UNIXプログラミング質問すれ Part7
■ このスレッドは過去ログ倉庫に格納されています
0552デフォルトの名無しさん
2005/12/26(月) 15:43:32#define READ 0
#define WRITE 1
int main()
{
fd_setfdset;
charstr[80],cmd[80];
intpipe[2];
if(pipe(pipe)){
printf("->pipe_error\n");
}
fd = pipe[0];
FD_ZERO(&fdset);
FD_SET(fd, &fdset);
if(fork()){
switch(select(fd, &fdset, NULL, NULL, NULL )){
case -1: break;
default:
if(FD_ISSET(fd, &fd_set)){
read(pipe[READ], cmd, sizeof(cmd))←ここに入ってこない
}
break;
}
}
else{
strcpy(str, "0987654321");
write(pipe[WRITE], str, sizeof(str));
}
}
readできないのです・・・
■ このスレッドは過去ログ倉庫に格納されています