Contract Management Library Functions
cttmplactivate(3CONTRACT)
NAME
cttmplactivate, cttmplclear, cttmplcreate,
cttmplsetcookie, cttmplsetcritical,
cttmplsetinformative, cttmplgetcookie,
cttmplgetcritical, cttmplgetinformative - common con-
tract template functions
SYNOPSIS
cc [ flag... ] file... -DLARGEFILE64SOURCE -lcontract [ library... ]
#include
int cttmplactivate(int fd);
int cttmplclear(int fd);
int cttmplcreate(int fd, ctidt *idp);
int cttmplsetcookie(int fd, uint64t cookie);
int cttmplsetcritical(int fd, uintt events);
int cttmplsetinformative(int fd, uintt events);
int cttmplgetcookie(int fd, uint64t *cookiep);
int cttmplgetcritical(int fd, uintt *eventsp);
int cttmplgetinformative(int fd, uintt *eventsp);
DESCRIPTION
These functions operate on contract template file descrip-
tors obtained from the contract(4) file system.
The cttmplactivate() function makes the template refer-
enced by the file descriptor fd the active template for the
calling thread.
The cttmplclear() function clears calling thread's active
template.
SunOS 5.11 Last change: 1 Apr 2004 1
Contract Management Library Functions
cttmplactivate(3CONTRACT)
The cttmplcreate() function uses the template referenced
by the file descriptor fd to create a new contract. If suc-
cessful, the ID of the newly created contract is placed in
*idp.
The cttmplsetcookie() and cttmplgetcookie() functions
write and read the cookie term of a contract template. The
cookie term is ignored by the system, except to include its
value in a resulting contract's status object. The default
cookie term is 0.
The cttmplsetcritical() and cttmplgetcritical() func-
tions write and read the critical event set term. The value
is a collection of bits as described in the contract type's
manual page.
The cttmplsetinformative() and cttmplgetinformative()
functions write and read the informative event set term. The
value is a collection of bits as described in the contract
type's manual page.
RETURN VALUES
Upon successful completion, cttmplactivate(),
cttmplcreate(), cttmplsetcookie(),
cttmplgetcookie(), cttmplsetcritical(),
cttmplgetcritical(), cttmplsetinformative(), and
cttmplgetinformative() return 0. Otherwise, they return a
non-zero error value.
ERORS
The cttmplcreate() function will fail if:
ERANGE The terms specified in the template were unsatis-
fied at the time of the call.
EAGAIN The project.max-contracts resource control would
have been exceeded.
The cttmplsetcritical() and cttmplsetinformative()
functions will fail if:
EINVAL An invalid event was specified.
SunOS 5.11 Last change: 1 Apr 2004 2
Contract Management Library Functions
cttmplactivate(3CONTRACT)
The cttmplsetcritical() function will fail if:
EPERM One of the specified events was disallowed given
other contract terms (see contract(4)) and
{PRIVCONTRACTEVENT} was not in the effective set
for the calling process.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Evolving
MT-Level Safe
SEE ALSO
libcontract(3LIB), contract(4), attributes(5), lfcompile(5)
SunOS 5.11 Last change: 1 Apr 2004 3
Contract Management Library Functions
cttmplactivate(3CONTRACT)
SunOS 5.11 Last change: 1 Apr 2004 4
|