NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO
#include <chorusdb.h>int getsitebyname(const char * name, int * site);
The getsitebyname function returns, in the object pointed to by site , the ChorusOS site number of the ChorusOS site whose symbolic name is name .
The getsitebyaddr function returns, in the character array name , the symbolic name of the ChorusOS site whose site number is site . If the real length of the symbolic name is greater than length , it is truncated to length bytes.
TIn order to obtain this information, a ChorusOS Name Server daemon must be running.
The getsitebyname and getsitebyaddr functions return 0 in case of success. Otherwise they return -1 and set errno to indicate the error condition. The getsitebyaddr function returns the real name string length in length (including the NULL character).
Error code:
No such ChorusOS site is known.
The ChorusOS Name Server cannot be reached.
Invalid length (must be >= 0).
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO