mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
capture: use _sp_sendfile() on non-Linux platforms
We still generally only build on Linux from the Sysprof project, but we can start to support other systems in the capture format (with the possibility of being more general for the UI later on too).
This commit is contained in:
@ -19,12 +19,12 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <sys/sendfile.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "capture/sp-capture-reader.h"
|
||||
#include "capture/sp-capture-util-private.h"
|
||||
#include "capture/sp-capture-writer.h"
|
||||
|
||||
struct _SpCaptureReader
|
||||
@ -842,7 +842,7 @@ sp_capture_reader_save_as (SpCaptureReader *self,
|
||||
{
|
||||
gssize written;
|
||||
|
||||
written = sendfile (fd, self->fd, &in_off, to_write);
|
||||
written = _sp_sendfile (fd, self->fd, &in_off, to_write);
|
||||
|
||||
if (written < 0)
|
||||
goto handle_errno;
|
||||
|
||||
@ -24,12 +24,12 @@
|
||||
#include <fcntl.h>
|
||||
#include <glib/gstdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/sendfile.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "capture/sp-capture-reader.h"
|
||||
#include "capture/sp-capture-util-private.h"
|
||||
#include "capture/sp-capture-writer.h"
|
||||
|
||||
#define DEFAULT_BUFFER_SIZE (getpagesize() * 64L)
|
||||
@ -829,7 +829,7 @@ sp_capture_writer_save_as (SpCaptureWriter *self,
|
||||
{
|
||||
gssize written;
|
||||
|
||||
written = sendfile (fd, self->fd, &in_off, pos);
|
||||
written = _sp_sendfile (fd, self->fd, &in_off, pos);
|
||||
|
||||
if (written < 0)
|
||||
goto handle_errno;
|
||||
@ -908,7 +908,7 @@ _sp_capture_writer_splice_from_fd (SpCaptureWriter *self,
|
||||
{
|
||||
gssize written;
|
||||
|
||||
written = sendfile (self->fd, fd, &in_off, to_write);
|
||||
written = _sp_sendfile (self->fd, fd, &in_off, to_write);
|
||||
|
||||
if (written < 0)
|
||||
goto handle_errno;
|
||||
|
||||
Reference in New Issue
Block a user