home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / sun / misc / 3316 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  1.1 KB

  1. Xref: sparky comp.sys.sun.misc:3316 comp.unix.ultrix:5863 comp.unix.bsd:2746
  2. Newsgroups: comp.sys.sun.misc,comp.unix.ultrix,comp.unix.bsd
  3. Path: sparky!uunet!kithrup!sef
  4. From: sef@kithrup.COM (Sean Eric Fagan)
  5. Subject: Re: Beware of fileno()
  6. Organization: Kithrup Enterprises, Ltd.
  7. Date: Fri, 24 Jul 1992 06:23:20 GMT
  8. Message-ID: <1992Jul24.062320.2170@kithrup.COM>
  9. Keywords: sunos, ultrix, stdio, fileno, lossage
  10. References: <14njaeINNvk@agate.berkeley.edu>
  11. Lines: 15
  12.  
  13. In article <14njaeINNvk@agate.berkeley.edu> stolcke@ICSI.Berkeley.EDU (Andreas Stolcke) writes:
  14. >This is because fileno() returns a char field in the FILE structure.
  15. >On systems like Sun where char is signed this results in a negative
  16. >integer file descriptor.  To prevent lossage, one has to use
  17. >
  18. >    (unsigned char)fileno(stream)
  19.  
  20. Current BSD sources have the _file element as a short.  Chris Torek
  21. anticipated your needs by several years 8-).
  22.  
  23. -- 
  24. Sean Eric Fagan  | "My psychiatrist says I have a messiah
  25. sef@kithrup.COM  |  complex.  But I forgive him."
  26. -----------------+              -- Jim Carrey
  27. Any opinions expressed are my own, and generally unpopular with others.
  28.