Lines Matching refs:stat

23 #include <sys/stat.h>
392 struct stat* statData);
394 const struct stat* stat, int statMask);
411 struct stat* statData);
413 const struct stat* statData, int statMask);
415 struct stat* stat, bool kernel);
1826 struct stat stat;
1832 status = FS_CALL(vnode, read_stat, &stat);
1836 flock->l_start += stat.st_size;
4326 struct stat* stat, bool kernel)
4331 // path given: get the stat of the node referred to by (fd, path)
4337 traverseLeafLink, stat, kernel);
4346 status = descriptor->ops->fd_read_stat(descriptor.Get(), stat);
4780 vfs_stat_vnode(struct vnode* vnode, struct stat* stat)
4782 status_t status = FS_CALL(vnode, read_stat, stat);
4786 stat->st_dev = vnode->device;
4787 stat->st_ino = vnode->id;
4789 if (!S_ISBLK(stat->st_mode) && !S_ISCHR(stat->st_mode))
4790 stat->st_rdev = -1;
4798 vfs_stat_node_ref(dev_t device, ino_t inode, struct stat* stat)
4805 status = vfs_stat_vnode(vnode, stat);
5762 // stat() the node
5766 struct stat stat;
5767 status_t status = FS_CALL(vnode, read_stat, &stat);
5771 offset = stat.st_size;
5774 // stat() on regular drivers doesn't report size
5808 // basic implementation with stat() the node
5812 struct stat stat;
5813 status = FS_CALL(vnode, read_stat, &stat);
5817 off_t end = stat.st_size;
6605 common_read_stat(struct file_descriptor* descriptor, struct stat* stat)
6609 FUNCTION(("common_read_stat: stat %p\n", stat));
6612 stat->st_crtim.tv_nsec = 0;
6613 stat->st_ctim.tv_nsec = 0;
6614 stat->st_mtim.tv_nsec = 0;
6615 stat->st_atim.tv_nsec = 0;
6617 return vfs_stat_vnode(vnode, stat);
6622 common_write_stat(struct file_descriptor* descriptor, const struct stat* stat,
6627 FUNCTION(("common_write_stat(vnode = %p, stat = %p, statMask = %d)\n",
6628 vnode, stat, statMask));
6638 return FS_CALL(vnode, write_stat, stat, statMask);
6644 struct stat* stat, bool kernel)
6646 FUNCTION(("common_path_read_stat: fd: %d, path '%s', stat %p,\n", fd, path,
6647 stat));
6655 status = vfs_stat_vnode(vnode.Get(), stat);
6663 const struct stat* stat, int statMask, bool kernel)
6665 FUNCTION(("common_write_stat: fd: %d, path '%s', stat %p, stat_mask %d, "
6666 "kernel %d\n", fd, path, stat, statMask, kernel));
6675 status = FS_CALL(vnode.Get(), write_stat, stat, statMask);
6917 struct stat stat;
6919 &stat);
6923 offset = stat.st_size;
6943 attr_read_stat(struct file_descriptor* descriptor, struct stat* stat)
6947 FUNCTION(("attr_read_stat: stat 0x%p\n", stat));
6952 return FS_CALL(vnode, read_attr_stat, descriptor->cookie, stat);
6957 attr_write_stat(struct file_descriptor* descriptor, const struct stat* stat,
6962 FUNCTION(("attr_write_stat: stat = %p, statMask %d\n", stat, statMask));
6967 return FS_CALL(vnode, write_attr_stat, descriptor->cookie, stat, statMask);
7150 index_read_stat(struct file_descriptor* descriptor, struct stat* stat)
7155 FUNCTION(("index_read_stat: stat 0x%p\n", stat));
7160 //return FS_CALL(vnode, read_index_stat, descriptor->cookie, stat);
7178 index_name_read_stat(dev_t mountID, const char* name, struct stat* stat,
7194 status = FS_MOUNT_CALL(mount, read_index_stat, name, stat);
8575 /*! \brief Reads stat data of an entity specified by a FD + path pair.
8577 If only \a fd is given, the stat operation associated with the type
8580 stat data. If both \a fd and \a path are given and the path is absolute,
8582 identified by \a fd and specifies the entry whose stat data shall be
8589 \param stat The buffer the stat data shall be written into.
8590 \param statSize The size of the supplied stat buffer.
8591 \return \c B_OK, if the the stat data have been read successfully, another
8596 struct stat* stat, size_t statSize)
8598 struct stat completeStat;
8599 struct stat* originalStat = NULL;
8602 if (statSize > sizeof(struct stat))
8605 // this supports different stat extensions
8606 if (statSize < sizeof(struct stat)) {
8607 originalStat = stat;
8608 stat = &completeStat;
8611 status = vfs_read_stat(fd, path, traverseLeafLink, stat, true);
8614 memcpy(originalStat, stat, statSize);
8620 /*! \brief Writes stat data of an entity specified by a FD + path pair.
8622 If only \a fd is given, the stat operation associated with the type
8625 stat data. If both \a fd and \a path are given and the path is absolute,
8627 identified by \a fd and specifies the entry whose stat data shall be
8634 \param stat The buffer containing the stat data to be written.
8635 \param statSize The size of the supplied stat buffer.
8636 \param statMask A mask specifying which parts of the stat data shall be
8638 \return \c B_OK, if the the stat data have been written successfully,
8643 const struct stat* stat, size_t statSize, int statMask)
8645 struct stat completeStat;
8647 if (statSize > sizeof(struct stat))
8650 // this supports different stat extensions
8651 if (statSize < sizeof(struct stat)) {
8653 sizeof(struct stat) - statSize);
8654 memcpy(&completeStat, stat, statSize);
8655 stat = &completeStat;
8661 // path given: write the stat of the node referred to by (fd, path)
8667 traverseLeafLink, stat, statMask, true);
8676 status = descriptor->ops->fd_write_stat(descriptor.Get(), stat, statMask);
8743 _kern_read_index_stat(dev_t device, const char* name, struct stat* stat)
8745 return index_name_read_stat(device, name, stat, true);
9599 struct stat* userStat, size_t statSize)
9601 struct stat stat = {0};
9604 if (statSize > sizeof(struct stat))
9611 // path given: get the stat of the node referred to by (fd, path)
9625 status = common_path_read_stat(fd, path, traverseLink, &stat, false);
9634 status = descriptor->ops->fd_read_stat(descriptor.Get(), &stat);
9642 return user_memcpy(userStat, &stat, statSize);
9648 const struct stat* userStat, size_t statSize, int statMask)
9650 if (statSize > sizeof(struct stat))
9653 struct stat stat;
9656 || user_memcpy(&stat, userStat, statSize) < B_OK)
9659 // clear additional stat fields
9660 if (statSize < sizeof(struct stat))
9661 memset((uint8*)&stat + statSize, 0, sizeof(struct stat) - statSize);
9666 // path given: write the stat of the node referred to by (fd, path)
9680 status = common_path_write_stat(fd, path, traverseLeafLink, &stat,
9690 status = descriptor->ops->fd_write_stat(descriptor.Get(), &stat,
9800 struct stat stat;
9802 status = descriptor->ops->fd_read_stat(descriptor, &stat);
9811 info.type = stat.st_type;
9812 info.size = stat.st_size;
9923 _user_read_index_stat(dev_t device, const char* userName, struct stat* userStat)
9926 struct stat stat = {0};
9935 status = index_name_read_stat(device, name, &stat, false);
9937 if (user_memcpy(userStat, &stat, sizeof(stat)) != B_OK)