Re: error setting pipe to non-blocking IO

2003-10-17 Thread Andy Howell
Brian Ford wrote: ioctl(pipefd[0], FIOBIO, &n); use: fcntl(pipefd[0], F_SETFL, O_NONBLOCK); instead. PTC for FIOBIO, although I can't even find what header that's in? fcntl did the trick. Thanks. FIONBIO come from sys/termios.h. I mis-spelled it in my message. Thanks again, Andy

error setting pipe to non-blocking IO

2003-10-17 Thread Andy Howell
I am trying to setup a pipe to do non-blocking IO: int main() { int pipefd[2]; int n; n = 1; pipe(pipefd); perror("Pipe: "); ioctl(pipefd[0], FIOBIO, &n); perror("Ioctl: "); } When I run this, I get: Pipe: No Error Ioctl: Invalid ar