Subject: Re: lsof and struct bufq_state
To: john heasley <>
From: Ron Roskens <>
List: current-users
Date: 09/11/2002 16:23:16
I don't know if its "proper" for a user util to define _KERNEL, but since
lsof is groveling around inside kernel space, it needs it more for all the
types to be defined.

Change dlsof.h so that the code around "include <sys/buf.h>" looks like this:

# if   defined(NETBSDV)
#  if  __NetBSD_Version__>=106050000
#define        _KERNEL
struct buf;    /* to satisfy a function prototype in buf.h */
#  endif
#include <sys/buf.h>
#  if  __NetBSD_Version__>=106050000
#undef _KERNEL
#  endif
# endif        /* defined(NETBSDV) */

On Wed, 11 Sep 2002, john heasley wrote:

> Date: Wed, 11 Sep 2002 21:13:30 +0000
> From: john heasley <>
> To:
> Subject: lsof and struct bufq_state
> from sources of yesterday, lsof build fails thusly
> In file included from ../dlsof.h:176,
>                  from ../lsof.h:172,
>                  from dvch.c:43:
> /usr/include/ufs/mfs/mfsnode.h:47: field `mfs_buflist' has incomplete type
> *** Error code 1
> because struct mfsnod has the member
>         struct  bufq_state mfs_buflist; /* list of I/O requests */
> defined in sys/buf.h and enclosed in _KERNEL.  is it proper to define
> _KERNEL in a user util to get to these definitions?