diff options
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch index ef81703bc3..4e21d1e9f1 100644 --- a/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch +++ b/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch | |||
| @@ -22,7 +22,14 @@ Change-Id: If2c6007a8c85bc3f3065002af8a7538b882fb4a8 | |||
| 22 | 22 | ||
| 23 | --- a/src/common/compat/compat-fcntl.c | 23 | --- a/src/common/compat/compat-fcntl.c |
| 24 | +++ b/src/common/compat/compat-fcntl.c | 24 | +++ b/src/common/compat/compat-fcntl.c |
| 25 | @@ -13,7 +13,7 @@ | 25 | @@ -8,14 +8,17 @@ |
| 26 | #define _LGPL_SOURCE | ||
| 27 | #include <common/compat/fcntl.h> | ||
| 28 | #include <common/macros.h> | ||
| 29 | +#include <common/bug.h> | ||
| 30 | +#include <stdint.h> | ||
| 31 | #include <unistd.h> | ||
| 32 | |||
| 26 | #ifdef __linux__ | 33 | #ifdef __linux__ |
| 27 | 34 | ||
| 28 | LTTNG_HIDDEN | 35 | LTTNG_HIDDEN |
| @@ -30,25 +37,20 @@ Change-Id: If2c6007a8c85bc3f3065002af8a7538b882fb4a8 | |||
| 30 | +int compat_sync_file_range(int fd, off_t offset, off_t nbytes, | 37 | +int compat_sync_file_range(int fd, off_t offset, off_t nbytes, |
| 31 | unsigned int flags) | 38 | unsigned int flags) |
| 32 | { | 39 | { |
| 40 | + LTTNG_BUILD_BUG_ON(sizeof(off_t) != sizeof(int64_t)); | ||
| 33 | #ifdef HAVE_SYNC_FILE_RANGE | 41 | #ifdef HAVE_SYNC_FILE_RANGE |
| 42 | return sync_file_range(fd, offset, nbytes, flags); | ||
| 43 | #else | ||
| 34 | --- a/src/common/compat/fcntl.h | 44 | --- a/src/common/compat/fcntl.h |
| 35 | +++ b/src/common/compat/fcntl.h | 45 | +++ b/src/common/compat/fcntl.h |
| 36 | @@ -8,21 +8,21 @@ | 46 | @@ -13,16 +13,12 @@ |
| 37 | #ifndef _COMPAT_FCNTL_H | ||
| 38 | #define _COMPAT_FCNTL_H | ||
| 39 | |||
| 40 | +#include <assert.h> | ||
| 41 | #include <fcntl.h> | ||
| 42 | #include <sys/types.h> | ||
| 43 | 47 | ||
| 44 | #include <common/compat/errno.h> | 48 | #include <common/compat/errno.h> |
| 45 | 49 | ||
| 46 | -#if (defined(__CYGWIN__)) | 50 | -#if (defined(__CYGWIN__)) |
| 47 | -typedef long long off64_t; | 51 | -typedef long long off64_t; |
| 48 | -#endif | 52 | -#endif |
| 49 | +static_assert(sizeof(off_t) == sizeof(int64_t), | 53 | - |
| 50 | + "Build system is misconfigured, off_t must be 64-bit wide"); | ||
| 51 | |||
| 52 | #if (defined(__FreeBSD__) || defined(__sun__)) | 54 | #if (defined(__FreeBSD__) || defined(__sun__)) |
| 53 | typedef off64_t loff_t; | 55 | typedef off64_t loff_t; |
| 54 | #endif | 56 | #endif |
| @@ -59,7 +61,7 @@ Change-Id: If2c6007a8c85bc3f3065002af8a7538b882fb4a8 | |||
| 59 | unsigned int flags); | 61 | unsigned int flags); |
| 60 | #define lttng_sync_file_range(fd, offset, nbytes, flags) \ | 62 | #define lttng_sync_file_range(fd, offset, nbytes, flags) \ |
| 61 | compat_sync_file_range(fd, offset, nbytes, flags) | 63 | compat_sync_file_range(fd, offset, nbytes, flags) |
| 62 | @@ -37,8 +37,8 @@ extern int compat_sync_file_range(int fd | 64 | @@ -37,8 +33,8 @@ extern int compat_sync_file_range(int fd |
| 63 | #define SYNC_FILE_RANGE_WAIT_BEFORE 0 | 65 | #define SYNC_FILE_RANGE_WAIT_BEFORE 0 |
| 64 | #define SYNC_FILE_RANGE_WRITE 0 | 66 | #define SYNC_FILE_RANGE_WRITE 0 |
| 65 | 67 | ||
