Date: Tue, 2 Feb 2016 15:11:45 +0200 From: Konstantin Belousov <kib@freebsd.org> To: Mateusz Guzik <mjguzik@gmail.com> Cc: freebsd-hackers@freebsd.org, Mateusz Guzik <mjg@freebsd.org> Subject: Re: [PATCH 1/2] fork: pass arguments to fork1 in a dedicated structure Message-ID: <20160202131145.GT91220@kib.kiev.ua> In-Reply-To: <1454386069-29657-2-git-send-email-mjguzik@gmail.com> References: <20160201103632.GL91220@kib.kiev.ua> <1454386069-29657-1-git-send-email-mjguzik@gmail.com> <1454386069-29657-2-git-send-email-mjguzik@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--ZwgA9U+XZDXt4+m+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 02, 2016 at 05:07:48AM +0100, Mateusz Guzik wrote: > From: Mateusz Guzik <mjg@freebsd.org> >=20 > --- > sys/compat/cloudabi/cloudabi_proc.c | 7 +++++- > sys/compat/linux/linux_fork.c | 17 ++++++++++---- > sys/kern/init_main.c | 6 +++-- > sys/kern/kern_fork.c | 46 +++++++++++++++++++++++++------= ------ > sys/kern/kern_kthread.c | 7 ++++-- > sys/sys/proc.h | 12 ++++++++-- > 6 files changed, 68 insertions(+), 27 deletions(-) >=20 > diff --git a/sys/compat/cloudabi/cloudabi_proc.c b/sys/compat/cloudabi/cl= oudabi_proc.c > index d917337..010efca 100644 > --- a/sys/compat/cloudabi/cloudabi_proc.c > +++ b/sys/compat/cloudabi/cloudabi_proc.c > @@ -75,12 +75,17 @@ int > cloudabi_sys_proc_fork(struct thread *td, > struct cloudabi_sys_proc_fork_args *uap) > { > + struct fork_req fr =3D {}; > struct filecaps fcaps =3D {}; > struct proc *p2; > int error, fd; > =20 > cap_rights_init(&fcaps.fc_rights, CAP_FSTAT, CAP_EVENT); > - error =3D fork1(td, RFFDG | RFPROC | RFPROCDESC, 0, &p2, &fd, 0, &fcaps= ); > + fr.fr_flags =3D RFFDG | RFPROC | RFPROCDESC; > + fr.fr_procp =3D &p2; > + fr.fr_pd_fd =3D &fd; > + fr.fr_pd_fcaps =3D &fcaps; > + error =3D fork1(td, &fr); > if (error !=3D 0) > return (error); The patch is fine. Would be great to not use initializer in declaration, i.e. use bzero() instead of c99 designated initializers. --ZwgA9U+XZDXt4+m+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWsKsRAAoJEJDCuSvBvK1BAuwP+wfZssh5Krj5Oxqp4RbyVRqU RxZ44ZwWprSHsU0vnnpMwTWp0R/YbRHq+6Cb3pieY2UZEtqUv76/Iu4v2gi3Lfyt VEbn02wNDHIbaV5rzwkB1xGj2mwwcgKxIjz42OLQ2F4iYkie/i9oUbF4m9tFhKJ2 rWQqXul4+qFaPVGIzdK8amr9J5DvoSzOG3dCXH7X+VkoOf+QEs5YCrxim34gsX3O xGzX3zf+l/N5i1QTH/awWX2q5Ah1FyOjjgGu0MEestvRNiNi1KK0NDJ7OD5UNcvW bHRqMSkiP2tUdkjl2hg6etHRy1MfipJ6TAOcZjaeKhf4ffz50bT0Am+b0avgRBTg 3UNx0D41NYVal3zY8/HGXbYsUHyC3IOIEgnxILXNH6K7w4n/5FCC2K7MIAreYZ/A MV9tRqWPn2i+M4PZ7s1Ugq1PlSq1jqigofTGOFnDQ0l51EaVxyDFA5xqMwDRQFx5 169RXBS67j0JucGIDQ1kVTkQOoMG3pZmciZm1VND4KQKfXk1DWWFVugSe3TNORmH 0bERq/w9rVlUug17XbbRK0cidftu64DbhoVwbZ4/GHbZonNBMqlY6iW1H1bSBDtY 5SwKBY+jhHqpvWO6kMWff8YcTt/sWvu40EM1+O3xQkLTZfukJbQbzKF25v8sC+MJ 9qfJuED9qB9E8PBBaXea =V/nc -----END PGP SIGNATURE----- --ZwgA9U+XZDXt4+m+--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160202131145.GT91220>