DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

mas_snap(3mas)


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.

MAS_SYSERR - cannot read metric segment
Read access was in use and the read system called failed.

References

Intro(3mas)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004