diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-08-01 08:47:27 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-08-01 08:47:27 -0400 |
commit | 2884639ad63583d2a5a3dd14185c77212e566b5f (patch) | |
tree | 2a8461ee9037d2b0f4a83e4ae3bfc2f9a9bca24f /src/lib/net/socketpair.h | |
parent | 7e4ac0283ef9c089ebe4da8b85a5f6b5ec84a081 (diff) | |
download | tor-2884639ad63583d2a5a3dd14185c77212e566b5f.tar.gz tor-2884639ad63583d2a5a3dd14185c77212e566b5f.zip |
Extract tor_ersatz_socketpair into a new c file
I'm doing this because I want to make it a lower-level function
again, so that we can use it without linking in the rest of the
universe.
Diffstat (limited to 'src/lib/net/socketpair.h')
-rw-r--r-- | src/lib/net/socketpair.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/net/socketpair.h b/src/lib/net/socketpair.h new file mode 100644 index 0000000000..3efa65a675 --- /dev/null +++ b/src/lib/net/socketpair.h @@ -0,0 +1,19 @@ +/* Copyright (c) 2003-2004, Roger Dingledine + * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. + * Copyright (c) 2007-2018, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +#ifndef TOR_SOCKETPAIR_H +#define TOR_SOCKETPAIR_H + +#include "orconfig.h" +#include "lib/testsupport/testsupport.h" +#include "lib/net/nettypes.h" + +#if !defined(HAVE_SOCKETPAIR) || defined(_WIN32) || defined(TOR_UNIT_TESTS) +#define NEED_ERSATZ_SOCKETPAIR +STATIC int tor_ersatz_socketpair(int family, int type, int protocol, + tor_socket_t fd[2]); +#endif + +#endif |