1
0
mirror of https://github.com/golang/go synced 2024-11-26 06:27:58 -07:00

syscall: fix FD passing on FreeBSD and NetBSD

Fixes #3348.

R=devon.odell, minux.ma, bradfitz, mdempsky
CC=golang-dev
https://golang.org/cl/7406050
This commit is contained in:
Dave Cheney 2013-02-27 09:13:15 +11:00
parent c8c16cfbb9
commit 98d44d140d
2 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build linux darwin // +build linux darwin freebsd netbsd
package syscall_test package syscall_test

View File

@ -37,7 +37,7 @@ func CmsgSpace(datalen int) int {
} }
func cmsgData(h *Cmsghdr) unsafe.Pointer { func cmsgData(h *Cmsghdr) unsafe.Pointer {
return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + SizeofCmsghdr) return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(SizeofCmsghdr)))
} }
// SocketControlMessage represents a socket control message. // SocketControlMessage represents a socket control message.