>From aadb66ea37db2e9e016b6f5ba63e843f684b96fe Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 26 Sep 2017 17:03:48 +0200 Subject: [PATCH 1/2] 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. --- ChangeLog | 6 ++++++ lib/vma-iter.c | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/ChangeLog b/ChangeLog index 440b906..9643700 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-09-26 Bruno Haible + + 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 glob: remove bogus extern decl diff --git a/lib/vma-iter.c b/lib/vma-iter.c index d5c612f..ab2eb3f 100644 --- a/lib/vma-iter.c +++ b/lib/vma-iter.c @@ -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); -- 2.7.4