[cs631apue] Question about execvp(3)
bzhang41
bzhang41 at stevens.edu
Fri Dec 16 01:21:02 EST 2016
Dear Prof.
I have a question about the final assignment.
When I tried to implement the -c options,
I try to use fork(3) and then execvp(3),
But I can't get the result as I expected, first argument of the execvp
needs the
real path of the executable file, and the second argument of the execvp
needs
some arguments with type char **.
But the command from -c options doesn't have any arguments
how can I pass a empty char ** to execvp, and let it just executes the
command without any arguments.
Or can I just call system(3) for -c options, I think that's a cheat
right ?
Thanks
Bo
More information about the cs631apue
mailing list