[sysprof] libsysprof-capture: add sysprof_getpagesize()
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] libsysprof-capture: add sysprof_getpagesize()
- Date: Thu, 13 Feb 2020 22:33:23 +0000 (UTC)
commit 86dcedfba01bd2404b00f9b0745e3da72c3b9e33
Author: Christian Hergert <chergert redhat com>
Date: Thu Feb 13 14:30:16 2020 -0800
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.
src/libsysprof-capture/sysprof-platform.c | 16 ++++++++++++++++
src/libsysprof-capture/sysprof-platform.h | 4 +++-
2 files changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/src/libsysprof-capture/sysprof-platform.c b/src/libsysprof-capture/sysprof-platform.c
index a81d2ae..99c9a55 100644
--- a/src/libsysprof-capture/sysprof-platform.c
+++ b/src/libsysprof-capture/sysprof-platform.c
@@ -63,6 +63,7 @@
#include <sys/syscall.h>
#include <unistd.h>
+#include "sysprof-capture-util-private.h"
#include "sysprof-platform.h"
/**
@@ -105,3 +106,18 @@ sysprof_memfd_create (const gchar *name)
return fd;
#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 ();
+}
diff --git a/src/libsysprof-capture/sysprof-platform.h b/src/libsysprof-capture/sysprof-platform.h
index 6cb6707..6dbe4ff 100644
--- a/src/libsysprof-capture/sysprof-platform.h
+++ b/src/libsysprof-capture/sysprof-platform.h
@@ -61,6 +61,8 @@
G_BEGIN_DECLS
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]