OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
deletion of tickets, threads, files, sockets, RPC endpoints, or other objects; message
transfer, including name lookup, binding, and forwarding; directory maintenance
(including caching, advertising, skulking, and replication); and database maintenance
(including replication or synchronization).
Data input syntax errors
Routines that process data that could have been entered from a keyboard should fail
gracefully (and not core dump, for example) if the data is syntactically incorrect.
Serviceability can be used to report this kind of failure.
Once you have identified the points in your code that should be reported with
serviceability messaging, the next step is to define the messages themselves (in the sams
file) and code the serviceability calls. The serviceability features of sams files were
described previously; the following sections describe the various parts of the
serviceability interface itself.
Using the serviceability interface to report errors ensures that the error codes used will be
unique within DCE.
4.3 Application Use of Serviceability
The following subsections describe in detail the various elements of the serviceability
API and what you can do with them.
Complete reference pages for all the serviceability routines can be found in the OSF
DCE Application Development Reference.
4.3.1 Basic Server Calls
The ‘‘basic’’ serviceability routines are the following:
DCE_SVC_DEFINE_HANDLE( )
This is a macro that can be used instead of dce_svc_register() to register a table (it
does this by means of a global variable created at compile time). It could have been
used in the hello_svc.c code as follows, with exactly the same results as from using
dce_svc_register():
DCE_SVC_DEFINE_HANDLE(hel_svc_handle, hel_svc_table, "hel");
/* handle | | */
/* table | */
/* component name */
Note that either DCE_SVC_DEFINE_HANDLE( ) or dce_svc_register() must be
called before the interface can be used.
4 16 Tandem Computers Incorporated 124245