瀏覽代碼

backend o_direct fixed

Corentin Salingue 12 年之前
父節點
當前提交
d9676ab81b
共有 2 個文件被更改,包括 7 次插入1 次删除
  1. 1 0
      configure.ac
  2. 6 1
      src/core/disk_ops/unistd/disk_unistd_global.c

+ 1 - 0
configure.ac

@@ -136,6 +136,7 @@ case "$target" in
   ;;
 *linux*)
   starpu_linux=yes
+  AC_DEFINE(STARPU_LINUX_SYS, 1, [Define to 1 on Linux])
   ;;
 esac
 AM_CONDITIONAL([STARPU_HAVE_WINDOWS], [test "x$starpu_windows" = "xyes"])

+ 6 - 1
src/core/disk_ops/unistd/disk_unistd_global.c

@@ -46,8 +46,13 @@ starpu_unistd_global_alloc (struct starpu_unistd_global_obj * obj, void *base, s
 
 	strcpy(baseCpy, (char *) base);
 	strcat(baseCpy,template);
-
+#ifdef STARPU_LINUX_SYS
 	id = mkostemp(baseCpy, obj->flags);
+#else
+	STARPU_ASSERT(obj->flags == O_RDWR);
+	id = mkstemp(baseCpy);
+#endif
+
 	/* fail */
 	if (id < 0)
 	{