Xenix sys/select.h for System V?
Brandon S. Allbery KB8JRR
allbery at NCoast.ORG
Wed Feb 6 15:24:54 AEST 1991
As quoted from <1991Jan31.224424.27733 at jwt.UUCP> by john at 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 <sys/param.h>
#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 at 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
More information about the Comp.unix.sysv386
mailing list