next up previous contents index
Next: 11.3.3 exitsetexit: Get Up: 11.3 C Library Environment Previous: 11.3.1 getfsnamespacesetfsnamespace: Get

11.3.2 gethostname, sethostname: Get and Set the system hostname

 

SYNOPSIS

#include <oskit/com/libcenv.h>

oskit_error_t oskit_libcenv_gethostname(oskit_libcenv_t *c, char *hostname, int len);
oskit_error_t oskit_libcenv_sethostname(oskit_libcenv_t *c, char *hostname, int len);

DESCRIPTION

Get (or set) the system hostname from the oskit_libcenv COM object. The application initialization code will typically set the hostname when it initializes the network. The POSIX library will then request the hostname as needed by the C library or the application program.

PARAMETERS

c
The oskit_libcenv object to operate on.
hostname
The character string of the hostname to either set or get.
len
The length of the hostname if being set, or the maximum length of the string buffer if getting the hostname.

RETURNS

Returns 0 on success, or an error code specified in <oskit/error.h>, on error.



Utah Flux Research Group