Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Jun 1996 12:12:00 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, fcurrent@jraynard.demon.co.uk
Cc:        freebsd-current@FreeBSD.ORG, j@uriah.heep.sax.de, nate@sri.MT.net
Subject:   Re: ktrace [Was: 2.2-960612-SNAP resolver problems]
Message-ID:  <199606180212.MAA01297@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606180212.MAA01297>