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)
65 if (len > 0)
return len;
91 if (n > 0)
return Qtrue;
117 if (
NIL_P(timeout)) {
132 if (n > 0)
return io;
156 if (
NIL_P(timeout)) {
struct timeval rb_time_interval(VALUE num)
void rb_io_check_readable(rb_io_t *)
static VALUE io_ready_p _((VALUE io))
#define FIONREAD_POSSIBLE_P(fd)
#define GetOpenFile(obj, fp)
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
static VALUE io_wait_readable(int argc, VALUE *argv, VALUE io)
int rb_wait_for_single_fd(int fd, int events, struct timeval *tv)
void rb_sys_fail(const char *mesg)
int rb_io_read_pending(rb_io_t *)
static VALUE io_wait_writable(int argc, VALUE *argv, VALUE io)
void rb_io_check_writable(rb_io_t *)
static VALUE io_nread(VALUE io)
static VALUE io_ready_p(VALUE io)
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
void rb_io_check_closed(rb_io_t *)