Contract Management Library Functions
ctprstatusgetparam(3CONTRACT)
NAME
ctprstatusgetparam, ctprstatusgetfatal,
ctprstatusgetmembers, ctprstatusgetcontracts,
ctprstatusgetsvcfmri, ctprstatusgetsvcaux,
ctprstatusgetsvcctid, ctprstatusgetsvccreator -
process contract status functions
SYNOPSIS
cc [ flag... ] file... -DLARGEFILE64SOURCE -lcontract [ library... ]
#include
#include
int ctprstatusgetparam(ctstathdlt stathdl, uintt *paramp);
int ctprstatusgetfatal(ctstathdlt stathdl, uintt *eventsp);
int ctprstatusgetmembers(ctstathdlt stathdl,
pidt **pidpp, uintt *n);
int ctprstatusgetcontracts(ctstathdlt stathdl,
ctidt **idpp, uintt *n);
int ctprstatusgetsvcfmri(ctstathdlt stathdl, char **fmri);
int ctprstatusgetsvcaux(ctstathdlt stathdl, char **aux);
int ctprstatusgetsvcctid(ctstathdlt stathdl, ctidt *ctid);
int ctprstatusgetsvccreator(ctstathdlt stathdl,
char **creator);
DESCRIPTION
These functions read process contract status information
from a status object returned by ctstatusread(3CONTRACT).
The ctprstatusgetparam() function reads the parameter
set term. The value is a collection of bits as described in
process(4).
The ctprstatusgetfatal() function reads the fatal event
set term. The value is a collection of bits as described in
SunOS 5.11 Last change: 25 Feb 2008 1
Contract Management Library Functions
ctprstatusgetparam(3CONTRACT)
process(4).
The ctprstatusgetmembers() function obtains a list of
the process IDs of the members of the process contract. A
pointer to an array of process IDs is stored in *pidpp. The
number of elements in this array is stored in *n. These data
are freed when the status object is freed by a call to
ctstatusfree(3CONTRACT).
The ctprstatusgetcontracts() function obtains a list of
IDs of contracts that have been inherited by the contract. A
pointer to an array of IDs is stored in *idpp. The number of
elements in this array is stored in *n. These data are freed
when the status object is freed by a call to
ctstatusfree().
The ctprstatusgetsvcfmri(),
ctprstatusgetsvccreator(), and
ctprstatusgetsvcaux() functions read, respectively, the
service FMRI, the contract's creator execname and the
creator's auxiliary field. The buffer pointed to by fmri,
aux or creator, is freed by a call to ctstatusfree() and
should not be modified.
The ctprstatusgetsvcctid() function reads the process
contract id for which the service FMRI was first set.
RETURN VALUES
Upon successful completion, ctprstatusgetparam(),
ctprstatusgetfatal(), ctprstatusgetmembers(),
ctprstatusgetcontracts(), ctprstatusgetsvcfmri(),
ctprstatusgetsvccreator(), ctprstatusgetsvcaux(),
and ctprstatusgetsvcctid() return 0. Otherwise, they
return a non-zero error value.
ERORS
The ctprstatusgetparam(), ctprstatusgetfatal(),
ctprstatusgetmembers(), ctprstatusgetcontracts(),
ctprstatusgetsvcfmri(), ctprstatusgetsvccreator(),
ctprstatusgetsvcaux(), and ctprstatusgetsvcctid()
functions will fail if:
EINVAL The stathdl argument is not a process contract
status object.
SunOS 5.11 Last change: 25 Feb 2008 2
Contract Management Library Functions
ctprstatusgetparam(3CONTRACT)
The ctprstatusgetparam(), ctprstatusgetfatal(),
ctprstatusgetmembers(), ctrstatusgetcontracts(),
ctprstatusgetsvcfmri(), ctprstatusgetsvccreator(),
ctprstatusgetsvcaux(), and ctprstatusgetsvcctid()
functions will fail if:
ENOENT The requested data were not available in the
status object.
EXAMPLES
Example 1 Print members of process contract 1.
Open the status file for contract 1, read the contract's
status, obtain the list of processes, print them, and free
the status object.
#include
#include
#include
#include
...
int fd;
uintt i, n;
pidt *procs;
ctstathdlt st;
fd = open("/system/contract/process/1/status");
ctstatusread(fd, &st);
ctprstatusgetmembers(st, &procs, &n);
for (i = 0 ; i < n; i])
printf("%ld\n", (long)procs[i]);
ctstatusfree(stat);
close(fd);
...
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 25 Feb 2008 3
Contract Management Library Functions
ctprstatusgetparam(3CONTRACT)
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level Safe
SEE ALSO
ctstatusfree(3CONTRACT), ctstatusread(3CONTRACT),
libcontract(3LIB), contract(4), process(4), attributes(5),
lfcompile(5)
SunOS 5.11 Last change: 25 Feb 2008 4
Contract Management Library Functions
ctprstatusgetparam(3CONTRACT)
SunOS 5.11 Last change: 25 Feb 2008 5
|