#ifndef SANDBOX_LINUX_SERVICES_SYSCALL_WRAPPERS_H_
#define SANDBOX_LINUX_SERVICES_SYSCALL_WRAPPERS_H_
#include <signal.h>
#include <stdint.h>
#include <sys/types.h>
#include <cstddef>
#include "sandbox/sandbox_export.h"
struct sock_fprog;
struct rlimit64;
struct cap_hdr;
struct cap_data;
struct kernel_stat;
struct kernel_stat64;
struct landlock_ruleset_attr;
namespace sandbox {
SANDBOX_EXPORT pid_t sys_getpid(void);
SANDBOX_EXPORT pid_t sys_gettid(void);
SANDBOX_EXPORT ssize_t sys_write(int fd,
const char* buffer,
size_t buffer_size);
SANDBOX_EXPORT long sys_clone(unsigned long flags);
SANDBOX_EXPORT long sys_clone(unsigned long flags,
std::nullptr_t child_stack,
pid_t* ptid,
pid_t* ctid,
std::nullptr_t regs);
SANDBOX_EXPORT void sys_exit_group(int status);
SANDBOX_EXPORT int sys_seccomp(unsigned int operation,
unsigned int flags,
const struct sock_fprog* args);
SANDBOX_EXPORT int sys_prlimit64(pid_t pid,
int resource,
const struct rlimit64* new_limit,
struct rlimit64* old_limit);
SANDBOX_EXPORT int sys_capget(struct cap_hdr* hdrp, struct cap_data* datap);
SANDBOX_EXPORT int sys_capset(struct cap_hdr* hdrp,
const struct cap_data* datap);
SANDBOX_EXPORT int sys_getresuid(uid_t* ruid, uid_t* euid, uid_t* suid);
SANDBOX_EXPORT int sys_getresgid(gid_t* rgid, gid_t* egid, gid_t* sgid);
SANDBOX_EXPORT int sys_chroot(const char* path);
SANDBOX_EXPORT int sys_unshare(int flags);
SANDBOX_EXPORT int sys_sigprocmask(int how,
const sigset_t* set,
std::nullptr_t oldset);
SANDBOX_EXPORT int sys_sigaction(int signum,
const struct sigaction* act,
struct sigaction* oldact);
SANDBOX_EXPORT int sys_stat(const char* path, struct kernel_stat* stat_buf);
SANDBOX_EXPORT int sys_lstat(const char* path, struct kernel_stat* stat_buf);
SANDBOX_EXPORT int sys_fstatat64(int dirfd,
const char* pathname,
struct kernel_stat64* stat_buf,
int flags);
SANDBOX_EXPORT int landlock_create_ruleset(
const struct landlock_ruleset_attr* const attr,
const size_t size,
const uint32_t flags);
}
#endif