Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 1 | From cc3e1abaa1e7ad85c6a299fe30a36e0cb732e1c8 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Thu, 15 Dec 2022 14:51:20 -0800 |
| 4 | Subject: [PATCH] compat: Define off64_t as off_t on linux |
| 5 | |
| 6 | This helps compile with latest musl, where off64_t is not defined |
| 7 | unless _LARGEFILE64_SOURCE is defined, on glibc _LARGEFILE64_SOURCE is |
| 8 | defined if _GNU_SOURCE is defined, so the problem is only seen with musl |
| 9 | |
| 10 | Upstream-Status: Submitted [https://github.com/lttng/lttng-tools/pull/164] |
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 12 | --- |
| 13 | src/common/compat/fcntl.h | 2 +- |
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 15 | |
| 16 | diff --git a/src/common/compat/fcntl.h b/src/common/compat/fcntl.h |
| 17 | index 5e566e50..d19a6ece 100644 |
| 18 | --- a/src/common/compat/fcntl.h |
| 19 | +++ b/src/common/compat/fcntl.h |
| 20 | @@ -7,7 +7,6 @@ |
| 21 | |
| 22 | #ifndef _COMPAT_FCNTL_H |
| 23 | #define _COMPAT_FCNTL_H |
| 24 | - |
| 25 | #include <fcntl.h> |
| 26 | #include <sys/types.h> |
| 27 | |
| 28 | @@ -22,6 +21,7 @@ typedef off64_t loff_t; |
| 29 | #endif |
| 30 | |
| 31 | #ifdef __linux__ |
| 32 | +typedef off_t off64_t; |
| 33 | extern int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes, |
| 34 | unsigned int flags); |
| 35 | #define lttng_sync_file_range(fd, offset, nbytes, flags) \ |