|
|
Message-ID: <20261102165837.24591-3-kaloz@kernel.org>
Date: Mon, 2 Nov 2026 17:58:29 +0100
From: Imre Kaloz <kaloz@...nel.org>
To: musl@...ts.openwall.com
Subject: [PATCH 02/10] allow archs to override fcntl lock and socket option numbers
sparc's F_RDLCK/F_WRLCK/F_UNLCK and its SO_* numbers from
SO_SECURITY_AUTHENTICATION on differ from the generic ones; an arch
that defines the first of either block must define all of it. Its
SO_TIMESTAMPNS_OLD and SO_TIMESTAMPING_OLD are 33 and 35, not 35 and 37.
---
include/fcntl.h | 2 ++
include/sys/socket.h | 2 ++
src/internal/syscall.h | 6 ++++++
3 files changed, 10 insertions(+)
diff --git a/include/fcntl.h b/include/fcntl.h
index 1e25f625..3c9c9bd1 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -51,9 +51,11 @@ int posix_fallocate(int, off_t, off_t);
#define F_DUPFD_CLOEXEC 1030
+#ifndef F_RDLCK
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2
+#endif
#define FD_CLOEXEC 1
diff --git a/include/sys/socket.h b/include/sys/socket.h
index 6dc1e40a..ebfd16fb 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -246,6 +246,7 @@ struct linger {
#endif
#endif
+#ifndef SO_SECURITY_AUTHENTICATION
#define SO_SECURITY_AUTHENTICATION 22
#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
#define SO_SECURITY_ENCRYPTION_NETWORK 24
@@ -291,6 +292,7 @@ struct linger {
#define SO_DETACH_REUSEPORT_BPF 68
#define SO_PREFER_BUSY_POLL 69
#define SO_BUSY_POLL_BUDGET 70
+#endif
#ifndef SOL_SOCKET
#define SOL_SOCKET 1
diff --git a/src/internal/syscall.h b/src/internal/syscall.h
index 2d8a5c13..236fb68d 100644
--- a/src/internal/syscall.h
+++ b/src/internal/syscall.h
@@ -359,9 +359,15 @@ static inline long __alt_socketcall(int sys, int sock, int cp, syscall_arg_t a,
#define SO_SNDTIMEO_OLD 21
#endif
+#ifndef SO_TIMESTAMP_OLD
#define SO_TIMESTAMP_OLD 29
+#endif
+#ifndef SO_TIMESTAMPNS_OLD
#define SO_TIMESTAMPNS_OLD 35
+#endif
+#ifndef SO_TIMESTAMPING_OLD
#define SO_TIMESTAMPING_OLD 37
+#endif
#define SCM_TIMESTAMP_OLD SO_TIMESTAMP_OLD
#define SCM_TIMESTAMPNS_OLD SO_TIMESTAMPNS_OLD
#define SCM_TIMESTAMPING_OLD SO_TIMESTAMPING_OLD
--
2.47.3
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.