Xlib uses AC_CHECK_FUNC(issetugid) in configure.ac, and then
in the code. On Linux everything's fine because libc doesn't have that
function. OTOH kfreebsd explodes with a missing prototype, see
Is that function defined somewhere on kfreebsd? If so, where? And
shouldn't unistd.h pull that in?
No, the prototype is not defined anywhere,
the function is available mainly for linking of old code.
The key problem is that configure uses different set of CFLAGS compared
to real build:
checking for issetugid... yes
error: implicit declaration of function 'issetugid' [-Werror=implicit-function-declaration]