Gets short status on one or more subsystems.
System Resource Controller Library (libsrc.a)
#include <spc.h>
int srcstat(Host,
SubsystemName,SubsystemPID, ReplyLength, StatusReply,Continued)
char * Host, * SubsystemName;
int SubsystemPID, * Continued;
short * ReplyLength;
void * StatusReply;
The srcstat subroutine sends a short status request to the System Resource Controller (SRC) and returns status for one or more subsystems to the caller.
Host | Specifies the foreign host on which this status action is requested. If the host is null, the status request is sent to the SRC on the local host. The local user must be running as "root". The remote system must be configured to accept remote System Resource Controller requests. That is, the srcmstr daemon (see /etc/inittab) must be started with the -r flag and the /etc/hosts.equiv or .rhosts file must be configured to allow remote requests. |
SubsystemName | Specifies the name of the subsystem on which to get short status. To get status of all subsystems, use the SRCALLSUBSYS constant. To get status of a group of subsystems, the SubsystemName parameter must start with the SRCGROUP constant, followed by the name of the group for which you want status appended. If you specify a null SubsystemName parameter, you must specify a SubsystemPID parameter. |
SubsystemPID | Specifies the PID of the subsystem on which to get status as returned by the srcstat subroutine. You must specify the SubsystemPID parameter if multiple instances of the subsystem are active and you request a long subsystem status or subserver status. If you specify a null SubsystemPID parameter, you must specify a SubsystemName parameter. |
ReplyLength | Specifies size of a srchdr structure plus the number of statcode structures times the size of one statcode structure. On return from the srcstat subroutine, this value is updated. |
StatusReply | Specifies a pointer to a structure containing first element as struct srchdr and secondary element as struct statcode (both defined in spc.h file) array that receives the status reply for the requested subsystem. The first element of the returned statcode array contains the status title line. The number of statcode structures array items depends on the number of subsystems user queried. |
Continued | Specifies whether this call to the srcstat subroutine is a continuation of a previous status request. If the Continued parameter is set to NEWREQUEST, a request for short subsystem status is sent to the SRC and srcstat waits for the first status response. The calling process should never set Continued to a value other than NEWREQUEST. The last response for the SRC sets Continued to END. |
If the srcstat subroutine succeeds, it returns a value of 0. An error code is returned if the subroutine is unsuccessful.
The srcstat subroutine fails if one or more of the following are true:
intcont=NEWREQUEST; struct { struct srchdr srchdr struct statcode statcode[6]; } status; short replen=sizeof(status); srcstat("MaryC","srctest",0,&replen,&status,&cont);
This entry requests short status of all instances of the subsystem srctest on the MaryC machine.
int cont=NEWREQUEST; struct { struct srchdr srchdr; struct statcode statcode[80]; } status; short replen=sizeof(status); srcstat("",SRCALLSUBSYS,0,&replen,&status,&cont);
This entry requests short status of all subsystems on the local machine.
int cont=NEWREQUEST; struct struct { struct srchdr srchdr; struct statcode statcode[30]; } status; short replen=sizeof(status), rep_num; char subsysname[30]; strcpy(subsysname,SRCGROUP); strcat(subsysname,"tcpip"); srcstat("",subsysname,0,&replen,&status, &cont); rep_num = (replen - sizeof(strcut srchdr)) / sizeof(strcut statcode); for (i = 0; i < rep_num; i++) printf("objtype %d status %d objname %s objtext %s\n", status.statcode[i].objtype, status.statcode[i].status, status.statcode[i].objname, status.statcode[i].objtext);
This entry requests short status of all members of the subsystem group tcpip on the local machine , and displays the query results on stdout.
/etc/services | Defines the sockets and protocols used for Internet services. |
/dev/SRC | Specifies the AF_UNIX socket file. |
/dev/.SRC-unix | Specifies the location for temporary socket files. |
The srcrrqs (srcrrqs Subroutine) subroutine, srcsbuf (srcsbuf Subroutine) subroutine, srcsrpy (srcsrpy Subroutine) subroutine, srcsrqt (srcsrqt Subroutine) subroutine, srcstathdr (srcstathdr Subroutine) subroutine, srcstattxt (srcstattxt Subroutine) subroutine, srcstop (srcstop Subroutine) subroutine, srcstrt (srcstrt Subroutine) subroutine.
List of SRC Subroutines, Programming Subsystem Communication with the SRC, System Resource Controller (SRC) Overview for Programmers in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.