ioctl problem in A/UX 2.0
Ronald P. Hughes
ron at xwind.UUCP
Sun Mar 10 03:11:09 AEST 1991
In article <2041 at public.BTR.COM> pke at public.BTR.COM (Peter Espen pke at 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 at xwind.com (or ...!uunet!xwind!ron)
CrossWind Technologies, Inc. 408-335-4988
"The fastest-growing software company in Felton!"
More information about the Comp.unix.aux
mailing list