Subject: Re: Broken sysctl.h on fresh 1.6.1 install?
To: Christopher Schultz <christopher.d.schultz@comcast.net>
From: David Brownlee <abs@NetBSD.org>
List: port-cobalt
Date: 10/21/2004 15:32:48
 	sysctl(3) states

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

 	On NetBSD you need to include sys/param.h before sys/sysctl.h.

 	Arguably that could be fixed, but its currently working as
 	documented.

On Thu, 21 Oct 2004, Christopher Schultz wrote:

> All,
> I have recently done a fresh install of both NetBSD 1.6 and (afterwards) 
> NetBSD 1.6.1, and both installs had non-compilable sysctl.h header files.
>
> I noticed this while running 'configure' on Apache 2 sources direclty from 
> httpd.apache.org:
>
> -------------------------------------------------------------------------
> configure: WARNING: sys/sysctl.h: present but cannot be compiled
> configure: WARNING: sys/sysctl.h: check for missing prerequisite headers?
> configure: WARNING: sys/sysctl.h: proceeding with the preprocessor's result
> configure: WARNING:     ## ------------------------------------ ##
> configure: WARNING:     ## Report this to bug-autoconf@gnu.org. ##
> configure: WARNING:     ## ------------------------------------ ##
> -------------------------------------------------------------------------
>
> I wrote my own quickie C program and compiled it. Sure enough, sysctl.h does 
> not compile:
>
> -------------------------------------------------------------------------
> # cat test.c
> #include <sys/sysctl.h>
>
> int main(int argc, char *argv[])
> {
>    return 0;
> }
>
> cc test.c
> In file included from /usr/include/sys/sysctl.h:48,
>                 from test.c:1:
> /usr/include/sys/ucred.h:51: `NGROUPS' undeclared here (not in a function)
> /usr/include/sys/ucred.h:59: `NGROUPS' undeclared here (not in a function)
> In file included from /usr/include/machine/proc.h:3,
>                 from /usr/include/sys/proc.h:53,
>                 from /usr/include/sys/sysctl.h:49,
>                 from test.c:1:
> /usr/include/mips/proc.h:52: `UPAGES' undeclared here (not in a function)
> In file included from /usr/include/sys/proc.h:57,
>                 from /usr/include/sys/sysctl.h:49,
>                 from test.c:1:
> /usr/include/sys/signalvar.h:50: `NSIG' undeclared here (not in a function)
> /usr/include/sys/signalvar.h:60: parse error before `sigset_t'
> /usr/include/sys/signalvar.h:60: warning: no semicolon at end of struct or 
> union
> /usr/include/sys/signalvar.h:66: parse error before `ps_oldmask'
> /usr/include/sys/signalvar.h:66: warning: data definition has no type or 
> storage class
> /usr/include/sys/signalvar.h:71: parse error before `ps_sigmask'
> /usr/include/sys/signalvar.h:71: warning: data definition has no type or 
> storage class
> /usr/include/sys/signalvar.h:72: parse error before `ps_sigignore'
> /usr/include/sys/signalvar.h:72: warning: data definition has no type or 
> storage class
> /usr/include/sys/signalvar.h:73: parse error before `ps_sigcatch'
> /usr/include/sys/signalvar.h:73: warning: data definition has no type or 
> storage class
> In file included from /usr/include/sys/sysctl.h:49,
>                 from test.c:1:
> /usr/include/sys/proc.h:67: `MAXLOGNAME' undeclared here (not in a function)
> /usr/include/sys/proc.h:104: parse error before `int'
> /usr/include/sys/proc.h:226: field `p_sigctx' has incomplete type
> /usr/include/sys/proc.h:231: `MAXCOMLEN' undeclared here (not in a function)
> /usr/include/sys/proc.h:231: size of array `p_comm' has non-integer type
> In file included from test.c:1:
> /usr/include/sys/sysctl.h:294: `MAXLOGNAME' undeclared here (not in a 
> function)
> /usr/include/sys/signalvar.h:65: storage size of `ps_sigstk' isn't known
> -------------------------------------------------------------------------
>
> Assuming someone has fixed this at some point, what's the best way to fix or 
> upgrade my header files?
>
> Thanks,
> -chris
>

-- 
 		David/absolute       -- www.NetBSD.org: No hype required --