1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // +build gc
6
7 #include "textflag.h"
8
9 TEXT ·RewindAndSetgid(SB),NOSPLIT,$0-0
10 MOVL $·Baton(SB), BX
11 // Rewind stack pointer so anything that happens on the stack
12 // will clobber the test pattern created by the caller
13 ADDL $(1024 * 8), SP
14
15 // Ask signaller to setgid
16 MOVL $1, (BX)
17
18 // Wait for setgid completion
19 loop:
20 PAUSE
21 MOVL (BX), AX
22 CMPL AX, $0
23 JNE loop
24
25 // Restore stack
26 SUBL $(1024 * 8), SP
27 RET
28
View as plain text