From: Theo Buehler Subject: Re: [PATCH]: Add POSIX O_CLOFORK flag To: guenther@openbsd.org Cc: tech@openbsd.org Date: Thu, 11 Dec 2025 13:29:59 +0100 On Sat, Jun 21, 2025 at 11:35:36PM +0200, Ricardo Branco wrote: > This initial patch adds support for POSIX O_CLOFORK (close-on-fork) flag. > > If there's interest, I can update manpages and fill the TODO list in the PR: > https://github.com/openbsd/src/pull/46 > > I uploaded the full test-suite from Illumos adapted to OpenBSD there. > > Work also being done to add this flag on: > > - FreeBSD: https://github.com/freebsd/freebsd-src/pull/1698 > - DragonflyBSD: https://github.com/DragonFlyBSD/DragonFlyBSD/pull/28 > > The discussion for adding this flag was done in the FreeBSD PR. Found this piece of this submission in one of my trees. Do we want this or was that omitted deliberately? Index: usr.bin/fstat/fstat.c =================================================================== RCS file: /cvs/src/usr.bin/fstat/fstat.c,v diff -u -p -r1.103 fstat.c --- usr.bin/fstat/fstat.c 20 Jun 2022 01:39:44 -0000 1.103 +++ usr.bin/fstat/fstat.c 28 Jun 2025 12:16:20 -0000 @@ -482,6 +482,8 @@ vtrans(struct kinfo_file *kf) strlcat(rwep, "w", sizeof rwep); if (kf->fd_ofileflags & UF_EXCLOSE) strlcat(rwep, "e", sizeof rwep); + if (kf->fd_ofileflags & UF_FORKCLOSE) + strlcat(rwep, "f", sizeof rwep); if (kf->fd_ofileflags & UF_PLEDGED) strlcat(rwep, "p", sizeof rwep); printf(" %4s", rwep);