// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build darwin || (openbsd && !mips64)
+//go:build aix || darwin || (openbsd && !mips64)
package poll
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd
package poll
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
+//go:build unix
package poll
// 1024 and this seems conservative enough for now. Darwin's
// UIO_MAXIOV also seems to be 1024.
maxVec := 1024
- if runtime.GOOS == "solaris" {
- // IOV_MAX is set to XOPEN_IOV_MAX on Solaris.
+ if runtime.GOOS == "aix" || runtime.GOOS == "solaris" {
+ // IOV_MAX is set to XOPEN_IOV_MAX on AIX and Solaris.
maxVec = 16
}
var wantSum int
switch runtime.GOOS {
- case "android", "darwin", "ios", "dragonfly", "freebsd", "illumos", "linux", "netbsd", "openbsd", "solaris":
+ case "aix", "android", "darwin", "ios", "dragonfly", "freebsd", "illumos", "linux", "netbsd", "openbsd", "solaris":
var wantMinCalls int
wantSum = want.Len()
v := chunks
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
+//go:build unix
package net
//sys Unlink(path string) (err error)
//sysnb Uname(buf *Utsname) (err error)
//sys write(fd int, p []byte) (n int, err error)
+//sys writev(fd int, iovecs []Iovec) (n uintptr, err error)
//sys gettimeofday(tv *Timeval, tzp *Timezone) (err error)
//go:cgo_import_dynamic libc_Unlink unlink "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_Uname uname "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_write write "libc.a/shr_64.o"
+//go:cgo_import_dynamic libc_writev writev "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_gettimeofday gettimeofday "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_mmap mmap "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_munmap munmap "libc.a/shr_64.o"
//go:linkname libc_Unlink libc_Unlink
//go:linkname libc_Uname libc_Uname
//go:linkname libc_write libc_write
+//go:linkname libc_writev libc_writev
//go:linkname libc_gettimeofday libc_gettimeofday
//go:linkname libc_mmap libc_mmap
//go:linkname libc_munmap libc_munmap
libc_Unlink,
libc_Uname,
libc_write,
+ libc_writev,
libc_gettimeofday,
libc_mmap,
libc_munmap libcFunc
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func writev(fd int, iovecs []Iovec) (n uintptr, err error) {
+ var _p0 *Iovec
+ if len(iovecs) > 0 {
+ _p0 = &iovecs[0]
+ }
+ r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_writev)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovecs)), 0, 0, 0)
+ n = uintptr(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func gettimeofday(tv *Timeval, tzp *Timezone) (err error) {
_, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_gettimeofday)), 2, uintptr(unsafe.Pointer(tv)), uintptr(unsafe.Pointer(tzp)), 0, 0, 0, 0)
if e1 != 0 {