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 #define READDIR_MAX_LEN 14
15 void halt (void) NO_RETURN;
16 void exit (int status) NO_RETURN;
17 pid_t exec (const char *file);
19 bool create (const char *file, unsigned initial_size);
20 bool remove (const char *file);
21 int open (const char *file);
22 int filesize (int fd);
23 int read (int fd, void *buffer, unsigned length);
24 int write (int fd, const void *buffer, unsigned length);
25 void seek (int fd, unsigned position);
26 unsigned tell (int fd);
28 mapid_t mmap (int fd, void *addr);
29 void munmap (mapid_t);
30 bool chdir (const char *dir);
31 bool mkdir (const char *dir);
32 bool readdir (int fd, char name[READDIR_MAX_LEN + 1]);
35 #endif /* lib/user/syscall.h */