site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Sep 17, 2011, at 15:35 , Jonas Maebe wrote: On 17 Sep 2011, at 21:17, Ingemar Ragnemalm wrote: -- Steve Checkoway _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com You are right, that did it for this example! Only one detail: AFAIK the EINTR checks are superfluous in the default setting, since the default behavior is to restart the interrupted call. I'm fairly sure that's not true. The FPC run time library missed several such EINTR checks when I first did the Mac OS X port, and this caused a lot of problems on Mac OS X until I fixed them. These errors hadn't been noticed before because interrupted systems are much less likely to happen on Linux than on Mac OS X (or they were at least back then, around 2004). Maybe I'm misreading the sigaction(2) man page, but it seems to say that the only system calls that might return EINTR when interrupted by a signal are "open(2), read(2), write(2), sendto(2), recvfrom(2), sendmsg(2), and recvmsg(2) on a communications channel or slow device (such as a terminal, but not a regular file) and during a wait(2) or ioctl(2)." (However, the man page says "including" rather than "are" so it's possible it really is just giving a partial list.) Of course, the close(2) man page includes EINTR. I think the only way those would not be restarted is if a signal handler for the signal were installed via sigaction(2) without using the SA_RESTART flag (signal(3) uses the SA_RESTART flag) or the behavior is changed via siginterrupt(3). That is, from what I've read restart is the default behavior on Mac OS X. I suppose one could check the xnu source to be sure. smime.p7s
participants (1)
-
Steve Checkoway