[PR PATCH] [Closed]: Fix FreeBSD/Darwin & Linux sendfile.

github at samba.org github at samba.org
Tue Feb 12 09:23:41 UTC 2019


There's a closed pull request on the Samba Samba Github repository

    Fix FreeBSD/Darwin & Linux sendfile.
https://github.com/samba-team/samba/pull/76
Description:     Use poll() to emulate a blocking sendfile().

    This avoids spinning on EAGAIN/EWOULDBLOCK under Linux implementation,
    which greatly reduces CPU usage.

(https://lists.samba.org/archive/samba/2013-September/175838.html)

    This fixes FreeBSD/Darwin implementation, which under most cases did
    not work, it would break early when nwritten == 0.  Which would happen
    anytime it spun on EAGAIN writing 0 bytes.

(https://forums.freebsd.org/threads/55017/)



More information about the samba-technical mailing list