PreviousNext

dce_svc_set_progname(3dce)

Sets an application's program name

Synopsis

#include <dce/dce.h>

void dce_svc_set_progname(

char *program_name,
error_status_t *status);

Parameters

Input

program_name
A string containing the name that is to be included in the text of all serviceability messages that the application generates during the session.

Output

status
Returns the status code from this operation. The status code is a value that indicates whether the routine completed successfully and if not, why not.

Description
This function sets the application's program name, which is included in serviceability messages. This allows serviceability messages from more than one application to be written to the same file and still be distinguishable as to their separate origins.

If dce_svc_set_progname( ) is not called, the application's generated serviceability messages will be identified by its process ID.

Examples
Suppose an application sets its program name to be demo_program, as shown:

dce_svc_set_progname("demo_program", &status);

Serviceability messages generated by the program will as a result look like the following:

1994-04-05-20:13:34.500+00:00I----- demo_program NOTICE app main.c 123 0xa444e208
message text

If the application does not set its program name, its generated serviceability messages will have the following form:

1994-04-05-20:13:34.500+00:00I----- PID#9467 NOTICE app main.c 123 0xa444e208
message text

Errors

The following describes a partial list of errors that might be returned. Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages.

See dce_svc_register(3dce).

Related Information
Functions: dce_printf(3dce)

dce_svc_printf(3dce)

DCE_SVC_DEBUG(3dce)