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