kern: Allow O_CLOFORK to be passed to shm_open(2)

Signed-off-by: Ricardo Branco <rbranco@suse.de>

Reviewed by:	kib
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1802
This commit is contained in:
Ricardo Branco
2025-08-04 16:56:17 +02:00
committed by Mark Johnston
parent 3af6f55735
commit 5e8b3eeb60
2 changed files with 5 additions and 3 deletions
+3 -2
View File
@@ -26,7 +26,7 @@
.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd January 30, 2023
.Dd August 4, 2025
.Dt SHM_OPEN 2
.Os
.Sh NAME
@@ -74,8 +74,9 @@ must be included in
The optional flags
.Dv O_CREAT ,
.Dv O_EXCL ,
.Dv O_TRUNC ,
and
.Dv O_TRUNC
.Dv O_CLOFORK
may also be specified.
.Pp
If
+2 -1
View File
@@ -1160,7 +1160,8 @@ kern_shm_open2(struct thread *td, const char *userpath, int flags, mode_t mode,
if ((flags & O_ACCMODE) != O_RDONLY && (flags & O_ACCMODE) != O_RDWR)
return (EINVAL);
if ((flags & ~(O_ACCMODE | O_CREAT | O_EXCL | O_TRUNC | O_CLOEXEC)) != 0)
if ((flags & ~(O_ACCMODE | O_CREAT | O_EXCL | O_TRUNC | O_CLOEXEC |
O_CLOFORK)) != 0)
return (EINVAL);
largepage = (shmflags & SHM_LARGEPAGE) != 0;