|
|
cc [options] file -lmas#include <mas.h> int mas_snap(int md);
If read access is being used, (mas_open was called with acc set to MAS_READ_ACCESS), the metric data segments are read into the snapshot buffer with the read system call.
If memory mapped access is being used, (mas_open was called with acc set to MAS_MMAP_ACCESS), the metric data segments are copied from their memory mapped pages into the snapshot buffer with the memcpy library call.
When read access is being used, mas_get_met and mas_get_met_snap both return the address of a metric instance within the snapshot buffer. When memory mapped access is being used, mas_get_met returns the address of a metric instance within the memory mapped pages, and mas_get_met_snap returns the address to which the instance is copied within the snapshot buffer.
On failure, mas_snap returns -1 and sets mas_errno to identify the error.