In article <9275.1664462...@jacaranda.noi.kre.to>, Robert Elz <k...@munnari.oz.au> wrote: > Date: Thu, 29 Sep 2022 08:18:28 -0400 > From: "Christos Zoulas" <chris...@netbsd.org> > Message-ID: <20220929121828.06edff...@cvs.netbsd.org> > > | Log Message: > | Add fd_set_exclose(). It is probably better to do this automatically in > | fd_affix()... > >Since that only affects /dev/ptmx I'd suggest fixing it generally for all >cloning devices (and handling O_??LOCK as well) would be a better method.
I think that the way to go is to: 1. Do the fd_set_exclose() in fd_affix(). That will remove most of the calls to fd_set_exclose() *and* the open-coded versions of it. 2. Move the open_setfp locking initialization code to fd_affix() and do it if fp->f_type == DTYPE_VNODE. This should enable locking in all the appropriate cloners. Best, christos