--- dmnt.o --- In file included from dmnt.c:36: In file included from lib/common.h:253: In file included from ./dlsof.h:171: In file included from /usr/src/sys/rpc/rpc.h:68: /usr/src/sys/rpc/svc.h:341:25: error: field has incomplete type 'struct sysctl_ctx_list' 341 | struct sysctl_ctx_list sp_sysctl; | ^ --- dnode.o --- In file included from dnode.c:36: In file included from lib/common.h:253: In file included from ./dlsof.h:171: In file included from /usr/src/sys/rpc/rpc.h:68: /usr/src/sys/rpc/svc.h:341:25: error: field has incomplete type 'struct sysctl_ctx_list' 341 | struct sysctl_ctx_list sp_sysctl; | ^ --- lib/liblsof.a --- In file included from ckkv.c:31: In file included from ./common.h:253: In file included from ../dlsof.h:171: In file included from /usr/src/sys/rpc/rpc.h:68: --- dproc.o --- In file included from dproc.c:36: In file included from lib/common.h:253: In file included from ./dlsof.h:171: In file included from /usr/src/sys/rpc/rpc.h:68: /usr/src/sys/rpc/svc.h:341:25: error: field has incomplete type 'struct sysctl_ctx_list' 341 | struct sysctl_ctx_list sp_sysctl; | ^ --- lib/liblsof.a --- /usr/src/sys/rpc/svc.h:341:25: error: field has incomplete type 'struct sysctl_ctx_list' --- dnode.o --- /usr/src/sys/rpc/svc.h:341:9: note: forward declaration of 'struct sysctl_ctx_list' --- dproc.o --- /usr/src/sys/rpc/svc.h:341:9: note: forward declaration of 'struct sysctl_ctx_list' 341 | struct sysctl_ctx_list sp_sysctl; | ^ --- dnode.o --- 341 | struct sysctl_ctx_list sp_sysctl; | ^ --- dmnt.o --- /usr/src/sys/rpc/svc.h:341:9: note: forward declaration of 'struct sysctl_ctx_list' --- lib/liblsof.a --- 341 | struct sysctl_ctx_list sp_sysctl; --- dmnt.o --- 341 | struct sysctl_ctx_list sp_sysctl; | ^ --- lib/liblsof.a --- | ^ /usr/src/sys/rpc/svc.h:341:9: note: forward declaration of 'struct sysctl_ctx_list' 341 | struct sysctl_ctx_list sp_sysctl; | ^ --- dnode.o --- /usr/src/sys/rpc/svc.h:568:12: warning: declaration of 'struct sysctl_oid_list' will not be visible outside of this function [-Wvisibility] 568 | struct sysctl_oid_list *sysctl_base); | ^ --- lib/liblsof.a --- /usr/src/sys/rpc/svc.h:568:12: warning: declaration of 'struct sysctl_oid_list' will not be visible outside of this function [-Wvisibility] 568 | struct sysctl_oid_list *sysctl_base); | ^ --- dmnt.o --- /usr/src/sys/rpc/svc.h:568:12: warning: declaration of 'struct sysctl_oid_list' will not be visible outside of this function [-Wvisibility] 568 | struct sysctl_oid_list *sysctl_base); | ^ --- dproc.o --- /usr/src/sys/rpc/svc.h:568:12: warning: declaration of 'struct sysctl_oid_list' will not be visible outside of this function [-Wvisibility] 568 | struct sysctl_oid_list *sysctl_base); | ^ --- dmnt.o --- 1 warning and 1 error generated. *** [dmnt.o] Error code 1 make: stopped making "all" in /wrkdirs/usr/ports/sysutils/lsof/work/lsof-4.99.4 --- lib/liblsof.a --- *** [lib/liblsof.a] Error code 6 make: stopped making "all" in /wrkdirs/usr/ports/sysutils/lsof/work/lsof-4.99.4 --- dproc.o --- 1 warning and 1 error generated. --- dnode.o --- 1 warning and 1 error generated. --- dproc.o --- *** [dproc.o] Error code 1 make: stopped making "all" in /wrkdirs/usr/ports/sysutils/lsof/work/lsof-4.99.4 --- dnode.o --- *** [dnode.o] Error code 1 make: stopped making "all" in /wrkdirs/usr/ports/sysutils/lsof/work/lsof-4.99.4 make: 4 errors make: stopped making "all" in /wrkdirs/usr/ports/sysutils/lsof/work/lsof-4.99.4 ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Stop. make: stopped making "build" in /usr/ports/sysutils/lsof =>> Cleaning up wrkdir ===> Cleaning for lsof-4.99.4_1,8
*** This bug has been marked as a duplicate of bug 284004 ***
Created attachment 256646 [details] patch to dlsof.h This patch fixes the initial problem. But, causes src/print.c some gas as it no longer sees the definition to clnt_create(). I suppose we could define a flag to not define _KERNEL prior to including common.h, but this would be a hack.
even with your patch: --- cvfs.o --- cc -idirafter /usr/src -pipe -fstack-protector-strong -fno-strict-aliasing -DNEEDS_BOOL_TYPEDEF -DHASTASKS -DHAS_DUP2 -DHAS_CLOSEFROM -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_VM_MEMATTR_T -DNEEDS_DEVICE_T -DHAS_CDEV2PRIV -DHAS_SYS_SX_H -DHASMSDOSFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DHAS_SB_CCC -DFREEBSDV=15000 -DHASFDESCFS=2 -DHASPROCFS -DHASPSEUDOFS -DHASNULLFS -DHAS9660FS -DHASIPv6 -DHASUTMPX -DHAS_XTCPCB_TMAXSEG -DHAS_KF_SOCK_SENDQ -DHAS_KF_FILE_NLINK -DHAS_STRFTIME -DLSOF_VSTR="15.0-CURRENT" -I/usr/src/sys -I.. -I../include -Idialects/freebsd -O2 -c cvfs.c -o cvfs.o --- dsock.o --- dsock.c:132:9: warning: call to undeclared function 'sysctlbyname'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] --- dproc.o --- dproc.c:71:10: warning: call to undeclared function 'sysctl'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 71 | if (!sysctl(mib, 2, NULL, &len, NULL, 0)) { | ^ dproc.c:121:10: warning: call to undeclared function 'sysctl'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 121 | if (!sysctl(mib, 2, NULL, &len, NULL, 0)) { | ^ dproc.c:392:9: warning: call to undeclared function 'sysctl'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 392 | if (sysctl(mib, 3, NULL, &len, NULL, 0) == 0) { | ^ --- dsock.o --- 132 | if (sysctlbyname(name, NULL, &len, NULL, 0)) | ^ dsock.c:164:9: warning: call to undeclared function 'sysctlbyname'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 164 | if (sysctlbyname("net.inet.tcp.pcblist", NULL, &len, NULL, 0)) | ^ dsock.c:196:9: warning: call to undeclared function 'sysctlbyname'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 196 | if (sysctlbyname("net.inet.udp.pcblist", NULL, &len, NULL, 0)) | ^ --- main.o --- main.c:1305:39: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat] 1304 | (void)fprintf(stderr, "%s: no space for %d sort pointers\n", | ~~ | %zu 1305 | Pn, Nlproc); | ^~~~~~ lib/common.h:1357:20: note: expanded from macro 'Nlproc' 1357 | # define Nlproc (ctx->procs_size) | ^~~~~~~~~~~~~~~~~ --- print.o --- print.c:181:15: warning: call to undeclared function 'clnt_create'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 181 | if (!(c = clnt_create("localhost", PMAPPROG, PMAPVERS, "tcp"))) | ^ print.c:181:13: error: incompatible integer to pointer conversion assigning to 'CLIENT *' (aka 'struct __rpc_client *') from 'int' [-Wint-conversion] 181 | if (!(c = clnt_create("localhost", PMAPPROG, PMAPVERS, "tcp"))) | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- lib/liblsof.a --- --- dvch.o --- cc -idirafter /usr/src -pipe -fstack-protector-strong -fno-strict-aliasing -DNEEDS_BOOL_TYPEDEF -DHASTASKS -DHAS_DUP2 -DHAS_CLOSEFROM -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_VM_MEMATTR_T -DNEEDS_DEVICE_T -DHAS_CDEV2PRIV -DHAS_SYS_SX_H -DHASMSDOSFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DHAS_SB_CCC -DFREEBSDV=15000 -DHASFDESCFS=2 -DHASPROCFS -DHASPSEUDOFS -DHASNULLFS -DHAS9660FS -DHASIPv6 -DHASUTMPX -DHAS_XTCPCB_TMAXSEG -DHAS_KF_SOCK_SENDQ -DHAS_KF_FILE_NLINK -DHAS_STRFTIME -DLSOF_VSTR="15.0-CURRENT" -I/usr/src/sys -I.. -I../include -Idialects/freebsd -O2 -c dvch.c -o dvch.o --- util.o --- --- lib/liblsof.a --- --- fino.o --- --- util.o --- cc -idirafter /usr/src -pipe -fstack-protector-strong -fno-strict-aliasing -DNEEDS_BOOL_TYPEDEF -DHASTASKS -DHAS_DUP2 -DHAS_CLOSEFROM -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_VM_MEMATTR_T -DNEEDS_DEVICE_T -DHAS_CDEV2PRIV -DHAS_SYS_SX_H -DHASMSDOSFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DHAS_SB_CCC -DFREEBSDV=15000 -DHASFDESCFS=2 -DHASPROCFS -DHASPSEUDOFS -DHASNULLFS -DHAS9660FS -DHASIPv6 -DHASUTMPX -DHAS_XTCPCB_TMAXSEG -DHAS_KF_SOCK_SENDQ -DHAS_KF_FILE_NLINK -DHAS_STRFTIME -DLSOF_VSTR=\"15.0-CURRENT\" -I/usr/src/sys -Iinclude -Ilib -Isrc -I. -O2 -c util.c -o util.o --- lib/liblsof.a --- cc -idirafter /usr/src -pipe -fstack-protector-strong -fno-strict-aliasing -DNEEDS_BOOL_TYPEDEF -DHASTASKS -DHAS_DUP2 -DHAS_CLOSEFROM -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_VM_MEMATTR_T -DNEEDS_DEVICE_T -DHAS_CDEV2PRIV -DHAS_SYS_SX_H -DHASMSDOSFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DHAS_SB_CCC -DFREEBSDV=15000 -DHASFDESCFS=2 -DHASPROCFS -DHASPSEUDOFS -DHASNULLFS -DHAS9660FS -DHASIPv6 -DHASUTMPX -DHAS_XTCPCB_TMAXSEG -DHAS_KF_SOCK_SENDQ -DHAS_KF_FILE_NLINK -DHAS_STRFTIME -DLSOF_VSTR="15.0-CURRENT" -I/usr/src/sys -I.. -I../include -Idialects/freebsd -O2 -c fino.c -o fino.o --- usage.o --- cc -idirafter /usr/src -pipe -fstack-protector-strong -fno-strict-aliasing -DNEEDS_BOOL_TYPEDEF -DHASTASKS -DHAS_DUP2 -DHAS_CLOSEFROM -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_VM_MEMATTR_T -DNEEDS_DEVICE_T -DHAS_CDEV2PRIV -DHAS_SYS_SX_H -DHASMSDOSFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DHAS_SB_CCC -DFREEBSDV=15000 -DHASFDESCFS=2 -DHASPROCFS -DHASPSEUDOFS -DHASNULLFS -DHAS9660FS -DHASIPv6 -DHASUTMPX -DHAS_XTCPCB_TMAXSEG -DHAS_KF_SOCK_SENDQ -DHAS_KF_FILE_NLINK -DHAS_STRFTIME -DLSOF_VSTR=\"15.0-CURRENT\" -I/usr/src/sys -Iinclude -Ilib -Isrc -I. -O2 -c usage.c -o usage.o --- lib/liblsof.a --- --- isfn.o --- cc -idirafter /usr/src -pipe -fstack-protector-strong -fno-strict-aliasing -DNEEDS_BOOL_TYPEDEF -DHASTASKS -DHAS_DUP2 -DHAS_CLOSEFROM -DHASEFFNLINK=i_effnlink -DHASF_VNODE -DHAS_FILEDESCENT -DHAS_TMPFS -DHASWCTYPE_H -DHASSBSTATE -DHAS_KVM_VNODE -DHAS_UFS1_2 -DHAS_VM_MEMATTR_T -DNEEDS_DEVICE_T -DHAS_CDEV2PRIV -DHAS_SYS_SX_H -DHASMSDOSFS -DHAS_V_LOCKF -DHAS_LOCKF_ENTRY -DHAS_NO_6PORT -DHAS_NO_6PPCB -DNEEDS_BOOLEAN_T -DHAS_SB_CCC -DFREEBSDV=15000 -DHASFDESCFS=2 -DHASPROCFS -DHASPSEUDOFS -DHASNULLFS -DHAS9660FS -DHASIPv6 -DHASUTMPX -DHAS_XTCPCB_TMAXSEG -DHAS_KF_SOCK_SENDQ -DHAS_KF_FILE_NLINK -DHAS_STRFTIME -DLSOF_VSTR="15.0-CURRENT" -I/usr/src/sys -I.. -I../include -Idialects/freebsd -O2 -c isfn.c -o isfn.o --- print.o --- 1 warning and 1 error generated. *** [print.o] Error code 1 make: stopped making "all" in /usr/ports/sysutils/lsof/work/lsof-4.99.4 --- lib/liblsof.a --- *** [lib/liblsof.a] Error code 6 make: stopped making "all" in /usr/ports/sysutils/lsof/work/lsof-4.99.4 --- dsock.o --- 3 warnings generated. --- dproc.o --- 3 warnings generated. --- usage.o --- usage.c:224:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype] 224 | static void report_HASKERNIDCK(pfx, verb) char *pfx; /* prefix (NULL if none) */ | ^ usage.c:243:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype] 243 | static void report_SECURITY(pfx, punct) char *pfx; /* prefix (NULL if none) */ | ^ usage.c:267:13: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype] 267 | static void report_WARNDEVACCESS(pfx, verb, | ^ 3 warnings generated. --- main.o --- 1 warning generated. make: 2 errors make: stopped making "all" in /usr/ports/sysutils/lsof/work/lsof-4.99.4 ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Stop. make: stopped making "all" in /usr/ports/sysutils/lsof ler in ๐ ryzen-box in ports/sysutils/lsof๐ on ๎ main โฏ
(In reply to Larry Rosenman from comment #3) Re-read my comment. Let me put it here again: This patch fixes the initial problem. But, causes src/print.c some gas as it no longer sees the definition to clnt_create(). I suppose we could define a flag to not define _KERNEL prior to including common.h, but this would be a hack.
OIC -- sorry for the noise. :(