Ruby  2.4.2p198(2017-09-14revision59899)
Macros | Functions
wait.c File Reference
#include "ruby.h"
#include "ruby/io.h"
#include <sys/types.h>
Include dependency graph for wait.c:

Go to the source code of this file.

Macros

#define ioctl_arg   int
 
#define ioctl_arg2num(i)   INT2NUM(i)
 
#define FIONREAD_POSSIBLE_P(fd)   ((void)(fd),Qtrue)
 

Functions

static VALUE io_ready_p _ ((VALUE io))
 
static VALUE io_wait_readable _ ((int argc, VALUE *argv, VALUE io))
 
void Init_wait _ ((void))
 
static struct timevalget_timeout (int argc, VALUE *argv, struct timeval *timerec)
 
static int wait_for_single_fd (rb_io_t *fptr, int events, struct timeval *tv)
 
static VALUE io_nread (VALUE io)
 
static VALUE io_ready_p (VALUE io)
 
static VALUE io_wait_readable (int argc, VALUE *argv, VALUE io)
 
static VALUE io_wait_writable (int argc, VALUE *argv, VALUE io)
 
static int wait_mode_sym (VALUE mode)
 
static VALUE io_wait_readwrite (int argc, VALUE *argv, VALUE io)
 
void Init_wait (void)
 

Macro Definition Documentation

◆ FIONREAD_POSSIBLE_P

#define FIONREAD_POSSIBLE_P (   fd)    ((void)(fd),Qtrue)

Definition at line 39 of file wait.c.

Referenced by io_nread().

◆ ioctl_arg

#define ioctl_arg   int

Definition at line 32 of file wait.c.

Referenced by io_nread().

◆ ioctl_arg2num

#define ioctl_arg2num (   i)    INT2NUM(i)

Definition at line 33 of file wait.c.

Referenced by io_nread().

Function Documentation

◆ _() [1/3]

static VALUE io_ready_p _ ( (VALUE io)  )
static

◆ _() [2/3]

static VALUE io_wait_writable _ ( (int argc, VALUE *argv, VALUE io)  )
static

◆ _() [3/3]

void Init_wait _ ( (void)  )

◆ get_timeout()

static struct timeval* get_timeout ( int  argc,
VALUE argv,
struct timeval timerec 
)
static

Definition at line 48 of file wait.c.

References NIL_P, NULL, Qnil, rb_check_arity, and rb_time_interval().

Referenced by io_wait_readable(), and io_wait_writable().

◆ Init_wait()

void Init_wait ( void  )

◆ io_nread()

static VALUE io_nread ( VALUE  io)
static

◆ io_ready_p()

static VALUE io_ready_p ( VALUE  io)
static

◆ io_wait_readable()

static VALUE io_wait_readable ( int  argc,
VALUE argv,
VALUE  io 
)
static

◆ io_wait_readwrite()

static VALUE io_wait_readwrite ( int  argc,
VALUE argv,
VALUE  io 
)
static

◆ io_wait_writable()

static VALUE io_wait_writable ( int  argc,
VALUE argv,
VALUE  io 
)
static

Definition at line 154 of file wait.c.

References get_timeout(), GetOpenFile, Qnil, rb_io_check_writable(), RB_WAITFD_OUT, and wait_for_single_fd().

Referenced by Init_wait().

◆ wait_for_single_fd()

static int wait_for_single_fd ( rb_io_t fptr,
int  events,
struct timeval tv 
)
static

◆ wait_mode_sym()

static int wait_mode_sym ( VALUE  mode)
static

Definition at line 170 of file wait.c.

References ID2SYM, PRIsVALUE, rb_eArgError, rb_intern, rb_raise(), RB_WAITFD_IN, and RB_WAITFD_OUT.

Referenced by io_wait_readwrite().