--- libev/ev.pod 2009/07/27 01:10:17 1.263 +++ libev/ev.pod 2009/08/26 17:15:05 1.266 @@ -2110,17 +2110,33 @@ with the kernel (thus it coexists with your own signal handlers as long as you don't register any with libev for the same signal). -Both the signal mask state (C) and the signal handler state -(C) are unspecified after starting a signal watcher (and after -sotpping it again), that is, libev might or might not block the signal, -and might or might not set or restore the installed signal handler. - If possible and supported, libev will install its handlers with C (or equivalent) behaviour enabled, so system calls should not be unduly interrupted. If you have a problem with system calls getting interrupted by signals you can block all signals in an C watcher and unblock them in an C watcher. +=head3 The special problem of inheritance over execve + +Both the signal mask (C) and the signal disposition +(C) are unspecified after starting a signal watcher (and after +stopping it again), that is, libev might or might not block the signal, +and might or might not set or restore the installed signal handler. + +While this does not matter for the signal disposition (libev never +sets signals to C, so handlers will be reset to C on +C), this matters for the signal mask: many programs do not expect +certain signals to be blocked. + +This means that before calling C (from the child) you should reset +the signal mask to whatever "default" you expect (all clear is a good +choice usually). + +In current versions of libev, you can ensure that the signal mask is not +blocking any signals (except temporarily, so thread users watch out) by +specifying the C when creating the event loop. This is +not guaranteed for future versions, however. + =head3 Watcher-Specific Functions and Data Members =over 4 @@ -3665,7 +3681,7 @@ it is assumed that all these functions actually work on fds, even on win32. Should not be defined on non-win32 platforms. -=item EV_FD_TO_WIN32_HANDLE +=item EV_FD_TO_WIN32_HANDLE(fd) If C is enabled, then libev needs a way to map file descriptors to socket handles. When not defining this symbol (the @@ -3673,6 +3689,20 @@ correct. In some cases, programs use their own file descriptor management, in which case they can provide this function to map fds to socket handles. +=item EV_WIN32_HANDLE_TO_FD(handle) + +If C then libev maps handles to file descriptors +using the standard C<_open_osfhandle> function. For programs implementing +their own fd to handle mapping, overwriting this function makes it easier +to do so. This can be done by defining this macro to an appropriate value. + +=item EV_WIN32_CLOSE_FD(fd) + +If programs implement their own fd to handle mapping on win32, then this +macro can be used to override the C function, useful to unregister +file descriptors again. Note that the replacement function has to close +the underlying OS handle. + =item EV_USE_POLL If defined to be C<1>, libev will compile in support for the C(2)