summaryrefslogtreecommitdiff
path: root/benchmarks/dbench/patches/patch-ac
blob: 330ea045134b9de43f4624390ba448d0b54e6f2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
$NetBSD: patch-ac,v 1.3 2014/12/12 06:45:34 mef Exp $

Make this package build on Darwin.  getxattr(2) and setxattr(2) on Darwin
require additional arguments related to the resource fork attribute.

Use O_FSYNC instead of O_SYNC on DragonFly. Disable extattr_get_file
on DragonFly, the semantic is different and it isn't very useful
in the current form.

--- system.c.orig	2004-12-12 17:37:43.000000000 -0800
+++ system.c
@@ -29,8 +29,12 @@
 ssize_t sys_getxattr (const char *path, const char *name, void *value, size_t size)
 {
 #if defined(HAVE_GETXATTR)
+#  ifdef __APPLE__
+	return getxattr(path, name, value, size, 0, 0);
+#  else
 	return getxattr(path, name, value, size);
-#elif defined(HAVE_EXTATTR_GET_FILE)
+#  endif
+#elif defined(HAVE_EXTATTR_GET_FILE) && !defined(__DragonFly__)
 	char *s;
 	int attrnamespace = (strncmp(name, "system", 6) == 0) ? 
 		EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER;
@@ -56,7 +60,11 @@ ssize_t sys_getxattr (const char *path, 
 ssize_t sys_fgetxattr (int filedes, const char *name, void *value, size_t size)
 {
 #if defined(HAVE_FGETXATTR)
+#  ifdef __APPLE__
+	return fgetxattr(filedes, name, value, size, 0, 0);
+#  else
 	return fgetxattr(filedes, name, value, size);
+#  endif
 #elif defined(HAVE_EXTATTR_GET_FD)
 	char *s;
 	int attrnamespace = (strncmp(name, "system", 6) == 0) ? 
@@ -89,7 +97,11 @@ ssize_t sys_fgetxattr (int filedes, cons
 int sys_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags)
 {
 #if defined(HAVE_FSETXATTR)
+#  ifdef __APPLE__
+	return fsetxattr(filedes, name, value, size, 0, flags);
+#  else
 	return fsetxattr(filedes, name, value, size, flags);
+#  endif
 #elif defined(HAVE_EXTATTR_SET_FD)
 	char *s;
 	int retval = 0;