mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall: implement Reboot for linux.
The published interface is the simple version of the syscall, allowing all reboot functions except for the esoteric LINUX_REBOOT_CMD_RESTART2. R=golang-dev, bradfitzgo, bradfitzwork CC=golang-dev https://golang.org/cl/4256060
This commit is contained in:
parent
78879b3b8b
commit
05660b79ea
8 changed files with 62 additions and 1 deletions
|
|
@ -81,6 +81,14 @@ func ptrace(request int, pid int, addr uintptr, data uintptr) (errno int) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func reboot(magic1 uint, magic2 uint, cmd int, arg string) (errno int) {
|
||||
_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(StringBytePtr(arg))), 0, 0)
|
||||
errno = int(e1)
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Access(path string, mode uint32) (errno int) {
|
||||
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
|
||||
errno = int(e1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue