]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/missing_syscall.h
Merge pull request #17079 from keszybz/late-exec-resolution
[thirdparty/systemd.git] / src / basic / missing_syscall.h
index 6f2a3589c05006bd499ab934cb04d6e54b9ea38b..7e6dd0cb52541f33378146ea4aa097a50849e682 100644 (file)
@@ -749,6 +749,25 @@ static inline int missing_rt_sigqueueinfo(pid_t tgid, int sig, siginfo_t *info)
 #  define rt_sigqueueinfo missing_rt_sigqueueinfo
 #endif
 
+/* ======================================================================= */
+#if !HAVE_EXECVEAT
+static inline int missing_execveat(int dirfd, const char *pathname,
+                                   char *const argv[], char *const envp[],
+                                   int flags) {
+#  if defined __NR_execveat && __NR_execveat >= 0
+        return syscall(__NR_execveat, dirfd, pathname, argv, envp, flags);
+#  else
+        errno = ENOSYS;
+        return -1;
+#  endif
+}
+#  undef AT_EMPTY_PATH
+#  define AT_EMPTY_PATH 0x1000
+#  define execveat missing_execveat
+#endif
+
 /* ======================================================================= */
 
 #define systemd_NR_close_range systemd_SC_arch_bias(436)