Rob Pike | 319a8c4 | 2011-03-21 13:02:10 -0700 | [diff] [blame] | 1 | // mksyscall.pl syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 2 | // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT |
| 3 | |
Shenghou Ma | 3863184 | 2015-05-14 21:01:52 -0400 | [diff] [blame] | 4 | // +build amd64,darwin |
| 5 | |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 6 | package syscall |
| 7 | |
Russ Cox | b04ac10 | 2009-08-12 13:19:17 -0700 | [diff] [blame] | 8 | import "unsafe" |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 9 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 10 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 11 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 12 | func getgroups(ngid int, gid *_Gid_t) (n int, err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 13 | r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 14 | n = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 15 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 16 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 17 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 18 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 19 | } |
| 20 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 21 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 22 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 23 | func setgroups(ngid int, gid *_Gid_t) (err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 24 | _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 25 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 26 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 27 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 28 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 29 | } |
| 30 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 31 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 32 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 33 | func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 34 | r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) |
| 35 | wpid = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 36 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 37 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 38 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 39 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 40 | } |
| 41 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 42 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 43 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 44 | func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 45 | r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) |
| 46 | fd = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 47 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 48 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 49 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 50 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 51 | } |
| 52 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 53 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 54 | |
Brad Fitzpatrick | f00af3d | 2014-01-21 18:54:49 -0800 | [diff] [blame] | 55 | func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 56 | _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 57 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 58 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 59 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 60 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 61 | } |
| 62 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 63 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 64 | |
Brad Fitzpatrick | f00af3d | 2014-01-21 18:54:49 -0800 | [diff] [blame] | 65 | func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 66 | _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 67 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 68 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 69 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 70 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 71 | } |
| 72 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 73 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 74 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 75 | func socket(domain int, typ int, proto int) (fd int, err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 76 | r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 77 | fd = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 78 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 79 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 80 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 81 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 82 | } |
| 83 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 84 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
Ivan Krasin | 400f7a6 | 2010-06-30 14:58:21 -0700 | [diff] [blame] | 85 | |
Brad Fitzpatrick | f00af3d | 2014-01-21 18:54:49 -0800 | [diff] [blame] | 86 | func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { |
Albert Strasheim | e83d696 | 2011-03-25 14:43:59 -0400 | [diff] [blame] | 87 | _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 88 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 89 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 90 | } |
Albert Strasheim | e83d696 | 2011-03-25 14:43:59 -0400 | [diff] [blame] | 91 | return |
| 92 | } |
| 93 | |
| 94 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 95 | |
Brad Fitzpatrick | f00af3d | 2014-01-21 18:54:49 -0800 | [diff] [blame] | 96 | func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 97 | _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 98 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 99 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 100 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 101 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 102 | } |
| 103 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 104 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 105 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 106 | func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 107 | _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 108 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 109 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 110 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 111 | return |
Russ Cox | 5d2ee9d | 2009-06-17 21:44:26 -0700 | [diff] [blame] | 112 | } |
| 113 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 114 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 115 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 116 | func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 117 | _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 118 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 119 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 120 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 121 | return |
Russ Cox | 5d2ee9d | 2009-06-17 21:44:26 -0700 | [diff] [blame] | 122 | } |
| 123 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 124 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 125 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 126 | func Shutdown(s int, how int) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 127 | _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 128 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 129 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 130 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 131 | return |
Russ Cox | 0b126c1 | 2009-12-01 16:53:43 -0800 | [diff] [blame] | 132 | } |
| 133 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 134 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 135 | |
Russ Cox | 3d5ddff | 2012-09-24 00:06:22 -0400 | [diff] [blame] | 136 | func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 137 | _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 138 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 139 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 140 | } |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 141 | return |
| 142 | } |
| 143 | |
| 144 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 145 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 146 | func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 147 | var _p0 unsafe.Pointer |
Russ Cox | fd1add2 | 2009-11-01 11:13:27 -0800 | [diff] [blame] | 148 | if len(p) > 0 { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 149 | _p0 = unsafe.Pointer(&p[0]) |
Russ Cox | 56faae2 | 2011-02-09 14:28:47 -0500 | [diff] [blame] | 150 | } else { |
| 151 | _p0 = unsafe.Pointer(&_zero) |
Russ Cox | fd1add2 | 2009-11-01 11:13:27 -0800 | [diff] [blame] | 152 | } |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 153 | r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 154 | n = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 155 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 156 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 157 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 158 | return |
Russ Cox | fd1add2 | 2009-11-01 11:13:27 -0800 | [diff] [blame] | 159 | } |
| 160 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 161 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 162 | |
Brad Fitzpatrick | f00af3d | 2014-01-21 18:54:49 -0800 | [diff] [blame] | 163 | func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 164 | var _p0 unsafe.Pointer |
Russ Cox | fd1add2 | 2009-11-01 11:13:27 -0800 | [diff] [blame] | 165 | if len(buf) > 0 { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 166 | _p0 = unsafe.Pointer(&buf[0]) |
Russ Cox | 56faae2 | 2011-02-09 14:28:47 -0500 | [diff] [blame] | 167 | } else { |
| 168 | _p0 = unsafe.Pointer(&_zero) |
Russ Cox | fd1add2 | 2009-11-01 11:13:27 -0800 | [diff] [blame] | 169 | } |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 170 | _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 171 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 172 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 173 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 174 | return |
Russ Cox | fd1add2 | 2009-11-01 11:13:27 -0800 | [diff] [blame] | 175 | } |
| 176 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 177 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 178 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 179 | func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { |
Mikio Hara | 5d6f118 | 2011-06-20 18:40:20 -0400 | [diff] [blame] | 180 | r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) |
| 181 | n = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 182 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 183 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 184 | } |
Mikio Hara | 5d6f118 | 2011-06-20 18:40:20 -0400 | [diff] [blame] | 185 | return |
| 186 | } |
| 187 | |
| 188 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 189 | |
Mikio Hara | a7858a4 | 2014-03-29 09:28:40 +0900 | [diff] [blame] | 190 | func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { |
| 191 | r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) |
| 192 | n = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 193 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 194 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 195 | } |
Mikio Hara | 5d6f118 | 2011-06-20 18:40:20 -0400 | [diff] [blame] | 196 | return |
| 197 | } |
| 198 | |
| 199 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 200 | |
Brad Fitzpatrick | ba8c92c | 2014-01-22 10:35:41 -0800 | [diff] [blame] | 201 | func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 202 | r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) |
| 203 | n = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 204 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 205 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 206 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 207 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 208 | } |
| 209 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 210 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 211 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 212 | func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 213 | var _p0 unsafe.Pointer |
Russ Cox | 6faacd2 | 2009-10-06 19:38:30 -0700 | [diff] [blame] | 214 | if len(mib) > 0 { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 215 | _p0 = unsafe.Pointer(&mib[0]) |
Russ Cox | 56faae2 | 2011-02-09 14:28:47 -0500 | [diff] [blame] | 216 | } else { |
| 217 | _p0 = unsafe.Pointer(&_zero) |
Russ Cox | 6faacd2 | 2009-10-06 19:38:30 -0700 | [diff] [blame] | 218 | } |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 219 | _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 220 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 221 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 222 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 223 | return |
Russ Cox | b32769b | 2009-06-29 13:44:46 -0700 | [diff] [blame] | 224 | } |
| 225 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 226 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 227 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 228 | func utimes(path string, timeval *[2]Timeval) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 229 | var _p0 *byte |
| 230 | _p0, err = BytePtrFromString(path) |
| 231 | if err != nil { |
| 232 | return |
| 233 | } |
| 234 | _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 235 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 236 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 237 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 238 | } |
Russ Cox | cbc01a3 | 2010-05-19 17:47:57 -0700 | [diff] [blame] | 239 | return |
| 240 | } |
| 241 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 242 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 243 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 244 | func futimes(fd int, timeval *[2]Timeval) (err error) { |
Russ Cox | cbc01a3 | 2010-05-19 17:47:57 -0700 | [diff] [blame] | 245 | _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 246 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 247 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 248 | } |
Russ Cox | cbc01a3 | 2010-05-19 17:47:57 -0700 | [diff] [blame] | 249 | return |
| 250 | } |
| 251 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 252 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 253 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 254 | func fcntl(fd int, cmd int, arg int) (val int, err error) { |
Giles Lean | ad73de2 | 2010-03-26 13:23:54 -0700 | [diff] [blame] | 255 | r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) |
| 256 | val = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 257 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 258 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 259 | } |
Giles Lean | 729ccb5 | 2010-03-24 21:59:21 -0700 | [diff] [blame] | 260 | return |
| 261 | } |
| 262 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 263 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 264 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 265 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { |
Jeff Hodges | 0ce57a7 | 2011-06-14 12:56:46 -0400 | [diff] [blame] | 266 | _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 267 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 268 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 269 | } |
Jeff Hodges | 0ce57a7 | 2011-06-14 12:56:46 -0400 | [diff] [blame] | 270 | return |
| 271 | } |
| 272 | |
| 273 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 274 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 275 | func pipe() (r int, w int, err error) { |
Mikio Hara | dc7f825 | 2011-08-04 00:22:48 -0400 | [diff] [blame] | 276 | r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) |
| 277 | r = int(r0) |
| 278 | w = int(r1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 279 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 280 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 281 | } |
Mikio Hara | dc7f825 | 2011-08-04 00:22:48 -0400 | [diff] [blame] | 282 | return |
| 283 | } |
| 284 | |
| 285 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 286 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 287 | func kill(pid int, signum int, posix int) (err error) { |
Giles Lean | ad73de2 | 2010-03-26 13:23:54 -0700 | [diff] [blame] | 288 | _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 289 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 290 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 291 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 292 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 293 | } |
| 294 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 295 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 296 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 297 | func Access(path string, mode uint32) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 298 | var _p0 *byte |
| 299 | _p0, err = BytePtrFromString(path) |
| 300 | if err != nil { |
| 301 | return |
| 302 | } |
| 303 | _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 304 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 305 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 306 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 307 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 308 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 309 | } |
| 310 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 311 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 312 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 313 | func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 314 | _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 315 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 316 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 317 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 318 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 319 | } |
| 320 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 321 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 322 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 323 | func Chdir(path string) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 324 | var _p0 *byte |
| 325 | _p0, err = BytePtrFromString(path) |
| 326 | if err != nil { |
| 327 | return |
| 328 | } |
| 329 | _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 330 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 331 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 332 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 333 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 334 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 335 | } |
| 336 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 337 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 338 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 339 | func Chflags(path string, flags int) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 340 | var _p0 *byte |
| 341 | _p0, err = BytePtrFromString(path) |
| 342 | if err != nil { |
| 343 | return |
| 344 | } |
| 345 | _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 346 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 347 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 348 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 349 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 350 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 351 | } |
| 352 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 353 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 354 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 355 | func Chmod(path string, mode uint32) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 356 | var _p0 *byte |
| 357 | _p0, err = BytePtrFromString(path) |
| 358 | if err != nil { |
| 359 | return |
| 360 | } |
| 361 | _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 362 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 363 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 364 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 365 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 366 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 367 | } |
| 368 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 369 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 370 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 371 | func Chown(path string, uid int, gid int) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 372 | var _p0 *byte |
| 373 | _p0, err = BytePtrFromString(path) |
| 374 | if err != nil { |
| 375 | return |
| 376 | } |
| 377 | _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 378 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 379 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 380 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 381 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 382 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 383 | } |
| 384 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 385 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 386 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 387 | func Chroot(path string) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 388 | var _p0 *byte |
| 389 | _p0, err = BytePtrFromString(path) |
| 390 | if err != nil { |
| 391 | return |
| 392 | } |
| 393 | _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 394 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 395 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 396 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 397 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 398 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 399 | } |
| 400 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 401 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 402 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 403 | func Close(fd int) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 404 | _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 405 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 406 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 407 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 408 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 409 | } |
| 410 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 411 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 412 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 413 | func Dup(fd int) (nfd int, err error) { |
Ian Lance Taylor | 28074d5 | 2015-03-26 08:02:16 -0700 | [diff] [blame] | 414 | r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 415 | nfd = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 416 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 417 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 418 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 419 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 420 | } |
| 421 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 422 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 423 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 424 | func Dup2(from int, to int) (err error) { |
Ian Lance Taylor | 28074d5 | 2015-03-26 08:02:16 -0700 | [diff] [blame] | 425 | _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 426 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 427 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 428 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 429 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 430 | } |
| 431 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 432 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 433 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 434 | func Exchangedata(path1 string, path2 string, options int) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 435 | var _p0 *byte |
| 436 | _p0, err = BytePtrFromString(path1) |
| 437 | if err != nil { |
| 438 | return |
| 439 | } |
| 440 | var _p1 *byte |
| 441 | _p1, err = BytePtrFromString(path2) |
| 442 | if err != nil { |
| 443 | return |
| 444 | } |
| 445 | _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 446 | use(unsafe.Pointer(_p0)) |
| 447 | use(unsafe.Pointer(_p1)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 448 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 449 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 450 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 451 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 452 | } |
| 453 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 454 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 455 | |
Russ Cox | 6faacd2 | 2009-10-06 19:38:30 -0700 | [diff] [blame] | 456 | func Exit(code int) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 457 | Syscall(SYS_EXIT, uintptr(code), 0, 0) |
| 458 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 459 | } |
| 460 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 461 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 462 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 463 | func Fchdir(fd int) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 464 | _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 465 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 466 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 467 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 468 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 469 | } |
| 470 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 471 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 472 | |
Shenghou Ma | 6de184b | 2013-05-07 05:20:00 +0800 | [diff] [blame] | 473 | func Fchflags(fd int, flags int) (err error) { |
| 474 | _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 475 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 476 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 477 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 478 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 479 | } |
| 480 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 481 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 482 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 483 | func Fchmod(fd int, mode uint32) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 484 | _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 485 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 486 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 487 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 488 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 489 | } |
| 490 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 491 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 492 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 493 | func Fchown(fd int, uid int, gid int) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 494 | _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 495 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 496 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 497 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 498 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 499 | } |
| 500 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 501 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 502 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 503 | func Flock(fd int, how int) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 504 | _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 505 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 506 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 507 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 508 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 509 | } |
| 510 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 511 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 512 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 513 | func Fpathconf(fd int, name int) (val int, err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 514 | r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) |
| 515 | val = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 516 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 517 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 518 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 519 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 520 | } |
| 521 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 522 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 523 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 524 | func Fstat(fd int, stat *Stat_t) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 525 | _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 526 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 527 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 528 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 529 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 530 | } |
| 531 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 532 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 533 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 534 | func Fstatfs(fd int, stat *Statfs_t) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 535 | _, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 536 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 537 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 538 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 539 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 540 | } |
| 541 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 542 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 543 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 544 | func Fsync(fd int) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 545 | _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 546 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 547 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 548 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 549 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 550 | } |
| 551 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 552 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 553 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 554 | func Ftruncate(fd int, length int64) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 555 | _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 556 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 557 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 558 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 559 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 560 | } |
| 561 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 562 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 563 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 564 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 565 | var _p0 unsafe.Pointer |
Russ Cox | 6faacd2 | 2009-10-06 19:38:30 -0700 | [diff] [blame] | 566 | if len(buf) > 0 { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 567 | _p0 = unsafe.Pointer(&buf[0]) |
Russ Cox | 56faae2 | 2011-02-09 14:28:47 -0500 | [diff] [blame] | 568 | } else { |
| 569 | _p0 = unsafe.Pointer(&_zero) |
Russ Cox | 6faacd2 | 2009-10-06 19:38:30 -0700 | [diff] [blame] | 570 | } |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 571 | r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 572 | n = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 573 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 574 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 575 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 576 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 577 | } |
| 578 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 579 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 580 | |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 581 | func Getdtablesize() (size int) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 582 | r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) |
| 583 | size = int(r0) |
| 584 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 585 | } |
| 586 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 587 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 588 | |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 589 | func Getegid() (egid int) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 590 | r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 591 | egid = int(r0) |
| 592 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 593 | } |
| 594 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 595 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 596 | |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 597 | func Geteuid() (uid int) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 598 | r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 599 | uid = int(r0) |
| 600 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 601 | } |
| 602 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 603 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 604 | |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 605 | func Getgid() (gid int) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 606 | r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 607 | gid = int(r0) |
| 608 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 609 | } |
| 610 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 611 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 612 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 613 | func Getpgid(pid int) (pgid int, err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 614 | r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 615 | pgid = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 616 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 617 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 618 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 619 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 620 | } |
| 621 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 622 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 623 | |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 624 | func Getpgrp() (pgrp int) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 625 | r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 626 | pgrp = int(r0) |
| 627 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 628 | } |
| 629 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 630 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 631 | |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 632 | func Getpid() (pid int) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 633 | r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 634 | pid = int(r0) |
| 635 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 636 | } |
| 637 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 638 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 639 | |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 640 | func Getppid() (ppid int) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 641 | r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 642 | ppid = int(r0) |
| 643 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 644 | } |
| 645 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 646 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 647 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 648 | func Getpriority(which int, who int) (prio int, err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 649 | r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) |
| 650 | prio = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 651 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 652 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 653 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 654 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 655 | } |
| 656 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 657 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 658 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 659 | func Getrlimit(which int, lim *Rlimit) (err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 660 | _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 661 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 662 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 663 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 664 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 665 | } |
| 666 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 667 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 668 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 669 | func Getrusage(who int, rusage *Rusage) (err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 670 | _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 671 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 672 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 673 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 674 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 675 | } |
| 676 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 677 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 678 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 679 | func Getsid(pid int) (sid int, err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 680 | r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 681 | sid = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 682 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 683 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 684 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 685 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 686 | } |
| 687 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 688 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 689 | |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 690 | func Getuid() (uid int) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 691 | r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 692 | uid = int(r0) |
| 693 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 694 | } |
| 695 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 696 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 697 | |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 698 | func Issetugid() (tainted bool) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 699 | r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 700 | tainted = bool(r0 != 0) |
| 701 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 702 | } |
| 703 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 704 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 705 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 706 | func Kqueue() (fd int, err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 707 | r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) |
| 708 | fd = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 709 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 710 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 711 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 712 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 713 | } |
| 714 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 715 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 716 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 717 | func Lchown(path string, uid int, gid int) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 718 | var _p0 *byte |
| 719 | _p0, err = BytePtrFromString(path) |
| 720 | if err != nil { |
| 721 | return |
| 722 | } |
| 723 | _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 724 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 725 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 726 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 727 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 728 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 729 | } |
| 730 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 731 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 732 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 733 | func Link(path string, link string) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 734 | var _p0 *byte |
| 735 | _p0, err = BytePtrFromString(path) |
| 736 | if err != nil { |
| 737 | return |
| 738 | } |
| 739 | var _p1 *byte |
| 740 | _p1, err = BytePtrFromString(link) |
| 741 | if err != nil { |
| 742 | return |
| 743 | } |
| 744 | _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 745 | use(unsafe.Pointer(_p0)) |
| 746 | use(unsafe.Pointer(_p1)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 747 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 748 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 749 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 750 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 751 | } |
| 752 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 753 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 754 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 755 | func Listen(s int, backlog int) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 756 | _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 757 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 758 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 759 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 760 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 761 | } |
| 762 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 763 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 764 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 765 | func Lstat(path string, stat *Stat_t) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 766 | var _p0 *byte |
| 767 | _p0, err = BytePtrFromString(path) |
| 768 | if err != nil { |
| 769 | return |
| 770 | } |
| 771 | _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 772 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 773 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 774 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 775 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 776 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 777 | } |
| 778 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 779 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 780 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 781 | func Mkdir(path string, mode uint32) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 782 | var _p0 *byte |
| 783 | _p0, err = BytePtrFromString(path) |
| 784 | if err != nil { |
| 785 | return |
| 786 | } |
| 787 | _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 788 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 789 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 790 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 791 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 792 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 793 | } |
| 794 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 795 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 796 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 797 | func Mkfifo(path string, mode uint32) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 798 | var _p0 *byte |
| 799 | _p0, err = BytePtrFromString(path) |
| 800 | if err != nil { |
| 801 | return |
| 802 | } |
| 803 | _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 804 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 805 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 806 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 807 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 808 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 809 | } |
| 810 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 811 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 812 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 813 | func Mknod(path string, mode uint32, dev int) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 814 | var _p0 *byte |
| 815 | _p0, err = BytePtrFromString(path) |
| 816 | if err != nil { |
| 817 | return |
| 818 | } |
| 819 | _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 820 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 821 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 822 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 823 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 824 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 825 | } |
| 826 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 827 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 828 | |
William Orr | 08706f1 | 2014-02-27 10:13:41 -0800 | [diff] [blame] | 829 | func Mlock(b []byte) (err error) { |
| 830 | var _p0 unsafe.Pointer |
| 831 | if len(b) > 0 { |
| 832 | _p0 = unsafe.Pointer(&b[0]) |
| 833 | } else { |
| 834 | _p0 = unsafe.Pointer(&_zero) |
| 835 | } |
| 836 | _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) |
| 837 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 838 | err = errnoErr(e1) |
William Orr | 08706f1 | 2014-02-27 10:13:41 -0800 | [diff] [blame] | 839 | } |
| 840 | return |
| 841 | } |
| 842 | |
| 843 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 844 | |
| 845 | func Mlockall(flags int) (err error) { |
| 846 | _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) |
| 847 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 848 | err = errnoErr(e1) |
William Orr | 08706f1 | 2014-02-27 10:13:41 -0800 | [diff] [blame] | 849 | } |
| 850 | return |
| 851 | } |
| 852 | |
| 853 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 854 | |
| 855 | func Mprotect(b []byte, prot int) (err error) { |
| 856 | var _p0 unsafe.Pointer |
| 857 | if len(b) > 0 { |
| 858 | _p0 = unsafe.Pointer(&b[0]) |
| 859 | } else { |
| 860 | _p0 = unsafe.Pointer(&_zero) |
| 861 | } |
| 862 | _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) |
| 863 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 864 | err = errnoErr(e1) |
William Orr | 08706f1 | 2014-02-27 10:13:41 -0800 | [diff] [blame] | 865 | } |
| 866 | return |
| 867 | } |
| 868 | |
| 869 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 870 | |
| 871 | func Munlock(b []byte) (err error) { |
| 872 | var _p0 unsafe.Pointer |
| 873 | if len(b) > 0 { |
| 874 | _p0 = unsafe.Pointer(&b[0]) |
| 875 | } else { |
| 876 | _p0 = unsafe.Pointer(&_zero) |
| 877 | } |
| 878 | _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) |
| 879 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 880 | err = errnoErr(e1) |
William Orr | 08706f1 | 2014-02-27 10:13:41 -0800 | [diff] [blame] | 881 | } |
| 882 | return |
| 883 | } |
| 884 | |
| 885 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 886 | |
| 887 | func Munlockall() (err error) { |
| 888 | _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) |
| 889 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 890 | err = errnoErr(e1) |
William Orr | 08706f1 | 2014-02-27 10:13:41 -0800 | [diff] [blame] | 891 | } |
| 892 | return |
| 893 | } |
| 894 | |
| 895 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 896 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 897 | func Open(path string, mode int, perm uint32) (fd int, err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 898 | var _p0 *byte |
| 899 | _p0, err = BytePtrFromString(path) |
| 900 | if err != nil { |
| 901 | return |
| 902 | } |
| 903 | r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 904 | use(unsafe.Pointer(_p0)) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 905 | fd = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 906 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 907 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 908 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 909 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 910 | } |
| 911 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 912 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 913 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 914 | func Pathconf(path string, name int) (val int, err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 915 | var _p0 *byte |
| 916 | _p0, err = BytePtrFromString(path) |
| 917 | if err != nil { |
| 918 | return |
| 919 | } |
| 920 | r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 921 | use(unsafe.Pointer(_p0)) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 922 | val = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 923 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 924 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 925 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 926 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 927 | } |
| 928 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 929 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 930 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 931 | func Pread(fd int, p []byte, offset int64) (n int, err error) { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 932 | var _p0 unsafe.Pointer |
Russ Cox | 6faacd2 | 2009-10-06 19:38:30 -0700 | [diff] [blame] | 933 | if len(p) > 0 { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 934 | _p0 = unsafe.Pointer(&p[0]) |
Russ Cox | 56faae2 | 2011-02-09 14:28:47 -0500 | [diff] [blame] | 935 | } else { |
| 936 | _p0 = unsafe.Pointer(&_zero) |
Russ Cox | 6faacd2 | 2009-10-06 19:38:30 -0700 | [diff] [blame] | 937 | } |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 938 | r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 939 | n = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 940 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 941 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 942 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 943 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 944 | } |
| 945 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 946 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 947 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 948 | func Pwrite(fd int, p []byte, offset int64) (n int, err error) { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 949 | var _p0 unsafe.Pointer |
Russ Cox | 6faacd2 | 2009-10-06 19:38:30 -0700 | [diff] [blame] | 950 | if len(p) > 0 { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 951 | _p0 = unsafe.Pointer(&p[0]) |
Russ Cox | 56faae2 | 2011-02-09 14:28:47 -0500 | [diff] [blame] | 952 | } else { |
| 953 | _p0 = unsafe.Pointer(&_zero) |
Russ Cox | 6faacd2 | 2009-10-06 19:38:30 -0700 | [diff] [blame] | 954 | } |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 955 | r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 956 | n = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 957 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 958 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 959 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 960 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 961 | } |
| 962 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 963 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 964 | |
Dmitriy Vyukov | cffbfae | 2012-10-09 20:51:58 +0400 | [diff] [blame] | 965 | func read(fd int, p []byte) (n int, err error) { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 966 | var _p0 unsafe.Pointer |
Russ Cox | 6faacd2 | 2009-10-06 19:38:30 -0700 | [diff] [blame] | 967 | if len(p) > 0 { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 968 | _p0 = unsafe.Pointer(&p[0]) |
Russ Cox | 56faae2 | 2011-02-09 14:28:47 -0500 | [diff] [blame] | 969 | } else { |
| 970 | _p0 = unsafe.Pointer(&_zero) |
Russ Cox | 6faacd2 | 2009-10-06 19:38:30 -0700 | [diff] [blame] | 971 | } |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 972 | r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 973 | n = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 974 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 975 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 976 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 977 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 978 | } |
| 979 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 980 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 981 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 982 | func Readlink(path string, buf []byte) (n int, err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 983 | var _p0 *byte |
| 984 | _p0, err = BytePtrFromString(path) |
| 985 | if err != nil { |
| 986 | return |
Russ Cox | 6faacd2 | 2009-10-06 19:38:30 -0700 | [diff] [blame] | 987 | } |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 988 | var _p1 unsafe.Pointer |
| 989 | if len(buf) > 0 { |
| 990 | _p1 = unsafe.Pointer(&buf[0]) |
| 991 | } else { |
| 992 | _p1 = unsafe.Pointer(&_zero) |
| 993 | } |
| 994 | r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 995 | use(unsafe.Pointer(_p0)) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 996 | n = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 997 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 998 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 999 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1000 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1001 | } |
| 1002 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1003 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1004 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1005 | func Rename(from string, to string) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 1006 | var _p0 *byte |
| 1007 | _p0, err = BytePtrFromString(from) |
| 1008 | if err != nil { |
| 1009 | return |
| 1010 | } |
| 1011 | var _p1 *byte |
| 1012 | _p1, err = BytePtrFromString(to) |
| 1013 | if err != nil { |
| 1014 | return |
| 1015 | } |
| 1016 | _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 1017 | use(unsafe.Pointer(_p0)) |
| 1018 | use(unsafe.Pointer(_p1)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1019 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1020 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1021 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1022 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1023 | } |
| 1024 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1025 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1026 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1027 | func Revoke(path string) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 1028 | var _p0 *byte |
| 1029 | _p0, err = BytePtrFromString(path) |
| 1030 | if err != nil { |
| 1031 | return |
| 1032 | } |
| 1033 | _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 1034 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1035 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1036 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1037 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1038 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1039 | } |
| 1040 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1041 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1042 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1043 | func Rmdir(path string) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 1044 | var _p0 *byte |
| 1045 | _p0, err = BytePtrFromString(path) |
| 1046 | if err != nil { |
| 1047 | return |
| 1048 | } |
| 1049 | _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 1050 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1051 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1052 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1053 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1054 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1055 | } |
| 1056 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1057 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1058 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1059 | func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1060 | r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) |
| 1061 | newoffset = int64(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1062 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1063 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1064 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1065 | return |
Russ Cox | 76c87d5 | 2009-06-16 17:17:02 -0700 | [diff] [blame] | 1066 | } |
| 1067 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1068 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1069 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1070 | func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1071 | _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1072 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1073 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1074 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1075 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1076 | } |
| 1077 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1078 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1079 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1080 | func Setegid(egid int) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1081 | _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1082 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1083 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1084 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1085 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1086 | } |
| 1087 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1088 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1089 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1090 | func Seteuid(euid int) (err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 1091 | _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1092 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1093 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1094 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1095 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1096 | } |
| 1097 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1098 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1099 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1100 | func Setgid(gid int) (err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 1101 | _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1102 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1103 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1104 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1105 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1106 | } |
| 1107 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1108 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1109 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1110 | func Setlogin(name string) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 1111 | var _p0 *byte |
| 1112 | _p0, err = BytePtrFromString(name) |
| 1113 | if err != nil { |
| 1114 | return |
| 1115 | } |
| 1116 | _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 1117 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1118 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1119 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1120 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1121 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1122 | } |
| 1123 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1124 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1125 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1126 | func Setpgid(pid int, pgid int) (err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 1127 | _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1128 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1129 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1130 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1131 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1132 | } |
| 1133 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1134 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1135 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1136 | func Setpriority(which int, who int, prio int) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1137 | _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1138 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1139 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1140 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1141 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1142 | } |
| 1143 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1144 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1145 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1146 | func Setprivexec(flag int) (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1147 | _, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1148 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1149 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1150 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1151 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1152 | } |
| 1153 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1154 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1155 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1156 | func Setregid(rgid int, egid int) (err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 1157 | _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1158 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1159 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1160 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1161 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1162 | } |
| 1163 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1164 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1165 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1166 | func Setreuid(ruid int, euid int) (err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 1167 | _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1168 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1169 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1170 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1171 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1172 | } |
| 1173 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1174 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1175 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1176 | func Setrlimit(which int, lim *Rlimit) (err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 1177 | _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1178 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1179 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1180 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1181 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1182 | } |
| 1183 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1184 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1185 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1186 | func Setsid() (pid int, err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 1187 | r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1188 | pid = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1189 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1190 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1191 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1192 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1193 | } |
| 1194 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1195 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1196 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1197 | func Settimeofday(tp *Timeval) (err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 1198 | _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1199 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1200 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1201 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1202 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1203 | } |
| 1204 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1205 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1206 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1207 | func Setuid(uid int) (err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 1208 | _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1209 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1210 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1211 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1212 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1213 | } |
| 1214 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1215 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1216 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1217 | func Stat(path string, stat *Stat_t) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 1218 | var _p0 *byte |
| 1219 | _p0, err = BytePtrFromString(path) |
| 1220 | if err != nil { |
| 1221 | return |
| 1222 | } |
| 1223 | _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 1224 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1225 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1226 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1227 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1228 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1229 | } |
| 1230 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1231 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1232 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1233 | func Statfs(path string, stat *Statfs_t) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 1234 | var _p0 *byte |
| 1235 | _p0, err = BytePtrFromString(path) |
| 1236 | if err != nil { |
| 1237 | return |
| 1238 | } |
| 1239 | _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 1240 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1241 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1242 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1243 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1244 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1245 | } |
| 1246 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1247 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1248 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1249 | func Symlink(path string, link string) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 1250 | var _p0 *byte |
| 1251 | _p0, err = BytePtrFromString(path) |
| 1252 | if err != nil { |
| 1253 | return |
| 1254 | } |
| 1255 | var _p1 *byte |
| 1256 | _p1, err = BytePtrFromString(link) |
| 1257 | if err != nil { |
| 1258 | return |
| 1259 | } |
| 1260 | _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 1261 | use(unsafe.Pointer(_p0)) |
| 1262 | use(unsafe.Pointer(_p1)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1263 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1264 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1265 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1266 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1267 | } |
| 1268 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1269 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1270 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1271 | func Sync() (err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1272 | _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1273 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1274 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1275 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1276 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1277 | } |
| 1278 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1279 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1280 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1281 | func Truncate(path string, length int64) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 1282 | var _p0 *byte |
| 1283 | _p0, err = BytePtrFromString(path) |
| 1284 | if err != nil { |
| 1285 | return |
| 1286 | } |
| 1287 | _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 1288 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1289 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1290 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1291 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1292 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1293 | } |
| 1294 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1295 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1296 | |
Giles Lean | 5aa3a8d | 2010-02-16 11:43:25 -0800 | [diff] [blame] | 1297 | func Umask(newmask int) (oldmask int) { |
| 1298 | r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) |
| 1299 | oldmask = int(r0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1300 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1301 | } |
| 1302 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1303 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1304 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1305 | func Undelete(path string) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 1306 | var _p0 *byte |
| 1307 | _p0, err = BytePtrFromString(path) |
| 1308 | if err != nil { |
| 1309 | return |
| 1310 | } |
| 1311 | _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 1312 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1313 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1314 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1315 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1316 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1317 | } |
| 1318 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1319 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1320 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1321 | func Unlink(path string) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 1322 | var _p0 *byte |
| 1323 | _p0, err = BytePtrFromString(path) |
| 1324 | if err != nil { |
| 1325 | return |
| 1326 | } |
| 1327 | _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 1328 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1329 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1330 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1331 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1332 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1333 | } |
| 1334 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1335 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1336 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1337 | func Unmount(path string, flags int) (err error) { |
Alexey Borzenkov | a108369 | 2012-08-05 17:24:32 -0400 | [diff] [blame] | 1338 | var _p0 *byte |
| 1339 | _p0, err = BytePtrFromString(path) |
| 1340 | if err != nil { |
| 1341 | return |
| 1342 | } |
| 1343 | _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) |
Russ Cox | cf622d7 | 2014-09-08 16:59:59 -0400 | [diff] [blame] | 1344 | use(unsafe.Pointer(_p0)) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1345 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1346 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1347 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1348 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1349 | } |
| 1350 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1351 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1352 | |
Dmitriy Vyukov | cffbfae | 2012-10-09 20:51:58 +0400 | [diff] [blame] | 1353 | func write(fd int, p []byte) (n int, err error) { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1354 | var _p0 unsafe.Pointer |
Russ Cox | 6faacd2 | 2009-10-06 19:38:30 -0700 | [diff] [blame] | 1355 | if len(p) > 0 { |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1356 | _p0 = unsafe.Pointer(&p[0]) |
Russ Cox | 56faae2 | 2011-02-09 14:28:47 -0500 | [diff] [blame] | 1357 | } else { |
| 1358 | _p0 = unsafe.Pointer(&_zero) |
Russ Cox | 6faacd2 | 2009-10-06 19:38:30 -0700 | [diff] [blame] | 1359 | } |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1360 | r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1361 | n = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1362 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1363 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1364 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1365 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1366 | } |
| 1367 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1368 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1369 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1370 | func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { |
Joel Sing | 68fea34 | 2011-08-08 09:56:45 -0400 | [diff] [blame] | 1371 | r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) |
| 1372 | ret = uintptr(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1373 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1374 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1375 | } |
Joel Sing | 68fea34 | 2011-08-08 09:56:45 -0400 | [diff] [blame] | 1376 | return |
| 1377 | } |
| 1378 | |
| 1379 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1380 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1381 | func munmap(addr uintptr, length uintptr) (err error) { |
Joel Sing | 68fea34 | 2011-08-08 09:56:45 -0400 | [diff] [blame] | 1382 | _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1383 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1384 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1385 | } |
Joel Sing | 68fea34 | 2011-08-08 09:56:45 -0400 | [diff] [blame] | 1386 | return |
| 1387 | } |
| 1388 | |
| 1389 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1390 | |
Dmitriy Vyukov | cffbfae | 2012-10-09 20:51:58 +0400 | [diff] [blame] | 1391 | func readlen(fd int, buf *byte, nbuf int) (n int, err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1392 | r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) |
| 1393 | n = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1394 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1395 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1396 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1397 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1398 | } |
| 1399 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1400 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1401 | |
Dmitriy Vyukov | cffbfae | 2012-10-09 20:51:58 +0400 | [diff] [blame] | 1402 | func writelen(fd int, buf *byte, nbuf int) (n int, err error) { |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1403 | r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) |
| 1404 | n = int(r0) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1405 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1406 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1407 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1408 | return |
Russ Cox | e11f833 | 2009-06-01 22:15:08 -0700 | [diff] [blame] | 1409 | } |
| 1410 | |
Russ Cox | 5c4917c | 2010-09-24 15:17:20 -0400 | [diff] [blame] | 1411 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
| 1412 | |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1413 | func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) { |
Ian Lance Taylor | 4fd41e4 | 2011-03-16 19:03:01 -0700 | [diff] [blame] | 1414 | r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1415 | sec = int64(r0) |
| 1416 | usec = int32(r1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1417 | if e1 != 0 { |
Brad Fitzpatrick | 6bf0007 | 2015-03-03 16:42:06 -0800 | [diff] [blame] | 1418 | err = errnoErr(e1) |
Russ Cox | c017a82 | 2011-11-13 22:44:52 -0500 | [diff] [blame] | 1419 | } |
Robert Griesemer | d65a5cc | 2009-12-15 15:40:16 -0800 | [diff] [blame] | 1420 | return |
Russ Cox | 01b695d | 2009-06-08 22:10:48 -0700 | [diff] [blame] | 1421 | } |