Subject: Re: CVS commit: src/sys/sys
To: None <dave@dtsp.co.nz>
From: M. Warner Losh <imp@bsdimp.com>
List: source-changes
Date: 01/04/2004 01:30:26
In message: <20040104070330.1849.qmail@mail.netbsd.org>
            Dave Sainty <dave@dtsp.co.nz> writes:
: Well, the given change was apparently for an application program.  For
: user-land programs I think it's hard enough to achieve compatibility
: between systems as it is, without imposing OUR particular header
: dependencies on the world and expecting application programmers to get
: them right.

Actually, it is documented in sysctl(3):

SYNOPSIS
     #include <sys/param.h>
     #include <sys/sysctl.h>

     int
     sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
         size_t newlen);

So the 'it is too hard' arugment isn't really a strong one.  The fact
that it might happen to work when you don't do things documented in
the man page is no less a bug as passing an uncast NULL to a varadic
function.  Sure, it might seem to work, but there are environements
where it won't work.

Since it is documented, as the first poster to this thread said, I
tend to agree that it should be backed out.

Warner