Date: Mon, 17 Jun 1996 12:02:21 +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: <199606170202.MAA11393@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>The error message is not particularly informative, either:-
>ktrace -f foobar ls
>ktrace: Ù¿ïÙ¿ï"Ù¿ï)Ù¿ï: Function not implemented.
>but this at least can easily be fixed:-
>--- ktrace.c.orig Sun Jun 16 23:59:12 1996
>+++ ktrace.c Sun Jun 16 23:59:58 1996
>@@ -174,7 +174,10 @@
> error(name)
> char *name;
> {
>- (void)fprintf(stderr, "ktrace: %s: %s.\n", name, strerror(errno));
>+ if (errno == ENOSYS)
>+ noktrace();
>+ else
>+ (void)fprintf(stderr, "ktrace: %s: %s.\n", name, strerror(errno));
> exit(1);
> }
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.
Grepping for ENOSYS in /sys/kern shows the same bug in oquota() and ENOSYS
being confused with ENOTTY in pipe_ioctl().
Grepping for ENOSYS in /sys shows that ENOSYS otherwise used only in
(presumably unfinished parts of) the ibcs2 and linux emulators.
Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606170202.MAA11393>
