From 1d2a6f21294f8390b683e4e097cb49210ed832d1 Mon Sep 17 00:00:00 2001 From: johannst Date: Fri, 26 Mar 2021 23:17:46 +0100 Subject: Added dyn allocator + syscall wrappers + minor fixes. --- lib/include/syscalls.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib/include/syscalls.h (limited to 'lib/include/syscalls.h') diff --git a/lib/include/syscalls.h b/lib/include/syscalls.h new file mode 100644 index 0000000..34b6b37 --- /dev/null +++ b/lib/include/syscalls.h @@ -0,0 +1,23 @@ +// Copyright (c) 2021 Johannes Stoelp + +#pragma once + +#include // size_t +#include // ssize_t, off_t, ... + +// Syscall definitions taken from corresponding man pages, eg +// open(2) +// read(2) +// ... + +#define O_RDONLY 00 +int open(const char* path, int flags); + +ssize_t read(int fd, void* buf, size_t count); + +#define SEEK_SET 0 +#define SEEK_CUR 1 +#define SEEK_END 2 +off_t lseek(int fd, off_t offset, int whence); + +void _exit(int status); -- cgit v1.2.3