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