summaryrefslogtreecommitdiffstats
path: root/Utilities/cmtar/compat/gethostname.c
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2009-10-30 17:15:06 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2009-10-30 17:15:06 (GMT)
commit042587c6312e7ddb794dea912f6172b08837ba48 (patch)
tree773f0005ec13407dd475e57ee528e37ae89b2fef /Utilities/cmtar/compat/gethostname.c
parentfb51d98562a26b6dcde7d3597938a0b707b6b881 (diff)
downloadCMake-042587c6312e7ddb794dea912f6172b08837ba48.zip
CMake-042587c6312e7ddb794dea912f6172b08837ba48.tar.gz
CMake-042587c6312e7ddb794dea912f6172b08837ba48.tar.bz2
Remove libtar
Diffstat (limited to 'Utilities/cmtar/compat/gethostname.c')
-rw-r--r--Utilities/cmtar/compat/gethostname.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/Utilities/cmtar/compat/gethostname.c b/Utilities/cmtar/compat/gethostname.c
deleted file mode 100644
index 1abaae1..0000000
--- a/Utilities/cmtar/compat/gethostname.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* gethostname.c: minimal substitute for missing gethostname() function
- * created 2000-Mar-02 jmk
- * requires SVR4 uname() and -lc
- *
- * by Jim Knoble <jmknoble@pobox.com>
- * Copyright ? 2000 Jim Knoble
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear in
- * supporting documentation.
- *
- * This software is provided "as is", without warranty of any kind,
- * express or implied, including but not limited to the warranties of
- * merchantability, fitness for a particular purpose and
- * noninfringement. In no event shall the author(s) be liable for any
- * claim, damages or other liability, whether in an action of contract,
- * tort or otherwise, arising from, out of or in connection with the
- * software or the use or other dealings in the software.
- */
-
-#include <string.h>
-#include <sys/utsname.h>
-
-int gethostname(char *name, size_t len)
-{
- struct utsname u;
- int status = uname(&u);
- if (-1 != status) {
- strncpy(name, u.nodename, len);
- name[len - 1] = '\0';
- }
- return(status);
-}
-