+ struct v_inode* vino = fds->file->inode;
+ struct device* fdev = vino->sb->dev;
+
+ stat->st_ino = vino->id;
+ stat->st_blocks = vino->lb_usage;
+ stat->st_size = vino->fsize;
+ stat->st_blksize = vino->sb->blksize;
+ stat->st_nlink = vino->link_count;
+ stat->st_uid = vino->uid;
+ stat->st_gid = vino->gid;
+
+ stat->st_ctim = vino->ctime;
+ stat->st_atim = vino->atime;
+ stat->st_mtim = vino->mtime;
+
+ stat->st_mode = (vino->itype << 16) | vino->acl;
+
+ stat->st_ioblksize = PAGE_SIZE;
+
+ if (check_device_node(vino)) {
+ struct device* rdev = resolve_device(vino->data);
+ if (!rdev) {
+ errno = EINVAL;
+ goto done;
+ }
+
+ stat->st_rdev = (dev_t){.meta = rdev->ident.fn_grp,
+ .unique = rdev->ident.unique,
+ .index = dev_uid(rdev) };
+ }
+
+ if (fdev) {
+ stat->st_dev = (dev_t){.meta = fdev->ident.fn_grp,
+ .unique = fdev->ident.unique,
+ .index = dev_uid(fdev) };
+ }
+
+done:
+ return DO_STATUS(errno);
+}
+
+__DEFINE_LXSYSCALL4(int, fchmodat, int, fd,
+ const char*, path, int, mode, int, flags)
+{
+ int errno;
+ struct v_dnode *dnode;
+ struct v_inode* inode;
+
+ errno = vfs_walkat(fd, path, flags, &dnode);
+ if (errno) {