Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rlgvax.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!rlgvax!guy From: guy@rlgvax.UUCP (Guy Harris) Newsgroups: net.unix-wizards Subject: Re: select query Message-ID: <404@rlgvax.UUCP> Date: Tue, 29-Jan-85 20:08:57 EST Article-I.D.: rlgvax.404 Posted: Tue Jan 29 20:08:57 1985 Date-Received: Sun, 3-Feb-85 00:16:34 EST References: <7834@brl-tgr.ARPA> Organization: CCI Office Systems Group, Reston, VA Lines: 36 Xref: seismo net.unix-wizards:11715 > boolean io_haschar(infile) > FILE *infile; > ... > readfds = (1< > nfound = select(1, &readfds, 0, 0, &timeout); > > if (nfound == 0) > return(FALSE); "fileno(infile)" must be zero for this to work. I don't have the original 4.2BSD or ULTRIX-32 documentation, so it may be ambiguous on this point, but my 4.2BSD manual says: "Nfds" descriptors are checked, i.e. the bits from 0 through "nfds"-1 in the masks are examined. I.e., "nfds" (the first argument to "select") is not the number of one bits in all the masks (which is 1 in this case), but the highest bit to be examined plus one (i.e., 32 is probably a nice number, as it's greater than the 20 that is usually the size of a descriptor table, and is also the number of bits in an "int" on machines that are 1) reasonable and 2) can support 4.2BSD). > We are running Ultrix-32, and note the following disclaimer in the > documentation for select(2). > > STATUS > SELECT(2) currently is not supported by Digital Equipment > Corporation. *THAT'S* amusing. I'd be curious to see what they do, and don't, support; a HECK of a lot of networking code uses "select". Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy