[comp.unix.programmer] wait3

alex@am.sublink.org (Alex Martelli) (04/26/91)

[I'm answering to a practical advice post on how to change BSD job
control to Posix job control, e.g. in bash...]:

Ah, great advice (particularly the fact that one needs to initialize
sigset_t's that are 'output' parameters, hmmm... wouldn't have guessed
that!).  I think the only tidbit I'm missing is, what do I do in lieu
of a wait3()?  Thanks to everybody for any answer!
-- 
Alex Martelli - (home snailmail:) v. Barontini 27, 40138 Bologna, ITALIA
Email: (work:) martelli@cadlab.sublink.org, (home:) alex@am.sublink.org
Phone: (work:) ++39 (51) 371099, (home:) ++39 (51) 250434; 
Fax: ++39 (51) 366964 (work only), Fidonet: 332/401.3 (home only).

chet@odin.INS.CWRU.Edu (Chet Ramey) (04/29/91)

In article <1991Apr25.191714.852@am.sublink.org> alex@am.sublink.org (Alex Martelli) writes:

>I think the only tidbit I'm missing is, what do I do in lieu
>of a wait3()?  Thanks to everybody for any answer!

You use waitpid().

Bash-1.07 has the changes necessary to do job control on a Posix system;
you could use it as an example.

Chet
-- 
Chet Ramey			  Internet: chet@po.CWRU.Edu
Case Western Reserve University	  NeXT Mail: chet@macbeth.INS.CWRU.Edu

``Now,  somehow we've brought our sins back physically -- and they're pissed.''

src@scuzzy.in-berlin.de (Heiko Blume) (05/01/91)

alex@am.sublink.org (Alex Martelli) writes:

>[I'm answering to a practical advice post on how to change BSD job
>control to Posix job control, e.g. in bash...]:

> I think the only tidbit I'm missing is, what do I do in lieu
>of a wait3()?  Thanks to everybody for any answer!

yip, change wait3(&status,(WNOHANG|WUNTRACED), (int *)0)
                                               /* ^ no rusage info avail */
to
waitpid(-1,&status,(WNOHANG|WUNTRACED)).
-- 
   Heiko Blume <-+-> src@scuzzy.in-berlin.de <-+-> (+49 30) 691 88 93 [voice!]
                  public UNIX source archive [HST V.42bis]:
        scuzzy Any ACU,f 38400 6919520 gin:--gin: nuucp sword: nuucp
                     uucp scuzzy!/src/README /your/home