port: Add missing sock_cred macros on FreeBSD
[lttng-tools.git] / src / common / compat / compat-fcntl.c
CommitLineData
3fa91327 1/*
ab5be9fa 2 * Copyright (C) 2011 David Goulet <dgoulet@efficios.com>
3fa91327 3 *
ab5be9fa 4 * SPDX-License-Identifier: GPL-2.0-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
9410f65c 15LTTNG_HIDDEN
3fa91327
DG
16int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes,
17 unsigned int flags)
18{
281047b8 19#ifdef HAVE_SYNC_FILE_RANGE
3fa91327 20 return sync_file_range(fd, offset, nbytes, flags);
281047b8
SM
21#else
22 return fdatasync(fd);
23#endif
3fa91327
DG
24}
25
26#endif /* __linux__ */
This page took 0.04937 seconds and 4 git commands to generate.