20#ifndef SYSTEM_SYSCALLS_H
21#define SYSTEM_SYSCALLS_H
23#include "pedigree/kernel/processor/Processor.h"
24#include "pedigree/kernel/processor/VirtualAddressSpace.h"
25#include "pedigree/kernel/processor/state.h"
28#include "wait-syscalls.h"
33bool posix_exec_file_readable(
File* file);
34long posix_setfsuid(uid_t uid);
35long posix_setfsgid(gid_t gid);
43uintptr_t posix_brk(uintptr_t theBreak);
44long posix_sbrk(
int delta);
45SyscallState posix_copy_clone_state(
const SyscallState& state);
46long posix_clone(SyscallState& state,
unsigned long flags,
void* child_stack,
int* ptid,
int* ctid,
47 unsigned long newtls,
bool linuxAbi =
false,
bool clearSignalHandlers =
false);
48int posix_fork(SyscallState& state);
49int posix_vfork(SyscallState& state);
50int posix_execve(
const char* name,
const char** argv,
const char** env, SyscallState& state);
54int posix_gettimeofday(timeval* tv,
struct timezone* tz);
55int posix_settimeofday(
const timeval* tv,
const struct timezone* tz);
56time_t posix_time(time_t* tval);
57clock_t posix_times(
struct tms* tm);
58int posix_getrusage(
int who,
struct rusage* r);
60ssize_t posix_getrandom(
void* buffer,
size_t length,
unsigned int flags);
62int posix_getpwent(passwd* pw,
int n,
char* str);
63int posix_getpwnam(passwd* pw,
const char* name,
char* str);
68int posix_setuid(uid_t uid);
69int posix_setgid(gid_t gid);
70int posix_seteuid(uid_t euid);
71int posix_setegid(gid_t egid);
73size_t posix_alarm(uint32_t seconds);
74int posix_sleep(uint32_t seconds);
75int posix_usleep(
size_t useconds);
76int posix_nanosleep(
const struct timespec* rqtp,
struct timespec* rmtp,
bool time32 =
false);
77int posix_clock_gettime(clockid_t clock_id,
struct timespec* tp);
79int posix_clock_getres_native(clockid_t clock_id,
struct timespec* resolution);
87int posix_setpgid(
int pid,
int pgid);
89int posix_getpgid(
int pid);
91mode_t posix_umask(mode_t mask);
93int posix_getgrnam(
const char* name,
struct group* out);
94int posix_getgrgid(gid_t
id,
struct group* out);
96int posix_linux_syslog(
int type,
char* buf,
int len);
97int posix_syslog(
const char* msg,
int prio);
99int pedigree_login(
int uid);
101int pedigree_reboot();
102int posix_reboot(uint32_t magic1, uint32_t magic2, uint32_t command);
104int posix_uname(
struct utsname* n);
106int posix_prctl(
int option, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5);
107int posix_arch_prctl(
int code,
unsigned long addr);
111int posix_setgroups(
size_t size,
const gid_t* list);
112int posix_getgroups(
size_t size, gid_t* list);
114int posix_getrlimit(
int resource,
struct rlimit* rlim);
115int posix_setrlimit(
int resource,
const struct rlimit* rlim);
117int posix_membarrier(
int command,
unsigned int flags,
int cpuId);
118int posix_getpriority(
int which,
int who,
bool linuxAbi =
false);
119int posix_setpriority(
int which,
int who,
int prio);
121int posix_setreuid(uid_t ruid, uid_t euid);
122int posix_setregid(gid_t rgid, gid_t egid);
124int posix_setresuid(uid_t ruid, uid_t euid, uid_t suid);
125int posix_setresgid(gid_t rgid, gid_t egid, gid_t sgid);
126int posix_getresuid(uid_t* ruid, uid_t* euid, uid_t* suid);
127int posix_getresgid(gid_t* rgid, gid_t* egid, gid_t* sgid);
129int posix_get_robust_list(
int pid,
struct robust_list_head** head_ptr,
size_t* len_ptr,
130 bool linuxAbi =
false);
131int posix_set_robust_list(
struct robust_list_head* head,
size_t len,
bool linuxAbi =
false);
133int posix_ioperm(
unsigned long from,
unsigned long num,
int turn_on);
134int posix_iopl(
int level);
136int posix_getitimer(
int which,
struct itimerval* curr_value);
137int posix_setitimer(
int which,
const struct itimerval* new_value,
struct itimerval* old_value);
139int posix_capget(
void* hdrp,
void* datap);
140int posix_capset(
void* hdrp,
const void* datap);