Gets short status on a subsystem.
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;
struct statrep * 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 statrep code structure containing a statcode array that receives the status reply for the requested subsystem. The first element of the returned statcode array contains the status title line. The statcode structure is defined in the spc.h file. |
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 statcode statcode[20]; short replen=sizeof(statcode); srcstat("MaryC","srctest",0,&replen,statcode,&cont);
This entry requests short status of all instances of the subsystem srctest on the MaryC machine.
intcont=NEWREQUEST; struct statcode statcode[20]; short replen=sizeof(statcode); srcstat("",SRCALLSUBSYS,0,&replen,statcode,&cont);
This entry requests short status of all subsystems on the local machine.
intcont=NEWREQUEST; struct statcode statcode[20]; short replen=sizeof(statcode); char subsysname[30]; strcpy(subsysname,SRCGROUP); strcat(subsysname,"tcpip"); srcstat("",subsysname,0,&replen,statcode, &cont);
This entry requests short status of all members of the subsystem group tcpip on the local machine.
This subroutine is part of Base Operating System (BOS) Runtime.
/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.1 General Programming Concepts: Writing and Debugging Programs.