/* * internal implementation of gfal_access * */ inline int gfal_posix_internal_stat(const char* path, struct stat* buff){ gfal_handle handle; GError* tmp_err = NULL; int ret = -1; if( (handle = gfal_posix_instance()) == NULL){ errno = EIO; return -1; } ret = gfal2_stat(handle, path, buff, &tmp_err); if(tmp_err){ // error reported gfal_posix_register_internal_error(handle, "[gfal_stat]", tmp_err); errno = tmp_err->code; } return ret; }
/* * Implementation of the mkdir function * * */ int gfal_posix_internal_mkdir(const char* path, mode_t mode){ GError* tmp_err=NULL; gfal_handle handle; int res= -1; if((handle = gfal_posix_instance()) == NULL){ errno = EIO; return -1; } res = gfal2_mkdir(handle, path, mode, &tmp_err); if(tmp_err){ gfal_posix_register_internal_error(handle, "[gfal_mkdir]", tmp_err); errno = tmp_err->code; } return res; }
/* * Implementation of gfal_open * */ int gfal_posix_internal_open(const char* path, int flag, mode_t mode){ GError* tmp_err=NULL; gfal_handle handle; int key = -1; gfal_log(GFAL_VERBOSE_TRACE, "%s ->",__func__); if((handle = gfal_posix_instance()) == NULL){ errno = EIO; return -1; } key = gfal2_open(handle, path, flag, &tmp_err); if(tmp_err){ gfal_posix_register_internal_error(handle, "[gfal_open]", tmp_err); errno = tmp_err->code; }else errno=0; return key; }
/* * list the extended attribute of a file, internal call * */ ssize_t gfal_posix_internal_listxattr (const char *path, char *list, size_t size){ GError* tmp_err=NULL; gfal2_context_t handle; ssize_t res= -1; if((handle = gfal_posix_instance()) == NULL){ errno = EIO; return -1; } res = gfal2_listxattr(handle, path, list, size, &tmp_err); if(tmp_err){ gfal_posix_register_internal_error(handle, "[gfal_listxattr]", tmp_err); errno = tmp_err->code; } return res; }
int gfal_posix_internal_symlink(const char* oldpath, const char* newpath){ GError* tmp_err = NULL; gfal2_context_t handle; int ret=-1; if( (handle = gfal_posix_instance() ) ==NULL){ errno = EIO; return -1; } ret = gfal2_symlink(handle, oldpath, newpath,&tmp_err); if(tmp_err){ gfal_posix_register_internal_error(handle, "[gfal_symlink]", tmp_err); errno = tmp_err->code; } return (ret)?-1:0; }
/* * set a value to a extended attribute * */ int gfal_posix_internal_setxattr (const char *path, const char *name, const void *value, size_t size, int flags){ GError* tmp_err=NULL; gfal_handle handle; int res= -1; if((handle = gfal_posix_instance()) == NULL){ errno = EIO; return -1; } res = gfal2_setxattr(handle, path, name, value, size, flags, &tmp_err); if(tmp_err){ gfal_posix_register_internal_error(handle, "[gfal_setxattr]", tmp_err); errno = tmp_err->code; } return res; }