Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!killer!tness7!bellcore!dana From: dana@dino.bellcore.com (Dana A. Chee) Newsgroups: comp.windows.x Subject: Portability Message-ID: Date: 23 Aug 88 13:14:57 GMT References: <80100001@convex> <15419@shemp.CS.UCLA.EDU> Sender: news@bellcore.bellcore.com Organization: Bellcore, Morristown, NJ USA Lines: 44 In-reply-to: casey@admin.cognet.ucla.edu's message of 23 Aug 88 00:58:55 GMT 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 * +*************************************************************************+