glibc源码分析之stat64系列函数
来源:互联网 发布:linux arp表老化时间 编辑:程序博客网 时间:2024/05/18 14:44
前文介绍了stat系列函数的源码实现,本文将向大家介绍stat64系列函数的源码实现。
stat64系列函数包括stat64,fstat64,lstat64。由于stat系列函数只能获取32位长度的文件的属性,所以glibc又提供了stat64系列函数,用于获取64位长度的文件的属性。
stat64的源码如下:
#undef stat64intattribute_hiddenstat64 (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 char *name, struct stat64 *buf){ int result; result = INLINE_SYSCALL (stat64, 2, name, buf); return result;}
调用了stat64系统调用。
fstat64函数源码如下:
#undef fstat64intattribute_hiddenfstat64 (int fd, struct stat64 *buf){ return __fxstat64 (_STAT_VER, fd, buf);}
fstat64 函数调用了__fxstat64 函数。
__fxstat64 函数定义在sysdeps/unix/sysv/linux/fxstat64.c文件中。
int___fxstat64 (int vers, int fd, struct stat64 *buf){ int result; result = INLINE_SYSCALL (fstat64, 2, fd, buf); return result;}
lstat64函数源码如下:
#undef lstat64intattribute_hiddenlstat64 (const char *file, struct stat64 *buf){ return __lxstat64 (_STAT_VER, file, buf);}
lstat64 函数调用了__lxstat64 函数。
__lxstat64 函数定义在sysdeps/unix/sysv/linux/lxstat64.c文件中。
int___lxstat64 (int vers, const char *name, struct stat64 *buf){ int result; result = INLINE_SYSCALL (lstat64, 2, name, buf); return result;}
阅读全文
1 0
- glibc源码分析之stat64系列函数
- glibc源码分析之stat系列函数
- glibc源码分析之chmod系列函数
- glibc源码分析之truncate系列函数
- glibc源码分析之chown系列函数
- glibc源码分析之utime系列函数
- glibc源码分析之statfs系列函数
- 调用stat64系列函数
- glibc源码分析之access函数
- glibc源码分析之rename函数
- glibc函数exit源码分析
- glibc源码分析之普通文件读写
- glibc源码分析之getpriority,setpriority,nice
- glibc源码分析之用户管理
- glibc 系列之strlen()函数
- [glibc源码分析] bzero
- strlen glibc 源码分析
- glibc--memcpy源码分析
- select
- leetcode 29. Divide Two Integers
- ElasticSearch常见错误整理
- JAVA开发的23种设计模式之 --- 适配器模式
- LeetCode 410. Split Array Largest Sum
- glibc源码分析之stat64系列函数
- HDU-1181 变形课(多种方式,好题)
- 最后冲刺!!!
- 数组剔除元素后的乘积
- chmod命令详细用法
- vuejs 移动端解决click 300ms延迟
- collection 和collections有什么区别
- 2017.8.15 阿狸的打字机 失败总结
- ubuntu16.04安装mlab步骤及错误处理