zsyscall_linux_arm.go 39.7 KB
Newer Older
1
// mksyscall.pl -l32 -arm -tags linux,arm syscall_linux.go syscall_linux_arm.go
2
// Code generated by the command above; DO NOT EDIT.
3

4
// +build linux,arm
5

6 7 8 9
package syscall

import "unsafe"

10 11
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
func faccessat(dirfd int, path string, mode uint32) (err error) {
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	_, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
	if e1 != 0 {
		err = errnoErr(e1)
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
func fchmodat(dirfd int, path string, mode uint32) (err error) {
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	_, _, e1 := Syscall(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
	if e1 != 0 {
		err = errnoErr(e1)
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

42
func linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
43
	var _p0 *byte
44
	_p0, err = BytePtrFromString(oldpath)
45 46 47
	if err != nil {
		return
	}
48 49 50 51 52 53
	var _p1 *byte
	_p1, err = BytePtrFromString(newpath)
	if err != nil {
		return
	}
	_, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
Russ Cox's avatar
Russ Cox committed
54
	if e1 != 0 {
55
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
56
	}
57 58 59
	return
}

60 61
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
62
func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {
63 64 65 66 67 68
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)
69
	fd = int(r0)
Russ Cox's avatar
Russ Cox committed
70
	if e1 != 0 {
71
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
72
	}
73 74 75
	return
}

76 77
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
func readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	var _p1 unsafe.Pointer
	if len(buf) > 0 {
		_p1 = unsafe.Pointer(&buf[0])
	} else {
		_p1 = unsafe.Pointer(&_zero)
	}
	r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
	n = int(r0)
	if e1 != 0 {
93
		err = errnoErr(e1)
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

func symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
	var _p0 *byte
	_p0, err = BytePtrFromString(oldpath)
	if err != nil {
		return
	}
	var _p1 *byte
	_p1, err = BytePtrFromString(newpath)
	if err != nil {
		return
	}
	_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
	if e1 != 0 {
113
		err = errnoErr(e1)
114 115 116 117 118 119 120 121 122 123 124 125 126 127
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

func unlinkat(dirfd int, path string, flags int) (err error) {
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
	if e1 != 0 {
128
		err = errnoErr(e1)
129 130 131 132 133 134
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
135
func utimes(path string, times *[2]Timeval) (err error) {
136 137 138 139 140 141
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
Russ Cox's avatar
Russ Cox committed
142
	if e1 != 0 {
143
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
144
	}
145
	return
146 147
}

148 149
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

150
func utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error) {
151 152 153 154 155
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
156
	_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flag), 0, 0)
157
	if e1 != 0 {
158
		err = errnoErr(e1)
159 160 161 162 163 164
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
165
func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) {
166
	_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)))
Russ Cox's avatar
Russ Cox committed
167
	if e1 != 0 {
168
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
169
	}
170
	return
171 172
}

173 174
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
175
func Getcwd(buf []byte) (n int, err error) {
176
	var _p0 unsafe.Pointer
177
	if len(buf) > 0 {
178
		_p0 = unsafe.Pointer(&buf[0])
179 180
	} else {
		_p0 = unsafe.Pointer(&_zero)
181
	}
182
	r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)
183
	n = int(r0)
Russ Cox's avatar
Russ Cox committed
184
	if e1 != 0 {
185
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
186
	}
187
	return
188 189
}

190 191
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
192
func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
193 194
	r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
	wpid = int(r0)
Russ Cox's avatar
Russ Cox committed
195
	if e1 != 0 {
196
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
197
	}
198
	return
199 200
}

201 202
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
203
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
204
	_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
Russ Cox's avatar
Russ Cox committed
205
	if e1 != 0 {
206
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
207
	}
208
	return
209 210
}

211 212
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
213
func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {
214 215 216 217 218 219
	var _p0 *byte
	_p0, err = BytePtrFromString(arg)
	if err != nil {
		return
	}
	_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)
Russ Cox's avatar
Russ Cox committed
220
	if e1 != 0 {
221
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
222
	}
223 224 225 226 227
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
228
func mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
	var _p0 *byte
	_p0, err = BytePtrFromString(source)
	if err != nil {
		return
	}
	var _p1 *byte
	_p1, err = BytePtrFromString(target)
	if err != nil {
		return
	}
	var _p2 *byte
	_p2, err = BytePtrFromString(fstype)
	if err != nil {
		return
	}
	_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)
Russ Cox's avatar
Russ Cox committed
245
	if e1 != 0 {
246
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
247
	}
248 249 250 251 252
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
253
func Acct(path string) (err error) {
254 255 256 257 258 259
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)
Russ Cox's avatar
Russ Cox committed
260
	if e1 != 0 {
261
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
262
	}
263
	return
264 265
}

266 267
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
268
func Adjtimex(buf *Timex) (state int, err error) {
269 270
	r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
	state = int(r0)
Russ Cox's avatar
Russ Cox committed
271
	if e1 != 0 {
272
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
273
	}
274
	return
275 276
}

277 278
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
279
func Chdir(path string) (err error) {
280 281 282 283 284 285
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
Russ Cox's avatar
Russ Cox committed
286
	if e1 != 0 {
287
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
288
	}
289
	return
290 291
}

292 293
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
294
func Chroot(path string) (err error) {
295 296 297 298 299 300
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
Russ Cox's avatar
Russ Cox committed
301
	if e1 != 0 {
302
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
303
	}
304
	return
305 306
}

307 308
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
309
func Close(fd int) (err error) {
310
	_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
Russ Cox's avatar
Russ Cox committed
311
	if e1 != 0 {
312
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
313
	}
314
	return
315 316
}

317 318
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
319
func Dup(oldfd int) (fd int, err error) {
320
	r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
321
	fd = int(r0)
Russ Cox's avatar
Russ Cox committed
322
	if e1 != 0 {
323
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
324
	}
325
	return
326 327
}

328 329
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

330
func Dup3(oldfd int, newfd int, flags int) (err error) {
331
	_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
332
	if e1 != 0 {
333
		err = errnoErr(e1)
334 335 336 337 338 339
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
340
func EpollCreate(size int) (fd int, err error) {
341
	r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
342
	fd = int(r0)
Russ Cox's avatar
Russ Cox committed
343
	if e1 != 0 {
344
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
345
	}
346
	return
347 348
}

349 350
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

351 352 353 354
func EpollCreate1(flag int) (fd int, err error) {
	r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
	fd = int(r0)
	if e1 != 0 {
355
		err = errnoErr(e1)
356 357 358 359 360 361
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
362
func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
363
	_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)
Russ Cox's avatar
Russ Cox committed
364
	if e1 != 0 {
365
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
366
	}
367
	return
368 369
}

370 371
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
372
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
373
	_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32))
Russ Cox's avatar
Russ Cox committed
374
	if e1 != 0 {
375
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
376
	}
377
	return
378 379
}

380 381
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
382
func Fchdir(fd int) (err error) {
383
	_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
Russ Cox's avatar
Russ Cox committed
384
	if e1 != 0 {
385
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
386
	}
387
	return
388 389
}

390 391
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
392
func Fchmod(fd int, mode uint32) (err error) {
393
	_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
Russ Cox's avatar
Russ Cox committed
394
	if e1 != 0 {
395
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
396
	}
397
	return
398 399
}

400 401
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
402
func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
403 404 405 406 407 408
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
Russ Cox's avatar
Russ Cox committed
409
	if e1 != 0 {
410
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
411
	}
412
	return
413 414
}

415 416
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
417
func fcntl(fd int, cmd int, arg int) (val int, err error) {
418 419
	r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
	val = int(r0)
Russ Cox's avatar
Russ Cox committed
420
	if e1 != 0 {
421
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
422
	}
423
	return
424 425
}

426 427
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
428
func Fdatasync(fd int) (err error) {
429
	_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)
Russ Cox's avatar
Russ Cox committed
430
	if e1 != 0 {
431
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
432
	}
433
	return
434 435
}

436 437
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
438
func Flock(fd int, how int) (err error) {
Russ Cox's avatar
Russ Cox committed
439
	_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
Russ Cox's avatar
Russ Cox committed
440
	if e1 != 0 {
441
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
442
	}
Russ Cox's avatar
Russ Cox committed
443 444 445 446 447
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
448
func Fsync(fd int) (err error) {
449
	_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
Russ Cox's avatar
Russ Cox committed
450
	if e1 != 0 {
451
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
452
	}
453
	return
454 455
}

456 457
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
458
func Getdents(fd int, buf []byte) (n int, err error) {
459
	var _p0 unsafe.Pointer
460
	if len(buf) > 0 {
461
		_p0 = unsafe.Pointer(&buf[0])
462 463
	} else {
		_p0 = unsafe.Pointer(&_zero)
464
	}
465
	r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
466
	n = int(r0)
Russ Cox's avatar
Russ Cox committed
467
	if e1 != 0 {
468
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
469
	}
470
	return
471 472
}

473 474
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
475
func Getpgid(pid int) (pgid int, err error) {
476
	r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
477
	pgid = int(r0)
Russ Cox's avatar
Russ Cox committed
478
	if e1 != 0 {
479
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
480
	}
481
	return
482 483
}

484 485
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

486
func Getpid() (pid int) {
487
	r0, _ := rawSyscallNoError(SYS_GETPID, 0, 0, 0)
488 489
	pid = int(r0)
	return
490 491
}

492 493
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

494
func Getppid() (ppid int) {
495
	r0, _ := rawSyscallNoError(SYS_GETPPID, 0, 0, 0)
496 497
	ppid = int(r0)
	return
498 499
}

500 501
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

502 503 504 505
func Getpriority(which int, who int) (prio int, err error) {
	r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
	prio = int(r0)
	if e1 != 0 {
506
		err = errnoErr(e1)
507 508 509 510 511 512
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
513
func Getrusage(who int, rusage *Rusage) (err error) {
514
	_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
Russ Cox's avatar
Russ Cox committed
515
	if e1 != 0 {
516
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
517
	}
518
	return
519 520
}

521 522
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

523
func Gettid() (tid int) {
524
	r0, _ := rawSyscallNoError(SYS_GETTID, 0, 0, 0)
525 526
	tid = int(r0)
	return
527 528
}

529 530
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550
func Getxattr(path string, attr string, dest []byte) (sz int, err error) {
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	var _p1 *byte
	_p1, err = BytePtrFromString(attr)
	if err != nil {
		return
	}
	var _p2 unsafe.Pointer
	if len(dest) > 0 {
		_p2 = unsafe.Pointer(&dest[0])
	} else {
		_p2 = unsafe.Pointer(&_zero)
	}
	r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
	sz = int(r0)
	if e1 != 0 {
551
		err = errnoErr(e1)
552 553 554 555 556 557
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
558
func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {
559 560 561 562 563 564
	var _p0 *byte
	_p0, err = BytePtrFromString(pathname)
	if err != nil {
		return
	}
	r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask))
Balazs Lecz's avatar
Balazs Lecz committed
565
	watchdesc = int(r0)
Russ Cox's avatar
Russ Cox committed
566
	if e1 != 0 {
567
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
568
	}
Balazs Lecz's avatar
Balazs Lecz committed
569 570 571
	return
}

572 573
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
574
func InotifyInit1(flags int) (fd int, err error) {
575
	r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)
Balazs Lecz's avatar
Balazs Lecz committed
576
	fd = int(r0)
Russ Cox's avatar
Russ Cox committed
577
	if e1 != 0 {
578
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
579
	}
Balazs Lecz's avatar
Balazs Lecz committed
580 581 582
	return
}

583 584
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
585
func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {
586
	r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)
Balazs Lecz's avatar
Balazs Lecz committed
587
	success = int(r0)
Russ Cox's avatar
Russ Cox committed
588
	if e1 != 0 {
589
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
590
	}
Balazs Lecz's avatar
Balazs Lecz committed
591 592 593
	return
}

594 595
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

596
func Kill(pid int, sig Signal) (err error) {
597
	_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)
Russ Cox's avatar
Russ Cox committed
598
	if e1 != 0 {
599
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
600
	}
601
	return
602 603
}

604 605
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
606
func Klogctl(typ int, buf []byte) (n int, err error) {
607
	var _p0 unsafe.Pointer
608
	if len(buf) > 0 {
609
		_p0 = unsafe.Pointer(&buf[0])
610 611
	} else {
		_p0 = unsafe.Pointer(&_zero)
612
	}
613
	r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))
614
	n = int(r0)
Russ Cox's avatar
Russ Cox committed
615
	if e1 != 0 {
616
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
617
	}
618
	return
619 620
}

621 622
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

623 624 625 626 627 628 629 630 631 632 633 634 635 636 637
func Listxattr(path string, dest []byte) (sz int, err error) {
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	var _p1 unsafe.Pointer
	if len(dest) > 0 {
		_p1 = unsafe.Pointer(&dest[0])
	} else {
		_p1 = unsafe.Pointer(&_zero)
	}
	r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
	sz = int(r0)
	if e1 != 0 {
638
		err = errnoErr(e1)
639 640 641 642 643 644
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
645
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
646 647 648 649 650 651
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
Russ Cox's avatar
Russ Cox committed
652
	if e1 != 0 {
653
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
654
	}
655
	return
656 657
}

658 659
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
660
func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
661 662 663 664 665 666
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
Russ Cox's avatar
Russ Cox committed
667
	if e1 != 0 {
668
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
669
	}
670
	return
671 672
}

673 674
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
675
func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
676
	_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
Russ Cox's avatar
Russ Cox committed
677
	if e1 != 0 {
678
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
679
	}
680
	return
681 682
}

683 684
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
685
func Pause() (err error) {
686
	_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
Russ Cox's avatar
Russ Cox committed
687
	if e1 != 0 {
688
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
689
	}
690
	return
691 692
}

693 694
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
695
func PivotRoot(newroot string, putold string) (err error) {
696 697 698 699 700 701 702 703 704 705 706
	var _p0 *byte
	_p0, err = BytePtrFromString(newroot)
	if err != nil {
		return
	}
	var _p1 *byte
	_p1, err = BytePtrFromString(putold)
	if err != nil {
		return
	}
	_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
Russ Cox's avatar
Russ Cox committed
707
	if e1 != 0 {
708
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
709
	}
710
	return
711 712
}

713
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
714

715 716
func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
	_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
717
	if e1 != 0 {
718
		err = errnoErr(e1)
719 720 721 722 723 724
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Dmitriy Vyukov's avatar
Dmitriy Vyukov committed
725
func read(fd int, p []byte) (n int, err error) {
726
	var _p0 unsafe.Pointer
727
	if len(p) > 0 {
728
		_p0 = unsafe.Pointer(&p[0])
729 730
	} else {
		_p0 = unsafe.Pointer(&_zero)
731
	}
732
	r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
733
	n = int(r0)
Russ Cox's avatar
Russ Cox committed
734
	if e1 != 0 {
735
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
736
	}
737
	return
738 739
}

740 741
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

742 743 744 745 746 747 748 749 750 751 752 753 754
func Removexattr(path string, attr string) (err error) {
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	var _p1 *byte
	_p1, err = BytePtrFromString(attr)
	if err != nil {
		return
	}
	_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
	if e1 != 0 {
755
		err = errnoErr(e1)
756 757 758 759 760 761
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
762
func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {
763 764 765 766 767 768 769 770 771 772 773
	var _p0 *byte
	_p0, err = BytePtrFromString(oldpath)
	if err != nil {
		return
	}
	var _p1 *byte
	_p1, err = BytePtrFromString(newpath)
	if err != nil {
		return
	}
	_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)
Russ Cox's avatar
Russ Cox committed
774
	if e1 != 0 {
775
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
776
	}
777
	return
778 779
}

780 781
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
782
func Setdomainname(p []byte) (err error) {
783
	var _p0 unsafe.Pointer
784
	if len(p) > 0 {
785
		_p0 = unsafe.Pointer(&p[0])
786 787
	} else {
		_p0 = unsafe.Pointer(&_zero)
788
	}
789
	_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)
Russ Cox's avatar
Russ Cox committed
790
	if e1 != 0 {
791
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
792
	}
793
	return
794 795
}

796 797
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
798
func Sethostname(p []byte) (err error) {
799
	var _p0 unsafe.Pointer
800
	if len(p) > 0 {
801
		_p0 = unsafe.Pointer(&p[0])
802 803
	} else {
		_p0 = unsafe.Pointer(&_zero)
804
	}
805
	_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)
Russ Cox's avatar
Russ Cox committed
806
	if e1 != 0 {
807
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
808
	}
809
	return
810 811
}

812 813
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
814
func Setpgid(pid int, pgid int) (err error) {
815
	_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
Russ Cox's avatar
Russ Cox committed
816
	if e1 != 0 {
817
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
818
	}
819
	return
820 821
}

822 823
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
824
func Setsid() (pid int, err error) {
825
	r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
826
	pid = int(r0)
Russ Cox's avatar
Russ Cox committed
827
	if e1 != 0 {
828
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
829
	}
830
	return
831 832
}

833 834
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
835
func Settimeofday(tv *Timeval) (err error) {
836
	_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
Russ Cox's avatar
Russ Cox committed
837
	if e1 != 0 {
838
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
839
	}
840
	return
841 842
}

843 844
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

845 846 847
func Setpriority(which int, who int, prio int) (err error) {
	_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
	if e1 != 0 {
848
		err = errnoErr(e1)
849 850 851 852 853 854
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873
func Setxattr(path string, attr string, data []byte, flags int) (err error) {
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	var _p1 *byte
	_p1, err = BytePtrFromString(attr)
	if err != nil {
		return
	}
	var _p2 unsafe.Pointer
	if len(data) > 0 {
		_p2 = unsafe.Pointer(&data[0])
	} else {
		_p2 = unsafe.Pointer(&_zero)
	}
	_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
	if e1 != 0 {
874
		err = errnoErr(e1)
875 876 877 878 879 880
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

881
func Sync() {
882 883
	Syscall(SYS_SYNC, 0, 0, 0)
	return
884 885
}

886 887
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
888
func Sysinfo(info *Sysinfo_t) (err error) {
889
	_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)
Russ Cox's avatar
Russ Cox committed
890
	if e1 != 0 {
891
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
892
	}
893
	return
894 895
}

896 897
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
898
func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
899
	r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)
900
	n = int64(int64(r1)<<32 | int64(r0))
Russ Cox's avatar
Russ Cox committed
901
	if e1 != 0 {
902
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
903
	}
904
	return
905 906
}

907 908
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

909
func Tgkill(tgid int, tid int, sig Signal) (err error) {
910
	_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))
Russ Cox's avatar
Russ Cox committed
911
	if e1 != 0 {
912
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
913
	}
914
	return
915 916
}

917 918
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
919
func Times(tms *Tms) (ticks uintptr, err error) {
920
	r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)
921
	ticks = uintptr(r0)
Russ Cox's avatar
Russ Cox committed
922
	if e1 != 0 {
923
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
924
	}
925
	return
926 927
}

928 929
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

930
func Umask(mask int) (oldmask int) {
931
	r0, _ := rawSyscallNoError(SYS_UMASK, uintptr(mask), 0, 0)
932 933
	oldmask = int(r0)
	return
934 935
}

936 937
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
938
func Uname(buf *Utsname) (err error) {
939
	_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)
Russ Cox's avatar
Russ Cox committed
940
	if e1 != 0 {
941
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
942
	}
943
	return
944 945
}

946 947
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
948
func Unmount(target string, flags int) (err error) {
949 950 951 952 953 954
	var _p0 *byte
	_p0, err = BytePtrFromString(target)
	if err != nil {
		return
	}
	_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
Russ Cox's avatar
Russ Cox committed
955
	if e1 != 0 {
956
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
957
	}
958 959 960 961 962
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
963
func Unshare(flags int) (err error) {
964
	_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)
Russ Cox's avatar
Russ Cox committed
965
	if e1 != 0 {
966
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
967
	}
968
	return
969 970
}

971 972
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
973
func Ustat(dev int, ubuf *Ustat_t) (err error) {
974
	_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
Russ Cox's avatar
Russ Cox committed
975
	if e1 != 0 {
976
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
977
	}
978
	return
979 980
}

981 982
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
983
func Utime(path string, buf *Utimbuf) (err error) {
984 985 986 987 988 989
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)
Russ Cox's avatar
Russ Cox committed
990
	if e1 != 0 {
991
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
992
	}
993
	return
994 995
}

996 997
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Dmitriy Vyukov's avatar
Dmitriy Vyukov committed
998
func write(fd int, p []byte) (n int, err error) {
999
	var _p0 unsafe.Pointer
1000
	if len(p) > 0 {
1001
		_p0 = unsafe.Pointer(&p[0])
1002 1003
	} else {
		_p0 = unsafe.Pointer(&_zero)
1004
	}
1005
	r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
1006
	n = int(r0)
Russ Cox's avatar
Russ Cox committed
1007
	if e1 != 0 {
1008
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1009
	}
1010
	return
1011 1012
}

1013 1014
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1015
func exitThread(code int) (err error) {
1016
	_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)
Russ Cox's avatar
Russ Cox committed
1017
	if e1 != 0 {
1018
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1019
	}
1020
	return
1021 1022
}

1023 1024
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Dmitriy Vyukov's avatar
Dmitriy Vyukov committed
1025
func readlen(fd int, p *byte, np int) (n int, err error) {
1026 1027
	r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
	n = int(r0)
Russ Cox's avatar
Russ Cox committed
1028
	if e1 != 0 {
1029
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1030
	}
1031
	return
1032 1033
}

1034 1035
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Dmitriy Vyukov's avatar
Dmitriy Vyukov committed
1036
func writelen(fd int, p *byte, np int) (n int, err error) {
1037 1038
	r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
	n = int(r0)
Russ Cox's avatar
Russ Cox committed
1039
	if e1 != 0 {
1040
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1041
	}
1042
	return
1043 1044
}

1045 1046
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1047
func munmap(addr uintptr, length uintptr) (err error) {
1048
	_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
Russ Cox's avatar
Russ Cox committed
1049
	if e1 != 0 {
1050
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1051
	}
1052 1053 1054 1055 1056
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1057
func Madvise(b []byte, advice int) (err error) {
1058 1059 1060 1061 1062 1063 1064
	var _p0 unsafe.Pointer
	if len(b) > 0 {
		_p0 = unsafe.Pointer(&b[0])
	} else {
		_p0 = unsafe.Pointer(&_zero)
	}
	_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))
Russ Cox's avatar
Russ Cox committed
1065
	if e1 != 0 {
1066
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1067
	}
1068 1069 1070 1071 1072
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1073
func Mprotect(b []byte, prot int) (err error) {
1074 1075 1076 1077 1078 1079 1080
	var _p0 unsafe.Pointer
	if len(b) > 0 {
		_p0 = unsafe.Pointer(&b[0])
	} else {
		_p0 = unsafe.Pointer(&_zero)
	}
	_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
Russ Cox's avatar
Russ Cox committed
1081
	if e1 != 0 {
1082
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1083
	}
1084 1085 1086 1087 1088
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1089
func Mlock(b []byte) (err error) {
1090 1091 1092 1093 1094 1095 1096
	var _p0 unsafe.Pointer
	if len(b) > 0 {
		_p0 = unsafe.Pointer(&b[0])
	} else {
		_p0 = unsafe.Pointer(&_zero)
	}
	_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
Russ Cox's avatar
Russ Cox committed
1097
	if e1 != 0 {
1098
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1099
	}
1100 1101 1102 1103 1104
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1105
func Munlock(b []byte) (err error) {
1106 1107 1108 1109 1110 1111 1112
	var _p0 unsafe.Pointer
	if len(b) > 0 {
		_p0 = unsafe.Pointer(&b[0])
	} else {
		_p0 = unsafe.Pointer(&_zero)
	}
	_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
Russ Cox's avatar
Russ Cox committed
1113
	if e1 != 0 {
1114
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1115
	}
1116 1117 1118 1119 1120
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1121
func Mlockall(flags int) (err error) {
1122
	_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
Russ Cox's avatar
Russ Cox committed
1123
	if e1 != 0 {
1124
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1125
	}
1126 1127 1128 1129 1130
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1131
func Munlockall() (err error) {
1132
	_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
Russ Cox's avatar
Russ Cox committed
1133
	if e1 != 0 {
1134
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1135
	}
1136 1137 1138 1139 1140
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1141 1142 1143 1144 1145 1146 1147 1148 1149 1150
func pipe(p *[2]_C_int) (err error) {
	_, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
	if e1 != 0 {
		err = errnoErr(e1)
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1151 1152 1153
func pipe2(p *[2]_C_int, flags int) (err error) {
	_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
	if e1 != 0 {
1154
		err = errnoErr(e1)
1155 1156 1157 1158 1159 1160
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1161
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
1162 1163
	r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
	fd = int(r0)
Russ Cox's avatar
Russ Cox committed
1164
	if e1 != 0 {
1165
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1166
	}
1167
	return
1168 1169
}

1170 1171
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1172 1173 1174 1175
func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {
	r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)
	fd = int(r0)
	if e1 != 0 {
1176
		err = errnoErr(e1)
1177 1178 1179 1180 1181 1182
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1183
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
1184
	_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
Russ Cox's avatar
Russ Cox committed
1185
	if e1 != 0 {
1186
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1187
	}
1188
	return
1189 1190
}

1191 1192
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1193
func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
1194
	_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
Russ Cox's avatar
Russ Cox committed
1195
	if e1 != 0 {
1196
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1197
	}
1198
	return
1199 1200
}

1201 1202
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1203
func getgroups(n int, list *_Gid_t) (nn int, err error) {
1204
	r0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
1205
	nn = int(r0)
Russ Cox's avatar
Russ Cox committed
1206
	if e1 != 0 {
1207
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1208
	}
1209
	return
1210 1211
}

1212 1213
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1214
func setgroups(n int, list *_Gid_t) (err error) {
1215
	_, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
Russ Cox's avatar
Russ Cox committed
1216
	if e1 != 0 {
1217
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1218
	}
1219
	return
1220 1221
}

1222 1223
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1224
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
Albert Strasheim's avatar
Albert Strasheim committed
1225
	_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
Russ Cox's avatar
Russ Cox committed
1226
	if e1 != 0 {
1227
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1228
	}
Albert Strasheim's avatar
Albert Strasheim committed
1229 1230 1231 1232 1233
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1234
func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
1235
	_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
Russ Cox's avatar
Russ Cox committed
1236
	if e1 != 0 {
1237
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1238
	}
1239
	return
1240 1241
}

1242 1243
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1244
func socket(domain int, typ int, proto int) (fd int, err error) {
1245
	r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
1246
	fd = int(r0)
Russ Cox's avatar
Russ Cox committed
1247
	if e1 != 0 {
1248
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1249
	}
1250
	return
1251 1252
}

1253 1254
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1255
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
1256
	_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
Russ Cox's avatar
Russ Cox committed
1257
	if e1 != 0 {
1258
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1259
	}
1260
	return
1261 1262
}

1263 1264
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1265
func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
1266
	_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
Russ Cox's avatar
Russ Cox committed
1267
	if e1 != 0 {
1268
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1269
	}
1270
	return
1271 1272
}

1273 1274
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1275
func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
1276
	var _p0 unsafe.Pointer
1277
	if len(p) > 0 {
1278
		_p0 = unsafe.Pointer(&p[0])
1279 1280
	} else {
		_p0 = unsafe.Pointer(&_zero)
1281
	}
1282
	r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
1283
	n = int(r0)
Russ Cox's avatar
Russ Cox committed
1284
	if e1 != 0 {
1285
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1286
	}
1287
	return
1288 1289
}

1290 1291
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1292
func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
1293
	var _p0 unsafe.Pointer
1294
	if len(buf) > 0 {
1295
		_p0 = unsafe.Pointer(&buf[0])
1296 1297
	} else {
		_p0 = unsafe.Pointer(&_zero)
1298
	}
1299
	_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
Russ Cox's avatar
Russ Cox committed
1300
	if e1 != 0 {
1301
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1302
	}
1303
	return
1304 1305
}

1306 1307
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1308
func socketpair(domain int, typ int, flags int, fd *[2]int32) (err error) {
1309
	_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0)
Russ Cox's avatar
Russ Cox committed
1310
	if e1 != 0 {
1311
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1312
	}
1313 1314 1315
	return
}

1316 1317
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1318
func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
Russ Cox's avatar
Russ Cox committed
1319 1320
	r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
	n = int(r0)
Russ Cox's avatar
Russ Cox committed
1321
	if e1 != 0 {
1322
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1323
	}
Russ Cox's avatar
Russ Cox committed
1324 1325 1326 1327 1328
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1329 1330 1331
func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
	r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
	n = int(r0)
Russ Cox's avatar
Russ Cox committed
1332
	if e1 != 0 {
1333
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1334
	}
Russ Cox's avatar
Russ Cox committed
1335 1336 1337 1338 1339
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1340
func Dup2(oldfd int, newfd int) (err error) {
1341
	_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
1342
	if e1 != 0 {
1343
		err = errnoErr(e1)
1344 1345 1346 1347 1348 1349
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1350
func Fchown(fd int, uid int, gid int) (err error) {
Shenghou Ma's avatar
Shenghou Ma committed
1351
	_, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid))
Russ Cox's avatar
Russ Cox committed
1352
	if e1 != 0 {
1353
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1354
	}
1355
	return
1356 1357
}

1358 1359
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1360
func Fstat(fd int, stat *Stat_t) (err error) {
1361
	_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
Russ Cox's avatar
Russ Cox committed
1362
	if e1 != 0 {
1363
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1364
	}
1365
	return
1366 1367
}

1368
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383

func fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) {
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	_, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
	if e1 != 0 {
		err = errnoErr(e1)
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
1384

1385
func Getegid() (egid int) {
1386
	r0, _ := rawSyscallNoError(SYS_GETEGID32, 0, 0, 0)
1387 1388
	egid = int(r0)
	return
1389 1390
}

1391 1392
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1393
func Geteuid() (euid int) {
1394
	r0, _ := rawSyscallNoError(SYS_GETEUID32, 0, 0, 0)
1395 1396
	euid = int(r0)
	return
1397 1398
}

1399 1400
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1401
func Getgid() (gid int) {
1402
	r0, _ := rawSyscallNoError(SYS_GETGID32, 0, 0, 0)
1403 1404
	gid = int(r0)
	return
1405 1406
}

1407 1408
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1409
func Getuid() (uid int) {
1410
	r0, _ := rawSyscallNoError(SYS_GETUID32, 0, 0, 0)
1411 1412
	uid = int(r0)
	return
1413 1414
}

1415 1416
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427
func InotifyInit() (fd int, err error) {
	r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0)
	fd = int(r0)
	if e1 != 0 {
		err = errnoErr(e1)
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1428
func Listen(s int, n int) (err error) {
1429
	_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)
Russ Cox's avatar
Russ Cox committed
1430
	if e1 != 0 {
1431
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1432
	}
1433
	return
1434 1435
}

1436 1437
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1438
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
Brad Fitzpatrick's avatar
Brad Fitzpatrick committed
1439 1440
	r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)
	written = int(r0)
Russ Cox's avatar
Russ Cox committed
1441
	if e1 != 0 {
1442
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1443
	}
Brad Fitzpatrick's avatar
Brad Fitzpatrick committed
1444 1445 1446 1447 1448
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1449
func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
1450 1451
	r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
	n = int(r0)
Russ Cox's avatar
Russ Cox committed
1452
	if e1 != 0 {
1453
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1454
	}
1455
	return
1456 1457
}

1458 1459
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1460
func Setfsgid(gid int) (err error) {
Shenghou Ma's avatar
Shenghou Ma committed
1461
	_, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0)
Russ Cox's avatar
Russ Cox committed
1462
	if e1 != 0 {
1463
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1464
	}
1465
	return
1466 1467
}

1468 1469
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1470
func Setfsuid(uid int) (err error) {
Shenghou Ma's avatar
Shenghou Ma committed
1471
	_, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0)
Russ Cox's avatar
Russ Cox committed
1472
	if e1 != 0 {
1473
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1474
	}
1475
	return
1476 1477
}

1478 1479
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1480
func Setregid(rgid int, egid int) (err error) {
Shenghou Ma's avatar
Shenghou Ma committed
1481
	_, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0)
Russ Cox's avatar
Russ Cox committed
1482
	if e1 != 0 {
1483
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1484
	}
1485
	return
1486 1487
}

1488 1489
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1490
func Setresgid(rgid int, egid int, sgid int) (err error) {
Shenghou Ma's avatar
Shenghou Ma committed
1491
	_, _, e1 := RawSyscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid))
Russ Cox's avatar
Russ Cox committed
1492
	if e1 != 0 {
1493
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1494
	}
1495
	return
1496 1497
}

1498 1499
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1500
func Setresuid(ruid int, euid int, suid int) (err error) {
Shenghou Ma's avatar
Shenghou Ma committed
1501
	_, _, e1 := RawSyscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid))
Russ Cox's avatar
Russ Cox committed
1502
	if e1 != 0 {
1503
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1504
	}
1505
	return
1506 1507
}

1508 1509
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1510
func Setreuid(ruid int, euid int) (err error) {
Shenghou Ma's avatar
Shenghou Ma committed
1511
	_, _, e1 := RawSyscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0)
Russ Cox's avatar
Russ Cox committed
1512
	if e1 != 0 {
1513
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1514
	}
1515
	return
1516 1517
}

1518 1519
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1520
func Shutdown(fd int, how int) (err error) {
1521
	_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)
Russ Cox's avatar
Russ Cox committed
1522
	if e1 != 0 {
1523
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1524
	}
1525
	return
1526 1527
}

1528 1529
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1530
func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
1531 1532
	r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
	n = int(r0)
Russ Cox's avatar
Russ Cox committed
1533
	if e1 != 0 {
1534
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1535
	}
1536 1537 1538 1539 1540
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1541
func Gettimeofday(tv *Timeval) (err error) {
1542
	_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
Russ Cox's avatar
Russ Cox committed
1543
	if e1 != 0 {
1544
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1545
	}
1546 1547 1548
	return
}

1549 1550
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1551
func Time(t *Time_t) (tt Time_t, err error) {
1552
	r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0)
1553
	tt = Time_t(r0)
Russ Cox's avatar
Russ Cox committed
1554
	if e1 != 0 {
1555
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1556
	}
1557 1558
	return
}
1559 1560 1561

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1562 1563 1564 1565 1566 1567 1568 1569 1570 1571
func Pread(fd int, p []byte, offset int64) (n int, err error) {
	var _p0 unsafe.Pointer
	if len(p) > 0 {
		_p0 = unsafe.Pointer(&p[0])
	} else {
		_p0 = unsafe.Pointer(&_zero)
	}
	r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
	n = int(r0)
	if e1 != 0 {
1572
		err = errnoErr(e1)
1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
	var _p0 unsafe.Pointer
	if len(p) > 0 {
		_p0 = unsafe.Pointer(&p[0])
	} else {
		_p0 = unsafe.Pointer(&_zero)
	}
	r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
	n = int(r0)
	if e1 != 0 {
1589
		err = errnoErr(e1)
1590 1591 1592 1593 1594 1595 1596
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

func Truncate(path string, length int64) (err error) {
1597 1598 1599 1600 1601 1602
	var _p0 *byte
	_p0, err = BytePtrFromString(path)
	if err != nil {
		return
	}
	_, _, e1 := Syscall6(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)
1603
	if e1 != 0 {
1604
		err = errnoErr(e1)
1605 1606 1607 1608 1609 1610 1611 1612 1613
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

func Ftruncate(fd int, length int64) (err error) {
	_, _, e1 := Syscall6(SYS_FTRUNCATE64, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)
	if e1 != 0 {
1614
		err = errnoErr(e1)
1615 1616 1617 1618 1619 1620
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

Russ Cox's avatar
Russ Cox committed
1621
func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) {
1622 1623
	r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset))
	xaddr = uintptr(r0)
Russ Cox's avatar
Russ Cox committed
1624
	if e1 != 0 {
1625
		err = errnoErr(e1)
Russ Cox's avatar
Russ Cox committed
1626
	}
1627 1628
	return
}
1629 1630 1631

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
	var _p0 unsafe.Pointer
	if len(events) > 0 {
		_p0 = unsafe.Pointer(&events[0])
	} else {
		_p0 = unsafe.Pointer(&_zero)
	}
	r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
	n = int(r0)
	if e1 != 0 {
		err = errnoErr(e1)
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

1649 1650 1651
func getrlimit(resource int, rlim *rlimit32) (err error) {
	_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
	if e1 != 0 {
1652
		err = errnoErr(e1)
1653 1654 1655 1656 1657 1658 1659 1660 1661
	}
	return
}

// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

func setrlimit(resource int, rlim *rlimit32) (err error) {
	_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
	if e1 != 0 {
1662
		err = errnoErr(e1)
1663 1664 1665
	}
	return
}