HP-UX Reference (11i v2 03/08) - 2 System Calls (vol 5)
c
crashconf(2) crashconf(2)
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) {
if (device_return[0] > -num_ccerrs)
fprintf(stderr, "%s: error: %s", device_to_add[0],
ccerrs[-device_return[0]]);
} else if (device_return[0] > 0) {
int warn_num;
for (warn_num = 0; warn_num < NUM_CCWARNS; warn_num++)
if (device_return[0] & (1 << warn_num))
fprintf(stderr,"%s: warning: %s",
device_to_add[0], ccwarns[warn_num]);
}
Example 5: Setting Compressed Dump ON, Excluding Unused Pages
crashconf(DC_SETCOMPRESS | DC_EXCLUDE, DT_UNUSED, 0, NULL, NULL);
RETURN VALUE
Upon successful completion, zero is returned. Otherwise, a value of −1 is returned and errno is set to
indicate the error. If
DC_DEVICES is set, a one (1) may be returned to indicate that at least one device
has been configured but one or more devices failed to configure.
ERRORS
crashconf() fails if one or more of the following is true:
[EPERM] The calling process does not have appropriate privileges.
[EINVAL] operation does not have at least one of
DC_INCLUDE, DC_EXCLUDE,
DC_SETCOMPRESS, DC_SETNOCOMPRESS
,orDC_DEVICES set.
[EINVAL] operation has both
DC_INCLUDE and DC_EXCLUDE set, and the same class (bit) is
specified in both includeClasses and excludeClasses.
[EINVAL] operation has both
DC_SETCOMPRESS
and DC_SETNOCOMPRESS set.
[EINVAL] operation has
DC_DEVICES set, and deviceCount is less than zero or greater than
DC_MAXDEVICES.
SEE ALSO
crashconf(1M), pstat_getcrashinfo(2), pstat_getcrashdev(2).
Section 2−−46 Hewlett-Packard Company − 3 − HP-UX 11i Version 2: August 2003