gcc/libgo/go/syscall/socket_posix.go
Ian Lance Taylor e0f69f36ea libgo: change build procedure to use build tags
Previously the libgo Makefile explicitly listed the set of files to
    compile for each package.  For packages that use build tags, this
    required a lot of awkward automake conditionals in the Makefile.
    
    This CL changes the build to look at the build tags in the files.
    The new shell script libgo/match.sh does the matching.  This required
    adjusting a lot of build tags, and removing some files that are never
    used.  I verified that the exact same sets of files are compiled on
    amd64 GNU/Linux.  I also tested the build on i386 Solaris.
    
    Writing match.sh revealed some bugs in the build tag handling that
    already exists, in a slightly different form, in the gotest shell
    script.  This CL fixes those problems as well.
    
    The old code used automake conditionals to handle systems that were
    missing strerror_r and wait4.  Rather than deal with those in Go, those
    functions are now implemented in runtime/go-nosys.c when necessary, so
    the Go code can simply assume that they exist.
    
    The os testsuite looked for dir_unix.go, which was never built for gccgo
    and has now been removed.  I changed the testsuite to look for dir.go
    instead.
    
    Reviewed-on: https://go-review.googlesource.com/25546

From-SVN: r239189
2016-08-06 00:36:33 +00:00

34 lines
1.4 KiB
Go

// socket_posix.go -- Socket handling for generic POSIX systems.
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !solaris
package syscall
//sys bind(fd int, sa *RawSockaddrAny, len Socklen_t) (err error)
//bind(fd _C_int, sa *RawSockaddrAny, len Socklen_t) _C_int
//sys connect(s int, addr *RawSockaddrAny, addrlen Socklen_t) (err error)
//connect(s _C_int, addr *RawSockaddrAny, addrlen Socklen_t) _C_int
//sysnb socket(domain int, typ int, proto int) (fd int, err error)
//socket(domain _C_int, typ _C_int, protocol _C_int) _C_int
//sysnb socketpair(domain int, typ int, proto int, fd *[2]_C_int) (err error)
//socketpair(domain _C_int, typ _C_int, protocol _C_int, fd *[2]_C_int) _C_int
//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *Socklen_t) (err error)
//getsockopt(s _C_int, level _C_int, name _C_int, val *byte, vallen *Socklen_t) _C_int
//sys sendto(s int, buf []byte, flags int, to *RawSockaddrAny, tolen Socklen_t) (err error)
//sendto(s _C_int, buf *byte, len Size_t, flags _C_int, to *RawSockaddrAny, tolen Socklen_t) Ssize_t
//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
//recvmsg(s _C_int, msg *Msghdr, flags _C_int) Ssize_t
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
//sendmsg(s _C_int, msg *Msghdr, flags _C_int) Ssize_t