13 #ifndef __STOUT_OS_POSIX_PIPE_HPP__ 14 #define __STOUT_OS_POSIX_PIPE_HPP__ 18 #include <sys/syscall.h> 35 std::array<int, 2> result;
38 #if defined(__FreeBSD__) && __FreeBSD_version >= 1000000 40 if (::pipe2(result.data(),
O_CLOEXEC) < 0) {
47 #if defined(__linux__) && defined(SYS_pipe2) 48 if (::syscall(SYS_pipe2, result.data(),
O_CLOEXEC) == 0) {
53 if (errno != ENOSYS) {
58 if (::
pipe(result.data()) < 0) {
87 #endif // __STOUT_OS_POSIX_PIPE_HPP__ Definition: nothing.hpp:16
Try< std::array< int, 2 > > pipe()
Definition: pipe.hpp:33
Definition: errorbase.hpp:36
Definition: errorbase.hpp:50
Definition: posix_signalhandler.hpp:23
constexpr int O_CLOEXEC
Definition: open.hpp:41
Try< Nothing > close(int fd)
Definition: close.hpp:24
Try< Nothing > cloexec(int fd)
Definition: fcntl.hpp:27
static Try error(const E &e)
Definition: try.hpp:43
bool isError() const
Definition: try.hpp:78
std::string error(const std::string &msg, uint32_t code)