1 #ifndef __LIB_USER_SYSCALL_H
2 #define __LIB_USER_SYSCALL_H
8 #define PID_ERROR ((pid_t) -1)
11 #define MAP_FAILED ((mapid_t) -1)
13 void halt (void) NO_RETURN;
14 void exit (int status) NO_RETURN;
15 pid_t exec (const char *file);
17 bool create (const char *file, unsigned initial_size);
18 bool remove (const char *file);
19 int open (const char *file);
20 int filesize (int fd);
21 int read (int fd, void *buffer, unsigned length);
22 int write (int fd, const void *buffer, unsigned length);
23 void seek (int fd, unsigned position);
24 unsigned tell (int fd);
26 mapid_t mmap (int fd, void *addr);
27 void munmap (mapid_t);
28 bool chdir (const char *dir);
29 bool mkdir (const char *dir);
32 #endif /* lib/user/syscall.h */