Fix "PR c++/92804 ICE trying to use concept as a nested-name-specifier"
[official-gcc.git] / libgo / go / syscall / socket_solaris.go
blob39588892f2b5825509a4408fba238e89b51470f9
1 // socket_solaris.go -- Socket handling specific to Solaris.
3 // Copyright 2010 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 package syscall
9 const SizeofSockaddrInet4 = 16
10 const SizeofSockaddrInet6 = 32
11 const SizeofSockaddrUnix = 110
13 type RawSockaddrInet4 struct {
14 Family uint16
15 Port uint16
16 Addr [4]byte /* in_addr */
17 Zero [8]uint8
20 func (sa *RawSockaddrInet4) setLen() Socklen_t {
21 return SizeofSockaddrInet4
24 type RawSockaddrInet6 struct {
25 Family uint16
26 Port uint16
27 Flowinfo uint32
28 Addr [16]byte /* in6_addr */
29 Scope_id uint32
30 Src_id uint32
33 func (sa *RawSockaddrInet6) setLen() Socklen_t {
34 return SizeofSockaddrInet6
37 type RawSockaddrUnix struct {
38 Family uint16
39 Path [108]int8
42 func (sa *RawSockaddrUnix) setLen(int) {
45 func (sa *RawSockaddrUnix) getLen() (int, error) {
46 n := 0
47 for n < len(sa.Path) && sa.Path[n] != 0 {
48 n++
50 return n, nil
53 func (sa *RawSockaddrUnix) adjustAbstract(sl Socklen_t) Socklen_t {
54 return sl
57 type RawSockaddr struct {
58 Family uint16
59 Data [14]int8
62 // BindToDevice binds the socket associated with fd to device.
63 func BindToDevice(fd int, device string) (err error) {
64 return ENOSYS
67 func anyToSockaddrOS(rsa *RawSockaddrAny) (Sockaddr, error) {
68 return nil, EAFNOSUPPORT