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

Re: accept4 and friends



Hi,

Hleb Valoshka:
> Hello,
> 
> This page [0] states that accept4, SOCK_CLOEXEC and SOCK_NONBLOCK are
> implemented only in FreeBSD 10, but libc on gnu/kfreebsd has prototype
> for accept4.
> 
> It seems to me that even if debian's kfreebsd supports accept4 (I
> doubt) it will be better to remove that prototype because:
> 1) it's useless without SOCK_CLOEXEC or SOCK_NONBLOCK
> 2) some software assumes that accept4 and SOCK_CLOEXEC go together so
> they check only for accept4 but not for SOCK_CLOEXEC, it's the reason
> why ruby2.0 build is failed on kfreebsd.

I agree with what you say, but since <sys/socket.h> is a
kernel-independant header, it is up to the glibc maintainers to do this.

Please can you file a bug on libc0.1-dev so that your request is considered?

I would suggest wrapping it, e.g.:

#if defined(SOCK_CLOEXEC) || defined(SOCK_NONBLOCK)
/* accept4 prototype */
#endif

-- 
Robert Millan


Reply to: