
系统编程
silentlambj
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
编写一个程序,利用多进程以及无名管道,实现下述命令的执行效果:ls | wc -w
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> #include <fcntl.h> int ma原创 2018-06-21 14:16:38 · 1456 阅读 · 0 评论 -
(转)linux c 获取系统时间
使用C语言编写程序需要获得当前精确时间(1970年1月1日到现在的时间),或者为执行计时,可以使用gettimeofday()函数。 #include <sys/time.h> int gettimeofday(struct timeval*tv, struct timezone *tz); 其参数tv是保存获取时间结果的结构体,参数tz用于保存时区结果: 结构体...转载 2018-06-22 10:34:29 · 758 阅读 · 0 评论 -
GCC 编译 链接选项-I,-l,-L,-Wl:rpath
-I,添加包含路径(大写i)-I 在编译时用,告诉编译器去哪个路径下找文件如:-I /home/hello/include表示将/home/hello/include目录作为第一个寻找头文件的目录。编译器的寻找顺序是:/home/hello/include-->/usr/include-->/usr/local/include。如果在/home/hello/include中有个文件he...转载 2018-07-12 11:00:50 · 6912 阅读 · 0 评论