Path: utzoo!attcan!uunet!peregrine!elroy!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!BELLCORE.BELLCORE.COM!dana From: dana@BELLCORE.BELLCORE.COM ("Dana A. Chee") Newsgroups: comp.windows.x Subject: Portability Message-ID: <8808240628.AA12711@kth.se> Date: 23 Aug 88 13:14:57 GMT Sender: daemon@bloom-beacon.MIT.EDU Reply-To: xpert@athena.mit.edu Organization: The Internet Lines: 46 In article <15419@shemp.CS.UCLA.EDU> casey@admin.cognet.ucla.edu (Casey Leedom) writes: In article dana@dino.bellcore.com (Dana A. Chee) writes: > > readfiles = (1 << yourSocket) | (1 << Xfd ); > n = select(32, &readfiles, 0, 0, 0); > > if( readfiles & (1 << Xfd) ) > ... Just being picky here. But if you're not going to use the fd_set stuff from , you should at least get the types you are using right. The above should read: readfiles = (1L << yourSocket) | (1L << Xfd ); n = select(32, &readfiles, (long *)0, (long *)0, (struct timeval *)0); if( readfiles & (1L << Xfd) ) Casey Ah yes, portability. After receiving your news item about something called fd_set, I went hunting for it. There seems to be a complete FD_SET, FD_ISSET, etc. under Ultrix, but no such functions on a Sun (3.5). Also, the definition of select on both the Sun and the Ultrix machines is: select(int ncnt, int *read, int *write, int *execp, struct timeval *time); So the values are to be pointers to ints, not pointers to longs. So much for portability. Enjoy! -- +*************************************************************************+ * Dana Chee (201) 829-4488 * * Bellcore * * Room 2Q-250 * * 445 South Street ARPA: dana@bellcore.com * * Morristown, NJ 07960-1910 UUCP: {gateways}!bellcore!dana * +*************************************************************************+