7#if defined(__cplusplus) 
   42#define PRIORITY_MAX 64 
   43#define PRIORITY_MAX_USER 32 
   76#define SPAWN_INHERIT_PRIORITY (1 << 0) 
   85        .child = FD_NONE, .parent = FD_NONE \ 
 
  140#define PAGE_SIZE 0x1000 
  151#define BYTES_TO_PAGES(amount) (((amount) + PAGE_SIZE - 1) / PAGE_SIZE) 
  161#define PAGE_SIZE_OF(object) BYTES_TO_PAGES(sizeof(object)) 
  238#define FUTEX_ALL UINT64_MAX 
  288#if defined(__cplusplus) 
pid_t spawn(const char **argv, const spawn_fd_t *fds, const char *cwd, spawn_attr_t *attr)
System call for creating child processes.
uint64_t spawn_flags_t
Spawn behaviour flags.
uint64_t mprotect(void *address, uint64_t length, prot_t prot)
System call to change the protection flags of memory.
futex_op_t
Futex operation enum.
tid_t gettid(void)
System call to retrieve the current tid.
void * mmap(fd_t fd, void *address, uint64_t length, prot_t prot)
System call to map memory from a file.
uint64_t futex(atomic_uint64_t *addr, uint64_t val, futex_op_t op, clock_t timeout)
System call for fast user space mutual exclusion.
uint64_t munmap(void *address, uint64_t length)
System call to unmap mapped memory.
clock_t uptime(void)
System call for retreving the time since boot.
prot_t
Memory protection flags.
pid_t getpid(void)
System call to retrieve the current pid.
uint8_t priority_t
Priority type.
uint64_t nanosleep(clock_t timeout)
System call for sleeping.
@ FUTEX_WAKE
The futex operation for waking up a amount of threads specified by the val argument.
@ FUTEX_WAIT
The futex operating for waiting until the value pointed to by addr is not equal to val.
@ PROT_READ
Memory can be read from.
@ PROT_WRITE
Memory can be written to.
__UINT64_TYPE__ tid_t
Thread Identifier.
__UINT64_TYPE__ fd_t
A file descriptor.
__UINT64_TYPE__ pid_t
Process Identifier.
__UINT64_TYPE__ clock_t
A nanosecond time.
Stucture used to duplicate fds in spawn().
fd_t child
The destination file descriptor in the child.
fd_t parent
The source file descriptor in the parent.
atomic_uint64_t value
The value of the sync object.