Source file
src/syscall/zsyscall_solaris_amd64.go
1
2
3
4
5
6 package syscall
7
8 import "unsafe"
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186 type libcFunc uintptr
187
188 var (
189 libc_pipe2,
190 libc_accept4,
191 libc_Getcwd,
192 libc_getgroups,
193 libc_setgroups,
194 libc_fcntl,
195 libc_accept,
196 libc___xnet_sendmsg,
197 libc_Access,
198 libc_Adjtime,
199 libc_Chdir,
200 libc_Chmod,
201 libc_Chown,
202 libc_Chroot,
203 libc_Close,
204 libc_Dup,
205 libc_Fchdir,
206 libc_Fchmod,
207 libc_Fchown,
208 libc_Fpathconf,
209 libc_Fstat,
210 libc_Getdents,
211 libc_Getgid,
212 libc_Getpid,
213 libc_Geteuid,
214 libc_Getegid,
215 libc_Getppid,
216 libc_Getpriority,
217 libc_Getrlimit,
218 libc_Getrusage,
219 libc_Gettimeofday,
220 libc_Getuid,
221 libc_Kill,
222 libc_Lchown,
223 libc_Link,
224 libc___xnet_listen,
225 libc_Lstat,
226 libc_Mkdir,
227 libc_Mknod,
228 libc_Nanosleep,
229 libc_Open,
230 libc_Pathconf,
231 libc_pread,
232 libc_pwrite,
233 libc_read,
234 libc_Readlink,
235 libc_Rename,
236 libc_Rmdir,
237 libc_lseek,
238 libc_sendfile,
239 libc_Setegid,
240 libc_Seteuid,
241 libc_Setgid,
242 libc_Setpgid,
243 libc_Setpriority,
244 libc_Setregid,
245 libc_Setreuid,
246 libc_setrlimit,
247 libc_Setsid,
248 libc_Setuid,
249 libc_shutdown,
250 libc_Stat,
251 libc_Symlink,
252 libc_Sync,
253 libc_Truncate,
254 libc_Fsync,
255 libc_Ftruncate,
256 libc_Umask,
257 libc_Unlink,
258 libc_utimes,
259 libc___xnet_bind,
260 libc___xnet_connect,
261 libc_mmap,
262 libc_munmap,
263 libc___xnet_sendto,
264 libc___xnet_socket,
265 libc___xnet_socketpair,
266 libc_write,
267 libc_writev,
268 libc___xnet_getsockopt,
269 libc_getpeername,
270 libc_getsockname,
271 libc_setsockopt,
272 libc_recvfrom,
273 libc___xnet_recvmsg,
274 libc_getexecname,
275 libc_utimensat libcFunc
276 )
277
278
279
280 func pipe2(p *[2]_C_int, flags int) (err error) {
281 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_pipe2)), 2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0, 0, 0, 0)
282 if e1 != 0 {
283 err = errnoErr(e1)
284 }
285 return
286 }
287
288
289
290 func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {
291 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_accept4)), 4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)
292 fd = int(r0)
293 if e1 != 0 {
294 err = errnoErr(e1)
295 }
296 return
297 }
298
299
300
301 func Getcwd(buf []byte) (n int, err error) {
302 var _p0 *byte
303 if len(buf) > 0 {
304 _p0 = &buf[0]
305 }
306 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Getcwd)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0, 0, 0, 0)
307 n = int(r0)
308 if e1 != 0 {
309 err = errnoErr(e1)
310 }
311 return
312 }
313
314
315
316 func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
317 r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_getgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0)
318 n = int(r0)
319 if e1 != 0 {
320 err = errnoErr(e1)
321 }
322 return
323 }
324
325
326
327 func setgroups(ngid int, gid *_Gid_t) (err error) {
328 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_setgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0)
329 if e1 != 0 {
330 err = errnoErr(e1)
331 }
332 return
333 }
334
335
336
337 func fcntl(fd int, cmd int, arg int) (val int, err error) {
338 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_fcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0)
339 val = int(r0)
340 if e1 != 0 {
341 err = errnoErr(e1)
342 }
343 return
344 }
345
346
347
348 func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
349 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_accept)), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
350 fd = int(r0)
351 if e1 != 0 {
352 err = errnoErr(e1)
353 }
354 return
355 }
356
357
358
359 func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
360 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_sendmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
361 n = int(r0)
362 if e1 != 0 {
363 err = errnoErr(e1)
364 }
365 return
366 }
367
368
369
370 func Access(path string, mode uint32) (err error) {
371 var _p0 *byte
372 _p0, err = BytePtrFromString(path)
373 if err != nil {
374 return
375 }
376 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Access)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
377 if e1 != 0 {
378 err = errnoErr(e1)
379 }
380 return
381 }
382
383
384
385 func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
386 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Adjtime)), 2, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0, 0, 0, 0)
387 if e1 != 0 {
388 err = errnoErr(e1)
389 }
390 return
391 }
392
393
394
395 func Chdir(path string) (err error) {
396 var _p0 *byte
397 _p0, err = BytePtrFromString(path)
398 if err != nil {
399 return
400 }
401 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Chdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
402 if e1 != 0 {
403 err = errnoErr(e1)
404 }
405 return
406 }
407
408
409
410 func Chmod(path string, mode uint32) (err error) {
411 var _p0 *byte
412 _p0, err = BytePtrFromString(path)
413 if err != nil {
414 return
415 }
416 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Chmod)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
417 if e1 != 0 {
418 err = errnoErr(e1)
419 }
420 return
421 }
422
423
424
425 func Chown(path string, uid int, gid int) (err error) {
426 var _p0 *byte
427 _p0, err = BytePtrFromString(path)
428 if err != nil {
429 return
430 }
431 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Chown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)
432 if e1 != 0 {
433 err = errnoErr(e1)
434 }
435 return
436 }
437
438
439
440 func Chroot(path string) (err error) {
441 var _p0 *byte
442 _p0, err = BytePtrFromString(path)
443 if err != nil {
444 return
445 }
446 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Chroot)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
447 if e1 != 0 {
448 err = errnoErr(e1)
449 }
450 return
451 }
452
453
454
455 func Close(fd int) (err error) {
456 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Close)), 1, uintptr(fd), 0, 0, 0, 0, 0)
457 if e1 != 0 {
458 err = errnoErr(e1)
459 }
460 return
461 }
462
463
464
465 func Dup(fd int) (nfd int, err error) {
466 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Dup)), 1, uintptr(fd), 0, 0, 0, 0, 0)
467 nfd = int(r0)
468 if e1 != 0 {
469 err = errnoErr(e1)
470 }
471 return
472 }
473
474
475
476 func Fchdir(fd int) (err error) {
477 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Fchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0)
478 if e1 != 0 {
479 err = errnoErr(e1)
480 }
481 return
482 }
483
484
485
486 func Fchmod(fd int, mode uint32) (err error) {
487 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Fchmod)), 2, uintptr(fd), uintptr(mode), 0, 0, 0, 0)
488 if e1 != 0 {
489 err = errnoErr(e1)
490 }
491 return
492 }
493
494
495
496 func Fchown(fd int, uid int, gid int) (err error) {
497 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Fchown)), 3, uintptr(fd), uintptr(uid), uintptr(gid), 0, 0, 0)
498 if e1 != 0 {
499 err = errnoErr(e1)
500 }
501 return
502 }
503
504
505
506 func Fpathconf(fd int, name int) (val int, err error) {
507 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Fpathconf)), 2, uintptr(fd), uintptr(name), 0, 0, 0, 0)
508 val = int(r0)
509 if e1 != 0 {
510 err = errnoErr(e1)
511 }
512 return
513 }
514
515
516
517 func Fstat(fd int, stat *Stat_t) (err error) {
518 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Fstat)), 2, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
519 if e1 != 0 {
520 err = errnoErr(e1)
521 }
522 return
523 }
524
525
526
527 func Getdents(fd int, buf []byte, basep *uintptr) (n int, err error) {
528 var _p0 *byte
529 if len(buf) > 0 {
530 _p0 = &buf[0]
531 }
532 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Getdents)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
533 n = int(r0)
534 if e1 != 0 {
535 err = errnoErr(e1)
536 }
537 return
538 }
539
540
541
542 func Getgid() (gid int) {
543 r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Getgid)), 0, 0, 0, 0, 0, 0, 0)
544 gid = int(r0)
545 return
546 }
547
548
549
550 func Getpid() (pid int) {
551 r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Getpid)), 0, 0, 0, 0, 0, 0, 0)
552 pid = int(r0)
553 return
554 }
555
556
557
558 func Geteuid() (euid int) {
559 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&libc_Geteuid)), 0, 0, 0, 0, 0, 0, 0)
560 euid = int(r0)
561 return
562 }
563
564
565
566 func Getegid() (egid int) {
567 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&libc_Getegid)), 0, 0, 0, 0, 0, 0, 0)
568 egid = int(r0)
569 return
570 }
571
572
573
574 func Getppid() (ppid int) {
575 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&libc_Getppid)), 0, 0, 0, 0, 0, 0, 0)
576 ppid = int(r0)
577 return
578 }
579
580
581
582 func Getpriority(which int, who int) (n int, err error) {
583 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Getpriority)), 2, uintptr(which), uintptr(who), 0, 0, 0, 0)
584 n = int(r0)
585 if e1 != 0 {
586 err = errnoErr(e1)
587 }
588 return
589 }
590
591
592
593 func Getrlimit(which int, lim *Rlimit) (err error) {
594 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Getrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)
595 if e1 != 0 {
596 err = errnoErr(e1)
597 }
598 return
599 }
600
601
602
603 func Getrusage(who int, rusage *Rusage) (err error) {
604 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Getrusage)), 2, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0, 0, 0, 0)
605 if e1 != 0 {
606 err = errnoErr(e1)
607 }
608 return
609 }
610
611
612
613 func Gettimeofday(tv *Timeval) (err error) {
614 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Gettimeofday)), 1, uintptr(unsafe.Pointer(tv)), 0, 0, 0, 0, 0)
615 if e1 != 0 {
616 err = errnoErr(e1)
617 }
618 return
619 }
620
621
622
623 func Getuid() (uid int) {
624 r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Getuid)), 0, 0, 0, 0, 0, 0, 0)
625 uid = int(r0)
626 return
627 }
628
629
630
631 func Kill(pid int, signum Signal) (err error) {
632 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Kill)), 2, uintptr(pid), uintptr(signum), 0, 0, 0, 0)
633 if e1 != 0 {
634 err = errnoErr(e1)
635 }
636 return
637 }
638
639
640
641 func Lchown(path string, uid int, gid int) (err error) {
642 var _p0 *byte
643 _p0, err = BytePtrFromString(path)
644 if err != nil {
645 return
646 }
647 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Lchown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)
648 if e1 != 0 {
649 err = errnoErr(e1)
650 }
651 return
652 }
653
654
655
656 func Link(path string, link string) (err error) {
657 var _p0 *byte
658 _p0, err = BytePtrFromString(path)
659 if err != nil {
660 return
661 }
662 var _p1 *byte
663 _p1, err = BytePtrFromString(link)
664 if err != nil {
665 return
666 }
667 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Link)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
668 if e1 != 0 {
669 err = errnoErr(e1)
670 }
671 return
672 }
673
674
675
676 func Listen(s int, backlog int) (err error) {
677 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_listen)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0)
678 if e1 != 0 {
679 err = errnoErr(e1)
680 }
681 return
682 }
683
684
685
686 func Lstat(path string, stat *Stat_t) (err error) {
687 var _p0 *byte
688 _p0, err = BytePtrFromString(path)
689 if err != nil {
690 return
691 }
692 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Lstat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
693 if e1 != 0 {
694 err = errnoErr(e1)
695 }
696 return
697 }
698
699
700
701 func Mkdir(path string, mode uint32) (err error) {
702 var _p0 *byte
703 _p0, err = BytePtrFromString(path)
704 if err != nil {
705 return
706 }
707 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Mkdir)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
708 if e1 != 0 {
709 err = errnoErr(e1)
710 }
711 return
712 }
713
714
715
716 func Mknod(path string, mode uint32, dev int) (err error) {
717 var _p0 *byte
718 _p0, err = BytePtrFromString(path)
719 if err != nil {
720 return
721 }
722 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Mknod)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0, 0)
723 if e1 != 0 {
724 err = errnoErr(e1)
725 }
726 return
727 }
728
729
730
731 func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
732 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Nanosleep)), 2, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0, 0, 0, 0)
733 if e1 != 0 {
734 err = errnoErr(e1)
735 }
736 return
737 }
738
739
740
741 func Open(path string, mode int, perm uint32) (fd int, err error) {
742 var _p0 *byte
743 _p0, err = BytePtrFromString(path)
744 if err != nil {
745 return
746 }
747 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Open)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0, 0)
748 fd = int(r0)
749 if e1 != 0 {
750 err = errnoErr(e1)
751 }
752 return
753 }
754
755
756
757 func Pathconf(path string, name int) (val int, err error) {
758 var _p0 *byte
759 _p0, err = BytePtrFromString(path)
760 if err != nil {
761 return
762 }
763 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Pathconf)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0, 0, 0, 0)
764 val = int(r0)
765 if e1 != 0 {
766 err = errnoErr(e1)
767 }
768 return
769 }
770
771
772
773 func pread(fd int, p []byte, offset int64) (n int, err error) {
774 var _p0 *byte
775 if len(p) > 0 {
776 _p0 = &p[0]
777 }
778 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_pread)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)
779 n = int(r0)
780 if e1 != 0 {
781 err = errnoErr(e1)
782 }
783 return
784 }
785
786
787
788 func pwrite(fd int, p []byte, offset int64) (n int, err error) {
789 var _p0 *byte
790 if len(p) > 0 {
791 _p0 = &p[0]
792 }
793 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_pwrite)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)
794 n = int(r0)
795 if e1 != 0 {
796 err = errnoErr(e1)
797 }
798 return
799 }
800
801
802
803 func read(fd int, p []byte) (n int, err error) {
804 var _p0 *byte
805 if len(p) > 0 {
806 _p0 = &p[0]
807 }
808 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_read)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)
809 n = int(r0)
810 if e1 != 0 {
811 err = errnoErr(e1)
812 }
813 return
814 }
815
816
817
818 func Readlink(path string, buf []byte) (n int, err error) {
819 var _p0 *byte
820 _p0, err = BytePtrFromString(path)
821 if err != nil {
822 return
823 }
824 var _p1 *byte
825 if len(buf) > 0 {
826 _p1 = &buf[0]
827 }
828 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Readlink)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(len(buf)), 0, 0, 0)
829 n = int(r0)
830 if e1 != 0 {
831 err = errnoErr(e1)
832 }
833 return
834 }
835
836
837
838 func Rename(from string, to string) (err error) {
839 var _p0 *byte
840 _p0, err = BytePtrFromString(from)
841 if err != nil {
842 return
843 }
844 var _p1 *byte
845 _p1, err = BytePtrFromString(to)
846 if err != nil {
847 return
848 }
849 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Rename)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
850 if e1 != 0 {
851 err = errnoErr(e1)
852 }
853 return
854 }
855
856
857
858 func Rmdir(path string) (err error) {
859 var _p0 *byte
860 _p0, err = BytePtrFromString(path)
861 if err != nil {
862 return
863 }
864 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Rmdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
865 if e1 != 0 {
866 err = errnoErr(e1)
867 }
868 return
869 }
870
871
872
873 func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
874 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_lseek)), 3, uintptr(fd), uintptr(offset), uintptr(whence), 0, 0, 0)
875 newoffset = int64(r0)
876 if e1 != 0 {
877 err = errnoErr(e1)
878 }
879 return
880 }
881
882
883
884 func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
885 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_sendfile)), 4, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)
886 written = int(r0)
887 if e1 != 0 {
888 err = errnoErr(e1)
889 }
890 return
891 }
892
893
894
895 func Setegid(egid int) (err error) {
896 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setegid)), 1, uintptr(egid), 0, 0, 0, 0, 0)
897 if e1 != 0 {
898 err = errnoErr(e1)
899 }
900 return
901 }
902
903
904
905 func Seteuid(euid int) (err error) {
906 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Seteuid)), 1, uintptr(euid), 0, 0, 0, 0, 0)
907 if e1 != 0 {
908 err = errnoErr(e1)
909 }
910 return
911 }
912
913
914
915 func Setgid(gid int) (err error) {
916 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setgid)), 1, uintptr(gid), 0, 0, 0, 0, 0)
917 if e1 != 0 {
918 err = errnoErr(e1)
919 }
920 return
921 }
922
923
924
925 func Setpgid(pid int, pgid int) (err error) {
926 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setpgid)), 2, uintptr(pid), uintptr(pgid), 0, 0, 0, 0)
927 if e1 != 0 {
928 err = errnoErr(e1)
929 }
930 return
931 }
932
933
934
935 func Setpriority(which int, who int, prio int) (err error) {
936 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Setpriority)), 3, uintptr(which), uintptr(who), uintptr(prio), 0, 0, 0)
937 if e1 != 0 {
938 err = errnoErr(e1)
939 }
940 return
941 }
942
943
944
945 func Setregid(rgid int, egid int) (err error) {
946 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setregid)), 2, uintptr(rgid), uintptr(egid), 0, 0, 0, 0)
947 if e1 != 0 {
948 err = errnoErr(e1)
949 }
950 return
951 }
952
953
954
955 func Setreuid(ruid int, euid int) (err error) {
956 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setreuid)), 2, uintptr(ruid), uintptr(euid), 0, 0, 0, 0)
957 if e1 != 0 {
958 err = errnoErr(e1)
959 }
960 return
961 }
962
963
964
965 func setrlimit(which int, lim *Rlimit) (err error) {
966 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_setrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)
967 if e1 != 0 {
968 err = errnoErr(e1)
969 }
970 return
971 }
972
973
974
975 func Setsid() (pid int, err error) {
976 r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setsid)), 0, 0, 0, 0, 0, 0, 0)
977 pid = int(r0)
978 if e1 != 0 {
979 err = errnoErr(e1)
980 }
981 return
982 }
983
984
985
986 func Setuid(uid int) (err error) {
987 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setuid)), 1, uintptr(uid), 0, 0, 0, 0, 0)
988 if e1 != 0 {
989 err = errnoErr(e1)
990 }
991 return
992 }
993
994
995
996 func Shutdown(s int, how int) (err error) {
997 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_shutdown)), 2, uintptr(s), uintptr(how), 0, 0, 0, 0)
998 if e1 != 0 {
999 err = errnoErr(e1)
1000 }
1001 return
1002 }
1003
1004
1005
1006 func Stat(path string, stat *Stat_t) (err error) {
1007 var _p0 *byte
1008 _p0, err = BytePtrFromString(path)
1009 if err != nil {
1010 return
1011 }
1012 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Stat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
1013 if e1 != 0 {
1014 err = errnoErr(e1)
1015 }
1016 return
1017 }
1018
1019
1020
1021 func Symlink(path string, link string) (err error) {
1022 var _p0 *byte
1023 _p0, err = BytePtrFromString(path)
1024 if err != nil {
1025 return
1026 }
1027 var _p1 *byte
1028 _p1, err = BytePtrFromString(link)
1029 if err != nil {
1030 return
1031 }
1032 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Symlink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
1033 if e1 != 0 {
1034 err = errnoErr(e1)
1035 }
1036 return
1037 }
1038
1039
1040
1041 func Sync() (err error) {
1042 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Sync)), 0, 0, 0, 0, 0, 0, 0)
1043 if e1 != 0 {
1044 err = errnoErr(e1)
1045 }
1046 return
1047 }
1048
1049
1050
1051 func Truncate(path string, length int64) (err error) {
1052 var _p0 *byte
1053 _p0, err = BytePtrFromString(path)
1054 if err != nil {
1055 return
1056 }
1057 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Truncate)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0, 0, 0, 0)
1058 if e1 != 0 {
1059 err = errnoErr(e1)
1060 }
1061 return
1062 }
1063
1064
1065
1066 func Fsync(fd int) (err error) {
1067 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Fsync)), 1, uintptr(fd), 0, 0, 0, 0, 0)
1068 if e1 != 0 {
1069 err = errnoErr(e1)
1070 }
1071 return
1072 }
1073
1074
1075
1076 func Ftruncate(fd int, length int64) (err error) {
1077 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Ftruncate)), 2, uintptr(fd), uintptr(length), 0, 0, 0, 0)
1078 if e1 != 0 {
1079 err = errnoErr(e1)
1080 }
1081 return
1082 }
1083
1084
1085
1086 func Umask(newmask int) (oldmask int) {
1087 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&libc_Umask)), 1, uintptr(newmask), 0, 0, 0, 0, 0)
1088 oldmask = int(r0)
1089 return
1090 }
1091
1092
1093
1094 func Unlink(path string) (err error) {
1095 var _p0 *byte
1096 _p0, err = BytePtrFromString(path)
1097 if err != nil {
1098 return
1099 }
1100 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Unlink)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
1101 if e1 != 0 {
1102 err = errnoErr(e1)
1103 }
1104 return
1105 }
1106
1107
1108
1109 func utimes(path string, times *[2]Timeval) (err error) {
1110 var _p0 *byte
1111 _p0, err = BytePtrFromString(path)
1112 if err != nil {
1113 return
1114 }
1115 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_utimes)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0, 0, 0, 0)
1116 if e1 != 0 {
1117 err = errnoErr(e1)
1118 }
1119 return
1120 }
1121
1122
1123
1124 func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
1125 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_bind)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
1126 if e1 != 0 {
1127 err = errnoErr(e1)
1128 }
1129 return
1130 }
1131
1132
1133
1134 func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
1135 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_connect)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
1136 if e1 != 0 {
1137 err = errnoErr(e1)
1138 }
1139 return
1140 }
1141
1142
1143
1144 func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
1145 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_mmap)), 6, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
1146 ret = uintptr(r0)
1147 if e1 != 0 {
1148 err = errnoErr(e1)
1149 }
1150 return
1151 }
1152
1153
1154
1155 func munmap(addr uintptr, length uintptr) (err error) {
1156 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_munmap)), 2, uintptr(addr), uintptr(length), 0, 0, 0, 0)
1157 if e1 != 0 {
1158 err = errnoErr(e1)
1159 }
1160 return
1161 }
1162
1163
1164
1165 func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
1166 var _p0 *byte
1167 if len(buf) > 0 {
1168 _p0 = &buf[0]
1169 }
1170 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_sendto)), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
1171 if e1 != 0 {
1172 err = errnoErr(e1)
1173 }
1174 return
1175 }
1176
1177
1178
1179 func socket(domain int, typ int, proto int) (fd int, err error) {
1180 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_socket)), 3, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0)
1181 fd = int(r0)
1182 if e1 != 0 {
1183 err = errnoErr(e1)
1184 }
1185 return
1186 }
1187
1188
1189
1190 func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
1191 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc___xnet_socketpair)), 4, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
1192 if e1 != 0 {
1193 err = errnoErr(e1)
1194 }
1195 return
1196 }
1197
1198
1199
1200 func write(fd int, p []byte) (n int, err error) {
1201 var _p0 *byte
1202 if len(p) > 0 {
1203 _p0 = &p[0]
1204 }
1205 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_write)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)
1206 n = int(r0)
1207 if e1 != 0 {
1208 err = errnoErr(e1)
1209 }
1210 return
1211 }
1212
1213
1214
1215 func writev(fd int, iovecs []Iovec) (n uintptr, err error) {
1216 var _p0 *Iovec
1217 if len(iovecs) > 0 {
1218 _p0 = &iovecs[0]
1219 }
1220 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_writev)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovecs)), 0, 0, 0)
1221 n = uintptr(r0)
1222 if e1 != 0 {
1223 err = errnoErr(e1)
1224 }
1225 return
1226 }
1227
1228
1229
1230 func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
1231 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_getsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
1232 if e1 != 0 {
1233 err = errnoErr(e1)
1234 }
1235 return
1236 }
1237
1238
1239
1240 func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
1241 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_getpeername)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
1242 if e1 != 0 {
1243 err = errnoErr(e1)
1244 }
1245 return
1246 }
1247
1248
1249
1250 func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
1251 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_getsockname)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
1252 if e1 != 0 {
1253 err = errnoErr(e1)
1254 }
1255 return
1256 }
1257
1258
1259
1260 func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
1261 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_setsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
1262 if e1 != 0 {
1263 err = errnoErr(e1)
1264 }
1265 return
1266 }
1267
1268
1269
1270 func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
1271 var _p0 *byte
1272 if len(p) > 0 {
1273 _p0 = &p[0]
1274 }
1275 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_recvfrom)), 6, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
1276 n = int(r0)
1277 if e1 != 0 {
1278 err = errnoErr(e1)
1279 }
1280 return
1281 }
1282
1283
1284
1285 func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
1286 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_recvmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
1287 n = int(r0)
1288 if e1 != 0 {
1289 err = errnoErr(e1)
1290 }
1291 return
1292 }
1293
1294
1295
1296 func getexecname() (path unsafe.Pointer, err error) {
1297 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_getexecname)), 0, 0, 0, 0, 0, 0, 0)
1298 path = unsafe.Pointer(r0)
1299 if e1 != 0 {
1300 err = errnoErr(e1)
1301 }
1302 return
1303 }
1304
1305
1306
1307 func utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error) {
1308 var _p0 *byte
1309 _p0, err = BytePtrFromString(path)
1310 if err != nil {
1311 return
1312 }
1313 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_utimensat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flag), 0, 0)
1314 if e1 != 0 {
1315 err = errnoErr(e1)
1316 }
1317 return
1318 }
1319
View as plain text