调用stat64系列函数
来源:互联网 发布:js防水涂料 编辑:程序博客网 时间:2024/06/07 02:34
前文是对stat64系列函数的源码分析。下面将介绍如何在实际情况下调用stat64系列函数。
#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>int main(int argc,char **argv){ struct stat64 st64; stat64("/home",&st64); return 0;}
如果使用编译上述文件将报错。
stat.c:7:16: error: storage size of ‘st64’ isn’t known struct stat64 st64;
原因是找不到struct stat64的定义。
只要添加宏定义_GNU_SOURCE即可
#define _GNU_SOURCE#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>int main(int argc,char **argv){ struct stat64 st64; stat64("/home",&st64); return 0;}
阅读全文
1 0
- 调用stat64系列函数
- glibc源码分析之stat64系列函数
- 调用系列函数的方式
- 重构系列7.简化函数调用
- 反汇编系列(一) 基本函数调用
- loadView 系列函数的调用顺序
- clips系列二-clips调用外部函数
- 函数指针系列:用函数指针调用执行函数
- C语言基本功教程系列 快速的函数调用
- C语言基本功教程系列(3) - 快速的函数调用
- 复习C语言系列二:动态调用函数指针数组
- 程序基石系列之自动调用析函数
- VC里面快速调用Nt系列函数示例方法
- linux的子进程调用exec( )系列函数
- SAP接口编程-RFC系列03 : RFC调用SAP函数
- SAP接口编程-RFC系列04 : 动态调用SAP函数
- C++虚函数系列之三:虚函数调用的另类"注入"
- javascript入门系列演示·函数的定义以及简单参数使用,调用函数 .txt
- hibernate多表操作2(七)一对一、多对多
- 排序一个数组要求时间复杂度为O(N)
- POJ 1383 Labyrinth(两次bfs求最长路径)
- Java中常用的代码汇总(值得收藏的)
- Discuz的安装
- 调用stat64系列函数
- css3
- HDU6130 Kolakoski
- Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransien
- java输出指定位数的小数
- HDU 6121 Build a tree
- A
- python 结合mysql数据库,在win7上安装和简单的增删改查
- jquery ajax请求成功后eval(data)报错 SyntaxError: missing ; before statement