Commit 47efbf0a authored by Ian Lance Taylor's avatar Ian Lance Taylor

runtime: make fcntl arguments consistent across OS's

The C fnctl takes all int parameters, so consistently use int32.
We already used int32 on Darwin.

Change-Id: I69a012145d012771d7308d705d133159fc1aceaa
Reviewed-on: https://go-review.googlesource.com/c/go/+/204101
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 15ea61c5
...@@ -91,8 +91,8 @@ func errno() int32 { ...@@ -91,8 +91,8 @@ func errno() int32 {
return *getg().m.perrno return *getg().m.perrno
} }
func fcntl(fd, cmd int32, arg uintptr) int32 { func fcntl(fd, cmd, arg int32) int32 {
return int32(sysvicall3(&libc_fcntl, uintptr(fd), uintptr(cmd), arg)) return int32(sysvicall3(&libc_fcntl, uintptr(fd), uintptr(cmd), uintptr(arg)))
} }
func port_create() int32 { func port_create() int32 {
......
...@@ -360,8 +360,8 @@ func setupSystemConf() { ...@@ -360,8 +360,8 @@ func setupSystemConf() {
} }
//go:nosplit //go:nosplit
func fcntl(fd, cmd int32, arg uintptr) int32 { func fcntl(fd, cmd, arg int32) int32 {
r, _ := syscall3(&libc_fcntl, uintptr(fd), uintptr(cmd), arg) r, _ := syscall3(&libc_fcntl, uintptr(fd), uintptr(cmd), uintptr(arg))
return int32(r) return int32(r)
} }
...@@ -373,5 +373,5 @@ func closeonexec(fd int32) { ...@@ -373,5 +373,5 @@ func closeonexec(fd int32) {
//go:nosplit //go:nosplit
func setNonblock(fd int32) { func setNonblock(fd int32) {
flags := fcntl(fd, _F_GETFL, 0) flags := fcntl(fd, _F_GETFL, 0)
fcntl(fd, _F_SETFL, uintptr(flags|_O_NONBLOCK)) fcntl(fd, _F_SETFL, flags|_O_NONBLOCK)
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment