|
|
Message-ID: <19f1a0b50ea.6a2147f21204555.165326421149005681@soss.website>
Date: Tue, 30 Jun 2026 14:39:37 -0500
From: Skye Soss <skye@...s.website>
To: "musl" <musl@...ts.openwall.com>
Subject: [PATCH] add execveat syscall wrapper
The execveat syscall was added to Linux in v4.0 (released in 2015),
and the libc wrapper function was added to glibc in 2021
The AT_EXECVEAT_CHECK option was added to Linux 6.14, so I believe the
syscall has the potential to become more widely used. Thus it is
important for musl to provide the wrapper.
---
include/unistd.h | 1 +
src/process/execveat.c | 7 +++++++
2 files changed, 8 insertions(+)
create mode 100644 src/process/execveat.c
diff --git a/include/unistd.h b/include/unistd.h
index 42b0e82b..a4bd6ddd 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -95,6 +95,7 @@ int execvp(const char *, char *const []);
int execlp(const char *, const char *, ...);
int fexecve(int, char *const [], char *const []);
_Noreturn void _exit(int);
+int execveat(int, const char *, char *const [], char *const [], int);
pid_t getpid(void);
pid_t getppid(void);
diff --git a/src/process/execveat.c b/src/process/execveat.c
new file mode 100644
index 00000000..a9d12877
--- /dev/null
+++ b/src/process/execveat.c
@@ -0,0 +1,7 @@
+#include <unistd.h>
+#include "syscall.h"
+
+int execveat(int dirfd, const char *path, char *const argv[], char *const envp[], int flags)
+{
+ return syscall(SYS_execveat, dirfd, path, argv, envp, flags);
+}
--
2.54.0
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.