xrootd
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Private Member Functions | Static Private Attributes | Friends | List of all members
XrdPosixXrootd Class Reference

POSIX interface to XRootD with some extensions, as noted. More...

#include <XrdPosixXrootd.hh>

Public Member Functions

int fdOrigin ()
 
 XrdPosixXrootd (int maxfd=255, int maxdir=0, int maxthr=0)
 
 ~XrdPosixXrootd ()
 

Static Public Member Functions

static int Access (const char *path, int amode)
 Access() conforms to POSIX.1-2001 access()
 
static int Close (int fildes)
 Close() conforms to POSIX.1-2001 close()
 
static int Closedir (DIR *dirp)
 Closedir() conforms to POSIX.1-2001 closedir()
 
static int endPoint (int FD, char *Buff, int Blen)
 
static int Fstat (int fildes, struct stat *buf)
 Fstat() conforms to POSIX.1-2001 fstat()
 
static int Fsync (int fildes)
 Fsync() conforms to POSIX.1-2001 fsync()
 
static void Fsync (int fildes, XrdPosixCallBackIO *cbp)
 
static int Ftruncate (int fildes, off_t offset)
 Ftruncate() conforms to POSIX.1-2001 ftruncate()
 
static long long Getxattr (const char *path, const char *name, void *value, unsigned long long size)
 
static off_t Lseek (int fildes, off_t offset, int whence)
 Lseek() conforms to POSIX.1-2001 lseek()
 
static int Mkdir (const char *path, mode_t mode)
 Mkdir() conforms to POSIX.1-2001 mkdir()
 
static int Open (const char *path, int oflag, mode_t mode=0, XrdPosixCallBack *cbP=0)
 
static DIR * Opendir (const char *path)
 Opendir() conforms to POSIX.1-2001 opendir()
 
static ssize_t Pread (int fildes, void *buf, size_t nbyte, off_t offset)
 Pread() conforms to POSIX.1-2001 pread()
 
static void Pread (int fildes, void *buf, size_t nbyte, off_t offset, XrdPosixCallBackIO *cbp)
 
static ssize_t Pwrite (int fildes, const void *buf, size_t nbyte, off_t offset)
 Pwrite() conforms to POSIX.1-2001 pwrite()
 
static void Pwrite (int fildes, const void *buf, size_t nbyte, off_t offset, XrdPosixCallBackIO *cbp)
 
static int QueryChksum (const char *path, time_t &mtime, char *buff, int blen)
 
static long long QueryOpaque (const char *path, char *buff, int blen)
 
static ssize_t Read (int fildes, void *buf, size_t nbyte)
 Read() conforms to POSIX.1-2001 read()
 
static ssize_t Readv (int fildes, const struct iovec *iov, int iovcnt)
 Readv() conforms to POSIX.1-2001 readv()
 
static struct dirent * Readdir (DIR *dirp)
 
static struct dirent64 * Readdir64 (DIR *dirp)
 
static int Readdir_r (DIR *dirp, struct dirent *entry, struct dirent **result)
 
static int Readdir64_r (DIR *dirp, struct dirent64 *entry, struct dirent64 **result)
 
static int Rename (const char *oldpath, const char *newpath)
 Rename() conforms to POSIX.1-2001 rename()
 
static void Rewinddir (DIR *dirp)
 Rewinddir() conforms to POSIX.1-2001 rewinddir()
 
static int Rmdir (const char *path)
 Rmdir() conforms to POSIX.1-2001 rmdir()
 
static void Seekdir (DIR *dirp, long loc)
 Seekdir() conforms to POSIX.1-2001 seekdir()
 
static int Stat (const char *path, struct stat *buf)
 Stat() conforms to POSIX.1-2001 stat()
 
static int Statfs (const char *path, struct statfs *buf)
 
static int Statvfs (const char *path, struct statvfs *buf)
 Statvfs() conforms to POSIX.1-2001 statvfs()
 
static long Telldir (DIR *dirp)
 Telldir() conforms to POSIX.1-2001 telldir()
 
static int Truncate (const char *path, off_t offset)
 Telldir() conforms to POSIX.1-2001 telldir()
 
static int Unlink (const char *path)
 Unlink() conforms to POSIX.1-2001 unlink()
 
static void VRead (int fildes, const XrdOucIOVec *readV, int n, XrdPosixCallBackIO *cbp)
 
static ssize_t VRead (int fildes, const XrdOucIOVec *readV, int n)
 
static ssize_t Write (int fildes, const void *buf, size_t nbyte)
 Write() conforms to POSIX.1-2001 write()
 
static ssize_t Writev (int fildes, const struct iovec *iov, int iovcnt)
 Writev() conforms to POSIX.1-2001 writev()
 
static bool isXrootdDir (DIR *dirp)
 
static bool myFD (int fd)
 

Static Public Attributes

static const int isStream = 0x40000000
 

Static Private Member Functions

static int Fault (XrdPosixFile *fp, int ecode)
 
static int Open (const char *path, int oflag, mode_t mode, XrdPosixCallBack *cbP, XrdPosixInfo *infoP)
 
static bool OpenCache (XrdPosixFile &file, XrdPosixInfo &Info)
 
static int EcRename (const char *, const char *, XrdPosixAdmin *)
 
static int EcStat (const char *, struct stat *, XrdPosixAdmin *)
 
static int EcUnlink (const char *, XrdPosixAdmin *)
 

Static Private Attributes

static int baseFD
 
static int initDone
 

Friends

class XrdPosixConfig
 
class XrdPosixExtra
 

Detailed Description

POSIX interface to XRootD with some extensions, as noted.

Constructor & Destructor Documentation

◆ XrdPosixXrootd()

XrdPosixXrootd::XrdPosixXrootd ( int  maxfd = 255,
int  maxdir = 0,
int  maxthr = 0 
)

◆ ~XrdPosixXrootd()

XrdPosixXrootd::~XrdPosixXrootd ( )

Member Function Documentation

◆ Access()

static int XrdPosixXrootd::Access ( const char *  path,
int  amode 
)
static

Access() conforms to POSIX.1-2001 access()

◆ Close()

static int XrdPosixXrootd::Close ( int  fildes)
static

Close() conforms to POSIX.1-2001 close()

◆ Closedir()

static int XrdPosixXrootd::Closedir ( DIR *  dirp)
static

Closedir() conforms to POSIX.1-2001 closedir()

◆ EcRename()

static int XrdPosixXrootd::EcRename ( const char *  ,
const char *  ,
XrdPosixAdmin  
)
staticprivate

◆ EcStat()

static int XrdPosixXrootd::EcStat ( const char *  ,
struct stat ,
XrdPosixAdmin  
)
staticprivate

◆ EcUnlink()

static int XrdPosixXrootd::EcUnlink ( const char *  ,
XrdPosixAdmin  
)
staticprivate

◆ endPoint()

static int XrdPosixXrootd::endPoint ( int  FD,
char *  Buff,
int  Blen 
)
static

endPoint() is a POSIX extension and returns the location of an open file.

Parameters
FDFile descriptor of an open file in question.
BuffPointer to the buffer to receive '<host>:<port>' of the server.
BlenSize of the buffer, it must be big enough for the result.
Returns
>= 0 The numeric port number of the data server.
-1 Call failed, errno has the reason.

◆ Fault()

static int XrdPosixXrootd::Fault ( XrdPosixFile fp,
int  ecode 
)
staticprivate

◆ fdOrigin()

int XrdPosixXrootd::fdOrigin ( )
inline

The following methods are considered private but defined as public to allow XrdPosix 'C' functions and XrdPss classes access private members.

References baseFD.

◆ Fstat()

static int XrdPosixXrootd::Fstat ( int  fildes,
struct stat buf 
)
static

Fstat() conforms to POSIX.1-2001 fstat()

◆ Fsync() [1/2]

static int XrdPosixXrootd::Fsync ( int  fildes)
static

Fsync() conforms to POSIX.1-2001 fsync()

◆ Fsync() [2/2]

static void XrdPosixXrootd::Fsync ( int  fildes,
XrdPosixCallBackIO cbp 
)
static

◆ Ftruncate()

static int XrdPosixXrootd::Ftruncate ( int  fildes,
off_t  offset 
)
static

Ftruncate() conforms to POSIX.1-2001 ftruncate()

◆ Getxattr()

static long long XrdPosixXrootd::Getxattr ( const char *  path,
const char *  name,
void *  value,
unsigned long long  size 
)
static

Getxattr() is a POSIX extension and conforms to Linux 2.4 getxattr(). This method returns attributes associated with a file. The format does not correspond to information returned by Linux. Refer to the XRootD protocol reference for the detailed description of the information returned.

Parameters
pathpointer to the path whose attributes are to be returned
namename of the attribute to be returned. Valid attributes are xrootd.cksum - file's checksum xrootd.space - space associated with the path xrootd.xattr - server specific extended attributes for path
valuepointer to the buffer to receive the attribute values.
sizesize of the buffer (value). If size is zero, only the maximum length of the attribute value is returned.
Returns
On success, a positive number is returned indicating the size of is extended attribute value. On failure, -1 is returned and errno

is set to indicate the reason.

◆ isXrootdDir()

static bool XrdPosixXrootd::isXrootdDir ( DIR *  dirp)
static

◆ Lseek()

static off_t XrdPosixXrootd::Lseek ( int  fildes,
off_t  offset,
int  whence 
)
static

Lseek() conforms to POSIX.1-2001 lseek()

◆ Mkdir()

static int XrdPosixXrootd::Mkdir ( const char *  path,
mode_t  mode 
)
static

Mkdir() conforms to POSIX.1-2001 mkdir()

◆ myFD()

static bool XrdPosixXrootd::myFD ( int  fd)
static

◆ Open() [1/2]

static int XrdPosixXrootd::Open ( const char *  path,
int  oflag,
mode_t  mode,
XrdPosixCallBack cbP,
XrdPosixInfo infoP 
)
staticprivate

◆ Open() [2/2]

static int XrdPosixXrootd::Open ( const char *  path,
int  oflag,
mode_t  mode = 0,
XrdPosixCallBack cbP = 0 
)
static

◆ OpenCache()

static bool XrdPosixXrootd::OpenCache ( XrdPosixFile file,
XrdPosixInfo Info 
)
staticprivate

◆ Opendir()

static DIR * XrdPosixXrootd::Opendir ( const char *  path)
static

Opendir() conforms to POSIX.1-2001 opendir()

◆ Pread() [1/2]

static ssize_t XrdPosixXrootd::Pread ( int  fildes,
void *  buf,
size_t  nbyte,
off_t  offset 
)
static

Pread() conforms to POSIX.1-2001 pread()

◆ Pread() [2/2]

static void XrdPosixXrootd::Pread ( int  fildes,
void *  buf,
size_t  nbyte,
off_t  offset,
XrdPosixCallBackIO cbp 
)
static

◆ Pwrite() [1/2]

static ssize_t XrdPosixXrootd::Pwrite ( int  fildes,
const void *  buf,
size_t  nbyte,
off_t  offset 
)
static

Pwrite() conforms to POSIX.1-2001 pwrite()

◆ Pwrite() [2/2]

static void XrdPosixXrootd::Pwrite ( int  fildes,
const void *  buf,
size_t  nbyte,
off_t  offset,
XrdPosixCallBackIO cbp 
)
static

◆ QueryChksum()

static int XrdPosixXrootd::QueryChksum ( const char *  path,
time_t &  mtime,
char *  buff,
int  blen 
)
static

QueryChksum() is a POSIX extension and returns a file's modification time and its associated checksum value.

Parameters
pathpath associated with the file whose checksum is wanted.
mtimewhere the file's modification time (st_mtime) is placed.
buffpointer to the buffer to hold the checksum value.
blenthe length of the buffer.
Returns
Upon success returns the length of the checksum response placed in buff. Otherwise, -1 is returned and errno appropriately set.

◆ QueryOpaque()

static long long XrdPosixXrootd::QueryOpaque ( const char *  path,
char *  buff,
int  blen 
)
static

QueryOpaque() is a POSIX extension and returns a file's implementation specific information.

Parameters
pathpath associated with the file whose information is wanted.
buffpointer to the buffer to hold the information.
blenthe length of the buffer.
Returns
Upon success returns the length of the checksum response placed in buff. Otherwise, -1 is returned and errno appropriately set.

◆ Read()

static ssize_t XrdPosixXrootd::Read ( int  fildes,
void *  buf,
size_t  nbyte 
)
static

Read() conforms to POSIX.1-2001 read()

◆ Readdir()

static struct dirent * XrdPosixXrootd::Readdir ( DIR *  dirp)
static

readdir() conforms to POSIX.1-2001 readdir() and is normally equivalent to readdir64(). The latter is provided for those platforms that require a specific 64-bit interface to directory information, which is now rare.

◆ Readdir64()

static struct dirent64 * XrdPosixXrootd::Readdir64 ( DIR *  dirp)
static

◆ Readdir64_r()

static int XrdPosixXrootd::Readdir64_r ( DIR *  dirp,
struct dirent64 *  entry,
struct dirent64 **  result 
)
static

◆ Readdir_r()

static int XrdPosixXrootd::Readdir_r ( DIR *  dirp,
struct dirent *  entry,
struct dirent **  result 
)
static

readdir_r() conforms to POSIX.1-2001 readdir_r() and is normally equivalent to readdir64_r(). The latter is provided for those platforms that require a specific 64-bit interface to directory information, which is now rare.

◆ Readv()

static ssize_t XrdPosixXrootd::Readv ( int  fildes,
const struct iovec *  iov,
int  iovcnt 
)
static

Readv() conforms to POSIX.1-2001 readv()

◆ Rename()

static int XrdPosixXrootd::Rename ( const char *  oldpath,
const char *  newpath 
)
static

Rename() conforms to POSIX.1-2001 rename()

◆ Rewinddir()

static void XrdPosixXrootd::Rewinddir ( DIR *  dirp)
static

Rewinddir() conforms to POSIX.1-2001 rewinddir()

◆ Rmdir()

static int XrdPosixXrootd::Rmdir ( const char *  path)
static

Rmdir() conforms to POSIX.1-2001 rmdir()

◆ Seekdir()

static void XrdPosixXrootd::Seekdir ( DIR *  dirp,
long  loc 
)
static

Seekdir() conforms to POSIX.1-2001 seekdir()

◆ Stat()

static int XrdPosixXrootd::Stat ( const char *  path,
struct stat buf 
)
static

Stat() conforms to POSIX.1-2001 stat()

◆ Statfs()

static int XrdPosixXrootd::Statfs ( const char *  path,
struct statfs buf 
)
static

Statfs() generally conforms to the platform-specific definition of statfs(). There is no specific POSIX specification for this call.

◆ Statvfs()

static int XrdPosixXrootd::Statvfs ( const char *  path,
struct statvfs buf 
)
static

Statvfs() conforms to POSIX.1-2001 statvfs()

◆ Telldir()

static long XrdPosixXrootd::Telldir ( DIR *  dirp)
static

Telldir() conforms to POSIX.1-2001 telldir()

◆ Truncate()

static int XrdPosixXrootd::Truncate ( const char *  path,
off_t  offset 
)
static

Telldir() conforms to POSIX.1-2001 telldir()

◆ Unlink()

static int XrdPosixXrootd::Unlink ( const char *  path)
static

Unlink() conforms to POSIX.1-2001 unlink()

◆ VRead() [1/2]

static ssize_t XrdPosixXrootd::VRead ( int  fildes,
const XrdOucIOVec readV,
int  n 
)
static

◆ VRead() [2/2]

static void XrdPosixXrootd::VRead ( int  fildes,
const XrdOucIOVec readV,
int  n,
XrdPosixCallBackIO cbp 
)
static

VRead() is a POSIX extension and allows one to read multiple chunks of a file in one operation.

Parameters
fildesfile descriptor of a file opened for reading.
readVthe read vector of offset/length/buffer triplets. Data at each offset of the specifiued length is placed in buffer.
nthe number of elements in the readV vector.
cbppointer to the callback object for async execution.

◆ Write()

static ssize_t XrdPosixXrootd::Write ( int  fildes,
const void *  buf,
size_t  nbyte 
)
static

Write() conforms to POSIX.1-2001 write()

◆ Writev()

static ssize_t XrdPosixXrootd::Writev ( int  fildes,
const struct iovec *  iov,
int  iovcnt 
)
static

Writev() conforms to POSIX.1-2001 writev()

Friends And Related Symbol Documentation

◆ XrdPosixConfig

friend class XrdPosixConfig
friend

◆ XrdPosixExtra

friend class XrdPosixExtra
friend

Member Data Documentation

◆ baseFD

int XrdPosixXrootd::baseFD
staticprivate

Referenced by fdOrigin().

◆ initDone

int XrdPosixXrootd::initDone
staticprivate

◆ isStream

const int XrdPosixXrootd::isStream = 0x40000000
static

Open() conforms to POSIX.1-2001 open() when extensions are not used.

Extensions:

Parameters
cbPPointer to a callback object. When specified, the open is performed in the background and the Comp[lete() is called when the Open() completes. See XrdPosixCallBack.hh for complete details.
Returns
-1 is always returned when cbP is specified. If the Open() was actually scheduled then errno will contain EINPROGRESS. Otherwise, the Open() immediately failed and errno contains the reason.

The documentation for this class was generated from the following file: