diff --git a/libs/libglibc-compatibility/glibc-compatibility.c b/libs/libglibc-compatibility/glibc-compatibility.c index 5524017b61f..cb0dd617bdf 100644 --- a/libs/libglibc-compatibility/glibc-compatibility.c +++ b/libs/libglibc-compatibility/glibc-compatibility.c @@ -1,4 +1,13 @@ -#include "glibc-compatibility.h" +/** Allows to build programs with libc 2.18 and run on systems with at least libc 2.11, + * such as Ubuntu Lucid or CentOS 6. + * + * Highly experimental, not recommended, disabled by default. + * + * Also look at http://www.lightofdawn.org/wiki/wiki.cgi/NewAppsOnOldGlibc + * + * If you want even older systems, such as Ubuntu Hardy, + * add fallocate, pipe2, __longjmp_chk, __vasprintf_chk. + */ #if defined (__cplusplus) extern "C" { @@ -14,6 +23,8 @@ long int __fdelt_chk(long int d) return d / __NFDBITS; } +#include +#include int __poll_chk(struct pollfd * fds, nfds_t nfds, int timeout, size_t fdslen) { @@ -22,12 +33,15 @@ int __poll_chk(struct pollfd * fds, nfds_t nfds, int timeout, size_t fdslen) return poll(fds, nfds, timeout); } +#include size_t __pthread_get_minstack(const pthread_attr_t * attr) { return 1048576; /// This is a guess. Don't sure it is correct. } +#include +#include #include #include diff --git a/libs/libglibc-compatibility/glibc-compatibility.h b/libs/libglibc-compatibility/glibc-compatibility.h deleted file mode 100644 index aeea2fc4adb..00000000000 --- a/libs/libglibc-compatibility/glibc-compatibility.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -/** Allows to build programs with libc 2.18 and run on systems with at least libc 2.11, - * such as Ubuntu Lucid or CentOS 6. - * - * Highly experimental, not recommended, disabled by default. - * - * Also look at http://www.lightofdawn.org/wiki/wiki.cgi/NewAppsOnOldGlibc - * - * If you want even older systems, such as Ubuntu Hardy, - * add fallocate, pipe2, __longjmp_chk, __vasprintf_chk. - */ - -#if defined (__cplusplus) -extern "C" { -#endif - - -__attribute__((__weak__)) long int __fdelt_chk(long int d); - -#include -#include - -__attribute__((__weak__)) int __poll_chk(struct pollfd * fds, nfds_t nfds, int timeout, size_t fdslen); - -#include - -__attribute__((__weak__)) size_t __pthread_get_minstack(const pthread_attr_t * attr); - -#include -#include - -__attribute__((__weak__)) int __gai_sigqueue(int sig, const union sigval val, pid_t caller_pid); - -#if defined (__cplusplus) -} -#endif