zsyscall_linux_amd64.go 21.6 KB
Newer Older
1
// mksyscall.sh syscall_linux.go syscall_linux_amd64.go
2 3 4 5
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT

package syscall

6
import "unsafe"
7

8
func open(path string, mode int, perm uint32) (fd int, errno int) {
9 10 11 12 13 14
	r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm))
	fd = int(r0)
	errno = int(e1)
	return
}

15
func openat(dirfd int, path string, flags int, mode uint32) (fd int, errno int) {
16 17 18 19 20 21
	r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), uintptr(mode), 0, 0)
	fd = int(r0)
	errno = int(e1)
	return
}

22
func pipe(p *[2]_C_int) (errno int) {
23 24 25
	_, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
	errno = int(e1)
	return
26 27 28
}

func utimes(path string, times *[2]Timeval) (errno int) {
29 30 31
	_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(times)), 0)
	errno = int(e1)
	return
32 33
}

34 35
func futimesat(dirfd int, path *byte, times *[2]Timeval) (errno int) {
	_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
36 37
	errno = int(e1)
	return
38 39 40
}

func Getcwd(buf []byte) (n int, errno int) {
41
	var _p0 *byte
42
	if len(buf) > 0 {
43
		_p0 = &buf[0]
44
	}
45 46 47 48
	r0, _, e1 := Syscall(SYS_GETCWD, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0)
	n = int(r0)
	errno = int(e1)
	return
49 50 51
}

func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int) {
52 53 54 55
	r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
	wpid = int(r0)
	errno = int(e1)
	return
56 57
}

58
func ptrace(request int, pid int, addr uintptr, data uintptr) (errno int) {
59 60 61
	_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
	errno = int(e1)
	return
62 63
}

64
func Access(path string, mode uint32) (errno int) {
65 66 67
	_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
	errno = int(e1)
	return
68 69 70
}

func Acct(path string) (errno int) {
71 72 73
	_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
	errno = int(e1)
	return
74 75 76
}

func Adjtimex(buf *Timex) (state int, errno int) {
77 78 79 80
	r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
	state = int(r0)
	errno = int(e1)
	return
81 82 83
}

func Chdir(path string) (errno int) {
84 85 86
	_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
	errno = int(e1)
	return
87 88
}

89
func Chmod(path string, mode uint32) (errno int) {
90 91 92
	_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
	errno = int(e1)
	return
93 94 95
}

func Chroot(path string) (errno int) {
96 97 98
	_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
	errno = int(e1)
	return
99 100 101
}

func Close(fd int) (errno int) {
102 103 104
	_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
	errno = int(e1)
	return
105 106
}

107
func Creat(path string, mode uint32) (fd int, errno int) {
108 109 110 111
	r0, _, e1 := Syscall(SYS_CREAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
	fd = int(r0)
	errno = int(e1)
	return
112 113 114
}

func Dup(oldfd int) (fd int, errno int) {
115 116 117 118
	r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
	fd = int(r0)
	errno = int(e1)
	return
119 120 121
}

func Dup2(oldfd int, newfd int) (fd int, errno int) {
122 123 124 125
	r0, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
	fd = int(r0)
	errno = int(e1)
	return
126 127 128
}

func EpollCreate(size int) (fd int, errno int) {
129 130 131 132
	r0, _, e1 := Syscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
	fd = int(r0)
	errno = int(e1)
	return
133 134 135
}

func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (errno int) {
136 137 138
	_, _, e1 := Syscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)
	errno = int(e1)
	return
139 140 141
}

func EpollWait(epfd int, events []EpollEvent, msec int) (n int, errno int) {
142
	var _p0 *EpollEvent
143
	if len(events) > 0 {
144
		_p0 = &events[0]
145
	}
146 147 148 149
	r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(unsafe.Pointer(_p0)), uintptr(len(events)), uintptr(msec), 0, 0)
	n = int(r0)
	errno = int(e1)
	return
150 151
}

152
func Exit(code int) {
153 154
	Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0)
	return
155 156
}

157
func Faccessat(dirfd int, path string, mode uint32, flags int) (errno int) {
158 159 160
	_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(flags), 0, 0)
	errno = int(e1)
	return
161 162
}

163
func Fallocate(fd int, mode uint32, off int64, len int64) (errno int) {
164 165 166
	_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
	errno = int(e1)
	return
167 168 169
}

func Fchdir(fd int) (errno int) {
170 171 172
	_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
	errno = int(e1)
	return
173 174
}

175
func Fchmod(fd int, mode uint32) (errno int) {
176 177 178
	_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
	errno = int(e1)
	return
179 180
}

181
func Fchmodat(dirfd int, path string, mode uint32, flags int) (errno int) {
182 183 184
	_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(flags), 0, 0)
	errno = int(e1)
	return
185 186 187
}

func Fchownat(dirfd int, path string, uid int, gid int, flags int) (errno int) {
188 189 190
	_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid), uintptr(flags), 0)
	errno = int(e1)
	return
191 192 193
}

func fcntl(fd int, cmd int, arg int) (val int, errno int) {
194 195 196 197
	r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
	val = int(r0)
	errno = int(e1)
	return
198 199 200
}

func Fdatasync(fd int) (errno int) {
201 202 203
	_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)
	errno = int(e1)
	return
204 205 206
}

func Fsync(fd int) (errno int) {
207 208 209
	_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
	errno = int(e1)
	return
210 211 212
}

func Ftruncate(fd int, length int64) (errno int) {
213 214 215
	_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)
	errno = int(e1)
	return
216 217 218
}

func Getdents(fd int, buf []byte) (n int, errno int) {
219
	var _p0 *byte
220
	if len(buf) > 0 {
221
		_p0 = &buf[0]
222
	}
223 224 225 226
	r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)))
	n = int(r0)
	errno = int(e1)
	return
227 228 229
}

func Getpgid(pid int) (pgid int, errno int) {
230 231 232 233
	r0, _, e1 := Syscall(SYS_GETPGID, uintptr(pid), 0, 0)
	pgid = int(r0)
	errno = int(e1)
	return
234 235 236
}

func Getpgrp() (pid int) {
237 238 239
	r0, _, _ := Syscall(SYS_GETPGRP, 0, 0, 0)
	pid = int(r0)
	return
240 241 242
}

func Getpid() (pid int) {
243 244 245
	r0, _, _ := Syscall(SYS_GETPID, 0, 0, 0)
	pid = int(r0)
	return
246 247 248
}

func Getppid() (ppid int) {
249 250 251
	r0, _, _ := Syscall(SYS_GETPPID, 0, 0, 0)
	ppid = int(r0)
	return
252 253 254
}

func Getrlimit(resource int, rlim *Rlimit) (errno int) {
255 256 257
	_, _, e1 := Syscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
	errno = int(e1)
	return
258 259 260
}

func Getrusage(who int, rusage *Rusage) (errno int) {
261 262 263
	_, _, e1 := Syscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
	errno = int(e1)
	return
264 265 266
}

func Gettid() (tid int) {
267 268 269
	r0, _, _ := Syscall(SYS_GETTID, 0, 0, 0)
	tid = int(r0)
	return
270 271 272
}

func Gettimeofday(tv *Timeval) (errno int) {
273 274 275
	_, _, e1 := Syscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
	errno = int(e1)
	return
276 277 278
}

func Kill(pid int, sig int) (errno int) {
279 280 281
	_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)
	errno = int(e1)
	return
282 283 284
}

func Klogctl(typ int, buf []byte) (n int, errno int) {
285
	var _p0 *byte
286
	if len(buf) > 0 {
287
		_p0 = &buf[0]
288
	}
289 290 291 292
	r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)))
	n = int(r0)
	errno = int(e1)
	return
293 294 295
}

func Link(oldpath string, newpath string) (errno int) {
296 297 298
	_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0)
	errno = int(e1)
	return
299 300
}

301
func Mkdir(path string, mode uint32) (errno int) {
302 303 304
	_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
	errno = int(e1)
	return
305 306
}

307
func Mkdirat(dirfd int, path string, mode uint32) (errno int) {
308 309 310
	_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode))
	errno = int(e1)
	return
311 312
}

313
func Mknod(path string, mode uint32, dev int) (errno int) {
314 315 316
	_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(dev))
	errno = int(e1)
	return
317 318
}

319
func Mknodat(dirfd int, path string, mode uint32, dev int) (errno int) {
320 321 322
	_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(dev), 0, 0)
	errno = int(e1)
	return
323 324 325
}

func Nanosleep(time *Timespec, leftover *Timespec) (errno int) {
326 327 328
	_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
	errno = int(e1)
	return
329 330 331
}

func Pause() (errno int) {
332 333 334
	_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
	errno = int(e1)
	return
335 336 337
}

func PivotRoot(newroot string, putold string) (errno int) {
338 339 340
	_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(StringBytePtr(newroot))), uintptr(unsafe.Pointer(StringBytePtr(putold))), 0)
	errno = int(e1)
	return
341 342 343
}

func Pread(fd int, p []byte, offset int64) (n int, errno int) {
344
	var _p0 *byte
345
	if len(p) > 0 {
346
		_p0 = &p[0]
347
	}
348 349 350 351
	r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)
	n = int(r0)
	errno = int(e1)
	return
352 353 354
}

func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
355
	var _p0 *byte
356
	if len(p) > 0 {
357
		_p0 = &p[0]
358
	}
359 360 361 362
	r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)
	n = int(r0)
	errno = int(e1)
	return
363 364 365
}

func Read(fd int, p []byte) (n int, errno int) {
366
	var _p0 *byte
367
	if len(p) > 0 {
368
		_p0 = &p[0]
369
	}
370 371 372 373
	r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)))
	n = int(r0)
	errno = int(e1)
	return
374 375 376
}

func Readlink(path string, buf []byte) (n int, errno int) {
377
	var _p0 *byte
378
	if len(buf) > 0 {
379
		_p0 = &buf[0]
380
	}
381 382 383 384
	r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)))
	n = int(r0)
	errno = int(e1)
	return
385 386 387
}

func Rename(oldpath string, newpath string) (errno int) {
388 389 390
	_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0)
	errno = int(e1)
	return
391 392 393
}

func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (errno int) {
394 395 396
	_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(newdirfd), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0, 0)
	errno = int(e1)
	return
397 398 399
}

func Rmdir(path string) (errno int) {
400 401 402
	_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
	errno = int(e1)
	return
403 404 405
}

func Setdomainname(p []byte) (errno int) {
406
	var _p0 *byte
407
	if len(p) > 0 {
408
		_p0 = &p[0]
409
	}
410 411 412
	_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0)
	errno = int(e1)
	return
413 414 415
}

func Sethostname(p []byte) (errno int) {
416
	var _p0 *byte
417
	if len(p) > 0 {
418
		_p0 = &p[0]
419
	}
420 421 422
	_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0)
	errno = int(e1)
	return
423 424 425
}

func Setpgid(pid int, pgid int) (errno int) {
426 427 428
	_, _, e1 := Syscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
	errno = int(e1)
	return
429 430 431
}

func Setrlimit(resource int, rlim *Rlimit) (errno int) {
432 433 434
	_, _, e1 := Syscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
	errno = int(e1)
	return
435 436
}

437 438
func Setsid() (pid int, errno int) {
	r0, _, e1 := Syscall(SYS_SETSID, 0, 0, 0)
439
	pid = int(r0)
440
	errno = int(e1)
441
	return
442 443 444
}

func Settimeofday(tv *Timeval) (errno int) {
445 446 447
	_, _, e1 := Syscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
	errno = int(e1)
	return
448 449 450
}

func Setuid(uid int) (errno int) {
451 452 453
	_, _, e1 := Syscall(SYS_SETUID, uintptr(uid), 0, 0)
	errno = int(e1)
	return
454 455 456
}

func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, errno int) {
457 458 459 460
	r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
	n = int64(r0)
	errno = int(e1)
	return
461 462 463
}

func Symlink(oldpath string, newpath string) (errno int) {
464 465 466
	_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0)
	errno = int(e1)
	return
467 468
}

469
func Sync() {
470 471
	Syscall(SYS_SYNC, 0, 0, 0)
	return
472 473 474
}

func Sysinfo(info *Sysinfo_t) (errno int) {
475 476 477
	_, _, e1 := Syscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)
	errno = int(e1)
	return
478 479 480
}

func Tee(rfd int, wfd int, len int, flags int) (n int64, errno int) {
481 482 483 484
	r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)
	n = int64(r0)
	errno = int(e1)
	return
485 486 487
}

func Tgkill(tgid int, tid int, sig int) (errno int) {
488 489 490
	_, _, e1 := Syscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))
	errno = int(e1)
	return
491 492 493
}

func Time(t *Time_t) (tt Time_t, errno int) {
494 495 496 497
	r0, _, e1 := Syscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)
	tt = Time_t(r0)
	errno = int(e1)
	return
498 499 500
}

func Times(tms *Tms) (ticks uintptr, errno int) {
501 502 503 504
	r0, _, e1 := Syscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)
	ticks = uintptr(r0)
	errno = int(e1)
	return
505 506 507
}

func Truncate(path string, length int64) (errno int) {
508 509 510
	_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), 0)
	errno = int(e1)
	return
511 512 513
}

func Umask(mask int) (oldmask int) {
514 515 516
	r0, _, _ := Syscall(SYS_UMASK, uintptr(mask), 0, 0)
	oldmask = int(r0)
	return
517 518 519
}

func Uname(buf *Utsname) (errno int) {
520 521 522
	_, _, e1 := Syscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)
	errno = int(e1)
	return
523 524 525
}

func Unlink(path string) (errno int) {
526 527 528
	_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0)
	errno = int(e1)
	return
529 530 531
}

func Unlinkat(dirfd int, path string) (errno int) {
532 533 534
	_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), 0)
	errno = int(e1)
	return
535 536 537
}

func Unshare(flags int) (errno int) {
538 539 540
	_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)
	errno = int(e1)
	return
541 542 543
}

func Ustat(dev int, ubuf *Ustat_t) (errno int) {
544 545 546
	_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
	errno = int(e1)
	return
547 548 549
}

func Utime(path string, buf *Utimbuf) (errno int) {
550 551 552
	_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(buf)), 0)
	errno = int(e1)
	return
553 554 555
}

func Write(fd int, p []byte) (n int, errno int) {
556
	var _p0 *byte
557
	if len(p) > 0 {
558
		_p0 = &p[0]
559
	}
560 561 562 563
	r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)))
	n = int(r0)
	errno = int(e1)
	return
564 565 566
}

func exitThread(code int) (errno int) {
567 568 569
	_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)
	errno = int(e1)
	return
570 571 572
}

func read(fd int, p *byte, np int) (n int, errno int) {
573 574 575 576
	r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
	n = int(r0)
	errno = int(e1)
	return
577 578 579
}

func write(fd int, p *byte, np int) (n int, errno int) {
580 581 582 583
	r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
	n = int(r0)
	errno = int(e1)
	return
584 585
}

Russ Cox's avatar
Russ Cox committed
586
func Chown(path string, uid int, gid int) (errno int) {
587 588 589
	_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
590 591 592
}

func Fchown(fd int, uid int, gid int) (errno int) {
593 594 595
	_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
596 597 598
}

func Fstat(fd int, stat *Stat_t) (errno int) {
599 600 601
	_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
602 603 604
}

func Fstatfs(fd int, buf *Statfs_t) (errno int) {
605 606 607
	_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
608 609 610
}

func Getegid() (egid int) {
611 612 613
	r0, _, _ := Syscall(SYS_GETEGID, 0, 0, 0)
	egid = int(r0)
	return
Russ Cox's avatar
Russ Cox committed
614 615 616
}

func Geteuid() (euid int) {
617 618 619
	r0, _, _ := Syscall(SYS_GETEUID, 0, 0, 0)
	euid = int(r0)
	return
Russ Cox's avatar
Russ Cox committed
620 621 622
}

func Getgid() (gid int) {
623 624 625
	r0, _, _ := Syscall(SYS_GETGID, 0, 0, 0)
	gid = int(r0)
	return
Russ Cox's avatar
Russ Cox committed
626 627 628
}

func Getuid() (uid int) {
629 630 631
	r0, _, _ := Syscall(SYS_GETUID, 0, 0, 0)
	uid = int(r0)
	return
Russ Cox's avatar
Russ Cox committed
632 633
}

Russ Cox's avatar
Russ Cox committed
634
func Ioperm(from int, num int, on int) (errno int) {
635 636 637
	_, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on))
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
638 639 640
}

func Iopl(level int) (errno int) {
641 642 643
	_, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
644 645
}

Russ Cox's avatar
Russ Cox committed
646
func Lchown(path string, uid int, gid int) (errno int) {
647 648 649
	_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
650 651 652
}

func Listen(s int, n int) (errno int) {
653 654 655
	_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
656 657 658
}

func Lstat(path string, stat *Stat_t) (errno int) {
659 660 661
	_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
662 663 664
}

func Seek(fd int, offset int64, whence int) (off int64, errno int) {
665 666 667 668
	r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))
	off = int64(r0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
669 670
}

671
func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, errno int) {
672 673 674 675
	r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
	n = int(r0)
	errno = int(e1)
	return
676 677
}

Russ Cox's avatar
Russ Cox committed
678
func Setfsgid(gid int) (errno int) {
679 680 681
	_, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
682 683 684
}

func Setfsuid(uid int) (errno int) {
685 686 687
	_, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
688 689 690
}

func Setgid(gid int) (errno int) {
691 692 693
	_, _, e1 := Syscall(SYS_SETGID, uintptr(gid), 0, 0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
694 695 696
}

func Setregid(rgid int, egid int) (errno int) {
697 698 699
	_, _, e1 := Syscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
700 701 702
}

func Setresgid(rgid int, egid int, sgid int) (errno int) {
703 704 705
	_, _, e1 := Syscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
706 707 708
}

func Setresuid(ruid int, euid int, suid int) (errno int) {
709 710 711
	_, _, e1 := Syscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
712 713 714
}

func Setreuid(ruid int, euid int) (errno int) {
715 716 717
	_, _, e1 := Syscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
718 719 720
}

func Shutdown(fd int, how int) (errno int) {
721 722 723
	_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
724 725 726
}

func Stat(path string, stat *Stat_t) (errno int) {
727 728 729
	_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
730 731 732
}

func Statfs(path string, buf *Statfs_t) (errno int) {
733 734 735
	_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(buf)), 0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
736 737
}

Russ Cox's avatar
Russ Cox committed
738
func SyncFileRange(fd int, off int64, n int64, flags int) (errno int) {
739 740 741
	_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
742 743
}

744
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) {
745 746 747 748
	r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
	fd = int(r0)
	errno = int(e1)
	return
749 750 751
}

func bind(s int, addr uintptr, addrlen _Socklen) (errno int) {
752 753 754
	_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
	errno = int(e1)
	return
755 756 757
}

func connect(s int, addr uintptr, addrlen _Socklen) (errno int) {
758 759 760
	_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
	errno = int(e1)
	return
761 762
}

Russ Cox's avatar
Russ Cox committed
763
func getgroups(n int, list *_Gid_t) (nn int, errno int) {
764 765 766 767
	r0, _, e1 := Syscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
	nn = int(r0)
	errno = int(e1)
	return
768 769
}

Russ Cox's avatar
Russ Cox committed
770
func setgroups(n int, list *_Gid_t) (errno int) {
771 772 773
	_, _, e1 := Syscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
	errno = int(e1)
	return
774 775
}

Russ Cox's avatar
Russ Cox committed
776
func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) {
777 778 779
	_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
	errno = int(e1)
	return
780 781
}

Russ Cox's avatar
Russ Cox committed
782
func socket(domain int, typ int, proto int) (fd int, errno int) {
783 784 785 786
	r0, _, e1 := Syscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
	fd = int(r0)
	errno = int(e1)
	return
787 788
}

Ivan Krasin's avatar
Ivan Krasin committed
789 790 791 792 793 794 795 796
func socketpair(domain int, typ int, proto int) (fd [2]int, errno int) {
	var f [2]int
	_, _, e1 := Syscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(&f)), 0, 0)
	fd = f
	errno = int(e1)
	return
}

797
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
798 799 800
	_, _, e1 := Syscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
	errno = int(e1)
	return
801 802 803
}

func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
804 805 806
	_, _, e1 := Syscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
	errno = int(e1)
	return
807
}
Russ Cox's avatar
Russ Cox committed
808 809

func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
810
	var _p0 *byte
Russ Cox's avatar
Russ Cox committed
811
	if len(p) > 0 {
812
		_p0 = &p[0]
Russ Cox's avatar
Russ Cox committed
813
	}
814 815 816 817
	r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
	n = int(r0)
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
818 819 820
}

func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) {
821
	var _p0 *byte
Russ Cox's avatar
Russ Cox committed
822
	if len(buf) > 0 {
823
		_p0 = &buf[0]
Russ Cox's avatar
Russ Cox committed
824
	}
825 826 827
	_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
	errno = int(e1)
	return
Russ Cox's avatar
Russ Cox committed
828
}