Commit d844d698 authored by Mikio Hara's avatar Mikio Hara

syscall: fix handling socket control messages on dragonfly

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/91860043
parent 9fc6c059
...@@ -13,9 +13,9 @@ import "unsafe" ...@@ -13,9 +13,9 @@ import "unsafe"
// Round the length of a raw sockaddr up to align it properly. // Round the length of a raw sockaddr up to align it properly.
func cmsgAlignOf(salen int) int { func cmsgAlignOf(salen int) int {
salign := sizeofPtr salign := sizeofPtr
// NOTE: It seems like 64-bit Darwin kernel still requires 32-bit // NOTE: It seems like 64-bit Darwin and DragonFly BSD kernels
// aligned access to BSD subsystem. // still require 32-bit aligned access to network subsystem.
if darwin64Bit { if darwin64Bit || dragonfly64Bit {
salign = 4 salign = 4
} }
return (salen + salign - 1) & ^(salign - 1) return (salen + salign - 1) & ^(salign - 1)
......
...@@ -20,6 +20,7 @@ var ( ...@@ -20,6 +20,7 @@ var (
const ( const (
darwin64Bit = runtime.GOOS == "darwin" && sizeofPtr == 8 darwin64Bit = runtime.GOOS == "darwin" && sizeofPtr == 8
dragonfly64Bit = runtime.GOOS == "dragonfly" && sizeofPtr == 8
netbsd32Bit = runtime.GOOS == "netbsd" && sizeofPtr == 4 netbsd32Bit = runtime.GOOS == "netbsd" && sizeofPtr == 4
) )
......
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