当前位置: 技术问答>linux和unix
如何得到当前目录所挂载的磁盘分区?
来源: 互联网 发布时间:2015-09-06
本文导语: 有这样的系统函数么?(c函数) 如果没有应该如何实现? | df.c in linux will be helpful | int stat(const char *file_name, struct stat *buf); int fstat(int filedes, struct stat *buf...
有这样的系统函数么?(c函数)
如果没有应该如何实现?
如果没有应该如何实现?
|
df.c in linux will be helpful
|
int stat(const char *file_name, struct stat *buf);
int fstat(int filedes, struct stat *buf);
int lstat(const char *file_name, struct stat *buf);
struct stat {
dev_t st_dev; /* device */
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
ino_t st_ino; /* inode */
mode_t st_mode; /* protection */
nlink_t st_nlink; /* number of hard links */
uid_t st_uid; /* user ID of owner */
gid_t st_gid; /* group ID of owner */
dev_t st_rdev; /* device type (if inode device) */
off_t st_size; /* total size, in bytes */
blksize_t st_blksize; /* blocksize for filesystem I/O */
blkcnt_t st_blocks; /* number of blocks allocated */
time_t st_atime; /* time of last access */
time_t st_mtime; /* time of last modification */
time_t st_ctime; /* time of last change */
};