The correct function is popen(3) with the "r" parm. Or you could use pipe(2) with fork(2)/exec(2).
And example of the reverse popen(3) is here:
The correct function is popen(3) with the "r" parm. Or you could use pipe(2) with fork(2)/exec(2).
And example of the reverse popen(3) is here: