From: "Iñaki Baz Castillo" Date: 2012-03-12T05:02:03+09:00 Subject: Re: [C extension] How to detect Linux Kernel and glibc version? 2012/3/8 Eric Wong : > I assume you meant ext/kgio/missing_accept4.h and not the actual diff: > > $ sed -ne 8,14p < ~/kgio/ext/kgio/missing_accept4.h > #    if (02000000 == O_NONBLOCK) > #      define SOCK_CLOEXEC 1 > #      define SOCK_NONBLOCK 2 > #    else > #      define SOCK_CLOEXEC 02000000 > #      define SOCK_NONBLOCK O_NONBLOCK > #    endif > > I'm just defining SOCK_* macros so the wrapper function has a way > of making sense of those flags and expose an interface similar > to the accept4() syscall.  Those macros eventually get defined > to the corresponding Kgio::SOCK_* constants in Ruby. > > This compatibility workaround of defining macros that look like > system-provide ones is only safe for use private headers, though. > (Don't do anything crazy like resolve the Ruby constants to >  Integers in your source and expect those Integers to work across >  upgrades/different platforms) Clear, thanks a lot. -- Iñaki Baz Castillo