Skip to content
Snippets Groups Projects
  • Sean Bright's avatar
    6d69fb3c
    utils: Wrap socket() and pipe() to reduce syscalls · 6d69fb3c
    Sean Bright authored
    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
    6d69fb3c
    History
    utils: Wrap socket() and pipe() to reduce syscalls
    Sean Bright authored
    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