Initial documentation for system calls

This commit is contained in:
Imbus 2024-08-07 08:26:50 +02:00
parent 2029279601
commit 065b782951

View file

@ -4,43 +4,121 @@
struct stat; struct stat;
// system calls /**
* System calls
*/
/** Create a child process */
int fork(void); int fork(void);
/** Exit (terminate) the calling process */
int exit(int) __attribute__((noreturn)); int exit(int) __attribute__((noreturn));
/** Blocks the calling process until child process terminates. */
int wait(int *); int wait(int *);
/** pipe */
int pipe(int *); int pipe(int *);
/** write */
int write(int, const void *, int); int write(int, const void *, int);
/** read */
int read(int, void *, int); int read(int, void *, int);
/** close */
int close(int); int close(int);
/** kill */
int kill(int); int kill(int);
/** exec */
int exec(const char *, char **); int exec(const char *, char **);
/** open */
int open(const char *, int); int open(const char *, int);
/** mknod */
int mknod(const char *, short, short); int mknod(const char *, short, short);
/** unlink */
int unlink(const char *); int unlink(const char *);
/** fstat */
int fstat(int fd, struct stat *); int fstat(int fd, struct stat *);
/** link */
int link(const char *, const char *); int link(const char *, const char *);
/** mkdir */
int mkdir(const char *); int mkdir(const char *);
/** chdir */
int chdir(const char *); int chdir(const char *);
/** dup */
int dup(int); int dup(int);
/** getpid */
int getpid(void); int getpid(void);
/** sbrk */
char *sbrk(int); char *sbrk(int);
/** sleep */
int sleep(int); int sleep(int);
/** uptime */
int uptime(void); int uptime(void);
/** trace */
int trace(int); int trace(int);
// ulib.c /**
* Library functions (ulib.c)
*/
/** stat */
int stat(const char *, struct stat *); int stat(const char *, struct stat *);
/** strcpy */
char *strcpy(char *, const char *); char *strcpy(char *, const char *);
/** memmove */
void *memmove(void *, const void *, int); void *memmove(void *, const void *, int);
/** strchr */
char *strchr(const char *, char c); char *strchr(const char *, char c);
/** strcmp */
int strcmp(const char *, const char *); int strcmp(const char *, const char *);
/** fprintf */
void fprintf(int, const char *, ...); void fprintf(int, const char *, ...);
/** printf */
void printf(const char *, ...); void printf(const char *, ...);
/** gets */
char *gets(char *, int max); char *gets(char *, int max);
/** strlen */
u32 strlen(const char *); u32 strlen(const char *);
/** memset */
void *memset(void *, int, u32); void *memset(void *, int, u32);
/** malloc */
void *malloc(u32); void *malloc(u32);
/** free */
void free(void *); void free(void *);
/** atoi */
int atoi(const char *); int atoi(const char *);
/** memcmp */
int memcmp(const void *, const void *, u32); int memcmp(const void *, const void *, u32);
/** memcpy */
void *memcpy(void *, const void *, u32); void *memcpy(void *, const void *, u32);