|
@@ -0,0 +1,25 @@
|
|
|
+
|
|
|
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
|
|
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
|
|
|
+
|
|
|
+
|
|
|
+#include "orconfig.h"
|
|
|
+#include "lib/net/gethostname.h"
|
|
|
+
|
|
|
+#ifdef HAVE_UNISTD_H
|
|
|
+#include <unistd.h>
|
|
|
+#endif
|
|
|
+#ifdef _WIN32
|
|
|
+#include <winsock2.h>
|
|
|
+#endif
|
|
|
+
|
|
|
+
|
|
|
+ * length is specified by <b>namelen</b> argument. Return 0 upon
|
|
|
+ * successful completion; otherwise return return -1. (Currently,
|
|
|
+ * this function is merely a mockable wrapper for POSIX gethostname().)
|
|
|
+ */
|
|
|
+MOCK_IMPL(int,
|
|
|
+tor_gethostname,(char *name, size_t namelen))
|
|
|
+{
|
|
|
+ return gethostname(name,namelen);
|
|
|
+}
|