[go: up one dir, main page]

Module procfs

Source
Expand description

Read auxv entries via Linux procfs.

Since it’s just doing file I/O and not odd linkage tricks, the code to work with procfs is available on all OSs but of course will return an error on non-Linux since it won’t be able to find /proc/self/auxv (or anything else in /proc).

If you want a convenient way to query for just a handful of keys, search_procfs_auxv is a good choice. You provide a slice of keys to look for, and it builds a map of key to value for the keys you specify.

If, on the other hand, you want to inspect everything in the aux vector, iterate_procfs_auxv is what you want. It will let you iterate over every key/value pair in the aux vector. A minor wrinkle is that there are two layers of Result: one for around the initial Iterator, and another around each key/value pair. That’s just the way I/O is…

Structs§

ProcfsAuxvIter
An iterator across auxv pairs froom procfs.

Enums§

ProcfsAuxvError
Errors from reading /proc/self/auxv.

Functions§

iterate_procfs_auxv
Iterate over the contents of the procfs auxv file..
search_procfs_auxv
Read from the procfs auxv file and look for the specified keys.