mirror of
https://github.com/golang/sys.git
synced 2026-02-09 04:06:04 +03:00
unix: use correct cmsg alignment for netbsd/arm64
netbsd/arm64 requires 128-bit alignment for cmsgs. Change-Id: I49d7a4dc223f15322c795569292b24200cedd389 Reviewed-on: https://go-review.googlesource.com/c/sys/+/258457 Trust: Tobias Klauser <tobias.klauser@gmail.com> Trust: Benny Siegert <bsiegert@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Benny Siegert <bsiegert@gmail.com>
This commit is contained in:
committed by
Tobias Klauser
parent
4d22bbb62b
commit
e293359b92
@@ -32,6 +32,10 @@ func cmsgAlignOf(salen int) int {
|
||||
if runtime.GOARCH == "arm" {
|
||||
salign = 8
|
||||
}
|
||||
// NetBSD aarch64 requires 128-bit alignment.
|
||||
if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" {
|
||||
salign = 16
|
||||
}
|
||||
}
|
||||
|
||||
return (salen + salign - 1) & ^(salign - 1)
|
||||
|
||||
Reference in New Issue
Block a user