📄 fi2.c
字号:
#include <stdio.h>#include <stdlib.h>#include <fcntl.h>#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>#define FIFO_FILE "myfifo"int main(){ int fifo_fd,i=0,n,total_byte=0; char sendbuf[4096+1]; fifo_fd=open(FIFO_FILE,O_WRONLY); while(i<4){ n=write(fifo_fd,sendbuf,4096); printf("%d write %d bype\n",getpid(),n); total_byte+=n; i++; } close(fifo_fd); printf("Process %d finished\n",getpid()); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -