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