-#ifndef LIB_SYSCALL_NR_H
-#define LIB_SYSCALL_NR_H 1
+#ifndef __LIB_SYSCALL_NR_H
+#define __LIB_SYSCALL_NR_H
/* System call numbers. */
-#define SYS_halt 0 /* Halts the operating system. */
-#define SYS_exit 1 /* Terminates this process. */
-#define SYS_exec 2 /* Start another process. */
-#define SYS_join 3 /* Waits for a child process to die. */
-#define SYS_create 4 /* Creates a file. */
-#define SYS_remove 5 /* Deletes a file. */
-#define SYS_open 6 /* Opens a file. */
-#define SYS_read 7 /* Reads from a file. */
-#define SYS_write 8 /* Writes to a file. */
-#define SYS_close 9 /* Closes a file. */
-#define SYS_length 10 /* Obtains a file's size. */
-#define SYS_mmap 11 /* Maps a file into memory. */
-#define SYS_munmap 12 /* Removes a memory mapping. */
+enum
+ {
+ /* Projects 2 and later. */
+ SYS_HALT, /* Halts the operating system. */
+ SYS_EXIT, /* Terminates this process. */
+ SYS_EXEC, /* Start another process. */
+ SYS_WAIT, /* Waits for a child process to die. */
+ SYS_CREATE, /* Creates a file. */
+ SYS_REMOVE, /* Deletes a file. */
+ SYS_OPEN, /* Opens a file. */
+ SYS_FILESIZE, /* Obtains a file's size. */
+ SYS_READ, /* Reads from a file. */
+ SYS_WRITE, /* Writes to a file. */
+ SYS_SEEK, /* Change position in a file. */
+ SYS_TELL, /* Report current position in a file. */
+ SYS_CLOSE, /* Closes a file. */
-/* Predefined file handles. */
-#define STDIN_FILENO 0
-#define STDOUT_FILENO 1
+ /* Project 3 and optionally project 4. */
+ SYS_MMAP, /* Maps a file into memory. */
+ SYS_MUNMAP, /* Removes a memory mapping. */
+
+ /* Project 4 only. */
+ SYS_CHDIR, /* Changes the current directory. */
+ SYS_MKDIR, /* Create a directory. */
+ SYS_LSDIR /* Lists the current directory to stdout. */
+ };
#endif /* lib/syscall-nr.h */