Tor
0.4.9.2-alpha-dev
Toggle main menu visibility
Main Page
Related Pages
Modules
Data Structures
Data Structures
Data Structure Index
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerator
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
b
c
d
f
g
h
l
m
n
o
p
r
s
v
Enumerations
a
b
c
d
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerator
a
b
c
d
e
g
h
i
m
n
o
p
q
r
s
t
v
w
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
lib
net
gethostname.c
Go to the documentation of this file.
1
/* Copyright (c) 2003-2004, Roger Dingledine
2
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3
* Copyright (c) 2007-2021, The Tor Project, Inc. */
4
/* See LICENSE for licensing information */
5
6
/**
7
* \file gethostname.c
8
* \brief Mockable wrapper for gethostname().
9
*/
10
11
#include "orconfig.h"
12
#include "
lib/net/gethostname.h
"
13
14
#ifdef HAVE_UNISTD_H
15
#include <unistd.h>
16
#endif
17
#ifdef _WIN32
18
#include <winsock2.h>
19
#endif
20
21
/** Get name of current host and write it to <b>name</b> array, whose
22
* length is specified by <b>namelen</b> argument. Return 0 upon
23
* successful completion; otherwise return return -1. (Currently,
24
* this function is merely a mockable wrapper for POSIX gethostname().)
25
*/
26
MOCK_IMPL
(
int
,
27
tor_gethostname
,(
char
*
name
,
size_t
namelen))
28
{
29
return
gethostname(
name
,namelen);
30
}
name
const char * name
Definition:
config.c:2471
tor_gethostname
int tor_gethostname(char *name, size_t namelen)
Definition:
gethostname.c:27
gethostname.h
Header for gethostname.c.
MOCK_IMPL
#define MOCK_IMPL(rv, funcname, arglist)
Definition:
testsupport.h:133
Generated by
1.9.4