dce_cf_get_host_name(3dce)
Returns the host name relative to the local cell root
Synopsis
#include <dce/dce_cf.h>
void dce_cf_get_host_name(
char **hostname,
error_status_t *status);
Parameters
Input
None.
Input/Output
hostname The address of a string pointer. This pointer will be set by the function to point to a buffer that contains the hostname.
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 The dce_cf_get_host_name( ) routine searches the DCE configuration file for the local host's name relative to the local cell's root. If the name is found,
dce_cf_get_host_name( ) allocates (by a call to malloc( )) a buffer for it, copies the name into the buffer, and returns its address in the hostname input parameter.
Cautions The memory for a returned name string is allocated by malloc( ), and must be freed by the caller of dce_cf_get_host_name( ).
Files
dcelocal/dce_cf.db The machine's local DCE configuration file (where dcelocal is usually something like /opt/dcelocal).
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.
dce_cf_st_ok Operation successfully completed.
dce_cf_e_file_open File open error.
dce_cf_e_no_mem No memory available.
dce_cf_e_no_match No hostname entry in the DCE configuration file.
Related Information Functions: dce_cf_binding_entry_from_host(3dce)
dce_cf_find_name_by_key(3dce)
dce_cf_get_cell_name(3dce)
dce_cf_prin_name_from_host(3dce)
Book: OSF DCE Administration Guide - Core Components
|