From d277a88f28b5a9ab9534155e7fb4ed0a554b9132 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 9 Aug 2023 11:09:28 -0700 Subject: [PATCH 1/2] Define `SO_PROTOCOL` and `SO_DOMAIN` on OpenBSD. This follows the definitions [here]. [here]: https://github.com/openbsd/src/blob/c5ac8393b86d7549b2b878fd46deeb0e8ee06ae0/sys/sys/socket.h#L116 --- libc-test/semver/openbsd.txt | 2 ++ src/unix/bsd/netbsdlike/openbsd/mod.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index afbf8eb572869..ea9cda0659ce4 100644 --- a/libc-test/semver/openbsd.txt +++ b/libc-test/semver/openbsd.txt @@ -778,8 +778,10 @@ SOCK_RAW SOCK_RDM SOMAXCONN SO_BINDANY +SO_DOMAIN SO_NETPROC SO_PEERCRED +SO_PROTOCOL SO_RTABLE SO_SPLICE SO_TIMESTAMP diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index 7fe81b3aa6bfb..5455bd344b657 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -999,6 +999,8 @@ pub const SO_NETPROC: ::c_int = 0x1020; pub const SO_RTABLE: ::c_int = 0x1021; pub const SO_PEERCRED: ::c_int = 0x1022; pub const SO_SPLICE: ::c_int = 0x1023; +pub const SO_DOMAIN: ::c_int = 0x1024; +pub const SO_PROTOCOL: ::c_int = 0x1025; // sys/netinet/in.h // Protocols (RFC 1700) From 4e664cc62c9a4ec4812c2415e4bfb70ca73098ac Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 9 Aug 2023 11:49:54 -0700 Subject: [PATCH 2/2] Define `SO_DOMAIN` and `SO_PROTOTYPE` on solarish platforms. --- src/unix/solarish/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index 400de8a26471c..a3fa56a65a67e 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -1825,6 +1825,8 @@ pub const SO_SNDTIMEO: ::c_int = 0x1005; pub const SO_RCVTIMEO: ::c_int = 0x1006; pub const SO_ERROR: ::c_int = 0x1007; pub const SO_TYPE: ::c_int = 0x1008; +pub const SO_PROTOTYPE: ::c_int = 0x1009; +pub const SO_DOMAIN: ::c_int = 0x100c; pub const SO_TIMESTAMP: ::c_int = 0x1013; pub const SCM_RIGHTS: ::c_int = 0x1010;