Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Feb 2013 18:27:57 +0700
From:      Erich Dollansky <erichsfreebsdlist@alogt.com>
To:        Peter Pentchev <roam@ringlet.net>
Cc:        freebsd-doc@freebsd.org
Subject:   Re: missing information in man 3 system
Message-ID:  <20130211182757.475efca2@X220.ovitrap.com>
In-Reply-To: <20130211094557.GB5801@straylight.m.ringlet.net>
References:  <20130211120438.730ce5d3@X220.ovitrap.com> <20130211094557.GB5801@straylight.m.ringlet.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Mon, 11 Feb 2013 11:45:57 +0200
Peter Pentchev <roam@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130211182757.475efca2>