1#ifndef __LIB_USER_SYSCALL_H
2#define __LIB_USER_SYSCALL_H
9#define PID_ERROR ((pid_t) -1)
13#define MAP_FAILED ((mapid_t) -1)
16#define READDIR_MAX_LEN 14
27bool create (
const char *
file,
unsigned initial_size);
31int read (
int fd,
void *
buffer,
unsigned length);
32int write (
int fd,
const void *
buffer,
unsigned length);
33void seek (
int fd,
unsigned position);
34unsigned tell (
int fd);
int read(int fd, void *buffer, unsigned length)
bool readdir(int fd, char name[READDIR_MAX_LEN+1])
bool chdir(const char *dir)
Project 4 only.
int pid_t
Process identifier.
mapid_t mmap(int fd, void *addr)
Project 3 and optionally project 4.
bool create(const char *file, unsigned initial_size)
int open(const char *file)
bool remove(const char *file)
int inumber(int fd)
lib/user/syscall.h
void exit(int status) NO_RETURN
void seek(int fd, unsigned position)
pid_t exec(const char *file)
void halt(void) NO_RETURN
Projects 2 and later.
#define READDIR_MAX_LEN
Maximum characters in a filename written by readdir().
int write(int fd, const void *buffer, unsigned length)
bool mkdir(const char *dir)
int mapid_t
Map region identifier.