From owner-freebsd-current Mon Jun 17 19:17:47 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id TAA17864 for current-outgoing; Mon, 17 Jun 1996 19:17:47 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id TAA17850 for ; Mon, 17 Jun 1996 19:17:42 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id MAA01297; Tue, 18 Jun 1996 12:12:00 +1000 Date: Tue, 18 Jun 1996 12:12:00 +1000 From: Bruce Evans Message-Id: <199606180212.MAA01297@godzilla.zeta.org.au> To: bde@zeta.org.au, fcurrent@jraynard.demon.co.uk Subject: Re: ktrace [Was: 2.2-960612-SNAP resolver problems] Cc: freebsd-current@FreeBSD.ORG, j@uriah.heep.sax.de, nate@sri.MT.net Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >ktrace: U?iU?i"U?i)U?i: Function not implemented. >In fact, this is caused by error() being invoked without any arguments. >NetBSD's ktrace implementation does this much more cleanly, using err() >and warn(). Any objections if I make the necessary modifications? Yes, these modifications should be made by mergeing with 4.4Lite2. Always look at Lite2 for cosmetic changes before adding them yourself. 4.4Lite2 also added a lot of function prototypes and ANSIFications (index -> strchr etc.). >> Why doesn't it get a SIGSYS? Answer: someone "fixed" the ktrace syscall to >> always exist and return ENOSYS if KTRACE is not configured. This breaks the >> usual handling of unimplemented syscalls, which is to generate SIGSYS and >> return EINVAL. >Thanks, I was wondering about that. Presumably this can be "un-fixed" >in the obvious way (ie shuffling some #ifdef/#endif's around)? No, the the obvious fix of restoring `#ifdef KTRACE' to init_sysent.c doesn't work because KTRACE is surely not defined because it is defined in opt_ktrace.h which isn't included by init_sysent.c. It's too much trouble to support options files in makesyscalls.sh. The correct fix seems to be `return (enosys(...));' instead of `return ENOSYS;'. >> Grepping for ENOSYS in /sys/kern shows the same bug in oquota() and ENOSYS >> being confused with ENOTTY in pipe_ioctl(). oquota() is probably similar, and pipe_ioctl() just needs a substitution. Lots of ioctl routines need need a similar substitution of EINVAL with ENOTTY. Bruce