blob: b76133447e8a1e346c0bd57d2e4e90be38ef18c4 [file] [log] [blame]
khenaidooac637102019-01-14 15:44:34 -05001// go run mksyscall.go -tags linux,riscv64 syscall_linux.go syscall_linux_riscv64.go
2// Code generated by the command above; see README.md. DO NOT EDIT.
3
4// +build linux,riscv64
5
6package unix
7
8import (
9 "syscall"
10 "unsafe"
11)
12
13var _ syscall.Errno
14
15// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
16
William Kurkiandaa6bb22019-03-07 12:26:28 -050017func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) {
18 _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0)
19 if e1 != 0 {
20 err = errnoErr(e1)
21 }
22 return
23}
24
25// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
26
khenaidooac637102019-01-14 15:44:34 -050027func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
28 _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
29 if e1 != 0 {
30 err = errnoErr(e1)
31 }
32 return
33}
34
35// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
36
khenaidooac637102019-01-14 15:44:34 -050037func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
38 r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)
39 n = int64(r0)
40 if e1 != 0 {
41 err = errnoErr(e1)
42 }
43 return
44}
45
46// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
47
khenaidooac637102019-01-14 15:44:34 -050048func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
49 var _p0 unsafe.Pointer
50 if len(events) > 0 {
51 _p0 = unsafe.Pointer(&events[0])
52 } else {
53 _p0 = unsafe.Pointer(&_zero)
54 }
55 r0, _, e1 := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
56 n = int(r0)
57 if e1 != 0 {
58 err = errnoErr(e1)
59 }
60 return
61}
62
63// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
64
65func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
66 _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0)
67 if e1 != 0 {
68 err = errnoErr(e1)
69 }
70 return
71}
72
73// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
74
75func Fchown(fd int, uid int, gid int) (err error) {
76 _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
77 if e1 != 0 {
78 err = errnoErr(e1)
79 }
80 return
81}
82
83// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
84
85func Fstat(fd int, stat *Stat_t) (err error) {
86 _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
87 if e1 != 0 {
88 err = errnoErr(e1)
89 }
90 return
91}
92
93// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
94
95func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) {
96 var _p0 *byte
97 _p0, err = BytePtrFromString(path)
98 if err != nil {
99 return
100 }
101 _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
102 if e1 != 0 {
103 err = errnoErr(e1)
104 }
105 return
106}
107
108// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
109
110func Fstatfs(fd int, buf *Statfs_t) (err error) {
111 _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)
112 if e1 != 0 {
113 err = errnoErr(e1)
114 }
115 return
116}
117
118// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
119
120func Ftruncate(fd int, length int64) (err error) {
121 _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)
122 if e1 != 0 {
123 err = errnoErr(e1)
124 }
125 return
126}
127
128// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
129
130func Getegid() (egid int) {
131 r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0)
132 egid = int(r0)
133 return
134}
135
136// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
137
138func Geteuid() (euid int) {
139 r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0)
140 euid = int(r0)
141 return
142}
143
144// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
145
146func Getgid() (gid int) {
147 r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0)
148 gid = int(r0)
149 return
150}
151
152// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
153
154func Getrlimit(resource int, rlim *Rlimit) (err error) {
155 _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
156 if e1 != 0 {
157 err = errnoErr(e1)
158 }
159 return
160}
161
162// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
163
164func Getuid() (uid int) {
165 r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0)
166 uid = int(r0)
167 return
168}
169
170// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
171
172func Listen(s int, n int) (err error) {
173 _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)
174 if e1 != 0 {
175 err = errnoErr(e1)
176 }
177 return
178}
179
180// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
181
182func Pread(fd int, p []byte, offset int64) (n int, err error) {
183 var _p0 unsafe.Pointer
184 if len(p) > 0 {
185 _p0 = unsafe.Pointer(&p[0])
186 } else {
187 _p0 = unsafe.Pointer(&_zero)
188 }
189 r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
190 n = int(r0)
191 if e1 != 0 {
192 err = errnoErr(e1)
193 }
194 return
195}
196
197// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
198
199func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
200 var _p0 unsafe.Pointer
201 if len(p) > 0 {
202 _p0 = unsafe.Pointer(&p[0])
203 } else {
204 _p0 = unsafe.Pointer(&_zero)
205 }
206 r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
207 n = int(r0)
208 if e1 != 0 {
209 err = errnoErr(e1)
210 }
211 return
212}
213
214// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
215
216func Seek(fd int, offset int64, whence int) (off int64, err error) {
217 r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))
218 off = int64(r0)
219 if e1 != 0 {
220 err = errnoErr(e1)
221 }
222 return
223}
224
225// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
226
227func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
228 r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)
229 written = int(r0)
230 if e1 != 0 {
231 err = errnoErr(e1)
232 }
233 return
234}
235
236// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
237
Andrea Campanella3614a922021-02-25 12:40:42 +0100238func setfsgid(gid int) (prev int, err error) {
239 r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)
240 prev = int(r0)
khenaidooac637102019-01-14 15:44:34 -0500241 if e1 != 0 {
242 err = errnoErr(e1)
243 }
244 return
245}
246
247// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
248
Andrea Campanella3614a922021-02-25 12:40:42 +0100249func setfsuid(uid int) (prev int, err error) {
250 r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)
251 prev = int(r0)
khenaidooac637102019-01-14 15:44:34 -0500252 if e1 != 0 {
253 err = errnoErr(e1)
254 }
255 return
256}
257
258// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
259
260func Setregid(rgid int, egid int) (err error) {
261 _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
262 if e1 != 0 {
263 err = errnoErr(e1)
264 }
265 return
266}
267
268// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
269
270func Setresgid(rgid int, egid int, sgid int) (err error) {
271 _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))
272 if e1 != 0 {
273 err = errnoErr(e1)
274 }
275 return
276}
277
278// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
279
280func Setresuid(ruid int, euid int, suid int) (err error) {
281 _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))
282 if e1 != 0 {
283 err = errnoErr(e1)
284 }
285 return
286}
287
288// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
289
290func Setrlimit(resource int, rlim *Rlimit) (err error) {
291 _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
292 if e1 != 0 {
293 err = errnoErr(e1)
294 }
295 return
296}
297
298// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
299
300func Setreuid(ruid int, euid int) (err error) {
301 _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
302 if e1 != 0 {
303 err = errnoErr(e1)
304 }
305 return
306}
307
308// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
309
310func Shutdown(fd int, how int) (err error) {
311 _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)
312 if e1 != 0 {
313 err = errnoErr(e1)
314 }
315 return
316}
317
318// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
319
320func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
321 r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
322 n = int64(r0)
323 if e1 != 0 {
324 err = errnoErr(e1)
325 }
326 return
327}
328
329// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
330
331func Statfs(path string, buf *Statfs_t) (err error) {
332 var _p0 *byte
333 _p0, err = BytePtrFromString(path)
334 if err != nil {
335 return
336 }
337 _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)
338 if e1 != 0 {
339 err = errnoErr(e1)
340 }
341 return
342}
343
344// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
345
346func SyncFileRange(fd int, off int64, n int64, flags int) (err error) {
347 _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0)
348 if e1 != 0 {
349 err = errnoErr(e1)
350 }
351 return
352}
353
354// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
355
356func Truncate(path string, length int64) (err error) {
357 var _p0 *byte
358 _p0, err = BytePtrFromString(path)
359 if err != nil {
360 return
361 }
362 _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)
363 if e1 != 0 {
364 err = errnoErr(e1)
365 }
366 return
367}
368
369// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
370
371func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
372 r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
373 fd = int(r0)
374 if e1 != 0 {
375 err = errnoErr(e1)
376 }
377 return
378}
379
380// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
381
382func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {
383 r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)
384 fd = int(r0)
385 if e1 != 0 {
386 err = errnoErr(e1)
387 }
388 return
389}
390
391// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
392
393func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
394 _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
395 if e1 != 0 {
396 err = errnoErr(e1)
397 }
398 return
399}
400
401// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
402
403func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
404 _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
405 if e1 != 0 {
406 err = errnoErr(e1)
407 }
408 return
409}
410
411// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
412
413func getgroups(n int, list *_Gid_t) (nn int, err error) {
414 r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
415 nn = int(r0)
416 if e1 != 0 {
417 err = errnoErr(e1)
418 }
419 return
420}
421
422// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
423
424func setgroups(n int, list *_Gid_t) (err error) {
425 _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
426 if e1 != 0 {
427 err = errnoErr(e1)
428 }
429 return
430}
431
432// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
433
434func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
435 _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
436 if e1 != 0 {
437 err = errnoErr(e1)
438 }
439 return
440}
441
442// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
443
444func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
445 _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
446 if e1 != 0 {
447 err = errnoErr(e1)
448 }
449 return
450}
451
452// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
453
454func socket(domain int, typ int, proto int) (fd int, err error) {
455 r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
456 fd = int(r0)
457 if e1 != 0 {
458 err = errnoErr(e1)
459 }
460 return
461}
462
463// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
464
465func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
466 _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
467 if e1 != 0 {
468 err = errnoErr(e1)
469 }
470 return
471}
472
473// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
474
475func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
476 _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
477 if e1 != 0 {
478 err = errnoErr(e1)
479 }
480 return
481}
482
483// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
484
485func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
486 _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
487 if e1 != 0 {
488 err = errnoErr(e1)
489 }
490 return
491}
492
493// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
494
495func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
496 var _p0 unsafe.Pointer
497 if len(p) > 0 {
498 _p0 = unsafe.Pointer(&p[0])
499 } else {
500 _p0 = unsafe.Pointer(&_zero)
501 }
502 r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
503 n = int(r0)
504 if e1 != 0 {
505 err = errnoErr(e1)
506 }
507 return
508}
509
510// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
511
512func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
513 var _p0 unsafe.Pointer
514 if len(buf) > 0 {
515 _p0 = unsafe.Pointer(&buf[0])
516 } else {
517 _p0 = unsafe.Pointer(&_zero)
518 }
519 _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
520 if e1 != 0 {
521 err = errnoErr(e1)
522 }
523 return
524}
525
526// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
527
528func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
529 r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
530 n = int(r0)
531 if e1 != 0 {
532 err = errnoErr(e1)
533 }
534 return
535}
536
537// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
538
539func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
540 r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
541 n = int(r0)
542 if e1 != 0 {
543 err = errnoErr(e1)
544 }
545 return
546}
547
548// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
549
550func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
551 r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))
552 xaddr = uintptr(r0)
553 if e1 != 0 {
554 err = errnoErr(e1)
555 }
556 return
557}
558
559// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
560
561func Gettimeofday(tv *Timeval) (err error) {
562 _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
563 if e1 != 0 {
564 err = errnoErr(e1)
565 }
566 return
567}
568
569// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
570
William Kurkiandaa6bb22019-03-07 12:26:28 -0500571func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) {
572 var _p0 *byte
573 _p0, err = BytePtrFromString(cmdline)
574 if err != nil {
575 return
576 }
577 _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
578 if e1 != 0 {
579 err = errnoErr(e1)
580 }
581 return
582}