[tor-dev] [PATCH torsocks]: Add support for the musl c library

David Goulet dgoulet at ev0ke.net
Mon May 30 18:48:04 UTC 2016


Hi Felix!

Just to say thanks for this. I've already have a patch in the pipe about this.
Someone gave me one few months ago. Next version will definitely have this in.

Thanks!
David

On 23 May (12:06:18), Felix Janda wrote:
> Signed-off-by: Felix Janda <felix.janda at posteo.de>
> ---
>  src/common/compat.c | 4 ++--
>  src/common/compat.h | 4 ++--
>  src/common/ref.h    | 4 ++--
>  src/lib/torsocks.h  | 4 ++--
>  4 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/src/common/compat.c b/src/common/compat.c
> index a861b3d..eb8eb12 100644
> --- a/src/common/compat.c
> +++ b/src/common/compat.c
> @@ -19,7 +19,7 @@
>  
>  #include "compat.h"
>  
> -#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__darwin__) ||
> defined(__NetBSD__))
> +#if (defined(__GLIBC__) || defined(__linux__) || defined(__FreeBSD__) ||
> defined(__darwin__) || defined(__NetBSD__))
>  
>  /*
>   * Initialize a pthread mutex. This never fails.
> @@ -96,4 +96,4 @@ void tsocks_once(tsocks_once_t *o, void
> (*init_routine)(void))
>  	tsocks_mutex_unlock(&o->mutex);
>  }
>  
> -#endif /* __GLIBC__, __darwin__, __FreeBSD__, __NetBSD__ */
> +#endif /* __GLIBC__, __linux__, __darwin__, __FreeBSD__, __NetBSD__ */
> diff --git a/src/common/compat.h b/src/common/compat.h
> index ce47129..11e0175 100644
> --- a/src/common/compat.h
> +++ b/src/common/compat.h
> @@ -22,7 +22,7 @@
>  #define __darwin__	1
>  #endif
>  
> -#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__darwin__) ||
> defined(__NetBSD__))
> +#if (defined(__GLIBC__) || defined(__linux__) || defined(__FreeBSD__) ||
> defined(__darwin__) || defined(__NetBSD__))
>  
>  #define RTLD_NEXT	((void *) -1)
>  
> @@ -55,7 +55,7 @@ void tsocks_once(tsocks_once_t *o, void
> (*init_routine)(void));
>  
>  #else
>  #error "OS not supported."
> -#endif /* __GLIBC__, __darwin__, __FreeBSD__, __NetBSD__ */
> +#endif /* __GLIBC__, __linux__, __darwin__, __FreeBSD__, __NetBSD__ */
>  
>  #if defined(__linux__)
>  #include <unistd.h>
> diff --git a/src/common/ref.h b/src/common/ref.h
> index 88aec2e..32e07a1 100644
> --- a/src/common/ref.h
> +++ b/src/common/ref.h
> @@ -26,7 +26,7 @@ struct ref {
>  	long count;
>  };
>  
> -#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__darwin__) ||
> defined(__NetBSD__))
> +#if (defined(__GLIBC__) || defined(__linux__) || defined(__FreeBSD__) ||
> defined(__darwin__) || defined(__NetBSD__))
>  
>  /*
>   * Get a reference by incrementing the refcount.
> @@ -57,6 +57,6 @@ static inline void ref_put(struct ref *r,
>  
>  #else
>  #error "OS not supported"
> -#endif /* __GLIBC__, __FreeBSD__, __darwin__ */
> +#endif /* __GLIBC__, __linux__, __FreeBSD__, __darwin__ */
>  
>  #endif /* TORSOCKS_REF_H */
> diff --git a/src/lib/torsocks.h b/src/lib/torsocks.h
> index 076f3a5..5fb76ee 100644
> --- a/src/lib/torsocks.h
> +++ b/src/lib/torsocks.h
> @@ -33,7 +33,7 @@
>  #define TSOCKS_DECL(name, type, sig) \
>  	extern type tsocks_##name(sig);
>  
> -#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__darwin__) ||
> defined(__NetBSD__))
> +#if (defined(__GLIBC__) || defined(__linux__) || defined(__FreeBSD__) ||
> defined(__darwin__) || defined(__NetBSD__))
>  
>  /* connect(2) */
>  #include <sys/types.h>
> @@ -207,7 +207,7 @@ struct hostent **result, int *h_errnop
>  
>  #else
>  #error "OS not supported."
> -#endif /* __GLIBC__ , __FreeBSD__, __darwin__, __NetBSD__ */
> +#endif /* __GLIBC__, __linux__, __FreeBSD__, __darwin__, __NetBSD__ */
>  
>  #if (defined(__linux__))
>  
> -- 
> 2.7.3
> 
> 
> 
> _______________________________________________
> tor-dev mailing list
> tor-dev at lists.torproject.org
> https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 603 bytes
Desc: not available
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20160530/a0d020dc/attachment.sig>


More information about the tor-dev mailing list