Ruby  1.9.3p547(2014-05-14revision45962)
init.c
Go to the documentation of this file.
1 /************************************************
2 
3  init.c -
4 
5  created at: Thu Mar 31 12:21:29 JST 1994
6 
7  Copyright (C) 1993-2007 Yukihiro Matsumoto
8 
9 ************************************************/
10 
11 #include "rubysocket.h"
12 
18 #ifdef AF_UNIX
19 VALUE rb_cUNIXSocket;
20 VALUE rb_cUNIXServer;
21 #endif
24 
26 
27 #ifdef SOCKS
28 VALUE rb_cSOCKSSocket;
29 #endif
30 
32 
33 void
34 rsock_raise_socket_error(const char *reason, int error)
35 {
36 #ifdef EAI_SYSTEM
37  if (error == EAI_SYSTEM) rb_sys_fail(reason);
38 #endif
39  rb_raise(rb_eSocket, "%s: %s", reason, gai_strerror(error));
40 }
41 
42 VALUE
43 rsock_init_sock(VALUE sock, int fd)
44 {
45  rb_io_t *fp;
46 #ifndef _WIN32
47  struct stat sbuf;
48 
49  if (fstat(fd, &sbuf) < 0)
50  rb_sys_fail(0);
51  rb_update_max_fd(fd);
52  if (!S_ISSOCK(sbuf.st_mode))
53  rb_raise(rb_eArgError, "not a socket file descriptor");
54 #else
55  if (!rb_w32_is_socket(fd))
56  rb_raise(rb_eArgError, "not a socket file descriptor");
57 #endif
58 
59  MakeOpenFile(sock, fp);
60  fp->fd = fd;
64  fp->mode |= FMODE_NOREVLOOKUP;
65  }
67 
68  return sock;
69 }
70 
71 VALUE
73 {
74  struct rsock_send_arg *arg = data;
75  VALUE mesg = arg->mesg;
76  return (VALUE)sendto(arg->fd, RSTRING_PTR(mesg), RSTRING_LEN(mesg),
77  arg->flags, arg->to, arg->tolen);
78 }
79 
80 VALUE
82 {
83  struct rsock_send_arg *arg = data;
84  VALUE mesg = arg->mesg;
85  return (VALUE)send(arg->fd, RSTRING_PTR(mesg), RSTRING_LEN(mesg),
86  arg->flags);
87 }
88 
89 struct recvfrom_arg {
90  int fd, flags;
92  socklen_t alen;
94 };
95 
96 static VALUE
97 recvfrom_blocking(void *data)
98 {
99  struct recvfrom_arg *arg = data;
100  return (VALUE)recvfrom(arg->fd, RSTRING_PTR(arg->str), RSTRING_LEN(arg->str),
101  arg->flags, (struct sockaddr*)&arg->buf, &arg->alen);
102 }
103 
104 VALUE
106 {
107  rb_io_t *fptr;
108  VALUE str, klass;
109  struct recvfrom_arg arg;
110  VALUE len, flg;
111  long buflen;
112  long slen;
113 
114  rb_scan_args(argc, argv, "11", &len, &flg);
115 
116  if (flg == Qnil) arg.flags = 0;
117  else arg.flags = NUM2INT(flg);
118  buflen = NUM2INT(len);
119 
120  GetOpenFile(sock, fptr);
121  if (rb_io_read_pending(fptr)) {
122  rb_raise(rb_eIOError, "recv for buffered IO");
123  }
124  arg.fd = fptr->fd;
125  arg.alen = (socklen_t)sizeof(arg.buf);
126 
127  arg.str = str = rb_tainted_str_new(0, buflen);
128  klass = RBASIC(str)->klass;
129  RBASIC(str)->klass = 0;
130 
131  while (rb_io_check_closed(fptr),
132  rb_thread_wait_fd(arg.fd),
133  (slen = BLOCKING_REGION_FD(recvfrom_blocking, &arg)) < 0) {
134  if (!rb_io_wait_readable(fptr->fd)) {
135  rb_sys_fail("recvfrom(2)");
136  }
137  if (RBASIC(str)->klass || RSTRING_LEN(str) != buflen) {
138  rb_raise(rb_eRuntimeError, "buffer string modified");
139  }
140  }
141 
142  RBASIC(str)->klass = klass;
143  if (slen < RSTRING_LEN(str)) {
144  rb_str_set_len(str, slen);
145  }
146  rb_obj_taint(str);
147  switch (from) {
148  case RECV_RECV:
149  return str;
150  case RECV_IP:
151 #if 0
152  if (arg.alen != sizeof(struct sockaddr_in)) {
153  rb_raise(rb_eTypeError, "sockaddr size differs - should not happen");
154  }
155 #endif
156  if (arg.alen && arg.alen != sizeof(arg.buf)) /* OSX doesn't return a from result for connection-oriented sockets */
157  return rb_assoc_new(str, rsock_ipaddr((struct sockaddr*)&arg.buf, fptr->mode & FMODE_NOREVLOOKUP));
158  else
159  return rb_assoc_new(str, Qnil);
160 
161 #ifdef HAVE_SYS_UN_H
162  case RECV_UNIX:
163  return rb_assoc_new(str, rsock_unixaddr((struct sockaddr_un*)&arg.buf, arg.alen));
164 #endif
165  case RECV_SOCKET:
166  return rb_assoc_new(str, rsock_io_socket_addrinfo(sock, (struct sockaddr*)&arg.buf, arg.alen));
167  default:
168  rb_bug("rsock_s_recvfrom called with bad value");
169  }
170 }
171 
172 VALUE
174 {
175  rb_io_t *fptr;
176  VALUE str;
177  struct sockaddr_storage buf;
178  socklen_t alen = (socklen_t)sizeof buf;
179  VALUE len, flg;
180  long buflen;
181  long slen;
182  int fd, flags;
183  VALUE addr = Qnil;
184 
185  rb_scan_args(argc, argv, "11", &len, &flg);
186 
187  if (flg == Qnil) flags = 0;
188  else flags = NUM2INT(flg);
189  buflen = NUM2INT(len);
190 
191 #ifdef MSG_DONTWAIT
192  /* MSG_DONTWAIT avoids the race condition between fcntl and recvfrom.
193  It is not portable, though. */
194  flags |= MSG_DONTWAIT;
195 #endif
196 
197  GetOpenFile(sock, fptr);
198  if (rb_io_read_pending(fptr)) {
199  rb_raise(rb_eIOError, "recvfrom for buffered IO");
200  }
201  fd = fptr->fd;
202 
203  str = rb_tainted_str_new(0, buflen);
204 
205  rb_io_check_closed(fptr);
206  rb_io_set_nonblock(fptr);
207  slen = recvfrom(fd, RSTRING_PTR(str), buflen, flags, (struct sockaddr*)&buf, &alen);
208 
209  if (slen < 0) {
210  switch (errno) {
211  case EAGAIN:
212 #if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
213  case EWOULDBLOCK:
214 #endif
215  rb_mod_sys_fail(rb_mWaitReadable, "recvfrom(2) would block");
216  }
217  rb_sys_fail("recvfrom(2)");
218  }
219  if (slen < RSTRING_LEN(str)) {
220  rb_str_set_len(str, slen);
221  }
222  rb_obj_taint(str);
223  switch (from) {
224  case RECV_RECV:
225  return str;
226 
227  case RECV_IP:
228  if (alen && alen != sizeof(buf)) /* connection-oriented socket may not return a from result */
229  addr = rsock_ipaddr((struct sockaddr*)&buf, fptr->mode & FMODE_NOREVLOOKUP);
230  break;
231 
232  case RECV_SOCKET:
233  addr = rsock_io_socket_addrinfo(sock, (struct sockaddr*)&buf, alen);
234  break;
235 
236  default:
237  rb_bug("rsock_s_recvfrom_nonblock called with bad value");
238  }
239  return rb_assoc_new(str, addr);
240 }
241 
242 int
243 rsock_socket(int domain, int type, int proto)
244 {
245  int fd;
246 
247  fd = socket(domain, type, proto);
248  if (fd < 0) {
249  if (errno == EMFILE || errno == ENFILE) {
250  rb_gc();
251  fd = socket(domain, type, proto);
252  }
253  }
254  if (0 <= fd)
255  rb_update_max_fd(fd);
256  return fd;
257 }
258 
259 static int
261 {
262  int sockerr;
263  socklen_t sockerrlen;
264  int revents;
265  int ret;
266 
267  for (;;) {
268  /*
269  * Stevens book says, succuessful finish turn on RB_WAITFD_OUT and
270  * failure finish turn on both RB_WAITFD_IN and RB_WAITFD_OUT.
271  */
273 
274  if (revents & (RB_WAITFD_IN|RB_WAITFD_OUT)) {
275  sockerrlen = (socklen_t)sizeof(sockerr);
276  ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen);
277 
278  /*
279  * Solaris getsockopt(SO_ERROR) return -1 and set errno
280  * in getsockopt(). Let's return immediately.
281  */
282  if (ret < 0)
283  break;
284  if (sockerr == 0) {
285  if (revents & RB_WAITFD_OUT)
286  break;
287  else
288  continue; /* workaround for winsock */
289  }
290 
291  /* BSD and Linux use sockerr. */
292  errno = sockerr;
293  ret = -1;
294  break;
295  }
296 
297  if ((revents & (RB_WAITFD_IN|RB_WAITFD_OUT)) == RB_WAITFD_OUT) {
298  ret = 0;
299  break;
300  }
301  }
302 
303  return ret;
304 }
305 
306 #ifdef __CYGWIN__
307 #define WAIT_IN_PROGRESS 10
308 #endif
309 #ifdef __APPLE__
310 #define WAIT_IN_PROGRESS 10
311 #endif
312 #ifdef __linux__
313 /* returns correct error */
314 #define WAIT_IN_PROGRESS 0
315 #endif
316 #ifndef WAIT_IN_PROGRESS
317 /* BSD origin code apparently has a problem */
318 #define WAIT_IN_PROGRESS 1
319 #endif
320 
321 struct connect_arg {
322  int fd;
323  const struct sockaddr *sockaddr;
324  socklen_t len;
325 };
326 
327 static VALUE
328 connect_blocking(void *data)
329 {
330  struct connect_arg *arg = data;
331  return (VALUE)connect(arg->fd, arg->sockaddr, arg->len);
332 }
333 
334 #if defined(SOCKS) && !defined(SOCKS5)
335 static VALUE
336 socks_connect_blocking(void *data)
337 {
338  struct connect_arg *arg = data;
339  return (VALUE)Rconnect(arg->fd, arg->sockaddr, arg->len);
340 }
341 #endif
342 
343 int
344 rsock_connect(int fd, const struct sockaddr *sockaddr, int len, int socks)
345 {
346  int status;
348  struct connect_arg arg;
349 #if WAIT_IN_PROGRESS > 0
350  int wait_in_progress = -1;
351  int sockerr;
352  socklen_t sockerrlen;
353 #endif
354 
355  arg.fd = fd;
356  arg.sockaddr = sockaddr;
357  arg.len = len;
358 #if defined(SOCKS) && !defined(SOCKS5)
359  if (socks) func = socks_connect_blocking;
360 #endif
361  for (;;) {
362  status = (int)BLOCKING_REGION_FD(func, &arg);
363  if (status < 0) {
364  switch (errno) {
365  case EINTR:
366 #if defined(ERESTART)
367  case ERESTART:
368 #endif
369  continue;
370 
371  case EAGAIN:
372 #ifdef EINPROGRESS
373  case EINPROGRESS:
374 #endif
375 #if WAIT_IN_PROGRESS > 0
376  sockerrlen = (socklen_t)sizeof(sockerr);
377  status = getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen);
378  if (status) break;
379  if (sockerr) {
380  status = -1;
381  errno = sockerr;
382  break;
383  }
384 #endif
385 #ifdef EALREADY
386  case EALREADY:
387 #endif
388 #if WAIT_IN_PROGRESS > 0
389  wait_in_progress = WAIT_IN_PROGRESS;
390 #endif
391  status = wait_connectable(fd);
392  if (status) {
393  break;
394  }
395  errno = 0;
396  continue;
397 
398 #if WAIT_IN_PROGRESS > 0
399  case EINVAL:
400  if (wait_in_progress-- > 0) {
401  /*
402  * connect() after EINPROGRESS returns EINVAL on
403  * some platforms, need to check true error
404  * status.
405  */
406  sockerrlen = (socklen_t)sizeof(sockerr);
407  status = getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen);
408  if (!status && !sockerr) {
409  struct timeval tv = {0, 100000};
410  rb_thread_wait_for(tv);
411  continue;
412  }
413  status = -1;
414  errno = sockerr;
415  }
416  break;
417 #endif
418 
419 #ifdef EISCONN
420  case EISCONN:
421  status = 0;
422  errno = 0;
423  break;
424 #endif
425  default:
426  break;
427  }
428  }
429  return status;
430  }
431 }
432 
433 static void
435 {
436  int flags;
437 #ifdef F_GETFL
438  flags = fcntl(fd, F_GETFL);
439  if (flags == -1) {
440  rb_sys_fail(0);
441  }
442 #else
443  flags = 0;
444 #endif
445  flags |= O_NONBLOCK;
446  if (fcntl(fd, F_SETFL, flags) == -1) {
447  rb_sys_fail(0);
448  }
449 }
450 
451 VALUE
452 rsock_s_accept_nonblock(VALUE klass, rb_io_t *fptr, struct sockaddr *sockaddr, socklen_t *len)
453 {
454  int fd2;
455  socklen_t len0 = len ? *len : 0;
456 
457  rb_secure(3);
458  rb_io_set_nonblock(fptr);
459  fd2 = accept(fptr->fd, (struct sockaddr*)sockaddr, len);
460  if (fd2 < 0) {
461  switch (errno) {
462  case EAGAIN:
463 #if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
464  case EWOULDBLOCK:
465 #endif
466  case ECONNABORTED:
467 #if defined EPROTO
468  case EPROTO:
469 #endif
470  rb_mod_sys_fail(rb_mWaitReadable, "accept(2) would block");
471  }
472  rb_sys_fail("accept(2)");
473  }
474  if (len && len0 < *len) *len = len0;
475  rb_update_max_fd(fd2);
476  make_fd_nonblock(fd2);
477  return rsock_init_sock(rb_obj_alloc(klass), fd2);
478 }
479 
480 struct accept_arg {
481  int fd;
483  socklen_t *len;
484 };
485 
486 static VALUE
487 accept_blocking(void *data)
488 {
489  struct accept_arg *arg = data;
490  int ret;
491  socklen_t len0 = 0;
492  if (arg->len) len0 = *arg->len;
493  ret = accept(arg->fd, arg->sockaddr, arg->len);
494  if (arg->len && len0 < *arg->len) *arg->len = len0;
495  return (VALUE)ret;
496 }
497 
498 VALUE
499 rsock_s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len)
500 {
501  int fd2;
502  int retry = 0;
503  struct accept_arg arg;
504 
505  rb_secure(3);
506  arg.fd = fd;
507  arg.sockaddr = sockaddr;
508  arg.len = len;
509  retry:
510  rb_thread_wait_fd(fd);
511  fd2 = (int)BLOCKING_REGION_FD(accept_blocking, &arg);
512  if (fd2 < 0) {
513  switch (errno) {
514  case EMFILE:
515  case ENFILE:
516  if (retry) break;
517  rb_gc();
518  retry = 1;
519  goto retry;
520  default:
521  if (!rb_io_wait_readable(fd)) break;
522  retry = 0;
523  goto retry;
524  }
525  rb_sys_fail(0);
526  }
527  rb_update_max_fd(fd2);
528  if (!klass) return INT2NUM(fd2);
529  return rsock_init_sock(rb_obj_alloc(klass), fd2);
530 }
531 
532 int
533 rsock_getfamily(int sockfd)
534 {
535  struct sockaddr_storage ss;
536  socklen_t sslen = (socklen_t)sizeof(ss);
537 
538  ss.ss_family = AF_UNSPEC;
539  if (getsockname(sockfd, (struct sockaddr*)&ss, &sslen) < 0)
540  return AF_UNSPEC;
541 
542  return ss.ss_family;
543 }
544 
545 void
547 {
548  /*
549  * SocketError is the error class for socket.
550  */
551  rb_eSocket = rb_define_class("SocketError", rb_eStandardError);
563 }
#define RSTRING_LEN(string)
Definition: generator.h:45
void rb_gc(void)
Definition: gc.c:3160
VALUE rb_eStandardError
Definition: error.c:465
struct sockaddr * sockaddr
Definition: init.c:482
void rb_bug(const char *fmt,...)
Definition: error.c:265
socklen_t tolen
Definition: rubysocket.h:251
#define FMODE_READWRITE
Definition: io.h:95
VALUE rsock_sendto_blocking(void *data)
Definition: init.c:72
void rb_update_max_fd(int fd)
Definition: io.c:156
void rb_io_set_nonblock(rb_io_t *fptr)
Definition: io.c:2124
void rb_io_synchronized(rb_io_t *)
Definition: io.c:5226
VALUE rb_cBasicSocket
Definition: init.c:13
#define NUM2INT(x)
Definition: ruby.h:536
socklen_t * len
Definition: init.c:483
Definition: io.h:53
VALUE rsock_ipaddr(struct sockaddr *sockaddr, int norevlookup)
Definition: raddrinfo.c:391
VALUE rb_eTypeError
Definition: error.c:467
VALUE rsock_init_sock(VALUE sock, int fd)
Definition: init.c:43
int fcntl(int, int,...)
Definition: win32.c:3579
void rsock_init_unixsocket(void)
Definition: unixsocket.c:504
VALUE str
Definition: init.c:91
static VALUE INT2NUM(int v)
Definition: ruby.h:981
#define RSTRING_PTR(string)
Definition: generator.h:42
void rsock_init_tcpserver(void)
Definition: tcpserver.c:132
VALUE rb_cIPSocket
Definition: init.c:14
void rb_raise(VALUE exc, const char *fmt,...)
Definition: error.c:1574
struct sockaddr * to
Definition: rubysocket.h:250
VALUE rsock_s_accept(VALUE klass, int fd, struct sockaddr *sockaddr, socklen_t *len)
Definition: init.c:499
sock_recv_type
Definition: rubysocket.h:258
#define FMODE_DUPLEX
Definition: io.h:99
#define FMODE_NOREVLOOKUP
Definition: rubysocket.h:171
void rsock_init_socket_constants(void)
Definition: constants.c:141
static void make_fd_nonblock(int fd)
Definition: init.c:434
int rsock_getfamily(int sockfd)
Definition: init.c:533
#define EINPROGRESS
Definition: win32.h:484
#define GetOpenFile(obj, fp)
Definition: io.h:110
void rsock_init_addrinfo(void)
Definition: raddrinfo.c:2182
VALUE rb_cTCPSocket
Definition: init.c:15
VALUE rsock_io_socket_addrinfo(VALUE io, struct sockaddr *addr, socklen_t len)
Definition: raddrinfo.c:2158
int rb_w32_is_socket(int)
Definition: win32.c:2198
#define RB_WAITFD_OUT
Definition: io.h:39
int mode
Definition: io.h:56
int fd
Definition: init.c:481
RUBY_EXTERN VALUE rb_mWaitReadable
Definition: ruby.h:1242
void rsock_init_tcpsocket(void)
Definition: tcpsocket.c:59
VALUE rb_obj_taint(VALUE)
Definition: object.c:791
#define F_SETFL
Definition: win32.h:588
VALUE rb_eRuntimeError
Definition: error.c:466
void rsock_init_sockssocket(void)
Definition: sockssocket.c:55
#define ECONNABORTED
Definition: win32.h:535
socklen_t len
Definition: init.c:324
VALUE rsock_send_blocking(void *data)
Definition: init.c:81
#define EALREADY
Definition: win32.h:487
int rsock_socket(int domain, int type, int proto)
Definition: init.c:243
#define WAIT_IN_PROGRESS
Definition: init.c:318
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
Definition: class.c:469
int fd
Definition: io.h:54
int argc
Definition: ruby.c:120
void rsock_init_ancdata(void)
Definition: ancdata.c:1776
static int wait_connectable(int fd)
Definition: init.c:260
VALUE rb_obj_alloc(VALUE)
Definition: object.c:1601
#define EAI_SYSTEM
Definition: addrinfo.h:88
arg
Definition: ripper.y:1287
void rsock_init_socket_init()
Definition: init.c:546
unsigned short ss_family
Definition: rubysocket.h:134
VALUE rb_cSocket
Definition: init.c:22
char * gai_strerror(int ecode)
Definition: getaddrinfo.c:202
SSL_METHOD *(* func)(void)
Definition: ossl_ssl.c:104
int errno
VALUE rsock_s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
Definition: init.c:105
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
Definition: class.c:1416
VALUE rb_assoc_new(VALUE car, VALUE cdr)
Definition: array.c:460
void rb_thread_wait_fd(int)
Definition: thread.c:2712
void rsock_init_udpsocket(void)
Definition: udpsocket.c:250
#define Qnil
Definition: ruby.h:367
VALUE rb_cTCPServer
Definition: init.c:16
int rsock_do_not_reverse_lookup
Definition: init.c:31
int type
Definition: tcltklib.c:107
unsigned long VALUE
Definition: ruby.h:88
#define RBASIC(obj)
Definition: ruby.h:904
int rb_wait_for_single_fd(int fd, int events, struct timeval *tv)
Definition: thread.c:2965
int fd
Definition: init.c:90
register unsigned int len
Definition: name2ctype.h:22210
VALUE rb_blocking_function_t(void *)
Definition: intern.h:822
void rb_sys_fail(const char *mesg)
Definition: error.c:1671
const struct sockaddr * sockaddr
Definition: init.c:323
VALUE rb_eSocket
Definition: init.c:25
void rb_thread_wait_for(struct timeval)
Definition: thread.c:974
int rb_io_read_pending(rb_io_t *)
Definition: io.c:693
#define EISCONN
Definition: win32.h:544
struct sockaddr_storage buf
Definition: init.c:93
void rb_mod_sys_fail(VALUE mod, const char *mesg)
Definition: error.c:1683
#define proto(p)
Definition: sdbm.h:60
void rsock_raise_socket_error(const char *reason, int error)
Definition: init.c:34
VALUE rb_io_ascii8bit_binmode(VALUE)
Definition: io.c:4309
int rsock_connect(int fd, const struct sockaddr *sockaddr, int len, int socks)
Definition: init.c:344
VALUE rb_cAddrinfo
Definition: init.c:23
#define O_NONBLOCK
Definition: win32.h:589
#define AF_UNSPEC
Definition: sockport.h:69
#define rb_str_set_len(str, length)
Definition: ruby_missing.h:30
#define EWOULDBLOCK
Definition: rubysocket.h:89
static VALUE connect_blocking(void *data)
Definition: init.c:328
VALUE rsock_s_accept_nonblock(VALUE klass, rb_io_t *fptr, struct sockaddr *sockaddr, socklen_t *len)
Definition: init.c:452
static VALUE accept_blocking(void *data)
Definition: init.c:487
void rsock_init_ipsocket(void)
Definition: ipsocket.c:292
socklen_t alen
Definition: init.c:92
void rsock_init_unixserver(void)
Definition: unixserver.c:139
RUBY_EXTERN VALUE rb_eIOError
Definition: ruby.h:1296
#define MakeOpenFile(obj, fp)
Definition: io.h:119
static VALUE recvfrom_blocking(void *data)
Definition: init.c:97
void rb_secure(int)
Definition: safe.c:79
void rsock_init_sockopt(void)
Definition: option.c:892
#define RB_WAITFD_IN
Definition: io.h:37
VALUE rb_tainted_str_new(const char *, long)
#define fstat(fd, st)
Definition: win32.h:202
#define stat(path, st)
Definition: win32.h:201
#define NULL
Definition: _sdbm.c:107
VALUE rsock_s_recvfrom_nonblock(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from)
Definition: init.c:173
int flags
Definition: init.c:90
int rb_io_wait_readable(int)
Definition: io.c:890
void rb_io_check_closed(rb_io_t *)
Definition: io.c:478
VALUE rb_eArgError
Definition: error.c:468
#define BLOCKING_REGION_FD(func, arg)
Definition: rubysocket.h:201
int fd
Definition: init.c:322
char ** argv
Definition: ruby.c:121
VALUE rb_cUDPSocket
Definition: init.c:17