getting the exit value of an exec'd program

BURNS,JIM gt0178a at prism.gatech.EDU
Thu Aug 16 14:25:11 AEST 1990


in article <1990Aug15.223952.1175 at NCoast.ORG>, atul at NCoast.ORG (Atul Parulekar) says:
> May be the answer is in the manual, but I have not been able to find it.
> My problem is that if I run a program using fork and execvp, how do I get
> the exit value of the exec'd program into the main program.

Exec doesn't return a status - it doesn't return at all. Use wait(2) in
the parent program. Its man page describes the union wait status variable
returned by wait(2) and its variants. (Exact return type also varies
between wait() variants and diff. unices.)
-- 
BURNS,JIM
Georgia Institute of Technology, Box 30178, Atlanta Georgia, 30332
uucp:	  ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt0178a
Internet: gt0178a at prism.gatech.edu



More information about the Comp.unix.questions mailing list