5 #include <gfarm/gfarm.h> 47 e = gfs_pio_create(fn, GFARM_FILE_RDWR, 0664, &gf);
48 if (e != GFARM_ERR_NO_ERROR)
49 ERR(
"gfs_pio_create failed");
67 e = gfs_pio_open(fn, GFARM_FILE_RDWR, &gf);
68 if (e != GFARM_ERR_NO_ERROR)
69 ERR(
"gfs_pio_open failed");
85 #define MAX_SZ (1024 * 1024 * 1024) 87 char *buf = (
char *)buffer;
97 e = gfs_pio_seek(fp->
gf, offset, GFARM_SEEK_SET, &off);
98 if (e != GFARM_ERR_NO_ERROR)
99 ERR(
"gfs_pio_seek failed");
102 e = gfs_pio_write(fp->
gf, buf, sz, &n);
104 e = gfs_pio_read(fp->
gf, buf, sz, &n);
105 if (e != GFARM_ERR_NO_ERROR)
108 ERR(
"EOF encountered");
123 if (gfs_pio_close(fp->
gf) != GFARM_ERR_NO_ERROR)
124 ERR(
"gfs_pio_close failed");
137 if (e != GFARM_ERR_NO_ERROR)
138 errno = gfarm_error_to_errno(e);
144 return ((
char *)gfarm_version());
155 if (gfs_pio_sync(fp->
gf) != GFARM_ERR_NO_ERROR)
156 ERR(
"gfs_pio_sync failed");
168 if (gfs_stat(fn, &st) != GFARM_ERR_NO_ERROR)
169 ERR(
"gfs_stat failed");
179 gfarm_off_t used, avail, files;
186 e = gfs_statfs_by_path(fn, &used, &avail, &files);
187 if (e != GFARM_ERR_NO_ERROR) {
188 errno = gfarm_error_to_errno(e);
192 st->
f_blocks = (used + avail) / bsize;
207 e = gfs_mkdir(fn, mode);
208 if (e == GFARM_ERR_NO_ERROR)
210 errno = gfarm_error_to_errno(e);
223 if (e == GFARM_ERR_NO_ERROR)
225 errno = gfarm_error_to_errno(e);
238 e = gfs_stat(fn, &st);
239 if (e != GFARM_ERR_NO_ERROR) {
240 errno = gfarm_error_to_errno(e);
248 #define GFS_DEV ((dev_t)-1) 249 #define GFS_BLKSIZE 8192 250 #define STAT_BLKSIZ 512 261 e = gfs_stat(fn, &st);
262 if (e != GFARM_ERR_NO_ERROR) {
263 errno = gfarm_error_to_errno(e);
267 buf->st_ino = st.st_ino;
268 buf->st_mode = st.st_mode;
269 buf->st_nlink = st.st_nlink;
270 buf->st_uid = getuid();
271 buf->st_gid = getgid();
272 buf->st_size = st.st_size;
275 buf->st_atime = st.st_atimespec.tv_sec;
276 buf->st_mtime = st.st_mtimespec.tv_sec;
277 buf->st_ctime = st.st_ctimespec.tv_sec;
278 #if defined(HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC) 279 buf->st_atim.tv_nsec = st.st_atimespec.tv_nsec;
280 buf->st_mtim.tv_nsec = st.st_mtimespec.tv_nsec;
281 buf->st_ctim.tv_nsec = st.st_ctimespec.tv_nsec;
318 .enable_mdtest =
true,
void Gfarm_delete(char *fn, aiori_mod_opt_t *param)
int Gfarm_rmdir(const char *fn, aiori_mod_opt_t *param)
IOR_offset_t Gfarm_get_file_size(aiori_mod_opt_t *param, char *fn)
aiori_fd_t * Gfarm_create(char *fn, int flag, aiori_mod_opt_t *param)
int Gfarm_stat(const char *fn, struct stat *buf, aiori_mod_opt_t *param)
void Gfarm_fsync(aiori_fd_t *fd, aiori_mod_opt_t *param)
static aiori_xfer_hint_t * hints
int Gfarm_mkdir(const char *fn, mode_t mode, aiori_mod_opt_t *param)
void Gfarm_xfer_hints(aiori_xfer_hint_t *params)
void Gfarm_close(aiori_fd_t *fd, aiori_mod_opt_t *param)
int Gfarm_statfs(const char *fn, ior_aiori_statfs_t *st, aiori_mod_opt_t *param)
void Gfarm_sync(aiori_mod_opt_t *param)
int Gfarm_access(const char *fn, int mode, aiori_mod_opt_t *param)
aiori_fd_t * Gfarm_open(char *fn, int flag, aiori_mod_opt_t *param)
long long int IOR_offset_t
IOR_offset_t Gfarm_xfer(int access, aiori_fd_t *fd, IOR_size_t *buffer, IOR_offset_t len, IOR_offset_t offset, aiori_mod_opt_t *param)