1 // mksyscall.pl syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go 2 // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT 3 4 // +build amd64,darwin 5 6 package syscall 7 8 import "unsafe" 9 10 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 11 12 func getgroups(ngid int, gid *_Gid_t) (n int, err error) { 13 r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) 14 n = int(r0) 15 if e1 != 0 { 16 err = errnoErr(e1) 17 } 18 return 19 } 20 21 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 22 23 func setgroups(ngid int, gid *_Gid_t) (err error) { 24 _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) 25 if e1 != 0 { 26 err = errnoErr(e1) 27 } 28 return 29 } 30 31 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 32 33 func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { 34 r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) 35 wpid = int(r0) 36 if e1 != 0 { 37 err = errnoErr(e1) 38 } 39 return 40 } 41 42 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 43 44 func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { 45 r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) 46 fd = int(r0) 47 if e1 != 0 { 48 err = errnoErr(e1) 49 } 50 return 51 } 52 53 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 54 55 func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { 56 _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) 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 connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { 66 _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) 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 socket(domain int, typ int, proto int) (fd int, err error) { 76 r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) 77 fd = int(r0) 78 if e1 != 0 { 79 err = errnoErr(e1) 80 } 81 return 82 } 83 84 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 85 86 func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { 87 _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) 88 if e1 != 0 { 89 err = errnoErr(e1) 90 } 91 return 92 } 93 94 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 95 96 func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { 97 _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) 98 if e1 != 0 { 99 err = errnoErr(e1) 100 } 101 return 102 } 103 104 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 105 106 func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { 107 _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) 108 if e1 != 0 { 109 err = errnoErr(e1) 110 } 111 return 112 } 113 114 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 115 116 func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { 117 _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) 118 if e1 != 0 { 119 err = errnoErr(e1) 120 } 121 return 122 } 123 124 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 125 126 func Shutdown(s int, how int) (err error) { 127 _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) 128 if e1 != 0 { 129 err = errnoErr(e1) 130 } 131 return 132 } 133 134 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 135 136 func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { 137 _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) 138 if e1 != 0 { 139 err = errnoErr(e1) 140 } 141 return 142 } 143 144 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 145 146 func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { 147 var _p0 unsafe.Pointer 148 if len(p) > 0 { 149 _p0 = unsafe.Pointer(&p[0]) 150 } else { 151 _p0 = unsafe.Pointer(&_zero) 152 } 153 r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) 154 n = int(r0) 155 if e1 != 0 { 156 err = errnoErr(e1) 157 } 158 return 159 } 160 161 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 162 163 func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { 164 var _p0 unsafe.Pointer 165 if len(buf) > 0 { 166 _p0 = unsafe.Pointer(&buf[0]) 167 } else { 168 _p0 = unsafe.Pointer(&_zero) 169 } 170 _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) 171 if e1 != 0 { 172 err = errnoErr(e1) 173 } 174 return 175 } 176 177 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 178 179 func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { 180 r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) 181 n = int(r0) 182 if e1 != 0 { 183 err = errnoErr(e1) 184 } 185 return 186 } 187 188 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 189 190 func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { 191 r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) 192 n = int(r0) 193 if e1 != 0 { 194 err = errnoErr(e1) 195 } 196 return 197 } 198 199 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 200 201 func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { 202 r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) 203 n = int(r0) 204 if e1 != 0 { 205 err = errnoErr(e1) 206 } 207 return 208 } 209 210 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 211 212 func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { 213 var _p0 unsafe.Pointer 214 if len(mib) > 0 { 215 _p0 = unsafe.Pointer(&mib[0]) 216 } else { 217 _p0 = unsafe.Pointer(&_zero) 218 } 219 _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) 220 if e1 != 0 { 221 err = errnoErr(e1) 222 } 223 return 224 } 225 226 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 227 228 func utimes(path string, timeval *[2]Timeval) (err error) { 229 var _p0 *byte 230 _p0, err = BytePtrFromString(path) 231 if err != nil { 232 return 233 } 234 _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) 235 use(unsafe.Pointer(_p0)) 236 if e1 != 0 { 237 err = errnoErr(e1) 238 } 239 return 240 } 241 242 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 243 244 func futimes(fd int, timeval *[2]Timeval) (err error) { 245 _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) 246 if e1 != 0 { 247 err = errnoErr(e1) 248 } 249 return 250 } 251 252 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 253 254 func fcntl(fd int, cmd int, arg int) (val int, err error) { 255 r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) 256 val = int(r0) 257 if e1 != 0 { 258 err = errnoErr(e1) 259 } 260 return 261 } 262 263 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 264 265 func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 266 _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) 267 if e1 != 0 { 268 err = errnoErr(e1) 269 } 270 return 271 } 272 273 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 274 275 func pipe() (r int, w int, err error) { 276 r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) 277 r = int(r0) 278 w = int(r1) 279 if e1 != 0 { 280 err = errnoErr(e1) 281 } 282 return 283 } 284 285 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 286 287 func kill(pid int, signum int, posix int) (err error) { 288 _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) 289 if e1 != 0 { 290 err = errnoErr(e1) 291 } 292 return 293 } 294 295 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 296 297 func Access(path string, mode uint32) (err error) { 298 var _p0 *byte 299 _p0, err = BytePtrFromString(path) 300 if err != nil { 301 return 302 } 303 _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) 304 use(unsafe.Pointer(_p0)) 305 if e1 != 0 { 306 err = errnoErr(e1) 307 } 308 return 309 } 310 311 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 312 313 func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { 314 _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) 315 if e1 != 0 { 316 err = errnoErr(e1) 317 } 318 return 319 } 320 321 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 322 323 func Chdir(path string) (err error) { 324 var _p0 *byte 325 _p0, err = BytePtrFromString(path) 326 if err != nil { 327 return 328 } 329 _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) 330 use(unsafe.Pointer(_p0)) 331 if e1 != 0 { 332 err = errnoErr(e1) 333 } 334 return 335 } 336 337 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 338 339 func Chflags(path string, flags int) (err error) { 340 var _p0 *byte 341 _p0, err = BytePtrFromString(path) 342 if err != nil { 343 return 344 } 345 _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) 346 use(unsafe.Pointer(_p0)) 347 if e1 != 0 { 348 err = errnoErr(e1) 349 } 350 return 351 } 352 353 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 354 355 func Chmod(path string, mode uint32) (err error) { 356 var _p0 *byte 357 _p0, err = BytePtrFromString(path) 358 if err != nil { 359 return 360 } 361 _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) 362 use(unsafe.Pointer(_p0)) 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 371 func Chown(path string, uid int, gid int) (err error) { 372 var _p0 *byte 373 _p0, err = BytePtrFromString(path) 374 if err != nil { 375 return 376 } 377 _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) 378 use(unsafe.Pointer(_p0)) 379 if e1 != 0 { 380 err = errnoErr(e1) 381 } 382 return 383 } 384 385 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 386 387 func Chroot(path string) (err error) { 388 var _p0 *byte 389 _p0, err = BytePtrFromString(path) 390 if err != nil { 391 return 392 } 393 _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) 394 use(unsafe.Pointer(_p0)) 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 403 func Close(fd int) (err error) { 404 _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) 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 413 func Dup(fd int) (nfd int, err error) { 414 r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) 415 nfd = 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 424 func Dup2(from int, to int) (err error) { 425 _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 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 434 func Exchangedata(path1 string, path2 string, options int) (err error) { 435 var _p0 *byte 436 _p0, err = BytePtrFromString(path1) 437 if err != nil { 438 return 439 } 440 var _p1 *byte 441 _p1, err = BytePtrFromString(path2) 442 if err != nil { 443 return 444 } 445 _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) 446 use(unsafe.Pointer(_p0)) 447 use(unsafe.Pointer(_p1)) 448 if e1 != 0 { 449 err = errnoErr(e1) 450 } 451 return 452 } 453 454 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 455 456 func Exit(code int) { 457 Syscall(SYS_EXIT, uintptr(code), 0, 0) 458 return 459 } 460 461 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 462 463 func Fchdir(fd int) (err error) { 464 _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) 465 if e1 != 0 { 466 err = errnoErr(e1) 467 } 468 return 469 } 470 471 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 472 473 func Fchflags(fd int, flags int) (err error) { 474 _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) 475 if e1 != 0 { 476 err = errnoErr(e1) 477 } 478 return 479 } 480 481 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 482 483 func Fchmod(fd int, mode uint32) (err error) { 484 _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) 485 if e1 != 0 { 486 err = errnoErr(e1) 487 } 488 return 489 } 490 491 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 492 493 func Fchown(fd int, uid int, gid int) (err error) { 494 _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) 495 if e1 != 0 { 496 err = errnoErr(e1) 497 } 498 return 499 } 500 501 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 502 503 func Flock(fd int, how int) (err error) { 504 _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) 505 if e1 != 0 { 506 err = errnoErr(e1) 507 } 508 return 509 } 510 511 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 512 513 func Fpathconf(fd int, name int) (val int, err error) { 514 r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) 515 val = int(r0) 516 if e1 != 0 { 517 err = errnoErr(e1) 518 } 519 return 520 } 521 522 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 523 524 func Fstat(fd int, stat *Stat_t) (err error) { 525 _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) 526 if e1 != 0 { 527 err = errnoErr(e1) 528 } 529 return 530 } 531 532 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 533 534 func Fstatfs(fd int, stat *Statfs_t) (err error) { 535 _, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) 536 if e1 != 0 { 537 err = errnoErr(e1) 538 } 539 return 540 } 541 542 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 543 544 func Fsync(fd int) (err error) { 545 _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) 546 if e1 != 0 { 547 err = errnoErr(e1) 548 } 549 return 550 } 551 552 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 553 554 func Ftruncate(fd int, length int64) (err error) { 555 _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) 556 if e1 != 0 { 557 err = errnoErr(e1) 558 } 559 return 560 } 561 562 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 563 564 func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 565 var _p0 unsafe.Pointer 566 if len(buf) > 0 { 567 _p0 = unsafe.Pointer(&buf[0]) 568 } else { 569 _p0 = unsafe.Pointer(&_zero) 570 } 571 r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) 572 n = int(r0) 573 if e1 != 0 { 574 err = errnoErr(e1) 575 } 576 return 577 } 578 579 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 580 581 func Getdtablesize() (size int) { 582 r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) 583 size = int(r0) 584 return 585 } 586 587 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 588 589 func Getegid() (egid int) { 590 r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) 591 egid = int(r0) 592 return 593 } 594 595 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 596 597 func Geteuid() (uid int) { 598 r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) 599 uid = int(r0) 600 return 601 } 602 603 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 604 605 func Getgid() (gid int) { 606 r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) 607 gid = int(r0) 608 return 609 } 610 611 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 612 613 func Getpgid(pid int) (pgid int, err error) { 614 r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) 615 pgid = int(r0) 616 if e1 != 0 { 617 err = errnoErr(e1) 618 } 619 return 620 } 621 622 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 623 624 func Getpgrp() (pgrp int) { 625 r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) 626 pgrp = int(r0) 627 return 628 } 629 630 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 631 632 func Getpid() (pid int) { 633 r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) 634 pid = int(r0) 635 return 636 } 637 638 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 639 640 func Getppid() (ppid int) { 641 r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) 642 ppid = int(r0) 643 return 644 } 645 646 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 647 648 func Getpriority(which int, who int) (prio int, err error) { 649 r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) 650 prio = int(r0) 651 if e1 != 0 { 652 err = errnoErr(e1) 653 } 654 return 655 } 656 657 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 658 659 func Getrlimit(which int, lim *Rlimit) (err error) { 660 _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) 661 if e1 != 0 { 662 err = errnoErr(e1) 663 } 664 return 665 } 666 667 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 668 669 func Getrusage(who int, rusage *Rusage) (err error) { 670 _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) 671 if e1 != 0 { 672 err = errnoErr(e1) 673 } 674 return 675 } 676 677 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 678 679 func Getsid(pid int) (sid int, err error) { 680 r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) 681 sid = int(r0) 682 if e1 != 0 { 683 err = errnoErr(e1) 684 } 685 return 686 } 687 688 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 689 690 func Getuid() (uid int) { 691 r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) 692 uid = int(r0) 693 return 694 } 695 696 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 697 698 func Issetugid() (tainted bool) { 699 r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0) 700 tainted = bool(r0 != 0) 701 return 702 } 703 704 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 705 706 func Kqueue() (fd int, err error) { 707 r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) 708 fd = int(r0) 709 if e1 != 0 { 710 err = errnoErr(e1) 711 } 712 return 713 } 714 715 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 716 717 func Lchown(path string, uid int, gid int) (err error) { 718 var _p0 *byte 719 _p0, err = BytePtrFromString(path) 720 if err != nil { 721 return 722 } 723 _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) 724 use(unsafe.Pointer(_p0)) 725 if e1 != 0 { 726 err = errnoErr(e1) 727 } 728 return 729 } 730 731 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 732 733 func Link(path string, link string) (err error) { 734 var _p0 *byte 735 _p0, err = BytePtrFromString(path) 736 if err != nil { 737 return 738 } 739 var _p1 *byte 740 _p1, err = BytePtrFromString(link) 741 if err != nil { 742 return 743 } 744 _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) 745 use(unsafe.Pointer(_p0)) 746 use(unsafe.Pointer(_p1)) 747 if e1 != 0 { 748 err = errnoErr(e1) 749 } 750 return 751 } 752 753 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 754 755 func Listen(s int, backlog int) (err error) { 756 _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) 757 if e1 != 0 { 758 err = errnoErr(e1) 759 } 760 return 761 } 762 763 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 764 765 func Lstat(path string, stat *Stat_t) (err error) { 766 var _p0 *byte 767 _p0, err = BytePtrFromString(path) 768 if err != nil { 769 return 770 } 771 _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) 772 use(unsafe.Pointer(_p0)) 773 if e1 != 0 { 774 err = errnoErr(e1) 775 } 776 return 777 } 778 779 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 780 781 func Mkdir(path string, mode uint32) (err error) { 782 var _p0 *byte 783 _p0, err = BytePtrFromString(path) 784 if err != nil { 785 return 786 } 787 _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) 788 use(unsafe.Pointer(_p0)) 789 if e1 != 0 { 790 err = errnoErr(e1) 791 } 792 return 793 } 794 795 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 796 797 func Mkfifo(path string, mode uint32) (err error) { 798 var _p0 *byte 799 _p0, err = BytePtrFromString(path) 800 if err != nil { 801 return 802 } 803 _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) 804 use(unsafe.Pointer(_p0)) 805 if e1 != 0 { 806 err = errnoErr(e1) 807 } 808 return 809 } 810 811 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 812 813 func Mknod(path string, mode uint32, dev int) (err error) { 814 var _p0 *byte 815 _p0, err = BytePtrFromString(path) 816 if err != nil { 817 return 818 } 819 _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) 820 use(unsafe.Pointer(_p0)) 821 if e1 != 0 { 822 err = errnoErr(e1) 823 } 824 return 825 } 826 827 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 828 829 func Mlock(b []byte) (err error) { 830 var _p0 unsafe.Pointer 831 if len(b) > 0 { 832 _p0 = unsafe.Pointer(&b[0]) 833 } else { 834 _p0 = unsafe.Pointer(&_zero) 835 } 836 _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) 837 if e1 != 0 { 838 err = errnoErr(e1) 839 } 840 return 841 } 842 843 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 844 845 func Mlockall(flags int) (err error) { 846 _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) 847 if e1 != 0 { 848 err = errnoErr(e1) 849 } 850 return 851 } 852 853 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 854 855 func Mprotect(b []byte, prot int) (err error) { 856 var _p0 unsafe.Pointer 857 if len(b) > 0 { 858 _p0 = unsafe.Pointer(&b[0]) 859 } else { 860 _p0 = unsafe.Pointer(&_zero) 861 } 862 _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) 863 if e1 != 0 { 864 err = errnoErr(e1) 865 } 866 return 867 } 868 869 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 870 871 func Munlock(b []byte) (err error) { 872 var _p0 unsafe.Pointer 873 if len(b) > 0 { 874 _p0 = unsafe.Pointer(&b[0]) 875 } else { 876 _p0 = unsafe.Pointer(&_zero) 877 } 878 _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) 879 if e1 != 0 { 880 err = errnoErr(e1) 881 } 882 return 883 } 884 885 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 886 887 func Munlockall() (err error) { 888 _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) 889 if e1 != 0 { 890 err = errnoErr(e1) 891 } 892 return 893 } 894 895 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 896 897 func Open(path string, mode int, perm uint32) (fd int, err error) { 898 var _p0 *byte 899 _p0, err = BytePtrFromString(path) 900 if err != nil { 901 return 902 } 903 r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) 904 use(unsafe.Pointer(_p0)) 905 fd = int(r0) 906 if e1 != 0 { 907 err = errnoErr(e1) 908 } 909 return 910 } 911 912 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 913 914 func Pathconf(path string, name int) (val int, err error) { 915 var _p0 *byte 916 _p0, err = BytePtrFromString(path) 917 if err != nil { 918 return 919 } 920 r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) 921 use(unsafe.Pointer(_p0)) 922 val = int(r0) 923 if e1 != 0 { 924 err = errnoErr(e1) 925 } 926 return 927 } 928 929 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 930 931 func Pread(fd int, p []byte, offset int64) (n int, err error) { 932 var _p0 unsafe.Pointer 933 if len(p) > 0 { 934 _p0 = unsafe.Pointer(&p[0]) 935 } else { 936 _p0 = unsafe.Pointer(&_zero) 937 } 938 r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) 939 n = int(r0) 940 if e1 != 0 { 941 err = errnoErr(e1) 942 } 943 return 944 } 945 946 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 947 948 func Pwrite(fd int, p []byte, offset int64) (n int, err error) { 949 var _p0 unsafe.Pointer 950 if len(p) > 0 { 951 _p0 = unsafe.Pointer(&p[0]) 952 } else { 953 _p0 = unsafe.Pointer(&_zero) 954 } 955 r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) 956 n = int(r0) 957 if e1 != 0 { 958 err = errnoErr(e1) 959 } 960 return 961 } 962 963 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 964 965 func read(fd int, p []byte) (n int, err error) { 966 var _p0 unsafe.Pointer 967 if len(p) > 0 { 968 _p0 = unsafe.Pointer(&p[0]) 969 } else { 970 _p0 = unsafe.Pointer(&_zero) 971 } 972 r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) 973 n = int(r0) 974 if e1 != 0 { 975 err = errnoErr(e1) 976 } 977 return 978 } 979 980 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 981 982 func Readlink(path string, buf []byte) (n int, err error) { 983 var _p0 *byte 984 _p0, err = BytePtrFromString(path) 985 if err != nil { 986 return 987 } 988 var _p1 unsafe.Pointer 989 if len(buf) > 0 { 990 _p1 = unsafe.Pointer(&buf[0]) 991 } else { 992 _p1 = unsafe.Pointer(&_zero) 993 } 994 r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) 995 use(unsafe.Pointer(_p0)) 996 n = int(r0) 997 if e1 != 0 { 998 err = errnoErr(e1) 999 } 1000 return 1001 } 1002 1003 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1004 1005 func Rename(from string, to string) (err error) { 1006 var _p0 *byte 1007 _p0, err = BytePtrFromString(from) 1008 if err != nil { 1009 return 1010 } 1011 var _p1 *byte 1012 _p1, err = BytePtrFromString(to) 1013 if err != nil { 1014 return 1015 } 1016 _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) 1017 use(unsafe.Pointer(_p0)) 1018 use(unsafe.Pointer(_p1)) 1019 if e1 != 0 { 1020 err = errnoErr(e1) 1021 } 1022 return 1023 } 1024 1025 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1026 1027 func Revoke(path string) (err error) { 1028 var _p0 *byte 1029 _p0, err = BytePtrFromString(path) 1030 if err != nil { 1031 return 1032 } 1033 _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) 1034 use(unsafe.Pointer(_p0)) 1035 if e1 != 0 { 1036 err = errnoErr(e1) 1037 } 1038 return 1039 } 1040 1041 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1042 1043 func Rmdir(path string) (err error) { 1044 var _p0 *byte 1045 _p0, err = BytePtrFromString(path) 1046 if err != nil { 1047 return 1048 } 1049 _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) 1050 use(unsafe.Pointer(_p0)) 1051 if e1 != 0 { 1052 err = errnoErr(e1) 1053 } 1054 return 1055 } 1056 1057 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1058 1059 func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { 1060 r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) 1061 newoffset = int64(r0) 1062 if e1 != 0 { 1063 err = errnoErr(e1) 1064 } 1065 return 1066 } 1067 1068 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1069 1070 func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { 1071 _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) 1072 if e1 != 0 { 1073 err = errnoErr(e1) 1074 } 1075 return 1076 } 1077 1078 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1079 1080 func Setegid(egid int) (err error) { 1081 _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0) 1082 if e1 != 0 { 1083 err = errnoErr(e1) 1084 } 1085 return 1086 } 1087 1088 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1089 1090 func Seteuid(euid int) (err error) { 1091 _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) 1092 if e1 != 0 { 1093 err = errnoErr(e1) 1094 } 1095 return 1096 } 1097 1098 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1099 1100 func Setgid(gid int) (err error) { 1101 _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) 1102 if e1 != 0 { 1103 err = errnoErr(e1) 1104 } 1105 return 1106 } 1107 1108 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1109 1110 func Setlogin(name string) (err error) { 1111 var _p0 *byte 1112 _p0, err = BytePtrFromString(name) 1113 if err != nil { 1114 return 1115 } 1116 _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) 1117 use(unsafe.Pointer(_p0)) 1118 if e1 != 0 { 1119 err = errnoErr(e1) 1120 } 1121 return 1122 } 1123 1124 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1125 1126 func Setpgid(pid int, pgid int) (err error) { 1127 _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) 1128 if e1 != 0 { 1129 err = errnoErr(e1) 1130 } 1131 return 1132 } 1133 1134 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1135 1136 func Setpriority(which int, who int, prio int) (err error) { 1137 _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) 1138 if e1 != 0 { 1139 err = errnoErr(e1) 1140 } 1141 return 1142 } 1143 1144 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1145 1146 func Setprivexec(flag int) (err error) { 1147 _, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0) 1148 if e1 != 0 { 1149 err = errnoErr(e1) 1150 } 1151 return 1152 } 1153 1154 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1155 1156 func Setregid(rgid int, egid int) (err error) { 1157 _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) 1158 if e1 != 0 { 1159 err = errnoErr(e1) 1160 } 1161 return 1162 } 1163 1164 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1165 1166 func Setreuid(ruid int, euid int) (err error) { 1167 _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) 1168 if e1 != 0 { 1169 err = errnoErr(e1) 1170 } 1171 return 1172 } 1173 1174 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1175 1176 func Setrlimit(which int, lim *Rlimit) (err error) { 1177 _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) 1178 if e1 != 0 { 1179 err = errnoErr(e1) 1180 } 1181 return 1182 } 1183 1184 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1185 1186 func Setsid() (pid int, err error) { 1187 r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) 1188 pid = int(r0) 1189 if e1 != 0 { 1190 err = errnoErr(e1) 1191 } 1192 return 1193 } 1194 1195 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1196 1197 func Settimeofday(tp *Timeval) (err error) { 1198 _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) 1199 if e1 != 0 { 1200 err = errnoErr(e1) 1201 } 1202 return 1203 } 1204 1205 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1206 1207 func Setuid(uid int) (err error) { 1208 _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) 1209 if e1 != 0 { 1210 err = errnoErr(e1) 1211 } 1212 return 1213 } 1214 1215 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1216 1217 func Stat(path string, stat *Stat_t) (err error) { 1218 var _p0 *byte 1219 _p0, err = BytePtrFromString(path) 1220 if err != nil { 1221 return 1222 } 1223 _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) 1224 use(unsafe.Pointer(_p0)) 1225 if e1 != 0 { 1226 err = errnoErr(e1) 1227 } 1228 return 1229 } 1230 1231 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1232 1233 func Statfs(path string, stat *Statfs_t) (err error) { 1234 var _p0 *byte 1235 _p0, err = BytePtrFromString(path) 1236 if err != nil { 1237 return 1238 } 1239 _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) 1240 use(unsafe.Pointer(_p0)) 1241 if e1 != 0 { 1242 err = errnoErr(e1) 1243 } 1244 return 1245 } 1246 1247 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1248 1249 func Symlink(path string, link string) (err error) { 1250 var _p0 *byte 1251 _p0, err = BytePtrFromString(path) 1252 if err != nil { 1253 return 1254 } 1255 var _p1 *byte 1256 _p1, err = BytePtrFromString(link) 1257 if err != nil { 1258 return 1259 } 1260 _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) 1261 use(unsafe.Pointer(_p0)) 1262 use(unsafe.Pointer(_p1)) 1263 if e1 != 0 { 1264 err = errnoErr(e1) 1265 } 1266 return 1267 } 1268 1269 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1270 1271 func Sync() (err error) { 1272 _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) 1273 if e1 != 0 { 1274 err = errnoErr(e1) 1275 } 1276 return 1277 } 1278 1279 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1280 1281 func Truncate(path string, length int64) (err error) { 1282 var _p0 *byte 1283 _p0, err = BytePtrFromString(path) 1284 if err != nil { 1285 return 1286 } 1287 _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) 1288 use(unsafe.Pointer(_p0)) 1289 if e1 != 0 { 1290 err = errnoErr(e1) 1291 } 1292 return 1293 } 1294 1295 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1296 1297 func Umask(newmask int) (oldmask int) { 1298 r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) 1299 oldmask = int(r0) 1300 return 1301 } 1302 1303 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1304 1305 func Undelete(path string) (err error) { 1306 var _p0 *byte 1307 _p0, err = BytePtrFromString(path) 1308 if err != nil { 1309 return 1310 } 1311 _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) 1312 use(unsafe.Pointer(_p0)) 1313 if e1 != 0 { 1314 err = errnoErr(e1) 1315 } 1316 return 1317 } 1318 1319 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1320 1321 func Unlink(path string) (err error) { 1322 var _p0 *byte 1323 _p0, err = BytePtrFromString(path) 1324 if err != nil { 1325 return 1326 } 1327 _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) 1328 use(unsafe.Pointer(_p0)) 1329 if e1 != 0 { 1330 err = errnoErr(e1) 1331 } 1332 return 1333 } 1334 1335 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1336 1337 func Unmount(path string, flags int) (err error) { 1338 var _p0 *byte 1339 _p0, err = BytePtrFromString(path) 1340 if err != nil { 1341 return 1342 } 1343 _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) 1344 use(unsafe.Pointer(_p0)) 1345 if e1 != 0 { 1346 err = errnoErr(e1) 1347 } 1348 return 1349 } 1350 1351 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1352 1353 func write(fd int, p []byte) (n int, err error) { 1354 var _p0 unsafe.Pointer 1355 if len(p) > 0 { 1356 _p0 = unsafe.Pointer(&p[0]) 1357 } else { 1358 _p0 = unsafe.Pointer(&_zero) 1359 } 1360 r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) 1361 n = int(r0) 1362 if e1 != 0 { 1363 err = errnoErr(e1) 1364 } 1365 return 1366 } 1367 1368 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1369 1370 func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { 1371 r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) 1372 ret = uintptr(r0) 1373 if e1 != 0 { 1374 err = errnoErr(e1) 1375 } 1376 return 1377 } 1378 1379 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1380 1381 func munmap(addr uintptr, length uintptr) (err error) { 1382 _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) 1383 if e1 != 0 { 1384 err = errnoErr(e1) 1385 } 1386 return 1387 } 1388 1389 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1390 1391 func readlen(fd int, buf *byte, nbuf int) (n int, err error) { 1392 r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) 1393 n = int(r0) 1394 if e1 != 0 { 1395 err = errnoErr(e1) 1396 } 1397 return 1398 } 1399 1400 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1401 1402 func writelen(fd int, buf *byte, nbuf int) (n int, err error) { 1403 r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) 1404 n = int(r0) 1405 if e1 != 0 { 1406 err = errnoErr(e1) 1407 } 1408 return 1409 } 1410 1411 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 1412 1413 func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) { 1414 r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) 1415 sec = int64(r0) 1416 usec = int32(r1) 1417 if e1 != 0 { 1418 err = errnoErr(e1) 1419 } 1420 return 1421 } 1422