1 #ifndef __XRDPOSIXXROOTD_H__
2 #define __XRDPOSIXXROOTD_H__
37 #include <sys/statvfs.h>
38 #include <sys/types.h>
40 #if defined(__APPLE__) || defined(__FreeBSD__)
41 #include <sys/param.h>
42 #include <sys/mount.h>
44 #include <sys/statfs.h>
74 static int Access(
const char *path,
int amode);
80 static int Close(
int fildes);
99 static int endPoint(
int FD,
char *Buff,
int Blen);
105 static int Fstat(
int fildes,
struct stat *buf);
111 static int Fsync(
int fildes);
119 static int Ftruncate(
int fildes, off_t offset);
140 static long long Getxattr (
const char *path,
const char *name,
141 void *value,
unsigned long long size);
147 static off_t
Lseek(
int fildes, off_t offset,
int whence);
153 static int Mkdir(
const char *path, mode_t mode);
169 static int Open(
const char *path,
int oflag, mode_t mode=0,
176 static DIR*
Opendir(
const char *path);
182 static ssize_t
Pread(
int fildes,
void *buf,
size_t nbyte, off_t offset);
184 static void Pread(
int fildes,
void *buf,
size_t nbyte, off_t offset,
191 static ssize_t
Pwrite(
int fildes,
const void *buf,
size_t nbyte, off_t offset);
193 static void Pwrite(
int fildes,
const void *buf,
size_t nbyte, off_t offset,
209 static int QueryChksum(
const char *path, time_t &mtime,
210 char *buff,
int blen);
224 static long long QueryOpaque(
const char *path,
char *buff,
int blen);
230 static ssize_t
Read(
int fildes,
void *buf,
size_t nbyte);
236 static ssize_t
Readv(
int fildes,
const struct iovec *iov,
int iovcnt);
244 static struct dirent*
Readdir (DIR *dirp);
245 static struct dirent64*
Readdir64(DIR *dirp);
253 static int Readdir_r (DIR *dirp,
struct dirent *entry,
struct dirent **result);
254 static int Readdir64_r(DIR *dirp,
struct dirent64 *entry,
struct dirent64 **result);
260 static int Rename(
const char *oldpath,
const char *newpath);
272 static int Rmdir(
const char *path);
278 static void Seekdir(DIR *dirp,
long loc);
284 static int Stat(
const char *path,
struct stat *buf);
291 static int Statfs(
const char *path,
struct statfs *buf);
297 static int Statvfs(
const char *path,
struct statvfs *buf);
303 static long Telldir(DIR *dirp);
309 static int Truncate(
const char *path, off_t offset);
315 static int Unlink(
const char *path);
341 static ssize_t
Write(
int fildes,
const void *buf,
size_t nbyte);
347 static ssize_t
Writev(
int fildes,
const struct iovec *iov,
int iovcnt);
358 static bool myFD(
int fd);
379 static void setCache(XrdOucCache2 *cP);
380 static void setDebug(
int val,
bool doDebug=
false);
381 static void setEnv(
const char *kword,
int kval);
382 static void setIPV4(
bool userv4);
390 static int Fault(XrdPosixFile *fp,
int ecode);
391 static void initStat(
struct stat *buf);
392 static void initXdev(dev_t &st_dev, dev_t &st_rdev);
static int baseFD
Definition: XrdPosixXrootd.hh:394
static int Statvfs(const char *path, struct statvfs *buf)
Statvfs() conforms to POSIX.1-2001 statvfs()
static int Ftruncate(int fildes, off_t offset)
Ftruncate() conforms to POSIX.1-2001 ftruncate()
static ssize_t Readv(int fildes, const struct iovec *iov, int iovcnt)
Readv() conforms to POSIX.1-2001 readv()
static int Open(const char *path, int oflag, mode_t mode=0, XrdPosixCallBack *cbP=0)
static const int isStream
Definition: XrdPosixXrootd.hh:167
static long Telldir(DIR *dirp)
Telldir() conforms to POSIX.1-2001 telldir()
static long long Getxattr(const char *path, const char *name, void *value, unsigned long long size)
int fdOrigin()
Definition: XrdPosixXrootd.hh:354
static long long QueryOpaque(const char *path, char *buff, int blen)
static void setLogger(XrdSysLogger *logP)
static ssize_t Pread(int fildes, void *buf, size_t nbyte, off_t offset)
Pread() conforms to POSIX.1-2001 pread()
static void setNumCB(int numcb)
Definition: XrdOucName2Name.hh:48
static ssize_t Write(int fildes, const void *buf, size_t nbyte)
Write() conforms to POSIX.1-2001 write()
static int Unlink(const char *path)
Unlink() conforms to POSIX.1-2001 unlink()
static int Access(const char *path, int amode)
Access() conforms to POSIX.1-2001 access()
XrdPosixXrootd(int maxfd=255, int maxdir=0, int maxthr=0)
static int Stat(const char *path, struct stat *buf)
Stat() conforms to POSIX.1-2001 stat()
Definition: XrdScheduler.hh:44
static int Fsync(int fildes)
Fsync() conforms to POSIX.1-2001 fsync()
static int Truncate(const char *path, off_t offset)
Telldir() conforms to POSIX.1-2001 telldir()
Definition: XrdOucCache.hh:340
static ssize_t Pwrite(int fildes, const void *buf, size_t nbyte, off_t offset)
Pwrite() conforms to POSIX.1-2001 pwrite()
static void setIPV4(bool userv4)
static void setN2N(XrdOucName2Name *pN2N, int opts=0)
Definition: XrdOucEnv.hh:41
static void setEnv(const char *kword, int kval)
An abstract class to define a callback for Open() call.
Definition: XrdPosixCallBack.hh:51
Definition: XrdOucIOVec.hh:40
static int Close(int fildes)
Close() conforms to POSIX.1-2001 close()
static int Fault(XrdPosixFile *fp, int ecode)
static int QueryChksum(const char *path, time_t &mtime, char *buff, int blen)
POSIX interface to XRootD with some extensions, as noted.
Definition: XrdPosixXrootd.hh:66
static int initDone
Definition: XrdPosixXrootd.hh:395
static bool isXrootdDir(DIR *dirp)
static void initXdev(dev_t &st_dev, dev_t &st_rdev)
static struct dirent * Readdir(DIR *dirp)
static int Statfs(const char *path, struct statfs *buf)
static void setDebug(int val, bool doDebug=false)
static void VRead(int fildes, const XrdOucIOVec *readV, int n, XrdPosixCallBackIO *cbp)
static int Fstat(int fildes, struct stat *buf)
Fstat() conforms to POSIX.1-2001 fstat()
Definition: XrdSysLogger.hh:52
static int Readdir64_r(DIR *dirp, struct dirent64 *entry, struct dirent64 **result)
static int Closedir(DIR *dirp)
Closedir() conforms to POSIX.1-2001 closedir()
static int endPoint(int FD, char *Buff, int Blen)
static void Rewinddir(DIR *dirp)
Rewinddir() conforms to POSIX.1-2001 rewinddir()
static struct dirent64 * Readdir64(DIR *dirp)
static int Rename(const char *oldpath, const char *newpath)
Rename() conforms to POSIX.1-2001 rename()
static void setCache(XrdOucCache *cP)
static int Rmdir(const char *path)
Rmdir() conforms to POSIX.1-2001 rmdir()
Definition: XrdPosixCallBack.hh:75
static ssize_t Read(int fildes, void *buf, size_t nbyte)
Read() conforms to POSIX.1-2001 read()
static off_t Lseek(int fildes, off_t offset, int whence)
Lseek() conforms to POSIX.1-2001 lseek()
static void initStat(struct stat *buf)
static ssize_t Writev(int fildes, const struct iovec *iov, int iovcnt)
Writev() conforms to POSIX.1-2001 writev()
static void setSched(XrdScheduler *sP)
static void Seekdir(DIR *dirp, long loc)
Seekdir() conforms to POSIX.1-2001 seekdir()
static int Mkdir(const char *path, mode_t mode)
Mkdir() conforms to POSIX.1-2001 mkdir()
static DIR * Opendir(const char *path)
Opendir() conforms to POSIX.1-2001 opendir()
static int Readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)