kgethostname Kernel Service

Purpose

Retrieves the name of the current host.

Syntax

#include <sys/types.h>
#include <sys/errno.h>

int
kgethostname ( name,  namelen)
char *name;
int *namelen;

Parameters

Item Description
name Specifies the address of the buffer in which to place the host name.
namelen Specifies the address of a variable in which the length of the host name will be stored. This parameter should be set to the size of the buffer before the kgethostname kernel service is called.

Description

The kgethostname kernel service returns the standard name of the current host as set by the sethostname subroutine. The returned host name is null-terminated unless insufficient space is provided.

Execution Environment

The kgethostname kernel service can be called from either the process or interrupt environment.

Return Value

Item Description
0 Indicates successful completion.