Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!sgi!vjs@rhyolite.SGI.COM From: vjs@rhyolite.SGI.COM (Vernon Schryver) Newsgroups: comp.sys.sgi Subject: Re: include files again.. Summary: use -I/usr/include/{bsd,sun} Message-ID: <27268@sgi.SGI.COM> Date: 22 Feb 89 18:43:07 GMT References: <769@cs-spool.calgary.UUCP> Sender: daemon@sgi.SGI.COM Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 56 In article <769@cs-spool.calgary.UUCP>, paquette@cpsc.ucalgary.ca (Trevor Paquette) writes: > Ok I give up.. what is the secret to getting the rpc include > files to work on a Persona Iris? The secret is to use "-I/usr/include/bsd" if you want to compile "BSD" style code, and "-I/usr/include/sun" for code related to a company with solar connotations. This is documented in the manuals, although since many people miss it, not clearly enough. Since we ship "SV with 4.3BSD enhancements," one generally has to fiddle with at least the makefiles when porting BSD code. Remember that SGI has (since V-kernel days) shiped AT&T-style, SV UNIX. There are symantic as well as silly syntactic conflicts between SV and 4.xBSD. For that reason, we chose to put the BSD and Sun include files in their own directories. Similarly, there are /usr/lib/libbsd.a and /usr/lib/libsun.a libraries. Over time, many things from libbsd.a and /usr/include/bsd have crept into /usr/include and libc.a. However, there is only so far that we can go without breaking SVID--at least until the millenium arrives with SVR4. One of the most egregious conflicts is with what you want when you use 'seekdir(3)' and friends. > A SYNTAX ERROR??? in an INCLUDE FILE????? what gives? What is 'fd_set'??? > taking a closer look at the include file this is what those lines > look like.. If you use "-I/usr/include/bsd", then when you "#include ", you will get the 4.3BSD select(2) definitions. > #ifndef KERNEL > /* dynamic; must be inspected before each call to select */ > #ifdef sgi > 209>extern fd_set svc_fds; > #else > extern int svc_fds; ^^^ > #endif The "int" is the bug--at least with 4.3BSD. To make it easier to track the ever changing NFS code (which changes just like ours and everyone else's), we use lots of ifdef's. In 4.3BSD, using an 'int' for select(2) is a No-No. Imagine if you happen to get file descriptor 33, not to mention 99. The use of int's for select(2) was a botch in 4.2BSD which was fixed in 4.3BSD. Remember that SunOS 3.* was based on 4.2 BSD, while SGI uses 4.3BSD. > > So I try 'cc -o t -Usgi t.c' seems to to futher this time.. In fact > it compiles just fine.. Yes, but it may not work. Vernon Schryver Silicon Graphics vjs@sgi.com