On 2/28/2019 2:04 PM, Dmitri Maziuk via Bacula-users wrote:
On 2/28/2019 8:06 AM, Andrea Venturoli wrote:
On 2/28/19 2:23 PM, Martin Simmons wrote:

That suggests the function accept4 was defined at compile time by fails with
errno=38 (ENOSYS) at run time.

I don't know what to answer.
I'm not competent enough to understand the difference between the two; I cannot also tell why it is defined and why it does not work.

It looks like accept(4) is a gnu-ism that takes a couple of convenience flags and falls back on accept() if the flags are 0. Arguably it's an error between the programmer's chair and keyboard: by using a non-standard extension that at best saves you a couple of extra lines of code, they lost portability to non-glibc systems including presumable musl-based linux distros.


Taking that programmer's chair and keyboard error a step further... There are only two flags that can be used in the accept4() flags arg, SOCK_NONBLOCK and SOCK_CLOEXEC, setting O_NONBLOCK and/or O_CLOEXEC. AFAIK, the O_CLOEXEC is a Linux-ism introduced in 2.6.23 and so automatically makes it less portable. The O_NONBLOCK simply saves a fcntl() call, so why does accept4() even exist. IMO, the original programmer's chair to keyboard error was made by Gnu. This is a nearly pointless POSIX extension.



But hey, we don't need portable C: ./configure libtool will figure it all out for us.


Definitely agree with your doubts about libtool.




_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to