git: sh - Support writes to non-blocking descriptors

Matthew Dillon dillon at crater.dragonflybsd.org
Sun Jul 3 22:28:40 PDT 2022


commit 8f2ce533369498e3276d110254f9f5e755401db2
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sun Jul 3 20:54:42 2022 -0700

    sh - Support writes to non-blocking descriptors
    
    * Instead of reporting "write error on stdout", support writes
      to non-blocking sockets by having xwrite() use poll() to block
      when EAGAIN is returned.
    
    * This is possibly related to such errors appearing in the dsynth
      logs.  Presumably (unverified), /bin/sh can wind up being executed
      with descriptor 1 set to non-blocking.  This works fine only as long
      as the other end of the pipe is able to drain it quickly enough.
      But under heavy loads, this might not happen.

Summary of changes:
 bin/sh/output.c | 31 ++++++++++++++++++++++++++++---
 bin/sh/output.h |  1 +
 2 files changed, 29 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8f2ce533369498e3276d110254f9f5e755401db2


-- 
DragonFly BSD source repository


More information about the Commits mailing list