Source file
src/syscall/zsyscall_aix_ppc64.go
Documentation: syscall
1
2
3
4
5
6
7 package syscall
8
9 import "unsafe"
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195 type libcFunc uintptr
196
197 var (
198 libc_fcntl,
199 libc_Dup2,
200 libc_pipe,
201 libc_readlink,
202 libc_utimes,
203 libc_utimensat,
204 libc_unlinkat,
205 libc_getcwd,
206 libc_getgroups,
207 libc_setgroups,
208 libc_getdirent,
209 libc_wait4,
210 libc_fsync_range,
211 libc_bind,
212 libc_connect,
213 libc_Getkerninfo,
214 libc_getsockopt,
215 libc_Listen,
216 libc_setsockopt,
217 libc_socket,
218 libc_socketpair,
219 libc_getpeername,
220 libc_getsockname,
221 libc_recvfrom,
222 libc_sendto,
223 libc_Shutdown,
224 libc_nrecvmsg,
225 libc_nsendmsg,
226 libc_accept,
227 libc_Openat,
228 libc_ptrace64,
229 libc_Acct,
230 libc_Chdir,
231 libc_Chmod,
232 libc_Chown,
233 libc_Chroot,
234 libc_Close,
235 libc_Dup,
236 libc_Faccessat,
237 libc_Fchdir,
238 libc_Fchmod,
239 libc_Fchmodat,
240 libc_Fchown,
241 libc_Fchownat,
242 libc_Fpathconf,
243 libc_Fstat,
244 libc_Fstatfs,
245 libc_Ftruncate,
246 libc_Getgid,
247 libc_Getpid,
248 libc_Geteuid,
249 libc_Getegid,
250 libc_Getppid,
251 libc_Getpriority,
252 libc_Getrlimit,
253 libc_Getuid,
254 libc_Kill,
255 libc_Lchown,
256 libc_Link,
257 libc_Lstat,
258 libc_Mkdir,
259 libc_Mkdirat,
260 libc_Mknodat,
261 libc_Open,
262 libc_Pread,
263 libc_Pwrite,
264 libc_read,
265 libc_Reboot,
266 libc_Rename,
267 libc_Renameat,
268 libc_Rmdir,
269 libc_lseek,
270 libc_Setegid,
271 libc_Seteuid,
272 libc_Setgid,
273 libc_Setpgid,
274 libc_Setpriority,
275 libc_Setregid,
276 libc_Setreuid,
277 libc_Setrlimit,
278 libc_Stat,
279 libc_Statfs,
280 libc_Symlink,
281 libc_Truncate,
282 libc_Umask,
283 libc_Unlink,
284 libc_Uname,
285 libc_write,
286 libc_gettimeofday,
287 libc_mmap,
288 libc_munmap libcFunc
289 )
290
291
292
293 func fcntl(fd int, cmd int, arg int) (val int, err error) {
294 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_fcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0)
295 val = int(r0)
296 if e1 != 0 {
297 err = errnoErr(e1)
298 }
299 return
300 }
301
302
303
304 func Dup2(old int, new int) (err error) {
305 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Dup2)), 2, uintptr(old), uintptr(new), 0, 0, 0, 0)
306 if e1 != 0 {
307 err = errnoErr(e1)
308 }
309 return
310 }
311
312
313
314 func pipe(p *[2]_C_int) (err error) {
315 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_pipe)), 1, uintptr(unsafe.Pointer(p)), 0, 0, 0, 0, 0)
316 if e1 != 0 {
317 err = errnoErr(e1)
318 }
319 return
320 }
321
322
323
324 func readlink(path string, buf []byte, bufSize uint64) (n int, err error) {
325 var _p0 *byte
326 _p0, err = BytePtrFromString(path)
327 if err != nil {
328 return
329 }
330 var _p1 *byte
331 if len(buf) > 0 {
332 _p1 = &buf[0]
333 }
334 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_readlink)), 4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(len(buf)), uintptr(bufSize), 0, 0)
335 n = int(r0)
336 if e1 != 0 {
337 err = errnoErr(e1)
338 }
339 return
340 }
341
342
343
344 func utimes(path string, times *[2]Timeval) (err error) {
345 var _p0 *byte
346 _p0, err = BytePtrFromString(path)
347 if err != nil {
348 return
349 }
350 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_utimes)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0, 0, 0, 0)
351 if e1 != 0 {
352 err = errnoErr(e1)
353 }
354 return
355 }
356
357
358
359 func utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error) {
360 var _p0 *byte
361 _p0, err = BytePtrFromString(path)
362 if err != nil {
363 return
364 }
365 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_utimensat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flag), 0, 0)
366 if e1 != 0 {
367 err = errnoErr(e1)
368 }
369 return
370 }
371
372
373
374 func unlinkat(dirfd int, path string, flags int) (err error) {
375 var _p0 *byte
376 _p0, err = BytePtrFromString(path)
377 if err != nil {
378 return
379 }
380 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_unlinkat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0, 0)
381 if e1 != 0 {
382 err = errnoErr(e1)
383 }
384 return
385 }
386
387
388
389 func getcwd(buf *byte, size uint64) (err error) {
390 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_getcwd)), 2, uintptr(unsafe.Pointer(buf)), uintptr(size), 0, 0, 0, 0)
391 if e1 != 0 {
392 err = errnoErr(e1)
393 }
394 return
395 }
396
397
398
399 func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
400 r0, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_getgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0)
401 n = int(r0)
402 if e1 != 0 {
403 err = errnoErr(e1)
404 }
405 return
406 }
407
408
409
410 func setgroups(ngid int, gid *_Gid_t) (err error) {
411 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_setgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0)
412 if e1 != 0 {
413 err = errnoErr(e1)
414 }
415 return
416 }
417
418
419
420 func getdirent(fd int, buf []byte) (n int, err error) {
421 var _p0 *byte
422 if len(buf) > 0 {
423 _p0 = &buf[0]
424 }
425 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_getdirent)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0, 0, 0)
426 n = int(r0)
427 if e1 != 0 {
428 err = errnoErr(e1)
429 }
430 return
431 }
432
433
434
435 func wait4(pid _Pid_t, status *_C_int, options int, rusage *Rusage) (wpid _Pid_t, err error) {
436 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_wait4)), 4, uintptr(pid), uintptr(unsafe.Pointer(status)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
437 wpid = _Pid_t(r0)
438 if e1 != 0 {
439 err = errnoErr(e1)
440 }
441 return
442 }
443
444
445
446 func fsyncRange(fd int, how int, start int64, length int64) (err error) {
447 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_fsync_range)), 4, uintptr(fd), uintptr(how), uintptr(start), uintptr(length), 0, 0)
448 if e1 != 0 {
449 err = errnoErr(e1)
450 }
451 return
452 }
453
454
455
456 func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
457 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_bind)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
458 if e1 != 0 {
459 err = errnoErr(e1)
460 }
461 return
462 }
463
464
465
466 func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
467 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_connect)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
468 if e1 != 0 {
469 err = errnoErr(e1)
470 }
471 return
472 }
473
474
475
476 func Getkerninfo(op int32, where uintptr, size uintptr, arg int64) (i int32, err error) {
477 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Getkerninfo)), 4, uintptr(op), uintptr(where), uintptr(size), uintptr(arg), 0, 0)
478 i = int32(r0)
479 if e1 != 0 {
480 err = errnoErr(e1)
481 }
482 return
483 }
484
485
486
487 func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
488 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_getsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
489 if e1 != 0 {
490 err = errnoErr(e1)
491 }
492 return
493 }
494
495
496
497 func Listen(s int, backlog int) (err error) {
498 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Listen)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0)
499 if e1 != 0 {
500 err = errnoErr(e1)
501 }
502 return
503 }
504
505
506
507 func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
508 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_setsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
509 if e1 != 0 {
510 err = errnoErr(e1)
511 }
512 return
513 }
514
515
516
517 func socket(domain int, typ int, proto int) (fd int, err error) {
518 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_socket)), 3, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0)
519 fd = int(r0)
520 if e1 != 0 {
521 err = errnoErr(e1)
522 }
523 return
524 }
525
526
527
528 func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
529 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_socketpair)), 4, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
530 if e1 != 0 {
531 err = errnoErr(e1)
532 }
533 return
534 }
535
536
537
538 func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
539 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_getpeername)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
540 if e1 != 0 {
541 err = errnoErr(e1)
542 }
543 return
544 }
545
546
547
548 func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
549 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_getsockname)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
550 if e1 != 0 {
551 err = errnoErr(e1)
552 }
553 return
554 }
555
556
557
558 func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
559 var _p0 *byte
560 if len(p) > 0 {
561 _p0 = &p[0]
562 }
563 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_recvfrom)), 6, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
564 n = int(r0)
565 if e1 != 0 {
566 err = errnoErr(e1)
567 }
568 return
569 }
570
571
572
573 func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
574 var _p0 *byte
575 if len(buf) > 0 {
576 _p0 = &buf[0]
577 }
578 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_sendto)), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
579 if e1 != 0 {
580 err = errnoErr(e1)
581 }
582 return
583 }
584
585
586
587 func Shutdown(s int, how int) (err error) {
588 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Shutdown)), 2, uintptr(s), uintptr(how), 0, 0, 0, 0)
589 if e1 != 0 {
590 err = errnoErr(e1)
591 }
592 return
593 }
594
595
596
597 func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
598 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_nrecvmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
599 n = int(r0)
600 if e1 != 0 {
601 err = errnoErr(e1)
602 }
603 return
604 }
605
606
607
608 func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
609 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_nsendmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
610 n = int(r0)
611 if e1 != 0 {
612 err = errnoErr(e1)
613 }
614 return
615 }
616
617
618
619 func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
620 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_accept)), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
621 fd = int(r0)
622 if e1 != 0 {
623 err = errnoErr(e1)
624 }
625 return
626 }
627
628
629
630 func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {
631 var _p0 *byte
632 _p0, err = BytePtrFromString(path)
633 if err != nil {
634 return
635 }
636 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Openat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)
637 fd = int(r0)
638 if e1 != 0 {
639 err = errnoErr(e1)
640 }
641 return
642 }
643
644
645
646 func ptrace64(request int, id int64, addr int64, data int, buff uintptr) (err error) {
647 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_ptrace64)), 5, uintptr(request), uintptr(id), uintptr(addr), uintptr(data), uintptr(buff), 0)
648 if e1 != 0 {
649 err = errnoErr(e1)
650 }
651 return
652 }
653
654
655
656 func Acct(path string) (err error) {
657 var _p0 *byte
658 _p0, err = BytePtrFromString(path)
659 if err != nil {
660 return
661 }
662 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Acct)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
663 if e1 != 0 {
664 err = errnoErr(e1)
665 }
666 return
667 }
668
669
670
671 func Chdir(path string) (err error) {
672 var _p0 *byte
673 _p0, err = BytePtrFromString(path)
674 if err != nil {
675 return
676 }
677 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Chdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
678 if e1 != 0 {
679 err = errnoErr(e1)
680 }
681 return
682 }
683
684
685
686 func Chmod(path string, mode uint32) (err error) {
687 var _p0 *byte
688 _p0, err = BytePtrFromString(path)
689 if err != nil {
690 return
691 }
692 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Chmod)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
693 if e1 != 0 {
694 err = errnoErr(e1)
695 }
696 return
697 }
698
699
700
701 func Chown(path string, uid int, gid int) (err error) {
702 var _p0 *byte
703 _p0, err = BytePtrFromString(path)
704 if err != nil {
705 return
706 }
707 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Chown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)
708 if e1 != 0 {
709 err = errnoErr(e1)
710 }
711 return
712 }
713
714
715
716 func Chroot(path string) (err error) {
717 var _p0 *byte
718 _p0, err = BytePtrFromString(path)
719 if err != nil {
720 return
721 }
722 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Chroot)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
723 if e1 != 0 {
724 err = errnoErr(e1)
725 }
726 return
727 }
728
729
730
731 func Close(fd int) (err error) {
732 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Close)), 1, uintptr(fd), 0, 0, 0, 0, 0)
733 if e1 != 0 {
734 err = errnoErr(e1)
735 }
736 return
737 }
738
739
740
741 func Dup(fd int) (nfd int, err error) {
742 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Dup)), 1, uintptr(fd), 0, 0, 0, 0, 0)
743 nfd = int(r0)
744 if e1 != 0 {
745 err = errnoErr(e1)
746 }
747 return
748 }
749
750
751
752 func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
753 var _p0 *byte
754 _p0, err = BytePtrFromString(path)
755 if err != nil {
756 return
757 }
758 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Faccessat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
759 if e1 != 0 {
760 err = errnoErr(e1)
761 }
762 return
763 }
764
765
766
767 func Fchdir(fd int) (err error) {
768 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0)
769 if e1 != 0 {
770 err = errnoErr(e1)
771 }
772 return
773 }
774
775
776
777 func Fchmod(fd int, mode uint32) (err error) {
778 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fchmod)), 2, uintptr(fd), uintptr(mode), 0, 0, 0, 0)
779 if e1 != 0 {
780 err = errnoErr(e1)
781 }
782 return
783 }
784
785
786
787 func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
788 var _p0 *byte
789 _p0, err = BytePtrFromString(path)
790 if err != nil {
791 return
792 }
793 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fchmodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
794 if e1 != 0 {
795 err = errnoErr(e1)
796 }
797 return
798 }
799
800
801
802 func Fchown(fd int, uid int, gid int) (err error) {
803 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fchown)), 3, uintptr(fd), uintptr(uid), uintptr(gid), 0, 0, 0)
804 if e1 != 0 {
805 err = errnoErr(e1)
806 }
807 return
808 }
809
810
811
812 func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
813 var _p0 *byte
814 _p0, err = BytePtrFromString(path)
815 if err != nil {
816 return
817 }
818 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fchownat)), 5, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
819 if e1 != 0 {
820 err = errnoErr(e1)
821 }
822 return
823 }
824
825
826
827 func Fpathconf(fd int, name int) (val int, err error) {
828 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fpathconf)), 2, uintptr(fd), uintptr(name), 0, 0, 0, 0)
829 val = int(r0)
830 if e1 != 0 {
831 err = errnoErr(e1)
832 }
833 return
834 }
835
836
837
838 func Fstat(fd int, stat *Stat_t) (err error) {
839 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fstat)), 2, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
840 if e1 != 0 {
841 err = errnoErr(e1)
842 }
843 return
844 }
845
846
847
848 func Fstatfs(fd int, buf *Statfs_t) (err error) {
849 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fstatfs)), 2, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0)
850 if e1 != 0 {
851 err = errnoErr(e1)
852 }
853 return
854 }
855
856
857
858 func Ftruncate(fd int, length int64) (err error) {
859 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Ftruncate)), 2, uintptr(fd), uintptr(length), 0, 0, 0, 0)
860 if e1 != 0 {
861 err = errnoErr(e1)
862 }
863 return
864 }
865
866
867
868 func Getgid() (gid int) {
869 r0, _, _ := rawSyscall6(uintptr(unsafe.Pointer(&libc_Getgid)), 0, 0, 0, 0, 0, 0, 0)
870 gid = int(r0)
871 return
872 }
873
874
875
876 func Getpid() (pid int) {
877 r0, _, _ := rawSyscall6(uintptr(unsafe.Pointer(&libc_Getpid)), 0, 0, 0, 0, 0, 0, 0)
878 pid = int(r0)
879 return
880 }
881
882
883
884 func Geteuid() (euid int) {
885 r0, _, _ := syscall6(uintptr(unsafe.Pointer(&libc_Geteuid)), 0, 0, 0, 0, 0, 0, 0)
886 euid = int(r0)
887 return
888 }
889
890
891
892 func Getegid() (egid int) {
893 r0, _, _ := syscall6(uintptr(unsafe.Pointer(&libc_Getegid)), 0, 0, 0, 0, 0, 0, 0)
894 egid = int(r0)
895 return
896 }
897
898
899
900 func Getppid() (ppid int) {
901 r0, _, _ := syscall6(uintptr(unsafe.Pointer(&libc_Getppid)), 0, 0, 0, 0, 0, 0, 0)
902 ppid = int(r0)
903 return
904 }
905
906
907
908 func Getpriority(which int, who int) (n int, err error) {
909 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Getpriority)), 2, uintptr(which), uintptr(who), 0, 0, 0, 0)
910 n = int(r0)
911 if e1 != 0 {
912 err = errnoErr(e1)
913 }
914 return
915 }
916
917
918
919 func Getrlimit(which int, lim *Rlimit) (err error) {
920 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Getrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)
921 if e1 != 0 {
922 err = errnoErr(e1)
923 }
924 return
925 }
926
927
928
929 func Getuid() (uid int) {
930 r0, _, _ := rawSyscall6(uintptr(unsafe.Pointer(&libc_Getuid)), 0, 0, 0, 0, 0, 0, 0)
931 uid = int(r0)
932 return
933 }
934
935
936
937 func Kill(pid int, signum Signal) (err error) {
938 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Kill)), 2, uintptr(pid), uintptr(signum), 0, 0, 0, 0)
939 if e1 != 0 {
940 err = errnoErr(e1)
941 }
942 return
943 }
944
945
946
947 func Lchown(path string, uid int, gid int) (err error) {
948 var _p0 *byte
949 _p0, err = BytePtrFromString(path)
950 if err != nil {
951 return
952 }
953 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Lchown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)
954 if e1 != 0 {
955 err = errnoErr(e1)
956 }
957 return
958 }
959
960
961
962 func Link(path string, link string) (err error) {
963 var _p0 *byte
964 _p0, err = BytePtrFromString(path)
965 if err != nil {
966 return
967 }
968 var _p1 *byte
969 _p1, err = BytePtrFromString(link)
970 if err != nil {
971 return
972 }
973 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Link)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
974 if e1 != 0 {
975 err = errnoErr(e1)
976 }
977 return
978 }
979
980
981
982 func Lstat(path string, stat *Stat_t) (err error) {
983 var _p0 *byte
984 _p0, err = BytePtrFromString(path)
985 if err != nil {
986 return
987 }
988 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Lstat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
989 if e1 != 0 {
990 err = errnoErr(e1)
991 }
992 return
993 }
994
995
996
997 func Mkdir(path string, mode uint32) (err error) {
998 var _p0 *byte
999 _p0, err = BytePtrFromString(path)
1000 if err != nil {
1001 return
1002 }
1003 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Mkdir)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
1004 if e1 != 0 {
1005 err = errnoErr(e1)
1006 }
1007 return
1008 }
1009
1010
1011
1012 func Mkdirat(dirfd int, path string, mode uint32) (err error) {
1013 var _p0 *byte
1014 _p0, err = BytePtrFromString(path)
1015 if err != nil {
1016 return
1017 }
1018 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Mkdirat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0)
1019 if e1 != 0 {
1020 err = errnoErr(e1)
1021 }
1022 return
1023 }
1024
1025
1026
1027 func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
1028 var _p0 *byte
1029 _p0, err = BytePtrFromString(path)
1030 if err != nil {
1031 return
1032 }
1033 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Mknodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
1034 if e1 != 0 {
1035 err = errnoErr(e1)
1036 }
1037 return
1038 }
1039
1040
1041
1042 func Open(path string, mode int, perm uint32) (fd int, err error) {
1043 var _p0 *byte
1044 _p0, err = BytePtrFromString(path)
1045 if err != nil {
1046 return
1047 }
1048 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Open)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0, 0)
1049 fd = int(r0)
1050 if e1 != 0 {
1051 err = errnoErr(e1)
1052 }
1053 return
1054 }
1055
1056
1057
1058 func Pread(fd int, p []byte, offset int64) (n int, err error) {
1059 var _p0 *byte
1060 if len(p) > 0 {
1061 _p0 = &p[0]
1062 }
1063 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Pread)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)
1064 n = int(r0)
1065 if e1 != 0 {
1066 err = errnoErr(e1)
1067 }
1068 return
1069 }
1070
1071
1072
1073 func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
1074 var _p0 *byte
1075 if len(p) > 0 {
1076 _p0 = &p[0]
1077 }
1078 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Pwrite)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)
1079 n = int(r0)
1080 if e1 != 0 {
1081 err = errnoErr(e1)
1082 }
1083 return
1084 }
1085
1086
1087
1088 func read(fd int, p []byte) (n int, err error) {
1089 var _p0 *byte
1090 if len(p) > 0 {
1091 _p0 = &p[0]
1092 }
1093 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_read)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)
1094 n = int(r0)
1095 if e1 != 0 {
1096 err = errnoErr(e1)
1097 }
1098 return
1099 }
1100
1101
1102
1103 func Reboot(how int) (err error) {
1104 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Reboot)), 1, uintptr(how), 0, 0, 0, 0, 0)
1105 if e1 != 0 {
1106 err = errnoErr(e1)
1107 }
1108 return
1109 }
1110
1111
1112
1113 func Rename(from string, to string) (err error) {
1114 var _p0 *byte
1115 _p0, err = BytePtrFromString(from)
1116 if err != nil {
1117 return
1118 }
1119 var _p1 *byte
1120 _p1, err = BytePtrFromString(to)
1121 if err != nil {
1122 return
1123 }
1124 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Rename)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
1125 if e1 != 0 {
1126 err = errnoErr(e1)
1127 }
1128 return
1129 }
1130
1131
1132
1133 func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {
1134 var _p0 *byte
1135 _p0, err = BytePtrFromString(oldpath)
1136 if err != nil {
1137 return
1138 }
1139 var _p1 *byte
1140 _p1, err = BytePtrFromString(newpath)
1141 if err != nil {
1142 return
1143 }
1144 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Renameat)), 4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)
1145 if e1 != 0 {
1146 err = errnoErr(e1)
1147 }
1148 return
1149 }
1150
1151
1152
1153 func Rmdir(path string) (err error) {
1154 var _p0 *byte
1155 _p0, err = BytePtrFromString(path)
1156 if err != nil {
1157 return
1158 }
1159 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Rmdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
1160 if e1 != 0 {
1161 err = errnoErr(e1)
1162 }
1163 return
1164 }
1165
1166
1167
1168 func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
1169 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_lseek)), 3, uintptr(fd), uintptr(offset), uintptr(whence), 0, 0, 0)
1170 newoffset = int64(r0)
1171 if e1 != 0 {
1172 err = errnoErr(e1)
1173 }
1174 return
1175 }
1176
1177
1178
1179 func Setegid(egid int) (err error) {
1180 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Setegid)), 1, uintptr(egid), 0, 0, 0, 0, 0)
1181 if e1 != 0 {
1182 err = errnoErr(e1)
1183 }
1184 return
1185 }
1186
1187
1188
1189 func Seteuid(euid int) (err error) {
1190 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Seteuid)), 1, uintptr(euid), 0, 0, 0, 0, 0)
1191 if e1 != 0 {
1192 err = errnoErr(e1)
1193 }
1194 return
1195 }
1196
1197
1198
1199 func Setgid(gid int) (err error) {
1200 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Setgid)), 1, uintptr(gid), 0, 0, 0, 0, 0)
1201 if e1 != 0 {
1202 err = errnoErr(e1)
1203 }
1204 return
1205 }
1206
1207
1208
1209 func Setpgid(pid int, pgid int) (err error) {
1210 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Setpgid)), 2, uintptr(pid), uintptr(pgid), 0, 0, 0, 0)
1211 if e1 != 0 {
1212 err = errnoErr(e1)
1213 }
1214 return
1215 }
1216
1217
1218
1219 func Setpriority(which int, who int, prio int) (err error) {
1220 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Setpriority)), 3, uintptr(which), uintptr(who), uintptr(prio), 0, 0, 0)
1221 if e1 != 0 {
1222 err = errnoErr(e1)
1223 }
1224 return
1225 }
1226
1227
1228
1229 func Setregid(rgid int, egid int) (err error) {
1230 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Setregid)), 2, uintptr(rgid), uintptr(egid), 0, 0, 0, 0)
1231 if e1 != 0 {
1232 err = errnoErr(e1)
1233 }
1234 return
1235 }
1236
1237
1238
1239 func Setreuid(ruid int, euid int) (err error) {
1240 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Setreuid)), 2, uintptr(ruid), uintptr(euid), 0, 0, 0, 0)
1241 if e1 != 0 {
1242 err = errnoErr(e1)
1243 }
1244 return
1245 }
1246
1247
1248
1249 func Setrlimit(which int, lim *Rlimit) (err error) {
1250 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Setrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)
1251 if e1 != 0 {
1252 err = errnoErr(e1)
1253 }
1254 return
1255 }
1256
1257
1258
1259 func Stat(path string, stat *Stat_t) (err error) {
1260 var _p0 *byte
1261 _p0, err = BytePtrFromString(path)
1262 if err != nil {
1263 return
1264 }
1265 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Stat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
1266 if e1 != 0 {
1267 err = errnoErr(e1)
1268 }
1269 return
1270 }
1271
1272
1273
1274 func Statfs(path string, buf *Statfs_t) (err error) {
1275 var _p0 *byte
1276 _p0, err = BytePtrFromString(path)
1277 if err != nil {
1278 return
1279 }
1280 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Statfs)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0)
1281 if e1 != 0 {
1282 err = errnoErr(e1)
1283 }
1284 return
1285 }
1286
1287
1288
1289 func Symlink(path string, link string) (err error) {
1290 var _p0 *byte
1291 _p0, err = BytePtrFromString(path)
1292 if err != nil {
1293 return
1294 }
1295 var _p1 *byte
1296 _p1, err = BytePtrFromString(link)
1297 if err != nil {
1298 return
1299 }
1300 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Symlink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
1301 if e1 != 0 {
1302 err = errnoErr(e1)
1303 }
1304 return
1305 }
1306
1307
1308
1309 func Truncate(path string, length int64) (err error) {
1310 var _p0 *byte
1311 _p0, err = BytePtrFromString(path)
1312 if err != nil {
1313 return
1314 }
1315 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Truncate)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0, 0, 0, 0)
1316 if e1 != 0 {
1317 err = errnoErr(e1)
1318 }
1319 return
1320 }
1321
1322
1323
1324 func Umask(newmask int) (oldmask int) {
1325 r0, _, _ := syscall6(uintptr(unsafe.Pointer(&libc_Umask)), 1, uintptr(newmask), 0, 0, 0, 0, 0)
1326 oldmask = int(r0)
1327 return
1328 }
1329
1330
1331
1332 func Unlink(path string) (err error) {
1333 var _p0 *byte
1334 _p0, err = BytePtrFromString(path)
1335 if err != nil {
1336 return
1337 }
1338 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Unlink)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
1339 if e1 != 0 {
1340 err = errnoErr(e1)
1341 }
1342 return
1343 }
1344
1345
1346
1347 func Uname(buf *Utsname) (err error) {
1348 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Uname)), 1, uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0, 0)
1349 if e1 != 0 {
1350 err = errnoErr(e1)
1351 }
1352 return
1353 }
1354
1355
1356
1357 func write(fd int, p []byte) (n int, err error) {
1358 var _p0 *byte
1359 if len(p) > 0 {
1360 _p0 = &p[0]
1361 }
1362 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_write)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)
1363 n = int(r0)
1364 if e1 != 0 {
1365 err = errnoErr(e1)
1366 }
1367 return
1368 }
1369
1370
1371
1372 func gettimeofday(tv *Timeval, tzp *Timezone) (err error) {
1373 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_gettimeofday)), 2, uintptr(unsafe.Pointer(tv)), uintptr(unsafe.Pointer(tzp)), 0, 0, 0, 0)
1374 if e1 != 0 {
1375 err = errnoErr(e1)
1376 }
1377 return
1378 }
1379
1380
1381
1382 func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
1383 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_mmap)), 6, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
1384 ret = uintptr(r0)
1385 if e1 != 0 {
1386 err = errnoErr(e1)
1387 }
1388 return
1389 }
1390
1391
1392
1393 func munmap(addr uintptr, length uintptr) (err error) {
1394 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_munmap)), 2, uintptr(addr), uintptr(length), 0, 0, 0, 0)
1395 if e1 != 0 {
1396 err = errnoErr(e1)
1397 }
1398 return
1399 }
1400
View as plain text