TCP/IP Programming Manual
char buffer [];
socklen_t buffer_length;
TAL Synopsis
?NOLIST, SOURCE SOCKPROC
?NOLIST, SOURCE SOCKDEFT
error := gethostname (buffer, buffer_length);
INT(32) error;
STRING .EXT buffer;
INT(32) buffer_length;
error
return value; if the call is successful, a zero is returned. If the call is not successful, —1 is
returned. If the call failed, the external variable errno is set as indicated in Errors (page 114).
buffer
return value; a character array in which the official name of the local host is returned. The
name returned is a null-terminated character string (for example, “medlab\0”).
buffer_length
input value; the size of buffer.
Errors
If an error occurs, the external variable errno is set to the following value:
An invalid argument was specified.EINVAL
getipnodebyaddr
The getipnodebyaddr function searches host entries until a match with the src is found. (This
function is supported for NonStop TCP/IP only.)
The getipnodebyaddr function returns a pointer to a hostent struct whose members specify
data from a name server specified in the resconf or hosts files.
NOTE: The C synopsis is given in ANSI C format rather than the pre-ANSI C formats of the other
library routines because the only NonStop servers you can use these routines on all support ANSI
C. (ANSI C format defines the function and the arguments in the same line rather than using an
assign statement and defining the arguments underneath.)
C Synopsis
#include <sys/socket.h>
#include <netdb.h>
struct hostent *getipnodebyaddr (const void *src, socklen_t len,
int af, int *error_ptr);
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
return_value := getipnodebyaddr(src, len, af, error_ptr);
INT(32) return_val;
STRING .EXT src;
INT(32) len;
INT(32) af;
114 Library Routines