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 
10 #include <dirent.h>
11 #include <errno.h>
12 #include <fcntl.h>
13 #include <sys/stat.h>
14 #include <sys/types.h>
15 #include <sys/time.h>
16 #include <sys/param.h>
17 #include <sys/resource.h>
18 #include <sys/uio.h>
19 #include <unistd.h>
20 #include <sys/statvfs.h>
21 
22 
23 #ifdef __cplusplus
24  extern "C" {
25 #endif
26 
27 int XrdFfsPosix_stat(const char *file_name, struct stat *buf);
28 
29 DIR *XrdFfsPosix_opendir(const char *dirname);
30 struct dirent *XrdFfsPosix_readdir(DIR *dirp);
31 int XrdFfsPosix_closedir(DIR *dir);
32 int XrdFfsPosix_mkdir(const char *path, mode_t mode);
33 int XrdFfsPosix_rmdir(const char *path);
34 
35 int XrdFfsPosix_open(const char *pathname, int flags, mode_t mode);
36 off_t XrdFfsPosix_lseek(int fildes, off_t offset, int whence);
37 ssize_t XrdFfsPosix_read(int fd, void *buf, size_t count);
38 ssize_t XrdFfsPosix_pread(int fildes, void *buf, size_t nbyte, off_t offset);
39 int XrdFfsPosix_close(int fd);
40 ssize_t XrdFfsPosix_write(int fildes, const void *buf, size_t nbyte);
41 ssize_t XrdFfsPosix_pwrite(int fildes, const void *buf, size_t nbyte, off_t offset);
42 int XrdFfsPosix_fsync(int fildes);
43 int XrdFfsPosix_unlink(const char *path);
44 int XrdFfsPosix_rename(const char *oldpath, const char *newpath);
45 int XrdFfsPosix_ftruncate(int fildes, off_t offset);
46 int XrdFfsPosix_truncate(const char *path, off_t size);
47 long long XrdFfsPosix_getxattr(const char *path, const char *name, void *value, unsigned long long size);
48 
49 /*
50  XrdFfsPosix_clear_from_rdr_cache() can be used to clear a non-existing file/directory from redirector cache
51  Note that this function is doesn't do the work in a atomical step.
52 */
53 void XrdFfsPosix_clear_from_rdr_cache(const char *rdrurl);
54 
55 int XrdFfsPosix_unlinkall(const char *rdrurl, const char *path, uid_t user_uid);
56 int XrdFfsPosix_rmdirall(const char *rdrurl, const char *path, uid_t user_uid);
57 int XrdFfsPosix_renameall(const char *rdrurl, const char *from, const char *to, uid_t user_uid);
58 int XrdFfsPosix_truncateall(const char *rdrurl, const char *path, off_t size, uid_t user_uid);
59 int XrdFfsPosix_readdirall(const char *rdrurl, const char *path, char ***direntarray, uid_t user_uid);
60 int XrdFfsPosix_statvfsall(const char *rdrurl, const char *path, struct statvfs *stbuf, uid_t user_uid);
61 int XrdFfsPosix_statall(const char *rdrurl, const char *path, struct stat *stbuf, uid_t user_uid);
62 
63 #ifdef __cplusplus
64  }
65 #endif