13 #ifndef __STOUT_OS_POSIX_FCNTL_HPP__ 14 #define __STOUT_OS_POSIX_FCNTL_HPP__ 29 int flags = ::fcntl(fd, F_GETFD);
35 if (::fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1) {
45 int flags = ::fcntl(fd, F_GETFD);
51 if (::fcntl(fd, F_SETFD, flags & ~FD_CLOEXEC) == -1) {
61 int flags = ::fcntl(fd, F_GETFD);
67 return (flags & FD_CLOEXEC) != 0;
73 int flags = ::fcntl(fd, F_GETFL);
79 if (::fcntl(fd, F_SETFL, flags |
O_NONBLOCK) == -1) {
89 int flags = ::fcntl(fd, F_GETFL);
100 #endif // __STOUT_OS_POSIX_FCNTL_HPP__ constexpr int O_NONBLOCK
Definition: open.hpp:31
Definition: nothing.hpp:16
Try< bool > isNonblock(int fd)
Definition: fcntl.hpp:87
Try< bool > isCloexec(int fd)
Definition: fcntl.hpp:59
Definition: errorbase.hpp:50
Definition: posix_signalhandler.hpp:23
Try< Nothing > nonblock(int fd)
Definition: fcntl.hpp:71
Try< Nothing > cloexec(int fd)
Definition: fcntl.hpp:27
Try< Nothing > unsetCloexec(int fd)
Definition: fcntl.hpp:43