tech-userlevel archive

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

Re: Our dirfd(3) is a macro not a function



On 09.09.2020 10:57, Paul Ripke wrote:
> TL;DR: Our dirfd(3) is a macro, boost expects a function. POSIX
> appears to require a function but allow an additional macro.
> FreeBSD, OpenBSD & Linux all provide functions. Perhaps we should,
> too?
> 
> Additional details are in my msg to tech-pkg@:
> http://mail-index.netbsd.org/tech-pkg/2020/09/09/msg023780.html
> 
> Cheers,
> 

The boost code should look like:

#ifdef dirfd
auto my_fd = dirfd(dir.get());
#else
auto my_fd = ::dirfd(dir.get());
#endif

or simply:

auto my_fd = dirfd(dir.get());

Otherwise it's not operational when dirfd is a macro.

The problem with dirfd as macro only pops up from time to time, mostly
in autoconf that tries to seek for a dirfd symbol inside libc and fail.

Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index