HomeFreeBSD

linux: getsockopt(): Simplify exporting groups a bit

Description

linux: getsockopt(): Simplify exporting groups a bit

No functional change (intended).

Go through conversion to a 'l_gid_t' before copying out in order to cope
with differing group types (except for not representable values, of
course). This is what is done, e.g., for getgroups() in 'linux_misc.c'.
As Linux's group type is the same as ours on all architectures, we could
as well just stop bothering and copy out our memory representation,
eliminating the loop here. Whatever the choice, though, it has to be
consistent here and there.

Introduce 'out' of type 'l_gid_t' to avoid performing "by hand" array
arithmetics when copying out.

MFC after: 5 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52280

Details

Provenance
olceAuthored on Aug 29 2025, 8:26 AM
Differential Revision
D52280: linux: getsockopt(): Simplify exporting groups a bit
Parents
rGb1326edddb30: linux: setgroups16(): Pre-extend the groups array
Branches
Unknown
Tags
Unknown