ct_pr_status_get_svc_fmri man page on SmartOS

Man page or keyword search:  
man Server   16655 pages
apropos Keyword Search (all sections)
Output format
SmartOS logo
[printable version]

CT_PR_STATUS_GET_PARAM(3CONTRACT)	     CT_PR_STATUS_GET_PARAM(3CONTRACT)

NAME
       ct_pr_status_get_param,	ct_pr_status_get_fatal,	 ct_pr_status_get_mem‐
       bers, ct_pr_status_get_contracts, ct_pr_status_get_svc_fmri, ct_pr_sta‐
       tus_get_svc_aux,	 ct_pr_status_get_svc_ctid,  ct_pr_status_get_svc_cre‐
       ator - process contract status functions

SYNOPSIS
       cc [ flag... ] file... -D_LARGEFILE64_SOURCE  -lcontract	 [ library... ]
       #include <libcontract.h>
       #include <sys/contract/process.h>

       int ct_pr_status_get_param(ct_stathdl_t stathdl, uint_t *paramp);

       int ct_pr_status_get_fatal(ct_stathdl_t stathdl, uint_t *eventsp);

       int ct_pr_status_get_members(ct_stathdl_t stathdl,
	    pid_t **pidpp, uint_t *n);

       int ct_pr_status_get_contracts(ct_stathdl_t stathdl,
	    ctid_t **idpp, uint_t *n);

       int ct_pr_status_get_svc_fmri(ct_stathdl_t stathdl, char **fmri);

       int ct_pr_status_get_svc_aux(ct_stathdl_t stathdl, char **aux);

       int ct_pr_status_get_svc_ctid(ct_stathdl_t stathdl, ctid_t *ctid);

       int ct_pr_status_get_svc_creator(ct_stathdl_t stathdl,
	    char **creator);

DESCRIPTION
       These functions read process contract status information from a	status
       object returned by ct_status_read(3CONTRACT).

       The ct_pr_status_get_param() function reads the parameter set term. The
       value is a collection of bits as described in process(4).

       The ct_pr_status_get_fatal() function reads the fatal event  set	 term.
       The value is a collection of bits as described in process(4).

       The  ct_pr_status_get_members()	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 ct_status_free(3CONTRACT).

       The ct_pr_status_get_contracts() function obtains a list of IDs of con‐
       tracts 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 ct_status_free().

       The  ct_pr_status_get_svc_fmri(),  ct_pr_status_get_svc_creator(),  and
       ct_pr_status_get_svc_aux() 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 ct_status_free() and should not be modified.

       The  ct_pr_status_get_svc_ctid() function reads the process contract id
       for which the service FMRI was first set.

RETURN VALUES
       Upon  successful	  completion,	ct_pr_status_get_param(),   ct_pr_sta‐
       tus_get_fatal(),	   ct_pr_status_get_members(),	 ct_pr_status_get_con‐
       tracts(), ct_pr_status_get_svc_fmri(),  ct_pr_status_get_svc_creator(),
       ct_pr_status_get_svc_aux(),  and	 ct_pr_status_get_svc_ctid() return 0.
       Otherwise, they return a non-zero error value.

ERRORS
       The  ct_pr_status_get_param(),	ct_pr_status_get_fatal(),   ct_pr_sta‐
       tus_get_members(),	ct_pr_status_get_contracts(),	    ct_pr_sta‐
       tus_get_svc_fmri(),     ct_pr_status_get_svc_creator(),	    ct_pr_sta‐
       tus_get_svc_aux(),  and ct_pr_status_get_svc_ctid() functions will fail
       if:

       EINVAL
		 The stathdl argument is not a process contract status object.

       The  ct_pr_status_get_param(),	ct_pr_status_get_fatal(),   ct_pr_sta‐
       tus_get_members(),	 ct_r_status_get_contracts(),	    ct_pr_sta‐
       tus_get_svc_fmri(),     ct_pr_status_get_svc_creator(),	    ct_pr_sta‐
       tus_get_svc_aux(),  and ct_pr_status_get_svc_ctid() 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 <sys/types.h>
	 #include <fcntl.h>
	 #include <libcontract.h>
	 #include <stdio.h>

	 ...
	 int fd;
	 uint_t i, n;
	 pid_t *procs;
	 ct_stathdl_t st;

	 fd = open("/system/contract/process/1/status");
	 ct_status_read(fd, &st);
	 ct_pr_status_get_members(st, &procs, &n);
	 for (i = 0 ; i < n; i++)
		 printf("%ld\n", (long)procs[i]);
	 ct_status_free(stat);
	 close(fd);
	 ...

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       ┌────────────────────┬─────────────────┐
       │  ATTRIBUTE TYPE    │ ATTRIBUTE VALUE │
       ├────────────────────┼─────────────────┤
       │Interface Stability │ Committed	      │
       ├────────────────────┼─────────────────┤
       │MT-Level	    │ Safe	      │
       └────────────────────┴─────────────────┘

SEE ALSO
       ct_status_free(3CONTRACT),      ct_status_read(3CONTRACT),      libcon‐
       tract(3LIB), contract(4), process(4), attributes(5), lfcompile(5)

				 Feb 25, 2008CT_PR_STATUS_GET_PARAM(3CONTRACT)
[top]

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net