随笔分类 -  有限状态机及高级IO

摘要:文件锁 int lockf(int fd, int cmd, off_t len); int flock(int fd, int operation); int fcntl(int fd, int cmd, ... /* arg */ ); 例程:lockf.c #include <stdio.h> 阅读全文
posted @ 2022-08-01 09:01 *^VV^* 阅读(93) 评论(0) 推荐(0) 编辑
摘要:使用mmap创建进程间共享内存 例程:shm.c #include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include 阅读全文
posted @ 2022-08-01 08:51 *^VV^* 阅读(105) 评论(0) 推荐(0) 编辑
摘要:数据中继epoll模型 示例:relay_epoll.c #include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <fcntl.h>#include <errno.h>#include < 阅读全文
posted @ 2022-08-01 08:41 *^VV^* 阅读(34) 评论(0) 推荐(0) 编辑
摘要:数据中继poll模型 示例:relay_poll.c #include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <fcntl.h>#include <errno.h>#include <po 阅读全文
posted @ 2022-08-01 08:21 *^VV^* 阅读(41) 评论(0) 推荐(0) 编辑
摘要:数据中继select模型 示例:relay_select.c #include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <fcntl.h>#include <errno.h>#include 阅读全文
posted @ 2022-07-29 21:32 *^VV^* 阅读(34) 评论(0) 推荐(0) 编辑
摘要:通过有限状态机实现文件相互拷贝 示例:relay.c #include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <fcntl.h>#include <errno.h> #define FIL 阅读全文
posted @ 2022-07-28 09:50 *^VV^* 阅读(30) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示