xrootd
XrdFfsPosix.hh
Go to the documentation of this file.
00001 /******************************************************************************/
00002 /* XrdFfsPosix.hh C wrapper to some of the Xrootd Posix library functions     */
00003 /*                                                                            */
00004 /* (c) 2010 by the Board of Trustees of the Leland Stanford, Jr., University  */
00005 /*                            All Rights Reserved                             */
00006 /* Author: Wei Yang (SLAC National Accelerator Laboratory, 2009)              */
00007 /*         Contract DE-AC02-76-SFO0515 with the Department of Energy          */
00008 /*                                                                            */
00009 /* This file is part of the XRootD software suite.                            */
00010 /*                                                                            */
00011 /* XRootD is free software: you can redistribute it and/or modify it under    */
00012 /* the terms of the GNU Lesser General Public License as published by the     */
00013 /* Free Software Foundation, either version 3 of the License, or (at your     */
00014 /* option) any later version.                                                 */
00015 /*                                                                            */
00016 /* XRootD is distributed in the hope that it will be useful, but WITHOUT      */
00017 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      */
00018 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public       */
00019 /* License for more details.                                                  */
00020 /*                                                                            */
00021 /* You should have received a copy of the GNU Lesser General Public License   */
00022 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file  */
00023 /* COPYING (GPL license).  If not, see <http://www.gnu.org/licenses/>.        */
00024 /*                                                                            */
00025 /* The copyright holder's institutional names and contributor's names may not */
00026 /* be used to endorse or promote products derived from this software without  */
00027 /* specific prior written permission of the institution or contributor.       */
00028 /******************************************************************************/
00029 
00030 #include <dirent.h>
00031 #include <errno.h>
00032 #include <fcntl.h>
00033 #include <sys/stat.h>
00034 #include <sys/types.h>
00035 #include <sys/time.h>
00036 #include <sys/param.h>
00037 #include <sys/resource.h>
00038 #include <sys/uio.h>
00039 #include <unistd.h>
00040 #include <sys/statvfs.h>
00041 
00042 
00043 #ifdef __cplusplus
00044   extern "C" {
00045 #endif
00046 
00047 int            XrdFfsPosix_stat(const char *file_name, struct stat *buf);
00048 
00049 DIR           *XrdFfsPosix_opendir(const char *dirname);
00050 struct dirent *XrdFfsPosix_readdir(DIR *dirp);
00051 int            XrdFfsPosix_closedir(DIR *dir);
00052 int            XrdFfsPosix_mkdir(const char *path, mode_t mode);
00053 int            XrdFfsPosix_rmdir(const char *path);
00054 
00055 int            XrdFfsPosix_open(const char *pathname, int flags, mode_t mode);
00056 off_t          XrdFfsPosix_lseek(int fildes, off_t offset, int whence);
00057 ssize_t        XrdFfsPosix_read(int fd, void *buf, size_t count);
00058 ssize_t        XrdFfsPosix_pread(int fildes, void *buf, size_t nbyte, off_t offset);
00059 int            XrdFfsPosix_close(int fd);
00060 ssize_t        XrdFfsPosix_write(int fildes, const void *buf, size_t nbyte);
00061 ssize_t        XrdFfsPosix_pwrite(int fildes, const void *buf, size_t nbyte, off_t offset);
00062 int            XrdFfsPosix_fsync(int fildes);
00063 int            XrdFfsPosix_unlink(const char *path);
00064 int            XrdFfsPosix_rename(const char *oldpath, const char *newpath);
00065 int            XrdFfsPosix_ftruncate(int fildes, off_t offset);
00066 int            XrdFfsPosix_truncate(const char *path, off_t size);
00067 long long      XrdFfsPosix_getxattr(const char *path, const char *name, void *value, unsigned long long size);
00068 
00069 /* 
00070    XrdFfsPosix_clear_from_rdr_cache() can be used to clear a non-existing file/directory from redirector cache
00071    Note that this function is doesn't do the work in a atomical step.
00072 */ 
00073 void           XrdFfsPosix_clear_from_rdr_cache(const char *rdrurl);
00074 
00075 int            XrdFfsPosix_unlinkall(const char *rdrurl, const char *path, uid_t user_uid);
00076 int            XrdFfsPosix_rmdirall(const char *rdrurl, const char *path, uid_t user_uid);
00077 int            XrdFfsPosix_renameall(const char *rdrurl, const char *from, const char *to, uid_t user_uid);
00078 int            XrdFfsPosix_truncateall(const char *rdrurl, const char *path, off_t size, uid_t user_uid);
00079 int            XrdFfsPosix_readdirall(const char *rdrurl, const char *path, char ***direntarray, uid_t user_uid);
00080 int            XrdFfsPosix_statvfsall(const char *rdrurl, const char *path, struct statvfs *stbuf, uid_t user_uid);
00081 int            XrdFfsPosix_statall(const char *rdrurl, const char *path, struct stat *stbuf, uid_t user_uid);
00082 
00083 #ifdef __cplusplus
00084   }
00085 #endif