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

Side by Side Diff: libgo/go/syscall/socket.go

Issue 6100049: code review 6100049: mksysinfo: More fixes to emulate master Go library. (Closed)
Patch Set: Created 11 years, 11 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 | « libgo/go/syscall/libcall_linux.go ('k') | libgo/mksysinfo.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // socket.go -- Socket handling. 1 // socket.go -- Socket handling.
2 2
3 // Copyright 2009 The Go Authors. All rights reserved. 3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style 4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file. 5 // license that can be found in the LICENSE file.
6 6
7 // Low-level socket interface. 7 // Low-level socket interface.
8 // Only for implementing net package. 8 // Only for implementing net package.
9 // DO NOT USE DIRECTLY. 9 // DO NOT USE DIRECTLY.
10 10
11 package syscall 11 package syscall
12 12
13 import "unsafe" 13 import "unsafe"
14 14
15 // For testing: clients can set this flag to force 15 // For testing: clients can set this flag to force
16 // creation of IPv6 sockets to return EAFNOSUPPORT. 16 // creation of IPv6 sockets to return EAFNOSUPPORT.
17 var SocketDisableIPv6 bool 17 var SocketDisableIPv6 bool
18 18
19 type Sockaddr interface { 19 type Sockaddr interface {
20 sockaddr() (ptr *RawSockaddrAny, len Socklen_t, err error) // lowercase; only we can define Sockaddrs 20 sockaddr() (ptr *RawSockaddrAny, len Socklen_t, err error) // lowercase; only we can define Sockaddrs
21 } 21 }
22 22
23 type RawSockaddrAny struct { 23 type RawSockaddrAny struct {
24 Addr RawSockaddr 24 Addr RawSockaddr
25 » Pad [12]int8 25 » Pad [96]int8
26 } 26 }
27 27
28 const SizeofSockaddrAny = 0x1c 28 const SizeofSockaddrAny = 0x1c
29 29
30 type SockaddrInet4 struct { 30 type SockaddrInet4 struct {
31 Port int 31 Port int
32 Addr [4]byte 32 Addr [4]byte
33 raw RawSockaddrInet4 33 raw RawSockaddrInet4
34 } 34 }
35 35
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 iov.Len = Iovec_len_t(length) 414 iov.Len = Iovec_len_t(length)
415 } 415 }
416 416
417 func (msghdr *Msghdr) SetControllen(length int) { 417 func (msghdr *Msghdr) SetControllen(length int) {
418 msghdr.Controllen = Msghdr_controllen_t(length) 418 msghdr.Controllen = Msghdr_controllen_t(length)
419 } 419 }
420 420
421 func (cmsg *Cmsghdr) SetLen(length int) { 421 func (cmsg *Cmsghdr) SetLen(length int) {
422 cmsg.Len = Cmsghdr_len_t(length) 422 cmsg.Len = Cmsghdr_len_t(length)
423 } 423 }
OLDNEW
« no previous file with comments | « libgo/go/syscall/libcall_linux.go ('k') | libgo/mksysinfo.sh » ('j') | no next file with comments »

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