280 lines
12 KiB
Diff
280 lines
12 KiB
Diff
From bc77ad792117829909eeeca3aa492d6f292d004d Mon Sep 17 00:00:00 2001
|
|
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
|
|
Date: Tue, 19 Mar 2019 13:55:44 -0600
|
|
Subject: [PATCH] syscall: do not link against ___getdirentries64
|
|
|
|
---
|
|
.../x/sys/unix/syscall_darwin_386.go | 5 ++++-
|
|
.../x/sys/unix/syscall_darwin_amd64.go | 5 ++++-
|
|
.../x/sys/unix/zsyscall_darwin_386.go | 22 -------------------
|
|
.../x/sys/unix/zsyscall_darwin_386.s | 2 --
|
|
.../x/sys/unix/zsyscall_darwin_amd64.go | 22 -------------------
|
|
.../x/sys/unix/zsyscall_darwin_amd64.s | 2 --
|
|
src/syscall/syscall_darwin_386.go | 5 ++++-
|
|
src/syscall/syscall_darwin_amd64.go | 5 ++++-
|
|
src/syscall/zsyscall_darwin_386.go | 20 -----------------
|
|
src/syscall/zsyscall_darwin_386.s | 2 --
|
|
src/syscall/zsyscall_darwin_amd64.go | 20 -----------------
|
|
src/syscall/zsyscall_darwin_amd64.s | 2 --
|
|
12 files changed, 16 insertions(+), 96 deletions(-)
|
|
|
|
diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_386.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_386.go
|
|
index 489726fa9b..900dd7c91f 100644
|
|
--- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_386.go
|
|
+++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_386.go
|
|
@@ -56,8 +56,11 @@ const SYS___SYSCTL = SYS_SYSCTL
|
|
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
|
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
|
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
|
|
-//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
|
|
//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
|
|
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
|
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
|
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
|
|
+
|
|
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|
+ return 0, ENOSYS
|
|
+}
|
|
diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
|
|
index 914b89bde5..95e245fff7 100644
|
|
--- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
|
|
+++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
|
|
@@ -56,8 +56,11 @@ const SYS___SYSCTL = SYS_SYSCTL
|
|
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
|
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
|
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
|
|
-//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
|
|
//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
|
|
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
|
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
|
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
|
|
+
|
|
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|
+ return 0, ENOSYS
|
|
+}
|
|
diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go
|
|
index 23346dc68f..db4f1eaf1c 100644
|
|
--- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go
|
|
+++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go
|
|
@@ -2408,28 +2408,6 @@ func libc_fstatfs64_trampoline()
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|
- var _p0 unsafe.Pointer
|
|
- if len(buf) > 0 {
|
|
- _p0 = unsafe.Pointer(&buf[0])
|
|
- } else {
|
|
- _p0 = unsafe.Pointer(&_zero)
|
|
- }
|
|
- r0, _, e1 := syscall_syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
|
|
- n = int(r0)
|
|
- if e1 != 0 {
|
|
- err = errnoErr(e1)
|
|
- }
|
|
- return
|
|
-}
|
|
-
|
|
-func libc___getdirentries64_trampoline()
|
|
-
|
|
-//go:linkname libc___getdirentries64 libc___getdirentries64
|
|
-//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib"
|
|
-
|
|
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
-
|
|
func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) {
|
|
r0, _, e1 := syscall_syscall(funcPC(libc_getfsstat64_trampoline), uintptr(buf), uintptr(size), uintptr(flags))
|
|
n = int(r0)
|
|
diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s
|
|
index 37b85b4f61..6165f70e33 100644
|
|
--- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s
|
|
+++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s
|
|
@@ -272,8 +272,6 @@ TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0
|
|
JMP libc_fstatat64(SB)
|
|
TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0
|
|
JMP libc_fstatfs64(SB)
|
|
-TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0
|
|
- JMP libc___getdirentries64(SB)
|
|
TEXT ·libc_getfsstat64_trampoline(SB),NOSPLIT,$0-0
|
|
JMP libc_getfsstat64(SB)
|
|
TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0
|
|
diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
|
|
index b50178d679..dea5dee75e 100644
|
|
--- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
|
|
+++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
|
|
@@ -2408,28 +2408,6 @@ func libc_fstatfs64_trampoline()
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|
- var _p0 unsafe.Pointer
|
|
- if len(buf) > 0 {
|
|
- _p0 = unsafe.Pointer(&buf[0])
|
|
- } else {
|
|
- _p0 = unsafe.Pointer(&_zero)
|
|
- }
|
|
- r0, _, e1 := syscall_syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
|
|
- n = int(r0)
|
|
- if e1 != 0 {
|
|
- err = errnoErr(e1)
|
|
- }
|
|
- return
|
|
-}
|
|
-
|
|
-func libc___getdirentries64_trampoline()
|
|
-
|
|
-//go:linkname libc___getdirentries64 libc___getdirentries64
|
|
-//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib"
|
|
-
|
|
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
-
|
|
func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) {
|
|
r0, _, e1 := syscall_syscall(funcPC(libc_getfsstat64_trampoline), uintptr(buf), uintptr(size), uintptr(flags))
|
|
n = int(r0)
|
|
diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s
|
|
index da9b900a8c..f1e2d7e9a4 100644
|
|
--- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s
|
|
+++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s
|
|
@@ -272,8 +272,6 @@ TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0
|
|
JMP libc_fstatat64(SB)
|
|
TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0
|
|
JMP libc_fstatfs64(SB)
|
|
-TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0
|
|
- JMP libc___getdirentries64(SB)
|
|
TEXT ·libc_getfsstat64_trampoline(SB),NOSPLIT,$0-0
|
|
JMP libc_getfsstat64(SB)
|
|
TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0
|
|
diff --git a/src/syscall/syscall_darwin_386.go b/src/syscall/syscall_darwin_386.go
|
|
index 045ebc726b..826d76f569 100644
|
|
--- a/src/syscall/syscall_darwin_386.go
|
|
+++ b/src/syscall/syscall_darwin_386.go
|
|
@@ -16,7 +16,6 @@ func setTimeval(sec, usec int64) Timeval {
|
|
|
|
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_fstat64
|
|
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_fstatfs64
|
|
-//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS___getdirentries64
|
|
//sysnb Gettimeofday(tp *Timeval) (err error)
|
|
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_lstat64
|
|
//sys Stat(path string, stat *Stat_t) (err error) = SYS_stat64
|
|
@@ -63,3 +62,7 @@ func libc_sendfile_trampoline()
|
|
func syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno)
|
|
|
|
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // sic
|
|
+
|
|
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|
+ return 0, ENOSYS
|
|
+}
|
|
diff --git a/src/syscall/syscall_darwin_amd64.go b/src/syscall/syscall_darwin_amd64.go
|
|
index 7b6493bf9f..3868790049 100644
|
|
--- a/src/syscall/syscall_darwin_amd64.go
|
|
+++ b/src/syscall/syscall_darwin_amd64.go
|
|
@@ -16,7 +16,6 @@ func setTimeval(sec, usec int64) Timeval {
|
|
|
|
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_fstat64
|
|
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_fstatfs64
|
|
-//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS___getdirentries64
|
|
//sysnb Gettimeofday(tp *Timeval) (err error)
|
|
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_lstat64
|
|
//sys Stat(path string, stat *Stat_t) (err error) = SYS_stat64
|
|
@@ -63,3 +62,7 @@ func libc_sendfile_trampoline()
|
|
func syscallX(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
|
|
|
|
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno)
|
|
+
|
|
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|
+ return 0, ENOSYS
|
|
+}
|
|
diff --git a/src/syscall/zsyscall_darwin_386.go b/src/syscall/zsyscall_darwin_386.go
|
|
index 758ff7b129..a666a1f65e 100644
|
|
--- a/src/syscall/zsyscall_darwin_386.go
|
|
+++ b/src/syscall/zsyscall_darwin_386.go
|
|
@@ -1845,27 +1845,7 @@ func libc_fstatfs64_trampoline()
|
|
|
|
//go:linkname libc_fstatfs64 libc_fstatfs64
|
|
//go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib"
|
|
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
-
|
|
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|
- var _p0 unsafe.Pointer
|
|
- if len(buf) > 0 {
|
|
- _p0 = unsafe.Pointer(&buf[0])
|
|
- } else {
|
|
- _p0 = unsafe.Pointer(&_zero)
|
|
- }
|
|
- r0, _, e1 := syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
|
|
- n = int(r0)
|
|
- if e1 != 0 {
|
|
- err = errnoErr(e1)
|
|
- }
|
|
- return
|
|
-}
|
|
-
|
|
-func libc___getdirentries64_trampoline()
|
|
|
|
-//go:linkname libc___getdirentries64 libc___getdirentries64
|
|
-//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib"
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
func Gettimeofday(tp *Timeval) (err error) {
|
|
diff --git a/src/syscall/zsyscall_darwin_386.s b/src/syscall/zsyscall_darwin_386.s
|
|
index a688192501..a5af9b64b9 100644
|
|
--- a/src/syscall/zsyscall_darwin_386.s
|
|
+++ b/src/syscall/zsyscall_darwin_386.s
|
|
@@ -235,8 +235,6 @@ TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0
|
|
JMP libc_fstat64(SB)
|
|
TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0
|
|
JMP libc_fstatfs64(SB)
|
|
-TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0
|
|
- JMP libc___getdirentries64(SB)
|
|
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
|
JMP libc_gettimeofday(SB)
|
|
TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0
|
|
diff --git a/src/syscall/zsyscall_darwin_amd64.go b/src/syscall/zsyscall_darwin_amd64.go
|
|
index afc3d72d8d..bb87aef1f9 100644
|
|
--- a/src/syscall/zsyscall_darwin_amd64.go
|
|
+++ b/src/syscall/zsyscall_darwin_amd64.go
|
|
@@ -1845,27 +1845,7 @@ func libc_fstatfs64_trampoline()
|
|
|
|
//go:linkname libc_fstatfs64 libc_fstatfs64
|
|
//go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib"
|
|
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
-
|
|
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|
- var _p0 unsafe.Pointer
|
|
- if len(buf) > 0 {
|
|
- _p0 = unsafe.Pointer(&buf[0])
|
|
- } else {
|
|
- _p0 = unsafe.Pointer(&_zero)
|
|
- }
|
|
- r0, _, e1 := syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
|
|
- n = int(r0)
|
|
- if e1 != 0 {
|
|
- err = errnoErr(e1)
|
|
- }
|
|
- return
|
|
-}
|
|
-
|
|
-func libc___getdirentries64_trampoline()
|
|
|
|
-//go:linkname libc___getdirentries64 libc___getdirentries64
|
|
-//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib"
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
func Gettimeofday(tp *Timeval) (err error) {
|
|
diff --git a/src/syscall/zsyscall_darwin_amd64.s b/src/syscall/zsyscall_darwin_amd64.s
|
|
index 21ab38e3ee..409320dea5 100644
|
|
--- a/src/syscall/zsyscall_darwin_amd64.s
|
|
+++ b/src/syscall/zsyscall_darwin_amd64.s
|
|
@@ -235,8 +235,6 @@ TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0
|
|
JMP libc_fstat64(SB)
|
|
TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0
|
|
JMP libc_fstatfs64(SB)
|
|
-TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0
|
|
- JMP libc___getdirentries64(SB)
|
|
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
|
JMP libc_gettimeofday(SB)
|
|
TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0
|
|
--
|
|
2.21.0
|
|
|