0
我有一個計劃,如果管道存在,或者不檢查,以便在函數中寫道的:SIGSTOP信號每次我跑我的程序命名管道在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 = open(「recv」,O_WRONLY);說線程1:信號SIGSTOP,雖然它工作正常,只是fd2 =開放(「發送」,O_RDONLY);我不知道爲什麼它給這個錯誤?我是Linux新手。