X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=libatalk%2Fadouble%2Fad_sendfile.c;h=5452b271860174ddfe1cd03736c7636f83ba652c;hp=2a1f1426aa45b6a5aeb1aa13614c46b3be17e078;hb=15c1fc2f2328736dd428ec3be37c893d8ee2e065;hpb=2fdd522410f80afcd055d7333f491ee6c0b4b9fa diff --git a/libatalk/adouble/ad_sendfile.c b/libatalk/adouble/ad_sendfile.c index 2a1f1426..5452b271 100644 --- a/libatalk/adouble/ad_sendfile.c +++ b/libatalk/adouble/ad_sendfile.c @@ -40,37 +40,15 @@ #include "ad_lock.h" -#if defined(LINUX_BROKEN_SENDFILE_API) - -extern int32_t sendfile (int fdout, int fdin, int32_t *offset, u_int32_t count); +#if defined(SENDFILE_FLAVOR_LINUX) +#include ssize_t sys_sendfile(int tofd, int fromfd, off_t *offset, size_t count) { -u_int32_t small_total; -int32_t small_offset; -int32_t nwritten; - - /* - * Fix for broken Linux 2.4 systems with no working sendfile64(). - * If the offset+count > 2 GB then pretend we don't have the - * system call sendfile at all. The upper layer catches this - * and uses a normal read. JRA. - */ - - if ((sizeof(off_t) >= 8) && (*offset + count > (off_t)0x7FFFFFFF)) { - errno = ENOSYS; - return -1; - } - small_offset = (int32_t)*offset; - small_total = (u_int32_t)count; - nwritten = sendfile(tofd, fromfd, &small_offset, small_total); - if (nwritten > = 0) - *offset += nwritten; - - return nwritten; + return sendfile(tofd, fromfd, offset, count); } -#elif defined(SENDFILE_FLAVOR_LINUX) +#elif defined(SENDFILE_FLAVOR_SOLARIS) #include ssize_t sys_sendfile(int tofd, int fromfd, off_t *offset, size_t count) @@ -79,8 +57,6 @@ ssize_t sys_sendfile(int tofd, int fromfd, off_t *offset, size_t count) } #elif defined(SENDFILE_FLAVOR_BSD ) -/* FIXME untested */ -#error sendfile semantic broken #include ssize_t sys_sendfile(int tofd, int fromfd, off_t *offset, size_t count) {