2 #include <sys/utsname.h>
4 /* true if TCP Fast Open is usable */
7 static void tfo_maybe(void)
9 VALUE mKgio
= rb_define_module("Kgio");
11 /* Deal with the case where system headers have not caught up */
13 /* Ensure Linux 3.7 or later for TCP_FASTOPEN */
19 if (sscanf(buf
.release
, "%u.%u", &maj
, &min
) != 2)
21 if (maj
< 3 || (maj
== 3 && min
< 7))
26 * KGIO_TFO_MAYBE will be false if a distro backports TFO
27 * to a pre-3.7 kernel, but includes the necessary constants
30 #if defined(MSG_FASTOPEN) && defined(TCP_FASTOPEN)
31 rb_define_const(mKgio
, "TCP_FASTOPEN", INT2NUM(TCP_FASTOPEN
));
32 rb_define_const(mKgio
, "MSG_FASTOPEN", INT2NUM(MSG_FASTOPEN
));
37 void Init_kgio_ext(void)
41 init_kgio_read_write();