http://codereview.appspot.com/5674072/diff/2001/src/pkg/runtime/sigqueue.goc File src/pkg/runtime/sigqueue.goc (right): http://codereview.appspot.com/5674072/diff/2001/src/pkg/runtime/sigqueue.goc#newcode144 src/pkg/runtime/sigqueue.goc:144: if(runtime·sigtab[i].flags & SigDefault) You have to declare runtime·sigtab[] in ...
13 years, 10 months ago
(2012-02-16 19:27:33 UTC)
#2
> I clearly don't, since this compiles just fine. ;-) you should put extern SigTab ...
13 years, 10 months ago
(2012-02-16 21:14:23 UTC)
#5
> I clearly don't, since this compiles just fine. ;-)
you should put
extern SigTab runtime.sigtab[];
at the top of the file. The fact that C code compiles
is not a guarantee that it is correct.
On Fri, Feb 17, 2012 at 8:14 AM, <rsc@golang.org> wrote: >> I clearly don't, since ...
13 years, 10 months ago
(2012-02-16 21:15:35 UTC)
#6
On Fri, Feb 17, 2012 at 8:14 AM, <rsc@golang.org> wrote:
>> I clearly don't, since this compiles just fine. ;-)
>
>
> you should put
>
> extern SigTab runtime.sigtab[];
>
> at the top of the file. The fact that C code compiles
> is not a guarantee that it is correct.
Done.
Actually, I have no idea why the C compiler would allow this code. I can't ...
13 years, 10 months ago
(2012-02-16 21:15:47 UTC)
#7
Actually, I have no idea why the C compiler would allow
this code. I can't find a forward declaration of runtime.sigtab
anywhere, and it would need one to determine what .flags means.
13 years, 10 months ago
(2012-02-16 21:18:41 UTC)
#8
http://codereview.appspot.com/5674072/diff/2001/src/pkg/runtime/sigqueue.goc
File src/pkg/runtime/sigqueue.goc (right):
http://codereview.appspot.com/5674072/diff/2001/src/pkg/runtime/sigqueue.goc#...
src/pkg/runtime/sigqueue.goc:144: if(runtime·sigtab[i].flags & SigDefault)
On 2012/02/16 21:13:17, dsymonds wrote:
> On 2012/02/16 19:27:33, minux wrote:
> > You have to declare runtime·sigtab[] in this file, or the code won't
compile.
>
> I clearly don't, since this compiles just fine. ;-)
Also, this is supposed to be portable, meaning not
Unix-specific. Can you put this code in signal_unix.c,
which already has the right extern declaration?
On Fri, Feb 17, 2012 at 8:18 AM, <rsc@golang.org> wrote: > Also, this is supposed ...
13 years, 10 months ago
(2012-02-16 21:29:08 UTC)
#9
On Fri, Feb 17, 2012 at 8:18 AM, <rsc@golang.org> wrote:
> Also, this is supposed to be portable, meaning not
> Unix-specific. Can you put this code in signal_unix.c,
> which already has the right extern declaration?
SigTab is in runtime.h, as are the flags, so it looks portable enough
to me. But I could put these bits into new functions in signal_unix.c
if you really want.
On Thu, Feb 16, 2012 at 16:29, David Symonds <dsymonds@golang.org> wrote: > SigTab is in ...
13 years, 10 months ago
(2012-02-16 21:36:57 UTC)
#10
On Thu, Feb 16, 2012 at 16:29, David Symonds <dsymonds@golang.org> wrote:
> SigTab is in runtime.h, as are the flags, so it looks portable enough
> to me. But I could put these bits into new functions in signal_unix.c
> if you really want.
setsig is not in runtime.h, and it is not implemented on
the non-unix systems. please put the code in signal_unix.c,
maybe runtime.sigenable(int32) with 0 meaning everything.
you'll need to add dummy functions to signal_windows.c
and signal_plan9.c too.
it is possible that if you run
GOOS=windows GOARCH=386 make.bash
it will do a windows build for you, to test that
it builds.
Okay, it's good to go now. Turns out that calling runtime·setsig on a signal the ...
13 years, 10 months ago
(2012-02-17 01:55:34 UTC)
#16
Okay, it's good to go now.
Turns out that calling runtime·setsig on a signal the second time
causes a mysterious panic. Rather than trying to unravel all that to
try to make it idempotent, I just changed runtime·sigenable(~0) to
only call runtime·setsig for SigDefault flags (i.e. the ones that
weren't enabled during runtime·initsig).
Dave.
Issue 5674072: code review 5674072: runtime: Permit default behaviour of SIGTSTP, SIGTTIN, ...
(Closed)
Created 13 years, 10 months ago by dsymonds
Modified 13 years, 10 months ago
Reviewers:
Base URL:
Comments: 9