From: Ben Pfaff Date: Thu, 9 Sep 2004 22:43:12 +0000 (+0000) Subject: Add new syscall stubs. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa3c96150e704a346f1a92cb52cd811514b24755;p=pintos-anon Add new syscall stubs. --- diff --git a/src/lib/user/syscall.c b/src/lib/user/syscall.c index 7395a3b..efabc01 100644 --- a/src/lib/user/syscall.c +++ b/src/lib/user/syscall.c @@ -63,3 +63,34 @@ close (int fd) { syscall (SYS_close, fd); } + +bool +mmap (int fd, void *addr, unsigned length) +{ + return syscall (SYS_mmap, fd, addr, length); +} + +bool +munmap (void *addr, unsigned length) +{ + return syscall (SYS_munmap, addr, length); +} + +bool +chdir (const char *dir) +{ + return syscall (SYS_chdir, dir); +} + +bool +mkdir (const char *dir) +{ + return syscall (SYS_mkdir, dir); +} + +void +lsdir (void) +{ + syscall (SYS_lsdir); +} + diff --git a/src/lib/user/syscall.h b/src/lib/user/syscall.h index e10d39e..a594016 100644 --- a/src/lib/user/syscall.h +++ b/src/lib/user/syscall.h @@ -8,13 +8,19 @@ typedef int pid_t; void halt (void) NO_RETURN; void exit (int status) NO_RETURN; -pid_t exec (const char *); +pid_t exec (const char *file); int join (pid_t); -bool create (const char *); -bool remove (const char *); -int open (const char *); -int read (int fd, void *, unsigned); -int write (int fd, const void *, unsigned); +bool create (const char *file); +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 close (int fd); +bool mmap (int fd, void *addr, unsigned length); +bool munmap (void *addr, unsigned length); +bool chdir (const char *dir); +bool mkdir (const char *dir); +void lsdir (void); #endif /* lib/user/syscall.h */