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