On Thu, Aug 18, 2011 at 2:10 AM, Rich Felker <[email protected]> wrote: > On Thu, Aug 18, 2011 at 01:11:37AM +0200, Denys Vlasenko wrote: >> > you simply >> > call poll first (or select, but select requires the fd # to be < 1024) >> > to check that it won't block, then call read. select and poll are >> > specified to only mark the fd readable if a read would not block. >> >> An example from a different area of Unix API: >> >> EINTR is supposed to be returned only if non-DFL, >> non-IGN signal was reseived and handler was executed. >> Right? Right... but... >> real world chimes in: EINTR also may be returned if someone >> happened to attach to your program with "strace -p PID" >> while you are in a syscall. Syscall may return EINTR even though >> *no signal whatsoever* was delivered. > > This is only true for non-restartable syscalls like sleep. open, read, > write, etc. can never return EINTR unless interrupted by a > non-restarting signal handler.
Got just a few minutes ago in a freshly opened gnome term: + -------------------------- | bash: printf: write error: Interrupted system call | $ _ | | Real world stroke again. EINTR which "can't happen" happened. -- vda _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
