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