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 at ara2:~ # cat >t.c #include <stdio.h> #include <signal.h> int main(void) { printf("%zu\n", sizeof(sigset_t)); return (0); } root at 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
Le 29/01/2011 23:03, Thorsten Glaser a ?crit :> [..] > No wonder mksh no longer works? any idea _why_, _where_, and how to fix? > > Thanks in advance, > //mirabilos >That's surely related to this commit : http://git.kernel.org/?p=libs/klibc/klibc.git;a=commitdiff;h=553466350c80a09da9414f007d34bd1a4d3a9aba I don't have the understanding of the exact problem and way to fix it. Maybe peter can help in that, Cheers, Erwan
Dixi quod?>root at ara2:~ # klcc -o tklibc t.c; gcc -o tglibc t.c; ./tklibc; ./tglibc >4 >128Hm. 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 ls shows: 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