When fixing packages for pkgsrc-2021Q4 I found that fdopendir is only visible when _NETBSD_SOURCE is defined. The thing is that it is a function defined in POSIX.1 2008 edition. So the function declaration is not visible when programs set -D_POSIX_C_SOURCE=200809L or -D_XOPEN_SOURCE=700 . I plan on putting
#if (_POSIX_C_SOURCE - 0) >= 200809L || (_XOPEN_SOURCE - 0) >= 700 || \ defined(_NETBSD_SOURCE) #ifndef __LIBC12_SOURCE__ DIR *fdopendir(int); #endif #endif in dirent.h so that it is also visible to POSIX and XOPEN users if it is okay and no one objects to it. Niclas Rosenvik