Sha256: fee76f762ec44cc837ab898f91884a0fa077154ef66feea25a049a841e27b18e
Contents?: true
Size: 438 Bytes
Versions: 6
Compression:
Stored size: 438 Bytes
Contents
#ifndef SLEEPY_PENGUIN_NONBLOCK_H #define SLEEPY_PENGUIN_NONBLOCK_H #include <unistd.h> #include <fcntl.h> #include <ruby.h> static void set_nonblock(int fd) { int flags = fcntl(fd, F_GETFL); if (flags == -1) rb_sys_fail("fcntl(F_GETFL)"); if ((flags & O_NONBLOCK) == O_NONBLOCK) return; flags = fcntl(fd, F_SETFL, flags | O_NONBLOCK); if (flags == -1) rb_sys_fail("fcntl(F_SETFL)"); } #endif /* SLEEPY_PENGUIN_NONBLOCK_H */
Version data entries
6 entries across 6 versions & 1 rubygems