int __xstat64(int ver, const char *pathname, struct stat64 *buf) { static int (*real___xstat64)(int ver, const char *pathname, struct stat64 *buf) = NULL; const char *p; int ret; GET_PATH(__xstat64); if (p) { ret = real___xstat64(ver, p, buf); PUT_PATH(-1); } return real___xstat64(ver, pathname, buf); }
int __xstat64(int __ver, const char *__filename, struct stat64 *__stat_buf) { int ret; DBG("enter: filename=%s\n", __filename); ret = real___xstat64(__ver, __filename, __stat_buf); if (unlikely(-1 == ret)) { if (-1 == install_package_for(__filename)) return -1; else return real___xstat64(__ver, __filename, __stat_buf); } return ret; }
int __xstat64(STAT_ARGS(stat64)) { stat_init(); return real___xstat64(ver, path, buf); }
/* * Copyright (c) 2008-2010 Wind River Systems; see * guts/COPYRIGHT for information. * * static FILE * * wrap_fopen64(const char *path, const char *mode) { * FILE * rc = 0; */ struct stat64 buf; int save_errno; int existed = (real___xstat64(_STAT_VER, path, &buf) != -1); rc = real_fopen64(path, mode); save_errno = errno; if (rc) { int fd = fileno(rc); pseudo_debug(PDBGF_FILE, "fopen64 '%s': fd %d <FILE %p>\n", path, fd, (void *) rc); if (real___fxstat64(_STAT_VER, fd, &buf) != -1) { if (!existed) { pseudo_client_op(OP_CREAT, 0, -1, -1, path, &buf); } pseudo_client_op(OP_OPEN, pseudo_access_fopen(mode), fd, -1, path, &buf); } else { pseudo_debug(PDBGF_CONSISTENCY, "fopen64 (fd %d) succeeded, but fstat failed (%s).\n", fd, strerror(errno)); pseudo_client_op(OP_OPEN, pseudo_access_fopen(mode), fd, -1, path, 0); } errno = save_errno;