Fix: C++ syntax of FreeBSD compat code
[lttng-tools.git] / src / common / compat / compat-fcntl.cpp
CommitLineData
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
c9e313bc
SM
9#include <common/compat/fcntl.hpp>
10#include <common/macros.hpp>
efc18125 11#include <unistd.h>
3fa91327
DG
12
13#ifdef __linux__
14
15int 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__ */
This page took 0.066313 seconds and 4 git commands to generate.