NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/59498: Add missing POSIX O_CLOFORK flag



The following reply was made to PR kern/59498; it has been noted by GNATS.

From: Ricardo Branco <rbranco%suse.de@localhost>
To: gnats-bugs%netbsd.org@localhost, kern-bug-people%netbsd.org@localhost,
 gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/59498: Add missing POSIX O_CLOFORK flag
Date: Thu, 10 Jul 2025 15:13:49 +0200

 On 7/1/25 8:35 PM, Christos Zoulas via gnats wrote:
 > The following reply was made to PR kern/59498; it has been noted by GNATS.
 >
 > From: Christos Zoulas <christos%zoulas.com@localhost>
 > To: gnats-bugs%netbsd.org@localhost
 > Cc: kern-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
 >   netbsd-bugs%netbsd.org@localhost
 > Subject: Re: kern/59498: Add missing POSIX O_CLOFORK flag
 > Date: Tue, 01 Jul 2025 14:25:38 -0400
 >
 >   In addition to kre@'s comments about reviewing fcntl(F_GETFD),
 >   I would add a fd_set_fdflags_from_oflags() that does:
 >   
 >          fd_set_fdflags(curlwp, newfd,
 >   	    ((flags & O_CLOEXEC) ? FD_CLOEXEC : 0) |
 >   	    ((flags & O_CLOFORK) ? FD_CLOFORK : 0));
 >   
 >   since this is repeated a bunch of times.
 >   
 >   christos
 >   
 
 Now that it's merged in both FreeBSD & DragonflyBSD, and
 with the OpenBSD version being taken care of Theo Buehler,
 I can devote attention to this one.
 
 To me it's the most problematic because I had to change a
 bool field in a struct to u_char, and also because the dup3()
 implementation is or was reportedly broken:
 https://github.com/NetBSD/src/blob/trunk/sys/sys/filedesc.h#L109
 
 I added tests, updated manpages and will work on it over the
 weekend.
 
 Best,
 Ricardo
 


Home | Main Index | Thread Index | Old Index