LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2012 The Go Authors. All rights reserved. | 1 // Copyright 2012 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // +build darwin dragonfly freebsd linux netbsd openbsd solaris | 5 // +build darwin dragonfly freebsd linux netbsd openbsd solaris |
6 | 6 |
7 #include "runtime.h" | 7 #include "runtime.h" |
8 #include "defs_GOOS_GOARCH.h" | 8 #include "defs_GOOS_GOARCH.h" |
9 #include "os_GOOS.h" | 9 #include "os_GOOS.h" |
10 #include "signal_unix.h" | 10 #include "signal_unix.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } else { | 86 } else { |
87 it.it_interval.tv_sec = 0; | 87 it.it_interval.tv_sec = 0; |
88 it.it_interval.tv_usec = 1000000 / hz; | 88 it.it_interval.tv_usec = 1000000 / hz; |
89 it.it_value = it.it_interval; | 89 it.it_value = it.it_interval; |
90 runtime·setitimer(ITIMER_PROF, &it, nil); | 90 runtime·setitimer(ITIMER_PROF, &it, nil); |
91 } | 91 } |
92 g->m->profilehz = hz; | 92 g->m->profilehz = hz; |
93 } | 93 } |
94 | 94 |
95 void | 95 void |
96 os·sigpipe(void) | 96 runtime·sigpipe(void) |
97 { | 97 { |
98 runtime·setsig(SIGPIPE, SIG_DFL, false); | 98 runtime·setsig(SIGPIPE, SIG_DFL, false); |
99 runtime·raise(SIGPIPE); | 99 runtime·raise(SIGPIPE); |
100 } | 100 } |
101 | 101 |
102 void | 102 void |
103 runtime·crash(void) | 103 runtime·crash(void) |
104 { | 104 { |
105 #ifdef GOOS_darwin | 105 #ifdef GOOS_darwin |
106 // OS X core dumps are linear dumps of the mapped memory, | 106 // OS X core dumps are linear dumps of the mapped memory, |
107 // from the first virtual byte to the last, with zeros in the gaps. | 107 // from the first virtual byte to the last, with zeros in the gaps. |
108 // Because of the way we arrange the address space on 64-bit systems, | 108 // Because of the way we arrange the address space on 64-bit systems, |
109 // this means the OS X core file will be >128 GB and even on a zippy | 109 // this means the OS X core file will be >128 GB and even on a zippy |
110 // workstation can take OS X well over an hour to write (uninterruptible
). | 110 // workstation can take OS X well over an hour to write (uninterruptible
). |
111 // Save users from making that mistake. | 111 // Save users from making that mistake. |
112 if(sizeof(void*) == 8) | 112 if(sizeof(void*) == 8) |
113 return; | 113 return; |
114 #endif | 114 #endif |
115 | 115 |
116 runtime·unblocksignals(); | 116 runtime·unblocksignals(); |
117 runtime·setsig(SIGABRT, SIG_DFL, false); | 117 runtime·setsig(SIGABRT, SIG_DFL, false); |
118 runtime·raise(SIGABRT); | 118 runtime·raise(SIGABRT); |
119 } | 119 } |
LEFT | RIGHT |