2026-07-06 22:13:57 -05:00
|
|
|
#ifndef RLIBC_SYSCALL_H
|
|
|
|
|
#define RLIBC_SYSCALL_H
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
2026-07-07 00:13:24 -05:00
|
|
|
#define SYS_EXIT 1
|
|
|
|
|
#define SYS_READ 3
|
|
|
|
|
#define SYS_WRITE 4
|
2026-07-08 21:15:30 -05:00
|
|
|
#define SYS_OPEN 5
|
|
|
|
|
#define SYS_CLOSE 6
|
2026-07-14 00:07:50 -05:00
|
|
|
#define SYS_BRK 12
|
|
|
|
|
#define SYS_SBRK 13
|
2026-07-07 00:13:24 -05:00
|
|
|
#define SYS_PTY 20
|
|
|
|
|
#define SYS_FORK 21
|
2026-07-08 21:15:30 -05:00
|
|
|
#define SYS_EXEC 22
|
|
|
|
|
#define SYS_DUP2 23
|
2026-07-12 20:13:13 -05:00
|
|
|
#define SYS_LSEEK 24
|
|
|
|
|
#define SYS_WAIT 25
|
2026-07-16 14:44:08 -05:00
|
|
|
#define SYS_MMAP 26
|
|
|
|
|
#define SYS_IOCTL 27
|
2026-07-06 22:13:57 -05:00
|
|
|
|
2026-07-08 21:15:30 -05:00
|
|
|
int open(const char* path);
|
2026-07-06 22:13:57 -05:00
|
|
|
int write(int fd, const void *buf, size_t count);
|
|
|
|
|
int read(int fd, void *buf, size_t count);
|
|
|
|
|
int close(int fd);
|
|
|
|
|
|
2026-07-12 04:37:46 -05:00
|
|
|
int lseek(int fd, size_t offset, int whence);
|
2026-07-06 22:13:57 -05:00
|
|
|
|
2026-07-16 14:44:08 -05:00
|
|
|
void* mmap(int fd);
|
|
|
|
|
|
2026-07-06 22:13:57 -05:00
|
|
|
void exit(int status) __attribute__((noreturn));
|
|
|
|
|
|
2026-07-14 00:07:50 -05:00
|
|
|
void* sbrk(int32_t increment);
|
2026-07-06 22:13:57 -05:00
|
|
|
int brk(void *addr);
|
|
|
|
|
|
2026-07-07 00:13:24 -05:00
|
|
|
int pty(int* slave);
|
2026-07-08 21:15:30 -05:00
|
|
|
|
2026-07-07 00:13:24 -05:00
|
|
|
int fork();
|
2026-07-08 21:15:30 -05:00
|
|
|
int exec(const char* path);
|
|
|
|
|
int dup2(int src, int dst);
|
2026-07-12 20:13:13 -05:00
|
|
|
int waitpid(int pid, int* status);
|
2026-07-07 00:13:24 -05:00
|
|
|
|
2026-07-16 14:44:08 -05:00
|
|
|
int ioctl(int fd, uint32_t request, void* arg);
|
|
|
|
|
|
2026-07-06 22:13:57 -05:00
|
|
|
#endif
|