}
if (__sysno == __NR_gettid) {
- static void *nextlib = NULL;
static long (*nextlib_syscall)(long number, ...);
if (nextlib_syscall == NULL) {
-#ifdef RTLD_NEXT
- nextlib = RTLD_NEXT;
-#else
- nextlib = dlopen("libc.so.6", RTLD_LAZY);
-#endif
- nextlib_syscall = dlsym(nextlib, "syscall");
+ nextlib_syscall = dlsym(RTLD_NEXT, "syscall");
if (nextlib_syscall == NULL) {
fprintf(stderr,
"FIXME FIXME FIXME: could not load syscall symbol: %s\n",
#include "testsuite.h"
-static void *nextlib;
static const char *rootpath;
static size_t rootpathlen;
{
void *fp;
- if (nextlib == NULL) {
-#ifdef RTLD_NEXT
- nextlib = RTLD_NEXT;
-#else
- nextlib = dlopen("libc.so.6", RTLD_LAZY);
-#endif
- }
-
- fp = dlsym(nextlib, f);
+ fp = dlsym(RTLD_NEXT, f);
assert(fp);
return fp;
TS_EXPORT int uname(struct utsname *u)
{
- static void *nextlib = NULL;
static int (*nextlib_uname)(struct utsname *u);
const char *release;
int err;
size_t sz;
- if (nextlib == NULL) {
-#ifdef RTLD_NEXT
- nextlib = RTLD_NEXT;
-#else
- nextlib = dlopen("libc.so.6", RTLD_LAZY);
-#endif
- nextlib_uname = dlsym(nextlib, "uname");
- }
+ if (nextlib_uname == NULL)
+ nextlib_uname = dlsym(RTLD_NEXT, "uname");
err = nextlib_uname(u);
if (err < 0)