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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [sysdeps/] [gethstnm.c] - Blame information for rev 1767

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

Line No. Rev Author Line
1 199 simons
#include <string.h>
2
#include <unistd.h>
3
#include <sys/utsname.h>
4
#include <errno.h>
5
 
6
int
7
gethostname(char *name, size_t len)
8
{
9
  struct utsname uts;
10
 
11
  if (name == NULL) {
12
    errno = EINVAL;
13
    return -1;
14
  }
15
 
16
  if (uname(&uts) == -1) return -1;
17
 
18
  if (strlen(uts.nodename)+1 > len) {
19
    errno = EINVAL;
20
    return -1;
21
  }
22
  strcpy(name, uts.nodename);
23
  return 0;
24
}
25
 
26
/* SIMON This is dummy function !!!! */
27
struct hostent *gethostbyname(char *name)
28
{
29
        return (struct hostent *)NULL;
30
}
31
 

powered by: WebSVN 2.1.0

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