2 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
4 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
9 #include <sys/utsname.h>
12 /* libc_hidden_proto(gethostname) */
14 /* Experimentally off - libc_hidden_proto(strlen) */
15 /* Experimentally off - libc_hidden_proto(strcpy) */
16 /* libc_hidden_proto(uname) */
19 gethostname(char *name, size_t len)
28 if (uname(&uts) == -1) return -1;
30 if (strlen(uts.nodename)+1 > len) {
34 strcpy(name, uts.nodename);
37 libc_hidden_def(gethostname)