From: Wichert A. <wi...@us...> - 2001-08-03 21:51:49
|
Update of /cvsroot/strace/strace/linux In directory usw-pr-cvs1:/tmp/cvs-serv1146/linux Modified Files: ioctlent.h Log Message: Regenerated |
From: Wichert A. <wi...@us...> - 2001-10-26 05:20:38
|
Update of /cvsroot/strace/strace/linux In directory usw-pr-cvs1:/tmp/cvs-serv19225/linux Modified Files: ioctlent.h Log Message: regenerated ioctlent.h using current scripts so term ioctls are included |
From: John H. <jo...@ca...> - 2001-10-26 08:08:36
|
On UnixWare I can't rebuild ioctlent.sh because some #defines are inside #ifdef blocks: $ gmake /bin/sh ./ioctlent.sh /usr/include >ioctlent.c gcc -E ioctlent.c | sed 1,/xyzzy/d >ioctlent.raw gcc -Wall -DHAVE_CONFIG_H -I. -I.. -I. -g -c ./../ioctlsort.c In file included from ./../ioctlsort.c:44: ioctlent.raw:196: `V_SETPARMS' undeclared here (not in a function) ioctlent.raw:196: initializer element is not constant ioctlent.raw:196: (near initialization for `ioctlent[190].code') ... inside /usr/include/sys/vtoc.h we have: #ifdef MERGE386 /* Floppy driver ioctl() commands for MERGE386 */ #define V_SETPARMS (VIOC|128) /* Set floppy parameters */ ... This could be fixed either by adding a "-DMERGE386" to the cpp command in the Makefile, but how can we work out the list of -D's to add? Or by fixing ioctlent.sh to protect the lines in ioctlent.c with an #ifdef, i.e. something like: #ifdef ASY_GETSTATS { "sys/asyc.h", "ASY_GETSTATS", ASY_GETSTATS }, #endif #ifdef ASY_SETUARTMODE { "sys/asyc.h", "ASY_SETUARTMODE", ASY_SETUARTMODE }, #endif This would lose some rare ioctl's, but at least we could regenerate ioctlent.h. |
From: John H. <jo...@ca...> - 2001-10-26 08:23:05
|
> On UnixWare I can't rebuild ioctlent.sh because some #defines are inside > #ifdef blocks: Ah, is that what the "bad_defines" thing is for? bad_defines='cg[48]var\.h|READSLICE|I_E_RECVFD|FBIOGPIXRECT|JTIMO|TTYTYPE|TI OCCONS|TCL_LINK|TCL_UNLINK' Not a very pretty way of doing it. I still like my #ifdef trick. Any comments? |
From: Wichert A. <wi...@wi...> - 2001-10-27 13:23:41
|
Previously John Hughes wrote: > On UnixWare I can't rebuild ioctlent.sh because some #defines are inside > #ifdef blocks: Can you try to use the ioctlent.sh approach that Linux uses and see if that improves things? That uses sed to find the ioctls and does not rely on compiling a file that tries to include all possible kernel headers. Getting the regular expressions correctly is somewhat messy, but the end result is a lot more robust. Wichert. -- _________________________________________________________________ / Nothing is fool-proof to a sufficiently talented fool \ | wi...@wi... http://www.liacs.nl/~wichert/ | | 1024D/2FA3BC2D 576E 100B 518D 2F16 36B0 2805 3CB8 9250 2FA3 BC2D | |
From: John H. <jo...@ca...> - 2001-10-29 14:35:16
|
> Previously John Hughes wrote: > > On UnixWare I can't rebuild ioctlent.sh because some #defines are > > inside #ifdef blocks: > > Can you try to use the ioctlent.sh approach that Linux uses and > see if that improves things? Doesn't look like it'll work on SVR4, too many assumptions about how ioctl's are defined, where they'll be defined and so on. The existing script can be made to work with just a little tweak: --- ioctlent.sh Mon Oct 29 15:32:10 2001 +++ ioctlent.sh.new Mon Oct 29 15:33:46 2001 @@ -47,6 +47,7 @@ egrep -v "$bad_includes" echo xyzzy echo "struct ioctlent ioctlent[] = {" -egrep -v "$bad_defines" ioctlent.tmp +egrep -v "$bad_defines" ioctlent.tmp | +awk '{ print "#ifdef " $4; print $0; print "#endif" }' echo "};" rm -f ioctlent.tmp It might even be possible to get rid of "bad_defines/bad_includes", but I don't have other svr4 systems to test it on. |
From: John H. <jo...@ca...> - 2001-10-29 14:35:27
|
> Previously John Hughes wrote: > > On UnixWare I can't rebuild ioctlent.sh because some #defines are > > inside #ifdef blocks: > > Can you try to use the ioctlent.sh approach that Linux uses and > see if that improves things? Doesn't look like it'll work on SVR4, too many assumptions about how ioctl's are defined, where they'll be defined and so on. The existing script can be made to work with just a little tweak: --- ioctlent.sh Mon Oct 29 15:32:10 2001 +++ ioctlent.sh.new Mon Oct 29 15:33:46 2001 @@ -47,6 +47,7 @@ egrep -v "$bad_includes" echo xyzzy echo "struct ioctlent ioctlent[] = {" -egrep -v "$bad_defines" ioctlent.tmp +egrep -v "$bad_defines" ioctlent.tmp | +awk '{ print "#ifdef " $4; print $0; print "#endif" }' echo "};" rm -f ioctlent.tmp It might even be possible to get rid of "bad_defines/bad_includes", but I don't have other svr4 systems to test it on. |