前文介绍了stat系列函数的源码实现,本文将向大家介绍stat64系列函数的源码实现。
stat64系列函数包括stat64,fstat64,lstat64。由于stat系列函数只能获取32位长度的文件的属性,所以glibc又提供了stat64系列函数,用于获取64位长度的文件的属性。
stat64的源码如下:
#undef stat64
int
attribute_hidden
stat64 (const char *file, struct stat64 *buf)
{
return __xstat64 (_STAT_VER, file, buf);
}
stat64调用了__xstat64 函数,完成文件属性的获取。
__xstat64 定义在sysdeps/unix/sysv/linux/xstat64.c文件中。
int
___xstat64 (int vers, const