linux学习
linux学习
greatwall_2012
这个作者很懒,什么都没留下…
展开
-
内网外围上网
https://zhidao.baidu.com/question/693760490626402324.html原创 2020-03-10 11:31:17 · 398 阅读 · 0 评论 -
vmvare 安装Ubuntu14.04 安装vmvaretool
https://jingyan.baidu.com/article/6079ad0e39242268fe86db78.html原创 2020-03-09 14:18:05 · 114 阅读 · 0 评论 -
linux 动态加载模块
my_driver.c#include <linux/module.h>int __init hello_init(void){ printk("hello world init!!!\n"); return 0;}void __exit hello_exit(void){ printk("hello world exit!!!\n");}modul...原创 2020-03-08 22:31:48 · 221 阅读 · 0 评论 -
命名UNIX域套接字通信
《UNIX环境高级编程》中开发的三个函数#include "apue.h"#include <sys/socket.h>#include <sys/un.h>#include <time.h>#include <errno.h>#define STALE 30 /* client's name can't be older tha...原创 2020-02-27 20:39:19 · 209 阅读 · 0 评论 -
UDP Server和Client源码实例
server#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <unistd.h>#include <stdlib.h>#include <string.h...转载 2020-02-27 10:26:48 · 467 阅读 · 1 评论 -
消息队列
接收者1:按顺序接收/* Here's the receiver program. */#include <stdlib.h>#include <stdio.h>#include <string.h>#include <errno.h>#include <unistd.h>#include <sys/msg.h&...原创 2020-02-22 14:40:50 · 162 阅读 · 0 评论 -
FIFO服务器程序以及客户端程序
服务器程序:#include "client.h"#include <ctype.h>#include <fcntl.h>int main(){ int server_fifo_fd, client_fifo_fd,server_fifo_fd_write; struct data_to_pass_st my_data; int read_...原创 2020-02-21 16:21:51 · 323 阅读 · 0 评论 -
把管道作为标准输入输出
#include <unistd.h>#include <stdlib.h>#include <stdio.h>#include <string.h>int main(){ int data_processed; int file_pipes[2]; const char some_data[] = "123";...原创 2020-02-20 21:51:55 · 563 阅读 · 1 评论 -
父子进程对文件描述符的影响
#include <fcntl.h>#include <stdio.h>#include <assert.h>#include <string.h>int main(int argc, char **args){ char buffer[2]; int fd = atoi(args[1]); memset(buff...原创 2020-02-20 21:01:01 · 263 阅读 · 0 评论 -
close on exec
close on exec, not on-fork 意思是如果对描述符设置了FD_CLOEXEC,使用execl执行的程序里,此描述符被关闭,此描述符不能再被使用. 但是在使用fork产生的子进程中此描述符不被关闭,仍然可以使用。 例如: cat fd_cloexec_flag_test.c #include <fcntl.h>...转载 2020-01-09 14:45:17 · 148 阅读 · 0 评论