Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Feb 2010 19:58:31 +0200
From:      Andriy Gapon <avg@icyb.net.ua>
To:        Garrett Cooper <yanefbsd@gmail.com>, Naveen Gujje <gujjenaveen@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: System() returning ECHILD error on FreeBSD 7.2
Message-ID:  <4B72F3C7.7060004@icyb.net.ua>
In-Reply-To: <7d6fde3d1002100952g1518bc36r371020260e81a8c3@mail.gmail.com>
References:  <39c945731002100925i2e466768peac89cdef15463f2@mail.gmail.com> <7d6fde3d1002100952g1518bc36r371020260e81a8c3@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
on 10/02/2010 19:52 Garrett Cooper said the following:
>     Isn't this section of the system(3) libcall essentially doing what
> you want, s.t. you'll never be able to get the process status when you
> call waitpid(2)?
> 
>        do {
>            pid = _wait4(savedpid, &pstat, 0, (struct rusage *)0);
>        } while (pid == -1 && errno == EINTR);
>        break;
> 
>     You typically get status via wait*(2) when using exec*(2) or via
> the return codes from system(3), not system(3) with wait*(2)...

Exactly.  I think that SIGCHLD handler would effectively 'reap' the child and thus
wait*() in system would rightfully return ECHILD (perhaps after doing EINTR
iteration of the loop).

-- 
Andriy Gapon



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