2021-12-03 14:05:10 +00:00
|
|
|
#ifndef LIBLINUX_H
|
|
|
|
#define LIBLINUX_H
|
|
|
|
|
2021-12-09 12:22:16 +00:00
|
|
|
#include <liblinux/syscall.h>
|
2021-12-03 14:05:10 +00:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <sys/types.h>
|
2021-12-26 13:01:42 +00:00
|
|
|
|
|
|
|
struct FILE {
|
|
|
|
int fd;
|
|
|
|
};
|
|
|
|
typedef struct FILE FILE;
|
|
|
|
|
|
|
|
extern FILE *stdin;
|
|
|
|
extern FILE *stdout;
|
|
|
|
extern FILE *stderr;
|
|
|
|
|
|
|
|
#define stdin stdin
|
|
|
|
#define stdout stdout
|
|
|
|
#define stderr stderr
|
2021-12-03 14:05:10 +00:00
|
|
|
|
2021-12-09 12:37:23 +00:00
|
|
|
void sys_exit(int status); // FIXME: noreturn
|
|
|
|
int sys_open(const char *pathname, int flags);
|
|
|
|
int sys_close(int fd);
|
2021-12-20 18:04:48 +00:00
|
|
|
ssize_t sys_write(FILE *fd, const void *buf, size_t count);
|
2021-12-09 12:37:23 +00:00
|
|
|
ssize_t sys_read(int fd, void *buf, size_t count);
|
2021-12-03 14:05:10 +00:00
|
|
|
|
|
|
|
// TODO
|
|
|
|
|
|
|
|
#endif
|