/* * Copyright (c) 2021, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace Core::System { #ifdef __serenity__ ErrorOr pledge(StringView promises, StringView execpromises); ErrorOr unveil(StringView path, StringView permissions); ErrorOr> pipe2(int flags); #endif ErrorOr sigaction(int signal, struct sigaction const* action, struct sigaction* old_action); ErrorOr fstat(int fd); ErrorOr fcntl(int fd, int command, ...); ErrorOr mmap(void* address, size_t, int protection, int flags, int fd, off_t, size_t alignment = 0, StringView name = {}); ErrorOr munmap(void* address, size_t); ErrorOr open(StringView path, int options, ...); ErrorOr close(int fd); ErrorOr ftruncate(int fd, off_t length); ErrorOr stat(StringView path); ErrorOr read(int fd, Bytes buffer); ErrorOr write(int fd, ReadonlyBytes buffer); ErrorOr kill(pid_t, int signal); ErrorOr dup2(int source_fd, int destination_fd); ErrorOr ptsname(int fd); ErrorOr gethostname(); }