Add FreeBSD compat layer for splice and sync_file_range
[lttng-tools.git] / src / common / kernel-consumer / kernel-consumer.c
index 3489ab6ed866970eec6915701ffef029d27d6c36..f32f47b3eeb1f6faf6b615700529dea5e990c7e5 100644 (file)
@@ -19,7 +19,6 @@
 
 #define _GNU_SOURCE
 #include <assert.h>
-#include <fcntl.h>
 #include <poll.h>
 #include <pthread.h>
 #include <stdlib.h>
 #include <sys/socket.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <sys/stat.h>
 
 #include <common/common.h>
 #include <common/kernel-ctl/kernel-ctl.h>
 #include <common/sessiond-comm/sessiond-comm.h>
+#include <common/compat/fcntl.h>
 
 #include "kernel-consumer.h"
 
@@ -72,7 +73,7 @@ int lttng_kconsumer_on_read_subbuffer_mmap(
                        goto end;
                }
                /* This won't block, but will start writeout asynchronously */
-               sync_file_range(outfd, stream->out_fd_offset, ret,
+               lttng_sync_file_range(outfd, stream->out_fd_offset, ret,
                                SYNC_FILE_RANGE_WRITE);
                stream->out_fd_offset += ret;
        }
@@ -122,7 +123,7 @@ int lttng_kconsumer_on_read_subbuffer_splice(
                }
                len -= ret;
                /* This won't block, but will start writeout asynchronously */
-               sync_file_range(outfd, stream->out_fd_offset, ret,
+               lttng_sync_file_range(outfd, stream->out_fd_offset, ret,
                                SYNC_FILE_RANGE_WRITE);
                stream->out_fd_offset += ret;
        }
This page took 0.025844 seconds and 5 git commands to generate.