]> git.ipfire.org Git - thirdparty/asterisk.git/commit
utils: Wrap socket() and pipe() to reduce syscalls
authorSean Bright <sean.bright@gmail.com>
Fri, 7 Dec 2018 12:57:48 +0000 (07:57 -0500)
committerSean Bright <sean.bright@gmail.com>
Fri, 7 Dec 2018 13:57:02 +0000 (08:57 -0500)
commit8c312c54ed5382776be7854c600bf6ce168d5223
tree3aa37ce2451d5679fe30d2655a417805e83f5d5d
parentd9252612a7a02952cfc4049e2223f584ae165246
utils: Wrap socket() and pipe() to reduce syscalls

Some platforms provide an implementation of socket() and pipe2() that allow the
caller to specify that the resulting file descriptors should be non-blocking.

Using these allows us to potentially elide 3 calls into 1 by avoiding extraneous
calls to fcntl() to set the O_NONBLOCK flag afterwards.

In passing, change ast_alertpipe_init() to use pipe2() directly instead of the
wrapper if it is available.

Change-Id: I3ebe654fb549587537161506c6c950f4ab298bb0
configure
configure.ac
include/asterisk/autoconfig.h.in
include/asterisk/utils.h
main/alertpipe.c
main/utils.c