当前位置: 技术问答>linux和unix
菜鸟问题:很多结构体中的字段类型是在哪里被重定义的,如uid_t
来源: 互联网 发布时间:2015-11-13
本文导语: 如 struct stat内各参数的说明 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;...
如
struct stat内各参数的说明
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 */
off_t st_size; /*total size, in bytes*/
unsigned long st_blksize; /*blocksize for filesystem I/O */
unsigned long st_blocks; /*number of blocks allocated*/
time_t st_atime; /* time of lastaccess*/
time_t st_mtime; /* time of last modification */
time_t st_ctime; /* time of last change */
};
类型gid_t,time_t等一般是在哪个头文件声明的阿????????????
struct stat内各参数的说明
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 */
off_t st_size; /*total size, in bytes*/
unsigned long st_blksize; /*blocksize for filesystem I/O */
unsigned long st_blocks; /*number of blocks allocated*/
time_t st_atime; /* time of lastaccess*/
time_t st_mtime; /* time of last modification */
time_t st_ctime; /* time of last change */
};
类型gid_t,time_t等一般是在哪个头文件声明的阿????????????
|
在/usr/include/linux/types.h
不过也是typedef
一般情况下,你可以这样找一个定义,比如__kernel_time_t
grep -r __kernel_time_t /usr/include/*
可以看到一行:
asm/posix_types.h:typedef long __kernel_time_t;
不过也是typedef
一般情况下,你可以这样找一个定义,比如__kernel_time_t
grep -r __kernel_time_t /usr/include/*
可以看到一行:
asm/posix_types.h:typedef long __kernel_time_t;