mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 10:21:20 +00:00
Refactor the code to be reusable between execve and execveat syscalls. https://bugs.kde.org/show_bug.cgi?id=345077
19 lines
336 B
C
19 lines
336 B
C
#include <sys/syscall.h>
|
|
#include <errno.h>
|
|
#include <unistd.h>
|
|
#include <stddef.h>
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
int has_execveat = 0;
|
|
#if defined(__NR_execveat)
|
|
errno = 0;
|
|
syscall(__NR_execveat, 0, NULL, 0, 0, 0);
|
|
has_execveat = (errno != ENOSYS);
|
|
#else
|
|
has_execveat = 0;
|
|
#endif
|
|
|
|
return has_execveat ? 0 : 1;
|
|
}
|