Actions
Feature #11138
closed[PATCH] ext/socket/init.c: use SOCK_NONBLOCK if available
Description
[PATCH 1/2] 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 (next patch)
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
Files
Actions
Like0
Like0