Re: Call for Foundation-supported Project Ideas: lsof

From: Stefan Esser <se_at_freebsd.org>
Date: Sat, 27 Nov 2021 21:55:06 UTC
Am 27.11.21 um 09:34 schrieb Graham Perrin:
> On 25/11/2021 00:01, Larry Rosenman wrote:
>> 𠉧… Back to the topic:
>> Can I PLEASE get some help on sysutils/lsof (which has been broken for all of
>> 13 and 14's lifetime)?
>> If I can't, I'm going to rmport it. …
> 
> 
> Is that, more than anything,
> <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253553> for compatibility
> with (OpenZFS) ZFS?

I have develioped a patch that supports the openzfs file layout, but did
not get lsof to build with OpenZFS headers. There are a number of type
conflicts and did not have any spare time to sort them out ...


A TAR file of the lsof port directory with some of the required patches
is available from:

	https://people.freebsd.org/~se/ports/lsof-port.tar.bz2

Some of the changes are experimental and not to be included in a final
version of the port. I first wanted to get the port to compile, then work
out the correct way to pass required options etc.


It still fails while compiling dnode2.c:

In file included from dnode2.c:45:
In file included from
/usr/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/types.h:36:
In file included from
/usr/src/sys/contrib/openzfs/lib/libspl/include/sys/types.h:75:
In file included from
/usr/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/param.h:34:
In file included from /usr/include/sys/param.h:142:
/usr/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/time.h:53:9: error:
unknown type name 'longlong_t'
typedef longlong_t      hrtime_t;
        ^
/usr/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/time.h:67:1: error:
redefinition of 'gethrtime'
gethrtime(void)
^
/usr/src/sys/contrib/openzfs/lib/libspl/include/sys/time.h:100:1: note:
previous definition is here
gethrtime(void)
^
In file included from dnode2.c:45:
In file included from
/usr/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/types.h:36:
In file included from
/usr/src/sys/contrib/openzfs/lib/libspl/include/sys/types.h:75:
In file included from
/usr/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/param.h:38:
In file included from
/usr/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/systm.h:33:
In file included from /usr/include/sys/systm.h:179:
/usr/include/sys/kpilite.h:33:10: fatal error: 'offset.inc' file not found
#include "offset.inc"
         ^~~~~~~~~~~~
3 errors generated.
*** Error code 1

Regards, STefan