?? fifo.c
字號(hào):
#include<stdio.h>#include<sys/types.h>#include<sys/stat.h>#include<fcntl.h>#include<unistd.h>#include<stdlib.h>#include<string.h>int main(){char msg[100];int fd;//mknod("genfifo",S_IFIFO | 0666,0) //dont create it twice fd=open("genfifos",O_RDONLY );printf("sayooj type from fifopro.c\n");if(fd==-1) { printf("error in opening"); }while(1){read(fd,msg,sizeof(msg));printf("message is : %s ",msg);sleep(5); //make consumer slow}close(fd); return 0;}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -