Messages in this thread |  | | Subject | Re: 2.4.0-test6 network socket problems | Date | Fri, 13 Oct 2000 23:37:29 +0100 (BST) | From | Alan Cox <> |
| |
> I've found the problem. This type of loop does not work: > > do { > alarm(t); > read(fd); > if (EINT) > exception(); > else > alarm(0); > } while (data); > > There are some semantics here that differ from other *nix where this > works. The read() won't come out when the alarm comes, and the socket > will effectively become broken.
The restart or continue behaviour is undefined unless you use sigaction() to control your signal behaviour (see POSIX.1 or SuS). Even then your code is buggy on every OS I know
Suppose this happens..
alarm(1) [sudden swap frenzy] alarm is delivered.. do nothing read
blocks forever. You need to make clever use of siglongjmp to avoid that one occurring or use select/poll.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
|  |