On Thu, Feb 27, 2003 at 11:43:08AM -0800, Seth Arnold wrote: > On Thu, Feb 27, 2003 at 08:30:50PM +0100, Frank A. Uepping wrote: > > > #define ERESTARTNOHAND 514 /* restart if no handler.. */ > > What handler (signal handler)? > > Yes; BSD introduced restartable systemcalls around 1985 or so; if the > system call was interrupted by a signal, rather than simply returning > EINTR, it would try to restart the system call for the process. > > I suggest checking out W Richard Stevens's absolutely wonderful book, > Advanced Programming in the Unix Environment. It is well worth its cost. ... the syscall is restarted if: - It returns -ERESTARTSYS and the signal handler did not exit via a longjump or terminate the process. - It returns -ERESTARTNOHAND and the signal is ignored. It should set errno EINTR if it is handled since ERESTARTNOHAND is only defined in kernel. Unfortunately you get no indication whatsoever that the syscall is restarted and no indication whatsoever that it will not be restarted. IIRC select uses this, so select is interrupted by signals except those ignored. ------------------------------------------------------------------------------- Jan 'Bulb' Hudec <bulb@ucw.cz> -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/