Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!uunet!xwind!ron From: ron@xwind.UUCP (Ronald P. Hughes) Newsgroups: comp.unix.aux Subject: Re: ioctl problem in A/UX 2.0 Keywords: AUX, 2.0, ioctl, help Message-ID: <402@xwind.UUCP> Date: 9 Mar 91 17:11:09 GMT References: <2041@public.BTR.COM> Reply-To: ron@xwind.UUCP (Ronald P. Hughes) Distribution: usa Organization: CrossWind Technologies, Inc., 6630 Highway 9, Suite 201, Felton, Ca. 95018 Lines: 33 In article <2041@public.BTR.COM> pke@public.BTR.COM (Peter Espen pke@btr.com) writes: > >Can someone explain to me why the first ioctl call in the following test >program fails with an invalid argument error? > This is just a wild guess, but are you using gcc? And, if so, did you run fixincludes? If you are running gcc and the file /usr/local/lib/gcc-include/sys/ioctl.h doesn't exist (I suppose your gcc could have been built to expect it elsewhere, but that's the most common location), then you haven't run fixincludes. Fixincludes is a shell script that copies all the standard include hierarchy from /usr/include to /usr/local/lib/gcc-include, makes whatever changes to the .h files contained therein to make them ansi compliant, then deletes whatever hasn't been modified. Gcc looks in /usr/local/lib/gcc-include before /usr/include. If this is your problem, then you either need to run fixincludes (I can email it to you if you like), or use the -traditional flag to gcc. The source of the problem? Consider the following macro definition: #define GRAUNCH(x,y,z) foobar('x' | ((y) << 8) + (z)) Is the 'x' (the one in single quotes) expanded as a macro arg, or is it a literal? What should it's behavior be? Check the ansi spec. Then examine /usr/include/sys/ioctl.h. You'll be amazed. Ronald P. Hughes ron@xwind.com (or ...!uunet!xwind!ron) CrossWind Technologies, Inc. 408-335-4988 "The fastest-growing software company in Felton!"