summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syscall.h
diff options
context:
space:
mode:
authorHarshavardhana <harsha@harshavardhana.net>2014-04-17 15:54:34 -0700
committerAnand Avati <avati@redhat.com>2014-04-24 14:41:48 -0700
commita3cb38e3edf005bef73da4c9cfd958474a14d50f (patch)
treea406029332a9eb096c14d441160bb670a42df8cb /libglusterfs/src/syscall.h
parent9c13471b109587a639662fc690384285bee02bc6 (diff)
build: MacOSX Porting fixes
git@forge.gluster.org:~schafdog/glusterfs-core/osx-glusterfs Working functionality on MacOSX - GlusterD (management daemon) - GlusterCLI (management cli) - GlusterFS FUSE (using OSXFUSE) - GlusterNFS (without NLM - issues with rpc.statd) Change-Id: I20193d3f8904388e47344e523b3787dbeab044ac BUG: 1089172 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Signed-off-by: Dennis Schafroth <dennis@schafroth.com> Tested-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Dennis Schafroth <dennis@schafroth.com> Reviewed-on: http://review.gluster.org/7503 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
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 f1c9f58c3fc..bbf23bef07b 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);