Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ct_pr_tmpl_set_fatal(3contrac) [sunos man page]

ct_pr_tmpl_set_transfer(3CONTRACT)		       Contract Management Library Functions			ct_pr_tmpl_set_transfer(3CONTRACT)

NAME
ct_pr_tmpl_set_transfer, ct_pr_tmpl_set_fatal, ct_pr_tmpl_set_param, ct_pr_tmpl_get_transfer, ct_pr_tmpl_get_fatal, ct_pr_tmpl_get_param - process contract template functions SYNOPSIS
cc [ flag... ] file... -D_LARGEFILE64_SOURCE -lcontract [ library... ] #include <libcontract.h> #include <sys/contract/process.h> int ct_pr_tmpl_set_transfer(int fd, ctid_t ctid); int ct_pr_tmpl_set_fatal(int fd, uint_t events); int ct_pr_tmpl_set_param(int fd, uint_t params); int ct_pr_tmpl_get_transfer(int fd, ctid_t *ctidp); int ct_pr_tmpl_get_fatal(int fd, uint_t *eventsp); int ct_pr_tmpl_get_param(int fd, uint_t *paramsp); DESCRIPTION
These functions read and write process contract terms and operate on process contract template file descriptors obtained from the con- tract(4) file system. The ct_pr_tmpl_set_transfer() and ct_pr_tmpl_get_transfer() functions write and read the transfer contract term. The value is the ID of an empty regent process contract owned by the caller whose inherited contracts are to be transferred to a newly created contract. The ct_pr_tmpl_set_fatal() and ct_pr_tmpl_get_fatal() functions write and read the fatal event set term. The value is a collection of bits as described in process(4). The ct_pr_tmpl_set_param() and ct_pr_tmpl_get_param() functions write and read the parameter set term. The value is a collection of bits as described in process(4). RETURN VALUES
Upon successful completion, ct_pr_tmpl_set_transfer(), ct_pr_tmpl_set_fatal(), ct_pr_tmpl_set_param(), ct_pr_tmpl_get_transfer(), ct_pr_tmpl_get_fatal(), and ct_pr_tmpl_get_param() return 0. Otherwise, they return a non-zero error value. ERRORS
The ct_pr_tmpl_set_param() function will fail if: EINVAL An invalid parameter was specified. The ct_pr_tmpl_set_fatal() function will fail if: EINVAL An invalid event was specified. The ct_pr_tmpl_set_transfer() function will fail if: ESRCH The ID specified by ctid does not correspond to a process contract. EACCES The ID specified by ctid does not correspond to a process contract owned by the calling process. ENOTEMPTY The ID specified by ctid does not correspond to an empty process contract. EXAMPLES
Example 1: Create and activate a process contract template. The following example opens a new template, makes hardware errors and signals fatal events, makes hardware errors critical events, and activates the template. It then forks a process in the new contract using the requested terms. #include <libcontract.h> #include <fcntl.h> #include <unistd.h> ... int fd; fd = open("/system/contract/process/template", O_RDWR); (void) ct_pr_tmpl_set_fatal(fd, CT_PR_EV_HWERR|CT_PR_EV_SIGNAL); (void) ct_tmpl_set_critical(fd, CT_PR_EV_HWERR); (void) ct_tmpl_activate(fd); close(fd); if (fork()) { /* parent - owns new process contract */ ... } else { /* child - in new process contract */ ... } ... Example 2: Clear the process contract template. The following example opens the template file and requests that the active template be cleared. #include <libcontract.h> #include <fcntl.h> ... int fd; fd = open("/system/contract/process/template", O_RDWR); (void) ct_tmpl_clear(fd); close(fd); ... ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
libcontract(3LIB), contract(4), process(4), attributes(5), lfcompile(5) SunOS 5.10 1 Apr 2004 ct_pr_tmpl_set_transfer(3CONTRACT)
Man Page