aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2021-02-07 12:43:25 +0100
committerMichael Kerrisk <mtk.manpages@gmail.com>2021-02-09 19:33:47 +0100
commit71a25d4c79b1ccf538f6b813c834bbc4197f6370 (patch)
treeb541680a3a3de09cf5414d2433ce1e0f91733f14
parent56d1311b870f0e422c93988c48f11fd2e92efce7 (diff)
downloadman-pages-71a25d4c79b1ccf538f6b813c834bbc4197f6370.tar.gz
execveat.2: Fix prototype
It's been 6 years since execveat(2) was added to the kernel, and there's still no glibc wrapper. Let's document the kernel syscall prototype. I reported a bug against glibc requesting a wrapper; when glibc adds the wrapper, this commit should probably be reverted. ...... .../linux$ grep_syscall execveat fs/exec.c:2062: SYSCALL_DEFINE5(execveat, int, fd, const char __user *, filename, const char __user *const __user *, argv, const char __user *const __user *, envp, int, flags) fs/exec.c:2083: COMPAT_SYSCALL_DEFINE5(execveat, int, fd, const char __user *, filename, const compat_uptr_t __user *, argv, const compat_uptr_t __user *, envp, int, flags) include/linux/compat.h:815: asmlinkage long compat_sys_execveat(int dfd, const char __user *filename, const compat_uptr_t __user *argv, const compat_uptr_t __user *envp, int flags); include/linux/syscalls.h:980: asmlinkage long sys_execveat(int dfd, const char __user *filename, const char __user *const __user *argv, const char __user *const __user *envp, int flags); .../linux$ function grep_syscall() { if ! [ -v 1 ]; then >&2 echo "Usage: ${FUNCNAME[0]} <syscall>"; return ${EX_USAGE}; fi find * -type f \ |grep '\.c$' \ |sort -V \ |xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?\)" \ |sed -E 's/^[^:]+:[0-9]+:/&\n/'; find * -type f \ |grep '\.[ch]$' \ |sort -V \ |xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_${1}\s*\(.*?\)" \ |sed -E 's/^[^:]+:[0-9]+:/&\n/'; } Glibc bug: <https://sourceware.org/bugzilla/show_bug.cgi?id=27364> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man2/execveat.22
1 files changed, 1 insertions, 1 deletions
diff --git a/man2/execveat.2 b/man2/execveat.2
index 02d9c73318..d1ce4bee13 100644
--- a/man2/execveat.2
+++ b/man2/execveat.2
@@ -31,7 +31,7 @@ execveat \- execute program relative to a directory file descriptor
.B #include <unistd.h>
.PP
.BI "int execveat(int " dirfd ", const char *" pathname ,
-.BI " char *const " argv "[], char *const " envp [],
+.BI " const char *const " argv "[], const char *const " envp [],
.BI " int " flags );
.fi
.PP