This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/15539] nftw with FTW_CHDIR doesn't restore cwd upon cancellation


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]