Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(238)

Side by Side Diff: unix/sockcmsg_unix.go

Issue 121520043: code review 121520043: go.sys: update package names (Closed)
Patch Set: diff -r ad63a19ca444543ec83ec030d1200b0510f3f192 https://code.google.com/p/go.sys Created 10 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « unix/sockcmsg_linux.go ('k') | unix/srpc_nacl.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // +build darwin dragonfly freebsd linux netbsd openbsd solaris 5 // +build darwin dragonfly freebsd linux netbsd openbsd solaris
6 6
7 // Socket control messages 7 // Socket control messages
8 8
9 package syscall 9 package unix
10 10
11 import "unsafe" 11 import "unsafe"
12 12
13 // Round the length of a raw sockaddr up to align it properly. 13 // Round the length of a raw sockaddr up to align it properly.
14 func cmsgAlignOf(salen int) int { 14 func cmsgAlignOf(salen int) int {
15 salign := sizeofPtr 15 salign := sizeofPtr
16 // NOTE: It seems like 64-bit Darwin and DragonFly BSD kernels 16 // NOTE: It seems like 64-bit Darwin and DragonFly BSD kernels
17 // still require 32-bit aligned access to network subsystem. 17 // still require 32-bit aligned access to network subsystem.
18 if darwin64Bit || dragonfly64Bit { 18 if darwin64Bit || dragonfly64Bit {
19 salign = 4 19 salign = 4
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 if m.Header.Type != SCM_RIGHTS { 94 if m.Header.Type != SCM_RIGHTS {
95 return nil, EINVAL 95 return nil, EINVAL
96 } 96 }
97 fds := make([]int, len(m.Data)>>2) 97 fds := make([]int, len(m.Data)>>2)
98 for i, j := 0, 0; i < len(m.Data); i += 4 { 98 for i, j := 0, 0; i < len(m.Data); i += 4 {
99 fds[j] = int(*(*int32)(unsafe.Pointer(&m.Data[i]))) 99 fds[j] = int(*(*int32)(unsafe.Pointer(&m.Data[i])))
100 j++ 100 j++
101 } 101 }
102 return fds, nil 102 return fds, nil
103 } 103 }
OLDNEW
« no previous file with comments | « unix/sockcmsg_linux.go ('k') | unix/srpc_nacl.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b