Skip to content

Commit 069aef4

Browse files
committed
syscall: use correct cmsg alignment for netbsd/arm64
netbsd/arm64 requires 128-bit alignment for cmsgs. Re-submit of CL 258437 which was dropped due to #41718. Change-Id: I898043d79f513bebe1a5eb931e7ebd8e291a5aec Reviewed-on: https://go-review.googlesource.com/c/go/+/258677 Trust: Tobias Klauser <[email protected]> Trust: Benny Siegert <[email protected]> Run-TryBot: Tobias Klauser <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Benny Siegert <[email protected]>
1 parent 9b1518a commit 069aef4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/syscall/sockcmsg_unix_other.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ func cmsgAlignOf(salen int) int {
3232
if runtime.GOARCH == "arm" {
3333
salign = 8
3434
}
35+
// NetBSD aarch64 requires 128-bit alignment.
36+
if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" {
37+
salign = 16
38+
}
3539
}
3640

3741
return (salen + salign - 1) & ^(salign - 1)

0 commit comments

Comments
 (0)