summaryrefslogtreecommitdiffstats
path: root/ctdb/lib/replace/system/filesys.h
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2013-05-29 14:44:03 +1000
committerAmitay Isaacs <amitay@gmail.com>2013-05-29 17:47:16 +1000
commit4c1dc871b9ebdb9a83ab7b4714d89e451ea0783a (patch)
tree340462070c256ce4f33bf0ccf344725c16270e17 /ctdb/lib/replace/system/filesys.h
parentfe1fc55c616f175a3ebdd8edb64dca0430c149d7 (diff)
downloadsamba-4c1dc871b9ebdb9a83ab7b4714d89e451ea0783a.tar.gz
samba-4c1dc871b9ebdb9a83ab7b4714d89e451ea0783a.tar.xz
samba-4c1dc871b9ebdb9a83ab7b4714d89e451ea0783a.zip
replace: Sync to latest replace from upstream
The latest commits affecting lib/replace remove autoconf build from Samba tree. So using following commit as a sync point. commit 9ddfd7d8784e6f546628f48990b69ee2850be52d Author: Andrew Bartlett <abartlet@samba.org> Date: Wed May 22 17:23:30 2013 +1000 Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 506b27c944b4031e8a325816bd12abddd442a0bb)
Diffstat (limited to 'ctdb/lib/replace/system/filesys.h')
-rw-r--r--ctdb/lib/replace/system/filesys.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/ctdb/lib/replace/system/filesys.h b/ctdb/lib/replace/system/filesys.h
index e2c3c1dd72..c8ac2b4f74 100644
--- a/ctdb/lib/replace/system/filesys.h
+++ b/ctdb/lib/replace/system/filesys.h
@@ -114,6 +114,8 @@
#if HAVE_SYS_ATTRIBUTES_H
#include <sys/attributes.h>
+#elif HAVE_ATTR_ATTRIBUTES_H
+#include <attr/attributes.h>
#endif
/* mutually exclusive (SuSE 8.2) */
@@ -123,11 +125,26 @@
#include <sys/xattr.h>
#endif
+#ifdef HAVE_SYS_EA_H
+#include <sys/ea.h>
+#endif
+
+#ifdef HAVE_SYS_EXTATTR_H
+#include <sys/extattr.h>
+#endif
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
+#ifndef XATTR_CREATE
+#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
+#endif
+
+#ifndef XATTR_REPLACE
+#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
+#endif
+
/* Some POSIX definitions for those without */
#ifndef S_IFDIR
@@ -200,4 +217,61 @@
# define uwrap_enabled() 0
#endif /* UID_WRAPPER */
+/*
+ this allows us to use a uniform error handling for our xattr
+ wrappers
+*/
+#ifndef ENOATTR
+#define ENOATTR ENODATA
+#endif
+
+
+#if !defined(HAVE_GETXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+ssize_t rep_getxattr (const char *path, const char *name, void *value, size_t size);
+#define getxattr(path, name, value, size) rep_getxattr(path, name, value, size)
+/* define is in "replace.h" */
+#endif
+
+#if !defined(HAVE_FGETXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+ssize_t rep_fgetxattr (int filedes, const char *name, void *value, size_t size);
+#define fgetxattr(filedes, name, value, size) rep_fgetxattr(filedes, name, value, size)
+/* define is in "replace.h" */
+#endif
+
+#if !defined(HAVE_LISTXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+ssize_t rep_listxattr (const char *path, char *list, size_t size);
+#define listxattr(path, list, size) rep_listxattr(path, list, size)
+/* define is in "replace.h" */
+#endif
+
+#if !defined(HAVE_FLISTXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+ssize_t rep_flistxattr (int filedes, char *list, size_t size);
+#define flistxattr(filedes, value, size) rep_flistxattr(filedes, value, size)
+/* define is in "replace.h" */
+#endif
+
+#if !defined(HAVE_REMOVEXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+int rep_removexattr (const char *path, const char *name);
+#define removexattr(path, name) rep_removexattr(path, name)
+/* define is in "replace.h" */
+#endif
+
+#if !defined(HAVE_FREMOVEXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+int rep_fremovexattr (int filedes, const char *name);
+#define fremovexattr(filedes, name) rep_fremovexattr(filedes, name)
+/* define is in "replace.h" */
+#endif
+
+#if !defined(HAVE_SETXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+int rep_setxattr (const char *path, const char *name, const void *value, size_t size, int flags);
+#define setxattr(path, name, value, size, flags) rep_setxattr(path, name, value, size, flags)
+/* define is in "replace.h" */
+#endif
+
+#if !defined(HAVE_FSETXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+int rep_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags);
+#define fsetxattr(filedes, name, value, size, flags) rep_fsetxattr(filedes, name, value, size, flags)
+/* define is in "replace.h" */
+#endif
+
#endif