16 #include <sys/types.h> 17 #if defined(HAVE_UNISTD_H) && (defined(__sun)) 20 #if defined(HAVE_SYS_IOCTL_H) 21 #include <sys/ioctl.h> 23 #if defined(FIONREAD_HEADER) 24 #include FIONREAD_HEADER 27 #ifdef HAVE_RB_W32_IOCTLSOCKET 28 #define ioctl ioctlsocket 29 #define ioctl_arg u_long 30 #define ioctl_arg2num(i) ULONG2NUM(i) 33 #define ioctl_arg2num(i) INT2NUM(i) 36 #ifdef HAVE_RB_W32_IS_SOCKET 37 #define FIONREAD_POSSIBLE_P(fd) rb_w32_is_socket(fd) 39 #define FIONREAD_POSSIBLE_P(fd) ((void)(fd),Qtrue) 52 if (!argc ||
NIL_P(timeout = argv[0])) {
89 if (len > 0)
return INT2FIX(len);
129 io_wait_readable(
int argc,
VALUE *argv,
VALUE io)
137 tv = get_timeout(argc, argv, &timerec);
154 io_wait_writable(
int argc,
VALUE *argv,
VALUE io)
162 tv = get_timeout(argc, argv, &timerec);
170 wait_mode_sym(
VALUE mode)
215 io_wait_readwrite(
int argc,
VALUE *argv,
VALUE io)
224 for (i = 0; i <
argc; ++i) {
226 event |= wait_mode_sym(argv[i]);
237 if (wait_for_single_fd(fptr, event, tv))
struct timeval rb_time_interval(VALUE num)
void rb_io_check_readable(rb_io_t *)
void rb_raise(VALUE exc, const char *fmt,...)
#define FIONREAD_POSSIBLE_P(fd)
#define GetOpenFile(obj, fp)
void rb_sys_fail(const char *mesg)
int rb_wait_for_single_fd(int fd, int events, struct timeval *tv)
register unsigned int len
int rb_io_read_pending(rb_io_t *)
void rb_io_check_writable(rb_io_t *)
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
void rb_io_check_closed(rb_io_t *)