1ct_tmpl_activate(3CONTCRoAnCtTr)act Management Library Funcctt_itomnpsl_activate(3CONTRACT)
2
3
4

NAME

6       ct_tmpl_activate,  ct_tmpl_clear,  ct_tmpl_create,  ct_tmpl_set_cookie,
7       ct_tmpl_set_critical,   ct_tmpl_set_informative,    ct_tmpl_get_cookie,
8       ct_tmpl_get_critical,  ct_tmpl_get_informative  -  common contract tem‐
9       plate functions
10

SYNOPSIS

12       cc [ flag... ] file... -D_LARGEFILE64_SOURCE  -lcontract  [ library... ]
13       #include <libcontract.h>
14
15       int ct_tmpl_activate(int fd);
16
17
18       int ct_tmpl_clear(int fd);
19
20
21       int ct_tmpl_create(int fd, ctid_t *idp);
22
23
24       int ct_tmpl_set_cookie(int fd, uint64_t cookie);
25
26
27       int ct_tmpl_set_critical(int fd, uint_t events);
28
29
30       int ct_tmpl_set_informative(int fd, uint_t events);
31
32
33       int ct_tmpl_get_cookie(int fd, uint64_t *cookiep);
34
35
36       int ct_tmpl_get_critical(int fd, uint_t *eventsp);
37
38
39       int ct_tmpl_get_informative(int fd, uint_t *eventsp);
40
41

DESCRIPTION

43       These functions operate on contract template file descriptors  obtained
44       from the contract(4) file system.
45
46
47       The  ct_tmpl_activate()  function  makes the template referenced by the
48       file descriptor fd the active template for the calling thread.
49
50
51       The ct_tmpl_clear() function clears calling thread's active template.
52
53
54       The ct_tmpl_create() function uses the template referenced by the  file
55       descriptor  fd  to  create a new contract. If successful, the ID of the
56       newly created contract is placed in *idp.
57
58
59       The ct_tmpl_set_cookie() and ct_tmpl_get_cookie() functions  write  and
60       read the cookie term of a contract template. The cookie term is ignored
61       by the system, except to include its value in  a  resulting  contract's
62       status object. The default cookie term is 0.
63
64
65       The  ct_tmpl_set_critical()  and ct_tmpl_get_critical() functions write
66       and read the critical event set term. The value is a collection of bits
67       as described in the contract type's manual page.
68
69
70       The  ct_tmpl_set_informative()  and ct_tmpl_get_informative() functions
71       write and read the informative event set term. The value is  a  collec‐
72       tion of bits as described in the contract type's manual page.
73

RETURN VALUES

75       Upon   successful   completion,  ct_tmpl_activate(),  ct_tmpl_create(),
76       ct_tmpl_set_cookie(),   ct_tmpl_get_cookie(),   ct_tmpl_set_critical(),
77       ct_tmpl_get_critical(),          ct_tmpl_set_informative(),         and
78       ct_tmpl_get_informative() return 0. Otherwise, they return  a  non-zero
79       error value.
80

ERRORS

82       The ct_tmpl_create() function will fail if:
83
84       ERANGE    The  terms  specified in the template were unsatisfied at the
85                 time of the call.
86
87
88       EAGAIN    The project.max-contracts resource control  would  have  been
89                 exceeded.
90
91
92
93       The ct_tmpl_set_critical() and ct_tmpl_set_informative() functions will
94       fail if:
95
96       EINVAL    An invalid event was specified.
97
98
99
100       The ct_tmpl_set_critical() function will fail if:
101
102       EPERM    One of the specified events was disallowed  given  other  con‐
103                tract  terms  (see  contract(4)) and {PRIV_CONTRACT_EVENT} was
104                not in the effective set for the calling process.
105
106

ATTRIBUTES

108       See attributes(5) for descriptions of the following attributes:
109
110
111
112
113       ┌─────────────────────────────┬─────────────────────────────┐
114       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
115       ├─────────────────────────────┼─────────────────────────────┤
116       │Interface Stability          │Evolving                     │
117       ├─────────────────────────────┼─────────────────────────────┤
118       │MT-Level                     │Safe                         │
119       └─────────────────────────────┴─────────────────────────────┘
120

SEE ALSO

122       libcontract(3LIB), contract(4), attributes(5), lfcompile(5)
123
124
125
126SunOS 5.11                        1 Apr 2004       ct_tmpl_activate(3CONTRACT)
Impressum