projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use standard POSIX "ustar" format for the scratch disk.
[pintos-anon]
/
src
/
lib
/
user
/
syscall.c
diff --git
a/src/lib/user/syscall.c
b/src/lib/user/syscall.c
index 6fc26edcc333db9e66cbf0b458e252387336d9ef..a9c5bc8500c517f58169a52c1dee5f1b78a3edff 100644
(file)
--- a/
src/lib/user/syscall.c
+++ b/
src/lib/user/syscall.c
@@
-64,110
+64,121
@@
void
halt (void)
{
void
halt (void)
{
- syscall0 (SYS_
halt
);
+ syscall0 (SYS_
HALT
);
NOT_REACHED ();
}
void
exit (int status)
{
NOT_REACHED ();
}
void
exit (int status)
{
- syscall1 (SYS_
exit
, status);
+ syscall1 (SYS_
EXIT
, status);
NOT_REACHED ();
}
pid_t
exec (const char *file)
{
NOT_REACHED ();
}
pid_t
exec (const char *file)
{
- return (pid_t) syscall1 (SYS_
exec
, file);
+ return (pid_t) syscall1 (SYS_
EXEC
, file);
}
int
wait (pid_t pid)
{
}
int
wait (pid_t pid)
{
- return syscall1 (SYS_
wait
, pid);
+ return syscall1 (SYS_
WAIT
, pid);
}
bool
create (const char *file, unsigned initial_size)
{
}
bool
create (const char *file, unsigned initial_size)
{
- return syscall2 (SYS_
create
, file, initial_size);
+ return syscall2 (SYS_
CREATE
, file, initial_size);
}
bool
remove (const char *file)
{
}
bool
remove (const char *file)
{
- return syscall1 (SYS_
remove
, file);
+ return syscall1 (SYS_
REMOVE
, file);
}
int
open (const char *file)
{
}
int
open (const char *file)
{
- return syscall1 (SYS_
open
, file);
+ return syscall1 (SYS_
OPEN
, file);
}
int
filesize (int fd)
{
}
int
filesize (int fd)
{
- return syscall1 (SYS_
filesize
, fd);
+ return syscall1 (SYS_
FILESIZE
, fd);
}
int
read (int fd, void *buffer, unsigned size)
{
}
int
read (int fd, void *buffer, unsigned size)
{
- return syscall3 (SYS_
read
, fd, buffer, size);
+ return syscall3 (SYS_
READ
, fd, buffer, size);
}
int
write (int fd, const void *buffer, unsigned size)
{
}
int
write (int fd, const void *buffer, unsigned size)
{
- return syscall3 (SYS_
write
, fd, buffer, size);
+ return syscall3 (SYS_
WRITE
, fd, buffer, size);
}
void
seek (int fd, unsigned position)
{
}
void
seek (int fd, unsigned position)
{
- syscall2 (SYS_
seek
, fd, position);
+ syscall2 (SYS_
SEEK
, fd, position);
}
unsigned
tell (int fd)
{
}
unsigned
tell (int fd)
{
- return syscall1 (SYS_
tell
, fd);
+ return syscall1 (SYS_
TELL
, fd);
}
void
close (int fd)
{
}
void
close (int fd)
{
- syscall1 (SYS_
close
, fd);
+ syscall1 (SYS_
CLOSE
, fd);
}
mapid_t
mmap (int fd, void *addr)
{
}
mapid_t
mmap (int fd, void *addr)
{
- return syscall2 (SYS_
mmap
, fd, addr);
+ return syscall2 (SYS_
MMAP
, fd, addr);
}
void
munmap (mapid_t mapid)
{
}
void
munmap (mapid_t mapid)
{
- syscall1 (SYS_
munmap
, mapid);
+ syscall1 (SYS_
MUNMAP
, mapid);
}
bool
chdir (const char *dir)
{
}
bool
chdir (const char *dir)
{
- return syscall1 (SYS_
chdir
, dir);
+ return syscall1 (SYS_
CHDIR
, dir);
}
bool
mkdir (const char *dir)
{
}
bool
mkdir (const char *dir)
{
- return syscall1 (SYS_
mkdir
, dir);
+ return syscall1 (SYS_
MKDIR
, dir);
}
}
-void
-lsdir (void)
+bool
+readdir (int fd, char name[READDIR_MAX_LEN + 1])
{
{
-
syscall0 (SYS_lsdir
);
+
return syscall2 (SYS_READDIR, fd, name
);
}
}
+bool
+isdir (int fd)
+{
+ return syscall1 (SYS_ISDIR, fd);
+}
+
+int
+inumber (int fd)
+{
+ return syscall1 (SYS_INUMBER, fd);
+}