]> git.mxchange.org Git - flightgear.git/commitdiff
Initial revision.
authorcurt <curt>
Thu, 22 Mar 2001 04:19:12 +0000 (04:19 +0000)
committercurt <curt>
Thu, 22 Mar 2001 04:19:12 +0000 (04:19 +0000)
tests/test-gethostname.cxx [new file with mode: 0644]

diff --git a/tests/test-gethostname.cxx b/tests/test-gethostname.cxx
new file mode 100644 (file)
index 0000000..ec62ace
--- /dev/null
@@ -0,0 +1,18 @@
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#if defined( unix ) || defined( __CYGWIN__ )
+#  include <unistd.h>          // for gethostname()
+#endif
+
+#include <stdio.h>
+
+int main() {
+#if defined( unix ) || defined( __CYGWIN__ )
+  char name[256];
+  gethostname( name, 256 );
+  printf("hostname = %s\n", name);
+#endif
+  return 0;
+}