]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/libcephfs: Only use sys/xattr.h on Linux
authorWillem Jan Withagen <wjw@digiware.nl>
Sat, 21 Sep 2019 12:43:30 +0000 (14:43 +0200)
committerWillem Jan Withagen <wjw@digiware.nl>
Fri, 27 Sep 2019 19:59:08 +0000 (21:59 +0200)
For compatibility add XATTR_CREATE to include/compat.h

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
src/include/compat.h
src/test/libcephfs/access.cc
src/test/libcephfs/acl.cc
src/test/libcephfs/caps.cc
src/test/libcephfs/deleg.cc
src/test/libcephfs/lazyio.cc
src/test/libcephfs/multiclient.cc
src/test/libcephfs/reclaim.cc
src/test/libcephfs/test.cc

index 606e4156288823f68785a1e1b597450e1f46c677..7c75dac2e16b0823315039fc6818c219a4f0ffc8 100644 (file)
@@ -99,6 +99,9 @@ int sched_setaffinity(pid_t pid, size_t cpusetsize,
 #ifndef EKEYREJECTED
 #define EKEYREJECTED 129
 #endif
+#ifndef XATTR_CREATE
+#define XATTR_CREATE 1
+#endif
 
 #ifndef HOST_NAME_MAX
 #ifdef MAXHOSTNAMELEN 
index b9286929acd57c734a13044c9ca4b9f934b646cc..cac42f33fb9c062f37c8080a206ef8067663adfd 100644 (file)
@@ -24,7 +24,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <dirent.h>
-#include <sys/xattr.h>
 #include <sys/uio.h>
 #include <iostream>
 #include <vector>
@@ -32,6 +31,7 @@
 
 #ifdef __linux__
 #include <limits.h>
+#include <sys/xattr.h>
 #endif
 
 
index a9a800d00aae8c21e87dea96a0ee12d0e4ee3531..a6c4a65963d92778645610b7d264a9bdde1885bb 100644 (file)
@@ -21,7 +21,9 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifdef __linux__
 #include <sys/xattr.h>
+#endif
 
 static size_t acl_ea_size(int count)
 {
index 4af9b418d2e8345dd36aa6d6752369e1cfc9472f..b4976c9c3effb5ab2224afceca1025300cc53480 100644 (file)
@@ -22,7 +22,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <dirent.h>
+#ifdef __linux__
 #include <sys/xattr.h>
+#endif
 #include <signal.h>
 
 TEST(Caps, ReadZero) {
index 36c0346d49bef6af2cda351b50a5417cdacd0c0f..1a6376ee5e19a632d81fe6d731e923643e3e1603 100644 (file)
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <dirent.h>
-#include <sys/xattr.h>
 #include <sys/uio.h>
 
 #ifdef __linux__
 #include <limits.h>
+#include <sys/xattr.h>
 #endif
 
 #include <map>
index 16e8e0a66ecd90cb24264a80330fd0630b6845c6..b484730438fd786122d85384541639e12ac1d18f 100644 (file)
@@ -21,7 +21,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <dirent.h>
+#if defined(__linux__)
 #include <sys/xattr.h>
+#endif
 
 rados_t cluster;
 
index 179109de25b0bdc5132f048f43c72caf09e40f4f..465bbd8f77246f0362d55b5a16ed8ba5b8fc37a4 100644 (file)
@@ -20,7 +20,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <dirent.h>
+#ifdef __linux__
 #include <sys/xattr.h>
+#endif
 
 TEST(LibCephFS, MulticlientSimple) {
   struct ceph_mount_info *ca, *cb;
index e019dd25a6443d4d80cb0fa647467e3a529a305f..7b2f7b7694f283df7d7c03534ce0318758642f13 100644 (file)
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <dirent.h>
-#include <sys/xattr.h>
 #include <sys/uio.h>
 #include <libgen.h>
 #include <stdlib.h>
 
 #ifdef __linux__
+#include <sys/xattr.h>
 #include <limits.h>
 #endif
 
+#ifdef __FreeBSD__
+#include <sys/wait.h>
+#endif
+
 
 #include <map>
 #include <vector>
index 63eb5d91a704194a4d67a95f069edb9e4579523e..e1b43db6ac05aad0e09560d542bccd33030773b5 100644 (file)
@@ -12,6 +12,7 @@
  *
  */
 
+#include "include/compat.h"
 #include "gtest/gtest.h"
 #include "include/cephfs/libcephfs.h"
 #include "include/stat.h"
@@ -21,7 +22,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <dirent.h>
-#include <sys/xattr.h>
 #include <sys/uio.h>
 #include <sys/time.h>
 #include <sys/resource.h>
@@ -30,6 +30,7 @@
 
 #ifdef __linux__
 #include <limits.h>
+#include <sys/xattr.h>
 #endif
 
 #include <map>