每次我在linux c++中为命名管道运行程序时,都会发出SIGSTOP信号
SIGSTOP signal everytime i run my program for named pipe in linux c++
我有一个检查管道是否存在的程序,所以在一个函数中写道:
status = mkfifo("recv",0666);
fd1 = open("recv",O_WRONLY);
fd2 = open("sendd", O_RDONLY);
cout<<"we are checking botth bcz we have both read and write in the program------:)";
if(fd1 <0 && fd2 <0)
{
//strerror(errno);
err = 1;// a const for remote
}
else if(fd1 >0 || fd2 >0){
err = 2; // a const for local
}
else{
err = 3; // a const for progrm failure error
cout<<"program has some problems";
}
但每次我运行程序时,它都会在fd1=打开("recv",O_WRONLY)处停止;称Thread1:信号SIGSTOP,尽管它只在fd2=open("sendd",O_RDONLY)下正常工作;我不知道它为什么会犯这个错误??我是linux管道的新手。
RTF,http://linux.die.net/man/3/mkfifo
一旦你用这种方式创建了一个FIFO特殊文件,任何进程都可以像普通文件一样打开它进行读取或写入。然而,它必须在两端同时打开,然后才能继续对其进行任何输入或输出操作。打开FIFO进行正常读取会阻塞,直到其他进程打开相同的FIFO进行写入,反之亦然。
相关文章:
- 获取日期异步信号安全吗?如果在信号处理程序中使用,它会导致死锁吗
- 如何在信号处理程序和普通函数中对全局变量进行互斥读写操作
- 有可能在信号处理程序中设置promise吗
- 在信号处理程序中捕获C++未处理的异常并恢复应用程序
- 通过安装信号处理程序关闭多线程应用程序
- 为什么我的信号处理程序只执行一次?
- GTK C++:找不到信号处理程序 您是否使用 -rdynamic 进行了编译?
- C++ 在信号处理程序后继续执行
- 没有信号处理程序的POSIX定时器的目的是什么?
- 为什么这个信号处理程序不能捕获 SIGHUP 或 SIGQUIT?
- 如何在C++中使用 std::bind 函数作为信号处理程序?
- C++ - 程序接收信号SIGSEGV,分段错误.In msvcrt!memcpy () (C:\Windows\S
- 在 C++17 中,是否未定义使用无锁原子学保护从信号处理程序传递的数据?
- 我应该使用什么信号来终止/终止Windows上的应用程序
- 如何将信号处理程序添加为方法
- 窗口上信号处理程序的异步安全写入函数
- sqlite3 程序接收信号 SIGSEGV,分段错误在 sqlite3_get_table ()
- 使用信号处理程序处理从 FIFO 接收的数据
- 程序在没有操作系统信号的情况下在函数中的特定行挂起
- 当通知程序/信号超出范围时,在提升绑定中解除分配回调侦听器对象