31 #if defined(__clang__) && defined(_FORTIFY_SOURCE)
32 #undef _FORTIFY_SOURCE
35 #include <sys/types.h>
71 namespace {
bool isLite = (getenv(
"XRD_POSIX_PRELOAD_LITE") != 0);}
79 int access(
const char *path,
int amode)
95 int acl(
const char *path,
int cmd,
int nentries,
void *aclbufp)
186 theArg = va_arg(ap,
void *);
196 #if !defined(__APPLE__)
228 FILE *
fopen64(
const char *path,
const char *mode)
242 size_t fread(
void *ptr,
size_t size,
size_t nitems, FILE *stream)
256 int fseek(FILE *stream,
long offset,
int whence)
270 int fseeko64(FILE *stream, off64_t offset,
int whence)
284 #if defined(__linux__) and defined(_STAT_VER) and __GNUC__ and __GNUC__ >= 2
285 int __fxstat64(
int ver,
int fildes,
struct stat64 *buf)
292 #if defined(__linux__) and defined(_STAT_VER)
293 return XrdPosix_FstatV(ver, fildes, (
struct stat *)buf);
362 size_t fwrite(
const void *ptr,
size_t size,
size_t nitems, FILE *stream)
374 #if defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
377 ssize_t fgetxattr (
int fd,
const char *name,
void *value,
size_t size)
381 return XrdPosix_Fgetxattr(fd, name, value, size);
390 #if defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
393 ssize_t getxattr (
const char *path,
const char *name,
void *value,
size_t size)
397 return XrdPosix_Getxattr(path, name, value, size);
406 #if defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
409 ssize_t lgetxattr (
const char *path,
const char *name,
void *value,
size_t size)
413 return XrdPosix_Lgetxattr(path, name, value, size);
424 off64_t
lseek64(
int fildes, off64_t offset,
int whence)
438 #if defined(__linux__) || defined(__APPLE__)
439 off_t
llseek(
int fildes, off_t offset,
int whence)
441 offset_t
llseek(
int fildes, offset_t offset,
int whence)
456 #if defined __linux__ && __GNUC__ && __GNUC__ >= 2
457 int __lxstat64(
int ver,
const char *path,
struct stat64 *buf)
474 int mkdir(
const char *path, mode_t mode)
488 int open64(
const char *path,
int oflag, ...)
495 mode = va_arg(ap,
int);
537 ssize_t
pread64(
int fildes,
void *buf,
size_t nbyte, off_t offset)
551 ssize_t
pwrite64(
int fildes,
const void *buf,
size_t nbyte, off_t offset)
565 ssize_t
read(
int fildes,
void *buf,
size_t nbyte)
579 ssize_t
readv(
int fildes,
const struct iovec *
iov,
int iovcnt)
607 int readdir64_r(DIR *dirp,
struct dirent64 *entry,
struct dirent64 **result)
622 int rename(
const char *oldpath,
const char *newpath)
680 #if defined __linux__ && __GNUC__ && __GNUC__ >= 2
681 int __xstat64(
int ver,
const char *path,
struct stat64 *buf)
696 #if !defined(__solaris__)
770 ssize_t
write(
int fildes,
const void *buf,
size_t nbyte)
784 ssize_t
writev(
int fildes,
const struct iovec *
iov,
int iovcnt)
int stat(const char *path, struct stat *buf)
int statvfs(const char *path, struct statvfs *buf)
int statfs(const char *path, struct statfs *buf)
int chdir(const char *path)
ssize_t pwrite64(int fildes, const void *buf, size_t nbyte, off_t offset)
off64_t lseek64(int fildes, off64_t offset, int whence)
offset_t llseek(int fildes, offset_t offset, int whence)
int fseeko64(FILE *stream, off64_t offset, int whence)
int statvfs64(const char *path, struct statvfs64 *buf)
int acl(const char *path, int cmd, int nentries, void *aclbufp)
int unlink(const char *path)
off64_t ftello64(FILE *stream)
ssize_t pread64(int fildes, void *buf, size_t nbyte, off_t offset)
size_t fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream)
int truncate64(const char *path, off_t offset)
size_t fread(void *ptr, size_t size, size_t nitems, FILE *stream)
int rename(const char *oldpath, const char *newpath)
int fcntl64(int fd, int cmd,...)
FILE * fopen64(const char *path, const char *mode)
int mkdir(const char *path, mode_t mode)
int fseek(FILE *stream, long offset, int whence)
int statfs64(const char *path, struct statfs64 *buf)
ssize_t readv(int fildes, const struct iovec *iov, int iovcnt)
void seekdir(DIR *dirp, long loc)
int readdir64_r(DIR *dirp, struct dirent64 *entry, struct dirent64 **result)
int fstat64(int fildes, struct stat64 *buf)
struct dirent64 * readdir64(DIR *dirp)
int ftruncate64(int fildes, off_t offset)
ssize_t write(int fildes, const void *buf, size_t nbyte)
long pathconf(const char *path, int name)
int access(const char *path, int amode)
int rmdir(const char *path)
ssize_t writev(int fildes, const struct iovec *iov, int iovcnt)
int creat64(const char *path, mode_t mode)
int lstat64(const char *path, struct stat64 *buf)
int open64(const char *path, int oflag,...)
ssize_t read(int fildes, void *buf, size_t nbyte)
int fdatasync(int fildes)
int stat64(const char *path, struct stat64 *buf)
DIR * opendir(const char *path)
int XrdPosix_Statfs(const char *path, struct statfs *buf)
long long XrdPosix_Pread(int fildes, void *buf, unsigned long long nbyte, long long offset)
long long XrdPosix_Write(int fildes, const void *buf, unsigned long long nbyte)
long long XrdPosix_Lseek(int fildes, long long offset, int whence)
long long XrdPosix_Writev(int fildes, const struct iovec *iov, int iovcnt)
int XrdPosix_Closedir(DIR *dirp)
int XrdPosix_Fsync(int fildes)
long long XrdPosix_Ftello(FILE *stream)
int XrdPosix_Open(const char *path, int oflag,...)
void XrdPosix_Rewinddir(DIR *dirp)
long long XrdPosix_Readv(int fildes, const struct iovec *iov, int iovcnt)
int XrdPosix_Readdir64_r(DIR *dirp, struct dirent64 *entry, struct dirent64 **result)
int XrdPosix_Close(int fildes)
void XrdPosix_Seekdir(DIR *dirp, long loc)
int XrdPosix_Rmdir(const char *path)
int XrdPosix_Chdir(const char *path)
FILE * XrdPosix_Fopen(const char *path, const char *mode)
int XrdPosix_Stat(const char *path, struct stat *buf)
int XrdPosix_Rename(const char *oldpath, const char *newpath)
int XrdPosix_Fcntl(int fd, int cmd,...)
int XrdPosix_Fseek(FILE *stream, long offset, int whence)
long XrdPosix_Ftell(FILE *stream)
long long XrdPosix_Pwrite(int fildes, const void *buf, unsigned long long nbyte, long long offset)
int XrdPosix_Mkdir(const char *path, mode_t mode)
long long XrdPosix_Read(int fildes, void *buf, unsigned long long nbyte)
int XrdPosix_Fflush(FILE *stream)
DIR * XrdPosix_Opendir(const char *path)
long XrdPosix_Telldir(DIR *dirp)
int XrdPosix_Lstat(const char *path, struct stat *buf)
int XrdPosix_Creat(const char *path, mode_t mode)
int XrdPosix_Statvfs(const char *path, struct statvfs *buf)
int XrdPosix_Acl(const char *path, int cmd, int nentries, void *aclbufp)
int XrdPosix_Fstat(int fildes, struct stat *buf)
size_t XrdPosix_Fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream)
int XrdPosix_Fclose(FILE *stream)
int XrdPosix_Fdatasync(int fildes)
int XrdPosix_Ftruncate(int fildes, long long offset)
struct dirent64 * XrdPosix_Readdir64(DIR *dirp)
long XrdPosix_Pathconf(const char *path, int name)
int XrdPosix_Truncate(const char *path, long long offset)
int XrdPosix_Unlink(const char *path)
size_t XrdPosix_Fread(void *ptr, size_t size, size_t nitems, FILE *stream)
int XrdPosix_Fseeko(FILE *stream, long long offset, int whence)
int XrdPosix_Access(const char *path, int amode)
Retv_Opendir(* Opendir)(Args_Opendir)
Retv_Mkdir(* Mkdir)(Args_Mkdir)
Retv_Readdir64(* Readdir64)(Args_Readdir64)
Retv_Rename(* Rename)(Args_Rename)
Retv_Rewinddir(* Rewinddir)(Args_Rewinddir)
Retv_Telldir(* Telldir)(Args_Telldir)
Retv_Readdir64_r(* Readdir64_r)(Args_Readdir64_r)
Retv_Seekdir(* Seekdir)(Args_Seekdir)
Retv_Chdir(* Chdir)(Args_Chdir)
Retv_Closedir(* Closedir)(Args_Closedir)
Retv_Rmdir(* Rmdir)(Args_Rmdir)
Retv_Unlink(* Unlink)(Args_Unlink)