Rename printk() to printf().
[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)
33 {
34   return syscall (SYS_create, file);
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 read (int fd, void *buffer, unsigned size)
51 {
52   return syscall (SYS_read, fd, buffer, size);
53 }
54
55 int
56 write (int fd, const void *buffer, unsigned size)
57 {
58   return syscall (SYS_write, fd, buffer, size);
59 }
60
61 void
62 close (int fd)
63 {
64   syscall (SYS_close, fd);
65 }