[sysprof/wip/chergert/sysprof-3] binfile: ignore vdso bytes if not on Linux



commit aae2aae2cb7befbe2db7dd9fe576df82581d87f9
Author: Christian Hergert <chergert redhat com>
Date:   Tue May 7 22:57:50 2019 -0700

    binfile: ignore vdso bytes if not on Linux
    
    Of course, this all needs improvements to be realistically useful, but
    it allows us to get things at least opening. We can adjust how we
    store that data to make it available on other OS's later.

 src/libsysprof/binfile.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/libsysprof/binfile.c b/src/libsysprof/binfile.c
index a876179..04430fc 100644
--- a/src/libsysprof/binfile.c
+++ b/src/libsysprof/binfile.c
@@ -300,6 +300,7 @@ get_lines (const char *format,
 static const uint8_t *
 get_vdso_bytes (size_t *length)
 {
+#ifdef __linux__
     static const uint8_t *bytes = NULL;
     static size_t n_bytes = 0;
     static gboolean has_data;
@@ -343,6 +344,11 @@ get_vdso_bytes (size_t *length)
         *length = n_bytes;
 
     return bytes;
+#else
+    if (length)
+        *length = 0;
+    return NULL;
+#endif
 }
 
 bin_file_t *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]