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