]> git.itanic.dy.fi Git - scan-pagemap/commit
parser: Remove unaccessible pids from the pidlist
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Thu, 26 Aug 2010 18:43:32 +0000 (21:43 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Thu, 26 Aug 2010 18:43:32 +0000 (21:43 +0300)
commitd52b8a4b749fde68d35dfa8bffc8f06f728d3f91
tree5b21c492ba992bba91cd17f035e5636d8762ca94
parentcd48806a2f27f91e5b06fcd0fbf3377e04201a0f
parser: Remove unaccessible pids from the pidlist

If scan-pagemap is run without root priviledges and --shared-mappings
option is used, pids that are inaccessible to the user need to be
removed from the list of interesting pids. Otherwise
dunp_process_maps() will not print any pages for the given processes,
as it will try to count pages that are shared with all interesting
pids. If any pids from the list are inaccessible to the user, then
none of the pages are shared with these inaccessible pids. Therefore,
the inaccessible pids must be removed from the list altogether.

Since list entries are being removed from the list, all
list_for_each_entry will be need to be replaced with the _safe
variant.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
parse.c