mas_snap(3mas) mas_snap(3mas)
NAME
mas_snap - take a snapshot of the metric segments for consumer
use
SYNOPSIS
cc [options] file -lmas
#include <mas.h>
int mas_snap(int md);
DESCRIPTION
The function mas_snap takes a snapshot of the metric data
segments. The md argument is a metric descriptor returned
from mas_open.
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.
Return Values
On success, mas_snap returns 0.
On failure, mas_snap returns -1 and sets mas_errno to identify
the error.
Errors
MAS_INVALID_ARG - invalid metric descriptor
The metric descriptor, md does not correspond to a
metric registration file previously opened by mas_open.
MAS_SYSERR - can't seek on metric segment
Read access was in use and the lseek system called
failed.
Copyright 1994 Novell, Inc. Page 1
mas_snap(3mas) mas_snap(3mas)
MAS_SYSERR - cannot read metric segment
Read access was in use and the read system called
failed.
REFERENCES
mas(3mas)
Copyright 1994 Novell, Inc. Page 2