home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / linux / 16021 < prev    next >
Encoding:
Text File  |  1992-11-08  |  1.2 KB  |  36 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!think.com!spool.mu.edu!uwm.edu!daffy!spock.cs.wisc.edu!quale
  3. From: quale@spock.cs.wisc.edu (Doug Quale)
  4. Subject: definition of fd_set is a trouble spot
  5. Message-ID: <1992Nov8.073130.25220@daffy.cs.wisc.edu>
  6. Sender: news@daffy.cs.wisc.edu (The News)
  7. Organization: Undergraduate Projects Lab, UW-Madison
  8. Date: Sun, 8 Nov 1992 07:31:30 GMT
  9. Lines: 25
  10.  
  11. The definition of fd_set in <linux/types.h> is a bit of a trouble spot.
  12. BSD makes fd_set an integer array to allow more open files/process than
  13. bits/word.  Linux allows only 32 open files/process, so fd_set is made
  14. an unsigned long.
  15.  
  16. If I haven't bored you to death and you're with me this far, the problem
  17. is that some programs expect fd_set to be an array, not a scalar.  For
  18. example, BSD rshd.c has the code sequence
  19.  
  20.     fd_set ready, readfrom;
  21.  
  22.     ...
  23.  
  24.     ready = readfrom;
  25.  
  26. The intent is that ready be an alias for readfrom, but this won't work
  27. if fd_set is a scalar as in Linux.  (BSD documents fd_set as an array
  28. in the man pages, so I would say that this coding is legitimate.)
  29.  
  30. If it's not too late, we should kill two birds with one stone and make
  31. fd_set an array.  This would also permit more than 32 open files/process.
  32.  
  33. -- 
  34. Doug Quale
  35. quale@saavik.cs.wisc.edu
  36.