os: Use LOCAL_PEERCRED instead of getpeereid() on FreeBSD
Inspired by 165d5c12.
LOCAL_PEERCRED
(FreeBSD, DragonFly) is similar to SO_PEERCRED
(Linux, OpenBSD). getpeereid()
uses LOCAL_PEERCRED
but getpeerucred()
is missing, so there's no wrapper to get cr_pid
.
Fixes XResGetClientPid()
used by
- https://github.com/resolritter/wpid-by-wid
- https://github.com/Plagman/gamescope/commit/70af2c38f0f1
- https://github.com/seebye/ueberzug/commit/11aad5190316
- https://gitlab.gnome.org/GNOME/libwnck/-/commit/07694559cc0c
- https://github.com/mate-desktop/marco/commit/2540175e5a5b
CC @manu, @arichardson
Edited by Jan Beich