1ct_ctl_adopt(3CONTRACTC)ontract Management Library Functiocnts_ctl_adopt(3CONTRACT)
2
3
4
6 ct_ctl_adopt, ct_ctl_abandon, ct_ctl_newct, ct_ctl_ack, ct_ctl_nack,
7 ct_ctl_qack - common contract control functions
8
10 cc [ flag... ] file... -D_LARGEFILE64_SOURCE -lcontract [ library... ]
11 #include <libcontract.h>
12
13 int ct_ctl_adopt(int fd);
14
15
16 int ct_ctl_abandon(int fd);
17
18
19 int ct_ctl_newct(int fd, uint64_t evid, int templatefd);
20
21
22 int ct_ctl_ack(int fd, uint64_t evid);
23
24
25 int ct_ctl_nack(int fd, uint64_t evid);
26
27
28 int ct_ctl_qack(int fd, uint64_t evid);
29
30
32 These functions operate on contract control file descriptors obtained
33 from the contract(4) file system.
34
35
36 The ct_ctl_adopt() function adopts the contract referenced by the file
37 descriptor fd. After a successful call to ct_ctl_adopt(), the contract
38 is owned by the calling process and any events in that contract's event
39 queue are appended to the process's bundle of the appropriate type.
40
41
42 The ct_ctl_abandon() function abandons the contract referenced by the
43 file descriptor fd. After a successful call to ct_ctl_abandon() the
44 process no longer owns the contract, any events sent by that contract
45 are automatically removed from the process's bundle, and any critical
46 events on the contract's event queue are automatically acknowledged.
47 Depending on its type and terms, the contract will either be orphaned
48 or destroyed.
49
50
51 The ct_ctl_ack() function acknowledges the critical event specified
52 byevid. If the event corresponds to an exit negotiation, ct_ctl_ack()
53 also indicates that the caller is prepared for the system to proceed
54 with the referenced reconfiguration.
55
56
57 The ct_ctl_nack() function acknowledges the critical negotiation event
58 specified by evid. The ct_ctl_nack() function also indicates that the
59 caller wishes to block the proposed reconfiguration indicated by event
60 evid. Depending on the contract type, this function might require cer‐
61 tain privileges to be asserted in the process's effective set. This
62 function will fail and return an error if the event represented by evid
63 is not a negotiation event.
64
65
66 The ct_ctl_qack() function requests a new quantum of time for the nego‐
67 tiation specified by the event ID evid.
68
69
70 The ct_ctl_newct() function instructs the contract specified by the
71 file descriptor fd that when the current exit negotiation completes,
72 another contract with the terms provided by the template specified by
73 templatefd should be automatically written.
74
76 Upon successful completion, ct_ctl_adopt(), ct_ctl_abandon(),
77 ct_ctl_newct(), ct_ctl_ack(), and ct_ctl_qack() return 0. Otherwise,
78 they return a non-zero error value.
79
81 The ct_ctl_adopt() function will fail if:
82
83 EBUSY The contract is in the owned state.
84
85
86 EINVAL The contract was not inherited by the caller's process con‐
87 tract or was created by a process in a different zone.
88
89
90
91 The ct_ctl_abandon(), ct_ctl_newct(), ct_ctl_ack(), ct_ctl_nack(), and
92 ct_ctl_qack() functions will fail if:
93
94 EBUSY The contract does not belong to the calling process.
95
96
97
98 The ct_ctl_newct() and ct_ctl_qack() functions will fail if:
99
100 ESRCH The event ID specified by evid does not correspond to an unac‐
101 knowledged negotiation event.
102
103
104
105 The ct_ctl_newct() function will fail if:
106
107 EINVAL The file descriptor specified by fd was not a valid template
108 file descriptor.
109
110
111
112 The ct_ctl_ack() and ct_ctl_nack() functions will fail if:
113
114 ESRCH The event ID specified by evid does not correspond to an unac‐
115 knowledged negotiation event.
116
117
118
119 The ct_ctl_nack() function will fail if:
120
121 EPERM The calling process lacks the appropriate privileges required
122 to block the reconfiguration.
123
124
125
126 The ct_ctl_qack() function will fail if:
127
128 ERANGE The maximum amount of time has been requested.
129
130
132 See attributes(5) for descriptions of the following attributes:
133
134
135
136
137 ┌─────────────────────────────┬─────────────────────────────┐
138 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
139 ├─────────────────────────────┼─────────────────────────────┤
140 │Interface Stability │Committed │
141 ├─────────────────────────────┼─────────────────────────────┤
142 │MT-Level │Safe │
143 └─────────────────────────────┴─────────────────────────────┘
144
146 libcontract(3LIB), contract(4), attributes(5), lfcompile(5)
147
148
149
150SunOS 5.11 9 Aug 2007 ct_ctl_adopt(3CONTRACT)