Re: git: a6ea60aa4887 - main - freebsd32/freebsd32.h: only define kinfo_knote32 when kevent32 is defined
Date: Mon, 24 Mar 2025 05:51:14 UTC
On Mon, Mar 24, 2025 at 05:45:16AM +0000, Jessica Clarke wrote: > On 24 Mar 2025, at 04:07, Konstantin Belousov <kib@FreeBSD.org> wrote: > > > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=a6ea60aa48878d2d0c113f541fb2b9b8246ac06b > > > > commit a6ea60aa48878d2d0c113f541fb2b9b8246ac06b > > Author: Konstantin Belousov <kib@FreeBSD.org> > > AuthorDate: 2025-03-24 04:06:24 +0000 > > Commit: Konstantin Belousov <kib@FreeBSD.org> > > CommitDate: 2025-03-24 04:06:24 +0000 > > > > freebsd32/freebsd32.h: only define kinfo_knote32 when kevent32 is defined > > > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > --- > > sys/compat/freebsd32/freebsd32.h | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/sys/compat/freebsd32/freebsd32.h b/sys/compat/freebsd32/freebsd32.h > > index c3234141d5a9..3a4625b8e2d3 100644 > > --- a/sys/compat/freebsd32/freebsd32.h > > +++ b/sys/compat/freebsd32/freebsd32.h > > @@ -446,6 +446,7 @@ struct kinfo_vm_layout32 { > > uint32_t kvm_spare[12]; > > }; > > > > +#if defined(_WANT_KEVENT32) || (defined(_KERNEL) && defined(__LP64__)) > > Please don’t use __LP64__ to mean “not 32-bit”. Other ABIs exist downstream. > > Is there a reason the RHS of the || isn’t just defined(COMPAT_FREEBSD32)? This line is the verbatim copy of the braces around the struct kevent32 in sys/sys/event.h. I suspect that both kevent32 and kinfo_knote32 definitions can be predicated on just _KERNEL, to be unused for 32bit kernel builds without consequences.