Fixed SO_PROTOCOL on new Illumos

This commit is contained in:
Gerhard Rieger 2024-08-21 09:23:02 +02:00
parent 642b729622
commit 0454c4fa43
2 changed files with 11 additions and 2 deletions

View file

@ -72,6 +72,10 @@ Porting:
in sys/stropts.h in sys/stropts.h
Thanks to Andy Fiddaman for sending a patch. Thanks to Andy Fiddaman for sending a patch.
On latest Illumos, compilation failed due to new unexpected SO_PROTOCOL
implementation.
Thanks to Andy Fiddaman for sending a patch.
Building: Building:
Makefile.in: procan.o build requires srcdir prefix for explicit source Makefile.in: procan.o build requires srcdir prefix for explicit source
file. file.

View file

@ -6,14 +6,19 @@
#define __xio_socket_h_included 1 #define __xio_socket_h_included 1
/* SO_PROTOTYPE is defined on Solaris, HP-UX /* SO_PROTOTYPE is defined on Solaris, HP-UX
SO_PROTOCOL in Linux, is the better name, but came much later */ SO_PROTOCOL in Linux, is the better name, but came much later, now
standardised in POSIX 2024
illumos defines both, with SO_PROTOCOL as an alias of SO_PROTOTYPE */
#ifdef SO_PROTOCOL #ifdef SO_PROTOCOL
# undef SO_PROTOTYPE # ifndef SO_PROTOTYPE
# define SO_PROTOTYPE SO_PROTOCOL # define SO_PROTOTYPE SO_PROTOCOL
# endif
#else #else
# ifdef SO_PROTOTYPE # ifdef SO_PROTOTYPE
# define SO_PROTOCOL SO_PROTOTYPE # define SO_PROTOCOL SO_PROTOTYPE
# else # else
/* Even when SO_PROTOCOL is not available for setsockopt() Socat uses it
internally as option for 3rd arg of socket() e.a. */
# define SO_PROTOCOL 0x9999 # define SO_PROTOCOL 0x9999
# define SO_PROTOTYPE SO_PROTOCOL # define SO_PROTOTYPE SO_PROTOCOL
# endif # endif