ClickHouse/base/harmful/harmful.c
2020-10-28 02:00:16 +03:00

90 lines
1.6 KiB
C

#pragma GCC diagnostic ignored "-Wincompatible-library-redeclaration"
#define TRAP(func) void func() { __builtin_trap(); }
/// Trap all non thread-safe functions:
/// nm -D /lib/x86_64-linux-gnu/{libc.so.6,libdl.so.2,libm.so.6,libpthread.so.0,librt.so.1,libnss_dns.so.2,libresolv.so.2} | grep -P '_r@?$' | awk '{ print $3 }' | sed -r -e 's/_r//' | grep -vP '^_'
TRAP(asctime)
TRAP(ctime)
TRAP(drand48)
TRAP(ecvt)
TRAP(erand48)
TRAP(ether_aton)
TRAP(ether_ntoa)
TRAP(fcvt)
TRAP(fgetgrent)
TRAP(fgetpwent)
TRAP(fgetsgent)
TRAP(fgetspent)
TRAP(getaliasbyname)
TRAP(getaliasent)
TRAP(getdate)
TRAP(getgrent)
TRAP(getgrgid)
TRAP(getgrnam)
TRAP(gethostbyaddr)
TRAP(gethostbyname2)
TRAP(gethostbyname)
TRAP(gethostent)
TRAP(getlogin)
TRAP(getmntent)
TRAP(getnetbyaddr)
TRAP(getnetbyname)
TRAP(getnetent)
TRAP(getnetgrent)
TRAP(getprotobyname)
TRAP(getprotobynumber)
TRAP(getprotoent)
TRAP(getpwent)
TRAP(getpwnam)
TRAP(getpwuid)
TRAP(getrpcbyname)
TRAP(getrpcbynumber)
TRAP(getrpcent)
TRAP(getservbyname)
TRAP(getservbyport)
TRAP(getservent)
TRAP(getsgent)
TRAP(getsgnam)
TRAP(getspent)
TRAP(getspnam)
TRAP(getutent)
TRAP(getutid)
TRAP(getutline)
TRAP(gmtime)
TRAP(hcreate)
TRAP(hdestroy)
TRAP(hsearch)
TRAP(initstate)
TRAP(jrand48)
TRAP(lcong48)
TRAP(localtime)
TRAP(lrand48)
TRAP(mrand48)
TRAP(nrand48)
TRAP(ptsname)
TRAP(qecvt)
TRAP(qfcvt)
TRAP(random)
TRAP(rand)
TRAP(seed48)
TRAP(setstate)
TRAP(sgetsgent)
TRAP(sgetspent)
TRAP(srand48)
TRAP(srandom)
TRAP(strerror)
TRAP(strtok)
TRAP(tmpnam)
TRAP(ttyname)
TRAP(twalk)
TRAP(lgammaf128)
TRAP(lgammaf32)
TRAP(lgammaf32x)
TRAP(lgammaf64)
TRAP(lgammaf64x)
TRAP(lgammaf)
TRAP(lgammal)
TRAP(lgamma)