This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 86cecb94191 syscall: List getsockopt() and setsockopt() only with
NET_SOCKOPTS.
86cecb94191 is described below
commit 86cecb94191fbe1689430fc000d17faf89163a6d
Author: Marco Casaroli <[email protected]>
AuthorDate: Tue Nov 3 15:19:36 2026 +0100
syscall: List getsockopt() and setsockopt() only with NET_SOCKOPTS.
net/socket builds getsockopt.c and setsockopt.c only with
CONFIG_NET_SOCKOPTS, but syscall_lookup.h lists both system calls with
CONFIG_NET, and syscall.csv makes the getsockopt() stub and proxy with
CONFIG_NET. So a protected or a kernel build with CONFIG_NET and
without CONFIG_NET_SOCKOPTS does not link: undefined reference to
`getsockopt' and `STUB_setsockopt'.
List both system calls only with CONFIG_NET_SOCKOPTS, as the flat build
has them only with that option.
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <[email protected]>
---
include/sys/syscall_lookup.h | 4 ++++
syscall/syscall.csv | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/sys/syscall_lookup.h b/include/sys/syscall_lookup.h
index b5552cfa734..b98c66bb1c4 100644
--- a/include/sys/syscall_lookup.h
+++ b/include/sys/syscall_lookup.h
@@ -392,7 +392,9 @@ SYSCALL_LOOKUP(munlockall, 0)
SYSCALL_LOOKUP(connect, 3)
SYSCALL_LOOKUP(getpeername, 3)
SYSCALL_LOOKUP(getsockname, 3)
+# ifdef CONFIG_NET_SOCKOPTS
SYSCALL_LOOKUP(getsockopt, 5)
+# endif
SYSCALL_LOOKUP(listen, 2)
SYSCALL_LOOKUP(recv, 4)
SYSCALL_LOOKUP(recvfrom, 6)
@@ -400,7 +402,9 @@ SYSCALL_LOOKUP(munlockall, 0)
SYSCALL_LOOKUP(send, 4)
SYSCALL_LOOKUP(sendto, 6)
SYSCALL_LOOKUP(sendmsg, 3)
+# ifdef CONFIG_NET_SOCKOPTS
SYSCALL_LOOKUP(setsockopt, 5)
+# endif
SYSCALL_LOOKUP(shutdown, 2)
SYSCALL_LOOKUP(socket, 3)
SYSCALL_LOOKUP(socketpair, 4)
diff --git a/syscall/syscall.csv b/syscall/syscall.csv
index af9a9c0481b..e232c6d93fe 100644
--- a/syscall/syscall.csv
+++ b/syscall/syscall.csv
@@ -50,7 +50,7 @@
"getppid","unistd.h","defined(CONFIG_SCHED_HAVE_PARENT)","pid_t"
"getrlimit","sys/resource.h","","int","int","FAR struct rlimit *"
"getsockname","sys/socket.h","defined(CONFIG_NET)","int","int","FAR struct
sockaddr *","FAR socklen_t *"
-"getsockopt","sys/socket.h","defined(CONFIG_NET)","int","int","int","int","FAR
void *","FAR socklen_t *"
+"getsockopt","sys/socket.h","defined(CONFIG_NET) &&
defined(CONFIG_NET_SOCKOPTS)","int","int","int","int","FAR void *","FAR
socklen_t *"
"gettimeofday","sys/time.h","","int","FAR struct timeval *","FAR struct
timezone *"
"getuid","unistd.h","defined(CONFIG_SCHED_USER_IDENTITY)","uid_t"
"getumask","sys/stat.h","","mode_t"