Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!ibmpa!bass.tcspa.ibm.com!webb From: webb@bass.tcspa.ibm.com (Bill Webb) Newsgroups: comp.unix.wizards Subject: Re: What new system calls do you want in BSD? Message-ID: <4057@ibmpa.UUCP> Date: 14 Feb 90 20:07:31 GMT References: <12157@stealth.acf.nyu.edu> Sender: news@ibmpa.UUCP Followup-To: uunet!ibmsupt!webb Distribution: usa Organization: IBM AWD Paloalto Lines: 37 > I'm asking about calls that don't require lots of code or fundamental > changes in the system; that provide a useful service unavailable with > current system calls; that, hopefully, simplify other calls; that don't > hurt security; that don't hurt anything if they're not used. How about a system call to indicate either the maximum number of file descriptors allocated, or better still, a bit-map of allocated e.g. nfound = getfds(nfds, fds); int nfound, nfds; fd_set *fds; The parameters are similar to those of select(2), except that bits are set for any valid file descriptors in the range 0...(nfds-1). It might be useful to specify two fd_set parameters, e.g. nfound = getfds(nfds, readfds, writefds); int nfound, nfds; fd_set *readfds, *writefds; where "readfds" returns bits for file descriptors opened for reading, "writefds" returns bits for file descriptors open for writing, and bits are set in both for file descriptors open for read/writing. These calls would mostly be useful to programs (such as shells) that have to manage file descriptors and either don't want to clobber existing file descriptors, or want to know what file descriptors to close in certain circumstances. This is particularly important now that the number of file descriptors allowed is significantly increased in some Unix implementations. This call should nicely complement 'getdtablesize' which tells you how many bits you will need to hold the resulting information. ---------------------------------------------------------------- The above views are my own, not those of my employer. Bill Webb (IBM AWD Palo Alto), (415) 855-4457. UUCP: ...!uunet!ibmsupt!webb