xv6-riscv-kernel/user/user.h

125 lines
1.7 KiB
C
Raw Normal View History

#pragma once
#include "../kernel/types.h"
2007-08-28 06:20:25 +02:00
struct stat;
2024-08-07 08:26:50 +02:00
/**
* System calls
*/
/** Create a child process */
int fork(void);
/** Exit (terminate) the calling process */
int exit(int) __attribute__((noreturn));
/** Blocks the calling process until child process terminates. */
int wait(int *);
/** pipe */
int pipe(int *);
/** write */
int write(int, const void *, int);
/** read */
int read(int, void *, int);
/** close */
int close(int);
/** kill */
int kill(int);
/** exec */
int exec(const char *, char **);
/** open */
int open(const char *, int);
/** mknod */
int mknod(const char *, short, short);
/** unlink */
int unlink(const char *);
/** fstat */
int fstat(int fd, struct stat *);
/** link */
int link(const char *, const char *);
/** mkdir */
int mkdir(const char *);
/** chdir */
int chdir(const char *);
/** dup */
int dup(int);
/** getpid */
int getpid(void);
/** sbrk */
2024-06-15 16:55:06 +02:00
char *sbrk(int);
2024-08-07 08:26:50 +02:00
/** sleep */
int sleep(int);
/** uptime */
int uptime(void);
/** trace */
int trace(int);
/**
* Library functions (ulib.c)
*/
/** stat */
int stat(const char *, struct stat *);
/** strcpy */
2024-06-15 16:55:06 +02:00
char *strcpy(char *, const char *);
2024-08-07 08:26:50 +02:00
/** memmove */
2024-06-15 16:55:06 +02:00
void *memmove(void *, const void *, int);
2024-08-07 08:26:50 +02:00
/** strchr */
2024-06-15 16:55:06 +02:00
char *strchr(const char *, char c);
2024-08-07 08:26:50 +02:00
/** strcmp */
int strcmp(const char *, const char *);
/** fprintf */
void fprintf(int, const char *, ...);
/** printf */
void printf(const char *, ...);
/** gets */
2024-06-15 16:55:06 +02:00
char *gets(char *, int max);
2024-08-07 08:26:50 +02:00
/** strlen */
u32 strlen(const char *);
/** memset */
2024-06-15 16:55:06 +02:00
void *memset(void *, int, u32);
2024-08-07 08:26:50 +02:00
/** malloc */
2024-06-15 16:55:06 +02:00
void *malloc(u32);
2024-08-07 08:26:50 +02:00
/** free */
void free(void *);
/** atoi */
int atoi(const char *);
/** memcmp */
int memcmp(const void *, const void *, u32);
/** memcpy */
2024-05-24 11:26:40 +02:00
void *memcpy(void *, const void *, u32);