Index of Section 3 Manual Pages

Interix / SUAgethostname.3Interix / SUA

gethostname(3)                                           gethostname(3)

  gethostname()

  NAME

    gethostname() - get name of current host

  SYNOPSIS

    #include 

    int gethostname (char *name, int namelen)

  DESCRIPTION

    The gethostname(3) function returns the standard host name for the current
    processor. The parameter namelen specifies the size of the name array. The
    returned name is null-terminated unless insufficient space is provided.

  RETURN VALUES

    If the call succeeds, it returns 0. If the call fails, it returns -1 and
    sets errno to indicate the error.

  ERRORS

    The following errors may be returned by these calls:

    [EFAULT]
        The name or namelen parameter gave an invalid address.

  BUGS

    Host names are limited to {MAXHOSTNAMELEN} (from ) characters.

  USAGE NOTES

    The gethostname function is thread safe.

    The gethostname function is not async-signal safe.


Interix / SUAHosted at SUA Community for Interix, SUA and SFUInterix / SUA