vendor: Update golang.org/x/sys/... (fixes #4615)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4619
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// +build !gccgo
|
||||||
|
|
||||||
|
#include "textflag.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// System call support for ARM, OpenBSD
|
||||||
|
//
|
||||||
|
|
||||||
|
// Just jump to package syscall's implementation for all these functions.
|
||||||
|
// The runtime may know about them.
|
||||||
|
|
||||||
|
TEXT ·Syscall(SB),NOSPLIT,$0-28
|
||||||
|
B syscall·Syscall(SB)
|
||||||
|
|
||||||
|
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
||||||
|
B syscall·Syscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
||||||
|
B syscall·Syscall9(SB)
|
||||||
|
|
||||||
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||||
|
B syscall·RawSyscall(SB)
|
||||||
|
|
||||||
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||||
|
B syscall·RawSyscall6(SB)
|
||||||
+2
-2
@@ -10,8 +10,8 @@
|
|||||||
// System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go
|
// System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go
|
||||||
//
|
//
|
||||||
|
|
||||||
TEXT ·sysvicall6(SB),NOSPLIT,$0-64
|
TEXT ·sysvicall6(SB),NOSPLIT,$0-88
|
||||||
JMP syscall·sysvicall6(SB)
|
JMP syscall·sysvicall6(SB)
|
||||||
|
|
||||||
TEXT ·rawSysvicall6(SB),NOSPLIT,$0-64
|
TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88
|
||||||
JMP syscall·rawSysvicall6(SB)
|
JMP syscall·rawSysvicall6(SB)
|
||||||
|
|||||||
+195
@@ -0,0 +1,195 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// +build freebsd
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import (
|
||||||
|
errorspkg "errors"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Go implementation of C mostly found in /usr/src/sys/kern/subr_capability.c
|
||||||
|
|
||||||
|
const (
|
||||||
|
// This is the version of CapRights this package understands. See C implementation for parallels.
|
||||||
|
capRightsGoVersion = CAP_RIGHTS_VERSION_00
|
||||||
|
capArSizeMin = CAP_RIGHTS_VERSION_00 + 2
|
||||||
|
capArSizeMax = capRightsGoVersion + 2
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
bit2idx = []int{
|
||||||
|
-1, 0, 1, -1, 2, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1,
|
||||||
|
4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func capidxbit(right uint64) int {
|
||||||
|
return int((right >> 57) & 0x1f)
|
||||||
|
}
|
||||||
|
|
||||||
|
func rightToIndex(right uint64) (int, error) {
|
||||||
|
idx := capidxbit(right)
|
||||||
|
if idx < 0 || idx >= len(bit2idx) {
|
||||||
|
return -2, fmt.Errorf("index for right 0x%x out of range", right)
|
||||||
|
}
|
||||||
|
return bit2idx[idx], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func caprver(right uint64) int {
|
||||||
|
return int(right >> 62)
|
||||||
|
}
|
||||||
|
|
||||||
|
func capver(rights *CapRights) int {
|
||||||
|
return caprver(rights.Rights[0])
|
||||||
|
}
|
||||||
|
|
||||||
|
func caparsize(rights *CapRights) int {
|
||||||
|
return capver(rights) + 2
|
||||||
|
}
|
||||||
|
|
||||||
|
// CapRightsSet sets the permissions in setrights in rights.
|
||||||
|
func CapRightsSet(rights *CapRights, setrights []uint64) error {
|
||||||
|
// This is essentially a copy of cap_rights_vset()
|
||||||
|
if capver(rights) != CAP_RIGHTS_VERSION_00 {
|
||||||
|
return fmt.Errorf("bad rights version %d", capver(rights))
|
||||||
|
}
|
||||||
|
|
||||||
|
n := caparsize(rights)
|
||||||
|
if n < capArSizeMin || n > capArSizeMax {
|
||||||
|
return errorspkg.New("bad rights size")
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, right := range setrights {
|
||||||
|
if caprver(right) != CAP_RIGHTS_VERSION_00 {
|
||||||
|
return errorspkg.New("bad right version")
|
||||||
|
}
|
||||||
|
i, err := rightToIndex(right)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if i >= n {
|
||||||
|
return errorspkg.New("index overflow")
|
||||||
|
}
|
||||||
|
if capidxbit(rights.Rights[i]) != capidxbit(right) {
|
||||||
|
return errorspkg.New("index mismatch")
|
||||||
|
}
|
||||||
|
rights.Rights[i] |= right
|
||||||
|
if capidxbit(rights.Rights[i]) != capidxbit(right) {
|
||||||
|
return errorspkg.New("index mismatch (after assign)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// CapRightsClear clears the permissions in clearrights from rights.
|
||||||
|
func CapRightsClear(rights *CapRights, clearrights []uint64) error {
|
||||||
|
// This is essentially a copy of cap_rights_vclear()
|
||||||
|
if capver(rights) != CAP_RIGHTS_VERSION_00 {
|
||||||
|
return fmt.Errorf("bad rights version %d", capver(rights))
|
||||||
|
}
|
||||||
|
|
||||||
|
n := caparsize(rights)
|
||||||
|
if n < capArSizeMin || n > capArSizeMax {
|
||||||
|
return errorspkg.New("bad rights size")
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, right := range clearrights {
|
||||||
|
if caprver(right) != CAP_RIGHTS_VERSION_00 {
|
||||||
|
return errorspkg.New("bad right version")
|
||||||
|
}
|
||||||
|
i, err := rightToIndex(right)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if i >= n {
|
||||||
|
return errorspkg.New("index overflow")
|
||||||
|
}
|
||||||
|
if capidxbit(rights.Rights[i]) != capidxbit(right) {
|
||||||
|
return errorspkg.New("index mismatch")
|
||||||
|
}
|
||||||
|
rights.Rights[i] &= ^(right & 0x01FFFFFFFFFFFFFF)
|
||||||
|
if capidxbit(rights.Rights[i]) != capidxbit(right) {
|
||||||
|
return errorspkg.New("index mismatch (after assign)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// CapRightsIsSet checks whether all the permissions in setrights are present in rights.
|
||||||
|
func CapRightsIsSet(rights *CapRights, setrights []uint64) (bool, error) {
|
||||||
|
// This is essentially a copy of cap_rights_is_vset()
|
||||||
|
if capver(rights) != CAP_RIGHTS_VERSION_00 {
|
||||||
|
return false, fmt.Errorf("bad rights version %d", capver(rights))
|
||||||
|
}
|
||||||
|
|
||||||
|
n := caparsize(rights)
|
||||||
|
if n < capArSizeMin || n > capArSizeMax {
|
||||||
|
return false, errorspkg.New("bad rights size")
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, right := range setrights {
|
||||||
|
if caprver(right) != CAP_RIGHTS_VERSION_00 {
|
||||||
|
return false, errorspkg.New("bad right version")
|
||||||
|
}
|
||||||
|
i, err := rightToIndex(right)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
if i >= n {
|
||||||
|
return false, errorspkg.New("index overflow")
|
||||||
|
}
|
||||||
|
if capidxbit(rights.Rights[i]) != capidxbit(right) {
|
||||||
|
return false, errorspkg.New("index mismatch")
|
||||||
|
}
|
||||||
|
if (rights.Rights[i] & right) != right {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func capright(idx uint64, bit uint64) uint64 {
|
||||||
|
return ((1 << (57 + idx)) | bit)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CapRightsInit returns a pointer to an initialised CapRights structure filled with rights.
|
||||||
|
// See man cap_rights_init(3) and rights(4).
|
||||||
|
func CapRightsInit(rights []uint64) (*CapRights, error) {
|
||||||
|
var r CapRights
|
||||||
|
r.Rights[0] = (capRightsGoVersion << 62) | capright(0, 0)
|
||||||
|
r.Rights[1] = capright(1, 0)
|
||||||
|
|
||||||
|
err := CapRightsSet(&r, rights)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &r, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// CapRightsLimit reduces the operations permitted on fd to at most those contained in rights.
|
||||||
|
// The capability rights on fd can never be increased by CapRightsLimit.
|
||||||
|
// See man cap_rights_limit(2) and rights(4).
|
||||||
|
func CapRightsLimit(fd uintptr, rights *CapRights) error {
|
||||||
|
return capRightsLimit(int(fd), rights)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CapRightsGet returns a CapRights structure containing the operations permitted on fd.
|
||||||
|
// See man cap_rights_get(3) and rights(4).
|
||||||
|
func CapRightsGet(fd uintptr) (*CapRights, error) {
|
||||||
|
r, err := CapRightsInit(nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
err = capRightsGet(capRightsGoVersion, int(fd), r)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return r, nil
|
||||||
|
}
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// Functions to access/create device major and minor numbers matching the
|
||||||
|
// encoding used in Darwin's sys/types.h header.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
// Major returns the major component of a Darwin device number.
|
||||||
|
func Major(dev uint64) uint32 {
|
||||||
|
return uint32((dev >> 24) & 0xff)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Minor returns the minor component of a Darwin device number.
|
||||||
|
func Minor(dev uint64) uint32 {
|
||||||
|
return uint32(dev & 0xffffff)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mkdev returns a Darwin device number generated from the given major and minor
|
||||||
|
// components.
|
||||||
|
func Mkdev(major, minor uint32) uint64 {
|
||||||
|
return (uint64(major) << 24) | uint64(minor)
|
||||||
|
}
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// Functions to access/create device major and minor numbers matching the
|
||||||
|
// encoding used in Dragonfly's sys/types.h header.
|
||||||
|
//
|
||||||
|
// The information below is extracted and adapted from sys/types.h:
|
||||||
|
//
|
||||||
|
// Minor gives a cookie instead of an index since in order to avoid changing the
|
||||||
|
// meanings of bits 0-15 or wasting time and space shifting bits 16-31 for
|
||||||
|
// devices that don't use them.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
// Major returns the major component of a DragonFlyBSD device number.
|
||||||
|
func Major(dev uint64) uint32 {
|
||||||
|
return uint32((dev >> 8) & 0xff)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Minor returns the minor component of a DragonFlyBSD device number.
|
||||||
|
func Minor(dev uint64) uint32 {
|
||||||
|
return uint32(dev & 0xffff00ff)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mkdev returns a DragonFlyBSD device number generated from the given major and
|
||||||
|
// minor components.
|
||||||
|
func Mkdev(major, minor uint32) uint64 {
|
||||||
|
return (uint64(major) << 8) | uint64(minor)
|
||||||
|
}
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// Functions to access/create device major and minor numbers matching the
|
||||||
|
// encoding used in FreeBSD's sys/types.h header.
|
||||||
|
//
|
||||||
|
// The information below is extracted and adapted from sys/types.h:
|
||||||
|
//
|
||||||
|
// Minor gives a cookie instead of an index since in order to avoid changing the
|
||||||
|
// meanings of bits 0-15 or wasting time and space shifting bits 16-31 for
|
||||||
|
// devices that don't use them.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
// Major returns the major component of a FreeBSD device number.
|
||||||
|
func Major(dev uint64) uint32 {
|
||||||
|
return uint32((dev >> 8) & 0xff)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Minor returns the minor component of a FreeBSD device number.
|
||||||
|
func Minor(dev uint64) uint32 {
|
||||||
|
return uint32(dev & 0xffff00ff)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mkdev returns a FreeBSD device number generated from the given major and
|
||||||
|
// minor components.
|
||||||
|
func Mkdev(major, minor uint32) uint64 {
|
||||||
|
return (uint64(major) << 8) | uint64(minor)
|
||||||
|
}
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// Functions to access/create device major and minor numbers matching the
|
||||||
|
// encoding used by the Linux kernel and glibc.
|
||||||
|
//
|
||||||
|
// The information below is extracted and adapted from bits/sysmacros.h in the
|
||||||
|
// glibc sources:
|
||||||
|
//
|
||||||
|
// dev_t in glibc is 64-bit, with 32-bit major and minor numbers. glibc's
|
||||||
|
// default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major
|
||||||
|
// number and m is a hex digit of the minor number. This is backward compatible
|
||||||
|
// with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also
|
||||||
|
// backward compatible with the Linux kernel, which for some architectures uses
|
||||||
|
// 32-bit dev_t, encoded as mmmM MMmm.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
// Major returns the major component of a Linux device number.
|
||||||
|
func Major(dev uint64) uint32 {
|
||||||
|
major := uint32((dev & 0x00000000000fff00) >> 8)
|
||||||
|
major |= uint32((dev & 0xfffff00000000000) >> 32)
|
||||||
|
return major
|
||||||
|
}
|
||||||
|
|
||||||
|
// Minor returns the minor component of a Linux device number.
|
||||||
|
func Minor(dev uint64) uint32 {
|
||||||
|
minor := uint32((dev & 0x00000000000000ff) >> 0)
|
||||||
|
minor |= uint32((dev & 0x00000ffffff00000) >> 12)
|
||||||
|
return minor
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mkdev returns a Linux device number generated from the given major and minor
|
||||||
|
// components.
|
||||||
|
func Mkdev(major, minor uint32) uint64 {
|
||||||
|
dev := (uint64(major) & 0x00000fff) << 8
|
||||||
|
dev |= (uint64(major) & 0xfffff000) << 32
|
||||||
|
dev |= (uint64(minor) & 0x000000ff) << 0
|
||||||
|
dev |= (uint64(minor) & 0xffffff00) << 12
|
||||||
|
return dev
|
||||||
|
}
|
||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// Functions to access/create device major and minor numbers matching the
|
||||||
|
// encoding used in NetBSD's sys/types.h header.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
// Major returns the major component of a NetBSD device number.
|
||||||
|
func Major(dev uint64) uint32 {
|
||||||
|
return uint32((dev & 0x000fff00) >> 8)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Minor returns the minor component of a NetBSD device number.
|
||||||
|
func Minor(dev uint64) uint32 {
|
||||||
|
minor := uint32((dev & 0x000000ff) >> 0)
|
||||||
|
minor |= uint32((dev & 0xfff00000) >> 12)
|
||||||
|
return minor
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mkdev returns a NetBSD device number generated from the given major and minor
|
||||||
|
// components.
|
||||||
|
func Mkdev(major, minor uint32) uint64 {
|
||||||
|
dev := (uint64(major) << 8) & 0x000fff00
|
||||||
|
dev |= (uint64(minor) << 12) & 0xfff00000
|
||||||
|
dev |= (uint64(minor) << 0) & 0x000000ff
|
||||||
|
return dev
|
||||||
|
}
|
||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// Functions to access/create device major and minor numbers matching the
|
||||||
|
// encoding used in OpenBSD's sys/types.h header.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
// Major returns the major component of an OpenBSD device number.
|
||||||
|
func Major(dev uint64) uint32 {
|
||||||
|
return uint32((dev & 0x0000ff00) >> 8)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Minor returns the minor component of an OpenBSD device number.
|
||||||
|
func Minor(dev uint64) uint32 {
|
||||||
|
minor := uint32((dev & 0x000000ff) >> 0)
|
||||||
|
minor |= uint32((dev & 0xffff0000) >> 8)
|
||||||
|
return minor
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mkdev returns an OpenBSD device number generated from the given major and minor
|
||||||
|
// components.
|
||||||
|
func Mkdev(major, minor uint32) uint64 {
|
||||||
|
dev := (uint64(major) << 8) & 0x0000ff00
|
||||||
|
dev |= (uint64(minor) << 8) & 0xffff0000
|
||||||
|
dev |= (uint64(minor) << 0) & 0x000000ff
|
||||||
|
return dev
|
||||||
|
}
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2010 The Go Authors. All rights reserved.
|
// Copyright 2010 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2014 The Go Authors. All rights reserved.
|
// Copyright 2014 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
|||||||
+227
@@ -0,0 +1,227 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
|
||||||
|
// them here for backwards compatibility.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
const (
|
||||||
|
IFF_SMART = 0x20
|
||||||
|
IFT_1822 = 0x2
|
||||||
|
IFT_A12MPPSWITCH = 0x82
|
||||||
|
IFT_AAL2 = 0xbb
|
||||||
|
IFT_AAL5 = 0x31
|
||||||
|
IFT_ADSL = 0x5e
|
||||||
|
IFT_AFLANE8023 = 0x3b
|
||||||
|
IFT_AFLANE8025 = 0x3c
|
||||||
|
IFT_ARAP = 0x58
|
||||||
|
IFT_ARCNET = 0x23
|
||||||
|
IFT_ARCNETPLUS = 0x24
|
||||||
|
IFT_ASYNC = 0x54
|
||||||
|
IFT_ATM = 0x25
|
||||||
|
IFT_ATMDXI = 0x69
|
||||||
|
IFT_ATMFUNI = 0x6a
|
||||||
|
IFT_ATMIMA = 0x6b
|
||||||
|
IFT_ATMLOGICAL = 0x50
|
||||||
|
IFT_ATMRADIO = 0xbd
|
||||||
|
IFT_ATMSUBINTERFACE = 0x86
|
||||||
|
IFT_ATMVCIENDPT = 0xc2
|
||||||
|
IFT_ATMVIRTUAL = 0x95
|
||||||
|
IFT_BGPPOLICYACCOUNTING = 0xa2
|
||||||
|
IFT_BSC = 0x53
|
||||||
|
IFT_CCTEMUL = 0x3d
|
||||||
|
IFT_CEPT = 0x13
|
||||||
|
IFT_CES = 0x85
|
||||||
|
IFT_CHANNEL = 0x46
|
||||||
|
IFT_CNR = 0x55
|
||||||
|
IFT_COFFEE = 0x84
|
||||||
|
IFT_COMPOSITELINK = 0x9b
|
||||||
|
IFT_DCN = 0x8d
|
||||||
|
IFT_DIGITALPOWERLINE = 0x8a
|
||||||
|
IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
|
||||||
|
IFT_DLSW = 0x4a
|
||||||
|
IFT_DOCSCABLEDOWNSTREAM = 0x80
|
||||||
|
IFT_DOCSCABLEMACLAYER = 0x7f
|
||||||
|
IFT_DOCSCABLEUPSTREAM = 0x81
|
||||||
|
IFT_DS0 = 0x51
|
||||||
|
IFT_DS0BUNDLE = 0x52
|
||||||
|
IFT_DS1FDL = 0xaa
|
||||||
|
IFT_DS3 = 0x1e
|
||||||
|
IFT_DTM = 0x8c
|
||||||
|
IFT_DVBASILN = 0xac
|
||||||
|
IFT_DVBASIOUT = 0xad
|
||||||
|
IFT_DVBRCCDOWNSTREAM = 0x93
|
||||||
|
IFT_DVBRCCMACLAYER = 0x92
|
||||||
|
IFT_DVBRCCUPSTREAM = 0x94
|
||||||
|
IFT_ENC = 0xf4
|
||||||
|
IFT_EON = 0x19
|
||||||
|
IFT_EPLRS = 0x57
|
||||||
|
IFT_ESCON = 0x49
|
||||||
|
IFT_ETHER = 0x6
|
||||||
|
IFT_FAITH = 0xf2
|
||||||
|
IFT_FAST = 0x7d
|
||||||
|
IFT_FASTETHER = 0x3e
|
||||||
|
IFT_FASTETHERFX = 0x45
|
||||||
|
IFT_FDDI = 0xf
|
||||||
|
IFT_FIBRECHANNEL = 0x38
|
||||||
|
IFT_FRAMERELAYINTERCONNECT = 0x3a
|
||||||
|
IFT_FRAMERELAYMPI = 0x5c
|
||||||
|
IFT_FRDLCIENDPT = 0xc1
|
||||||
|
IFT_FRELAY = 0x20
|
||||||
|
IFT_FRELAYDCE = 0x2c
|
||||||
|
IFT_FRF16MFRBUNDLE = 0xa3
|
||||||
|
IFT_FRFORWARD = 0x9e
|
||||||
|
IFT_G703AT2MB = 0x43
|
||||||
|
IFT_G703AT64K = 0x42
|
||||||
|
IFT_GIF = 0xf0
|
||||||
|
IFT_GIGABITETHERNET = 0x75
|
||||||
|
IFT_GR303IDT = 0xb2
|
||||||
|
IFT_GR303RDT = 0xb1
|
||||||
|
IFT_H323GATEKEEPER = 0xa4
|
||||||
|
IFT_H323PROXY = 0xa5
|
||||||
|
IFT_HDH1822 = 0x3
|
||||||
|
IFT_HDLC = 0x76
|
||||||
|
IFT_HDSL2 = 0xa8
|
||||||
|
IFT_HIPERLAN2 = 0xb7
|
||||||
|
IFT_HIPPI = 0x2f
|
||||||
|
IFT_HIPPIINTERFACE = 0x39
|
||||||
|
IFT_HOSTPAD = 0x5a
|
||||||
|
IFT_HSSI = 0x2e
|
||||||
|
IFT_HY = 0xe
|
||||||
|
IFT_IBM370PARCHAN = 0x48
|
||||||
|
IFT_IDSL = 0x9a
|
||||||
|
IFT_IEEE80211 = 0x47
|
||||||
|
IFT_IEEE80212 = 0x37
|
||||||
|
IFT_IEEE8023ADLAG = 0xa1
|
||||||
|
IFT_IFGSN = 0x91
|
||||||
|
IFT_IMT = 0xbe
|
||||||
|
IFT_INTERLEAVE = 0x7c
|
||||||
|
IFT_IP = 0x7e
|
||||||
|
IFT_IPFORWARD = 0x8e
|
||||||
|
IFT_IPOVERATM = 0x72
|
||||||
|
IFT_IPOVERCDLC = 0x6d
|
||||||
|
IFT_IPOVERCLAW = 0x6e
|
||||||
|
IFT_IPSWITCH = 0x4e
|
||||||
|
IFT_IPXIP = 0xf9
|
||||||
|
IFT_ISDN = 0x3f
|
||||||
|
IFT_ISDNBASIC = 0x14
|
||||||
|
IFT_ISDNPRIMARY = 0x15
|
||||||
|
IFT_ISDNS = 0x4b
|
||||||
|
IFT_ISDNU = 0x4c
|
||||||
|
IFT_ISO88022LLC = 0x29
|
||||||
|
IFT_ISO88023 = 0x7
|
||||||
|
IFT_ISO88024 = 0x8
|
||||||
|
IFT_ISO88025 = 0x9
|
||||||
|
IFT_ISO88025CRFPINT = 0x62
|
||||||
|
IFT_ISO88025DTR = 0x56
|
||||||
|
IFT_ISO88025FIBER = 0x73
|
||||||
|
IFT_ISO88026 = 0xa
|
||||||
|
IFT_ISUP = 0xb3
|
||||||
|
IFT_L3IPXVLAN = 0x89
|
||||||
|
IFT_LAPB = 0x10
|
||||||
|
IFT_LAPD = 0x4d
|
||||||
|
IFT_LAPF = 0x77
|
||||||
|
IFT_LOCALTALK = 0x2a
|
||||||
|
IFT_LOOP = 0x18
|
||||||
|
IFT_MEDIAMAILOVERIP = 0x8b
|
||||||
|
IFT_MFSIGLINK = 0xa7
|
||||||
|
IFT_MIOX25 = 0x26
|
||||||
|
IFT_MODEM = 0x30
|
||||||
|
IFT_MPC = 0x71
|
||||||
|
IFT_MPLS = 0xa6
|
||||||
|
IFT_MPLSTUNNEL = 0x96
|
||||||
|
IFT_MSDSL = 0x8f
|
||||||
|
IFT_MVL = 0xbf
|
||||||
|
IFT_MYRINET = 0x63
|
||||||
|
IFT_NFAS = 0xaf
|
||||||
|
IFT_NSIP = 0x1b
|
||||||
|
IFT_OPTICALCHANNEL = 0xc3
|
||||||
|
IFT_OPTICALTRANSPORT = 0xc4
|
||||||
|
IFT_OTHER = 0x1
|
||||||
|
IFT_P10 = 0xc
|
||||||
|
IFT_P80 = 0xd
|
||||||
|
IFT_PARA = 0x22
|
||||||
|
IFT_PFLOG = 0xf6
|
||||||
|
IFT_PFSYNC = 0xf7
|
||||||
|
IFT_PLC = 0xae
|
||||||
|
IFT_POS = 0xab
|
||||||
|
IFT_PPPMULTILINKBUNDLE = 0x6c
|
||||||
|
IFT_PROPBWAP2MP = 0xb8
|
||||||
|
IFT_PROPCNLS = 0x59
|
||||||
|
IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
|
||||||
|
IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
|
||||||
|
IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
|
||||||
|
IFT_PROPMUX = 0x36
|
||||||
|
IFT_PROPWIRELESSP2P = 0x9d
|
||||||
|
IFT_PTPSERIAL = 0x16
|
||||||
|
IFT_PVC = 0xf1
|
||||||
|
IFT_QLLC = 0x44
|
||||||
|
IFT_RADIOMAC = 0xbc
|
||||||
|
IFT_RADSL = 0x5f
|
||||||
|
IFT_REACHDSL = 0xc0
|
||||||
|
IFT_RFC1483 = 0x9f
|
||||||
|
IFT_RS232 = 0x21
|
||||||
|
IFT_RSRB = 0x4f
|
||||||
|
IFT_SDLC = 0x11
|
||||||
|
IFT_SDSL = 0x60
|
||||||
|
IFT_SHDSL = 0xa9
|
||||||
|
IFT_SIP = 0x1f
|
||||||
|
IFT_SLIP = 0x1c
|
||||||
|
IFT_SMDSDXI = 0x2b
|
||||||
|
IFT_SMDSICIP = 0x34
|
||||||
|
IFT_SONET = 0x27
|
||||||
|
IFT_SONETOVERHEADCHANNEL = 0xb9
|
||||||
|
IFT_SONETPATH = 0x32
|
||||||
|
IFT_SONETVT = 0x33
|
||||||
|
IFT_SRP = 0x97
|
||||||
|
IFT_SS7SIGLINK = 0x9c
|
||||||
|
IFT_STACKTOSTACK = 0x6f
|
||||||
|
IFT_STARLAN = 0xb
|
||||||
|
IFT_STF = 0xd7
|
||||||
|
IFT_T1 = 0x12
|
||||||
|
IFT_TDLC = 0x74
|
||||||
|
IFT_TERMPAD = 0x5b
|
||||||
|
IFT_TR008 = 0xb0
|
||||||
|
IFT_TRANSPHDLC = 0x7b
|
||||||
|
IFT_TUNNEL = 0x83
|
||||||
|
IFT_ULTRA = 0x1d
|
||||||
|
IFT_USB = 0xa0
|
||||||
|
IFT_V11 = 0x40
|
||||||
|
IFT_V35 = 0x2d
|
||||||
|
IFT_V36 = 0x41
|
||||||
|
IFT_V37 = 0x78
|
||||||
|
IFT_VDSL = 0x61
|
||||||
|
IFT_VIRTUALIPADDRESS = 0x70
|
||||||
|
IFT_VOICEEM = 0x64
|
||||||
|
IFT_VOICEENCAP = 0x67
|
||||||
|
IFT_VOICEFXO = 0x65
|
||||||
|
IFT_VOICEFXS = 0x66
|
||||||
|
IFT_VOICEOVERATM = 0x98
|
||||||
|
IFT_VOICEOVERFRAMERELAY = 0x99
|
||||||
|
IFT_VOICEOVERIP = 0x68
|
||||||
|
IFT_X213 = 0x5d
|
||||||
|
IFT_X25 = 0x5
|
||||||
|
IFT_X25DDN = 0x4
|
||||||
|
IFT_X25HUNTGROUP = 0x7a
|
||||||
|
IFT_X25MLP = 0x79
|
||||||
|
IFT_X25PLE = 0x28
|
||||||
|
IFT_XETHER = 0x1a
|
||||||
|
IPPROTO_MAXID = 0x34
|
||||||
|
IPV6_FAITH = 0x1d
|
||||||
|
IP_FAITH = 0x16
|
||||||
|
MAP_NORESERVE = 0x40
|
||||||
|
MAP_RENAME = 0x20
|
||||||
|
NET_RT_MAXID = 0x6
|
||||||
|
RTF_PRCLONING = 0x10000
|
||||||
|
RTM_OLDADD = 0x9
|
||||||
|
RTM_OLDDEL = 0xa
|
||||||
|
SIOCADDRT = 0x8030720a
|
||||||
|
SIOCALIFADDR = 0x8118691b
|
||||||
|
SIOCDELRT = 0x8030720b
|
||||||
|
SIOCDLIFADDR = 0x8118691d
|
||||||
|
SIOCGLIFADDR = 0xc118691c
|
||||||
|
SIOCGLIFPHYADDR = 0xc118694b
|
||||||
|
SIOCSLIFPHYADDR = 0x8118694a
|
||||||
|
)
|
||||||
+227
@@ -0,0 +1,227 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
|
||||||
|
// them here for backwards compatibility.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
const (
|
||||||
|
IFF_SMART = 0x20
|
||||||
|
IFT_1822 = 0x2
|
||||||
|
IFT_A12MPPSWITCH = 0x82
|
||||||
|
IFT_AAL2 = 0xbb
|
||||||
|
IFT_AAL5 = 0x31
|
||||||
|
IFT_ADSL = 0x5e
|
||||||
|
IFT_AFLANE8023 = 0x3b
|
||||||
|
IFT_AFLANE8025 = 0x3c
|
||||||
|
IFT_ARAP = 0x58
|
||||||
|
IFT_ARCNET = 0x23
|
||||||
|
IFT_ARCNETPLUS = 0x24
|
||||||
|
IFT_ASYNC = 0x54
|
||||||
|
IFT_ATM = 0x25
|
||||||
|
IFT_ATMDXI = 0x69
|
||||||
|
IFT_ATMFUNI = 0x6a
|
||||||
|
IFT_ATMIMA = 0x6b
|
||||||
|
IFT_ATMLOGICAL = 0x50
|
||||||
|
IFT_ATMRADIO = 0xbd
|
||||||
|
IFT_ATMSUBINTERFACE = 0x86
|
||||||
|
IFT_ATMVCIENDPT = 0xc2
|
||||||
|
IFT_ATMVIRTUAL = 0x95
|
||||||
|
IFT_BGPPOLICYACCOUNTING = 0xa2
|
||||||
|
IFT_BSC = 0x53
|
||||||
|
IFT_CCTEMUL = 0x3d
|
||||||
|
IFT_CEPT = 0x13
|
||||||
|
IFT_CES = 0x85
|
||||||
|
IFT_CHANNEL = 0x46
|
||||||
|
IFT_CNR = 0x55
|
||||||
|
IFT_COFFEE = 0x84
|
||||||
|
IFT_COMPOSITELINK = 0x9b
|
||||||
|
IFT_DCN = 0x8d
|
||||||
|
IFT_DIGITALPOWERLINE = 0x8a
|
||||||
|
IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
|
||||||
|
IFT_DLSW = 0x4a
|
||||||
|
IFT_DOCSCABLEDOWNSTREAM = 0x80
|
||||||
|
IFT_DOCSCABLEMACLAYER = 0x7f
|
||||||
|
IFT_DOCSCABLEUPSTREAM = 0x81
|
||||||
|
IFT_DS0 = 0x51
|
||||||
|
IFT_DS0BUNDLE = 0x52
|
||||||
|
IFT_DS1FDL = 0xaa
|
||||||
|
IFT_DS3 = 0x1e
|
||||||
|
IFT_DTM = 0x8c
|
||||||
|
IFT_DVBASILN = 0xac
|
||||||
|
IFT_DVBASIOUT = 0xad
|
||||||
|
IFT_DVBRCCDOWNSTREAM = 0x93
|
||||||
|
IFT_DVBRCCMACLAYER = 0x92
|
||||||
|
IFT_DVBRCCUPSTREAM = 0x94
|
||||||
|
IFT_ENC = 0xf4
|
||||||
|
IFT_EON = 0x19
|
||||||
|
IFT_EPLRS = 0x57
|
||||||
|
IFT_ESCON = 0x49
|
||||||
|
IFT_ETHER = 0x6
|
||||||
|
IFT_FAITH = 0xf2
|
||||||
|
IFT_FAST = 0x7d
|
||||||
|
IFT_FASTETHER = 0x3e
|
||||||
|
IFT_FASTETHERFX = 0x45
|
||||||
|
IFT_FDDI = 0xf
|
||||||
|
IFT_FIBRECHANNEL = 0x38
|
||||||
|
IFT_FRAMERELAYINTERCONNECT = 0x3a
|
||||||
|
IFT_FRAMERELAYMPI = 0x5c
|
||||||
|
IFT_FRDLCIENDPT = 0xc1
|
||||||
|
IFT_FRELAY = 0x20
|
||||||
|
IFT_FRELAYDCE = 0x2c
|
||||||
|
IFT_FRF16MFRBUNDLE = 0xa3
|
||||||
|
IFT_FRFORWARD = 0x9e
|
||||||
|
IFT_G703AT2MB = 0x43
|
||||||
|
IFT_G703AT64K = 0x42
|
||||||
|
IFT_GIF = 0xf0
|
||||||
|
IFT_GIGABITETHERNET = 0x75
|
||||||
|
IFT_GR303IDT = 0xb2
|
||||||
|
IFT_GR303RDT = 0xb1
|
||||||
|
IFT_H323GATEKEEPER = 0xa4
|
||||||
|
IFT_H323PROXY = 0xa5
|
||||||
|
IFT_HDH1822 = 0x3
|
||||||
|
IFT_HDLC = 0x76
|
||||||
|
IFT_HDSL2 = 0xa8
|
||||||
|
IFT_HIPERLAN2 = 0xb7
|
||||||
|
IFT_HIPPI = 0x2f
|
||||||
|
IFT_HIPPIINTERFACE = 0x39
|
||||||
|
IFT_HOSTPAD = 0x5a
|
||||||
|
IFT_HSSI = 0x2e
|
||||||
|
IFT_HY = 0xe
|
||||||
|
IFT_IBM370PARCHAN = 0x48
|
||||||
|
IFT_IDSL = 0x9a
|
||||||
|
IFT_IEEE80211 = 0x47
|
||||||
|
IFT_IEEE80212 = 0x37
|
||||||
|
IFT_IEEE8023ADLAG = 0xa1
|
||||||
|
IFT_IFGSN = 0x91
|
||||||
|
IFT_IMT = 0xbe
|
||||||
|
IFT_INTERLEAVE = 0x7c
|
||||||
|
IFT_IP = 0x7e
|
||||||
|
IFT_IPFORWARD = 0x8e
|
||||||
|
IFT_IPOVERATM = 0x72
|
||||||
|
IFT_IPOVERCDLC = 0x6d
|
||||||
|
IFT_IPOVERCLAW = 0x6e
|
||||||
|
IFT_IPSWITCH = 0x4e
|
||||||
|
IFT_IPXIP = 0xf9
|
||||||
|
IFT_ISDN = 0x3f
|
||||||
|
IFT_ISDNBASIC = 0x14
|
||||||
|
IFT_ISDNPRIMARY = 0x15
|
||||||
|
IFT_ISDNS = 0x4b
|
||||||
|
IFT_ISDNU = 0x4c
|
||||||
|
IFT_ISO88022LLC = 0x29
|
||||||
|
IFT_ISO88023 = 0x7
|
||||||
|
IFT_ISO88024 = 0x8
|
||||||
|
IFT_ISO88025 = 0x9
|
||||||
|
IFT_ISO88025CRFPINT = 0x62
|
||||||
|
IFT_ISO88025DTR = 0x56
|
||||||
|
IFT_ISO88025FIBER = 0x73
|
||||||
|
IFT_ISO88026 = 0xa
|
||||||
|
IFT_ISUP = 0xb3
|
||||||
|
IFT_L3IPXVLAN = 0x89
|
||||||
|
IFT_LAPB = 0x10
|
||||||
|
IFT_LAPD = 0x4d
|
||||||
|
IFT_LAPF = 0x77
|
||||||
|
IFT_LOCALTALK = 0x2a
|
||||||
|
IFT_LOOP = 0x18
|
||||||
|
IFT_MEDIAMAILOVERIP = 0x8b
|
||||||
|
IFT_MFSIGLINK = 0xa7
|
||||||
|
IFT_MIOX25 = 0x26
|
||||||
|
IFT_MODEM = 0x30
|
||||||
|
IFT_MPC = 0x71
|
||||||
|
IFT_MPLS = 0xa6
|
||||||
|
IFT_MPLSTUNNEL = 0x96
|
||||||
|
IFT_MSDSL = 0x8f
|
||||||
|
IFT_MVL = 0xbf
|
||||||
|
IFT_MYRINET = 0x63
|
||||||
|
IFT_NFAS = 0xaf
|
||||||
|
IFT_NSIP = 0x1b
|
||||||
|
IFT_OPTICALCHANNEL = 0xc3
|
||||||
|
IFT_OPTICALTRANSPORT = 0xc4
|
||||||
|
IFT_OTHER = 0x1
|
||||||
|
IFT_P10 = 0xc
|
||||||
|
IFT_P80 = 0xd
|
||||||
|
IFT_PARA = 0x22
|
||||||
|
IFT_PFLOG = 0xf6
|
||||||
|
IFT_PFSYNC = 0xf7
|
||||||
|
IFT_PLC = 0xae
|
||||||
|
IFT_POS = 0xab
|
||||||
|
IFT_PPPMULTILINKBUNDLE = 0x6c
|
||||||
|
IFT_PROPBWAP2MP = 0xb8
|
||||||
|
IFT_PROPCNLS = 0x59
|
||||||
|
IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
|
||||||
|
IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
|
||||||
|
IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
|
||||||
|
IFT_PROPMUX = 0x36
|
||||||
|
IFT_PROPWIRELESSP2P = 0x9d
|
||||||
|
IFT_PTPSERIAL = 0x16
|
||||||
|
IFT_PVC = 0xf1
|
||||||
|
IFT_QLLC = 0x44
|
||||||
|
IFT_RADIOMAC = 0xbc
|
||||||
|
IFT_RADSL = 0x5f
|
||||||
|
IFT_REACHDSL = 0xc0
|
||||||
|
IFT_RFC1483 = 0x9f
|
||||||
|
IFT_RS232 = 0x21
|
||||||
|
IFT_RSRB = 0x4f
|
||||||
|
IFT_SDLC = 0x11
|
||||||
|
IFT_SDSL = 0x60
|
||||||
|
IFT_SHDSL = 0xa9
|
||||||
|
IFT_SIP = 0x1f
|
||||||
|
IFT_SLIP = 0x1c
|
||||||
|
IFT_SMDSDXI = 0x2b
|
||||||
|
IFT_SMDSICIP = 0x34
|
||||||
|
IFT_SONET = 0x27
|
||||||
|
IFT_SONETOVERHEADCHANNEL = 0xb9
|
||||||
|
IFT_SONETPATH = 0x32
|
||||||
|
IFT_SONETVT = 0x33
|
||||||
|
IFT_SRP = 0x97
|
||||||
|
IFT_SS7SIGLINK = 0x9c
|
||||||
|
IFT_STACKTOSTACK = 0x6f
|
||||||
|
IFT_STARLAN = 0xb
|
||||||
|
IFT_STF = 0xd7
|
||||||
|
IFT_T1 = 0x12
|
||||||
|
IFT_TDLC = 0x74
|
||||||
|
IFT_TERMPAD = 0x5b
|
||||||
|
IFT_TR008 = 0xb0
|
||||||
|
IFT_TRANSPHDLC = 0x7b
|
||||||
|
IFT_TUNNEL = 0x83
|
||||||
|
IFT_ULTRA = 0x1d
|
||||||
|
IFT_USB = 0xa0
|
||||||
|
IFT_V11 = 0x40
|
||||||
|
IFT_V35 = 0x2d
|
||||||
|
IFT_V36 = 0x41
|
||||||
|
IFT_V37 = 0x78
|
||||||
|
IFT_VDSL = 0x61
|
||||||
|
IFT_VIRTUALIPADDRESS = 0x70
|
||||||
|
IFT_VOICEEM = 0x64
|
||||||
|
IFT_VOICEENCAP = 0x67
|
||||||
|
IFT_VOICEFXO = 0x65
|
||||||
|
IFT_VOICEFXS = 0x66
|
||||||
|
IFT_VOICEOVERATM = 0x98
|
||||||
|
IFT_VOICEOVERFRAMERELAY = 0x99
|
||||||
|
IFT_VOICEOVERIP = 0x68
|
||||||
|
IFT_X213 = 0x5d
|
||||||
|
IFT_X25 = 0x5
|
||||||
|
IFT_X25DDN = 0x4
|
||||||
|
IFT_X25HUNTGROUP = 0x7a
|
||||||
|
IFT_X25MLP = 0x79
|
||||||
|
IFT_X25PLE = 0x28
|
||||||
|
IFT_XETHER = 0x1a
|
||||||
|
IPPROTO_MAXID = 0x34
|
||||||
|
IPV6_FAITH = 0x1d
|
||||||
|
IP_FAITH = 0x16
|
||||||
|
MAP_NORESERVE = 0x40
|
||||||
|
MAP_RENAME = 0x20
|
||||||
|
NET_RT_MAXID = 0x6
|
||||||
|
RTF_PRCLONING = 0x10000
|
||||||
|
RTM_OLDADD = 0x9
|
||||||
|
RTM_OLDDEL = 0xa
|
||||||
|
SIOCADDRT = 0x8040720a
|
||||||
|
SIOCALIFADDR = 0x8118691b
|
||||||
|
SIOCDELRT = 0x8040720b
|
||||||
|
SIOCDLIFADDR = 0x8118691d
|
||||||
|
SIOCGLIFADDR = 0xc118691c
|
||||||
|
SIOCGLIFPHYADDR = 0xc118694b
|
||||||
|
SIOCSLIFPHYADDR = 0x8118694a
|
||||||
|
)
|
||||||
+226
@@ -0,0 +1,226 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
const (
|
||||||
|
IFT_1822 = 0x2
|
||||||
|
IFT_A12MPPSWITCH = 0x82
|
||||||
|
IFT_AAL2 = 0xbb
|
||||||
|
IFT_AAL5 = 0x31
|
||||||
|
IFT_ADSL = 0x5e
|
||||||
|
IFT_AFLANE8023 = 0x3b
|
||||||
|
IFT_AFLANE8025 = 0x3c
|
||||||
|
IFT_ARAP = 0x58
|
||||||
|
IFT_ARCNET = 0x23
|
||||||
|
IFT_ARCNETPLUS = 0x24
|
||||||
|
IFT_ASYNC = 0x54
|
||||||
|
IFT_ATM = 0x25
|
||||||
|
IFT_ATMDXI = 0x69
|
||||||
|
IFT_ATMFUNI = 0x6a
|
||||||
|
IFT_ATMIMA = 0x6b
|
||||||
|
IFT_ATMLOGICAL = 0x50
|
||||||
|
IFT_ATMRADIO = 0xbd
|
||||||
|
IFT_ATMSUBINTERFACE = 0x86
|
||||||
|
IFT_ATMVCIENDPT = 0xc2
|
||||||
|
IFT_ATMVIRTUAL = 0x95
|
||||||
|
IFT_BGPPOLICYACCOUNTING = 0xa2
|
||||||
|
IFT_BSC = 0x53
|
||||||
|
IFT_CCTEMUL = 0x3d
|
||||||
|
IFT_CEPT = 0x13
|
||||||
|
IFT_CES = 0x85
|
||||||
|
IFT_CHANNEL = 0x46
|
||||||
|
IFT_CNR = 0x55
|
||||||
|
IFT_COFFEE = 0x84
|
||||||
|
IFT_COMPOSITELINK = 0x9b
|
||||||
|
IFT_DCN = 0x8d
|
||||||
|
IFT_DIGITALPOWERLINE = 0x8a
|
||||||
|
IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
|
||||||
|
IFT_DLSW = 0x4a
|
||||||
|
IFT_DOCSCABLEDOWNSTREAM = 0x80
|
||||||
|
IFT_DOCSCABLEMACLAYER = 0x7f
|
||||||
|
IFT_DOCSCABLEUPSTREAM = 0x81
|
||||||
|
IFT_DS0 = 0x51
|
||||||
|
IFT_DS0BUNDLE = 0x52
|
||||||
|
IFT_DS1FDL = 0xaa
|
||||||
|
IFT_DS3 = 0x1e
|
||||||
|
IFT_DTM = 0x8c
|
||||||
|
IFT_DVBASILN = 0xac
|
||||||
|
IFT_DVBASIOUT = 0xad
|
||||||
|
IFT_DVBRCCDOWNSTREAM = 0x93
|
||||||
|
IFT_DVBRCCMACLAYER = 0x92
|
||||||
|
IFT_DVBRCCUPSTREAM = 0x94
|
||||||
|
IFT_ENC = 0xf4
|
||||||
|
IFT_EON = 0x19
|
||||||
|
IFT_EPLRS = 0x57
|
||||||
|
IFT_ESCON = 0x49
|
||||||
|
IFT_ETHER = 0x6
|
||||||
|
IFT_FAST = 0x7d
|
||||||
|
IFT_FASTETHER = 0x3e
|
||||||
|
IFT_FASTETHERFX = 0x45
|
||||||
|
IFT_FDDI = 0xf
|
||||||
|
IFT_FIBRECHANNEL = 0x38
|
||||||
|
IFT_FRAMERELAYINTERCONNECT = 0x3a
|
||||||
|
IFT_FRAMERELAYMPI = 0x5c
|
||||||
|
IFT_FRDLCIENDPT = 0xc1
|
||||||
|
IFT_FRELAY = 0x20
|
||||||
|
IFT_FRELAYDCE = 0x2c
|
||||||
|
IFT_FRF16MFRBUNDLE = 0xa3
|
||||||
|
IFT_FRFORWARD = 0x9e
|
||||||
|
IFT_G703AT2MB = 0x43
|
||||||
|
IFT_G703AT64K = 0x42
|
||||||
|
IFT_GIF = 0xf0
|
||||||
|
IFT_GIGABITETHERNET = 0x75
|
||||||
|
IFT_GR303IDT = 0xb2
|
||||||
|
IFT_GR303RDT = 0xb1
|
||||||
|
IFT_H323GATEKEEPER = 0xa4
|
||||||
|
IFT_H323PROXY = 0xa5
|
||||||
|
IFT_HDH1822 = 0x3
|
||||||
|
IFT_HDLC = 0x76
|
||||||
|
IFT_HDSL2 = 0xa8
|
||||||
|
IFT_HIPERLAN2 = 0xb7
|
||||||
|
IFT_HIPPI = 0x2f
|
||||||
|
IFT_HIPPIINTERFACE = 0x39
|
||||||
|
IFT_HOSTPAD = 0x5a
|
||||||
|
IFT_HSSI = 0x2e
|
||||||
|
IFT_HY = 0xe
|
||||||
|
IFT_IBM370PARCHAN = 0x48
|
||||||
|
IFT_IDSL = 0x9a
|
||||||
|
IFT_IEEE80211 = 0x47
|
||||||
|
IFT_IEEE80212 = 0x37
|
||||||
|
IFT_IEEE8023ADLAG = 0xa1
|
||||||
|
IFT_IFGSN = 0x91
|
||||||
|
IFT_IMT = 0xbe
|
||||||
|
IFT_INTERLEAVE = 0x7c
|
||||||
|
IFT_IP = 0x7e
|
||||||
|
IFT_IPFORWARD = 0x8e
|
||||||
|
IFT_IPOVERATM = 0x72
|
||||||
|
IFT_IPOVERCDLC = 0x6d
|
||||||
|
IFT_IPOVERCLAW = 0x6e
|
||||||
|
IFT_IPSWITCH = 0x4e
|
||||||
|
IFT_ISDN = 0x3f
|
||||||
|
IFT_ISDNBASIC = 0x14
|
||||||
|
IFT_ISDNPRIMARY = 0x15
|
||||||
|
IFT_ISDNS = 0x4b
|
||||||
|
IFT_ISDNU = 0x4c
|
||||||
|
IFT_ISO88022LLC = 0x29
|
||||||
|
IFT_ISO88023 = 0x7
|
||||||
|
IFT_ISO88024 = 0x8
|
||||||
|
IFT_ISO88025 = 0x9
|
||||||
|
IFT_ISO88025CRFPINT = 0x62
|
||||||
|
IFT_ISO88025DTR = 0x56
|
||||||
|
IFT_ISO88025FIBER = 0x73
|
||||||
|
IFT_ISO88026 = 0xa
|
||||||
|
IFT_ISUP = 0xb3
|
||||||
|
IFT_L3IPXVLAN = 0x89
|
||||||
|
IFT_LAPB = 0x10
|
||||||
|
IFT_LAPD = 0x4d
|
||||||
|
IFT_LAPF = 0x77
|
||||||
|
IFT_LOCALTALK = 0x2a
|
||||||
|
IFT_LOOP = 0x18
|
||||||
|
IFT_MEDIAMAILOVERIP = 0x8b
|
||||||
|
IFT_MFSIGLINK = 0xa7
|
||||||
|
IFT_MIOX25 = 0x26
|
||||||
|
IFT_MODEM = 0x30
|
||||||
|
IFT_MPC = 0x71
|
||||||
|
IFT_MPLS = 0xa6
|
||||||
|
IFT_MPLSTUNNEL = 0x96
|
||||||
|
IFT_MSDSL = 0x8f
|
||||||
|
IFT_MVL = 0xbf
|
||||||
|
IFT_MYRINET = 0x63
|
||||||
|
IFT_NFAS = 0xaf
|
||||||
|
IFT_NSIP = 0x1b
|
||||||
|
IFT_OPTICALCHANNEL = 0xc3
|
||||||
|
IFT_OPTICALTRANSPORT = 0xc4
|
||||||
|
IFT_OTHER = 0x1
|
||||||
|
IFT_P10 = 0xc
|
||||||
|
IFT_P80 = 0xd
|
||||||
|
IFT_PARA = 0x22
|
||||||
|
IFT_PFLOG = 0xf6
|
||||||
|
IFT_PFSYNC = 0xf7
|
||||||
|
IFT_PLC = 0xae
|
||||||
|
IFT_POS = 0xab
|
||||||
|
IFT_PPPMULTILINKBUNDLE = 0x6c
|
||||||
|
IFT_PROPBWAP2MP = 0xb8
|
||||||
|
IFT_PROPCNLS = 0x59
|
||||||
|
IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
|
||||||
|
IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
|
||||||
|
IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
|
||||||
|
IFT_PROPMUX = 0x36
|
||||||
|
IFT_PROPWIRELESSP2P = 0x9d
|
||||||
|
IFT_PTPSERIAL = 0x16
|
||||||
|
IFT_PVC = 0xf1
|
||||||
|
IFT_QLLC = 0x44
|
||||||
|
IFT_RADIOMAC = 0xbc
|
||||||
|
IFT_RADSL = 0x5f
|
||||||
|
IFT_REACHDSL = 0xc0
|
||||||
|
IFT_RFC1483 = 0x9f
|
||||||
|
IFT_RS232 = 0x21
|
||||||
|
IFT_RSRB = 0x4f
|
||||||
|
IFT_SDLC = 0x11
|
||||||
|
IFT_SDSL = 0x60
|
||||||
|
IFT_SHDSL = 0xa9
|
||||||
|
IFT_SIP = 0x1f
|
||||||
|
IFT_SLIP = 0x1c
|
||||||
|
IFT_SMDSDXI = 0x2b
|
||||||
|
IFT_SMDSICIP = 0x34
|
||||||
|
IFT_SONET = 0x27
|
||||||
|
IFT_SONETOVERHEADCHANNEL = 0xb9
|
||||||
|
IFT_SONETPATH = 0x32
|
||||||
|
IFT_SONETVT = 0x33
|
||||||
|
IFT_SRP = 0x97
|
||||||
|
IFT_SS7SIGLINK = 0x9c
|
||||||
|
IFT_STACKTOSTACK = 0x6f
|
||||||
|
IFT_STARLAN = 0xb
|
||||||
|
IFT_STF = 0xd7
|
||||||
|
IFT_T1 = 0x12
|
||||||
|
IFT_TDLC = 0x74
|
||||||
|
IFT_TERMPAD = 0x5b
|
||||||
|
IFT_TR008 = 0xb0
|
||||||
|
IFT_TRANSPHDLC = 0x7b
|
||||||
|
IFT_TUNNEL = 0x83
|
||||||
|
IFT_ULTRA = 0x1d
|
||||||
|
IFT_USB = 0xa0
|
||||||
|
IFT_V11 = 0x40
|
||||||
|
IFT_V35 = 0x2d
|
||||||
|
IFT_V36 = 0x41
|
||||||
|
IFT_V37 = 0x78
|
||||||
|
IFT_VDSL = 0x61
|
||||||
|
IFT_VIRTUALIPADDRESS = 0x70
|
||||||
|
IFT_VOICEEM = 0x64
|
||||||
|
IFT_VOICEENCAP = 0x67
|
||||||
|
IFT_VOICEFXO = 0x65
|
||||||
|
IFT_VOICEFXS = 0x66
|
||||||
|
IFT_VOICEOVERATM = 0x98
|
||||||
|
IFT_VOICEOVERFRAMERELAY = 0x99
|
||||||
|
IFT_VOICEOVERIP = 0x68
|
||||||
|
IFT_X213 = 0x5d
|
||||||
|
IFT_X25 = 0x5
|
||||||
|
IFT_X25DDN = 0x4
|
||||||
|
IFT_X25HUNTGROUP = 0x7a
|
||||||
|
IFT_X25MLP = 0x79
|
||||||
|
IFT_X25PLE = 0x28
|
||||||
|
IFT_XETHER = 0x1a
|
||||||
|
|
||||||
|
// missing constants on FreeBSD-11.1-RELEASE, copied from old values in ztypes_freebsd_arm.go
|
||||||
|
IFF_SMART = 0x20
|
||||||
|
IFT_FAITH = 0xf2
|
||||||
|
IFT_IPXIP = 0xf9
|
||||||
|
IPPROTO_MAXID = 0x34
|
||||||
|
IPV6_FAITH = 0x1d
|
||||||
|
IP_FAITH = 0x16
|
||||||
|
MAP_NORESERVE = 0x40
|
||||||
|
MAP_RENAME = 0x20
|
||||||
|
NET_RT_MAXID = 0x6
|
||||||
|
RTF_PRCLONING = 0x10000
|
||||||
|
RTM_OLDADD = 0x9
|
||||||
|
RTM_OLDDEL = 0xa
|
||||||
|
SIOCADDRT = 0x8030720a
|
||||||
|
SIOCALIFADDR = 0x8118691b
|
||||||
|
SIOCDELRT = 0x8030720b
|
||||||
|
SIOCDLIFADDR = 0x8118691d
|
||||||
|
SIOCGLIFADDR = 0xc118691c
|
||||||
|
SIOCGLIFPHYADDR = 0xc118694b
|
||||||
|
SIOCSLIFPHYADDR = 0x8118694a
|
||||||
|
)
|
||||||
-2
@@ -1,5 +1,3 @@
|
|||||||
// +build linux darwin freebsd openbsd netbsd dragonfly
|
|
||||||
|
|
||||||
// Copyright 2014 The Go Authors. All rights reserved.
|
// Copyright 2014 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2015 The Go Authors. All rights reserved.
|
// Copyright 2015 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ package unix
|
|||||||
|
|
||||||
import "syscall"
|
import "syscall"
|
||||||
|
|
||||||
// We can't use the gc-syntax .s files for gccgo. On the plus side
|
// We can't use the gc-syntax .s files for gccgo. On the plus side
|
||||||
// much of the functionality can be written directly in Go.
|
// much of the functionality can be written directly in Go.
|
||||||
|
|
||||||
//extern gccgoRealSyscall
|
//extern gccgoRealSyscall
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2015 The Go Authors. All rights reserved.
|
// Copyright 2015 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2015 The Go Authors. All rights reserved.
|
// Copyright 2015 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
|||||||
-20
@@ -1,20 +0,0 @@
|
|||||||
// Copyright 2016 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 gccgo,linux,sparc64
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
import "syscall"
|
|
||||||
|
|
||||||
//extern sysconf
|
|
||||||
func realSysconf(name int) int64
|
|
||||||
|
|
||||||
func sysconf(name int) (n int64, err syscall.Errno) {
|
|
||||||
r := realSysconf(name)
|
|
||||||
if r < 0 {
|
|
||||||
return 0, syscall.GetErrno()
|
|
||||||
}
|
|
||||||
return r, 0
|
|
||||||
}
|
|
||||||
+482
@@ -0,0 +1,482 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// linux/mkall.go - Generates all Linux zsysnum, zsyscall, zerror, and ztype
|
||||||
|
// files for all 11 linux architectures supported by the go compiler. See
|
||||||
|
// README.md for more information about the build system.
|
||||||
|
|
||||||
|
// To run it you must have a git checkout of the Linux kernel and glibc. Once
|
||||||
|
// the appropriate sources are ready, the program is run as:
|
||||||
|
// go run linux/mkall.go <linux_dir> <glibc_dir>
|
||||||
|
|
||||||
|
// +build ignore
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"bytes"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
|
"strings"
|
||||||
|
"unicode"
|
||||||
|
)
|
||||||
|
|
||||||
|
// These will be paths to the appropriate source directories.
|
||||||
|
var LinuxDir string
|
||||||
|
var GlibcDir string
|
||||||
|
|
||||||
|
const TempDir = "/tmp"
|
||||||
|
const IncludeDir = TempDir + "/include" // To hold our C headers
|
||||||
|
const BuildDir = TempDir + "/build" // To hold intermediate build files
|
||||||
|
|
||||||
|
const GOOS = "linux" // Only for Linux targets
|
||||||
|
const BuildArch = "amd64" // Must be built on this architecture
|
||||||
|
const MinKernel = "2.6.23" // https://golang.org/doc/install#requirements
|
||||||
|
|
||||||
|
type target struct {
|
||||||
|
GoArch string // Architecture name according to Go
|
||||||
|
LinuxArch string // Architecture name according to the Linux Kernel
|
||||||
|
GNUArch string // Architecture name according to GNU tools (https://wiki.debian.org/Multiarch/Tuples)
|
||||||
|
BigEndian bool // Default Little Endian
|
||||||
|
SignedChar bool // Is -fsigned-char needed (default no)
|
||||||
|
Bits int
|
||||||
|
}
|
||||||
|
|
||||||
|
// List of the 11 Linux targets supported by the go compiler. sparc64 is not
|
||||||
|
// currently supported, though a port is in progress.
|
||||||
|
var targets = []target{
|
||||||
|
{
|
||||||
|
GoArch: "386",
|
||||||
|
LinuxArch: "x86",
|
||||||
|
GNUArch: "i686-linux-gnu", // Note "i686" not "i386"
|
||||||
|
Bits: 32,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "amd64",
|
||||||
|
LinuxArch: "x86",
|
||||||
|
GNUArch: "x86_64-linux-gnu",
|
||||||
|
Bits: 64,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "arm64",
|
||||||
|
LinuxArch: "arm64",
|
||||||
|
GNUArch: "aarch64-linux-gnu",
|
||||||
|
SignedChar: true,
|
||||||
|
Bits: 64,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "arm",
|
||||||
|
LinuxArch: "arm",
|
||||||
|
GNUArch: "arm-linux-gnueabi",
|
||||||
|
Bits: 32,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "mips",
|
||||||
|
LinuxArch: "mips",
|
||||||
|
GNUArch: "mips-linux-gnu",
|
||||||
|
BigEndian: true,
|
||||||
|
Bits: 32,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "mipsle",
|
||||||
|
LinuxArch: "mips",
|
||||||
|
GNUArch: "mipsel-linux-gnu",
|
||||||
|
Bits: 32,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "mips64",
|
||||||
|
LinuxArch: "mips",
|
||||||
|
GNUArch: "mips64-linux-gnuabi64",
|
||||||
|
BigEndian: true,
|
||||||
|
Bits: 64,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "mips64le",
|
||||||
|
LinuxArch: "mips",
|
||||||
|
GNUArch: "mips64el-linux-gnuabi64",
|
||||||
|
Bits: 64,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "ppc64",
|
||||||
|
LinuxArch: "powerpc",
|
||||||
|
GNUArch: "powerpc64-linux-gnu",
|
||||||
|
BigEndian: true,
|
||||||
|
Bits: 64,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "ppc64le",
|
||||||
|
LinuxArch: "powerpc",
|
||||||
|
GNUArch: "powerpc64le-linux-gnu",
|
||||||
|
Bits: 64,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GoArch: "s390x",
|
||||||
|
LinuxArch: "s390",
|
||||||
|
GNUArch: "s390x-linux-gnu",
|
||||||
|
BigEndian: true,
|
||||||
|
SignedChar: true,
|
||||||
|
Bits: 64,
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// GoArch: "sparc64",
|
||||||
|
// LinuxArch: "sparc",
|
||||||
|
// GNUArch: "sparc64-linux-gnu",
|
||||||
|
// BigEndian: true,
|
||||||
|
// Bits: 64,
|
||||||
|
// },
|
||||||
|
}
|
||||||
|
|
||||||
|
// ptracePairs is a list of pairs of targets that can, in some cases,
|
||||||
|
// run each other's binaries.
|
||||||
|
var ptracePairs = []struct{ a1, a2 string }{
|
||||||
|
{"386", "amd64"},
|
||||||
|
{"arm", "arm64"},
|
||||||
|
{"mips", "mips64"},
|
||||||
|
{"mipsle", "mips64le"},
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
if runtime.GOOS != GOOS || runtime.GOARCH != BuildArch {
|
||||||
|
fmt.Printf("Build system has GOOS_GOARCH = %s_%s, need %s_%s\n",
|
||||||
|
runtime.GOOS, runtime.GOARCH, GOOS, BuildArch)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check that we are using the new build system if we should
|
||||||
|
if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
|
||||||
|
fmt.Println("In the new build system, mkall.go should not be called directly.")
|
||||||
|
fmt.Println("See README.md")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Parse the command line options
|
||||||
|
if len(os.Args) != 3 {
|
||||||
|
fmt.Println("USAGE: go run linux/mkall.go <linux_dir> <glibc_dir>")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
LinuxDir = os.Args[1]
|
||||||
|
GlibcDir = os.Args[2]
|
||||||
|
|
||||||
|
for _, t := range targets {
|
||||||
|
fmt.Printf("----- GENERATING: %s -----\n", t.GoArch)
|
||||||
|
if err := t.generateFiles(); err != nil {
|
||||||
|
fmt.Printf("%v\n***** FAILURE: %s *****\n\n", err, t.GoArch)
|
||||||
|
} else {
|
||||||
|
fmt.Printf("----- SUCCESS: %s -----\n\n", t.GoArch)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("----- GENERATING ptrace pairs -----\n")
|
||||||
|
ok := true
|
||||||
|
for _, p := range ptracePairs {
|
||||||
|
if err := generatePtracePair(p.a1, p.a2); err != nil {
|
||||||
|
fmt.Printf("%v\n***** FAILURE: %s/%s *****\n\n", err, p.a1, p.a2)
|
||||||
|
ok = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ok {
|
||||||
|
fmt.Printf("----- SUCCESS ptrace pairs -----\n\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Makes an exec.Cmd with Stderr attached to os.Stderr
|
||||||
|
func makeCommand(name string, args ...string) *exec.Cmd {
|
||||||
|
cmd := exec.Command(name, args...)
|
||||||
|
cmd.Stderr = os.Stderr
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
// Runs the command, pipes output to a formatter, pipes that to an output file.
|
||||||
|
func (t *target) commandFormatOutput(formatter string, outputFile string,
|
||||||
|
name string, args ...string) (err error) {
|
||||||
|
mainCmd := makeCommand(name, args...)
|
||||||
|
|
||||||
|
fmtCmd := makeCommand(formatter)
|
||||||
|
if formatter == "mkpost" {
|
||||||
|
fmtCmd = makeCommand("go", "run", "mkpost.go")
|
||||||
|
// Set GOARCH_TARGET so mkpost knows what GOARCH is..
|
||||||
|
fmtCmd.Env = append(os.Environ(), "GOARCH_TARGET="+t.GoArch)
|
||||||
|
// Set GOARCH to host arch for mkpost, so it can run natively.
|
||||||
|
for i, s := range fmtCmd.Env {
|
||||||
|
if strings.HasPrefix(s, "GOARCH=") {
|
||||||
|
fmtCmd.Env[i] = "GOARCH=" + BuildArch
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// mainCmd | fmtCmd > outputFile
|
||||||
|
if fmtCmd.Stdin, err = mainCmd.StdoutPipe(); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if fmtCmd.Stdout, err = os.Create(outputFile); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make sure the formatter eventually closes
|
||||||
|
if err = fmtCmd.Start(); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
fmtErr := fmtCmd.Wait()
|
||||||
|
if err == nil {
|
||||||
|
err = fmtErr
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
return mainCmd.Run()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generates all the files for a Linux target
|
||||||
|
func (t *target) generateFiles() error {
|
||||||
|
// Setup environment variables
|
||||||
|
os.Setenv("GOOS", GOOS)
|
||||||
|
os.Setenv("GOARCH", t.GoArch)
|
||||||
|
|
||||||
|
// Get appropriate compiler and emulator (unless on x86)
|
||||||
|
if t.LinuxArch != "x86" {
|
||||||
|
// Check/Setup cross compiler
|
||||||
|
compiler := t.GNUArch + "-gcc"
|
||||||
|
if _, err := exec.LookPath(compiler); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
os.Setenv("CC", compiler)
|
||||||
|
|
||||||
|
// Check/Setup emulator (usually first component of GNUArch)
|
||||||
|
qemuArchName := t.GNUArch[:strings.Index(t.GNUArch, "-")]
|
||||||
|
if t.LinuxArch == "powerpc" {
|
||||||
|
qemuArchName = t.GoArch
|
||||||
|
}
|
||||||
|
os.Setenv("GORUN", "qemu-"+qemuArchName)
|
||||||
|
} else {
|
||||||
|
os.Setenv("CC", "gcc")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make the include directory and fill it with headers
|
||||||
|
if err := os.MkdirAll(IncludeDir, os.ModePerm); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer os.RemoveAll(IncludeDir)
|
||||||
|
if err := t.makeHeaders(); err != nil {
|
||||||
|
return fmt.Errorf("could not make header files: %v", err)
|
||||||
|
}
|
||||||
|
fmt.Println("header files generated")
|
||||||
|
|
||||||
|
// Make each of the four files
|
||||||
|
if err := t.makeZSysnumFile(); err != nil {
|
||||||
|
return fmt.Errorf("could not make zsysnum file: %v", err)
|
||||||
|
}
|
||||||
|
fmt.Println("zsysnum file generated")
|
||||||
|
|
||||||
|
if err := t.makeZSyscallFile(); err != nil {
|
||||||
|
return fmt.Errorf("could not make zsyscall file: %v", err)
|
||||||
|
}
|
||||||
|
fmt.Println("zsyscall file generated")
|
||||||
|
|
||||||
|
if err := t.makeZTypesFile(); err != nil {
|
||||||
|
return fmt.Errorf("could not make ztypes file: %v", err)
|
||||||
|
}
|
||||||
|
fmt.Println("ztypes file generated")
|
||||||
|
|
||||||
|
if err := t.makeZErrorsFile(); err != nil {
|
||||||
|
return fmt.Errorf("could not make zerrors file: %v", err)
|
||||||
|
}
|
||||||
|
fmt.Println("zerrors file generated")
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the Linux and glibc headers in the include directory.
|
||||||
|
func (t *target) makeHeaders() error {
|
||||||
|
// Make the Linux headers we need for this architecture
|
||||||
|
linuxMake := makeCommand("make", "headers_install", "ARCH="+t.LinuxArch, "INSTALL_HDR_PATH="+TempDir)
|
||||||
|
linuxMake.Dir = LinuxDir
|
||||||
|
if err := linuxMake.Run(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// A Temporary build directory for glibc
|
||||||
|
if err := os.MkdirAll(BuildDir, os.ModePerm); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer os.RemoveAll(BuildDir)
|
||||||
|
|
||||||
|
// Make the glibc headers we need for this architecture
|
||||||
|
confScript := filepath.Join(GlibcDir, "configure")
|
||||||
|
glibcConf := makeCommand(confScript, "--prefix="+TempDir, "--host="+t.GNUArch, "--enable-kernel="+MinKernel)
|
||||||
|
glibcConf.Dir = BuildDir
|
||||||
|
if err := glibcConf.Run(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
glibcMake := makeCommand("make", "install-headers")
|
||||||
|
glibcMake.Dir = BuildDir
|
||||||
|
if err := glibcMake.Run(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// We only need an empty stubs file
|
||||||
|
stubsFile := filepath.Join(IncludeDir, "gnu/stubs.h")
|
||||||
|
if file, err := os.Create(stubsFile); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
file.Close()
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// makes the zsysnum_linux_$GOARCH.go file
|
||||||
|
func (t *target) makeZSysnumFile() error {
|
||||||
|
zsysnumFile := fmt.Sprintf("zsysnum_linux_%s.go", t.GoArch)
|
||||||
|
unistdFile := filepath.Join(IncludeDir, "asm/unistd.h")
|
||||||
|
|
||||||
|
args := append(t.cFlags(), unistdFile)
|
||||||
|
return t.commandFormatOutput("gofmt", zsysnumFile, "linux/mksysnum.pl", args...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// makes the zsyscall_linux_$GOARCH.go file
|
||||||
|
func (t *target) makeZSyscallFile() error {
|
||||||
|
zsyscallFile := fmt.Sprintf("zsyscall_linux_%s.go", t.GoArch)
|
||||||
|
// Find the correct architecture syscall file (might end with x.go)
|
||||||
|
archSyscallFile := fmt.Sprintf("syscall_linux_%s.go", t.GoArch)
|
||||||
|
if _, err := os.Stat(archSyscallFile); os.IsNotExist(err) {
|
||||||
|
shortArch := strings.TrimSuffix(t.GoArch, "le")
|
||||||
|
archSyscallFile = fmt.Sprintf("syscall_linux_%sx.go", shortArch)
|
||||||
|
}
|
||||||
|
|
||||||
|
args := append(t.mksyscallFlags(), "-tags", "linux,"+t.GoArch,
|
||||||
|
"syscall_linux.go", archSyscallFile)
|
||||||
|
return t.commandFormatOutput("gofmt", zsyscallFile, "./mksyscall.pl", args...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// makes the zerrors_linux_$GOARCH.go file
|
||||||
|
func (t *target) makeZErrorsFile() error {
|
||||||
|
zerrorsFile := fmt.Sprintf("zerrors_linux_%s.go", t.GoArch)
|
||||||
|
|
||||||
|
return t.commandFormatOutput("gofmt", zerrorsFile, "./mkerrors.sh", t.cFlags()...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// makes the ztypes_linux_$GOARCH.go file
|
||||||
|
func (t *target) makeZTypesFile() error {
|
||||||
|
ztypesFile := fmt.Sprintf("ztypes_linux_%s.go", t.GoArch)
|
||||||
|
|
||||||
|
args := []string{"tool", "cgo", "-godefs", "--"}
|
||||||
|
args = append(args, t.cFlags()...)
|
||||||
|
args = append(args, "linux/types.go")
|
||||||
|
return t.commandFormatOutput("mkpost", ztypesFile, "go", args...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Flags that should be given to gcc and cgo for this target
|
||||||
|
func (t *target) cFlags() []string {
|
||||||
|
// Compile statically to avoid cross-architecture dynamic linking.
|
||||||
|
flags := []string{"-Wall", "-Werror", "-static", "-I" + IncludeDir}
|
||||||
|
|
||||||
|
// Architecture-specific flags
|
||||||
|
if t.SignedChar {
|
||||||
|
flags = append(flags, "-fsigned-char")
|
||||||
|
}
|
||||||
|
if t.LinuxArch == "x86" {
|
||||||
|
flags = append(flags, fmt.Sprintf("-m%d", t.Bits))
|
||||||
|
}
|
||||||
|
|
||||||
|
return flags
|
||||||
|
}
|
||||||
|
|
||||||
|
// Flags that should be given to mksyscall for this target
|
||||||
|
func (t *target) mksyscallFlags() (flags []string) {
|
||||||
|
if t.Bits == 32 {
|
||||||
|
if t.BigEndian {
|
||||||
|
flags = append(flags, "-b32")
|
||||||
|
} else {
|
||||||
|
flags = append(flags, "-l32")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This flag menas a 64-bit value should use (even, odd)-pair.
|
||||||
|
if t.GoArch == "arm" || (t.LinuxArch == "mips" && t.Bits == 32) {
|
||||||
|
flags = append(flags, "-arm")
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// generatePtracePair takes a pair of GOARCH values that can run each
|
||||||
|
// other's binaries, such as 386 and amd64. It extracts the PtraceRegs
|
||||||
|
// type for each one. It writes a new file defining the types
|
||||||
|
// PtraceRegsArch1 and PtraceRegsArch2 and the corresponding functions
|
||||||
|
// Ptrace{Get,Set}Regs{arch1,arch2}. This permits debugging the other
|
||||||
|
// binary on a native system.
|
||||||
|
func generatePtracePair(arch1, arch2 string) error {
|
||||||
|
def1, err := ptraceDef(arch1)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
def2, err := ptraceDef(arch2)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
f, err := os.Create(fmt.Sprintf("zptrace%s_linux.go", arch1))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
buf := bufio.NewWriter(f)
|
||||||
|
fmt.Fprintf(buf, "// Code generated by linux/mkall.go generatePtracePair(%s, %s). DO NOT EDIT.\n", arch1, arch2)
|
||||||
|
fmt.Fprintf(buf, "\n")
|
||||||
|
fmt.Fprintf(buf, "// +build linux\n")
|
||||||
|
fmt.Fprintf(buf, "// +build %s %s\n", arch1, arch2)
|
||||||
|
fmt.Fprintf(buf, "\n")
|
||||||
|
fmt.Fprintf(buf, "package unix\n")
|
||||||
|
fmt.Fprintf(buf, "\n")
|
||||||
|
fmt.Fprintf(buf, "%s\n", `import "unsafe"`)
|
||||||
|
fmt.Fprintf(buf, "\n")
|
||||||
|
writeOnePtrace(buf, arch1, def1)
|
||||||
|
fmt.Fprintf(buf, "\n")
|
||||||
|
writeOnePtrace(buf, arch2, def2)
|
||||||
|
if err := buf.Flush(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := f.Close(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ptraceDef returns the definition of PtraceRegs for arch.
|
||||||
|
func ptraceDef(arch string) (string, error) {
|
||||||
|
filename := fmt.Sprintf("ztypes_linux_%s.go", arch)
|
||||||
|
data, err := ioutil.ReadFile(filename)
|
||||||
|
if err != nil {
|
||||||
|
return "", fmt.Errorf("reading %s: %v", filename, err)
|
||||||
|
}
|
||||||
|
start := bytes.Index(data, []byte("type PtraceRegs struct"))
|
||||||
|
if start < 0 {
|
||||||
|
return "", fmt.Errorf("%s: no definition of PtraceRegs", filename)
|
||||||
|
}
|
||||||
|
data = data[start:]
|
||||||
|
end := bytes.Index(data, []byte("\n}\n"))
|
||||||
|
if end < 0 {
|
||||||
|
return "", fmt.Errorf("%s: can't find end of PtraceRegs definition", filename)
|
||||||
|
}
|
||||||
|
return string(data[:end+2]), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// writeOnePtrace writes out the ptrace definitions for arch.
|
||||||
|
func writeOnePtrace(w io.Writer, arch, def string) {
|
||||||
|
uarch := string(unicode.ToUpper(rune(arch[0]))) + arch[1:]
|
||||||
|
fmt.Fprintf(w, "// PtraceRegs%s is the registers used by %s binaries.\n", uarch, arch)
|
||||||
|
fmt.Fprintf(w, "%s\n", strings.Replace(def, "PtraceRegs", "PtraceRegs"+uarch, 1))
|
||||||
|
fmt.Fprintf(w, "\n")
|
||||||
|
fmt.Fprintf(w, "// PtraceGetRegs%s fetches the registers used by %s binaries.\n", uarch, arch)
|
||||||
|
fmt.Fprintf(w, "func PtraceGetRegs%s(pid int, regsout *PtraceRegs%s) error {\n", uarch, uarch)
|
||||||
|
fmt.Fprintf(w, "\treturn ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))\n")
|
||||||
|
fmt.Fprintf(w, "}\n")
|
||||||
|
fmt.Fprintf(w, "\n")
|
||||||
|
fmt.Fprintf(w, "// PtraceSetRegs%s sets the registers used by %s binaries.\n", uarch, arch)
|
||||||
|
fmt.Fprintf(w, "func PtraceSetRegs%s(pid int, regs *PtraceRegs%s) error {\n", uarch, uarch)
|
||||||
|
fmt.Fprintf(w, "\treturn ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))\n")
|
||||||
|
fmt.Fprintf(w, "}\n")
|
||||||
|
}
|
||||||
Generated
Vendored
+141
-14
@@ -5,7 +5,7 @@
|
|||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Input to cgo -godefs. See also mkerrors.sh and mkall.sh
|
Input to cgo -godefs. See README.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// +godefs map struct_in_addr [4]byte /* in_addr */
|
// +godefs map struct_in_addr [4]byte /* in_addr */
|
||||||
@@ -20,7 +20,6 @@ package unix
|
|||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netinet/tcp.h>
|
#include <netinet/tcp.h>
|
||||||
#include <netpacket/packet.h>
|
#include <netpacket/packet.h>
|
||||||
@@ -29,6 +28,7 @@ package unix
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/epoll.h>
|
#include <sys/epoll.h>
|
||||||
#include <sys/inotify.h>
|
#include <sys/inotify.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@@ -36,31 +36,83 @@ package unix
|
|||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#include <sys/signal.h>
|
#include <sys/signal.h>
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/statfs.h>
|
#include <sys/statfs.h>
|
||||||
#include <sys/sysinfo.h>
|
#include <sys/sysinfo.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/times.h>
|
#include <sys/times.h>
|
||||||
#include <sys/timex.h>
|
#include <sys/timex.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
#include <sys/user.h>
|
#include <sys/user.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <linux/filter.h>
|
#include <linux/filter.h>
|
||||||
|
#include <linux/keyctl.h>
|
||||||
#include <linux/netlink.h>
|
#include <linux/netlink.h>
|
||||||
|
#include <linux/perf_event.h>
|
||||||
#include <linux/rtnetlink.h>
|
#include <linux/rtnetlink.h>
|
||||||
#include <linux/icmpv6.h>
|
#include <linux/icmpv6.h>
|
||||||
#include <asm/termbits.h>
|
#include <asm/termbits.h>
|
||||||
|
#include <asm/ptrace.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <ustat.h>
|
#include <ustat.h>
|
||||||
#include <utime.h>
|
#include <utime.h>
|
||||||
#include <bluetooth/bluetooth.h>
|
|
||||||
#include <bluetooth/hci.h>
|
|
||||||
#include <linux/can.h>
|
#include <linux/can.h>
|
||||||
#include <linux/if_alg.h>
|
#include <linux/if_alg.h>
|
||||||
|
#include <linux/fs.h>
|
||||||
#include <linux/vm_sockets.h>
|
#include <linux/vm_sockets.h>
|
||||||
|
#include <linux/random.h>
|
||||||
|
#include <linux/taskstats.h>
|
||||||
|
#include <linux/genetlink.h>
|
||||||
|
|
||||||
|
// On mips64, the glibc stat and kernel stat do not agree
|
||||||
|
#if (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI64)
|
||||||
|
|
||||||
|
// Use the stat defined by the kernel with a few modifications. These are:
|
||||||
|
// * The time fields (like st_atime and st_atimensec) use the timespec
|
||||||
|
// struct (like st_atim) for consitancy with the glibc fields.
|
||||||
|
// * The padding fields get different names to not break compatibility.
|
||||||
|
// * st_blocks is signed, again for compatibility.
|
||||||
|
struct stat {
|
||||||
|
unsigned int st_dev;
|
||||||
|
unsigned int st_pad1[3]; // Reserved for st_dev expansion
|
||||||
|
|
||||||
|
unsigned long st_ino;
|
||||||
|
|
||||||
|
mode_t st_mode;
|
||||||
|
__u32 st_nlink;
|
||||||
|
|
||||||
|
uid_t st_uid;
|
||||||
|
gid_t st_gid;
|
||||||
|
|
||||||
|
unsigned int st_rdev;
|
||||||
|
unsigned int st_pad2[3]; // Reserved for st_rdev expansion
|
||||||
|
|
||||||
|
off_t st_size;
|
||||||
|
|
||||||
|
// These are declared as speperate fields in the kernel. Here we use
|
||||||
|
// the timespec struct for consistancy with the other stat structs.
|
||||||
|
struct timespec st_atim;
|
||||||
|
struct timespec st_mtim;
|
||||||
|
struct timespec st_ctim;
|
||||||
|
|
||||||
|
unsigned int st_blksize;
|
||||||
|
unsigned int st_pad4;
|
||||||
|
|
||||||
|
long st_blocks;
|
||||||
|
};
|
||||||
|
|
||||||
|
// These are needed because we do not include fcntl.h or sys/types.h
|
||||||
|
#include <linux/fcntl.h>
|
||||||
|
#include <linux/fadvise.h>
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
// Use the stat defined by glibc
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef TCSETS2
|
#ifdef TCSETS2
|
||||||
// On systems that have "struct termios2" use this as type Termios.
|
// On systems that have "struct termios2" use this as type Termios.
|
||||||
@@ -87,6 +139,13 @@ struct sockaddr_any {
|
|||||||
char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
|
char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// copied from /usr/include/bluetooth/hci.h
|
||||||
|
struct sockaddr_hci {
|
||||||
|
sa_family_t hci_family;
|
||||||
|
unsigned short hci_dev;
|
||||||
|
unsigned short hci_channel;
|
||||||
|
};;
|
||||||
|
|
||||||
// copied from /usr/include/linux/un.h
|
// copied from /usr/include/linux/un.h
|
||||||
struct my_sockaddr_un {
|
struct my_sockaddr_un {
|
||||||
sa_family_t sun_family;
|
sa_family_t sun_family;
|
||||||
@@ -102,10 +161,8 @@ struct my_sockaddr_un {
|
|||||||
typedef struct user_regs PtraceRegs;
|
typedef struct user_regs PtraceRegs;
|
||||||
#elif defined(__aarch64__)
|
#elif defined(__aarch64__)
|
||||||
typedef struct user_pt_regs PtraceRegs;
|
typedef struct user_pt_regs PtraceRegs;
|
||||||
#elif defined(__powerpc64__)
|
#elif defined(__mips__) || defined(__powerpc64__)
|
||||||
typedef struct pt_regs PtraceRegs;
|
typedef struct pt_regs PtraceRegs;
|
||||||
#elif defined(__mips__)
|
|
||||||
typedef struct user PtraceRegs;
|
|
||||||
#elif defined(__s390x__)
|
#elif defined(__s390x__)
|
||||||
typedef struct _user_regs_struct PtraceRegs;
|
typedef struct _user_regs_struct PtraceRegs;
|
||||||
#elif defined(__sparc__)
|
#elif defined(__sparc__)
|
||||||
@@ -196,6 +253,16 @@ type Fsid C.fsid_t
|
|||||||
|
|
||||||
type Flock_t C.struct_flock
|
type Flock_t C.struct_flock
|
||||||
|
|
||||||
|
// Filesystem Encryption
|
||||||
|
|
||||||
|
type FscryptPolicy C.struct_fscrypt_policy
|
||||||
|
|
||||||
|
type FscryptKey C.struct_fscrypt_key
|
||||||
|
|
||||||
|
// Structure for Keyctl
|
||||||
|
|
||||||
|
type KeyctlDHParams C.struct_keyctl_dh_params
|
||||||
|
|
||||||
// Advice to Fadvise
|
// Advice to Fadvise
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -243,6 +310,8 @@ type IPMreqn C.struct_ip_mreqn
|
|||||||
|
|
||||||
type IPv6Mreq C.struct_ipv6_mreq
|
type IPv6Mreq C.struct_ipv6_mreq
|
||||||
|
|
||||||
|
type PacketMreq C.struct_packet_mreq
|
||||||
|
|
||||||
type Msghdr C.struct_msghdr
|
type Msghdr C.struct_msghdr
|
||||||
|
|
||||||
type Cmsghdr C.struct_cmsghdr
|
type Cmsghdr C.struct_cmsghdr
|
||||||
@@ -271,9 +340,11 @@ const (
|
|||||||
SizeofSockaddrALG = C.sizeof_struct_sockaddr_alg
|
SizeofSockaddrALG = C.sizeof_struct_sockaddr_alg
|
||||||
SizeofSockaddrVM = C.sizeof_struct_sockaddr_vm
|
SizeofSockaddrVM = C.sizeof_struct_sockaddr_vm
|
||||||
SizeofLinger = C.sizeof_struct_linger
|
SizeofLinger = C.sizeof_struct_linger
|
||||||
|
SizeofIovec = C.sizeof_struct_iovec
|
||||||
SizeofIPMreq = C.sizeof_struct_ip_mreq
|
SizeofIPMreq = C.sizeof_struct_ip_mreq
|
||||||
SizeofIPMreqn = C.sizeof_struct_ip_mreqn
|
SizeofIPMreqn = C.sizeof_struct_ip_mreqn
|
||||||
SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
|
SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
|
||||||
|
SizeofPacketMreq = C.sizeof_struct_packet_mreq
|
||||||
SizeofMsghdr = C.sizeof_struct_msghdr
|
SizeofMsghdr = C.sizeof_struct_msghdr
|
||||||
SizeofCmsghdr = C.sizeof_struct_cmsghdr
|
SizeofCmsghdr = C.sizeof_struct_cmsghdr
|
||||||
SizeofInet4Pktinfo = C.sizeof_struct_in_pktinfo
|
SizeofInet4Pktinfo = C.sizeof_struct_in_pktinfo
|
||||||
@@ -421,11 +492,11 @@ const SizeofInotifyEvent = C.sizeof_struct_inotify_event
|
|||||||
type PtraceRegs C.PtraceRegs
|
type PtraceRegs C.PtraceRegs
|
||||||
|
|
||||||
// Structures contained in PtraceRegs on s390x (exported by mkpost.go)
|
// Structures contained in PtraceRegs on s390x (exported by mkpost.go)
|
||||||
type ptracePsw C.ptracePsw
|
type PtracePsw C.ptracePsw
|
||||||
|
|
||||||
type ptraceFpregs C.ptraceFpregs
|
type PtraceFpregs C.ptraceFpregs
|
||||||
|
|
||||||
type ptracePer C.ptracePer
|
type PtracePer C.ptracePer
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
|
|
||||||
@@ -441,6 +512,7 @@ type EpollEvent C.struct_my_epoll_event
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
AT_FDCWD = C.AT_FDCWD
|
AT_FDCWD = C.AT_FDCWD
|
||||||
|
AT_NO_AUTOMOUNT = C.AT_NO_AUTOMOUNT
|
||||||
AT_REMOVEDIR = C.AT_REMOVEDIR
|
AT_REMOVEDIR = C.AT_REMOVEDIR
|
||||||
AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
|
AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
|
||||||
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||||
@@ -460,10 +532,65 @@ const (
|
|||||||
|
|
||||||
type Sigset_t C.sigset_t
|
type Sigset_t C.sigset_t
|
||||||
|
|
||||||
// sysconf information
|
const RNDGETENTCNT = C.RNDGETENTCNT
|
||||||
|
|
||||||
const _SC_PAGESIZE = C._SC_PAGESIZE
|
const PERF_IOC_FLAG_GROUP = C.PERF_IOC_FLAG_GROUP
|
||||||
|
|
||||||
// Terminal handling
|
// Terminal handling
|
||||||
|
|
||||||
type Termios C.termios_t
|
type Termios C.termios_t
|
||||||
|
|
||||||
|
type Winsize C.struct_winsize
|
||||||
|
|
||||||
|
// Taskstats
|
||||||
|
|
||||||
|
type Taskstats C.struct_taskstats
|
||||||
|
|
||||||
|
const (
|
||||||
|
TASKSTATS_CMD_UNSPEC = C.TASKSTATS_CMD_UNSPEC
|
||||||
|
TASKSTATS_CMD_GET = C.TASKSTATS_CMD_GET
|
||||||
|
TASKSTATS_CMD_NEW = C.TASKSTATS_CMD_NEW
|
||||||
|
TASKSTATS_TYPE_UNSPEC = C.TASKSTATS_TYPE_UNSPEC
|
||||||
|
TASKSTATS_TYPE_PID = C.TASKSTATS_TYPE_PID
|
||||||
|
TASKSTATS_TYPE_TGID = C.TASKSTATS_TYPE_TGID
|
||||||
|
TASKSTATS_TYPE_STATS = C.TASKSTATS_TYPE_STATS
|
||||||
|
TASKSTATS_TYPE_AGGR_PID = C.TASKSTATS_TYPE_AGGR_PID
|
||||||
|
TASKSTATS_TYPE_AGGR_TGID = C.TASKSTATS_TYPE_AGGR_TGID
|
||||||
|
TASKSTATS_TYPE_NULL = C.TASKSTATS_TYPE_NULL
|
||||||
|
TASKSTATS_CMD_ATTR_UNSPEC = C.TASKSTATS_CMD_ATTR_UNSPEC
|
||||||
|
TASKSTATS_CMD_ATTR_PID = C.TASKSTATS_CMD_ATTR_PID
|
||||||
|
TASKSTATS_CMD_ATTR_TGID = C.TASKSTATS_CMD_ATTR_TGID
|
||||||
|
TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = C.TASKSTATS_CMD_ATTR_REGISTER_CPUMASK
|
||||||
|
TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = C.TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK
|
||||||
|
)
|
||||||
|
|
||||||
|
// Generic netlink
|
||||||
|
|
||||||
|
type Genlmsghdr C.struct_genlmsghdr
|
||||||
|
|
||||||
|
const (
|
||||||
|
CTRL_CMD_UNSPEC = C.CTRL_CMD_UNSPEC
|
||||||
|
CTRL_CMD_NEWFAMILY = C.CTRL_CMD_NEWFAMILY
|
||||||
|
CTRL_CMD_DELFAMILY = C.CTRL_CMD_DELFAMILY
|
||||||
|
CTRL_CMD_GETFAMILY = C.CTRL_CMD_GETFAMILY
|
||||||
|
CTRL_CMD_NEWOPS = C.CTRL_CMD_NEWOPS
|
||||||
|
CTRL_CMD_DELOPS = C.CTRL_CMD_DELOPS
|
||||||
|
CTRL_CMD_GETOPS = C.CTRL_CMD_GETOPS
|
||||||
|
CTRL_CMD_NEWMCAST_GRP = C.CTRL_CMD_NEWMCAST_GRP
|
||||||
|
CTRL_CMD_DELMCAST_GRP = C.CTRL_CMD_DELMCAST_GRP
|
||||||
|
CTRL_CMD_GETMCAST_GRP = C.CTRL_CMD_GETMCAST_GRP
|
||||||
|
CTRL_ATTR_UNSPEC = C.CTRL_ATTR_UNSPEC
|
||||||
|
CTRL_ATTR_FAMILY_ID = C.CTRL_ATTR_FAMILY_ID
|
||||||
|
CTRL_ATTR_FAMILY_NAME = C.CTRL_ATTR_FAMILY_NAME
|
||||||
|
CTRL_ATTR_VERSION = C.CTRL_ATTR_VERSION
|
||||||
|
CTRL_ATTR_HDRSIZE = C.CTRL_ATTR_HDRSIZE
|
||||||
|
CTRL_ATTR_MAXATTR = C.CTRL_ATTR_MAXATTR
|
||||||
|
CTRL_ATTR_OPS = C.CTRL_ATTR_OPS
|
||||||
|
CTRL_ATTR_MCAST_GROUPS = C.CTRL_ATTR_MCAST_GROUPS
|
||||||
|
CTRL_ATTR_OP_UNSPEC = C.CTRL_ATTR_OP_UNSPEC
|
||||||
|
CTRL_ATTR_OP_ID = C.CTRL_ATTR_OP_ID
|
||||||
|
CTRL_ATTR_OP_FLAGS = C.CTRL_ATTR_OP_FLAGS
|
||||||
|
CTRL_ATTR_MCAST_GRP_UNSPEC = C.CTRL_ATTR_MCAST_GRP_UNSPEC
|
||||||
|
CTRL_ATTR_MCAST_GRP_NAME = C.CTRL_ATTR_MCAST_GRP_NAME
|
||||||
|
CTRL_ATTR_MCAST_GRP_ID = C.CTRL_ATTR_MCAST_GRP_ID
|
||||||
|
)
|
||||||
+56
-25
@@ -8,10 +8,11 @@
|
|||||||
// modify the generated types. It is used to clean up
|
// modify the generated types. It is used to clean up
|
||||||
// the sys API in an architecture specific manner.
|
// the sys API in an architecture specific manner.
|
||||||
//
|
//
|
||||||
// mkpost is run after cgo -godefs by mkall.sh.
|
// mkpost is run after cgo -godefs; see README.md.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go/format"
|
"go/format"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
@@ -21,42 +22,72 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
// Get the OS and architecture (using GOARCH_TARGET if it exists)
|
||||||
|
goos := os.Getenv("GOOS")
|
||||||
|
goarch := os.Getenv("GOARCH_TARGET")
|
||||||
|
if goarch == "" {
|
||||||
|
goarch = os.Getenv("GOARCH")
|
||||||
|
}
|
||||||
|
// Check that we are using the new build system if we should be.
|
||||||
|
if goos == "linux" && goarch != "sparc64" {
|
||||||
|
if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
|
||||||
|
os.Stderr.WriteString("In the new build system, mkpost should not be called directly.\n")
|
||||||
|
os.Stderr.WriteString("See README.md\n")
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
b, err := ioutil.ReadAll(os.Stdin)
|
b, err := ioutil.ReadAll(os.Stdin)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
s := string(b)
|
|
||||||
|
|
||||||
goarch := os.Getenv("GOARCH")
|
// If we have empty Ptrace structs, we should delete them. Only s390x emits
|
||||||
goos := os.Getenv("GOOS")
|
// nonempty Ptrace structs.
|
||||||
|
ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`)
|
||||||
|
b = ptraceRexexp.ReplaceAll(b, nil)
|
||||||
|
|
||||||
|
// Replace the control_regs union with a blank identifier for now.
|
||||||
|
controlRegsRegex := regexp.MustCompile(`(Control_regs)\s+\[0\]uint64`)
|
||||||
|
b = controlRegsRegex.ReplaceAll(b, []byte("_ [0]uint64"))
|
||||||
|
|
||||||
|
// Remove fields that are added by glibc
|
||||||
|
// Note that this is unstable as the identifers are private.
|
||||||
|
removeFieldsRegex := regexp.MustCompile(`X__glibc\S*`)
|
||||||
|
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
|
||||||
|
|
||||||
|
// Convert [65]int8 to [65]byte in Utsname members to simplify
|
||||||
|
// conversion to string; see golang.org/issue/20753
|
||||||
|
convertUtsnameRegex := regexp.MustCompile(`((Sys|Node|Domain)name|Release|Version|Machine)(\s+)\[(\d+)\]u?int8`)
|
||||||
|
b = convertUtsnameRegex.ReplaceAll(b, []byte("$1$3[$4]byte"))
|
||||||
|
|
||||||
|
// We refuse to export private fields on s390x
|
||||||
if goarch == "s390x" && goos == "linux" {
|
if goarch == "s390x" && goos == "linux" {
|
||||||
// Export the types of PtraceRegs fields.
|
// Remove cgo padding fields
|
||||||
re := regexp.MustCompile("ptrace(Psw|Fpregs|Per)")
|
removeFieldsRegex := regexp.MustCompile(`Pad_cgo_\d+`)
|
||||||
s = re.ReplaceAllString(s, "Ptrace$1")
|
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
|
||||||
|
|
||||||
// Replace padding fields inserted by cgo with blank identifiers.
|
// Remove padding, hidden, or unused fields
|
||||||
re = regexp.MustCompile("Pad_cgo[A-Za-z0-9_]*")
|
removeFieldsRegex = regexp.MustCompile(`X_\S+`)
|
||||||
s = re.ReplaceAllString(s, "_")
|
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
|
||||||
|
|
||||||
// Replace other unwanted fields with blank identifiers.
|
|
||||||
re = regexp.MustCompile("X_[A-Za-z0-9_]*")
|
|
||||||
s = re.ReplaceAllString(s, "_")
|
|
||||||
|
|
||||||
// Replace the control_regs union with a blank identifier for now.
|
|
||||||
re = regexp.MustCompile("(Control_regs)\\s+\\[0\\]uint64")
|
|
||||||
s = re.ReplaceAllString(s, "_ [0]uint64")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove the first line of warning from cgo
|
||||||
|
b = b[bytes.IndexByte(b, '\n')+1:]
|
||||||
|
// Modify the command in the header to include:
|
||||||
|
// mkpost, our own warning, and a build tag.
|
||||||
|
replacement := fmt.Sprintf(`$1 | go run mkpost.go
|
||||||
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
|
// +build %s,%s`, goarch, goos)
|
||||||
|
cgoCommandRegex := regexp.MustCompile(`(cgo -godefs .*)`)
|
||||||
|
b = cgoCommandRegex.ReplaceAll(b, []byte(replacement))
|
||||||
|
|
||||||
// gofmt
|
// gofmt
|
||||||
b, err = format.Source([]byte(s))
|
b, err = format.Source(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Append this command to the header to show where the new file
|
os.Stdout.Write(b)
|
||||||
// came from.
|
|
||||||
re := regexp.MustCompile("(cgo -godefs [a-zA-Z0-9_]+\\.go.*)")
|
|
||||||
b = re.ReplaceAll(b, []byte("$1 | go run mkpost.go"))
|
|
||||||
|
|
||||||
fmt.Printf("%s", b)
|
|
||||||
}
|
}
|
||||||
|
|||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
||||||
|
|
||||||
|
// For Unix, get the pagesize from the runtime.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import "syscall"
|
||||||
|
|
||||||
|
func Getpagesize() int {
|
||||||
|
return syscall.Getpagesize()
|
||||||
|
}
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2011 The Go Authors. All rights reserved.
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
|||||||
+5
-4
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2011 The Go Authors. All rights reserved.
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
@@ -13,9 +13,10 @@ import "unsafe"
|
|||||||
// Round the length of a raw sockaddr up to align it properly.
|
// Round the length of a raw sockaddr up to align it properly.
|
||||||
func cmsgAlignOf(salen int) int {
|
func cmsgAlignOf(salen int) int {
|
||||||
salign := sizeofPtr
|
salign := sizeofPtr
|
||||||
// NOTE: It seems like 64-bit Darwin and DragonFly BSD kernels
|
// NOTE: It seems like 64-bit Darwin, DragonFly BSD and
|
||||||
// still require 32-bit aligned access to network subsystem.
|
// Solaris kernels still require 32-bit aligned access to
|
||||||
if darwin64Bit || dragonfly64Bit {
|
// network subsystem.
|
||||||
|
if darwin64Bit || dragonfly64Bit || solaris64Bit {
|
||||||
salign = 4
|
salign = 4
|
||||||
}
|
}
|
||||||
return (salen + salign - 1) & ^(salign - 1)
|
return (salen + salign - 1) & ^(salign - 1)
|
||||||
|
|||||||
+3
-21
@@ -5,10 +5,10 @@
|
|||||||
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
||||||
|
|
||||||
// Package unix contains an interface to the low-level operating system
|
// Package unix contains an interface to the low-level operating system
|
||||||
// primitives. OS details vary depending on the underlying system, and
|
// primitives. OS details vary depending on the underlying system, and
|
||||||
// by default, godoc will display OS-specific documentation for the current
|
// by default, godoc will display OS-specific documentation for the current
|
||||||
// system. If you want godoc to display OS documentation for another
|
// system. If you want godoc to display OS documentation for another
|
||||||
// system, set $GOOS and $GOARCH to the desired system. For example, if
|
// system, set $GOOS and $GOARCH to the desired system. For example, if
|
||||||
// you want to view documentation for freebsd/arm on linux/amd64, set $GOOS
|
// you want to view documentation for freebsd/arm on linux/amd64, set $GOOS
|
||||||
// to freebsd and $GOARCH to arm.
|
// to freebsd and $GOARCH to arm.
|
||||||
// The primary use of this package is inside other packages that provide a more
|
// The primary use of this package is inside other packages that provide a more
|
||||||
@@ -49,21 +49,3 @@ func BytePtrFromString(s string) (*byte, error) {
|
|||||||
// Single-word zero for use when we need a valid pointer to 0 bytes.
|
// Single-word zero for use when we need a valid pointer to 0 bytes.
|
||||||
// See mkunix.pl.
|
// See mkunix.pl.
|
||||||
var _zero uintptr
|
var _zero uintptr
|
||||||
|
|
||||||
func (ts *Timespec) Unix() (sec int64, nsec int64) {
|
|
||||||
return int64(ts.Sec), int64(ts.Nsec)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (tv *Timeval) Unix() (sec int64, nsec int64) {
|
|
||||||
return int64(tv.Sec), int64(tv.Usec) * 1000
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ts *Timespec) Nano() int64 {
|
|
||||||
return int64(ts.Sec)*1e9 + int64(ts.Nsec)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (tv *Timeval) Nano() int64 {
|
|
||||||
return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000
|
|
||||||
}
|
|
||||||
|
|
||||||
func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }
|
|
||||||
|
|||||||
+57
-6
@@ -34,7 +34,7 @@ func Getgroups() (gids []int, err error) {
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sanity check group count. Max is 16 on BSD.
|
// Sanity check group count. Max is 16 on BSD.
|
||||||
if n < 0 || n > 1000 {
|
if n < 0 || n > 1000 {
|
||||||
return nil, EINVAL
|
return nil, EINVAL
|
||||||
}
|
}
|
||||||
@@ -352,6 +352,18 @@ func GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error) {
|
|||||||
return &value, err
|
return &value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetsockoptString returns the string value of the socket option opt for the
|
||||||
|
// socket associated with fd at the given socket level.
|
||||||
|
func GetsockoptString(fd, level, opt int) (string, error) {
|
||||||
|
buf := make([]byte, 256)
|
||||||
|
vallen := _Socklen(len(buf))
|
||||||
|
err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return string(buf[:vallen-1]), nil
|
||||||
|
}
|
||||||
|
|
||||||
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
|
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
|
||||||
//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
|
//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
|
||||||
//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
||||||
@@ -561,13 +573,24 @@ func Utimes(path string, tv []Timeval) error {
|
|||||||
|
|
||||||
func UtimesNano(path string, ts []Timespec) error {
|
func UtimesNano(path string, ts []Timespec) error {
|
||||||
if ts == nil {
|
if ts == nil {
|
||||||
|
err := utimensat(AT_FDCWD, path, nil, 0)
|
||||||
|
if err != ENOSYS {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return utimes(path, nil)
|
return utimes(path, nil)
|
||||||
}
|
}
|
||||||
// TODO: The BSDs can do utimensat with SYS_UTIMENSAT but it
|
|
||||||
// isn't supported by darwin so this uses utimes instead
|
|
||||||
if len(ts) != 2 {
|
if len(ts) != 2 {
|
||||||
return EINVAL
|
return EINVAL
|
||||||
}
|
}
|
||||||
|
// Darwin setattrlist can set nanosecond timestamps
|
||||||
|
err := setattrlistTimes(path, ts, 0)
|
||||||
|
if err != ENOSYS {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
err = utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
|
||||||
|
if err != ENOSYS {
|
||||||
|
return err
|
||||||
|
}
|
||||||
// Not as efficient as it could be because Timespec and
|
// Not as efficient as it could be because Timespec and
|
||||||
// Timeval have different types in the different OSes
|
// Timeval have different types in the different OSes
|
||||||
tv := [2]Timeval{
|
tv := [2]Timeval{
|
||||||
@@ -577,6 +600,20 @@ func UtimesNano(path string, ts []Timespec) error {
|
|||||||
return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
|
return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
|
||||||
|
if ts == nil {
|
||||||
|
return utimensat(dirfd, path, nil, flags)
|
||||||
|
}
|
||||||
|
if len(ts) != 2 {
|
||||||
|
return EINVAL
|
||||||
|
}
|
||||||
|
err := setattrlistTimes(path, ts, flags)
|
||||||
|
if err != ENOSYS {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags)
|
||||||
|
}
|
||||||
|
|
||||||
//sys futimes(fd int, timeval *[2]Timeval) (err error)
|
//sys futimes(fd int, timeval *[2]Timeval) (err error)
|
||||||
|
|
||||||
func Futimes(fd int, tv []Timeval) error {
|
func Futimes(fd int, tv []Timeval) error {
|
||||||
@@ -591,12 +628,18 @@ func Futimes(fd int, tv []Timeval) error {
|
|||||||
|
|
||||||
//sys fcntl(fd int, cmd int, arg int) (val int, err error)
|
//sys fcntl(fd int, cmd int, arg int) (val int, err error)
|
||||||
|
|
||||||
|
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
|
||||||
|
|
||||||
|
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||||
|
if len(fds) == 0 {
|
||||||
|
return poll(nil, 0, timeout)
|
||||||
|
}
|
||||||
|
return poll(&fds[0], len(fds), timeout)
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: wrap
|
// TODO: wrap
|
||||||
// Acct(name nil-string) (err error)
|
// Acct(name nil-string) (err error)
|
||||||
// Gethostuuid(uuid *byte, timeout *Timespec) (err error)
|
// Gethostuuid(uuid *byte, timeout *Timespec) (err error)
|
||||||
// Madvise(addr *byte, len int, behav int) (err error)
|
|
||||||
// Mprotect(addr *byte, len int, prot int) (err error)
|
|
||||||
// Msync(addr *byte, len int, flags int) (err error)
|
|
||||||
// Ptrace(req int, pid int, addr uintptr, data int) (ret uintptr, err error)
|
// Ptrace(req int, pid int, addr uintptr, data int) (ret uintptr, err error)
|
||||||
|
|
||||||
var mapper = &mmapper{
|
var mapper = &mmapper{
|
||||||
@@ -612,3 +655,11 @@ func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, e
|
|||||||
func Munmap(b []byte) (err error) {
|
func Munmap(b []byte) (err error) {
|
||||||
return mapper.Munmap(b)
|
return mapper.Munmap(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sys Madvise(b []byte, behav int) (err error)
|
||||||
|
//sys Mlock(b []byte) (err error)
|
||||||
|
//sys Mlockall(flags int) (err error)
|
||||||
|
//sys Mprotect(b []byte, prot int) (err error)
|
||||||
|
//sys Msync(b []byte, flags int) (err error)
|
||||||
|
//sys Munlock(b []byte) (err error)
|
||||||
|
//sys Munlockall() (err error)
|
||||||
|
|||||||
+132
-13
@@ -54,7 +54,7 @@ func nametomib(name string) (mib []_C_int, err error) {
|
|||||||
|
|
||||||
// NOTE(rsc): It seems strange to set the buffer to have
|
// NOTE(rsc): It seems strange to set the buffer to have
|
||||||
// size CTL_MAXNAME+2 but use only CTL_MAXNAME
|
// size CTL_MAXNAME+2 but use only CTL_MAXNAME
|
||||||
// as the size. I don't know why the +2 is here, but the
|
// as the size. I don't know why the +2 is here, but the
|
||||||
// kernel uses +2 for its own implementation of this function.
|
// kernel uses +2 for its own implementation of this function.
|
||||||
// I am scared that if we don't include the +2 here, the kernel
|
// I am scared that if we don't include the +2 here, the kernel
|
||||||
// will silently write 2 words farther than we specify
|
// will silently write 2 words farther than we specify
|
||||||
@@ -187,6 +187,42 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setattrlistTimes(path string, times []Timespec, flags int) error {
|
||||||
|
_p0, err := BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
var attrList attrList
|
||||||
|
attrList.bitmapCount = ATTR_BIT_MAP_COUNT
|
||||||
|
attrList.CommonAttr = ATTR_CMN_MODTIME | ATTR_CMN_ACCTIME
|
||||||
|
|
||||||
|
// order is mtime, atime: the opposite of Chtimes
|
||||||
|
attributes := [2]Timespec{times[1], times[0]}
|
||||||
|
options := 0
|
||||||
|
if flags&AT_SYMLINK_NOFOLLOW != 0 {
|
||||||
|
options |= FSOPT_NOFOLLOW
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(
|
||||||
|
SYS_SETATTRLIST,
|
||||||
|
uintptr(unsafe.Pointer(_p0)),
|
||||||
|
uintptr(unsafe.Pointer(&attrList)),
|
||||||
|
uintptr(unsafe.Pointer(&attributes)),
|
||||||
|
uintptr(unsafe.Sizeof(attributes)),
|
||||||
|
uintptr(options),
|
||||||
|
0,
|
||||||
|
)
|
||||||
|
if e1 != 0 {
|
||||||
|
return e1
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error {
|
||||||
|
// Darwin doesn't support SYS_UTIMENSAT
|
||||||
|
return ENOSYS
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wrapped
|
* Wrapped
|
||||||
*/
|
*/
|
||||||
@@ -195,6 +231,91 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
|
|
||||||
func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 1) }
|
func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 1) }
|
||||||
|
|
||||||
|
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||||
|
|
||||||
|
// ioctl itself should not be exposed directly, but additional get/set
|
||||||
|
// functions for specific types are permissible.
|
||||||
|
|
||||||
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
|
// on fd, using the specified request number.
|
||||||
|
func IoctlSetInt(fd int, req uint, value int) error {
|
||||||
|
return ioctl(fd, req, uintptr(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||||
|
// from fd, using the specified request number.
|
||||||
|
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||||
|
var value int
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||||
|
var value Winsize
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||||
|
var value Termios
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func Uname(uname *Utsname) error {
|
||||||
|
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
|
||||||
|
n := unsafe.Sizeof(uname.Sysname)
|
||||||
|
if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
|
||||||
|
n = unsafe.Sizeof(uname.Nodename)
|
||||||
|
if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
|
||||||
|
n = unsafe.Sizeof(uname.Release)
|
||||||
|
if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_VERSION}
|
||||||
|
n = unsafe.Sizeof(uname.Version)
|
||||||
|
if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// The version might have newlines or tabs in it, convert them to
|
||||||
|
// spaces.
|
||||||
|
for i, b := range uname.Version {
|
||||||
|
if b == '\n' || b == '\t' {
|
||||||
|
if i == len(uname.Version)-1 {
|
||||||
|
uname.Version[i] = 0
|
||||||
|
} else {
|
||||||
|
uname.Version[i] = ' '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_HW, HW_MACHINE}
|
||||||
|
n = unsafe.Sizeof(uname.Machine)
|
||||||
|
if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exposed directly
|
* Exposed directly
|
||||||
*/
|
*/
|
||||||
@@ -210,10 +331,13 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
|||||||
//sys Dup2(from int, to int) (err error)
|
//sys Dup2(from int, to int) (err error)
|
||||||
//sys Exchangedata(path1 string, path2 string, options int) (err error)
|
//sys Exchangedata(path1 string, path2 string, options int) (err error)
|
||||||
//sys Exit(code int)
|
//sys Exit(code int)
|
||||||
|
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
//sys Fchdir(fd int) (err error)
|
//sys Fchdir(fd int) (err error)
|
||||||
//sys Fchflags(fd int, flags int) (err error)
|
//sys Fchflags(fd int, flags int) (err error)
|
||||||
//sys Fchmod(fd int, mode uint32) (err error)
|
//sys Fchmod(fd int, mode uint32) (err error)
|
||||||
|
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
|
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
|
||||||
//sys Flock(fd int, how int) (err error)
|
//sys Flock(fd int, how int) (err error)
|
||||||
//sys Fpathconf(fd int, name int) (val int, err error)
|
//sys Fpathconf(fd int, name int) (val int, err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
||||||
@@ -238,23 +362,23 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
|||||||
//sys Kqueue() (fd int, err error)
|
//sys Kqueue() (fd int, err error)
|
||||||
//sys Lchown(path string, uid int, gid int) (err error)
|
//sys Lchown(path string, uid int, gid int) (err error)
|
||||||
//sys Link(path string, link string) (err error)
|
//sys Link(path string, link string) (err error)
|
||||||
|
//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
|
||||||
//sys Listen(s int, backlog int) (err error)
|
//sys Listen(s int, backlog int) (err error)
|
||||||
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
||||||
//sys Mkdir(path string, mode uint32) (err error)
|
//sys Mkdir(path string, mode uint32) (err error)
|
||||||
|
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
|
||||||
//sys Mkfifo(path string, mode uint32) (err error)
|
//sys Mkfifo(path string, mode uint32) (err error)
|
||||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||||
//sys Mlock(b []byte) (err error)
|
|
||||||
//sys Mlockall(flags int) (err error)
|
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
|
||||||
//sys Munlock(b []byte) (err error)
|
|
||||||
//sys Munlockall() (err error)
|
|
||||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||||
|
//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error)
|
||||||
//sys Pathconf(path string, name int) (val int, err error)
|
//sys Pathconf(path string, name int) (val int, err error)
|
||||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error)
|
//sys Pread(fd int, p []byte, offset int64) (n int, err error)
|
||||||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
|
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
|
||||||
//sys read(fd int, p []byte) (n int, err error)
|
//sys read(fd int, p []byte) (n int, err error)
|
||||||
//sys Readlink(path string, buf []byte) (n int, err error)
|
//sys Readlink(path string, buf []byte) (n int, err error)
|
||||||
|
//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
|
||||||
//sys Rename(from string, to string) (err error)
|
//sys Rename(from string, to string) (err error)
|
||||||
|
//sys Renameat(fromfd int, from string, tofd int, to string) (err error)
|
||||||
//sys Revoke(path string) (err error)
|
//sys Revoke(path string) (err error)
|
||||||
//sys Rmdir(path string) (err error)
|
//sys Rmdir(path string) (err error)
|
||||||
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
|
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
|
||||||
@@ -275,11 +399,13 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
|||||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
||||||
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
|
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
|
||||||
//sys Symlink(path string, link string) (err error)
|
//sys Symlink(path string, link string) (err error)
|
||||||
|
//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
|
||||||
//sys Sync() (err error)
|
//sys Sync() (err error)
|
||||||
//sys Truncate(path string, length int64) (err error)
|
//sys Truncate(path string, length int64) (err error)
|
||||||
//sys Umask(newmask int) (oldmask int)
|
//sys Umask(newmask int) (oldmask int)
|
||||||
//sys Undelete(path string) (err error)
|
//sys Undelete(path string) (err error)
|
||||||
//sys Unlink(path string) (err error)
|
//sys Unlink(path string) (err error)
|
||||||
|
//sys Unlinkat(dirfd int, path string, flags int) (err error)
|
||||||
//sys Unmount(path string, flags int) (err error)
|
//sys Unmount(path string, flags int) (err error)
|
||||||
//sys write(fd int, p []byte) (n int, err error)
|
//sys write(fd int, p []byte) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
||||||
@@ -319,9 +445,6 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
|||||||
// Add_profil
|
// Add_profil
|
||||||
// Kdebug_trace
|
// Kdebug_trace
|
||||||
// Sigreturn
|
// Sigreturn
|
||||||
// Mmap
|
|
||||||
// Mlock
|
|
||||||
// Munlock
|
|
||||||
// Atsocket
|
// Atsocket
|
||||||
// Kqueue_from_portset_np
|
// Kqueue_from_portset_np
|
||||||
// Kqueue_portset
|
// Kqueue_portset
|
||||||
@@ -331,7 +454,6 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
|||||||
// Searchfs
|
// Searchfs
|
||||||
// Delete
|
// Delete
|
||||||
// Copyfile
|
// Copyfile
|
||||||
// Poll
|
|
||||||
// Watchevent
|
// Watchevent
|
||||||
// Waitevent
|
// Waitevent
|
||||||
// Modwatch
|
// Modwatch
|
||||||
@@ -414,8 +536,6 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
|||||||
// Lio_listio
|
// Lio_listio
|
||||||
// __pthread_cond_wait
|
// __pthread_cond_wait
|
||||||
// Iopolicysys
|
// Iopolicysys
|
||||||
// Mlockall
|
|
||||||
// Munlockall
|
|
||||||
// __pthread_kill
|
// __pthread_kill
|
||||||
// __pthread_sigmask
|
// __pthread_sigmask
|
||||||
// __sigwait
|
// __sigwait
|
||||||
@@ -469,7 +589,6 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
|||||||
// Sendmsg_nocancel
|
// Sendmsg_nocancel
|
||||||
// Recvfrom_nocancel
|
// Recvfrom_nocancel
|
||||||
// Accept_nocancel
|
// Accept_nocancel
|
||||||
// Msync_nocancel
|
|
||||||
// Fcntl_nocancel
|
// Fcntl_nocancel
|
||||||
// Select_nocancel
|
// Select_nocancel
|
||||||
// Fsync_nocancel
|
// Fsync_nocancel
|
||||||
|
|||||||
+5
-14
@@ -11,27 +11,18 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int32(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int32(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
|
//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
|
||||||
func Gettimeofday(tv *Timeval) (err error) {
|
func Gettimeofday(tv *Timeval) (err error) {
|
||||||
// The tv passed to gettimeofday must be non-nil
|
// The tv passed to gettimeofday must be non-nil
|
||||||
// but is otherwise unused. The answers come back
|
// but is otherwise unused. The answers come back
|
||||||
// in the two registers.
|
// in the two registers.
|
||||||
sec, usec, err := gettimeofday(tv)
|
sec, usec, err := gettimeofday(tv)
|
||||||
tv.Sec = int32(sec)
|
tv.Sec = int32(sec)
|
||||||
|
|||||||
+5
-16
@@ -11,29 +11,18 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func Getpagesize() int { return 4096 }
|
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
|
//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
|
||||||
func Gettimeofday(tv *Timeval) (err error) {
|
func Gettimeofday(tv *Timeval) (err error) {
|
||||||
// The tv passed to gettimeofday must be non-nil
|
// The tv passed to gettimeofday must be non-nil
|
||||||
// but is otherwise unused. The answers come back
|
// but is otherwise unused. The answers come back
|
||||||
// in the two registers.
|
// in the two registers.
|
||||||
sec, usec, err := gettimeofday(tv)
|
sec, usec, err := gettimeofday(tv)
|
||||||
tv.Sec = sec
|
tv.Sec = sec
|
||||||
|
|||||||
+9
-14
@@ -9,27 +9,18 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int32(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int32(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
|
//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
|
||||||
func Gettimeofday(tv *Timeval) (err error) {
|
func Gettimeofday(tv *Timeval) (err error) {
|
||||||
// The tv passed to gettimeofday must be non-nil
|
// The tv passed to gettimeofday must be non-nil
|
||||||
// but is otherwise unused. The answers come back
|
// but is otherwise unused. The answers come back
|
||||||
// in the two registers.
|
// in the two registers.
|
||||||
sec, usec, err := gettimeofday(tv)
|
sec, usec, err := gettimeofday(tv)
|
||||||
tv.Sec = int32(sec)
|
tv.Sec = int32(sec)
|
||||||
@@ -69,3 +60,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic
|
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic
|
||||||
|
|
||||||
|
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
|
||||||
|
// of darwin/arm the syscall is called sysctl instead of __sysctl.
|
||||||
|
const SYS___SYSCTL = SYS_SYSCTL
|
||||||
|
|||||||
+5
-14
@@ -11,27 +11,18 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 16384 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
|
//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
|
||||||
func Gettimeofday(tv *Timeval) (err error) {
|
func Gettimeofday(tv *Timeval) (err error) {
|
||||||
// The tv passed to gettimeofday must be non-nil
|
// The tv passed to gettimeofday must be non-nil
|
||||||
// but is otherwise unused. The answers come back
|
// but is otherwise unused. The answers come back
|
||||||
// in the two registers.
|
// in the two registers.
|
||||||
sec, usec, err := gettimeofday(tv)
|
sec, usec, err := gettimeofday(tv)
|
||||||
tv.Sec = sec
|
tv.Sec = sec
|
||||||
|
|||||||
+149
-15
@@ -1,8 +1,8 @@
|
|||||||
// Copyright 2009,2010 The Go Authors. All rights reserved.
|
// Copyright 2009 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// FreeBSD system calls.
|
// DragonFly BSD system calls.
|
||||||
// This file is compiled as ordinary Go code,
|
// This file is compiled as ordinary Go code,
|
||||||
// but it is also input to mksyscall,
|
// but it is also input to mksyscall,
|
||||||
// which parses the //sys lines and generates system call stubs.
|
// which parses the //sys lines and generates system call stubs.
|
||||||
@@ -34,7 +34,7 @@ func nametomib(name string) (mib []_C_int, err error) {
|
|||||||
|
|
||||||
// NOTE(rsc): It seems strange to set the buffer to have
|
// NOTE(rsc): It seems strange to set the buffer to have
|
||||||
// size CTL_MAXNAME+2 but use only CTL_MAXNAME
|
// size CTL_MAXNAME+2 but use only CTL_MAXNAME
|
||||||
// as the size. I don't know why the +2 is here, but the
|
// as the size. I don't know why the +2 is here, but the
|
||||||
// kernel uses +2 for its own implementation of this function.
|
// kernel uses +2 for its own implementation of this function.
|
||||||
// I am scared that if we don't include the +2 here, the kernel
|
// I am scared that if we don't include the +2 here, the kernel
|
||||||
// will silently write 2 words farther than we specify
|
// will silently write 2 words farther than we specify
|
||||||
@@ -57,7 +57,7 @@ func nametomib(name string) (mib []_C_int, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func direntIno(buf []byte) (uint64, bool) {
|
func direntIno(buf []byte) (uint64, bool) {
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino))
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
|
||||||
}
|
}
|
||||||
|
|
||||||
func direntReclen(buf []byte) (uint64, bool) {
|
func direntReclen(buf []byte) (uint64, bool) {
|
||||||
@@ -65,7 +65,7 @@ func direntReclen(buf []byte) (uint64, bool) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
return 0, false
|
return 0, false
|
||||||
}
|
}
|
||||||
return (16 + namlen + 1 + 7) & ^7, true
|
return (16 + namlen + 1 + 7) &^ 7, true
|
||||||
}
|
}
|
||||||
|
|
||||||
func direntNamlen(buf []byte) (uint64, bool) {
|
func direntNamlen(buf []byte) (uint64, bool) {
|
||||||
@@ -92,6 +92,41 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
|
|||||||
return extpwrite(fd, p, 0, offset)
|
return extpwrite(fd, p, 0, offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {
|
||||||
|
var rsa RawSockaddrAny
|
||||||
|
var len _Socklen = SizeofSockaddrAny
|
||||||
|
nfd, err = accept4(fd, &rsa, &len, flags)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len > SizeofSockaddrAny {
|
||||||
|
panic("RawSockaddrAny too small")
|
||||||
|
}
|
||||||
|
sa, err = anyToSockaddr(&rsa)
|
||||||
|
if err != nil {
|
||||||
|
Close(nfd)
|
||||||
|
nfd = 0
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const ImplementsGetwd = true
|
||||||
|
|
||||||
|
//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD
|
||||||
|
|
||||||
|
func Getwd() (string, error) {
|
||||||
|
var buf [PathMax]byte
|
||||||
|
_, err := Getcwd(buf[0:])
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
n := clen(buf[:])
|
||||||
|
if n < 1 {
|
||||||
|
return "", EINVAL
|
||||||
|
}
|
||||||
|
return string(buf[:n]), nil
|
||||||
|
}
|
||||||
|
|
||||||
func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
var bufsize uintptr
|
var bufsize uintptr
|
||||||
@@ -107,6 +142,113 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setattrlistTimes(path string, times []Timespec, flags int) error {
|
||||||
|
// used on Darwin for UtimesNano
|
||||||
|
return ENOSYS
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||||
|
|
||||||
|
// ioctl itself should not be exposed directly, but additional get/set
|
||||||
|
// functions for specific types are permissible.
|
||||||
|
|
||||||
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
|
// on fd, using the specified request number.
|
||||||
|
func IoctlSetInt(fd int, req uint, value int) error {
|
||||||
|
return ioctl(fd, req, uintptr(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||||
|
// from fd, using the specified request number.
|
||||||
|
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||||
|
var value int
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||||
|
var value Winsize
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||||
|
var value Termios
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func sysctlUname(mib []_C_int, old *byte, oldlen *uintptr) error {
|
||||||
|
err := sysctl(mib, old, oldlen, nil, 0)
|
||||||
|
if err != nil {
|
||||||
|
// Utsname members on Dragonfly are only 32 bytes and
|
||||||
|
// the syscall returns ENOMEM in case the actual value
|
||||||
|
// is longer.
|
||||||
|
if err == ENOMEM {
|
||||||
|
err = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func Uname(uname *Utsname) error {
|
||||||
|
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
|
||||||
|
n := unsafe.Sizeof(uname.Sysname)
|
||||||
|
if err := sysctlUname(mib, &uname.Sysname[0], &n); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
uname.Sysname[unsafe.Sizeof(uname.Sysname)-1] = 0
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
|
||||||
|
n = unsafe.Sizeof(uname.Nodename)
|
||||||
|
if err := sysctlUname(mib, &uname.Nodename[0], &n); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
uname.Nodename[unsafe.Sizeof(uname.Nodename)-1] = 0
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
|
||||||
|
n = unsafe.Sizeof(uname.Release)
|
||||||
|
if err := sysctlUname(mib, &uname.Release[0], &n); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
uname.Release[unsafe.Sizeof(uname.Release)-1] = 0
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_VERSION}
|
||||||
|
n = unsafe.Sizeof(uname.Version)
|
||||||
|
if err := sysctlUname(mib, &uname.Version[0], &n); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// The version might have newlines or tabs in it, convert them to
|
||||||
|
// spaces.
|
||||||
|
for i, b := range uname.Version {
|
||||||
|
if b == '\n' || b == '\t' {
|
||||||
|
if i == len(uname.Version)-1 {
|
||||||
|
uname.Version[i] = 0
|
||||||
|
} else {
|
||||||
|
uname.Version[i] = ' '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_HW, HW_MACHINE}
|
||||||
|
n = unsafe.Sizeof(uname.Machine)
|
||||||
|
if err := sysctlUname(mib, &uname.Machine[0], &n); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
uname.Machine[unsafe.Sizeof(uname.Machine)-1] = 0
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exposed directly
|
* Exposed directly
|
||||||
*/
|
*/
|
||||||
@@ -156,11 +298,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
//sys Mkdir(path string, mode uint32) (err error)
|
//sys Mkdir(path string, mode uint32) (err error)
|
||||||
//sys Mkfifo(path string, mode uint32) (err error)
|
//sys Mkfifo(path string, mode uint32) (err error)
|
||||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||||
//sys Mlock(b []byte) (err error)
|
|
||||||
//sys Mlockall(flags int) (err error)
|
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
|
||||||
//sys Munlock(b []byte) (err error)
|
|
||||||
//sys Munlockall() (err error)
|
|
||||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||||
//sys Pathconf(path string, name int) (val int, err error)
|
//sys Pathconf(path string, name int) (val int, err error)
|
||||||
@@ -199,6 +336,8 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
||||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||||
|
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
||||||
|
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unimplemented
|
* Unimplemented
|
||||||
@@ -210,7 +349,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
// Getlogin
|
// Getlogin
|
||||||
// Sigpending
|
// Sigpending
|
||||||
// Sigaltstack
|
// Sigaltstack
|
||||||
// Ioctl
|
|
||||||
// Reboot
|
// Reboot
|
||||||
// Execve
|
// Execve
|
||||||
// Vfork
|
// Vfork
|
||||||
@@ -233,7 +371,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
// Add_profil
|
// Add_profil
|
||||||
// Kdebug_trace
|
// Kdebug_trace
|
||||||
// Sigreturn
|
// Sigreturn
|
||||||
// Mmap
|
|
||||||
// Atsocket
|
// Atsocket
|
||||||
// Kqueue_from_portset_np
|
// Kqueue_from_portset_np
|
||||||
// Kqueue_portset
|
// Kqueue_portset
|
||||||
@@ -243,7 +380,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
// Searchfs
|
// Searchfs
|
||||||
// Delete
|
// Delete
|
||||||
// Copyfile
|
// Copyfile
|
||||||
// Poll
|
|
||||||
// Watchevent
|
// Watchevent
|
||||||
// Waitevent
|
// Waitevent
|
||||||
// Modwatch
|
// Modwatch
|
||||||
@@ -378,7 +514,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
// Sendmsg_nocancel
|
// Sendmsg_nocancel
|
||||||
// Recvfrom_nocancel
|
// Recvfrom_nocancel
|
||||||
// Accept_nocancel
|
// Accept_nocancel
|
||||||
// Msync_nocancel
|
|
||||||
// Fcntl_nocancel
|
// Fcntl_nocancel
|
||||||
// Select_nocancel
|
// Select_nocancel
|
||||||
// Fsync_nocancel
|
// Fsync_nocancel
|
||||||
@@ -390,7 +525,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
// Pread_nocancel
|
// Pread_nocancel
|
||||||
// Pwrite_nocancel
|
// Pwrite_nocancel
|
||||||
// Waitid_nocancel
|
// Waitid_nocancel
|
||||||
// Poll_nocancel
|
|
||||||
// Msgsnd_nocancel
|
// Msgsnd_nocancel
|
||||||
// Msgrcv_nocancel
|
// Msgrcv_nocancel
|
||||||
// Sem_wait_nocancel
|
// Sem_wait_nocancel
|
||||||
|
|||||||
+4
-13
@@ -11,21 +11,12 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|||||||
+126
-22
@@ -32,7 +32,7 @@ func nametomib(name string) (mib []_C_int, err error) {
|
|||||||
|
|
||||||
// NOTE(rsc): It seems strange to set the buffer to have
|
// NOTE(rsc): It seems strange to set the buffer to have
|
||||||
// size CTL_MAXNAME+2 but use only CTL_MAXNAME
|
// size CTL_MAXNAME+2 but use only CTL_MAXNAME
|
||||||
// as the size. I don't know why the +2 is here, but the
|
// as the size. I don't know why the +2 is here, but the
|
||||||
// kernel uses +2 for its own implementation of this function.
|
// kernel uses +2 for its own implementation of this function.
|
||||||
// I am scared that if we don't include the +2 here, the kernel
|
// I am scared that if we don't include the +2 here, the kernel
|
||||||
// will silently write 2 words farther than we specify
|
// will silently write 2 words farther than we specify
|
||||||
@@ -105,6 +105,23 @@ func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ImplementsGetwd = true
|
||||||
|
|
||||||
|
//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD
|
||||||
|
|
||||||
|
func Getwd() (string, error) {
|
||||||
|
var buf [PathMax]byte
|
||||||
|
_, err := Getcwd(buf[0:])
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
n := clen(buf[:])
|
||||||
|
if n < 1 {
|
||||||
|
return "", EINVAL
|
||||||
|
}
|
||||||
|
return string(buf[:n]), nil
|
||||||
|
}
|
||||||
|
|
||||||
func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
var bufsize uintptr
|
var bufsize uintptr
|
||||||
@@ -120,6 +137,11 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setattrlistTimes(path string, times []Timespec, flags int) error {
|
||||||
|
// used on Darwin for UtimesNano
|
||||||
|
return ENOSYS
|
||||||
|
}
|
||||||
|
|
||||||
// Derive extattr namespace and attribute name
|
// Derive extattr namespace and attribute name
|
||||||
|
|
||||||
func xattrnamespace(fullattr string) (ns int, attr string, err error) {
|
func xattrnamespace(fullattr string) (ns int, attr string, err error) {
|
||||||
@@ -271,7 +293,6 @@ func Listxattr(file string, dest []byte) (sz int, err error) {
|
|||||||
|
|
||||||
// FreeBSD won't allow you to list xattrs from multiple namespaces
|
// FreeBSD won't allow you to list xattrs from multiple namespaces
|
||||||
s := 0
|
s := 0
|
||||||
var e error
|
|
||||||
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
|
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
|
||||||
stmp, e := ExtattrListFile(file, nsid, uintptr(d), destsiz)
|
stmp, e := ExtattrListFile(file, nsid, uintptr(d), destsiz)
|
||||||
|
|
||||||
@@ -283,7 +304,6 @@ func Listxattr(file string, dest []byte) (sz int, err error) {
|
|||||||
* we don't have read permissions on, so don't ignore those errors
|
* we don't have read permissions on, so don't ignore those errors
|
||||||
*/
|
*/
|
||||||
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
||||||
e = nil
|
|
||||||
continue
|
continue
|
||||||
} else if e != nil {
|
} else if e != nil {
|
||||||
return s, e
|
return s, e
|
||||||
@@ -297,7 +317,7 @@ func Listxattr(file string, dest []byte) (sz int, err error) {
|
|||||||
d = initxattrdest(dest, s)
|
d = initxattrdest(dest, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
return s, e
|
return s, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Flistxattr(fd int, dest []byte) (sz int, err error) {
|
func Flistxattr(fd int, dest []byte) (sz int, err error) {
|
||||||
@@ -305,11 +325,9 @@ func Flistxattr(fd int, dest []byte) (sz int, err error) {
|
|||||||
destsiz := len(dest)
|
destsiz := len(dest)
|
||||||
|
|
||||||
s := 0
|
s := 0
|
||||||
var e error
|
|
||||||
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
|
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
|
||||||
stmp, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz)
|
stmp, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz)
|
||||||
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
||||||
e = nil
|
|
||||||
continue
|
continue
|
||||||
} else if e != nil {
|
} else if e != nil {
|
||||||
return s, e
|
return s, e
|
||||||
@@ -323,7 +341,7 @@ func Flistxattr(fd int, dest []byte) (sz int, err error) {
|
|||||||
d = initxattrdest(dest, s)
|
d = initxattrdest(dest, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
return s, e
|
return s, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Llistxattr(link string, dest []byte) (sz int, err error) {
|
func Llistxattr(link string, dest []byte) (sz int, err error) {
|
||||||
@@ -331,11 +349,9 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||||||
destsiz := len(dest)
|
destsiz := len(dest)
|
||||||
|
|
||||||
s := 0
|
s := 0
|
||||||
var e error
|
|
||||||
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
|
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
|
||||||
stmp, e := ExtattrListLink(link, nsid, uintptr(d), destsiz)
|
stmp, e := ExtattrListLink(link, nsid, uintptr(d), destsiz)
|
||||||
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
||||||
e = nil
|
|
||||||
continue
|
continue
|
||||||
} else if e != nil {
|
} else if e != nil {
|
||||||
return s, e
|
return s, e
|
||||||
@@ -349,7 +365,92 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||||||
d = initxattrdest(dest, s)
|
d = initxattrdest(dest, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
return s, e
|
return s, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||||
|
|
||||||
|
// ioctl itself should not be exposed directly, but additional get/set
|
||||||
|
// functions for specific types are permissible.
|
||||||
|
|
||||||
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
|
// on fd, using the specified request number.
|
||||||
|
func IoctlSetInt(fd int, req uint, value int) error {
|
||||||
|
return ioctl(fd, req, uintptr(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||||
|
// from fd, using the specified request number.
|
||||||
|
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||||
|
var value int
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||||
|
var value Winsize
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||||
|
var value Termios
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func Uname(uname *Utsname) error {
|
||||||
|
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
|
||||||
|
n := unsafe.Sizeof(uname.Sysname)
|
||||||
|
if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
|
||||||
|
n = unsafe.Sizeof(uname.Nodename)
|
||||||
|
if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
|
||||||
|
n = unsafe.Sizeof(uname.Release)
|
||||||
|
if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_VERSION}
|
||||||
|
n = unsafe.Sizeof(uname.Version)
|
||||||
|
if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// The version might have newlines or tabs in it, convert them to
|
||||||
|
// spaces.
|
||||||
|
for i, b := range uname.Version {
|
||||||
|
if b == '\n' || b == '\t' {
|
||||||
|
if i == len(uname.Version)-1 {
|
||||||
|
uname.Version[i] = 0
|
||||||
|
} else {
|
||||||
|
uname.Version[i] = ' '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_HW, HW_MACHINE}
|
||||||
|
n = unsafe.Sizeof(uname.Machine)
|
||||||
|
if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -357,6 +458,9 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||||||
*/
|
*/
|
||||||
//sys Access(path string, mode uint32) (err error)
|
//sys Access(path string, mode uint32) (err error)
|
||||||
//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
|
//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
|
||||||
|
//sys CapEnter() (err error)
|
||||||
|
//sys capRightsGet(version int, fd int, rightsp *CapRights) (err error) = SYS___CAP_RIGHTS_GET
|
||||||
|
//sys capRightsLimit(fd int, rightsp *CapRights) (err error)
|
||||||
//sys Chdir(path string) (err error)
|
//sys Chdir(path string) (err error)
|
||||||
//sys Chflags(path string, flags int) (err error)
|
//sys Chflags(path string, flags int) (err error)
|
||||||
//sys Chmod(path string, mode uint32) (err error)
|
//sys Chmod(path string, mode uint32) (err error)
|
||||||
@@ -379,16 +483,20 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||||||
//sys ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error)
|
//sys ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error)
|
||||||
//sys ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
|
//sys ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
|
||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE
|
||||||
|
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
//sys Fchdir(fd int) (err error)
|
//sys Fchdir(fd int) (err error)
|
||||||
//sys Fchflags(fd int, flags int) (err error)
|
//sys Fchflags(fd int, flags int) (err error)
|
||||||
//sys Fchmod(fd int, mode uint32) (err error)
|
//sys Fchmod(fd int, mode uint32) (err error)
|
||||||
|
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
|
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
|
||||||
//sys Flock(fd int, how int) (err error)
|
//sys Flock(fd int, how int) (err error)
|
||||||
//sys Fpathconf(fd int, name int) (val int, err error)
|
//sys Fpathconf(fd int, name int) (val int, err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
|
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
|
||||||
//sys Fsync(fd int) (err error)
|
//sys Fsync(fd int) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
|
//sys Getdents(fd int, buf []byte) (n int, err error)
|
||||||
//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)
|
//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)
|
||||||
//sys Getdtablesize() (size int)
|
//sys Getdtablesize() (size int)
|
||||||
//sysnb Getegid() (egid int)
|
//sysnb Getegid() (egid int)
|
||||||
@@ -409,24 +517,24 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||||||
//sys Kqueue() (fd int, err error)
|
//sys Kqueue() (fd int, err error)
|
||||||
//sys Lchown(path string, uid int, gid int) (err error)
|
//sys Lchown(path string, uid int, gid int) (err error)
|
||||||
//sys Link(path string, link string) (err error)
|
//sys Link(path string, link string) (err error)
|
||||||
|
//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
|
||||||
//sys Listen(s int, backlog int) (err error)
|
//sys Listen(s int, backlog int) (err error)
|
||||||
//sys Lstat(path string, stat *Stat_t) (err error)
|
//sys Lstat(path string, stat *Stat_t) (err error)
|
||||||
//sys Mkdir(path string, mode uint32) (err error)
|
//sys Mkdir(path string, mode uint32) (err error)
|
||||||
|
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
|
||||||
//sys Mkfifo(path string, mode uint32) (err error)
|
//sys Mkfifo(path string, mode uint32) (err error)
|
||||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||||
//sys Mlock(b []byte) (err error)
|
|
||||||
//sys Mlockall(flags int) (err error)
|
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
|
||||||
//sys Munlock(b []byte) (err error)
|
|
||||||
//sys Munlockall() (err error)
|
|
||||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||||
|
//sys Openat(fdat int, path string, mode int, perm uint32) (fd int, err error)
|
||||||
//sys Pathconf(path string, name int) (val int, err error)
|
//sys Pathconf(path string, name int) (val int, err error)
|
||||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error)
|
//sys Pread(fd int, p []byte, offset int64) (n int, err error)
|
||||||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
|
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
|
||||||
//sys read(fd int, p []byte) (n int, err error)
|
//sys read(fd int, p []byte) (n int, err error)
|
||||||
//sys Readlink(path string, buf []byte) (n int, err error)
|
//sys Readlink(path string, buf []byte) (n int, err error)
|
||||||
|
//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
|
||||||
//sys Rename(from string, to string) (err error)
|
//sys Rename(from string, to string) (err error)
|
||||||
|
//sys Renameat(fromfd int, from string, tofd int, to string) (err error)
|
||||||
//sys Revoke(path string) (err error)
|
//sys Revoke(path string) (err error)
|
||||||
//sys Rmdir(path string) (err error)
|
//sys Rmdir(path string) (err error)
|
||||||
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
|
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
|
||||||
@@ -448,11 +556,13 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||||||
//sys Stat(path string, stat *Stat_t) (err error)
|
//sys Stat(path string, stat *Stat_t) (err error)
|
||||||
//sys Statfs(path string, stat *Statfs_t) (err error)
|
//sys Statfs(path string, stat *Statfs_t) (err error)
|
||||||
//sys Symlink(path string, link string) (err error)
|
//sys Symlink(path string, link string) (err error)
|
||||||
|
//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
|
||||||
//sys Sync() (err error)
|
//sys Sync() (err error)
|
||||||
//sys Truncate(path string, length int64) (err error)
|
//sys Truncate(path string, length int64) (err error)
|
||||||
//sys Umask(newmask int) (oldmask int)
|
//sys Umask(newmask int) (oldmask int)
|
||||||
//sys Undelete(path string) (err error)
|
//sys Undelete(path string) (err error)
|
||||||
//sys Unlink(path string) (err error)
|
//sys Unlink(path string) (err error)
|
||||||
|
//sys Unlinkat(dirfd int, path string, flags int) (err error)
|
||||||
//sys Unmount(path string, flags int) (err error)
|
//sys Unmount(path string, flags int) (err error)
|
||||||
//sys write(fd int, p []byte) (n int, err error)
|
//sys write(fd int, p []byte) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
||||||
@@ -460,6 +570,7 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||||||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
||||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||||
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
||||||
|
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unimplemented
|
* Unimplemented
|
||||||
@@ -493,9 +604,6 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||||||
// Add_profil
|
// Add_profil
|
||||||
// Kdebug_trace
|
// Kdebug_trace
|
||||||
// Sigreturn
|
// Sigreturn
|
||||||
// Mmap
|
|
||||||
// Mlock
|
|
||||||
// Munlock
|
|
||||||
// Atsocket
|
// Atsocket
|
||||||
// Kqueue_from_portset_np
|
// Kqueue_from_portset_np
|
||||||
// Kqueue_portset
|
// Kqueue_portset
|
||||||
@@ -505,7 +613,6 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||||||
// Searchfs
|
// Searchfs
|
||||||
// Delete
|
// Delete
|
||||||
// Copyfile
|
// Copyfile
|
||||||
// Poll
|
|
||||||
// Watchevent
|
// Watchevent
|
||||||
// Waitevent
|
// Waitevent
|
||||||
// Modwatch
|
// Modwatch
|
||||||
@@ -588,8 +695,6 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||||||
// Lio_listio
|
// Lio_listio
|
||||||
// __pthread_cond_wait
|
// __pthread_cond_wait
|
||||||
// Iopolicysys
|
// Iopolicysys
|
||||||
// Mlockall
|
|
||||||
// Munlockall
|
|
||||||
// __pthread_kill
|
// __pthread_kill
|
||||||
// __pthread_sigmask
|
// __pthread_sigmask
|
||||||
// __sigwait
|
// __sigwait
|
||||||
@@ -642,7 +747,6 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||||||
// Sendmsg_nocancel
|
// Sendmsg_nocancel
|
||||||
// Recvfrom_nocancel
|
// Recvfrom_nocancel
|
||||||
// Accept_nocancel
|
// Accept_nocancel
|
||||||
// Msync_nocancel
|
|
||||||
// Fcntl_nocancel
|
// Fcntl_nocancel
|
||||||
// Select_nocancel
|
// Select_nocancel
|
||||||
// Fsync_nocancel
|
// Fsync_nocancel
|
||||||
|
|||||||
+4
-13
@@ -11,21 +11,12 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int32(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int32(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|||||||
+4
-13
@@ -11,21 +11,12 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|||||||
+4
-13
@@ -11,21 +11,12 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return ts.Sec*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|||||||
+220
-26
@@ -36,6 +36,59 @@ func Creat(path string, mode uint32) (fd int, err error) {
|
|||||||
return Open(path, O_CREAT|O_WRONLY|O_TRUNC, mode)
|
return Open(path, O_CREAT|O_WRONLY|O_TRUNC, mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sys fchmodat(dirfd int, path string, mode uint32) (err error)
|
||||||
|
|
||||||
|
func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||||
|
// Linux fchmodat doesn't support the flags parameter. Mimick glibc's behavior
|
||||||
|
// and check the flags. Otherwise the mode would be applied to the symlink
|
||||||
|
// destination which is not what the user expects.
|
||||||
|
if flags&^AT_SYMLINK_NOFOLLOW != 0 {
|
||||||
|
return EINVAL
|
||||||
|
} else if flags&AT_SYMLINK_NOFOLLOW != 0 {
|
||||||
|
return EOPNOTSUPP
|
||||||
|
}
|
||||||
|
return fchmodat(dirfd, path, mode)
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||||
|
|
||||||
|
// ioctl itself should not be exposed directly, but additional get/set
|
||||||
|
// functions for specific types are permissible.
|
||||||
|
|
||||||
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
|
// on fd, using the specified request number.
|
||||||
|
func IoctlSetInt(fd int, req uint, value int) error {
|
||||||
|
return ioctl(fd, req, uintptr(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||||
|
// from fd, using the specified request number.
|
||||||
|
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||||
|
var value int
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||||
|
var value Winsize
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||||
|
var value Termios
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
//sys Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error)
|
//sys Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error)
|
||||||
|
|
||||||
func Link(oldpath string, newpath string) (err error) {
|
func Link(oldpath string, newpath string) (err error) {
|
||||||
@@ -202,7 +255,7 @@ func Getgroups() (gids []int, err error) {
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sanity check group count. Max is 1<<16 on Linux.
|
// Sanity check group count. Max is 1<<16 on Linux.
|
||||||
if n < 0 || n > 1<<20 {
|
if n < 0 || n > 1<<20 {
|
||||||
return nil, EINVAL
|
return nil, EINVAL
|
||||||
}
|
}
|
||||||
@@ -237,8 +290,8 @@ type WaitStatus uint32
|
|||||||
// 0x7F (stopped), or a signal number that caused an exit.
|
// 0x7F (stopped), or a signal number that caused an exit.
|
||||||
// The 0x80 bit is whether there was a core dump.
|
// The 0x80 bit is whether there was a core dump.
|
||||||
// An extra number (exit code, signal causing a stop)
|
// An extra number (exit code, signal causing a stop)
|
||||||
// is in the high bits. At least that's the idea.
|
// is in the high bits. At least that's the idea.
|
||||||
// There are various irregularities. For example, the
|
// There are various irregularities. For example, the
|
||||||
// "continued" status is 0xFFFF, distinguishing itself
|
// "continued" status is 0xFFFF, distinguishing itself
|
||||||
// from stopped via the core dump bit.
|
// from stopped via the core dump bit.
|
||||||
|
|
||||||
@@ -299,10 +352,14 @@ func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int,
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func Mkfifo(path string, mode uint32) (err error) {
|
func Mkfifo(path string, mode uint32) error {
|
||||||
return Mknod(path, mode|S_IFIFO, 0)
|
return Mknod(path, mode|S_IFIFO, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Mkfifoat(dirfd int, path string, mode uint32) error {
|
||||||
|
return Mknodat(dirfd, path, mode|S_IFIFO, 0)
|
||||||
|
}
|
||||||
|
|
||||||
func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||||
if sa.Port < 0 || sa.Port > 0xFFFF {
|
if sa.Port < 0 || sa.Port > 0xFFFF {
|
||||||
return nil, 0, EINVAL
|
return nil, 0, EINVAL
|
||||||
@@ -751,10 +808,135 @@ func GetsockoptTCPInfo(fd, level, opt int) (*TCPInfo, error) {
|
|||||||
return &value, err
|
return &value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetsockoptString returns the string value of the socket option opt for the
|
||||||
|
// socket associated with fd at the given socket level.
|
||||||
|
func GetsockoptString(fd, level, opt int) (string, error) {
|
||||||
|
buf := make([]byte, 256)
|
||||||
|
vallen := _Socklen(len(buf))
|
||||||
|
err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen)
|
||||||
|
if err != nil {
|
||||||
|
if err == ERANGE {
|
||||||
|
buf = make([]byte, vallen)
|
||||||
|
err = getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen)
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return string(buf[:vallen-1]), nil
|
||||||
|
}
|
||||||
|
|
||||||
func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
|
func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
|
||||||
return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
|
return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Keyctl Commands (http://man7.org/linux/man-pages/man2/keyctl.2.html)
|
||||||
|
|
||||||
|
// KeyctlInt calls keyctl commands in which each argument is an int.
|
||||||
|
// These commands are KEYCTL_REVOKE, KEYCTL_CHOWN, KEYCTL_CLEAR, KEYCTL_LINK,
|
||||||
|
// KEYCTL_UNLINK, KEYCTL_NEGATE, KEYCTL_SET_REQKEY_KEYRING, KEYCTL_SET_TIMEOUT,
|
||||||
|
// KEYCTL_ASSUME_AUTHORITY, KEYCTL_SESSION_TO_PARENT, KEYCTL_REJECT,
|
||||||
|
// KEYCTL_INVALIDATE, and KEYCTL_GET_PERSISTENT.
|
||||||
|
//sys KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) = SYS_KEYCTL
|
||||||
|
|
||||||
|
// KeyctlBuffer calls keyctl commands in which the third and fourth
|
||||||
|
// arguments are a buffer and its length, respectively.
|
||||||
|
// These commands are KEYCTL_UPDATE, KEYCTL_READ, and KEYCTL_INSTANTIATE.
|
||||||
|
//sys KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) = SYS_KEYCTL
|
||||||
|
|
||||||
|
// KeyctlString calls keyctl commands which return a string.
|
||||||
|
// These commands are KEYCTL_DESCRIBE and KEYCTL_GET_SECURITY.
|
||||||
|
func KeyctlString(cmd int, id int) (string, error) {
|
||||||
|
// We must loop as the string data may change in between the syscalls.
|
||||||
|
// We could allocate a large buffer here to reduce the chance that the
|
||||||
|
// syscall needs to be called twice; however, this is unnecessary as
|
||||||
|
// the performance loss is negligible.
|
||||||
|
var buffer []byte
|
||||||
|
for {
|
||||||
|
// Try to fill the buffer with data
|
||||||
|
length, err := KeyctlBuffer(cmd, id, buffer, 0)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if the data was written
|
||||||
|
if length <= len(buffer) {
|
||||||
|
// Exclude the null terminator
|
||||||
|
return string(buffer[:length-1]), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make a bigger buffer if needed
|
||||||
|
buffer = make([]byte, length)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Keyctl commands with special signatures.
|
||||||
|
|
||||||
|
// KeyctlGetKeyringID implements the KEYCTL_GET_KEYRING_ID command.
|
||||||
|
// See the full documentation at:
|
||||||
|
// http://man7.org/linux/man-pages/man3/keyctl_get_keyring_ID.3.html
|
||||||
|
func KeyctlGetKeyringID(id int, create bool) (ringid int, err error) {
|
||||||
|
createInt := 0
|
||||||
|
if create {
|
||||||
|
createInt = 1
|
||||||
|
}
|
||||||
|
return KeyctlInt(KEYCTL_GET_KEYRING_ID, id, createInt, 0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
// KeyctlSetperm implements the KEYCTL_SETPERM command. The perm value is the
|
||||||
|
// key handle permission mask as described in the "keyctl setperm" section of
|
||||||
|
// http://man7.org/linux/man-pages/man1/keyctl.1.html.
|
||||||
|
// See the full documentation at:
|
||||||
|
// http://man7.org/linux/man-pages/man3/keyctl_setperm.3.html
|
||||||
|
func KeyctlSetperm(id int, perm uint32) error {
|
||||||
|
_, err := KeyctlInt(KEYCTL_SETPERM, id, int(perm), 0, 0)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys keyctlJoin(cmd int, arg2 string) (ret int, err error) = SYS_KEYCTL
|
||||||
|
|
||||||
|
// KeyctlJoinSessionKeyring implements the KEYCTL_JOIN_SESSION_KEYRING command.
|
||||||
|
// See the full documentation at:
|
||||||
|
// http://man7.org/linux/man-pages/man3/keyctl_join_session_keyring.3.html
|
||||||
|
func KeyctlJoinSessionKeyring(name string) (ringid int, err error) {
|
||||||
|
return keyctlJoin(KEYCTL_JOIN_SESSION_KEYRING, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) = SYS_KEYCTL
|
||||||
|
|
||||||
|
// KeyctlSearch implements the KEYCTL_SEARCH command.
|
||||||
|
// See the full documentation at:
|
||||||
|
// http://man7.org/linux/man-pages/man3/keyctl_search.3.html
|
||||||
|
func KeyctlSearch(ringid int, keyType, description string, destRingid int) (id int, err error) {
|
||||||
|
return keyctlSearch(KEYCTL_SEARCH, ringid, keyType, description, destRingid)
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) = SYS_KEYCTL
|
||||||
|
|
||||||
|
// KeyctlInstantiateIOV implements the KEYCTL_INSTANTIATE_IOV command. This
|
||||||
|
// command is similar to KEYCTL_INSTANTIATE, except that the payload is a slice
|
||||||
|
// of Iovec (each of which represents a buffer) instead of a single buffer.
|
||||||
|
// See the full documentation at:
|
||||||
|
// http://man7.org/linux/man-pages/man3/keyctl_instantiate_iov.3.html
|
||||||
|
func KeyctlInstantiateIOV(id int, payload []Iovec, ringid int) error {
|
||||||
|
return keyctlIOV(KEYCTL_INSTANTIATE_IOV, id, payload, ringid)
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) = SYS_KEYCTL
|
||||||
|
|
||||||
|
// KeyctlDHCompute implements the KEYCTL_DH_COMPUTE command. This command
|
||||||
|
// computes a Diffie-Hellman shared secret based on the provide params. The
|
||||||
|
// secret is written to the provided buffer and the returned size is the number
|
||||||
|
// of bytes written (returning an error if there is insufficient space in the
|
||||||
|
// buffer). If a nil buffer is passed in, this function returns the minimum
|
||||||
|
// buffer length needed to store the appropriate data. Note that this differs
|
||||||
|
// from KEYCTL_READ's behavior which always returns the requested payload size.
|
||||||
|
// See the full documentation at:
|
||||||
|
// http://man7.org/linux/man-pages/man3/keyctl_dh_compute.3.html
|
||||||
|
func KeyctlDHCompute(params *KeyctlDHParams, buffer []byte) (size int, err error) {
|
||||||
|
return keyctlDH(KEYCTL_DH_COMPUTE, params, buffer)
|
||||||
|
}
|
||||||
|
|
||||||
func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
|
func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
|
||||||
var msg Msghdr
|
var msg Msghdr
|
||||||
var rsa RawSockaddrAny
|
var rsa RawSockaddrAny
|
||||||
@@ -762,17 +944,22 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from
|
|||||||
msg.Namelen = uint32(SizeofSockaddrAny)
|
msg.Namelen = uint32(SizeofSockaddrAny)
|
||||||
var iov Iovec
|
var iov Iovec
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
iov.Base = (*byte)(unsafe.Pointer(&p[0]))
|
iov.Base = &p[0]
|
||||||
iov.SetLen(len(p))
|
iov.SetLen(len(p))
|
||||||
}
|
}
|
||||||
var dummy byte
|
var dummy byte
|
||||||
if len(oob) > 0 {
|
if len(oob) > 0 {
|
||||||
|
var sockType int
|
||||||
|
sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
// receive at least one normal byte
|
// receive at least one normal byte
|
||||||
if len(p) == 0 {
|
if sockType != SOCK_DGRAM && len(p) == 0 {
|
||||||
iov.Base = &dummy
|
iov.Base = &dummy
|
||||||
iov.SetLen(1)
|
iov.SetLen(1)
|
||||||
}
|
}
|
||||||
msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
|
msg.Control = &oob[0]
|
||||||
msg.SetControllen(len(oob))
|
msg.SetControllen(len(oob))
|
||||||
}
|
}
|
||||||
msg.Iov = &iov
|
msg.Iov = &iov
|
||||||
@@ -805,21 +992,26 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var msg Msghdr
|
var msg Msghdr
|
||||||
msg.Name = (*byte)(unsafe.Pointer(ptr))
|
msg.Name = (*byte)(ptr)
|
||||||
msg.Namelen = uint32(salen)
|
msg.Namelen = uint32(salen)
|
||||||
var iov Iovec
|
var iov Iovec
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
iov.Base = (*byte)(unsafe.Pointer(&p[0]))
|
iov.Base = &p[0]
|
||||||
iov.SetLen(len(p))
|
iov.SetLen(len(p))
|
||||||
}
|
}
|
||||||
var dummy byte
|
var dummy byte
|
||||||
if len(oob) > 0 {
|
if len(oob) > 0 {
|
||||||
|
var sockType int
|
||||||
|
sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
// send at least one normal byte
|
// send at least one normal byte
|
||||||
if len(p) == 0 {
|
if sockType != SOCK_DGRAM && len(p) == 0 {
|
||||||
iov.Base = &dummy
|
iov.Base = &dummy
|
||||||
iov.SetLen(1)
|
iov.SetLen(1)
|
||||||
}
|
}
|
||||||
msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
|
msg.Control = &oob[0]
|
||||||
msg.SetControllen(len(oob))
|
msg.SetControllen(len(oob))
|
||||||
}
|
}
|
||||||
msg.Iov = &iov
|
msg.Iov = &iov
|
||||||
@@ -849,7 +1041,7 @@ func ptracePeek(req int, pid int, addr uintptr, out []byte) (count int, err erro
|
|||||||
|
|
||||||
var buf [sizeofPtr]byte
|
var buf [sizeofPtr]byte
|
||||||
|
|
||||||
// Leading edge. PEEKTEXT/PEEKDATA don't require aligned
|
// Leading edge. PEEKTEXT/PEEKDATA don't require aligned
|
||||||
// access (PEEKUSER warns that it might), but if we don't
|
// access (PEEKUSER warns that it might), but if we don't
|
||||||
// align our reads, we might straddle an unmapped page
|
// align our reads, we might straddle an unmapped page
|
||||||
// boundary and not get the bytes leading up to the page
|
// boundary and not get the bytes leading up to the page
|
||||||
@@ -951,6 +1143,10 @@ func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error) {
|
|||||||
return ptracePoke(PTRACE_POKEDATA, PTRACE_PEEKDATA, pid, addr, data)
|
return ptracePoke(PTRACE_POKEDATA, PTRACE_PEEKDATA, pid, addr, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func PtracePokeUser(pid int, addr uintptr, data []byte) (count int, err error) {
|
||||||
|
return ptracePoke(PTRACE_POKEUSR, PTRACE_PEEKUSR, pid, addr, data)
|
||||||
|
}
|
||||||
|
|
||||||
func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
|
func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
|
||||||
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||||
}
|
}
|
||||||
@@ -1033,22 +1229,24 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri
|
|||||||
* Direct access
|
* Direct access
|
||||||
*/
|
*/
|
||||||
//sys Acct(path string) (err error)
|
//sys Acct(path string) (err error)
|
||||||
|
//sys AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error)
|
||||||
//sys Adjtimex(buf *Timex) (state int, err error)
|
//sys Adjtimex(buf *Timex) (state int, err error)
|
||||||
//sys Chdir(path string) (err error)
|
//sys Chdir(path string) (err error)
|
||||||
//sys Chroot(path string) (err error)
|
//sys Chroot(path string) (err error)
|
||||||
//sys ClockGettime(clockid int32, time *Timespec) (err error)
|
//sys ClockGettime(clockid int32, time *Timespec) (err error)
|
||||||
//sys Close(fd int) (err error)
|
//sys Close(fd int) (err error)
|
||||||
|
//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
|
||||||
//sys Dup(oldfd int) (fd int, err error)
|
//sys Dup(oldfd int) (fd int, err error)
|
||||||
//sys Dup3(oldfd int, newfd int, flags int) (err error)
|
//sys Dup3(oldfd int, newfd int, flags int) (err error)
|
||||||
//sysnb EpollCreate(size int) (fd int, err error)
|
//sysnb EpollCreate(size int) (fd int, err error)
|
||||||
//sysnb EpollCreate1(flag int) (fd int, err error)
|
//sysnb EpollCreate1(flag int) (fd int, err error)
|
||||||
//sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)
|
//sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)
|
||||||
|
//sys Eventfd(initval uint, flags int) (fd int, err error) = SYS_EVENTFD2
|
||||||
//sys Exit(code int) = SYS_EXIT_GROUP
|
//sys Exit(code int) = SYS_EXIT_GROUP
|
||||||
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
|
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
//sys Fallocate(fd int, mode uint32, off int64, len int64) (err error)
|
//sys Fallocate(fd int, mode uint32, off int64, len int64) (err error)
|
||||||
//sys Fchdir(fd int) (err error)
|
//sys Fchdir(fd int) (err error)
|
||||||
//sys Fchmod(fd int, mode uint32) (err error)
|
//sys Fchmod(fd int, mode uint32) (err error)
|
||||||
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
|
||||||
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
|
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
|
||||||
//sys fcntl(fd int, cmd int, arg int) (val int, err error)
|
//sys fcntl(fd int, cmd int, arg int) (val int, err error)
|
||||||
//sys Fdatasync(fd int) (err error)
|
//sys Fdatasync(fd int) (err error)
|
||||||
@@ -1075,16 +1273,22 @@ func Getpgrp() (pid int) {
|
|||||||
//sysnb InotifyRmWatch(fd int, watchdesc uint32) (success int, err error)
|
//sysnb InotifyRmWatch(fd int, watchdesc uint32) (success int, err error)
|
||||||
//sysnb Kill(pid int, sig syscall.Signal) (err error)
|
//sysnb Kill(pid int, sig syscall.Signal) (err error)
|
||||||
//sys Klogctl(typ int, buf []byte) (n int, err error) = SYS_SYSLOG
|
//sys Klogctl(typ int, buf []byte) (n int, err error) = SYS_SYSLOG
|
||||||
|
//sys Lgetxattr(path string, attr string, dest []byte) (sz int, err error)
|
||||||
//sys Listxattr(path string, dest []byte) (sz int, err error)
|
//sys Listxattr(path string, dest []byte) (sz int, err error)
|
||||||
|
//sys Llistxattr(path string, dest []byte) (sz int, err error)
|
||||||
|
//sys Lremovexattr(path string, attr string) (err error)
|
||||||
|
//sys Lsetxattr(path string, attr string, data []byte, flags int) (err error)
|
||||||
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
|
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
|
||||||
//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
|
//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
|
||||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||||
//sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT
|
//sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT
|
||||||
//sysnb prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64
|
//sysnb prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64
|
||||||
//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)
|
//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)
|
||||||
|
//sys Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) = SYS_PSELECT6
|
||||||
//sys read(fd int, p []byte) (n int, err error)
|
//sys read(fd int, p []byte) (n int, err error)
|
||||||
//sys Removexattr(path string, attr string) (err error)
|
//sys Removexattr(path string, attr string) (err error)
|
||||||
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
|
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
|
||||||
|
//sys RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error)
|
||||||
//sys Setdomainname(p []byte) (err error)
|
//sys Setdomainname(p []byte) (err error)
|
||||||
//sys Sethostname(p []byte) (err error)
|
//sys Sethostname(p []byte) (err error)
|
||||||
//sysnb Setpgid(pid int, pgid int) (err error)
|
//sysnb Setpgid(pid int, pgid int) (err error)
|
||||||
@@ -1108,6 +1312,7 @@ func Setgid(uid int) (err error) {
|
|||||||
//sys Setpriority(which int, who int, prio int) (err error)
|
//sys Setpriority(which int, who int, prio int) (err error)
|
||||||
//sys Setxattr(path string, attr string, data []byte, flags int) (err error)
|
//sys Setxattr(path string, attr string, data []byte, flags int) (err error)
|
||||||
//sys Sync()
|
//sys Sync()
|
||||||
|
//sys Syncfs(fd int) (err error)
|
||||||
//sysnb Sysinfo(info *Sysinfo_t) (err error)
|
//sysnb Sysinfo(info *Sysinfo_t) (err error)
|
||||||
//sys Tee(rfd int, wfd int, len int, flags int) (n int64, err error)
|
//sys Tee(rfd int, wfd int, len int, flags int) (n int64, err error)
|
||||||
//sysnb Tgkill(tgid int, tid int, sig syscall.Signal) (err error)
|
//sysnb Tgkill(tgid int, tid int, sig syscall.Signal) (err error)
|
||||||
@@ -1142,8 +1347,9 @@ func Munmap(b []byte) (err error) {
|
|||||||
//sys Madvise(b []byte, advice int) (err error)
|
//sys Madvise(b []byte, advice int) (err error)
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
//sys Mprotect(b []byte, prot int) (err error)
|
||||||
//sys Mlock(b []byte) (err error)
|
//sys Mlock(b []byte) (err error)
|
||||||
//sys Munlock(b []byte) (err error)
|
|
||||||
//sys Mlockall(flags int) (err error)
|
//sys Mlockall(flags int) (err error)
|
||||||
|
//sys Msync(b []byte, flags int) (err error)
|
||||||
|
//sys Munlock(b []byte) (err error)
|
||||||
//sys Munlockall() (err error)
|
//sys Munlockall() (err error)
|
||||||
|
|
||||||
// Vmsplice splices user pages from a slice of Iovecs into a pipe specified by fd,
|
// Vmsplice splices user pages from a slice of Iovecs into a pipe specified by fd,
|
||||||
@@ -1168,7 +1374,6 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
|||||||
/*
|
/*
|
||||||
* Unimplemented
|
* Unimplemented
|
||||||
*/
|
*/
|
||||||
// AddKey
|
|
||||||
// AfsSyscall
|
// AfsSyscall
|
||||||
// Alarm
|
// Alarm
|
||||||
// ArchPrctl
|
// ArchPrctl
|
||||||
@@ -1184,7 +1389,6 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
|||||||
// EpollCtlOld
|
// EpollCtlOld
|
||||||
// EpollPwait
|
// EpollPwait
|
||||||
// EpollWaitOld
|
// EpollWaitOld
|
||||||
// Eventfd
|
|
||||||
// Execve
|
// Execve
|
||||||
// Fgetxattr
|
// Fgetxattr
|
||||||
// Flistxattr
|
// Flistxattr
|
||||||
@@ -1203,23 +1407,16 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
|||||||
// IoGetevents
|
// IoGetevents
|
||||||
// IoSetup
|
// IoSetup
|
||||||
// IoSubmit
|
// IoSubmit
|
||||||
// Ioctl
|
|
||||||
// IoprioGet
|
// IoprioGet
|
||||||
// IoprioSet
|
// IoprioSet
|
||||||
// KexecLoad
|
// KexecLoad
|
||||||
// Keyctl
|
|
||||||
// Lgetxattr
|
|
||||||
// Llistxattr
|
|
||||||
// LookupDcookie
|
// LookupDcookie
|
||||||
// Lremovexattr
|
|
||||||
// Lsetxattr
|
|
||||||
// Mbind
|
// Mbind
|
||||||
// MigratePages
|
// MigratePages
|
||||||
// Mincore
|
// Mincore
|
||||||
// ModifyLdt
|
// ModifyLdt
|
||||||
// Mount
|
// Mount
|
||||||
// MovePages
|
// MovePages
|
||||||
// Mprotect
|
|
||||||
// MqGetsetattr
|
// MqGetsetattr
|
||||||
// MqNotify
|
// MqNotify
|
||||||
// MqOpen
|
// MqOpen
|
||||||
@@ -1231,8 +1428,6 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
|||||||
// Msgget
|
// Msgget
|
||||||
// Msgrcv
|
// Msgrcv
|
||||||
// Msgsnd
|
// Msgsnd
|
||||||
// Msync
|
|
||||||
// Newfstatat
|
|
||||||
// Nfsservctl
|
// Nfsservctl
|
||||||
// Personality
|
// Personality
|
||||||
// Pselect6
|
// Pselect6
|
||||||
@@ -1243,7 +1438,6 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
|||||||
// Readahead
|
// Readahead
|
||||||
// Readv
|
// Readv
|
||||||
// RemapFilePages
|
// RemapFilePages
|
||||||
// RequestKey
|
|
||||||
// RestartSyscall
|
// RestartSyscall
|
||||||
// RtSigaction
|
// RtSigaction
|
||||||
// RtSigpending
|
// RtSigpending
|
||||||
|
|||||||
+7
-15
@@ -14,21 +14,12 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int32(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||||
tv.Sec = int32(nsec / 1e9)
|
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb pipe(p *[2]_C_int) (err error)
|
//sysnb pipe(p *[2]_C_int) (err error)
|
||||||
@@ -63,6 +54,7 @@ func Pipe2(p []int, flags int) (err error) {
|
|||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
|
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
||||||
//sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64
|
//sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64
|
||||||
//sysnb Getegid() (egid int) = SYS_GETEGID32
|
//sysnb Getegid() (egid int) = SYS_GETEGID32
|
||||||
//sysnb Geteuid() (euid int) = SYS_GETEUID32
|
//sysnb Geteuid() (euid int) = SYS_GETEUID32
|
||||||
@@ -185,9 +177,9 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
|||||||
|
|
||||||
// On x86 Linux, all the socket calls go through an extra indirection,
|
// On x86 Linux, all the socket calls go through an extra indirection,
|
||||||
// I think because the 5-register system call interface can't handle
|
// I think because the 5-register system call interface can't handle
|
||||||
// the 6-argument calls like sendto and recvfrom. Instead the
|
// the 6-argument calls like sendto and recvfrom. Instead the
|
||||||
// arguments to the underlying system call are the number below
|
// arguments to the underlying system call are the number below
|
||||||
// and a pointer to an array of uintptr. We hide the pointer in the
|
// and a pointer to an array of uintptr. We hide the pointer in the
|
||||||
// socketcall assembly to avoid allocation on every system call.
|
// socketcall assembly to avoid allocation on every system call.
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
+5
-13
@@ -11,6 +11,7 @@ package unix
|
|||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT
|
||||||
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
//sysnb Getegid() (egid int)
|
//sysnb Getegid() (egid int)
|
||||||
@@ -69,8 +70,6 @@ func Gettimeofday(tv *Timeval) (err error) {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
|
||||||
|
|
||||||
func Time(t *Time_t) (tt Time_t, err error) {
|
func Time(t *Time_t) (tt Time_t, err error) {
|
||||||
var tv Timeval
|
var tv Timeval
|
||||||
errno := gettimeofday(&tv)
|
errno := gettimeofday(&tv)
|
||||||
@@ -85,19 +84,12 @@ func Time(t *Time_t) (tt Time_t, err error) {
|
|||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb pipe(p *[2]_C_int) (err error)
|
//sysnb pipe(p *[2]_C_int) (err error)
|
||||||
|
|||||||
+5
-13
@@ -11,21 +11,12 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int32(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||||
tv.Sec = int32(nsec / 1e9)
|
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Pipe(p []int) (err error) {
|
func Pipe(p []int) (err error) {
|
||||||
@@ -86,6 +77,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
|||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
|
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
||||||
//sysnb Getegid() (egid int) = SYS_GETEGID32
|
//sysnb Getegid() (egid int) = SYS_GETEGID32
|
||||||
//sysnb Geteuid() (euid int) = SYS_GETEUID32
|
//sysnb Geteuid() (euid int) = SYS_GETEUID32
|
||||||
//sysnb Getgid() (gid int) = SYS_GETGID32
|
//sysnb Getgid() (gid int) = SYS_GETGID32
|
||||||
|
|||||||
+10
-14
@@ -21,7 +21,12 @@ package unix
|
|||||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
||||||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
||||||
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
||||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS_PSELECT6
|
|
||||||
|
func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
|
||||||
|
ts := Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
|
||||||
|
return Pselect(nfd, r, w, e, &ts, nil)
|
||||||
|
}
|
||||||
|
|
||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||||
//sys Setfsgid(gid int) (err error)
|
//sys Setfsgid(gid int) (err error)
|
||||||
//sys Setfsuid(uid int) (err error)
|
//sys Setfsuid(uid int) (err error)
|
||||||
@@ -66,23 +71,14 @@ func Lstat(path string, stat *Stat_t) (err error) {
|
|||||||
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
||||||
|
|
||||||
func Getpagesize() int { return 65536 }
|
|
||||||
|
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Time(t *Time_t) (Time_t, error) {
|
func Time(t *Time_t) (Time_t, error) {
|
||||||
|
|||||||
+14
-16
@@ -7,8 +7,10 @@
|
|||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT
|
||||||
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
//sysnb Getegid() (egid int)
|
//sysnb Getegid() (egid int)
|
||||||
@@ -22,7 +24,12 @@ package unix
|
|||||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
||||||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
||||||
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
||||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS_PSELECT6
|
|
||||||
|
func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
|
||||||
|
ts := Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
|
||||||
|
return Pselect(nfd, r, w, e, &ts, nil)
|
||||||
|
}
|
||||||
|
|
||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||||
//sys Setfsgid(gid int) (err error)
|
//sys Setfsgid(gid int) (err error)
|
||||||
//sys Setfsuid(uid int) (err error)
|
//sys Setfsuid(uid int) (err error)
|
||||||
@@ -54,8 +61,6 @@ package unix
|
|||||||
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
||||||
|
|
||||||
func Getpagesize() int { return 65536 }
|
|
||||||
|
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
|
|
||||||
func Time(t *Time_t) (tt Time_t, err error) {
|
func Time(t *Time_t) (tt Time_t, err error) {
|
||||||
@@ -72,19 +77,12 @@ func Time(t *Time_t) (tt Time_t, err error) {
|
|||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Pipe(p []int) (err error) {
|
func Pipe(p []int) (err error) {
|
||||||
@@ -182,9 +180,9 @@ func fillStat_t(s *Stat_t, st *stat_t) {
|
|||||||
s.Blocks = st.Blocks
|
s.Blocks = st.Blocks
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *PtraceRegs) PC() uint64 { return r.Regs[64] }
|
func (r *PtraceRegs) PC() uint64 { return r.Epc }
|
||||||
|
|
||||||
func (r *PtraceRegs) SetPC(pc uint64) { r.Regs[64] = pc }
|
func (r *PtraceRegs) SetPC(pc uint64) { r.Epc = pc }
|
||||||
|
|
||||||
func (iov *Iovec) SetLen(length int) {
|
func (iov *Iovec) SetLen(length int) {
|
||||||
iov.Len = uint64(length)
|
iov.Len = uint64(length)
|
||||||
|
|||||||
+7
-15
@@ -65,6 +65,7 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
|
|||||||
|
|
||||||
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
||||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
@@ -99,19 +100,12 @@ func Seek(fd int, offset int64, whence int) (off int64, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int32(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||||
tv.Sec = int32(nsec / 1e9)
|
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb pipe2(p *[2]_C_int, flags int) (err error)
|
//sysnb pipe2(p *[2]_C_int, flags int) (err error)
|
||||||
@@ -211,9 +205,9 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) {
|
|||||||
return setrlimit(resource, &rl)
|
return setrlimit(resource, &rl)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *PtraceRegs) PC() uint64 { return uint64(r.Regs[64]) }
|
func (r *PtraceRegs) PC() uint64 { return r.Epc }
|
||||||
|
|
||||||
func (r *PtraceRegs) SetPC(pc uint64) { r.Regs[64] = uint32(pc) }
|
func (r *PtraceRegs) SetPC(pc uint64) { r.Epc = pc }
|
||||||
|
|
||||||
func (iov *Iovec) SetLen(length int) {
|
func (iov *Iovec) SetLen(length int) {
|
||||||
iov.Len = uint32(length)
|
iov.Len = uint32(length)
|
||||||
@@ -235,5 +229,3 @@ func Poll(fds []PollFd, timeout int) (n int, err error) {
|
|||||||
}
|
}
|
||||||
return poll(&fds[0], len(fds), timeout)
|
return poll(&fds[0], len(fds), timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
|
||||||
|
|||||||
+6
-14
@@ -11,6 +11,7 @@ package unix
|
|||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT
|
||||||
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
//sysnb Getegid() (egid int)
|
//sysnb Getegid() (egid int)
|
||||||
@@ -28,7 +29,7 @@ package unix
|
|||||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
||||||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
||||||
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
||||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
|
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
|
||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||||
//sys Setfsgid(gid int) (err error)
|
//sys Setfsgid(gid int) (err error)
|
||||||
//sys Setfsuid(uid int) (err error)
|
//sys Setfsuid(uid int) (err error)
|
||||||
@@ -61,26 +62,17 @@ package unix
|
|||||||
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
||||||
|
|
||||||
func Getpagesize() int { return 65536 }
|
|
||||||
|
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
//sysnb Time(t *Time_t) (tt Time_t, err error)
|
//sysnb Time(t *Time_t) (tt Time_t, err error)
|
||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *PtraceRegs) PC() uint64 { return r.Nip }
|
func (r *PtraceRegs) PC() uint64 { return r.Nip }
|
||||||
|
|||||||
+5
-13
@@ -15,6 +15,7 @@ import (
|
|||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT
|
||||||
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
//sysnb Getegid() (egid int)
|
//sysnb Getegid() (egid int)
|
||||||
@@ -46,8 +47,6 @@ import (
|
|||||||
//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
|
//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
|
||||||
//sysnb setgroups(n int, list *_Gid_t) (err error)
|
//sysnb setgroups(n int, list *_Gid_t) (err error)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
|
||||||
|
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
|
|
||||||
func Time(t *Time_t) (tt Time_t, err error) {
|
func Time(t *Time_t) (tt Time_t, err error) {
|
||||||
@@ -64,19 +63,12 @@ func Time(t *Time_t) (tt Time_t, err error) {
|
|||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb pipe2(p *[2]_C_int, flags int) (err error)
|
//sysnb pipe2(p *[2]_C_int, flags int) (err error)
|
||||||
|
|||||||
+5
-31
@@ -6,15 +6,11 @@
|
|||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
import (
|
|
||||||
"sync/atomic"
|
|
||||||
"syscall"
|
|
||||||
)
|
|
||||||
|
|
||||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
||||||
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
//sysnb Getegid() (egid int)
|
//sysnb Getegid() (egid int)
|
||||||
@@ -63,21 +59,6 @@ import (
|
|||||||
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
||||||
|
|
||||||
func sysconf(name int) (n int64, err syscall.Errno)
|
|
||||||
|
|
||||||
// pageSize caches the value of Getpagesize, since it can't change
|
|
||||||
// once the system is booted.
|
|
||||||
var pageSize int64 // accessed atomically
|
|
||||||
|
|
||||||
func Getpagesize() int {
|
|
||||||
n := atomic.LoadInt64(&pageSize)
|
|
||||||
if n == 0 {
|
|
||||||
n, _ = sysconf(_SC_PAGESIZE)
|
|
||||||
atomic.StoreInt64(&pageSize, n)
|
|
||||||
}
|
|
||||||
return int(n)
|
|
||||||
}
|
|
||||||
|
|
||||||
func Ioperm(from int, num int, on int) (err error) {
|
func Ioperm(from int, num int, on int) (err error) {
|
||||||
return ENOSYS
|
return ENOSYS
|
||||||
}
|
}
|
||||||
@@ -102,19 +83,12 @@ func Time(t *Time_t) (tt Time_t, err error) {
|
|||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *PtraceRegs) PC() uint64 { return r.Tpc }
|
func (r *PtraceRegs) PC() uint64 { return r.Tpc }
|
||||||
|
|||||||
+108
-8
@@ -55,7 +55,6 @@ func sysctlNodes(mib []_C_int) (nodes []Sysctlnode, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func nametomib(name string) (mib []_C_int, err error) {
|
func nametomib(name string) (mib []_C_int, err error) {
|
||||||
|
|
||||||
// Split name into components.
|
// Split name into components.
|
||||||
var parts []string
|
var parts []string
|
||||||
last := 0
|
last := 0
|
||||||
@@ -119,11 +118,118 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|||||||
return getdents(fd, buf)
|
return getdents(fd, buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ImplementsGetwd = true
|
||||||
|
|
||||||
|
//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD
|
||||||
|
|
||||||
|
func Getwd() (string, error) {
|
||||||
|
var buf [PathMax]byte
|
||||||
|
_, err := Getcwd(buf[0:])
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
n := clen(buf[:])
|
||||||
|
if n < 1 {
|
||||||
|
return "", EINVAL
|
||||||
|
}
|
||||||
|
return string(buf[:n]), nil
|
||||||
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
||||||
return -1, ENOSYS
|
return -1, ENOSYS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setattrlistTimes(path string, times []Timespec, flags int) error {
|
||||||
|
// used on Darwin for UtimesNano
|
||||||
|
return ENOSYS
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||||
|
|
||||||
|
// ioctl itself should not be exposed directly, but additional get/set
|
||||||
|
// functions for specific types are permissible.
|
||||||
|
|
||||||
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
|
// on fd, using the specified request number.
|
||||||
|
func IoctlSetInt(fd int, req uint, value int) error {
|
||||||
|
return ioctl(fd, req, uintptr(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||||
|
// from fd, using the specified request number.
|
||||||
|
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||||
|
var value int
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||||
|
var value Winsize
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||||
|
var value Termios
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func Uname(uname *Utsname) error {
|
||||||
|
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
|
||||||
|
n := unsafe.Sizeof(uname.Sysname)
|
||||||
|
if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
|
||||||
|
n = unsafe.Sizeof(uname.Nodename)
|
||||||
|
if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
|
||||||
|
n = unsafe.Sizeof(uname.Release)
|
||||||
|
if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_VERSION}
|
||||||
|
n = unsafe.Sizeof(uname.Version)
|
||||||
|
if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// The version might have newlines or tabs in it, convert them to
|
||||||
|
// spaces.
|
||||||
|
for i, b := range uname.Version {
|
||||||
|
if b == '\n' || b == '\t' {
|
||||||
|
if i == len(uname.Version)-1 {
|
||||||
|
uname.Version[i] = 0
|
||||||
|
} else {
|
||||||
|
uname.Version[i] = ' '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_HW, HW_MACHINE}
|
||||||
|
n = unsafe.Sizeof(uname.Machine)
|
||||||
|
if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exposed directly
|
* Exposed directly
|
||||||
*/
|
*/
|
||||||
@@ -170,11 +276,6 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||||||
//sys Mkdir(path string, mode uint32) (err error)
|
//sys Mkdir(path string, mode uint32) (err error)
|
||||||
//sys Mkfifo(path string, mode uint32) (err error)
|
//sys Mkfifo(path string, mode uint32) (err error)
|
||||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||||
//sys Mlock(b []byte) (err error)
|
|
||||||
//sys Mlockall(flags int) (err error)
|
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
|
||||||
//sys Munlock(b []byte) (err error)
|
|
||||||
//sys Munlockall() (err error)
|
|
||||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||||
//sys Pathconf(path string, name int) (val int, err error)
|
//sys Pathconf(path string, name int) (val int, err error)
|
||||||
@@ -210,6 +311,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
||||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||||
|
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unimplemented
|
* Unimplemented
|
||||||
@@ -388,7 +490,6 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||||||
// getitimer
|
// getitimer
|
||||||
// getvfsstat
|
// getvfsstat
|
||||||
// getxattr
|
// getxattr
|
||||||
// ioctl
|
|
||||||
// ktrace
|
// ktrace
|
||||||
// lchflags
|
// lchflags
|
||||||
// lchmod
|
// lchmod
|
||||||
@@ -426,7 +527,6 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||||||
// ntp_adjtime
|
// ntp_adjtime
|
||||||
// pmc_control
|
// pmc_control
|
||||||
// pmc_get_info
|
// pmc_get_info
|
||||||
// poll
|
|
||||||
// pollts
|
// pollts
|
||||||
// preadv
|
// preadv
|
||||||
// profil
|
// profil
|
||||||
|
|||||||
+4
-13
@@ -6,21 +6,12 @@
|
|||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int64(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|||||||
+4
-13
@@ -6,21 +6,12 @@
|
|||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int64(nsec / 1e9)
|
|
||||||
ts.Nsec = int64(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|||||||
+4
-13
@@ -6,21 +6,12 @@
|
|||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int64(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|||||||
-11
@@ -1,11 +0,0 @@
|
|||||||
// 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 dragonfly freebsd netbsd openbsd
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
const ImplementsGetwd = false
|
|
||||||
|
|
||||||
func Getwd() (string, error) { return "", ENOTSUP }
|
|
||||||
+114
-25
@@ -13,6 +13,7 @@
|
|||||||
package unix
|
package unix
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"sort"
|
||||||
"syscall"
|
"syscall"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
@@ -32,23 +33,11 @@ type SockaddrDatalink struct {
|
|||||||
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||||
|
|
||||||
func nametomib(name string) (mib []_C_int, err error) {
|
func nametomib(name string) (mib []_C_int, err error) {
|
||||||
|
i := sort.Search(len(sysctlMib), func(i int) bool {
|
||||||
// Perform lookup via a binary search
|
return sysctlMib[i].ctlname >= name
|
||||||
left := 0
|
})
|
||||||
right := len(sysctlMib) - 1
|
if i < len(sysctlMib) && sysctlMib[i].ctlname == name {
|
||||||
for {
|
return sysctlMib[i].ctloid, nil
|
||||||
idx := left + (right-left)/2
|
|
||||||
switch {
|
|
||||||
case name == sysctlMib[idx].ctlname:
|
|
||||||
return sysctlMib[idx].ctloid, nil
|
|
||||||
case name > sysctlMib[idx].ctlname:
|
|
||||||
left = idx + 1
|
|
||||||
default:
|
|
||||||
right = idx - 1
|
|
||||||
}
|
|
||||||
if left > right {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nil, EINVAL
|
return nil, EINVAL
|
||||||
}
|
}
|
||||||
@@ -82,6 +71,23 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|||||||
return getdents(fd, buf)
|
return getdents(fd, buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ImplementsGetwd = true
|
||||||
|
|
||||||
|
//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD
|
||||||
|
|
||||||
|
func Getwd() (string, error) {
|
||||||
|
var buf [PathMax]byte
|
||||||
|
_, err := Getcwd(buf[0:])
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
n := clen(buf[:])
|
||||||
|
if n < 1 {
|
||||||
|
return "", EINVAL
|
||||||
|
}
|
||||||
|
return string(buf[:n]), nil
|
||||||
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
||||||
return -1, ENOSYS
|
return -1, ENOSYS
|
||||||
@@ -102,6 +108,96 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setattrlistTimes(path string, times []Timespec, flags int) error {
|
||||||
|
// used on Darwin for UtimesNano
|
||||||
|
return ENOSYS
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||||
|
|
||||||
|
// ioctl itself should not be exposed directly, but additional get/set
|
||||||
|
// functions for specific types are permissible.
|
||||||
|
|
||||||
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
|
// on fd, using the specified request number.
|
||||||
|
func IoctlSetInt(fd int, req uint, value int) error {
|
||||||
|
return ioctl(fd, req, uintptr(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||||
|
// from fd, using the specified request number.
|
||||||
|
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||||
|
var value int
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||||
|
var value Winsize
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||||
|
var value Termios
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func Uname(uname *Utsname) error {
|
||||||
|
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
|
||||||
|
n := unsafe.Sizeof(uname.Sysname)
|
||||||
|
if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
|
||||||
|
n = unsafe.Sizeof(uname.Nodename)
|
||||||
|
if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
|
||||||
|
n = unsafe.Sizeof(uname.Release)
|
||||||
|
if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_VERSION}
|
||||||
|
n = unsafe.Sizeof(uname.Version)
|
||||||
|
if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// The version might have newlines or tabs in it, convert them to
|
||||||
|
// spaces.
|
||||||
|
for i, b := range uname.Version {
|
||||||
|
if b == '\n' || b == '\t' {
|
||||||
|
if i == len(uname.Version)-1 {
|
||||||
|
uname.Version[i] = 0
|
||||||
|
} else {
|
||||||
|
uname.Version[i] = ' '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_HW, HW_MACHINE}
|
||||||
|
n = unsafe.Sizeof(uname.Machine)
|
||||||
|
if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exposed directly
|
* Exposed directly
|
||||||
*/
|
*/
|
||||||
@@ -149,11 +245,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
//sys Mkdir(path string, mode uint32) (err error)
|
//sys Mkdir(path string, mode uint32) (err error)
|
||||||
//sys Mkfifo(path string, mode uint32) (err error)
|
//sys Mkfifo(path string, mode uint32) (err error)
|
||||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||||
//sys Mlock(b []byte) (err error)
|
|
||||||
//sys Mlockall(flags int) (err error)
|
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
|
||||||
//sys Munlock(b []byte) (err error)
|
|
||||||
//sys Munlockall() (err error)
|
|
||||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||||
//sys Pathconf(path string, name int) (val int, err error)
|
//sys Pathconf(path string, name int) (val int, err error)
|
||||||
@@ -193,6 +284,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
||||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||||
|
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unimplemented
|
* Unimplemented
|
||||||
@@ -226,7 +318,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
// getresuid
|
// getresuid
|
||||||
// getrtable
|
// getrtable
|
||||||
// getthrid
|
// getthrid
|
||||||
// ioctl
|
|
||||||
// ktrace
|
// ktrace
|
||||||
// lfs_bmapv
|
// lfs_bmapv
|
||||||
// lfs_markv
|
// lfs_markv
|
||||||
@@ -247,7 +338,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
// nfssvc
|
// nfssvc
|
||||||
// nnpfspioctl
|
// nnpfspioctl
|
||||||
// openat
|
// openat
|
||||||
// poll
|
|
||||||
// preadv
|
// preadv
|
||||||
// profil
|
// profil
|
||||||
// pwritev
|
// pwritev
|
||||||
@@ -282,6 +372,5 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||||||
// thrsleep
|
// thrsleep
|
||||||
// thrwakeup
|
// thrwakeup
|
||||||
// unlinkat
|
// unlinkat
|
||||||
// utimensat
|
|
||||||
// vfork
|
// vfork
|
||||||
// writev
|
// writev
|
||||||
|
|||||||
+4
-13
@@ -6,21 +6,12 @@
|
|||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int64(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|||||||
+4
-13
@@ -6,21 +6,12 @@
|
|||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|||||||
+33
@@ -0,0 +1,33 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// +build arm,openbsd
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: int32(nsec)}
|
||||||
|
}
|
||||||
|
|
||||||
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
k.Ident = uint32(fd)
|
||||||
|
k.Filter = int16(mode)
|
||||||
|
k.Flags = uint16(flags)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (iov *Iovec) SetLen(length int) {
|
||||||
|
iov.Len = uint32(length)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (msghdr *Msghdr) SetControllen(length int) {
|
||||||
|
msghdr.Controllen = uint32(length)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cmsg *Cmsghdr) SetLen(length int) {
|
||||||
|
cmsg.Len = uint32(length)
|
||||||
|
}
|
||||||
+66
-47
@@ -13,7 +13,6 @@
|
|||||||
package unix
|
package unix
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"sync/atomic"
|
|
||||||
"syscall"
|
"syscall"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
@@ -35,15 +34,6 @@ type SockaddrDatalink struct {
|
|||||||
raw RawSockaddrDatalink
|
raw RawSockaddrDatalink
|
||||||
}
|
}
|
||||||
|
|
||||||
func clen(n []byte) int {
|
|
||||||
for i := 0; i < len(n); i++ {
|
|
||||||
if n[i] == 0 {
|
|
||||||
return i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return len(n)
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntIno(buf []byte) (uint64, bool) {
|
func direntIno(buf []byte) (uint64, bool) {
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino))
|
return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino))
|
||||||
}
|
}
|
||||||
@@ -140,6 +130,18 @@ func Getsockname(fd int) (sa Sockaddr, err error) {
|
|||||||
return anyToSockaddr(&rsa)
|
return anyToSockaddr(&rsa)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetsockoptString returns the string value of the socket option opt for the
|
||||||
|
// socket associated with fd at the given socket level.
|
||||||
|
func GetsockoptString(fd, level, opt int) (string, error) {
|
||||||
|
buf := make([]byte, 256)
|
||||||
|
vallen := _Socklen(len(buf))
|
||||||
|
err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return string(buf[:vallen-1]), nil
|
||||||
|
}
|
||||||
|
|
||||||
const ImplementsGetwd = true
|
const ImplementsGetwd = true
|
||||||
|
|
||||||
//sys Getcwd(buf []byte) (n int, err error)
|
//sys Getcwd(buf []byte) (n int, err error)
|
||||||
@@ -167,7 +169,7 @@ func Getwd() (wd string, err error) {
|
|||||||
|
|
||||||
func Getgroups() (gids []int, err error) {
|
func Getgroups() (gids []int, err error) {
|
||||||
n, err := getgroups(0, nil)
|
n, err := getgroups(0, nil)
|
||||||
// Check for error and sanity check group count. Newer versions of
|
// Check for error and sanity check group count. Newer versions of
|
||||||
// Solaris allow up to 1024 (NGROUPS_MAX).
|
// Solaris allow up to 1024 (NGROUPS_MAX).
|
||||||
if n < 0 || n > 1024 {
|
if n < 0 || n > 1024 {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -351,7 +353,7 @@ func Futimesat(dirfd int, path string, tv []Timeval) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Solaris doesn't have an futimes function because it allows NULL to be
|
// Solaris doesn't have an futimes function because it allows NULL to be
|
||||||
// specified as the path for futimesat. However, Go doesn't like
|
// specified as the path for futimesat. However, Go doesn't like
|
||||||
// NULL-style string interfaces, so this simple wrapper is provided.
|
// NULL-style string interfaces, so this simple wrapper is provided.
|
||||||
func Futimes(fd int, tv []Timeval) error {
|
func Futimes(fd int, tv []Timeval) error {
|
||||||
if tv == nil {
|
if tv == nil {
|
||||||
@@ -422,7 +424,7 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.recvmsg
|
//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.__xnet_recvmsg
|
||||||
|
|
||||||
func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
|
func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
|
||||||
var msg Msghdr
|
var msg Msghdr
|
||||||
@@ -441,7 +443,7 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from
|
|||||||
iov.Base = &dummy
|
iov.Base = &dummy
|
||||||
iov.SetLen(1)
|
iov.SetLen(1)
|
||||||
}
|
}
|
||||||
msg.Accrights = (*int8)(unsafe.Pointer(&oob[0]))
|
msg.Accrightslen = int32(len(oob))
|
||||||
}
|
}
|
||||||
msg.Iov = &iov
|
msg.Iov = &iov
|
||||||
msg.Iovlen = 1
|
msg.Iovlen = 1
|
||||||
@@ -461,7 +463,7 @@ func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.sendmsg
|
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.__xnet_sendmsg
|
||||||
|
|
||||||
func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
|
func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
|
||||||
var ptr unsafe.Pointer
|
var ptr unsafe.Pointer
|
||||||
@@ -487,7 +489,7 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)
|
|||||||
iov.Base = &dummy
|
iov.Base = &dummy
|
||||||
iov.SetLen(1)
|
iov.SetLen(1)
|
||||||
}
|
}
|
||||||
msg.Accrights = (*int8)(unsafe.Pointer(&oob[0]))
|
msg.Accrightslen = int32(len(oob))
|
||||||
}
|
}
|
||||||
msg.Iov = &iov
|
msg.Iov = &iov
|
||||||
msg.Iovlen = 1
|
msg.Iovlen = 1
|
||||||
@@ -515,52 +517,79 @@ func Acct(path string) (err error) {
|
|||||||
return acct(pathp)
|
return acct(pathp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sys __makedev(version int, major uint, minor uint) (val uint64)
|
||||||
|
|
||||||
|
func Mkdev(major, minor uint32) uint64 {
|
||||||
|
return __makedev(NEWDEV, uint(major), uint(minor))
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys __major(version int, dev uint64) (val uint)
|
||||||
|
|
||||||
|
func Major(dev uint64) uint32 {
|
||||||
|
return uint32(__major(NEWDEV, dev))
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys __minor(version int, dev uint64) (val uint)
|
||||||
|
|
||||||
|
func Minor(dev uint64) uint32 {
|
||||||
|
return uint32(__minor(NEWDEV, dev))
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Expose the ioctl function
|
* Expose the ioctl function
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//sys ioctl(fd int, req int, arg uintptr) (err error)
|
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||||
|
|
||||||
func IoctlSetInt(fd int, req int, value int) (err error) {
|
func IoctlSetInt(fd int, req uint, value int) (err error) {
|
||||||
return ioctl(fd, req, uintptr(value))
|
return ioctl(fd, req, uintptr(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlSetWinsize(fd int, req int, value *Winsize) (err error) {
|
func IoctlSetWinsize(fd int, req uint, value *Winsize) (err error) {
|
||||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlSetTermios(fd int, req int, value *Termios) (err error) {
|
func IoctlSetTermios(fd int, req uint, value *Termios) (err error) {
|
||||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlSetTermio(fd int, req int, value *Termio) (err error) {
|
func IoctlSetTermio(fd int, req uint, value *Termio) (err error) {
|
||||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlGetInt(fd int, req int) (int, error) {
|
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||||
var value int
|
var value int
|
||||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
return value, err
|
return value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlGetWinsize(fd int, req int) (*Winsize, error) {
|
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||||
var value Winsize
|
var value Winsize
|
||||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
return &value, err
|
return &value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlGetTermios(fd int, req int) (*Termios, error) {
|
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||||
var value Termios
|
var value Termios
|
||||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
return &value, err
|
return &value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlGetTermio(fd int, req int) (*Termio, error) {
|
func IoctlGetTermio(fd int, req uint) (*Termio, error) {
|
||||||
var value Termio
|
var value Termio
|
||||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
return &value, err
|
return &value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
|
||||||
|
|
||||||
|
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||||
|
if len(fds) == 0 {
|
||||||
|
return poll(nil, 0, timeout)
|
||||||
|
}
|
||||||
|
return poll(&fds[0], len(fds), timeout)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exposed directly
|
* Exposed directly
|
||||||
*/
|
*/
|
||||||
@@ -581,8 +610,10 @@ func IoctlGetTermio(fd int, req int) (*Termio, error) {
|
|||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
|
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
|
||||||
//sys Fdatasync(fd int) (err error)
|
//sys Fdatasync(fd int) (err error)
|
||||||
|
//sys Flock(fd int, how int) (err error)
|
||||||
//sys Fpathconf(fd int, name int) (val int, err error)
|
//sys Fpathconf(fd int, name int) (val int, err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
|
//sys Fstatvfs(fd int, vfsstat *Statvfs_t) (err error)
|
||||||
//sys Getdents(fd int, buf []byte, basep *uintptr) (n int, err error)
|
//sys Getdents(fd int, buf []byte, basep *uintptr) (n int, err error)
|
||||||
//sysnb Getgid() (gid int)
|
//sysnb Getgid() (gid int)
|
||||||
//sysnb Getpid() (pid int)
|
//sysnb Getpid() (pid int)
|
||||||
@@ -599,7 +630,7 @@ func IoctlGetTermio(fd int, req int) (*Termio, error) {
|
|||||||
//sys Kill(pid int, signum syscall.Signal) (err error)
|
//sys Kill(pid int, signum syscall.Signal) (err error)
|
||||||
//sys Lchown(path string, uid int, gid int) (err error)
|
//sys Lchown(path string, uid int, gid int) (err error)
|
||||||
//sys Link(path string, link string) (err error)
|
//sys Link(path string, link string) (err error)
|
||||||
//sys Listen(s int, backlog int) (err error) = libsocket.listen
|
//sys Listen(s int, backlog int) (err error) = libsocket.__xnet_llisten
|
||||||
//sys Lstat(path string, stat *Stat_t) (err error)
|
//sys Lstat(path string, stat *Stat_t) (err error)
|
||||||
//sys Madvise(b []byte, advice int) (err error)
|
//sys Madvise(b []byte, advice int) (err error)
|
||||||
//sys Mkdir(path string, mode uint32) (err error)
|
//sys Mkdir(path string, mode uint32) (err error)
|
||||||
@@ -611,6 +642,7 @@ func IoctlGetTermio(fd int, req int) (*Termio, error) {
|
|||||||
//sys Mlock(b []byte) (err error)
|
//sys Mlock(b []byte) (err error)
|
||||||
//sys Mlockall(flags int) (err error)
|
//sys Mlockall(flags int) (err error)
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
//sys Mprotect(b []byte, prot int) (err error)
|
||||||
|
//sys Msync(b []byte, flags int) (err error)
|
||||||
//sys Munlock(b []byte) (err error)
|
//sys Munlock(b []byte) (err error)
|
||||||
//sys Munlockall() (err error)
|
//sys Munlockall() (err error)
|
||||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||||
@@ -626,6 +658,7 @@ func IoctlGetTermio(fd int, req int) (*Termio, error) {
|
|||||||
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
|
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
|
||||||
//sys Rmdir(path string) (err error)
|
//sys Rmdir(path string) (err error)
|
||||||
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = lseek
|
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = lseek
|
||||||
|
//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
|
||||||
//sysnb Setegid(egid int) (err error)
|
//sysnb Setegid(egid int) (err error)
|
||||||
//sysnb Seteuid(euid int) (err error)
|
//sysnb Seteuid(euid int) (err error)
|
||||||
//sysnb Setgid(gid int) (err error)
|
//sysnb Setgid(gid int) (err error)
|
||||||
@@ -639,6 +672,7 @@ func IoctlGetTermio(fd int, req int) (*Termio, error) {
|
|||||||
//sysnb Setuid(uid int) (err error)
|
//sysnb Setuid(uid int) (err error)
|
||||||
//sys Shutdown(s int, how int) (err error) = libsocket.shutdown
|
//sys Shutdown(s int, how int) (err error) = libsocket.shutdown
|
||||||
//sys Stat(path string, stat *Stat_t) (err error)
|
//sys Stat(path string, stat *Stat_t) (err error)
|
||||||
|
//sys Statvfs(path string, vfsstat *Statvfs_t) (err error)
|
||||||
//sys Symlink(path string, link string) (err error)
|
//sys Symlink(path string, link string) (err error)
|
||||||
//sys Sync() (err error)
|
//sys Sync() (err error)
|
||||||
//sysnb Times(tms *Tms) (ticks uintptr, err error)
|
//sysnb Times(tms *Tms) (ticks uintptr, err error)
|
||||||
@@ -652,15 +686,15 @@ func IoctlGetTermio(fd int, req int) (*Termio, error) {
|
|||||||
//sys Unlinkat(dirfd int, path string, flags int) (err error)
|
//sys Unlinkat(dirfd int, path string, flags int) (err error)
|
||||||
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
|
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.bind
|
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_bind
|
||||||
//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.connect
|
//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_connect
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
||||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||||
//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.sendto
|
//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_sendto
|
||||||
//sys socket(domain int, typ int, proto int) (fd int, err error) = libsocket.socket
|
//sys socket(domain int, typ int, proto int) (fd int, err error) = libsocket.__xnet_socket
|
||||||
//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) = libsocket.socketpair
|
//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) = libsocket.__xnet_socketpair
|
||||||
//sys write(fd int, p []byte) (n int, err error)
|
//sys write(fd int, p []byte) (n int, err error)
|
||||||
//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) = libsocket.getsockopt
|
//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) = libsocket.__xnet_getsockopt
|
||||||
//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = libsocket.getpeername
|
//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = libsocket.getpeername
|
||||||
//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) = libsocket.setsockopt
|
//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) = libsocket.setsockopt
|
||||||
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) = libsocket.recvfrom
|
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) = libsocket.recvfrom
|
||||||
@@ -696,18 +730,3 @@ func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, e
|
|||||||
func Munmap(b []byte) (err error) {
|
func Munmap(b []byte) (err error) {
|
||||||
return mapper.Munmap(b)
|
return mapper.Munmap(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
//sys sysconf(name int) (n int64, err error)
|
|
||||||
|
|
||||||
// pageSize caches the value of Getpagesize, since it can't change
|
|
||||||
// once the system is booted.
|
|
||||||
var pageSize int64 // accessed atomically
|
|
||||||
|
|
||||||
func Getpagesize() int {
|
|
||||||
n := atomic.LoadInt64(&pageSize)
|
|
||||||
if n == 0 {
|
|
||||||
n, _ = sysconf(_SC_PAGESIZE)
|
|
||||||
atomic.StoreInt64(&pageSize, n)
|
|
||||||
}
|
|
||||||
return int(n)
|
|
||||||
}
|
|
||||||
|
|||||||
+4
-11
@@ -6,19 +6,12 @@
|
|||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (iov *Iovec) SetLen(length int) {
|
func (iov *Iovec) SetLen(length int) {
|
||||||
|
|||||||
+12
@@ -23,6 +23,7 @@ const (
|
|||||||
darwin64Bit = runtime.GOOS == "darwin" && sizeofPtr == 8
|
darwin64Bit = runtime.GOOS == "darwin" && sizeofPtr == 8
|
||||||
dragonfly64Bit = runtime.GOOS == "dragonfly" && sizeofPtr == 8
|
dragonfly64Bit = runtime.GOOS == "dragonfly" && sizeofPtr == 8
|
||||||
netbsd32Bit = runtime.GOOS == "netbsd" && sizeofPtr == 4
|
netbsd32Bit = runtime.GOOS == "netbsd" && sizeofPtr == 4
|
||||||
|
solaris64Bit = runtime.GOOS == "solaris" && sizeofPtr == 8
|
||||||
)
|
)
|
||||||
|
|
||||||
// Do the interface allocations only once for common
|
// Do the interface allocations only once for common
|
||||||
@@ -49,6 +50,17 @@ func errnoErr(e syscall.Errno) error {
|
|||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clen returns the index of the first NULL byte in n or len(n) if n contains no
|
||||||
|
// NULL byte or len(n) if n contains no NULL byte
|
||||||
|
func clen(n []byte) int {
|
||||||
|
for i := 0; i < len(n); i++ {
|
||||||
|
if n[i] == 0 {
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return len(n)
|
||||||
|
}
|
||||||
|
|
||||||
// Mmap manager, for use by operating system-specific implementations.
|
// Mmap manager, for use by operating system-specific implementations.
|
||||||
|
|
||||||
type mmapper struct {
|
type mmapper struct {
|
||||||
|
|||||||
+82
@@ -0,0 +1,82 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
// TimespecToNsec converts a Timespec value into a number of
|
||||||
|
// nanoseconds since the Unix epoch.
|
||||||
|
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
||||||
|
|
||||||
|
// NsecToTimespec takes a number of nanoseconds since the Unix epoch
|
||||||
|
// and returns the corresponding Timespec value.
|
||||||
|
func NsecToTimespec(nsec int64) Timespec {
|
||||||
|
sec := nsec / 1e9
|
||||||
|
nsec = nsec % 1e9
|
||||||
|
if nsec < 0 {
|
||||||
|
nsec += 1e9
|
||||||
|
sec--
|
||||||
|
}
|
||||||
|
return setTimespec(sec, nsec)
|
||||||
|
}
|
||||||
|
|
||||||
|
// TimeToTimespec converts t into a Timespec.
|
||||||
|
// On some 32-bit systems the range of valid Timespec values are smaller
|
||||||
|
// than that of time.Time values. So if t is out of the valid range of
|
||||||
|
// Timespec, it returns a zero Timespec and ERANGE.
|
||||||
|
func TimeToTimespec(t time.Time) (Timespec, error) {
|
||||||
|
sec := t.Unix()
|
||||||
|
nsec := int64(t.Nanosecond())
|
||||||
|
ts := setTimespec(sec, nsec)
|
||||||
|
|
||||||
|
// Currently all targets have either int32 or int64 for Timespec.Sec.
|
||||||
|
// If there were a new target with floating point type for it, we have
|
||||||
|
// to consider the rounding error.
|
||||||
|
if int64(ts.Sec) != sec {
|
||||||
|
return Timespec{}, ERANGE
|
||||||
|
}
|
||||||
|
return ts, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// TimevalToNsec converts a Timeval value into a number of nanoseconds
|
||||||
|
// since the Unix epoch.
|
||||||
|
func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }
|
||||||
|
|
||||||
|
// NsecToTimeval takes a number of nanoseconds since the Unix epoch
|
||||||
|
// and returns the corresponding Timeval value.
|
||||||
|
func NsecToTimeval(nsec int64) Timeval {
|
||||||
|
nsec += 999 // round up to microsecond
|
||||||
|
usec := nsec % 1e9 / 1e3
|
||||||
|
sec := nsec / 1e9
|
||||||
|
if usec < 0 {
|
||||||
|
usec += 1e6
|
||||||
|
sec--
|
||||||
|
}
|
||||||
|
return setTimeval(sec, usec)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unix returns ts as the number of seconds and nanoseconds elapsed since the
|
||||||
|
// Unix epoch.
|
||||||
|
func (ts *Timespec) Unix() (sec int64, nsec int64) {
|
||||||
|
return int64(ts.Sec), int64(ts.Nsec)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unix returns tv as the number of seconds and nanoseconds elapsed since the
|
||||||
|
// Unix epoch.
|
||||||
|
func (tv *Timeval) Unix() (sec int64, nsec int64) {
|
||||||
|
return int64(tv.Sec), int64(tv.Usec) * 1000
|
||||||
|
}
|
||||||
|
|
||||||
|
// Nano returns ts as the number of nanoseconds elapsed since the Unix epoch.
|
||||||
|
func (ts *Timespec) Nano() int64 {
|
||||||
|
return int64(ts.Sec)*1e9 + int64(ts.Nsec)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Nano returns tv as the number of nanoseconds elapsed since the Unix epoch.
|
||||||
|
func (tv *Timeval) Nano() int64 {
|
||||||
|
return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000
|
||||||
|
}
|
||||||
+28
-1
@@ -5,7 +5,7 @@
|
|||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Input to cgo -godefs. See also mkerrors.sh and mkall.sh
|
Input to cgo -godefs. See README.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// +godefs map struct_in_addr [4]byte /* in_addr */
|
// +godefs map struct_in_addr [4]byte /* in_addr */
|
||||||
@@ -19,6 +19,7 @@ package unix
|
|||||||
#define _DARWIN_USE_64_BIT_INODE
|
#define _DARWIN_USE_64_BIT_INODE
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <poll.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -38,6 +39,7 @@ package unix
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
@@ -242,9 +244,34 @@ type BpfHdr C.struct_bpf_hdr
|
|||||||
|
|
||||||
type Termios C.struct_termios
|
type Termios C.struct_termios
|
||||||
|
|
||||||
|
type Winsize C.struct_winsize
|
||||||
|
|
||||||
// fchmodat-like syscalls.
|
// fchmodat-like syscalls.
|
||||||
|
|
||||||
const (
|
const (
|
||||||
AT_FDCWD = C.AT_FDCWD
|
AT_FDCWD = C.AT_FDCWD
|
||||||
|
AT_REMOVEDIR = C.AT_REMOVEDIR
|
||||||
|
AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
|
||||||
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// poll
|
||||||
|
|
||||||
|
type PollFd C.struct_pollfd
|
||||||
|
|
||||||
|
const (
|
||||||
|
POLLERR = C.POLLERR
|
||||||
|
POLLHUP = C.POLLHUP
|
||||||
|
POLLIN = C.POLLIN
|
||||||
|
POLLNVAL = C.POLLNVAL
|
||||||
|
POLLOUT = C.POLLOUT
|
||||||
|
POLLPRI = C.POLLPRI
|
||||||
|
POLLRDBAND = C.POLLRDBAND
|
||||||
|
POLLRDNORM = C.POLLRDNORM
|
||||||
|
POLLWRBAND = C.POLLWRBAND
|
||||||
|
POLLWRNORM = C.POLLWRNORM
|
||||||
|
)
|
||||||
|
|
||||||
|
// uname
|
||||||
|
|
||||||
|
type Utsname C.struct_utsname
|
||||||
|
|||||||
+39
-1
@@ -5,7 +5,7 @@
|
|||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Input to cgo -godefs. See also mkerrors.sh and mkall.sh
|
Input to cgo -godefs. See README.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// +godefs map struct_in_addr [4]byte /* in_addr */
|
// +godefs map struct_in_addr [4]byte /* in_addr */
|
||||||
@@ -17,6 +17,7 @@ package unix
|
|||||||
#define KERNEL
|
#define KERNEL
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <poll.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -34,6 +35,7 @@ package unix
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
@@ -125,6 +127,12 @@ type Dirent C.struct_dirent
|
|||||||
|
|
||||||
type Fsid C.struct_fsid
|
type Fsid C.struct_fsid
|
||||||
|
|
||||||
|
// File system limits
|
||||||
|
|
||||||
|
const (
|
||||||
|
PathMax = C.PATH_MAX
|
||||||
|
)
|
||||||
|
|
||||||
// Sockets
|
// Sockets
|
||||||
|
|
||||||
type RawSockaddrInet4 C.struct_sockaddr_in
|
type RawSockaddrInet4 C.struct_sockaddr_in
|
||||||
@@ -240,3 +248,33 @@ type BpfHdr C.struct_bpf_hdr
|
|||||||
// Terminal handling
|
// Terminal handling
|
||||||
|
|
||||||
type Termios C.struct_termios
|
type Termios C.struct_termios
|
||||||
|
|
||||||
|
type Winsize C.struct_winsize
|
||||||
|
|
||||||
|
// fchmodat-like syscalls.
|
||||||
|
|
||||||
|
const (
|
||||||
|
AT_FDCWD = C.AT_FDCWD
|
||||||
|
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||||
|
)
|
||||||
|
|
||||||
|
// poll
|
||||||
|
|
||||||
|
type PollFd C.struct_pollfd
|
||||||
|
|
||||||
|
const (
|
||||||
|
POLLERR = C.POLLERR
|
||||||
|
POLLHUP = C.POLLHUP
|
||||||
|
POLLIN = C.POLLIN
|
||||||
|
POLLNVAL = C.POLLNVAL
|
||||||
|
POLLOUT = C.POLLOUT
|
||||||
|
POLLPRI = C.POLLPRI
|
||||||
|
POLLRDBAND = C.POLLRDBAND
|
||||||
|
POLLRDNORM = C.POLLRDNORM
|
||||||
|
POLLWRBAND = C.POLLWRBAND
|
||||||
|
POLLWRNORM = C.POLLWRNORM
|
||||||
|
)
|
||||||
|
|
||||||
|
// Uname
|
||||||
|
|
||||||
|
type Utsname C.struct_utsname
|
||||||
|
|||||||
+50
-1
@@ -5,7 +5,7 @@
|
|||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Input to cgo -godefs. See also mkerrors.sh and mkall.sh
|
Input to cgo -godefs. See README.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// +godefs map struct_in_addr [4]byte /* in_addr */
|
// +godefs map struct_in_addr [4]byte /* in_addr */
|
||||||
@@ -17,10 +17,12 @@ package unix
|
|||||||
#define KERNEL
|
#define KERNEL
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <poll.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <sys/capability.h>
|
||||||
#include <sys/event.h>
|
#include <sys/event.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
@@ -34,6 +36,7 @@ package unix
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
@@ -130,7 +133,10 @@ struct if_data8 {
|
|||||||
u_long ifi_iqdrops;
|
u_long ifi_iqdrops;
|
||||||
u_long ifi_noproto;
|
u_long ifi_noproto;
|
||||||
u_long ifi_hwassist;
|
u_long ifi_hwassist;
|
||||||
|
// FIXME: these are now unions, so maybe need to change definitions?
|
||||||
|
#undef ifi_epoch
|
||||||
time_t ifi_epoch;
|
time_t ifi_epoch;
|
||||||
|
#undef ifi_lastchange
|
||||||
struct timeval ifi_lastchange;
|
struct timeval ifi_lastchange;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -210,6 +216,12 @@ type Dirent C.struct_dirent
|
|||||||
|
|
||||||
type Fsid C.struct_fsid
|
type Fsid C.struct_fsid
|
||||||
|
|
||||||
|
// File system limits
|
||||||
|
|
||||||
|
const (
|
||||||
|
PathMax = C.PATH_MAX
|
||||||
|
)
|
||||||
|
|
||||||
// Advice to Fadvise
|
// Advice to Fadvise
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -351,3 +363,40 @@ type BpfZbufHeader C.struct_bpf_zbuf_header
|
|||||||
// Terminal handling
|
// Terminal handling
|
||||||
|
|
||||||
type Termios C.struct_termios
|
type Termios C.struct_termios
|
||||||
|
|
||||||
|
type Winsize C.struct_winsize
|
||||||
|
|
||||||
|
// fchmodat-like syscalls.
|
||||||
|
|
||||||
|
const (
|
||||||
|
AT_FDCWD = C.AT_FDCWD
|
||||||
|
AT_REMOVEDIR = C.AT_REMOVEDIR
|
||||||
|
AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
|
||||||
|
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||||
|
)
|
||||||
|
|
||||||
|
// poll
|
||||||
|
|
||||||
|
type PollFd C.struct_pollfd
|
||||||
|
|
||||||
|
const (
|
||||||
|
POLLERR = C.POLLERR
|
||||||
|
POLLHUP = C.POLLHUP
|
||||||
|
POLLIN = C.POLLIN
|
||||||
|
POLLINIGNEOF = C.POLLINIGNEOF
|
||||||
|
POLLNVAL = C.POLLNVAL
|
||||||
|
POLLOUT = C.POLLOUT
|
||||||
|
POLLPRI = C.POLLPRI
|
||||||
|
POLLRDBAND = C.POLLRDBAND
|
||||||
|
POLLRDNORM = C.POLLRDNORM
|
||||||
|
POLLWRBAND = C.POLLWRBAND
|
||||||
|
POLLWRNORM = C.POLLWRNORM
|
||||||
|
)
|
||||||
|
|
||||||
|
// Capabilities
|
||||||
|
|
||||||
|
type CapRights C.struct_cap_rights
|
||||||
|
|
||||||
|
// Uname
|
||||||
|
|
||||||
|
type Utsname C.struct_utsname
|
||||||
|
|||||||
+39
-1
@@ -5,7 +5,7 @@
|
|||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Input to cgo -godefs. See also mkerrors.sh and mkall.sh
|
Input to cgo -godefs. See README.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// +godefs map struct_in_addr [4]byte /* in_addr */
|
// +godefs map struct_in_addr [4]byte /* in_addr */
|
||||||
@@ -17,6 +17,7 @@ package unix
|
|||||||
#define KERNEL
|
#define KERNEL
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <poll.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -36,6 +37,7 @@ package unix
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
@@ -110,6 +112,12 @@ type Dirent C.struct_dirent
|
|||||||
|
|
||||||
type Fsid C.fsid_t
|
type Fsid C.fsid_t
|
||||||
|
|
||||||
|
// File system limits
|
||||||
|
|
||||||
|
const (
|
||||||
|
PathMax = C.PATH_MAX
|
||||||
|
)
|
||||||
|
|
||||||
// Sockets
|
// Sockets
|
||||||
|
|
||||||
type RawSockaddrInet4 C.struct_sockaddr_in
|
type RawSockaddrInet4 C.struct_sockaddr_in
|
||||||
@@ -227,6 +235,36 @@ type BpfTimeval C.struct_bpf_timeval
|
|||||||
|
|
||||||
type Termios C.struct_termios
|
type Termios C.struct_termios
|
||||||
|
|
||||||
|
type Winsize C.struct_winsize
|
||||||
|
|
||||||
|
// fchmodat-like syscalls.
|
||||||
|
|
||||||
|
const (
|
||||||
|
AT_FDCWD = C.AT_FDCWD
|
||||||
|
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||||
|
)
|
||||||
|
|
||||||
|
// poll
|
||||||
|
|
||||||
|
type PollFd C.struct_pollfd
|
||||||
|
|
||||||
|
const (
|
||||||
|
POLLERR = C.POLLERR
|
||||||
|
POLLHUP = C.POLLHUP
|
||||||
|
POLLIN = C.POLLIN
|
||||||
|
POLLNVAL = C.POLLNVAL
|
||||||
|
POLLOUT = C.POLLOUT
|
||||||
|
POLLPRI = C.POLLPRI
|
||||||
|
POLLRDBAND = C.POLLRDBAND
|
||||||
|
POLLRDNORM = C.POLLRDNORM
|
||||||
|
POLLWRBAND = C.POLLWRBAND
|
||||||
|
POLLWRNORM = C.POLLWRNORM
|
||||||
|
)
|
||||||
|
|
||||||
// Sysctl
|
// Sysctl
|
||||||
|
|
||||||
type Sysctlnode C.struct_sysctlnode
|
type Sysctlnode C.struct_sysctlnode
|
||||||
|
|
||||||
|
// Uname
|
||||||
|
|
||||||
|
type Utsname C.struct_utsname
|
||||||
|
|||||||
+39
-1
@@ -5,7 +5,7 @@
|
|||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Input to cgo -godefs. See also mkerrors.sh and mkall.sh
|
Input to cgo -godefs. See README.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// +godefs map struct_in_addr [4]byte /* in_addr */
|
// +godefs map struct_in_addr [4]byte /* in_addr */
|
||||||
@@ -17,6 +17,7 @@ package unix
|
|||||||
#define KERNEL
|
#define KERNEL
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <poll.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -35,6 +36,7 @@ package unix
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
@@ -126,6 +128,12 @@ type Dirent C.struct_dirent
|
|||||||
|
|
||||||
type Fsid C.fsid_t
|
type Fsid C.fsid_t
|
||||||
|
|
||||||
|
// File system limits
|
||||||
|
|
||||||
|
const (
|
||||||
|
PathMax = C.PATH_MAX
|
||||||
|
)
|
||||||
|
|
||||||
// Sockets
|
// Sockets
|
||||||
|
|
||||||
type RawSockaddrInet4 C.struct_sockaddr_in
|
type RawSockaddrInet4 C.struct_sockaddr_in
|
||||||
@@ -242,3 +250,33 @@ type BpfTimeval C.struct_bpf_timeval
|
|||||||
// Terminal handling
|
// Terminal handling
|
||||||
|
|
||||||
type Termios C.struct_termios
|
type Termios C.struct_termios
|
||||||
|
|
||||||
|
type Winsize C.struct_winsize
|
||||||
|
|
||||||
|
// fchmodat-like syscalls.
|
||||||
|
|
||||||
|
const (
|
||||||
|
AT_FDCWD = C.AT_FDCWD
|
||||||
|
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||||
|
)
|
||||||
|
|
||||||
|
// poll
|
||||||
|
|
||||||
|
type PollFd C.struct_pollfd
|
||||||
|
|
||||||
|
const (
|
||||||
|
POLLERR = C.POLLERR
|
||||||
|
POLLHUP = C.POLLHUP
|
||||||
|
POLLIN = C.POLLIN
|
||||||
|
POLLNVAL = C.POLLNVAL
|
||||||
|
POLLOUT = C.POLLOUT
|
||||||
|
POLLPRI = C.POLLPRI
|
||||||
|
POLLRDBAND = C.POLLRDBAND
|
||||||
|
POLLRDNORM = C.POLLRDNORM
|
||||||
|
POLLWRBAND = C.POLLWRBAND
|
||||||
|
POLLWRNORM = C.POLLWRNORM
|
||||||
|
)
|
||||||
|
|
||||||
|
// Uname
|
||||||
|
|
||||||
|
type Utsname C.struct_utsname
|
||||||
|
|||||||
+26
-5
@@ -5,7 +5,7 @@
|
|||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Input to cgo -godefs. See also mkerrors.sh and mkall.sh
|
Input to cgo -godefs. See README.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// +godefs map struct_in_addr [4]byte /* in_addr */
|
// +godefs map struct_in_addr [4]byte /* in_addr */
|
||||||
@@ -24,6 +24,7 @@ package unix
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <poll.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <termio.h>
|
#include <termio.h>
|
||||||
@@ -37,6 +38,7 @@ package unix
|
|||||||
#include <sys/signal.h>
|
#include <sys/signal.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <sys/statvfs.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/times.h>
|
#include <sys/times.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -139,6 +141,12 @@ type Flock_t C.struct_flock
|
|||||||
|
|
||||||
type Dirent C.struct_dirent
|
type Dirent C.struct_dirent
|
||||||
|
|
||||||
|
// Filesystems
|
||||||
|
|
||||||
|
type _Fsblkcnt_t C.fsblkcnt_t
|
||||||
|
|
||||||
|
type Statvfs_t C.struct_statvfs
|
||||||
|
|
||||||
// Sockets
|
// Sockets
|
||||||
|
|
||||||
type RawSockaddrInet4 C.struct_sockaddr_in
|
type RawSockaddrInet4 C.struct_sockaddr_in
|
||||||
@@ -249,10 +257,6 @@ type BpfTimeval C.struct_bpf_timeval
|
|||||||
|
|
||||||
type BpfHdr C.struct_bpf_hdr
|
type BpfHdr C.struct_bpf_hdr
|
||||||
|
|
||||||
// sysconf information
|
|
||||||
|
|
||||||
const _SC_PAGESIZE = C._SC_PAGESIZE
|
|
||||||
|
|
||||||
// Terminal handling
|
// Terminal handling
|
||||||
|
|
||||||
type Termios C.struct_termios
|
type Termios C.struct_termios
|
||||||
@@ -260,3 +264,20 @@ type Termios C.struct_termios
|
|||||||
type Termio C.struct_termio
|
type Termio C.struct_termio
|
||||||
|
|
||||||
type Winsize C.struct_winsize
|
type Winsize C.struct_winsize
|
||||||
|
|
||||||
|
// poll
|
||||||
|
|
||||||
|
type PollFd C.struct_pollfd
|
||||||
|
|
||||||
|
const (
|
||||||
|
POLLERR = C.POLLERR
|
||||||
|
POLLHUP = C.POLLHUP
|
||||||
|
POLLIN = C.POLLIN
|
||||||
|
POLLNVAL = C.POLLNVAL
|
||||||
|
POLLOUT = C.POLLOUT
|
||||||
|
POLLPRI = C.POLLPRI
|
||||||
|
POLLRDBAND = C.POLLRDBAND
|
||||||
|
POLLRDNORM = C.POLLRDNORM
|
||||||
|
POLLWRBAND = C.POLLWRBAND
|
||||||
|
POLLWRNORM = C.POLLWRNORM
|
||||||
|
)
|
||||||
|
|||||||
+196
-3
@@ -1,5 +1,5 @@
|
|||||||
// mkerrors.sh -m32
|
// mkerrors.sh -m32
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build 386,darwin
|
// +build 386,darwin
|
||||||
|
|
||||||
@@ -48,6 +48,87 @@ const (
|
|||||||
AF_UNIX = 0x1
|
AF_UNIX = 0x1
|
||||||
AF_UNSPEC = 0x0
|
AF_UNSPEC = 0x0
|
||||||
AF_UTUN = 0x26
|
AF_UTUN = 0x26
|
||||||
|
ALTWERASE = 0x200
|
||||||
|
ATTR_BIT_MAP_COUNT = 0x5
|
||||||
|
ATTR_CMN_ACCESSMASK = 0x20000
|
||||||
|
ATTR_CMN_ACCTIME = 0x1000
|
||||||
|
ATTR_CMN_ADDEDTIME = 0x10000000
|
||||||
|
ATTR_CMN_BKUPTIME = 0x2000
|
||||||
|
ATTR_CMN_CHGTIME = 0x800
|
||||||
|
ATTR_CMN_CRTIME = 0x200
|
||||||
|
ATTR_CMN_DATA_PROTECT_FLAGS = 0x40000000
|
||||||
|
ATTR_CMN_DEVID = 0x2
|
||||||
|
ATTR_CMN_DOCUMENT_ID = 0x100000
|
||||||
|
ATTR_CMN_ERROR = 0x20000000
|
||||||
|
ATTR_CMN_EXTENDED_SECURITY = 0x400000
|
||||||
|
ATTR_CMN_FILEID = 0x2000000
|
||||||
|
ATTR_CMN_FLAGS = 0x40000
|
||||||
|
ATTR_CMN_FNDRINFO = 0x4000
|
||||||
|
ATTR_CMN_FSID = 0x4
|
||||||
|
ATTR_CMN_FULLPATH = 0x8000000
|
||||||
|
ATTR_CMN_GEN_COUNT = 0x80000
|
||||||
|
ATTR_CMN_GRPID = 0x10000
|
||||||
|
ATTR_CMN_GRPUUID = 0x1000000
|
||||||
|
ATTR_CMN_MODTIME = 0x400
|
||||||
|
ATTR_CMN_NAME = 0x1
|
||||||
|
ATTR_CMN_NAMEDATTRCOUNT = 0x80000
|
||||||
|
ATTR_CMN_NAMEDATTRLIST = 0x100000
|
||||||
|
ATTR_CMN_OBJID = 0x20
|
||||||
|
ATTR_CMN_OBJPERMANENTID = 0x40
|
||||||
|
ATTR_CMN_OBJTAG = 0x10
|
||||||
|
ATTR_CMN_OBJTYPE = 0x8
|
||||||
|
ATTR_CMN_OWNERID = 0x8000
|
||||||
|
ATTR_CMN_PARENTID = 0x4000000
|
||||||
|
ATTR_CMN_PAROBJID = 0x80
|
||||||
|
ATTR_CMN_RETURNED_ATTRS = 0x80000000
|
||||||
|
ATTR_CMN_SCRIPT = 0x100
|
||||||
|
ATTR_CMN_SETMASK = 0x41c7ff00
|
||||||
|
ATTR_CMN_USERACCESS = 0x200000
|
||||||
|
ATTR_CMN_UUID = 0x800000
|
||||||
|
ATTR_CMN_VALIDMASK = 0xffffffff
|
||||||
|
ATTR_CMN_VOLSETMASK = 0x6700
|
||||||
|
ATTR_FILE_ALLOCSIZE = 0x4
|
||||||
|
ATTR_FILE_CLUMPSIZE = 0x10
|
||||||
|
ATTR_FILE_DATAALLOCSIZE = 0x400
|
||||||
|
ATTR_FILE_DATAEXTENTS = 0x800
|
||||||
|
ATTR_FILE_DATALENGTH = 0x200
|
||||||
|
ATTR_FILE_DEVTYPE = 0x20
|
||||||
|
ATTR_FILE_FILETYPE = 0x40
|
||||||
|
ATTR_FILE_FORKCOUNT = 0x80
|
||||||
|
ATTR_FILE_FORKLIST = 0x100
|
||||||
|
ATTR_FILE_IOBLOCKSIZE = 0x8
|
||||||
|
ATTR_FILE_LINKCOUNT = 0x1
|
||||||
|
ATTR_FILE_RSRCALLOCSIZE = 0x2000
|
||||||
|
ATTR_FILE_RSRCEXTENTS = 0x4000
|
||||||
|
ATTR_FILE_RSRCLENGTH = 0x1000
|
||||||
|
ATTR_FILE_SETMASK = 0x20
|
||||||
|
ATTR_FILE_TOTALSIZE = 0x2
|
||||||
|
ATTR_FILE_VALIDMASK = 0x37ff
|
||||||
|
ATTR_VOL_ALLOCATIONCLUMP = 0x40
|
||||||
|
ATTR_VOL_ATTRIBUTES = 0x40000000
|
||||||
|
ATTR_VOL_CAPABILITIES = 0x20000
|
||||||
|
ATTR_VOL_DIRCOUNT = 0x400
|
||||||
|
ATTR_VOL_ENCODINGSUSED = 0x10000
|
||||||
|
ATTR_VOL_FILECOUNT = 0x200
|
||||||
|
ATTR_VOL_FSTYPE = 0x1
|
||||||
|
ATTR_VOL_INFO = 0x80000000
|
||||||
|
ATTR_VOL_IOBLOCKSIZE = 0x80
|
||||||
|
ATTR_VOL_MAXOBJCOUNT = 0x800
|
||||||
|
ATTR_VOL_MINALLOCATION = 0x20
|
||||||
|
ATTR_VOL_MOUNTEDDEVICE = 0x8000
|
||||||
|
ATTR_VOL_MOUNTFLAGS = 0x4000
|
||||||
|
ATTR_VOL_MOUNTPOINT = 0x1000
|
||||||
|
ATTR_VOL_NAME = 0x2000
|
||||||
|
ATTR_VOL_OBJCOUNT = 0x100
|
||||||
|
ATTR_VOL_QUOTA_SIZE = 0x10000000
|
||||||
|
ATTR_VOL_RESERVED_SIZE = 0x20000000
|
||||||
|
ATTR_VOL_SETMASK = 0x80002000
|
||||||
|
ATTR_VOL_SIGNATURE = 0x2
|
||||||
|
ATTR_VOL_SIZE = 0x4
|
||||||
|
ATTR_VOL_SPACEAVAIL = 0x10
|
||||||
|
ATTR_VOL_SPACEFREE = 0x8
|
||||||
|
ATTR_VOL_UUID = 0x40000
|
||||||
|
ATTR_VOL_VALIDMASK = 0xf007ffff
|
||||||
B0 = 0x0
|
B0 = 0x0
|
||||||
B110 = 0x6e
|
B110 = 0x6e
|
||||||
B115200 = 0x1c200
|
B115200 = 0x1c200
|
||||||
@@ -138,9 +219,26 @@ const (
|
|||||||
BPF_W = 0x0
|
BPF_W = 0x0
|
||||||
BPF_X = 0x8
|
BPF_X = 0x8
|
||||||
BRKINT = 0x2
|
BRKINT = 0x2
|
||||||
|
BS0 = 0x0
|
||||||
|
BS1 = 0x8000
|
||||||
|
BSDLY = 0x8000
|
||||||
CFLUSH = 0xf
|
CFLUSH = 0xf
|
||||||
CLOCAL = 0x8000
|
CLOCAL = 0x8000
|
||||||
|
CLOCK_MONOTONIC = 0x6
|
||||||
|
CLOCK_MONOTONIC_RAW = 0x4
|
||||||
|
CLOCK_MONOTONIC_RAW_APPROX = 0x5
|
||||||
|
CLOCK_PROCESS_CPUTIME_ID = 0xc
|
||||||
|
CLOCK_REALTIME = 0x0
|
||||||
|
CLOCK_THREAD_CPUTIME_ID = 0x10
|
||||||
|
CLOCK_UPTIME_RAW = 0x8
|
||||||
|
CLOCK_UPTIME_RAW_APPROX = 0x9
|
||||||
|
CR0 = 0x0
|
||||||
|
CR1 = 0x1000
|
||||||
|
CR2 = 0x2000
|
||||||
|
CR3 = 0x3000
|
||||||
|
CRDLY = 0x3000
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
|
CRTSCTS = 0x30000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
CS6 = 0x100
|
CS6 = 0x100
|
||||||
CS7 = 0x200
|
CS7 = 0x200
|
||||||
@@ -151,6 +249,8 @@ const (
|
|||||||
CSTOP = 0x13
|
CSTOP = 0x13
|
||||||
CSTOPB = 0x400
|
CSTOPB = 0x400
|
||||||
CSUSP = 0x1a
|
CSUSP = 0x1a
|
||||||
|
CTL_HW = 0x6
|
||||||
|
CTL_KERN = 0x1
|
||||||
CTL_MAXNAME = 0xc
|
CTL_MAXNAME = 0xc
|
||||||
CTL_NET = 0x4
|
CTL_NET = 0x4
|
||||||
DLT_A429 = 0xb8
|
DLT_A429 = 0xb8
|
||||||
@@ -332,13 +432,14 @@ const (
|
|||||||
ECHONL = 0x10
|
ECHONL = 0x10
|
||||||
ECHOPRT = 0x20
|
ECHOPRT = 0x20
|
||||||
EVFILT_AIO = -0x3
|
EVFILT_AIO = -0x3
|
||||||
|
EVFILT_EXCEPT = -0xf
|
||||||
EVFILT_FS = -0x9
|
EVFILT_FS = -0x9
|
||||||
EVFILT_MACHPORT = -0x8
|
EVFILT_MACHPORT = -0x8
|
||||||
EVFILT_PROC = -0x5
|
EVFILT_PROC = -0x5
|
||||||
EVFILT_READ = -0x1
|
EVFILT_READ = -0x1
|
||||||
EVFILT_SIGNAL = -0x6
|
EVFILT_SIGNAL = -0x6
|
||||||
EVFILT_SYSCOUNT = 0xe
|
EVFILT_SYSCOUNT = 0xf
|
||||||
EVFILT_THREADMARKER = 0xe
|
EVFILT_THREADMARKER = 0xf
|
||||||
EVFILT_TIMER = -0x7
|
EVFILT_TIMER = -0x7
|
||||||
EVFILT_USER = -0xa
|
EVFILT_USER = -0xa
|
||||||
EVFILT_VM = -0xc
|
EVFILT_VM = -0xc
|
||||||
@@ -349,6 +450,7 @@ const (
|
|||||||
EV_DELETE = 0x2
|
EV_DELETE = 0x2
|
||||||
EV_DISABLE = 0x8
|
EV_DISABLE = 0x8
|
||||||
EV_DISPATCH = 0x80
|
EV_DISPATCH = 0x80
|
||||||
|
EV_DISPATCH2 = 0x180
|
||||||
EV_ENABLE = 0x4
|
EV_ENABLE = 0x4
|
||||||
EV_EOF = 0x8000
|
EV_EOF = 0x8000
|
||||||
EV_ERROR = 0x4000
|
EV_ERROR = 0x4000
|
||||||
@@ -359,16 +461,30 @@ const (
|
|||||||
EV_POLL = 0x1000
|
EV_POLL = 0x1000
|
||||||
EV_RECEIPT = 0x40
|
EV_RECEIPT = 0x40
|
||||||
EV_SYSFLAGS = 0xf000
|
EV_SYSFLAGS = 0xf000
|
||||||
|
EV_UDATA_SPECIFIC = 0x100
|
||||||
|
EV_VANISHED = 0x200
|
||||||
EXTA = 0x4b00
|
EXTA = 0x4b00
|
||||||
EXTB = 0x9600
|
EXTB = 0x9600
|
||||||
EXTPROC = 0x800
|
EXTPROC = 0x800
|
||||||
FD_CLOEXEC = 0x1
|
FD_CLOEXEC = 0x1
|
||||||
FD_SETSIZE = 0x400
|
FD_SETSIZE = 0x400
|
||||||
|
FF0 = 0x0
|
||||||
|
FF1 = 0x4000
|
||||||
|
FFDLY = 0x4000
|
||||||
FLUSHO = 0x800000
|
FLUSHO = 0x800000
|
||||||
|
FSOPT_ATTR_CMN_EXTENDED = 0x20
|
||||||
|
FSOPT_NOFOLLOW = 0x1
|
||||||
|
FSOPT_NOINMEMUPDATE = 0x2
|
||||||
|
FSOPT_PACK_INVAL_ATTRS = 0x8
|
||||||
|
FSOPT_REPORT_FULLSIZE = 0x4
|
||||||
F_ADDFILESIGS = 0x3d
|
F_ADDFILESIGS = 0x3d
|
||||||
|
F_ADDFILESIGS_FOR_DYLD_SIM = 0x53
|
||||||
|
F_ADDFILESIGS_RETURN = 0x61
|
||||||
F_ADDSIGS = 0x3b
|
F_ADDSIGS = 0x3b
|
||||||
F_ALLOCATEALL = 0x4
|
F_ALLOCATEALL = 0x4
|
||||||
F_ALLOCATECONTIG = 0x2
|
F_ALLOCATECONTIG = 0x2
|
||||||
|
F_BARRIERFSYNC = 0x55
|
||||||
|
F_CHECK_LV = 0x62
|
||||||
F_CHKCLEAN = 0x29
|
F_CHKCLEAN = 0x29
|
||||||
F_DUPFD = 0x0
|
F_DUPFD = 0x0
|
||||||
F_DUPFD_CLOEXEC = 0x43
|
F_DUPFD_CLOEXEC = 0x43
|
||||||
@@ -396,6 +512,7 @@ const (
|
|||||||
F_PATHPKG_CHECK = 0x34
|
F_PATHPKG_CHECK = 0x34
|
||||||
F_PEOFPOSMODE = 0x3
|
F_PEOFPOSMODE = 0x3
|
||||||
F_PREALLOCATE = 0x2a
|
F_PREALLOCATE = 0x2a
|
||||||
|
F_PUNCHHOLE = 0x63
|
||||||
F_RDADVISE = 0x2c
|
F_RDADVISE = 0x2c
|
||||||
F_RDAHEAD = 0x2d
|
F_RDAHEAD = 0x2d
|
||||||
F_RDLCK = 0x1
|
F_RDLCK = 0x1
|
||||||
@@ -412,10 +529,12 @@ const (
|
|||||||
F_SINGLE_WRITER = 0x4c
|
F_SINGLE_WRITER = 0x4c
|
||||||
F_THAW_FS = 0x36
|
F_THAW_FS = 0x36
|
||||||
F_TRANSCODEKEY = 0x4b
|
F_TRANSCODEKEY = 0x4b
|
||||||
|
F_TRIM_ACTIVE_FILE = 0x64
|
||||||
F_UNLCK = 0x2
|
F_UNLCK = 0x2
|
||||||
F_VOLPOSMODE = 0x4
|
F_VOLPOSMODE = 0x4
|
||||||
F_WRLCK = 0x3
|
F_WRLCK = 0x3
|
||||||
HUPCL = 0x4000
|
HUPCL = 0x4000
|
||||||
|
HW_MACHINE = 0x1
|
||||||
ICANON = 0x100
|
ICANON = 0x100
|
||||||
ICMP6_FILTER = 0x12
|
ICMP6_FILTER = 0x12
|
||||||
ICRNL = 0x100
|
ICRNL = 0x100
|
||||||
@@ -652,6 +771,7 @@ const (
|
|||||||
IPV6_FAITH = 0x1d
|
IPV6_FAITH = 0x1d
|
||||||
IPV6_FLOWINFO_MASK = 0xffffff0f
|
IPV6_FLOWINFO_MASK = 0xffffff0f
|
||||||
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
||||||
|
IPV6_FLOW_ECN_MASK = 0x300
|
||||||
IPV6_FRAGTTL = 0x3c
|
IPV6_FRAGTTL = 0x3c
|
||||||
IPV6_FW_ADD = 0x1e
|
IPV6_FW_ADD = 0x1e
|
||||||
IPV6_FW_DEL = 0x1f
|
IPV6_FW_DEL = 0x1f
|
||||||
@@ -742,6 +862,7 @@ const (
|
|||||||
IP_RECVOPTS = 0x5
|
IP_RECVOPTS = 0x5
|
||||||
IP_RECVPKTINFO = 0x1a
|
IP_RECVPKTINFO = 0x1a
|
||||||
IP_RECVRETOPTS = 0x6
|
IP_RECVRETOPTS = 0x6
|
||||||
|
IP_RECVTOS = 0x1b
|
||||||
IP_RECVTTL = 0x18
|
IP_RECVTTL = 0x18
|
||||||
IP_RETOPTS = 0x8
|
IP_RETOPTS = 0x8
|
||||||
IP_RF = 0x8000
|
IP_RF = 0x8000
|
||||||
@@ -760,6 +881,10 @@ const (
|
|||||||
IXANY = 0x800
|
IXANY = 0x800
|
||||||
IXOFF = 0x400
|
IXOFF = 0x400
|
||||||
IXON = 0x200
|
IXON = 0x200
|
||||||
|
KERN_HOSTNAME = 0xa
|
||||||
|
KERN_OSRELEASE = 0x2
|
||||||
|
KERN_OSTYPE = 0x1
|
||||||
|
KERN_VERSION = 0x4
|
||||||
LOCK_EX = 0x2
|
LOCK_EX = 0x2
|
||||||
LOCK_NB = 0x4
|
LOCK_NB = 0x4
|
||||||
LOCK_SH = 0x1
|
LOCK_SH = 0x1
|
||||||
@@ -770,11 +895,13 @@ const (
|
|||||||
MADV_FREE_REUSABLE = 0x7
|
MADV_FREE_REUSABLE = 0x7
|
||||||
MADV_FREE_REUSE = 0x8
|
MADV_FREE_REUSE = 0x8
|
||||||
MADV_NORMAL = 0x0
|
MADV_NORMAL = 0x0
|
||||||
|
MADV_PAGEOUT = 0xa
|
||||||
MADV_RANDOM = 0x1
|
MADV_RANDOM = 0x1
|
||||||
MADV_SEQUENTIAL = 0x2
|
MADV_SEQUENTIAL = 0x2
|
||||||
MADV_WILLNEED = 0x3
|
MADV_WILLNEED = 0x3
|
||||||
MADV_ZERO_WIRED_PAGES = 0x6
|
MADV_ZERO_WIRED_PAGES = 0x6
|
||||||
MAP_ANON = 0x1000
|
MAP_ANON = 0x1000
|
||||||
|
MAP_ANONYMOUS = 0x1000
|
||||||
MAP_COPY = 0x2
|
MAP_COPY = 0x2
|
||||||
MAP_FILE = 0x0
|
MAP_FILE = 0x0
|
||||||
MAP_FIXED = 0x10
|
MAP_FIXED = 0x10
|
||||||
@@ -786,9 +913,43 @@ const (
|
|||||||
MAP_PRIVATE = 0x2
|
MAP_PRIVATE = 0x2
|
||||||
MAP_RENAME = 0x20
|
MAP_RENAME = 0x20
|
||||||
MAP_RESERVED0080 = 0x80
|
MAP_RESERVED0080 = 0x80
|
||||||
|
MAP_RESILIENT_CODESIGN = 0x2000
|
||||||
|
MAP_RESILIENT_MEDIA = 0x4000
|
||||||
MAP_SHARED = 0x1
|
MAP_SHARED = 0x1
|
||||||
MCL_CURRENT = 0x1
|
MCL_CURRENT = 0x1
|
||||||
MCL_FUTURE = 0x2
|
MCL_FUTURE = 0x2
|
||||||
|
MNT_ASYNC = 0x40
|
||||||
|
MNT_AUTOMOUNTED = 0x400000
|
||||||
|
MNT_CMDFLAGS = 0xf0000
|
||||||
|
MNT_CPROTECT = 0x80
|
||||||
|
MNT_DEFWRITE = 0x2000000
|
||||||
|
MNT_DONTBROWSE = 0x100000
|
||||||
|
MNT_DOVOLFS = 0x8000
|
||||||
|
MNT_DWAIT = 0x4
|
||||||
|
MNT_EXPORTED = 0x100
|
||||||
|
MNT_FORCE = 0x80000
|
||||||
|
MNT_IGNORE_OWNERSHIP = 0x200000
|
||||||
|
MNT_JOURNALED = 0x800000
|
||||||
|
MNT_LOCAL = 0x1000
|
||||||
|
MNT_MULTILABEL = 0x4000000
|
||||||
|
MNT_NOATIME = 0x10000000
|
||||||
|
MNT_NOBLOCK = 0x20000
|
||||||
|
MNT_NODEV = 0x10
|
||||||
|
MNT_NOEXEC = 0x4
|
||||||
|
MNT_NOSUID = 0x8
|
||||||
|
MNT_NOUSERXATTR = 0x1000000
|
||||||
|
MNT_NOWAIT = 0x2
|
||||||
|
MNT_QUARANTINE = 0x400
|
||||||
|
MNT_QUOTA = 0x2000
|
||||||
|
MNT_RDONLY = 0x1
|
||||||
|
MNT_RELOAD = 0x40000
|
||||||
|
MNT_ROOTFS = 0x4000
|
||||||
|
MNT_SYNCHRONOUS = 0x2
|
||||||
|
MNT_UNION = 0x20
|
||||||
|
MNT_UNKNOWNPERMISSIONS = 0x200000
|
||||||
|
MNT_UPDATE = 0x10000
|
||||||
|
MNT_VISFLAGMASK = 0x17f0f5ff
|
||||||
|
MNT_WAIT = 0x1
|
||||||
MSG_CTRUNC = 0x20
|
MSG_CTRUNC = 0x20
|
||||||
MSG_DONTROUTE = 0x4
|
MSG_DONTROUTE = 0x4
|
||||||
MSG_DONTWAIT = 0x80
|
MSG_DONTWAIT = 0x80
|
||||||
@@ -819,7 +980,13 @@ const (
|
|||||||
NET_RT_MAXID = 0xa
|
NET_RT_MAXID = 0xa
|
||||||
NET_RT_STAT = 0x4
|
NET_RT_STAT = 0x4
|
||||||
NET_RT_TRASH = 0x5
|
NET_RT_TRASH = 0x5
|
||||||
|
NL0 = 0x0
|
||||||
|
NL1 = 0x100
|
||||||
|
NL2 = 0x200
|
||||||
|
NL3 = 0x300
|
||||||
|
NLDLY = 0x300
|
||||||
NOFLSH = 0x80000000
|
NOFLSH = 0x80000000
|
||||||
|
NOKERNINFO = 0x2000000
|
||||||
NOTE_ABSOLUTE = 0x8
|
NOTE_ABSOLUTE = 0x8
|
||||||
NOTE_ATTRIB = 0x8
|
NOTE_ATTRIB = 0x8
|
||||||
NOTE_BACKGROUND = 0x40
|
NOTE_BACKGROUND = 0x40
|
||||||
@@ -843,11 +1010,14 @@ const (
|
|||||||
NOTE_FFNOP = 0x0
|
NOTE_FFNOP = 0x0
|
||||||
NOTE_FFOR = 0x80000000
|
NOTE_FFOR = 0x80000000
|
||||||
NOTE_FORK = 0x40000000
|
NOTE_FORK = 0x40000000
|
||||||
|
NOTE_FUNLOCK = 0x100
|
||||||
NOTE_LEEWAY = 0x10
|
NOTE_LEEWAY = 0x10
|
||||||
NOTE_LINK = 0x10
|
NOTE_LINK = 0x10
|
||||||
NOTE_LOWAT = 0x1
|
NOTE_LOWAT = 0x1
|
||||||
|
NOTE_MACH_CONTINUOUS_TIME = 0x80
|
||||||
NOTE_NONE = 0x80
|
NOTE_NONE = 0x80
|
||||||
NOTE_NSECONDS = 0x4
|
NOTE_NSECONDS = 0x4
|
||||||
|
NOTE_OOB = 0x2
|
||||||
NOTE_PCTRLMASK = -0x100000
|
NOTE_PCTRLMASK = -0x100000
|
||||||
NOTE_PDATAMASK = 0xfffff
|
NOTE_PDATAMASK = 0xfffff
|
||||||
NOTE_REAP = 0x10000000
|
NOTE_REAP = 0x10000000
|
||||||
@@ -872,6 +1042,7 @@ const (
|
|||||||
ONOCR = 0x20
|
ONOCR = 0x20
|
||||||
ONOEOT = 0x8
|
ONOEOT = 0x8
|
||||||
OPOST = 0x1
|
OPOST = 0x1
|
||||||
|
OXTABS = 0x4
|
||||||
O_ACCMODE = 0x3
|
O_ACCMODE = 0x3
|
||||||
O_ALERT = 0x20000000
|
O_ALERT = 0x20000000
|
||||||
O_APPEND = 0x8
|
O_APPEND = 0x8
|
||||||
@@ -880,6 +1051,7 @@ const (
|
|||||||
O_CREAT = 0x200
|
O_CREAT = 0x200
|
||||||
O_DIRECTORY = 0x100000
|
O_DIRECTORY = 0x100000
|
||||||
O_DP_GETRAWENCRYPTED = 0x1
|
O_DP_GETRAWENCRYPTED = 0x1
|
||||||
|
O_DP_GETRAWUNENCRYPTED = 0x2
|
||||||
O_DSYNC = 0x400000
|
O_DSYNC = 0x400000
|
||||||
O_EVTONLY = 0x8000
|
O_EVTONLY = 0x8000
|
||||||
O_EXCL = 0x800
|
O_EXCL = 0x800
|
||||||
@@ -932,7 +1104,10 @@ const (
|
|||||||
RLIMIT_CPU_USAGE_MONITOR = 0x2
|
RLIMIT_CPU_USAGE_MONITOR = 0x2
|
||||||
RLIMIT_DATA = 0x2
|
RLIMIT_DATA = 0x2
|
||||||
RLIMIT_FSIZE = 0x1
|
RLIMIT_FSIZE = 0x1
|
||||||
|
RLIMIT_MEMLOCK = 0x6
|
||||||
RLIMIT_NOFILE = 0x8
|
RLIMIT_NOFILE = 0x8
|
||||||
|
RLIMIT_NPROC = 0x7
|
||||||
|
RLIMIT_RSS = 0x5
|
||||||
RLIMIT_STACK = 0x3
|
RLIMIT_STACK = 0x3
|
||||||
RLIM_INFINITY = 0x7fffffffffffffff
|
RLIM_INFINITY = 0x7fffffffffffffff
|
||||||
RTAX_AUTHOR = 0x6
|
RTAX_AUTHOR = 0x6
|
||||||
@@ -1102,6 +1277,8 @@ const (
|
|||||||
SO_LABEL = 0x1010
|
SO_LABEL = 0x1010
|
||||||
SO_LINGER = 0x80
|
SO_LINGER = 0x80
|
||||||
SO_LINGER_SEC = 0x1080
|
SO_LINGER_SEC = 0x1080
|
||||||
|
SO_NETSVC_MARKING_LEVEL = 0x1119
|
||||||
|
SO_NET_SERVICE_TYPE = 0x1116
|
||||||
SO_NKE = 0x1021
|
SO_NKE = 0x1021
|
||||||
SO_NOADDRERR = 0x1023
|
SO_NOADDRERR = 0x1023
|
||||||
SO_NOSIGPIPE = 0x1022
|
SO_NOSIGPIPE = 0x1022
|
||||||
@@ -1157,11 +1334,22 @@ const (
|
|||||||
S_IXGRP = 0x8
|
S_IXGRP = 0x8
|
||||||
S_IXOTH = 0x1
|
S_IXOTH = 0x1
|
||||||
S_IXUSR = 0x40
|
S_IXUSR = 0x40
|
||||||
|
TAB0 = 0x0
|
||||||
|
TAB1 = 0x400
|
||||||
|
TAB2 = 0x800
|
||||||
|
TAB3 = 0x4
|
||||||
|
TABDLY = 0xc04
|
||||||
TCIFLUSH = 0x1
|
TCIFLUSH = 0x1
|
||||||
|
TCIOFF = 0x3
|
||||||
TCIOFLUSH = 0x3
|
TCIOFLUSH = 0x3
|
||||||
|
TCION = 0x4
|
||||||
TCOFLUSH = 0x2
|
TCOFLUSH = 0x2
|
||||||
|
TCOOFF = 0x1
|
||||||
|
TCOON = 0x2
|
||||||
TCP_CONNECTIONTIMEOUT = 0x20
|
TCP_CONNECTIONTIMEOUT = 0x20
|
||||||
|
TCP_CONNECTION_INFO = 0x106
|
||||||
TCP_ENABLE_ECN = 0x104
|
TCP_ENABLE_ECN = 0x104
|
||||||
|
TCP_FASTOPEN = 0x105
|
||||||
TCP_KEEPALIVE = 0x10
|
TCP_KEEPALIVE = 0x10
|
||||||
TCP_KEEPCNT = 0x102
|
TCP_KEEPCNT = 0x102
|
||||||
TCP_KEEPINTVL = 0x101
|
TCP_KEEPINTVL = 0x101
|
||||||
@@ -1261,6 +1449,11 @@ const (
|
|||||||
VKILL = 0x5
|
VKILL = 0x5
|
||||||
VLNEXT = 0xe
|
VLNEXT = 0xe
|
||||||
VMIN = 0x10
|
VMIN = 0x10
|
||||||
|
VM_LOADAVG = 0x2
|
||||||
|
VM_MACHFACTOR = 0x4
|
||||||
|
VM_MAXID = 0x6
|
||||||
|
VM_METER = 0x1
|
||||||
|
VM_SWAPUSAGE = 0x5
|
||||||
VQUIT = 0x9
|
VQUIT = 0x9
|
||||||
VREPRINT = 0x6
|
VREPRINT = 0x6
|
||||||
VSTART = 0xc
|
VSTART = 0xc
|
||||||
|
|||||||
+196
-3
@@ -1,5 +1,5 @@
|
|||||||
// mkerrors.sh -m64
|
// mkerrors.sh -m64
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build amd64,darwin
|
// +build amd64,darwin
|
||||||
|
|
||||||
@@ -48,6 +48,87 @@ const (
|
|||||||
AF_UNIX = 0x1
|
AF_UNIX = 0x1
|
||||||
AF_UNSPEC = 0x0
|
AF_UNSPEC = 0x0
|
||||||
AF_UTUN = 0x26
|
AF_UTUN = 0x26
|
||||||
|
ALTWERASE = 0x200
|
||||||
|
ATTR_BIT_MAP_COUNT = 0x5
|
||||||
|
ATTR_CMN_ACCESSMASK = 0x20000
|
||||||
|
ATTR_CMN_ACCTIME = 0x1000
|
||||||
|
ATTR_CMN_ADDEDTIME = 0x10000000
|
||||||
|
ATTR_CMN_BKUPTIME = 0x2000
|
||||||
|
ATTR_CMN_CHGTIME = 0x800
|
||||||
|
ATTR_CMN_CRTIME = 0x200
|
||||||
|
ATTR_CMN_DATA_PROTECT_FLAGS = 0x40000000
|
||||||
|
ATTR_CMN_DEVID = 0x2
|
||||||
|
ATTR_CMN_DOCUMENT_ID = 0x100000
|
||||||
|
ATTR_CMN_ERROR = 0x20000000
|
||||||
|
ATTR_CMN_EXTENDED_SECURITY = 0x400000
|
||||||
|
ATTR_CMN_FILEID = 0x2000000
|
||||||
|
ATTR_CMN_FLAGS = 0x40000
|
||||||
|
ATTR_CMN_FNDRINFO = 0x4000
|
||||||
|
ATTR_CMN_FSID = 0x4
|
||||||
|
ATTR_CMN_FULLPATH = 0x8000000
|
||||||
|
ATTR_CMN_GEN_COUNT = 0x80000
|
||||||
|
ATTR_CMN_GRPID = 0x10000
|
||||||
|
ATTR_CMN_GRPUUID = 0x1000000
|
||||||
|
ATTR_CMN_MODTIME = 0x400
|
||||||
|
ATTR_CMN_NAME = 0x1
|
||||||
|
ATTR_CMN_NAMEDATTRCOUNT = 0x80000
|
||||||
|
ATTR_CMN_NAMEDATTRLIST = 0x100000
|
||||||
|
ATTR_CMN_OBJID = 0x20
|
||||||
|
ATTR_CMN_OBJPERMANENTID = 0x40
|
||||||
|
ATTR_CMN_OBJTAG = 0x10
|
||||||
|
ATTR_CMN_OBJTYPE = 0x8
|
||||||
|
ATTR_CMN_OWNERID = 0x8000
|
||||||
|
ATTR_CMN_PARENTID = 0x4000000
|
||||||
|
ATTR_CMN_PAROBJID = 0x80
|
||||||
|
ATTR_CMN_RETURNED_ATTRS = 0x80000000
|
||||||
|
ATTR_CMN_SCRIPT = 0x100
|
||||||
|
ATTR_CMN_SETMASK = 0x41c7ff00
|
||||||
|
ATTR_CMN_USERACCESS = 0x200000
|
||||||
|
ATTR_CMN_UUID = 0x800000
|
||||||
|
ATTR_CMN_VALIDMASK = 0xffffffff
|
||||||
|
ATTR_CMN_VOLSETMASK = 0x6700
|
||||||
|
ATTR_FILE_ALLOCSIZE = 0x4
|
||||||
|
ATTR_FILE_CLUMPSIZE = 0x10
|
||||||
|
ATTR_FILE_DATAALLOCSIZE = 0x400
|
||||||
|
ATTR_FILE_DATAEXTENTS = 0x800
|
||||||
|
ATTR_FILE_DATALENGTH = 0x200
|
||||||
|
ATTR_FILE_DEVTYPE = 0x20
|
||||||
|
ATTR_FILE_FILETYPE = 0x40
|
||||||
|
ATTR_FILE_FORKCOUNT = 0x80
|
||||||
|
ATTR_FILE_FORKLIST = 0x100
|
||||||
|
ATTR_FILE_IOBLOCKSIZE = 0x8
|
||||||
|
ATTR_FILE_LINKCOUNT = 0x1
|
||||||
|
ATTR_FILE_RSRCALLOCSIZE = 0x2000
|
||||||
|
ATTR_FILE_RSRCEXTENTS = 0x4000
|
||||||
|
ATTR_FILE_RSRCLENGTH = 0x1000
|
||||||
|
ATTR_FILE_SETMASK = 0x20
|
||||||
|
ATTR_FILE_TOTALSIZE = 0x2
|
||||||
|
ATTR_FILE_VALIDMASK = 0x37ff
|
||||||
|
ATTR_VOL_ALLOCATIONCLUMP = 0x40
|
||||||
|
ATTR_VOL_ATTRIBUTES = 0x40000000
|
||||||
|
ATTR_VOL_CAPABILITIES = 0x20000
|
||||||
|
ATTR_VOL_DIRCOUNT = 0x400
|
||||||
|
ATTR_VOL_ENCODINGSUSED = 0x10000
|
||||||
|
ATTR_VOL_FILECOUNT = 0x200
|
||||||
|
ATTR_VOL_FSTYPE = 0x1
|
||||||
|
ATTR_VOL_INFO = 0x80000000
|
||||||
|
ATTR_VOL_IOBLOCKSIZE = 0x80
|
||||||
|
ATTR_VOL_MAXOBJCOUNT = 0x800
|
||||||
|
ATTR_VOL_MINALLOCATION = 0x20
|
||||||
|
ATTR_VOL_MOUNTEDDEVICE = 0x8000
|
||||||
|
ATTR_VOL_MOUNTFLAGS = 0x4000
|
||||||
|
ATTR_VOL_MOUNTPOINT = 0x1000
|
||||||
|
ATTR_VOL_NAME = 0x2000
|
||||||
|
ATTR_VOL_OBJCOUNT = 0x100
|
||||||
|
ATTR_VOL_QUOTA_SIZE = 0x10000000
|
||||||
|
ATTR_VOL_RESERVED_SIZE = 0x20000000
|
||||||
|
ATTR_VOL_SETMASK = 0x80002000
|
||||||
|
ATTR_VOL_SIGNATURE = 0x2
|
||||||
|
ATTR_VOL_SIZE = 0x4
|
||||||
|
ATTR_VOL_SPACEAVAIL = 0x10
|
||||||
|
ATTR_VOL_SPACEFREE = 0x8
|
||||||
|
ATTR_VOL_UUID = 0x40000
|
||||||
|
ATTR_VOL_VALIDMASK = 0xf007ffff
|
||||||
B0 = 0x0
|
B0 = 0x0
|
||||||
B110 = 0x6e
|
B110 = 0x6e
|
||||||
B115200 = 0x1c200
|
B115200 = 0x1c200
|
||||||
@@ -138,9 +219,26 @@ const (
|
|||||||
BPF_W = 0x0
|
BPF_W = 0x0
|
||||||
BPF_X = 0x8
|
BPF_X = 0x8
|
||||||
BRKINT = 0x2
|
BRKINT = 0x2
|
||||||
|
BS0 = 0x0
|
||||||
|
BS1 = 0x8000
|
||||||
|
BSDLY = 0x8000
|
||||||
CFLUSH = 0xf
|
CFLUSH = 0xf
|
||||||
CLOCAL = 0x8000
|
CLOCAL = 0x8000
|
||||||
|
CLOCK_MONOTONIC = 0x6
|
||||||
|
CLOCK_MONOTONIC_RAW = 0x4
|
||||||
|
CLOCK_MONOTONIC_RAW_APPROX = 0x5
|
||||||
|
CLOCK_PROCESS_CPUTIME_ID = 0xc
|
||||||
|
CLOCK_REALTIME = 0x0
|
||||||
|
CLOCK_THREAD_CPUTIME_ID = 0x10
|
||||||
|
CLOCK_UPTIME_RAW = 0x8
|
||||||
|
CLOCK_UPTIME_RAW_APPROX = 0x9
|
||||||
|
CR0 = 0x0
|
||||||
|
CR1 = 0x1000
|
||||||
|
CR2 = 0x2000
|
||||||
|
CR3 = 0x3000
|
||||||
|
CRDLY = 0x3000
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
|
CRTSCTS = 0x30000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
CS6 = 0x100
|
CS6 = 0x100
|
||||||
CS7 = 0x200
|
CS7 = 0x200
|
||||||
@@ -151,6 +249,8 @@ const (
|
|||||||
CSTOP = 0x13
|
CSTOP = 0x13
|
||||||
CSTOPB = 0x400
|
CSTOPB = 0x400
|
||||||
CSUSP = 0x1a
|
CSUSP = 0x1a
|
||||||
|
CTL_HW = 0x6
|
||||||
|
CTL_KERN = 0x1
|
||||||
CTL_MAXNAME = 0xc
|
CTL_MAXNAME = 0xc
|
||||||
CTL_NET = 0x4
|
CTL_NET = 0x4
|
||||||
DLT_A429 = 0xb8
|
DLT_A429 = 0xb8
|
||||||
@@ -332,13 +432,14 @@ const (
|
|||||||
ECHONL = 0x10
|
ECHONL = 0x10
|
||||||
ECHOPRT = 0x20
|
ECHOPRT = 0x20
|
||||||
EVFILT_AIO = -0x3
|
EVFILT_AIO = -0x3
|
||||||
|
EVFILT_EXCEPT = -0xf
|
||||||
EVFILT_FS = -0x9
|
EVFILT_FS = -0x9
|
||||||
EVFILT_MACHPORT = -0x8
|
EVFILT_MACHPORT = -0x8
|
||||||
EVFILT_PROC = -0x5
|
EVFILT_PROC = -0x5
|
||||||
EVFILT_READ = -0x1
|
EVFILT_READ = -0x1
|
||||||
EVFILT_SIGNAL = -0x6
|
EVFILT_SIGNAL = -0x6
|
||||||
EVFILT_SYSCOUNT = 0xe
|
EVFILT_SYSCOUNT = 0xf
|
||||||
EVFILT_THREADMARKER = 0xe
|
EVFILT_THREADMARKER = 0xf
|
||||||
EVFILT_TIMER = -0x7
|
EVFILT_TIMER = -0x7
|
||||||
EVFILT_USER = -0xa
|
EVFILT_USER = -0xa
|
||||||
EVFILT_VM = -0xc
|
EVFILT_VM = -0xc
|
||||||
@@ -349,6 +450,7 @@ const (
|
|||||||
EV_DELETE = 0x2
|
EV_DELETE = 0x2
|
||||||
EV_DISABLE = 0x8
|
EV_DISABLE = 0x8
|
||||||
EV_DISPATCH = 0x80
|
EV_DISPATCH = 0x80
|
||||||
|
EV_DISPATCH2 = 0x180
|
||||||
EV_ENABLE = 0x4
|
EV_ENABLE = 0x4
|
||||||
EV_EOF = 0x8000
|
EV_EOF = 0x8000
|
||||||
EV_ERROR = 0x4000
|
EV_ERROR = 0x4000
|
||||||
@@ -359,16 +461,30 @@ const (
|
|||||||
EV_POLL = 0x1000
|
EV_POLL = 0x1000
|
||||||
EV_RECEIPT = 0x40
|
EV_RECEIPT = 0x40
|
||||||
EV_SYSFLAGS = 0xf000
|
EV_SYSFLAGS = 0xf000
|
||||||
|
EV_UDATA_SPECIFIC = 0x100
|
||||||
|
EV_VANISHED = 0x200
|
||||||
EXTA = 0x4b00
|
EXTA = 0x4b00
|
||||||
EXTB = 0x9600
|
EXTB = 0x9600
|
||||||
EXTPROC = 0x800
|
EXTPROC = 0x800
|
||||||
FD_CLOEXEC = 0x1
|
FD_CLOEXEC = 0x1
|
||||||
FD_SETSIZE = 0x400
|
FD_SETSIZE = 0x400
|
||||||
|
FF0 = 0x0
|
||||||
|
FF1 = 0x4000
|
||||||
|
FFDLY = 0x4000
|
||||||
FLUSHO = 0x800000
|
FLUSHO = 0x800000
|
||||||
|
FSOPT_ATTR_CMN_EXTENDED = 0x20
|
||||||
|
FSOPT_NOFOLLOW = 0x1
|
||||||
|
FSOPT_NOINMEMUPDATE = 0x2
|
||||||
|
FSOPT_PACK_INVAL_ATTRS = 0x8
|
||||||
|
FSOPT_REPORT_FULLSIZE = 0x4
|
||||||
F_ADDFILESIGS = 0x3d
|
F_ADDFILESIGS = 0x3d
|
||||||
|
F_ADDFILESIGS_FOR_DYLD_SIM = 0x53
|
||||||
|
F_ADDFILESIGS_RETURN = 0x61
|
||||||
F_ADDSIGS = 0x3b
|
F_ADDSIGS = 0x3b
|
||||||
F_ALLOCATEALL = 0x4
|
F_ALLOCATEALL = 0x4
|
||||||
F_ALLOCATECONTIG = 0x2
|
F_ALLOCATECONTIG = 0x2
|
||||||
|
F_BARRIERFSYNC = 0x55
|
||||||
|
F_CHECK_LV = 0x62
|
||||||
F_CHKCLEAN = 0x29
|
F_CHKCLEAN = 0x29
|
||||||
F_DUPFD = 0x0
|
F_DUPFD = 0x0
|
||||||
F_DUPFD_CLOEXEC = 0x43
|
F_DUPFD_CLOEXEC = 0x43
|
||||||
@@ -396,6 +512,7 @@ const (
|
|||||||
F_PATHPKG_CHECK = 0x34
|
F_PATHPKG_CHECK = 0x34
|
||||||
F_PEOFPOSMODE = 0x3
|
F_PEOFPOSMODE = 0x3
|
||||||
F_PREALLOCATE = 0x2a
|
F_PREALLOCATE = 0x2a
|
||||||
|
F_PUNCHHOLE = 0x63
|
||||||
F_RDADVISE = 0x2c
|
F_RDADVISE = 0x2c
|
||||||
F_RDAHEAD = 0x2d
|
F_RDAHEAD = 0x2d
|
||||||
F_RDLCK = 0x1
|
F_RDLCK = 0x1
|
||||||
@@ -412,10 +529,12 @@ const (
|
|||||||
F_SINGLE_WRITER = 0x4c
|
F_SINGLE_WRITER = 0x4c
|
||||||
F_THAW_FS = 0x36
|
F_THAW_FS = 0x36
|
||||||
F_TRANSCODEKEY = 0x4b
|
F_TRANSCODEKEY = 0x4b
|
||||||
|
F_TRIM_ACTIVE_FILE = 0x64
|
||||||
F_UNLCK = 0x2
|
F_UNLCK = 0x2
|
||||||
F_VOLPOSMODE = 0x4
|
F_VOLPOSMODE = 0x4
|
||||||
F_WRLCK = 0x3
|
F_WRLCK = 0x3
|
||||||
HUPCL = 0x4000
|
HUPCL = 0x4000
|
||||||
|
HW_MACHINE = 0x1
|
||||||
ICANON = 0x100
|
ICANON = 0x100
|
||||||
ICMP6_FILTER = 0x12
|
ICMP6_FILTER = 0x12
|
||||||
ICRNL = 0x100
|
ICRNL = 0x100
|
||||||
@@ -652,6 +771,7 @@ const (
|
|||||||
IPV6_FAITH = 0x1d
|
IPV6_FAITH = 0x1d
|
||||||
IPV6_FLOWINFO_MASK = 0xffffff0f
|
IPV6_FLOWINFO_MASK = 0xffffff0f
|
||||||
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
||||||
|
IPV6_FLOW_ECN_MASK = 0x300
|
||||||
IPV6_FRAGTTL = 0x3c
|
IPV6_FRAGTTL = 0x3c
|
||||||
IPV6_FW_ADD = 0x1e
|
IPV6_FW_ADD = 0x1e
|
||||||
IPV6_FW_DEL = 0x1f
|
IPV6_FW_DEL = 0x1f
|
||||||
@@ -742,6 +862,7 @@ const (
|
|||||||
IP_RECVOPTS = 0x5
|
IP_RECVOPTS = 0x5
|
||||||
IP_RECVPKTINFO = 0x1a
|
IP_RECVPKTINFO = 0x1a
|
||||||
IP_RECVRETOPTS = 0x6
|
IP_RECVRETOPTS = 0x6
|
||||||
|
IP_RECVTOS = 0x1b
|
||||||
IP_RECVTTL = 0x18
|
IP_RECVTTL = 0x18
|
||||||
IP_RETOPTS = 0x8
|
IP_RETOPTS = 0x8
|
||||||
IP_RF = 0x8000
|
IP_RF = 0x8000
|
||||||
@@ -760,6 +881,10 @@ const (
|
|||||||
IXANY = 0x800
|
IXANY = 0x800
|
||||||
IXOFF = 0x400
|
IXOFF = 0x400
|
||||||
IXON = 0x200
|
IXON = 0x200
|
||||||
|
KERN_HOSTNAME = 0xa
|
||||||
|
KERN_OSRELEASE = 0x2
|
||||||
|
KERN_OSTYPE = 0x1
|
||||||
|
KERN_VERSION = 0x4
|
||||||
LOCK_EX = 0x2
|
LOCK_EX = 0x2
|
||||||
LOCK_NB = 0x4
|
LOCK_NB = 0x4
|
||||||
LOCK_SH = 0x1
|
LOCK_SH = 0x1
|
||||||
@@ -770,11 +895,13 @@ const (
|
|||||||
MADV_FREE_REUSABLE = 0x7
|
MADV_FREE_REUSABLE = 0x7
|
||||||
MADV_FREE_REUSE = 0x8
|
MADV_FREE_REUSE = 0x8
|
||||||
MADV_NORMAL = 0x0
|
MADV_NORMAL = 0x0
|
||||||
|
MADV_PAGEOUT = 0xa
|
||||||
MADV_RANDOM = 0x1
|
MADV_RANDOM = 0x1
|
||||||
MADV_SEQUENTIAL = 0x2
|
MADV_SEQUENTIAL = 0x2
|
||||||
MADV_WILLNEED = 0x3
|
MADV_WILLNEED = 0x3
|
||||||
MADV_ZERO_WIRED_PAGES = 0x6
|
MADV_ZERO_WIRED_PAGES = 0x6
|
||||||
MAP_ANON = 0x1000
|
MAP_ANON = 0x1000
|
||||||
|
MAP_ANONYMOUS = 0x1000
|
||||||
MAP_COPY = 0x2
|
MAP_COPY = 0x2
|
||||||
MAP_FILE = 0x0
|
MAP_FILE = 0x0
|
||||||
MAP_FIXED = 0x10
|
MAP_FIXED = 0x10
|
||||||
@@ -786,9 +913,43 @@ const (
|
|||||||
MAP_PRIVATE = 0x2
|
MAP_PRIVATE = 0x2
|
||||||
MAP_RENAME = 0x20
|
MAP_RENAME = 0x20
|
||||||
MAP_RESERVED0080 = 0x80
|
MAP_RESERVED0080 = 0x80
|
||||||
|
MAP_RESILIENT_CODESIGN = 0x2000
|
||||||
|
MAP_RESILIENT_MEDIA = 0x4000
|
||||||
MAP_SHARED = 0x1
|
MAP_SHARED = 0x1
|
||||||
MCL_CURRENT = 0x1
|
MCL_CURRENT = 0x1
|
||||||
MCL_FUTURE = 0x2
|
MCL_FUTURE = 0x2
|
||||||
|
MNT_ASYNC = 0x40
|
||||||
|
MNT_AUTOMOUNTED = 0x400000
|
||||||
|
MNT_CMDFLAGS = 0xf0000
|
||||||
|
MNT_CPROTECT = 0x80
|
||||||
|
MNT_DEFWRITE = 0x2000000
|
||||||
|
MNT_DONTBROWSE = 0x100000
|
||||||
|
MNT_DOVOLFS = 0x8000
|
||||||
|
MNT_DWAIT = 0x4
|
||||||
|
MNT_EXPORTED = 0x100
|
||||||
|
MNT_FORCE = 0x80000
|
||||||
|
MNT_IGNORE_OWNERSHIP = 0x200000
|
||||||
|
MNT_JOURNALED = 0x800000
|
||||||
|
MNT_LOCAL = 0x1000
|
||||||
|
MNT_MULTILABEL = 0x4000000
|
||||||
|
MNT_NOATIME = 0x10000000
|
||||||
|
MNT_NOBLOCK = 0x20000
|
||||||
|
MNT_NODEV = 0x10
|
||||||
|
MNT_NOEXEC = 0x4
|
||||||
|
MNT_NOSUID = 0x8
|
||||||
|
MNT_NOUSERXATTR = 0x1000000
|
||||||
|
MNT_NOWAIT = 0x2
|
||||||
|
MNT_QUARANTINE = 0x400
|
||||||
|
MNT_QUOTA = 0x2000
|
||||||
|
MNT_RDONLY = 0x1
|
||||||
|
MNT_RELOAD = 0x40000
|
||||||
|
MNT_ROOTFS = 0x4000
|
||||||
|
MNT_SYNCHRONOUS = 0x2
|
||||||
|
MNT_UNION = 0x20
|
||||||
|
MNT_UNKNOWNPERMISSIONS = 0x200000
|
||||||
|
MNT_UPDATE = 0x10000
|
||||||
|
MNT_VISFLAGMASK = 0x17f0f5ff
|
||||||
|
MNT_WAIT = 0x1
|
||||||
MSG_CTRUNC = 0x20
|
MSG_CTRUNC = 0x20
|
||||||
MSG_DONTROUTE = 0x4
|
MSG_DONTROUTE = 0x4
|
||||||
MSG_DONTWAIT = 0x80
|
MSG_DONTWAIT = 0x80
|
||||||
@@ -819,7 +980,13 @@ const (
|
|||||||
NET_RT_MAXID = 0xa
|
NET_RT_MAXID = 0xa
|
||||||
NET_RT_STAT = 0x4
|
NET_RT_STAT = 0x4
|
||||||
NET_RT_TRASH = 0x5
|
NET_RT_TRASH = 0x5
|
||||||
|
NL0 = 0x0
|
||||||
|
NL1 = 0x100
|
||||||
|
NL2 = 0x200
|
||||||
|
NL3 = 0x300
|
||||||
|
NLDLY = 0x300
|
||||||
NOFLSH = 0x80000000
|
NOFLSH = 0x80000000
|
||||||
|
NOKERNINFO = 0x2000000
|
||||||
NOTE_ABSOLUTE = 0x8
|
NOTE_ABSOLUTE = 0x8
|
||||||
NOTE_ATTRIB = 0x8
|
NOTE_ATTRIB = 0x8
|
||||||
NOTE_BACKGROUND = 0x40
|
NOTE_BACKGROUND = 0x40
|
||||||
@@ -843,11 +1010,14 @@ const (
|
|||||||
NOTE_FFNOP = 0x0
|
NOTE_FFNOP = 0x0
|
||||||
NOTE_FFOR = 0x80000000
|
NOTE_FFOR = 0x80000000
|
||||||
NOTE_FORK = 0x40000000
|
NOTE_FORK = 0x40000000
|
||||||
|
NOTE_FUNLOCK = 0x100
|
||||||
NOTE_LEEWAY = 0x10
|
NOTE_LEEWAY = 0x10
|
||||||
NOTE_LINK = 0x10
|
NOTE_LINK = 0x10
|
||||||
NOTE_LOWAT = 0x1
|
NOTE_LOWAT = 0x1
|
||||||
|
NOTE_MACH_CONTINUOUS_TIME = 0x80
|
||||||
NOTE_NONE = 0x80
|
NOTE_NONE = 0x80
|
||||||
NOTE_NSECONDS = 0x4
|
NOTE_NSECONDS = 0x4
|
||||||
|
NOTE_OOB = 0x2
|
||||||
NOTE_PCTRLMASK = -0x100000
|
NOTE_PCTRLMASK = -0x100000
|
||||||
NOTE_PDATAMASK = 0xfffff
|
NOTE_PDATAMASK = 0xfffff
|
||||||
NOTE_REAP = 0x10000000
|
NOTE_REAP = 0x10000000
|
||||||
@@ -872,6 +1042,7 @@ const (
|
|||||||
ONOCR = 0x20
|
ONOCR = 0x20
|
||||||
ONOEOT = 0x8
|
ONOEOT = 0x8
|
||||||
OPOST = 0x1
|
OPOST = 0x1
|
||||||
|
OXTABS = 0x4
|
||||||
O_ACCMODE = 0x3
|
O_ACCMODE = 0x3
|
||||||
O_ALERT = 0x20000000
|
O_ALERT = 0x20000000
|
||||||
O_APPEND = 0x8
|
O_APPEND = 0x8
|
||||||
@@ -880,6 +1051,7 @@ const (
|
|||||||
O_CREAT = 0x200
|
O_CREAT = 0x200
|
||||||
O_DIRECTORY = 0x100000
|
O_DIRECTORY = 0x100000
|
||||||
O_DP_GETRAWENCRYPTED = 0x1
|
O_DP_GETRAWENCRYPTED = 0x1
|
||||||
|
O_DP_GETRAWUNENCRYPTED = 0x2
|
||||||
O_DSYNC = 0x400000
|
O_DSYNC = 0x400000
|
||||||
O_EVTONLY = 0x8000
|
O_EVTONLY = 0x8000
|
||||||
O_EXCL = 0x800
|
O_EXCL = 0x800
|
||||||
@@ -932,7 +1104,10 @@ const (
|
|||||||
RLIMIT_CPU_USAGE_MONITOR = 0x2
|
RLIMIT_CPU_USAGE_MONITOR = 0x2
|
||||||
RLIMIT_DATA = 0x2
|
RLIMIT_DATA = 0x2
|
||||||
RLIMIT_FSIZE = 0x1
|
RLIMIT_FSIZE = 0x1
|
||||||
|
RLIMIT_MEMLOCK = 0x6
|
||||||
RLIMIT_NOFILE = 0x8
|
RLIMIT_NOFILE = 0x8
|
||||||
|
RLIMIT_NPROC = 0x7
|
||||||
|
RLIMIT_RSS = 0x5
|
||||||
RLIMIT_STACK = 0x3
|
RLIMIT_STACK = 0x3
|
||||||
RLIM_INFINITY = 0x7fffffffffffffff
|
RLIM_INFINITY = 0x7fffffffffffffff
|
||||||
RTAX_AUTHOR = 0x6
|
RTAX_AUTHOR = 0x6
|
||||||
@@ -1102,6 +1277,8 @@ const (
|
|||||||
SO_LABEL = 0x1010
|
SO_LABEL = 0x1010
|
||||||
SO_LINGER = 0x80
|
SO_LINGER = 0x80
|
||||||
SO_LINGER_SEC = 0x1080
|
SO_LINGER_SEC = 0x1080
|
||||||
|
SO_NETSVC_MARKING_LEVEL = 0x1119
|
||||||
|
SO_NET_SERVICE_TYPE = 0x1116
|
||||||
SO_NKE = 0x1021
|
SO_NKE = 0x1021
|
||||||
SO_NOADDRERR = 0x1023
|
SO_NOADDRERR = 0x1023
|
||||||
SO_NOSIGPIPE = 0x1022
|
SO_NOSIGPIPE = 0x1022
|
||||||
@@ -1157,11 +1334,22 @@ const (
|
|||||||
S_IXGRP = 0x8
|
S_IXGRP = 0x8
|
||||||
S_IXOTH = 0x1
|
S_IXOTH = 0x1
|
||||||
S_IXUSR = 0x40
|
S_IXUSR = 0x40
|
||||||
|
TAB0 = 0x0
|
||||||
|
TAB1 = 0x400
|
||||||
|
TAB2 = 0x800
|
||||||
|
TAB3 = 0x4
|
||||||
|
TABDLY = 0xc04
|
||||||
TCIFLUSH = 0x1
|
TCIFLUSH = 0x1
|
||||||
|
TCIOFF = 0x3
|
||||||
TCIOFLUSH = 0x3
|
TCIOFLUSH = 0x3
|
||||||
|
TCION = 0x4
|
||||||
TCOFLUSH = 0x2
|
TCOFLUSH = 0x2
|
||||||
|
TCOOFF = 0x1
|
||||||
|
TCOON = 0x2
|
||||||
TCP_CONNECTIONTIMEOUT = 0x20
|
TCP_CONNECTIONTIMEOUT = 0x20
|
||||||
|
TCP_CONNECTION_INFO = 0x106
|
||||||
TCP_ENABLE_ECN = 0x104
|
TCP_ENABLE_ECN = 0x104
|
||||||
|
TCP_FASTOPEN = 0x105
|
||||||
TCP_KEEPALIVE = 0x10
|
TCP_KEEPALIVE = 0x10
|
||||||
TCP_KEEPCNT = 0x102
|
TCP_KEEPCNT = 0x102
|
||||||
TCP_KEEPINTVL = 0x101
|
TCP_KEEPINTVL = 0x101
|
||||||
@@ -1261,6 +1449,11 @@ const (
|
|||||||
VKILL = 0x5
|
VKILL = 0x5
|
||||||
VLNEXT = 0xe
|
VLNEXT = 0xe
|
||||||
VMIN = 0x10
|
VMIN = 0x10
|
||||||
|
VM_LOADAVG = 0x2
|
||||||
|
VM_MACHFACTOR = 0x4
|
||||||
|
VM_MAXID = 0x6
|
||||||
|
VM_METER = 0x1
|
||||||
|
VM_SWAPUSAGE = 0x5
|
||||||
VQUIT = 0x9
|
VQUIT = 0x9
|
||||||
VREPRINT = 0x6
|
VREPRINT = 0x6
|
||||||
VSTART = 0xc
|
VSTART = 0xc
|
||||||
|
|||||||
+482
-6
@@ -1,11 +1,11 @@
|
|||||||
// mkerrors.sh
|
// mkerrors.sh
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
|
// +build arm,darwin
|
||||||
|
|
||||||
// Created by cgo -godefs - DO NOT EDIT
|
// Created by cgo -godefs - DO NOT EDIT
|
||||||
// cgo -godefs -- _const.go
|
// cgo -godefs -- _const.go
|
||||||
|
|
||||||
// +build arm,darwin
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
import "syscall"
|
import "syscall"
|
||||||
@@ -48,6 +48,87 @@ const (
|
|||||||
AF_UNIX = 0x1
|
AF_UNIX = 0x1
|
||||||
AF_UNSPEC = 0x0
|
AF_UNSPEC = 0x0
|
||||||
AF_UTUN = 0x26
|
AF_UTUN = 0x26
|
||||||
|
ALTWERASE = 0x200
|
||||||
|
ATTR_BIT_MAP_COUNT = 0x5
|
||||||
|
ATTR_CMN_ACCESSMASK = 0x20000
|
||||||
|
ATTR_CMN_ACCTIME = 0x1000
|
||||||
|
ATTR_CMN_ADDEDTIME = 0x10000000
|
||||||
|
ATTR_CMN_BKUPTIME = 0x2000
|
||||||
|
ATTR_CMN_CHGTIME = 0x800
|
||||||
|
ATTR_CMN_CRTIME = 0x200
|
||||||
|
ATTR_CMN_DATA_PROTECT_FLAGS = 0x40000000
|
||||||
|
ATTR_CMN_DEVID = 0x2
|
||||||
|
ATTR_CMN_DOCUMENT_ID = 0x100000
|
||||||
|
ATTR_CMN_ERROR = 0x20000000
|
||||||
|
ATTR_CMN_EXTENDED_SECURITY = 0x400000
|
||||||
|
ATTR_CMN_FILEID = 0x2000000
|
||||||
|
ATTR_CMN_FLAGS = 0x40000
|
||||||
|
ATTR_CMN_FNDRINFO = 0x4000
|
||||||
|
ATTR_CMN_FSID = 0x4
|
||||||
|
ATTR_CMN_FULLPATH = 0x8000000
|
||||||
|
ATTR_CMN_GEN_COUNT = 0x80000
|
||||||
|
ATTR_CMN_GRPID = 0x10000
|
||||||
|
ATTR_CMN_GRPUUID = 0x1000000
|
||||||
|
ATTR_CMN_MODTIME = 0x400
|
||||||
|
ATTR_CMN_NAME = 0x1
|
||||||
|
ATTR_CMN_NAMEDATTRCOUNT = 0x80000
|
||||||
|
ATTR_CMN_NAMEDATTRLIST = 0x100000
|
||||||
|
ATTR_CMN_OBJID = 0x20
|
||||||
|
ATTR_CMN_OBJPERMANENTID = 0x40
|
||||||
|
ATTR_CMN_OBJTAG = 0x10
|
||||||
|
ATTR_CMN_OBJTYPE = 0x8
|
||||||
|
ATTR_CMN_OWNERID = 0x8000
|
||||||
|
ATTR_CMN_PARENTID = 0x4000000
|
||||||
|
ATTR_CMN_PAROBJID = 0x80
|
||||||
|
ATTR_CMN_RETURNED_ATTRS = 0x80000000
|
||||||
|
ATTR_CMN_SCRIPT = 0x100
|
||||||
|
ATTR_CMN_SETMASK = 0x41c7ff00
|
||||||
|
ATTR_CMN_USERACCESS = 0x200000
|
||||||
|
ATTR_CMN_UUID = 0x800000
|
||||||
|
ATTR_CMN_VALIDMASK = 0xffffffff
|
||||||
|
ATTR_CMN_VOLSETMASK = 0x6700
|
||||||
|
ATTR_FILE_ALLOCSIZE = 0x4
|
||||||
|
ATTR_FILE_CLUMPSIZE = 0x10
|
||||||
|
ATTR_FILE_DATAALLOCSIZE = 0x400
|
||||||
|
ATTR_FILE_DATAEXTENTS = 0x800
|
||||||
|
ATTR_FILE_DATALENGTH = 0x200
|
||||||
|
ATTR_FILE_DEVTYPE = 0x20
|
||||||
|
ATTR_FILE_FILETYPE = 0x40
|
||||||
|
ATTR_FILE_FORKCOUNT = 0x80
|
||||||
|
ATTR_FILE_FORKLIST = 0x100
|
||||||
|
ATTR_FILE_IOBLOCKSIZE = 0x8
|
||||||
|
ATTR_FILE_LINKCOUNT = 0x1
|
||||||
|
ATTR_FILE_RSRCALLOCSIZE = 0x2000
|
||||||
|
ATTR_FILE_RSRCEXTENTS = 0x4000
|
||||||
|
ATTR_FILE_RSRCLENGTH = 0x1000
|
||||||
|
ATTR_FILE_SETMASK = 0x20
|
||||||
|
ATTR_FILE_TOTALSIZE = 0x2
|
||||||
|
ATTR_FILE_VALIDMASK = 0x37ff
|
||||||
|
ATTR_VOL_ALLOCATIONCLUMP = 0x40
|
||||||
|
ATTR_VOL_ATTRIBUTES = 0x40000000
|
||||||
|
ATTR_VOL_CAPABILITIES = 0x20000
|
||||||
|
ATTR_VOL_DIRCOUNT = 0x400
|
||||||
|
ATTR_VOL_ENCODINGSUSED = 0x10000
|
||||||
|
ATTR_VOL_FILECOUNT = 0x200
|
||||||
|
ATTR_VOL_FSTYPE = 0x1
|
||||||
|
ATTR_VOL_INFO = 0x80000000
|
||||||
|
ATTR_VOL_IOBLOCKSIZE = 0x80
|
||||||
|
ATTR_VOL_MAXOBJCOUNT = 0x800
|
||||||
|
ATTR_VOL_MINALLOCATION = 0x20
|
||||||
|
ATTR_VOL_MOUNTEDDEVICE = 0x8000
|
||||||
|
ATTR_VOL_MOUNTFLAGS = 0x4000
|
||||||
|
ATTR_VOL_MOUNTPOINT = 0x1000
|
||||||
|
ATTR_VOL_NAME = 0x2000
|
||||||
|
ATTR_VOL_OBJCOUNT = 0x100
|
||||||
|
ATTR_VOL_QUOTA_SIZE = 0x10000000
|
||||||
|
ATTR_VOL_RESERVED_SIZE = 0x20000000
|
||||||
|
ATTR_VOL_SETMASK = 0x80002000
|
||||||
|
ATTR_VOL_SIGNATURE = 0x2
|
||||||
|
ATTR_VOL_SIZE = 0x4
|
||||||
|
ATTR_VOL_SPACEAVAIL = 0x10
|
||||||
|
ATTR_VOL_SPACEFREE = 0x8
|
||||||
|
ATTR_VOL_UUID = 0x40000
|
||||||
|
ATTR_VOL_VALIDMASK = 0xf007ffff
|
||||||
B0 = 0x0
|
B0 = 0x0
|
||||||
B110 = 0x6e
|
B110 = 0x6e
|
||||||
B115200 = 0x1c200
|
B115200 = 0x1c200
|
||||||
@@ -86,6 +167,7 @@ const (
|
|||||||
BIOCSBLEN = 0xc0044266
|
BIOCSBLEN = 0xc0044266
|
||||||
BIOCSDLT = 0x80044278
|
BIOCSDLT = 0x80044278
|
||||||
BIOCSETF = 0x80104267
|
BIOCSETF = 0x80104267
|
||||||
|
BIOCSETFNR = 0x8010427e
|
||||||
BIOCSETIF = 0x8020426c
|
BIOCSETIF = 0x8020426c
|
||||||
BIOCSHDRCMPLT = 0x80044275
|
BIOCSHDRCMPLT = 0x80044275
|
||||||
BIOCSRSIG = 0x80044273
|
BIOCSRSIG = 0x80044273
|
||||||
@@ -137,9 +219,26 @@ const (
|
|||||||
BPF_W = 0x0
|
BPF_W = 0x0
|
||||||
BPF_X = 0x8
|
BPF_X = 0x8
|
||||||
BRKINT = 0x2
|
BRKINT = 0x2
|
||||||
|
BS0 = 0x0
|
||||||
|
BS1 = 0x8000
|
||||||
|
BSDLY = 0x8000
|
||||||
CFLUSH = 0xf
|
CFLUSH = 0xf
|
||||||
CLOCAL = 0x8000
|
CLOCAL = 0x8000
|
||||||
|
CLOCK_MONOTONIC = 0x6
|
||||||
|
CLOCK_MONOTONIC_RAW = 0x4
|
||||||
|
CLOCK_MONOTONIC_RAW_APPROX = 0x5
|
||||||
|
CLOCK_PROCESS_CPUTIME_ID = 0xc
|
||||||
|
CLOCK_REALTIME = 0x0
|
||||||
|
CLOCK_THREAD_CPUTIME_ID = 0x10
|
||||||
|
CLOCK_UPTIME_RAW = 0x8
|
||||||
|
CLOCK_UPTIME_RAW_APPROX = 0x9
|
||||||
|
CR0 = 0x0
|
||||||
|
CR1 = 0x1000
|
||||||
|
CR2 = 0x2000
|
||||||
|
CR3 = 0x3000
|
||||||
|
CRDLY = 0x3000
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
|
CRTSCTS = 0x30000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
CS6 = 0x100
|
CS6 = 0x100
|
||||||
CS7 = 0x200
|
CS7 = 0x200
|
||||||
@@ -150,35 +249,172 @@ const (
|
|||||||
CSTOP = 0x13
|
CSTOP = 0x13
|
||||||
CSTOPB = 0x400
|
CSTOPB = 0x400
|
||||||
CSUSP = 0x1a
|
CSUSP = 0x1a
|
||||||
|
CTL_HW = 0x6
|
||||||
|
CTL_KERN = 0x1
|
||||||
CTL_MAXNAME = 0xc
|
CTL_MAXNAME = 0xc
|
||||||
CTL_NET = 0x4
|
CTL_NET = 0x4
|
||||||
|
DLT_A429 = 0xb8
|
||||||
|
DLT_A653_ICM = 0xb9
|
||||||
|
DLT_AIRONET_HEADER = 0x78
|
||||||
|
DLT_AOS = 0xde
|
||||||
DLT_APPLE_IP_OVER_IEEE1394 = 0x8a
|
DLT_APPLE_IP_OVER_IEEE1394 = 0x8a
|
||||||
DLT_ARCNET = 0x7
|
DLT_ARCNET = 0x7
|
||||||
|
DLT_ARCNET_LINUX = 0x81
|
||||||
DLT_ATM_CLIP = 0x13
|
DLT_ATM_CLIP = 0x13
|
||||||
DLT_ATM_RFC1483 = 0xb
|
DLT_ATM_RFC1483 = 0xb
|
||||||
|
DLT_AURORA = 0x7e
|
||||||
DLT_AX25 = 0x3
|
DLT_AX25 = 0x3
|
||||||
|
DLT_AX25_KISS = 0xca
|
||||||
|
DLT_BACNET_MS_TP = 0xa5
|
||||||
|
DLT_BLUETOOTH_HCI_H4 = 0xbb
|
||||||
|
DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9
|
||||||
|
DLT_CAN20B = 0xbe
|
||||||
|
DLT_CAN_SOCKETCAN = 0xe3
|
||||||
DLT_CHAOS = 0x5
|
DLT_CHAOS = 0x5
|
||||||
DLT_CHDLC = 0x68
|
DLT_CHDLC = 0x68
|
||||||
|
DLT_CISCO_IOS = 0x76
|
||||||
DLT_C_HDLC = 0x68
|
DLT_C_HDLC = 0x68
|
||||||
|
DLT_C_HDLC_WITH_DIR = 0xcd
|
||||||
|
DLT_DBUS = 0xe7
|
||||||
|
DLT_DECT = 0xdd
|
||||||
|
DLT_DOCSIS = 0x8f
|
||||||
|
DLT_DVB_CI = 0xeb
|
||||||
|
DLT_ECONET = 0x73
|
||||||
DLT_EN10MB = 0x1
|
DLT_EN10MB = 0x1
|
||||||
DLT_EN3MB = 0x2
|
DLT_EN3MB = 0x2
|
||||||
|
DLT_ENC = 0x6d
|
||||||
|
DLT_ERF = 0xc5
|
||||||
|
DLT_ERF_ETH = 0xaf
|
||||||
|
DLT_ERF_POS = 0xb0
|
||||||
|
DLT_FC_2 = 0xe0
|
||||||
|
DLT_FC_2_WITH_FRAME_DELIMS = 0xe1
|
||||||
DLT_FDDI = 0xa
|
DLT_FDDI = 0xa
|
||||||
|
DLT_FLEXRAY = 0xd2
|
||||||
|
DLT_FRELAY = 0x6b
|
||||||
|
DLT_FRELAY_WITH_DIR = 0xce
|
||||||
|
DLT_GCOM_SERIAL = 0xad
|
||||||
|
DLT_GCOM_T1E1 = 0xac
|
||||||
|
DLT_GPF_F = 0xab
|
||||||
|
DLT_GPF_T = 0xaa
|
||||||
|
DLT_GPRS_LLC = 0xa9
|
||||||
|
DLT_GSMTAP_ABIS = 0xda
|
||||||
|
DLT_GSMTAP_UM = 0xd9
|
||||||
|
DLT_HHDLC = 0x79
|
||||||
|
DLT_IBM_SN = 0x92
|
||||||
|
DLT_IBM_SP = 0x91
|
||||||
DLT_IEEE802 = 0x6
|
DLT_IEEE802 = 0x6
|
||||||
DLT_IEEE802_11 = 0x69
|
DLT_IEEE802_11 = 0x69
|
||||||
DLT_IEEE802_11_RADIO = 0x7f
|
DLT_IEEE802_11_RADIO = 0x7f
|
||||||
DLT_IEEE802_11_RADIO_AVS = 0xa3
|
DLT_IEEE802_11_RADIO_AVS = 0xa3
|
||||||
|
DLT_IEEE802_15_4 = 0xc3
|
||||||
|
DLT_IEEE802_15_4_LINUX = 0xbf
|
||||||
|
DLT_IEEE802_15_4_NOFCS = 0xe6
|
||||||
|
DLT_IEEE802_15_4_NONASK_PHY = 0xd7
|
||||||
|
DLT_IEEE802_16_MAC_CPS = 0xbc
|
||||||
|
DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1
|
||||||
|
DLT_IPFILTER = 0x74
|
||||||
|
DLT_IPMB = 0xc7
|
||||||
|
DLT_IPMB_LINUX = 0xd1
|
||||||
|
DLT_IPNET = 0xe2
|
||||||
|
DLT_IPOIB = 0xf2
|
||||||
|
DLT_IPV4 = 0xe4
|
||||||
|
DLT_IPV6 = 0xe5
|
||||||
|
DLT_IP_OVER_FC = 0x7a
|
||||||
|
DLT_JUNIPER_ATM1 = 0x89
|
||||||
|
DLT_JUNIPER_ATM2 = 0x87
|
||||||
|
DLT_JUNIPER_ATM_CEMIC = 0xee
|
||||||
|
DLT_JUNIPER_CHDLC = 0xb5
|
||||||
|
DLT_JUNIPER_ES = 0x84
|
||||||
|
DLT_JUNIPER_ETHER = 0xb2
|
||||||
|
DLT_JUNIPER_FIBRECHANNEL = 0xea
|
||||||
|
DLT_JUNIPER_FRELAY = 0xb4
|
||||||
|
DLT_JUNIPER_GGSN = 0x85
|
||||||
|
DLT_JUNIPER_ISM = 0xc2
|
||||||
|
DLT_JUNIPER_MFR = 0x86
|
||||||
|
DLT_JUNIPER_MLFR = 0x83
|
||||||
|
DLT_JUNIPER_MLPPP = 0x82
|
||||||
|
DLT_JUNIPER_MONITOR = 0xa4
|
||||||
|
DLT_JUNIPER_PIC_PEER = 0xae
|
||||||
|
DLT_JUNIPER_PPP = 0xb3
|
||||||
|
DLT_JUNIPER_PPPOE = 0xa7
|
||||||
|
DLT_JUNIPER_PPPOE_ATM = 0xa8
|
||||||
|
DLT_JUNIPER_SERVICES = 0x88
|
||||||
|
DLT_JUNIPER_SRX_E2E = 0xe9
|
||||||
|
DLT_JUNIPER_ST = 0xc8
|
||||||
|
DLT_JUNIPER_VP = 0xb7
|
||||||
|
DLT_JUNIPER_VS = 0xe8
|
||||||
|
DLT_LAPB_WITH_DIR = 0xcf
|
||||||
|
DLT_LAPD = 0xcb
|
||||||
|
DLT_LIN = 0xd4
|
||||||
|
DLT_LINUX_EVDEV = 0xd8
|
||||||
|
DLT_LINUX_IRDA = 0x90
|
||||||
|
DLT_LINUX_LAPD = 0xb1
|
||||||
|
DLT_LINUX_PPP_WITHDIRECTION = 0xa6
|
||||||
DLT_LINUX_SLL = 0x71
|
DLT_LINUX_SLL = 0x71
|
||||||
DLT_LOOP = 0x6c
|
DLT_LOOP = 0x6c
|
||||||
|
DLT_LTALK = 0x72
|
||||||
|
DLT_MATCHING_MAX = 0xf5
|
||||||
|
DLT_MATCHING_MIN = 0x68
|
||||||
|
DLT_MFR = 0xb6
|
||||||
|
DLT_MOST = 0xd3
|
||||||
|
DLT_MPEG_2_TS = 0xf3
|
||||||
|
DLT_MPLS = 0xdb
|
||||||
|
DLT_MTP2 = 0x8c
|
||||||
|
DLT_MTP2_WITH_PHDR = 0x8b
|
||||||
|
DLT_MTP3 = 0x8d
|
||||||
|
DLT_MUX27010 = 0xec
|
||||||
|
DLT_NETANALYZER = 0xf0
|
||||||
|
DLT_NETANALYZER_TRANSPARENT = 0xf1
|
||||||
|
DLT_NFC_LLCP = 0xf5
|
||||||
|
DLT_NFLOG = 0xef
|
||||||
|
DLT_NG40 = 0xf4
|
||||||
DLT_NULL = 0x0
|
DLT_NULL = 0x0
|
||||||
|
DLT_PCI_EXP = 0x7d
|
||||||
DLT_PFLOG = 0x75
|
DLT_PFLOG = 0x75
|
||||||
DLT_PFSYNC = 0x12
|
DLT_PFSYNC = 0x12
|
||||||
|
DLT_PPI = 0xc0
|
||||||
DLT_PPP = 0x9
|
DLT_PPP = 0x9
|
||||||
DLT_PPP_BSDOS = 0x10
|
DLT_PPP_BSDOS = 0x10
|
||||||
|
DLT_PPP_ETHER = 0x33
|
||||||
|
DLT_PPP_PPPD = 0xa6
|
||||||
DLT_PPP_SERIAL = 0x32
|
DLT_PPP_SERIAL = 0x32
|
||||||
|
DLT_PPP_WITH_DIR = 0xcc
|
||||||
|
DLT_PPP_WITH_DIRECTION = 0xa6
|
||||||
|
DLT_PRISM_HEADER = 0x77
|
||||||
DLT_PRONET = 0x4
|
DLT_PRONET = 0x4
|
||||||
|
DLT_RAIF1 = 0xc6
|
||||||
DLT_RAW = 0xc
|
DLT_RAW = 0xc
|
||||||
|
DLT_RIO = 0x7c
|
||||||
|
DLT_SCCP = 0x8e
|
||||||
|
DLT_SITA = 0xc4
|
||||||
DLT_SLIP = 0x8
|
DLT_SLIP = 0x8
|
||||||
DLT_SLIP_BSDOS = 0xf
|
DLT_SLIP_BSDOS = 0xf
|
||||||
|
DLT_STANAG_5066_D_PDU = 0xed
|
||||||
|
DLT_SUNATM = 0x7b
|
||||||
|
DLT_SYMANTEC_FIREWALL = 0x63
|
||||||
|
DLT_TZSP = 0x80
|
||||||
|
DLT_USB = 0xba
|
||||||
|
DLT_USB_LINUX = 0xbd
|
||||||
|
DLT_USB_LINUX_MMAPPED = 0xdc
|
||||||
|
DLT_USER0 = 0x93
|
||||||
|
DLT_USER1 = 0x94
|
||||||
|
DLT_USER10 = 0x9d
|
||||||
|
DLT_USER11 = 0x9e
|
||||||
|
DLT_USER12 = 0x9f
|
||||||
|
DLT_USER13 = 0xa0
|
||||||
|
DLT_USER14 = 0xa1
|
||||||
|
DLT_USER15 = 0xa2
|
||||||
|
DLT_USER2 = 0x95
|
||||||
|
DLT_USER3 = 0x96
|
||||||
|
DLT_USER4 = 0x97
|
||||||
|
DLT_USER5 = 0x98
|
||||||
|
DLT_USER6 = 0x99
|
||||||
|
DLT_USER7 = 0x9a
|
||||||
|
DLT_USER8 = 0x9b
|
||||||
|
DLT_USER9 = 0x9c
|
||||||
|
DLT_WIHART = 0xdf
|
||||||
|
DLT_X2E_SERIAL = 0xd5
|
||||||
|
DLT_X2E_XORAYA = 0xd6
|
||||||
DT_BLK = 0x6
|
DT_BLK = 0x6
|
||||||
DT_CHR = 0x2
|
DT_CHR = 0x2
|
||||||
DT_DIR = 0x4
|
DT_DIR = 0x4
|
||||||
@@ -196,13 +432,14 @@ const (
|
|||||||
ECHONL = 0x10
|
ECHONL = 0x10
|
||||||
ECHOPRT = 0x20
|
ECHOPRT = 0x20
|
||||||
EVFILT_AIO = -0x3
|
EVFILT_AIO = -0x3
|
||||||
|
EVFILT_EXCEPT = -0xf
|
||||||
EVFILT_FS = -0x9
|
EVFILT_FS = -0x9
|
||||||
EVFILT_MACHPORT = -0x8
|
EVFILT_MACHPORT = -0x8
|
||||||
EVFILT_PROC = -0x5
|
EVFILT_PROC = -0x5
|
||||||
EVFILT_READ = -0x1
|
EVFILT_READ = -0x1
|
||||||
EVFILT_SIGNAL = -0x6
|
EVFILT_SIGNAL = -0x6
|
||||||
EVFILT_SYSCOUNT = 0xe
|
EVFILT_SYSCOUNT = 0xf
|
||||||
EVFILT_THREADMARKER = 0xe
|
EVFILT_THREADMARKER = 0xf
|
||||||
EVFILT_TIMER = -0x7
|
EVFILT_TIMER = -0x7
|
||||||
EVFILT_USER = -0xa
|
EVFILT_USER = -0xa
|
||||||
EVFILT_VM = -0xc
|
EVFILT_VM = -0xc
|
||||||
@@ -213,6 +450,7 @@ const (
|
|||||||
EV_DELETE = 0x2
|
EV_DELETE = 0x2
|
||||||
EV_DISABLE = 0x8
|
EV_DISABLE = 0x8
|
||||||
EV_DISPATCH = 0x80
|
EV_DISPATCH = 0x80
|
||||||
|
EV_DISPATCH2 = 0x180
|
||||||
EV_ENABLE = 0x4
|
EV_ENABLE = 0x4
|
||||||
EV_EOF = 0x8000
|
EV_EOF = 0x8000
|
||||||
EV_ERROR = 0x4000
|
EV_ERROR = 0x4000
|
||||||
@@ -223,16 +461,30 @@ const (
|
|||||||
EV_POLL = 0x1000
|
EV_POLL = 0x1000
|
||||||
EV_RECEIPT = 0x40
|
EV_RECEIPT = 0x40
|
||||||
EV_SYSFLAGS = 0xf000
|
EV_SYSFLAGS = 0xf000
|
||||||
|
EV_UDATA_SPECIFIC = 0x100
|
||||||
|
EV_VANISHED = 0x200
|
||||||
EXTA = 0x4b00
|
EXTA = 0x4b00
|
||||||
EXTB = 0x9600
|
EXTB = 0x9600
|
||||||
EXTPROC = 0x800
|
EXTPROC = 0x800
|
||||||
FD_CLOEXEC = 0x1
|
FD_CLOEXEC = 0x1
|
||||||
FD_SETSIZE = 0x400
|
FD_SETSIZE = 0x400
|
||||||
|
FF0 = 0x0
|
||||||
|
FF1 = 0x4000
|
||||||
|
FFDLY = 0x4000
|
||||||
FLUSHO = 0x800000
|
FLUSHO = 0x800000
|
||||||
|
FSOPT_ATTR_CMN_EXTENDED = 0x20
|
||||||
|
FSOPT_NOFOLLOW = 0x1
|
||||||
|
FSOPT_NOINMEMUPDATE = 0x2
|
||||||
|
FSOPT_PACK_INVAL_ATTRS = 0x8
|
||||||
|
FSOPT_REPORT_FULLSIZE = 0x4
|
||||||
F_ADDFILESIGS = 0x3d
|
F_ADDFILESIGS = 0x3d
|
||||||
|
F_ADDFILESIGS_FOR_DYLD_SIM = 0x53
|
||||||
|
F_ADDFILESIGS_RETURN = 0x61
|
||||||
F_ADDSIGS = 0x3b
|
F_ADDSIGS = 0x3b
|
||||||
F_ALLOCATEALL = 0x4
|
F_ALLOCATEALL = 0x4
|
||||||
F_ALLOCATECONTIG = 0x2
|
F_ALLOCATECONTIG = 0x2
|
||||||
|
F_BARRIERFSYNC = 0x55
|
||||||
|
F_CHECK_LV = 0x62
|
||||||
F_CHKCLEAN = 0x29
|
F_CHKCLEAN = 0x29
|
||||||
F_DUPFD = 0x0
|
F_DUPFD = 0x0
|
||||||
F_DUPFD_CLOEXEC = 0x43
|
F_DUPFD_CLOEXEC = 0x43
|
||||||
@@ -260,6 +512,7 @@ const (
|
|||||||
F_PATHPKG_CHECK = 0x34
|
F_PATHPKG_CHECK = 0x34
|
||||||
F_PEOFPOSMODE = 0x3
|
F_PEOFPOSMODE = 0x3
|
||||||
F_PREALLOCATE = 0x2a
|
F_PREALLOCATE = 0x2a
|
||||||
|
F_PUNCHHOLE = 0x63
|
||||||
F_RDADVISE = 0x2c
|
F_RDADVISE = 0x2c
|
||||||
F_RDAHEAD = 0x2d
|
F_RDAHEAD = 0x2d
|
||||||
F_RDLCK = 0x1
|
F_RDLCK = 0x1
|
||||||
@@ -276,10 +529,12 @@ const (
|
|||||||
F_SINGLE_WRITER = 0x4c
|
F_SINGLE_WRITER = 0x4c
|
||||||
F_THAW_FS = 0x36
|
F_THAW_FS = 0x36
|
||||||
F_TRANSCODEKEY = 0x4b
|
F_TRANSCODEKEY = 0x4b
|
||||||
|
F_TRIM_ACTIVE_FILE = 0x64
|
||||||
F_UNLCK = 0x2
|
F_UNLCK = 0x2
|
||||||
F_VOLPOSMODE = 0x4
|
F_VOLPOSMODE = 0x4
|
||||||
F_WRLCK = 0x3
|
F_WRLCK = 0x3
|
||||||
HUPCL = 0x4000
|
HUPCL = 0x4000
|
||||||
|
HW_MACHINE = 0x1
|
||||||
ICANON = 0x100
|
ICANON = 0x100
|
||||||
ICMP6_FILTER = 0x12
|
ICMP6_FILTER = 0x12
|
||||||
ICRNL = 0x100
|
ICRNL = 0x100
|
||||||
@@ -347,6 +602,7 @@ const (
|
|||||||
IFT_PDP = 0xff
|
IFT_PDP = 0xff
|
||||||
IFT_PFLOG = 0xf5
|
IFT_PFLOG = 0xf5
|
||||||
IFT_PFSYNC = 0xf6
|
IFT_PFSYNC = 0xf6
|
||||||
|
IFT_PKTAP = 0xfe
|
||||||
IFT_PPP = 0x17
|
IFT_PPP = 0x17
|
||||||
IFT_PROPMUX = 0x36
|
IFT_PROPMUX = 0x36
|
||||||
IFT_PROPVIRTUAL = 0x35
|
IFT_PROPVIRTUAL = 0x35
|
||||||
@@ -515,7 +771,8 @@ const (
|
|||||||
IPV6_FAITH = 0x1d
|
IPV6_FAITH = 0x1d
|
||||||
IPV6_FLOWINFO_MASK = 0xffffff0f
|
IPV6_FLOWINFO_MASK = 0xffffff0f
|
||||||
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
||||||
IPV6_FRAGTTL = 0x78
|
IPV6_FLOW_ECN_MASK = 0x300
|
||||||
|
IPV6_FRAGTTL = 0x3c
|
||||||
IPV6_FW_ADD = 0x1e
|
IPV6_FW_ADD = 0x1e
|
||||||
IPV6_FW_DEL = 0x1f
|
IPV6_FW_DEL = 0x1f
|
||||||
IPV6_FW_FLUSH = 0x20
|
IPV6_FW_FLUSH = 0x20
|
||||||
@@ -605,6 +862,7 @@ const (
|
|||||||
IP_RECVOPTS = 0x5
|
IP_RECVOPTS = 0x5
|
||||||
IP_RECVPKTINFO = 0x1a
|
IP_RECVPKTINFO = 0x1a
|
||||||
IP_RECVRETOPTS = 0x6
|
IP_RECVRETOPTS = 0x6
|
||||||
|
IP_RECVTOS = 0x1b
|
||||||
IP_RECVTTL = 0x18
|
IP_RECVTTL = 0x18
|
||||||
IP_RETOPTS = 0x8
|
IP_RETOPTS = 0x8
|
||||||
IP_RF = 0x8000
|
IP_RF = 0x8000
|
||||||
@@ -623,6 +881,10 @@ const (
|
|||||||
IXANY = 0x800
|
IXANY = 0x800
|
||||||
IXOFF = 0x400
|
IXOFF = 0x400
|
||||||
IXON = 0x200
|
IXON = 0x200
|
||||||
|
KERN_HOSTNAME = 0xa
|
||||||
|
KERN_OSRELEASE = 0x2
|
||||||
|
KERN_OSTYPE = 0x1
|
||||||
|
KERN_VERSION = 0x4
|
||||||
LOCK_EX = 0x2
|
LOCK_EX = 0x2
|
||||||
LOCK_NB = 0x4
|
LOCK_NB = 0x4
|
||||||
LOCK_SH = 0x1
|
LOCK_SH = 0x1
|
||||||
@@ -633,11 +895,13 @@ const (
|
|||||||
MADV_FREE_REUSABLE = 0x7
|
MADV_FREE_REUSABLE = 0x7
|
||||||
MADV_FREE_REUSE = 0x8
|
MADV_FREE_REUSE = 0x8
|
||||||
MADV_NORMAL = 0x0
|
MADV_NORMAL = 0x0
|
||||||
|
MADV_PAGEOUT = 0xa
|
||||||
MADV_RANDOM = 0x1
|
MADV_RANDOM = 0x1
|
||||||
MADV_SEQUENTIAL = 0x2
|
MADV_SEQUENTIAL = 0x2
|
||||||
MADV_WILLNEED = 0x3
|
MADV_WILLNEED = 0x3
|
||||||
MADV_ZERO_WIRED_PAGES = 0x6
|
MADV_ZERO_WIRED_PAGES = 0x6
|
||||||
MAP_ANON = 0x1000
|
MAP_ANON = 0x1000
|
||||||
|
MAP_ANONYMOUS = 0x1000
|
||||||
MAP_COPY = 0x2
|
MAP_COPY = 0x2
|
||||||
MAP_FILE = 0x0
|
MAP_FILE = 0x0
|
||||||
MAP_FIXED = 0x10
|
MAP_FIXED = 0x10
|
||||||
@@ -649,9 +913,43 @@ const (
|
|||||||
MAP_PRIVATE = 0x2
|
MAP_PRIVATE = 0x2
|
||||||
MAP_RENAME = 0x20
|
MAP_RENAME = 0x20
|
||||||
MAP_RESERVED0080 = 0x80
|
MAP_RESERVED0080 = 0x80
|
||||||
|
MAP_RESILIENT_CODESIGN = 0x2000
|
||||||
|
MAP_RESILIENT_MEDIA = 0x4000
|
||||||
MAP_SHARED = 0x1
|
MAP_SHARED = 0x1
|
||||||
MCL_CURRENT = 0x1
|
MCL_CURRENT = 0x1
|
||||||
MCL_FUTURE = 0x2
|
MCL_FUTURE = 0x2
|
||||||
|
MNT_ASYNC = 0x40
|
||||||
|
MNT_AUTOMOUNTED = 0x400000
|
||||||
|
MNT_CMDFLAGS = 0xf0000
|
||||||
|
MNT_CPROTECT = 0x80
|
||||||
|
MNT_DEFWRITE = 0x2000000
|
||||||
|
MNT_DONTBROWSE = 0x100000
|
||||||
|
MNT_DOVOLFS = 0x8000
|
||||||
|
MNT_DWAIT = 0x4
|
||||||
|
MNT_EXPORTED = 0x100
|
||||||
|
MNT_FORCE = 0x80000
|
||||||
|
MNT_IGNORE_OWNERSHIP = 0x200000
|
||||||
|
MNT_JOURNALED = 0x800000
|
||||||
|
MNT_LOCAL = 0x1000
|
||||||
|
MNT_MULTILABEL = 0x4000000
|
||||||
|
MNT_NOATIME = 0x10000000
|
||||||
|
MNT_NOBLOCK = 0x20000
|
||||||
|
MNT_NODEV = 0x10
|
||||||
|
MNT_NOEXEC = 0x4
|
||||||
|
MNT_NOSUID = 0x8
|
||||||
|
MNT_NOUSERXATTR = 0x1000000
|
||||||
|
MNT_NOWAIT = 0x2
|
||||||
|
MNT_QUARANTINE = 0x400
|
||||||
|
MNT_QUOTA = 0x2000
|
||||||
|
MNT_RDONLY = 0x1
|
||||||
|
MNT_RELOAD = 0x40000
|
||||||
|
MNT_ROOTFS = 0x4000
|
||||||
|
MNT_SYNCHRONOUS = 0x2
|
||||||
|
MNT_UNION = 0x20
|
||||||
|
MNT_UNKNOWNPERMISSIONS = 0x200000
|
||||||
|
MNT_UPDATE = 0x10000
|
||||||
|
MNT_VISFLAGMASK = 0x17f0f5ff
|
||||||
|
MNT_WAIT = 0x1
|
||||||
MSG_CTRUNC = 0x20
|
MSG_CTRUNC = 0x20
|
||||||
MSG_DONTROUTE = 0x4
|
MSG_DONTROUTE = 0x4
|
||||||
MSG_DONTWAIT = 0x80
|
MSG_DONTWAIT = 0x80
|
||||||
@@ -682,7 +980,13 @@ const (
|
|||||||
NET_RT_MAXID = 0xa
|
NET_RT_MAXID = 0xa
|
||||||
NET_RT_STAT = 0x4
|
NET_RT_STAT = 0x4
|
||||||
NET_RT_TRASH = 0x5
|
NET_RT_TRASH = 0x5
|
||||||
|
NL0 = 0x0
|
||||||
|
NL1 = 0x100
|
||||||
|
NL2 = 0x200
|
||||||
|
NL3 = 0x300
|
||||||
|
NLDLY = 0x300
|
||||||
NOFLSH = 0x80000000
|
NOFLSH = 0x80000000
|
||||||
|
NOKERNINFO = 0x2000000
|
||||||
NOTE_ABSOLUTE = 0x8
|
NOTE_ABSOLUTE = 0x8
|
||||||
NOTE_ATTRIB = 0x8
|
NOTE_ATTRIB = 0x8
|
||||||
NOTE_BACKGROUND = 0x40
|
NOTE_BACKGROUND = 0x40
|
||||||
@@ -706,11 +1010,14 @@ const (
|
|||||||
NOTE_FFNOP = 0x0
|
NOTE_FFNOP = 0x0
|
||||||
NOTE_FFOR = 0x80000000
|
NOTE_FFOR = 0x80000000
|
||||||
NOTE_FORK = 0x40000000
|
NOTE_FORK = 0x40000000
|
||||||
|
NOTE_FUNLOCK = 0x100
|
||||||
NOTE_LEEWAY = 0x10
|
NOTE_LEEWAY = 0x10
|
||||||
NOTE_LINK = 0x10
|
NOTE_LINK = 0x10
|
||||||
NOTE_LOWAT = 0x1
|
NOTE_LOWAT = 0x1
|
||||||
|
NOTE_MACH_CONTINUOUS_TIME = 0x80
|
||||||
NOTE_NONE = 0x80
|
NOTE_NONE = 0x80
|
||||||
NOTE_NSECONDS = 0x4
|
NOTE_NSECONDS = 0x4
|
||||||
|
NOTE_OOB = 0x2
|
||||||
NOTE_PCTRLMASK = -0x100000
|
NOTE_PCTRLMASK = -0x100000
|
||||||
NOTE_PDATAMASK = 0xfffff
|
NOTE_PDATAMASK = 0xfffff
|
||||||
NOTE_REAP = 0x10000000
|
NOTE_REAP = 0x10000000
|
||||||
@@ -735,6 +1042,7 @@ const (
|
|||||||
ONOCR = 0x20
|
ONOCR = 0x20
|
||||||
ONOEOT = 0x8
|
ONOEOT = 0x8
|
||||||
OPOST = 0x1
|
OPOST = 0x1
|
||||||
|
OXTABS = 0x4
|
||||||
O_ACCMODE = 0x3
|
O_ACCMODE = 0x3
|
||||||
O_ALERT = 0x20000000
|
O_ALERT = 0x20000000
|
||||||
O_APPEND = 0x8
|
O_APPEND = 0x8
|
||||||
@@ -743,6 +1051,7 @@ const (
|
|||||||
O_CREAT = 0x200
|
O_CREAT = 0x200
|
||||||
O_DIRECTORY = 0x100000
|
O_DIRECTORY = 0x100000
|
||||||
O_DP_GETRAWENCRYPTED = 0x1
|
O_DP_GETRAWENCRYPTED = 0x1
|
||||||
|
O_DP_GETRAWUNENCRYPTED = 0x2
|
||||||
O_DSYNC = 0x400000
|
O_DSYNC = 0x400000
|
||||||
O_EVTONLY = 0x8000
|
O_EVTONLY = 0x8000
|
||||||
O_EXCL = 0x800
|
O_EXCL = 0x800
|
||||||
@@ -795,7 +1104,10 @@ const (
|
|||||||
RLIMIT_CPU_USAGE_MONITOR = 0x2
|
RLIMIT_CPU_USAGE_MONITOR = 0x2
|
||||||
RLIMIT_DATA = 0x2
|
RLIMIT_DATA = 0x2
|
||||||
RLIMIT_FSIZE = 0x1
|
RLIMIT_FSIZE = 0x1
|
||||||
|
RLIMIT_MEMLOCK = 0x6
|
||||||
RLIMIT_NOFILE = 0x8
|
RLIMIT_NOFILE = 0x8
|
||||||
|
RLIMIT_NPROC = 0x7
|
||||||
|
RLIMIT_RSS = 0x5
|
||||||
RLIMIT_STACK = 0x3
|
RLIMIT_STACK = 0x3
|
||||||
RLIM_INFINITY = 0x7fffffffffffffff
|
RLIM_INFINITY = 0x7fffffffffffffff
|
||||||
RTAX_AUTHOR = 0x6
|
RTAX_AUTHOR = 0x6
|
||||||
@@ -830,6 +1142,7 @@ const (
|
|||||||
RTF_LOCAL = 0x200000
|
RTF_LOCAL = 0x200000
|
||||||
RTF_MODIFIED = 0x20
|
RTF_MODIFIED = 0x20
|
||||||
RTF_MULTICAST = 0x800000
|
RTF_MULTICAST = 0x800000
|
||||||
|
RTF_NOIFREF = 0x2000
|
||||||
RTF_PINNED = 0x100000
|
RTF_PINNED = 0x100000
|
||||||
RTF_PRCLONING = 0x10000
|
RTF_PRCLONING = 0x10000
|
||||||
RTF_PROTO1 = 0x8000
|
RTF_PROTO1 = 0x8000
|
||||||
@@ -964,6 +1277,8 @@ const (
|
|||||||
SO_LABEL = 0x1010
|
SO_LABEL = 0x1010
|
||||||
SO_LINGER = 0x80
|
SO_LINGER = 0x80
|
||||||
SO_LINGER_SEC = 0x1080
|
SO_LINGER_SEC = 0x1080
|
||||||
|
SO_NETSVC_MARKING_LEVEL = 0x1119
|
||||||
|
SO_NET_SERVICE_TYPE = 0x1116
|
||||||
SO_NKE = 0x1021
|
SO_NKE = 0x1021
|
||||||
SO_NOADDRERR = 0x1023
|
SO_NOADDRERR = 0x1023
|
||||||
SO_NOSIGPIPE = 0x1022
|
SO_NOSIGPIPE = 0x1022
|
||||||
@@ -1019,11 +1334,22 @@ const (
|
|||||||
S_IXGRP = 0x8
|
S_IXGRP = 0x8
|
||||||
S_IXOTH = 0x1
|
S_IXOTH = 0x1
|
||||||
S_IXUSR = 0x40
|
S_IXUSR = 0x40
|
||||||
|
TAB0 = 0x0
|
||||||
|
TAB1 = 0x400
|
||||||
|
TAB2 = 0x800
|
||||||
|
TAB3 = 0x4
|
||||||
|
TABDLY = 0xc04
|
||||||
TCIFLUSH = 0x1
|
TCIFLUSH = 0x1
|
||||||
|
TCIOFF = 0x3
|
||||||
TCIOFLUSH = 0x3
|
TCIOFLUSH = 0x3
|
||||||
|
TCION = 0x4
|
||||||
TCOFLUSH = 0x2
|
TCOFLUSH = 0x2
|
||||||
|
TCOOFF = 0x1
|
||||||
|
TCOON = 0x2
|
||||||
TCP_CONNECTIONTIMEOUT = 0x20
|
TCP_CONNECTIONTIMEOUT = 0x20
|
||||||
|
TCP_CONNECTION_INFO = 0x106
|
||||||
TCP_ENABLE_ECN = 0x104
|
TCP_ENABLE_ECN = 0x104
|
||||||
|
TCP_FASTOPEN = 0x105
|
||||||
TCP_KEEPALIVE = 0x10
|
TCP_KEEPALIVE = 0x10
|
||||||
TCP_KEEPCNT = 0x102
|
TCP_KEEPCNT = 0x102
|
||||||
TCP_KEEPINTVL = 0x101
|
TCP_KEEPINTVL = 0x101
|
||||||
@@ -1123,6 +1449,11 @@ const (
|
|||||||
VKILL = 0x5
|
VKILL = 0x5
|
||||||
VLNEXT = 0xe
|
VLNEXT = 0xe
|
||||||
VMIN = 0x10
|
VMIN = 0x10
|
||||||
|
VM_LOADAVG = 0x2
|
||||||
|
VM_MACHFACTOR = 0x4
|
||||||
|
VM_MAXID = 0x6
|
||||||
|
VM_METER = 0x1
|
||||||
|
VM_SWAPUSAGE = 0x5
|
||||||
VQUIT = 0x9
|
VQUIT = 0x9
|
||||||
VREPRINT = 0x6
|
VREPRINT = 0x6
|
||||||
VSTART = 0xc
|
VSTART = 0xc
|
||||||
@@ -1291,3 +1622,148 @@ const (
|
|||||||
SIGXCPU = syscall.Signal(0x18)
|
SIGXCPU = syscall.Signal(0x18)
|
||||||
SIGXFSZ = syscall.Signal(0x19)
|
SIGXFSZ = syscall.Signal(0x19)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Error table
|
||||||
|
var errors = [...]string{
|
||||||
|
1: "operation not permitted",
|
||||||
|
2: "no such file or directory",
|
||||||
|
3: "no such process",
|
||||||
|
4: "interrupted system call",
|
||||||
|
5: "input/output error",
|
||||||
|
6: "device not configured",
|
||||||
|
7: "argument list too long",
|
||||||
|
8: "exec format error",
|
||||||
|
9: "bad file descriptor",
|
||||||
|
10: "no child processes",
|
||||||
|
11: "resource deadlock avoided",
|
||||||
|
12: "cannot allocate memory",
|
||||||
|
13: "permission denied",
|
||||||
|
14: "bad address",
|
||||||
|
15: "block device required",
|
||||||
|
16: "resource busy",
|
||||||
|
17: "file exists",
|
||||||
|
18: "cross-device link",
|
||||||
|
19: "operation not supported by device",
|
||||||
|
20: "not a directory",
|
||||||
|
21: "is a directory",
|
||||||
|
22: "invalid argument",
|
||||||
|
23: "too many open files in system",
|
||||||
|
24: "too many open files",
|
||||||
|
25: "inappropriate ioctl for device",
|
||||||
|
26: "text file busy",
|
||||||
|
27: "file too large",
|
||||||
|
28: "no space left on device",
|
||||||
|
29: "illegal seek",
|
||||||
|
30: "read-only file system",
|
||||||
|
31: "too many links",
|
||||||
|
32: "broken pipe",
|
||||||
|
33: "numerical argument out of domain",
|
||||||
|
34: "result too large",
|
||||||
|
35: "resource temporarily unavailable",
|
||||||
|
36: "operation now in progress",
|
||||||
|
37: "operation already in progress",
|
||||||
|
38: "socket operation on non-socket",
|
||||||
|
39: "destination address required",
|
||||||
|
40: "message too long",
|
||||||
|
41: "protocol wrong type for socket",
|
||||||
|
42: "protocol not available",
|
||||||
|
43: "protocol not supported",
|
||||||
|
44: "socket type not supported",
|
||||||
|
45: "operation not supported",
|
||||||
|
46: "protocol family not supported",
|
||||||
|
47: "address family not supported by protocol family",
|
||||||
|
48: "address already in use",
|
||||||
|
49: "can't assign requested address",
|
||||||
|
50: "network is down",
|
||||||
|
51: "network is unreachable",
|
||||||
|
52: "network dropped connection on reset",
|
||||||
|
53: "software caused connection abort",
|
||||||
|
54: "connection reset by peer",
|
||||||
|
55: "no buffer space available",
|
||||||
|
56: "socket is already connected",
|
||||||
|
57: "socket is not connected",
|
||||||
|
58: "can't send after socket shutdown",
|
||||||
|
59: "too many references: can't splice",
|
||||||
|
60: "operation timed out",
|
||||||
|
61: "connection refused",
|
||||||
|
62: "too many levels of symbolic links",
|
||||||
|
63: "file name too long",
|
||||||
|
64: "host is down",
|
||||||
|
65: "no route to host",
|
||||||
|
66: "directory not empty",
|
||||||
|
67: "too many processes",
|
||||||
|
68: "too many users",
|
||||||
|
69: "disc quota exceeded",
|
||||||
|
70: "stale NFS file handle",
|
||||||
|
71: "too many levels of remote in path",
|
||||||
|
72: "RPC struct is bad",
|
||||||
|
73: "RPC version wrong",
|
||||||
|
74: "RPC prog. not avail",
|
||||||
|
75: "program version wrong",
|
||||||
|
76: "bad procedure for program",
|
||||||
|
77: "no locks available",
|
||||||
|
78: "function not implemented",
|
||||||
|
79: "inappropriate file type or format",
|
||||||
|
80: "authentication error",
|
||||||
|
81: "need authenticator",
|
||||||
|
82: "device power is off",
|
||||||
|
83: "device error",
|
||||||
|
84: "value too large to be stored in data type",
|
||||||
|
85: "bad executable (or shared library)",
|
||||||
|
86: "bad CPU type in executable",
|
||||||
|
87: "shared library version mismatch",
|
||||||
|
88: "malformed Mach-o file",
|
||||||
|
89: "operation canceled",
|
||||||
|
90: "identifier removed",
|
||||||
|
91: "no message of desired type",
|
||||||
|
92: "illegal byte sequence",
|
||||||
|
93: "attribute not found",
|
||||||
|
94: "bad message",
|
||||||
|
95: "EMULTIHOP (Reserved)",
|
||||||
|
96: "no message available on STREAM",
|
||||||
|
97: "ENOLINK (Reserved)",
|
||||||
|
98: "no STREAM resources",
|
||||||
|
99: "not a STREAM",
|
||||||
|
100: "protocol error",
|
||||||
|
101: "STREAM ioctl timeout",
|
||||||
|
102: "operation not supported on socket",
|
||||||
|
103: "policy not found",
|
||||||
|
104: "state not recoverable",
|
||||||
|
105: "previous owner died",
|
||||||
|
106: "interface output queue is full",
|
||||||
|
}
|
||||||
|
|
||||||
|
// Signal table
|
||||||
|
var signals = [...]string{
|
||||||
|
1: "hangup",
|
||||||
|
2: "interrupt",
|
||||||
|
3: "quit",
|
||||||
|
4: "illegal instruction",
|
||||||
|
5: "trace/BPT trap",
|
||||||
|
6: "abort trap",
|
||||||
|
7: "EMT trap",
|
||||||
|
8: "floating point exception",
|
||||||
|
9: "killed",
|
||||||
|
10: "bus error",
|
||||||
|
11: "segmentation fault",
|
||||||
|
12: "bad system call",
|
||||||
|
13: "broken pipe",
|
||||||
|
14: "alarm clock",
|
||||||
|
15: "terminated",
|
||||||
|
16: "urgent I/O condition",
|
||||||
|
17: "suspended (signal)",
|
||||||
|
18: "suspended",
|
||||||
|
19: "continued",
|
||||||
|
20: "child exited",
|
||||||
|
21: "stopped (tty input)",
|
||||||
|
22: "stopped (tty output)",
|
||||||
|
23: "I/O possible",
|
||||||
|
24: "cputime limit exceeded",
|
||||||
|
25: "filesize limit exceeded",
|
||||||
|
26: "virtual timer expired",
|
||||||
|
27: "profiling timer expired",
|
||||||
|
28: "window size changes",
|
||||||
|
29: "information request",
|
||||||
|
30: "user defined signal 1",
|
||||||
|
31: "user defined signal 2",
|
||||||
|
}
|
||||||
|
|||||||
+196
-3
@@ -1,5 +1,5 @@
|
|||||||
// mkerrors.sh -m64
|
// mkerrors.sh -m64
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build arm64,darwin
|
// +build arm64,darwin
|
||||||
|
|
||||||
@@ -48,6 +48,87 @@ const (
|
|||||||
AF_UNIX = 0x1
|
AF_UNIX = 0x1
|
||||||
AF_UNSPEC = 0x0
|
AF_UNSPEC = 0x0
|
||||||
AF_UTUN = 0x26
|
AF_UTUN = 0x26
|
||||||
|
ALTWERASE = 0x200
|
||||||
|
ATTR_BIT_MAP_COUNT = 0x5
|
||||||
|
ATTR_CMN_ACCESSMASK = 0x20000
|
||||||
|
ATTR_CMN_ACCTIME = 0x1000
|
||||||
|
ATTR_CMN_ADDEDTIME = 0x10000000
|
||||||
|
ATTR_CMN_BKUPTIME = 0x2000
|
||||||
|
ATTR_CMN_CHGTIME = 0x800
|
||||||
|
ATTR_CMN_CRTIME = 0x200
|
||||||
|
ATTR_CMN_DATA_PROTECT_FLAGS = 0x40000000
|
||||||
|
ATTR_CMN_DEVID = 0x2
|
||||||
|
ATTR_CMN_DOCUMENT_ID = 0x100000
|
||||||
|
ATTR_CMN_ERROR = 0x20000000
|
||||||
|
ATTR_CMN_EXTENDED_SECURITY = 0x400000
|
||||||
|
ATTR_CMN_FILEID = 0x2000000
|
||||||
|
ATTR_CMN_FLAGS = 0x40000
|
||||||
|
ATTR_CMN_FNDRINFO = 0x4000
|
||||||
|
ATTR_CMN_FSID = 0x4
|
||||||
|
ATTR_CMN_FULLPATH = 0x8000000
|
||||||
|
ATTR_CMN_GEN_COUNT = 0x80000
|
||||||
|
ATTR_CMN_GRPID = 0x10000
|
||||||
|
ATTR_CMN_GRPUUID = 0x1000000
|
||||||
|
ATTR_CMN_MODTIME = 0x400
|
||||||
|
ATTR_CMN_NAME = 0x1
|
||||||
|
ATTR_CMN_NAMEDATTRCOUNT = 0x80000
|
||||||
|
ATTR_CMN_NAMEDATTRLIST = 0x100000
|
||||||
|
ATTR_CMN_OBJID = 0x20
|
||||||
|
ATTR_CMN_OBJPERMANENTID = 0x40
|
||||||
|
ATTR_CMN_OBJTAG = 0x10
|
||||||
|
ATTR_CMN_OBJTYPE = 0x8
|
||||||
|
ATTR_CMN_OWNERID = 0x8000
|
||||||
|
ATTR_CMN_PARENTID = 0x4000000
|
||||||
|
ATTR_CMN_PAROBJID = 0x80
|
||||||
|
ATTR_CMN_RETURNED_ATTRS = 0x80000000
|
||||||
|
ATTR_CMN_SCRIPT = 0x100
|
||||||
|
ATTR_CMN_SETMASK = 0x41c7ff00
|
||||||
|
ATTR_CMN_USERACCESS = 0x200000
|
||||||
|
ATTR_CMN_UUID = 0x800000
|
||||||
|
ATTR_CMN_VALIDMASK = 0xffffffff
|
||||||
|
ATTR_CMN_VOLSETMASK = 0x6700
|
||||||
|
ATTR_FILE_ALLOCSIZE = 0x4
|
||||||
|
ATTR_FILE_CLUMPSIZE = 0x10
|
||||||
|
ATTR_FILE_DATAALLOCSIZE = 0x400
|
||||||
|
ATTR_FILE_DATAEXTENTS = 0x800
|
||||||
|
ATTR_FILE_DATALENGTH = 0x200
|
||||||
|
ATTR_FILE_DEVTYPE = 0x20
|
||||||
|
ATTR_FILE_FILETYPE = 0x40
|
||||||
|
ATTR_FILE_FORKCOUNT = 0x80
|
||||||
|
ATTR_FILE_FORKLIST = 0x100
|
||||||
|
ATTR_FILE_IOBLOCKSIZE = 0x8
|
||||||
|
ATTR_FILE_LINKCOUNT = 0x1
|
||||||
|
ATTR_FILE_RSRCALLOCSIZE = 0x2000
|
||||||
|
ATTR_FILE_RSRCEXTENTS = 0x4000
|
||||||
|
ATTR_FILE_RSRCLENGTH = 0x1000
|
||||||
|
ATTR_FILE_SETMASK = 0x20
|
||||||
|
ATTR_FILE_TOTALSIZE = 0x2
|
||||||
|
ATTR_FILE_VALIDMASK = 0x37ff
|
||||||
|
ATTR_VOL_ALLOCATIONCLUMP = 0x40
|
||||||
|
ATTR_VOL_ATTRIBUTES = 0x40000000
|
||||||
|
ATTR_VOL_CAPABILITIES = 0x20000
|
||||||
|
ATTR_VOL_DIRCOUNT = 0x400
|
||||||
|
ATTR_VOL_ENCODINGSUSED = 0x10000
|
||||||
|
ATTR_VOL_FILECOUNT = 0x200
|
||||||
|
ATTR_VOL_FSTYPE = 0x1
|
||||||
|
ATTR_VOL_INFO = 0x80000000
|
||||||
|
ATTR_VOL_IOBLOCKSIZE = 0x80
|
||||||
|
ATTR_VOL_MAXOBJCOUNT = 0x800
|
||||||
|
ATTR_VOL_MINALLOCATION = 0x20
|
||||||
|
ATTR_VOL_MOUNTEDDEVICE = 0x8000
|
||||||
|
ATTR_VOL_MOUNTFLAGS = 0x4000
|
||||||
|
ATTR_VOL_MOUNTPOINT = 0x1000
|
||||||
|
ATTR_VOL_NAME = 0x2000
|
||||||
|
ATTR_VOL_OBJCOUNT = 0x100
|
||||||
|
ATTR_VOL_QUOTA_SIZE = 0x10000000
|
||||||
|
ATTR_VOL_RESERVED_SIZE = 0x20000000
|
||||||
|
ATTR_VOL_SETMASK = 0x80002000
|
||||||
|
ATTR_VOL_SIGNATURE = 0x2
|
||||||
|
ATTR_VOL_SIZE = 0x4
|
||||||
|
ATTR_VOL_SPACEAVAIL = 0x10
|
||||||
|
ATTR_VOL_SPACEFREE = 0x8
|
||||||
|
ATTR_VOL_UUID = 0x40000
|
||||||
|
ATTR_VOL_VALIDMASK = 0xf007ffff
|
||||||
B0 = 0x0
|
B0 = 0x0
|
||||||
B110 = 0x6e
|
B110 = 0x6e
|
||||||
B115200 = 0x1c200
|
B115200 = 0x1c200
|
||||||
@@ -138,9 +219,26 @@ const (
|
|||||||
BPF_W = 0x0
|
BPF_W = 0x0
|
||||||
BPF_X = 0x8
|
BPF_X = 0x8
|
||||||
BRKINT = 0x2
|
BRKINT = 0x2
|
||||||
|
BS0 = 0x0
|
||||||
|
BS1 = 0x8000
|
||||||
|
BSDLY = 0x8000
|
||||||
CFLUSH = 0xf
|
CFLUSH = 0xf
|
||||||
CLOCAL = 0x8000
|
CLOCAL = 0x8000
|
||||||
|
CLOCK_MONOTONIC = 0x6
|
||||||
|
CLOCK_MONOTONIC_RAW = 0x4
|
||||||
|
CLOCK_MONOTONIC_RAW_APPROX = 0x5
|
||||||
|
CLOCK_PROCESS_CPUTIME_ID = 0xc
|
||||||
|
CLOCK_REALTIME = 0x0
|
||||||
|
CLOCK_THREAD_CPUTIME_ID = 0x10
|
||||||
|
CLOCK_UPTIME_RAW = 0x8
|
||||||
|
CLOCK_UPTIME_RAW_APPROX = 0x9
|
||||||
|
CR0 = 0x0
|
||||||
|
CR1 = 0x1000
|
||||||
|
CR2 = 0x2000
|
||||||
|
CR3 = 0x3000
|
||||||
|
CRDLY = 0x3000
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
|
CRTSCTS = 0x30000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
CS6 = 0x100
|
CS6 = 0x100
|
||||||
CS7 = 0x200
|
CS7 = 0x200
|
||||||
@@ -151,6 +249,8 @@ const (
|
|||||||
CSTOP = 0x13
|
CSTOP = 0x13
|
||||||
CSTOPB = 0x400
|
CSTOPB = 0x400
|
||||||
CSUSP = 0x1a
|
CSUSP = 0x1a
|
||||||
|
CTL_HW = 0x6
|
||||||
|
CTL_KERN = 0x1
|
||||||
CTL_MAXNAME = 0xc
|
CTL_MAXNAME = 0xc
|
||||||
CTL_NET = 0x4
|
CTL_NET = 0x4
|
||||||
DLT_A429 = 0xb8
|
DLT_A429 = 0xb8
|
||||||
@@ -332,13 +432,14 @@ const (
|
|||||||
ECHONL = 0x10
|
ECHONL = 0x10
|
||||||
ECHOPRT = 0x20
|
ECHOPRT = 0x20
|
||||||
EVFILT_AIO = -0x3
|
EVFILT_AIO = -0x3
|
||||||
|
EVFILT_EXCEPT = -0xf
|
||||||
EVFILT_FS = -0x9
|
EVFILT_FS = -0x9
|
||||||
EVFILT_MACHPORT = -0x8
|
EVFILT_MACHPORT = -0x8
|
||||||
EVFILT_PROC = -0x5
|
EVFILT_PROC = -0x5
|
||||||
EVFILT_READ = -0x1
|
EVFILT_READ = -0x1
|
||||||
EVFILT_SIGNAL = -0x6
|
EVFILT_SIGNAL = -0x6
|
||||||
EVFILT_SYSCOUNT = 0xe
|
EVFILT_SYSCOUNT = 0xf
|
||||||
EVFILT_THREADMARKER = 0xe
|
EVFILT_THREADMARKER = 0xf
|
||||||
EVFILT_TIMER = -0x7
|
EVFILT_TIMER = -0x7
|
||||||
EVFILT_USER = -0xa
|
EVFILT_USER = -0xa
|
||||||
EVFILT_VM = -0xc
|
EVFILT_VM = -0xc
|
||||||
@@ -349,6 +450,7 @@ const (
|
|||||||
EV_DELETE = 0x2
|
EV_DELETE = 0x2
|
||||||
EV_DISABLE = 0x8
|
EV_DISABLE = 0x8
|
||||||
EV_DISPATCH = 0x80
|
EV_DISPATCH = 0x80
|
||||||
|
EV_DISPATCH2 = 0x180
|
||||||
EV_ENABLE = 0x4
|
EV_ENABLE = 0x4
|
||||||
EV_EOF = 0x8000
|
EV_EOF = 0x8000
|
||||||
EV_ERROR = 0x4000
|
EV_ERROR = 0x4000
|
||||||
@@ -359,16 +461,30 @@ const (
|
|||||||
EV_POLL = 0x1000
|
EV_POLL = 0x1000
|
||||||
EV_RECEIPT = 0x40
|
EV_RECEIPT = 0x40
|
||||||
EV_SYSFLAGS = 0xf000
|
EV_SYSFLAGS = 0xf000
|
||||||
|
EV_UDATA_SPECIFIC = 0x100
|
||||||
|
EV_VANISHED = 0x200
|
||||||
EXTA = 0x4b00
|
EXTA = 0x4b00
|
||||||
EXTB = 0x9600
|
EXTB = 0x9600
|
||||||
EXTPROC = 0x800
|
EXTPROC = 0x800
|
||||||
FD_CLOEXEC = 0x1
|
FD_CLOEXEC = 0x1
|
||||||
FD_SETSIZE = 0x400
|
FD_SETSIZE = 0x400
|
||||||
|
FF0 = 0x0
|
||||||
|
FF1 = 0x4000
|
||||||
|
FFDLY = 0x4000
|
||||||
FLUSHO = 0x800000
|
FLUSHO = 0x800000
|
||||||
|
FSOPT_ATTR_CMN_EXTENDED = 0x20
|
||||||
|
FSOPT_NOFOLLOW = 0x1
|
||||||
|
FSOPT_NOINMEMUPDATE = 0x2
|
||||||
|
FSOPT_PACK_INVAL_ATTRS = 0x8
|
||||||
|
FSOPT_REPORT_FULLSIZE = 0x4
|
||||||
F_ADDFILESIGS = 0x3d
|
F_ADDFILESIGS = 0x3d
|
||||||
|
F_ADDFILESIGS_FOR_DYLD_SIM = 0x53
|
||||||
|
F_ADDFILESIGS_RETURN = 0x61
|
||||||
F_ADDSIGS = 0x3b
|
F_ADDSIGS = 0x3b
|
||||||
F_ALLOCATEALL = 0x4
|
F_ALLOCATEALL = 0x4
|
||||||
F_ALLOCATECONTIG = 0x2
|
F_ALLOCATECONTIG = 0x2
|
||||||
|
F_BARRIERFSYNC = 0x55
|
||||||
|
F_CHECK_LV = 0x62
|
||||||
F_CHKCLEAN = 0x29
|
F_CHKCLEAN = 0x29
|
||||||
F_DUPFD = 0x0
|
F_DUPFD = 0x0
|
||||||
F_DUPFD_CLOEXEC = 0x43
|
F_DUPFD_CLOEXEC = 0x43
|
||||||
@@ -396,6 +512,7 @@ const (
|
|||||||
F_PATHPKG_CHECK = 0x34
|
F_PATHPKG_CHECK = 0x34
|
||||||
F_PEOFPOSMODE = 0x3
|
F_PEOFPOSMODE = 0x3
|
||||||
F_PREALLOCATE = 0x2a
|
F_PREALLOCATE = 0x2a
|
||||||
|
F_PUNCHHOLE = 0x63
|
||||||
F_RDADVISE = 0x2c
|
F_RDADVISE = 0x2c
|
||||||
F_RDAHEAD = 0x2d
|
F_RDAHEAD = 0x2d
|
||||||
F_RDLCK = 0x1
|
F_RDLCK = 0x1
|
||||||
@@ -412,10 +529,12 @@ const (
|
|||||||
F_SINGLE_WRITER = 0x4c
|
F_SINGLE_WRITER = 0x4c
|
||||||
F_THAW_FS = 0x36
|
F_THAW_FS = 0x36
|
||||||
F_TRANSCODEKEY = 0x4b
|
F_TRANSCODEKEY = 0x4b
|
||||||
|
F_TRIM_ACTIVE_FILE = 0x64
|
||||||
F_UNLCK = 0x2
|
F_UNLCK = 0x2
|
||||||
F_VOLPOSMODE = 0x4
|
F_VOLPOSMODE = 0x4
|
||||||
F_WRLCK = 0x3
|
F_WRLCK = 0x3
|
||||||
HUPCL = 0x4000
|
HUPCL = 0x4000
|
||||||
|
HW_MACHINE = 0x1
|
||||||
ICANON = 0x100
|
ICANON = 0x100
|
||||||
ICMP6_FILTER = 0x12
|
ICMP6_FILTER = 0x12
|
||||||
ICRNL = 0x100
|
ICRNL = 0x100
|
||||||
@@ -652,6 +771,7 @@ const (
|
|||||||
IPV6_FAITH = 0x1d
|
IPV6_FAITH = 0x1d
|
||||||
IPV6_FLOWINFO_MASK = 0xffffff0f
|
IPV6_FLOWINFO_MASK = 0xffffff0f
|
||||||
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
||||||
|
IPV6_FLOW_ECN_MASK = 0x300
|
||||||
IPV6_FRAGTTL = 0x3c
|
IPV6_FRAGTTL = 0x3c
|
||||||
IPV6_FW_ADD = 0x1e
|
IPV6_FW_ADD = 0x1e
|
||||||
IPV6_FW_DEL = 0x1f
|
IPV6_FW_DEL = 0x1f
|
||||||
@@ -742,6 +862,7 @@ const (
|
|||||||
IP_RECVOPTS = 0x5
|
IP_RECVOPTS = 0x5
|
||||||
IP_RECVPKTINFO = 0x1a
|
IP_RECVPKTINFO = 0x1a
|
||||||
IP_RECVRETOPTS = 0x6
|
IP_RECVRETOPTS = 0x6
|
||||||
|
IP_RECVTOS = 0x1b
|
||||||
IP_RECVTTL = 0x18
|
IP_RECVTTL = 0x18
|
||||||
IP_RETOPTS = 0x8
|
IP_RETOPTS = 0x8
|
||||||
IP_RF = 0x8000
|
IP_RF = 0x8000
|
||||||
@@ -760,6 +881,10 @@ const (
|
|||||||
IXANY = 0x800
|
IXANY = 0x800
|
||||||
IXOFF = 0x400
|
IXOFF = 0x400
|
||||||
IXON = 0x200
|
IXON = 0x200
|
||||||
|
KERN_HOSTNAME = 0xa
|
||||||
|
KERN_OSRELEASE = 0x2
|
||||||
|
KERN_OSTYPE = 0x1
|
||||||
|
KERN_VERSION = 0x4
|
||||||
LOCK_EX = 0x2
|
LOCK_EX = 0x2
|
||||||
LOCK_NB = 0x4
|
LOCK_NB = 0x4
|
||||||
LOCK_SH = 0x1
|
LOCK_SH = 0x1
|
||||||
@@ -770,11 +895,13 @@ const (
|
|||||||
MADV_FREE_REUSABLE = 0x7
|
MADV_FREE_REUSABLE = 0x7
|
||||||
MADV_FREE_REUSE = 0x8
|
MADV_FREE_REUSE = 0x8
|
||||||
MADV_NORMAL = 0x0
|
MADV_NORMAL = 0x0
|
||||||
|
MADV_PAGEOUT = 0xa
|
||||||
MADV_RANDOM = 0x1
|
MADV_RANDOM = 0x1
|
||||||
MADV_SEQUENTIAL = 0x2
|
MADV_SEQUENTIAL = 0x2
|
||||||
MADV_WILLNEED = 0x3
|
MADV_WILLNEED = 0x3
|
||||||
MADV_ZERO_WIRED_PAGES = 0x6
|
MADV_ZERO_WIRED_PAGES = 0x6
|
||||||
MAP_ANON = 0x1000
|
MAP_ANON = 0x1000
|
||||||
|
MAP_ANONYMOUS = 0x1000
|
||||||
MAP_COPY = 0x2
|
MAP_COPY = 0x2
|
||||||
MAP_FILE = 0x0
|
MAP_FILE = 0x0
|
||||||
MAP_FIXED = 0x10
|
MAP_FIXED = 0x10
|
||||||
@@ -786,9 +913,43 @@ const (
|
|||||||
MAP_PRIVATE = 0x2
|
MAP_PRIVATE = 0x2
|
||||||
MAP_RENAME = 0x20
|
MAP_RENAME = 0x20
|
||||||
MAP_RESERVED0080 = 0x80
|
MAP_RESERVED0080 = 0x80
|
||||||
|
MAP_RESILIENT_CODESIGN = 0x2000
|
||||||
|
MAP_RESILIENT_MEDIA = 0x4000
|
||||||
MAP_SHARED = 0x1
|
MAP_SHARED = 0x1
|
||||||
MCL_CURRENT = 0x1
|
MCL_CURRENT = 0x1
|
||||||
MCL_FUTURE = 0x2
|
MCL_FUTURE = 0x2
|
||||||
|
MNT_ASYNC = 0x40
|
||||||
|
MNT_AUTOMOUNTED = 0x400000
|
||||||
|
MNT_CMDFLAGS = 0xf0000
|
||||||
|
MNT_CPROTECT = 0x80
|
||||||
|
MNT_DEFWRITE = 0x2000000
|
||||||
|
MNT_DONTBROWSE = 0x100000
|
||||||
|
MNT_DOVOLFS = 0x8000
|
||||||
|
MNT_DWAIT = 0x4
|
||||||
|
MNT_EXPORTED = 0x100
|
||||||
|
MNT_FORCE = 0x80000
|
||||||
|
MNT_IGNORE_OWNERSHIP = 0x200000
|
||||||
|
MNT_JOURNALED = 0x800000
|
||||||
|
MNT_LOCAL = 0x1000
|
||||||
|
MNT_MULTILABEL = 0x4000000
|
||||||
|
MNT_NOATIME = 0x10000000
|
||||||
|
MNT_NOBLOCK = 0x20000
|
||||||
|
MNT_NODEV = 0x10
|
||||||
|
MNT_NOEXEC = 0x4
|
||||||
|
MNT_NOSUID = 0x8
|
||||||
|
MNT_NOUSERXATTR = 0x1000000
|
||||||
|
MNT_NOWAIT = 0x2
|
||||||
|
MNT_QUARANTINE = 0x400
|
||||||
|
MNT_QUOTA = 0x2000
|
||||||
|
MNT_RDONLY = 0x1
|
||||||
|
MNT_RELOAD = 0x40000
|
||||||
|
MNT_ROOTFS = 0x4000
|
||||||
|
MNT_SYNCHRONOUS = 0x2
|
||||||
|
MNT_UNION = 0x20
|
||||||
|
MNT_UNKNOWNPERMISSIONS = 0x200000
|
||||||
|
MNT_UPDATE = 0x10000
|
||||||
|
MNT_VISFLAGMASK = 0x17f0f5ff
|
||||||
|
MNT_WAIT = 0x1
|
||||||
MSG_CTRUNC = 0x20
|
MSG_CTRUNC = 0x20
|
||||||
MSG_DONTROUTE = 0x4
|
MSG_DONTROUTE = 0x4
|
||||||
MSG_DONTWAIT = 0x80
|
MSG_DONTWAIT = 0x80
|
||||||
@@ -819,7 +980,13 @@ const (
|
|||||||
NET_RT_MAXID = 0xa
|
NET_RT_MAXID = 0xa
|
||||||
NET_RT_STAT = 0x4
|
NET_RT_STAT = 0x4
|
||||||
NET_RT_TRASH = 0x5
|
NET_RT_TRASH = 0x5
|
||||||
|
NL0 = 0x0
|
||||||
|
NL1 = 0x100
|
||||||
|
NL2 = 0x200
|
||||||
|
NL3 = 0x300
|
||||||
|
NLDLY = 0x300
|
||||||
NOFLSH = 0x80000000
|
NOFLSH = 0x80000000
|
||||||
|
NOKERNINFO = 0x2000000
|
||||||
NOTE_ABSOLUTE = 0x8
|
NOTE_ABSOLUTE = 0x8
|
||||||
NOTE_ATTRIB = 0x8
|
NOTE_ATTRIB = 0x8
|
||||||
NOTE_BACKGROUND = 0x40
|
NOTE_BACKGROUND = 0x40
|
||||||
@@ -843,11 +1010,14 @@ const (
|
|||||||
NOTE_FFNOP = 0x0
|
NOTE_FFNOP = 0x0
|
||||||
NOTE_FFOR = 0x80000000
|
NOTE_FFOR = 0x80000000
|
||||||
NOTE_FORK = 0x40000000
|
NOTE_FORK = 0x40000000
|
||||||
|
NOTE_FUNLOCK = 0x100
|
||||||
NOTE_LEEWAY = 0x10
|
NOTE_LEEWAY = 0x10
|
||||||
NOTE_LINK = 0x10
|
NOTE_LINK = 0x10
|
||||||
NOTE_LOWAT = 0x1
|
NOTE_LOWAT = 0x1
|
||||||
|
NOTE_MACH_CONTINUOUS_TIME = 0x80
|
||||||
NOTE_NONE = 0x80
|
NOTE_NONE = 0x80
|
||||||
NOTE_NSECONDS = 0x4
|
NOTE_NSECONDS = 0x4
|
||||||
|
NOTE_OOB = 0x2
|
||||||
NOTE_PCTRLMASK = -0x100000
|
NOTE_PCTRLMASK = -0x100000
|
||||||
NOTE_PDATAMASK = 0xfffff
|
NOTE_PDATAMASK = 0xfffff
|
||||||
NOTE_REAP = 0x10000000
|
NOTE_REAP = 0x10000000
|
||||||
@@ -872,6 +1042,7 @@ const (
|
|||||||
ONOCR = 0x20
|
ONOCR = 0x20
|
||||||
ONOEOT = 0x8
|
ONOEOT = 0x8
|
||||||
OPOST = 0x1
|
OPOST = 0x1
|
||||||
|
OXTABS = 0x4
|
||||||
O_ACCMODE = 0x3
|
O_ACCMODE = 0x3
|
||||||
O_ALERT = 0x20000000
|
O_ALERT = 0x20000000
|
||||||
O_APPEND = 0x8
|
O_APPEND = 0x8
|
||||||
@@ -880,6 +1051,7 @@ const (
|
|||||||
O_CREAT = 0x200
|
O_CREAT = 0x200
|
||||||
O_DIRECTORY = 0x100000
|
O_DIRECTORY = 0x100000
|
||||||
O_DP_GETRAWENCRYPTED = 0x1
|
O_DP_GETRAWENCRYPTED = 0x1
|
||||||
|
O_DP_GETRAWUNENCRYPTED = 0x2
|
||||||
O_DSYNC = 0x400000
|
O_DSYNC = 0x400000
|
||||||
O_EVTONLY = 0x8000
|
O_EVTONLY = 0x8000
|
||||||
O_EXCL = 0x800
|
O_EXCL = 0x800
|
||||||
@@ -932,7 +1104,10 @@ const (
|
|||||||
RLIMIT_CPU_USAGE_MONITOR = 0x2
|
RLIMIT_CPU_USAGE_MONITOR = 0x2
|
||||||
RLIMIT_DATA = 0x2
|
RLIMIT_DATA = 0x2
|
||||||
RLIMIT_FSIZE = 0x1
|
RLIMIT_FSIZE = 0x1
|
||||||
|
RLIMIT_MEMLOCK = 0x6
|
||||||
RLIMIT_NOFILE = 0x8
|
RLIMIT_NOFILE = 0x8
|
||||||
|
RLIMIT_NPROC = 0x7
|
||||||
|
RLIMIT_RSS = 0x5
|
||||||
RLIMIT_STACK = 0x3
|
RLIMIT_STACK = 0x3
|
||||||
RLIM_INFINITY = 0x7fffffffffffffff
|
RLIM_INFINITY = 0x7fffffffffffffff
|
||||||
RTAX_AUTHOR = 0x6
|
RTAX_AUTHOR = 0x6
|
||||||
@@ -1102,6 +1277,8 @@ const (
|
|||||||
SO_LABEL = 0x1010
|
SO_LABEL = 0x1010
|
||||||
SO_LINGER = 0x80
|
SO_LINGER = 0x80
|
||||||
SO_LINGER_SEC = 0x1080
|
SO_LINGER_SEC = 0x1080
|
||||||
|
SO_NETSVC_MARKING_LEVEL = 0x1119
|
||||||
|
SO_NET_SERVICE_TYPE = 0x1116
|
||||||
SO_NKE = 0x1021
|
SO_NKE = 0x1021
|
||||||
SO_NOADDRERR = 0x1023
|
SO_NOADDRERR = 0x1023
|
||||||
SO_NOSIGPIPE = 0x1022
|
SO_NOSIGPIPE = 0x1022
|
||||||
@@ -1157,11 +1334,22 @@ const (
|
|||||||
S_IXGRP = 0x8
|
S_IXGRP = 0x8
|
||||||
S_IXOTH = 0x1
|
S_IXOTH = 0x1
|
||||||
S_IXUSR = 0x40
|
S_IXUSR = 0x40
|
||||||
|
TAB0 = 0x0
|
||||||
|
TAB1 = 0x400
|
||||||
|
TAB2 = 0x800
|
||||||
|
TAB3 = 0x4
|
||||||
|
TABDLY = 0xc04
|
||||||
TCIFLUSH = 0x1
|
TCIFLUSH = 0x1
|
||||||
|
TCIOFF = 0x3
|
||||||
TCIOFLUSH = 0x3
|
TCIOFLUSH = 0x3
|
||||||
|
TCION = 0x4
|
||||||
TCOFLUSH = 0x2
|
TCOFLUSH = 0x2
|
||||||
|
TCOOFF = 0x1
|
||||||
|
TCOON = 0x2
|
||||||
TCP_CONNECTIONTIMEOUT = 0x20
|
TCP_CONNECTIONTIMEOUT = 0x20
|
||||||
|
TCP_CONNECTION_INFO = 0x106
|
||||||
TCP_ENABLE_ECN = 0x104
|
TCP_ENABLE_ECN = 0x104
|
||||||
|
TCP_FASTOPEN = 0x105
|
||||||
TCP_KEEPALIVE = 0x10
|
TCP_KEEPALIVE = 0x10
|
||||||
TCP_KEEPCNT = 0x102
|
TCP_KEEPCNT = 0x102
|
||||||
TCP_KEEPINTVL = 0x101
|
TCP_KEEPINTVL = 0x101
|
||||||
@@ -1261,6 +1449,11 @@ const (
|
|||||||
VKILL = 0x5
|
VKILL = 0x5
|
||||||
VLNEXT = 0xe
|
VLNEXT = 0xe
|
||||||
VMIN = 0x10
|
VMIN = 0x10
|
||||||
|
VM_LOADAVG = 0x2
|
||||||
|
VM_MACHFACTOR = 0x4
|
||||||
|
VM_MAXID = 0x6
|
||||||
|
VM_METER = 0x1
|
||||||
|
VM_SWAPUSAGE = 0x5
|
||||||
VQUIT = 0x9
|
VQUIT = 0x9
|
||||||
VREPRINT = 0x6
|
VREPRINT = 0x6
|
||||||
VSTART = 0xc
|
VSTART = 0xc
|
||||||
|
|||||||
+54
-9
@@ -1,5 +1,5 @@
|
|||||||
// mkerrors.sh -m64
|
// mkerrors.sh -m64
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build amd64,dragonfly
|
// +build amd64,dragonfly
|
||||||
|
|
||||||
@@ -37,8 +37,8 @@ const (
|
|||||||
AF_MAX = 0x24
|
AF_MAX = 0x24
|
||||||
AF_MPLS = 0x22
|
AF_MPLS = 0x22
|
||||||
AF_NATM = 0x1d
|
AF_NATM = 0x1d
|
||||||
|
AF_NETBIOS = 0x6
|
||||||
AF_NETGRAPH = 0x20
|
AF_NETGRAPH = 0x20
|
||||||
AF_NS = 0x6
|
|
||||||
AF_OSI = 0x7
|
AF_OSI = 0x7
|
||||||
AF_PUP = 0x4
|
AF_PUP = 0x4
|
||||||
AF_ROUTE = 0x11
|
AF_ROUTE = 0x11
|
||||||
@@ -46,6 +46,7 @@ const (
|
|||||||
AF_SNA = 0xb
|
AF_SNA = 0xb
|
||||||
AF_UNIX = 0x1
|
AF_UNIX = 0x1
|
||||||
AF_UNSPEC = 0x0
|
AF_UNSPEC = 0x0
|
||||||
|
ALTWERASE = 0x200
|
||||||
B0 = 0x0
|
B0 = 0x0
|
||||||
B110 = 0x6e
|
B110 = 0x6e
|
||||||
B115200 = 0x1c200
|
B115200 = 0x1c200
|
||||||
@@ -141,7 +142,22 @@ const (
|
|||||||
BRKINT = 0x2
|
BRKINT = 0x2
|
||||||
CFLUSH = 0xf
|
CFLUSH = 0xf
|
||||||
CLOCAL = 0x8000
|
CLOCAL = 0x8000
|
||||||
|
CLOCK_MONOTONIC = 0x4
|
||||||
|
CLOCK_MONOTONIC_FAST = 0xc
|
||||||
|
CLOCK_MONOTONIC_PRECISE = 0xb
|
||||||
|
CLOCK_PROCESS_CPUTIME_ID = 0xf
|
||||||
|
CLOCK_PROF = 0x2
|
||||||
|
CLOCK_REALTIME = 0x0
|
||||||
|
CLOCK_REALTIME_FAST = 0xa
|
||||||
|
CLOCK_REALTIME_PRECISE = 0x9
|
||||||
|
CLOCK_SECOND = 0xd
|
||||||
|
CLOCK_THREAD_CPUTIME_ID = 0xe
|
||||||
|
CLOCK_UPTIME = 0x5
|
||||||
|
CLOCK_UPTIME_FAST = 0x8
|
||||||
|
CLOCK_UPTIME_PRECISE = 0x7
|
||||||
|
CLOCK_VIRTUAL = 0x1
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
|
CRTSCTS = 0x30000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
CS6 = 0x100
|
CS6 = 0x100
|
||||||
CS7 = 0x200
|
CS7 = 0x200
|
||||||
@@ -152,6 +168,8 @@ const (
|
|||||||
CSTOP = 0x13
|
CSTOP = 0x13
|
||||||
CSTOPB = 0x400
|
CSTOPB = 0x400
|
||||||
CSUSP = 0x1a
|
CSUSP = 0x1a
|
||||||
|
CTL_HW = 0x6
|
||||||
|
CTL_KERN = 0x1
|
||||||
CTL_MAXNAME = 0xc
|
CTL_MAXNAME = 0xc
|
||||||
CTL_NET = 0x4
|
CTL_NET = 0x4
|
||||||
DLT_A429 = 0xb8
|
DLT_A429 = 0xb8
|
||||||
@@ -286,24 +304,28 @@ const (
|
|||||||
ECHOPRT = 0x20
|
ECHOPRT = 0x20
|
||||||
EVFILT_AIO = -0x3
|
EVFILT_AIO = -0x3
|
||||||
EVFILT_EXCEPT = -0x8
|
EVFILT_EXCEPT = -0x8
|
||||||
|
EVFILT_FS = -0xa
|
||||||
EVFILT_MARKER = 0xf
|
EVFILT_MARKER = 0xf
|
||||||
EVFILT_PROC = -0x5
|
EVFILT_PROC = -0x5
|
||||||
EVFILT_READ = -0x1
|
EVFILT_READ = -0x1
|
||||||
EVFILT_SIGNAL = -0x6
|
EVFILT_SIGNAL = -0x6
|
||||||
EVFILT_SYSCOUNT = 0x8
|
EVFILT_SYSCOUNT = 0xa
|
||||||
EVFILT_TIMER = -0x7
|
EVFILT_TIMER = -0x7
|
||||||
|
EVFILT_USER = -0x9
|
||||||
EVFILT_VNODE = -0x4
|
EVFILT_VNODE = -0x4
|
||||||
EVFILT_WRITE = -0x2
|
EVFILT_WRITE = -0x2
|
||||||
EV_ADD = 0x1
|
EV_ADD = 0x1
|
||||||
EV_CLEAR = 0x20
|
EV_CLEAR = 0x20
|
||||||
EV_DELETE = 0x2
|
EV_DELETE = 0x2
|
||||||
EV_DISABLE = 0x8
|
EV_DISABLE = 0x8
|
||||||
|
EV_DISPATCH = 0x80
|
||||||
EV_ENABLE = 0x4
|
EV_ENABLE = 0x4
|
||||||
EV_EOF = 0x8000
|
EV_EOF = 0x8000
|
||||||
EV_ERROR = 0x4000
|
EV_ERROR = 0x4000
|
||||||
EV_FLAG1 = 0x2000
|
EV_FLAG1 = 0x2000
|
||||||
EV_NODATA = 0x1000
|
EV_NODATA = 0x1000
|
||||||
EV_ONESHOT = 0x10
|
EV_ONESHOT = 0x10
|
||||||
|
EV_RECEIPT = 0x40
|
||||||
EV_SYSFLAGS = 0xf000
|
EV_SYSFLAGS = 0xf000
|
||||||
EXTA = 0x4b00
|
EXTA = 0x4b00
|
||||||
EXTB = 0x9600
|
EXTB = 0x9600
|
||||||
@@ -333,6 +355,7 @@ const (
|
|||||||
F_UNLCK = 0x2
|
F_UNLCK = 0x2
|
||||||
F_WRLCK = 0x3
|
F_WRLCK = 0x3
|
||||||
HUPCL = 0x4000
|
HUPCL = 0x4000
|
||||||
|
HW_MACHINE = 0x1
|
||||||
ICANON = 0x100
|
ICANON = 0x100
|
||||||
ICMP6_FILTER = 0x12
|
ICMP6_FILTER = 0x12
|
||||||
ICRNL = 0x100
|
ICRNL = 0x100
|
||||||
@@ -679,7 +702,6 @@ const (
|
|||||||
IPPROTO_SATEXPAK = 0x40
|
IPPROTO_SATEXPAK = 0x40
|
||||||
IPPROTO_SATMON = 0x45
|
IPPROTO_SATMON = 0x45
|
||||||
IPPROTO_SCCSP = 0x60
|
IPPROTO_SCCSP = 0x60
|
||||||
IPPROTO_SCTP = 0x84
|
|
||||||
IPPROTO_SDRP = 0x2a
|
IPPROTO_SDRP = 0x2a
|
||||||
IPPROTO_SEP = 0x21
|
IPPROTO_SEP = 0x21
|
||||||
IPPROTO_SKIP = 0x39
|
IPPROTO_SKIP = 0x39
|
||||||
@@ -730,6 +752,7 @@ const (
|
|||||||
IPV6_LEAVE_GROUP = 0xd
|
IPV6_LEAVE_GROUP = 0xd
|
||||||
IPV6_MAXHLIM = 0xff
|
IPV6_MAXHLIM = 0xff
|
||||||
IPV6_MAXPACKET = 0xffff
|
IPV6_MAXPACKET = 0xffff
|
||||||
|
IPV6_MINHLIM = 0x28
|
||||||
IPV6_MMTU = 0x500
|
IPV6_MMTU = 0x500
|
||||||
IPV6_MSFILTER = 0x4a
|
IPV6_MSFILTER = 0x4a
|
||||||
IPV6_MULTICAST_HOPS = 0xa
|
IPV6_MULTICAST_HOPS = 0xa
|
||||||
@@ -778,6 +801,7 @@ const (
|
|||||||
IP_FW_FLUSH = 0x34
|
IP_FW_FLUSH = 0x34
|
||||||
IP_FW_GET = 0x36
|
IP_FW_GET = 0x36
|
||||||
IP_FW_RESETLOG = 0x37
|
IP_FW_RESETLOG = 0x37
|
||||||
|
IP_FW_X = 0x31
|
||||||
IP_FW_ZERO = 0x35
|
IP_FW_ZERO = 0x35
|
||||||
IP_HDRINCL = 0x2
|
IP_HDRINCL = 0x2
|
||||||
IP_IPSEC_POLICY = 0x15
|
IP_IPSEC_POLICY = 0x15
|
||||||
@@ -814,6 +838,10 @@ const (
|
|||||||
IXANY = 0x800
|
IXANY = 0x800
|
||||||
IXOFF = 0x400
|
IXOFF = 0x400
|
||||||
IXON = 0x200
|
IXON = 0x200
|
||||||
|
KERN_HOSTNAME = 0xa
|
||||||
|
KERN_OSRELEASE = 0x2
|
||||||
|
KERN_OSTYPE = 0x1
|
||||||
|
KERN_VERSION = 0x4
|
||||||
LOCK_EX = 0x2
|
LOCK_EX = 0x2
|
||||||
LOCK_NB = 0x4
|
LOCK_NB = 0x4
|
||||||
LOCK_SH = 0x1
|
LOCK_SH = 0x1
|
||||||
@@ -833,6 +861,7 @@ const (
|
|||||||
MADV_SETMAP = 0xb
|
MADV_SETMAP = 0xb
|
||||||
MADV_WILLNEED = 0x3
|
MADV_WILLNEED = 0x3
|
||||||
MAP_ANON = 0x1000
|
MAP_ANON = 0x1000
|
||||||
|
MAP_ANONYMOUS = 0x1000
|
||||||
MAP_COPY = 0x2
|
MAP_COPY = 0x2
|
||||||
MAP_FILE = 0x0
|
MAP_FILE = 0x0
|
||||||
MAP_FIXED = 0x10
|
MAP_FIXED = 0x10
|
||||||
@@ -851,6 +880,7 @@ const (
|
|||||||
MAP_VPAGETABLE = 0x2000
|
MAP_VPAGETABLE = 0x2000
|
||||||
MCL_CURRENT = 0x1
|
MCL_CURRENT = 0x1
|
||||||
MCL_FUTURE = 0x2
|
MCL_FUTURE = 0x2
|
||||||
|
MSG_CMSG_CLOEXEC = 0x1000
|
||||||
MSG_CTRUNC = 0x20
|
MSG_CTRUNC = 0x20
|
||||||
MSG_DONTROUTE = 0x4
|
MSG_DONTROUTE = 0x4
|
||||||
MSG_DONTWAIT = 0x80
|
MSG_DONTWAIT = 0x80
|
||||||
@@ -860,11 +890,11 @@ const (
|
|||||||
MSG_FMASK = 0xffff0000
|
MSG_FMASK = 0xffff0000
|
||||||
MSG_FNONBLOCKING = 0x20000
|
MSG_FNONBLOCKING = 0x20000
|
||||||
MSG_NOSIGNAL = 0x400
|
MSG_NOSIGNAL = 0x400
|
||||||
MSG_NOTIFICATION = 0x200
|
|
||||||
MSG_OOB = 0x1
|
MSG_OOB = 0x1
|
||||||
MSG_PEEK = 0x2
|
MSG_PEEK = 0x2
|
||||||
MSG_SYNC = 0x800
|
MSG_SYNC = 0x800
|
||||||
MSG_TRUNC = 0x10
|
MSG_TRUNC = 0x10
|
||||||
|
MSG_UNUSED09 = 0x200
|
||||||
MSG_WAITALL = 0x40
|
MSG_WAITALL = 0x40
|
||||||
MS_ASYNC = 0x1
|
MS_ASYNC = 0x1
|
||||||
MS_INVALIDATE = 0x2
|
MS_INVALIDATE = 0x2
|
||||||
@@ -875,12 +905,19 @@ const (
|
|||||||
NET_RT_IFLIST = 0x3
|
NET_RT_IFLIST = 0x3
|
||||||
NET_RT_MAXID = 0x4
|
NET_RT_MAXID = 0x4
|
||||||
NOFLSH = 0x80000000
|
NOFLSH = 0x80000000
|
||||||
|
NOKERNINFO = 0x2000000
|
||||||
NOTE_ATTRIB = 0x8
|
NOTE_ATTRIB = 0x8
|
||||||
NOTE_CHILD = 0x4
|
NOTE_CHILD = 0x4
|
||||||
NOTE_DELETE = 0x1
|
NOTE_DELETE = 0x1
|
||||||
NOTE_EXEC = 0x20000000
|
NOTE_EXEC = 0x20000000
|
||||||
NOTE_EXIT = 0x80000000
|
NOTE_EXIT = 0x80000000
|
||||||
NOTE_EXTEND = 0x4
|
NOTE_EXTEND = 0x4
|
||||||
|
NOTE_FFAND = 0x40000000
|
||||||
|
NOTE_FFCOPY = 0xc0000000
|
||||||
|
NOTE_FFCTRLMASK = 0xc0000000
|
||||||
|
NOTE_FFLAGSMASK = 0xffffff
|
||||||
|
NOTE_FFNOP = 0x0
|
||||||
|
NOTE_FFOR = 0x80000000
|
||||||
NOTE_FORK = 0x40000000
|
NOTE_FORK = 0x40000000
|
||||||
NOTE_LINK = 0x10
|
NOTE_LINK = 0x10
|
||||||
NOTE_LOWAT = 0x1
|
NOTE_LOWAT = 0x1
|
||||||
@@ -891,6 +928,7 @@ const (
|
|||||||
NOTE_REVOKE = 0x40
|
NOTE_REVOKE = 0x40
|
||||||
NOTE_TRACK = 0x1
|
NOTE_TRACK = 0x1
|
||||||
NOTE_TRACKERR = 0x2
|
NOTE_TRACKERR = 0x2
|
||||||
|
NOTE_TRIGGER = 0x1000000
|
||||||
NOTE_WRITE = 0x2
|
NOTE_WRITE = 0x2
|
||||||
OCRNL = 0x10
|
OCRNL = 0x10
|
||||||
ONLCR = 0x2
|
ONLCR = 0x2
|
||||||
@@ -898,6 +936,7 @@ const (
|
|||||||
ONOCR = 0x20
|
ONOCR = 0x20
|
||||||
ONOEOT = 0x8
|
ONOEOT = 0x8
|
||||||
OPOST = 0x1
|
OPOST = 0x1
|
||||||
|
OXTABS = 0x4
|
||||||
O_ACCMODE = 0x3
|
O_ACCMODE = 0x3
|
||||||
O_APPEND = 0x8
|
O_APPEND = 0x8
|
||||||
O_ASYNC = 0x40
|
O_ASYNC = 0x40
|
||||||
@@ -910,14 +949,11 @@ const (
|
|||||||
O_FAPPEND = 0x100000
|
O_FAPPEND = 0x100000
|
||||||
O_FASYNCWRITE = 0x800000
|
O_FASYNCWRITE = 0x800000
|
||||||
O_FBLOCKING = 0x40000
|
O_FBLOCKING = 0x40000
|
||||||
O_FBUFFERED = 0x2000000
|
O_FMASK = 0xfc0000
|
||||||
O_FMASK = 0x7fc0000
|
|
||||||
O_FNONBLOCKING = 0x80000
|
O_FNONBLOCKING = 0x80000
|
||||||
O_FOFFSET = 0x200000
|
O_FOFFSET = 0x200000
|
||||||
O_FSYNC = 0x80
|
O_FSYNC = 0x80
|
||||||
O_FSYNCWRITE = 0x400000
|
O_FSYNCWRITE = 0x400000
|
||||||
O_FUNBUFFERED = 0x1000000
|
|
||||||
O_MAPONREAD = 0x4000000
|
|
||||||
O_NDELAY = 0x4
|
O_NDELAY = 0x4
|
||||||
O_NOCTTY = 0x8000
|
O_NOCTTY = 0x8000
|
||||||
O_NOFOLLOW = 0x100
|
O_NOFOLLOW = 0x100
|
||||||
@@ -1096,8 +1132,10 @@ const (
|
|||||||
SIOCSLIFPHYADDR = 0x8118694a
|
SIOCSLIFPHYADDR = 0x8118694a
|
||||||
SIOCSLOWAT = 0x80047302
|
SIOCSLOWAT = 0x80047302
|
||||||
SIOCSPGRP = 0x80047308
|
SIOCSPGRP = 0x80047308
|
||||||
|
SOCK_CLOEXEC = 0x10000000
|
||||||
SOCK_DGRAM = 0x2
|
SOCK_DGRAM = 0x2
|
||||||
SOCK_MAXADDRLEN = 0xff
|
SOCK_MAXADDRLEN = 0xff
|
||||||
|
SOCK_NONBLOCK = 0x20000000
|
||||||
SOCK_RAW = 0x3
|
SOCK_RAW = 0x3
|
||||||
SOCK_RDM = 0x4
|
SOCK_RDM = 0x4
|
||||||
SOCK_SEQPACKET = 0x5
|
SOCK_SEQPACKET = 0x5
|
||||||
@@ -1107,6 +1145,7 @@ const (
|
|||||||
SO_ACCEPTCONN = 0x2
|
SO_ACCEPTCONN = 0x2
|
||||||
SO_ACCEPTFILTER = 0x1000
|
SO_ACCEPTFILTER = 0x1000
|
||||||
SO_BROADCAST = 0x20
|
SO_BROADCAST = 0x20
|
||||||
|
SO_CPUHINT = 0x1030
|
||||||
SO_DEBUG = 0x1
|
SO_DEBUG = 0x1
|
||||||
SO_DONTROUTE = 0x10
|
SO_DONTROUTE = 0x10
|
||||||
SO_ERROR = 0x1007
|
SO_ERROR = 0x1007
|
||||||
@@ -1127,8 +1166,12 @@ const (
|
|||||||
SO_TYPE = 0x1008
|
SO_TYPE = 0x1008
|
||||||
SO_USELOOPBACK = 0x40
|
SO_USELOOPBACK = 0x40
|
||||||
TCIFLUSH = 0x1
|
TCIFLUSH = 0x1
|
||||||
|
TCIOFF = 0x3
|
||||||
TCIOFLUSH = 0x3
|
TCIOFLUSH = 0x3
|
||||||
|
TCION = 0x4
|
||||||
TCOFLUSH = 0x2
|
TCOFLUSH = 0x2
|
||||||
|
TCOOFF = 0x1
|
||||||
|
TCOON = 0x2
|
||||||
TCP_FASTKEEP = 0x80
|
TCP_FASTKEEP = 0x80
|
||||||
TCP_KEEPCNT = 0x400
|
TCP_KEEPCNT = 0x400
|
||||||
TCP_KEEPIDLE = 0x100
|
TCP_KEEPIDLE = 0x100
|
||||||
@@ -1227,6 +1270,8 @@ const (
|
|||||||
VKILL = 0x5
|
VKILL = 0x5
|
||||||
VLNEXT = 0xe
|
VLNEXT = 0xe
|
||||||
VMIN = 0x10
|
VMIN = 0x10
|
||||||
|
VM_BCACHE_SIZE_MAX = 0x0
|
||||||
|
VM_SWZONE_SIZE_MAX = 0x4000000000
|
||||||
VQUIT = 0x9
|
VQUIT = 0x9
|
||||||
VREPRINT = 0x6
|
VREPRINT = 0x6
|
||||||
VSTART = 0xc
|
VSTART = 0xc
|
||||||
|
|||||||
+1464
-1451
File diff suppressed because it is too large
Load Diff
+1465
-1456
File diff suppressed because it is too large
Load Diff
+1473
-1437
File diff suppressed because it is too large
Load Diff
+1890
-1532
File diff suppressed because it is too large
Load Diff
+1891
-1540
File diff suppressed because it is too large
Load Diff
+1895
-1460
File diff suppressed because it is too large
Load Diff
+1879
-1610
File diff suppressed because it is too large
Load Diff
+1895
-1509
File diff suppressed because it is too large
Load Diff
+1893
-1603
File diff suppressed because it is too large
Load Diff
+1893
-1603
File diff suppressed because it is too large
Load Diff
+1893
-1704
File diff suppressed because it is too large
Load Diff
+1950
-1682
File diff suppressed because it is too large
Load Diff
+1950
-1678
File diff suppressed because it is too large
Load Diff
+1950
-1736
File diff suppressed because it is too large
Load Diff
+8
-1
@@ -1,5 +1,5 @@
|
|||||||
// mkerrors.sh -m32
|
// mkerrors.sh -m32
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build 386,netbsd
|
// +build 386,netbsd
|
||||||
|
|
||||||
@@ -169,6 +169,8 @@ const (
|
|||||||
CSTOP = 0x13
|
CSTOP = 0x13
|
||||||
CSTOPB = 0x400
|
CSTOPB = 0x400
|
||||||
CSUSP = 0x1a
|
CSUSP = 0x1a
|
||||||
|
CTL_HW = 0x6
|
||||||
|
CTL_KERN = 0x1
|
||||||
CTL_MAXNAME = 0xc
|
CTL_MAXNAME = 0xc
|
||||||
CTL_NET = 0x4
|
CTL_NET = 0x4
|
||||||
CTL_QUERY = -0x2
|
CTL_QUERY = -0x2
|
||||||
@@ -581,6 +583,7 @@ const (
|
|||||||
F_UNLCK = 0x2
|
F_UNLCK = 0x2
|
||||||
F_WRLCK = 0x3
|
F_WRLCK = 0x3
|
||||||
HUPCL = 0x4000
|
HUPCL = 0x4000
|
||||||
|
HW_MACHINE = 0x1
|
||||||
ICANON = 0x100
|
ICANON = 0x100
|
||||||
ICMP6_FILTER = 0x12
|
ICMP6_FILTER = 0x12
|
||||||
ICRNL = 0x100
|
ICRNL = 0x100
|
||||||
@@ -970,6 +973,10 @@ const (
|
|||||||
IXANY = 0x800
|
IXANY = 0x800
|
||||||
IXOFF = 0x400
|
IXOFF = 0x400
|
||||||
IXON = 0x200
|
IXON = 0x200
|
||||||
|
KERN_HOSTNAME = 0xa
|
||||||
|
KERN_OSRELEASE = 0x2
|
||||||
|
KERN_OSTYPE = 0x1
|
||||||
|
KERN_VERSION = 0x4
|
||||||
LOCK_EX = 0x2
|
LOCK_EX = 0x2
|
||||||
LOCK_NB = 0x4
|
LOCK_NB = 0x4
|
||||||
LOCK_SH = 0x1
|
LOCK_SH = 0x1
|
||||||
|
|||||||
+8
-1
@@ -1,5 +1,5 @@
|
|||||||
// mkerrors.sh -m64
|
// mkerrors.sh -m64
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build amd64,netbsd
|
// +build amd64,netbsd
|
||||||
|
|
||||||
@@ -169,6 +169,8 @@ const (
|
|||||||
CSTOP = 0x13
|
CSTOP = 0x13
|
||||||
CSTOPB = 0x400
|
CSTOPB = 0x400
|
||||||
CSUSP = 0x1a
|
CSUSP = 0x1a
|
||||||
|
CTL_HW = 0x6
|
||||||
|
CTL_KERN = 0x1
|
||||||
CTL_MAXNAME = 0xc
|
CTL_MAXNAME = 0xc
|
||||||
CTL_NET = 0x4
|
CTL_NET = 0x4
|
||||||
CTL_QUERY = -0x2
|
CTL_QUERY = -0x2
|
||||||
@@ -571,6 +573,7 @@ const (
|
|||||||
F_UNLCK = 0x2
|
F_UNLCK = 0x2
|
||||||
F_WRLCK = 0x3
|
F_WRLCK = 0x3
|
||||||
HUPCL = 0x4000
|
HUPCL = 0x4000
|
||||||
|
HW_MACHINE = 0x1
|
||||||
ICANON = 0x100
|
ICANON = 0x100
|
||||||
ICMP6_FILTER = 0x12
|
ICMP6_FILTER = 0x12
|
||||||
ICRNL = 0x100
|
ICRNL = 0x100
|
||||||
@@ -960,6 +963,10 @@ const (
|
|||||||
IXANY = 0x800
|
IXANY = 0x800
|
||||||
IXOFF = 0x400
|
IXOFF = 0x400
|
||||||
IXON = 0x200
|
IXON = 0x200
|
||||||
|
KERN_HOSTNAME = 0xa
|
||||||
|
KERN_OSRELEASE = 0x2
|
||||||
|
KERN_OSTYPE = 0x1
|
||||||
|
KERN_VERSION = 0x4
|
||||||
LOCK_EX = 0x2
|
LOCK_EX = 0x2
|
||||||
LOCK_NB = 0x4
|
LOCK_NB = 0x4
|
||||||
LOCK_SH = 0x1
|
LOCK_SH = 0x1
|
||||||
|
|||||||
+11
-1
@@ -1,5 +1,5 @@
|
|||||||
// mkerrors.sh -marm
|
// mkerrors.sh -marm
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build arm,netbsd
|
// +build arm,netbsd
|
||||||
|
|
||||||
@@ -161,6 +161,8 @@ const (
|
|||||||
CSTOP = 0x13
|
CSTOP = 0x13
|
||||||
CSTOPB = 0x400
|
CSTOPB = 0x400
|
||||||
CSUSP = 0x1a
|
CSUSP = 0x1a
|
||||||
|
CTL_HW = 0x6
|
||||||
|
CTL_KERN = 0x1
|
||||||
CTL_MAXNAME = 0xc
|
CTL_MAXNAME = 0xc
|
||||||
CTL_NET = 0x4
|
CTL_NET = 0x4
|
||||||
CTL_QUERY = -0x2
|
CTL_QUERY = -0x2
|
||||||
@@ -563,6 +565,7 @@ const (
|
|||||||
F_UNLCK = 0x2
|
F_UNLCK = 0x2
|
||||||
F_WRLCK = 0x3
|
F_WRLCK = 0x3
|
||||||
HUPCL = 0x4000
|
HUPCL = 0x4000
|
||||||
|
HW_MACHINE = 0x1
|
||||||
ICANON = 0x100
|
ICANON = 0x100
|
||||||
ICMP6_FILTER = 0x12
|
ICMP6_FILTER = 0x12
|
||||||
ICRNL = 0x100
|
ICRNL = 0x100
|
||||||
@@ -952,6 +955,10 @@ const (
|
|||||||
IXANY = 0x800
|
IXANY = 0x800
|
||||||
IXOFF = 0x400
|
IXOFF = 0x400
|
||||||
IXON = 0x200
|
IXON = 0x200
|
||||||
|
KERN_HOSTNAME = 0xa
|
||||||
|
KERN_OSRELEASE = 0x2
|
||||||
|
KERN_OSTYPE = 0x1
|
||||||
|
KERN_VERSION = 0x4
|
||||||
LOCK_EX = 0x2
|
LOCK_EX = 0x2
|
||||||
LOCK_NB = 0x4
|
LOCK_NB = 0x4
|
||||||
LOCK_SH = 0x1
|
LOCK_SH = 0x1
|
||||||
@@ -1006,6 +1013,9 @@ const (
|
|||||||
MSG_TRUNC = 0x10
|
MSG_TRUNC = 0x10
|
||||||
MSG_USERFLAGS = 0xffffff
|
MSG_USERFLAGS = 0xffffff
|
||||||
MSG_WAITALL = 0x40
|
MSG_WAITALL = 0x40
|
||||||
|
MS_ASYNC = 0x1
|
||||||
|
MS_INVALIDATE = 0x2
|
||||||
|
MS_SYNC = 0x4
|
||||||
NAME_MAX = 0x1ff
|
NAME_MAX = 0x1ff
|
||||||
NET_RT_DUMP = 0x1
|
NET_RT_DUMP = 0x1
|
||||||
NET_RT_FLAGS = 0x2
|
NET_RT_FLAGS = 0x2
|
||||||
|
|||||||
+8
-1
@@ -1,5 +1,5 @@
|
|||||||
// mkerrors.sh -m32
|
// mkerrors.sh -m32
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build 386,openbsd
|
// +build 386,openbsd
|
||||||
|
|
||||||
@@ -157,6 +157,8 @@ const (
|
|||||||
CSTOP = 0x13
|
CSTOP = 0x13
|
||||||
CSTOPB = 0x400
|
CSTOPB = 0x400
|
||||||
CSUSP = 0x1a
|
CSUSP = 0x1a
|
||||||
|
CTL_HW = 0x6
|
||||||
|
CTL_KERN = 0x1
|
||||||
CTL_MAXNAME = 0xc
|
CTL_MAXNAME = 0xc
|
||||||
CTL_NET = 0x4
|
CTL_NET = 0x4
|
||||||
DIOCOSFPFLUSH = 0x2000444e
|
DIOCOSFPFLUSH = 0x2000444e
|
||||||
@@ -442,6 +444,7 @@ const (
|
|||||||
F_UNLCK = 0x2
|
F_UNLCK = 0x2
|
||||||
F_WRLCK = 0x3
|
F_WRLCK = 0x3
|
||||||
HUPCL = 0x4000
|
HUPCL = 0x4000
|
||||||
|
HW_MACHINE = 0x1
|
||||||
ICANON = 0x100
|
ICANON = 0x100
|
||||||
ICMP6_FILTER = 0x12
|
ICMP6_FILTER = 0x12
|
||||||
ICRNL = 0x100
|
ICRNL = 0x100
|
||||||
@@ -860,6 +863,10 @@ const (
|
|||||||
IXANY = 0x800
|
IXANY = 0x800
|
||||||
IXOFF = 0x400
|
IXOFF = 0x400
|
||||||
IXON = 0x200
|
IXON = 0x200
|
||||||
|
KERN_HOSTNAME = 0xa
|
||||||
|
KERN_OSRELEASE = 0x2
|
||||||
|
KERN_OSTYPE = 0x1
|
||||||
|
KERN_VERSION = 0x4
|
||||||
LCNT_OVERLOAD_FLUSH = 0x6
|
LCNT_OVERLOAD_FLUSH = 0x6
|
||||||
LOCK_EX = 0x2
|
LOCK_EX = 0x2
|
||||||
LOCK_NB = 0x4
|
LOCK_NB = 0x4
|
||||||
|
|||||||
+8
-1
@@ -1,5 +1,5 @@
|
|||||||
// mkerrors.sh -m64
|
// mkerrors.sh -m64
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build amd64,openbsd
|
// +build amd64,openbsd
|
||||||
|
|
||||||
@@ -157,6 +157,8 @@ const (
|
|||||||
CSTOP = 0x13
|
CSTOP = 0x13
|
||||||
CSTOPB = 0x400
|
CSTOPB = 0x400
|
||||||
CSUSP = 0x1a
|
CSUSP = 0x1a
|
||||||
|
CTL_HW = 0x6
|
||||||
|
CTL_KERN = 0x1
|
||||||
CTL_MAXNAME = 0xc
|
CTL_MAXNAME = 0xc
|
||||||
CTL_NET = 0x4
|
CTL_NET = 0x4
|
||||||
DIOCOSFPFLUSH = 0x2000444e
|
DIOCOSFPFLUSH = 0x2000444e
|
||||||
@@ -442,6 +444,7 @@ const (
|
|||||||
F_UNLCK = 0x2
|
F_UNLCK = 0x2
|
||||||
F_WRLCK = 0x3
|
F_WRLCK = 0x3
|
||||||
HUPCL = 0x4000
|
HUPCL = 0x4000
|
||||||
|
HW_MACHINE = 0x1
|
||||||
ICANON = 0x100
|
ICANON = 0x100
|
||||||
ICMP6_FILTER = 0x12
|
ICMP6_FILTER = 0x12
|
||||||
ICRNL = 0x100
|
ICRNL = 0x100
|
||||||
@@ -860,6 +863,10 @@ const (
|
|||||||
IXANY = 0x800
|
IXANY = 0x800
|
||||||
IXOFF = 0x400
|
IXOFF = 0x400
|
||||||
IXON = 0x200
|
IXON = 0x200
|
||||||
|
KERN_HOSTNAME = 0xa
|
||||||
|
KERN_OSRELEASE = 0x2
|
||||||
|
KERN_OSTYPE = 0x1
|
||||||
|
KERN_VERSION = 0x4
|
||||||
LCNT_OVERLOAD_FLUSH = 0x6
|
LCNT_OVERLOAD_FLUSH = 0x6
|
||||||
LOCK_EX = 0x2
|
LOCK_EX = 0x2
|
||||||
LOCK_NB = 0x4
|
LOCK_NB = 0x4
|
||||||
|
|||||||
+1593
File diff suppressed because it is too large
Load Diff
+54
-1
@@ -1,5 +1,5 @@
|
|||||||
// mkerrors.sh -m64
|
// mkerrors.sh -m64
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build amd64,solaris
|
// +build amd64,solaris
|
||||||
|
|
||||||
@@ -159,7 +159,12 @@ const (
|
|||||||
BPF_W = 0x0
|
BPF_W = 0x0
|
||||||
BPF_X = 0x8
|
BPF_X = 0x8
|
||||||
BRKINT = 0x2
|
BRKINT = 0x2
|
||||||
|
BS0 = 0x0
|
||||||
|
BS1 = 0x2000
|
||||||
|
BSDLY = 0x2000
|
||||||
|
CBAUD = 0xf
|
||||||
CFLUSH = 0xf
|
CFLUSH = 0xf
|
||||||
|
CIBAUD = 0xf0000
|
||||||
CLOCAL = 0x800
|
CLOCAL = 0x800
|
||||||
CLOCK_HIGHRES = 0x4
|
CLOCK_HIGHRES = 0x4
|
||||||
CLOCK_LEVEL = 0xa
|
CLOCK_LEVEL = 0xa
|
||||||
@@ -169,7 +174,13 @@ const (
|
|||||||
CLOCK_REALTIME = 0x3
|
CLOCK_REALTIME = 0x3
|
||||||
CLOCK_THREAD_CPUTIME_ID = 0x2
|
CLOCK_THREAD_CPUTIME_ID = 0x2
|
||||||
CLOCK_VIRTUAL = 0x1
|
CLOCK_VIRTUAL = 0x1
|
||||||
|
CR0 = 0x0
|
||||||
|
CR1 = 0x200
|
||||||
|
CR2 = 0x400
|
||||||
|
CR3 = 0x600
|
||||||
|
CRDLY = 0x600
|
||||||
CREAD = 0x80
|
CREAD = 0x80
|
||||||
|
CRTSCTS = 0x80000000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
CS6 = 0x10
|
CS6 = 0x10
|
||||||
CS7 = 0x20
|
CS7 = 0x20
|
||||||
@@ -276,6 +287,9 @@ const (
|
|||||||
FD_CLOEXEC = 0x1
|
FD_CLOEXEC = 0x1
|
||||||
FD_NFDBITS = 0x40
|
FD_NFDBITS = 0x40
|
||||||
FD_SETSIZE = 0x10000
|
FD_SETSIZE = 0x10000
|
||||||
|
FF0 = 0x0
|
||||||
|
FF1 = 0x8000
|
||||||
|
FFDLY = 0x8000
|
||||||
FLUSHALL = 0x1
|
FLUSHALL = 0x1
|
||||||
FLUSHDATA = 0x0
|
FLUSHDATA = 0x0
|
||||||
FLUSHO = 0x2000
|
FLUSHO = 0x2000
|
||||||
@@ -290,6 +304,10 @@ const (
|
|||||||
F_DUP2FD_CLOEXEC = 0x24
|
F_DUP2FD_CLOEXEC = 0x24
|
||||||
F_DUPFD = 0x0
|
F_DUPFD = 0x0
|
||||||
F_DUPFD_CLOEXEC = 0x25
|
F_DUPFD_CLOEXEC = 0x25
|
||||||
|
F_FLOCK = 0x35
|
||||||
|
F_FLOCK64 = 0x35
|
||||||
|
F_FLOCKW = 0x36
|
||||||
|
F_FLOCKW64 = 0x36
|
||||||
F_FREESP = 0xb
|
F_FREESP = 0xb
|
||||||
F_FREESP64 = 0xb
|
F_FREESP64 = 0xb
|
||||||
F_GETFD = 0x1
|
F_GETFD = 0x1
|
||||||
@@ -304,6 +322,12 @@ const (
|
|||||||
F_MDACC = 0x20
|
F_MDACC = 0x20
|
||||||
F_NODNY = 0x0
|
F_NODNY = 0x0
|
||||||
F_NPRIV = 0x10
|
F_NPRIV = 0x10
|
||||||
|
F_OFD_GETLK = 0x2f
|
||||||
|
F_OFD_GETLK64 = 0x2f
|
||||||
|
F_OFD_SETLK = 0x30
|
||||||
|
F_OFD_SETLK64 = 0x30
|
||||||
|
F_OFD_SETLKW = 0x31
|
||||||
|
F_OFD_SETLKW64 = 0x31
|
||||||
F_PRIV = 0xf
|
F_PRIV = 0xf
|
||||||
F_QUOTACTL = 0x11
|
F_QUOTACTL = 0x11
|
||||||
F_RDACC = 0x1
|
F_RDACC = 0x1
|
||||||
@@ -332,6 +356,7 @@ const (
|
|||||||
F_WRDNY = 0x2
|
F_WRDNY = 0x2
|
||||||
F_WRLCK = 0x2
|
F_WRLCK = 0x2
|
||||||
HUPCL = 0x400
|
HUPCL = 0x400
|
||||||
|
IBSHIFT = 0x10
|
||||||
ICANON = 0x2
|
ICANON = 0x2
|
||||||
ICRNL = 0x100
|
ICRNL = 0x100
|
||||||
IEXTEN = 0x8000
|
IEXTEN = 0x8000
|
||||||
@@ -589,15 +614,21 @@ const (
|
|||||||
IP_UNSPEC_SRC = 0x42
|
IP_UNSPEC_SRC = 0x42
|
||||||
ISIG = 0x1
|
ISIG = 0x1
|
||||||
ISTRIP = 0x20
|
ISTRIP = 0x20
|
||||||
|
IUCLC = 0x200
|
||||||
IXANY = 0x800
|
IXANY = 0x800
|
||||||
IXOFF = 0x1000
|
IXOFF = 0x1000
|
||||||
IXON = 0x400
|
IXON = 0x400
|
||||||
|
LOCK_EX = 0x2
|
||||||
|
LOCK_NB = 0x4
|
||||||
|
LOCK_SH = 0x1
|
||||||
|
LOCK_UN = 0x8
|
||||||
MADV_ACCESS_DEFAULT = 0x6
|
MADV_ACCESS_DEFAULT = 0x6
|
||||||
MADV_ACCESS_LWP = 0x7
|
MADV_ACCESS_LWP = 0x7
|
||||||
MADV_ACCESS_MANY = 0x8
|
MADV_ACCESS_MANY = 0x8
|
||||||
MADV_DONTNEED = 0x4
|
MADV_DONTNEED = 0x4
|
||||||
MADV_FREE = 0x5
|
MADV_FREE = 0x5
|
||||||
MADV_NORMAL = 0x0
|
MADV_NORMAL = 0x0
|
||||||
|
MADV_PURGE = 0x9
|
||||||
MADV_RANDOM = 0x1
|
MADV_RANDOM = 0x1
|
||||||
MADV_SEQUENTIAL = 0x2
|
MADV_SEQUENTIAL = 0x2
|
||||||
MADV_WILLNEED = 0x3
|
MADV_WILLNEED = 0x3
|
||||||
@@ -605,6 +636,7 @@ const (
|
|||||||
MAP_ALIGN = 0x200
|
MAP_ALIGN = 0x200
|
||||||
MAP_ANON = 0x100
|
MAP_ANON = 0x100
|
||||||
MAP_ANONYMOUS = 0x100
|
MAP_ANONYMOUS = 0x100
|
||||||
|
MAP_FILE = 0x0
|
||||||
MAP_FIXED = 0x10
|
MAP_FIXED = 0x10
|
||||||
MAP_INITDATA = 0x800
|
MAP_INITDATA = 0x800
|
||||||
MAP_NORESERVE = 0x40
|
MAP_NORESERVE = 0x40
|
||||||
@@ -632,10 +664,19 @@ const (
|
|||||||
MS_OLDSYNC = 0x0
|
MS_OLDSYNC = 0x0
|
||||||
MS_SYNC = 0x4
|
MS_SYNC = 0x4
|
||||||
M_FLUSH = 0x86
|
M_FLUSH = 0x86
|
||||||
|
NAME_MAX = 0xff
|
||||||
|
NEWDEV = 0x1
|
||||||
|
NL0 = 0x0
|
||||||
|
NL1 = 0x100
|
||||||
|
NLDLY = 0x100
|
||||||
NOFLSH = 0x80
|
NOFLSH = 0x80
|
||||||
OCRNL = 0x8
|
OCRNL = 0x8
|
||||||
OFDEL = 0x80
|
OFDEL = 0x80
|
||||||
OFILL = 0x40
|
OFILL = 0x40
|
||||||
|
OLCUC = 0x2
|
||||||
|
OLDDEV = 0x0
|
||||||
|
ONBITSMAJOR = 0x7
|
||||||
|
ONBITSMINOR = 0x8
|
||||||
ONLCR = 0x4
|
ONLCR = 0x4
|
||||||
ONLRET = 0x20
|
ONLRET = 0x20
|
||||||
ONOCR = 0x10
|
ONOCR = 0x10
|
||||||
@@ -955,12 +996,21 @@ const (
|
|||||||
SO_USELOOPBACK = 0x40
|
SO_USELOOPBACK = 0x40
|
||||||
SO_VRRP = 0x1017
|
SO_VRRP = 0x1017
|
||||||
SO_WROFF = 0x2
|
SO_WROFF = 0x2
|
||||||
|
TAB0 = 0x0
|
||||||
|
TAB1 = 0x800
|
||||||
|
TAB2 = 0x1000
|
||||||
|
TAB3 = 0x1800
|
||||||
|
TABDLY = 0x1800
|
||||||
TCFLSH = 0x5407
|
TCFLSH = 0x5407
|
||||||
TCGETA = 0x5401
|
TCGETA = 0x5401
|
||||||
TCGETS = 0x540d
|
TCGETS = 0x540d
|
||||||
TCIFLUSH = 0x0
|
TCIFLUSH = 0x0
|
||||||
|
TCIOFF = 0x2
|
||||||
TCIOFLUSH = 0x2
|
TCIOFLUSH = 0x2
|
||||||
|
TCION = 0x3
|
||||||
TCOFLUSH = 0x1
|
TCOFLUSH = 0x1
|
||||||
|
TCOOFF = 0x0
|
||||||
|
TCOON = 0x1
|
||||||
TCP_ABORT_THRESHOLD = 0x11
|
TCP_ABORT_THRESHOLD = 0x11
|
||||||
TCP_ANONPRIVBIND = 0x20
|
TCP_ANONPRIVBIND = 0x20
|
||||||
TCP_CONN_ABORT_THRESHOLD = 0x13
|
TCP_CONN_ABORT_THRESHOLD = 0x13
|
||||||
@@ -1060,6 +1110,7 @@ const (
|
|||||||
VEOL = 0x5
|
VEOL = 0x5
|
||||||
VEOL2 = 0x6
|
VEOL2 = 0x6
|
||||||
VERASE = 0x2
|
VERASE = 0x2
|
||||||
|
VERASE2 = 0x11
|
||||||
VINTR = 0x0
|
VINTR = 0x0
|
||||||
VKILL = 0x3
|
VKILL = 0x3
|
||||||
VLNEXT = 0xf
|
VLNEXT = 0xf
|
||||||
@@ -1089,6 +1140,8 @@ const (
|
|||||||
WSTOPPED = 0x4
|
WSTOPPED = 0x4
|
||||||
WTRAPPED = 0x2
|
WTRAPPED = 0x2
|
||||||
WUNTRACED = 0x4
|
WUNTRACED = 0x4
|
||||||
|
XCASE = 0x4
|
||||||
|
XTABS = 0x1800
|
||||||
)
|
)
|
||||||
|
|
||||||
// Errors
|
// Errors
|
||||||
|
|||||||
+80
@@ -0,0 +1,80 @@
|
|||||||
|
// Code generated by linux/mkall.go generatePtracePair(386, amd64). DO NOT EDIT.
|
||||||
|
|
||||||
|
// +build linux
|
||||||
|
// +build 386 amd64
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import "unsafe"
|
||||||
|
|
||||||
|
// PtraceRegs386 is the registers used by 386 binaries.
|
||||||
|
type PtraceRegs386 struct {
|
||||||
|
Ebx int32
|
||||||
|
Ecx int32
|
||||||
|
Edx int32
|
||||||
|
Esi int32
|
||||||
|
Edi int32
|
||||||
|
Ebp int32
|
||||||
|
Eax int32
|
||||||
|
Xds int32
|
||||||
|
Xes int32
|
||||||
|
Xfs int32
|
||||||
|
Xgs int32
|
||||||
|
Orig_eax int32
|
||||||
|
Eip int32
|
||||||
|
Xcs int32
|
||||||
|
Eflags int32
|
||||||
|
Esp int32
|
||||||
|
Xss int32
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceGetRegs386 fetches the registers used by 386 binaries.
|
||||||
|
func PtraceGetRegs386(pid int, regsout *PtraceRegs386) error {
|
||||||
|
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceSetRegs386 sets the registers used by 386 binaries.
|
||||||
|
func PtraceSetRegs386(pid int, regs *PtraceRegs386) error {
|
||||||
|
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceRegsAmd64 is the registers used by amd64 binaries.
|
||||||
|
type PtraceRegsAmd64 struct {
|
||||||
|
R15 uint64
|
||||||
|
R14 uint64
|
||||||
|
R13 uint64
|
||||||
|
R12 uint64
|
||||||
|
Rbp uint64
|
||||||
|
Rbx uint64
|
||||||
|
R11 uint64
|
||||||
|
R10 uint64
|
||||||
|
R9 uint64
|
||||||
|
R8 uint64
|
||||||
|
Rax uint64
|
||||||
|
Rcx uint64
|
||||||
|
Rdx uint64
|
||||||
|
Rsi uint64
|
||||||
|
Rdi uint64
|
||||||
|
Orig_rax uint64
|
||||||
|
Rip uint64
|
||||||
|
Cs uint64
|
||||||
|
Eflags uint64
|
||||||
|
Rsp uint64
|
||||||
|
Ss uint64
|
||||||
|
Fs_base uint64
|
||||||
|
Gs_base uint64
|
||||||
|
Ds uint64
|
||||||
|
Es uint64
|
||||||
|
Fs uint64
|
||||||
|
Gs uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceGetRegsAmd64 fetches the registers used by amd64 binaries.
|
||||||
|
func PtraceGetRegsAmd64(pid int, regsout *PtraceRegsAmd64) error {
|
||||||
|
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceSetRegsAmd64 sets the registers used by amd64 binaries.
|
||||||
|
func PtraceSetRegsAmd64(pid int, regs *PtraceRegsAmd64) error {
|
||||||
|
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||||
|
}
|
||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
// Code generated by linux/mkall.go generatePtracePair(arm, arm64). DO NOT EDIT.
|
||||||
|
|
||||||
|
// +build linux
|
||||||
|
// +build arm arm64
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import "unsafe"
|
||||||
|
|
||||||
|
// PtraceRegsArm is the registers used by arm binaries.
|
||||||
|
type PtraceRegsArm struct {
|
||||||
|
Uregs [18]uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceGetRegsArm fetches the registers used by arm binaries.
|
||||||
|
func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error {
|
||||||
|
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceSetRegsArm sets the registers used by arm binaries.
|
||||||
|
func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error {
|
||||||
|
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceRegsArm64 is the registers used by arm64 binaries.
|
||||||
|
type PtraceRegsArm64 struct {
|
||||||
|
Regs [31]uint64
|
||||||
|
Sp uint64
|
||||||
|
Pc uint64
|
||||||
|
Pstate uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceGetRegsArm64 fetches the registers used by arm64 binaries.
|
||||||
|
func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error {
|
||||||
|
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceSetRegsArm64 sets the registers used by arm64 binaries.
|
||||||
|
func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error {
|
||||||
|
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||||
|
}
|
||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
// Code generated by linux/mkall.go generatePtracePair(mips, mips64). DO NOT EDIT.
|
||||||
|
|
||||||
|
// +build linux
|
||||||
|
// +build mips mips64
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import "unsafe"
|
||||||
|
|
||||||
|
// PtraceRegsMips is the registers used by mips binaries.
|
||||||
|
type PtraceRegsMips struct {
|
||||||
|
Regs [32]uint64
|
||||||
|
Lo uint64
|
||||||
|
Hi uint64
|
||||||
|
Epc uint64
|
||||||
|
Badvaddr uint64
|
||||||
|
Status uint64
|
||||||
|
Cause uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceGetRegsMips fetches the registers used by mips binaries.
|
||||||
|
func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error {
|
||||||
|
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceSetRegsMips sets the registers used by mips binaries.
|
||||||
|
func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error {
|
||||||
|
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceRegsMips64 is the registers used by mips64 binaries.
|
||||||
|
type PtraceRegsMips64 struct {
|
||||||
|
Regs [32]uint64
|
||||||
|
Lo uint64
|
||||||
|
Hi uint64
|
||||||
|
Epc uint64
|
||||||
|
Badvaddr uint64
|
||||||
|
Status uint64
|
||||||
|
Cause uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceGetRegsMips64 fetches the registers used by mips64 binaries.
|
||||||
|
func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error {
|
||||||
|
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceSetRegsMips64 sets the registers used by mips64 binaries.
|
||||||
|
func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error {
|
||||||
|
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||||
|
}
|
||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
// Code generated by linux/mkall.go generatePtracePair(mipsle, mips64le). DO NOT EDIT.
|
||||||
|
|
||||||
|
// +build linux
|
||||||
|
// +build mipsle mips64le
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import "unsafe"
|
||||||
|
|
||||||
|
// PtraceRegsMipsle is the registers used by mipsle binaries.
|
||||||
|
type PtraceRegsMipsle struct {
|
||||||
|
Regs [32]uint64
|
||||||
|
Lo uint64
|
||||||
|
Hi uint64
|
||||||
|
Epc uint64
|
||||||
|
Badvaddr uint64
|
||||||
|
Status uint64
|
||||||
|
Cause uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceGetRegsMipsle fetches the registers used by mipsle binaries.
|
||||||
|
func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error {
|
||||||
|
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceSetRegsMipsle sets the registers used by mipsle binaries.
|
||||||
|
func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error {
|
||||||
|
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceRegsMips64le is the registers used by mips64le binaries.
|
||||||
|
type PtraceRegsMips64le struct {
|
||||||
|
Regs [32]uint64
|
||||||
|
Lo uint64
|
||||||
|
Hi uint64
|
||||||
|
Epc uint64
|
||||||
|
Badvaddr uint64
|
||||||
|
Status uint64
|
||||||
|
Cause uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceGetRegsMips64le fetches the registers used by mips64le binaries.
|
||||||
|
func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error {
|
||||||
|
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// PtraceSetRegsMips64le sets the registers used by mips64le binaries.
|
||||||
|
func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error {
|
||||||
|
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||||
|
}
|
||||||
+295
-69
@@ -1,5 +1,5 @@
|
|||||||
// mksyscall.pl -l32 -tags darwin,386 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go
|
// mksyscall.pl -l32 -tags darwin,386 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build darwin,386
|
// +build darwin,386
|
||||||
|
|
||||||
@@ -266,6 +266,117 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
|
||||||
|
r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Madvise(b []byte, behav int) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(b) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&b[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Mlock(b []byte) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(b) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&b[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Mlockall(flags int) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Mprotect(b []byte, prot int) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(b) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&b[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Msync(b []byte, flags int) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(b) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&b[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Munlock(b []byte) (err error) {
|
||||||
|
var _p0 unsafe.Pointer
|
||||||
|
if len(b) > 0 {
|
||||||
|
_p0 = unsafe.Pointer(&b[0])
|
||||||
|
} else {
|
||||||
|
_p0 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Munlockall() (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -298,6 +409,16 @@ func kill(pid int, signum int, posix int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||||
|
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Access(path string, mode uint32) (err error) {
|
func Access(path string, mode uint32) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -456,6 +577,21 @@ func Exit(code int) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Fchdir(fd int) (err error) {
|
func Fchdir(fd int) (err error) {
|
||||||
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
|
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -486,6 +622,21 @@ func Fchmod(fd int, mode uint32) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Fchown(fd int, uid int, gid int) (err error) {
|
func Fchown(fd int, uid int, gid int) (err error) {
|
||||||
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
|
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -496,6 +647,21 @@ func Fchown(fd int, uid int, gid int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Flock(fd int, how int) (err error) {
|
func Flock(fd int, how int) (err error) {
|
||||||
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
|
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -745,6 +911,26 @@ func Link(path string, link string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(link)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Listen(s int, backlog int) (err error) {
|
func Listen(s int, backlog int) (err error) {
|
||||||
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
|
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -785,6 +971,21 @@ func Mkdir(path string, mode uint32) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Mkfifo(path string, mode uint32) (err error) {
|
func Mkfifo(path string, mode uint32) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -815,74 +1016,6 @@ func Mknod(path string, mode uint32, dev int) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Mlock(b []byte) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mlockall(flags int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mprotect(b []byte, prot int) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Munlock(b []byte) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Munlockall() (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Open(path string, mode int, perm uint32) (fd int, err error) {
|
func Open(path string, mode int, perm uint32) (fd int, err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -899,6 +1032,22 @@ func Open(path string, mode int, perm uint32) (fd int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Pathconf(path string, name int) (val int, err error) {
|
func Pathconf(path string, name int) (val int, err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -988,6 +1137,28 @@ func Readlink(path string, buf []byte) (n int, err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 unsafe.Pointer
|
||||||
|
if len(buf) > 0 {
|
||||||
|
_p1 = unsafe.Pointer(&buf[0])
|
||||||
|
} else {
|
||||||
|
_p1 = unsafe.Pointer(&_zero)
|
||||||
|
}
|
||||||
|
r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
|
||||||
|
n = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Rename(from string, to string) (err error) {
|
func Rename(from string, to string) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(from)
|
_p0, err = BytePtrFromString(from)
|
||||||
@@ -1008,6 +1179,26 @@ func Rename(from string, to string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Renameat(fromfd int, from string, tofd int, to string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(from)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(to)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Revoke(path string) (err error) {
|
func Revoke(path string) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
@@ -1245,6 +1436,26 @@ func Symlink(path string, link string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(oldpath)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(newpath)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Sync() (err error) {
|
func Sync() (err error) {
|
||||||
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
|
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
@@ -1308,6 +1519,21 @@ func Unlink(path string) (err error) {
|
|||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Unlinkat(dirfd int, path string, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Unmount(path string, flags int) (err error) {
|
func Unmount(path string, flags int) (err error) {
|
||||||
var _p0 *byte
|
var _p0 *byte
|
||||||
_p0, err = BytePtrFromString(path)
|
_p0, err = BytePtrFromString(path)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user