Back to index

glibc  2.9
gethostname.c File Reference
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sysdep.h>
#include <sys/syscall.h>
#include <bp-checks.h>

Go to the source code of this file.


int __gethostname (char *name, size_t len)

Function Documentation

int __gethostname ( char *  name,
size_t  len 

Definition at line 29 of file gethostname.c.

  int result;

  result = INLINE_SYSCALL (gethostname, 2, CHECK_N (name, len), len);

  if (result == 0
      /* See whether the string is terminated.  If not we will return
        an error.  */
      && memchr (name, '\0', len) == NULL)
      __set_errno (EOVERFLOW);
      result = -1;

  return result;

Here is the call graph for this function:

Here is the caller graph for this function: