Forráskód Böngészése

badly cope with __NR_copy_file_range not being defined

Samuel Thibault 7 éve
szülő
commit
779c9884f8
1 módosított fájl, 9 hozzáadás és 0 törlés
  1. 9 0
      src/core/disk_ops/unistd/disk_unistd_global.c

+ 9 - 0
src/core/disk_ops/unistd/disk_unistd_global.c

@@ -58,12 +58,21 @@
 #define TEMP_HIERARCHY_DEPTH 2
 
 #ifndef HAVE_COPY_FILE_RANGE 
+#ifdef __NR_copy_file_range
 static loff_t copy_file_range(int fd_in, loff_t *off_in, int fd_out,
 		loff_t *off_out, size_t len, unsigned int flags)
 {
 	return syscall(__NR_copy_file_range, fd_in, off_in, fd_out,
 			off_out, len, flags);
 }
+#else
+static loff_t copy_file_range(int fd_in, loff_t *off_in, int fd_out,
+		loff_t *off_out, size_t len, unsigned int flags)
+{
+	errno = ENOSYS;
+	return -1
+}
+#endif
 #endif
 
 static unsigned starpu_unistd_opened_files;