NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/53123: incomplete type kinfo_proc.



The following reply was made to PR lib/53123; it has been noted by GNATS.

From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: lib/53123: incomplete type kinfo_proc.
Date: Sat, 24 Mar 2018 07:43:22 -0000 (UTC)

 utkarsh009%yandex.com@localhost writes:
 
 >2. Compile it with clang (or gcc) to get the following error:
 >temp.c:5:8: error: invalid application of 'sizeof' to an incomplete type 'struct kinfo_proc'
 >printf(sizeof(struct kinfo_proc));
 
 
 The structure kinfo_proc is exposed only to kernel code and kmem users.
 E.g.:
 
 % cat c.c
 #define _KMEMUSER
 #include <stdio.h>
 #include <sys/sysctl.h>
 
 int main() {
     printf("%d\n",sizeof(struct kinfo_proc));
     return 0;
 }
 
 % cc c.c
 % ./a.out
 912
 
 
 -- 
 -- 
                                 Michael van Elst
 Internet: mlelstv%serpens.de@localhost
                                 "A potential Snark may lurk in every tree."
 


Home | Main Index | Thread Index | Old Index