Re: Our /bin/sh and process group IDs

From: Ganael Laplanche <ganael.laplanche_at_martymac.org>
Date: Sat, 26 Mar 2022 14:52:40 UTC
Le 25/03/2022 à 20:13, Bryan Drewery a écrit :

Hello Bryan,

> set -m needs to be set from the parent process, not child.

Thanks for those clarifications.

Is that something required by POSIX (I could not find any documentation 
about that) ? Or is it a limitation (or bug) of our implementation ? 
Other shells -mostly- do not behave that way (see my original post).

> In this  example test_func is a child *and* the sleep is a child which is also 
> very racy. Here's a pattern I use that works:
> [...]

Unfortunately, in my case, spawn would have to be called from a 
sub-process already forked (from a background function, executed as a 
child process) ; so that wouldn't work either. Anyway, thanks for the 
hint :)

Cheers,

-- 
Ganael LAPLANCHE <ganael.laplanche_at_martymac.org>
http://www.martymac.org | http://contribs.martymac.org
FreeBSD: martymac <martymac_at_FreeBSD.org>, http://www.FreeBSD.org