summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syscall.h
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2014-04-28 14:18:50 +0000
committerJeff Darcy <jdarcy@redhat.com>2014-04-28 14:18:50 +0000
commite139b4d0ba2286c0d4d44ba81260c2b287016019 (patch)
tree0a21f0761528e0f79da0a9f67106eb128ace0cf7 /libglusterfs/src/syscall.h
parent73b60c87ca7f62517a8466431f5a8cf167589c8c (diff)
parentf2bac9f9d5b9956969ddd25a54bc636b82f6923e (diff)
Merge branch 'upstream'HEADmaster
Conflicts: rpc/xdr/src/glusterfs3-xdr.c rpc/xdr/src/glusterfs3-xdr.h xlators/features/changelog/src/Makefile.am xlators/features/changelog/src/changelog-helpers.h xlators/features/changelog/src/changelog.c xlators/mgmt/glusterd/src/glusterd-sm.c Change-Id: I9972a5e6184503477eb77a8b56c50a4db4eec3e2
Diffstat (limited to 'libglusterfs/src/syscall.h')
-rw-r--r--libglusterfs/src/syscall.h53
1 files changed, 51 insertions, 2 deletions
diff --git a/libglusterfs/src/syscall.h b/libglusterfs/src/syscall.h
index f1c9f58c3..bbf23bef0 100644
--- a/libglusterfs/src/syscall.h
+++ b/libglusterfs/src/syscall.h
@@ -11,6 +11,41 @@
#ifndef __SYSCALL_H__
#define __SYSCALL_H__
+/* GF follows the Linux XATTR definition, which differs in Darwin. */
+#define GF_XATTR_CREATE 0x1 /* set value, fail if attr already exists */
+#define GF_XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
+
+/* Linux kernel version 2.6.x don't have these defined
+ define if not defined */
+
+#ifndef XATTR_SECURITY_PREFIX
+#define XATTR_SECURITY_PREFIX "security."
+#define XATTR_SECURITY_PREFIX_LEN (sizeof (XATTR_SECURITY_PREFIX) - 1)
+#endif
+
+#ifndef XATTR_SYSTEM_PREFIX
+#define XATTR_SYSTEM_PREFIX "system."
+#define XATTR_SYSTEM_PREFIX_LEN (sizeof (XATTR_SYSTEM_PREFIX) - 1)
+#endif
+
+#ifndef XATTR_TRUSTED_PREFIX
+#define XATTR_TRUSTED_PREFIX "trusted."
+#define XATTR_TRUSTED_PREFIX_LEN (sizeof (XATTR_TRUSTED_PREFIX) - 1)
+#endif
+
+#ifndef XATTR_USER_PREFIX
+#define XATTR_USER_PREFIX "user."
+#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1)
+#endif
+
+#if defined(GF_DARWIN_HOST_OS)
+#include <sys/xattr.h>
+#define XATTR_DARWIN_NOSECURITY XATTR_NOSECURITY
+#define XATTR_DARWIN_NODEFAULT XATTR_NODEFAULT
+#define XATTR_DARWIN_SHOWCOMPRESSION XATTR_SHOWCOMPRESSION
+#endif
+
+
int
sys_lstat (const char *path, struct stat *buf);
@@ -20,8 +55,13 @@ sys_stat (const char *path, struct stat *buf);
int
sys_fstat (int fd, struct stat *buf);
-DIR *
-sys_opendir (const char *name);
+int
+sys_fstatat (int dirfd, const char *pathname, struct stat *buf,
+ int flags);
+int
+sys_openat (int dirfd, const char *pathname, int flags, ...);
+
+DIR *sys_opendir (const char *name);
struct dirent *
sys_readdir (DIR *dir);
@@ -39,6 +79,9 @@ int
sys_mkdir (const char *pathname, mode_t mode);
int
+sys_mkdirat (int dirfd, const char *pathname, mode_t mode);
+
+int
sys_unlink (const char *pathname);
int
@@ -107,6 +150,12 @@ sys_fsync (int fd);
int
sys_fdatasync (int fd);
+void
+gf_add_prefix(const char *ns, const char *key, char **newkey);
+
+void
+gf_remove_prefix(const char *ns, const char *key, char **newkey);
+
int
sys_lsetxattr (const char *path, const char *name, const void *value,
size_t size, int flags);