File tree 1 file changed +34
-1
lines changed
1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change 7
7
8
8
package runtime
9
9
10
- import "runtime/internal/atomic"
10
+ import (
11
+ "runtime/internal/atomic"
12
+ "unsafe"
13
+ )
11
14
12
15
//go:noescape
13
16
func uname (utsname * new_utsname ) int
@@ -55,6 +58,36 @@ func osArchInit() {
55
58
return
56
59
}
57
60
61
+ if major == 5 && minor == 4 && patch < 2 {
62
+ // All 5.4 versions of Ubuntu are patched.
63
+ procVersion := []byte ("/proc/version\000 " )
64
+ f := open (& procVersion [0 ], _O_RDONLY , 0 )
65
+ if f >= 0 {
66
+ var buf [512 ]byte
67
+ p := noescape (unsafe .Pointer (& buf [0 ]))
68
+ n := read (f , p , int32 (len (buf )))
69
+ closefd (f )
70
+
71
+ needle := []byte ("Ubuntu" )
72
+ contains:
73
+ for i , c := range buf [:n ] {
74
+ if c != needle [0 ] {
75
+ continue
76
+ }
77
+ if int (n )- i < len (needle ) {
78
+ break
79
+ }
80
+ for j , c2 := range needle {
81
+ if c2 != buf [i + j ] {
82
+ continue contains
83
+ }
84
+ }
85
+ // This is an Ubuntu system.
86
+ return
87
+ }
88
+ }
89
+ }
90
+
58
91
if major == 5 && (minor == 2 || minor == 3 && patch < 15 || minor == 4 && patch < 2 ) {
59
92
gsignalInitQuirk = mlockGsignal
60
93
if m0 .gsignal != nil {
You can’t perform that action at this time.
0 commit comments