blob: 998f008314651bdce35daf67f1630c7e6fe4c1ef [file] [log] [blame]
Rob Pikecd324982009-08-13 13:22:37 -07001// mksyscall.sh syscall_darwin.go syscall_darwin_amd64.go
Russ Coxe11f8332009-06-01 22:15:08 -07002// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
3
4package syscall
5
Russ Coxb04ac102009-08-12 13:19:17 -07006import "unsafe"
Russ Coxe11f8332009-06-01 22:15:08 -07007
Russ Coxe11f8332009-06-01 22:15:08 -07008func getgroups(ngid int, gid *_Gid_t) (n int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -07009 r0, _, e1 := Syscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0);
Russ Coxe11f8332009-06-01 22:15:08 -070010 n = int(r0);
11 errno = int(e1);
12 return;
13}
14
15func setgroups(ngid int, gid *_Gid_t) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -070016 _, _, e1 := Syscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0);
Russ Coxe11f8332009-06-01 22:15:08 -070017 errno = int(e1);
18 return;
19}
20
21func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -070022 r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -070023 wpid = int(r0);
24 errno = int(e1);
25 return;
26}
27
28func pipe() (r int, w int, errno int) {
29 r0, r1, e1 := Syscall(SYS_PIPE, 0, 0, 0);
30 r = int(r0);
31 w = int(r1);
32 errno = int(e1);
33 return;
34}
35
Russ Coxe11f8332009-06-01 22:15:08 -070036func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -070037 r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)));
Russ Coxe11f8332009-06-01 22:15:08 -070038 fd = int(r0);
39 errno = int(e1);
40 return;
41}
42
43func bind(s int, addr uintptr, addrlen _Socklen) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -070044 _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen));
Russ Coxe11f8332009-06-01 22:15:08 -070045 errno = int(e1);
46 return;
47}
48
49func connect(s int, addr uintptr, addrlen _Socklen) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -070050 _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen));
Russ Coxe11f8332009-06-01 22:15:08 -070051 errno = int(e1);
52 return;
53}
54
55func socket(domain int, typ int, proto int) (fd int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -070056 r0, _, e1 := Syscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto));
Russ Coxe11f8332009-06-01 22:15:08 -070057 fd = int(r0);
58 errno = int(e1);
59 return;
60}
61
62func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -070063 _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0);
Russ Coxe11f8332009-06-01 22:15:08 -070064 errno = int(e1);
65 return;
66}
67
Russ Cox5d2ee9d2009-06-17 21:44:26 -070068func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -070069 _, _, e1 := Syscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)));
Russ Cox5d2ee9d2009-06-17 21:44:26 -070070 errno = int(e1);
71 return;
72}
73
74func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -070075 _, _, e1 := Syscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)));
Russ Cox5d2ee9d2009-06-17 21:44:26 -070076 errno = int(e1);
77 return;
78}
79
Russ Cox0b126c12009-12-01 16:53:43 -080080func Shutdown(s int, how int) (errno int) {
81 _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0);
82 errno = int(e1);
83 return;
84}
85
Russ Coxfd1add22009-11-01 11:13:27 -080086func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
87 var _p0 *byte;
88 if len(p) > 0 {
Robert Griesemer40621d52009-11-09 12:07:39 -080089 _p0 = &p[0]
Russ Coxfd1add22009-11-01 11:13:27 -080090 }
91 r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)));
92 n = int(r0);
93 errno = int(e1);
94 return;
95}
96
97func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
98 var _p0 *byte;
99 if len(buf) > 0 {
Robert Griesemer40621d52009-11-09 12:07:39 -0800100 _p0 = &buf[0]
Russ Coxfd1add22009-11-01 11:13:27 -0800101 }
102 _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen));
103 errno = int(e1);
104 return;
105}
106
Russ Coxe11f8332009-06-01 22:15:08 -0700107func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700108 r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)));
Russ Coxe11f8332009-06-01 22:15:08 -0700109 n = int(r0);
110 errno = int(e1);
111 return;
112}
113
Russ Coxb32769b2009-06-29 13:44:46 -0700114func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (errno int) {
115 var _p0 *_C_int;
Russ Cox6faacd22009-10-06 19:38:30 -0700116 if len(mib) > 0 {
Robert Griesemer40621d52009-11-09 12:07:39 -0800117 _p0 = &mib[0]
Russ Cox6faacd22009-10-06 19:38:30 -0700118 }
Russ Cox98c98192009-09-15 13:51:33 -0700119 _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(unsafe.Pointer(_p0)), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen));
Russ Coxb32769b2009-06-29 13:44:46 -0700120 errno = int(e1);
121 return;
122}
123
Russ Coxe11f8332009-06-01 22:15:08 -0700124func fcntl(fd int, cmd int, arg int) (val int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700125 r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg));
Russ Coxe11f8332009-06-01 22:15:08 -0700126 val = int(r0);
127 errno = int(e1);
128 return;
129}
130
131func Access(path string, flags int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700132 _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700133 errno = int(e1);
134 return;
135}
136
137func Adjtime(delta *Timeval, olddelta *Timeval) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700138 _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700139 errno = int(e1);
140 return;
141}
142
143func Chdir(path string) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700144 _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700145 errno = int(e1);
146 return;
147}
148
149func Chflags(path string, flags int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700150 _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700151 errno = int(e1);
152 return;
153}
154
155func Chmod(path string, mode int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700156 _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700157 errno = int(e1);
158 return;
159}
160
161func Chown(path string, uid int, gid int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700162 _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid));
Russ Coxe11f8332009-06-01 22:15:08 -0700163 errno = int(e1);
164 return;
165}
166
167func Chroot(path string) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700168 _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700169 errno = int(e1);
170 return;
171}
172
173func Close(fd int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700174 _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700175 errno = int(e1);
176 return;
177}
178
179func Dup(fd int) (nfd int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700180 r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700181 nfd = int(r0);
182 errno = int(e1);
183 return;
184}
185
186func Dup2(from int, to int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700187 _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700188 errno = int(e1);
189 return;
190}
191
192func Exchangedata(path1 string, path2 string, options int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700193 _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(StringBytePtr(path1))), uintptr(unsafe.Pointer(StringBytePtr(path2))), uintptr(options));
Russ Coxe11f8332009-06-01 22:15:08 -0700194 errno = int(e1);
195 return;
196}
197
Russ Cox6faacd22009-10-06 19:38:30 -0700198func Exit(code int) {
Russ Cox98c98192009-09-15 13:51:33 -0700199 Syscall(SYS_EXIT, uintptr(code), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700200 return;
201}
202
203func Fchdir(fd int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700204 _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700205 errno = int(e1);
206 return;
207}
208
209func Fchflags(path string, flags int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700210 _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700211 errno = int(e1);
212 return;
213}
214
215func Fchmod(fd int, mode int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700216 _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700217 errno = int(e1);
218 return;
219}
220
221func Fchown(fd int, uid int, gid int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700222 _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid));
Russ Coxe11f8332009-06-01 22:15:08 -0700223 errno = int(e1);
224 return;
225}
226
227func Flock(fd int, how int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700228 _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700229 errno = int(e1);
230 return;
231}
232
233func Fpathconf(fd int, name int) (val int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700234 r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700235 val = int(r0);
236 errno = int(e1);
237 return;
238}
239
240func Fstat(fd int, stat *Stat_t) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700241 _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700242 errno = int(e1);
243 return;
244}
245
246func Fstatfs(fd int, stat *Statfs_t) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700247 _, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700248 errno = int(e1);
249 return;
250}
251
252func Fsync(fd int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700253 _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700254 errno = int(e1);
255 return;
256}
257
258func Ftruncate(fd int, length int64) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700259 _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700260 errno = int(e1);
261 return;
262}
263
264func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int) {
265 var _p0 *byte;
Russ Cox6faacd22009-10-06 19:38:30 -0700266 if len(buf) > 0 {
Robert Griesemer40621d52009-11-09 12:07:39 -0800267 _p0 = &buf[0]
Russ Cox6faacd22009-10-06 19:38:30 -0700268 }
Russ Cox98c98192009-09-15 13:51:33 -0700269 r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700270 n = int(r0);
271 errno = int(e1);
272 return;
273}
274
275func Getdtablesize() (size int) {
Russ Cox98c98192009-09-15 13:51:33 -0700276 r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700277 size = int(r0);
278 return;
279}
280
281func Getegid() (egid int) {
Russ Cox98c98192009-09-15 13:51:33 -0700282 r0, _, _ := Syscall(SYS_GETEGID, 0, 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700283 egid = int(r0);
284 return;
285}
286
287func Geteuid() (uid int) {
Russ Cox98c98192009-09-15 13:51:33 -0700288 r0, _, _ := Syscall(SYS_GETEUID, 0, 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700289 uid = int(r0);
290 return;
291}
292
Russ Cox01b695d2009-06-08 22:10:48 -0700293func Getfsstat(buf []Statfs_t, flags int) (n int, errno int) {
294 var _p0 *Statfs_t;
Russ Cox6faacd22009-10-06 19:38:30 -0700295 if len(buf) > 0 {
Robert Griesemer40621d52009-11-09 12:07:39 -0800296 _p0 = &buf[0]
Russ Cox6faacd22009-10-06 19:38:30 -0700297 }
Russ Cox98c98192009-09-15 13:51:33 -0700298 r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags));
Russ Cox01b695d2009-06-08 22:10:48 -0700299 n = int(r0);
300 errno = int(e1);
301 return;
302}
303
Russ Coxe11f8332009-06-01 22:15:08 -0700304func Getgid() (gid int) {
Russ Cox98c98192009-09-15 13:51:33 -0700305 r0, _, _ := Syscall(SYS_GETGID, 0, 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700306 gid = int(r0);
307 return;
308}
309
310func Getpgid(pid int) (pgid int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700311 r0, _, e1 := Syscall(SYS_GETPGID, uintptr(pid), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700312 pgid = int(r0);
313 errno = int(e1);
314 return;
315}
316
317func Getpgrp() (pgrp int) {
Russ Cox98c98192009-09-15 13:51:33 -0700318 r0, _, _ := Syscall(SYS_GETPGRP, 0, 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700319 pgrp = int(r0);
320 return;
321}
322
323func Getpid() (pid int) {
Russ Cox98c98192009-09-15 13:51:33 -0700324 r0, _, _ := Syscall(SYS_GETPID, 0, 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700325 pid = int(r0);
326 return;
327}
328
329func Getppid() (ppid int) {
Russ Cox98c98192009-09-15 13:51:33 -0700330 r0, _, _ := Syscall(SYS_GETPPID, 0, 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700331 ppid = int(r0);
332 return;
333}
334
335func Getpriority(which int, who int) (prio int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700336 r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700337 prio = int(r0);
338 errno = int(e1);
339 return;
340}
341
342func Getrlimit(which int, lim *Rlimit) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700343 _, _, e1 := Syscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700344 errno = int(e1);
345 return;
346}
347
348func Getrusage(who int, rusage *Rusage) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700349 _, _, e1 := Syscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700350 errno = int(e1);
351 return;
352}
353
354func Getsid(pid int) (sid int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700355 r0, _, e1 := Syscall(SYS_GETSID, uintptr(pid), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700356 sid = int(r0);
357 errno = int(e1);
358 return;
359}
360
361func Getuid() (uid int) {
Russ Cox98c98192009-09-15 13:51:33 -0700362 r0, _, _ := Syscall(SYS_GETUID, 0, 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700363 uid = int(r0);
364 return;
365}
366
367func Issetugid() (tainted bool) {
Russ Cox98c98192009-09-15 13:51:33 -0700368 r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700369 tainted = bool(r0 != 0);
370 return;
371}
372
373func Kill(pid int, signum int, posix int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700374 _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix));
Russ Coxe11f8332009-06-01 22:15:08 -0700375 errno = int(e1);
376 return;
377}
378
379func Kqueue() (fd int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700380 r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700381 fd = int(r0);
382 errno = int(e1);
383 return;
384}
385
386func Lchown(path string, uid int, gid int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700387 _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid));
Russ Coxe11f8332009-06-01 22:15:08 -0700388 errno = int(e1);
389 return;
390}
391
392func Link(path string, link string) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700393 _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700394 errno = int(e1);
395 return;
396}
397
398func Listen(s int, backlog int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700399 _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700400 errno = int(e1);
401 return;
402}
403
404func Lstat(path string, stat *Stat_t) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700405 _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700406 errno = int(e1);
407 return;
408}
409
410func Mkdir(path string, mode int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700411 _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700412 errno = int(e1);
413 return;
414}
415
416func Mkfifo(path string, mode int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700417 _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700418 errno = int(e1);
419 return;
420}
421
422func Mknod(path string, mode int, dev int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700423 _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(dev));
Russ Coxe11f8332009-06-01 22:15:08 -0700424 errno = int(e1);
425 return;
426}
427
428func Open(path string, mode int, perm int) (fd int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700429 r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm));
Russ Coxe11f8332009-06-01 22:15:08 -0700430 fd = int(r0);
431 errno = int(e1);
432 return;
433}
434
435func Pathconf(path string, name int) (val int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700436 r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(name), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700437 val = int(r0);
438 errno = int(e1);
439 return;
440}
441
442func Pread(fd int, p []byte, offset int64) (n int, errno int) {
443 var _p0 *byte;
Russ Cox6faacd22009-10-06 19:38:30 -0700444 if len(p) > 0 {
Robert Griesemer40621d52009-11-09 12:07:39 -0800445 _p0 = &p[0]
Russ Cox6faacd22009-10-06 19:38:30 -0700446 }
Russ Cox98c98192009-09-15 13:51:33 -0700447 r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700448 n = int(r0);
449 errno = int(e1);
450 return;
451}
452
453func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
454 var _p0 *byte;
Russ Cox6faacd22009-10-06 19:38:30 -0700455 if len(p) > 0 {
Robert Griesemer40621d52009-11-09 12:07:39 -0800456 _p0 = &p[0]
Russ Cox6faacd22009-10-06 19:38:30 -0700457 }
Russ Cox98c98192009-09-15 13:51:33 -0700458 r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700459 n = int(r0);
460 errno = int(e1);
461 return;
462}
463
464func Read(fd int, p []byte) (n int, errno int) {
465 var _p0 *byte;
Russ Cox6faacd22009-10-06 19:38:30 -0700466 if len(p) > 0 {
Robert Griesemer40621d52009-11-09 12:07:39 -0800467 _p0 = &p[0]
Russ Cox6faacd22009-10-06 19:38:30 -0700468 }
Russ Cox98c98192009-09-15 13:51:33 -0700469 r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)));
Russ Coxe11f8332009-06-01 22:15:08 -0700470 n = int(r0);
471 errno = int(e1);
472 return;
473}
474
475func Readlink(path string, buf []byte) (n int, errno int) {
476 var _p0 *byte;
Russ Cox6faacd22009-10-06 19:38:30 -0700477 if len(buf) > 0 {
Robert Griesemer40621d52009-11-09 12:07:39 -0800478 _p0 = &buf[0]
Russ Cox6faacd22009-10-06 19:38:30 -0700479 }
Russ Cox98c98192009-09-15 13:51:33 -0700480 r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)));
Russ Coxe11f8332009-06-01 22:15:08 -0700481 n = int(r0);
482 errno = int(e1);
483 return;
484}
485
486func Rename(from string, to string) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700487 _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(StringBytePtr(from))), uintptr(unsafe.Pointer(StringBytePtr(to))), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700488 errno = int(e1);
489 return;
490}
491
492func Revoke(path string) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700493 _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700494 errno = int(e1);
495 return;
496}
497
498func Rmdir(path string) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700499 _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700500 errno = int(e1);
501 return;
502}
503
Russ Cox76c87d52009-06-16 17:17:02 -0700504func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700505 r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence));
Russ Cox76c87d52009-06-16 17:17:02 -0700506 newoffset = int64(r0);
507 errno = int(e1);
508 return;
509}
510
Russ Coxe11f8332009-06-01 22:15:08 -0700511func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700512 _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700513 errno = int(e1);
514 return;
515}
516
517func Setegid(egid int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700518 _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700519 errno = int(e1);
520 return;
521}
522
523func Seteuid(euid int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700524 _, _, e1 := Syscall(SYS_SETEUID, uintptr(euid), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700525 errno = int(e1);
526 return;
527}
528
529func Setgid(gid int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700530 _, _, e1 := Syscall(SYS_SETGID, uintptr(gid), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700531 errno = int(e1);
532 return;
533}
534
535func Setlogin(name string) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700536 _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(StringBytePtr(name))), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700537 errno = int(e1);
538 return;
539}
540
541func Setpgid(pid int, pgid int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700542 _, _, e1 := Syscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700543 errno = int(e1);
544 return;
545}
546
547func Setpriority(which int, who int, prio int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700548 _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio));
Russ Coxe11f8332009-06-01 22:15:08 -0700549 errno = int(e1);
550 return;
551}
552
553func Setprivexec(flag int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700554 _, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700555 errno = int(e1);
556 return;
557}
558
559func Setregid(rgid int, egid int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700560 _, _, e1 := Syscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700561 errno = int(e1);
562 return;
563}
564
565func Setreuid(ruid int, euid int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700566 _, _, e1 := Syscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700567 errno = int(e1);
568 return;
569}
570
571func Setrlimit(which int, lim *Rlimit) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700572 _, _, e1 := Syscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700573 errno = int(e1);
574 return;
575}
576
577func Setsid() (pid int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700578 r0, _, e1 := Syscall(SYS_SETSID, 0, 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700579 pid = int(r0);
580 errno = int(e1);
581 return;
582}
583
584func Settimeofday(tp *Timeval) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700585 _, _, e1 := Syscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700586 errno = int(e1);
587 return;
588}
589
590func Setuid(uid int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700591 _, _, e1 := Syscall(SYS_SETUID, uintptr(uid), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700592 errno = int(e1);
593 return;
594}
595
596func Stat(path string, stat *Stat_t) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700597 _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700598 errno = int(e1);
599 return;
600}
601
602func Statfs(path string, stat *Statfs_t) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700603 _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700604 errno = int(e1);
605 return;
606}
607
608func Symlink(path string, link string) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700609 _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700610 errno = int(e1);
611 return;
612}
613
614func Sync() (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700615 _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700616 errno = int(e1);
617 return;
618}
619
620func Truncate(path string, length int64) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700621 _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700622 errno = int(e1);
623 return;
624}
625
626func Umask(newmask int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700627 _, _, e1 := Syscall(SYS_UMASK, uintptr(newmask), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700628 errno = int(e1);
629 return;
630}
631
632func Undelete(path string) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700633 _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700634 errno = int(e1);
635 return;
636}
637
638func Unlink(path string) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700639 _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700640 errno = int(e1);
641 return;
642}
643
644func Unmount(path string, flags int) (errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700645 _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0);
Russ Coxe11f8332009-06-01 22:15:08 -0700646 errno = int(e1);
647 return;
648}
649
650func Write(fd int, p []byte) (n int, errno int) {
651 var _p0 *byte;
Russ Cox6faacd22009-10-06 19:38:30 -0700652 if len(p) > 0 {
Robert Griesemer40621d52009-11-09 12:07:39 -0800653 _p0 = &p[0]
Russ Cox6faacd22009-10-06 19:38:30 -0700654 }
Russ Cox98c98192009-09-15 13:51:33 -0700655 r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)));
Russ Coxe11f8332009-06-01 22:15:08 -0700656 n = int(r0);
657 errno = int(e1);
658 return;
659}
660
661func read(fd int, buf *byte, nbuf int) (n int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700662 r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf));
Russ Coxe11f8332009-06-01 22:15:08 -0700663 n = int(r0);
664 errno = int(e1);
665 return;
666}
667
668func write(fd int, buf *byte, nbuf int) (n int, errno int) {
Russ Cox98c98192009-09-15 13:51:33 -0700669 r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf));
Russ Coxe11f8332009-06-01 22:15:08 -0700670 n = int(r0);
671 errno = int(e1);
672 return;
673}
674
Russ Cox01b695d2009-06-08 22:10:48 -0700675func gettimeofday(tp *Timeval) (sec int64, usec int32, errno int) {
676 r0, r1, e1 := Syscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0);
677 sec = int64(r0);
678 usec = int32(r1);
679 errno = int(e1);
680 return;
681}