TNF Library Functions tnfctlregisterfuncs(3TNF)
NAME
tnfctlregisterfuncs - register callbacks for probe crea-
tion and destruction
SYNOPSIS
cc [ flag ... ] file ... -ltnfctl [ library ... ]
#include
tnfctlerrcodet tnfctlregisterfuncs(tnfctlhandlet *hndl, void * (*createfunc)
(tnfctlhandlet *, tnfctlprobet *), void (*destroyfunc)(void *));
DESCRIPTION
The function tnfctlregisterfuncs() is used to store
client-specific data on a per-probe basis. It registers a
creator and a destructor function with hndl, either of
which can be NUL. The creator function is called for every
probe that currently exists in hndl. Every time a new probe
is discovered, that is brought in by dlopen(3C), createfunc
is called.
The return value of the creator function is stored as part
of the probe state and can be retrieved by
tnfctlprobestateget(3TNF) in the member field
clientregistereddata.
destroyfunc is called for every probe handle that is freed.
This does not necessarily happen at the time dlclose(3C)
frees the shared object. The probe handles are freed only
when hndl is closed by tnfctlclose(3TNF). If
tnfctlregisterfuncs() is called a second time for the same
hndl, then the previously registered destructor function is
called first for all of the probes.
RETURN VALUES
tnfctlregisterfuncs() returns TNFCTLERNONE upon suc-
cess.
ERORS
TNFCTLERINTERNAL An internal error occurred.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 1 Mar 2004 1
TNF Library Functions tnfctlregisterfuncs(3TNF)
ATRIBUTE TYPE ATRIBUTE VALUE
Availability SUNWtnfc
MT Level MT-Safe
SEE ALSO
prex(1), TNFPROBE(3TNF), dlclose(3C), dlopen(3C),
libtnfctl(3TNF), tnfctlclose(3TNF),
tnfctlprobestateget(3TNF), tracing(3TNF),
tnfkernelprobes(4), attributes(5)
Linker and Libraries Guide
SunOS 5.11 Last change: 1 Mar 2004 2
|