Does the exit code indicate specific errors or does it just say that an
error has occured?

On Fri, Oct 2, 2009 at 1:54 AM, James Carlson <[email protected]>wrote:

> Vivek S wrote:
> > I can spawn ifconfig, but then how do i recognize errors?
>
> It depends on how you spawn it.  If you use system(3C) (not what I'd do,
> but ...), then the return value is the exit code.  Just test for non-zero.
>
> If you do fork/exec, then use wait(3C) or waitpid(3C) to get the
> results.  The "stat_loc" variable will be filled in with the exit code,
> and will be non-zero in case of error.
>
> --
> James Carlson         42.703N 71.076W         <[email protected]>
>
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to