pstat.2 (2010 09)
p
pstat(2) pstat(2)
structures pointed to by buf. The elemcount parameter specifies the number of
pst_shminfo struc-
tures that are available at buf to be filled in. The index parameter specifies the starting index within the
context of System V shared memory segments. As a shortcut, information for a single shared memory
segment can be obtained by setting elemcount to
0 and setting index to the shmid of that shared memory
segment.
PSTAT FUNCTION
Name
pstat_getsocket()
- get detailed information for a socket
Synopsis
#include <sys/pstat.h>
int pstat_getsocket(
struct pst_socket *buf,
size_t elemsize ,
struct pst_fid *fid
);
Description
pstat_getsocket()
returns detailed information specific to a socket. For the specified socket, there
is one instance of this context. For each call, up to a maximum of elemsize bytes of data is returned in the
pst_socket structure pointed to by buf. The fid parameter uniquely identifies the socket. This fid is
obtained from calls to
pstat_getfile2()
. The use of this function is limited to UID 0 or an effective
UID match. See
pstat_getfiledetails()
for the definition of effective UID match.
On success, the function returns
1. On failure, the value of -1 is returned and
errno is set indicating
the cause of the failure. For AF_UNIX sockets that are opened to files, more information about the files
can be obtained with the
pstat_getfiledetails()
call. In case of AF_UNIX sockets, the fields
pst_peer_hi_nodeid
and pst_peer_lo_nodeid can be used to find the peer socket by matching
them with
pst_hi_nodeid and
pst_lo_nodeid. The members pst_boundaddr and
pst_remaddr contain data of the form structsockaddr, sockaddr_un, sockaddr_in,
sockaddr_in6, and so on, depending on the socket family.
Note
The
PS_SS_BOUND socket state in the pst_state field of struct pst_socket is deprecated and
will be obsoleted/removed in a future release.
PSTAT FUNCTION
Name
pstat_getstable()
- get information from the system’s stable storage area
Synopsis
#include <sys/pstat.h>
int pstat_getstable(
struct pst_stable *buf,
size_t elemsize ,
size_t elemcount ,
int index
);
Description
pstat_getstable() returns information contained in the system’s stable storage area. There is one
global instance of this context. Up to a maximum of elemsize bytes of data is returned in the
pst_stable structure pointed to by buf. The elemcount parameter must be 1. The index parameter
must be 0.
PSTAT FUNCTION
Name
pstat_getstatic() - get information about the system
HP-UX 11i Version 3: September 2010 − 13 − Hewlett-Packard Company 13