HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
c
crashconf(2) crashconf(2)
deviceReturn is an array of deviceCount integers for returning the results of attempting to configure the
corresponding device from the devices array. Upon return, each element is set to a numeric value indicat-
ing the result of configuring the corresponding device as follows:
0 Successfully configured the corresponding device as a dump device.
<0 Failed to configure the corresponding device as a dump device. The absolute value of the
returned number can be used as an index into an array of error messages. The error message
strings are defined in CCERR_STRINGS (see below).
>0 Warning, The corresponding device has been configured but there is one or more notes or
warnings associated with the device. The returned value is a bitmap of warnings. the warn-
ing message strings are defined in CCWARN_STRINGS (see below).
Any parameters which are not used for the given operation should be set to zero. Note that both devices
and deviceReturn must be specified if DC_DEVICES is specified.
Classes
The following system memory classes have been defined as of this writing. Refer to the output of
crashconf(1M) or to /usr/include/sys/crashconf.h
for definitions of any classes added since
publication. The memory page size is 4Kb.
DT_UNUSED Unused physicalmemory pages
DT_KCODE Kernel code pages
DT_BCACHE Buffer cache data pages
DT_KSDATA Kernel static data pages
DT_KDDATA Kernel dynamic data pages
DT_FSDATA File system metadata pages
DT_USTACK User process stack pages
DT_UAREA U-Area pages
DT_USERPG User process pages
EXAMPLES
The following examples demonstrate the usage of crashconf() .
Example 1: Adding a Crash Dump Device
char *device_to_add[1];
int device_return[1];
...
crashconf(DC_DEVICES, 0, 0, 1, device_to_add, device_return);
Example 2: Force Dumping of Buffer Cache
crashconf(DC_INCLUDE, DT_BCACHE, 0, 0, NULL, NULL);
Example 3: Disable Dumps
crashconf(DC_EXCLUDE | DC_REPLACE, 0, DT_ALL, 0, NULL, NULL);
Example 4: Using CCERR_STRINGS and CCWARN_STRINGS
Assume only one device, devices[0], is being added to the dump configuration. The following code will check
the device_return[0] value and print corresponding error or warning messages.
char *ccerrs[] = {
CCERR_STRINGS
};
int num_ccerrs = sizeof(ccerrs)/sizeof(*ccerrs);
char *ccwarns[] = {
CCWARN_STRINGS
};
int num_ccwarns = sizeof(ccwarns)/sizeof(*ccwarns);
char *device_to_add[1];
int device_return[1];
...
crashconf(DC_DEVICES, 0, 0, 1, device_to_add, device_return);
if (device_return[0] < 0) {
Section 2−−42 − 2 − HP-UX Release 11i: December 2000
___
___