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