Bug#516294: On the trail of sigsuspend(2)

2011-01-29 Thread Thorsten Glaser
SIGSUSPEND(2)  Linux Programmer's Manual SIGSUSPEND(2)

NAME
   sigsuspend - wait for a signal

SYNOPSIS
   #include signal.h

   int sigsuspend(const sigset_t *mask);

… and …

SIGSUSPEND(2)  BSD Programmer's Manual   SIGSUSPEND(2)

NAME
 sigsuspend - atomically release blocked signals and wait for interrupt

SYNOPSIS
 #include signal.h

 int
 sigsuspend(const sigset_t *sigmask);

… but …

root@ara2:~ # cat t.c
#include stdio.h
#include signal.h

int main(void) {
printf(%zu\n, sizeof(sigset_t));
return (0);
}
root@ara2:~ # klcc -o tklibc t.c; gcc -o tglibc t.c; ./tklibc; ./tglibc
4
128


No wonder mksh no longer works… any idea _why_, _where_, and how to fix?

Thanks in advance,
//mirabilos
-- 
“It is inappropriate to require that a time represented as
 seconds since the Epoch precisely represent the number of
 seconds between the referenced time and the Epoch.”
-- IEEE Std 1003.1b-1993 (POSIX) Section B.2.2.2



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#516294: On the trail of sigsuspend(2)

2011-01-29 Thread Thorsten Glaser
Dixi quod…

root@ara2:~ # klcc -o tklibc t.c; gcc -o tglibc t.c; ./tklibc; ./tglibc
4
128

Hm. Apparently, it’s not that, because klibc appears to use the
old-style functions and old_sigset_t is a long, so okay. (And
no, it’s not related to that commit, 1.5.20 was broken too.)

strace ./mksh -c lsshows:
sigsuspend([INT ILL USR1 USR2 ALRM CHLD CONT STOP WINCH]

Funnily enough, strace /bin/mksh -c ls says:
rt_sigsuspend([])   = ? ERESTARTNOHAND (To be restarted)

Now, from what I can gather from the manpages (this signal stuff
is not my code and way past me by now, especially considering the
time of day), sigprocmask() fills in sm_default which is used as
sigsuspend() argument in the only place it’s called.

Still, one has to wonder whether it’s related to this:
- ticket: http://dev.haiku-os.org/ticket/5567
- commit: http://dev.haiku-os.org/changeset/35836
The symptoms are the same.

bye,
//mirabilos
-- 
I believe no one can invent an algorithm. One just happens to hit upon it
when God enlightens him. Or only God invents algorithms, we merely copy them.
If you don't believe in God, just consider God as Nature if you won't deny
existence.  -- Coywolf Qi Hunt



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org