XRootD
Loading...
Searching...
No Matches
XrdPosixExtern.hh File Reference
#include <dirent.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include "XrdPosix/XrdPosixOsDep.hh"
+ Include dependency graph for XrdPosixExtern.hh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int XrdPosix_Access (const char *path, int amode)
 
int XrdPosix_Acl (const char *path, int cmd, int nentries, void *aclbufp)
 
int XrdPosix_Chdir (const char *path)
 
int XrdPosix_Close (int fildes)
 
int XrdPosix_Closedir (DIR *dirp)
 
int XrdPosix_Creat (const char *path, mode_t mode)
 
int XrdPosix_Fclose (FILE *stream)
 
int XrdPosix_Fcntl (int fd, int cmd,...)
 
int XrdPosix_Fdatasync (int fildes)
 
int XrdPosix_Fflush (FILE *stream)
 
FILE * XrdPosix_Fopen (const char *path, const char *mode)
 
size_t XrdPosix_Fread (void *ptr, size_t size, size_t nitems, FILE *stream)
 
int XrdPosix_Fseek (FILE *stream, long offset, int whence)
 
int XrdPosix_Fseeko (FILE *stream, off64_t offset, int whence)
 
int XrdPosix_Fstat (int fildes, struct stat *buf)
 
int XrdPosix_Fsync (int fildes)
 
long XrdPosix_Ftell (FILE *stream)
 
off64_t XrdPosix_Ftello (FILE *stream)
 
int XrdPosix_Ftruncate (int fildes, off64_t offset)
 
size_t XrdPosix_Fwrite (const void *ptr, size_t size, size_t nitems, FILE *stream)
 
int XrdPosix_isMyPath (const char *path)
 
off64_t XrdPosix_Lseek (int fildes, off64_t offset, int whence)
 
int XrdPosix_Lstat (const char *path, struct stat *buf)
 
int XrdPosix_Mkdir (const char *path, mode_t mode)
 
int XrdPosix_Open (const char *path, int oflag,...)
 
DIR * XrdPosix_Opendir (const char *path)
 
long XrdPosix_Pathconf (const char *path, int name)
 
ssize_t XrdPosix_Pread (int fildes, void *buf, size_t nbyte, off64_t offset)
 
ssize_t XrdPosix_Pwrite (int fildes, const void *buf, size_t nbyte, off64_t offset)
 
ssize_t XrdPosix_Read (int fildes, void *buf, size_t nbyte)
 
struct dirent * XrdPosix_Readdir (DIR *dirp)
 
struct dirent64 * XrdPosix_Readdir64 (DIR *dirp)
 
int XrdPosix_Readdir64_r (DIR *dirp, struct dirent64 *entry, struct dirent64 **result)
 
int XrdPosix_Readdir_r (DIR *dirp, struct dirent *entry, struct dirent **result)
 
long long XrdPosix_Readv (int fildes, const struct iovec *iov, int iovcnt)
 
int XrdPosix_Rename (const char *oname, const char *nname)
 
void XrdPosix_Rewinddir (DIR *dirp)
 
int XrdPosix_Rmdir (const char *path)
 
void XrdPosix_Seekdir (DIR *dirp, long loc)
 
int XrdPosix_Stat (const char *path, struct stat *buf)
 
int XrdPosix_Statfs (const char *path, struct statfs *buf)
 
int XrdPosix_Statvfs (const char *path, struct statvfs *buf)
 
long XrdPosix_Telldir (DIR *dirp)
 
int XrdPosix_Truncate (const char *path, off64_t offset)
 
int XrdPosix_Unlink (const char *path)
 
char * XrdPosix_URL (const char *path, char *buff, int blen)
 
ssize_t XrdPosix_Write (int fildes, const void *buf, size_t nbyte)
 
ssize_t XrdPosix_Writev (int fildes, const struct iovec *iov, int iovcnt)
 

Function Documentation

◆ XrdPosix_Access()

int XrdPosix_Access ( const char * path,
int amode )
extern

Definition at line 114 of file XrdPosix.cc.

115{
116 char *myPath, buff[2048];
117
118// Make sure a path was passed
119//
120 if (!path) {errno = EFAULT; return -1;}
121
122// Return the results of a mkdir of a Unix file system
123//
124 if (!(myPath = XrootPath.URL(path, buff, sizeof(buff))))
125 return Xunix.Access( path, amode);
126
127// Return the results of our version of access()
128//
129 return Xroot.Access(myPath, amode);
130}
XrdPosixXrootd Xroot
Definition XrdPosix.cc:50
XrdPosixXrootPath XrootPath
Definition XrdPosix.cc:52
XrdPosixLinkage Xunix
Retv_Access(* Access)(Args_Access)
char * URL(const char *path, char *buff, int blen)
static int Access(const char *path, int amode)
Access() conforms to POSIX.1-2001 access()

References XrdPosixLinkage::Access, XrdPosixXrootd::Access(), XrdPosixXrootPath::URL(), Xroot, XrootPath, and Xunix.

Referenced by access().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Acl()

int XrdPosix_Acl ( const char * path,
int cmd,
int nentries,
void * aclbufp )
extern

Definition at line 141 of file XrdPosix.cc.

142{
143 return (XrootPath.URL(path, 0, 0)
144 ? Xunix.Acl("/tmp", cmd,nentries,aclbufp)
145 : Xunix.Acl(path, cmd,nentries,aclbufp));
146}
Retv_Acl(* Acl)(Args_Acl)

References XrdPosixLinkage::Acl, XrdPosixXrootPath::URL(), XrootPath, and Xunix.

Referenced by acl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Chdir()

int XrdPosix_Chdir ( const char * path)
extern

Definition at line 155 of file XrdPosix.cc.

156{
157 int rc;
158
159// Set the working directory if the actual chdir succeeded
160//
161 if (!(rc = Xunix.Chdir(path))) XrootPath.CWD(path);
162 return rc;
163}
Retv_Chdir(* Chdir)(Args_Chdir)
void CWD(const char *path)

References XrdPosixLinkage::Chdir, XrdPosixXrootPath::CWD(), XrootPath, and Xunix.

Referenced by chdir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Close()

int XrdPosix_Close ( int fildes)
extern

Definition at line 172 of file XrdPosix.cc.

173{
174
175// Return result of the close
176//
177 return (Xroot.myFD(fildes) ? Xroot.Close(fildes) : Xunix.Close(fildes));
178}
Retv_Close(* Close)(Args_Close)
static int Close(int fildes)
Close() conforms to POSIX.1-2001 close()
static bool myFD(int fd)

References XrdPosixLinkage::Close, XrdPosixXrootd::Close(), XrdPosixXrootd::myFD(), Xroot, and Xunix.

Referenced by close().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Closedir()

int XrdPosix_Closedir ( DIR * dirp)
extern

Definition at line 187 of file XrdPosix.cc.

188{
189
190 return (Xroot.isXrootdDir(dirp) ? Xroot.Closedir(dirp)
191 : Xunix.Closedir(dirp));
192}
Retv_Closedir(* Closedir)(Args_Closedir)
static int Closedir(DIR *dirp)
Closedir() conforms to POSIX.1-2001 closedir()
static bool isXrootdDir(DIR *dirp)

References XrdPosixLinkage::Closedir, XrdPosixXrootd::Closedir(), XrdPosixXrootd::isXrootdDir(), Xroot, and Xunix.

Referenced by closedir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Creat()

int XrdPosix_Creat ( const char * path,
mode_t mode )
extern

Definition at line 201 of file XrdPosix.cc.

202{
203 extern int XrdPosix_Open(const char *path, int oflag, ...);
204
205 return XrdPosix_Open(path, O_WRONLY | O_CREAT | O_TRUNC, mode);
206}
int XrdPosix_Open(const char *path, int oflag,...)
Definition XrdPosix.cc:642

References XrdPosix_Open().

Referenced by creat64().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Fclose()

int XrdPosix_Fclose ( FILE * stream)
extern

Definition at line 215 of file XrdPosix.cc.

216{
217 int nullfd = fileno(stream);
218
219// Close the associated file
220//
221 if (Xroot.myFD(nullfd)) Xroot.Close(nullfd);
222
223// Now close the stream
224//
225 return Xunix.Fclose(stream);
226}
Retv_Fclose(* Fclose)(Args_Fclose)

References XrdPosixXrootd::Close(), XrdPosixLinkage::Fclose, XrdPosixXrootd::myFD(), Xroot, and Xunix.

Referenced by fclose().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Fcntl()

int XrdPosix_Fcntl ( int fd,
int cmd,
... )
extern

Definition at line 235 of file XrdPosix.cc.

236{
237 va_list ap;
238 void *theArg;
239
240 if (Xroot.myFD(fd)) return 0;
241 va_start(ap, cmd);
242 theArg = va_arg(ap, void *);
243 va_end(ap);
244 return Xunix.Fcntl64(fd, cmd, theArg);
245}
Retv_Fcntl64(* Fcntl64)(Args_Fcntl64)

References XrdPosixLinkage::Fcntl64, XrdPosixXrootd::myFD(), Xroot, and Xunix.

Referenced by fcntl64().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Fdatasync()

int XrdPosix_Fdatasync ( int fildes)
extern

Definition at line 254 of file XrdPosix.cc.

255{
256
257// Return the result of the sync
258//
259 return (Xroot.myFD(fildes) ? Xroot.Fsync(fildes)
260 : Xunix.Fsync(fildes));
261}
Retv_Fsync(* Fsync)(Args_Fsync)
static int Fsync(int fildes)
Fsync() conforms to POSIX.1-2001 fsync()

References XrdPosixLinkage::Fsync, XrdPosixXrootd::Fsync(), XrdPosixXrootd::myFD(), Xroot, and Xunix.

Referenced by fdatasync().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Fflush()

int XrdPosix_Fflush ( FILE * stream)
extern

Definition at line 286 of file XrdPosix.cc.

287{
288
289// Return the result of the fseek
290//
291 if (!stream || !Xroot.myFD(fileno(stream)))
292 return Xunix.Fflush(stream);
293
294 return Xroot.Fsync(fileno(stream));
295}
Retv_Fflush(* Fflush)(Args_Fflush)

References XrdPosixLinkage::Fflush, XrdPosixXrootd::Fsync(), XrdPosixXrootd::myFD(), Xroot, and Xunix.

Referenced by fflush().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Fopen()

FILE * XrdPosix_Fopen ( const char * path,
const char * mode )
extern

Definition at line 306 of file XrdPosix.cc.

307{
308 char *myPath, buff[2048];
309 int erc, fd, omode;
310 FILE *stream;
311
312// Transfer to unix if this is not our path
313//
314 if (!(myPath = XrootPath.URL(path, buff, sizeof(buff))))
315 return Xunix.Fopen64(path, mode);
316
317// Translate the mode flags
318//
319 if (ISMODE("r") || ISMODE("rb")) omode = O_RDONLY;
320 else if (ISMODE("w") || ISMODE("wb")) omode = O_WRONLY
321 | O_CREAT | O_TRUNC;
322 else if (ISMODE("a") || ISMODE("ab")) omode = O_WRONLY
323 | O_CREAT | O_APPEND;
324 else if (ISMODE("r+") || ISMODE("rb+") || ISMODE("r+b")) omode = O_RDWR;
325 else if (ISMODE("w+") || ISMODE("wb+") || ISMODE("w+b")) omode = O_RDWR
326 | O_CREAT | O_TRUNC;
327 else if (ISMODE("a+") || ISMODE("ab+") || ISMODE("a+b")) omode = O_RDWR
328 | O_CREAT | O_APPEND;
329 else {errno = EINVAL; return 0;}
330
331// Now open the file
332//
333 if ((fd = Xroot.Open(myPath, omode | XrdPosixXrootd::isStream , 0)) < 0)
334 return 0;
335
336// First obtain a free stream
337//
338 if (!(stream = fdopen(fd, mode)))
339 {erc = errno; Xroot.Close(fd); errno = erc;}
340
341// All done
342//
343 return stream;
344}
#define ISMODE(x)
Definition XrdPosix.cc:302
Retv_Fopen64(* Fopen64)(Args_Fopen64)
static const int isStream
static int Open(const char *path, int oflag, mode_t mode=0, XrdPosixCallBack *cbP=0)

References XrdPosixXrootd::Close(), XrdPosixLinkage::Fopen64, ISMODE, XrdPosixXrootd::isStream, XrdPosixXrootd::Open(), XrdPosixXrootPath::URL(), Xroot, XrootPath, and Xunix.

Referenced by fopen64().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Fread()

size_t XrdPosix_Fread ( void * ptr,
size_t size,
size_t nitems,
FILE * stream )
extern

Definition at line 353 of file XrdPosix.cc.

354{
355 ssize_t bytes;
356 size_t rc = 0;
357 int fd = fileno(stream);
358
359 if (!Xroot.myFD(fd)) return Xunix.Fread(ptr, size, nitems, stream);
360
361 bytes = Xroot.Read(fd, ptr, size*nitems);
362
363// Get the right return code. Note that we cannot emulate the flags in sunx86
364//
365 if (bytes > 0 && size) rc = bytes/size;
366 else if (bytes < 0) fseterr(stream);
367 else fseteof(stream);
368
369 return rc;
370}
static void fseterr(FILE *fp)
Definition XrdPosix.cc:64
static void fseteof(FILE *fp)
Definition XrdPosix.cc:87
Retv_Fread(* Fread)(Args_Fread)
static ssize_t Read(int fildes, void *buf, size_t nbyte)
Read() conforms to POSIX.1-2001 read()

References XrdPosixLinkage::Fread, fseteof(), fseterr(), XrdPosixXrootd::myFD(), XrdPosixXrootd::Read(), Xroot, and Xunix.

Referenced by fread().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Fseek()

int XrdPosix_Fseek ( FILE * stream,
long offset,
int whence )
extern

Definition at line 379 of file XrdPosix.cc.

380{
381
382// Return the result of the fseek
383//
384 if (!Xroot.myFD(fileno(stream)))
385 return Xunix.Fseek( stream, offset, whence);
386
387 return (Xroot.Lseek(fileno(stream), offset, whence) < 0 ? -1 : 0);
388}
Retv_Fseek(* Fseek)(Args_Fseek)
static off_t Lseek(int fildes, off_t offset, int whence)
Lseek() conforms to POSIX.1-2001 lseek()

References XrdPosixLinkage::Fseek, XrdPosixXrootd::Lseek(), XrdPosixXrootd::myFD(), Xroot, and Xunix.

Referenced by fseek().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Fseeko()

int XrdPosix_Fseeko ( FILE * stream,
off64_t offset,
int whence )
extern

◆ XrdPosix_Fstat()

int XrdPosix_Fstat ( int fildes,
struct stat * buf )
extern

Definition at line 415 of file XrdPosix.cc.

416{
417
418// Return result of the close
419//
420 return (Xroot.myFD(fildes)
421 ? Xroot.Fstat(fildes, buf)
422#if defined(__linux__) and defined(_STAT_VER)
423 : Xunix.Fstat64(_STAT_VER, fildes, (struct stat64 *)buf));
424#else
425 : Xunix.Fstat64( fildes, (struct stat64 *)buf));
426#endif
427}
int stat64(const char *path, struct stat64 *buf)
Retv_Fstat64(* Fstat64)(Args_Fstat64)
static int Fstat(int fildes, struct stat *buf)
Fstat() conforms to POSIX.1-2001 fstat()

References XrdPosixXrootd::Fstat(), XrdPosixLinkage::Fstat64, XrdPosixXrootd::myFD(), stat64(), Xroot, and Xunix.

Referenced by fstat(), and fstat64().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Fsync()

int XrdPosix_Fsync ( int fildes)
extern

Definition at line 449 of file XrdPosix.cc.

450{
451
452// Return the result of the sync
453//
454 return (Xroot.myFD(fildes) ? Xroot.Fsync(fildes)
455 : Xunix.Fsync(fildes));
456}

References XrdPosixLinkage::Fsync, XrdPosixXrootd::Fsync(), XrdPosixXrootd::myFD(), Xroot, and Xunix.

Referenced by fsync().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Ftell()

long XrdPosix_Ftell ( FILE * stream)
extern

Definition at line 465 of file XrdPosix.cc.

466{
467
468// Return the result of the tell
469//
470 if (!Xroot.myFD(fileno(stream))) return Xunix.Ftell(stream);
471
472 return static_cast<long>(Xroot.Lseek(fileno(stream), 0, SEEK_CUR));
473}
Retv_Ftell(* Ftell)(Args_Ftell)

References XrdPosixLinkage::Ftell, XrdPosixXrootd::Lseek(), XrdPosixXrootd::myFD(), Xroot, and Xunix.

Referenced by ftell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Ftello()

off64_t XrdPosix_Ftello ( FILE * stream)
extern

Definition at line 482 of file XrdPosix.cc.

483{
484
485// Return the result of the tell
486//
487 if (!Xroot.myFD(fileno(stream))) return Xunix.Ftello64(stream);
488
489 return Xroot.Lseek(fileno(stream), 0, SEEK_CUR);
490}
Retv_Ftello64(* Ftello64)(Args_Ftello64)

References XrdPosixLinkage::Ftello64, XrdPosixXrootd::Lseek(), XrdPosixXrootd::myFD(), Xroot, and Xunix.

Referenced by ftello(), and ftello64().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Ftruncate()

int XrdPosix_Ftruncate ( int fildes,
off64_t offset )
extern

◆ XrdPosix_Fwrite()

size_t XrdPosix_Fwrite ( const void * ptr,
size_t size,
size_t nitems,
FILE * stream )
extern

Definition at line 515 of file XrdPosix.cc.

516{
517 size_t bytes, rc = 0;
518 int fd = fileno(stream);
519
520 if (!Xroot.myFD(fd)) return Xunix.Fwrite(ptr, size, nitems, stream);
521
522 bytes = Xroot.Write(fd, ptr, size*nitems);
523
524// Get the right return code.
525//
526 if (bytes > 0 && size) rc = bytes/size;
527 else fseterr(stream);
528
529 return rc;
530}
Retv_Fwrite(* Fwrite)(Args_Fwrite)
static ssize_t Write(int fildes, const void *buf, size_t nbyte)
Write() conforms to POSIX.1-2001 write()

References fseterr(), XrdPosixLinkage::Fwrite, XrdPosixXrootd::myFD(), XrdPosixXrootd::Write(), Xroot, and Xunix.

Referenced by fwrite().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_isMyPath()

int XrdPosix_isMyPath ( const char * path)
extern

Definition at line 1085 of file XrdPosix.cc.

1086{
1087 return (0 != XrootPath.URL(path, 0, 0));
1088}

References XrdPosixXrootPath::URL(), and XrootPath.

Referenced by lstat(), and stat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Lseek()

off64_t XrdPosix_Lseek ( int fildes,
off64_t offset,
int whence )
extern

◆ XrdPosix_Lstat()

int XrdPosix_Lstat ( const char * path,
struct stat * buf )
extern

Definition at line 591 of file XrdPosix.cc.

592{
593 char *myPath, buff[2048];
594
595// Make sure a path was passed
596//
597 if (!path) {errno = EFAULT; return -1;}
598
599// Return the results of an open of a Unix file
600//
601 return (!(myPath = XrootPath.URL(path, buff, sizeof(buff)))
602#if defined(__linux__) and defined(_STAT_VER)
603 ? Xunix.Lstat64(_STAT_VER, path, (struct stat64 *)buf)
604#else
605 ? Xunix.Lstat64( path, (struct stat64 *)buf)
606#endif
607 : Xroot.Stat(myPath, buf));
608}
Retv_Lstat64(* Lstat64)(Args_Lstat64)
static int Stat(const char *path, struct stat *buf)
Stat() conforms to POSIX.1-2001 stat()

References XrdPosixLinkage::Lstat64, XrdPosixXrootd::Stat(), stat64(), XrdPosixXrootPath::URL(), Xroot, XrootPath, and Xunix.

Referenced by lstat(), and lstat64().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Mkdir()

int XrdPosix_Mkdir ( const char * path,
mode_t mode )
extern

Definition at line 617 of file XrdPosix.cc.

618{
619 char *myPath, buff[2048];
620
621// Make sure a path was passed
622//
623 if (!path) {errno = EFAULT; return -1;}
624
625// Return the results of a mkdir of a Unix file system
626//
627 if (!(myPath = XrootPath.URL(path, buff, sizeof(buff))))
628 return Xunix.Mkdir(path, mode);
629
630// Return the results of an mkdir of an xrootd file system
631//
632 return Xroot.Mkdir(myPath, mode);
633}
Retv_Mkdir(* Mkdir)(Args_Mkdir)
static int Mkdir(const char *path, mode_t mode)
Mkdir() conforms to POSIX.1-2001 mkdir()

References XrdPosixLinkage::Mkdir, XrdPosixXrootd::Mkdir(), XrdPosixXrootPath::URL(), Xroot, XrootPath, and Xunix.

Referenced by mkdir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Open()

int XrdPosix_Open ( const char * path,
int oflag,
... )
extern

Definition at line 642 of file XrdPosix.cc.

643{
644 char *myPath, buff[2048];
645 va_list ap;
646 int mode;
647
648// Make sure a path was passed
649//
650 if (!path) {errno = EFAULT; return -1;}
651
652// Return the results of an open of a Unix file
653//
654 if (!(myPath = XrootPath.URL(path, buff, sizeof(buff))))
655 {if (!(oflag & O_CREAT)) return Xunix.Open64(path, oflag);
656 va_start(ap, oflag);
657 mode = va_arg(ap, int);
658 va_end(ap);
659 return Xunix.Open64(path, oflag, (mode_t)mode);
660 }
661
662// Return the results of an open of an xrootd file
663//
664 if (!(oflag & O_CREAT)) return Xroot.Open(myPath, oflag);
665 va_start(ap, oflag);
666 mode = va_arg(ap, int);
667 va_end(ap);
668 return Xroot.Open(myPath, oflag, (mode_t)mode);
669}
Retv_Open64(* Open64)(Args_Open64)

References XrdPosixXrootd::Open(), XrdPosixLinkage::Open64, XrdPosixXrootPath::URL(), Xroot, XrootPath, and Xunix.

Referenced by creat(), open(), open64(), and XrdPosix_Creat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Opendir()

DIR * XrdPosix_Opendir ( const char * path)
extern

Definition at line 678 of file XrdPosix.cc.

679{
680 char *myPath, buff[2048];
681
682// Make sure a path was passed
683//
684 if (!path) {errno = EFAULT; return 0;}
685
686// Unix opendir
687//
688 if (!(myPath = XrootPath.URL(path, buff, sizeof(buff))))
689 return Xunix.Opendir(path);
690
691// Xrootd opendir
692//
693 return Xroot.Opendir(myPath);
694}
Retv_Opendir(* Opendir)(Args_Opendir)
static DIR * Opendir(const char *path)
Opendir() conforms to POSIX.1-2001 opendir()

References XrdPosixLinkage::Opendir, XrdPosixXrootd::Opendir(), XrdPosixXrootPath::URL(), Xroot, XrootPath, and Xunix.

Referenced by opendir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Pathconf()

long XrdPosix_Pathconf ( const char * path,
int name )
extern

Definition at line 705 of file XrdPosix.cc.

706{
707 return (XrootPath.URL(path, 0, 0) ? Xunix.Pathconf("/tmp", name)
708 : Xunix.Pathconf(path, name));
709}
Retv_Pathconf(* Pathconf)(Args_Pathconf)

References XrdPosixLinkage::Pathconf, XrdPosixXrootPath::URL(), XrootPath, and Xunix.

Referenced by pathconf().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Pread()

ssize_t XrdPosix_Pread ( int fildes,
void * buf,
size_t nbyte,
off64_t offset )
extern

◆ XrdPosix_Pwrite()

ssize_t XrdPosix_Pwrite ( int fildes,
const void * buf,
size_t nbyte,
off64_t offset )
extern

◆ XrdPosix_Read()

ssize_t XrdPosix_Read ( int fildes,
void * buf,
size_t nbyte )
extern

◆ XrdPosix_Readdir()

struct dirent * XrdPosix_Readdir ( DIR * dirp)
extern

Definition at line 786 of file XrdPosix.cc.

787{
788
789// Return result of readdir
790//
791 return (Xroot.isXrootdDir(dirp) ? Xroot.Readdir(dirp)
792 : Xunix.Readdir(dirp));
793}
Retv_Readdir(* Readdir)(Args_Readdir)
static struct dirent * Readdir(DIR *dirp)

References XrdPosixXrootd::isXrootdDir(), XrdPosixLinkage::Readdir, XrdPosixXrootd::Readdir(), Xroot, and Xunix.

+ Here is the call graph for this function:

◆ XrdPosix_Readdir64()

struct dirent64 * XrdPosix_Readdir64 ( DIR * dirp)
extern

Definition at line 795 of file XrdPosix.cc.

796{
797
798// Return result of readdir
799//
800 return (Xroot.isXrootdDir(dirp) ? Xroot.Readdir64(dirp)
801 : Xunix.Readdir64(dirp));
802}
Retv_Readdir64(* Readdir64)(Args_Readdir64)
static struct dirent64 * Readdir64(DIR *dirp)

References XrdPosixXrootd::isXrootdDir(), XrdPosixLinkage::Readdir64, XrdPosixXrootd::Readdir64(), Xroot, and Xunix.

Referenced by readdir(), and readdir64().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Readdir64_r()

int XrdPosix_Readdir64_r ( DIR * dirp,
struct dirent64 * entry,
struct dirent64 ** result )
extern

Definition at line 820 of file XrdPosix.cc.

821{
822
823// Return result of readdir
824//
825 return (Xroot.isXrootdDir(dirp) ? Xroot.Readdir64_r(dirp,entry,result)
826 : Xunix.Readdir64_r(dirp,entry,result));
827}
Retv_Readdir64_r(* Readdir64_r)(Args_Readdir64_r)
static int Readdir64_r(DIR *dirp, struct dirent64 *entry, struct dirent64 **result)

References XrdPosixXrootd::isXrootdDir(), XrdPosixLinkage::Readdir64_r, XrdPosixXrootd::Readdir64_r(), Xroot, and Xunix.

Referenced by readdir64_r(), and readdir_r().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Readdir_r()

int XrdPosix_Readdir_r ( DIR * dirp,
struct dirent * entry,
struct dirent ** result )
extern

Definition at line 811 of file XrdPosix.cc.

812{
813
814// Return result of readdir
815//
816 return (Xroot.isXrootdDir(dirp) ? Xroot.Readdir_r(dirp,entry,result)
817 : Xunix.Readdir_r(dirp,entry,result));
818}
Retv_Readdir_r(* Readdir_r)(Args_Readdir_r)
static int Readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)

References XrdPosixXrootd::isXrootdDir(), XrdPosixLinkage::Readdir_r, XrdPosixXrootd::Readdir_r(), Xroot, and Xunix.

Referenced by readdir_r().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Readv()

long long XrdPosix_Readv ( int fildes,
const struct iovec * iov,
int iovcnt )
extern

Definition at line 768 of file XrdPosix.cc.

769{
770
771// Return results of the readv
772//
773 return (Xroot.myFD(fildes) ? Xroot.Readv(fildes, iov, iovcnt)
774 : Xunix.Readv(fildes, iov, iovcnt));
775}
Retv_Readv(* Readv)(Args_Readv)
static ssize_t Readv(int fildes, const struct iovec *iov, int iovcnt)
Readv() conforms to POSIX.1-2001 readv()

References XrdPosixXrootd::myFD(), XrdPosixLinkage::Readv, XrdPosixXrootd::Readv(), Xroot, and Xunix.

Referenced by readv().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Rename()

int XrdPosix_Rename ( const char * oname,
const char * nname )
extern

Definition at line 836 of file XrdPosix.cc.

837{
838 char *oldPath, buffold[2048], *newPath, buffnew[2048];
839
840// Make sure a path was passed
841//
842 if (!oldpath || !newpath) {errno = EFAULT; return -1;}
843
844// Return the results of a mkdir of a Unix file system
845//
846 if (!(oldPath = XrootPath.URL(oldpath, buffold, sizeof(buffold)))
847 || !(newPath = XrootPath.URL(newpath, buffnew, sizeof(buffnew))))
848 return Xunix.Rename(oldpath, newpath);
849
850// Return the results of an mkdir of an xrootd file system
851//
852 return Xroot.Rename(oldPath, newPath);
853}
Retv_Rename(* Rename)(Args_Rename)
static int Rename(const char *oldpath, const char *newpath)
Rename() conforms to POSIX.1-2001 rename()

References XrdPosixLinkage::Rename, XrdPosixXrootd::Rename(), XrdPosixXrootPath::URL(), Xroot, XrootPath, and Xunix.

Referenced by rename().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Rewinddir()

void XrdPosix_Rewinddir ( DIR * dirp)
extern

Definition at line 862 of file XrdPosix.cc.

863{
864
865// Return result of rewind
866//
867 return (Xroot.isXrootdDir(dirp) ? Xroot.Rewinddir(dirp)
868 : Xunix.Rewinddir(dirp));
869}
Retv_Rewinddir(* Rewinddir)(Args_Rewinddir)
static void Rewinddir(DIR *dirp)
Rewinddir() conforms to POSIX.1-2001 rewinddir()

References XrdPosixXrootd::isXrootdDir(), XrdPosixLinkage::Rewinddir, XrdPosixXrootd::Rewinddir(), Xroot, and Xunix.

Referenced by rewinddir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Rmdir()

int XrdPosix_Rmdir ( const char * path)
extern

Definition at line 878 of file XrdPosix.cc.

879{
880 char *myPath, buff[2048];
881
882// Make sure a path was passed
883//
884 if (!path) {errno = EFAULT; return -1;}
885
886// Return the results of a mkdir of a Unix file system
887//
888 if (!(myPath = XrootPath.URL(path, buff, sizeof(buff))))
889 return Xunix.Rmdir(path);
890
891// Return the results of an mkdir of an xrootd file system
892//
893 return Xroot.Rmdir(myPath);
894}
Retv_Rmdir(* Rmdir)(Args_Rmdir)
static int Rmdir(const char *path)
Rmdir() conforms to POSIX.1-2001 rmdir()

References XrdPosixLinkage::Rmdir, XrdPosixXrootd::Rmdir(), XrdPosixXrootPath::URL(), Xroot, XrootPath, and Xunix.

Referenced by rmdir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Seekdir()

void XrdPosix_Seekdir ( DIR * dirp,
long loc )
extern

Definition at line 903 of file XrdPosix.cc.

904{
905
906// Call seekdir
907//
908 (Xroot.isXrootdDir(dirp) ? Xroot.Seekdir(dirp, loc)
909 : Xunix.Seekdir(dirp, loc));
910}
Retv_Seekdir(* Seekdir)(Args_Seekdir)
static void Seekdir(DIR *dirp, long loc)
Seekdir() conforms to POSIX.1-2001 seekdir()

References XrdPosixXrootd::isXrootdDir(), XrdPosixLinkage::Seekdir, XrdPosixXrootd::Seekdir(), Xroot, and Xunix.

Referenced by seekdir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Stat()

int XrdPosix_Stat ( const char * path,
struct stat * buf )
extern

Definition at line 919 of file XrdPosix.cc.

920{
921 char *myPath, buff[2048];
922
923// Make sure a path was passed
924//
925 if (!path) {errno = EFAULT; return -1;}
926
927// Return the results of an open of a Unix file
928//
929 return (!(myPath = XrootPath.URL(path, buff, sizeof(buff)))
930#if defined(__linux__) and defined(_STAT_VER)
931 ? Xunix.Stat64(_STAT_VER, path, (struct stat64 *)buf)
932#else
933 ? Xunix.Stat64( path, (struct stat64 *)buf)
934#endif
935 : Xroot.Stat(myPath, buf));
936}
Retv_Stat64(* Stat64)(Args_Stat64)

References XrdPosixXrootd::Stat(), XrdPosixLinkage::Stat64, stat64(), XrdPosixXrootPath::URL(), Xroot, XrootPath, and Xunix.

Referenced by stat(), and stat64().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Statfs()

int XrdPosix_Statfs ( const char * path,
struct statfs * buf )
extern

Definition at line 945 of file XrdPosix.cc.

946{
947 char *myPath, buff[2048];
948
949// Make sure a path was passed
950//
951 if (!path) {errno = EFAULT; return -1;}
952
953// Return the results of an open of a Unix file
954//
955 return ((myPath = XrootPath.URL(path, buff, sizeof(buff)))
956 ? Xroot.Statfs(myPath, buf)
957 : Xunix.Statfs64(path, (struct statfs64 *)buf));
958}
int statfs64(const char *path, struct statfs64 *buf)
Retv_Statfs64(* Statfs64)(Args_Statfs64)
static int Statfs(const char *path, struct statfs *buf)

References XrdPosixXrootd::Statfs(), XrdPosixLinkage::Statfs64, statfs64(), XrdPosixXrootPath::URL(), Xroot, XrootPath, and Xunix.

Referenced by statfs(), and statfs64().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Statvfs()

int XrdPosix_Statvfs ( const char * path,
struct statvfs * buf )
extern

Definition at line 967 of file XrdPosix.cc.

968{
969 char *myPath, buff[2048];
970
971// Make sure a path was passed
972//
973 if (!path) {errno = EFAULT; return -1;}
974
975// Return the results of an open of a Unix file
976//
977 return ((myPath = XrootPath.URL(path, buff, sizeof(buff)))
978 ? Xroot.Statvfs(myPath, buf)
979 : Xunix.Statvfs64(path, (struct statvfs64 *)buf));
980}
int statvfs64(const char *path, struct statvfs64 *buf)
Retv_Statvfs64(* Statvfs64)(Args_Statvfs64)
static int Statvfs(const char *path, struct statvfs *buf)
Statvfs() conforms to POSIX.1-2001 statvfs()

References XrdPosixXrootd::Statvfs(), XrdPosixLinkage::Statvfs64, statvfs64(), XrdPosixXrootPath::URL(), Xroot, XrootPath, and Xunix.

Referenced by statvfs(), and statvfs64().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Telldir()

long XrdPosix_Telldir ( DIR * dirp)
extern

Definition at line 989 of file XrdPosix.cc.

990{
991
992// Return result of telldir
993//
994 return (Xroot.isXrootdDir(dirp) ? Xroot.Telldir(dirp)
995 : Xunix.Telldir(dirp));
996}
Retv_Telldir(* Telldir)(Args_Telldir)
static long Telldir(DIR *dirp)
Telldir() conforms to POSIX.1-2001 telldir()

References XrdPosixXrootd::isXrootdDir(), XrdPosixLinkage::Telldir, XrdPosixXrootd::Telldir(), Xroot, and Xunix.

Referenced by telldir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_Truncate()

int XrdPosix_Truncate ( const char * path,
off64_t offset )
extern

◆ XrdPosix_Unlink()

int XrdPosix_Unlink ( const char * path)
extern

Definition at line 1030 of file XrdPosix.cc.

1031{
1032 char *myPath, buff[2048];
1033
1034// Make sure a path was passed
1035//
1036 if (!path) {errno = EFAULT; return -1;}
1037
1038// Return the result of a unlink of a Unix file
1039//
1040 if (!(myPath = XrootPath.URL(path, buff, sizeof(buff))))
1041 return Xunix.Unlink(path);
1042
1043// Return the results of an unlink of an xrootd file
1044//
1045 return Xroot.Unlink(myPath);
1046}
Retv_Unlink(* Unlink)(Args_Unlink)
static int Unlink(const char *path)
Unlink() conforms to POSIX.1-2001 unlink()

References XrdPosixLinkage::Unlink, XrdPosixXrootd::Unlink(), XrdPosixXrootPath::URL(), Xroot, XrootPath, and Xunix.

Referenced by unlink().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ XrdPosix_URL()

char * XrdPosix_URL ( const char * path,
char * buff,
int blen )
extern

Definition at line 1094 of file XrdPosix.cc.

1095{
1096 return XrootPath.URL(path, buff, blen);
1097}

References XrdPosixXrootPath::URL(), and XrootPath.

+ Here is the call graph for this function:

◆ XrdPosix_Write()

ssize_t XrdPosix_Write ( int fildes,
const void * buf,
size_t nbyte )
extern

◆ XrdPosix_Writev()

ssize_t XrdPosix_Writev ( int fildes,
const struct iovec * iov,
int iovcnt )
extern

Definition at line 1071 of file XrdPosix.cc.

1072{
1073
1074// Return results of the writev
1075//
1076 return (Xroot.myFD(fildes) ? Xroot.Writev(fildes, iov, iovcnt)
1077 : Xunix.Writev(fildes, iov, iovcnt));
1078}
Retv_Writev(* Writev)(Args_Writev)
static ssize_t Writev(int fildes, const struct iovec *iov, int iovcnt)
Writev() conforms to POSIX.1-2001 writev()

References XrdPosixXrootd::myFD(), XrdPosixLinkage::Writev, XrdPosixXrootd::Writev(), Xroot, and Xunix.

Referenced by writev().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: