Database Routines
gethostname()
Description Return the standard host name for the local machine.
#include <winsock.h>
int PASCAL FAR gethostname ( char FAR * name, int namelen );
name A pointer to a buffer that will receive the host name.
namelen The length of the buffer.
Remarks This routine returns the name of the local host into the buffer
specified by the name
parameter. The host name is returned as a null-terminated string. The form
of the host
name is dependent on the Windows Sockets implementation--it may be a simple
host
name, or it may be a fully qualified domain name. However, it is guaranteed
that the
name returned will be successfully parsed by gethostbyname() and
WSAAsyncGetHostByName().
Return Value If no error occurs, gethostname() reutrns 0, otherwise it
returns SOCKET_ERROR and a
specific error code may be retrieved by calling WSAGetLastError().
Error Codes WSAEFAULT The namelen parameter is too small
WSANOTINITIALISED A successful WSAStartup() must occur before using this API.
WSAENETDOWN The Windows Sockets implementation has detected that the
network subsystem has failed.
WSAEINPROGRESS A blocking Windows Sockets operation is in progress.
See Also gethostbyname(), WSAAsyncGetHostByName().
*************************************************
* Ian Carr-de Avelon avelon@phys.uva.nl *
* http://pc-ia184.phys.uva.nl/avelon.htm *
* *
* dept. of Physics Education *
* University of Amsterdam *
* Netherlands *
*************************************************