/** * \file misc/unistd.hh * \brief unistd.h syscall wrappers. */ #pragma once #include #include #include #include #include #include "misc/fd.hh" #include "misc/sys-wrapper.hh" namespace sys { /** * \brief close(2). */ inline auto close = make_wrapper(::close); /** * \brief fork(2). */ inline auto fork = make_wrapper(::fork); /** * \brief fstat(2). */ inline auto fstat = make_wrapper(::fstat); /** * \brief kill(2). */ inline auto kill = make_wrapper(::kill); static int open_wrapper(const char* path, int flags) { return ::open(path, flags); } /** * \brief open(2). * * Since open is a variadic syscall we need to call a helper with a * fixed number of parameters to create a wrapper out of it. */ inline auto open = make_wrapper(open_wrapper); /** * \brief wait(2). */ inline auto waitpid = make_wrapper(::waitpid); } // namespace sys