Add filesize() stub.
[pintos-anon] / src / lib / user / syscall.c
1 #include <syscall.h>
2 #include "syscall-stub.h"
3 #include "../syscall-nr.h"
4
5 void
6 halt (void)
7 {
8   syscall (SYS_halt);
9   NOT_REACHED ();
10 }
11
12 void
13 exit (int status)
14 {
15   syscall (SYS_exit, status);
16   NOT_REACHED ();
17 }
18
19 pid_t
20 exec (const char *file)
21 {
22   return syscall (SYS_exec, file);
23 }
24
25 int
26 join (pid_t pid)
27 {
28   return syscall (SYS_join, pid);
29 }
30
31 bool
32 create (const char *file, unsigned initial_size)
33 {
34   return syscall (SYS_create, file, initial_size);
35 }
36
37 bool
38 remove (const char *file)
39 {
40   return syscall (SYS_remove, file);
41 }
42
43 int
44 open (const char *file)
45 {
46   return syscall (SYS_open, file);
47 }
48
49 int
50 filesize (int fd) 
51 {
52   return syscall (SYS_filesize, fd);
53 }
54
55 int
56 read (int fd, void *buffer, unsigned size)
57 {
58   return syscall (SYS_read, fd, buffer, size);
59 }
60
61 int
62 write (int fd, const void *buffer, unsigned size)
63 {
64   return syscall (SYS_write, fd, buffer, size);
65 }
66
67 void
68 seek (int fd, unsigned position) 
69 {
70   syscall (SYS_seek, fd, position);
71 }
72
73 unsigned
74 tell (int fd) 
75 {
76   return syscall (SYS_tell, fd);
77 }
78
79 void
80 close (int fd)
81 {
82   syscall (SYS_close, fd);
83 }
84
85 bool
86 mmap (int fd, void *addr, unsigned length)
87 {
88   return syscall (SYS_mmap, fd, addr, length);
89 }
90
91 bool
92 munmap (void *addr, unsigned length)
93 {
94   return syscall (SYS_munmap, addr, length);
95 }
96
97 bool
98 chdir (const char *dir)
99 {
100   return syscall (SYS_chdir, dir);
101 }
102
103 bool
104 mkdir (const char *dir)
105 {
106   return syscall (SYS_mkdir, dir);
107 }
108
109 void
110 lsdir (void)
111 {
112   syscall (SYS_lsdir);
113 }
114