Jorge Israel Peña 2cd70f4342 replace signal() call with sigaction() for better portability
signal() is known to have portability problems. Some systems such as
old Unix systems and System V employ a behavior in which the signal
disposition is reset to SIG_DFL (default) upon invocation of a signal
handler by the delivery of a signal.

See issue #51 in which Solaris users experience signal-based issues.

Solaris is a system which employs the SIG_DFL reset behavior even in
version 11.1.

See http://docs.oracle.com/cd/E26502_01/html/E29034/signal-3c.html

> If signal() is used, disp is the address of a signal handler, and sig is not SIGILL,
> SIGTRAP, or SIGPWR, the system first sets the signal's disposition to SIG_DFL before
> executing the signal handler.

On Solaris the default signal disposition for SIGUSR1 is to exit the application.

See http://docs.oracle.com/cd/E26502_01/html/E29033/signal.h-3head.html

If I'm correct in assuming this is the problem Solaris users are encountering,
the solution to this (and likely any other portability issues that may arise)
is to use sigaction() which has explicitly defined behavior as per the POSIX standards.

As you can see, it's a pretty drop-in solution. In fact, on some systems such as Linux,
glibc defines signal() as a wrapper around sigaction() to use BSD semantics (i.e. not the
behavior detailed above), which is likely why few others have experienced these problems.

See http://man7.org/linux/man-pages/man2/signal.2.html
2013-04-07 19:41:32 -07:00
2012-08-28 12:35:10 +01:00
2013-02-26 17:44:42 +09:00
2005-01-25 18:47:10 +00:00
2005-01-25 18:47:10 +00:00
2013-02-26 17:44:42 +09:00
2005-01-25 18:47:10 +00:00
2005-01-25 18:47:10 +00:00
2011-12-10 22:58:02 +09:00
2005-01-25 18:47:10 +00:00

BUILDING

 Run "./autogen.sh" to generate the configure scripts if
nessesary. The man page "doc/rtorrent.1" must be generated with
"docbook2man rtorrent.1.xml" if it is missing.

 Note that rtorrent follows the development of libtorrent closely, and
thus the versions must be in sync. This should not be nessesary in the
future, when the library API stabilizes.

USAGE

 See the man page or website for instructions.

LICENSE

 GNU GPL, see COPYING. "libtorrent/src/utils/sha_fast.{cc,h}" is
originally from the Mozilla NSS and is under a triple license; MPL,
LGPL and GPL. An exception to non-NSS code has been added for linking
to OpenSSL as requested by Debian, though the author considers that
library to be part of the Operative System and thus linking is allowed
according to the GPL.

 Use whatever fits your purpose, the code required to compile with
Mozilla's NSS implementation of SHA1 has been retained and can be
compiled if the user wishes to avoid using OpenSSL.

DEPENDENCIES

  libcurl >= 7.12.0
  ncurses

CONTACT

 Send bug reports, suggestions and patches to <jaris@ifi.uio.no> or
to the mailinglist.
S
Description
Languages
C++ 93.5%
M4 5.9%
Makefile 0.3%
Lua 0.2%
C 0.1%