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