diff options
| author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-02-28 03:18:23 +0000 | 
|---|---|---|
| committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-02-28 03:18:23 +0000 | 
| commit | 675d62ac876ffe4719580d45b8c9469934ccf6d7 (patch) | |
| tree | e666bd4a1d816842c070e4928715d66b82655fc2 /libc/sysdeps/linux/common/gethstnm.c | |
| parent | fd666fca933f7241ff75d06ff36c9282fd443335 (diff) | |
| download | uClibc-alpine-675d62ac876ffe4719580d45b8c9469934ccf6d7.tar.bz2 uClibc-alpine-675d62ac876ffe4719580d45b8c9469934ccf6d7.tar.xz  | |
Merge from trunk.
Diffstat (limited to 'libc/sysdeps/linux/common/gethstnm.c')
| -rw-r--r-- | libc/sysdeps/linux/common/gethstnm.c | 22 | 
1 files changed, 16 insertions, 6 deletions
diff --git a/libc/sysdeps/linux/common/gethstnm.c b/libc/sysdeps/linux/common/gethstnm.c index cb6e5efce..fc5a72c8d 100644 --- a/libc/sysdeps/linux/common/gethstnm.c +++ b/libc/sysdeps/linux/common/gethstnm.c @@ -1,12 +1,22 @@ -#define uname __uname +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */  #include <string.h>  #include <unistd.h>  #include <sys/utsname.h>  #include <errno.h> -int attribute_hidden -__gethostname(char *name, size_t len) +libc_hidden_proto(gethostname) + +libc_hidden_proto(strlen) +libc_hidden_proto(strcpy) +libc_hidden_proto(uname) + +int +gethostname(char *name, size_t len)  {    struct utsname uts; @@ -17,11 +27,11 @@ __gethostname(char *name, size_t len)    if (uname(&uts) == -1) return -1; -  if (__strlen(uts.nodename)+1 > len) { +  if (strlen(uts.nodename)+1 > len) {      __set_errno(EINVAL);      return -1;    } -  __strcpy(name, uts.nodename); +  strcpy(name, uts.nodename);    return 0;  } -strong_alias(__gethostname,gethostname) +libc_hidden_def(gethostname)  | 
