[ruby-cvs:57666] normal:r50518 (trunk): ext/socket/init.c: use SOCK_NONBLOCK if available

normal at ruby-lang.org normal at ruby-lang.org
Sun May 17 14:56:09 JST 2015


normal	2015-05-17 14:56:07 +0900 (Sun, 17 May 2015)

  New Revision: 50518

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50518

  Log:
    ext/socket/init.c: use SOCK_NONBLOCK if available
    
    This saves a system call by allowing us to use SOCK_NONBLOCK in
    Linux when accept4 is available.
    
    Note: I do not agree accept_nonblock should always make accepted
    sockets non-blocking, and will propose a future API to allow
    controlling whether accepted sockets are non-blocking or not
    regardless of how they were created.
    
    * ext/socket/init.c (cloexec_accept): support nonblock flag and
      use SOCK_NONBLOCK if possible
    * ext/socket/init.c (rsock_s_accept_nonblock): update cloexec_accept call
    * ext/socket/init.c (accept_blocking): ditto for blocking
    * test/socket/test_nonblock.rb: check nonblock? on accepted socket
      [Feature #11138]

  Modified files:
    trunk/ChangeLog
    trunk/ext/socket/init.c
    trunk/test/socket/test_nonblock.rb


More information about the ruby-cvs mailing list