Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jul 2019 21:33:56 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r350116 - head/lib/libc/gen
Message-ID:  <201907182133.x6ILXu4k026793@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Thu Jul 18 21:33:55 2019
New Revision: 350116
URL: https://svnweb.freebsd.org/changeset/base/350116

Log:
  Document that setmode(3) is not thread safe.
  
  In some circumstances, setmode(3) may call umask(2) twice to retrieve
  the current mode and then restore it.  Between calls, the process will
  have a umask of 0.
  
  Reviewed by:	markj
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D20982

Modified:
  head/lib/libc/gen/setmode.3

Modified: head/lib/libc/gen/setmode.3
==============================================================================
--- head/lib/libc/gen/setmode.3	Thu Jul 18 17:55:13 2019	(r350115)
+++ head/lib/libc/gen/setmode.3	Thu Jul 18 21:33:55 2019	(r350116)
@@ -28,7 +28,7 @@
 .\"     @(#)setmode.3	8.2 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd February 22, 2015
+.Dd July 18, 2019
 .Dt SETMODE 3
 .Os
 .Sh NAME
@@ -125,3 +125,10 @@ and
 .Fn setmode
 functions first appeared in
 .Bx 4.4 .
+.Sh BUGS
+The
+.Fn setmode
+function is not thread safe.
+Files created in other threads while
+.Fn setmode
+is being called may be created with a umask of 0.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907182133.x6ILXu4k026793>