pfm_$intro(3)
NAME
pfm_$intro − fault management
SYNOPSIS
C Syntax
#include <idl/c/base.h>
#include <ppfm.h>
Remarks
To view this manual entry via the man(1) command, use the function name shown above without the “$” character.
DESCRIPTION
pfm_$() calls, part of the Network Computing System (NCS), allow programs to manage signals, faults, and exceptions by establishing cleanup handlers.
pfm_$cleanup() Establish a cleanup handler.
pfm_$enable() Enable asynchronous faults.
pfm_$enable_faults()
Enable asynchronous faults after faults have been inhibited via pfm_$inhibit_faults().
pfm_$inhibit() Inhibit asynchronous faults.
pfm_$inhibit_faults()
Inhibit asynchronous faults but allow time-sliced task switching.
pfm_$init() Initialize the PFM package.
pfm_$reset_cleanup()
Reset a cleanup handler.
pfm_$rls_cleanup()
Release cleanup handlers.
pfm_$signal() Signal the calling process.
Cleanup Handlers
A cleanup handler is a piece of code that allows a program to terminate gracefully when it receives an error. A cleanup handler begins with a pfm_$cleanup() call and usually ends with a call to pfm_$signal() or pgm_$exit(), though it can also simply continue back into the program after the cleanup code.
Include Files in NCS Software
<ppfm.h>, is the include file for the "portable PFM" interface. It supersedes <pfm.h>, the include file that was provided in early releases of NCS .
Constants
pfm_$init_signal_handlers
A constant used as the flags parameter to pfm_$init(), causing C signals to be intercepted and converted to PFM signals.
Data Types
pfm_$cleanup_rec
An opaque data type for passing process context among cleanup handler calls.
status_$t
A status code. Most NCS calls supply their completion status in this format. The status_$t type is defined as a structure containing a long integer:
struct status_$t {
long all;
}
However, the calls can also use status_$t as a set of bit fields. To access the fields in a returned status code, assign the value of the status code to a union defined as follows:
typedef union {
struct {
unsigned fail : 1,
subsys : 7,
modc : 8;
short code;
} s;
long all;
} status_u;
where:
all All 32 bits in the status code. If all is equal to status_$ok, the call that supplied the status was successful.
fail If this bit is set, the error was not within the scope of the module invoked, but occurred within a lower-level module.
subsys This indicates the subsystem that encountered the error.
modc This indicates the module that encountered the error.
code This is a signed number that identifies the type of error that occurred.
Status Codes
pfm_$bad_rls_order
Attempted to release a cleanup handler out of order.
pfm_$cleanup_not_found
There is no pending cleanup handler.
pfm_$cleanup_set
A cleanup handler was established successfully.
pfm_$cleanup_set_signalled
Attempted to use pfm_$cleanup_set as a signal.
pfm_$invalid_cleanup_rec
Passed an invalid cleanup record to a call.
pfm_$no_space
Cannot allocate storage for a cleanup handler.
status_$ok
The call was successful.
SEE ALSO
pfm_$cleanup(3), pfm_$enable(3), pfm_$enable_faults(3), pfm_$inhibit(3), pfm_$inhibit_faults(3), pfm_$init(3), pfm_$reset_cleanup(3), pfm_$rls_cleanup(3), pfm_$signal(3).
Hewlett-Packard Company — HP-UX Release 10.20: July 1996