mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-28 12:56:32 -04:00
Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d82a9bb43d | ||
|
|
1edeebeea0 | ||
|
|
ecada54126 | ||
|
|
5e63aa5e0f | ||
|
|
033906b9f0 | ||
|
|
6be6c584a2 | ||
|
|
32e203842b | ||
|
|
137f2eda35 | ||
|
|
b06ce0514e | ||
|
|
689cc11b26 | ||
|
|
a4712b9054 | ||
|
|
0293703b0a | ||
|
|
ab85cbbe91 | ||
|
|
9bd37534d8 | ||
|
|
899c23279d |
@@ -1,115 +0,0 @@
|
||||
diff --git a/unix/ztypes_freebsd_386.go b/unix/ztypes_freebsd_386.go
|
||||
index 51e13eb0..5212328e 100644
|
||||
--- a/unix/ztypes_freebsd_386.go
|
||||
+++ b/unix/ztypes_freebsd_386.go
|
||||
@@ -203,7 +203,8 @@ type Xucred struct {
|
||||
Uid uint32
|
||||
Ngroups int16
|
||||
Groups [16]uint32
|
||||
- _ *byte
|
||||
+ _ byte
|
||||
+ Pid uint32
|
||||
}
|
||||
|
||||
type Linger struct {
|
||||
@@ -268,7 +269,7 @@ const (
|
||||
SizeofSockaddrAny = 0x6c
|
||||
SizeofSockaddrUnix = 0x6a
|
||||
SizeofSockaddrDatalink = 0x36
|
||||
- SizeofXucred = 0x50
|
||||
+ SizeofXucred = 0x54
|
||||
SizeofLinger = 0x8
|
||||
SizeofIovec = 0x8
|
||||
SizeofIPMreq = 0x8
|
||||
diff --git a/unix/ztypes_freebsd_amd64.go b/unix/ztypes_freebsd_amd64.go
|
||||
index d002d8ef..1673b4e8 100644
|
||||
--- a/unix/ztypes_freebsd_amd64.go
|
||||
+++ b/unix/ztypes_freebsd_amd64.go
|
||||
@@ -200,7 +200,8 @@ type Xucred struct {
|
||||
Uid uint32
|
||||
Ngroups int16
|
||||
Groups [16]uint32
|
||||
- _ *byte
|
||||
+ _ byte
|
||||
+ Pid uint32
|
||||
}
|
||||
|
||||
type Linger struct {
|
||||
@@ -265,7 +266,7 @@ const (
|
||||
SizeofSockaddrAny = 0x6c
|
||||
SizeofSockaddrUnix = 0x6a
|
||||
SizeofSockaddrDatalink = 0x36
|
||||
- SizeofXucred = 0x58
|
||||
+ SizeofXucred = 0x54
|
||||
SizeofLinger = 0x8
|
||||
SizeofIovec = 0x10
|
||||
SizeofIPMreq = 0x8
|
||||
diff --git a/unix/ztypes_freebsd_arm.go b/unix/ztypes_freebsd_arm.go
|
||||
index 3f863d89..a54f4570 100644
|
||||
--- a/unix/ztypes_freebsd_arm.go
|
||||
+++ b/unix/ztypes_freebsd_arm.go
|
||||
@@ -202,7 +202,8 @@ type Xucred struct {
|
||||
Uid uint32
|
||||
Ngroups int16
|
||||
Groups [16]uint32
|
||||
- _ *byte
|
||||
+ _ byte
|
||||
+ Pid uint32
|
||||
}
|
||||
|
||||
type Linger struct {
|
||||
@@ -267,7 +268,7 @@ const (
|
||||
SizeofSockaddrAny = 0x6c
|
||||
SizeofSockaddrUnix = 0x6a
|
||||
SizeofSockaddrDatalink = 0x36
|
||||
- SizeofXucred = 0x50
|
||||
+ SizeofXucred = 0x54
|
||||
SizeofLinger = 0x8
|
||||
SizeofIovec = 0x8
|
||||
SizeofIPMreq = 0x8
|
||||
diff --git a/unix/ztypes_freebsd_arm64.go b/unix/ztypes_freebsd_arm64.go
|
||||
index 61c72931..a91ccc72 100644
|
||||
--- a/unix/ztypes_freebsd_arm64.go
|
||||
+++ b/unix/ztypes_freebsd_arm64.go
|
||||
@@ -200,7 +200,8 @@ type Xucred struct {
|
||||
Uid uint32
|
||||
Ngroups int16
|
||||
Groups [16]uint32
|
||||
- _ *byte
|
||||
+ _ byte
|
||||
+ Pid uint32
|
||||
}
|
||||
|
||||
type Linger struct {
|
||||
@@ -265,7 +266,7 @@ const (
|
||||
SizeofSockaddrAny = 0x6c
|
||||
SizeofSockaddrUnix = 0x6a
|
||||
SizeofSockaddrDatalink = 0x36
|
||||
- SizeofXucred = 0x58
|
||||
+ SizeofXucred = 0x54
|
||||
SizeofLinger = 0x8
|
||||
SizeofIovec = 0x10
|
||||
SizeofIPMreq = 0x8
|
||||
diff --git a/unix/ztypes_freebsd_riscv64.go b/unix/ztypes_freebsd_riscv64.go
|
||||
index b5d17414..596538d9 100644
|
||||
--- a/unix/ztypes_freebsd_riscv64.go
|
||||
+++ b/unix/ztypes_freebsd_riscv64.go
|
||||
@@ -200,7 +200,8 @@ type Xucred struct {
|
||||
Uid uint32
|
||||
Ngroups int16
|
||||
Groups [16]uint32
|
||||
- _ *byte
|
||||
+ _ byte
|
||||
+ Pid uint32
|
||||
}
|
||||
|
||||
type Linger struct {
|
||||
@@ -265,7 +266,7 @@ const (
|
||||
SizeofSockaddrAny = 0x6c
|
||||
SizeofSockaddrUnix = 0x6a
|
||||
SizeofSockaddrDatalink = 0x36
|
||||
- SizeofXucred = 0x58
|
||||
+ SizeofXucred = 0x54
|
||||
SizeofLinger = 0x8
|
||||
SizeofIovec = 0x10
|
||||
SizeofIPMreq = 0x8
|
||||
@@ -1,7 +1,17 @@
|
||||
# sys - rwinkhart patches
|
||||
This repository holds my custom patches atop the Go sys module.
|
||||
# sys
|
||||
|
||||
The only changes in the master branch are this README and the patches in the `1patches` directory. The patches are applied on other branches and tagged releases are available for import from the releases page.
|
||||
[](https://pkg.go.dev/golang.org/x/sys)
|
||||
|
||||
# How To?
|
||||
Copy the desired patch file(s) into a new branch (cloned from upstream master) and apply with `patch -p1 < patchfile.patch`.
|
||||
This repository holds supplemental Go packages for low-level interactions with
|
||||
the operating system.
|
||||
|
||||
## Report Issues / Send Patches
|
||||
|
||||
This repository uses Gerrit for code changes. To learn how to submit changes to
|
||||
this repository, see https://go.dev/doc/contribute.
|
||||
|
||||
The git repository is https://go.googlesource.com/sys.
|
||||
|
||||
The main issue tracker for the sys repository is located at
|
||||
https://go.dev/issues. Prefix your issue with "x/sys:" in the
|
||||
subject line, so it is easy to find.
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
// Copyright 2015 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build go1.5
|
||||
|
||||
package plan9
|
||||
|
||||
import "syscall"
|
||||
|
||||
func fixwd() {
|
||||
syscall.Fixwd()
|
||||
}
|
||||
|
||||
func Getwd() (wd string, err error) {
|
||||
return syscall.Getwd()
|
||||
}
|
||||
|
||||
func Chdir(path string) error {
|
||||
return syscall.Chdir(path)
|
||||
}
|
||||
+5
-9
@@ -2,22 +2,18 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !go1.5
|
||||
|
||||
package plan9
|
||||
|
||||
import "syscall"
|
||||
|
||||
func fixwd() {
|
||||
syscall.Fixwd()
|
||||
}
|
||||
|
||||
func Getwd() (wd string, err error) {
|
||||
fd, err := open(".", O_RDONLY)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer Close(fd)
|
||||
return Fd2path(fd)
|
||||
return syscall.Getwd()
|
||||
}
|
||||
|
||||
func Chdir(path string) error {
|
||||
return chdir(path)
|
||||
return syscall.Chdir(path)
|
||||
}
|
||||
|
||||
@@ -38,8 +38,15 @@ func SchedSetaffinity(pid int, set *CPUSet) error {
|
||||
|
||||
// Zero clears the set s, so that it contains no CPUs.
|
||||
func (s *CPUSet) Zero() {
|
||||
clear(s[:])
|
||||
}
|
||||
|
||||
// Fill adds all possible CPU bits to the set s. On Linux, [SchedSetaffinity]
|
||||
// will silently ignore any invalid CPU bits in [CPUSet] so this is an
|
||||
// efficient way of resetting the CPU affinity of a process.
|
||||
func (s *CPUSet) Fill() {
|
||||
for i := range s {
|
||||
s[i] = 0
|
||||
s[i] = ^cpuMask(0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -12,7 +12,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sort"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -72,7 +72,7 @@ func TestDirent(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
sort.Strings(names)
|
||||
slices.Sort(names)
|
||||
t.Logf("names: %q", names)
|
||||
|
||||
if len(names) != 10 {
|
||||
@@ -145,9 +145,9 @@ func TestDirentRepeat(t *testing.T) {
|
||||
}
|
||||
|
||||
// Check results
|
||||
sort.Strings(files)
|
||||
sort.Strings(files2)
|
||||
if strings.Join(files, "|") != strings.Join(files2, "|") {
|
||||
slices.Sort(files)
|
||||
slices.Sort(files2)
|
||||
if !slices.Equal(files, files2) {
|
||||
t.Errorf("bad file list: want\n%q\ngot\n%q", files, files2)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-3
@@ -23,7 +23,5 @@ func (fds *FdSet) IsSet(fd int) bool {
|
||||
|
||||
// Zero clears the set fds.
|
||||
func (fds *FdSet) Zero() {
|
||||
for i := range fds.Bits {
|
||||
fds.Bits[i] = 0
|
||||
}
|
||||
clear(fds.Bits[:])
|
||||
}
|
||||
|
||||
@@ -10,8 +10,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
"slices"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
@@ -71,9 +70,9 @@ func testGetdirentries(t *testing.T, count int) {
|
||||
}
|
||||
}
|
||||
|
||||
sort.Strings(names)
|
||||
sort.Strings(names2)
|
||||
if strings.Join(names, ":") != strings.Join(names2, ":") {
|
||||
slices.Sort(names)
|
||||
slices.Sort(names2)
|
||||
if !slices.Equal(names, names2) {
|
||||
t.Errorf("names don't match\n names: %q\nnames2: %q", names, names2)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
// Copyright 2023 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build netbsd
|
||||
|
||||
package unix_test
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func TestGetvfsstat(t *testing.T) {
|
||||
n, err := unix.Getvfsstat(nil, unix.MNT_NOWAIT)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
data := make([]unix.Statvfs_t, n)
|
||||
n2, err := unix.Getvfsstat(data, unix.MNT_NOWAIT)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if n != n2 {
|
||||
t.Errorf("Getvfsstat(nil) = %d, but subsequent Getvfsstat(slice) = %d", n, n2)
|
||||
}
|
||||
for i, stat := range data {
|
||||
if stat == (unix.Statvfs_t{}) {
|
||||
t.Errorf("index %v is an empty Statvfs_t struct", i)
|
||||
}
|
||||
t.Logf("%s on %s", unix.ByteSliceToString(stat.Mntfromname[:]), unix.ByteSliceToString(stat.Mntonname[:]))
|
||||
}
|
||||
if t.Failed() {
|
||||
for i, stat := range data[:n2] {
|
||||
t.Logf("data[%v] = %+v", i, stat)
|
||||
}
|
||||
mount, err := exec.Command("mount").CombinedOutput()
|
||||
if err != nil {
|
||||
t.Logf("mount: %v\n%s", err, mount)
|
||||
} else {
|
||||
t.Logf("mount: %s", mount)
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-3
@@ -111,9 +111,7 @@ func (ifr *Ifreq) SetUint32(v uint32) {
|
||||
// clear zeroes the ifreq's union field to prevent trailing garbage data from
|
||||
// being sent to the kernel if an ifreq is reused.
|
||||
func (ifr *Ifreq) clear() {
|
||||
for i := range ifr.raw.Ifru {
|
||||
ifr.raw.Ifru[i] = 0
|
||||
}
|
||||
clear(ifr.raw.Ifru[:])
|
||||
}
|
||||
|
||||
// TODO(mdlayher): export as IfreqData? For now we can provide helpers such as
|
||||
|
||||
+36
-1
@@ -121,6 +121,7 @@ struct termios2 {
|
||||
#include <linux/hidraw.h>
|
||||
#include <linux/icmp.h>
|
||||
#include <linux/icmpv6.h>
|
||||
#include <linux/if_addrlabel.h>
|
||||
#include <linux/if_alg.h>
|
||||
#include <linux/if_bridge.h>
|
||||
#include <linux/if_packet.h>
|
||||
@@ -878,6 +879,8 @@ const (
|
||||
IFA_FLAGS = C.IFA_FLAGS
|
||||
IFA_RT_PRIORITY = C.IFA_RT_PRIORITY
|
||||
IFA_TARGET_NETNSID = C.IFA_TARGET_NETNSID
|
||||
IFAL_LABEL = C.IFAL_LABEL
|
||||
IFAL_ADDRESS = C.IFAL_ADDRESS
|
||||
RT_SCOPE_UNIVERSE = C.RT_SCOPE_UNIVERSE
|
||||
RT_SCOPE_SITE = C.RT_SCOPE_SITE
|
||||
RT_SCOPE_LINK = C.RT_SCOPE_LINK
|
||||
@@ -935,6 +938,7 @@ const (
|
||||
SizeofRtAttr = C.sizeof_struct_rtattr
|
||||
SizeofIfInfomsg = C.sizeof_struct_ifinfomsg
|
||||
SizeofIfAddrmsg = C.sizeof_struct_ifaddrmsg
|
||||
SizeofIfAddrlblmsg = C.sizeof_struct_ifaddrlblmsg
|
||||
SizeofIfaCacheinfo = C.sizeof_struct_ifa_cacheinfo
|
||||
SizeofRtMsg = C.sizeof_struct_rtmsg
|
||||
SizeofRtNexthop = C.sizeof_struct_rtnexthop
|
||||
@@ -956,6 +960,8 @@ type IfInfomsg C.struct_ifinfomsg
|
||||
|
||||
type IfAddrmsg C.struct_ifaddrmsg
|
||||
|
||||
type IfAddrlblmsg C.struct_ifaddrlblmsg
|
||||
|
||||
type IfaCacheinfo C.struct_ifa_cacheinfo
|
||||
|
||||
type RtMsg C.struct_rtmsg
|
||||
@@ -3113,8 +3119,25 @@ const (
|
||||
)
|
||||
|
||||
// generated by:
|
||||
// perl -nlE '/^\s*(RTNLGRP_\w+)/ && say "$1 = C.$1"' include/uapi/linux/rtnetlink.h
|
||||
// perl -nlE '/^\s*((RTNLGRP_|TCA_)\w+)/ && say "$1 = C.$1"' include/uapi/linux/rtnetlink.h
|
||||
const (
|
||||
TCA_UNSPEC = C.TCA_UNSPEC
|
||||
TCA_KIND = C.TCA_KIND
|
||||
TCA_OPTIONS = C.TCA_OPTIONS
|
||||
TCA_STATS = C.TCA_STATS
|
||||
TCA_XSTATS = C.TCA_XSTATS
|
||||
TCA_RATE = C.TCA_RATE
|
||||
TCA_FCNT = C.TCA_FCNT
|
||||
TCA_STATS2 = C.TCA_STATS2
|
||||
TCA_STAB = C.TCA_STAB
|
||||
TCA_PAD = C.TCA_PAD
|
||||
TCA_DUMP_INVISIBLE = C.TCA_DUMP_INVISIBLE
|
||||
TCA_CHAIN = C.TCA_CHAIN
|
||||
TCA_HW_OFFLOAD = C.TCA_HW_OFFLOAD
|
||||
TCA_INGRESS_BLOCK = C.TCA_INGRESS_BLOCK
|
||||
TCA_EGRESS_BLOCK = C.TCA_EGRESS_BLOCK
|
||||
TCA_DUMP_FLAGS = C.TCA_DUMP_FLAGS
|
||||
TCA_EXT_WARN_MSG = C.TCA_EXT_WARN_MSG
|
||||
RTNLGRP_NONE = C.RTNLGRP_NONE
|
||||
RTNLGRP_LINK = C.RTNLGRP_LINK
|
||||
RTNLGRP_NOTIFY = C.RTNLGRP_NOTIFY
|
||||
@@ -3149,6 +3172,18 @@ const (
|
||||
RTNLGRP_IPV6_MROUTE_R = C.RTNLGRP_IPV6_MROUTE_R
|
||||
RTNLGRP_NEXTHOP = C.RTNLGRP_NEXTHOP
|
||||
RTNLGRP_BRVLAN = C.RTNLGRP_BRVLAN
|
||||
RTNLGRP_MCTP_IFADDR = C.RTNLGRP_MCTP_IFADDR
|
||||
RTNLGRP_TUNNEL = C.RTNLGRP_TUNNEL
|
||||
RTNLGRP_STATS = C.RTNLGRP_STATS
|
||||
RTNLGRP_IPV4_MCADDR = C.RTNLGRP_IPV4_MCADDR
|
||||
RTNLGRP_IPV6_MCADDR = C.RTNLGRP_IPV6_MCADDR
|
||||
RTNLGRP_IPV6_ACADDR = C.RTNLGRP_IPV6_ACADDR
|
||||
TCA_ROOT_UNSPEC = C.TCA_ROOT_UNSPEC
|
||||
TCA_ROOT_TAB = C.TCA_ROOT_TAB
|
||||
TCA_ROOT_FLAGS = C.TCA_ROOT_FLAGS
|
||||
TCA_ROOT_COUNT = C.TCA_ROOT_COUNT
|
||||
TCA_ROOT_TIME_DELTA = C.TCA_ROOT_TIME_DELTA
|
||||
TCA_ROOT_EXT_WARN_MSG = C.TCA_ROOT_EXT_WARN_MSG
|
||||
)
|
||||
|
||||
// Capabilities
|
||||
|
||||
@@ -49,6 +49,7 @@ esac
|
||||
if [[ "$GOOS" = "linux" ]]; then
|
||||
# Use the Docker-based build system
|
||||
# Files generated through docker (use $cmd so you can Ctl-C the build or run)
|
||||
set -e
|
||||
$cmd docker build --tag generate:$GOOS $GOOS
|
||||
$cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && pwd):/build generate:$GOOS
|
||||
exit
|
||||
|
||||
@@ -801,9 +801,7 @@ func (sa *SockaddrPPPoE) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||
// one. The kernel expects SID to be in network byte order.
|
||||
binary.BigEndian.PutUint16(sa.raw[6:8], sa.SID)
|
||||
copy(sa.raw[8:14], sa.Remote)
|
||||
for i := 14; i < 14+IFNAMSIZ; i++ {
|
||||
sa.raw[i] = 0
|
||||
}
|
||||
clear(sa.raw[14 : 14+IFNAMSIZ])
|
||||
copy(sa.raw[14:], sa.Dev)
|
||||
return unsafe.Pointer(&sa.raw), SizeofSockaddrPPPoX, nil
|
||||
}
|
||||
|
||||
@@ -248,6 +248,23 @@ func Statvfs(path string, buf *Statvfs_t) (err error) {
|
||||
return Statvfs1(path, buf, ST_WAIT)
|
||||
}
|
||||
|
||||
func Getvfsstat(buf []Statvfs_t, flags int) (n int, err error) {
|
||||
var (
|
||||
_p0 unsafe.Pointer
|
||||
bufsize uintptr
|
||||
)
|
||||
if len(buf) > 0 {
|
||||
_p0 = unsafe.Pointer(&buf[0])
|
||||
bufsize = unsafe.Sizeof(Statvfs_t{}) * uintptr(len(buf))
|
||||
}
|
||||
r0, _, e1 := Syscall(SYS_GETVFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
|
||||
n = int(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
* Exposed directly
|
||||
*/
|
||||
|
||||
@@ -629,7 +629,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||
//sys Kill(pid int, signum syscall.Signal) (err error)
|
||||
//sys Lchown(path string, uid int, gid int) (err error)
|
||||
//sys Link(path string, link string) (err error)
|
||||
//sys Listen(s int, backlog int) (err error) = libsocket.__xnet_llisten
|
||||
//sys Listen(s int, backlog int) (err error) = libsocket.__xnet_listen
|
||||
//sys Lstat(path string, stat *Stat_t) (err error)
|
||||
//sys Madvise(b []byte, advice int) (err error)
|
||||
//sys Mkdir(path string, mode uint32) (err error)
|
||||
|
||||
@@ -72,7 +72,7 @@ import (
|
||||
//go:cgo_import_dynamic libc_kill kill "libc.so"
|
||||
//go:cgo_import_dynamic libc_lchown lchown "libc.so"
|
||||
//go:cgo_import_dynamic libc_link link "libc.so"
|
||||
//go:cgo_import_dynamic libc___xnet_llisten __xnet_llisten "libsocket.so"
|
||||
//go:cgo_import_dynamic libc___xnet_listen __xnet_listen "libsocket.so"
|
||||
//go:cgo_import_dynamic libc_lstat lstat "libc.so"
|
||||
//go:cgo_import_dynamic libc_madvise madvise "libc.so"
|
||||
//go:cgo_import_dynamic libc_mkdir mkdir "libc.so"
|
||||
@@ -221,7 +221,7 @@ import (
|
||||
//go:linkname procKill libc_kill
|
||||
//go:linkname procLchown libc_lchown
|
||||
//go:linkname procLink libc_link
|
||||
//go:linkname proc__xnet_llisten libc___xnet_llisten
|
||||
//go:linkname proc__xnet_listen libc___xnet_listen
|
||||
//go:linkname procLstat libc_lstat
|
||||
//go:linkname procMadvise libc_madvise
|
||||
//go:linkname procMkdir libc_mkdir
|
||||
@@ -371,7 +371,7 @@ var (
|
||||
procKill,
|
||||
procLchown,
|
||||
procLink,
|
||||
proc__xnet_llisten,
|
||||
proc__xnet_listen,
|
||||
procLstat,
|
||||
procMadvise,
|
||||
procMkdir,
|
||||
@@ -1178,7 +1178,7 @@ func Link(path string, link string) (err error) {
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Listen(s int, backlog int) (err error) {
|
||||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_llisten)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0)
|
||||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_listen)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
|
||||
@@ -203,7 +203,8 @@ type Xucred struct {
|
||||
Uid uint32
|
||||
Ngroups int16
|
||||
Groups [16]uint32
|
||||
_ *byte
|
||||
_ byte
|
||||
Pid uint32
|
||||
}
|
||||
|
||||
type Linger struct {
|
||||
@@ -268,7 +269,7 @@ const (
|
||||
SizeofSockaddrAny = 0x6c
|
||||
SizeofSockaddrUnix = 0x6a
|
||||
SizeofSockaddrDatalink = 0x36
|
||||
SizeofXucred = 0x50
|
||||
SizeofXucred = 0x54
|
||||
SizeofLinger = 0x8
|
||||
SizeofIovec = 0x8
|
||||
SizeofIPMreq = 0x8
|
||||
|
||||
@@ -200,7 +200,8 @@ type Xucred struct {
|
||||
Uid uint32
|
||||
Ngroups int16
|
||||
Groups [16]uint32
|
||||
_ *byte
|
||||
_ byte
|
||||
Pid uint32
|
||||
}
|
||||
|
||||
type Linger struct {
|
||||
@@ -265,7 +266,7 @@ const (
|
||||
SizeofSockaddrAny = 0x6c
|
||||
SizeofSockaddrUnix = 0x6a
|
||||
SizeofSockaddrDatalink = 0x36
|
||||
SizeofXucred = 0x58
|
||||
SizeofXucred = 0x54
|
||||
SizeofLinger = 0x8
|
||||
SizeofIovec = 0x10
|
||||
SizeofIPMreq = 0x8
|
||||
|
||||
@@ -202,7 +202,8 @@ type Xucred struct {
|
||||
Uid uint32
|
||||
Ngroups int16
|
||||
Groups [16]uint32
|
||||
_ *byte
|
||||
_ byte
|
||||
Pid uint32
|
||||
}
|
||||
|
||||
type Linger struct {
|
||||
@@ -267,7 +268,7 @@ const (
|
||||
SizeofSockaddrAny = 0x6c
|
||||
SizeofSockaddrUnix = 0x6a
|
||||
SizeofSockaddrDatalink = 0x36
|
||||
SizeofXucred = 0x50
|
||||
SizeofXucred = 0x54
|
||||
SizeofLinger = 0x8
|
||||
SizeofIovec = 0x8
|
||||
SizeofIPMreq = 0x8
|
||||
|
||||
@@ -200,7 +200,8 @@ type Xucred struct {
|
||||
Uid uint32
|
||||
Ngroups int16
|
||||
Groups [16]uint32
|
||||
_ *byte
|
||||
_ byte
|
||||
Pid uint32
|
||||
}
|
||||
|
||||
type Linger struct {
|
||||
@@ -265,7 +266,7 @@ const (
|
||||
SizeofSockaddrAny = 0x6c
|
||||
SizeofSockaddrUnix = 0x6a
|
||||
SizeofSockaddrDatalink = 0x36
|
||||
SizeofXucred = 0x58
|
||||
SizeofXucred = 0x54
|
||||
SizeofLinger = 0x8
|
||||
SizeofIovec = 0x10
|
||||
SizeofIPMreq = 0x8
|
||||
|
||||
@@ -200,7 +200,8 @@ type Xucred struct {
|
||||
Uid uint32
|
||||
Ngroups int16
|
||||
Groups [16]uint32
|
||||
_ *byte
|
||||
_ byte
|
||||
Pid uint32
|
||||
}
|
||||
|
||||
type Linger struct {
|
||||
@@ -265,7 +266,7 @@ const (
|
||||
SizeofSockaddrAny = 0x6c
|
||||
SizeofSockaddrUnix = 0x6a
|
||||
SizeofSockaddrDatalink = 0x36
|
||||
SizeofXucred = 0x58
|
||||
SizeofXucred = 0x54
|
||||
SizeofLinger = 0x8
|
||||
SizeofIovec = 0x10
|
||||
SizeofIPMreq = 0x8
|
||||
|
||||
@@ -632,6 +632,8 @@ const (
|
||||
IFA_FLAGS = 0x8
|
||||
IFA_RT_PRIORITY = 0x9
|
||||
IFA_TARGET_NETNSID = 0xa
|
||||
IFAL_LABEL = 0x2
|
||||
IFAL_ADDRESS = 0x1
|
||||
RT_SCOPE_UNIVERSE = 0x0
|
||||
RT_SCOPE_SITE = 0xc8
|
||||
RT_SCOPE_LINK = 0xfd
|
||||
@@ -689,6 +691,7 @@ const (
|
||||
SizeofRtAttr = 0x4
|
||||
SizeofIfInfomsg = 0x10
|
||||
SizeofIfAddrmsg = 0x8
|
||||
SizeofIfAddrlblmsg = 0xc
|
||||
SizeofIfaCacheinfo = 0x10
|
||||
SizeofRtMsg = 0xc
|
||||
SizeofRtNexthop = 0x8
|
||||
@@ -740,6 +743,15 @@ type IfAddrmsg struct {
|
||||
Index uint32
|
||||
}
|
||||
|
||||
type IfAddrlblmsg struct {
|
||||
Family uint8
|
||||
_ uint8
|
||||
Prefixlen uint8
|
||||
Flags uint8
|
||||
Index uint32
|
||||
Seq uint32
|
||||
}
|
||||
|
||||
type IfaCacheinfo struct {
|
||||
Prefered uint32
|
||||
Valid uint32
|
||||
@@ -3052,6 +3064,23 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
TCA_UNSPEC = 0x0
|
||||
TCA_KIND = 0x1
|
||||
TCA_OPTIONS = 0x2
|
||||
TCA_STATS = 0x3
|
||||
TCA_XSTATS = 0x4
|
||||
TCA_RATE = 0x5
|
||||
TCA_FCNT = 0x6
|
||||
TCA_STATS2 = 0x7
|
||||
TCA_STAB = 0x8
|
||||
TCA_PAD = 0x9
|
||||
TCA_DUMP_INVISIBLE = 0xa
|
||||
TCA_CHAIN = 0xb
|
||||
TCA_HW_OFFLOAD = 0xc
|
||||
TCA_INGRESS_BLOCK = 0xd
|
||||
TCA_EGRESS_BLOCK = 0xe
|
||||
TCA_DUMP_FLAGS = 0xf
|
||||
TCA_EXT_WARN_MSG = 0x10
|
||||
RTNLGRP_NONE = 0x0
|
||||
RTNLGRP_LINK = 0x1
|
||||
RTNLGRP_NOTIFY = 0x2
|
||||
@@ -3086,6 +3115,18 @@ const (
|
||||
RTNLGRP_IPV6_MROUTE_R = 0x1f
|
||||
RTNLGRP_NEXTHOP = 0x20
|
||||
RTNLGRP_BRVLAN = 0x21
|
||||
RTNLGRP_MCTP_IFADDR = 0x22
|
||||
RTNLGRP_TUNNEL = 0x23
|
||||
RTNLGRP_STATS = 0x24
|
||||
RTNLGRP_IPV4_MCADDR = 0x25
|
||||
RTNLGRP_IPV6_MCADDR = 0x26
|
||||
RTNLGRP_IPV6_ACADDR = 0x27
|
||||
TCA_ROOT_UNSPEC = 0x0
|
||||
TCA_ROOT_TAB = 0x1
|
||||
TCA_ROOT_FLAGS = 0x2
|
||||
TCA_ROOT_COUNT = 0x3
|
||||
TCA_ROOT_TIME_DELTA = 0x4
|
||||
TCA_ROOT_EXT_WARN_MSG = 0x5
|
||||
)
|
||||
|
||||
type CapUserHeader struct {
|
||||
|
||||
@@ -62,7 +62,6 @@ import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"text/template"
|
||||
)
|
||||
@@ -543,47 +542,9 @@ func (f *Fn) ParamPrintList() string {
|
||||
return join(f.Params, func(p *Param) string { return fmt.Sprintf(`"%s=", %s, `, p.Name, p.Name) }, `", ", `)
|
||||
}
|
||||
|
||||
// ParamCount return number of syscall parameters for function f.
|
||||
func (f *Fn) ParamCount() int {
|
||||
n := 0
|
||||
for _, p := range f.Params {
|
||||
n += len(p.SyscallArgList())
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
// SyscallParamCount determines which version of Syscall/Syscall6/Syscall9/...
|
||||
// to use. It returns parameter count for correspondent SyscallX function.
|
||||
func (f *Fn) SyscallParamCount() int {
|
||||
n := f.ParamCount()
|
||||
switch {
|
||||
case n <= 3:
|
||||
return 3
|
||||
case n <= 6:
|
||||
return 6
|
||||
case n <= 9:
|
||||
return 9
|
||||
case n <= 12:
|
||||
return 12
|
||||
case n <= 15:
|
||||
return 15
|
||||
case n <= 42: // current SyscallN limit
|
||||
return n
|
||||
default:
|
||||
panic("too many arguments to system call")
|
||||
}
|
||||
}
|
||||
|
||||
// Syscall determines which SyscallX function to use for function f.
|
||||
func (f *Fn) Syscall() string {
|
||||
c := f.SyscallParamCount()
|
||||
if c == 3 {
|
||||
return syscalldot() + "Syscall"
|
||||
}
|
||||
if c > 15 {
|
||||
return syscalldot() + "SyscallN"
|
||||
}
|
||||
return syscalldot() + "Syscall" + strconv.Itoa(c)
|
||||
// SyscallN returns a string representing the SyscallN function.
|
||||
func (f *Fn) SyscallN() string {
|
||||
return syscalldot() + "SyscallN"
|
||||
}
|
||||
|
||||
// SyscallParamList returns source code for SyscallX parameters for function f.
|
||||
@@ -592,9 +553,12 @@ func (f *Fn) SyscallParamList() string {
|
||||
for _, p := range f.Params {
|
||||
a = append(a, p.SyscallArgList()...)
|
||||
}
|
||||
for len(a) < f.SyscallParamCount() {
|
||||
a = append(a, "0")
|
||||
|
||||
// Check if the number exceeds the current SyscallN limit
|
||||
if len(a) > 42 {
|
||||
panic("too many arguments to system call")
|
||||
}
|
||||
|
||||
return strings.Join(a, ", ")
|
||||
}
|
||||
|
||||
@@ -1015,7 +979,7 @@ func {{.HelperName}}({{.HelperParamList}}) {{template "results" .}}{
|
||||
|
||||
{{define "results"}}{{if .Rets.List}}{{.Rets.List}} {{end}}{{end}}
|
||||
|
||||
{{define "syscall"}}{{.Rets.SetReturnValuesCode}}{{.Syscall}}(proc{{.DLLFuncName}}.Addr(),{{if le .ParamCount 15}} {{.ParamCount}},{{end}} {{.SyscallParamList}}){{end}}
|
||||
{{define "syscall"}}{{.Rets.SetReturnValuesCode}}{{.SyscallN}}(proc{{.DLLFuncName}}.Addr(), {{.SyscallParamList}}){{end}}
|
||||
|
||||
{{define "tmpvarsreadback"}}{{range .Params}}{{if .TmpVarReadbackCode}}
|
||||
{{.TmpVarReadbackCode}}{{end}}{{end}}{{end}}
|
||||
|
||||
@@ -50,7 +50,7 @@ func TestDLLFilenameEscaping(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSyscallXGeneration(t *testing.T) {
|
||||
func TestSyscallNGeneration(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
wantsysfunc string
|
||||
@@ -58,17 +58,17 @@ func TestSyscallXGeneration(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
name: "syscall with 2 params",
|
||||
wantsysfunc: "syscall.Syscall",
|
||||
wantsysfunc: "syscall.SyscallN",
|
||||
sig: "Example(a1 *uint16, a2 *uint16) = ",
|
||||
},
|
||||
{
|
||||
name: "syscall with 6 params",
|
||||
wantsysfunc: "syscall.Syscall6",
|
||||
wantsysfunc: "syscall.SyscallN",
|
||||
sig: "Example(a1 *uint, a2 *uint, a3 *uint, a4 *uint, a5 *uint, a6 *uint) = ",
|
||||
},
|
||||
{
|
||||
name: "syscall with 15 params",
|
||||
wantsysfunc: "syscall.Syscall15",
|
||||
wantsysfunc: "syscall.SyscallN",
|
||||
sig: strings.ReplaceAll(`Example(a1 *uint, a2 *uint, a3 *uint, a4 *uint, a5 *uint, a6 *uint,
|
||||
a7 *uint, a8 *uint, a9 *uint, a10 *uint, a11 *uint, a12 *uint,
|
||||
a13 *uint, a14 *uint, a15 *uint) = `, "\n", ""),
|
||||
|
||||
@@ -52,7 +52,7 @@ var (
|
||||
)
|
||||
|
||||
func regConnectRegistry(machinename *uint16, key syscall.Handle, result *syscall.Handle) (regerrno error) {
|
||||
r0, _, _ := syscall.Syscall(procRegConnectRegistryW.Addr(), 3, uintptr(unsafe.Pointer(machinename)), uintptr(key), uintptr(unsafe.Pointer(result)))
|
||||
r0, _, _ := syscall.SyscallN(procRegConnectRegistryW.Addr(), uintptr(unsafe.Pointer(machinename)), uintptr(key), uintptr(unsafe.Pointer(result)))
|
||||
if r0 != 0 {
|
||||
regerrno = syscall.Errno(r0)
|
||||
}
|
||||
@@ -60,7 +60,7 @@ func regConnectRegistry(machinename *uint16, key syscall.Handle, result *syscall
|
||||
}
|
||||
|
||||
func regCreateKeyEx(key syscall.Handle, subkey *uint16, reserved uint32, class *uint16, options uint32, desired uint32, sa *syscall.SecurityAttributes, result *syscall.Handle, disposition *uint32) (regerrno error) {
|
||||
r0, _, _ := syscall.Syscall9(procRegCreateKeyExW.Addr(), 9, uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(reserved), uintptr(unsafe.Pointer(class)), uintptr(options), uintptr(desired), uintptr(unsafe.Pointer(sa)), uintptr(unsafe.Pointer(result)), uintptr(unsafe.Pointer(disposition)))
|
||||
r0, _, _ := syscall.SyscallN(procRegCreateKeyExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(reserved), uintptr(unsafe.Pointer(class)), uintptr(options), uintptr(desired), uintptr(unsafe.Pointer(sa)), uintptr(unsafe.Pointer(result)), uintptr(unsafe.Pointer(disposition)))
|
||||
if r0 != 0 {
|
||||
regerrno = syscall.Errno(r0)
|
||||
}
|
||||
@@ -68,7 +68,7 @@ func regCreateKeyEx(key syscall.Handle, subkey *uint16, reserved uint32, class *
|
||||
}
|
||||
|
||||
func regDeleteKey(key syscall.Handle, subkey *uint16) (regerrno error) {
|
||||
r0, _, _ := syscall.Syscall(procRegDeleteKeyW.Addr(), 2, uintptr(key), uintptr(unsafe.Pointer(subkey)), 0)
|
||||
r0, _, _ := syscall.SyscallN(procRegDeleteKeyW.Addr(), uintptr(key), uintptr(unsafe.Pointer(subkey)))
|
||||
if r0 != 0 {
|
||||
regerrno = syscall.Errno(r0)
|
||||
}
|
||||
@@ -76,7 +76,7 @@ func regDeleteKey(key syscall.Handle, subkey *uint16) (regerrno error) {
|
||||
}
|
||||
|
||||
func regDeleteValue(key syscall.Handle, name *uint16) (regerrno error) {
|
||||
r0, _, _ := syscall.Syscall(procRegDeleteValueW.Addr(), 2, uintptr(key), uintptr(unsafe.Pointer(name)), 0)
|
||||
r0, _, _ := syscall.SyscallN(procRegDeleteValueW.Addr(), uintptr(key), uintptr(unsafe.Pointer(name)))
|
||||
if r0 != 0 {
|
||||
regerrno = syscall.Errno(r0)
|
||||
}
|
||||
@@ -84,7 +84,7 @@ func regDeleteValue(key syscall.Handle, name *uint16) (regerrno error) {
|
||||
}
|
||||
|
||||
func regEnumValue(key syscall.Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) {
|
||||
r0, _, _ := syscall.Syscall9(procRegEnumValueW.Addr(), 8, uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen)), 0)
|
||||
r0, _, _ := syscall.SyscallN(procRegEnumValueW.Addr(), uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen)))
|
||||
if r0 != 0 {
|
||||
regerrno = syscall.Errno(r0)
|
||||
}
|
||||
@@ -92,7 +92,7 @@ func regEnumValue(key syscall.Handle, index uint32, name *uint16, nameLen *uint3
|
||||
}
|
||||
|
||||
func regLoadMUIString(key syscall.Handle, name *uint16, buf *uint16, buflen uint32, buflenCopied *uint32, flags uint32, dir *uint16) (regerrno error) {
|
||||
r0, _, _ := syscall.Syscall9(procRegLoadMUIStringW.Addr(), 7, uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(unsafe.Pointer(buflenCopied)), uintptr(flags), uintptr(unsafe.Pointer(dir)), 0, 0)
|
||||
r0, _, _ := syscall.SyscallN(procRegLoadMUIStringW.Addr(), uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(unsafe.Pointer(buflenCopied)), uintptr(flags), uintptr(unsafe.Pointer(dir)))
|
||||
if r0 != 0 {
|
||||
regerrno = syscall.Errno(r0)
|
||||
}
|
||||
@@ -100,7 +100,7 @@ func regLoadMUIString(key syscall.Handle, name *uint16, buf *uint16, buflen uint
|
||||
}
|
||||
|
||||
func regSetValueEx(key syscall.Handle, valueName *uint16, reserved uint32, vtype uint32, buf *byte, bufsize uint32) (regerrno error) {
|
||||
r0, _, _ := syscall.Syscall6(procRegSetValueExW.Addr(), 6, uintptr(key), uintptr(unsafe.Pointer(valueName)), uintptr(reserved), uintptr(vtype), uintptr(unsafe.Pointer(buf)), uintptr(bufsize))
|
||||
r0, _, _ := syscall.SyscallN(procRegSetValueExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(valueName)), uintptr(reserved), uintptr(vtype), uintptr(unsafe.Pointer(buf)), uintptr(bufsize))
|
||||
if r0 != 0 {
|
||||
regerrno = syscall.Errno(r0)
|
||||
}
|
||||
@@ -108,7 +108,7 @@ func regSetValueEx(key syscall.Handle, valueName *uint16, reserved uint32, vtype
|
||||
}
|
||||
|
||||
func expandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, err error) {
|
||||
r0, _, e1 := syscall.Syscall(procExpandEnvironmentStringsW.Addr(), 3, uintptr(unsafe.Pointer(src)), uintptr(unsafe.Pointer(dst)), uintptr(size))
|
||||
r0, _, e1 := syscall.SyscallN(procExpandEnvironmentStringsW.Addr(), uintptr(unsafe.Pointer(src)), uintptr(unsafe.Pointer(dst)), uintptr(size))
|
||||
n = uint32(r0)
|
||||
if n == 0 {
|
||||
err = errnoErr(e1)
|
||||
|
||||
@@ -321,6 +321,8 @@ func NewCallbackCDecl(fn interface{}) uintptr {
|
||||
//sys SetConsoleOutputCP(cp uint32) (err error) = kernel32.SetConsoleOutputCP
|
||||
//sys WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) = kernel32.WriteConsoleW
|
||||
//sys ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) = kernel32.ReadConsoleW
|
||||
//sys GetNumberOfConsoleInputEvents(console Handle, numevents *uint32) (err error) = kernel32.GetNumberOfConsoleInputEvents
|
||||
//sys FlushConsoleInputBuffer(console Handle) (err error) = kernel32.FlushConsoleInputBuffer
|
||||
//sys resizePseudoConsole(pconsole Handle, size uint32) (hr error) = kernel32.ResizePseudoConsole
|
||||
//sys CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) [failretval==InvalidHandle] = kernel32.CreateToolhelp32Snapshot
|
||||
//sys Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error) = kernel32.Module32FirstW
|
||||
|
||||
@@ -65,6 +65,22 @@ var signals = [...]string{
|
||||
15: "terminated",
|
||||
}
|
||||
|
||||
// File flags for [os.OpenFile]. The O_ prefix is used to indicate
|
||||
// that these flags are specific to the OpenFile function.
|
||||
const (
|
||||
O_FILE_FLAG_OPEN_NO_RECALL = FILE_FLAG_OPEN_NO_RECALL
|
||||
O_FILE_FLAG_OPEN_REPARSE_POINT = FILE_FLAG_OPEN_REPARSE_POINT
|
||||
O_FILE_FLAG_SESSION_AWARE = FILE_FLAG_SESSION_AWARE
|
||||
O_FILE_FLAG_POSIX_SEMANTICS = FILE_FLAG_POSIX_SEMANTICS
|
||||
O_FILE_FLAG_BACKUP_SEMANTICS = FILE_FLAG_BACKUP_SEMANTICS
|
||||
O_FILE_FLAG_DELETE_ON_CLOSE = FILE_FLAG_DELETE_ON_CLOSE
|
||||
O_FILE_FLAG_SEQUENTIAL_SCAN = FILE_FLAG_SEQUENTIAL_SCAN
|
||||
O_FILE_FLAG_RANDOM_ACCESS = FILE_FLAG_RANDOM_ACCESS
|
||||
O_FILE_FLAG_NO_BUFFERING = FILE_FLAG_NO_BUFFERING
|
||||
O_FILE_FLAG_OVERLAPPED = FILE_FLAG_OVERLAPPED
|
||||
O_FILE_FLAG_WRITE_THROUGH = FILE_FLAG_WRITE_THROUGH
|
||||
)
|
||||
|
||||
const (
|
||||
FILE_READ_DATA = 0x00000001
|
||||
FILE_READ_ATTRIBUTES = 0x00000080
|
||||
@@ -1976,6 +1992,12 @@ const (
|
||||
SYMBOLIC_LINK_FLAG_DIRECTORY = 0x1
|
||||
)
|
||||
|
||||
// FILE_ZERO_DATA_INFORMATION from winioctl.h
|
||||
type FileZeroDataInformation struct {
|
||||
FileOffset int64
|
||||
BeyondFinalZero int64
|
||||
}
|
||||
|
||||
const (
|
||||
ComputerNameNetBIOS = 0
|
||||
ComputerNameDnsHostname = 1
|
||||
|
||||
+501
-483
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user