11 #include <sys/types.h>
12 #include <sys/socket.h>
14 #include <netinet/in.h>
17 #include <arpa/inet.h>
21 #include "ancient_ruby.h"
31 void init_kgio_wait(void);
32 void init_kgio_read_write(void);
33 void init_kgio_accept(void);
34 void init_kgio_connect(void);
35 void init_kgio_autopush(void);
36 void init_kgio_poll(void);
37 void init_kgio_tryopen(void);
39 void kgio_autopush_accept(VALUE
, VALUE
);
40 void kgio_autopush_recv(VALUE
);
41 void kgio_autopush_send(VALUE
);
43 VALUE
kgio_call_wait_writable(VALUE io
);
44 VALUE
kgio_call_wait_readable(VALUE io
);
45 #if defined(HAVE_RB_THREAD_BLOCKING_REGION) && defined(HAVE_POLL)
46 # define USE_KGIO_POLL
47 #endif /* USE_KGIO_POLL */
49 #ifndef HAVE_RB_UPDATE_MAX_FD
50 # define rb_update_max_fd(fd) for (;0;)
54 * 2012/12/13 - Linux 3.7 was released on 2012/12/10 with TFO.
55 * Headers distributed with glibc will take some time to catch up and
56 * be officially released. Most GNU/Linux distros will take a few months
57 * to a year longer. "Enterprise" distros will probably take 5-7 years.
58 * So keep these until 2017 at least...
62 # define MSG_FASTOPEN 0x20000000 /* for clients */
65 # define TCP_FASTOPEN 23 /* for listeners */
67 /* we _may_ have TFO support */
68 # define KGIO_TFO_MAYBE (1)
69 #else /* rely entirely on standard system headers */
70 # define KGIO_TFO_MAYBE (0)
73 extern unsigned kgio_tfo
;