#define _GNU_SOURCE 1
#include <sys/stat.h>
#include <dlfcn.h>
#include <string.h>
static int (*_lstat)(const int, const char *, struct stat64 *) = NULL;
int __lxstat64(int __ver, __const char *__filename, struct stat64 *__stat_buf)
{
int ret;
if (!_lstat)
_lstat = dlsym(RTLD_NEXT, "__lxstat64");
ret = _lstat(__ver, __filename, __stat_buf);
if (strcmp(__filename, "test.c")==0)
{
__stat_buf->st_size = 0;
}
return ret;
}
|