1
2
3
4
5
6 package unix
7
8 import (
9 "syscall"
10 "unsafe"
11 )
12
13 var _ syscall.Errno
14
15
16
17 func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
18 r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
19 n = int(r0)
20 if e1 != 0 {
21 err = errnoErr(e1)
22 }
23 return
24 }
25
26
27
28 func setgroups(ngid int, gid *_Gid_t) (err error) {
29 _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
30 if e1 != 0 {
31 err = errnoErr(e1)
32 }
33 return
34 }
35
36
37
38 func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
39 r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
40 wpid = int(r0)
41 if e1 != 0 {
42 err = errnoErr(e1)
43 }
44 return
45 }
46
47
48
49 func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
50 r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
51 fd = int(r0)
52 if e1 != 0 {
53 err = errnoErr(e1)
54 }
55 return
56 }
57
58
59
60 func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
61 _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
62 if e1 != 0 {
63 err = errnoErr(e1)
64 }
65 return
66 }
67
68
69
70 func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
71 _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
72 if e1 != 0 {
73 err = errnoErr(e1)
74 }
75 return
76 }
77
78
79
80 func socket(domain int, typ int, proto int) (fd int, err error) {
81 r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
82 fd = int(r0)
83 if e1 != 0 {
84 err = errnoErr(e1)
85 }
86 return
87 }
88
89
90
91 func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
92 _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
93 if e1 != 0 {
94 err = errnoErr(e1)
95 }
96 return
97 }
98
99
100
101 func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
102 _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
103 if e1 != 0 {
104 err = errnoErr(e1)
105 }
106 return
107 }
108
109
110
111 func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
112 _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
113 if e1 != 0 {
114 err = errnoErr(e1)
115 }
116 return
117 }
118
119
120
121 func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
122 _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
123 if e1 != 0 {
124 err = errnoErr(e1)
125 }
126 return
127 }
128
129
130
131 func Shutdown(s int, how int) (err error) {
132 _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
133 if e1 != 0 {
134 err = errnoErr(e1)
135 }
136 return
137 }
138
139
140
141 func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
142 _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
143 if e1 != 0 {
144 err = errnoErr(e1)
145 }
146 return
147 }
148
149
150
151 func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
152 var _p0 unsafe.Pointer
153 if len(p) > 0 {
154 _p0 = unsafe.Pointer(&p[0])
155 } else {
156 _p0 = unsafe.Pointer(&_zero)
157 }
158 r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
159 n = int(r0)
160 if e1 != 0 {
161 err = errnoErr(e1)
162 }
163 return
164 }
165
166
167
168 func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
169 var _p0 unsafe.Pointer
170 if len(buf) > 0 {
171 _p0 = unsafe.Pointer(&buf[0])
172 } else {
173 _p0 = unsafe.Pointer(&_zero)
174 }
175 _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
176 if e1 != 0 {
177 err = errnoErr(e1)
178 }
179 return
180 }
181
182
183
184 func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
185 r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
186 n = int(r0)
187 if e1 != 0 {
188 err = errnoErr(e1)
189 }
190 return
191 }
192
193
194
195 func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
196 r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
197 n = int(r0)
198 if e1 != 0 {
199 err = errnoErr(e1)
200 }
201 return
202 }
203
204
205
206 func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {
207 r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
208 n = int(r0)
209 if e1 != 0 {
210 err = errnoErr(e1)
211 }
212 return
213 }
214
215
216
217 func utimes(path string, timeval *[2]Timeval) (err error) {
218 var _p0 *byte
219 _p0, err = BytePtrFromString(path)
220 if err != nil {
221 return
222 }
223 _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
224 if e1 != 0 {
225 err = errnoErr(e1)
226 }
227 return
228 }
229
230
231
232 func futimes(fd int, timeval *[2]Timeval) (err error) {
233 _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
234 if e1 != 0 {
235 err = errnoErr(e1)
236 }
237 return
238 }
239
240
241
242 func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
243 r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
244 n = int(r0)
245 if e1 != 0 {
246 err = errnoErr(e1)
247 }
248 return
249 }
250
251
252
253 func Madvise(b []byte, behav int) (err error) {
254 var _p0 unsafe.Pointer
255 if len(b) > 0 {
256 _p0 = unsafe.Pointer(&b[0])
257 } else {
258 _p0 = unsafe.Pointer(&_zero)
259 }
260 _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav))
261 if e1 != 0 {
262 err = errnoErr(e1)
263 }
264 return
265 }
266
267
268
269 func Mlock(b []byte) (err error) {
270 var _p0 unsafe.Pointer
271 if len(b) > 0 {
272 _p0 = unsafe.Pointer(&b[0])
273 } else {
274 _p0 = unsafe.Pointer(&_zero)
275 }
276 _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
277 if e1 != 0 {
278 err = errnoErr(e1)
279 }
280 return
281 }
282
283
284
285 func Mlockall(flags int) (err error) {
286 _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
287 if e1 != 0 {
288 err = errnoErr(e1)
289 }
290 return
291 }
292
293
294
295 func Mprotect(b []byte, prot int) (err error) {
296 var _p0 unsafe.Pointer
297 if len(b) > 0 {
298 _p0 = unsafe.Pointer(&b[0])
299 } else {
300 _p0 = unsafe.Pointer(&_zero)
301 }
302 _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
303 if e1 != 0 {
304 err = errnoErr(e1)
305 }
306 return
307 }
308
309
310
311 func Msync(b []byte, flags int) (err error) {
312 var _p0 unsafe.Pointer
313 if len(b) > 0 {
314 _p0 = unsafe.Pointer(&b[0])
315 } else {
316 _p0 = unsafe.Pointer(&_zero)
317 }
318 _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags))
319 if e1 != 0 {
320 err = errnoErr(e1)
321 }
322 return
323 }
324
325
326
327 func Munlock(b []byte) (err error) {
328 var _p0 unsafe.Pointer
329 if len(b) > 0 {
330 _p0 = unsafe.Pointer(&b[0])
331 } else {
332 _p0 = unsafe.Pointer(&_zero)
333 }
334 _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
335 if e1 != 0 {
336 err = errnoErr(e1)
337 }
338 return
339 }
340
341
342
343 func Munlockall() (err error) {
344 _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
345 if e1 != 0 {
346 err = errnoErr(e1)
347 }
348 return
349 }
350
351
352
353 func pipe2(p *[2]_C_int, flags int) (err error) {
354 _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
355 if e1 != 0 {
356 err = errnoErr(e1)
357 }
358 return
359 }
360
361
362
363 func Getcwd(buf []byte) (n int, err error) {
364 var _p0 unsafe.Pointer
365 if len(buf) > 0 {
366 _p0 = unsafe.Pointer(&buf[0])
367 } else {
368 _p0 = unsafe.Pointer(&_zero)
369 }
370 r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0)
371 n = int(r0)
372 if e1 != 0 {
373 err = errnoErr(e1)
374 }
375 return
376 }
377
378
379
380 func ioctl(fd int, req uint, arg uintptr) (err error) {
381 _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
382 if e1 != 0 {
383 err = errnoErr(e1)
384 }
385 return
386 }
387
388
389
390 func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) {
391 _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
392 if e1 != 0 {
393 err = errnoErr(e1)
394 }
395 return
396 }
397
398
399
400 func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
401 var _p0 unsafe.Pointer
402 if len(mib) > 0 {
403 _p0 = unsafe.Pointer(&mib[0])
404 } else {
405 _p0 = unsafe.Pointer(&_zero)
406 }
407 _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
408 if e1 != 0 {
409 err = errnoErr(e1)
410 }
411 return
412 }
413
414
415
416 func ptrace(request int, pid int, addr uintptr, data int) (err error) {
417 _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
418 if e1 != 0 {
419 err = errnoErr(e1)
420 }
421 return
422 }
423
424
425
426 func ptracePtr(request int, pid int, addr unsafe.Pointer, data int) (err error) {
427 _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
428 if e1 != 0 {
429 err = errnoErr(e1)
430 }
431 return
432 }
433
434
435
436 func Access(path string, mode uint32) (err error) {
437 var _p0 *byte
438 _p0, err = BytePtrFromString(path)
439 if err != nil {
440 return
441 }
442 _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
443 if e1 != 0 {
444 err = errnoErr(e1)
445 }
446 return
447 }
448
449
450
451 func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
452 _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
453 if e1 != 0 {
454 err = errnoErr(e1)
455 }
456 return
457 }
458
459
460
461 func CapEnter() (err error) {
462 _, _, e1 := Syscall(SYS_CAP_ENTER, 0, 0, 0)
463 if e1 != 0 {
464 err = errnoErr(e1)
465 }
466 return
467 }
468
469
470
471 func capRightsGet(version int, fd int, rightsp *CapRights) (err error) {
472 _, _, e1 := Syscall(SYS___CAP_RIGHTS_GET, uintptr(version), uintptr(fd), uintptr(unsafe.Pointer(rightsp)))
473 if e1 != 0 {
474 err = errnoErr(e1)
475 }
476 return
477 }
478
479
480
481 func capRightsLimit(fd int, rightsp *CapRights) (err error) {
482 _, _, e1 := Syscall(SYS_CAP_RIGHTS_LIMIT, uintptr(fd), uintptr(unsafe.Pointer(rightsp)), 0)
483 if e1 != 0 {
484 err = errnoErr(e1)
485 }
486 return
487 }
488
489
490
491 func Chdir(path string) (err error) {
492 var _p0 *byte
493 _p0, err = BytePtrFromString(path)
494 if err != nil {
495 return
496 }
497 _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
498 if e1 != 0 {
499 err = errnoErr(e1)
500 }
501 return
502 }
503
504
505
506 func Chflags(path string, flags int) (err error) {
507 var _p0 *byte
508 _p0, err = BytePtrFromString(path)
509 if err != nil {
510 return
511 }
512 _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
513 if e1 != 0 {
514 err = errnoErr(e1)
515 }
516 return
517 }
518
519
520
521 func Chmod(path string, mode uint32) (err error) {
522 var _p0 *byte
523 _p0, err = BytePtrFromString(path)
524 if err != nil {
525 return
526 }
527 _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
528 if e1 != 0 {
529 err = errnoErr(e1)
530 }
531 return
532 }
533
534
535
536 func Chown(path string, uid int, gid int) (err error) {
537 var _p0 *byte
538 _p0, err = BytePtrFromString(path)
539 if err != nil {
540 return
541 }
542 _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
543 if e1 != 0 {
544 err = errnoErr(e1)
545 }
546 return
547 }
548
549
550
551 func Chroot(path string) (err error) {
552 var _p0 *byte
553 _p0, err = BytePtrFromString(path)
554 if err != nil {
555 return
556 }
557 _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
558 if e1 != 0 {
559 err = errnoErr(e1)
560 }
561 return
562 }
563
564
565
566 func ClockGettime(clockid int32, time *Timespec) (err error) {
567 _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)
568 if e1 != 0 {
569 err = errnoErr(e1)
570 }
571 return
572 }
573
574
575
576 func Close(fd int) (err error) {
577 _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
578 if e1 != 0 {
579 err = errnoErr(e1)
580 }
581 return
582 }
583
584
585
586 func Dup(fd int) (nfd int, err error) {
587 r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
588 nfd = int(r0)
589 if e1 != 0 {
590 err = errnoErr(e1)
591 }
592 return
593 }
594
595
596
597 func Dup2(from int, to int) (err error) {
598 _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
599 if e1 != 0 {
600 err = errnoErr(e1)
601 }
602 return
603 }
604
605
606
607 func Exit(code int) {
608 Syscall(SYS_EXIT, uintptr(code), 0, 0)
609 return
610 }
611
612
613
614 func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
615 var _p0 *byte
616 _p0, err = BytePtrFromString(attrname)
617 if err != nil {
618 return
619 }
620 r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)
621 ret = int(r0)
622 if e1 != 0 {
623 err = errnoErr(e1)
624 }
625 return
626 }
627
628
629
630 func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
631 var _p0 *byte
632 _p0, err = BytePtrFromString(attrname)
633 if err != nil {
634 return
635 }
636 r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)
637 ret = int(r0)
638 if e1 != 0 {
639 err = errnoErr(e1)
640 }
641 return
642 }
643
644
645
646 func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) {
647 var _p0 *byte
648 _p0, err = BytePtrFromString(attrname)
649 if err != nil {
650 return
651 }
652 _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)))
653 if e1 != 0 {
654 err = errnoErr(e1)
655 }
656 return
657 }
658
659
660
661 func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {
662 r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)
663 ret = int(r0)
664 if e1 != 0 {
665 err = errnoErr(e1)
666 }
667 return
668 }
669
670
671
672 func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
673 var _p0 *byte
674 _p0, err = BytePtrFromString(file)
675 if err != nil {
676 return
677 }
678 var _p1 *byte
679 _p1, err = BytePtrFromString(attrname)
680 if err != nil {
681 return
682 }
683 r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)
684 ret = int(r0)
685 if e1 != 0 {
686 err = errnoErr(e1)
687 }
688 return
689 }
690
691
692
693 func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
694 var _p0 *byte
695 _p0, err = BytePtrFromString(file)
696 if err != nil {
697 return
698 }
699 var _p1 *byte
700 _p1, err = BytePtrFromString(attrname)
701 if err != nil {
702 return
703 }
704 r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)
705 ret = int(r0)
706 if e1 != 0 {
707 err = errnoErr(e1)
708 }
709 return
710 }
711
712
713
714 func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) {
715 var _p0 *byte
716 _p0, err = BytePtrFromString(file)
717 if err != nil {
718 return
719 }
720 var _p1 *byte
721 _p1, err = BytePtrFromString(attrname)
722 if err != nil {
723 return
724 }
725 _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))
726 if e1 != 0 {
727 err = errnoErr(e1)
728 }
729 return
730 }
731
732
733
734 func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {
735 var _p0 *byte
736 _p0, err = BytePtrFromString(file)
737 if err != nil {
738 return
739 }
740 r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)
741 ret = int(r0)
742 if e1 != 0 {
743 err = errnoErr(e1)
744 }
745 return
746 }
747
748
749
750 func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
751 var _p0 *byte
752 _p0, err = BytePtrFromString(link)
753 if err != nil {
754 return
755 }
756 var _p1 *byte
757 _p1, err = BytePtrFromString(attrname)
758 if err != nil {
759 return
760 }
761 r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)
762 ret = int(r0)
763 if e1 != 0 {
764 err = errnoErr(e1)
765 }
766 return
767 }
768
769
770
771 func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
772 var _p0 *byte
773 _p0, err = BytePtrFromString(link)
774 if err != nil {
775 return
776 }
777 var _p1 *byte
778 _p1, err = BytePtrFromString(attrname)
779 if err != nil {
780 return
781 }
782 r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)
783 ret = int(r0)
784 if e1 != 0 {
785 err = errnoErr(e1)
786 }
787 return
788 }
789
790
791
792 func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) {
793 var _p0 *byte
794 _p0, err = BytePtrFromString(link)
795 if err != nil {
796 return
797 }
798 var _p1 *byte
799 _p1, err = BytePtrFromString(attrname)
800 if err != nil {
801 return
802 }
803 _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))
804 if e1 != 0 {
805 err = errnoErr(e1)
806 }
807 return
808 }
809
810
811
812 func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {
813 var _p0 *byte
814 _p0, err = BytePtrFromString(link)
815 if err != nil {
816 return
817 }
818 r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)
819 ret = int(r0)
820 if e1 != 0 {
821 err = errnoErr(e1)
822 }
823 return
824 }
825
826
827
828 func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
829 _, _, e1 := Syscall9(SYS_POSIX_FADVISE, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice), 0, 0)
830 if e1 != 0 {
831 err = errnoErr(e1)
832 }
833 return
834 }
835
836
837
838 func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
839 var _p0 *byte
840 _p0, err = BytePtrFromString(path)
841 if err != nil {
842 return
843 }
844 _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
845 if e1 != 0 {
846 err = errnoErr(e1)
847 }
848 return
849 }
850
851
852
853 func Fchdir(fd int) (err error) {
854 _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
855 if e1 != 0 {
856 err = errnoErr(e1)
857 }
858 return
859 }
860
861
862
863 func Fchflags(fd int, flags int) (err error) {
864 _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)
865 if e1 != 0 {
866 err = errnoErr(e1)
867 }
868 return
869 }
870
871
872
873 func Fchmod(fd int, mode uint32) (err error) {
874 _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
875 if e1 != 0 {
876 err = errnoErr(e1)
877 }
878 return
879 }
880
881
882
883 func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
884 var _p0 *byte
885 _p0, err = BytePtrFromString(path)
886 if err != nil {
887 return
888 }
889 _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
890 if e1 != 0 {
891 err = errnoErr(e1)
892 }
893 return
894 }
895
896
897
898 func Fchown(fd int, uid int, gid int) (err error) {
899 _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
900 if e1 != 0 {
901 err = errnoErr(e1)
902 }
903 return
904 }
905
906
907
908 func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
909 var _p0 *byte
910 _p0, err = BytePtrFromString(path)
911 if err != nil {
912 return
913 }
914 _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
915 if e1 != 0 {
916 err = errnoErr(e1)
917 }
918 return
919 }
920
921
922
923 func Flock(fd int, how int) (err error) {
924 _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
925 if e1 != 0 {
926 err = errnoErr(e1)
927 }
928 return
929 }
930
931
932
933 func Fpathconf(fd int, name int) (val int, err error) {
934 r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
935 val = int(r0)
936 if e1 != 0 {
937 err = errnoErr(e1)
938 }
939 return
940 }
941
942
943
944 func Fstat(fd int, stat *Stat_t) (err error) {
945 _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
946 if e1 != 0 {
947 err = errnoErr(e1)
948 }
949 return
950 }
951
952
953
954 func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) {
955 var _p0 *byte
956 _p0, err = BytePtrFromString(path)
957 if err != nil {
958 return
959 }
960 _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
961 if e1 != 0 {
962 err = errnoErr(e1)
963 }
964 return
965 }
966
967
968
969 func Fstatfs(fd int, stat *Statfs_t) (err error) {
970 _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
971 if e1 != 0 {
972 err = errnoErr(e1)
973 }
974 return
975 }
976
977
978
979 func Fsync(fd int) (err error) {
980 _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
981 if e1 != 0 {
982 err = errnoErr(e1)
983 }
984 return
985 }
986
987
988
989 func Ftruncate(fd int, length int64) (err error) {
990 _, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)
991 if e1 != 0 {
992 err = errnoErr(e1)
993 }
994 return
995 }
996
997
998
999 func getdirentries(fd int, buf []byte, basep *uint64) (n int, err error) {
1000 var _p0 unsafe.Pointer
1001 if len(buf) > 0 {
1002 _p0 = unsafe.Pointer(&buf[0])
1003 } else {
1004 _p0 = unsafe.Pointer(&_zero)
1005 }
1006 r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
1007 n = int(r0)
1008 if e1 != 0 {
1009 err = errnoErr(e1)
1010 }
1011 return
1012 }
1013
1014
1015
1016 func Getdtablesize() (size int) {
1017 r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)
1018 size = int(r0)
1019 return
1020 }
1021
1022
1023
1024 func Getegid() (egid int) {
1025 r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)
1026 egid = int(r0)
1027 return
1028 }
1029
1030
1031
1032 func Geteuid() (uid int) {
1033 r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)
1034 uid = int(r0)
1035 return
1036 }
1037
1038
1039
1040 func Getgid() (gid int) {
1041 r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)
1042 gid = int(r0)
1043 return
1044 }
1045
1046
1047
1048 func Getpgid(pid int) (pgid int, err error) {
1049 r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
1050 pgid = int(r0)
1051 if e1 != 0 {
1052 err = errnoErr(e1)
1053 }
1054 return
1055 }
1056
1057
1058
1059 func Getpgrp() (pgrp int) {
1060 r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)
1061 pgrp = int(r0)
1062 return
1063 }
1064
1065
1066
1067 func Getpid() (pid int) {
1068 r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
1069 pid = int(r0)
1070 return
1071 }
1072
1073
1074
1075 func Getppid() (ppid int) {
1076 r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)
1077 ppid = int(r0)
1078 return
1079 }
1080
1081
1082
1083 func Getpriority(which int, who int) (prio int, err error) {
1084 r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
1085 prio = int(r0)
1086 if e1 != 0 {
1087 err = errnoErr(e1)
1088 }
1089 return
1090 }
1091
1092
1093
1094 func Getrlimit(which int, lim *Rlimit) (err error) {
1095 _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
1096 if e1 != 0 {
1097 err = errnoErr(e1)
1098 }
1099 return
1100 }
1101
1102
1103
1104 func Getrusage(who int, rusage *Rusage) (err error) {
1105 _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
1106 if e1 != 0 {
1107 err = errnoErr(e1)
1108 }
1109 return
1110 }
1111
1112
1113
1114 func Getsid(pid int) (sid int, err error) {
1115 r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
1116 sid = int(r0)
1117 if e1 != 0 {
1118 err = errnoErr(e1)
1119 }
1120 return
1121 }
1122
1123
1124
1125 func Gettimeofday(tv *Timeval) (err error) {
1126 _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
1127 if e1 != 0 {
1128 err = errnoErr(e1)
1129 }
1130 return
1131 }
1132
1133
1134
1135 func Getuid() (uid int) {
1136 r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)
1137 uid = int(r0)
1138 return
1139 }
1140
1141
1142
1143 func Issetugid() (tainted bool) {
1144 r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)
1145 tainted = bool(r0 != 0)
1146 return
1147 }
1148
1149
1150
1151 func Kill(pid int, signum syscall.Signal) (err error) {
1152 _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)
1153 if e1 != 0 {
1154 err = errnoErr(e1)
1155 }
1156 return
1157 }
1158
1159
1160
1161 func Kqueue() (fd int, err error) {
1162 r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
1163 fd = int(r0)
1164 if e1 != 0 {
1165 err = errnoErr(e1)
1166 }
1167 return
1168 }
1169
1170
1171
1172 func Lchown(path string, uid int, gid int) (err error) {
1173 var _p0 *byte
1174 _p0, err = BytePtrFromString(path)
1175 if err != nil {
1176 return
1177 }
1178 _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
1179 if e1 != 0 {
1180 err = errnoErr(e1)
1181 }
1182 return
1183 }
1184
1185
1186
1187 func Link(path string, link string) (err error) {
1188 var _p0 *byte
1189 _p0, err = BytePtrFromString(path)
1190 if err != nil {
1191 return
1192 }
1193 var _p1 *byte
1194 _p1, err = BytePtrFromString(link)
1195 if err != nil {
1196 return
1197 }
1198 _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
1199 if e1 != 0 {
1200 err = errnoErr(e1)
1201 }
1202 return
1203 }
1204
1205
1206
1207 func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) {
1208 var _p0 *byte
1209 _p0, err = BytePtrFromString(path)
1210 if err != nil {
1211 return
1212 }
1213 var _p1 *byte
1214 _p1, err = BytePtrFromString(link)
1215 if err != nil {
1216 return
1217 }
1218 _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
1219 if e1 != 0 {
1220 err = errnoErr(e1)
1221 }
1222 return
1223 }
1224
1225
1226
1227 func Listen(s int, backlog int) (err error) {
1228 _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
1229 if e1 != 0 {
1230 err = errnoErr(e1)
1231 }
1232 return
1233 }
1234
1235
1236
1237 func Mkdir(path string, mode uint32) (err error) {
1238 var _p0 *byte
1239 _p0, err = BytePtrFromString(path)
1240 if err != nil {
1241 return
1242 }
1243 _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
1244 if e1 != 0 {
1245 err = errnoErr(e1)
1246 }
1247 return
1248 }
1249
1250
1251
1252 func Mkdirat(dirfd int, path string, mode uint32) (err error) {
1253 var _p0 *byte
1254 _p0, err = BytePtrFromString(path)
1255 if err != nil {
1256 return
1257 }
1258 _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
1259 if e1 != 0 {
1260 err = errnoErr(e1)
1261 }
1262 return
1263 }
1264
1265
1266
1267 func Mkfifo(path string, mode uint32) (err error) {
1268 var _p0 *byte
1269 _p0, err = BytePtrFromString(path)
1270 if err != nil {
1271 return
1272 }
1273 _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
1274 if e1 != 0 {
1275 err = errnoErr(e1)
1276 }
1277 return
1278 }
1279
1280
1281
1282 func Mknodat(fd int, path string, mode uint32, dev uint64) (err error) {
1283 var _p0 *byte
1284 _p0, err = BytePtrFromString(path)
1285 if err != nil {
1286 return
1287 }
1288 _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, uintptr(dev), uintptr(dev>>32))
1289 if e1 != 0 {
1290 err = errnoErr(e1)
1291 }
1292 return
1293 }
1294
1295
1296
1297 func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
1298 _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
1299 if e1 != 0 {
1300 err = errnoErr(e1)
1301 }
1302 return
1303 }
1304
1305
1306
1307 func Open(path string, mode int, perm uint32) (fd int, err error) {
1308 var _p0 *byte
1309 _p0, err = BytePtrFromString(path)
1310 if err != nil {
1311 return
1312 }
1313 r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
1314 fd = int(r0)
1315 if e1 != 0 {
1316 err = errnoErr(e1)
1317 }
1318 return
1319 }
1320
1321
1322
1323 func Openat(fdat int, path string, mode int, perm uint32) (fd int, err error) {
1324 var _p0 *byte
1325 _p0, err = BytePtrFromString(path)
1326 if err != nil {
1327 return
1328 }
1329 r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(fdat), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0)
1330 fd = int(r0)
1331 if e1 != 0 {
1332 err = errnoErr(e1)
1333 }
1334 return
1335 }
1336
1337
1338
1339 func Pathconf(path string, name int) (val int, err error) {
1340 var _p0 *byte
1341 _p0, err = BytePtrFromString(path)
1342 if err != nil {
1343 return
1344 }
1345 r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)
1346 val = int(r0)
1347 if e1 != 0 {
1348 err = errnoErr(e1)
1349 }
1350 return
1351 }
1352
1353
1354
1355 func pread(fd int, p []byte, offset int64) (n int, err error) {
1356 var _p0 unsafe.Pointer
1357 if len(p) > 0 {
1358 _p0 = unsafe.Pointer(&p[0])
1359 } else {
1360 _p0 = unsafe.Pointer(&_zero)
1361 }
1362 r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
1363 n = int(r0)
1364 if e1 != 0 {
1365 err = errnoErr(e1)
1366 }
1367 return
1368 }
1369
1370
1371
1372 func pwrite(fd int, p []byte, offset int64) (n int, err error) {
1373 var _p0 unsafe.Pointer
1374 if len(p) > 0 {
1375 _p0 = unsafe.Pointer(&p[0])
1376 } else {
1377 _p0 = unsafe.Pointer(&_zero)
1378 }
1379 r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
1380 n = int(r0)
1381 if e1 != 0 {
1382 err = errnoErr(e1)
1383 }
1384 return
1385 }
1386
1387
1388
1389 func read(fd int, p []byte) (n int, err error) {
1390 var _p0 unsafe.Pointer
1391 if len(p) > 0 {
1392 _p0 = unsafe.Pointer(&p[0])
1393 } else {
1394 _p0 = unsafe.Pointer(&_zero)
1395 }
1396 r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
1397 n = int(r0)
1398 if e1 != 0 {
1399 err = errnoErr(e1)
1400 }
1401 return
1402 }
1403
1404
1405
1406 func Readlink(path string, buf []byte) (n int, err error) {
1407 var _p0 *byte
1408 _p0, err = BytePtrFromString(path)
1409 if err != nil {
1410 return
1411 }
1412 var _p1 unsafe.Pointer
1413 if len(buf) > 0 {
1414 _p1 = unsafe.Pointer(&buf[0])
1415 } else {
1416 _p1 = unsafe.Pointer(&_zero)
1417 }
1418 r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))
1419 n = int(r0)
1420 if e1 != 0 {
1421 err = errnoErr(e1)
1422 }
1423 return
1424 }
1425
1426
1427
1428 func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
1429 var _p0 *byte
1430 _p0, err = BytePtrFromString(path)
1431 if err != nil {
1432 return
1433 }
1434 var _p1 unsafe.Pointer
1435 if len(buf) > 0 {
1436 _p1 = unsafe.Pointer(&buf[0])
1437 } else {
1438 _p1 = unsafe.Pointer(&_zero)
1439 }
1440 r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
1441 n = int(r0)
1442 if e1 != 0 {
1443 err = errnoErr(e1)
1444 }
1445 return
1446 }
1447
1448
1449
1450 func Rename(from string, to string) (err error) {
1451 var _p0 *byte
1452 _p0, err = BytePtrFromString(from)
1453 if err != nil {
1454 return
1455 }
1456 var _p1 *byte
1457 _p1, err = BytePtrFromString(to)
1458 if err != nil {
1459 return
1460 }
1461 _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
1462 if e1 != 0 {
1463 err = errnoErr(e1)
1464 }
1465 return
1466 }
1467
1468
1469
1470 func Renameat(fromfd int, from string, tofd int, to string) (err error) {
1471 var _p0 *byte
1472 _p0, err = BytePtrFromString(from)
1473 if err != nil {
1474 return
1475 }
1476 var _p1 *byte
1477 _p1, err = BytePtrFromString(to)
1478 if err != nil {
1479 return
1480 }
1481 _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0)
1482 if e1 != 0 {
1483 err = errnoErr(e1)
1484 }
1485 return
1486 }
1487
1488
1489
1490 func Revoke(path string) (err error) {
1491 var _p0 *byte
1492 _p0, err = BytePtrFromString(path)
1493 if err != nil {
1494 return
1495 }
1496 _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)
1497 if e1 != 0 {
1498 err = errnoErr(e1)
1499 }
1500 return
1501 }
1502
1503
1504
1505 func Rmdir(path string) (err error) {
1506 var _p0 *byte
1507 _p0, err = BytePtrFromString(path)
1508 if err != nil {
1509 return
1510 }
1511 _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
1512 if e1 != 0 {
1513 err = errnoErr(e1)
1514 }
1515 return
1516 }
1517
1518
1519
1520 func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
1521 r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)
1522 newoffset = int64(int64(r1)<<32 | int64(r0))
1523 if e1 != 0 {
1524 err = errnoErr(e1)
1525 }
1526 return
1527 }
1528
1529
1530
1531 func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
1532 r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
1533 n = int(r0)
1534 if e1 != 0 {
1535 err = errnoErr(e1)
1536 }
1537 return
1538 }
1539
1540
1541
1542 func Setegid(egid int) (err error) {
1543 _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)
1544 if e1 != 0 {
1545 err = errnoErr(e1)
1546 }
1547 return
1548 }
1549
1550
1551
1552 func Seteuid(euid int) (err error) {
1553 _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
1554 if e1 != 0 {
1555 err = errnoErr(e1)
1556 }
1557 return
1558 }
1559
1560
1561
1562 func Setgid(gid int) (err error) {
1563 _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
1564 if e1 != 0 {
1565 err = errnoErr(e1)
1566 }
1567 return
1568 }
1569
1570
1571
1572 func Setlogin(name string) (err error) {
1573 var _p0 *byte
1574 _p0, err = BytePtrFromString(name)
1575 if err != nil {
1576 return
1577 }
1578 _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)
1579 if e1 != 0 {
1580 err = errnoErr(e1)
1581 }
1582 return
1583 }
1584
1585
1586
1587 func Setpgid(pid int, pgid int) (err error) {
1588 _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
1589 if e1 != 0 {
1590 err = errnoErr(e1)
1591 }
1592 return
1593 }
1594
1595
1596
1597 func Setpriority(which int, who int, prio int) (err error) {
1598 _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
1599 if e1 != 0 {
1600 err = errnoErr(e1)
1601 }
1602 return
1603 }
1604
1605
1606
1607 func Setregid(rgid int, egid int) (err error) {
1608 _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
1609 if e1 != 0 {
1610 err = errnoErr(e1)
1611 }
1612 return
1613 }
1614
1615
1616
1617 func Setreuid(ruid int, euid int) (err error) {
1618 _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
1619 if e1 != 0 {
1620 err = errnoErr(e1)
1621 }
1622 return
1623 }
1624
1625
1626
1627 func Setresgid(rgid int, egid int, sgid int) (err error) {
1628 _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))
1629 if e1 != 0 {
1630 err = errnoErr(e1)
1631 }
1632 return
1633 }
1634
1635
1636
1637 func Setresuid(ruid int, euid int, suid int) (err error) {
1638 _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))
1639 if e1 != 0 {
1640 err = errnoErr(e1)
1641 }
1642 return
1643 }
1644
1645
1646
1647 func Setsid() (pid int, err error) {
1648 r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
1649 pid = int(r0)
1650 if e1 != 0 {
1651 err = errnoErr(e1)
1652 }
1653 return
1654 }
1655
1656
1657
1658 func Settimeofday(tp *Timeval) (err error) {
1659 _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
1660 if e1 != 0 {
1661 err = errnoErr(e1)
1662 }
1663 return
1664 }
1665
1666
1667
1668 func Setuid(uid int) (err error) {
1669 _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
1670 if e1 != 0 {
1671 err = errnoErr(e1)
1672 }
1673 return
1674 }
1675
1676
1677
1678 func Statfs(path string, stat *Statfs_t) (err error) {
1679 var _p0 *byte
1680 _p0, err = BytePtrFromString(path)
1681 if err != nil {
1682 return
1683 }
1684 _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
1685 if e1 != 0 {
1686 err = errnoErr(e1)
1687 }
1688 return
1689 }
1690
1691
1692
1693 func Symlink(path string, link string) (err error) {
1694 var _p0 *byte
1695 _p0, err = BytePtrFromString(path)
1696 if err != nil {
1697 return
1698 }
1699 var _p1 *byte
1700 _p1, err = BytePtrFromString(link)
1701 if err != nil {
1702 return
1703 }
1704 _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
1705 if e1 != 0 {
1706 err = errnoErr(e1)
1707 }
1708 return
1709 }
1710
1711
1712
1713 func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
1714 var _p0 *byte
1715 _p0, err = BytePtrFromString(oldpath)
1716 if err != nil {
1717 return
1718 }
1719 var _p1 *byte
1720 _p1, err = BytePtrFromString(newpath)
1721 if err != nil {
1722 return
1723 }
1724 _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
1725 if e1 != 0 {
1726 err = errnoErr(e1)
1727 }
1728 return
1729 }
1730
1731
1732
1733 func Sync() (err error) {
1734 _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
1735 if e1 != 0 {
1736 err = errnoErr(e1)
1737 }
1738 return
1739 }
1740
1741
1742
1743 func Truncate(path string, length int64) (err error) {
1744 var _p0 *byte
1745 _p0, err = BytePtrFromString(path)
1746 if err != nil {
1747 return
1748 }
1749 _, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)
1750 if e1 != 0 {
1751 err = errnoErr(e1)
1752 }
1753 return
1754 }
1755
1756
1757
1758 func Umask(newmask int) (oldmask int) {
1759 r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)
1760 oldmask = int(r0)
1761 return
1762 }
1763
1764
1765
1766 func Undelete(path string) (err error) {
1767 var _p0 *byte
1768 _p0, err = BytePtrFromString(path)
1769 if err != nil {
1770 return
1771 }
1772 _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)
1773 if e1 != 0 {
1774 err = errnoErr(e1)
1775 }
1776 return
1777 }
1778
1779
1780
1781 func Unlink(path string) (err error) {
1782 var _p0 *byte
1783 _p0, err = BytePtrFromString(path)
1784 if err != nil {
1785 return
1786 }
1787 _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)
1788 if e1 != 0 {
1789 err = errnoErr(e1)
1790 }
1791 return
1792 }
1793
1794
1795
1796 func Unlinkat(dirfd int, path string, flags int) (err error) {
1797 var _p0 *byte
1798 _p0, err = BytePtrFromString(path)
1799 if err != nil {
1800 return
1801 }
1802 _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
1803 if e1 != 0 {
1804 err = errnoErr(e1)
1805 }
1806 return
1807 }
1808
1809
1810
1811 func Unmount(path string, flags int) (err error) {
1812 var _p0 *byte
1813 _p0, err = BytePtrFromString(path)
1814 if err != nil {
1815 return
1816 }
1817 _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
1818 if e1 != 0 {
1819 err = errnoErr(e1)
1820 }
1821 return
1822 }
1823
1824
1825
1826 func write(fd int, p []byte) (n int, err error) {
1827 var _p0 unsafe.Pointer
1828 if len(p) > 0 {
1829 _p0 = unsafe.Pointer(&p[0])
1830 } else {
1831 _p0 = unsafe.Pointer(&_zero)
1832 }
1833 r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
1834 n = int(r0)
1835 if e1 != 0 {
1836 err = errnoErr(e1)
1837 }
1838 return
1839 }
1840
1841
1842
1843 func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
1844 r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)
1845 ret = uintptr(r0)
1846 if e1 != 0 {
1847 err = errnoErr(e1)
1848 }
1849 return
1850 }
1851
1852
1853
1854 func munmap(addr uintptr, length uintptr) (err error) {
1855 _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
1856 if e1 != 0 {
1857 err = errnoErr(e1)
1858 }
1859 return
1860 }
1861
1862
1863
1864 func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) {
1865 r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)
1866 nfd = int(r0)
1867 if e1 != 0 {
1868 err = errnoErr(e1)
1869 }
1870 return
1871 }
1872
1873
1874
1875 func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
1876 var _p0 *byte
1877 _p0, err = BytePtrFromString(path)
1878 if err != nil {
1879 return
1880 }
1881 _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)
1882 if e1 != 0 {
1883 err = errnoErr(e1)
1884 }
1885 return
1886 }
1887
View as plain text