Xref: utzoo comp.unix.xenix.sco:1618 comp.unix.sysv386:4621 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!shelby!agate!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KB8JRR) Newsgroups: comp.unix.xenix.sco,comp.unix.sysv386 Subject: Re: Xenix sys/select.h for System V? Message-ID: <1991Feb6.042454.6930@NCoast.ORG> Date: 6 Feb 91 04:24:54 GMT References: <1991Jan31.224424.27733@jwt.UUCP> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KB8JRR) Followup-To: comp.unix.xenix.sco Organization: North Coast Public Access Un*x (ncoast) Lines: 38 As quoted from <1991Jan31.224424.27733@jwt.UUCP> by john@jwt.UUCP (John Temples): +--------------- | macros I assume are in it: FD_SETSIZE, FD_ISSET, FD_SET, FD_CLR, and | FD_ZERO. There's also a missing typedef for "fd_set". Has anyone | already ported this program to System V, or can you point me to a | System V equivalent for these Xenix functions? +--------------- They came from 4.3BSD, and as such are publicly available e.g. on uunet. But here's a simplistic version that will serve: #include #ifndef NBPL #define NBPL (sizeof (long) * 8) #endif #define FD_SETSIZE NOFILE typedef long fd_set[(FD_SETSIZE + NBPL - 1) / NBPL]; #define FD_SET(fd,p) ((p)[(fd) / NBPL] |= (1 << ((fd) % NBPL))) #define FD_CLR(fd,p) ((p)[(fd) / NBPL] &= ~(1 << ((fd) % NBPL))) #define FD_ISSET(fd,p) ((p)[(fd) / NBPL] & (1 << ((fd) % NBPL))) (Note: these are not necessarily the fastest way to do it.) BTW: they may be defined somewhere else on the system. But if they aren't, chances are the compile will eventually fail with a missing symbol "select". If so, you may be able to use poll (look for poll(S) or poll(2), depending on whether the manuals have been screwed with or not); it doesn't use these macros, but you may be able to write a select() based on poll(). If not, you're out of luck. Not all System Vs have networking built in. ++Brandon -- Me: Brandon S. Allbery VHF/UHF: KB8JRR on 220, 2m, 440 Internet: allbery@NCoast.ORG Packet: KB8JRR @ WA8BXN America OnLine: KB8JRR AMPR: KB8JRR.AmPR.ORG [44.70.4.88] uunet!usenet.ins.cwru.edu!ncoast!allbery Delphi: ALLBERY