X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flib%2Fuser%2Fsyscall.h;h=f6294667428490acd3debb417c7c369981ca7a17;hb=39bf3b41bc3108e2d3ae994b3e1ebb16816b8673;hp=a594016cb1ff1db565f5739a97169f873d00167a;hpb=fa3c96150e704a346f1a92cb52cd811514b24755;p=pintos-anon diff --git a/src/lib/user/syscall.h b/src/lib/user/syscall.h index a594016..f629466 100644 --- a/src/lib/user/syscall.h +++ b/src/lib/user/syscall.h @@ -5,20 +5,26 @@ #include typedef int pid_t; +#define PID_ERROR ((pid_t) -1) + +typedef int mapid_t; +#define MAPID_ERROR ((mapid_t) -1) void halt (void) NO_RETURN; void exit (int status) NO_RETURN; pid_t exec (const char *file); int join (pid_t); -bool create (const char *file); +bool create (const char *file, unsigned initial_size); bool remove (const char *file); int open (const char *file); int filesize (int fd); int read (int fd, void *buffer, unsigned length); int write (int fd, const void *buffer, unsigned length); +void seek (int fd, unsigned position); +unsigned tell (int fd); void close (int fd); -bool mmap (int fd, void *addr, unsigned length); -bool munmap (void *addr, unsigned length); +mapid_t mmap (int fd, void *addr); +bool munmap (mapid_t); bool chdir (const char *dir); bool mkdir (const char *dir); void lsdir (void);