|
|
Message-Id: <19f1a095415.241d45e41204294.8165301962567043834@soss.website>
Date: Tue, 30 Jun 2026 14:37:26 -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 the
syscall has the potential to become more widely used
---
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
Content of type "text/html" skipped
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.