Return to BSD News archive
Newsgroups: comp.unix.bsd Path: sserve!manuel!munnari.oz.au!uunet!zaphod.mps.ohio-state.edu!uunet.ca!cognos!dealwisb From: dealwisb@cognos.com (Brian de Alwis) Subject: Howto's for kern_execve.c, and some questions Message-ID: <1992Jul9.030820.20203@cognos.com> Summary: description of patch to kern_execve.c Organization: Cognos Incorporated, Ottawa CANADA Date: Thu, 9 Jul 1992 03:08:20 GMT Lines: 28 I was having some problems using xargs while using egrep, in that I was constantly getting a "Error 0: Undefined error" (or something to that effect). I gathered that is was due to an E2BIG that wasn't being passed back/being set. I took a peek at the kern_execve.c and came up with the following: There are a max of (kstringbuf-kargbuf)/sizeof(char *) command-line arguments and environment strings. In my version of the code, this was 448; if I tried a 'find /sys -print | wc -l', I'd get 668 args. The cure? Replace the 'NBPG/2's by 'NBPG'. This will give a max of 960 args/envs. Make sure this is done in the adjustment section (near the end of the code) as well. I also noticed that limitonargs is decreased by an additional sizeof(long). Why? Removing the sizeof(long) does no wrong (the system works). There are must be some bugs in Pace's ptrace patches, or a bug in the kernel. Whenever I use gdb, the next 'major' program I run will crash the system completely. Any ideas? Does anybody have any pointers to docs on the VFS interface? If so, please drop me a note. -- +++BdA Brian de Alwis. Brain on loan to Cognos Inc, Ottawa, Ontario. dealwisb@cognos.com, or bsdealwis@napier.waterloo.edu "Nine out of ten men who tried camels said they preferred women" My views do not necessarily represent those of Cognos or UofWaterloo