GETCCENT(3C) — HP-UX
Series 300 Diskless Only
NAME
getccent, getcccid, getccnam, setccent, endccent, fgetccent − get cluster configuration entry
SYNOPSIS
#include <sys/types.h>
#include <cluster.h>
struct cct_entry *getccent()
struct cct_entry *getcccid(cid)
cnode_t cid;
struct cct_entry *getccnam(name)
char *name;
void setccent()
void endccent()
struct cct_entry *fgetccent(f)
FILE *f;
DESCRIPTION
Getccent, getcccid, and getccnam each returns a pointer to an object with the following structure containing the broken-out fields in the /etc/clusterconf file. The file contains a list of cct_entry structures, defined in the <cluster.h> header file. The cct_entry structure includes the following fields:
| u_char machine_id[M_IDLEN]; | /* Unique machine ID */ |
| cnode_t cnode_id; | /* cnode ID */ |
| char cnode_name[15]; | /* cnode name */ |
| char cnode_type; | /* ’r’=root server |
| ’c’=all other cluster nodes */ | |
| cnode_t swap_serving_cnode; | /* swap cnode */ |
| int kcsp; | /* default number of CSPs to create |
| see csp(1M) */ |
The constant M_IDLEN is defined in <cluster.h> .
Getccent when first called opens the cluster configuration file /etc/clusterconf and returns a pointer to the first cct_entry structure in the file. Thereafter, it returns a pointer to the next cct_entry structure in the file. Successive calls can be used to search the entire file. Getcccid searches from the beginning of the file until an entry whose cnode ID matches cid is found and returns a pointer to the particular structure in which it was found. Getccnam searches from the beginning of the file until a cnode name matching name is found and returns a pointer to the particular structure in which it was found. If an EOF or an error is encountered on reading, these functions return a NULL pointer.
A call to setccent has the effect of rewinding the cluster configuration file to the beginning of the file to allow repeated searches. Endccent can be called to close the cluster configuration file when processing is complete.
Fgetccent returns a pointer to the next cct_entry structure in the stream f, which matches the format of /etc/clusterconf.
DIAGNOSTICS
A NULL pointer is returned on EOF or error.
WARNINGS
The above routines use <stdio.h>, which causes them to increase the size of programs not otherwise using standard I/O, more than might be expected.
All information is contained in a static area overwritten with each call; thus information must be copied if it is to be saved.
AUTHOR
Getccent was developed by HP.
FILES
/etc/clusterconf
SEE ALSO
Hewlett-Packard Company — May 11, 2021