FILE *fopen64(const char *pathname, const char *mode) { FILE *fp; const char *path; char buffer[PATH_MAX]; fopen64_func_t orig_fopen64; orig_fopen64 = (fopen64_func_t)dlsym(RTLD_NEXT, "fopen64"); path = redirect(pathname, buffer); fp = orig_fopen64(path, mode); if (path != pathname && getenv("PRELOAD_DEBUG")) { fprintf(stderr, "preload_debug: fopen64(\"%s\", \"%s\") => \"%s\": fp=%p\n", pathname, mode, path, fp); } return fp; }
FILE * fopen64 ( const char * path, const char *mode ) { enforcer(path); return orig_fopen64( path, mode ); }