]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/common/xattr.c
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / common / xattr.c
index 080bebcaafd81497867ab6113f3aeeb09f11c656..c7afcf1e1e0028df275706012c2fdf60438e8ab2 100644 (file)
@@ -19,7 +19,8 @@
 #elif defined(__linux__)
 #include <sys/types.h>
 #include <sys/xattr.h>
-#elif defined(DARWIN)
+#elif defined(__APPLE__)
+#include <errno.h>
 #include <sys/xattr.h>
 #else
 #error "Your system is not supported!"
@@ -44,7 +45,7 @@ ceph_os_setxattr(const char *path, const char *name,
                error = 0;
 #elif defined(__linux__) 
        error = setxattr(path, name, value, size, 0);
-#elif defined(DARWIN)
+#elif defined(__APPLE__)
        error = setxattr(path, name, value, size, 0 /* position */, 0);
 #endif
 
@@ -63,8 +64,8 @@ ceph_os_fsetxattr(int fd, const char *name, const void *value,
                error = 0;
 #elif defined(__linux__)
        error = fsetxattr(fd, name, value, size, 0);
-#elif defined(DARWIN)
-       error = fsetxattr(fd, name, value, size, 0, 0 /* no options should be indentical to Linux */ );
+#elif defined(__APPLE__)
+       error = fsetxattr(fd, name, value, size, 0, 0 /* no options should be identical to Linux */ );
 #endif
 
        return (error);
@@ -95,7 +96,7 @@ void *value, size_t size)
        }
 #elif defined(__linux__)
        error = getxattr(path, name, value, size);
-#elif defined(DARWIN)
+#elif defined(__APPLE__)
        error = getxattr(path, name, value, size, 0 /* position  */, 0);
        /* ENOATTR and ENODATA have different values */
        if (error < 0 && errno == ENOATTR)
@@ -130,7 +131,7 @@ ceph_os_fgetxattr(int fd, const char *name, void *value,
        }
 #elif defined(__linux__)
        error = fgetxattr(fd, name, value, size);
-#elif defined(DARWIN)
+#elif defined(__APPLE__)
        error = fgetxattr(fd, name, value, size, 0, 0 /* no options */);
        /* ENOATTR and ENODATA have different values */
        if (error < 0 && errno == ENOATTR)
@@ -182,7 +183,7 @@ ceph_os_listxattr(const char *path, char *list, size_t size)
        }
 #elif defined(__linux__)
        error = listxattr(path, list, size);
-#elif defined(DARWIN)
+#elif defined(__APPLE__)
        error = listxattr(path, list, size, 0);
 #endif
 
@@ -231,7 +232,7 @@ ceph_os_flistxattr(int fd, char *list, size_t size)
        }
 #elif defined(__linux__)
        error = flistxattr(fd, list, size);
-#elif defined(DARWIN)
+#elif defined(__APPLE__)
        error = flistxattr(fd, list, size, 0);
 #endif
 
@@ -247,7 +248,7 @@ ceph_os_removexattr(const char *path, const char *name)
        error = extattr_delete_file(path, EXTATTR_NAMESPACE_USER, name);
 #elif defined(__linux__)
        error = removexattr(path, name);
-#elif defined(DARWIN)
+#elif defined(__APPLE__)
        error = removexattr(path, name, 0);
        /* ENOATTR and ENODATA have different values */
        if (error < 0 && errno == ENOATTR)
@@ -266,7 +267,7 @@ ceph_os_fremovexattr(int fd, const char *name)
        error = extattr_delete_fd(fd, EXTATTR_NAMESPACE_USER, name);
 #elif defined(__linux__)
        error = fremovexattr(fd, name);
-#elif defined(DARWIN)
+#elif defined(__APPLE__)
        error = fremovexattr(fd, name, 0);
        /* ENOATTR and ENODATA have different values */
        if (error < 0 && errno == ENOATTR)