On Thu, Mar 17, 2022 at 12:47:15AM +0100, Alexander Bluhm wrote:
> Hi,
> 
> My previous atempt to add a mutex to in_pcb.h was reverted as it
> broke userland build.
> 
> Is the correct fix to include sys/mutex.h in every .c file that
> includes netinet/in_pcb.h ?  I made a release with it.
> Or should I include sys/mutex.h in netinet/in_pcb.h ?

I would add sys/mutex.h in netinet/in_pcb.h. We do the same in other
headers like sys/proc.h etc.
 
> ok?
> 
> bluhm
> 
> Index: lib/libkvm/kvm_file2.c
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/src/lib/libkvm/kvm_file2.c,v
> retrieving revision 1.57
> diff -u -p -r1.57 kvm_file2.c
> --- lib/libkvm/kvm_file2.c    22 Feb 2022 17:35:01 -0000      1.57
> +++ lib/libkvm/kvm_file2.c    16 Mar 2022 16:42:15 -0000
> @@ -74,6 +74,7 @@
>  #include <sys/unpcb.h>
>  #include <sys/filedesc.h>
>  #include <sys/mbuf.h>
> +#include <sys/mutex.h>
>  #include <sys/pipe.h>
>  #include <sys/stat.h>
>  #include <sys/sysctl.h>
> Index: sbin/sysctl/sysctl.c
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/src/sbin/sysctl/sysctl.c,v
> retrieving revision 1.258
> diff -u -p -r1.258 sysctl.c
> --- sbin/sysctl/sysctl.c      12 Jul 2021 15:09:19 -0000      1.258
> +++ sbin/sysctl/sysctl.c      15 Mar 2022 09:18:31 -0000
> @@ -42,9 +42,11 @@
>  #include <sys/uio.h>
>  #include <sys/tty.h>
>  #include <sys/namei.h>
> +#include <sys/mutex.h>
>  #include <sys/sched.h>
>  #include <sys/sensors.h>
>  #include <sys/vmmeter.h>
> +
>  #include <net/route.h>
>  #include <net/if.h>
>  
> Index: usr.bin/netstat/inet.c
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/src/usr.bin/netstat/inet.c,v
> retrieving revision 1.173
> diff -u -p -r1.173 inet.c
> --- usr.bin/netstat/inet.c    5 Dec 2021 22:36:19 -0000       1.173
> +++ usr.bin/netstat/inet.c    16 Mar 2022 16:44:32 -0000
> @@ -34,6 +34,7 @@
>  #include <sys/socket.h>
>  #include <sys/socketvar.h>
>  #include <sys/domain.h>
> +#include <sys/mutex.h>
>  #include <sys/protosw.h>
>  #include <sys/sysctl.h>
>  #define _KERNEL
> @@ -41,6 +42,7 @@
>  #undef _KERNEL
>  
>  #include <net/route.h>
> +
>  #include <netinet/in.h>
>  #include <netinet/ip.h>
>  #include <netinet/in_pcb.h>
> Index: usr.bin/tcpbench/tcpbench.c
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/src/usr.bin/tcpbench/tcpbench.c,v
> retrieving revision 1.65
> diff -u -p -r1.65 tcpbench.c
> --- usr.bin/tcpbench/tcpbench.c       12 Jul 2021 15:09:20 -0000      1.65
> +++ usr.bin/tcpbench/tcpbench.c       16 Mar 2022 16:44:55 -0000
> @@ -21,6 +21,7 @@
>  #include <sys/time.h>
>  #include <sys/socket.h>
>  #include <sys/socketvar.h>
> +#include <sys/mutex.h>
>  #include <sys/resource.h>
>  #include <sys/queue.h>
>  #include <sys/un.h>
> Index: usr.sbin/trpt/trpt.c
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/trpt/trpt.c,v
> retrieving revision 1.39
> diff -u -p -r1.39 trpt.c
> --- usr.sbin/trpt/trpt.c      2 Dec 2019 21:47:54 -0000       1.39
> +++ usr.sbin/trpt/trpt.c      16 Mar 2022 16:45:23 -0000
> @@ -62,6 +62,7 @@
>  #include <sys/queue.h>
>  #include <sys/time.h>
>  #include <sys/socket.h>
> +#include <sys/mutex.h>
>  #define PRUREQUESTS
>  #include <sys/protosw.h>
>  #define _KERNEL
> 

-- 
:wq Claudio

Reply via email to