May 19th, 2014

nepal

two-way pipe between two processes

Linux pipes are one-way, for a reason to avoid deadlocks I suppose. I was looking for a way to create a two-way pipe between two processes (so they can interact between each other). Was thinking of shell redirection with exec, but found an easier(?) way:

socat EXEC:./sender EXEC:./receiver

Update: unfortunately, the biggest problem is socat ignores children exit codes, and apparently there's no way to get those.