[parted-devel] Parted on GNU Hurd based systems

Debarshi 'Rishi' Ray debarshi.ray at gmail.com
Wed Feb 28 00:04:11 CET 2007


> A new problem has cropped up. In parted/ui.c, the function init_ui uses the
> SA_SIGINFO constant to set the flags passed to sigaction. Although the entire
> block is within a '#ifdef HAVE_SIGACTION....#endif', we are not checking
> whether the SA_SIGINFO is defined in glibc or not. While building in Debian
> GNU/Hurd 4.0 I found out that although the sigaction function is mentioned in
> /usr/include/bits/sigaction.h, SA_SIGINFO is not defined in the library. This
> seems to be a known issue in the Hurd kernel, and is confirmed by #hurd.
> According to Guillem Jover (braindmg) we should check for the availability of
> SA_SIGINFO at build-time, since it is a POSIX XSI extension.

Please find attached a 'diff -uNp' of parted/ui.c to solve this problem.

Instead of checking for the presence of the sigaction function in
signal.h using HAVE_SIGACTION, I am checking for the availabilty of
the SA_SIGINFO constant in signal.h. I have done this because even if
sigaction is available and SA_SIGINFO is not, as in Hurd, then we are
stuck with using a signal handler having the signature:
void handler (int signum);

All those cases where SA_SIGINFO is not available I have used the
'signal' function, as was being done before. The difference this time
around is that I have used separate signal handler definitions for
cases where it is present and where it is not to ensure that the
signal handler signature is exactly what is expected by sigaction and
signal.

Comments...

Happy hacking,
Debarshi
-- 
GPG key ID: 63D4A5A7
Key server: pgp.mit.edu



More information about the parted-devel mailing list