XRootD
XrdFfsPosix.hh
Go to the documentation of this file.
1 /******************************************************************************/
2 /* XrdFfsPosix.hh C wrapper to some of the Xrootd Posix library functions */
3 /* */
4 /* (c) 2010 by the Board of Trustees of the Leland Stanford, Jr., University */
5 /* All Rights Reserved */
6 /* Author: Wei Yang (SLAC National Accelerator Laboratory, 2009) */
7 /* Contract DE-AC02-76-SFO0515 with the Department of Energy */
8 /* */
9 /* This file is part of the XRootD software suite. */
10 /* */
11 /* XRootD is free software: you can redistribute it and/or modify it under */
12 /* the terms of the GNU Lesser General Public License as published by the */
13 /* Free Software Foundation, either version 3 of the License, or (at your */
14 /* option) any later version. */
15 /* */
16 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
17 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
18 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
19 /* License for more details. */
20 /* */
21 /* You should have received a copy of the GNU Lesser General Public License */
22 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
23 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
24 /* */
25 /* The copyright holder's institutional names and contributor's names may not */
26 /* be used to endorse or promote products derived from this software without */
27 /* specific prior written permission of the institution or contributor. */
28 /******************************************************************************/
29 
30 #include <dirent.h>
31 #include <cerrno>
32 #include <fcntl.h>
33 #include <sys/stat.h>
34 #include <sys/types.h>
35 #include <sys/time.h>
36 #include <sys/param.h>
37 #include <sys/resource.h>
38 #include <sys/uio.h>
39 #include <unistd.h>
40 #include <sys/statvfs.h>
41 
42 
43 #ifdef __cplusplus
44  extern "C" {
45 #endif
46 
47 int XrdFfsPosix_stat(const char *file_name, struct stat *buf);
48 
49 DIR *XrdFfsPosix_opendir(const char *dirname);
50 struct dirent *XrdFfsPosix_readdir(DIR *dirp);
51 int XrdFfsPosix_closedir(DIR *dir);
52 int XrdFfsPosix_mkdir(const char *path, mode_t mode);
53 int XrdFfsPosix_rmdir(const char *path);
54 
55 int XrdFfsPosix_open(const char *pathname, int flags, mode_t mode);
56 off_t XrdFfsPosix_lseek(int fildes, off_t offset, int whence);
57 ssize_t XrdFfsPosix_read(int fd, void *buf, size_t count);
58 ssize_t XrdFfsPosix_pread(int fildes, void *buf, size_t nbyte, off_t offset);
59 int XrdFfsPosix_close(int fd);
60 ssize_t XrdFfsPosix_write(int fildes, const void *buf, size_t nbyte);
61 ssize_t XrdFfsPosix_pwrite(int fildes, const void *buf, size_t nbyte, off_t offset);
62 int XrdFfsPosix_fsync(int fildes);
63 int XrdFfsPosix_unlink(const char *path);
64 int XrdFfsPosix_rename(const char *oldpath, const char *newpath);
65 int XrdFfsPosix_ftruncate(int fildes, off_t offset);
66 int XrdFfsPosix_truncate(const char *path, off_t size);
67 long long XrdFfsPosix_getxattr(const char *path, const char *name, void *value, unsigned long long size);
68 
69 /*
70  XrdFfsPosix_clear_from_rdr_cache() can be used to clear a non-existing file/directory from redirector cache
71  Note that this function is doesn't do the work in a atomical step.
72 */
73 void XrdFfsPosix_clear_from_rdr_cache(const char *rdrurl);
74 
75 int XrdFfsPosix_unlinkall(const char *rdrurl, const char *path, uid_t user_uid);
76 int XrdFfsPosix_rmdirall(const char *rdrurl, const char *path, uid_t user_uid);
77 int XrdFfsPosix_renameall(const char *rdrurl, const char *from, const char *to, uid_t user_uid);
78 int XrdFfsPosix_truncateall(const char *rdrurl, const char *path, off_t size, uid_t user_uid);
79 int XrdFfsPosix_readdirall(const char *rdrurl, const char *path, char ***direntarray, uid_t user_uid);
80 int XrdFfsPosix_statvfsall(const char *rdrurl, const char *path, struct statvfs *stbuf, uid_t user_uid);
81 int XrdFfsPosix_statall(const char *rdrurl, const char *path, struct stat *stbuf, uid_t user_uid);
82 
83 #ifdef __cplusplus
84  }
85 #endif
int XrdFfsPosix_ftruncate(int fildes, off_t offset)
Definition: XrdFfsPosix.cc:172
int XrdFfsPosix_rmdirall(const char *rdrurl, const char *path, uid_t user_uid)
Definition: XrdFfsPosix.cc:334
int XrdFfsPosix_rename(const char *oldpath, const char *newpath)
Definition: XrdFfsPosix.cc:167
int XrdFfsPosix_truncate(const char *path, off_t size)
Definition: XrdFfsPosix.cc:176
int XrdFfsPosix_stat(const char *file_name, struct stat *buf)
Definition: XrdFfsPosix.cc:66
int XrdFfsPosix_fsync(int fildes)
Definition: XrdFfsPosix.cc:157
int XrdFfsPosix_unlink(const char *path)
Definition: XrdFfsPosix.cc:162
int XrdFfsPosix_renameall(const char *rdrurl, const char *from, const char *to, uid_t user_uid)
Definition: XrdFfsPosix.cc:339
void XrdFfsPosix_clear_from_rdr_cache(const char *rdrurl)
Definition: XrdFfsPosix.cc:235
DIR * XrdFfsPosix_opendir(const char *dirname)
Definition: XrdFfsPosix.cc:82
ssize_t XrdFfsPosix_pwrite(int fildes, const void *buf, size_t nbyte, off_t offset)
Definition: XrdFfsPosix.cc:152
int XrdFfsPosix_truncateall(const char *rdrurl, const char *path, off_t size, uid_t user_uid)
Definition: XrdFfsPosix.cc:390
int XrdFfsPosix_open(const char *pathname, int flags, mode_t mode)
Definition: XrdFfsPosix.cc:122
ssize_t XrdFfsPosix_read(int fd, void *buf, size_t count)
Definition: XrdFfsPosix.cc:137
int XrdFfsPosix_rmdir(const char *path)
Definition: XrdFfsPosix.cc:117
struct dirent * XrdFfsPosix_readdir(DIR *dirp)
Definition: XrdFfsPosix.cc:87
off_t XrdFfsPosix_lseek(int fildes, off_t offset, int whence)
Definition: XrdFfsPosix.cc:132
int XrdFfsPosix_closedir(DIR *dir)
Definition: XrdFfsPosix.cc:92
ssize_t XrdFfsPosix_pread(int fildes, void *buf, size_t nbyte, off_t offset)
Definition: XrdFfsPosix.cc:142
int XrdFfsPosix_statvfsall(const char *rdrurl, const char *path, struct statvfs *stbuf, uid_t user_uid)
Definition: XrdFfsPosix.cc:677
int XrdFfsPosix_close(int fd)
Definition: XrdFfsPosix.cc:127
int XrdFfsPosix_readdirall(const char *rdrurl, const char *path, char ***direntarray, uid_t user_uid)
Definition: XrdFfsPosix.cc:474
int XrdFfsPosix_statall(const char *rdrurl, const char *path, struct stat *stbuf, uid_t user_uid)
Definition: XrdFfsPosix.cc:759
int XrdFfsPosix_unlinkall(const char *rdrurl, const char *path, uid_t user_uid)
Definition: XrdFfsPosix.cc:329
int XrdFfsPosix_mkdir(const char *path, mode_t mode)
Definition: XrdFfsPosix.cc:97
long long XrdFfsPosix_getxattr(const char *path, const char *name, void *value, unsigned long long size)
Definition: XrdFfsPosix.cc:181
ssize_t XrdFfsPosix_write(int fildes, const void *buf, size_t nbyte)
Definition: XrdFfsPosix.cc:147
int stat(const char *path, struct stat *buf)
int statvfs(const char *path, struct statvfs *buf)
static INT to(const char *buffer)
Definition: XrdZipUtils.hh:91