Commit | Line | Data |
---|---|---|
3fa91327 | 1 | /* |
ab5be9fa | 2 | * Copyright (C) 2011 David Goulet <dgoulet@efficios.com> |
3fa91327 | 3 | * |
c922647d | 4 | * SPDX-License-Identifier: LGPL-2.1-only |
3fa91327 | 5 | * |
3fa91327 DG |
6 | */ |
7 | ||
6c1c0768 | 8 | #define _LGPL_SOURCE |
3fa91327 | 9 | #include <common/compat/fcntl.h> |
9410f65c | 10 | #include <common/macros.h> |
efc18125 | 11 | #include <unistd.h> |
3fa91327 DG |
12 | |
13 | #ifdef __linux__ | |
14 | ||
15 | int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes, | |
16 | unsigned int flags) | |
17 | { | |
281047b8 | 18 | #ifdef HAVE_SYNC_FILE_RANGE |
3fa91327 | 19 | return sync_file_range(fd, offset, nbytes, flags); |
281047b8 SM |
20 | #else |
21 | return fdatasync(fd); | |
22 | #endif | |
3fa91327 DG |
23 | } |
24 | ||
25 | #endif /* __linux__ */ |