fn_ctx_bind(3N)
NAME
fn_ctx_bind − bind a reference to a name
SYNOPSIS
cc [ flag ... ] file ... −lxfn [ library ... ]
#include <xfn/xfn.h>
int fn_ctx_bind(FN_ctx_t ∗ctx, const FN_composite_name_t ∗name,
const FN_ref_t ∗ref, unsigned int exclusive, FN_status_t ∗status);
MT-LEVEL
Safe.
DESCRIPTION
This operation binds the supplied reference ref to the supplied composite name name relative to ctx. The binding is made in the target context — that context named by all but the terminal atomic part of name. The operation binds the terminal atomic name to the supplied reference in the target context. The target context must already exist.
The value of exclusive determines what happens if the terminal atomic part of the name is already bound in the target context. If exclusive is nonzero and name is already bound, the operation fails. If exclusive is zero, the new binding replaces any existing binding.
RETURN VALUE
When the bind operation is successful it returns 1; on error it returns 0.
ERRORS
fn_ctx_bind sets status as described in FN_status_t(3N) and xfn_status_codes. Of special relevance for this operation is the following status code:
FN_E_NAME_IN_USE
The supplied name is already in use.
APPLICATION USAGE
The value of ref cannot be NULL. If the intent is to reserve a name using fn_ctx_bind(), a reference containing no address should be supplied. This reference may be name service-specific or it may be the conventional NULL reference defined in the X/Open registry (see fns_references(5)).
If multiple sources are updating a reference, they must synchronize amongst each other when adding, modifying, or removing from the address list of a bound reference.
SEE ALSO
FN_composite_name_t(3N), FN_ctx_t(3N), FN_ref_t(3N), FN_status_t(3N), fn_ctx_lookup(3N), fn_ctx_unbind(3N), xfn_status_codes(3N), xfn(3N)
SunOS 5.5 — Last change: 4 Nov 1994