internal/socket: use correct cmsg alignment for openbsd/arm

The OpenBSD armv7 port requires 64-bit alignment for cmsgs.

Change-Id: Ibb1c5dc32c9e0851d0ee23b4ebdb316d7ed79629
Reviewed-on: https://go-review.googlesource.com/c/154397
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Joel Sing
2018-12-16 01:29:05 +11:00
committed by Brad Fitzpatrick
parent 891ebc4b82
commit e147a91383

View File

@@ -6,9 +6,15 @@
package socket
import "unsafe"
import (
"runtime"
"unsafe"
)
func probeProtocolStack() int {
if runtime.GOOS == "openbsd" && runtime.GOARCH == "arm" {
return 8
}
var p uintptr
return int(unsafe.Sizeof(p))
}