Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ AS_CASE([$host_os],
[linux*|kfreebsd*-gnu|freebsd*],
[
libc_name=`ldd /usr/bin/yes | grep 'libc\.' | cut -d ' ' -f 1 | tr -d '\t'`
if test "${libc_name}" == ""; then
if test "${libc_name}" = ""; then
# Default libc on most system.
libc_name="libc.so.6"
fi
Expand Down
2 changes: 1 addition & 1 deletion src/lib/accept.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ LIBC_ACCEPT_DECL
return tsocks_accept(LIBC_ACCEPT_ARGS);
}

#if (defined(__linux__))
#if (defined(__linux__) || defined(__NetBSD__))

TSOCKS_LIBC_DECL(accept4, LIBC_ACCEPT4_RET_TYPE, LIBC_ACCEPT4_SIG)

Expand Down
7 changes: 5 additions & 2 deletions src/lib/torsocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,18 @@ struct hostent **result, int *h_errnop
#define LIBC_SYSCALL_SIG long int number, ...
#define LIBC_SYSCALL_ARGS number

#endif /* __linux__ */

#if defined(__linux__) || defined(__NetBSD__)
/* accept4(2) */
#define LIBC_ACCEPT4_NAME accept4
#define LIBC_ACCEPT4_NAME_STR XSTR(LIBC_ACCEPT4_NAME)
#define LIBC_ACCEPT4_RET_TYPE int
#define LIBC_ACCEPT4_SIG \
int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags
#define LIBC_ACCEPT4_ARGS sockfd, addr, addrlen, flags
#endif

#endif /* __linux__ */

#if (defined(__FreeBSD__) || defined(__darwin__) || defined(__NetBSD__))

Expand Down Expand Up @@ -414,7 +417,7 @@ TSOCKS_DECL(accept, LIBC_ACCEPT_RET_TYPE, LIBC_ACCEPT_SIG)
LIBC_ACCEPT_NAME(LIBC_ACCEPT_SIG)

/* accept4(2) */
#if (defined(__linux__))
#if (defined(__linux__) || defined(__NetBSD__))
extern TSOCKS_LIBC_DECL(accept4, LIBC_ACCEPT4_RET_TYPE, LIBC_ACCEPT4_SIG)
TSOCKS_DECL(accept4, LIBC_ACCEPT4_RET_TYPE, LIBC_ACCEPT4_SIG)
#define LIBC_ACCEPT4_DECL LIBC_ACCEPT4_RET_TYPE \
Expand Down