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__
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:49
Try< Nothing > nonblock(int fd)
Definition: fcntl.hpp:71
Try< Nothing > cloexec(int fd)
Definition: fcntl.hpp:27
const mode_t O_NONBLOCK
Definition: windows.hpp:341
#define flags
Definition: decoder.hpp:18
Try< Nothing > unsetCloexec(int fd)
Definition: fcntl.hpp:43