188576d35edbe205507fa2d61e6dc4644014be87
[pintos-anon] / src / lib / user / syscall.h
1 #ifndef __LIB_USER_SYSCALL_H
2 #define __LIB_USER_SYSCALL_H
3
4 #include <stdbool.h>
5 #include <debug.h>
6
7 typedef int pid_t;
8 #define PID_ERROR ((pid_t) -1)
9
10 void halt (void) NO_RETURN;
11 void exit (int status) NO_RETURN;
12 pid_t exec (const char *file);
13 int join (pid_t);
14 bool create (const char *file, unsigned initial_size);
15 bool remove (const char *file);
16 int open (const char *file);
17 int filesize (int fd);
18 int read (int fd, void *buffer, unsigned length);
19 int write (int fd, const void *buffer, unsigned length);
20 void seek (int fd, unsigned position);
21 unsigned tell (int fd);
22 void close (int fd);
23 bool mmap (int fd, void *addr, unsigned length);
24 bool munmap (void *addr, unsigned length);
25 bool chdir (const char *dir);
26 bool mkdir (const char *dir);
27 void lsdir (void);
28
29 #endif /* lib/user/syscall.h */