31 #if defined(__clang__) && defined(_FORTIFY_SOURCE)
32 #undef _FORTIFY_SOURCE
35 #if defined(__APPLE__)
36 #define _DARWIN_USE_64_BIT_INODE 1
39 #include <sys/types.h>
75 namespace {
bool isLite = (getenv(
"XRD_POSIX_PRELOAD_LITE") != 0);}
83 int access(
const char *path,
int amode)
99 int acl(
const char *path,
int cmd,
int nentries,
void *aclbufp)
190 theArg = va_arg(ap,
void *);
200 #if !defined(__APPLE__)
232 FILE *
fopen64(
const char *path,
const char *mode)
246 size_t fread(
void *ptr,
size_t size,
size_t nitems, FILE *stream)
260 int fseek(FILE *stream,
long offset,
int whence)
274 int fseeko64(FILE *stream, off64_t offset,
int whence)
288 #if defined(__linux__) and defined(_STAT_VER) and __GNUC__ and __GNUC__ >= 2
289 int __fxstat64(
int ver,
int fildes,
struct stat64 *buf)
296 #if defined(__linux__) and defined(_STAT_VER)
297 return XrdPosix_FstatV(ver, fildes, (
struct stat *)buf);
366 size_t fwrite(
const void *ptr,
size_t size,
size_t nitems, FILE *stream)
378 #if defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
381 ssize_t fgetxattr (
int fd,
const char *name,
void *value,
size_t size)
385 return XrdPosix_Fgetxattr(fd, name, value, size);
394 #if defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
397 ssize_t getxattr (
const char *path,
const char *name,
void *value,
size_t size)
401 return XrdPosix_Getxattr(path, name, value, size);
410 #if defined(__linux__) || defined(__GNU__) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
413 ssize_t lgetxattr (
const char *path,
const char *name,
void *value,
size_t size)
417 return XrdPosix_Lgetxattr(path, name, value, size);
428 off64_t
lseek64(
int fildes, off64_t offset,
int whence)
442 #if defined(__linux__) || defined(__APPLE__)
443 off_t
llseek(
int fildes, off_t offset,
int whence)
445 offset_t
llseek(
int fildes, offset_t offset,
int whence)
460 #if defined __linux__ && __GNUC__ && __GNUC__ >= 2
461 int __lxstat64(
int ver,
const char *path,
struct stat64 *buf)
478 int mkdir(
const char *path, mode_t mode)
492 int open64(
const char *path,
int oflag, ...)
499 mode = va_arg(ap,
int);
541 ssize_t
pread64(
int fildes,
void *buf,
size_t nbyte, off_t offset)
555 ssize_t
pwrite64(
int fildes,
const void *buf,
size_t nbyte, off_t offset)
569 ssize_t
read(
int fildes,
void *buf,
size_t nbyte)
583 ssize_t
readv(
int fildes,
const struct iovec *
iov,
int iovcnt)
611 int readdir64_r(DIR *dirp,
struct dirent64 *entry,
struct dirent64 **result)
626 int rename(
const char *oldpath,
const char *newpath)
684 #if defined __linux__ && __GNUC__ && __GNUC__ >= 2
685 int __xstat64(
int ver,
const char *path,
struct stat64 *buf)
700 #if !defined(__solaris__)
774 ssize_t
write(
int fildes,
const void *buf,
size_t nbyte)
788 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)
void rewinddir(DIR *dirp)
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)