PSTAT Interfaces
26
* If there is more than 1 module, we expect 3 structures,
* head, modules).
*/
count = pstat_getstream(psfstream, sizeof(struct pst_stream),
sizeof(psfstream) / sizeof(struct pst_stream),
0, &psf.psf_fid);
if (count > 0) {
if ((psfstream[0].val.head.pst_hi_fileid ==
psf.psf_hi_fileid) &&
(psfstream[0].val.head.pst_lo_fileid ==
psf.psf_lo_fileid) &&
(psfstream[0].val.head.pst_hi_nodeid ==
psf.psf_hi_nodeid) &&
(psfstream[0].val.head.pst_lo_nodeid ==
psf.psf_lo_nodeid)) {
printf("Major number of the stream is %d\n",
psfstream[0].val.head.pst_dev_major);
} else {
printf("State changed\n");
}
} else {
perror("pstat_getstream()");
}
} else {
perror("pstat_getfile2");
}
close(fd);
}
4.24 pstat_getswap()
Synopsis:
int pstat_getswap(struct pst_swapinfo *buf, size_t elemsize, size_t elemcount, int index);
Description:
This call returns swap area information. There is one instance of this context for each
swap area (block or file system) configured into the system. For each instance data up to a
maximum of elemsize bytes are returned in the structs pst_swapinfo pointed to by buf. The
elemcount parameter specifies the number of structs pst_swapinfo that are available at buf. The
index parameter specifies the starting index within the context of swap areas.
Return Value:
On success, the call returns 1. On failure, -1 is returned and errno is set indicating the
cause of the failure.
Errors:
• EINVAL is set if elemcount == 0 or index < 0.
• EINVAL is set if the user's size declaration isn't valid.
• EFAULT is set if buf points to an invalid address.
4.25 pstat_getvminfo()
Synopsis:
int pstat_getvminfo(struct pst_vminfo *buf, size_t elemsize, size_t elemcount, int index);
Description: