Source file
src/syscall/zsyscall_aix_ppc64.go
Documentation: syscall
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 ptrace64Ptr(request int, id int64, addr int64, data int, buff unsafe.Pointer) (err error) {
662 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_ptrace64)), 5, uintptr(request), uintptr(id), uintptr(addr), uintptr(data), uintptr(buff), 0)
663 if e1 != 0 {
664 err = errnoErr(e1)
665 }
666 return
667 }
668
669
670
671 func Acct(path string) (err error) {
672 var _p0 *byte
673 _p0, err = BytePtrFromString(path)
674 if err != nil {
675 return
676 }
677 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Acct)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
678 if e1 != 0 {
679 err = errnoErr(e1)
680 }
681 return
682 }
683
684
685
686 func Chdir(path string) (err error) {
687 var _p0 *byte
688 _p0, err = BytePtrFromString(path)
689 if err != nil {
690 return
691 }
692 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Chdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
693 if e1 != 0 {
694 err = errnoErr(e1)
695 }
696 return
697 }
698
699
700
701 func Chmod(path string, mode uint32) (err error) {
702 var _p0 *byte
703 _p0, err = BytePtrFromString(path)
704 if err != nil {
705 return
706 }
707 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Chmod)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
708 if e1 != 0 {
709 err = errnoErr(e1)
710 }
711 return
712 }
713
714
715
716 func Chown(path string, uid int, gid int) (err error) {
717 var _p0 *byte
718 _p0, err = BytePtrFromString(path)
719 if err != nil {
720 return
721 }
722 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Chown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)
723 if e1 != 0 {
724 err = errnoErr(e1)
725 }
726 return
727 }
728
729
730
731 func Chroot(path string) (err error) {
732 var _p0 *byte
733 _p0, err = BytePtrFromString(path)
734 if err != nil {
735 return
736 }
737 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Chroot)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
738 if e1 != 0 {
739 err = errnoErr(e1)
740 }
741 return
742 }
743
744
745
746 func Close(fd int) (err error) {
747 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Close)), 1, uintptr(fd), 0, 0, 0, 0, 0)
748 if e1 != 0 {
749 err = errnoErr(e1)
750 }
751 return
752 }
753
754
755
756 func Dup(fd int) (nfd int, err error) {
757 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Dup)), 1, uintptr(fd), 0, 0, 0, 0, 0)
758 nfd = int(r0)
759 if e1 != 0 {
760 err = errnoErr(e1)
761 }
762 return
763 }
764
765
766
767 func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
768 var _p0 *byte
769 _p0, err = BytePtrFromString(path)
770 if err != nil {
771 return
772 }
773 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Faccessat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
774 if e1 != 0 {
775 err = errnoErr(e1)
776 }
777 return
778 }
779
780
781
782 func Fchdir(fd int) (err error) {
783 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0)
784 if e1 != 0 {
785 err = errnoErr(e1)
786 }
787 return
788 }
789
790
791
792 func Fchmod(fd int, mode uint32) (err error) {
793 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fchmod)), 2, uintptr(fd), uintptr(mode), 0, 0, 0, 0)
794 if e1 != 0 {
795 err = errnoErr(e1)
796 }
797 return
798 }
799
800
801
802 func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
803 var _p0 *byte
804 _p0, err = BytePtrFromString(path)
805 if err != nil {
806 return
807 }
808 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fchmodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
809 if e1 != 0 {
810 err = errnoErr(e1)
811 }
812 return
813 }
814
815
816
817 func Fchown(fd int, uid int, gid int) (err error) {
818 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fchown)), 3, uintptr(fd), uintptr(uid), uintptr(gid), 0, 0, 0)
819 if e1 != 0 {
820 err = errnoErr(e1)
821 }
822 return
823 }
824
825
826
827 func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
828 var _p0 *byte
829 _p0, err = BytePtrFromString(path)
830 if err != nil {
831 return
832 }
833 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fchownat)), 5, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
834 if e1 != 0 {
835 err = errnoErr(e1)
836 }
837 return
838 }
839
840
841
842 func Fpathconf(fd int, name int) (val int, err error) {
843 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fpathconf)), 2, uintptr(fd), uintptr(name), 0, 0, 0, 0)
844 val = int(r0)
845 if e1 != 0 {
846 err = errnoErr(e1)
847 }
848 return
849 }
850
851
852
853 func Fstat(fd int, stat *Stat_t) (err error) {
854 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fstat)), 2, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
855 if e1 != 0 {
856 err = errnoErr(e1)
857 }
858 return
859 }
860
861
862
863 func Fstatfs(fd int, buf *Statfs_t) (err error) {
864 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Fstatfs)), 2, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0)
865 if e1 != 0 {
866 err = errnoErr(e1)
867 }
868 return
869 }
870
871
872
873 func Ftruncate(fd int, length int64) (err error) {
874 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Ftruncate)), 2, uintptr(fd), uintptr(length), 0, 0, 0, 0)
875 if e1 != 0 {
876 err = errnoErr(e1)
877 }
878 return
879 }
880
881
882
883 func Getgid() (gid int) {
884 r0, _, _ := rawSyscall6(uintptr(unsafe.Pointer(&libc_Getgid)), 0, 0, 0, 0, 0, 0, 0)
885 gid = int(r0)
886 return
887 }
888
889
890
891 func Getpid() (pid int) {
892 r0, _, _ := rawSyscall6(uintptr(unsafe.Pointer(&libc_Getpid)), 0, 0, 0, 0, 0, 0, 0)
893 pid = int(r0)
894 return
895 }
896
897
898
899 func Geteuid() (euid int) {
900 r0, _, _ := syscall6(uintptr(unsafe.Pointer(&libc_Geteuid)), 0, 0, 0, 0, 0, 0, 0)
901 euid = int(r0)
902 return
903 }
904
905
906
907 func Getegid() (egid int) {
908 r0, _, _ := syscall6(uintptr(unsafe.Pointer(&libc_Getegid)), 0, 0, 0, 0, 0, 0, 0)
909 egid = int(r0)
910 return
911 }
912
913
914
915 func Getppid() (ppid int) {
916 r0, _, _ := syscall6(uintptr(unsafe.Pointer(&libc_Getppid)), 0, 0, 0, 0, 0, 0, 0)
917 ppid = int(r0)
918 return
919 }
920
921
922
923 func Getpriority(which int, who int) (n int, err error) {
924 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Getpriority)), 2, uintptr(which), uintptr(who), 0, 0, 0, 0)
925 n = int(r0)
926 if e1 != 0 {
927 err = errnoErr(e1)
928 }
929 return
930 }
931
932
933
934 func Getrlimit(which int, lim *Rlimit) (err error) {
935 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Getrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)
936 if e1 != 0 {
937 err = errnoErr(e1)
938 }
939 return
940 }
941
942
943
944 func Getrusage(who int, rusage *Rusage) (err error) {
945 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Getrusage)), 2, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0, 0, 0, 0)
946 if e1 != 0 {
947 err = errnoErr(e1)
948 }
949 return
950 }
951
952
953
954 func Getuid() (uid int) {
955 r0, _, _ := rawSyscall6(uintptr(unsafe.Pointer(&libc_Getuid)), 0, 0, 0, 0, 0, 0, 0)
956 uid = int(r0)
957 return
958 }
959
960
961
962 func Kill(pid int, signum Signal) (err error) {
963 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Kill)), 2, uintptr(pid), uintptr(signum), 0, 0, 0, 0)
964 if e1 != 0 {
965 err = errnoErr(e1)
966 }
967 return
968 }
969
970
971
972 func Lchown(path string, uid int, gid int) (err error) {
973 var _p0 *byte
974 _p0, err = BytePtrFromString(path)
975 if err != nil {
976 return
977 }
978 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Lchown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)
979 if e1 != 0 {
980 err = errnoErr(e1)
981 }
982 return
983 }
984
985
986
987 func Link(path string, link string) (err error) {
988 var _p0 *byte
989 _p0, err = BytePtrFromString(path)
990 if err != nil {
991 return
992 }
993 var _p1 *byte
994 _p1, err = BytePtrFromString(link)
995 if err != nil {
996 return
997 }
998 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Link)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
999 if e1 != 0 {
1000 err = errnoErr(e1)
1001 }
1002 return
1003 }
1004
1005
1006
1007 func Lstat(path string, stat *Stat_t) (err error) {
1008 var _p0 *byte
1009 _p0, err = BytePtrFromString(path)
1010 if err != nil {
1011 return
1012 }
1013 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Lstat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
1014 if e1 != 0 {
1015 err = errnoErr(e1)
1016 }
1017 return
1018 }
1019
1020
1021
1022 func Mkdir(path string, mode uint32) (err error) {
1023 var _p0 *byte
1024 _p0, err = BytePtrFromString(path)
1025 if err != nil {
1026 return
1027 }
1028 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Mkdir)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
1029 if e1 != 0 {
1030 err = errnoErr(e1)
1031 }
1032 return
1033 }
1034
1035
1036
1037 func Mkdirat(dirfd int, path string, mode uint32) (err error) {
1038 var _p0 *byte
1039 _p0, err = BytePtrFromString(path)
1040 if err != nil {
1041 return
1042 }
1043 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Mkdirat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0)
1044 if e1 != 0 {
1045 err = errnoErr(e1)
1046 }
1047 return
1048 }
1049
1050
1051
1052 func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
1053 var _p0 *byte
1054 _p0, err = BytePtrFromString(path)
1055 if err != nil {
1056 return
1057 }
1058 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Mknodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
1059 if e1 != 0 {
1060 err = errnoErr(e1)
1061 }
1062 return
1063 }
1064
1065
1066
1067 func Open(path string, mode int, perm uint32) (fd int, err error) {
1068 var _p0 *byte
1069 _p0, err = BytePtrFromString(path)
1070 if err != nil {
1071 return
1072 }
1073 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Open)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0, 0)
1074 fd = int(r0)
1075 if e1 != 0 {
1076 err = errnoErr(e1)
1077 }
1078 return
1079 }
1080
1081
1082
1083 func pread(fd int, p []byte, offset int64) (n int, err error) {
1084 var _p0 *byte
1085 if len(p) > 0 {
1086 _p0 = &p[0]
1087 }
1088 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_pread)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)
1089 n = int(r0)
1090 if e1 != 0 {
1091 err = errnoErr(e1)
1092 }
1093 return
1094 }
1095
1096
1097
1098 func pwrite(fd int, p []byte, offset int64) (n int, err error) {
1099 var _p0 *byte
1100 if len(p) > 0 {
1101 _p0 = &p[0]
1102 }
1103 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_pwrite)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)
1104 n = int(r0)
1105 if e1 != 0 {
1106 err = errnoErr(e1)
1107 }
1108 return
1109 }
1110
1111
1112
1113 func read(fd int, p []byte) (n int, err error) {
1114 var _p0 *byte
1115 if len(p) > 0 {
1116 _p0 = &p[0]
1117 }
1118 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_read)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)
1119 n = int(r0)
1120 if e1 != 0 {
1121 err = errnoErr(e1)
1122 }
1123 return
1124 }
1125
1126
1127
1128 func Reboot(how int) (err error) {
1129 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Reboot)), 1, uintptr(how), 0, 0, 0, 0, 0)
1130 if e1 != 0 {
1131 err = errnoErr(e1)
1132 }
1133 return
1134 }
1135
1136
1137
1138 func Rename(from string, to string) (err error) {
1139 var _p0 *byte
1140 _p0, err = BytePtrFromString(from)
1141 if err != nil {
1142 return
1143 }
1144 var _p1 *byte
1145 _p1, err = BytePtrFromString(to)
1146 if err != nil {
1147 return
1148 }
1149 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Rename)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
1150 if e1 != 0 {
1151 err = errnoErr(e1)
1152 }
1153 return
1154 }
1155
1156
1157
1158 func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {
1159 var _p0 *byte
1160 _p0, err = BytePtrFromString(oldpath)
1161 if err != nil {
1162 return
1163 }
1164 var _p1 *byte
1165 _p1, err = BytePtrFromString(newpath)
1166 if err != nil {
1167 return
1168 }
1169 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Renameat)), 4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)
1170 if e1 != 0 {
1171 err = errnoErr(e1)
1172 }
1173 return
1174 }
1175
1176
1177
1178 func Rmdir(path string) (err error) {
1179 var _p0 *byte
1180 _p0, err = BytePtrFromString(path)
1181 if err != nil {
1182 return
1183 }
1184 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Rmdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
1185 if e1 != 0 {
1186 err = errnoErr(e1)
1187 }
1188 return
1189 }
1190
1191
1192
1193 func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
1194 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_lseek)), 3, uintptr(fd), uintptr(offset), uintptr(whence), 0, 0, 0)
1195 newoffset = int64(r0)
1196 if e1 != 0 {
1197 err = errnoErr(e1)
1198 }
1199 return
1200 }
1201
1202
1203
1204 func Setegid(egid int) (err error) {
1205 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Setegid)), 1, uintptr(egid), 0, 0, 0, 0, 0)
1206 if e1 != 0 {
1207 err = errnoErr(e1)
1208 }
1209 return
1210 }
1211
1212
1213
1214 func Seteuid(euid int) (err error) {
1215 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Seteuid)), 1, uintptr(euid), 0, 0, 0, 0, 0)
1216 if e1 != 0 {
1217 err = errnoErr(e1)
1218 }
1219 return
1220 }
1221
1222
1223
1224 func Setgid(gid int) (err error) {
1225 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Setgid)), 1, uintptr(gid), 0, 0, 0, 0, 0)
1226 if e1 != 0 {
1227 err = errnoErr(e1)
1228 }
1229 return
1230 }
1231
1232
1233
1234 func Setpgid(pid int, pgid int) (err error) {
1235 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Setpgid)), 2, uintptr(pid), uintptr(pgid), 0, 0, 0, 0)
1236 if e1 != 0 {
1237 err = errnoErr(e1)
1238 }
1239 return
1240 }
1241
1242
1243
1244 func Setpriority(which int, who int, prio int) (err error) {
1245 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Setpriority)), 3, uintptr(which), uintptr(who), uintptr(prio), 0, 0, 0)
1246 if e1 != 0 {
1247 err = errnoErr(e1)
1248 }
1249 return
1250 }
1251
1252
1253
1254 func Setregid(rgid int, egid int) (err error) {
1255 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Setregid)), 2, uintptr(rgid), uintptr(egid), 0, 0, 0, 0)
1256 if e1 != 0 {
1257 err = errnoErr(e1)
1258 }
1259 return
1260 }
1261
1262
1263
1264 func Setreuid(ruid int, euid int) (err error) {
1265 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Setreuid)), 2, uintptr(ruid), uintptr(euid), 0, 0, 0, 0)
1266 if e1 != 0 {
1267 err = errnoErr(e1)
1268 }
1269 return
1270 }
1271
1272
1273
1274 func setrlimit(which int, lim *Rlimit) (err error) {
1275 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_setrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)
1276 if e1 != 0 {
1277 err = errnoErr(e1)
1278 }
1279 return
1280 }
1281
1282
1283
1284 func Stat(path string, stat *Stat_t) (err error) {
1285 var _p0 *byte
1286 _p0, err = BytePtrFromString(path)
1287 if err != nil {
1288 return
1289 }
1290 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Stat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
1291 if e1 != 0 {
1292 err = errnoErr(e1)
1293 }
1294 return
1295 }
1296
1297
1298
1299 func Statfs(path string, buf *Statfs_t) (err error) {
1300 var _p0 *byte
1301 _p0, err = BytePtrFromString(path)
1302 if err != nil {
1303 return
1304 }
1305 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Statfs)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0)
1306 if e1 != 0 {
1307 err = errnoErr(e1)
1308 }
1309 return
1310 }
1311
1312
1313
1314 func Symlink(path string, link string) (err error) {
1315 var _p0 *byte
1316 _p0, err = BytePtrFromString(path)
1317 if err != nil {
1318 return
1319 }
1320 var _p1 *byte
1321 _p1, err = BytePtrFromString(link)
1322 if err != nil {
1323 return
1324 }
1325 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Symlink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
1326 if e1 != 0 {
1327 err = errnoErr(e1)
1328 }
1329 return
1330 }
1331
1332
1333
1334 func Truncate(path string, length int64) (err error) {
1335 var _p0 *byte
1336 _p0, err = BytePtrFromString(path)
1337 if err != nil {
1338 return
1339 }
1340 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Truncate)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0, 0, 0, 0)
1341 if e1 != 0 {
1342 err = errnoErr(e1)
1343 }
1344 return
1345 }
1346
1347
1348
1349 func Umask(newmask int) (oldmask int) {
1350 r0, _, _ := syscall6(uintptr(unsafe.Pointer(&libc_Umask)), 1, uintptr(newmask), 0, 0, 0, 0, 0)
1351 oldmask = int(r0)
1352 return
1353 }
1354
1355
1356
1357 func Unlink(path string) (err error) {
1358 var _p0 *byte
1359 _p0, err = BytePtrFromString(path)
1360 if err != nil {
1361 return
1362 }
1363 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Unlink)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
1364 if e1 != 0 {
1365 err = errnoErr(e1)
1366 }
1367 return
1368 }
1369
1370
1371
1372 func Uname(buf *Utsname) (err error) {
1373 _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Uname)), 1, uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0, 0)
1374 if e1 != 0 {
1375 err = errnoErr(e1)
1376 }
1377 return
1378 }
1379
1380
1381
1382 func write(fd int, p []byte) (n int, err error) {
1383 var _p0 *byte
1384 if len(p) > 0 {
1385 _p0 = &p[0]
1386 }
1387 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_write)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)
1388 n = int(r0)
1389 if e1 != 0 {
1390 err = errnoErr(e1)
1391 }
1392 return
1393 }
1394
1395
1396
1397 func writev(fd int, iovecs []Iovec) (n uintptr, err error) {
1398 var _p0 *Iovec
1399 if len(iovecs) > 0 {
1400 _p0 = &iovecs[0]
1401 }
1402 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_writev)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovecs)), 0, 0, 0)
1403 n = uintptr(r0)
1404 if e1 != 0 {
1405 err = errnoErr(e1)
1406 }
1407 return
1408 }
1409
1410
1411
1412 func gettimeofday(tv *Timeval, tzp *Timezone) (err error) {
1413 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_gettimeofday)), 2, uintptr(unsafe.Pointer(tv)), uintptr(unsafe.Pointer(tzp)), 0, 0, 0, 0)
1414 if e1 != 0 {
1415 err = errnoErr(e1)
1416 }
1417 return
1418 }
1419
1420
1421
1422 func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
1423 r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_mmap)), 6, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
1424 ret = uintptr(r0)
1425 if e1 != 0 {
1426 err = errnoErr(e1)
1427 }
1428 return
1429 }
1430
1431
1432
1433 func munmap(addr uintptr, length uintptr) (err error) {
1434 _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_munmap)), 2, uintptr(addr), uintptr(length), 0, 0, 0, 0)
1435 if e1 != 0 {
1436 err = errnoErr(e1)
1437 }
1438 return
1439 }
1440
View as plain text