Email List: Xaustin-group-futures-lX
[All Lists]

Re: thread-private working directory

To: Jason Zions <yyyyyyyy@xxxxxxxxxxxxxxxxxxx>
Subject: Re: thread-private working directory
From: Kaz Kylheku <yyy@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 4 Aug 2003 12:43:58 -0700 (PDT)
Cc: Alexander Terekhov <yyyyyyyy@xxxxxxxxxx>, <yyyyyyyyyyyyyyyyyyyyyy@xxxxxxxxxxxxx>, <yyyyyyyyyyyyyy@xxxxxxxxxxxxx>
On Mon, 4 Aug 2003, Jason Zions wrote:

> Or, you could simply write your threaded applications to always pass
> fully rooted paths. Seems like a much simpler change to me. 

``You could simply write your apps so that ...'' is not always that
simple in the real world. Within the portions of the application that
you write yourself, you can stick to arbitrary conventions, but there
may be third-party components, some of which you don't have source code
to, others which would be hard to modify.

How do you know that the directory traversal function ftw() doesn't use
internally use chdir and relative references, for instance? What if two
or more threads use this library function at the same time?

Full paths are a disadvantage for another reason: platforms impose
limitations on how long a path you can specify in one call.  E.g. I
think on Linux, I think it's the size of a page, so 4096-1 bytes on
IA-32. If you pass a string longer than that to open() and other
functions, they will bail with ENAMETOOLONG.  Thus a filesystem could
have areas that are only reachable by a combination of chdir() and
relative paths.

<Prev in Thread] Current Thread [Next in Thread>