fifo_write0fzc.c
来源:互联网 发布:2016好听的网络歌曲 编辑:程序博客网 时间:2024/06/06 01:12
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define FIFO_SERVER "/tmp/myfifo"
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define FIFO_SERVER "/tmp/myfifo"
main(int argc,char** argv)
{
int fd;
char w_buf[100];
int nwrite;
{
int fd;
char w_buf[100];
int nwrite;
/*打开管道*/
fd=open(FIFO_SERVER,O_WRONLY|O_NONBLOCK,0);
if(argc==1)
{
printf("Please send something\n");
exit(-1);
}
strcpy(w_buf,argv[1]);
fd=open(FIFO_SERVER,O_WRONLY|O_NONBLOCK,0);
if(argc==1)
{
printf("Please send something\n");
exit(-1);
}
strcpy(w_buf,argv[1]);
/* 向管道写入数据 */
if((nwrite=write(fd,w_buf,100))==-1)
{
if(errno==EAGAIN)
printf("The FIFO has not been read yet.Please try later\n");
}
else
printf("write %s to the FIFO\n",w_buf);
}
if((nwrite=write(fd,w_buf,100))==-1)
{
if(errno==EAGAIN)
printf("The FIFO has not been read yet.Please try later\n");
}
else
printf("write %s to the FIFO\n",w_buf);
}
0 0
- fifo_write0fzc.c
- c
- c
- c
- c
- C
- c
- c
- c
- C+
- c
- C
- c
- c
- c
- C
- C
- c
- CF 777B
- Mysql,Oracle,SqlServer三大数据库【关键字一览表】
- 【AOSP BUG】IndexOutOfBoundsException in NotificationManagerService.java
- linux安装elasticsearch5.0.x-安装篇
- 用无名管道重定向子进程的输入输出
- fifo_write0fzc.c
- 理解Python中的with…as…语法
- java基础_day0018_数组_ArrayUtil_最大值_最小值_交换_复制_平均值_求和
- oracle清空某列数据
- 回车与换行字符
- Tomcat 8.5.6 登录控制台界面查看 状态
- uboot简介
- echarts3学习
- StrutsPrepareAndExecuteFilter