int puffs9p_node_getattr(struct puffs_usermount *pu, void *opc, struct vattr *vap, const struct puffs_cred *pcr) { struct puffs_node *pn = opc; int rv; rv = do_getattr(pu, pn, &pn->pn_va); if (rv == 0) memcpy(vap, &pn->pn_va, sizeof(struct vattr)); return rv; }
int getattr_test() { int ret = 0; printf("getattr_test: Start\n"); printf("\tbegin: Check entry type of %s\n", NEW_DIR_PATH_1); if((ret = do_getattr(NEW_DIR_PATH_1)) != 0) { goto out; } printf("\tend: Success\n"); out: if (ret) { printf("\tend: Failed\n"); } printf("getattr_test: Finish\n"); return ret; }
bool msg_callback(void *buf, anvil_msginfo_t *msg_info) { // Assume that we'll handle the msg bool handled = true; //anvil_syslog(0, "msg_callback\n"); switch (msg_info->type & ~ANVIL_NAME_LOOKUP) { case ANVIL_OPEN: do_open(buf, msg_info); break; case ANVIL_CLOSE: do_close(buf, msg_info); break; case ANVIL_DUP: do_dup(buf, msg_info); break; case ANVIL_READ: do_read(buf, msg_info); break; case ANVIL_WRITE: do_write(buf, msg_info); break; case ANVIL_STAT: do_stat(buf, msg_info); break; case ANVIL_GETATTR: do_getattr(buf, msg_info); break; case ANVIL_SETATTR: do_setattr(buf, msg_info); break; case ANVIL_GETWINSZ: do_getwinsz(buf, msg_info); break; default: handled = false; anvil_syslog(0, "term-svr GOT UNKNOWN MSG %d\n", msg_info->type); break; } return handled; }
static int seaf_fuse_getattr(const char *path, struct stat *stbuf) { memset(stbuf, 0, sizeof(struct stat)); return do_getattr(seaf, path, stbuf); }