[lkml]   [2001]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: A signal fairy tale
Shouldn't there be a sigclose() and other operations to make the API
orthogonal. sigopen() should be selective about the signals it allows
as argument. Try and make sigopen() thread specific, so that if one
thread does a sigopen(), it does not imply it will do all the signal
handling for all the threads.

Does using sigopen() imply that signal(), sigaction(), etc cannot be used.
In the same process one could do a sigopen() in the library, but the
process could use sigaction()/signal() without knowing what the library
does (which signals it handles, etc).

Let me know, when somebody has a patch or needs help, I would like to
help or take a look at it.


| sigopen - open a signal as a file descriptor
| #include <signal.h>
| int sigopen(int signum);
| The sigopen system call opens signal number signum as a file descriptor.
| That signal is no longer delivered normally or available for pickup
| with sigwait() et al. Instead, it must be picked up by calling
| read() on the file descriptor returned by sigwait(); the buffer passed to
| read() must have a size which is a multiple of sizeof(siginfo_t).
| Multiple signals may be picked up with a single call to read().
| When that file descriptor is closed, the signal is available once more
| for traditional use.
| A signal number cannot be opened more than once concurrently; sigopen()
| thus provides a way to avoid signal usage clashes in large programs.
| signal returns the new file descriptor, or -1 on error (in which case, errno
| is set appropriately).
| EWOULDBLOCK signal is already open
| read() will block when reading from a file descriptor opened by sigopen()
| until a signal is available unless fcntl(fd, F_SETFL, O_NONBLOCK) is called
| to set it into nonblocking mode.
| sigopen() first appeared in the 2.5.2 Linux kernel.
|Linux July, 2001 1

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:55    [W:0.067 / U:0.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site