Post Al3mWCp0IIkMrDZPOq by simontatham@hachyderm.io
 (DIR) More posts by simontatham@hachyderm.io
 (DIR) Post #Al3mWCp0IIkMrDZPOq by simontatham@hachyderm.io
       2024-08-17T12:50:18Z
       
       0 likes, 0 repeats
       
       If you put the same pipe on a process's stdout and stderr, you get all its output interleaved in the order it wrote it (after stdio buffering).If you use two pipes, you can tell which output went where.But what if you want separation _and_ ordering?You can _almost_ do it by making two AF_UNIX datagram sockets connected to the same peer. Then recvfrom() gives you a chunk of data _and_ tells you which socket it was written to.But you lose the ability to detect EOF, which is a show-stopper!