PSTAT Interfaces
11
This call returns the system-wide global System V IPC constants. These are currently
defined at boot time, but may become dynamic in future releases. There is only one instance of
this context. Data up to a maximum of elemsize bytes are returned in the struct pst_ipcinfo
pointed to by buf. The elemcount parameter must be 1. The index parameter must be 0.
Return Value:
This call returns –1 on failure or 1 on success.
Errors:
• EINVAL is set if elemcount is not equal to 1 or index is not equal to 0.
• EINVAL is set if user’s size declaration is not valid.
• EFAULT is set if buf is invalid.
• EOVERFLOW is set if any of the fields in narrow mode exceed the maximum positive integer
value. The corresponding bit in the valid vector is cleared.
Example:
#include <sys/pstat.h>
void main(void)
{
struct pst_ipcinfo psi;
if (pstat_getipc(&psi, sizeof (psi), 1, 0) == -1) {
printf("\nError getting ipc info");
return;
}
printf("\n Maximum value for semaphore: %ld", psi.psi_semvmx);
printf("\n System wide total semaphores: %ld", psi.psi_semmns);
printf("\n Maximum shared memory segment size %ld", psi.psi_shmmax);
}
4.9 pstat_getlv()
Synopsis:
int pstat_getlv(struct pst_lvinfo *buf, size_t elemsize, size_t elemcount, int index);
Description:
This call returns information about logical volume configured in the system. Each structure
returned describes one logical volume. For each instance data up to a maximum of elemsize
bytes are returned in the structs pst_lvinfo pointed to by buf. The elemcount parameter specifies
the number of structs pst_lvinfo that are available at buf. The index parameter specifies the
starting index within the context of logical volumes. As a shortcut, information for a single
logical volume may be obtained by setting elemcount to zero and setting index to the dev_t of
that logical volume.
Return Value:
This call returns –1 on failure or number of instances copied to buf on success.
Errors:
• If the user's size declaration isn't valid, EINVAL is set.
• EINVAL is set if the initial selection, index, isn't valid.
• ESRCH is set if the specific-LV shortcut is used and there is no logical volume with that
device specification,
• EFAULT is set if buf points to invalid address.