A NOTE has been added to this issue. ====================================================================== https://www.austingroupbugs.net/view.php?id=1960 ====================================================================== Reported By: steffen Assigned To: ====================================================================== Project: 1003.1(2024)/Issue8 Issue ID: 1960 Category: System Interfaces Type: Enhancement Request Severity: Editorial Priority: high Status: New Name: steffen Organization: User Reference: Section: fcntl Page Number: 246 Line Number: 8633 Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2025-11-20 17:17 UTC Last Modified: 2026-01-09 15:50 UTC ====================================================================== Summary: fcntl(): add F_DUPFD_CLOFORKEXEC flag ======================================================================
---------------------------------------------------------------------- (0007358) steffen (reporter) - 2026-01-09 15:50 https://www.austingroupbugs.net/view.php?id=1960#c7358 ---------------------------------------------------------------------- lanodan: you are right, bad search from my side. msbrown: CLOCPL or CLOCOMPLETE is good. I want to point out that only the BSDs and (Open)Solaris as of now (to my knowledge) support CLOFORK, and if you search (now better) for CLOFORK in the BSDs you get <pre> #?130|kent:free-src.git$ git grep CLOFORK origin/main | grep -vE '(sys/(kern|sys)|lib/(libc|libsys)|(tests|cddl/contrib/opensolaris/tests))/' origin/main:contrib/tzcode/NEWS: platform has O_CLOFORK and O_CLOEXEC respectively. Also, the origin/main:contrib/tzcode/localtime.c:#ifndef O_CLOFORK origin/main:contrib/tzcode/localtime.c:# define O_CLOFORK 0 origin/main:contrib/tzcode/localtime.c: fid = open(name, (O_RDONLY | O_BINARY | O_CLOEXEC | O_CLOFORK origin/main:contrib/tzdata/NEWS: platform has O_CLOFORK and O_CLOEXEC respectively. Also, the origin/main:lib/libsysdecode/flags.c: X(SOCK_CLOEXEC) X(SOCK_CLOFORK) X(SOCK_NONBLOCK) XEND origin/main:lib/libsysdecode/flags.c: type & ~(SOCK_CLOEXEC | SOCK_CLOFORK | SOCK_NONBLOCK)); origin/main:lib/libsysdecode/flags.c: *rem = type & ~(SOCK_CLOEXEC | SOCK_CLOFORK | SOCK_NONBLOCK); origin/main:lib/libsysdecode/flags.c: val = type & (SOCK_CLOEXEC | SOCK_CLOFORK | SOCK_NONBLOCK); origin/main:lib/libsysdecode/flags.c: X(O_CLOEXEC) X(O_CLOFORK) X(O_NONBLOCK) XEND origin/main:lib/libsysdecode/flags.c: X(FD_CLOEXEC) X(FD_CLOFORK) X(0) XEND origin/main:lib/libsysdecode/sysdecode_fcntl_arg.3:.Dq FD_CLOFORK #?0|kent:free-src.git$ cd ../net-src.git/ #?0|kent:net-src.git$ git grep CLOFORK origin/trunk | grep -vE '(sys/(kern|sys)|lib/(libc|libsys)|(tests|cddl/contrib/opensolaris/tests))/' origin/trunk:doc/CHANGES: posix_openpt(3): Support O_CLOFORK. [gutteridge 20250806] origin/trunk:doc/CHANGES.prev: kernel (et al): Added O_CLOFORK (etc) implementation from origin/trunk:external/gpl3/gdb.old/dist/gnulib/import/fcntl.c: #ifdef F_DUP2FD_CLOFORK /* Solaris */ origin/trunk:external/gpl3/gdb.old/dist/gnulib/import/fcntl.c: case F_DUP2FD_CLOFORK: origin/trunk:external/gpl3/gdb.old/dist/gnulib/import/fcntl.c: #ifdef F_DUPFD_CLOFORK /* Solaris */ origin/trunk:external/gpl3/gdb.old/dist/gnulib/import/fcntl.c: case F_DUPFD_CLOFORK: origin/trunk:external/gpl3/gdb/dist/gnulib/import/fcntl.c: #ifdef F_DUP2FD_CLOFORK /* Solaris */ origin/trunk:external/gpl3/gdb/dist/gnulib/import/fcntl.c: case F_DUP2FD_CLOFORK: origin/trunk:external/gpl3/gdb/dist/gnulib/import/fcntl.c: #ifdef F_DUPFD_CLOFORK /* Solaris */ origin/trunk:external/gpl3/gdb/dist/gnulib/import/fcntl.c: case F_DUPFD_CLOFORK: origin/trunk:external/public-domain/tz/dist/NEWS: platform has O_CLOFORK and O_CLOEXEC respectively. Also, the #?0|kent:net-src.git$ cd ../open-src.git/ #?0|kent:open-src.git$ git grep CLOFORK origin/master | grep -vE '(sys/(kern|sys)|lib/(libc|libsys)|(tests|cddl/contrib/opensolaris/tests))/' #?1|kent:open-src.git$ </pre> It would seem to me quickly adding the possibility to have one systemcall instead of several would avoid contortion and future preprocessor jungles. Issue History Date Modified Username Field Change ====================================================================== 2025-11-20 17:17 steffen New Issue 2025-12-11 17:33 lanodan Note Added: 0007336 2025-12-11 21:50 steffen Note Added: 0007337 2025-12-11 21:52 steffen Note Edited: 0007337 2025-12-11 21:52 steffen Note Edited: 0007337 2026-01-08 16:11 lanodan Note Added: 0007353 2026-01-08 16:11 lanodan Note Edited: 0007353 2026-01-08 16:47 msbrown Note Added: 0007354 2026-01-09 15:50 steffen Note Added: 0007358 ======================================================================
