摘要: ###用系统调用实现who命令mywho ###使用man who 和man -k utmp进行学习 ####代码: #include <stdio.h> #include <stdlib.h> #include <utmp.h> #include <fcntl.h> #include <unist 阅读全文
posted @ 2022-10-15 21:27 20201224吴卓航 阅读(13) 评论(0) 推荐(0) 编辑
摘要: ###改进后代码: #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <stdlib.h> #include <errno.h 阅读全文
posted @ 2022-10-15 20:34 20201224吴卓航 阅读(16) 评论(0) 推荐(0) 编辑
摘要: ###打开目录文件 ###针对目录文件 ####读取目录条目 ####显示文件名 ###关闭文件目录文件 ###代码: #include <stdio.h> #include <sys/types.h> #include <dirent.h> #include <sys/stat.h> #inclu 阅读全文
posted @ 2022-10-15 20:28 20201224吴卓航 阅读(16) 评论(0) 推荐(0) 编辑
摘要: ##学习使用stat(1),并用C语言实现 ###提交学习stat(1)的截图 ####使用man 1 stat打开stat手册页: ####命令选项: -L, --dereference:跟随符号链接解析原文件而非符号链接; -f, --file-system:显示文件所在文件系统信息而非文件信息 阅读全文
posted @ 2022-10-15 10:49 20201224吴卓航 阅读(37) 评论(0) 推荐(0) 编辑
摘要: #笔记 ##第四章 并发编程 ###并行计算导论 并行计算是一种计算方法,通过使用多个执行并行算法的处理器相较串行计算更快地解决问题。 ####顺序算法与并行算法 顺序算法 begin step_1; step_2; ... step_n; end // next step 并行算法 cobegin 阅读全文
posted @ 2022-10-15 09:57 20201224吴卓航 阅读(17) 评论(0) 推荐(0) 编辑