2 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH CT_TMPL_ACTIVATE 3CONTRACT "Apr 1, 2004"
8 ct_tmpl_activate, ct_tmpl_clear, ct_tmpl_create, ct_tmpl_set_cookie,
9 ct_tmpl_set_critical, ct_tmpl_set_informative, ct_tmpl_get_cookie,
10 ct_tmpl_get_critical, ct_tmpl_get_informative \- common contract template
15 cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-D_LARGEFILE64_SOURCE\fR \fB -lcontract \fR [ \fIlibrary\fR\&.\|.\|. ]
16 #include <libcontract.h>
18 \fBint\fR \fBct_tmpl_activate\fR(\fBint\fR \fIfd\fR);
23 \fBint\fR \fBct_tmpl_clear\fR(\fBint\fR \fIfd\fR);
28 \fBint\fR \fBct_tmpl_create\fR(\fBint\fR \fIfd\fR, \fBctid_t *\fR\fIidp\fR);
33 \fBint\fR \fBct_tmpl_set_cookie\fR(\fBint\fR \fIfd\fR, \fBuint64_t\fR \fIcookie\fR);
38 \fBint\fR \fBct_tmpl_set_critical\fR(\fBint\fR \fIfd\fR, \fBuint_t\fR \fIevents\fR);
43 \fBint\fR \fBct_tmpl_set_informative\fR(\fBint\fR \fIfd\fR, \fBuint_t\fR \fIevents\fR);
48 \fBint\fR \fBct_tmpl_get_cookie\fR(\fBint\fR \fIfd\fR, \fBuint64_t *\fR\fIcookiep\fR);
53 \fBint\fR \fBct_tmpl_get_critical\fR(\fBint\fR \fIfd\fR, \fBuint_t *\fR\fIeventsp\fR);
58 \fBint\fR \fBct_tmpl_get_informative\fR(\fBint\fR \fIfd\fR, \fBuint_t *\fR\fIeventsp\fR);
64 These functions operate on contract template file descriptors obtained from the
65 \fBcontract\fR(4) file system.
68 The \fBct_tmpl_activate()\fR function makes the template referenced by the file
69 descriptor \fIfd\fR the active template for the calling thread.
72 The \fBct_tmpl_clear()\fR function clears calling thread's active template.
75 The \fBct_tmpl_create()\fR function uses the template referenced by the file
76 descriptor \fIfd\fR to create a new contract. If successful, the ID of the
77 newly created contract is placed in *\fIidp\fR.
80 The \fBct_tmpl_set_cookie()\fR and \fBct_tmpl_get_cookie()\fR functions write
81 and read the cookie term of a contract template. The cookie term is ignored by
82 the system, except to include its value in a resulting contract's status
83 object. The default cookie term is 0.
86 The \fBct_tmpl_set_critical()\fR and \fBct_tmpl_get_critical()\fR functions
87 write and read the critical event set term. The value is a collection of bits
88 as described in the contract type's manual page.
91 The \fBct_tmpl_set_informative()\fR and \fBct_tmpl_get_informative()\fR
92 functions write and read the informative event set term. The value is a
93 collection of bits as described in the contract type's manual page.
97 Upon successful completion, \fBct_tmpl_activate()\fR, \fBct_tmpl_create()\fR,
98 \fBct_tmpl_set_cookie()\fR, \fBct_tmpl_get_cookie()\fR,
99 \fBct_tmpl_set_critical()\fR, \fBct_tmpl_get_critical()\fR,
100 \fBct_tmpl_set_informative()\fR, and \fBct_tmpl_get_informative()\fR return 0.
101 Otherwise, they return a non-zero error value.
105 The \fBct_tmpl_create()\fR function will fail if:
112 The terms specified in the template were unsatisfied at the time of the call.
121 The \fIproject\fR.\fImax-contracts\fR resource control would have been
127 The \fBct_tmpl_set_critical()\fR and \fBct_tmpl_set_informative()\fR functions
135 An invalid event was specified.
140 The \fBct_tmpl_set_critical()\fR function will fail if:
147 One of the specified events was disallowed given other contract terms (see
148 \fBcontract\fR(4)) and {\fBPRIV_CONTRACT_EVENT\fR} was not in the effective set
149 for the calling process.
155 See \fBattributes\fR(5) for descriptions of the following attributes:
163 ATTRIBUTE TYPE ATTRIBUTE VALUE
165 Interface Stability Evolving
173 \fBlibcontract\fR(3LIB), \fBcontract\fR(4), \fBattributes\fR(5),