$46 GRAYBYTE WORDPRESS FILE MANAGER $40

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/usr/lib/golang/src/internal/runtime/syscall/

HOME
Current File : /usr/lib/golang/src/internal/runtime/syscall//syscall_linux.go
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package syscall provides the syscall primitives required for the runtime.
package syscall

import (
	"internal/goarch"
	"unsafe"
)

// TODO(https://go.dev/issue/51087): This package is incomplete and currently
// only contains very minimal support for Linux.

// Syscall6 calls system call number 'num' with arguments a1-6.
func Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr)

func EpollCreate1(flags int32) (fd int32, errno uintptr) {
	r1, _, e := Syscall6(SYS_EPOLL_CREATE1, uintptr(flags), 0, 0, 0, 0, 0)
	return int32(r1), e
}

var _zero uintptr

func EpollWait(epfd int32, events []EpollEvent, maxev, waitms int32) (n int32, errno uintptr) {
	var ev unsafe.Pointer
	if len(events) > 0 {
		ev = unsafe.Pointer(&events[0])
	} else {
		ev = unsafe.Pointer(&_zero)
	}
	r1, _, e := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(ev), uintptr(maxev), uintptr(waitms), 0, 0)
	return int32(r1), e
}

func EpollCtl(epfd, op, fd int32, event *EpollEvent) (errno uintptr) {
	_, _, e := Syscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)
	return e
}

func Eventfd(initval, flags int32) (fd int32, errno uintptr) {
	r1, _, e := Syscall6(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0, 0, 0, 0)
	return int32(r1), e
}

func Open(path *byte, mode int, perm uint32) (fd int, errno uintptr) {
	// Use SYS_OPENAT to match the syscall package.
	dfd := AT_FDCWD
	r1, _, e := Syscall6(SYS_OPENAT, uintptr(dfd), uintptr(unsafe.Pointer(path)), uintptr(mode|O_LARGEFILE), uintptr(perm), 0, 0)
	return int(r1), e
}

func Close(fd int) (errno uintptr) {
	_, _, e := Syscall6(SYS_CLOSE, uintptr(fd), 0, 0, 0, 0, 0)
	return e
}

func Read(fd int, p []byte) (n int, errno uintptr) {
	var p0 unsafe.Pointer
	if len(p) > 0 {
		p0 = unsafe.Pointer(&p[0])
	} else {
		p0 = unsafe.Pointer(&_zero)
	}
	r1, _, e := Syscall6(SYS_READ, uintptr(fd), uintptr(p0), uintptr(len(p)), 0, 0, 0)
	return int(r1), e
}

func Pread(fd int, p []byte, offset int64) (n int, errno uintptr) {
	var p0 unsafe.Pointer
	if len(p) > 0 {
		p0 = unsafe.Pointer(&p[0])
	} else {
		p0 = unsafe.Pointer(&_zero)
	}
	var r1, e uintptr
	switch goarch.GOARCH {
	case "386":
		r1, _, e = Syscall6(SYS_PREAD64, uintptr(fd), uintptr(p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
	case "arm", "mipsle":
		r1, _, e = Syscall6(SYS_PREAD64, uintptr(fd), uintptr(p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
	case "mips":
		r1, _, e = Syscall6(SYS_PREAD64, uintptr(fd), uintptr(p0), uintptr(len(p)), 0, uintptr(offset>>32), uintptr(offset))
	default:
		r1, _, e = Syscall6(SYS_PREAD64, uintptr(fd), uintptr(p0), uintptr(len(p)), uintptr(offset), 0, 0)
	}
	return int(r1), e
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
16 Dec 2025 9.30 PM
root / root
0755
asm_linux_386.s
0.841 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_linux_amd64.s
1.108 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_linux_arm.s
0.68 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_linux_arm64.s
0.63 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_linux_loong64.s
0.989 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_linux_mips64x.s
0.707 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_linux_mipsx.s
0.855 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_linux_ppc64x.s
0.686 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_linux_riscv64.s
0.946 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_linux_s390x.s
0.647 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux.go
0.559 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_386.go
0.591 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_amd64.go
0.589 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_arm.go
0.606 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_arm64.go
0.599 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_loong64.go
0.611 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_mips64x.go
0.672 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_mipsx.go
0.649 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_ppc64x.go
0.654 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_riscv64.go
0.611 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_s390x.go
0.615 KB
4 Dec 2025 6.06 PM
root / root
0644
syscall_linux.go
2.817 KB
4 Dec 2025 6.06 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF