Open bsiegert opened 8 months ago
SO_REUSEPORT is not generalized, and is there, for now exclusively, for LX brand sockets. Hence the _KERNEL ifdef.
To add a little more color: The SO_REUSEPORT
implementation added for LX is TCP-only, and really lacking in functionality. It only basically covers the "I want to reload haproxy without closing the socket" use case, and isn't especially robust at that. Because of its shortcomings, it was not exposed to the native system.
Hi! pkgsrc developer here. One of our users wanted to compile Caddy (a Go binary) with support for
SO_REUSEPORT
. I tried adding the definition to golang.org/x/sys using the standard way, which involves taking values from C header files.I found that commit b98c37dfd78bd387b2889c2f1bc6db5e2ff64987 added this support for OmniOS but put the constant into an
#ifdef _KERNEL
block. This seems wrong to me, since_KERNEL
typically switches from user-mode to intra-kernel interfaces. Is this a bug? Or is it deliberate?/cc @pfmooney, who wrote that code.