Lines Matching defs:buf
21 static void stat64_to_hostfs(const struct stat64 *buf, struct hostfs_stat *p)
23 p->ino = buf->st_ino;
24 p->mode = buf->st_mode;
25 p->nlink = buf->st_nlink;
26 p->uid = buf->st_uid;
27 p->gid = buf->st_gid;
28 p->size = buf->st_size;
29 p->atime.tv_sec = buf->st_atime;
31 p->ctime.tv_sec = buf->st_ctime;
33 p->mtime.tv_sec = buf->st_mtime;
35 p->blksize = buf->st_blksize;
36 p->blocks = buf->st_blocks;
37 p->maj = os_major(buf->st_rdev);
38 p->min = os_minor(buf->st_rdev);
43 struct stat64 buf;
46 if (fstat64(fd, &buf) < 0)
48 } else if (lstat64(path, &buf) < 0) {
51 stat64_to_hostfs(&buf, p);
124 int read_file(int fd, unsigned long long *offset, char *buf, int len)
128 n = pread64(fd, buf, len, *offset);
135 int write_file(int fd, unsigned long long *offset, const char *buf, int len)
139 n = pwrite64(fd, buf, len, *offset);
337 int hostfs_do_readlink(char *file, char *buf, int size)
341 n = readlink(file, buf, size);
345 buf[n] = '\0';
391 struct statfs64 buf;
394 err = statfs64(root, &buf);
398 *bsize_out = buf.f_bsize;
399 *blocks_out = buf.f_blocks;
400 *bfree_out = buf.f_bfree;
401 *bavail_out = buf.f_bavail;
402 *files_out = buf.f_files;
403 *ffree_out = buf.f_ffree;
404 memcpy(fsid_out, &buf.f_fsid,
405 sizeof(buf.f_fsid) > fsid_size ? fsid_size :
406 sizeof(buf.f_fsid));
407 *namelen_out = buf.f_namelen;