tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: fdopendir visibility in dirent.h



In article <20211229211621.5f176fc4%netbsd.org@localhost>,
Niclas Rosenvik  <nros%netbsd.org@localhost> wrote:
>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.

Assuming it is correct go for it.

christos



Home | Main Index | Thread Index | Old Index