This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/15539] nftw with FTW_CHDIR doesn't restore cwd upon cancellation
- From: "bugdal at aerifal dot cx" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Mon, 21 Oct 2013 01:35:41 +0000
- Subject: [Bug libc/15539] nftw with FTW_CHDIR doesn't restore cwd upon cancellation
- Auto-submitted: auto-generated
- References: <bug-15539-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=15539
Rich Felker <bugdal at aerifal dot cx> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bugdal at aerifal dot cx
--- Comment #2 from Rich Felker <bugdal at aerifal dot cx> ---
nftw is not even required to be thread-safe, so per the standard such usage
invokes undefined behavior. I suspect glibc's nftw implementation aims to
provide the maximal possible thread-safety, but using chdir is not really
compatible with multithreaded use, so it should not be used in multithreaded
programs with FTW_CHDIR. My inclination would be just to recommend against use
of nftw altogether; with the *at functions, a much better API for filesystem
tree walking is possible.
--
You are receiving this mail because:
You are on the CC list for the bug.