1
2
3
4
5
6
7 package unix
8
9 import (
10 "syscall"
11 "unsafe"
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286 var (
287 procpipe,
288 procpipe2,
289 procgetsockname,
290 procGetcwd,
291 procgetgroups,
292 procsetgroups,
293 procwait4,
294 procgethostname,
295 procutimes,
296 procutimensat,
297 procfcntl,
298 procfutimesat,
299 procaccept,
300 proc__xnet_recvmsg,
301 proc__xnet_sendmsg,
302 procacct,
303 proc__makedev,
304 proc__major,
305 proc__minor,
306 procioctl,
307 procpoll,
308 procAccess,
309 procAdjtime,
310 procChdir,
311 procChmod,
312 procChown,
313 procChroot,
314 procClose,
315 procCreat,
316 procDup,
317 procDup2,
318 procExit,
319 procFaccessat,
320 procFchdir,
321 procFchmod,
322 procFchmodat,
323 procFchown,
324 procFchownat,
325 procFdatasync,
326 procFlock,
327 procFpathconf,
328 procFstat,
329 procFstatat,
330 procFstatvfs,
331 procGetdents,
332 procGetgid,
333 procGetpid,
334 procGetpgid,
335 procGetpgrp,
336 procGeteuid,
337 procGetegid,
338 procGetppid,
339 procGetpriority,
340 procGetrlimit,
341 procGetrusage,
342 procGettimeofday,
343 procGetuid,
344 procKill,
345 procLchown,
346 procLink,
347 proc__xnet_llisten,
348 procLstat,
349 procMadvise,
350 procMkdir,
351 procMkdirat,
352 procMkfifo,
353 procMkfifoat,
354 procMknod,
355 procMknodat,
356 procMlock,
357 procMlockall,
358 procMprotect,
359 procMsync,
360 procMunlock,
361 procMunlockall,
362 procNanosleep,
363 procOpen,
364 procOpenat,
365 procPathconf,
366 procPause,
367 procPread,
368 procPwrite,
369 procread,
370 procReadlink,
371 procRename,
372 procRenameat,
373 procRmdir,
374 proclseek,
375 procSelect,
376 procSetegid,
377 procSeteuid,
378 procSetgid,
379 procSethostname,
380 procSetpgid,
381 procSetpriority,
382 procSetregid,
383 procSetreuid,
384 procSetrlimit,
385 procSetsid,
386 procSetuid,
387 procshutdown,
388 procStat,
389 procStatvfs,
390 procSymlink,
391 procSync,
392 procSysconf,
393 procTimes,
394 procTruncate,
395 procFsync,
396 procFtruncate,
397 procUmask,
398 procUname,
399 procumount,
400 procUnlink,
401 procUnlinkat,
402 procUstat,
403 procUtime,
404 proc__xnet_bind,
405 proc__xnet_connect,
406 procmmap,
407 procmunmap,
408 procsendfile,
409 proc__xnet_sendto,
410 proc__xnet_socket,
411 proc__xnet_socketpair,
412 procwrite,
413 proc__xnet_getsockopt,
414 procgetpeername,
415 procsetsockopt,
416 procrecvfrom,
417 procport_create,
418 procport_associate,
419 procport_dissociate,
420 procport_get,
421 procport_getn syscallFunc
422 )
423
424
425
426 func pipe(p *[2]_C_int) (n int, err error) {
427 r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procpipe)), 1, uintptr(unsafe.Pointer(p)), 0, 0, 0, 0, 0)
428 n = int(r0)
429 if e1 != 0 {
430 err = e1
431 }
432 return
433 }
434
435
436
437 func pipe2(p *[2]_C_int, flags int) (err error) {
438 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procpipe2)), 2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0, 0, 0, 0)
439 if e1 != 0 {
440 err = e1
441 }
442 return
443 }
444
445
446
447 func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
448 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetsockname)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
449 if e1 != 0 {
450 err = e1
451 }
452 return
453 }
454
455
456
457 func Getcwd(buf []byte) (n int, err error) {
458 var _p0 *byte
459 if len(buf) > 0 {
460 _p0 = &buf[0]
461 }
462 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetcwd)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0, 0, 0, 0)
463 n = int(r0)
464 if e1 != 0 {
465 err = e1
466 }
467 return
468 }
469
470
471
472 func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
473 r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procgetgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0)
474 n = int(r0)
475 if e1 != 0 {
476 err = e1
477 }
478 return
479 }
480
481
482
483 func setgroups(ngid int, gid *_Gid_t) (err error) {
484 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procsetgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0)
485 if e1 != 0 {
486 err = e1
487 }
488 return
489 }
490
491
492
493 func wait4(pid int32, statusp *_C_int, options int, rusage *Rusage) (wpid int32, err error) {
494 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwait4)), 4, uintptr(pid), uintptr(unsafe.Pointer(statusp)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
495 wpid = int32(r0)
496 if e1 != 0 {
497 err = e1
498 }
499 return
500 }
501
502
503
504 func gethostname(buf []byte) (n int, err error) {
505 var _p0 *byte
506 if len(buf) > 0 {
507 _p0 = &buf[0]
508 }
509 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgethostname)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0, 0, 0, 0)
510 n = int(r0)
511 if e1 != 0 {
512 err = e1
513 }
514 return
515 }
516
517
518
519 func utimes(path string, times *[2]Timeval) (err error) {
520 var _p0 *byte
521 _p0, err = BytePtrFromString(path)
522 if err != nil {
523 return
524 }
525 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procutimes)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0, 0, 0, 0)
526 if e1 != 0 {
527 err = e1
528 }
529 return
530 }
531
532
533
534 func utimensat(fd int, path string, times *[2]Timespec, flag int) (err error) {
535 var _p0 *byte
536 _p0, err = BytePtrFromString(path)
537 if err != nil {
538 return
539 }
540 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procutimensat)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flag), 0, 0)
541 if e1 != 0 {
542 err = e1
543 }
544 return
545 }
546
547
548
549 func fcntl(fd int, cmd int, arg int) (val int, err error) {
550 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0)
551 val = int(r0)
552 if e1 != 0 {
553 err = e1
554 }
555 return
556 }
557
558
559
560 func futimesat(fildes int, path *byte, times *[2]Timeval) (err error) {
561 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfutimesat)), 3, uintptr(fildes), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)), 0, 0, 0)
562 if e1 != 0 {
563 err = e1
564 }
565 return
566 }
567
568
569
570 func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
571 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procaccept)), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
572 fd = int(r0)
573 if e1 != 0 {
574 err = e1
575 }
576 return
577 }
578
579
580
581 func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
582 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_recvmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
583 n = int(r0)
584 if e1 != 0 {
585 err = e1
586 }
587 return
588 }
589
590
591
592 func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
593 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_sendmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
594 n = int(r0)
595 if e1 != 0 {
596 err = e1
597 }
598 return
599 }
600
601
602
603 func acct(path *byte) (err error) {
604 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procacct)), 1, uintptr(unsafe.Pointer(path)), 0, 0, 0, 0, 0)
605 if e1 != 0 {
606 err = e1
607 }
608 return
609 }
610
611
612
613 func __makedev(version int, major uint, minor uint) (val uint64) {
614 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&proc__makedev)), 3, uintptr(version), uintptr(major), uintptr(minor), 0, 0, 0)
615 val = uint64(r0)
616 return
617 }
618
619
620
621 func __major(version int, dev uint64) (val uint) {
622 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&proc__major)), 2, uintptr(version), uintptr(dev), 0, 0, 0, 0)
623 val = uint(r0)
624 return
625 }
626
627
628
629 func __minor(version int, dev uint64) (val uint) {
630 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&proc__minor)), 2, uintptr(version), uintptr(dev), 0, 0, 0, 0)
631 val = uint(r0)
632 return
633 }
634
635
636
637 func ioctlRet(fd int, req uint, arg uintptr) (ret int, err error) {
638 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0)
639 ret = int(r0)
640 if e1 != 0 {
641 err = e1
642 }
643 return
644 }
645
646
647
648 func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
649 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpoll)), 3, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout), 0, 0, 0)
650 n = int(r0)
651 if e1 != 0 {
652 err = e1
653 }
654 return
655 }
656
657
658
659 func Access(path string, mode uint32) (err error) {
660 var _p0 *byte
661 _p0, err = BytePtrFromString(path)
662 if err != nil {
663 return
664 }
665 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procAccess)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
666 if e1 != 0 {
667 err = e1
668 }
669 return
670 }
671
672
673
674 func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
675 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procAdjtime)), 2, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0, 0, 0, 0)
676 if e1 != 0 {
677 err = e1
678 }
679 return
680 }
681
682
683
684 func Chdir(path string) (err error) {
685 var _p0 *byte
686 _p0, err = BytePtrFromString(path)
687 if err != nil {
688 return
689 }
690 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
691 if e1 != 0 {
692 err = e1
693 }
694 return
695 }
696
697
698
699 func Chmod(path string, mode uint32) (err error) {
700 var _p0 *byte
701 _p0, err = BytePtrFromString(path)
702 if err != nil {
703 return
704 }
705 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChmod)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
706 if e1 != 0 {
707 err = e1
708 }
709 return
710 }
711
712
713
714 func Chown(path string, uid int, gid int) (err error) {
715 var _p0 *byte
716 _p0, err = BytePtrFromString(path)
717 if err != nil {
718 return
719 }
720 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)
721 if e1 != 0 {
722 err = e1
723 }
724 return
725 }
726
727
728
729 func Chroot(path string) (err error) {
730 var _p0 *byte
731 _p0, err = BytePtrFromString(path)
732 if err != nil {
733 return
734 }
735 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChroot)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
736 if e1 != 0 {
737 err = e1
738 }
739 return
740 }
741
742
743
744 func Close(fd int) (err error) {
745 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procClose)), 1, uintptr(fd), 0, 0, 0, 0, 0)
746 if e1 != 0 {
747 err = e1
748 }
749 return
750 }
751
752
753
754 func Creat(path string, mode uint32) (fd int, err error) {
755 var _p0 *byte
756 _p0, err = BytePtrFromString(path)
757 if err != nil {
758 return
759 }
760 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procCreat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
761 fd = int(r0)
762 if e1 != 0 {
763 err = e1
764 }
765 return
766 }
767
768
769
770 func Dup(fd int) (nfd int, err error) {
771 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procDup)), 1, uintptr(fd), 0, 0, 0, 0, 0)
772 nfd = int(r0)
773 if e1 != 0 {
774 err = e1
775 }
776 return
777 }
778
779
780
781 func Dup2(oldfd int, newfd int) (err error) {
782 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procDup2)), 2, uintptr(oldfd), uintptr(newfd), 0, 0, 0, 0)
783 if e1 != 0 {
784 err = e1
785 }
786 return
787 }
788
789
790
791 func Exit(code int) {
792 sysvicall6(uintptr(unsafe.Pointer(&procExit)), 1, uintptr(code), 0, 0, 0, 0, 0)
793 return
794 }
795
796
797
798 func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
799 var _p0 *byte
800 _p0, err = BytePtrFromString(path)
801 if err != nil {
802 return
803 }
804 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFaccessat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
805 if e1 != 0 {
806 err = e1
807 }
808 return
809 }
810
811
812
813 func Fchdir(fd int) (err error) {
814 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0)
815 if e1 != 0 {
816 err = e1
817 }
818 return
819 }
820
821
822
823 func Fchmod(fd int, mode uint32) (err error) {
824 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchmod)), 2, uintptr(fd), uintptr(mode), 0, 0, 0, 0)
825 if e1 != 0 {
826 err = e1
827 }
828 return
829 }
830
831
832
833 func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
834 var _p0 *byte
835 _p0, err = BytePtrFromString(path)
836 if err != nil {
837 return
838 }
839 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchmodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
840 if e1 != 0 {
841 err = e1
842 }
843 return
844 }
845
846
847
848 func Fchown(fd int, uid int, gid int) (err error) {
849 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchown)), 3, uintptr(fd), uintptr(uid), uintptr(gid), 0, 0, 0)
850 if e1 != 0 {
851 err = e1
852 }
853 return
854 }
855
856
857
858 func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
859 var _p0 *byte
860 _p0, err = BytePtrFromString(path)
861 if err != nil {
862 return
863 }
864 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchownat)), 5, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
865 if e1 != 0 {
866 err = e1
867 }
868 return
869 }
870
871
872
873 func Fdatasync(fd int) (err error) {
874 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFdatasync)), 1, uintptr(fd), 0, 0, 0, 0, 0)
875 if e1 != 0 {
876 err = e1
877 }
878 return
879 }
880
881
882
883 func Flock(fd int, how int) (err error) {
884 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFlock)), 2, uintptr(fd), uintptr(how), 0, 0, 0, 0)
885 if e1 != 0 {
886 err = e1
887 }
888 return
889 }
890
891
892
893 func Fpathconf(fd int, name int) (val int, err error) {
894 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFpathconf)), 2, uintptr(fd), uintptr(name), 0, 0, 0, 0)
895 val = int(r0)
896 if e1 != 0 {
897 err = e1
898 }
899 return
900 }
901
902
903
904 func Fstat(fd int, stat *Stat_t) (err error) {
905 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFstat)), 2, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
906 if e1 != 0 {
907 err = e1
908 }
909 return
910 }
911
912
913
914 func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) {
915 var _p0 *byte
916 _p0, err = BytePtrFromString(path)
917 if err != nil {
918 return
919 }
920 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFstatat)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
921 if e1 != 0 {
922 err = e1
923 }
924 return
925 }
926
927
928
929 func Fstatvfs(fd int, vfsstat *Statvfs_t) (err error) {
930 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFstatvfs)), 2, uintptr(fd), uintptr(unsafe.Pointer(vfsstat)), 0, 0, 0, 0)
931 if e1 != 0 {
932 err = e1
933 }
934 return
935 }
936
937
938
939 func Getdents(fd int, buf []byte, basep *uintptr) (n int, err error) {
940 var _p0 *byte
941 if len(buf) > 0 {
942 _p0 = &buf[0]
943 }
944 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetdents)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
945 n = int(r0)
946 if e1 != 0 {
947 err = e1
948 }
949 return
950 }
951
952
953
954 func Getgid() (gid int) {
955 r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetgid)), 0, 0, 0, 0, 0, 0, 0)
956 gid = int(r0)
957 return
958 }
959
960
961
962 func Getpid() (pid int) {
963 r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpid)), 0, 0, 0, 0, 0, 0, 0)
964 pid = int(r0)
965 return
966 }
967
968
969
970 func Getpgid(pid int) (pgid int, err error) {
971 r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpgid)), 1, uintptr(pid), 0, 0, 0, 0, 0)
972 pgid = int(r0)
973 if e1 != 0 {
974 err = e1
975 }
976 return
977 }
978
979
980
981 func Getpgrp() (pgid int, err error) {
982 r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpgrp)), 0, 0, 0, 0, 0, 0, 0)
983 pgid = int(r0)
984 if e1 != 0 {
985 err = e1
986 }
987 return
988 }
989
990
991
992 func Geteuid() (euid int) {
993 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGeteuid)), 0, 0, 0, 0, 0, 0, 0)
994 euid = int(r0)
995 return
996 }
997
998
999
1000 func Getegid() (egid int) {
1001 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGetegid)), 0, 0, 0, 0, 0, 0, 0)
1002 egid = int(r0)
1003 return
1004 }
1005
1006
1007
1008 func Getppid() (ppid int) {
1009 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGetppid)), 0, 0, 0, 0, 0, 0, 0)
1010 ppid = int(r0)
1011 return
1012 }
1013
1014
1015
1016 func Getpriority(which int, who int) (n int, err error) {
1017 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetpriority)), 2, uintptr(which), uintptr(who), 0, 0, 0, 0)
1018 n = int(r0)
1019 if e1 != 0 {
1020 err = e1
1021 }
1022 return
1023 }
1024
1025
1026
1027 func Getrlimit(which int, lim *Rlimit) (err error) {
1028 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)
1029 if e1 != 0 {
1030 err = e1
1031 }
1032 return
1033 }
1034
1035
1036
1037 func Getrusage(who int, rusage *Rusage) (err error) {
1038 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetrusage)), 2, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0, 0, 0, 0)
1039 if e1 != 0 {
1040 err = e1
1041 }
1042 return
1043 }
1044
1045
1046
1047 func Gettimeofday(tv *Timeval) (err error) {
1048 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGettimeofday)), 1, uintptr(unsafe.Pointer(tv)), 0, 0, 0, 0, 0)
1049 if e1 != 0 {
1050 err = e1
1051 }
1052 return
1053 }
1054
1055
1056
1057 func Getuid() (uid int) {
1058 r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetuid)), 0, 0, 0, 0, 0, 0, 0)
1059 uid = int(r0)
1060 return
1061 }
1062
1063
1064
1065 func Kill(pid int, signum syscall.Signal) (err error) {
1066 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procKill)), 2, uintptr(pid), uintptr(signum), 0, 0, 0, 0)
1067 if e1 != 0 {
1068 err = e1
1069 }
1070 return
1071 }
1072
1073
1074
1075 func Lchown(path string, uid int, gid int) (err error) {
1076 var _p0 *byte
1077 _p0, err = BytePtrFromString(path)
1078 if err != nil {
1079 return
1080 }
1081 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLchown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)
1082 if e1 != 0 {
1083 err = e1
1084 }
1085 return
1086 }
1087
1088
1089
1090 func Link(path string, link string) (err error) {
1091 var _p0 *byte
1092 _p0, err = BytePtrFromString(path)
1093 if err != nil {
1094 return
1095 }
1096 var _p1 *byte
1097 _p1, err = BytePtrFromString(link)
1098 if err != nil {
1099 return
1100 }
1101 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
1102 if e1 != 0 {
1103 err = e1
1104 }
1105 return
1106 }
1107
1108
1109
1110 func Listen(s int, backlog int) (err error) {
1111 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_llisten)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0)
1112 if e1 != 0 {
1113 err = e1
1114 }
1115 return
1116 }
1117
1118
1119
1120 func Lstat(path string, stat *Stat_t) (err error) {
1121 var _p0 *byte
1122 _p0, err = BytePtrFromString(path)
1123 if err != nil {
1124 return
1125 }
1126 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLstat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
1127 if e1 != 0 {
1128 err = e1
1129 }
1130 return
1131 }
1132
1133
1134
1135 func Madvise(b []byte, advice int) (err error) {
1136 var _p0 *byte
1137 if len(b) > 0 {
1138 _p0 = &b[0]
1139 }
1140 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMadvise)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(advice), 0, 0, 0)
1141 if e1 != 0 {
1142 err = e1
1143 }
1144 return
1145 }
1146
1147
1148
1149 func Mkdir(path string, mode uint32) (err error) {
1150 var _p0 *byte
1151 _p0, err = BytePtrFromString(path)
1152 if err != nil {
1153 return
1154 }
1155 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkdir)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
1156 if e1 != 0 {
1157 err = e1
1158 }
1159 return
1160 }
1161
1162
1163
1164 func Mkdirat(dirfd int, path string, mode uint32) (err error) {
1165 var _p0 *byte
1166 _p0, err = BytePtrFromString(path)
1167 if err != nil {
1168 return
1169 }
1170 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkdirat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0)
1171 if e1 != 0 {
1172 err = e1
1173 }
1174 return
1175 }
1176
1177
1178
1179 func Mkfifo(path string, mode uint32) (err error) {
1180 var _p0 *byte
1181 _p0, err = BytePtrFromString(path)
1182 if err != nil {
1183 return
1184 }
1185 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkfifo)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
1186 if e1 != 0 {
1187 err = e1
1188 }
1189 return
1190 }
1191
1192
1193
1194 func Mkfifoat(dirfd int, path string, mode uint32) (err error) {
1195 var _p0 *byte
1196 _p0, err = BytePtrFromString(path)
1197 if err != nil {
1198 return
1199 }
1200 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkfifoat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0)
1201 if e1 != 0 {
1202 err = e1
1203 }
1204 return
1205 }
1206
1207
1208
1209 func Mknod(path string, mode uint32, dev int) (err error) {
1210 var _p0 *byte
1211 _p0, err = BytePtrFromString(path)
1212 if err != nil {
1213 return
1214 }
1215 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMknod)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0, 0)
1216 if e1 != 0 {
1217 err = e1
1218 }
1219 return
1220 }
1221
1222
1223
1224 func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
1225 var _p0 *byte
1226 _p0, err = BytePtrFromString(path)
1227 if err != nil {
1228 return
1229 }
1230 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMknodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
1231 if e1 != 0 {
1232 err = e1
1233 }
1234 return
1235 }
1236
1237
1238
1239 func Mlock(b []byte) (err error) {
1240 var _p0 *byte
1241 if len(b) > 0 {
1242 _p0 = &b[0]
1243 }
1244 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMlock)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), 0, 0, 0, 0)
1245 if e1 != 0 {
1246 err = e1
1247 }
1248 return
1249 }
1250
1251
1252
1253 func Mlockall(flags int) (err error) {
1254 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMlockall)), 1, uintptr(flags), 0, 0, 0, 0, 0)
1255 if e1 != 0 {
1256 err = e1
1257 }
1258 return
1259 }
1260
1261
1262
1263 func Mprotect(b []byte, prot int) (err error) {
1264 var _p0 *byte
1265 if len(b) > 0 {
1266 _p0 = &b[0]
1267 }
1268 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMprotect)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(prot), 0, 0, 0)
1269 if e1 != 0 {
1270 err = e1
1271 }
1272 return
1273 }
1274
1275
1276
1277 func Msync(b []byte, flags int) (err error) {
1278 var _p0 *byte
1279 if len(b) > 0 {
1280 _p0 = &b[0]
1281 }
1282 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMsync)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(flags), 0, 0, 0)
1283 if e1 != 0 {
1284 err = e1
1285 }
1286 return
1287 }
1288
1289
1290
1291 func Munlock(b []byte) (err error) {
1292 var _p0 *byte
1293 if len(b) > 0 {
1294 _p0 = &b[0]
1295 }
1296 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMunlock)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), 0, 0, 0, 0)
1297 if e1 != 0 {
1298 err = e1
1299 }
1300 return
1301 }
1302
1303
1304
1305 func Munlockall() (err error) {
1306 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMunlockall)), 0, 0, 0, 0, 0, 0, 0)
1307 if e1 != 0 {
1308 err = e1
1309 }
1310 return
1311 }
1312
1313
1314
1315 func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
1316 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procNanosleep)), 2, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0, 0, 0, 0)
1317 if e1 != 0 {
1318 err = e1
1319 }
1320 return
1321 }
1322
1323
1324
1325 func Open(path string, mode int, perm uint32) (fd int, err error) {
1326 var _p0 *byte
1327 _p0, err = BytePtrFromString(path)
1328 if err != nil {
1329 return
1330 }
1331 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procOpen)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0, 0)
1332 fd = int(r0)
1333 if e1 != 0 {
1334 err = e1
1335 }
1336 return
1337 }
1338
1339
1340
1341 func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {
1342 var _p0 *byte
1343 _p0, err = BytePtrFromString(path)
1344 if err != nil {
1345 return
1346 }
1347 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procOpenat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)
1348 fd = int(r0)
1349 if e1 != 0 {
1350 err = e1
1351 }
1352 return
1353 }
1354
1355
1356
1357 func Pathconf(path string, name int) (val int, err error) {
1358 var _p0 *byte
1359 _p0, err = BytePtrFromString(path)
1360 if err != nil {
1361 return
1362 }
1363 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPathconf)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0, 0, 0, 0)
1364 val = int(r0)
1365 if e1 != 0 {
1366 err = e1
1367 }
1368 return
1369 }
1370
1371
1372
1373 func Pause() (err error) {
1374 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPause)), 0, 0, 0, 0, 0, 0, 0)
1375 if e1 != 0 {
1376 err = e1
1377 }
1378 return
1379 }
1380
1381
1382
1383 func Pread(fd int, p []byte, offset int64) (n int, err error) {
1384 var _p0 *byte
1385 if len(p) > 0 {
1386 _p0 = &p[0]
1387 }
1388 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPread)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)
1389 n = int(r0)
1390 if e1 != 0 {
1391 err = e1
1392 }
1393 return
1394 }
1395
1396
1397
1398 func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
1399 var _p0 *byte
1400 if len(p) > 0 {
1401 _p0 = &p[0]
1402 }
1403 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPwrite)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)
1404 n = int(r0)
1405 if e1 != 0 {
1406 err = e1
1407 }
1408 return
1409 }
1410
1411
1412
1413 func read(fd int, p []byte) (n int, err error) {
1414 var _p0 *byte
1415 if len(p) > 0 {
1416 _p0 = &p[0]
1417 }
1418 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procread)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)
1419 n = int(r0)
1420 if e1 != 0 {
1421 err = e1
1422 }
1423 return
1424 }
1425
1426
1427
1428 func Readlink(path string, buf []byte) (n int, err error) {
1429 var _p0 *byte
1430 _p0, err = BytePtrFromString(path)
1431 if err != nil {
1432 return
1433 }
1434 var _p1 *byte
1435 if len(buf) > 0 {
1436 _p1 = &buf[0]
1437 }
1438 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procReadlink)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(len(buf)), 0, 0, 0)
1439 n = int(r0)
1440 if e1 != 0 {
1441 err = e1
1442 }
1443 return
1444 }
1445
1446
1447
1448 func Rename(from string, to string) (err error) {
1449 var _p0 *byte
1450 _p0, err = BytePtrFromString(from)
1451 if err != nil {
1452 return
1453 }
1454 var _p1 *byte
1455 _p1, err = BytePtrFromString(to)
1456 if err != nil {
1457 return
1458 }
1459 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRename)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
1460 if e1 != 0 {
1461 err = e1
1462 }
1463 return
1464 }
1465
1466
1467
1468 func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {
1469 var _p0 *byte
1470 _p0, err = BytePtrFromString(oldpath)
1471 if err != nil {
1472 return
1473 }
1474 var _p1 *byte
1475 _p1, err = BytePtrFromString(newpath)
1476 if err != nil {
1477 return
1478 }
1479 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRenameat)), 4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)
1480 if e1 != 0 {
1481 err = e1
1482 }
1483 return
1484 }
1485
1486
1487
1488 func Rmdir(path string) (err error) {
1489 var _p0 *byte
1490 _p0, err = BytePtrFromString(path)
1491 if err != nil {
1492 return
1493 }
1494 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRmdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
1495 if e1 != 0 {
1496 err = e1
1497 }
1498 return
1499 }
1500
1501
1502
1503 func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
1504 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proclseek)), 3, uintptr(fd), uintptr(offset), uintptr(whence), 0, 0, 0)
1505 newoffset = int64(r0)
1506 if e1 != 0 {
1507 err = e1
1508 }
1509 return
1510 }
1511
1512
1513
1514 func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
1515 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSelect)), 5, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
1516 n = int(r0)
1517 if e1 != 0 {
1518 err = e1
1519 }
1520 return
1521 }
1522
1523
1524
1525 func Setegid(egid int) (err error) {
1526 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetegid)), 1, uintptr(egid), 0, 0, 0, 0, 0)
1527 if e1 != 0 {
1528 err = e1
1529 }
1530 return
1531 }
1532
1533
1534
1535 func Seteuid(euid int) (err error) {
1536 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSeteuid)), 1, uintptr(euid), 0, 0, 0, 0, 0)
1537 if e1 != 0 {
1538 err = e1
1539 }
1540 return
1541 }
1542
1543
1544
1545 func Setgid(gid int) (err error) {
1546 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetgid)), 1, uintptr(gid), 0, 0, 0, 0, 0)
1547 if e1 != 0 {
1548 err = e1
1549 }
1550 return
1551 }
1552
1553
1554
1555 func Sethostname(p []byte) (err error) {
1556 var _p0 *byte
1557 if len(p) > 0 {
1558 _p0 = &p[0]
1559 }
1560 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSethostname)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0, 0)
1561 if e1 != 0 {
1562 err = e1
1563 }
1564 return
1565 }
1566
1567
1568
1569 func Setpgid(pid int, pgid int) (err error) {
1570 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetpgid)), 2, uintptr(pid), uintptr(pgid), 0, 0, 0, 0)
1571 if e1 != 0 {
1572 err = e1
1573 }
1574 return
1575 }
1576
1577
1578
1579 func Setpriority(which int, who int, prio int) (err error) {
1580 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSetpriority)), 3, uintptr(which), uintptr(who), uintptr(prio), 0, 0, 0)
1581 if e1 != 0 {
1582 err = e1
1583 }
1584 return
1585 }
1586
1587
1588
1589 func Setregid(rgid int, egid int) (err error) {
1590 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetregid)), 2, uintptr(rgid), uintptr(egid), 0, 0, 0, 0)
1591 if e1 != 0 {
1592 err = e1
1593 }
1594 return
1595 }
1596
1597
1598
1599 func Setreuid(ruid int, euid int) (err error) {
1600 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetreuid)), 2, uintptr(ruid), uintptr(euid), 0, 0, 0, 0)
1601 if e1 != 0 {
1602 err = e1
1603 }
1604 return
1605 }
1606
1607
1608
1609 func Setrlimit(which int, lim *Rlimit) (err error) {
1610 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)
1611 if e1 != 0 {
1612 err = e1
1613 }
1614 return
1615 }
1616
1617
1618
1619 func Setsid() (pid int, err error) {
1620 r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetsid)), 0, 0, 0, 0, 0, 0, 0)
1621 pid = int(r0)
1622 if e1 != 0 {
1623 err = e1
1624 }
1625 return
1626 }
1627
1628
1629
1630 func Setuid(uid int) (err error) {
1631 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetuid)), 1, uintptr(uid), 0, 0, 0, 0, 0)
1632 if e1 != 0 {
1633 err = e1
1634 }
1635 return
1636 }
1637
1638
1639
1640 func Shutdown(s int, how int) (err error) {
1641 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procshutdown)), 2, uintptr(s), uintptr(how), 0, 0, 0, 0)
1642 if e1 != 0 {
1643 err = e1
1644 }
1645 return
1646 }
1647
1648
1649
1650 func Stat(path string, stat *Stat_t) (err error) {
1651 var _p0 *byte
1652 _p0, err = BytePtrFromString(path)
1653 if err != nil {
1654 return
1655 }
1656 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procStat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
1657 if e1 != 0 {
1658 err = e1
1659 }
1660 return
1661 }
1662
1663
1664
1665 func Statvfs(path string, vfsstat *Statvfs_t) (err error) {
1666 var _p0 *byte
1667 _p0, err = BytePtrFromString(path)
1668 if err != nil {
1669 return
1670 }
1671 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procStatvfs)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(vfsstat)), 0, 0, 0, 0)
1672 if e1 != 0 {
1673 err = e1
1674 }
1675 return
1676 }
1677
1678
1679
1680 func Symlink(path string, link string) (err error) {
1681 var _p0 *byte
1682 _p0, err = BytePtrFromString(path)
1683 if err != nil {
1684 return
1685 }
1686 var _p1 *byte
1687 _p1, err = BytePtrFromString(link)
1688 if err != nil {
1689 return
1690 }
1691 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSymlink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
1692 if e1 != 0 {
1693 err = e1
1694 }
1695 return
1696 }
1697
1698
1699
1700 func Sync() (err error) {
1701 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSync)), 0, 0, 0, 0, 0, 0, 0)
1702 if e1 != 0 {
1703 err = e1
1704 }
1705 return
1706 }
1707
1708
1709
1710 func Sysconf(which int) (n int64, err error) {
1711 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSysconf)), 1, uintptr(which), 0, 0, 0, 0, 0)
1712 n = int64(r0)
1713 if e1 != 0 {
1714 err = e1
1715 }
1716 return
1717 }
1718
1719
1720
1721 func Times(tms *Tms) (ticks uintptr, err error) {
1722 r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procTimes)), 1, uintptr(unsafe.Pointer(tms)), 0, 0, 0, 0, 0)
1723 ticks = uintptr(r0)
1724 if e1 != 0 {
1725 err = e1
1726 }
1727 return
1728 }
1729
1730
1731
1732 func Truncate(path string, length int64) (err error) {
1733 var _p0 *byte
1734 _p0, err = BytePtrFromString(path)
1735 if err != nil {
1736 return
1737 }
1738 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procTruncate)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0, 0, 0, 0)
1739 if e1 != 0 {
1740 err = e1
1741 }
1742 return
1743 }
1744
1745
1746
1747 func Fsync(fd int) (err error) {
1748 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFsync)), 1, uintptr(fd), 0, 0, 0, 0, 0)
1749 if e1 != 0 {
1750 err = e1
1751 }
1752 return
1753 }
1754
1755
1756
1757 func Ftruncate(fd int, length int64) (err error) {
1758 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFtruncate)), 2, uintptr(fd), uintptr(length), 0, 0, 0, 0)
1759 if e1 != 0 {
1760 err = e1
1761 }
1762 return
1763 }
1764
1765
1766
1767 func Umask(mask int) (oldmask int) {
1768 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procUmask)), 1, uintptr(mask), 0, 0, 0, 0, 0)
1769 oldmask = int(r0)
1770 return
1771 }
1772
1773
1774
1775 func Uname(buf *Utsname) (err error) {
1776 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procUname)), 1, uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0, 0)
1777 if e1 != 0 {
1778 err = e1
1779 }
1780 return
1781 }
1782
1783
1784
1785 func Unmount(target string, flags int) (err error) {
1786 var _p0 *byte
1787 _p0, err = BytePtrFromString(target)
1788 if err != nil {
1789 return
1790 }
1791 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procumount)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0, 0, 0)
1792 if e1 != 0 {
1793 err = e1
1794 }
1795 return
1796 }
1797
1798
1799
1800 func Unlink(path string) (err error) {
1801 var _p0 *byte
1802 _p0, err = BytePtrFromString(path)
1803 if err != nil {
1804 return
1805 }
1806 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUnlink)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
1807 if e1 != 0 {
1808 err = e1
1809 }
1810 return
1811 }
1812
1813
1814
1815 func Unlinkat(dirfd int, path string, flags int) (err error) {
1816 var _p0 *byte
1817 _p0, err = BytePtrFromString(path)
1818 if err != nil {
1819 return
1820 }
1821 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUnlinkat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0, 0)
1822 if e1 != 0 {
1823 err = e1
1824 }
1825 return
1826 }
1827
1828
1829
1830 func Ustat(dev int, ubuf *Ustat_t) (err error) {
1831 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUstat)), 2, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0, 0, 0, 0)
1832 if e1 != 0 {
1833 err = e1
1834 }
1835 return
1836 }
1837
1838
1839
1840 func Utime(path string, buf *Utimbuf) (err error) {
1841 var _p0 *byte
1842 _p0, err = BytePtrFromString(path)
1843 if err != nil {
1844 return
1845 }
1846 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUtime)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0)
1847 if e1 != 0 {
1848 err = e1
1849 }
1850 return
1851 }
1852
1853
1854
1855 func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
1856 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_bind)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
1857 if e1 != 0 {
1858 err = e1
1859 }
1860 return
1861 }
1862
1863
1864
1865 func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
1866 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_connect)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
1867 if e1 != 0 {
1868 err = e1
1869 }
1870 return
1871 }
1872
1873
1874
1875 func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
1876 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procmmap)), 6, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
1877 ret = uintptr(r0)
1878 if e1 != 0 {
1879 err = e1
1880 }
1881 return
1882 }
1883
1884
1885
1886 func munmap(addr uintptr, length uintptr) (err error) {
1887 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procmunmap)), 2, uintptr(addr), uintptr(length), 0, 0, 0, 0)
1888 if e1 != 0 {
1889 err = e1
1890 }
1891 return
1892 }
1893
1894
1895
1896 func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
1897 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsendfile)), 4, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)
1898 written = int(r0)
1899 if e1 != 0 {
1900 err = e1
1901 }
1902 return
1903 }
1904
1905
1906
1907 func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
1908 var _p0 *byte
1909 if len(buf) > 0 {
1910 _p0 = &buf[0]
1911 }
1912 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_sendto)), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
1913 if e1 != 0 {
1914 err = e1
1915 }
1916 return
1917 }
1918
1919
1920
1921 func socket(domain int, typ int, proto int) (fd int, err error) {
1922 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_socket)), 3, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0)
1923 fd = int(r0)
1924 if e1 != 0 {
1925 err = e1
1926 }
1927 return
1928 }
1929
1930
1931
1932 func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
1933 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&proc__xnet_socketpair)), 4, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
1934 if e1 != 0 {
1935 err = e1
1936 }
1937 return
1938 }
1939
1940
1941
1942 func write(fd int, p []byte) (n int, err error) {
1943 var _p0 *byte
1944 if len(p) > 0 {
1945 _p0 = &p[0]
1946 }
1947 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwrite)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)
1948 n = int(r0)
1949 if e1 != 0 {
1950 err = e1
1951 }
1952 return
1953 }
1954
1955
1956
1957 func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
1958 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_getsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
1959 if e1 != 0 {
1960 err = e1
1961 }
1962 return
1963 }
1964
1965
1966
1967 func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
1968 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procgetpeername)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
1969 if e1 != 0 {
1970 err = e1
1971 }
1972 return
1973 }
1974
1975
1976
1977 func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
1978 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsetsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
1979 if e1 != 0 {
1980 err = e1
1981 }
1982 return
1983 }
1984
1985
1986
1987 func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
1988 var _p0 *byte
1989 if len(p) > 0 {
1990 _p0 = &p[0]
1991 }
1992 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procrecvfrom)), 6, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
1993 n = int(r0)
1994 if e1 != 0 {
1995 err = e1
1996 }
1997 return
1998 }
1999
2000
2001
2002 func port_create() (n int, err error) {
2003 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_create)), 0, 0, 0, 0, 0, 0, 0)
2004 n = int(r0)
2005 if e1 != 0 {
2006 err = e1
2007 }
2008 return
2009 }
2010
2011
2012
2013 func port_associate(port int, source int, object uintptr, events int, user *byte) (n int, err error) {
2014 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_associate)), 5, uintptr(port), uintptr(source), uintptr(object), uintptr(events), uintptr(unsafe.Pointer(user)), 0)
2015 n = int(r0)
2016 if e1 != 0 {
2017 err = e1
2018 }
2019 return
2020 }
2021
2022
2023
2024 func port_dissociate(port int, source int, object uintptr) (n int, err error) {
2025 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_dissociate)), 3, uintptr(port), uintptr(source), uintptr(object), 0, 0, 0)
2026 n = int(r0)
2027 if e1 != 0 {
2028 err = e1
2029 }
2030 return
2031 }
2032
2033
2034
2035 func port_get(port int, pe *portEvent, timeout *Timespec) (n int, err error) {
2036 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_get)), 3, uintptr(port), uintptr(unsafe.Pointer(pe)), uintptr(unsafe.Pointer(timeout)), 0, 0, 0)
2037 n = int(r0)
2038 if e1 != 0 {
2039 err = e1
2040 }
2041 return
2042 }
2043
2044
2045
2046 func port_getn(port int, pe *portEvent, max uint32, nget *uint32, timeout *Timespec) (n int, err error) {
2047 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procport_getn)), 5, uintptr(port), uintptr(unsafe.Pointer(pe)), uintptr(max), uintptr(unsafe.Pointer(nget)), uintptr(unsafe.Pointer(timeout)), 0)
2048 n = int(r0)
2049 if e1 != 0 {
2050 err = e1
2051 }
2052 return
2053 }
2054
View as plain text