Subject: Re: popen reentrant (was Re: SA/pthread and vfork)
To: Christian Limpach <email@example.com>
From: Nathan J. Williams <firstname.lastname@example.org>
Date: 09/12/2003 16:41:58
Christian Limpach <email@example.com> writes:
> The appended patch should make popen()/pclose() reentrant. It adds a
> lockfile for access to the pidlist and it prevents concurrent pclose/fclose
> calls on the descriptors in the pidlist from interfering with the child
> closing those descriptors.
(Man, I had no idea that popen()/pclose() went through all these
Why is this using a rwlock instead of a mutex, since it never uses the
lock in read-only mode?
What's the reason for caching the file descriptor numbers of all pipes
in the pidlist? It's okay to use fileno(); FLOCKFILE()/FUNLOCKFILE()
are recursive locks.