How does one do a time-out using alarm() call? It seems
that syscall read() is not aborted by alarm()..

  int rd, try = 0;
  char buf[1024];

  while(try < 2) {
     alarm(2 * 1000);
     rd = read(0, buf, 1024);
     alarm(0);
     if(rd > 0) {
        write(1, buf, rd);
        break;
     }
  }

-ishwar

Reply via email to