On Wed, Jul 27, 2005 at 02:35:31PM +0000, Vincenzo Mallozzi wrote: > Hi, > I've a doubt on the behaviour of processes on receiving a signal. My doubt > reguards the write instruction. > In other word, if a process is writing into a memory page and receives a > signal, what's matter? > > 1) the process completes the write instruction and then handles the signal, or > > 2) the process is stopped and then, after the signal handling, continues the > execution (if not SIGSTOP signaled) 3) The write() call is aborted. The signal handler is called to handle the signal. After the signal handler returns, the write() call returns the amount of bytes written so far. If there wasn't any data written yet, write() returns -1 and errno is set to EINTR. (so that's why you should always check return values). See "Advanced programming in the Unix environment" for the gory details. Erik -- Erik Mouw J.A.K.Mouw@xxxxxxxxxxxxxx mouw@xxxxxxxxxxxx
Attachment:
signature.asc
Description: Digital signature