From: eugene.loh@oracle.com
To: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: [PATCH 2/4] test: Use syscall in case of no execveat() wrapper
Date: Mon, 6 Oct 2025 17:57:24 -0400 [thread overview]
Message-ID: <20251006215726.8893-2-eugene.loh@oracle.com> (raw)
In-Reply-To: <20251006215726.8893-1-eugene.loh@oracle.com>
From: Eugene Loh <eugene.loh@oracle.com>
While execveat() appeared in kernel 3.19, GNU C library support
came later. We are still testing on some systems with older libc.
Do not assume libc has an execveat() wrapper: use syscall().
Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
---
test/unittest/proc/tst.exec-execveat.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/unittest/proc/tst.exec-execveat.sh b/test/unittest/proc/tst.exec-execveat.sh
index db68a5043..e4b9dfa5e 100755
--- a/test/unittest/proc/tst.exec-execveat.sh
+++ b/test/unittest/proc/tst.exec-execveat.sh
@@ -17,7 +17,7 @@ cd $DIRNAME
cat << EOF > parent.c
#include <stdio.h>
#include <linux/fcntl.h> /* Definition of AT_* constants */
-#define __USE_GNU /* so unistd.h will find execveat */
+#include <sys/syscall.h> /* Definition of SYS_* constants */
#include <unistd.h>
int main(int c, char **v) {
@@ -26,7 +26,7 @@ int main(int c, char **v) {
int rc;
printf("exec\n");
- rc = execveat(AT_FDCWD, "bogus_direc/bogus_exec", argv, envp, 0);
+ rc = syscall(__NR_execveat, AT_FDCWD, "bogus_direc/bogus_exec", argv, envp, 0);
return 0;
}
--
2.47.3
next prev parent reply other threads:[~2025-10-06 21:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-06 21:57 [PATCH 1/4] test: Turn char[16] into string to ignore garbage bytes eugene.loh
2025-10-06 21:57 ` eugene.loh [this message]
2025-10-07 15:38 ` [DTrace-devel] [PATCH 2/4] test: Use syscall in case of no execveat() wrapper Kris Van Hees
2025-10-07 17:44 ` Eugene Loh
2025-10-06 21:57 ` [PATCH 3/4] test: Supply XFAIL for tests that use vtimestamp eugene.loh
2025-10-07 15:41 ` [DTrace-devel] " Kris Van Hees
2025-10-07 22:54 ` Eugene Loh
2025-10-06 21:57 ` [PATCH 4/4] test: Skip D return() action if kernel not configured right eugene.loh
2025-10-06 22:14 ` Kris Van Hees
2025-10-07 15:37 ` [PATCH 1/4] test: Turn char[16] into string to ignore garbage bytes Kris Van Hees
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251006215726.8893-2-eugene.loh@oracle.com \
--to=eugene.loh@oracle.com \
--cc=dtrace-devel@oss.oracle.com \
--cc=dtrace@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox