XRootD
Loading...
Searching...
No Matches
XrdPosix.cc File Reference
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/uio.h>
#include "XrdSys/XrdSysHeaders.hh"
#include "XrdPosix/XrdPosixLinkage.hh"
#include "XrdPosix/XrdPosixXrootd.hh"
#include "XrdPosix/XrdPosixXrootdPath.hh"
Include dependency graph for XrdPosix.cc:

Go to the source code of this file.

Macros

#define ISMODE(x)

Functions

static void fseteof (FILE *fp)
static void fseterr (FILE *fp)
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, long long offset, int whence)
int XrdPosix_Fstat (int fildes, struct stat *buf)
int XrdPosix_Fsync (int fildes)
long XrdPosix_Ftell (FILE *stream)
long long XrdPosix_Ftello (FILE *stream)
int XrdPosix_Ftruncate (int fildes, long long offset)
size_t XrdPosix_Fwrite (const void *ptr, size_t size, size_t nitems, FILE *stream)
int XrdPosix_isMyPath (const char *path)
long long XrdPosix_Lseek (int fildes, long long 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)
long long XrdPosix_Pread (int fildes, void *buf, unsigned long long nbyte, long long offset)
long long XrdPosix_Pwrite (int fildes, const void *buf, unsigned long long nbyte, long long offset)
long long XrdPosix_Read (int fildes, void *buf, unsigned long long 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 *oldpath, const char *newpath)
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, long long offset)
int XrdPosix_Unlink (const char *path)
char * XrdPosix_URL (const char *path, char *buff, int blen)
long long XrdPosix_Write (int fildes, const void *buf, unsigned long long nbyte)
long long XrdPosix_Writev (int fildes, const struct iovec *iov, int iovcnt)

Variables

XrdPosixXrootd Xroot
XrdPosixXrootPath XrootPath
XrdPosixLinkage Xunix

Macro Definition Documentation

◆ ISMODE

#define ISMODE ( x)
Value:
!strcmp(mode, x)

Definition at line 302 of file XrdPosix.cc.

Referenced by XrdPosix_Fopen().

Function Documentation

◆ fseteof()

void fseteof ( FILE * fp)
inlinestatic

Definition at line 87 of file XrdPosix.cc.

88{
89 /* Most systems provide FILE as a struct and the necessary bitmask in
90 <stdio.h>, because they need it for implementing getc() and putc() as
91 fast macros. */
92#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
93 /* GNU libc, BeOS, Haiku, Linux libc5 */
94 fp->_flags |= _IO_EOF_SEEN;
95#elif defined __sferror || defined __APPLE__ || defined __DragonFly__ || defined __ANDROID__
96 /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
97 fp->_flags |= __SEOF;
98#elif defined _IOEOF
99 /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
100 fp->_flag |= _IOEOF;
101#elif defined __UCLIBC__ /* uClibc */
102 fp->__modeflags |= __FLAG_EOF;
103#else
104 (void) fseek(fp, 0L, SEEK_END);
105#endif
106}
#define fseek(a, b, c)
Definition XrdPosix.hh:58

References fseek.

Referenced by XrdPosix_Fread().

Here is the caller graph for this function:

◆ fseterr()

void fseterr ( FILE * fp)
inlinestatic

Definition at line 64 of file XrdPosix.cc.

65{
66 /* Most systems provide FILE as a struct and the necessary bitmask in
67 <stdio.h>, because they need it for implementing getc() and putc() as
68 fast macros. This function is based on gnulib's fseterr.c */
69#if defined _IO_ERR_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
70 /* GNU libc, BeOS, Haiku, Linux libc5 */
71 fp->_flags |= _IO_ERR_SEEN;
72#elif defined __sferror || defined __APPLE__ || defined __DragonFly__ || defined __FreeBSD__ || defined __ANDROID__
73 /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
74 fp->_flags |= __SERR;
75#elif defined _IOERR
76 /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
77 fp->_flag |= _IOERR;
78#elif defined __UCLIBC__ /* uClibc */
79 fp->__modeflags |= __FLAG_ERROR;
80#elif defined MUSL /* musl libc */
81 __fseterr(fp);
82#else
83 #error "Unsupported platform! Please report it as a bug."
84#endif
85}

Referenced by XrdPosix_Fread(), and XrdPosix_Fwrite().

Here is the caller graph for this function:

◆ XrdPosix_Access()

int XrdPosix_Access ( const char * path,
int amode )

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

References Xroot, XrootPath, and Xunix.

Referenced by access().

Here is the caller graph for this function:

◆ XrdPosix_Acl()

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

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}

References XrootPath, and Xunix.

Referenced by acl().

Here is the caller graph for this function:

◆ XrdPosix_Chdir()

int XrdPosix_Chdir ( const char * path)

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}

References XrootPath, and Xunix.

Referenced by chdir().

Here is the caller graph for this function:

◆ XrdPosix_Close()

int XrdPosix_Close ( int fildes)

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}

References Xroot, and Xunix.

Referenced by close().

Here is the caller graph for this function:

◆ XrdPosix_Closedir()

int XrdPosix_Closedir ( DIR * dirp)

Definition at line 187 of file XrdPosix.cc.

188{
189
190 return (Xroot.isXrootdDir(dirp) ? Xroot.Closedir(dirp)
191 : Xunix.Closedir(dirp));
192}

References Xroot, and Xunix.

Referenced by closedir().

Here is the caller graph for this function:

◆ XrdPosix_Creat()

int XrdPosix_Creat ( const char * path,
mode_t mode )

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)

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}

References Xroot, and Xunix.

Referenced by fclose().

Here is the caller graph for this function:

◆ XrdPosix_Fcntl()

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

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}

References Xroot, and Xunix.

Referenced by fcntl64().

Here is the caller graph for this function:

◆ XrdPosix_Fdatasync()

int XrdPosix_Fdatasync ( int fildes)

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}

References Xroot, and Xunix.

Referenced by fdatasync().

Here is the caller graph for this function:

◆ XrdPosix_Fflush()

int XrdPosix_Fflush ( FILE * stream)

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}

References Xroot, and Xunix.

Referenced by fflush().

Here is the caller graph for this function:

◆ XrdPosix_Fopen()

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

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
static const int isStream

References ISMODE, XrdPosixXrootd::isStream, Xroot, XrootPath, and Xunix.

Referenced by fopen64().

Here is the caller graph for this function:

◆ XrdPosix_Fread()

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

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

References fseteof(), fseterr(), 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 )

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}

References Xroot, and Xunix.

Referenced by fseek().

Here is the caller graph for this function:

◆ XrdPosix_Fseeko()

int XrdPosix_Fseeko ( FILE * stream,
long long offset,
int whence )

Definition at line 397 of file XrdPosix.cc.

398{
399
400// Return the result of the fseek
401//
402 if (!Xroot.myFD(fileno(stream)))
403 return Xunix.Fseeko64(stream, offset, whence);
404
405 return (Xroot.Lseek(fileno(stream), offset, whence) < 0 ? -1 : 0);
406}

References Xroot, and Xunix.

Referenced by fseeko(), and fseeko64().

Here is the caller graph for this function:

◆ XrdPosix_Fstat()

int XrdPosix_Fstat ( int fildes,
struct stat * buf )

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)

References stat, 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)

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 Xroot, and Xunix.

Referenced by fsync().

Here is the caller graph for this function:

◆ XrdPosix_Ftell()

long XrdPosix_Ftell ( FILE * stream)

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}

References Xroot, and Xunix.

Referenced by ftell().

Here is the caller graph for this function:

◆ XrdPosix_Ftello()

long long XrdPosix_Ftello ( FILE * stream)

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}

References Xroot, and Xunix.

Referenced by ftello(), and ftello64().

Here is the caller graph for this function:

◆ XrdPosix_Ftruncate()

int XrdPosix_Ftruncate ( int fildes,
long long offset )

Definition at line 499 of file XrdPosix.cc.

500{
501
502// Return the result of the ftruncate
503//
504 return (Xroot.myFD(fildes) ? Xroot.Ftruncate (fildes, offset)
505 : Xunix.Ftruncate64(fildes, offset));
506}

References Xroot, and Xunix.

Referenced by ftruncate(), and ftruncate64().

Here is the caller graph for this function:

◆ XrdPosix_Fwrite()

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

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}

References fseterr(), 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)

Definition at line 1085 of file XrdPosix.cc.

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

References XrootPath.

Referenced by lstat(), and stat().

Here is the caller graph for this function:

◆ XrdPosix_Lseek()

long long XrdPosix_Lseek ( int fildes,
long long offset,
int whence )

Definition at line 575 of file XrdPosix.cc.

576{
577
578// Return the operation of the seek
579//
580 return (Xroot.myFD(fildes) ? Xroot.Lseek (fildes, offset, whence)
581 : Xunix.Lseek64(fildes, offset, whence));
582}

References Xroot, and Xunix.

Referenced by llseek(), lseek(), and lseek64().

Here is the caller graph for this function:

◆ XrdPosix_Lstat()

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

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}

References stat, stat64(), 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 )

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}

References Xroot, XrootPath, and Xunix.

Referenced by mkdir().

Here is the caller graph for this function:

◆ XrdPosix_Open()

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

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}

References Xroot, XrootPath, and Xunix.

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

Here is the caller graph for this function:

◆ XrdPosix_Opendir()

DIR * XrdPosix_Opendir ( const char * path)

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}

References Xroot, XrootPath, and Xunix.

Referenced by opendir().

Here is the caller graph for this function:

◆ XrdPosix_Pathconf()

long XrdPosix_Pathconf ( const char * path,
int name )

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}

References XrootPath, and Xunix.

Referenced by pathconf().

Here is the caller graph for this function:

◆ XrdPosix_Pread()

long long XrdPosix_Pread ( int fildes,
void * buf,
unsigned long long nbyte,
long long offset )

Definition at line 718 of file XrdPosix.cc.

720{
721
722// Return the results of the read
723//
724 return (Xroot.myFD(fildes) ? Xroot.Pread (fildes, buf, nbyte, offset)
725 : Xunix.Pread64(fildes, buf, nbyte, offset));
726}

References Xroot, and Xunix.

Referenced by pread(), and pread64().

Here is the caller graph for this function:

◆ XrdPosix_Pwrite()

long long XrdPosix_Pwrite ( int fildes,
const void * buf,
unsigned long long nbyte,
long long offset )

Definition at line 735 of file XrdPosix.cc.

737{
738
739// Return the results of the write
740//
741 return (Xroot.myFD(fildes) ? Xroot.Pwrite (fildes, buf, nbyte, offset)
742 : Xunix.Pwrite64(fildes, buf, nbyte, offset));
743}

References Xroot, and Xunix.

Referenced by pwrite(), and pwrite64().

Here is the caller graph for this function:

◆ XrdPosix_Read()

long long XrdPosix_Read ( int fildes,
void * buf,
unsigned long long nbyte )

Definition at line 752 of file XrdPosix.cc.

753{
754
755// Return the results of the read
756//
757 return (Xroot.myFD(fildes) ? Xroot.Read(fildes, buf, nbyte)
758 : Xunix.Read(fildes, buf, nbyte));
759}

References Xroot, and Xunix.

Referenced by read().

Here is the caller graph for this function:

◆ XrdPosix_Readdir()

struct dirent * XrdPosix_Readdir ( DIR * dirp)

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}

References Xroot, and Xunix.

◆ XrdPosix_Readdir64()

struct dirent64 * XrdPosix_Readdir64 ( DIR * dirp)

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}

References Xroot, and Xunix.

Referenced by readdir(), and readdir64().

Here is the caller graph for this function:

◆ XrdPosix_Readdir64_r()

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

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}

References Xroot, and Xunix.

Referenced by readdir64_r(), and readdir_r().

Here is the caller graph for this function:

◆ XrdPosix_Readdir_r()

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

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}

References Xroot, and Xunix.

Referenced by readdir_r().

Here is the caller graph for this function:

◆ XrdPosix_Readv()

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

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}

References Xroot, and Xunix.

Referenced by readv().

Here is the caller graph for this function:

◆ XrdPosix_Rename()

int XrdPosix_Rename ( const char * oldpath,
const char * newpath )

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}

References Xroot, XrootPath, and Xunix.

Referenced by rename().

Here is the caller graph for this function:

◆ XrdPosix_Rewinddir()

void XrdPosix_Rewinddir ( DIR * dirp)

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}

References Xroot, and Xunix.

Referenced by rewinddir().

Here is the caller graph for this function:

◆ XrdPosix_Rmdir()

int XrdPosix_Rmdir ( const char * path)

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}

References Xroot, XrootPath, and Xunix.

Referenced by rmdir().

Here is the caller graph for this function:

◆ XrdPosix_Seekdir()

void XrdPosix_Seekdir ( DIR * dirp,
long loc )

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}

References Xroot, and Xunix.

Referenced by seekdir().

Here is the caller graph for this function:

◆ XrdPosix_Stat()

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

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}

References stat, stat64(), 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 )

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)

References statfs, statfs64(), 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 )

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)

References statvfs, statvfs64(), 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)

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}

References Xroot, and Xunix.

Referenced by telldir().

Here is the caller graph for this function:

◆ XrdPosix_Truncate()

int XrdPosix_Truncate ( const char * path,
long long offset )

Definition at line 1005 of file XrdPosix.cc.

1006{
1007 char *myPath, buff[2048];
1008
1009// Make sure a path was passed
1010//
1011 if (!path) {errno = EFAULT; return -1;}
1012
1013// Return the results of a truncate of a Unix file system
1014//
1015 if (!(myPath = XrootPath.URL(path, buff, sizeof(buff))))
1016 return Xunix.Truncate64(path, offset);
1017
1018// Return the results of an truncate of an xrootd file system
1019//
1020 return Xroot.Truncate(myPath, offset);
1021}

References Xroot, XrootPath, and Xunix.

Referenced by truncate(), and truncate64().

Here is the caller graph for this function:

◆ XrdPosix_Unlink()

int XrdPosix_Unlink ( const char * path)

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}

References Xroot, XrootPath, and Xunix.

Referenced by unlink().

Here is the caller graph for this function:

◆ XrdPosix_URL()

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

Definition at line 1094 of file XrdPosix.cc.

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

References XrootPath.

◆ XrdPosix_Write()

long long XrdPosix_Write ( int fildes,
const void * buf,
unsigned long long nbyte )

Definition at line 1055 of file XrdPosix.cc.

1056{
1057
1058// Return the results of the write
1059//
1060 return (Xroot.myFD(fildes) ? Xroot.Write(fildes, buf, nbyte)
1061 : Xunix.Write(fildes, buf, nbyte));
1062}

References Xroot, and Xunix.

Referenced by write().

Here is the caller graph for this function:

◆ XrdPosix_Writev()

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

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}

References Xroot, and Xunix.

Referenced by writev().

Here is the caller graph for this function:

Variable Documentation

◆ Xroot

◆ XrootPath

◆ Xunix

XrdPosixLinkage Xunix
extern

Definition at line 57 of file XrdPosixLinkage.cc.

Referenced by access(), acl(), chdir(), close(), closedir(), creat(), creat64(), fclose(), fcntl(), fcntl64(), fdatasync(), fflush(), fopen64(), fread(), fseek(), fseeko(), fseeko64(), fstat(), fstat64(), fsync(), ftell(), ftello(), ftello64(), ftruncate(), ftruncate64(), fwrite(), llseek(), lseek(), lseek64(), lstat(), lstat64(), mkdir(), open(), open64(), opendir(), pathconf(), pread(), pread64(), pwrite(), pwrite64(), read(), readdir(), readdir64(), readdir64_r(), readdir_r(), readv(), rename(), rewinddir(), rmdir(), seekdir(), stat(), stat64(), statfs(), statfs64(), statvfs(), statvfs64(), telldir(), truncate(), truncate64(), unlink(), write(), writev(), Xrd_U_Access(), Xrd_U_Acl(), Xrd_U_Chdir(), Xrd_U_Close(), Xrd_U_Closedir(), Xrd_U_Fclose(), Xrd_U_Fcntl(), Xrd_U_Fcntl64(), Xrd_U_Fdatasync(), Xrd_U_Fflush(), Xrd_U_Fgetxattr(), Xrd_U_Fopen(), Xrd_U_Fopen64(), Xrd_U_Fread(), Xrd_U_Fseek(), Xrd_U_Fseeko(), Xrd_U_Fseeko64(), Xrd_U_Fstat(), Xrd_U_Fstat64(), Xrd_U_Fsync(), Xrd_U_Ftell(), Xrd_U_Ftello(), Xrd_U_Ftello64(), Xrd_U_Ftruncate(), Xrd_U_Ftruncate64(), Xrd_U_Fwrite(), Xrd_U_Getxattr(), Xrd_U_Lgetxattr(), Xrd_U_Lseek(), Xrd_U_Lseek64(), Xrd_U_Lstat(), Xrd_U_Lstat64(), Xrd_U_Mkdir(), Xrd_U_Open(), Xrd_U_Open64(), Xrd_U_Opendir(), Xrd_U_Pathconf(), Xrd_U_Pread(), Xrd_U_Pread64(), Xrd_U_Pwrite(), Xrd_U_Pwrite64(), Xrd_U_Read(), Xrd_U_Readdir(), Xrd_U_Readdir64(), Xrd_U_Readdir64_r(), Xrd_U_Readdir_r(), Xrd_U_Readv(), Xrd_U_Rename(), Xrd_U_Rewinddir(), Xrd_U_Rmdir(), Xrd_U_Seekdir(), Xrd_U_Stat(), Xrd_U_Stat64(), Xrd_U_Statfs(), Xrd_U_Statfs64(), Xrd_U_Statvfs(), Xrd_U_Statvfs64(), Xrd_U_Telldir(), Xrd_U_Truncate(), Xrd_U_Truncate64(), Xrd_U_Unlink(), Xrd_U_Write(), Xrd_U_Writev(), XrdPosix_Access(), XrdPosix_Acl(), XrdPosix_Chdir(), XrdPosix_Close(), XrdPosix_Closedir(), XrdPosix_Fclose(), XrdPosix_Fcntl(), XrdPosix_Fdatasync(), XrdPosix_Fflush(), XrdPosix_Fopen(), XrdPosix_Fread(), XrdPosix_Fseek(), XrdPosix_Fseeko(), XrdPosix_Fstat(), XrdPosix_Fsync(), XrdPosix_Ftell(), XrdPosix_Ftello(), XrdPosix_Ftruncate(), XrdPosix_Fwrite(), XrdPosix_Lseek(), XrdPosix_Lstat(), XrdPosix_Mkdir(), XrdPosix_Open(), XrdPosix_Opendir(), XrdPosix_Pathconf(), XrdPosix_Pread(), XrdPosix_Pwrite(), XrdPosix_Read(), XrdPosix_Readdir(), XrdPosix_Readdir64(), XrdPosix_Readdir64_r(), XrdPosix_Readdir_r(), XrdPosix_Readv(), XrdPosix_Rename(), XrdPosix_Rewinddir(), XrdPosix_Rmdir(), XrdPosix_Seekdir(), XrdPosix_Stat(), XrdPosix_Statfs(), XrdPosix_Statvfs(), XrdPosix_Telldir(), XrdPosix_Truncate(), XrdPosix_Unlink(), XrdPosix_Write(), and XrdPosix_Writev().