test: Fix failing tests
This commit is contained in:
27
vendor/modernc.org/memory/LICENSE-GO
generated
vendored
Normal file
27
vendor/modernc.org/memory/LICENSE-GO
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Copyright (c) 2009 The Go Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
19
vendor/modernc.org/memory/mmap_darwin.go
generated
vendored
Normal file
19
vendor/modernc.org/memory/mmap_darwin.go
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
// Copyright 2017 The Memory 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 amd64 || arm64
|
||||
// +build amd64 arm64
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
_ "unsafe"
|
||||
)
|
||||
|
||||
// Function syscall.mmap for darwin and openbsd calls internal/abi.FuncPCABI0,
|
||||
// which is implemented as a compile intrinsic so the code cannot be reused.
|
||||
// Using go:linkname directive to link mmapSyscall to syscall.mmap
|
||||
|
||||
//go:linkname mmapSyscall syscall.mmap
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
22
vendor/modernc.org/memory/mmap_freebsd_32.go
generated
vendored
Normal file
22
vendor/modernc.org/memory/mmap_freebsd_32.go
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright 2009 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-GO file.
|
||||
|
||||
//go:build (freebsd && 386) || (freebsd && arm)
|
||||
// +build freebsd,386 freebsd,arm
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_freebsd_386.go
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
|
||||
r0, _, e1 := syscall.Syscall9(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0)
|
||||
ret = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
22
vendor/modernc.org/memory/mmap_freebsd_64.go
generated
vendored
Normal file
22
vendor/modernc.org/memory/mmap_freebsd_64.go
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright 2009 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-GO file.
|
||||
|
||||
//go:build (freebsd && amd64) || (freebsd && arm64)
|
||||
// +build freebsd,amd64 freebsd,arm64
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_freebsd_amd64.go;l=1337-1346
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
|
||||
r0, _, e1 := syscall.Syscall6(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
|
||||
ret = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
35
vendor/modernc.org/memory/mmap_linux_32.go
generated
vendored
Normal file
35
vendor/modernc.org/memory/mmap_linux_32.go
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
// Copyright 2009 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-GO file.
|
||||
|
||||
//go:build linux && (386 || arm || mips || mipsle)
|
||||
// +build linux
|
||||
// +build 386 arm mips mipsle
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// Function syscall.mmap and syscall.mmap2 are same for linux/386, linux/arm,
|
||||
// linux/mips and linux/mipsle
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/syscall_linux_386.go;l=99-105
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
|
||||
page := uintptr(offset / 4096)
|
||||
if offset != int64(page)*4096 {
|
||||
return 0, syscall.EINVAL
|
||||
}
|
||||
return mmap2Syscall(addr, length, prot, flags, fd, page)
|
||||
}
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_linux_386.go;l=1361-1370
|
||||
func mmap2Syscall(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) {
|
||||
r0, _, e1 := syscall.Syscall6(syscall.SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset))
|
||||
xaddr = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
26
vendor/modernc.org/memory/mmap_linux_64.go
generated
vendored
Normal file
26
vendor/modernc.org/memory/mmap_linux_64.go
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright 2009 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-GO file.
|
||||
|
||||
//go:build linux && (amd64 || arm64 || mips64 || mips64le || riscv64 || ppc64le)
|
||||
// +build linux
|
||||
// +build amd64 arm64 mips64 mips64le riscv64 ppc64le
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// Function syscall.mmap is same for linux/amd64, linux/arm64, linux/mips64,
|
||||
// linux/mips64le and linux/riscv64.
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_linux_amd64.go;l=1575-1584
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
|
||||
r0, _, e1 := syscall.Syscall6(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))
|
||||
xaddr = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
23
vendor/modernc.org/memory/mmap_linux_s390x.go
generated
vendored
Normal file
23
vendor/modernc.org/memory/mmap_linux_s390x.go
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright 2009 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-GO file.
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/syscall_linux_s390x.go;l=105-115
|
||||
// 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 mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
|
||||
mmap_args := [6]uintptr{addr, length, uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)}
|
||||
r0, _, e1 := syscall.Syscall(syscall.SYS_MMAP, uintptr(unsafe.Pointer(&mmap_args[0])), 0, 0)
|
||||
xaddr = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
22
vendor/modernc.org/memory/mmap_netbsd_32.go
generated
vendored
Normal file
22
vendor/modernc.org/memory/mmap_netbsd_32.go
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright 2009 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-GO file.
|
||||
|
||||
//go:build netbsd && 386 || netbsd && arm
|
||||
// +build netbsd,386 netbsd,arm
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_freebsd_386.go
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
|
||||
r0, _, e1 := syscall.Syscall9(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)
|
||||
ret = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
22
vendor/modernc.org/memory/mmap_netbsd_64.go
generated
vendored
Normal file
22
vendor/modernc.org/memory/mmap_netbsd_64.go
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright 2009 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-GO file.
|
||||
|
||||
//go:build netbsd && amd64
|
||||
// +build netbsd,amd64
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_netbsd_amd64.go;l=1190
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
|
||||
r0, _, e1 := syscall.Syscall9(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0)
|
||||
ret = uintptr(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
19
vendor/modernc.org/memory/mmap_openbsd.go
generated
vendored
Normal file
19
vendor/modernc.org/memory/mmap_openbsd.go
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
// Copyright 2017 The Memory 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 386 || amd64 || arm64
|
||||
// +build 386 amd64 arm64
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
_ "unsafe"
|
||||
)
|
||||
|
||||
// Function syscall.mmap for darwin and openbsd calls internal/abi.FuncPCABI0,
|
||||
// which is implemented as a compile intrinsic so the code cannot be reused.
|
||||
// Using go:linkname directive to link mmapSyscall to syscall.mmap
|
||||
|
||||
//go:linkname mmapSyscall syscall.mmap
|
||||
func mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
Reference in New Issue
Block a user