[Top][All Lists]

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

Re: GNULib save-cwd.c on Windows & Visual Studio 6.0

From: Jim Meyering
Subject: Re: GNULib save-cwd.c on Windows & Visual Studio 6.0
Date: Tue, 08 Mar 2005 09:24:21 +0100

"Conrad T. Pino" <address@hidden> wrote:
> The CVS project compiles the Windows CVS binary with Microsoft Visual
> Studio 6.0 which doesn't have a "fchdir" implementation which is used
> in "save-cwd.c" module.  The comments say:
>    Some systems lack fchdir altogether: e.g., OS/2, pre-2001 Cygwin,
>    SCO Xenix.  Also, SunOS 4 and Irix 5.3 provide the function, yet it
>    doesn't work for partitions on which auditing is enabled.  If
>    you're still using an obsolete system with these problems, please
>    send email to the maintainer of this code.
> Function "fchdir" is also used in "chdir-long.c" and "openat.c" modules
> which may not be used in Windows build.
> What would you suggest for this issue?

Hi Conrad,

Is it an option to use a more modern/POSIX-compliant development
environment on Windows?  I know that Cygwin now has fchdir and it looks
like MKS has support for it, too.  POSIX has required fchdir for a
long time, now, and having fchdir lets programs do things like save and
restore the working directory much more efficiently and robustly than
the alternative getcwd-based implementation would.  For example, if you
`return' to a saved working directory using chdir, you have to wonder
if maybe you've been tricked into changing to some other directory --
or incur the cost of getting/saving/comparing before and after device
and inode numbers.  If you opt to continue using Visual Studio 6 in
spite of this, it must have some important redeeming features.

The Unix systems that lack support for fchdir stopped being reasonable
porting targets a couple of years ago.  And since Cygwin has had fchdir
support for over three years, I thought we'd be safe on the WOE side, too.
So about a month ago we removed from the save-cwd module support for
systems with missing or flaky fchdir support.  Although that module
could work around the lack of a working fchdir function, the openat
module cannot.  And since the chdir-long module also uses openat, its
use of fchdir is moot.

If you have no alternative, it wouldn't be hard to revert the last
change to the save-cwd module, but it'd feel like a step backwards.


reply via email to

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