您可以在sys/stat.h 中看到这两个结构体被一模一样的写了两遍,而不是typedef或者define
以下是引用你们都要疼我哦在2010-7-10 03:24:45的发言:
移植 封装 扩充 简化。。。
typedef
define
#ifndef _STAT_DEFINED
struct _stat {
_dev_t st_dev;
_ino_t st_ino;
unsigned short st_mode;
short st_nlink;
short st_uid;
short st_gid;
_dev_t st_rdev;
_off_t st_size;
time_t st_atime;
time_t st_mtime;
time_t st_ctime;
};
#if
!__STDC__
/* Non-ANSI names for compatibility */
struct stat {
_dev_t st_dev;
_ino_t st_ino;
unsigned short st_mode;
short st_nlink;
short st_uid;
short st_gid;
_dev_t st_rdev;
_off_t st_size;
time_t st_atime;
time_t st_mtime;
time_t st_ctime;
};
#endif
/* __STDC__ */