[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

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

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

0 Indicates successful completion.

Implementation Specifics

The kgethostname kernel service is part of Base Operating System (BOS) Runtime.

Related Information

The sethostname subroutine.

Network Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]