home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!think.com!spool.mu.edu!uwm.edu!daffy!spock.cs.wisc.edu!quale
- From: quale@spock.cs.wisc.edu (Doug Quale)
- Subject: definition of fd_set is a trouble spot
- Message-ID: <1992Nov8.073130.25220@daffy.cs.wisc.edu>
- Sender: news@daffy.cs.wisc.edu (The News)
- Organization: Undergraduate Projects Lab, UW-Madison
- Date: Sun, 8 Nov 1992 07:31:30 GMT
- Lines: 25
-
- The definition of fd_set in <linux/types.h> is a bit of a trouble spot.
- BSD makes fd_set an integer array to allow more open files/process than
- bits/word. Linux allows only 32 open files/process, so fd_set is made
- an unsigned long.
-
- If I haven't bored you to death and you're with me this far, the problem
- is that some programs expect fd_set to be an array, not a scalar. For
- example, BSD rshd.c has the code sequence
-
- fd_set ready, readfrom;
-
- ...
-
- ready = readfrom;
-
- The intent is that ready be an alias for readfrom, but this won't work
- if fd_set is a scalar as in Linux. (BSD documents fd_set as an array
- in the man pages, so I would say that this coding is legitimate.)
-
- If it's not too late, we should kill two birds with one stone and make
- fd_set an array. This would also permit more than 32 open files/process.
-
- --
- Doug Quale
- quale@saavik.cs.wisc.edu
-