Crate pagemap[][src]

A crate to provide a simple API to Linux kernel’s pagemap API.

Structs

DeviceNumbers

Major and minor numbers of a file.

KPageFlags

kpageflags as defined in Linux, at include/uapi/linux/kernel-page-flags.h.

MapsEntry

A memory mapping of a process, parsed from /proc/<PID>/maps.

MemoryRegion

A region of virtual memory, defined by the first and the next-to-last addresses that it includes.

PageMap

A handle used to read from:

PageMapEntry

An entry read from /proc/<PID>/pagemap for a process, and optionally from /proc/kpagecount and /proc/kpageflags too.

PagePermissions

The permissions that a page may have.

Enums

PageMapError

An error type returned by calls to the API exposed by this crate.

Functions

maps

Convenience function for PageMap::maps, to parse all entries of /proc/PID/maps for the process with the given PID.

page_size

Retrieve system’s page size in bytes.

pagemap

Convenience wrapper for PageMap::pagemap, to retrieve the entries of /proc/PID/maps for the process with the given PID, combined with those in /proc/PID/pagemap (and also /proc/kpagecount and /proc/kpageflags, if permitted).

uss

Calculate the “unique set size” (USS) (i.e., the amount of memory that a process is using which is not shared with any other process) in bytes.

Type Definitions

Result

A custom Result type for this crate, combining a return value with a PageMapError. It is used all over the crate and also returned by many functions and methods of its external API.