Merge branch 'master' of git://git.lttng.org/lttng-tools
[lttng-tools.git] / src / common / kernel-consumer / kernel-consumer.c
index 2054a865f75d76e78b19ec6b6d2e84718271eae1..823b4a28aa9df3934df86e55b09c3469857631fc 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 @@ ssize_t 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;
        }
@@ -105,7 +106,7 @@ ssize_t lttng_kconsumer_on_read_subbuffer_splice(
                                (unsigned long)offset, fd);
                ret = splice(fd, &offset, ctx->consumer_thread_pipe[1], NULL, len,
                                SPLICE_F_MOVE | SPLICE_F_MORE);
-               DBG("splice chan to pipe ret %ld", ret);
+               DBG("splice chan to pipe ret %zd", ret);
                if (ret < 0) {
                        errno = -ret;
                        perror("Error in relay splice");
@@ -114,7 +115,7 @@ ssize_t lttng_kconsumer_on_read_subbuffer_splice(
 
                ret = splice(ctx->consumer_thread_pipe[0], NULL, outfd, NULL, ret,
                                SPLICE_F_MOVE | SPLICE_F_MORE);
-               DBG("splice pipe to file %ld", ret);
+               DBG("splice pipe to file %zd", ret);
                if (ret < 0) {
                        errno = -ret;
                        perror("Error in file splice");
@@ -122,7 +123,7 @@ ssize_t 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.024435 seconds and 4 git commands to generate.