compat: include proper headers for FreeBSD

Signed-off-by: Yan, Zheng <zyan@redhat.com>
This commit is contained in:
Yan, Zheng 2015-09-06 16:03:45 +08:00
parent be595df56c
commit b4330832cd
13 changed files with 22 additions and 14 deletions

View File

@ -34,7 +34,7 @@ using namespace std;
#include "global/global_init.h"
#include "common/safe_io.h"
#ifndef DARWIN
#if !defined(DARWIN) && !defined(__FreeBSD__)
#include <envz.h>
#endif // DARWIN

View File

@ -14,6 +14,8 @@
#define FUSE_USE_VERSION 30
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -1,5 +1,6 @@
#include "include/ipaddr.h"
#include <sys/socket.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>

View File

@ -17,12 +17,10 @@
#include <unistd.h>
#ifndef __CYGWIN__
# ifndef DARWIN
# include <sys/ioctl.h>
# include <syscall.h>
# include "../os/btrfs_ioctl.h"
# endif
#if defined(__linux__)
#include <sys/ioctl.h>
#include <syscall.h>
#include "../os/btrfs_ioctl.h"
#endif
inline int sync_filesystem(int fd)

View File

@ -25,7 +25,7 @@
#include <sys/vfs.h>
#endif
#if defined(DARWIN)
#if defined(DARWIN) || defined(__FreeBSD__)
#include <sys/param.h>
#include <sys/mount.h>
#endif

View File

@ -17,6 +17,7 @@
#ifndef CEPH_MSG_EVENTKQUEUE_H
#define CEPH_MSG_EVENTKQUEUE_H
#include <sys/types.h>
#include <sys/event.h>
#include <unistd.h>

View File

@ -12,7 +12,9 @@
*
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <sys/uio.h>

View File

@ -281,7 +281,7 @@ int GenericFileStoreBackend::do_fiemap(int fd, off_t start, size_t len, struct f
fiemap->fm_length = len + start % CEPH_PAGE_SIZE;
fiemap->fm_flags = FIEMAP_FLAG_SYNC; /* flush extents to disk if needed */
#if defined(DARWIN)
#if defined(DARWIN) || defined(__FreeBSD__)
ret = -ENOTSUP;
goto done_err;
#else
@ -305,7 +305,7 @@ int GenericFileStoreBackend::do_fiemap(int fd, off_t start, size_t len, struct f
fiemap->fm_extent_count = fiemap->fm_mapped_extents;
fiemap->fm_mapped_extents = 0;
#if defined(DARWIN)
#if defined(DARWIN) || defined(__FreeBSD__)
ret = -ENOTSUP;
goto done_err;
#else

View File

@ -11,7 +11,7 @@
#if defined(__linux__)
#include <limits.h>
#define CHAIN_XATTR_MAX_NAME_LEN ((XATTR_NAME_MAX + 1) / 2)
#elif defined(__APPLE__) || defined(__FreeBSD__)
#elif defined(__APPLE__)
#include <sys/xattr.h>
#define CHAIN_XATTR_MAX_NAME_LEN ((XATTR_MAXNAMELEN + 1) / 2)
#else

View File

@ -30,7 +30,7 @@
#include "XFS.h"
#endif
#ifdef DARWIN
#if defined(DARWIN) || defined(__FreeBSD__)
#include <sys/mount.h>
#else
#include <sys/vfs.h>

View File

@ -19,6 +19,10 @@
#include <getopt.h>
#include <assert.h>
#if defined(__FreeBSD__)
#include <sys/param.h>
#endif
#include "include/compat.h"
#include "include/rbd/librbd.h"

View File

@ -15,7 +15,7 @@
#include "Deser.hpp"
#include <arpa/inet.h>
#include <cstdlib>
#if defined(DARWIN)
#if defined(DARWIN) || defined(__FreeBSD__)
#include <machine/endian.h>
#else
#include <endian.h>

View File

@ -16,7 +16,7 @@
#include "Ser.hpp"
#include <arpa/inet.h>
#include <cstdlib>
#if defined(DARWIN)
#if defined(DARWIN) || defined(__FreeBSD__)
#include <machine/endian.h>
#else
#include <endian.h>