getgroups.2: Clarify, mention ascending order, add SECURITY CONSIDERATIONS
Clarify and be more precise about the behavior of getgroups(2), in
particular with respect to 'gidsetlen'.
Prefer a terminology close to POSIX terms, i.e., use "effective groups"
instead of "group access list".
Say that getgroups(2) reports the supplementary groups in strictly
ascending order (and mention this has been the case since FreeBSD 14.3).
Add a new SECURITY CONSIDERATIONS section, in particular contrasting
FreeBSD 15's behavior with the current one.
While here, fix some style.
Reviewed by: gbe (older version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52286
(cherry picked from commit 4be38acc826f260e4c7d3ebbb9de534db449782e)
As indicated in the original commit message, the manual page was
specifically modified as stable/14's getgroups(2) still has the old
behavior.
The original commit message above was reworked to reflect the actual
commit content.