-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcompat.h
41 lines (35 loc) · 1.11 KB
/
compat.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2011 Stanislav Sedov <stas@FreeBSD.org>
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software
* Foundation. See file COPYING.
*/
#ifndef CEPH_COMPAT_H
#define CEPH_COMPAT_H
#if defined(__FreeBSD__)
#define ENODATA 61
#define MSG_MORE 0
#endif /* !__FreeBSD__ */
#ifndef TEMP_FAILURE_RETRY
#define TEMP_FAILURE_RETRY(expression) ({ \
typeof(expression) __result; \
do { \
__result = (expression); \
} while (__result == -1 && errno == EINTR); \
__result; })
#endif
#ifdef __cplusplus
# define VOID_TEMP_FAILURE_RETRY(expression) \
static_cast<void>(TEMP_FAILURE_RETRY(expression))
#else
# define VOID_TEMP_FAILURE_RETRY(expression) \
do { (void)TEMP_FAILURE_RETRY(expression); } while (0)
#endif
#if defined(__FreeBSD__) || defined(__APPLE__)
#define lseek64(fd, offset, whence) lseek(fd, offset, whence)
#endif
#endif /* !CEPH_COMPAT_H */