Re: whither struct __kvm?

2022-09-11 Thread Todd C . Miller
On Fri, 09 Sep 2022 20:22:38 -0700, "Lyndon Nerenberg (VE7TFX/VE6BBM)" wrote:

> The first declaration in  is:
>
>   typedef struct __kvm kvm_t;
>
> and yet 'grep -r __kvm /usr/include /sys' returns only the above
> line.  What am I missing?

It is an opaque type that is only passed as a pointer to libkvm.
The actual struct definition is in src/lib/libkvm/kvm_private.h but
the definition is intentionally not in the public headers.

 - todd



Re: whither struct __kvm?

2022-09-10 Thread Dave Voutila


"Lyndon Nerenberg (VE7TFX/VE6BBM)"  writes:

> The first declaration in  is:
>
>   typedef struct __kvm kvm_t;
>
> and yet 'grep -r __kvm /usr/include /sys' returns only the above
> line.  What am I missing?
>

Since you don't say what you're expecting to *see* I'm not sure how to
tell you what you aren't seeing. Let's assume you want to know about
where the struct comes from and what uses it...

man 3 kvm

Do you even have a source tree checked out to /usr/src? See
/usr/src/lib/libkvm.

-dv



Re: whither struct __kvm?

2022-09-09 Thread Theo de Raadt
>The first declaration in  is:
>
>  typedef struct __kvm kvm_t;
>
>and yet 'grep -r __kvm /usr/include /sys' returns only the above
>line.  What am I missing?

Uhm

./bin/ps/nlist.c:extern kvm_t *kd;
./bin/ps/print.c:extern kvm_t *kd;
./bin/ps/ps.c:kvm_t *kd;
etc etc etc etc

It is the published API.



whither struct __kvm?

2022-09-09 Thread Lyndon Nerenberg (VE7TFX/VE6BBM)
The first declaration in  is:

  typedef struct __kvm kvm_t;

and yet 'grep -r __kvm /usr/include /sys' returns only the above
line.  What am I missing?

--lyndon