mirror of
https://github.com/golang/net.git
synced 2026-03-31 10:27:08 +09:00
Add system call definitions for 32-bit PowerPC (ppc). These are
expected to be used with gccgo, as gc does not have a suitable code
generator.
* Define the system call numbers for recvmmsg() and sendmmsg()
* Enable the 32-bit definitions of cmsghdr, iovec, and msghdr structures
* Add the structure definitions generated by godefs
This has been tested with a program that listens for UDP connections
and then sends back multiple messages with PacketConn.WriteBatch.
Fixes golang/go#45677
Change-Id: Idd7bbcfcea373db674759d3cb86aab60312403dc
GitHub-Last-Rev: dfc1dfce61
GitHub-Pull-Request: golang/net#101
Reviewed-on: https://go-review.googlesource.com/c/net/+/312710
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
26 lines
537 B
Go
26 lines
537 B
Go
// Copyright 2017 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.
|
|
|
|
//go:build (arm || mips || mipsle || 386 || ppc) && linux
|
|
// +build arm mips mipsle 386 ppc
|
|
// +build linux
|
|
|
|
package socket
|
|
|
|
import "unsafe"
|
|
|
|
func (h *msghdr) setIov(vs []iovec) {
|
|
l := len(vs)
|
|
if l == 0 {
|
|
return
|
|
}
|
|
h.Iov = &vs[0]
|
|
h.Iovlen = uint32(l)
|
|
}
|
|
|
|
func (h *msghdr) setControl(b []byte) {
|
|
h.Control = (*byte)(unsafe.Pointer(&b[0]))
|
|
h.Controllen = uint32(len(b))
|
|
}
|