Welcome to The Fiwix Project
A UNIX-like kernel for the i386 architecture
1 /* 2 * fiwix/include/fiwix/syscalls.h 3 * 4 * Copyright 2018, Jordi Sanfeliu. All rights reserved. 5 * Distributed under the terms of the Fiwix License. 6 */ 7 8 #ifndef _FIWIX_SYSCALLS_H 9 #define _FIWIX_SYSCALLS_H 10 11 #include <fiwix/types.h> 12 #include <fiwix/system.h> 13 #include <fiwix/time.h> 14 #include <fiwix/times.h> 15 #include <fiwix/timeb.h> 16 #include <fiwix/utime.h> 17 #include <fiwix/statbuf.h> 18 #include <fiwix/ustat.h> 19 #include <fiwix/signal.h> 20 #include <fiwix/utsname.h> 21 #include <fiwix/resource.h> 22 #include <fiwix/dirent.h> 23 #include <fiwix/statfs.h> 24 #include <fiwix/sigcontext.h> 25 #include <fiwix/mman.h> 26 27 #define NR_SYSCALLS (sizeof(syscall_table) / sizeof(unsigned int)) 28 29 int do_syscall(unsigned int, int, int, int, int, int, struct sigcontext); 30 31 int sys_exit(int); 32 void do_exit(int); 33 int sys_fork(int, int, int, int, int, struct sigcontext *); 34 int sys_read(unsigned int, char *, int); 35 int sys_write(unsigned int, const char *, int); 36 int sys_open(const char *, int, __mode_t); 37 int sys_close(unsigned int); 38 int sys_waitpid(__pid_t, int *, int); 39 int sys_creat(const char *, __mode_t); 40 int sys_link(const char *, const char *); 41 int sys_unlink(const char *); 42 int sys_execve(const char *, char **, char **, int, int, struct sigcontext *); 43 int sys_chdir(const char *); 44 int sys_time(__time_t *); 45 int sys_mknod(const char *, __mode_t, __dev_t); 46 int sys_chmod(const char *, __mode_t); 47 int sys_chown(const char *, __uid_t, __gid_t); 48 int sys_stat(const char *, struct old_stat *); 49 int sys_lseek(unsigned int, __off_t, unsigned int); 50 int sys_getpid(void); 51 int sys_mount(const char *, const char *, const char *, unsigned long int, const void *); 52 int sys_umount(const char *); 53 int sys_setuid(__uid_t); 54 int sys_getuid(void); 55 int sys_stime(__time_t *); 56 int sys_alarm(unsigned int); 57 int sys_fstat(unsigned int, struct old_stat *); 58 int sys_pause(void); 59 int sys_utime(const char *, struct utimbuf *); 60 int sys_access(const char *, __mode_t); 61 int sys_ftime(struct timeb *); 62 void sys_sync(void); 63 int sys_kill(__pid_t, __sigset_t); 64 int sys_rename(const char *, const char *); 65 int sys_mkdir(const char *, __mode_t); 66 int sys_rmdir(const char *); 67 int sys_dup(unsigned int); 68 int sys_pipe(int *); 69 int sys_times(struct tms *); 70 int sys_brk(unsigned int); 71 int sys_setgid(__gid_t); 72 int sys_getgid(void); 73 unsigned int sys_signal(__sigset_t, void(*sighandler)(int)); 74 int sys_geteuid(void); 75 int sys_getegid(void); 76 int sys_umount2(const char *, int); 77 int sys_ioctl(unsigned int, int, unsigned long int); 78 int sys_fcntl(int, int, unsigned long int); 79 int sys_setpgid(__pid_t, __pid_t); 80 int sys_olduname(struct oldold_utsname *); 81 int sys_umask(__mode_t); 82 int sys_chroot(const char *); 83 int sys_ustat(__dev_t, struct ustat *); 84 int sys_dup2(int, int); 85 int sys_getppid(void); 86 int sys_getpgrp(void); 87 int sys_setsid(void); 88 int sys_sigaction(__sigset_t, const struct sigaction *, struct sigaction *); 89 int sys_sgetmask(void); 90 int sys_ssetmask(int); 91 int sys_setreuid(__uid_t, __uid_t); 92 int sys_setregid(__gid_t, __gid_t); 93 int sys_sigsuspend(__sigset_t *); 94 int sys_sigpending(__sigset_t *); 95 int sys_sethostname(const char *, int); 96 int sys_setrlimit(int, const struct rlimit *); 97 int sys_getrlimit(int, struct rlimit *); 98 int sys_getrusage(int, struct rusage *); 99 int sys_gettimeofday(struct timeval *, struct timezone *); 100 int sys_settimeofday(const struct timeval *, const struct timezone *); 101 int sys_getgroups(__ssize_t, __gid_t *); 102 int sys_setgroups(__ssize_t, const __gid_t *); 103 int old_select(unsigned long int *); 104 int sys_symlink(const char *, const char *); 105 int sys_lstat(const char *, struct old_stat *); 106 int sys_readlink(const char *, char *, __size_t); 107 int sys_reboot(int, int, int); 108 int old_mmap(struct mmap *); 109 int sys_munmap(unsigned int, __size_t); 110 int sys_truncate(const char *, __off_t); 111 int sys_ftruncate(int, __off_t); 112 int sys_fchmod(int, __mode_t); 113 int sys_fchown(int, __uid_t, __gid_t); 114 int sys_statfs(const char *, struct statfs *); 115 int sys_fstatfs(unsigned int, struct statfs *); 116 int sys_ioperm(unsigned long int, unsigned long int, int); 117 int sys_socketcall(int, unsigned long int *); 118 int sys_setitimer(int, const struct itimerval *, struct itimerval *); 119 int sys_getitimer(int, struct itimerval *); 120 int sys_newstat(const char *, struct new_stat *); 121 int sys_newlstat(const char *, struct new_stat *); 122 int sys_newfstat(unsigned int, struct new_stat *); 123 int sys_uname(struct old_utsname *); 124 int sys_iopl(int, int, int, int, int, struct sigcontext *); 125 int sys_wait4(__pid_t, int *, int, struct rusage *); 126 int sys_sysinfo(struct sysinfo *); 127 int sys_fsync(int); 128 int sys_sigreturn(unsigned int, int, int, int, int, struct sigcontext *); 129 int sys_setdomainname(const char *, int); 130 int sys_newuname(struct new_utsname *); 131 int sys_mprotect(unsigned int, __size_t, int); 132 int sys_sigprocmask(int, const __sigset_t *, __sigset_t *); 133 int sys_getpgid(__pid_t); 134 int sys_fchdir(unsigned int); 135 int sys_personality(unsigned long int); 136 int sys_setfsuid(__uid_t); 137 int sys_setfsgid(__gid_t); 138 int sys_llseek(unsigned int, unsigned long int, unsigned long int, __loff_t *, unsigned int); 139 int sys_getdents(unsigned int, struct dirent *, unsigned int); 140 int sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *); 141 int sys_flock(int, int); 142 int sys_getsid(__pid_t); 143 int sys_fdatasync(int); 144 int sys_nanosleep(const struct timespec *, struct timespec *); 145 int sys_getcwd(char *, __size_t); 146 147 #endif /* _FIWIX_SYSCALLS_H */