Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151317411
D52828.id163253.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D52828.id163253.diff
View Options
diff --git a/lib/libc/gen/fts.3 b/lib/libc/gen/fts.3
--- a/lib/libc/gen/fts.3
+++ b/lib/libc/gen/fts.3
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd June 30, 2025
+.Dd October 1, 2025
.Dt FTS 3
.Os
.Sh NAME
@@ -376,6 +376,43 @@
.Fa fts_name
field is always
.Dv NUL Ns -terminated .
+.Ss Thread Safety
+The
+.Nm
+functions can safely be used in multi-threaded programs provided no
+two threads access the same
+.Vt FTS
+or
+.Vt FTSENT
+structure simultaneously.
+However, unless the
+.Dv FTS_NOCHDIR
+flag was passed to
+.Fn fts_open
+or
+.Fn fts_open_b ,
+calls to
+.Fn fts_read
+and
+.Fn fts_children
+may change the current working directory, which will affect all
+threads.
+Conversely, changing the current working directory either during or
+between calls to
+.Fn fts_read
+or
+.Fn fts_children
+(even in a single-thread program) may cause
+.Nm
+to malfunction unless the
+.Dv FTS_NOCHDIR
+flag was passed to
+.Fn fts_open
+or
+.Fn fts_open_b
+and all paths in
+.Va path_argv
+were absolute.
.Sh FTS_OPEN
The
.Fn fts_open
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 8, 1:38 PM (1 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31100990
Default Alt Text
D52828.id163253.diff (1 KB)
Attached To
Mode
D52828: fts: Document thread (un)safety
Attached
Detach File
Event Timeline
Log In to Comment