mirror of https://github.com/docker/buildx.git
Go 1.17
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
c1c414e4c9
commit
45c678ad26
13
Dockerfile
13
Dockerfile
|
@ -1,5 +1,6 @@
|
|||
# syntax=docker/dockerfile:1.3
|
||||
|
||||
ARG GO_VERSION=1.17.0
|
||||
ARG DOCKERD_VERSION=19.03
|
||||
ARG CLI_VERSION=19.03
|
||||
|
||||
|
@ -8,17 +9,9 @@ FROM docker:$DOCKERD_VERSION AS dockerd-release
|
|||
# xx is a helper for cross-compilation
|
||||
FROM --platform=$BUILDPLATFORM tonistiigi/xx@sha256:21a61be4744f6531cb5f33b0e6f40ede41fa3a1b8c82d5946178f80cc84bfc04 AS xx
|
||||
|
||||
FROM --platform=$BUILDPLATFORM golang:1.16-alpine AS golatest
|
||||
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS golatest
|
||||
|
||||
FROM golatest AS go-linux
|
||||
FROM golatest AS go-darwin
|
||||
FROM golatest AS go-windows-amd64
|
||||
FROM golatest AS go-windows-386
|
||||
FROM golatest AS go-windows-arm
|
||||
FROM --platform=$BUILDPLATFORM golang:1.17beta1-alpine AS go-windows-arm64
|
||||
FROM go-windows-${TARGETARCH} AS go-windows
|
||||
|
||||
FROM go-${TARGETOS} AS gobase
|
||||
FROM golatest AS gobase
|
||||
COPY --from=xx / /
|
||||
RUN apk add --no-cache file git
|
||||
ENV GOFLAGS=-mod=vendor
|
||||
|
|
1
go.mod
1
go.mod
|
@ -47,6 +47,7 @@ require (
|
|||
go.opentelemetry.io/otel v1.0.0-RC1
|
||||
go.opentelemetry.io/otel/trace v1.0.0-RC1
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
|
||||
gopkg.in/dancannon/gorethink.v3 v3.0.5 // indirect
|
||||
gopkg.in/fatih/pool.v2 v2.0.0 // indirect
|
||||
gopkg.in/gorethink/gorethink.v3 v3.0.5 // indirect
|
||||
|
|
3
go.sum
3
go.sum
|
@ -1118,8 +1118,9 @@ golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# syntax=docker/dockerfile:1.3
|
||||
|
||||
FROM golang:1.16-alpine AS docsgen
|
||||
ARG GO_VERSION=1.17.0
|
||||
|
||||
FROM golang:${GO_VERSION}-alpine AS docsgen
|
||||
WORKDIR /src
|
||||
RUN --mount=target=. \
|
||||
--mount=target=/root/.cache,type=cache \
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# syntax=docker/dockerfile:1.3
|
||||
|
||||
FROM golang:1.16-alpine
|
||||
ARG GO_VERSION=1.17.0
|
||||
|
||||
FROM golang:${GO_VERSION}-alpine
|
||||
RUN apk add --no-cache gcc musl-dev yamllint
|
||||
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.36.0
|
||||
WORKDIR /go/src/github.com/docker/buildx
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# syntax=docker/dockerfile:1.3
|
||||
|
||||
FROM golang:1.16-alpine AS vendored
|
||||
ARG GO_VERSION=1.17.0
|
||||
|
||||
FROM golang:${GO_VERSION}-alpine AS vendored
|
||||
RUN apk add --no-cache git rsync
|
||||
WORKDIR /src
|
||||
RUN --mount=target=/context \
|
||||
|
|
|
@ -154,14 +154,13 @@ var MIPS64X struct {
|
|||
// For ppc64/ppc64le, it is safe to check only for ISA level starting on ISA v3.00,
|
||||
// since there are no optional categories. There are some exceptions that also
|
||||
// require kernel support to work (DARN, SCV), so there are feature bits for
|
||||
// those as well. The minimum processor requirement is POWER8 (ISA 2.07).
|
||||
// The struct is padded to avoid false sharing.
|
||||
// those as well. The struct is padded to avoid false sharing.
|
||||
var PPC64 struct {
|
||||
_ CacheLinePad
|
||||
HasDARN bool // Hardware random number generator (requires kernel enablement)
|
||||
HasSCV bool // Syscall vectored (requires kernel enablement)
|
||||
IsPOWER8 bool // ISA v2.07 (POWER8)
|
||||
IsPOWER9 bool // ISA v3.00 (POWER9)
|
||||
IsPOWER9 bool // ISA v3.00 (POWER9), implies IsPOWER8
|
||||
_ CacheLinePad
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ func archInit() {
|
|||
PPC64.IsPOWER8 = true
|
||||
}
|
||||
if impl&_IMPL_POWER9 != 0 {
|
||||
PPC64.IsPOWER8 = true
|
||||
PPC64.IsPOWER9 = true
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ arguments can be passed to the kernel. The third is for low-level use by the
|
|||
ForkExec wrapper. Unlike the first two, it does not call into the scheduler to
|
||||
let it know that a system call is running.
|
||||
|
||||
When porting Go to an new architecture/OS, this file must be implemented for
|
||||
When porting Go to a new architecture/OS, this file must be implemented for
|
||||
each GOOS/GOARCH pair.
|
||||
|
||||
### mksysnum
|
||||
|
@ -107,7 +107,7 @@ prototype can be exported (capitalized) or not.
|
|||
Adding a new syscall often just requires adding a new `//sys` function prototype
|
||||
with the desired arguments and a capitalized name so it is exported. However, if
|
||||
you want the interface to the syscall to be different, often one will make an
|
||||
unexported `//sys` prototype, an then write a custom wrapper in
|
||||
unexported `//sys` prototype, and then write a custom wrapper in
|
||||
`syscall_${GOOS}.go`.
|
||||
|
||||
### types files
|
||||
|
@ -137,7 +137,7 @@ some `#if/#elif` macros in your include statements.
|
|||
|
||||
This script is used to generate the system's various constants. This doesn't
|
||||
just include the error numbers and error strings, but also the signal numbers
|
||||
an a wide variety of miscellaneous constants. The constants come from the list
|
||||
and a wide variety of miscellaneous constants. The constants come from the list
|
||||
of include files in the `includes_${uname}` variable. A regex then picks out
|
||||
the desired `#define` statements, and generates the corresponding Go constants.
|
||||
The error numbers and strings are generated from `#include <errno.h>`, and the
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build (darwin || freebsd || netbsd || openbsd) && gc
|
||||
// +build darwin freebsd netbsd openbsd
|
||||
//go:build (freebsd || netbsd || openbsd) && gc
|
||||
// +build freebsd netbsd openbsd
|
||||
// +build gc
|
||||
|
||||
#include "textflag.h"
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build (darwin || freebsd || netbsd || openbsd) && gc
|
||||
// +build darwin freebsd netbsd openbsd
|
||||
//go:build (freebsd || netbsd || openbsd) && gc
|
||||
// +build freebsd netbsd openbsd
|
||||
// +build gc
|
||||
|
||||
#include "textflag.h"
|
||||
|
|
|
@ -239,6 +239,7 @@ struct ltchars {
|
|||
#include <linux/netfilter/nfnetlink.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/net_namespace.h>
|
||||
#include <linux/nfc.h>
|
||||
#include <linux/nsfs.h>
|
||||
#include <linux/perf_event.h>
|
||||
#include <linux/pps.h>
|
||||
|
@ -258,6 +259,7 @@ struct ltchars {
|
|||
#include <linux/watchdog.h>
|
||||
|
||||
#include <mtd/ubi-user.h>
|
||||
#include <mtd/mtd-user.h>
|
||||
#include <net/route.h>
|
||||
|
||||
#if defined(__sparc__)
|
||||
|
@ -501,6 +503,9 @@ ccflags="$@"
|
|||
$2 ~ /^LO_(KEY|NAME)_SIZE$/ ||
|
||||
$2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ ||
|
||||
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL)_/ ||
|
||||
$2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ ||
|
||||
$2 ~ /^NFC_.*_(MAX)?SIZE$/ ||
|
||||
$2 ~ /^RAW_PAYLOAD_/ ||
|
||||
$2 ~ /^TP_STATUS_/ ||
|
||||
$2 ~ /^FALLOC_/ ||
|
||||
$2 ~ /^ICMPV?6?_(FILTER|SEC)/ ||
|
||||
|
@ -558,6 +563,7 @@ ccflags="$@"
|
|||
$2 ~ /^KEYCTL_/ ||
|
||||
$2 ~ /^PERF_/ ||
|
||||
$2 ~ /^SECCOMP_MODE_/ ||
|
||||
$2 ~ /^SEEK_/ ||
|
||||
$2 ~ /^SPLICE_/ ||
|
||||
$2 ~ /^SYNC_FILE_RANGE_/ ||
|
||||
$2 !~ /^AUDIT_RECORD_MAGIC/ &&
|
||||
|
@ -593,6 +599,9 @@ ccflags="$@"
|
|||
$2 == "HID_MAX_DESCRIPTOR_SIZE" ||
|
||||
$2 ~ /^_?HIDIOC/ ||
|
||||
$2 ~ /^BUS_(USB|HIL|BLUETOOTH|VIRTUAL)$/ ||
|
||||
$2 ~ /^MTD/ ||
|
||||
$2 ~ /^OTP/ ||
|
||||
$2 ~ /^MEM/ ||
|
||||
$2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)}
|
||||
$2 ~ /^__WCOREFLAG$/ {next}
|
||||
$2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
package unix
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
@ -398,6 +399,38 @@ func GetsockoptXucred(fd, level, opt int) (*Xucred, error) {
|
|||
return x, err
|
||||
}
|
||||
|
||||
func SysctlKinfoProcSlice(name string) ([]KinfoProc, error) {
|
||||
mib, err := sysctlmib(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Find size.
|
||||
n := uintptr(0)
|
||||
if err := sysctl(mib, nil, &n, nil, 0); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if n == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
if n%SizeofKinfoProc != 0 {
|
||||
return nil, fmt.Errorf("sysctl() returned a size of %d, which is not a multiple of %d", n, SizeofKinfoProc)
|
||||
}
|
||||
|
||||
// Read into buffer of that size.
|
||||
buf := make([]KinfoProc, n/SizeofKinfoProc)
|
||||
if err := sysctl(mib, (*byte)(unsafe.Pointer(&buf[0])), &n, nil, 0); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if n%SizeofKinfoProc != 0 {
|
||||
return nil, fmt.Errorf("sysctl() returned a size of %d, which is not a multiple of %d", n, SizeofKinfoProc)
|
||||
}
|
||||
|
||||
// The actual call may return less than the original reported required
|
||||
// size so ensure we deal with that.
|
||||
return buf[:n/SizeofKinfoProc], nil
|
||||
}
|
||||
|
||||
//sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)
|
||||
|
||||
/*
|
||||
|
|
|
@ -904,6 +904,46 @@ func (sa *SockaddrIUCV) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
|||
return unsafe.Pointer(&sa.raw), SizeofSockaddrIUCV, nil
|
||||
}
|
||||
|
||||
type SockaddrNFC struct {
|
||||
DeviceIdx uint32
|
||||
TargetIdx uint32
|
||||
NFCProtocol uint32
|
||||
raw RawSockaddrNFC
|
||||
}
|
||||
|
||||
func (sa *SockaddrNFC) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||
sa.raw.Sa_family = AF_NFC
|
||||
sa.raw.Dev_idx = sa.DeviceIdx
|
||||
sa.raw.Target_idx = sa.TargetIdx
|
||||
sa.raw.Nfc_protocol = sa.NFCProtocol
|
||||
return unsafe.Pointer(&sa.raw), SizeofSockaddrNFC, nil
|
||||
}
|
||||
|
||||
type SockaddrNFCLLCP struct {
|
||||
DeviceIdx uint32
|
||||
TargetIdx uint32
|
||||
NFCProtocol uint32
|
||||
DestinationSAP uint8
|
||||
SourceSAP uint8
|
||||
ServiceName string
|
||||
raw RawSockaddrNFCLLCP
|
||||
}
|
||||
|
||||
func (sa *SockaddrNFCLLCP) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||
sa.raw.Sa_family = AF_NFC
|
||||
sa.raw.Dev_idx = sa.DeviceIdx
|
||||
sa.raw.Target_idx = sa.TargetIdx
|
||||
sa.raw.Nfc_protocol = sa.NFCProtocol
|
||||
sa.raw.Dsap = sa.DestinationSAP
|
||||
sa.raw.Ssap = sa.SourceSAP
|
||||
if len(sa.ServiceName) > len(sa.raw.Service_name) {
|
||||
return nil, 0, EINVAL
|
||||
}
|
||||
copy(sa.raw.Service_name[:], sa.ServiceName)
|
||||
sa.raw.SetServiceNameLen(len(sa.ServiceName))
|
||||
return unsafe.Pointer(&sa.raw), SizeofSockaddrNFCLLCP, nil
|
||||
}
|
||||
|
||||
var socketProtocol = func(fd int) (int, error) {
|
||||
return GetsockoptInt(fd, SOL_SOCKET, SO_PROTOCOL)
|
||||
}
|
||||
|
@ -1144,6 +1184,37 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
|
|||
}
|
||||
return sa, nil
|
||||
}
|
||||
case AF_NFC:
|
||||
proto, err := socketProtocol(fd)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
switch proto {
|
||||
case NFC_SOCKPROTO_RAW:
|
||||
pp := (*RawSockaddrNFC)(unsafe.Pointer(rsa))
|
||||
sa := &SockaddrNFC{
|
||||
DeviceIdx: pp.Dev_idx,
|
||||
TargetIdx: pp.Target_idx,
|
||||
NFCProtocol: pp.Nfc_protocol,
|
||||
}
|
||||
return sa, nil
|
||||
case NFC_SOCKPROTO_LLCP:
|
||||
pp := (*RawSockaddrNFCLLCP)(unsafe.Pointer(rsa))
|
||||
if uint64(pp.Service_name_len) > uint64(len(pp.Service_name)) {
|
||||
return nil, EINVAL
|
||||
}
|
||||
sa := &SockaddrNFCLLCP{
|
||||
DeviceIdx: pp.Dev_idx,
|
||||
TargetIdx: pp.Target_idx,
|
||||
NFCProtocol: pp.Nfc_protocol,
|
||||
DestinationSAP: pp.Dsap,
|
||||
SourceSAP: pp.Ssap,
|
||||
ServiceName: string(pp.Service_name[:pp.Service_name_len]),
|
||||
}
|
||||
return sa, nil
|
||||
default:
|
||||
return nil, EINVAL
|
||||
}
|
||||
}
|
||||
return nil, EAFNOSUPPORT
|
||||
}
|
||||
|
|
|
@ -378,6 +378,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
|||
cmsg.Len = uint32(length)
|
||||
}
|
||||
|
||||
func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
|
||||
rsa.Service_name_len = uint32(length)
|
||||
}
|
||||
|
||||
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
|
||||
|
||||
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||
|
|
|
@ -172,6 +172,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
|||
cmsg.Len = uint64(length)
|
||||
}
|
||||
|
||||
func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
|
||||
rsa.Service_name_len = uint64(length)
|
||||
}
|
||||
|
||||
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
|
||||
|
||||
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||
|
|
|
@ -256,6 +256,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
|||
cmsg.Len = uint32(length)
|
||||
}
|
||||
|
||||
func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
|
||||
rsa.Service_name_len = uint32(length)
|
||||
}
|
||||
|
||||
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
|
||||
|
||||
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||
|
|
|
@ -207,6 +207,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
|||
cmsg.Len = uint64(length)
|
||||
}
|
||||
|
||||
func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
|
||||
rsa.Service_name_len = uint64(length)
|
||||
}
|
||||
|
||||
func InotifyInit() (fd int, err error) {
|
||||
return InotifyInit1(0)
|
||||
}
|
||||
|
|
|
@ -217,6 +217,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
|||
cmsg.Len = uint64(length)
|
||||
}
|
||||
|
||||
func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
|
||||
rsa.Service_name_len = uint64(length)
|
||||
}
|
||||
|
||||
func InotifyInit() (fd int, err error) {
|
||||
return InotifyInit1(0)
|
||||
}
|
||||
|
|
|
@ -229,6 +229,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
|||
cmsg.Len = uint32(length)
|
||||
}
|
||||
|
||||
func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
|
||||
rsa.Service_name_len = uint32(length)
|
||||
}
|
||||
|
||||
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
|
||||
|
||||
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||
|
|
|
@ -215,6 +215,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
|||
cmsg.Len = uint32(length)
|
||||
}
|
||||
|
||||
func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
|
||||
rsa.Service_name_len = uint32(length)
|
||||
}
|
||||
|
||||
//sysnb pipe(p *[2]_C_int) (err error)
|
||||
|
||||
func Pipe(p []int) (err error) {
|
||||
|
|
|
@ -100,6 +100,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
|||
cmsg.Len = uint64(length)
|
||||
}
|
||||
|
||||
func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
|
||||
rsa.Service_name_len = uint64(length)
|
||||
}
|
||||
|
||||
//sysnb pipe(p *[2]_C_int) (err error)
|
||||
|
||||
func Pipe(p []int) (err error) {
|
||||
|
|
|
@ -188,6 +188,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
|||
cmsg.Len = uint64(length)
|
||||
}
|
||||
|
||||
func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
|
||||
rsa.Service_name_len = uint64(length)
|
||||
}
|
||||
|
||||
func InotifyInit() (fd int, err error) {
|
||||
return InotifyInit1(0)
|
||||
}
|
||||
|
|
|
@ -129,6 +129,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
|||
cmsg.Len = uint64(length)
|
||||
}
|
||||
|
||||
func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
|
||||
rsa.Service_name_len = uint64(length)
|
||||
}
|
||||
|
||||
// Linux on s390x uses the old mmap interface, which requires arguments to be passed in a struct.
|
||||
// mmap2 also requires arguments to be passed in a struct; it is currently not exposed in <asm/unistd.h>.
|
||||
func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
|
||||
|
|
|
@ -116,6 +116,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
|||
cmsg.Len = uint64(length)
|
||||
}
|
||||
|
||||
func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
|
||||
rsa.Service_name_len = uint64(length)
|
||||
}
|
||||
|
||||
//sysnb pipe(p *[2]_C_int) (err error)
|
||||
|
||||
func Pipe(p []int) (err error) {
|
||||
|
|
|
@ -1262,6 +1262,11 @@ const (
|
|||
SCM_RIGHTS = 0x1
|
||||
SCM_TIMESTAMP = 0x2
|
||||
SCM_TIMESTAMP_MONOTONIC = 0x4
|
||||
SEEK_CUR = 0x1
|
||||
SEEK_DATA = 0x4
|
||||
SEEK_END = 0x2
|
||||
SEEK_HOLE = 0x3
|
||||
SEEK_SET = 0x0
|
||||
SHUT_RD = 0x0
|
||||
SHUT_RDWR = 0x2
|
||||
SHUT_WR = 0x1
|
||||
|
|
|
@ -1262,6 +1262,11 @@ const (
|
|||
SCM_RIGHTS = 0x1
|
||||
SCM_TIMESTAMP = 0x2
|
||||
SCM_TIMESTAMP_MONOTONIC = 0x4
|
||||
SEEK_CUR = 0x1
|
||||
SEEK_DATA = 0x4
|
||||
SEEK_END = 0x2
|
||||
SEEK_HOLE = 0x3
|
||||
SEEK_SET = 0x0
|
||||
SHUT_RD = 0x0
|
||||
SHUT_RDWR = 0x2
|
||||
SHUT_WR = 0x1
|
||||
|
|
|
@ -1297,6 +1297,11 @@ const (
|
|||
SCM_RIGHTS = 0x1
|
||||
SCM_TIMESTAMP = 0x2
|
||||
SCM_TIME_INFO = 0x7
|
||||
SEEK_CUR = 0x1
|
||||
SEEK_DATA = 0x3
|
||||
SEEK_END = 0x2
|
||||
SEEK_HOLE = 0x4
|
||||
SEEK_SET = 0x0
|
||||
SHUT_RD = 0x0
|
||||
SHUT_RDWR = 0x2
|
||||
SHUT_WR = 0x1
|
||||
|
|
|
@ -1298,6 +1298,11 @@ const (
|
|||
SCM_RIGHTS = 0x1
|
||||
SCM_TIMESTAMP = 0x2
|
||||
SCM_TIME_INFO = 0x7
|
||||
SEEK_CUR = 0x1
|
||||
SEEK_DATA = 0x3
|
||||
SEEK_END = 0x2
|
||||
SEEK_HOLE = 0x4
|
||||
SEEK_SET = 0x0
|
||||
SHUT_RD = 0x0
|
||||
SHUT_RDWR = 0x2
|
||||
SHUT_WR = 0x1
|
||||
|
|
|
@ -1276,6 +1276,11 @@ const (
|
|||
SCM_CREDS = 0x3
|
||||
SCM_RIGHTS = 0x1
|
||||
SCM_TIMESTAMP = 0x2
|
||||
SEEK_CUR = 0x1
|
||||
SEEK_DATA = 0x3
|
||||
SEEK_END = 0x2
|
||||
SEEK_HOLE = 0x4
|
||||
SEEK_SET = 0x0
|
||||
SHUT_RD = 0x0
|
||||
SHUT_RDWR = 0x2
|
||||
SHUT_WR = 0x1
|
||||
|
|
|
@ -1298,6 +1298,11 @@ const (
|
|||
SCM_RIGHTS = 0x1
|
||||
SCM_TIMESTAMP = 0x2
|
||||
SCM_TIME_INFO = 0x7
|
||||
SEEK_CUR = 0x1
|
||||
SEEK_DATA = 0x3
|
||||
SEEK_END = 0x2
|
||||
SEEK_HOLE = 0x4
|
||||
SEEK_SET = 0x0
|
||||
SHUT_RD = 0x0
|
||||
SHUT_RDWR = 0x2
|
||||
SHUT_WR = 0x1
|
||||
|
|
|
@ -1406,6 +1406,10 @@ const (
|
|||
MCAST_LEAVE_SOURCE_GROUP = 0x2f
|
||||
MCAST_MSFILTER = 0x30
|
||||
MCAST_UNBLOCK_SOURCE = 0x2c
|
||||
MEMGETREGIONINFO = 0xc0104d08
|
||||
MEMREADOOB64 = 0xc0184d16
|
||||
MEMWRITE = 0xc0304d18
|
||||
MEMWRITEOOB64 = 0xc0184d15
|
||||
MFD_ALLOW_SEALING = 0x2
|
||||
MFD_CLOEXEC = 0x1
|
||||
MFD_HUGETLB = 0x4
|
||||
|
@ -1494,7 +1498,35 @@ const (
|
|||
MS_SYNCHRONOUS = 0x10
|
||||
MS_UNBINDABLE = 0x20000
|
||||
MS_VERBOSE = 0x8000
|
||||
MTD_ABSENT = 0x0
|
||||
MTD_BIT_WRITEABLE = 0x800
|
||||
MTD_CAP_NANDFLASH = 0x400
|
||||
MTD_CAP_NORFLASH = 0xc00
|
||||
MTD_CAP_NVRAM = 0x1c00
|
||||
MTD_CAP_RAM = 0x1c00
|
||||
MTD_CAP_ROM = 0x0
|
||||
MTD_DATAFLASH = 0x6
|
||||
MTD_INODE_FS_MAGIC = 0x11307854
|
||||
MTD_MAX_ECCPOS_ENTRIES = 0x40
|
||||
MTD_MAX_OOBFREE_ENTRIES = 0x8
|
||||
MTD_MLCNANDFLASH = 0x8
|
||||
MTD_NANDECC_AUTOPLACE = 0x2
|
||||
MTD_NANDECC_AUTOPL_USR = 0x4
|
||||
MTD_NANDECC_OFF = 0x0
|
||||
MTD_NANDECC_PLACE = 0x1
|
||||
MTD_NANDECC_PLACEONLY = 0x3
|
||||
MTD_NANDFLASH = 0x4
|
||||
MTD_NORFLASH = 0x3
|
||||
MTD_NO_ERASE = 0x1000
|
||||
MTD_OTP_FACTORY = 0x1
|
||||
MTD_OTP_OFF = 0x0
|
||||
MTD_OTP_USER = 0x2
|
||||
MTD_POWERUP_LOCK = 0x2000
|
||||
MTD_RAM = 0x1
|
||||
MTD_ROM = 0x2
|
||||
MTD_SLC_ON_MLC_EMULATION = 0x4000
|
||||
MTD_UBIVOLUME = 0x7
|
||||
MTD_WRITEABLE = 0x400
|
||||
NAME_MAX = 0xff
|
||||
NCP_SUPER_MAGIC = 0x564c
|
||||
NETLINK_ADD_MEMBERSHIP = 0x1
|
||||
|
@ -1534,6 +1566,59 @@ const (
|
|||
NETLINK_XFRM = 0x6
|
||||
NETNSA_MAX = 0x5
|
||||
NETNSA_NSID_NOT_ASSIGNED = -0x1
|
||||
NFC_ATR_REQ_GB_MAXSIZE = 0x30
|
||||
NFC_ATR_REQ_MAXSIZE = 0x40
|
||||
NFC_ATR_RES_GB_MAXSIZE = 0x2f
|
||||
NFC_ATR_RES_MAXSIZE = 0x40
|
||||
NFC_COMM_ACTIVE = 0x0
|
||||
NFC_COMM_PASSIVE = 0x1
|
||||
NFC_DEVICE_NAME_MAXSIZE = 0x8
|
||||
NFC_DIRECTION_RX = 0x0
|
||||
NFC_DIRECTION_TX = 0x1
|
||||
NFC_FIRMWARE_NAME_MAXSIZE = 0x20
|
||||
NFC_GB_MAXSIZE = 0x30
|
||||
NFC_GENL_MCAST_EVENT_NAME = "events"
|
||||
NFC_GENL_NAME = "nfc"
|
||||
NFC_GENL_VERSION = 0x1
|
||||
NFC_HEADER_SIZE = 0x1
|
||||
NFC_ISO15693_UID_MAXSIZE = 0x8
|
||||
NFC_LLCP_MAX_SERVICE_NAME = 0x3f
|
||||
NFC_LLCP_MIUX = 0x1
|
||||
NFC_LLCP_REMOTE_LTO = 0x3
|
||||
NFC_LLCP_REMOTE_MIU = 0x2
|
||||
NFC_LLCP_REMOTE_RW = 0x4
|
||||
NFC_LLCP_RW = 0x0
|
||||
NFC_NFCID1_MAXSIZE = 0xa
|
||||
NFC_NFCID2_MAXSIZE = 0x8
|
||||
NFC_NFCID3_MAXSIZE = 0xa
|
||||
NFC_PROTO_FELICA = 0x3
|
||||
NFC_PROTO_FELICA_MASK = 0x8
|
||||
NFC_PROTO_ISO14443 = 0x4
|
||||
NFC_PROTO_ISO14443_B = 0x6
|
||||
NFC_PROTO_ISO14443_B_MASK = 0x40
|
||||
NFC_PROTO_ISO14443_MASK = 0x10
|
||||
NFC_PROTO_ISO15693 = 0x7
|
||||
NFC_PROTO_ISO15693_MASK = 0x80
|
||||
NFC_PROTO_JEWEL = 0x1
|
||||
NFC_PROTO_JEWEL_MASK = 0x2
|
||||
NFC_PROTO_MAX = 0x8
|
||||
NFC_PROTO_MIFARE = 0x2
|
||||
NFC_PROTO_MIFARE_MASK = 0x4
|
||||
NFC_PROTO_NFC_DEP = 0x5
|
||||
NFC_PROTO_NFC_DEP_MASK = 0x20
|
||||
NFC_RAW_HEADER_SIZE = 0x2
|
||||
NFC_RF_INITIATOR = 0x0
|
||||
NFC_RF_NONE = 0x2
|
||||
NFC_RF_TARGET = 0x1
|
||||
NFC_SENSB_RES_MAXSIZE = 0xc
|
||||
NFC_SENSF_RES_MAXSIZE = 0x12
|
||||
NFC_SE_DISABLED = 0x0
|
||||
NFC_SE_EMBEDDED = 0x2
|
||||
NFC_SE_ENABLED = 0x1
|
||||
NFC_SE_UICC = 0x1
|
||||
NFC_SOCKPROTO_LLCP = 0x1
|
||||
NFC_SOCKPROTO_MAX = 0x2
|
||||
NFC_SOCKPROTO_RAW = 0x0
|
||||
NFNETLINK_V0 = 0x0
|
||||
NFNLGRP_ACCT_QUOTA = 0x8
|
||||
NFNLGRP_CONNTRACK_DESTROY = 0x3
|
||||
|
@ -1959,6 +2044,11 @@ const (
|
|||
QNX4_SUPER_MAGIC = 0x2f
|
||||
QNX6_SUPER_MAGIC = 0x68191122
|
||||
RAMFS_MAGIC = 0x858458f6
|
||||
RAW_PAYLOAD_DIGITAL = 0x3
|
||||
RAW_PAYLOAD_HCI = 0x2
|
||||
RAW_PAYLOAD_LLCP = 0x0
|
||||
RAW_PAYLOAD_NCI = 0x1
|
||||
RAW_PAYLOAD_PROPRIETARY = 0x4
|
||||
RDTGROUP_SUPER_MAGIC = 0x7655821
|
||||
REISERFS_SUPER_MAGIC = 0x52654973
|
||||
RENAME_EXCHANGE = 0x2
|
||||
|
@ -2194,6 +2284,12 @@ const (
|
|||
SECCOMP_MODE_FILTER = 0x2
|
||||
SECCOMP_MODE_STRICT = 0x1
|
||||
SECURITYFS_MAGIC = 0x73636673
|
||||
SEEK_CUR = 0x1
|
||||
SEEK_DATA = 0x3
|
||||
SEEK_END = 0x2
|
||||
SEEK_HOLE = 0x4
|
||||
SEEK_MAX = 0x4
|
||||
SEEK_SET = 0x0
|
||||
SELINUX_MAGIC = 0xf97cff8c
|
||||
SHUT_RD = 0x0
|
||||
SHUT_RDWR = 0x2
|
||||
|
|
|
@ -60,6 +60,8 @@ const (
|
|||
CS8 = 0x30
|
||||
CSIZE = 0x30
|
||||
CSTOPB = 0x40
|
||||
ECCGETLAYOUT = 0x81484d11
|
||||
ECCGETSTATS = 0x80104d12
|
||||
ECHOCTL = 0x200
|
||||
ECHOE = 0x10
|
||||
ECHOK = 0x20
|
||||
|
@ -123,6 +125,19 @@ const (
|
|||
MCL_CURRENT = 0x1
|
||||
MCL_FUTURE = 0x2
|
||||
MCL_ONFAULT = 0x4
|
||||
MEMERASE = 0x40084d02
|
||||
MEMERASE64 = 0x40104d14
|
||||
MEMGETBADBLOCK = 0x40084d0b
|
||||
MEMGETINFO = 0x80204d01
|
||||
MEMGETOOBSEL = 0x80c84d0a
|
||||
MEMGETREGIONCOUNT = 0x80044d07
|
||||
MEMISLOCKED = 0x80084d17
|
||||
MEMLOCK = 0x40084d05
|
||||
MEMREADOOB = 0xc00c4d04
|
||||
MEMSETBADBLOCK = 0x40084d0c
|
||||
MEMUNLOCK = 0x40084d06
|
||||
MEMWRITEOOB = 0xc00c4d03
|
||||
MTDFILEMODE = 0x4d13
|
||||
NFDBITS = 0x20
|
||||
NLDLY = 0x100
|
||||
NOFLSH = 0x80
|
||||
|
@ -132,6 +147,10 @@ const (
|
|||
NS_GET_USERNS = 0xb701
|
||||
OLCUC = 0x2
|
||||
ONLCR = 0x4
|
||||
OTPGETREGIONCOUNT = 0x40044d0e
|
||||
OTPGETREGIONINFO = 0x400c4d0f
|
||||
OTPLOCK = 0x800c4d10
|
||||
OTPSELECT = 0x80044d0d
|
||||
O_APPEND = 0x400
|
||||
O_ASYNC = 0x2000
|
||||
O_CLOEXEC = 0x80000
|
||||
|
|
|
@ -60,6 +60,8 @@ const (
|
|||
CS8 = 0x30
|
||||
CSIZE = 0x30
|
||||
CSTOPB = 0x40
|
||||
ECCGETLAYOUT = 0x81484d11
|
||||
ECCGETSTATS = 0x80104d12
|
||||
ECHOCTL = 0x200
|
||||
ECHOE = 0x10
|
||||
ECHOK = 0x20
|
||||
|
@ -123,6 +125,19 @@ const (
|
|||
MCL_CURRENT = 0x1
|
||||
MCL_FUTURE = 0x2
|
||||
MCL_ONFAULT = 0x4
|
||||
MEMERASE = 0x40084d02
|
||||
MEMERASE64 = 0x40104d14
|
||||
MEMGETBADBLOCK = 0x40084d0b
|
||||
MEMGETINFO = 0x80204d01
|
||||
MEMGETOOBSEL = 0x80c84d0a
|
||||
MEMGETREGIONCOUNT = 0x80044d07
|
||||
MEMISLOCKED = 0x80084d17
|
||||
MEMLOCK = 0x40084d05
|
||||
MEMREADOOB = 0xc0104d04
|
||||
MEMSETBADBLOCK = 0x40084d0c
|
||||
MEMUNLOCK = 0x40084d06
|
||||
MEMWRITEOOB = 0xc0104d03
|
||||
MTDFILEMODE = 0x4d13
|
||||
NFDBITS = 0x40
|
||||
NLDLY = 0x100
|
||||
NOFLSH = 0x80
|
||||
|
@ -132,6 +147,10 @@ const (
|
|||
NS_GET_USERNS = 0xb701
|
||||
OLCUC = 0x2
|
||||
ONLCR = 0x4
|
||||
OTPGETREGIONCOUNT = 0x40044d0e
|
||||
OTPGETREGIONINFO = 0x400c4d0f
|
||||
OTPLOCK = 0x800c4d10
|
||||
OTPSELECT = 0x80044d0d
|
||||
O_APPEND = 0x400
|
||||
O_ASYNC = 0x2000
|
||||
O_CLOEXEC = 0x80000
|
||||
|
|
|
@ -60,6 +60,8 @@ const (
|
|||
CS8 = 0x30
|
||||
CSIZE = 0x30
|
||||
CSTOPB = 0x40
|
||||
ECCGETLAYOUT = 0x81484d11
|
||||
ECCGETSTATS = 0x80104d12
|
||||
ECHOCTL = 0x200
|
||||
ECHOE = 0x10
|
||||
ECHOK = 0x20
|
||||
|
@ -121,6 +123,19 @@ const (
|
|||
MCL_CURRENT = 0x1
|
||||
MCL_FUTURE = 0x2
|
||||
MCL_ONFAULT = 0x4
|
||||
MEMERASE = 0x40084d02
|
||||
MEMERASE64 = 0x40104d14
|
||||
MEMGETBADBLOCK = 0x40084d0b
|
||||
MEMGETINFO = 0x80204d01
|
||||
MEMGETOOBSEL = 0x80c84d0a
|
||||
MEMGETREGIONCOUNT = 0x80044d07
|
||||
MEMISLOCKED = 0x80084d17
|
||||
MEMLOCK = 0x40084d05
|
||||
MEMREADOOB = 0xc00c4d04
|
||||
MEMSETBADBLOCK = 0x40084d0c
|
||||
MEMUNLOCK = 0x40084d06
|
||||
MEMWRITEOOB = 0xc00c4d03
|
||||
MTDFILEMODE = 0x4d13
|
||||
NFDBITS = 0x20
|
||||
NLDLY = 0x100
|
||||
NOFLSH = 0x80
|
||||
|
@ -130,6 +145,10 @@ const (
|
|||
NS_GET_USERNS = 0xb701
|
||||
OLCUC = 0x2
|
||||
ONLCR = 0x4
|
||||
OTPGETREGIONCOUNT = 0x40044d0e
|
||||
OTPGETREGIONINFO = 0x400c4d0f
|
||||
OTPLOCK = 0x800c4d10
|
||||
OTPSELECT = 0x80044d0d
|
||||
O_APPEND = 0x400
|
||||
O_ASYNC = 0x2000
|
||||
O_CLOEXEC = 0x80000
|
||||
|
|
|
@ -60,6 +60,8 @@ const (
|
|||
CS8 = 0x30
|
||||
CSIZE = 0x30
|
||||
CSTOPB = 0x40
|
||||
ECCGETLAYOUT = 0x81484d11
|
||||
ECCGETSTATS = 0x80104d12
|
||||
ECHOCTL = 0x200
|
||||
ECHOE = 0x10
|
||||
ECHOK = 0x20
|
||||
|
@ -124,6 +126,19 @@ const (
|
|||
MCL_CURRENT = 0x1
|
||||
MCL_FUTURE = 0x2
|
||||
MCL_ONFAULT = 0x4
|
||||
MEMERASE = 0x40084d02
|
||||
MEMERASE64 = 0x40104d14
|
||||
MEMGETBADBLOCK = 0x40084d0b
|
||||
MEMGETINFO = 0x80204d01
|
||||
MEMGETOOBSEL = 0x80c84d0a
|
||||
MEMGETREGIONCOUNT = 0x80044d07
|
||||
MEMISLOCKED = 0x80084d17
|
||||
MEMLOCK = 0x40084d05
|
||||
MEMREADOOB = 0xc0104d04
|
||||
MEMSETBADBLOCK = 0x40084d0c
|
||||
MEMUNLOCK = 0x40084d06
|
||||
MEMWRITEOOB = 0xc0104d03
|
||||
MTDFILEMODE = 0x4d13
|
||||
NFDBITS = 0x40
|
||||
NLDLY = 0x100
|
||||
NOFLSH = 0x80
|
||||
|
@ -133,6 +148,10 @@ const (
|
|||
NS_GET_USERNS = 0xb701
|
||||
OLCUC = 0x2
|
||||
ONLCR = 0x4
|
||||
OTPGETREGIONCOUNT = 0x40044d0e
|
||||
OTPGETREGIONINFO = 0x400c4d0f
|
||||
OTPLOCK = 0x800c4d10
|
||||
OTPSELECT = 0x80044d0d
|
||||
O_APPEND = 0x400
|
||||
O_ASYNC = 0x2000
|
||||
O_CLOEXEC = 0x80000
|
||||
|
|
|
@ -60,6 +60,8 @@ const (
|
|||
CS8 = 0x30
|
||||
CSIZE = 0x30
|
||||
CSTOPB = 0x40
|
||||
ECCGETLAYOUT = 0x41484d11
|
||||
ECCGETSTATS = 0x40104d12
|
||||
ECHOCTL = 0x200
|
||||
ECHOE = 0x10
|
||||
ECHOK = 0x20
|
||||
|
@ -121,6 +123,19 @@ const (
|
|||
MCL_CURRENT = 0x1
|
||||
MCL_FUTURE = 0x2
|
||||
MCL_ONFAULT = 0x4
|
||||
MEMERASE = 0x80084d02
|
||||
MEMERASE64 = 0x80104d14
|
||||
MEMGETBADBLOCK = 0x80084d0b
|
||||
MEMGETINFO = 0x40204d01
|
||||
MEMGETOOBSEL = 0x40c84d0a
|
||||
MEMGETREGIONCOUNT = 0x40044d07
|
||||
MEMISLOCKED = 0x40084d17
|
||||
MEMLOCK = 0x80084d05
|
||||
MEMREADOOB = 0xc00c4d04
|
||||
MEMSETBADBLOCK = 0x80084d0c
|
||||
MEMUNLOCK = 0x80084d06
|
||||
MEMWRITEOOB = 0xc00c4d03
|
||||
MTDFILEMODE = 0x20004d13
|
||||
NFDBITS = 0x20
|
||||
NLDLY = 0x100
|
||||
NOFLSH = 0x80
|
||||
|
@ -130,6 +145,10 @@ const (
|
|||
NS_GET_USERNS = 0x2000b701
|
||||
OLCUC = 0x2
|
||||
ONLCR = 0x4
|
||||
OTPGETREGIONCOUNT = 0x80044d0e
|
||||
OTPGETREGIONINFO = 0x800c4d0f
|
||||
OTPLOCK = 0x400c4d10
|
||||
OTPSELECT = 0x40044d0d
|
||||
O_APPEND = 0x8
|
||||
O_ASYNC = 0x1000
|
||||
O_CLOEXEC = 0x80000
|
||||
|
|
|
@ -60,6 +60,8 @@ const (
|
|||
CS8 = 0x30
|
||||
CSIZE = 0x30
|
||||
CSTOPB = 0x40
|
||||
ECCGETLAYOUT = 0x41484d11
|
||||
ECCGETSTATS = 0x40104d12
|
||||
ECHOCTL = 0x200
|
||||
ECHOE = 0x10
|
||||
ECHOK = 0x20
|
||||
|
@ -121,6 +123,19 @@ const (
|
|||
MCL_CURRENT = 0x1
|
||||
MCL_FUTURE = 0x2
|
||||
MCL_ONFAULT = 0x4
|
||||
MEMERASE = 0x80084d02
|
||||
MEMERASE64 = 0x80104d14
|
||||
MEMGETBADBLOCK = 0x80084d0b
|
||||
MEMGETINFO = 0x40204d01
|
||||
MEMGETOOBSEL = 0x40c84d0a
|
||||
MEMGETREGIONCOUNT = 0x40044d07
|
||||
MEMISLOCKED = 0x40084d17
|
||||
MEMLOCK = 0x80084d05
|
||||
MEMREADOOB = 0xc0104d04
|
||||
MEMSETBADBLOCK = 0x80084d0c
|
||||
MEMUNLOCK = 0x80084d06
|
||||
MEMWRITEOOB = 0xc0104d03
|
||||
MTDFILEMODE = 0x20004d13
|
||||
NFDBITS = 0x40
|
||||
NLDLY = 0x100
|
||||
NOFLSH = 0x80
|
||||
|
@ -130,6 +145,10 @@ const (
|
|||
NS_GET_USERNS = 0x2000b701
|
||||
OLCUC = 0x2
|
||||
ONLCR = 0x4
|
||||
OTPGETREGIONCOUNT = 0x80044d0e
|
||||
OTPGETREGIONINFO = 0x800c4d0f
|
||||
OTPLOCK = 0x400c4d10
|
||||
OTPSELECT = 0x40044d0d
|
||||
O_APPEND = 0x8
|
||||
O_ASYNC = 0x1000
|
||||
O_CLOEXEC = 0x80000
|
||||
|
|
|
@ -60,6 +60,8 @@ const (
|
|||
CS8 = 0x30
|
||||
CSIZE = 0x30
|
||||
CSTOPB = 0x40
|
||||
ECCGETLAYOUT = 0x41484d11
|
||||
ECCGETSTATS = 0x40104d12
|
||||
ECHOCTL = 0x200
|
||||
ECHOE = 0x10
|
||||
ECHOK = 0x20
|
||||
|
@ -121,6 +123,19 @@ const (
|
|||
MCL_CURRENT = 0x1
|
||||
MCL_FUTURE = 0x2
|
||||
MCL_ONFAULT = 0x4
|
||||
MEMERASE = 0x80084d02
|
||||
MEMERASE64 = 0x80104d14
|
||||
MEMGETBADBLOCK = 0x80084d0b
|
||||
MEMGETINFO = 0x40204d01
|
||||
MEMGETOOBSEL = 0x40c84d0a
|
||||
MEMGETREGIONCOUNT = 0x40044d07
|
||||
MEMISLOCKED = 0x40084d17
|
||||
MEMLOCK = 0x80084d05
|
||||
MEMREADOOB = 0xc0104d04
|
||||
MEMSETBADBLOCK = 0x80084d0c
|
||||
MEMUNLOCK = 0x80084d06
|
||||
MEMWRITEOOB = 0xc0104d03
|
||||
MTDFILEMODE = 0x20004d13
|
||||
NFDBITS = 0x40
|
||||
NLDLY = 0x100
|
||||
NOFLSH = 0x80
|
||||
|
@ -130,6 +145,10 @@ const (
|
|||
NS_GET_USERNS = 0x2000b701
|
||||
OLCUC = 0x2
|
||||
ONLCR = 0x4
|
||||
OTPGETREGIONCOUNT = 0x80044d0e
|
||||
OTPGETREGIONINFO = 0x800c4d0f
|
||||
OTPLOCK = 0x400c4d10
|
||||
OTPSELECT = 0x40044d0d
|
||||
O_APPEND = 0x8
|
||||
O_ASYNC = 0x1000
|
||||
O_CLOEXEC = 0x80000
|
||||
|
|
|
@ -60,6 +60,8 @@ const (
|
|||
CS8 = 0x30
|
||||
CSIZE = 0x30
|
||||
CSTOPB = 0x40
|
||||
ECCGETLAYOUT = 0x41484d11
|
||||
ECCGETSTATS = 0x40104d12
|
||||
ECHOCTL = 0x200
|
||||
ECHOE = 0x10
|
||||
ECHOK = 0x20
|
||||
|
@ -121,6 +123,19 @@ const (
|
|||
MCL_CURRENT = 0x1
|
||||
MCL_FUTURE = 0x2
|
||||
MCL_ONFAULT = 0x4
|
||||
MEMERASE = 0x80084d02
|
||||
MEMERASE64 = 0x80104d14
|
||||
MEMGETBADBLOCK = 0x80084d0b
|
||||
MEMGETINFO = 0x40204d01
|
||||
MEMGETOOBSEL = 0x40c84d0a
|
||||
MEMGETREGIONCOUNT = 0x40044d07
|
||||
MEMISLOCKED = 0x40084d17
|
||||
MEMLOCK = 0x80084d05
|
||||
MEMREADOOB = 0xc00c4d04
|
||||
MEMSETBADBLOCK = 0x80084d0c
|
||||
MEMUNLOCK = 0x80084d06
|
||||
MEMWRITEOOB = 0xc00c4d03
|
||||
MTDFILEMODE = 0x20004d13
|
||||
NFDBITS = 0x20
|
||||
NLDLY = 0x100
|
||||
NOFLSH = 0x80
|
||||
|
@ -130,6 +145,10 @@ const (
|
|||
NS_GET_USERNS = 0x2000b701
|
||||
OLCUC = 0x2
|
||||
ONLCR = 0x4
|
||||
OTPGETREGIONCOUNT = 0x80044d0e
|
||||
OTPGETREGIONINFO = 0x800c4d0f
|
||||
OTPLOCK = 0x400c4d10
|
||||
OTPSELECT = 0x40044d0d
|
||||
O_APPEND = 0x8
|
||||
O_ASYNC = 0x1000
|
||||
O_CLOEXEC = 0x80000
|
||||
|
|
|
@ -60,6 +60,8 @@ const (
|
|||
CS8 = 0x300
|
||||
CSIZE = 0x300
|
||||
CSTOPB = 0x400
|
||||
ECCGETLAYOUT = 0x41484d11
|
||||
ECCGETSTATS = 0x40104d12
|
||||
ECHOCTL = 0x40
|
||||
ECHOE = 0x2
|
||||
ECHOK = 0x4
|
||||
|
@ -121,6 +123,19 @@ const (
|
|||
MCL_CURRENT = 0x2000
|
||||
MCL_FUTURE = 0x4000
|
||||
MCL_ONFAULT = 0x8000
|
||||
MEMERASE = 0x80084d02
|
||||
MEMERASE64 = 0x80104d14
|
||||
MEMGETBADBLOCK = 0x80084d0b
|
||||
MEMGETINFO = 0x40204d01
|
||||
MEMGETOOBSEL = 0x40c84d0a
|
||||
MEMGETREGIONCOUNT = 0x40044d07
|
||||
MEMISLOCKED = 0x40084d17
|
||||
MEMLOCK = 0x80084d05
|
||||
MEMREADOOB = 0xc00c4d04
|
||||
MEMSETBADBLOCK = 0x80084d0c
|
||||
MEMUNLOCK = 0x80084d06
|
||||
MEMWRITEOOB = 0xc00c4d03
|
||||
MTDFILEMODE = 0x20004d13
|
||||
NFDBITS = 0x20
|
||||
NL2 = 0x200
|
||||
NL3 = 0x300
|
||||
|
@ -132,6 +147,10 @@ const (
|
|||
NS_GET_USERNS = 0x2000b701
|
||||
OLCUC = 0x4
|
||||
ONLCR = 0x2
|
||||
OTPGETREGIONCOUNT = 0x80044d0e
|
||||
OTPGETREGIONINFO = 0x800c4d0f
|
||||
OTPLOCK = 0x400c4d10
|
||||
OTPSELECT = 0x40044d0d
|
||||
O_APPEND = 0x400
|
||||
O_ASYNC = 0x2000
|
||||
O_CLOEXEC = 0x80000
|
||||
|
|
|
@ -60,6 +60,8 @@ const (
|
|||
CS8 = 0x300
|
||||
CSIZE = 0x300
|
||||
CSTOPB = 0x400
|
||||
ECCGETLAYOUT = 0x41484d11
|
||||
ECCGETSTATS = 0x40104d12
|
||||
ECHOCTL = 0x40
|
||||
ECHOE = 0x2
|
||||
ECHOK = 0x4
|
||||
|
@ -121,6 +123,19 @@ const (
|
|||
MCL_CURRENT = 0x2000
|
||||
MCL_FUTURE = 0x4000
|
||||
MCL_ONFAULT = 0x8000
|
||||
MEMERASE = 0x80084d02
|
||||
MEMERASE64 = 0x80104d14
|
||||
MEMGETBADBLOCK = 0x80084d0b
|
||||
MEMGETINFO = 0x40204d01
|
||||
MEMGETOOBSEL = 0x40c84d0a
|
||||
MEMGETREGIONCOUNT = 0x40044d07
|
||||
MEMISLOCKED = 0x40084d17
|
||||
MEMLOCK = 0x80084d05
|
||||
MEMREADOOB = 0xc0104d04
|
||||
MEMSETBADBLOCK = 0x80084d0c
|
||||
MEMUNLOCK = 0x80084d06
|
||||
MEMWRITEOOB = 0xc0104d03
|
||||
MTDFILEMODE = 0x20004d13
|
||||
NFDBITS = 0x40
|
||||
NL2 = 0x200
|
||||
NL3 = 0x300
|
||||
|
@ -132,6 +147,10 @@ const (
|
|||
NS_GET_USERNS = 0x2000b701
|
||||
OLCUC = 0x4
|
||||
ONLCR = 0x2
|
||||
OTPGETREGIONCOUNT = 0x80044d0e
|
||||
OTPGETREGIONINFO = 0x800c4d0f
|
||||
OTPLOCK = 0x400c4d10
|
||||
OTPSELECT = 0x40044d0d
|
||||
O_APPEND = 0x400
|
||||
O_ASYNC = 0x2000
|
||||
O_CLOEXEC = 0x80000
|
||||
|
|
|
@ -60,6 +60,8 @@ const (
|
|||
CS8 = 0x300
|
||||
CSIZE = 0x300
|
||||
CSTOPB = 0x400
|
||||
ECCGETLAYOUT = 0x41484d11
|
||||
ECCGETSTATS = 0x40104d12
|
||||
ECHOCTL = 0x40
|
||||
ECHOE = 0x2
|
||||
ECHOK = 0x4
|
||||
|
@ -121,6 +123,19 @@ const (
|
|||
MCL_CURRENT = 0x2000
|
||||
MCL_FUTURE = 0x4000
|
||||
MCL_ONFAULT = 0x8000
|
||||
MEMERASE = 0x80084d02
|
||||
MEMERASE64 = 0x80104d14
|
||||
MEMGETBADBLOCK = 0x80084d0b
|
||||
MEMGETINFO = 0x40204d01
|
||||
MEMGETOOBSEL = 0x40c84d0a
|
||||
MEMGETREGIONCOUNT = 0x40044d07
|
||||
MEMISLOCKED = 0x40084d17
|
||||
MEMLOCK = 0x80084d05
|
||||
MEMREADOOB = 0xc0104d04
|
||||
MEMSETBADBLOCK = 0x80084d0c
|
||||
MEMUNLOCK = 0x80084d06
|
||||
MEMWRITEOOB = 0xc0104d03
|
||||
MTDFILEMODE = 0x20004d13
|
||||
NFDBITS = 0x40
|
||||
NL2 = 0x200
|
||||
NL3 = 0x300
|
||||
|
@ -132,6 +147,10 @@ const (
|
|||
NS_GET_USERNS = 0x2000b701
|
||||
OLCUC = 0x4
|
||||
ONLCR = 0x2
|
||||
OTPGETREGIONCOUNT = 0x80044d0e
|
||||
OTPGETREGIONINFO = 0x800c4d0f
|
||||
OTPLOCK = 0x400c4d10
|
||||
OTPSELECT = 0x40044d0d
|
||||
O_APPEND = 0x400
|
||||
O_ASYNC = 0x2000
|
||||
O_CLOEXEC = 0x80000
|
||||
|
|
|
@ -60,6 +60,8 @@ const (
|
|||
CS8 = 0x30
|
||||
CSIZE = 0x30
|
||||
CSTOPB = 0x40
|
||||
ECCGETLAYOUT = 0x81484d11
|
||||
ECCGETSTATS = 0x80104d12
|
||||
ECHOCTL = 0x200
|
||||
ECHOE = 0x10
|
||||
ECHOK = 0x20
|
||||
|
@ -121,6 +123,19 @@ const (
|
|||
MCL_CURRENT = 0x1
|
||||
MCL_FUTURE = 0x2
|
||||
MCL_ONFAULT = 0x4
|
||||
MEMERASE = 0x40084d02
|
||||
MEMERASE64 = 0x40104d14
|
||||
MEMGETBADBLOCK = 0x40084d0b
|
||||
MEMGETINFO = 0x80204d01
|
||||
MEMGETOOBSEL = 0x80c84d0a
|
||||
MEMGETREGIONCOUNT = 0x80044d07
|
||||
MEMISLOCKED = 0x80084d17
|
||||
MEMLOCK = 0x40084d05
|
||||
MEMREADOOB = 0xc0104d04
|
||||
MEMSETBADBLOCK = 0x40084d0c
|
||||
MEMUNLOCK = 0x40084d06
|
||||
MEMWRITEOOB = 0xc0104d03
|
||||
MTDFILEMODE = 0x4d13
|
||||
NFDBITS = 0x40
|
||||
NLDLY = 0x100
|
||||
NOFLSH = 0x80
|
||||
|
@ -130,6 +145,10 @@ const (
|
|||
NS_GET_USERNS = 0xb701
|
||||
OLCUC = 0x2
|
||||
ONLCR = 0x4
|
||||
OTPGETREGIONCOUNT = 0x40044d0e
|
||||
OTPGETREGIONINFO = 0x400c4d0f
|
||||
OTPLOCK = 0x800c4d10
|
||||
OTPSELECT = 0x80044d0d
|
||||
O_APPEND = 0x400
|
||||
O_ASYNC = 0x2000
|
||||
O_CLOEXEC = 0x80000
|
||||
|
|
|
@ -60,6 +60,8 @@ const (
|
|||
CS8 = 0x30
|
||||
CSIZE = 0x30
|
||||
CSTOPB = 0x40
|
||||
ECCGETLAYOUT = 0x81484d11
|
||||
ECCGETSTATS = 0x80104d12
|
||||
ECHOCTL = 0x200
|
||||
ECHOE = 0x10
|
||||
ECHOK = 0x20
|
||||
|
@ -121,6 +123,19 @@ const (
|
|||
MCL_CURRENT = 0x1
|
||||
MCL_FUTURE = 0x2
|
||||
MCL_ONFAULT = 0x4
|
||||
MEMERASE = 0x40084d02
|
||||
MEMERASE64 = 0x40104d14
|
||||
MEMGETBADBLOCK = 0x40084d0b
|
||||
MEMGETINFO = 0x80204d01
|
||||
MEMGETOOBSEL = 0x80c84d0a
|
||||
MEMGETREGIONCOUNT = 0x80044d07
|
||||
MEMISLOCKED = 0x80084d17
|
||||
MEMLOCK = 0x40084d05
|
||||
MEMREADOOB = 0xc0104d04
|
||||
MEMSETBADBLOCK = 0x40084d0c
|
||||
MEMUNLOCK = 0x40084d06
|
||||
MEMWRITEOOB = 0xc0104d03
|
||||
MTDFILEMODE = 0x4d13
|
||||
NFDBITS = 0x40
|
||||
NLDLY = 0x100
|
||||
NOFLSH = 0x80
|
||||
|
@ -130,6 +145,10 @@ const (
|
|||
NS_GET_USERNS = 0xb701
|
||||
OLCUC = 0x2
|
||||
ONLCR = 0x4
|
||||
OTPGETREGIONCOUNT = 0x40044d0e
|
||||
OTPGETREGIONINFO = 0x400c4d0f
|
||||
OTPLOCK = 0x800c4d10
|
||||
OTPSELECT = 0x80044d0d
|
||||
O_APPEND = 0x400
|
||||
O_ASYNC = 0x2000
|
||||
O_CLOEXEC = 0x80000
|
||||
|
|
|
@ -63,6 +63,8 @@ const (
|
|||
CS8 = 0x30
|
||||
CSIZE = 0x30
|
||||
CSTOPB = 0x40
|
||||
ECCGETLAYOUT = 0x41484d11
|
||||
ECCGETSTATS = 0x40104d12
|
||||
ECHOCTL = 0x200
|
||||
ECHOE = 0x10
|
||||
ECHOK = 0x20
|
||||
|
@ -126,6 +128,19 @@ const (
|
|||
MCL_CURRENT = 0x2000
|
||||
MCL_FUTURE = 0x4000
|
||||
MCL_ONFAULT = 0x8000
|
||||
MEMERASE = 0x80084d02
|
||||
MEMERASE64 = 0x80104d14
|
||||
MEMGETBADBLOCK = 0x80084d0b
|
||||
MEMGETINFO = 0x40204d01
|
||||
MEMGETOOBSEL = 0x40c84d0a
|
||||
MEMGETREGIONCOUNT = 0x40044d07
|
||||
MEMISLOCKED = 0x40084d17
|
||||
MEMLOCK = 0x80084d05
|
||||
MEMREADOOB = 0xc0104d04
|
||||
MEMSETBADBLOCK = 0x80084d0c
|
||||
MEMUNLOCK = 0x80084d06
|
||||
MEMWRITEOOB = 0xc0104d03
|
||||
MTDFILEMODE = 0x20004d13
|
||||
NFDBITS = 0x40
|
||||
NLDLY = 0x100
|
||||
NOFLSH = 0x80
|
||||
|
@ -135,6 +150,10 @@ const (
|
|||
NS_GET_USERNS = 0x2000b701
|
||||
OLCUC = 0x2
|
||||
ONLCR = 0x4
|
||||
OTPGETREGIONCOUNT = 0x80044d0e
|
||||
OTPGETREGIONINFO = 0x800c4d0f
|
||||
OTPLOCK = 0x400c4d10
|
||||
OTPSELECT = 0x40044d0d
|
||||
O_APPEND = 0x8
|
||||
O_ASYNC = 0x40
|
||||
O_CLOEXEC = 0x400000
|
||||
|
|
|
@ -535,3 +535,107 @@ type CtlInfo struct {
|
|||
Id uint32
|
||||
Name [96]byte
|
||||
}
|
||||
|
||||
const SizeofKinfoProc = 0x288
|
||||
|
||||
type Eproc struct {
|
||||
Paddr uintptr
|
||||
Sess uintptr
|
||||
Pcred Pcred
|
||||
Ucred Ucred
|
||||
Vm Vmspace
|
||||
Ppid int32
|
||||
Pgid int32
|
||||
Jobc int16
|
||||
Tdev int32
|
||||
Tpgid int32
|
||||
Tsess uintptr
|
||||
Wmesg [8]int8
|
||||
Xsize int32
|
||||
Xrssize int16
|
||||
Xccount int16
|
||||
Xswrss int16
|
||||
Flag int32
|
||||
Login [12]int8
|
||||
Spare [4]int32
|
||||
_ [4]byte
|
||||
}
|
||||
|
||||
type ExternProc struct {
|
||||
P_starttime Timeval
|
||||
P_vmspace *Vmspace
|
||||
P_sigacts uintptr
|
||||
P_flag int32
|
||||
P_stat int8
|
||||
P_pid int32
|
||||
P_oppid int32
|
||||
P_dupfd int32
|
||||
User_stack *int8
|
||||
Exit_thread *byte
|
||||
P_debugger int32
|
||||
Sigwait int32
|
||||
P_estcpu uint32
|
||||
P_cpticks int32
|
||||
P_pctcpu uint32
|
||||
P_wchan *byte
|
||||
P_wmesg *int8
|
||||
P_swtime uint32
|
||||
P_slptime uint32
|
||||
P_realtimer Itimerval
|
||||
P_rtime Timeval
|
||||
P_uticks uint64
|
||||
P_sticks uint64
|
||||
P_iticks uint64
|
||||
P_traceflag int32
|
||||
P_tracep uintptr
|
||||
P_siglist int32
|
||||
P_textvp uintptr
|
||||
P_holdcnt int32
|
||||
P_sigmask uint32
|
||||
P_sigignore uint32
|
||||
P_sigcatch uint32
|
||||
P_priority uint8
|
||||
P_usrpri uint8
|
||||
P_nice int8
|
||||
P_comm [17]int8
|
||||
P_pgrp uintptr
|
||||
P_addr uintptr
|
||||
P_xstat uint16
|
||||
P_acflag uint16
|
||||
P_ru *Rusage
|
||||
}
|
||||
|
||||
type Itimerval struct {
|
||||
Interval Timeval
|
||||
Value Timeval
|
||||
}
|
||||
|
||||
type KinfoProc struct {
|
||||
Proc ExternProc
|
||||
Eproc Eproc
|
||||
}
|
||||
|
||||
type Vmspace struct {
|
||||
Dummy int32
|
||||
Dummy2 *int8
|
||||
Dummy3 [5]int32
|
||||
Dummy4 [3]*int8
|
||||
}
|
||||
|
||||
type Pcred struct {
|
||||
Pc_lock [72]int8
|
||||
Pc_ucred uintptr
|
||||
P_ruid uint32
|
||||
P_svuid uint32
|
||||
P_rgid uint32
|
||||
P_svgid uint32
|
||||
P_refcnt int32
|
||||
_ [4]byte
|
||||
}
|
||||
|
||||
type Ucred struct {
|
||||
Ref int32
|
||||
Uid uint32
|
||||
Ngroups int16
|
||||
Groups [16]uint32
|
||||
}
|
||||
|
|
|
@ -535,3 +535,107 @@ type CtlInfo struct {
|
|||
Id uint32
|
||||
Name [96]byte
|
||||
}
|
||||
|
||||
const SizeofKinfoProc = 0x288
|
||||
|
||||
type Eproc struct {
|
||||
Paddr uintptr
|
||||
Sess uintptr
|
||||
Pcred Pcred
|
||||
Ucred Ucred
|
||||
Vm Vmspace
|
||||
Ppid int32
|
||||
Pgid int32
|
||||
Jobc int16
|
||||
Tdev int32
|
||||
Tpgid int32
|
||||
Tsess uintptr
|
||||
Wmesg [8]int8
|
||||
Xsize int32
|
||||
Xrssize int16
|
||||
Xccount int16
|
||||
Xswrss int16
|
||||
Flag int32
|
||||
Login [12]int8
|
||||
Spare [4]int32
|
||||
_ [4]byte
|
||||
}
|
||||
|
||||
type ExternProc struct {
|
||||
P_starttime Timeval
|
||||
P_vmspace *Vmspace
|
||||
P_sigacts uintptr
|
||||
P_flag int32
|
||||
P_stat int8
|
||||
P_pid int32
|
||||
P_oppid int32
|
||||
P_dupfd int32
|
||||
User_stack *int8
|
||||
Exit_thread *byte
|
||||
P_debugger int32
|
||||
Sigwait int32
|
||||
P_estcpu uint32
|
||||
P_cpticks int32
|
||||
P_pctcpu uint32
|
||||
P_wchan *byte
|
||||
P_wmesg *int8
|
||||
P_swtime uint32
|
||||
P_slptime uint32
|
||||
P_realtimer Itimerval
|
||||
P_rtime Timeval
|
||||
P_uticks uint64
|
||||
P_sticks uint64
|
||||
P_iticks uint64
|
||||
P_traceflag int32
|
||||
P_tracep uintptr
|
||||
P_siglist int32
|
||||
P_textvp uintptr
|
||||
P_holdcnt int32
|
||||
P_sigmask uint32
|
||||
P_sigignore uint32
|
||||
P_sigcatch uint32
|
||||
P_priority uint8
|
||||
P_usrpri uint8
|
||||
P_nice int8
|
||||
P_comm [17]int8
|
||||
P_pgrp uintptr
|
||||
P_addr uintptr
|
||||
P_xstat uint16
|
||||
P_acflag uint16
|
||||
P_ru *Rusage
|
||||
}
|
||||
|
||||
type Itimerval struct {
|
||||
Interval Timeval
|
||||
Value Timeval
|
||||
}
|
||||
|
||||
type KinfoProc struct {
|
||||
Proc ExternProc
|
||||
Eproc Eproc
|
||||
}
|
||||
|
||||
type Vmspace struct {
|
||||
Dummy int32
|
||||
Dummy2 *int8
|
||||
Dummy3 [5]int32
|
||||
Dummy4 [3]*int8
|
||||
}
|
||||
|
||||
type Pcred struct {
|
||||
Pc_lock [72]int8
|
||||
Pc_ucred uintptr
|
||||
P_ruid uint32
|
||||
P_svuid uint32
|
||||
P_rgid uint32
|
||||
P_svgid uint32
|
||||
P_refcnt int32
|
||||
_ [4]byte
|
||||
}
|
||||
|
||||
type Ucred struct {
|
||||
Ref int32
|
||||
Uid uint32
|
||||
Ngroups int16
|
||||
Groups [16]uint32
|
||||
}
|
||||
|
|
|
@ -431,6 +431,9 @@ type Winsize struct {
|
|||
const (
|
||||
AT_FDCWD = 0xfffafdcd
|
||||
AT_SYMLINK_NOFOLLOW = 0x1
|
||||
AT_REMOVEDIR = 0x2
|
||||
AT_EACCESS = 0x4
|
||||
AT_SYMLINK_FOLLOW = 0x8
|
||||
)
|
||||
|
||||
type PollFd struct {
|
||||
|
|
|
@ -672,9 +672,10 @@ type Winsize struct {
|
|||
|
||||
const (
|
||||
AT_FDCWD = -0x64
|
||||
AT_REMOVEDIR = 0x800
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_EACCESS = 0x100
|
||||
AT_SYMLINK_NOFOLLOW = 0x200
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_REMOVEDIR = 0x800
|
||||
)
|
||||
|
||||
type PollFd struct {
|
||||
|
|
|
@ -675,9 +675,10 @@ type Winsize struct {
|
|||
|
||||
const (
|
||||
AT_FDCWD = -0x64
|
||||
AT_REMOVEDIR = 0x800
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_EACCESS = 0x100
|
||||
AT_SYMLINK_NOFOLLOW = 0x200
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_REMOVEDIR = 0x800
|
||||
)
|
||||
|
||||
type PollFd struct {
|
||||
|
|
|
@ -656,9 +656,10 @@ type Winsize struct {
|
|||
|
||||
const (
|
||||
AT_FDCWD = -0x64
|
||||
AT_REMOVEDIR = 0x800
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_EACCESS = 0x100
|
||||
AT_SYMLINK_NOFOLLOW = 0x200
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_REMOVEDIR = 0x800
|
||||
)
|
||||
|
||||
type PollFd struct {
|
||||
|
|
|
@ -653,9 +653,10 @@ type Winsize struct {
|
|||
|
||||
const (
|
||||
AT_FDCWD = -0x64
|
||||
AT_REMOVEDIR = 0x800
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_EACCESS = 0x100
|
||||
AT_SYMLINK_NOFOLLOW = 0x200
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_REMOVEDIR = 0x800
|
||||
)
|
||||
|
||||
type PollFd struct {
|
||||
|
|
|
@ -351,6 +351,13 @@ type RawSockaddrIUCV struct {
|
|||
Name [8]int8
|
||||
}
|
||||
|
||||
type RawSockaddrNFC struct {
|
||||
Sa_family uint16
|
||||
Dev_idx uint32
|
||||
Target_idx uint32
|
||||
Nfc_protocol uint32
|
||||
}
|
||||
|
||||
type _Socklen uint32
|
||||
|
||||
type Linger struct {
|
||||
|
@ -464,6 +471,7 @@ const (
|
|||
SizeofSockaddrL2TPIP = 0x10
|
||||
SizeofSockaddrL2TPIP6 = 0x20
|
||||
SizeofSockaddrIUCV = 0x20
|
||||
SizeofSockaddrNFC = 0x10
|
||||
SizeofLinger = 0x8
|
||||
SizeofIPMreq = 0x8
|
||||
SizeofIPMreqn = 0xc
|
||||
|
@ -1765,6 +1773,8 @@ const (
|
|||
NFPROTO_NUMPROTO = 0xd
|
||||
)
|
||||
|
||||
const SO_ORIGINAL_DST = 0x50
|
||||
|
||||
type Nfgenmsg struct {
|
||||
Nfgen_family uint8
|
||||
Version uint8
|
||||
|
@ -3742,3 +3752,158 @@ const (
|
|||
NLMSGERR_ATTR_OFFS = 0x2
|
||||
NLMSGERR_ATTR_COOKIE = 0x3
|
||||
)
|
||||
|
||||
type (
|
||||
EraseInfo struct {
|
||||
Start uint32
|
||||
Length uint32
|
||||
}
|
||||
EraseInfo64 struct {
|
||||
Start uint64
|
||||
Length uint64
|
||||
}
|
||||
MtdOobBuf struct {
|
||||
Start uint32
|
||||
Length uint32
|
||||
Ptr *uint8
|
||||
}
|
||||
MtdOobBuf64 struct {
|
||||
Start uint64
|
||||
Pad uint32
|
||||
Length uint32
|
||||
Ptr uint64
|
||||
}
|
||||
MtdWriteReq struct {
|
||||
Start uint64
|
||||
Len uint64
|
||||
Ooblen uint64
|
||||
Data uint64
|
||||
Oob uint64
|
||||
Mode uint8
|
||||
_ [7]uint8
|
||||
}
|
||||
MtdInfo struct {
|
||||
Type uint8
|
||||
Flags uint32
|
||||
Size uint32
|
||||
Erasesize uint32
|
||||
Writesize uint32
|
||||
Oobsize uint32
|
||||
_ uint64
|
||||
}
|
||||
RegionInfo struct {
|
||||
Offset uint32
|
||||
Erasesize uint32
|
||||
Numblocks uint32
|
||||
Regionindex uint32
|
||||
}
|
||||
OtpInfo struct {
|
||||
Start uint32
|
||||
Length uint32
|
||||
Locked uint32
|
||||
}
|
||||
NandOobinfo struct {
|
||||
Useecc uint32
|
||||
Eccbytes uint32
|
||||
Oobfree [8][2]uint32
|
||||
Eccpos [32]uint32
|
||||
}
|
||||
NandOobfree struct {
|
||||
Offset uint32
|
||||
Length uint32
|
||||
}
|
||||
NandEcclayout struct {
|
||||
Eccbytes uint32
|
||||
Eccpos [64]uint32
|
||||
Oobavail uint32
|
||||
Oobfree [8]NandOobfree
|
||||
}
|
||||
MtdEccStats struct {
|
||||
Corrected uint32
|
||||
Failed uint32
|
||||
Badblocks uint32
|
||||
Bbtblocks uint32
|
||||
}
|
||||
)
|
||||
|
||||
const (
|
||||
MTD_OPS_PLACE_OOB = 0x0
|
||||
MTD_OPS_AUTO_OOB = 0x1
|
||||
MTD_OPS_RAW = 0x2
|
||||
)
|
||||
|
||||
const (
|
||||
MTD_FILE_MODE_NORMAL = 0x0
|
||||
MTD_FILE_MODE_OTP_FACTORY = 0x1
|
||||
MTD_FILE_MODE_OTP_USER = 0x2
|
||||
MTD_FILE_MODE_RAW = 0x3
|
||||
)
|
||||
|
||||
const (
|
||||
NFC_CMD_UNSPEC = 0x0
|
||||
NFC_CMD_GET_DEVICE = 0x1
|
||||
NFC_CMD_DEV_UP = 0x2
|
||||
NFC_CMD_DEV_DOWN = 0x3
|
||||
NFC_CMD_DEP_LINK_UP = 0x4
|
||||
NFC_CMD_DEP_LINK_DOWN = 0x5
|
||||
NFC_CMD_START_POLL = 0x6
|
||||
NFC_CMD_STOP_POLL = 0x7
|
||||
NFC_CMD_GET_TARGET = 0x8
|
||||
NFC_EVENT_TARGETS_FOUND = 0x9
|
||||
NFC_EVENT_DEVICE_ADDED = 0xa
|
||||
NFC_EVENT_DEVICE_REMOVED = 0xb
|
||||
NFC_EVENT_TARGET_LOST = 0xc
|
||||
NFC_EVENT_TM_ACTIVATED = 0xd
|
||||
NFC_EVENT_TM_DEACTIVATED = 0xe
|
||||
NFC_CMD_LLC_GET_PARAMS = 0xf
|
||||
NFC_CMD_LLC_SET_PARAMS = 0x10
|
||||
NFC_CMD_ENABLE_SE = 0x11
|
||||
NFC_CMD_DISABLE_SE = 0x12
|
||||
NFC_CMD_LLC_SDREQ = 0x13
|
||||
NFC_EVENT_LLC_SDRES = 0x14
|
||||
NFC_CMD_FW_DOWNLOAD = 0x15
|
||||
NFC_EVENT_SE_ADDED = 0x16
|
||||
NFC_EVENT_SE_REMOVED = 0x17
|
||||
NFC_EVENT_SE_CONNECTIVITY = 0x18
|
||||
NFC_EVENT_SE_TRANSACTION = 0x19
|
||||
NFC_CMD_GET_SE = 0x1a
|
||||
NFC_CMD_SE_IO = 0x1b
|
||||
NFC_CMD_ACTIVATE_TARGET = 0x1c
|
||||
NFC_CMD_VENDOR = 0x1d
|
||||
NFC_CMD_DEACTIVATE_TARGET = 0x1e
|
||||
NFC_ATTR_UNSPEC = 0x0
|
||||
NFC_ATTR_DEVICE_INDEX = 0x1
|
||||
NFC_ATTR_DEVICE_NAME = 0x2
|
||||
NFC_ATTR_PROTOCOLS = 0x3
|
||||
NFC_ATTR_TARGET_INDEX = 0x4
|
||||
NFC_ATTR_TARGET_SENS_RES = 0x5
|
||||
NFC_ATTR_TARGET_SEL_RES = 0x6
|
||||
NFC_ATTR_TARGET_NFCID1 = 0x7
|
||||
NFC_ATTR_TARGET_SENSB_RES = 0x8
|
||||
NFC_ATTR_TARGET_SENSF_RES = 0x9
|
||||
NFC_ATTR_COMM_MODE = 0xa
|
||||
NFC_ATTR_RF_MODE = 0xb
|
||||
NFC_ATTR_DEVICE_POWERED = 0xc
|
||||
NFC_ATTR_IM_PROTOCOLS = 0xd
|
||||
NFC_ATTR_TM_PROTOCOLS = 0xe
|
||||
NFC_ATTR_LLC_PARAM_LTO = 0xf
|
||||
NFC_ATTR_LLC_PARAM_RW = 0x10
|
||||
NFC_ATTR_LLC_PARAM_MIUX = 0x11
|
||||
NFC_ATTR_SE = 0x12
|
||||
NFC_ATTR_LLC_SDP = 0x13
|
||||
NFC_ATTR_FIRMWARE_NAME = 0x14
|
||||
NFC_ATTR_SE_INDEX = 0x15
|
||||
NFC_ATTR_SE_TYPE = 0x16
|
||||
NFC_ATTR_SE_AID = 0x17
|
||||
NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS = 0x18
|
||||
NFC_ATTR_SE_APDU = 0x19
|
||||
NFC_ATTR_TARGET_ISO15693_DSFID = 0x1a
|
||||
NFC_ATTR_TARGET_ISO15693_UID = 0x1b
|
||||
NFC_ATTR_SE_PARAMS = 0x1c
|
||||
NFC_ATTR_VENDOR_ID = 0x1d
|
||||
NFC_ATTR_VENDOR_SUBCMD = 0x1e
|
||||
NFC_ATTR_VENDOR_DATA = 0x1f
|
||||
NFC_SDP_ATTR_UNSPEC = 0x0
|
||||
NFC_SDP_ATTR_URI = 0x1
|
||||
NFC_SDP_ATTR_SAP = 0x2
|
||||
)
|
||||
|
|
|
@ -128,6 +128,17 @@ const (
|
|||
FADV_NOREUSE = 0x5
|
||||
)
|
||||
|
||||
type RawSockaddrNFCLLCP struct {
|
||||
Sa_family uint16
|
||||
Dev_idx uint32
|
||||
Target_idx uint32
|
||||
Nfc_protocol uint32
|
||||
Dsap uint8
|
||||
Ssap uint8
|
||||
Service_name [63]uint8
|
||||
Service_name_len uint32
|
||||
}
|
||||
|
||||
type RawSockaddr struct {
|
||||
Family uint16
|
||||
Data [14]int8
|
||||
|
@ -160,9 +171,10 @@ type Cmsghdr struct {
|
|||
}
|
||||
|
||||
const (
|
||||
SizeofIovec = 0x8
|
||||
SizeofMsghdr = 0x1c
|
||||
SizeofCmsghdr = 0xc
|
||||
SizeofSockaddrNFCLLCP = 0x58
|
||||
SizeofIovec = 0x8
|
||||
SizeofMsghdr = 0x1c
|
||||
SizeofCmsghdr = 0xc
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -130,6 +130,17 @@ const (
|
|||
FADV_NOREUSE = 0x5
|
||||
)
|
||||
|
||||
type RawSockaddrNFCLLCP struct {
|
||||
Sa_family uint16
|
||||
Dev_idx uint32
|
||||
Target_idx uint32
|
||||
Nfc_protocol uint32
|
||||
Dsap uint8
|
||||
Ssap uint8
|
||||
Service_name [63]uint8
|
||||
Service_name_len uint64
|
||||
}
|
||||
|
||||
type RawSockaddr struct {
|
||||
Family uint16
|
||||
Data [14]int8
|
||||
|
@ -163,9 +174,10 @@ type Cmsghdr struct {
|
|||
}
|
||||
|
||||
const (
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
SizeofSockaddrNFCLLCP = 0x60
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -134,6 +134,17 @@ const (
|
|||
FADV_NOREUSE = 0x5
|
||||
)
|
||||
|
||||
type RawSockaddrNFCLLCP struct {
|
||||
Sa_family uint16
|
||||
Dev_idx uint32
|
||||
Target_idx uint32
|
||||
Nfc_protocol uint32
|
||||
Dsap uint8
|
||||
Ssap uint8
|
||||
Service_name [63]uint8
|
||||
Service_name_len uint32
|
||||
}
|
||||
|
||||
type RawSockaddr struct {
|
||||
Family uint16
|
||||
Data [14]uint8
|
||||
|
@ -166,9 +177,10 @@ type Cmsghdr struct {
|
|||
}
|
||||
|
||||
const (
|
||||
SizeofIovec = 0x8
|
||||
SizeofMsghdr = 0x1c
|
||||
SizeofCmsghdr = 0xc
|
||||
SizeofSockaddrNFCLLCP = 0x58
|
||||
SizeofIovec = 0x8
|
||||
SizeofMsghdr = 0x1c
|
||||
SizeofCmsghdr = 0xc
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -131,6 +131,17 @@ const (
|
|||
FADV_NOREUSE = 0x5
|
||||
)
|
||||
|
||||
type RawSockaddrNFCLLCP struct {
|
||||
Sa_family uint16
|
||||
Dev_idx uint32
|
||||
Target_idx uint32
|
||||
Nfc_protocol uint32
|
||||
Dsap uint8
|
||||
Ssap uint8
|
||||
Service_name [63]uint8
|
||||
Service_name_len uint64
|
||||
}
|
||||
|
||||
type RawSockaddr struct {
|
||||
Family uint16
|
||||
Data [14]int8
|
||||
|
@ -164,9 +175,10 @@ type Cmsghdr struct {
|
|||
}
|
||||
|
||||
const (
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
SizeofSockaddrNFCLLCP = 0x60
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -133,6 +133,17 @@ const (
|
|||
FADV_NOREUSE = 0x5
|
||||
)
|
||||
|
||||
type RawSockaddrNFCLLCP struct {
|
||||
Sa_family uint16
|
||||
Dev_idx uint32
|
||||
Target_idx uint32
|
||||
Nfc_protocol uint32
|
||||
Dsap uint8
|
||||
Ssap uint8
|
||||
Service_name [63]uint8
|
||||
Service_name_len uint32
|
||||
}
|
||||
|
||||
type RawSockaddr struct {
|
||||
Family uint16
|
||||
Data [14]int8
|
||||
|
@ -165,9 +176,10 @@ type Cmsghdr struct {
|
|||
}
|
||||
|
||||
const (
|
||||
SizeofIovec = 0x8
|
||||
SizeofMsghdr = 0x1c
|
||||
SizeofCmsghdr = 0xc
|
||||
SizeofSockaddrNFCLLCP = 0x58
|
||||
SizeofIovec = 0x8
|
||||
SizeofMsghdr = 0x1c
|
||||
SizeofCmsghdr = 0xc
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -131,6 +131,17 @@ const (
|
|||
FADV_NOREUSE = 0x5
|
||||
)
|
||||
|
||||
type RawSockaddrNFCLLCP struct {
|
||||
Sa_family uint16
|
||||
Dev_idx uint32
|
||||
Target_idx uint32
|
||||
Nfc_protocol uint32
|
||||
Dsap uint8
|
||||
Ssap uint8
|
||||
Service_name [63]uint8
|
||||
Service_name_len uint64
|
||||
}
|
||||
|
||||
type RawSockaddr struct {
|
||||
Family uint16
|
||||
Data [14]int8
|
||||
|
@ -164,9 +175,10 @@ type Cmsghdr struct {
|
|||
}
|
||||
|
||||
const (
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
SizeofSockaddrNFCLLCP = 0x60
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -131,6 +131,17 @@ const (
|
|||
FADV_NOREUSE = 0x5
|
||||
)
|
||||
|
||||
type RawSockaddrNFCLLCP struct {
|
||||
Sa_family uint16
|
||||
Dev_idx uint32
|
||||
Target_idx uint32
|
||||
Nfc_protocol uint32
|
||||
Dsap uint8
|
||||
Ssap uint8
|
||||
Service_name [63]uint8
|
||||
Service_name_len uint64
|
||||
}
|
||||
|
||||
type RawSockaddr struct {
|
||||
Family uint16
|
||||
Data [14]int8
|
||||
|
@ -164,9 +175,10 @@ type Cmsghdr struct {
|
|||
}
|
||||
|
||||
const (
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
SizeofSockaddrNFCLLCP = 0x60
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -133,6 +133,17 @@ const (
|
|||
FADV_NOREUSE = 0x5
|
||||
)
|
||||
|
||||
type RawSockaddrNFCLLCP struct {
|
||||
Sa_family uint16
|
||||
Dev_idx uint32
|
||||
Target_idx uint32
|
||||
Nfc_protocol uint32
|
||||
Dsap uint8
|
||||
Ssap uint8
|
||||
Service_name [63]uint8
|
||||
Service_name_len uint32
|
||||
}
|
||||
|
||||
type RawSockaddr struct {
|
||||
Family uint16
|
||||
Data [14]int8
|
||||
|
@ -165,9 +176,10 @@ type Cmsghdr struct {
|
|||
}
|
||||
|
||||
const (
|
||||
SizeofIovec = 0x8
|
||||
SizeofMsghdr = 0x1c
|
||||
SizeofCmsghdr = 0xc
|
||||
SizeofSockaddrNFCLLCP = 0x58
|
||||
SizeofIovec = 0x8
|
||||
SizeofMsghdr = 0x1c
|
||||
SizeofCmsghdr = 0xc
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -134,6 +134,17 @@ const (
|
|||
FADV_NOREUSE = 0x5
|
||||
)
|
||||
|
||||
type RawSockaddrNFCLLCP struct {
|
||||
Sa_family uint16
|
||||
Dev_idx uint32
|
||||
Target_idx uint32
|
||||
Nfc_protocol uint32
|
||||
Dsap uint8
|
||||
Ssap uint8
|
||||
Service_name [63]uint8
|
||||
Service_name_len uint32
|
||||
}
|
||||
|
||||
type RawSockaddr struct {
|
||||
Family uint16
|
||||
Data [14]uint8
|
||||
|
@ -166,9 +177,10 @@ type Cmsghdr struct {
|
|||
}
|
||||
|
||||
const (
|
||||
SizeofIovec = 0x8
|
||||
SizeofMsghdr = 0x1c
|
||||
SizeofCmsghdr = 0xc
|
||||
SizeofSockaddrNFCLLCP = 0x58
|
||||
SizeofIovec = 0x8
|
||||
SizeofMsghdr = 0x1c
|
||||
SizeofCmsghdr = 0xc
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -132,6 +132,17 @@ const (
|
|||
FADV_NOREUSE = 0x5
|
||||
)
|
||||
|
||||
type RawSockaddrNFCLLCP struct {
|
||||
Sa_family uint16
|
||||
Dev_idx uint32
|
||||
Target_idx uint32
|
||||
Nfc_protocol uint32
|
||||
Dsap uint8
|
||||
Ssap uint8
|
||||
Service_name [63]uint8
|
||||
Service_name_len uint64
|
||||
}
|
||||
|
||||
type RawSockaddr struct {
|
||||
Family uint16
|
||||
Data [14]uint8
|
||||
|
@ -165,9 +176,10 @@ type Cmsghdr struct {
|
|||
}
|
||||
|
||||
const (
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
SizeofSockaddrNFCLLCP = 0x60
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -132,6 +132,17 @@ const (
|
|||
FADV_NOREUSE = 0x5
|
||||
)
|
||||
|
||||
type RawSockaddrNFCLLCP struct {
|
||||
Sa_family uint16
|
||||
Dev_idx uint32
|
||||
Target_idx uint32
|
||||
Nfc_protocol uint32
|
||||
Dsap uint8
|
||||
Ssap uint8
|
||||
Service_name [63]uint8
|
||||
Service_name_len uint64
|
||||
}
|
||||
|
||||
type RawSockaddr struct {
|
||||
Family uint16
|
||||
Data [14]uint8
|
||||
|
@ -165,9 +176,10 @@ type Cmsghdr struct {
|
|||
}
|
||||
|
||||
const (
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
SizeofSockaddrNFCLLCP = 0x60
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -131,6 +131,17 @@ const (
|
|||
FADV_NOREUSE = 0x5
|
||||
)
|
||||
|
||||
type RawSockaddrNFCLLCP struct {
|
||||
Sa_family uint16
|
||||
Dev_idx uint32
|
||||
Target_idx uint32
|
||||
Nfc_protocol uint32
|
||||
Dsap uint8
|
||||
Ssap uint8
|
||||
Service_name [63]uint8
|
||||
Service_name_len uint64
|
||||
}
|
||||
|
||||
type RawSockaddr struct {
|
||||
Family uint16
|
||||
Data [14]uint8
|
||||
|
@ -164,9 +175,10 @@ type Cmsghdr struct {
|
|||
}
|
||||
|
||||
const (
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
SizeofSockaddrNFCLLCP = 0x60
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -130,6 +130,17 @@ const (
|
|||
FADV_NOREUSE = 0x7
|
||||
)
|
||||
|
||||
type RawSockaddrNFCLLCP struct {
|
||||
Sa_family uint16
|
||||
Dev_idx uint32
|
||||
Target_idx uint32
|
||||
Nfc_protocol uint32
|
||||
Dsap uint8
|
||||
Ssap uint8
|
||||
Service_name [63]uint8
|
||||
Service_name_len uint64
|
||||
}
|
||||
|
||||
type RawSockaddr struct {
|
||||
Family uint16
|
||||
Data [14]int8
|
||||
|
@ -163,9 +174,10 @@ type Cmsghdr struct {
|
|||
}
|
||||
|
||||
const (
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
SizeofSockaddrNFCLLCP = 0x60
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -134,6 +134,17 @@ const (
|
|||
FADV_NOREUSE = 0x5
|
||||
)
|
||||
|
||||
type RawSockaddrNFCLLCP struct {
|
||||
Sa_family uint16
|
||||
Dev_idx uint32
|
||||
Target_idx uint32
|
||||
Nfc_protocol uint32
|
||||
Dsap uint8
|
||||
Ssap uint8
|
||||
Service_name [63]uint8
|
||||
Service_name_len uint64
|
||||
}
|
||||
|
||||
type RawSockaddr struct {
|
||||
Family uint16
|
||||
Data [14]int8
|
||||
|
@ -167,9 +178,10 @@ type Cmsghdr struct {
|
|||
}
|
||||
|
||||
const (
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
SizeofSockaddrNFCLLCP = 0x60
|
||||
SizeofIovec = 0x10
|
||||
SizeofMsghdr = 0x38
|
||||
SizeofCmsghdr = 0x10
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -445,8 +445,10 @@ type Ptmget struct {
|
|||
|
||||
const (
|
||||
AT_FDCWD = -0x64
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_EACCESS = 0x100
|
||||
AT_SYMLINK_NOFOLLOW = 0x200
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_REMOVEDIR = 0x800
|
||||
)
|
||||
|
||||
type PollFd struct {
|
||||
|
|
|
@ -453,8 +453,10 @@ type Ptmget struct {
|
|||
|
||||
const (
|
||||
AT_FDCWD = -0x64
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_EACCESS = 0x100
|
||||
AT_SYMLINK_NOFOLLOW = 0x200
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_REMOVEDIR = 0x800
|
||||
)
|
||||
|
||||
type PollFd struct {
|
||||
|
|
|
@ -450,8 +450,10 @@ type Ptmget struct {
|
|||
|
||||
const (
|
||||
AT_FDCWD = -0x64
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_EACCESS = 0x100
|
||||
AT_SYMLINK_NOFOLLOW = 0x200
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_REMOVEDIR = 0x800
|
||||
)
|
||||
|
||||
type PollFd struct {
|
||||
|
|
|
@ -453,8 +453,10 @@ type Ptmget struct {
|
|||
|
||||
const (
|
||||
AT_FDCWD = -0x64
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_EACCESS = 0x100
|
||||
AT_SYMLINK_NOFOLLOW = 0x200
|
||||
AT_SYMLINK_FOLLOW = 0x400
|
||||
AT_REMOVEDIR = 0x800
|
||||
)
|
||||
|
||||
type PollFd struct {
|
||||
|
|
|
@ -438,8 +438,10 @@ type Winsize struct {
|
|||
|
||||
const (
|
||||
AT_FDCWD = -0x64
|
||||
AT_SYMLINK_FOLLOW = 0x4
|
||||
AT_EACCESS = 0x1
|
||||
AT_SYMLINK_NOFOLLOW = 0x2
|
||||
AT_SYMLINK_FOLLOW = 0x4
|
||||
AT_REMOVEDIR = 0x8
|
||||
)
|
||||
|
||||
type PollFd struct {
|
||||
|
|
|
@ -438,8 +438,10 @@ type Winsize struct {
|
|||
|
||||
const (
|
||||
AT_FDCWD = -0x64
|
||||
AT_SYMLINK_FOLLOW = 0x4
|
||||
AT_EACCESS = 0x1
|
||||
AT_SYMLINK_NOFOLLOW = 0x2
|
||||
AT_SYMLINK_FOLLOW = 0x4
|
||||
AT_REMOVEDIR = 0x8
|
||||
)
|
||||
|
||||
type PollFd struct {
|
||||
|
|
|
@ -439,8 +439,10 @@ type Winsize struct {
|
|||
|
||||
const (
|
||||
AT_FDCWD = -0x64
|
||||
AT_SYMLINK_FOLLOW = 0x4
|
||||
AT_EACCESS = 0x1
|
||||
AT_SYMLINK_NOFOLLOW = 0x2
|
||||
AT_SYMLINK_FOLLOW = 0x4
|
||||
AT_REMOVEDIR = 0x8
|
||||
)
|
||||
|
||||
type PollFd struct {
|
||||
|
|
|
@ -432,8 +432,10 @@ type Winsize struct {
|
|||
|
||||
const (
|
||||
AT_FDCWD = -0x64
|
||||
AT_SYMLINK_FOLLOW = 0x4
|
||||
AT_EACCESS = 0x1
|
||||
AT_SYMLINK_NOFOLLOW = 0x2
|
||||
AT_SYMLINK_FOLLOW = 0x4
|
||||
AT_REMOVEDIR = 0x8
|
||||
)
|
||||
|
||||
type PollFd struct {
|
||||
|
|
|
@ -432,8 +432,10 @@ type Winsize struct {
|
|||
|
||||
const (
|
||||
AT_FDCWD = -0x64
|
||||
AT_SYMLINK_FOLLOW = 0x4
|
||||
AT_EACCESS = 0x1
|
||||
AT_SYMLINK_NOFOLLOW = 0x2
|
||||
AT_SYMLINK_FOLLOW = 0x4
|
||||
AT_REMOVEDIR = 0x8
|
||||
)
|
||||
|
||||
type PollFd struct {
|
||||
|
|
|
@ -9,6 +9,8 @@ package windows
|
|||
import (
|
||||
errorspkg "errors"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/sys/internal/unsafeheader"
|
||||
)
|
||||
|
||||
// EscapeArg rewrites command line argument s as prescribed
|
||||
|
@ -78,6 +80,40 @@ func EscapeArg(s string) string {
|
|||
return string(qs[:j])
|
||||
}
|
||||
|
||||
// ComposeCommandLine escapes and joins the given arguments suitable for use as a Windows command line,
|
||||
// in CreateProcess's CommandLine argument, CreateService/ChangeServiceConfig's BinaryPathName argument,
|
||||
// or any program that uses CommandLineToArgv.
|
||||
func ComposeCommandLine(args []string) string {
|
||||
var commandLine string
|
||||
for i := range args {
|
||||
if i > 0 {
|
||||
commandLine += " "
|
||||
}
|
||||
commandLine += EscapeArg(args[i])
|
||||
}
|
||||
return commandLine
|
||||
}
|
||||
|
||||
// DecomposeCommandLine breaks apart its argument command line into unescaped parts using CommandLineToArgv,
|
||||
// as gathered from GetCommandLine, QUERY_SERVICE_CONFIG's BinaryPathName argument, or elsewhere that
|
||||
// command lines are passed around.
|
||||
func DecomposeCommandLine(commandLine string) ([]string, error) {
|
||||
if len(commandLine) == 0 {
|
||||
return []string{}, nil
|
||||
}
|
||||
var argc int32
|
||||
argv, err := CommandLineToArgv(StringToUTF16Ptr(commandLine), &argc)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer LocalFree(Handle(unsafe.Pointer(argv)))
|
||||
var args []string
|
||||
for _, v := range (*argv)[:argc] {
|
||||
args = append(args, UTF16ToString((*v)[:]))
|
||||
}
|
||||
return args, nil
|
||||
}
|
||||
|
||||
func CloseOnExec(fd Handle) {
|
||||
SetHandleInformation(Handle(fd), HANDLE_FLAG_INHERIT, 0)
|
||||
}
|
||||
|
@ -101,8 +137,8 @@ func FullPath(name string) (path string, err error) {
|
|||
}
|
||||
}
|
||||
|
||||
// NewProcThreadAttributeList allocates a new ProcThreadAttributeList, with the requested maximum number of attributes.
|
||||
func NewProcThreadAttributeList(maxAttrCount uint32) (*ProcThreadAttributeList, error) {
|
||||
// NewProcThreadAttributeList allocates a new ProcThreadAttributeListContainer, with the requested maximum number of attributes.
|
||||
func NewProcThreadAttributeList(maxAttrCount uint32) (*ProcThreadAttributeListContainer, error) {
|
||||
var size uintptr
|
||||
err := initializeProcThreadAttributeList(nil, maxAttrCount, 0, &size)
|
||||
if err != ERROR_INSUFFICIENT_BUFFER {
|
||||
|
@ -111,10 +147,9 @@ func NewProcThreadAttributeList(maxAttrCount uint32) (*ProcThreadAttributeList,
|
|||
}
|
||||
return nil, err
|
||||
}
|
||||
const psize = unsafe.Sizeof(uintptr(0))
|
||||
// size is guaranteed to be ≥1 by InitializeProcThreadAttributeList.
|
||||
al := (*ProcThreadAttributeList)(unsafe.Pointer(&make([]unsafe.Pointer, (size+psize-1)/psize)[0]))
|
||||
err = initializeProcThreadAttributeList(al, maxAttrCount, 0, &size)
|
||||
al := &ProcThreadAttributeListContainer{data: (*ProcThreadAttributeList)(unsafe.Pointer(&make([]byte, size)[0]))}
|
||||
err = initializeProcThreadAttributeList(al.data, maxAttrCount, 0, &size)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -122,11 +157,39 @@ func NewProcThreadAttributeList(maxAttrCount uint32) (*ProcThreadAttributeList,
|
|||
}
|
||||
|
||||
// Update modifies the ProcThreadAttributeList using UpdateProcThreadAttribute.
|
||||
func (al *ProcThreadAttributeList) Update(attribute uintptr, flags uint32, value unsafe.Pointer, size uintptr, prevValue unsafe.Pointer, returnedSize *uintptr) error {
|
||||
return updateProcThreadAttribute(al, flags, attribute, value, size, prevValue, returnedSize)
|
||||
// Note that the value passed to this function will be copied into memory
|
||||
// allocated by LocalAlloc, the contents of which should not contain any
|
||||
// Go-managed pointers, even if the passed value itself is a Go-managed
|
||||
// pointer.
|
||||
func (al *ProcThreadAttributeListContainer) Update(attribute uintptr, value unsafe.Pointer, size uintptr) error {
|
||||
alloc, err := LocalAlloc(LMEM_FIXED, uint32(size))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var src, dst []byte
|
||||
hdr := (*unsafeheader.Slice)(unsafe.Pointer(&src))
|
||||
hdr.Data = value
|
||||
hdr.Cap = int(size)
|
||||
hdr.Len = int(size)
|
||||
hdr = (*unsafeheader.Slice)(unsafe.Pointer(&dst))
|
||||
hdr.Data = unsafe.Pointer(alloc)
|
||||
hdr.Cap = int(size)
|
||||
hdr.Len = int(size)
|
||||
copy(dst, src)
|
||||
al.heapAllocations = append(al.heapAllocations, alloc)
|
||||
return updateProcThreadAttribute(al.data, 0, attribute, unsafe.Pointer(alloc), size, nil, nil)
|
||||
}
|
||||
|
||||
// Delete frees ProcThreadAttributeList's resources.
|
||||
func (al *ProcThreadAttributeList) Delete() {
|
||||
deleteProcThreadAttributeList(al)
|
||||
func (al *ProcThreadAttributeListContainer) Delete() {
|
||||
deleteProcThreadAttributeList(al.data)
|
||||
for i := range al.heapAllocations {
|
||||
LocalFree(Handle(al.heapAllocations[i]))
|
||||
}
|
||||
al.heapAllocations = nil
|
||||
}
|
||||
|
||||
// List returns the actual ProcThreadAttributeList to be passed to StartupInfoEx.
|
||||
func (al *ProcThreadAttributeListContainer) List() *ProcThreadAttributeList {
|
||||
return al.data
|
||||
}
|
||||
|
|
|
@ -220,6 +220,7 @@ func NewCallbackCDecl(fn interface{}) uintptr {
|
|||
//sys CancelIo(s Handle) (err error)
|
||||
//sys CancelIoEx(s Handle, o *Overlapped) (err error)
|
||||
//sys CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) = CreateProcessW
|
||||
//sys CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) = advapi32.CreateProcessAsUserW
|
||||
//sys initializeProcThreadAttributeList(attrlist *ProcThreadAttributeList, attrcount uint32, flags uint32, size *uintptr) (err error) = InitializeProcThreadAttributeList
|
||||
//sys deleteProcThreadAttributeList(attrlist *ProcThreadAttributeList) = DeleteProcThreadAttributeList
|
||||
//sys updateProcThreadAttribute(attrlist *ProcThreadAttributeList, flags uint32, attr uintptr, value unsafe.Pointer, size uintptr, prevvalue unsafe.Pointer, returnedsize *uintptr) (err error) = UpdateProcThreadAttribute
|
||||
|
|
|
@ -680,7 +680,7 @@ const (
|
|||
WTD_CHOICE_CERT = 5
|
||||
|
||||
WTD_STATEACTION_IGNORE = 0x00000000
|
||||
WTD_STATEACTION_VERIFY = 0x00000010
|
||||
WTD_STATEACTION_VERIFY = 0x00000001
|
||||
WTD_STATEACTION_CLOSE = 0x00000002
|
||||
WTD_STATEACTION_AUTO_CACHE = 0x00000003
|
||||
WTD_STATEACTION_AUTO_CACHE_FLUSH = 0x00000004
|
||||
|
@ -909,14 +909,15 @@ type StartupInfoEx struct {
|
|||
|
||||
// ProcThreadAttributeList is a placeholder type to represent a PROC_THREAD_ATTRIBUTE_LIST.
|
||||
//
|
||||
// To create a *ProcThreadAttributeList, use NewProcThreadAttributeList, and
|
||||
// free its memory using ProcThreadAttributeList.Delete.
|
||||
type ProcThreadAttributeList struct {
|
||||
// This is of type unsafe.Pointer, not of type byte or uintptr, because
|
||||
// the contents of it is mostly a list of pointers, and in most cases,
|
||||
// that's a list of pointers to Go-allocated objects. In order to keep
|
||||
// the GC from collecting these objects, we declare this as unsafe.Pointer.
|
||||
_ [1]unsafe.Pointer
|
||||
// To create a *ProcThreadAttributeList, use NewProcThreadAttributeList, update
|
||||
// it with ProcThreadAttributeListContainer.Update, free its memory using
|
||||
// ProcThreadAttributeListContainer.Delete, and access the list itself using
|
||||
// ProcThreadAttributeListContainer.List.
|
||||
type ProcThreadAttributeList struct{}
|
||||
|
||||
type ProcThreadAttributeListContainer struct {
|
||||
data *ProcThreadAttributeList
|
||||
heapAllocations []uintptr
|
||||
}
|
||||
|
||||
type ProcessInformation struct {
|
||||
|
|
|
@ -69,6 +69,7 @@ var (
|
|||
procConvertStringSecurityDescriptorToSecurityDescriptorW = modadvapi32.NewProc("ConvertStringSecurityDescriptorToSecurityDescriptorW")
|
||||
procConvertStringSidToSidW = modadvapi32.NewProc("ConvertStringSidToSidW")
|
||||
procCopySid = modadvapi32.NewProc("CopySid")
|
||||
procCreateProcessAsUserW = modadvapi32.NewProc("CreateProcessAsUserW")
|
||||
procCreateServiceW = modadvapi32.NewProc("CreateServiceW")
|
||||
procCreateWellKnownSid = modadvapi32.NewProc("CreateWellKnownSid")
|
||||
procCryptAcquireContextW = modadvapi32.NewProc("CryptAcquireContextW")
|
||||
|
@ -553,6 +554,18 @@ func CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) {
|
||||
var _p0 uint32
|
||||
if inheritHandles {
|
||||
_p0 = 1
|
||||
}
|
||||
r1, _, e1 := syscall.Syscall12(procCreateProcessAsUserW.Addr(), 11, uintptr(token), uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)), 0)
|
||||
if r1 == 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access uint32, srvType uint32, startType uint32, errCtl uint32, pathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16) (handle Handle, err error) {
|
||||
r0, _, e1 := syscall.Syscall15(procCreateServiceW.Addr(), 13, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(unsafe.Pointer(displayName)), uintptr(access), uintptr(srvType), uintptr(startType), uintptr(errCtl), uintptr(unsafe.Pointer(pathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), 0, 0)
|
||||
handle = Handle(r0)
|
||||
|
|
|
@ -503,7 +503,8 @@ golang.org/x/oauth2/jwt
|
|||
## explicit
|
||||
golang.org/x/sync/errgroup
|
||||
golang.org/x/sync/semaphore
|
||||
# golang.org/x/sys v0.0.0-20210510120138-977fb7262007
|
||||
# golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
|
||||
## explicit
|
||||
golang.org/x/sys/cpu
|
||||
golang.org/x/sys/execabs
|
||||
golang.org/x/sys/internal/unsafeheader
|
||||
|
|
Loading…
Reference in New Issue