]> Savannah Git Hosting - gnulib.git/commitdiff
vma-iter: Provide the protection flags on FreeBSD.
authorBruno Haible <bruno@clisp.org>
Tue, 26 Sep 2017 15:03:48 +0000 (17:03 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 26 Sep 2017 23:49:25 +0000 (01:49 +0200)
* lib/vma-iter.c (vma_iterate) [FreeBSD]: When reading from /proc,
skip three fields between the addresses and the protection flags.

ChangeLog
lib/vma-iter.c

index 440b90686a50183a813e36dede9c382df59dbc02..964370066002bbcbba6f9d7438d91031049493d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-26  Bruno Haible  <bruno@clisp.org>
+
+       vma-iter: Provide the protection flags on FreeBSD.
+       * lib/vma-iter.c (vma_iterate) [FreeBSD]: When reading from /proc,
+       skip three fields between the addresses and the protection flags.
+
 2017-09-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        glob: remove bogus extern decl
index d5c612fc62201ce76ef87e655721d288a5fb687c..ab2eb3f45c614fe64318af764bdd23f2099e9228 100644 (file)
@@ -532,6 +532,29 @@ vma_iterate (vma_iterate_callback_fn callback, void *data)
                 && rof_getchar (&rof) == 'x'
                 && rof_scanf_lx (&rof, &end) >= 0))
             break;
+# if defined __FreeBSD__
+          /* Then the resident pages count.  */
+          do
+            c = rof_getchar (&rof);
+          while (c == ' ');
+          do
+            c = rof_getchar (&rof);
+          while (c != -1 && c != '\n' && c != ' ');
+          /* Then the private resident pages count.  */
+          do
+            c = rof_getchar (&rof);
+          while (c == ' ');
+          do
+            c = rof_getchar (&rof);
+          while (c != -1 && c != '\n' && c != ' ');
+          /* Then some kernel address.  */
+          do
+            c = rof_getchar (&rof);
+          while (c == ' ');
+          do
+            c = rof_getchar (&rof);
+          while (c != -1 && c != '\n' && c != ' ');
+# endif
           /* Then the flags.  */
           do
             c = rof_getchar (&rof);