Fix old glibc without liblinuxcompat.a

This commit is contained in:
Joshua Granick
2017-09-15 11:12:58 -07:00
parent 411f9d0668
commit e5488470a6
2 changed files with 23 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
#ifdef HX_LINUX
// Improve compatibility with old glibc
#define __fdelt_chk __fdelt_chk_local
#include <sys/select.h>
#undef __fdelt_chk
long int __fdelt_chk (long int d) {
if (d >= FD_SETSIZE) {
//printf("Select - bad fd.\n");
return 0;
}
return d / __NFDBITS;
}
#endif