OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [sysdeps/] [gethstnm.c] - Rev 1767

Go to most recent revision | Compare with Previous | Blame | View Log

#include <string.h>
#include <unistd.h>
#include <sys/utsname.h>
#include <errno.h>
 
int
gethostname(char *name, size_t len)
{
  struct utsname uts;
 
  if (name == NULL) {
    errno = EINVAL;
    return -1;
  }
 
  if (uname(&uts) == -1) return -1;
 
  if (strlen(uts.nodename)+1 > len) {
    errno = EINVAL;
    return -1;
  }
  strcpy(name, uts.nodename);
  return 0;
}
 
/* SIMON This is dummy function !!!! */
struct hostent *gethostbyname(char *name)
{
	return (struct hostent *)NULL;
}
 
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.