XrdPosixExtern.hh

Go to the documentation of this file.
00001 #ifndef __XRDPOSIXEXTERN_H__
00002 #define __XRDPOSIXEXTERN_H__
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                     X r d P o s i x E x t e r n . h h                      */
00006 /*                                                                            */
00007 /* (c) 2005 by the Board of Trustees of the Leland Stanford, Jr., University  */
00008 /*                            All Rights Reserved                             */
00009 /*   Produced by Andrew Hanushevsky for Stanford University under contract    */
00010 /*              DE-AC02-76-SFO0515 with the Department of Energy              */
00011 /*                                                                            */
00012 /* This file is part of the XRootD software suite.                            */
00013 /*                                                                            */
00014 /* XRootD is free software: you can redistribute it and/or modify it under    */
00015 /* the terms of the GNU Lesser General Public License as published by the     */
00016 /* Free Software Foundation, either version 3 of the License, or (at your     */
00017 /* option) any later version.                                                 */
00018 /*                                                                            */
00019 /* XRootD is distributed in the hope that it will be useful, but WITHOUT      */
00020 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      */
00021 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public       */
00022 /* License for more details.                                                  */
00023 /*                                                                            */
00024 /* You should have received a copy of the GNU Lesser General Public License   */
00025 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file  */
00026 /* COPYING (GPL license).  If not, see <http://www.gnu.org/licenses/>.        */
00027 /*                                                                            */
00028 /* The copyright holder's institutional names and contributor's names may not */
00029 /* be used to endorse or promote products derived from this software without  */
00030 /* specific prior written permission of the institution or contributor.       */
00031 /* Modified by Frank Winklmeier to add the full Posix file system definition. */
00032 /******************************************************************************/
00033   
00034 // These OS-Compatible (not C++) externs are included by XrdPosix.hh to
00035 // complete the macro definitions contained therein.
00036 
00037 // Use this file directly to define your own macros or interfaces. Note that
00038 // native types are used to avoid 32/64 bit parameter/return value ambiguities
00039 // and to enforce shared library compatability (needed by the preload32 code).
00040 
00041 // Only 64-bit interfaces are directly supported. However, the preload library
00042 // supports the old 32-bit interfaces. To use this include you must specify
00043 
00044 // -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
00045 
00046 // compilation options. This ensures LP64 compatability which defines:
00047 //
00048 // ssize_t ->          long long
00049 //  size_t -> unsigned long long
00050 //   off_t ->          long long
00051 
00052 #if (!defined(_LARGEFILE_SOURCE) || !defined(_LARGEFILE64_SOURCE) || \
00053     _FILE_OFFSET_BITS!=64) && !defined(XRDPOSIXPRELOAD32)
00054 #error Compilation options are incompatible with XrdPosixExtern.hh; \
00055        Specify -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
00056 #endif
00057 
00058 // We pre-declare various structure t avoid compilation complaints. We cannot
00059 // include the necessary ".h" files as these would also try to define entry
00060 // points which may conflict with our definitions due to renaming pragmas and
00061 // simple defines. All we want is to make sure we have the right name in the
00062 // loader's symbol table so that the preload library can intercept the call.
00063 // We need these definitions here because the includer may not have included
00064 // all of the includes necessary to support all of the API's.
00065 //
00066 struct iovec;
00067 struct stat;
00068 struct statfs;
00069 struct statvfs;
00070 
00071 #include <dirent.h>
00072 #include <stdio.h>
00073 #include <unistd.h>
00074 #include <sys/types.h>
00075 
00076 #include "XrdPosix/XrdPosixOsDep.hh"
00077 
00078 #ifdef __cplusplus
00079 extern "C"
00080 {
00081 #endif
00082 extern int        XrdPosix_Access(const char *path, int amode);
00083 
00084 extern int        XrdPosix_Acl(const char *path, int cmd, int nentries,
00085                                void *aclbufp);
00086 
00087 extern int        XrdPosix_Chdir(const char *path);
00088 
00089 extern int        XrdPosix_Close(int fildes);
00090 
00091 extern int        XrdPosix_Closedir(DIR *dirp);
00092 
00093 extern int        XrdPosix_Creat(const char *path, mode_t mode);
00094 
00095 extern int        XrdPosix_Fclose(FILE *stream);
00096 
00097 extern int        XrdPosix_Fcntl(int fd, int cmd, ...);
00098 
00099 extern int        XrdPosix_Fdatasync(int fildes);
00100 
00101 extern int        XrdPosix_Fflush(FILE *stream);
00102 
00103 #ifdef __linux__
00104 extern long long  XrdPosix_Fgetxattr (int fd, const char *name,
00105                                       void *value, unsigned long long size);
00106 #endif
00107 
00108 extern FILE      *XrdPosix_Fopen(const char *path, const char *mode);
00109 
00110 extern size_t     XrdPosix_Fread(void *ptr, size_t size, size_t nitems, FILE *stream);
00111 
00112 extern int        XrdPosix_Fseek(FILE *stream, long offset, int whence);
00113 
00114 extern int        XrdPosix_Fseeko(FILE *stream, long long offset, int whence);
00115 
00116 extern int        XrdPosix_Fstat(int fildes, struct stat *buf);
00117 
00118 #ifdef __linux__
00119 extern int        XrdPosix_FstatV(int ver, int fildes, struct stat *buf);
00120 #endif
00121 
00122 extern int        XrdPosix_Fsync(int fildes);
00123 
00124 extern long       XrdPosix_Ftell(FILE *stream);
00125 
00126 extern long long  XrdPosix_Ftello(FILE *stream);
00127 
00128 extern int        XrdPosix_Ftruncate(int fildes, long long offset);
00129 
00130 extern size_t     XrdPosix_Fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream);
00131 
00132 #ifdef __linux__
00133 extern long long  XrdPosix_Getxattr (const char *path, const char *name, 
00134                                      void *value, unsigned long long size);
00135 
00136 extern long long  XrdPosix_Lgetxattr(const char *path, const char *name, 
00137                                      void *value, unsigned long long size);
00138 #endif
00139 
00140 extern long long  XrdPosix_Lseek(int fildes, long long offset, int whence);
00141 
00142 extern int        XrdPosix_Lstat(const char *path, struct stat *buf);
00143 
00144 extern int        XrdPosix_Mkdir(const char *path, mode_t mode);
00145 
00146 extern int        XrdPosix_Open(const char *path, int oflag, ...);
00147 
00148 extern DIR*       XrdPosix_Opendir(const char *path);
00149   
00150 extern long       XrdPosix_Pathconf(const char *path, int name);
00151 
00152 extern long long  XrdPosix_Pread(int fildes, void *buf, unsigned long long nbyte,
00153                                  long long offset);
00154 
00155 extern long long  XrdPosix_Read(int fildes, void *buf, unsigned long long nbyte);
00156   
00157 extern long long  XrdPosix_Readv(int fildes, const struct iovec *iov, int iovcnt);
00158 
00159 extern struct dirent*   XrdPosix_Readdir  (DIR *dirp);
00160 extern struct dirent64* XrdPosix_Readdir64(DIR *dirp);
00161 
00162 extern int        XrdPosix_Readdir_r  (DIR *dirp, struct dirent   *entry, struct dirent   **result);
00163 extern int        XrdPosix_Readdir64_r(DIR *dirp, struct dirent64 *entry, struct dirent64 **result);
00164 
00165 extern int        XrdPosix_Rename(const char *oname, const char *nname);
00166 
00167 extern void       XrdPosix_Rewinddir(DIR *dirp);
00168 
00169 extern int        XrdPosix_Rmdir(const char *path);
00170 
00171 extern void       XrdPosix_Seekdir(DIR *dirp, long loc);
00172 
00173 extern int        XrdPosix_Stat(const char *path, struct stat *buf);
00174 
00175 #if !defined(__solaris__)
00176 extern int        XrdPosix_Statfs(const char *path, struct statfs *buf);
00177 #endif
00178 
00179 extern int        XrdPosix_Statvfs(const char *path, struct statvfs *buf);
00180 
00181 extern long long  XrdPosix_Pwrite(int fildes, const void *buf, 
00182                                   unsigned long long nbyte, long long offset);
00183 
00184 extern long       XrdPosix_Telldir(DIR *dirp);
00185 
00186 extern int        XrdPosix_Truncate(const char *path, long long offset);
00187 
00188 extern int        XrdPosix_Unlink(const char *path);
00189 
00190 extern long long  XrdPosix_Write(int fildes, const void *buf,
00191                                  unsigned long long nbyte);
00192 
00193 extern long long  XrdPosix_Writev(int fildes, const struct iovec *iov, int iovcnt);
00194 
00195 #ifdef __cplusplus
00196 };
00197 #endif
00198 
00199 // The following is for use for wrapper classeses
00200 //
00201 extern int        XrdPosix_isMyPath(const char *path);
00202 
00203 extern char      *XrdPosix_URL(const char *path, char *buff, int blen);
00204 
00205 #endif

Generated on 5 Oct 2016 for xrootd by  doxygen 1.4.7