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

Delta Between Two Patch Sets: unix/sockcmsg_linux.go

Issue 126960043: code review 126960043: go.sys: copy files from syscall package to go.sys/{plan... (Closed)
Left Patch Set: Created 10 years, 7 months ago
Right Patch Set: diff -r 89b705e036f489a14b4d11c6e025ea61a53bb735 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « unix/so_solaris.go ('k') | unix/sockcmsg_unix.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(Both sides are equal)
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 // Socket control messages 5 // Socket control messages
6 6
7 package syscall 7 package syscall
8 8
9 import "unsafe" 9 import "unsafe"
10 10
(...skipping 16 matching lines...) Expand all
27 func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 27 func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) {
28 if m.Header.Level != SOL_SOCKET { 28 if m.Header.Level != SOL_SOCKET {
29 return nil, EINVAL 29 return nil, EINVAL
30 } 30 }
31 if m.Header.Type != SCM_CREDENTIALS { 31 if m.Header.Type != SCM_CREDENTIALS {
32 return nil, EINVAL 32 return nil, EINVAL
33 } 33 }
34 ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 34 ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0]))
35 return &ucred, nil 35 return &ucred, nil
36 } 36 }
LEFTRIGHT

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