This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC] Add pthread_detach_pwd call.
- From: Rich Felker <dalias at aerifal dot cx>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 21 Oct 2013 09:59:39 -0400
- Subject: Re: [RFC] Add pthread_detach_pwd call.
- Authentication-results: sourceware.org; auth=none
- References: <20131020174109 dot GA17943 at domone dot podge> <20131020222505 dot GK20515 at brightrain dot aerifal dot cx> <20131021063718 dot GA19974 at domone dot podge>
On Mon, Oct 21, 2013 at 08:37:18AM +0200, OndÅej BÃlka wrote:
> On Sun, Oct 20, 2013 at 06:25:05PM -0400, Rich Felker wrote:
> > On Sun, Oct 20, 2013 at 07:41:09PM +0200, OndÅej BÃlka wrote:
> > > Hi,
> > >
> > > One of problematic parts of threading is working directory. As it is
> > > global a changing it is problematic. Particulary when there is a third
> > > party library that does this without multithreading in mind.
> > >
> > > I got idea how users could fix this without much effort. It is that we
> > > implement a pthread_detach_pwd call which will cause all subsequent
> > > queries/changes in thread be resolved by using thread local variable.
> > >
> > > Possible disadvantage is that this would make open/fopen more complicated.
> >
> > There is already a clean, portable way to achieve the exact same
> > thing: the *at functions. Your proposal would have very confusing
> > semantics: for example, when a thread with detached pwd creates a new
> > thread, does the new thread:
> >
> Could you browse around 50000 open source libaries and rewrite them with
> at functions?
This is a strawman; most libraries have NO REASON WHATSOEVER to care
about the pwd.
Rich