1 #ifndef __XRDPOSIXXROOTD_H__
2 #define __XRDPOSIXXROOTD_H__
38 #include <sys/statvfs.h>
39 #include <sys/types.h>
41 #if defined(__APPLE__) || defined(__FreeBSD__)
42 #include <sys/param.h>
43 #include <sys/mount.h>
45 #include <sys/statfs.h>
73 static int Access(
const char *path,
int amode);
79 static int Close(
int fildes);
98 static int endPoint(
int FD,
char *Buff,
int Blen);
104 static int Fstat(
int fildes,
struct stat *buf);
110 static int Fsync(
int fildes);
118 static int Ftruncate(
int fildes, off_t offset);
139 static long long Getxattr (
const char *path,
const char *name,
140 void *value,
unsigned long long size);
146 static off_t
Lseek(
int fildes, off_t offset,
int whence);
152 static int Mkdir(
const char *path, mode_t mode);
168 static int Open(
const char *path,
int oflag, mode_t mode=0,
175 static DIR*
Opendir(
const char *path);
181 static ssize_t
Pread(
int fildes,
void *buf,
size_t nbyte, off_t offset);
183 static void Pread(
int fildes,
void *buf,
size_t nbyte, off_t offset,
190 static ssize_t
Pwrite(
int fildes,
const void *buf,
size_t nbyte, off_t offset);
192 static void Pwrite(
int fildes,
const void *buf,
size_t nbyte, off_t offset,
208 static int QueryChksum(
const char *path, time_t &mtime,
209 char *buff,
int blen);
228 static int QueryError(std::string&
emsg,
int fd=-1,
bool reset=
true);
230 static int QueryError(std::string&
emsg, DIR* dirP,
bool reset=
true);
244 static long long QueryOpaque(
const char *path,
char *buff,
int blen);
250 static ssize_t
Read(
int fildes,
void *buf,
size_t nbyte);
256 static ssize_t
Readv(
int fildes,
const struct iovec *
iov,
int iovcnt);
264 static struct dirent*
Readdir (DIR *dirp);
265 static struct dirent64*
Readdir64(DIR *dirp);
273 static int Readdir_r (DIR *dirp,
struct dirent *entry,
struct dirent **result);
274 static int Readdir64_r(DIR *dirp,
struct dirent64 *entry,
struct dirent64 **result);
280 static int Rename(
const char *oldpath,
const char *newpath);
292 static int Rmdir(
const char *path);
298 static void Seekdir(DIR *dirp,
long loc);
304 static int Stat(
const char *path,
struct stat *buf);
311 static int Statfs(
const char *path,
struct statfs *buf);
323 static long Telldir(DIR *dirp);
329 static int Truncate(
const char *path, off_t offset);
335 static int Unlink(
const char *path);
358 static ssize_t
Write(
int fildes,
const void *buf,
size_t nbyte);
364 static ssize_t
Writev(
int fildes,
const struct iovec *
iov,
int iovcnt);
375 static bool myFD(
int fd);
393 static int Fault(
XrdPosixFile *fp,
int ecode,
const char *msg=0);
395 static int Open(
const char *path,
int oflag, mode_t mode,
400 static int EcRename(
const char*,
const char*,
XrdPosixAdmin&);
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 emsg(int rc, char *msg)
An abstract class to define a callback for Open() call.
POSIX interface to XRootD with some extensions, as noted.
static ssize_t Readv(int fildes, const struct iovec *iov, int iovcnt)
Readv() conforms to POSIX.1-2001 readv()
static ssize_t Pread(int fildes, void *buf, size_t nbyte, off_t offset)
Pread() conforms to POSIX.1-2001 pread()
static int Closedir(DIR *dirp)
Closedir() conforms to POSIX.1-2001 closedir()
static void Seekdir(DIR *dirp, long loc)
Seekdir() conforms to POSIX.1-2001 seekdir()
static const int isStream
static int Stat(const char *path, struct stat *buf)
Stat() conforms to POSIX.1-2001 stat()
static int QueryChksum(const char *path, time_t &mtime, char *buff, int blen)
static int Mkdir(const char *path, mode_t mode)
Mkdir() conforms to POSIX.1-2001 mkdir()
static int Unlink(const char *path)
Unlink() conforms to POSIX.1-2001 unlink()
static int Rmdir(const char *path)
Rmdir() conforms to POSIX.1-2001 rmdir()
static void Rewinddir(DIR *dirp)
Rewinddir() conforms to POSIX.1-2001 rewinddir()
static void VRead(int fildes, const XrdOucIOVec *readV, int n, XrdPosixCallBackIO *cbp)
static int Rename(const char *oldpath, const char *newpath)
Rename() conforms to POSIX.1-2001 rename()
static int Close(int fildes)
Close() conforms to POSIX.1-2001 close()
static int Statvfs(const char *path, struct statvfs *buf)
Statvfs() conforms to POSIX.1-2001 statvfs()
static int endPoint(int FD, char *Buff, int Blen)
static ssize_t Write(int fildes, const void *buf, size_t nbyte)
Write() conforms to POSIX.1-2001 write()
static struct dirent * Readdir(DIR *dirp)
static int Readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)
static ssize_t Writev(int fildes, const struct iovec *iov, int iovcnt)
Writev() conforms to POSIX.1-2001 writev()
static int QueryError(std::string &emsg, int fd=-1, bool reset=true)
static struct dirent64 * Readdir64(DIR *dirp)
XrdPosixXrootd(int maxfd=255, int maxdir=0, int maxthr=0)
static int Ftruncate(int fildes, off_t offset)
Ftruncate() conforms to POSIX.1-2001 ftruncate()
static long Telldir(DIR *dirp)
Telldir() conforms to POSIX.1-2001 telldir()
static bool isXrootdDir(DIR *dirp)
static int Access(const char *path, int amode)
Access() conforms to POSIX.1-2001 access()
static DIR * Opendir(const char *path)
Opendir() conforms to POSIX.1-2001 opendir()
static int Fsync(int fildes)
Fsync() conforms to POSIX.1-2001 fsync()
static long long Getxattr(const char *path, const char *name, void *value, unsigned long long size)
static long long QueryOpaque(const char *path, char *buff, int blen)
static int Statfs(const char *path, struct statfs *buf)
static int Readdir64_r(DIR *dirp, struct dirent64 *entry, struct dirent64 **result)
static ssize_t Read(int fildes, void *buf, size_t nbyte)
Read() conforms to POSIX.1-2001 read()
static int Fstat(int fildes, struct stat *buf)
Fstat() conforms to POSIX.1-2001 fstat()
static off_t Lseek(int fildes, off_t offset, int whence)
Lseek() conforms to POSIX.1-2001 lseek()
static int Open(const char *path, int oflag, mode_t mode=0, XrdPosixCallBack *cbP=0)
static ssize_t Pwrite(int fildes, const void *buf, size_t nbyte, off_t offset)
Pwrite() conforms to POSIX.1-2001 pwrite()
static int Truncate(const char *path, off_t offset)
Telldir() conforms to POSIX.1-2001 telldir()