X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fcompat%2Fcompat-fcntl.cpp;fp=src%2Fcommon%2Fcompat%2Fcompat-fcntl.cpp;h=bc014d6404df4f1a78f71a0783d4b4ab6b47656a;hb=740da7d5000ca1ffdcf14bda5096bf7ccfb86bdd;hp=0000000000000000000000000000000000000000;hpb=02c3d2c2e3b27ab0bad1207c70465f84b649c816;p=lttng-tools.git diff --git a/src/common/compat/compat-fcntl.cpp b/src/common/compat/compat-fcntl.cpp new file mode 100644 index 000000000..bc014d640 --- /dev/null +++ b/src/common/compat/compat-fcntl.cpp @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 David Goulet + * + * SPDX-License-Identifier: GPL-2.0-only + * + */ + +#define _LGPL_SOURCE +#include +#include +#include + +#ifdef __linux__ + +int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes, + unsigned int flags) +{ +#ifdef HAVE_SYNC_FILE_RANGE + return sync_file_range(fd, offset, nbytes, flags); +#else + return fdatasync(fd); +#endif +} + +#endif /* __linux__ */