Commit 248d1446 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

syscall: don't make //sys lines be doc comments

Cleans up godoc and makes it consistent. (some had it, some
didn't)

This still keeps the information there, though, for people
looking at the source directly.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/7324056
parent 357a18a2
...@@ -20,6 +20,7 @@ import ( ...@@ -20,6 +20,7 @@ import (
/* /*
* Pseudo-system calls * Pseudo-system calls
*/ */
// The const provides a compile-time constant so clients // The const provides a compile-time constant so clients
// can adjust to whether there is a working Getwd and avoid // can adjust to whether there is a working Getwd and avoid
// even linking this function into the binary. See ../os/getwd.go. // even linking this function into the binary. See ../os/getwd.go.
......
...@@ -18,16 +18,19 @@ import "unsafe" ...@@ -18,16 +18,19 @@ import "unsafe"
*/ */
//sys open(path string, mode int, perm uint32) (fd int, err error) //sys open(path string, mode int, perm uint32) (fd int, err error)
func Open(path string, mode int, perm uint32) (fd int, err error) { func Open(path string, mode int, perm uint32) (fd int, err error) {
return open(path, mode|O_LARGEFILE, perm) return open(path, mode|O_LARGEFILE, perm)
} }
//sys openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) //sys openat(dirfd int, path string, flags int, mode uint32) (fd int, err error)
func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {
return openat(dirfd, path, flags|O_LARGEFILE, mode) return openat(dirfd, path, flags|O_LARGEFILE, mode)
} }
//sysnb pipe(p *[2]_C_int) (err error) //sysnb pipe(p *[2]_C_int) (err error)
func Pipe(p []int) (err error) { func Pipe(p []int) (err error) {
if len(p) != 2 { if len(p) != 2 {
return EINVAL return EINVAL
...@@ -40,6 +43,7 @@ func Pipe(p []int) (err error) { ...@@ -40,6 +43,7 @@ func Pipe(p []int) (err error) {
} }
//sysnb pipe2(p *[2]_C_int, flags int) (err error) //sysnb pipe2(p *[2]_C_int, flags int) (err error)
func Pipe2(p []int, flags int) (err error) { func Pipe2(p []int, flags int) (err error) {
if len(p) != 2 { if len(p) != 2 {
return EINVAL return EINVAL
...@@ -52,6 +56,7 @@ func Pipe2(p []int, flags int) (err error) { ...@@ -52,6 +56,7 @@ func Pipe2(p []int, flags int) (err error) {
} }
//sys utimes(path string, times *[2]Timeval) (err error) //sys utimes(path string, times *[2]Timeval) (err error)
func Utimes(path string, tv []Timeval) (err error) { func Utimes(path string, tv []Timeval) (err error) {
if len(tv) != 2 { if len(tv) != 2 {
return EINVAL return EINVAL
...@@ -60,6 +65,7 @@ func Utimes(path string, tv []Timeval) (err error) { ...@@ -60,6 +65,7 @@ func Utimes(path string, tv []Timeval) (err error) {
} }
//sys utimensat(dirfd int, path string, times *[2]Timespec) (err error) //sys utimensat(dirfd int, path string, times *[2]Timespec) (err error)
func UtimesNano(path string, ts []Timespec) (err error) { func UtimesNano(path string, ts []Timespec) (err error) {
if len(ts) != 2 { if len(ts) != 2 {
return EINVAL return EINVAL
...@@ -79,6 +85,7 @@ func UtimesNano(path string, ts []Timespec) (err error) { ...@@ -79,6 +85,7 @@ func UtimesNano(path string, ts []Timespec) (err error) {
} }
//sys futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) //sys futimesat(dirfd int, path *byte, times *[2]Timeval) (err error)
func Futimesat(dirfd int, path string, tv []Timeval) (err error) { func Futimesat(dirfd int, path string, tv []Timeval) (err error) {
if len(tv) != 2 { if len(tv) != 2 {
return EINVAL return EINVAL
...@@ -99,6 +106,7 @@ func Futimes(fd int, tv []Timeval) (err error) { ...@@ -99,6 +106,7 @@ func Futimes(fd int, tv []Timeval) (err error) {
const ImplementsGetwd = true const ImplementsGetwd = true
//sys Getcwd(buf []byte) (n int, err error) //sys Getcwd(buf []byte) (n int, err error)
func Getwd() (wd string, err error) { func Getwd() (wd string, err error) {
var buf [PathMax]byte var buf [PathMax]byte
n, err := Getcwd(buf[0:]) n, err := Getcwd(buf[0:])
...@@ -208,6 +216,7 @@ func (w WaitStatus) TrapCause() int { ...@@ -208,6 +216,7 @@ func (w WaitStatus) TrapCause() int {
} }
//sys wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) //sys wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error)
func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) {
var status _C_int var status _C_int
wpid, err = wait4(pid, &status, options, rusage) wpid, err = wait4(pid, &status, options, rusage)
...@@ -809,6 +818,7 @@ func PtraceAttach(pid int) (err error) { return ptrace(PTRACE_ATTACH, pid, 0, 0) ...@@ -809,6 +818,7 @@ func PtraceAttach(pid int) (err error) { return ptrace(PTRACE_ATTACH, pid, 0, 0)
func PtraceDetach(pid int) (err error) { return ptrace(PTRACE_DETACH, pid, 0, 0) } func PtraceDetach(pid int) (err error) { return ptrace(PTRACE_DETACH, pid, 0, 0) }
//sys reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) //sys reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error)
func Reboot(cmd int) (err error) { func Reboot(cmd int) (err error) {
return reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, "") return reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, "")
} }
...@@ -848,6 +858,7 @@ func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, ...@@ -848,6 +858,7 @@ func ParseDirent(buf []byte, max int, names []string) (consumed int, count int,
} }
//sys mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) //sys mount(source string, target string, fstype string, flags uintptr, data *byte) (err error)
func Mount(source string, target string, fstype string, flags uintptr, data string) (err error) { func Mount(source string, target string, fstype string, flags uintptr, data string) (err error) {
// Certain file systems get rather angry and EINVAL if you give // Certain file systems get rather angry and EINVAL if you give
// them an empty string of data, rather than NULL. // them an empty string of data, rather than NULL.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment