missing information in man 3 system

Erich Dollansky erichsfreebsdlist at alogt.com
Mon Feb 11 11:28:07 UTC 2013


Hi,

On Mon, 11 Feb 2013 11:45:57 +0200
Peter Pentchev <roam at ringlet.net> wrote:

> On Mon, Feb 11, 2013 at 12:04:38PM +0700, Erich Dollansky wrote:
> > 
> > Or did I simply miss something?
> 
> Yes, this is indeed the intended behavior of system(3) - it does say

ok. This is good.

Ah, this is from the description section. Which I did not read.

> 
> 	if (WIFEXITED(code)) {
> 		printf("The program exited with code %d\n",
> 		    WEXITSTATUS(code));

So, this is what I need.

> Yes, it may seem a bit convoluted at first glance, but it is indeed
> necessary for the purpose of providing all the information in a single
> return value.  Don't worry, this is something that everyone stumbles
> into when making their first steps in system programming :) (pun
> unintended ;)

This comes then from the good-old-16-bit-days of Unix. I was more
confused by the fact that my memory was right but I could not find the
description under RETURN VALUES. That 
> 
> Hope that helps!

Yes, of course.

Thanks.

Erich


More information about the freebsd-doc mailing list