The discussion is not about getcwd(). That is hopefully well done. The
discussion is about fgetcwd() (or getcwdat()) to determinate the full
path for a given file descriptor, or AT_FDCWD.

The sad story is, as you have said on the chat, that some OSes have
neither /proc, libproc or fdopendir(), which is a shame. Either way, I
provide a patch for it.

Olga

On Mon, Jul 29, 2013 at 10:08 AM, Glenn Fowler <[email protected]> wrote:
>
> On Mon, 29 Jul 2013 06:26:38 +0200 Irek Szczesniak wrote:
>> On Sun, Jul 28, 2013 at 1:54 AM, Roland Mainz <[email protected]> 
>> wrote:
>> > Hi!
>> >
>> > ----
>> >
>> > [Mainly for Glenn...]
>> > Is it Ok if I add |getcwdat()| (which is missing in the POSIX |*at()|
>> > APIs... but why ?) and |pathprogat()| to libast ?
>
>> Just don't use the libast getcwd(). It relies on chdir() and other
>> cruel stuff which is incompatible to threads ;-(
>
> on linux is uses the getcwd syscall via syscall(2)
>
> I'm guessing the only thread cruelty is using chdir() to get around pwd paths 
> that
> would trigger ENAMETOOLONG -- the code was written before fdopendir() and 
> fchdir()
> and *at() -- the chdir() part only kicks in on long pwd
>
> its time to revisit that code with a fallback to the cruel code on systems
> that don't have fdopendir()
>
> _______________________________________________
> ast-developers mailing list
> [email protected]
> http://lists.research.att.com/mailman/listinfo/ast-developers



-- 
      ,   _                                    _   ,
     { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
.----'-/`-/     [email protected]   \-`\-'----.
 `'-..-| /       http://twitter.com/fleyta     \ |-..-'`
      /\/\     Solaris/BSD//C/C++ programmer   /\/\
      `--`                                      `--`
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to