In the suggested answer, the code changes but the process survives.
I suspect the answer to my original question is no, but I know only a tiny
fraction of the cumulative API of the extended Unix family.
Doug
Was there ever
a
flavor of Unix in which a process could excise itself
from a pipeline without breaking the pipeline?
If in the middle of a pipeline, all I can think of is:
close fd 0 and fd 1
dup() read end of pipe 1 to be stdin (fd 0)
dup() write end of pipe 2 to be stdout (fd 1)
exec("/bin/cat")