github.com/tristanisham/sys@v0.0.0-20240326010300-a16cbabb7555/unix/zsyscall_linux_riscv64.go (about) 1 // 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 //go:build linux && riscv64 5 6 package unix 7 8 import ( 9 "syscall" 10 "unsafe" 11 ) 12 13 var _ syscall.Errno 14 15 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 16 17 func 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 27 func 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 37 func 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 48 func 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 65 func 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 75 func 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 85 func 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 95 func 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 110 func 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 120 func 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 130 func 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 138 func 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 146 func 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 154 func 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 164 func 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 172 func 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 182 func MemfdSecret(flags int) (fd int, err error) { 183 r0, _, e1 := Syscall(SYS_MEMFD_SECRET, uintptr(flags), 0, 0) 184 fd = int(r0) 185 if e1 != 0 { 186 err = errnoErr(e1) 187 } 188 return 189 } 190 191 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 192 193 func pread(fd int, p []byte, offset int64) (n int, err error) { 194 var _p0 unsafe.Pointer 195 if len(p) > 0 { 196 _p0 = unsafe.Pointer(&p[0]) 197 } else { 198 _p0 = unsafe.Pointer(&_zero) 199 } 200 r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) 201 n = int(r0) 202 if e1 != 0 { 203 err = errnoErr(e1) 204 } 205 return 206 } 207 208 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 209 210 func pwrite(fd int, p []byte, offset int64) (n int, err error) { 211 var _p0 unsafe.Pointer 212 if len(p) > 0 { 213 _p0 = unsafe.Pointer(&p[0]) 214 } else { 215 _p0 = unsafe.Pointer(&_zero) 216 } 217 r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) 218 n = int(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 227 func Seek(fd int, offset int64, whence int) (off int64, err error) { 228 r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) 229 off = int64(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 238 func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 239 r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) 240 written = int(r0) 241 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 249 func setfsgid(gid int) (prev int, err error) { 250 r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) 251 prev = int(r0) 252 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 260 func setfsuid(uid int) (prev int, err error) { 261 r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) 262 prev = int(r0) 263 if e1 != 0 { 264 err = errnoErr(e1) 265 } 266 return 267 } 268 269 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 270 271 func Shutdown(fd int, how int) (err error) { 272 _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) 273 if e1 != 0 { 274 err = errnoErr(e1) 275 } 276 return 277 } 278 279 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 280 281 func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { 282 r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) 283 n = int64(r0) 284 if e1 != 0 { 285 err = errnoErr(e1) 286 } 287 return 288 } 289 290 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 291 292 func Statfs(path string, buf *Statfs_t) (err error) { 293 var _p0 *byte 294 _p0, err = BytePtrFromString(path) 295 if err != nil { 296 return 297 } 298 _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) 299 if e1 != 0 { 300 err = errnoErr(e1) 301 } 302 return 303 } 304 305 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 306 307 func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { 308 _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) 309 if e1 != 0 { 310 err = errnoErr(e1) 311 } 312 return 313 } 314 315 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 316 317 func Truncate(path string, length int64) (err error) { 318 var _p0 *byte 319 _p0, err = BytePtrFromString(path) 320 if err != nil { 321 return 322 } 323 _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) 324 if e1 != 0 { 325 err = errnoErr(e1) 326 } 327 return 328 } 329 330 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 331 332 func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { 333 r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) 334 fd = int(r0) 335 if e1 != 0 { 336 err = errnoErr(e1) 337 } 338 return 339 } 340 341 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 342 343 func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { 344 _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) 345 if e1 != 0 { 346 err = errnoErr(e1) 347 } 348 return 349 } 350 351 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 352 353 func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { 354 _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) 355 if e1 != 0 { 356 err = errnoErr(e1) 357 } 358 return 359 } 360 361 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 362 363 func getgroups(n int, list *_Gid_t) (nn int, err error) { 364 r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) 365 nn = int(r0) 366 if e1 != 0 { 367 err = errnoErr(e1) 368 } 369 return 370 } 371 372 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 373 374 func setgroups(n int, list *_Gid_t) (err error) { 375 _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) 376 if e1 != 0 { 377 err = errnoErr(e1) 378 } 379 return 380 } 381 382 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 383 384 func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { 385 _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) 386 if e1 != 0 { 387 err = errnoErr(e1) 388 } 389 return 390 } 391 392 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 393 394 func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { 395 _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) 396 if e1 != 0 { 397 err = errnoErr(e1) 398 } 399 return 400 } 401 402 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 403 404 func socket(domain int, typ int, proto int) (fd int, err error) { 405 r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) 406 fd = int(r0) 407 if e1 != 0 { 408 err = errnoErr(e1) 409 } 410 return 411 } 412 413 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 414 415 func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { 416 _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) 417 if e1 != 0 { 418 err = errnoErr(e1) 419 } 420 return 421 } 422 423 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 424 425 func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { 426 _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) 427 if e1 != 0 { 428 err = errnoErr(e1) 429 } 430 return 431 } 432 433 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 434 435 func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { 436 _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) 437 if e1 != 0 { 438 err = errnoErr(e1) 439 } 440 return 441 } 442 443 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 444 445 func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { 446 var _p0 unsafe.Pointer 447 if len(p) > 0 { 448 _p0 = unsafe.Pointer(&p[0]) 449 } else { 450 _p0 = unsafe.Pointer(&_zero) 451 } 452 r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) 453 n = int(r0) 454 if e1 != 0 { 455 err = errnoErr(e1) 456 } 457 return 458 } 459 460 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 461 462 func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { 463 var _p0 unsafe.Pointer 464 if len(buf) > 0 { 465 _p0 = unsafe.Pointer(&buf[0]) 466 } else { 467 _p0 = unsafe.Pointer(&_zero) 468 } 469 _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) 470 if e1 != 0 { 471 err = errnoErr(e1) 472 } 473 return 474 } 475 476 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 477 478 func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { 479 r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) 480 n = int(r0) 481 if e1 != 0 { 482 err = errnoErr(e1) 483 } 484 return 485 } 486 487 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 488 489 func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { 490 r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) 491 n = int(r0) 492 if e1 != 0 { 493 err = errnoErr(e1) 494 } 495 return 496 } 497 498 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 499 500 func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { 501 r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) 502 xaddr = uintptr(r0) 503 if e1 != 0 { 504 err = errnoErr(e1) 505 } 506 return 507 } 508 509 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 510 511 func Gettimeofday(tv *Timeval) (err error) { 512 _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) 513 if e1 != 0 { 514 err = errnoErr(e1) 515 } 516 return 517 } 518 519 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 520 521 func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { 522 var _p0 *byte 523 _p0, err = BytePtrFromString(cmdline) 524 if err != nil { 525 return 526 } 527 _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) 528 if e1 != 0 { 529 err = errnoErr(e1) 530 } 531 return 532 } 533 534 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 535 536 func riscvHWProbe(pairs []RISCVHWProbePairs, cpuCount uintptr, cpus *CPUSet, flags uint) (err error) { 537 var _p0 unsafe.Pointer 538 if len(pairs) > 0 { 539 _p0 = unsafe.Pointer(&pairs[0]) 540 } else { 541 _p0 = unsafe.Pointer(&_zero) 542 } 543 _, _, e1 := Syscall6(SYS_RISCV_HWPROBE, uintptr(_p0), uintptr(len(pairs)), uintptr(cpuCount), uintptr(unsafe.Pointer(cpus)), uintptr(flags), 0) 544 if e1 != 0 { 545 err = errnoErr(e1) 546 } 547 return 548 }