diff options
author | Ian Lance Taylor <iant@golang.org> | 2019-04-03 16:31:13 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2019-10-20 21:15:55 +0000 |
commit | 3b0aa546d289390027ee1bf1a5e41f37f6131fa7 (patch) | |
tree | 631fafe6c7e524f3c27b5c58581bad68b0334390 /src/runtime/sys_openbsd_386.s | |
parent | 504fce98ba3052135ec1f9564e06819f42cdbc86 (diff) | |
download | go-3b0aa546d289390027ee1bf1a5e41f37f6131fa7.tar.gz go-3b0aa546d289390027ee1bf1a5e41f37f6131fa7.zip |
runtime: define nonblockingPipe
This requires defining pipe, pipe2, and setNonblock for various platforms.
The new function is currently only used on AIX. It will be used by
later CLs in this series.
Updates #27707
Change-Id: Id2f987b66b4c66a3ef40c22484ff1d14f58e9b31
Reviewed-on: https://go-review.googlesource.com/c/go/+/171822
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/sys_openbsd_386.s')
-rw-r--r-- | src/runtime/sys_openbsd_386.s | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/runtime/sys_openbsd_386.s b/src/runtime/sys_openbsd_386.s index 31c837cd81..1a216a572f 100644 --- a/src/runtime/sys_openbsd_386.s +++ b/src/runtime/sys_openbsd_386.s @@ -50,6 +50,26 @@ TEXT runtime·read(SB),NOSPLIT,$-4 MOVL AX, ret+12(FP) RET +// func pipe() (r, w int32, errno int32) +TEXT runtime·pipe(SB),NOSPLIT,$8-12 + MOVL $263, AX + LEAL r+0(FP), BX + MOVL BX, 4(SP) + INT $0x80 + MOVL AX, errno+8(FP) + RET + +// func pipe2(flags int32) (r, w int32, errno int32) +TEXT runtime·pipe2(SB),NOSPLIT,$12-16 + MOVL $101, AX + LEAL r+4(FP), BX + MOVL BX, 4(SP) + MOVL flags+0(FP), BX + MOVL BX, 8(SP) + INT $0x80 + MOVL AX, errno+12(FP) + RET + TEXT runtime·write1(SB),NOSPLIT,$-4 MOVL $4, AX // sys_write INT $0x80 @@ -416,4 +436,21 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$32 NEGL AX RET +// func runtime·setNonblock(fd int32) +TEXT runtime·setNonblock(SB),NOSPLIT,$16-4 + MOVL $92, AX // fcntl + MOVL fd+0(FP), BX // fd + MOVL BX, 4(SP) + MOVL $3, 8(SP) // F_GETFL + MOVL $0, 12(SP) + INT $0x80 + MOVL fd+0(FP), BX // fd + MOVL BX, 4(SP) + MOVL $4, 8(SP) // F_SETFL + ORL $4, AX // O_NONBLOCK + MOVL AX, 12(SP) + MOVL $92, AX // fcntl + INT $0x80 + RET + GLOBL runtime·tlsoffset(SB),NOPTR,$4 |