PSTAT Interfaces

5
4. Description of Wrappers
4.1 pstat_getcrashdev()
Synopsis:
int pstat_getcrashdev(struct pst_crashdev *buf, size_t elemsize, size_t elemcount, int index);
Description:
This call returns information about crash dump devices configured on the system. There
is one instance of this context for each crash dump device configured on the system. For each
instance, data up to a maximum of elemsize bytes are returned in the structs pst_crashdev
pointed to by buf. The elemcount parameter specifies the number of structs pst_crashdev that are
available at buf. The index parameter specifies the starting index within the context of crash
dump devices. This call is available only in wide mode. That is –D_PSTAT64 flag needs to be
defined at compile time.
Return Value:
This call returns –1 on error or the number of instances copied to buf on success.
Errors:
EINVAL is set if the user is in narrow more.
EINVAL is set if elemcount is not >= 1 or index is not >= to 0.
EINVAL is set if user’s size declaration is not valid.
EFAULT is set if buf is invalid.
Example:
#include <sys/pstat.h>
void main(void)
{
struct pst_crashdev pst;
int count;
/* Get information about the first crash dump device configured. */
count = pstat_getcrashdev(&pst, sizeof(pst), 1, 0);
if (count > 0) {
printf(“\nSize of dump area: %d”, pst.psc_size);
} else {
perror("pstat_getcrashdev()");
}
}
4.2 pstat_getcrashinfo()
Synopsis:
int pstat_getcrashinfo(struct pst_crashinfo *buf, size_t elemsize, size_t elemcount, int index);
Description:
This call provides information about system’s crash dump configuration. There is only
one instance of this context. The elemcount parameter must be equal to 1 and the index
parameter must be equal to 0. This call is available only in wide mode. That is –D_PSTAT64 flag
needs to be defined at compile time.
Return Value:
This call returns –1 on failure or 1 on success.
Errors: