System calls

void debug(char *s);
void *mmap(void *vaddr, size_t size, int prot, int flags, oid_t *oid, offs_t offs);
void munmap(void *vaddr, size_t size);
int sys_fork(void);
void vforksvc(void);
int release(void);
int sys_spawn(char *path, char **argv, char **envp);
int exec(char *path, char **argv, char **envp);
int sys_exit(int code);
int sys_waitpid(pid_t pid, int *stat, int options);
int threadJoin(time_t timeout);
pid_t getpid(void);
pid_t getppid(void);
int gettid(void);
int beginthreadex(void *start, unsigned int priority, void *stack, unsigned int stacksz, void *arg, unsigned int *id);
void endthread(void);
int usleep(unsigned int us);
int priority(int priority);
int threadsinfo(int n, threadinfo_t *info);
void meminfo(meminfo_t *info);
int syspageprog(syspageprog_t *prog, int i);
int perf_start(pid_t pid);
int perf_read(void *buffer, size_t size);
int perf_finish(void);
int mutexCreate(unsigned int *h);
int phMutexLock(unsigned int h);
int mutexTry(unsigned int h);
int mutexUnlock(unsigned int h);
int condCreate(unsigned int *h);
int phCondWait(unsigned int h, unsigned int m, time_t timeout);
int condSignal(unsigned int h);
int condBroadcast(unsigned int h);
int resourceDestroy(unsigned int h);
int interrupt(unsigned int n, void *f, void *data, unsigned int cond, unsigned int *handle);
int portCreate(u32 port);
void portDestroy(u32 port);
int msgSend(u32 port, msg_t *msg);
int msgRecv(u32 port, msg_t *msg, unsigned int *rid);
int msgRespond(u32 port, msg_t * msg, unsigned int rid);
int gettime(time_t *praw, time_t *poffs);
int settime(time_t offs);
void keepidle(int t);
void mmdump(void);
int platformctl(void *ptr);
void wdgreload(void);
addr_t va2pa(void *va);
void signalHandle(void *handler, unsigned mask, unsigned mmask);
int signalPost(int pid, int tid, int signal);
unsigned int signalMask(unsigned mask, unsigned mmask);
int signalSuspend(unsigned mask);
int SetRoot(oid_t *oid, mode_t mode);
int sys_openat(int dirfd, const char *filename, int flags, mode_t mode);
int sys_open(const char *filename, int flags, mode_t mode);
int sys_close(int fildes);
int sys_read(int fildes, void *buf, size_t nbyte);
int sys_write(int fildes, void *buf, size_t nbyte);
int sys_dup3(int fildes, int fildes2, int flags);
int fileLink(int fildes, const char *path, int dirfd, const char *name, int flags);
int fileUnlink(int dirfd, const char *path, int flags);
int lseek(int fildes, off_t *offset, int whence);
int sys_ftruncate(int fildes, off_t length);
int sys_fcntl(int fildes, int cmd, long arg);
int fileStat(int fildes, const char *path, struct stat *buf, int flags);
int sys_fchmod(int fildes, mode_t mode);
int fileIoctl(int fildes, unsigned long request, const char *indata size_t insz, char *outdata, size_t outsz);
int sys_poll(struct pollfd *fds, nfds_t nfds, int timeout_ms);
int eventRegister(const oid_t *oid, unsigned types);
int queueCreate(void);
int queueWait(int fd, const event_t *subs, int subcnt, event_t *events, int evcnt, time_t timeout);
int sys_pipe(int fds[2]);
int sys_accept4(int socket, struct sockaddr *address, socklen_t *address_len, int flags);
int sys_bind(int socket, const struct sockaddr *address, socklen_t address_len);
int sys_connect(int socket, const struct sockaddr *address, socklen_t address_len);
int sys_getpeername(int socket, struct sockaddr *address, socklen_t *address_len);
int sys_getsockname(int socket, struct sockaddr *address, socklen_t *address_len);
int sys_getsockopt(int socket, int level, int optname, void *optval, socklen_t *optlen);
int sys_listen(int socket, int backlog);
ssize_t sys_recvfrom(int socket, void *message, size_t length, int flags, struct sockaddr *src_addr, socklen_t *src_len);
ssize_t sys_sendto(int socket, const void *message, size_t length, int flags, constr struct sockaddr *dest_addr, socklen_t dest_len);
int sys_socket(int domain, int type, int protocol);
int sys_shutdown(int socket, int how);
int sys_setsockopt(int socket, int level, int optname, const void *optval, socklen_t optlen);
int sys_setpgid(pid_t pid, pid_t pgid);
pid_t sys_getpgid(pid_t pid);
pid_t sys_setsid(void);
pid_t sys_getsid(pid_t pid);
int threadKill(pid_t pid, int tid, int sig);