Merge pull request #3987 from ntherning/fix-support-stdio-compile-error-on-android
[mono.git] / support / sys-sendfile.c
index 0a6c7f6d59fb9c2b02580adec0fbcc257e05e89d..3edf7be4163bac5febd12a6987d64dfbaa5d2b86 100644 (file)
@@ -7,15 +7,18 @@
  * Copyright (C) 2004 Jonathan Pryor
  */
 
+#include <config.h>
+
 #include <sys/types.h>
 #include <errno.h>
 
+#include "map.h"
+#include "mph.h"
+
 #ifdef HAVE_SYS_SENDFILE_H
 #include <sys/sendfile.h>
 #endif /* ndef HAVE_SYS_SENDFILE_H */
 
-#include "mph.h"
-
 G_BEGIN_DECLS
 
 #ifdef HAVE_SENDFILE
@@ -28,7 +31,12 @@ Mono_Posix_Syscall_sendfile (int out_fd, int in_fd, mph_off_t *offset, mph_size_
 
        _offset = *offset;
 
+#if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD)
+       /* The BSD version has 6 arguments */
+       g_assert_not_reached ();
+#else
        r = sendfile (out_fd, in_fd, &_offset, (size_t) count);
+#endif
 
        *offset = _offset;