[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

difference between robust_getcwd and rpl_getcwd

From: Eric Blake
Subject: difference between robust_getcwd and rpl_getcwd
Date: Tue, 28 Feb 2006 15:51:50 +0000

Why are there two implementations of a recursive readdir
implementation of getcwd()?  One (rpl_getcwd) is in
lib/getcwd.c, which fails to use root-dev-ino.h (and is
therefore currently broken on cygwin's distinct //), but uses
fstatat for speed and thread-safety, and which produces
no error message on failure.  The other, robust_getcwd,
is in src/pwd.c, uses fchdir and dies on error (since pwd
is single-threaded), rather than returning a failure, but
since it used root-dev-ino.h it was easy to patch to recognize
cygwin's distinct //.  It just seems odd to me that there
are two implementations, and I wonder if any features
should be factored out between the two.  Furthermore,
since some parts of gnulib, such as canonicalize.c,
depend on getcwd, it would be nice if it were as easy
to patch lib/getcwd.c to recognize // as a distinct root.

Eric Blake

reply via email to

[Prev in Thread] Current Thread [Next in Thread]