I am trying to make a rw version of popen (by returning a pair of pipes), but I am having trouble dup2'ing stdin to an end of a pipe.
GivesCode:dup2(wpipe[0], stdin);
How do I turn it into a file descriptor then? and what exactly is it?Code:test.c:18: warning: passing argument 2 of ‘dup2’ makes integer from pointer without a cast
[edit]
and
givesCode:dup2(wpipe[0], *stdin);
Quote:
test.c:18: error: incompatible type for argument 2 of ‘dup2’