mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 07:30:54 +00:00
memfd: add workaround for systems without memfd
Just a quick workaround to use a tmpfile if memfd is not available. We should try to ensure that we get something on tmpfs, but this is probably good enough for a fallback.
This commit is contained in:
@ -19,10 +19,10 @@
|
||||
#include <glib.h>
|
||||
#include <glib/gstdio.h>
|
||||
#include <errno.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sp-local-profiler.h"
|
||||
#include "sp-platform.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@ -467,7 +467,7 @@ sp_local_profiler_start (SpProfiler *profiler)
|
||||
SpCaptureWriter *writer;
|
||||
int fd;
|
||||
|
||||
if ((-1 == (fd = syscall (__NR_memfd_create, "[sysprof]", 0))) ||
|
||||
if ((-1 == (fd = sp_memfd_create ("[sysprof]"))) ||
|
||||
(NULL == (writer = sp_capture_writer_new_from_fd (fd, 0))))
|
||||
{
|
||||
const GError error = {
|
||||
|
||||
Reference in New Issue
Block a user