Files
2016-01-21 23:40:00 +01:00

50 lines
1.7 KiB
Plaintext

$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;