25 lines
581 B
C
25 lines
581 B
C
#pragma once
|
|
|
|
#include <common.h>
|
|
|
|
#define stdin 0
|
|
#define stdout 1
|
|
#define stderr 2
|
|
|
|
#define PROT_NONE 0x0
|
|
#define PROT_READ 0x1
|
|
#define PROT_WRITE 0x2
|
|
#define PROT_EXEC 0x4
|
|
|
|
#define MAP_SHARED 0x01
|
|
#define MAP_PRIVATE 0x02
|
|
#define MAP_FIXED 0x10
|
|
#define MAP_ANONYMOUS 0x20
|
|
|
|
isize read(i32 fd, void* buf, usize size);
|
|
isize write(i32 fd, const void* buf, usize size);
|
|
void* mmap(void* addr, usize length, i32 prot, i32 flags, i32 fd, isize offset);
|
|
i32 mprotect(void* addr, usize len, i32 prot);
|
|
i32 ftruncate(i32 fd, isize length);
|
|
i32 memfd_create(const char* name, u32 flags);
|