return (_lp_use_sendfile(snum) && (get_remote_arch() != RA_WIN95) && !srv_is_signing_active());
}
+/*******************************************************************
+ Turn off sendfile if we find the underlying OS doesn't support it.
+********************************************************************/
+
+void set_use_sendfile(int snum, BOOL val)
+{
+ if (LP_SNUM_OK(snum))
+ ServicePtrs[snum]->bUseSendfile = val;
+ else
+ sDefault.bUseSendfile = val;
+}
+
/*******************************************************************
Turn off storing DOS attributes if this share doesn't support it.
********************************************************************/
* Special hack for broken Linux with no 64 bit clean sendfile. If we
* return ENOSYS then pretend we just got a normal read.
*/
- if (errno == ENOSYS)
+ if (errno == ENOSYS) {
+ set_use_sendfile(SNUM(conn), False);
goto normal_read;
+ }
DEBUG(0,("send_file_readbraw: sendfile failed for file %s (%s). Terminating\n",
fsp->fsp_name, strerror(errno) ));
* Special hack for broken Linux with no 64 bit clean sendfile. If we
* return ENOSYS then pretend we just got a normal read.
*/
- if (errno == ENOSYS)
+ if (errno == ENOSYS) {
+ set_use_sendfile(SNUM(conn), False);
goto normal_read;
+ }
DEBUG(0,("send_file_readX: sendfile failed for file %s (%s). Terminating\n",
fsp->fsp_name, strerror(errno) ));