Contract Management Library Functions ctctladopt(3CONTRACT)
NAME
ctctladopt, ctctlabandon, ctctlnewct, ctctlack,
ctctlnack, ctctlqack - common contract control functions
SYNOPSIS
cc [ flag... ] file... -DLARGEFILE64SOURCE -lcontract [ library... ]
#include
int ctctladopt(int fd);
int ctctlabandon(int fd);
int ctctlnewct(int fd, uint64t evid, int templatefd);
int ctctlack(int fd, uint64t evid);
int ctctlnack(int fd, uint64t evid);
int ctctlqack(int fd, uint64t evid);
DESCRIPTION
These functions operate on contract control file descriptors
obtained from the contract(4) file system.
The ctctladopt() function adopts the contract referenced
by the file descriptor fd. After a successful call to
ctctladopt(), the contract is owned by the calling process
and any events in that contract's event queue are appended
to the process's bundle of the appropriate type.
The ctctlabandon() function abandons the contract refer-
enced by the file descriptor fd. After a successful call to
ctctlabandon() the process no longer owns the contract,
any events sent by that contract are automatically removed
from the process's bundle, and any critical events on the
contract's event queue are automatically acknowledged.
Depending on its type and terms, the contract will either be
orphaned or destroyed.
The ctctlack() function acknowledges the critical event
specified byevid. If the event corresponds to an exit nego-
tiation, ctctlack() also indicates that the caller is
prepared for the system to proceed with the referenced
SunOS 5.11 Last change: 9 Aug 2007 1
Contract Management Library Functions ctctladopt(3CONTRACT)
reconfiguration.
The ctctlnack() function acknowledges the critical nego-
tiation event specified by evid. The ctctlnack() function
also indicates that the caller wishes to block the proposed
reconfiguration indicated by event evid. Depending on the
contract type, this function might require certain
privileges to be asserted in the process's effective set.
This function will fail and return an error if the event
represented by evid is not a negotiation event.
The ctctlqack() function requests a new quantum of time
for the negotiation specified by the event ID evid.
The ctctlnewct() function instructs the contract specified
by the file descriptor fd that when the current exit nego-
tiation completes, another contract with the terms provided
by the template specified by templatefd should be automati-
cally written.
RETURN VALUES
Upon successful completion, ctctladopt(),
ctctlabandon(), ctctlnewct(), ctctlack(), and
ctctlqack() return 0. Otherwise, they return a non-zero
error value.
ERORS
The ctctladopt() function will fail if:
EBUSY The contract is in the owned state.
EINVAL The contract was not inherited by the caller's
process contract or was created by a process in a
different zone.
The ctctlabandon(), ctctlnewct(), ctctlack(),
ctctlnack(), and ctctlqack() functions will fail if:
EBUSY The contract does not belong to the calling pro-
cess.
The ctctlnewct() and ctctlqack() functions will fail if:
SunOS 5.11 Last change: 9 Aug 2007 2
Contract Management Library Functions ctctladopt(3CONTRACT)
ESRCH The event ID specified by evid does not correspond
to an unacknowledged negotiation event.
The ctctlnewct() function will fail if:
EINVAL The file descriptor specified by fd was not a
valid template file descriptor.
The ctctlack() and ctctlnack() functions will fail if:
ESRCH The event ID specified by evid does not correspond
to an unacknowledged negotiation event.
The ctctlnack() function will fail if:
EPERM The calling process lacks the appropriate
privileges required to block the reconfiguration.
The ctctlqack() function will fail if:
ERANGE The maximum amount of time has been requested.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level Safe
SEE ALSO
libcontract(3LIB), contract(4), attributes(5), lfcompile(5)
SunOS 5.11 Last change: 9 Aug 2007 3
|