[Bug libc/15539] nftw with FTW_CHDIR doesn't restore cwd upon cancellation
bugdal at aerifal dot cx
sourceware-bugzilla@sourceware.org
Mon Oct 21 01:35:00 GMT 2013
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.
More information about the Glibc-bugs
mailing list