1 // mksyscall_solaris.pl syscall_solaris.go syscall_solaris_amd64.go 2 // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT 3 4 // +build amd64,solaris 5 6 package syscall 7 8 import "unsafe" 9 10 //go:cgo_import_dynamic libc_Getcwd getcwd "libc.so" 11 //go:cgo_import_dynamic libc_getgroups getgroups "libc.so" 12 //go:cgo_import_dynamic libc_setgroups setgroups "libc.so" 13 //go:cgo_import_dynamic libc_fcntl fcntl "libc.so" 14 //go:cgo_import_dynamic libc_accept accept "libsocket.so" 15 //go:cgo_import_dynamic libc___xnet_sendmsg __xnet_sendmsg "libsocket.so" 16 //go:cgo_import_dynamic libc_Access access "libc.so" 17 //go:cgo_import_dynamic libc_Adjtime adjtime "libc.so" 18 //go:cgo_import_dynamic libc_Chdir chdir "libc.so" 19 //go:cgo_import_dynamic libc_Chmod chmod "libc.so" 20 //go:cgo_import_dynamic libc_Chown chown "libc.so" 21 //go:cgo_import_dynamic libc_Chroot chroot "libc.so" 22 //go:cgo_import_dynamic libc_Close close "libc.so" 23 //go:cgo_import_dynamic libc_Dup dup "libc.so" 24 //go:cgo_import_dynamic libc_Exit exit "libc.so" 25 //go:cgo_import_dynamic libc_Fchdir fchdir "libc.so" 26 //go:cgo_import_dynamic libc_Fchmod fchmod "libc.so" 27 //go:cgo_import_dynamic libc_Fchown fchown "libc.so" 28 //go:cgo_import_dynamic libc_Fpathconf fpathconf "libc.so" 29 //go:cgo_import_dynamic libc_Fstat fstat "libc.so" 30 //go:cgo_import_dynamic libc_Getdents getdents "libc.so" 31 //go:cgo_import_dynamic libc_Getgid getgid "libc.so" 32 //go:cgo_import_dynamic libc_Getpid getpid "libc.so" 33 //go:cgo_import_dynamic libc_Geteuid geteuid "libc.so" 34 //go:cgo_import_dynamic libc_Getegid getegid "libc.so" 35 //go:cgo_import_dynamic libc_Getppid getppid "libc.so" 36 //go:cgo_import_dynamic libc_Getpriority getpriority "libc.so" 37 //go:cgo_import_dynamic libc_Getrlimit getrlimit "libc.so" 38 //go:cgo_import_dynamic libc_Gettimeofday gettimeofday "libc.so" 39 //go:cgo_import_dynamic libc_Getuid getuid "libc.so" 40 //go:cgo_import_dynamic libc_Kill kill "libc.so" 41 //go:cgo_import_dynamic libc_Lchown lchown "libc.so" 42 //go:cgo_import_dynamic libc_Link link "libc.so" 43 //go:cgo_import_dynamic libc___xnet_listen __xnet_listen "libsocket.so" 44 //go:cgo_import_dynamic libc_Lstat lstat "libc.so" 45 //go:cgo_import_dynamic libc_Mkdir mkdir "libc.so" 46 //go:cgo_import_dynamic libc_Mknod mknod "libc.so" 47 //go:cgo_import_dynamic libc_Nanosleep nanosleep "libc.so" 48 //go:cgo_import_dynamic libc_Open open "libc.so" 49 //go:cgo_import_dynamic libc_Pathconf pathconf "libc.so" 50 //go:cgo_import_dynamic libc_Pread pread "libc.so" 51 //go:cgo_import_dynamic libc_Pwrite pwrite "libc.so" 52 //go:cgo_import_dynamic libc_read read "libc.so" 53 //go:cgo_import_dynamic libc_Readlink readlink "libc.so" 54 //go:cgo_import_dynamic libc_Rename rename "libc.so" 55 //go:cgo_import_dynamic libc_Rmdir rmdir "libc.so" 56 //go:cgo_import_dynamic libc_lseek lseek "libc.so" 57 //go:cgo_import_dynamic libc_sendfile sendfile "libsendfile.so" 58 //go:cgo_import_dynamic libc_Setegid setegid "libc.so" 59 //go:cgo_import_dynamic libc_Seteuid seteuid "libc.so" 60 //go:cgo_import_dynamic libc_Setgid setgid "libc.so" 61 //go:cgo_import_dynamic libc_Setpgid setpgid "libc.so" 62 //go:cgo_import_dynamic libc_Setpriority setpriority "libc.so" 63 //go:cgo_import_dynamic libc_Setregid setregid "libc.so" 64 //go:cgo_import_dynamic libc_Setreuid setreuid "libc.so" 65 //go:cgo_import_dynamic libc_Setrlimit setrlimit "libc.so" 66 //go:cgo_import_dynamic libc_Setsid setsid "libc.so" 67 //go:cgo_import_dynamic libc_Setuid setuid "libc.so" 68 //go:cgo_import_dynamic libc_shutdown shutdown "libsocket.so" 69 //go:cgo_import_dynamic libc_Stat stat "libc.so" 70 //go:cgo_import_dynamic libc_Symlink symlink "libc.so" 71 //go:cgo_import_dynamic libc_Sync sync "libc.so" 72 //go:cgo_import_dynamic libc_Truncate truncate "libc.so" 73 //go:cgo_import_dynamic libc_Fsync fsync "libc.so" 74 //go:cgo_import_dynamic libc_Ftruncate ftruncate "libc.so" 75 //go:cgo_import_dynamic libc_Umask umask "libc.so" 76 //go:cgo_import_dynamic libc_Unlink unlink "libc.so" 77 //go:cgo_import_dynamic libc_Utimes utimes "libc.so" 78 //go:cgo_import_dynamic libc___xnet_bind __xnet_bind "libsocket.so" 79 //go:cgo_import_dynamic libc___xnet_connect __xnet_connect "libsocket.so" 80 //go:cgo_import_dynamic libc_mmap mmap "libc.so" 81 //go:cgo_import_dynamic libc_munmap munmap "libc.so" 82 //go:cgo_import_dynamic libc___xnet_sendto __xnet_sendto "libsocket.so" 83 //go:cgo_import_dynamic libc___xnet_socket __xnet_socket "libsocket.so" 84 //go:cgo_import_dynamic libc___xnet_socketpair __xnet_socketpair "libsocket.so" 85 //go:cgo_import_dynamic libc_write write "libc.so" 86 //go:cgo_import_dynamic libc___xnet_getsockopt __xnet_getsockopt "libsocket.so" 87 //go:cgo_import_dynamic libc_getpeername getpeername "libsocket.so" 88 //go:cgo_import_dynamic libc_getsockname getsockname "libsocket.so" 89 //go:cgo_import_dynamic libc_setsockopt setsockopt "libsocket.so" 90 //go:cgo_import_dynamic libc_recvfrom recvfrom "libsocket.so" 91 //go:cgo_import_dynamic libc___xnet_recvmsg __xnet_recvmsg "libsocket.so" 92 //go:cgo_import_dynamic libc_getexecname getexecname "libc.so" 93 94 //go:linkname libc_Getcwd libc_Getcwd 95 //go:linkname libc_getgroups libc_getgroups 96 //go:linkname libc_setgroups libc_setgroups 97 //go:linkname libc_fcntl libc_fcntl 98 //go:linkname libc_accept libc_accept 99 //go:linkname libc___xnet_sendmsg libc___xnet_sendmsg 100 //go:linkname libc_Access libc_Access 101 //go:linkname libc_Adjtime libc_Adjtime 102 //go:linkname libc_Chdir libc_Chdir 103 //go:linkname libc_Chmod libc_Chmod 104 //go:linkname libc_Chown libc_Chown 105 //go:linkname libc_Chroot libc_Chroot 106 //go:linkname libc_Close libc_Close 107 //go:linkname libc_Dup libc_Dup 108 //go:linkname libc_Exit libc_Exit 109 //go:linkname libc_Fchdir libc_Fchdir 110 //go:linkname libc_Fchmod libc_Fchmod 111 //go:linkname libc_Fchown libc_Fchown 112 //go:linkname libc_Fpathconf libc_Fpathconf 113 //go:linkname libc_Fstat libc_Fstat 114 //go:linkname libc_Getdents libc_Getdents 115 //go:linkname libc_Getgid libc_Getgid 116 //go:linkname libc_Getpid libc_Getpid 117 //go:linkname libc_Geteuid libc_Geteuid 118 //go:linkname libc_Getegid libc_Getegid 119 //go:linkname libc_Getppid libc_Getppid 120 //go:linkname libc_Getpriority libc_Getpriority 121 //go:linkname libc_Getrlimit libc_Getrlimit 122 //go:linkname libc_Gettimeofday libc_Gettimeofday 123 //go:linkname libc_Getuid libc_Getuid 124 //go:linkname libc_Kill libc_Kill 125 //go:linkname libc_Lchown libc_Lchown 126 //go:linkname libc_Link libc_Link 127 //go:linkname libc___xnet_listen libc___xnet_listen 128 //go:linkname libc_Lstat libc_Lstat 129 //go:linkname libc_Mkdir libc_Mkdir 130 //go:linkname libc_Mknod libc_Mknod 131 //go:linkname libc_Nanosleep libc_Nanosleep 132 //go:linkname libc_Open libc_Open 133 //go:linkname libc_Pathconf libc_Pathconf 134 //go:linkname libc_Pread libc_Pread 135 //go:linkname libc_Pwrite libc_Pwrite 136 //go:linkname libc_read libc_read 137 //go:linkname libc_Readlink libc_Readlink 138 //go:linkname libc_Rename libc_Rename 139 //go:linkname libc_Rmdir libc_Rmdir 140 //go:linkname libc_lseek libc_lseek 141 //go:linkname libc_sendfile libc_sendfile 142 //go:linkname libc_Setegid libc_Setegid 143 //go:linkname libc_Seteuid libc_Seteuid 144 //go:linkname libc_Setgid libc_Setgid 145 //go:linkname libc_Setpgid libc_Setpgid 146 //go:linkname libc_Setpriority libc_Setpriority 147 //go:linkname libc_Setregid libc_Setregid 148 //go:linkname libc_Setreuid libc_Setreuid 149 //go:linkname libc_Setrlimit libc_Setrlimit 150 //go:linkname libc_Setsid libc_Setsid 151 //go:linkname libc_Setuid libc_Setuid 152 //go:linkname libc_shutdown libc_shutdown 153 //go:linkname libc_Stat libc_Stat 154 //go:linkname libc_Symlink libc_Symlink 155 //go:linkname libc_Sync libc_Sync 156 //go:linkname libc_Truncate libc_Truncate 157 //go:linkname libc_Fsync libc_Fsync 158 //go:linkname libc_Ftruncate libc_Ftruncate 159 //go:linkname libc_Umask libc_Umask 160 //go:linkname libc_Unlink libc_Unlink 161 //go:linkname libc_Utimes libc_Utimes 162 //go:linkname libc___xnet_bind libc___xnet_bind 163 //go:linkname libc___xnet_connect libc___xnet_connect 164 //go:linkname libc_mmap libc_mmap 165 //go:linkname libc_munmap libc_munmap 166 //go:linkname libc___xnet_sendto libc___xnet_sendto 167 //go:linkname libc___xnet_socket libc___xnet_socket 168 //go:linkname libc___xnet_socketpair libc___xnet_socketpair 169 //go:linkname libc_write libc_write 170 //go:linkname libc___xnet_getsockopt libc___xnet_getsockopt 171 //go:linkname libc_getpeername libc_getpeername 172 //go:linkname libc_getsockname libc_getsockname 173 //go:linkname libc_setsockopt libc_setsockopt 174 //go:linkname libc_recvfrom libc_recvfrom 175 //go:linkname libc___xnet_recvmsg libc___xnet_recvmsg 176 //go:linkname libc_getexecname libc_getexecname 177 178 type libcFunc uintptr 179 180 var ( 181 libc_Getcwd, 182 libc_getgroups, 183 libc_setgroups, 184 libc_fcntl, 185 libc_accept, 186 libc___xnet_sendmsg, 187 libc_Access, 188 libc_Adjtime, 189 libc_Chdir, 190 libc_Chmod, 191 libc_Chown, 192 libc_Chroot, 193 libc_Close, 194 libc_Dup, 195 libc_Exit, 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 libcFunc 264 ) 265 266 func Getcwd(buf []byte) (n int, err error) { 267 var _p0 *byte 268 if len(buf) > 0 { 269 _p0 = &buf[0] 270 } 271 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Getcwd)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0, 0, 0, 0) 272 n = int(r0) 273 if e1 != 0 { 274 err = errnoErr(e1) 275 } 276 return 277 } 278 279 func getgroups(ngid int, gid *_Gid_t) (n int, err error) { 280 r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_getgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0) 281 n = int(r0) 282 if e1 != 0 { 283 err = errnoErr(e1) 284 } 285 return 286 } 287 288 func setgroups(ngid int, gid *_Gid_t) (err error) { 289 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_setgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0) 290 if e1 != 0 { 291 err = errnoErr(e1) 292 } 293 return 294 } 295 296 func fcntl(fd int, cmd int, arg int) (val int, err error) { 297 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_fcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0) 298 val = int(r0) 299 if e1 != 0 { 300 err = errnoErr(e1) 301 } 302 return 303 } 304 305 func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { 306 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_accept)), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) 307 fd = int(r0) 308 if e1 != 0 { 309 err = errnoErr(e1) 310 } 311 return 312 } 313 314 func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { 315 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_sendmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0) 316 n = int(r0) 317 if e1 != 0 { 318 err = errnoErr(e1) 319 } 320 return 321 } 322 323 func Access(path string, mode uint32) (err error) { 324 var _p0 *byte 325 _p0, err = BytePtrFromString(path) 326 if err != nil { 327 return 328 } 329 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Access)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0) 330 use(unsafe.Pointer(_p0)) 331 if e1 != 0 { 332 err = errnoErr(e1) 333 } 334 return 335 } 336 337 func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { 338 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Adjtime)), 2, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0, 0, 0, 0) 339 if e1 != 0 { 340 err = errnoErr(e1) 341 } 342 return 343 } 344 345 func Chdir(path string) (err error) { 346 var _p0 *byte 347 _p0, err = BytePtrFromString(path) 348 if err != nil { 349 return 350 } 351 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Chdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0) 352 use(unsafe.Pointer(_p0)) 353 if e1 != 0 { 354 err = errnoErr(e1) 355 } 356 return 357 } 358 359 func Chmod(path string, mode uint32) (err error) { 360 var _p0 *byte 361 _p0, err = BytePtrFromString(path) 362 if err != nil { 363 return 364 } 365 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Chmod)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0) 366 use(unsafe.Pointer(_p0)) 367 if e1 != 0 { 368 err = errnoErr(e1) 369 } 370 return 371 } 372 373 func Chown(path string, uid int, gid int) (err error) { 374 var _p0 *byte 375 _p0, err = BytePtrFromString(path) 376 if err != nil { 377 return 378 } 379 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Chown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0) 380 use(unsafe.Pointer(_p0)) 381 if e1 != 0 { 382 err = errnoErr(e1) 383 } 384 return 385 } 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 := sysvicall6(uintptr(unsafe.Pointer(&libc_Chroot)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0) 394 use(unsafe.Pointer(_p0)) 395 if e1 != 0 { 396 err = errnoErr(e1) 397 } 398 return 399 } 400 401 func Close(fd int) (err error) { 402 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Close)), 1, uintptr(fd), 0, 0, 0, 0, 0) 403 if e1 != 0 { 404 err = errnoErr(e1) 405 } 406 return 407 } 408 409 func Dup(fd int) (nfd int, err error) { 410 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Dup)), 1, uintptr(fd), 0, 0, 0, 0, 0) 411 nfd = int(r0) 412 if e1 != 0 { 413 err = errnoErr(e1) 414 } 415 return 416 } 417 418 func Exit(code int) { 419 sysvicall6(uintptr(unsafe.Pointer(&libc_Exit)), 1, uintptr(code), 0, 0, 0, 0, 0) 420 return 421 } 422 423 func Fchdir(fd int) (err error) { 424 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Fchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0) 425 if e1 != 0 { 426 err = errnoErr(e1) 427 } 428 return 429 } 430 431 func Fchmod(fd int, mode uint32) (err error) { 432 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Fchmod)), 2, uintptr(fd), uintptr(mode), 0, 0, 0, 0) 433 if e1 != 0 { 434 err = errnoErr(e1) 435 } 436 return 437 } 438 439 func Fchown(fd int, uid int, gid int) (err error) { 440 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Fchown)), 3, uintptr(fd), uintptr(uid), uintptr(gid), 0, 0, 0) 441 if e1 != 0 { 442 err = errnoErr(e1) 443 } 444 return 445 } 446 447 func Fpathconf(fd int, name int) (val int, err error) { 448 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Fpathconf)), 2, uintptr(fd), uintptr(name), 0, 0, 0, 0) 449 val = int(r0) 450 if e1 != 0 { 451 err = errnoErr(e1) 452 } 453 return 454 } 455 456 func Fstat(fd int, stat *Stat_t) (err error) { 457 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Fstat)), 2, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0) 458 if e1 != 0 { 459 err = errnoErr(e1) 460 } 461 return 462 } 463 464 func Getdents(fd int, buf []byte, basep *uintptr) (n int, err error) { 465 var _p0 *byte 466 if len(buf) > 0 { 467 _p0 = &buf[0] 468 } 469 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Getdents)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) 470 n = int(r0) 471 if e1 != 0 { 472 err = errnoErr(e1) 473 } 474 return 475 } 476 477 func Getgid() (gid int) { 478 r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Getgid)), 0, 0, 0, 0, 0, 0, 0) 479 gid = int(r0) 480 return 481 } 482 483 func Getpid() (pid int) { 484 r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Getpid)), 0, 0, 0, 0, 0, 0, 0) 485 pid = int(r0) 486 return 487 } 488 489 func Geteuid() (euid int) { 490 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&libc_Geteuid)), 0, 0, 0, 0, 0, 0, 0) 491 euid = int(r0) 492 return 493 } 494 495 func Getegid() (egid int) { 496 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&libc_Getegid)), 0, 0, 0, 0, 0, 0, 0) 497 egid = int(r0) 498 return 499 } 500 501 func Getppid() (ppid int) { 502 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&libc_Getppid)), 0, 0, 0, 0, 0, 0, 0) 503 ppid = int(r0) 504 return 505 } 506 507 func Getpriority(which int, who int) (n int, err error) { 508 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Getpriority)), 2, uintptr(which), uintptr(who), 0, 0, 0, 0) 509 n = int(r0) 510 if e1 != 0 { 511 err = errnoErr(e1) 512 } 513 return 514 } 515 516 func Getrlimit(which int, lim *Rlimit) (err error) { 517 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Getrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0) 518 if e1 != 0 { 519 err = errnoErr(e1) 520 } 521 return 522 } 523 524 func Gettimeofday(tv *Timeval) (err error) { 525 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Gettimeofday)), 1, uintptr(unsafe.Pointer(tv)), 0, 0, 0, 0, 0) 526 if e1 != 0 { 527 err = errnoErr(e1) 528 } 529 return 530 } 531 532 func Getuid() (uid int) { 533 r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Getuid)), 0, 0, 0, 0, 0, 0, 0) 534 uid = int(r0) 535 return 536 } 537 538 func Kill(pid int, signum Signal) (err error) { 539 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Kill)), 2, uintptr(pid), uintptr(signum), 0, 0, 0, 0) 540 if e1 != 0 { 541 err = errnoErr(e1) 542 } 543 return 544 } 545 546 func Lchown(path string, uid int, gid int) (err error) { 547 var _p0 *byte 548 _p0, err = BytePtrFromString(path) 549 if err != nil { 550 return 551 } 552 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Lchown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0) 553 use(unsafe.Pointer(_p0)) 554 if e1 != 0 { 555 err = errnoErr(e1) 556 } 557 return 558 } 559 560 func Link(path string, link string) (err error) { 561 var _p0 *byte 562 _p0, err = BytePtrFromString(path) 563 if err != nil { 564 return 565 } 566 var _p1 *byte 567 _p1, err = BytePtrFromString(link) 568 if err != nil { 569 return 570 } 571 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Link)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0) 572 use(unsafe.Pointer(_p0)) 573 use(unsafe.Pointer(_p1)) 574 if e1 != 0 { 575 err = errnoErr(e1) 576 } 577 return 578 } 579 580 func Listen(s int, backlog int) (err error) { 581 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_listen)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0) 582 if e1 != 0 { 583 err = errnoErr(e1) 584 } 585 return 586 } 587 588 func Lstat(path string, stat *Stat_t) (err error) { 589 var _p0 *byte 590 _p0, err = BytePtrFromString(path) 591 if err != nil { 592 return 593 } 594 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Lstat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0) 595 use(unsafe.Pointer(_p0)) 596 if e1 != 0 { 597 err = errnoErr(e1) 598 } 599 return 600 } 601 602 func Mkdir(path string, mode uint32) (err error) { 603 var _p0 *byte 604 _p0, err = BytePtrFromString(path) 605 if err != nil { 606 return 607 } 608 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Mkdir)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0) 609 use(unsafe.Pointer(_p0)) 610 if e1 != 0 { 611 err = errnoErr(e1) 612 } 613 return 614 } 615 616 func Mknod(path string, mode uint32, dev int) (err error) { 617 var _p0 *byte 618 _p0, err = BytePtrFromString(path) 619 if err != nil { 620 return 621 } 622 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Mknod)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0, 0) 623 use(unsafe.Pointer(_p0)) 624 if e1 != 0 { 625 err = errnoErr(e1) 626 } 627 return 628 } 629 630 func Nanosleep(time *Timespec, leftover *Timespec) (err error) { 631 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Nanosleep)), 2, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0, 0, 0, 0) 632 if e1 != 0 { 633 err = errnoErr(e1) 634 } 635 return 636 } 637 638 func Open(path string, mode int, perm uint32) (fd int, err error) { 639 var _p0 *byte 640 _p0, err = BytePtrFromString(path) 641 if err != nil { 642 return 643 } 644 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Open)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0, 0) 645 use(unsafe.Pointer(_p0)) 646 fd = int(r0) 647 if e1 != 0 { 648 err = errnoErr(e1) 649 } 650 return 651 } 652 653 func Pathconf(path string, name int) (val int, err error) { 654 var _p0 *byte 655 _p0, err = BytePtrFromString(path) 656 if err != nil { 657 return 658 } 659 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Pathconf)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0, 0, 0, 0) 660 use(unsafe.Pointer(_p0)) 661 val = int(r0) 662 if e1 != 0 { 663 err = errnoErr(e1) 664 } 665 return 666 } 667 668 func Pread(fd int, p []byte, offset int64) (n int, err error) { 669 var _p0 *byte 670 if len(p) > 0 { 671 _p0 = &p[0] 672 } 673 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Pread)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0) 674 n = int(r0) 675 if e1 != 0 { 676 err = errnoErr(e1) 677 } 678 return 679 } 680 681 func Pwrite(fd int, p []byte, offset int64) (n int, err error) { 682 var _p0 *byte 683 if len(p) > 0 { 684 _p0 = &p[0] 685 } 686 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Pwrite)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0) 687 n = int(r0) 688 if e1 != 0 { 689 err = errnoErr(e1) 690 } 691 return 692 } 693 694 func read(fd int, p []byte) (n int, err error) { 695 var _p0 *byte 696 if len(p) > 0 { 697 _p0 = &p[0] 698 } 699 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_read)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0) 700 n = int(r0) 701 if e1 != 0 { 702 err = errnoErr(e1) 703 } 704 return 705 } 706 707 func Readlink(path string, buf []byte) (n int, err error) { 708 var _p0 *byte 709 _p0, err = BytePtrFromString(path) 710 if err != nil { 711 return 712 } 713 var _p1 *byte 714 if len(buf) > 0 { 715 _p1 = &buf[0] 716 } 717 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Readlink)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(len(buf)), 0, 0, 0) 718 use(unsafe.Pointer(_p0)) 719 n = int(r0) 720 if e1 != 0 { 721 err = errnoErr(e1) 722 } 723 return 724 } 725 726 func Rename(from string, to string) (err error) { 727 var _p0 *byte 728 _p0, err = BytePtrFromString(from) 729 if err != nil { 730 return 731 } 732 var _p1 *byte 733 _p1, err = BytePtrFromString(to) 734 if err != nil { 735 return 736 } 737 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Rename)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0) 738 use(unsafe.Pointer(_p0)) 739 use(unsafe.Pointer(_p1)) 740 if e1 != 0 { 741 err = errnoErr(e1) 742 } 743 return 744 } 745 746 func Rmdir(path string) (err error) { 747 var _p0 *byte 748 _p0, err = BytePtrFromString(path) 749 if err != nil { 750 return 751 } 752 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Rmdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0) 753 use(unsafe.Pointer(_p0)) 754 if e1 != 0 { 755 err = errnoErr(e1) 756 } 757 return 758 } 759 760 func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { 761 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_lseek)), 3, uintptr(fd), uintptr(offset), uintptr(whence), 0, 0, 0) 762 newoffset = int64(r0) 763 if e1 != 0 { 764 err = errnoErr(e1) 765 } 766 return 767 } 768 769 func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 770 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_sendfile)), 4, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) 771 written = int(r0) 772 if e1 != 0 { 773 err = errnoErr(e1) 774 } 775 return 776 } 777 778 func Setegid(egid int) (err error) { 779 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setegid)), 1, uintptr(egid), 0, 0, 0, 0, 0) 780 if e1 != 0 { 781 err = errnoErr(e1) 782 } 783 return 784 } 785 786 func Seteuid(euid int) (err error) { 787 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Seteuid)), 1, uintptr(euid), 0, 0, 0, 0, 0) 788 if e1 != 0 { 789 err = errnoErr(e1) 790 } 791 return 792 } 793 794 func Setgid(gid int) (err error) { 795 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setgid)), 1, uintptr(gid), 0, 0, 0, 0, 0) 796 if e1 != 0 { 797 err = errnoErr(e1) 798 } 799 return 800 } 801 802 func Setpgid(pid int, pgid int) (err error) { 803 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setpgid)), 2, uintptr(pid), uintptr(pgid), 0, 0, 0, 0) 804 if e1 != 0 { 805 err = errnoErr(e1) 806 } 807 return 808 } 809 810 func Setpriority(which int, who int, prio int) (err error) { 811 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Setpriority)), 3, uintptr(which), uintptr(who), uintptr(prio), 0, 0, 0) 812 if e1 != 0 { 813 err = errnoErr(e1) 814 } 815 return 816 } 817 818 func Setregid(rgid int, egid int) (err error) { 819 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setregid)), 2, uintptr(rgid), uintptr(egid), 0, 0, 0, 0) 820 if e1 != 0 { 821 err = errnoErr(e1) 822 } 823 return 824 } 825 826 func Setreuid(ruid int, euid int) (err error) { 827 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setreuid)), 2, uintptr(ruid), uintptr(euid), 0, 0, 0, 0) 828 if e1 != 0 { 829 err = errnoErr(e1) 830 } 831 return 832 } 833 834 func Setrlimit(which int, lim *Rlimit) (err error) { 835 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0) 836 if e1 != 0 { 837 err = errnoErr(e1) 838 } 839 return 840 } 841 842 func Setsid() (pid int, err error) { 843 r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setsid)), 0, 0, 0, 0, 0, 0, 0) 844 pid = int(r0) 845 if e1 != 0 { 846 err = errnoErr(e1) 847 } 848 return 849 } 850 851 func Setuid(uid int) (err error) { 852 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setuid)), 1, uintptr(uid), 0, 0, 0, 0, 0) 853 if e1 != 0 { 854 err = errnoErr(e1) 855 } 856 return 857 } 858 859 func Shutdown(s int, how int) (err error) { 860 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_shutdown)), 2, uintptr(s), uintptr(how), 0, 0, 0, 0) 861 if e1 != 0 { 862 err = errnoErr(e1) 863 } 864 return 865 } 866 867 func Stat(path string, stat *Stat_t) (err error) { 868 var _p0 *byte 869 _p0, err = BytePtrFromString(path) 870 if err != nil { 871 return 872 } 873 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Stat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0) 874 use(unsafe.Pointer(_p0)) 875 if e1 != 0 { 876 err = errnoErr(e1) 877 } 878 return 879 } 880 881 func Symlink(path string, link string) (err error) { 882 var _p0 *byte 883 _p0, err = BytePtrFromString(path) 884 if err != nil { 885 return 886 } 887 var _p1 *byte 888 _p1, err = BytePtrFromString(link) 889 if err != nil { 890 return 891 } 892 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Symlink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0) 893 use(unsafe.Pointer(_p0)) 894 use(unsafe.Pointer(_p1)) 895 if e1 != 0 { 896 err = errnoErr(e1) 897 } 898 return 899 } 900 901 func Sync() (err error) { 902 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Sync)), 0, 0, 0, 0, 0, 0, 0) 903 if e1 != 0 { 904 err = errnoErr(e1) 905 } 906 return 907 } 908 909 func Truncate(path string, length int64) (err error) { 910 var _p0 *byte 911 _p0, err = BytePtrFromString(path) 912 if err != nil { 913 return 914 } 915 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Truncate)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0, 0, 0, 0) 916 use(unsafe.Pointer(_p0)) 917 if e1 != 0 { 918 err = errnoErr(e1) 919 } 920 return 921 } 922 923 func Fsync(fd int) (err error) { 924 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Fsync)), 1, uintptr(fd), 0, 0, 0, 0, 0) 925 if e1 != 0 { 926 err = errnoErr(e1) 927 } 928 return 929 } 930 931 func Ftruncate(fd int, length int64) (err error) { 932 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Ftruncate)), 2, uintptr(fd), uintptr(length), 0, 0, 0, 0) 933 if e1 != 0 { 934 err = errnoErr(e1) 935 } 936 return 937 } 938 939 func Umask(newmask int) (oldmask int) { 940 r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&libc_Umask)), 1, uintptr(newmask), 0, 0, 0, 0, 0) 941 oldmask = int(r0) 942 return 943 } 944 945 func Unlink(path string) (err error) { 946 var _p0 *byte 947 _p0, err = BytePtrFromString(path) 948 if err != nil { 949 return 950 } 951 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Unlink)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0) 952 use(unsafe.Pointer(_p0)) 953 if e1 != 0 { 954 err = errnoErr(e1) 955 } 956 return 957 } 958 959 func utimes(path string, times *[2]Timeval) (err error) { 960 var _p0 *byte 961 _p0, err = BytePtrFromString(path) 962 if err != nil { 963 return 964 } 965 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_Utimes)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0, 0, 0, 0) 966 use(unsafe.Pointer(_p0)) 967 if e1 != 0 { 968 err = errnoErr(e1) 969 } 970 return 971 } 972 973 func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { 974 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_bind)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0) 975 if e1 != 0 { 976 err = errnoErr(e1) 977 } 978 return 979 } 980 981 func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { 982 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_connect)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0) 983 if e1 != 0 { 984 err = errnoErr(e1) 985 } 986 return 987 } 988 989 func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { 990 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_mmap)), 6, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) 991 ret = uintptr(r0) 992 if e1 != 0 { 993 err = errnoErr(e1) 994 } 995 return 996 } 997 998 func munmap(addr uintptr, length uintptr) (err error) { 999 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_munmap)), 2, uintptr(addr), uintptr(length), 0, 0, 0, 0) 1000 if e1 != 0 { 1001 err = errnoErr(e1) 1002 } 1003 return 1004 } 1005 1006 func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { 1007 var _p0 *byte 1008 if len(buf) > 0 { 1009 _p0 = &buf[0] 1010 } 1011 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_sendto)), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) 1012 if e1 != 0 { 1013 err = errnoErr(e1) 1014 } 1015 return 1016 } 1017 1018 func socket(domain int, typ int, proto int) (fd int, err error) { 1019 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_socket)), 3, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0) 1020 fd = int(r0) 1021 if e1 != 0 { 1022 err = errnoErr(e1) 1023 } 1024 return 1025 } 1026 1027 func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { 1028 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc___xnet_socketpair)), 4, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) 1029 if e1 != 0 { 1030 err = errnoErr(e1) 1031 } 1032 return 1033 } 1034 1035 func write(fd int, p []byte) (n int, err error) { 1036 var _p0 *byte 1037 if len(p) > 0 { 1038 _p0 = &p[0] 1039 } 1040 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_write)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0) 1041 n = int(r0) 1042 if e1 != 0 { 1043 err = errnoErr(e1) 1044 } 1045 return 1046 } 1047 1048 func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { 1049 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_getsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) 1050 if e1 != 0 { 1051 err = errnoErr(e1) 1052 } 1053 return 1054 } 1055 1056 func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { 1057 _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_getpeername)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) 1058 if e1 != 0 { 1059 err = errnoErr(e1) 1060 } 1061 return 1062 } 1063 1064 func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { 1065 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_getsockname)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) 1066 if e1 != 0 { 1067 err = errnoErr(e1) 1068 } 1069 return 1070 } 1071 1072 func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { 1073 _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_setsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) 1074 if e1 != 0 { 1075 err = errnoErr(e1) 1076 } 1077 return 1078 } 1079 1080 func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { 1081 var _p0 *byte 1082 if len(p) > 0 { 1083 _p0 = &p[0] 1084 } 1085 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))) 1086 n = int(r0) 1087 if e1 != 0 { 1088 err = errnoErr(e1) 1089 } 1090 return 1091 } 1092 1093 func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { 1094 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc___xnet_recvmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0) 1095 n = int(r0) 1096 if e1 != 0 { 1097 err = errnoErr(e1) 1098 } 1099 return 1100 } 1101 1102 func getexecname() (path unsafe.Pointer, err error) { 1103 r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&libc_getexecname)), 0, 0, 0, 0, 0, 0, 0) 1104 path = unsafe.Pointer(r0) 1105 if e1 != 0 { 1106 err = errnoErr(e1) 1107 } 1108 return 1109 } 1110