随笔分类 - 网络编程
摘要:信号 信号概述 发送信号 #include <sys/types.h> #include <signal.h> //把信号sig发给目标进程;目标进程由pid参数指定 //pid>0,发送进程号为pid的进程 //pid=0,发送本进程组内的其他进程 //pid=-1,信号发送除给init进程外的所
阅读全文
摘要:打开和关闭文件 #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> //flags参数指明了进程打算如何访问这个文件:O_RDONLY,O_WRONLY,O_RDWR,O_CREAT,O_TRUNC,O_APPEND //m
阅读全文