diff options
author | Dean Deng <deandeng@google.com> | 2019-10-21 14:53:44 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-10-21 14:55:18 -0700 |
commit | 0b569b7caebc2b7785732ed6cb8248cf0568783f (patch) | |
tree | 5fac50eea5f8a1fea265336ea20e6fca8c0718a1 /test/util/multiprocess_util.h | |
parent | a9358ce81fca1c99449ce6fd28faf3f04baf6104 (diff) |
Add basic implementation of execveat syscall and associated tests.
Allow file descriptors of directories as well as AT_FDCWD.
PiperOrigin-RevId: 275929668
Diffstat (limited to 'test/util/multiprocess_util.h')
-rw-r--r-- | test/util/multiprocess_util.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/util/multiprocess_util.h b/test/util/multiprocess_util.h index 0aecd3439..c413d63ea 100644 --- a/test/util/multiprocess_util.h +++ b/test/util/multiprocess_util.h @@ -102,6 +102,13 @@ inline PosixErrorOr<Cleanup> ForkAndExec(const std::string& filename, return ForkAndExec(filename, argv, envv, [] {}, child, execve_errno); } +// Equivalent to ForkAndExec, except using dirfd and flags with execveat. +PosixErrorOr<Cleanup> ForkAndExecveat(int32_t dirfd, const std::string& pathname, + const ExecveArray& argv, + const ExecveArray& envv, int flags, + const std::function<void()>& fn, + pid_t* child, int* execve_errno); + // Calls fn in a forked subprocess and returns the exit status of the // subprocess. // |