mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-09 22:50:54 +00:00
libsysprof-capture: add sysprof_getpagesize()
This is a helper to get the page size on various platforms so that calling code does not need to duplicate that effort.
This commit is contained in:
@ -63,6 +63,7 @@
|
|||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "sysprof-capture-util-private.h"
|
||||||
#include "sysprof-platform.h"
|
#include "sysprof-platform.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -105,3 +106,18 @@ sysprof_memfd_create (const gchar *name)
|
|||||||
return fd;
|
return fd;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sysprof_getpagesize:
|
||||||
|
*
|
||||||
|
* Gets the page size using platform specific APIs.
|
||||||
|
*
|
||||||
|
* Returns: the system page size
|
||||||
|
*
|
||||||
|
* Since: 3.36
|
||||||
|
*/
|
||||||
|
gsize
|
||||||
|
sysprof_getpagesize (void)
|
||||||
|
{
|
||||||
|
return _sysprof_getpagesize ();
|
||||||
|
}
|
||||||
|
|||||||
@ -61,6 +61,8 @@
|
|||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
int sysprof_memfd_create (const gchar *desc);
|
int sysprof_memfd_create (const gchar *desc);
|
||||||
|
SYSPROF_AVAILABLE_IN_3_36
|
||||||
|
gsize sysprof_getpagesize (void);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|||||||
Reference in New Issue
Block a user