| 1 | /* |
| 2 | * Copyright (C) 2011 David Goulet <dgoulet@efficios.com> |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0-only |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #define _LGPL_SOURCE |
| 9 | #include <common/compat/fcntl.h> |
| 10 | #include <common/macros.h> |
| 11 | #include <unistd.h> |
| 12 | |
| 13 | #ifdef __linux__ |
| 14 | |
| 15 | LTTNG_HIDDEN |
| 16 | int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes, |
| 17 | unsigned int flags) |
| 18 | { |
| 19 | #ifdef HAVE_SYNC_FILE_RANGE |
| 20 | return sync_file_range(fd, offset, nbytes, flags); |
| 21 | #else |
| 22 | return fdatasync(fd); |
| 23 | #endif |
| 24 | } |
| 25 | |
| 26 | #endif /* __linux__ */ |