W
ws.taylor
I am in a systems programming class, using C on a Solaris 10
development server. Part of the first programming assignment calls for
the output of a command executed by a child process with execvp to be
redirected to a buffer so that it can be sent through a named pipe back
to the parent process. The only part I'm having problems with is
capturing execvp's output to a buffer. I can't find anything about this
from our book, or from searching the web. Would I use dup2 for this? Is
it even possible to use dup2 to redirect stdout to a buffer? I can
redirect stdout to the named pipe, so it seems like that's possible.
Any help would be greatly appreciated.
development server. Part of the first programming assignment calls for
the output of a command executed by a child process with execvp to be
redirected to a buffer so that it can be sent through a named pipe back
to the parent process. The only part I'm having problems with is
capturing execvp's output to a buffer. I can't find anything about this
from our book, or from searching the web. Would I use dup2 for this? Is
it even possible to use dup2 to redirect stdout to a buffer? I can
redirect stdout to the named pipe, so it seems like that's possible.
Any help would be greatly appreciated.