Devon H. O'Dell | 0489a26 | 2009-11-17 08:20:58 -0800 | [diff] [blame] | 1 | // mksyscall.sh syscall_freebsd.go syscall_freebsd_amd64.go |
| 2 | // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT |
| 3 | |
| 4 | package syscall |
| 5 | |
| 6 | import "unsafe" |
| 7 | |
| 8 | func getgroups(ngid int, gid *_Gid_t) (n int, errno int) { |
| 9 | r0, _, e1 := Syscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0); |
| 10 | n = int(r0); |
| 11 | errno = int(e1); |
| 12 | return; |
| 13 | } |
| 14 | |
| 15 | func setgroups(ngid int, gid *_Gid_t) (errno int) { |
| 16 | _, _, e1 := Syscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0); |
| 17 | errno = int(e1); |
| 18 | return; |
| 19 | } |
| 20 | |
| 21 | func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int) { |
| 22 | r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0); |
| 23 | wpid = int(r0); |
| 24 | errno = int(e1); |
| 25 | return; |
| 26 | } |
| 27 | |
| 28 | func pipe() (r int, w int, errno int) { |
| 29 | r0, r1, e1 := Syscall(SYS_PIPE, 0, 0, 0); |
| 30 | r = int(r0); |
| 31 | w = int(r1); |
| 32 | errno = int(e1); |
| 33 | return; |
| 34 | } |
| 35 | |
| 36 | func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) { |
| 37 | r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))); |
| 38 | fd = int(r0); |
| 39 | errno = int(e1); |
| 40 | return; |
| 41 | } |
| 42 | |
| 43 | func bind(s int, addr uintptr, addrlen _Socklen) (errno int) { |
| 44 | _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)); |
| 45 | errno = int(e1); |
| 46 | return; |
| 47 | } |
| 48 | |
| 49 | func connect(s int, addr uintptr, addrlen _Socklen) (errno int) { |
| 50 | _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)); |
| 51 | errno = int(e1); |
| 52 | return; |
| 53 | } |
| 54 | |
| 55 | func socket(domain int, typ int, proto int) (fd int, errno int) { |
| 56 | r0, _, e1 := Syscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)); |
| 57 | fd = int(r0); |
| 58 | errno = int(e1); |
| 59 | return; |
| 60 | } |
| 61 | |
| 62 | func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) { |
| 63 | _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0); |
| 64 | errno = int(e1); |
| 65 | return; |
| 66 | } |
| 67 | |
| 68 | func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { |
| 69 | _, _, e1 := Syscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))); |
| 70 | errno = int(e1); |
| 71 | return; |
| 72 | } |
| 73 | |
| 74 | func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { |
| 75 | _, _, e1 := Syscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))); |
| 76 | errno = int(e1); |
| 77 | return; |
| 78 | } |
| 79 | |
| 80 | func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) { |
| 81 | var _p0 *byte; |
| 82 | if len(p) > 0 { |
| 83 | _p0 = &p[0] |
| 84 | } |
| 85 | r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))); |
| 86 | n = int(r0); |
| 87 | errno = int(e1); |
| 88 | return; |
| 89 | } |
| 90 | |
| 91 | func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) { |
| 92 | var _p0 *byte; |
| 93 | if len(buf) > 0 { |
| 94 | _p0 = &buf[0] |
| 95 | } |
| 96 | _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)); |
| 97 | errno = int(e1); |
| 98 | return; |
| 99 | } |
| 100 | |
| 101 | func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, timeout *Timespec) (n int, errno int) { |
| 102 | r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))); |
| 103 | n = int(r0); |
| 104 | errno = int(e1); |
| 105 | return; |
| 106 | } |
| 107 | |
| 108 | func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (errno int) { |
| 109 | var _p0 *_C_int; |
| 110 | if len(mib) > 0 { |
| 111 | _p0 = &mib[0] |
| 112 | } |
| 113 | _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(unsafe.Pointer(_p0)), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)); |
| 114 | errno = int(e1); |
| 115 | return; |
| 116 | } |
| 117 | |
| 118 | func fcntl(fd int, cmd int, arg int) (val int, errno int) { |
| 119 | r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)); |
| 120 | val = int(r0); |
| 121 | errno = int(e1); |
| 122 | return; |
| 123 | } |
| 124 | |
| 125 | func Access(path string, flags int) (errno int) { |
| 126 | _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0); |
| 127 | errno = int(e1); |
| 128 | return; |
| 129 | } |
| 130 | |
| 131 | func Adjtime(delta *Timeval, olddelta *Timeval) (errno int) { |
| 132 | _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0); |
| 133 | errno = int(e1); |
| 134 | return; |
| 135 | } |
| 136 | |
| 137 | func Chdir(path string) (errno int) { |
| 138 | _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0); |
| 139 | errno = int(e1); |
| 140 | return; |
| 141 | } |
| 142 | |
| 143 | func Chflags(path string, flags int) (errno int) { |
| 144 | _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0); |
| 145 | errno = int(e1); |
| 146 | return; |
| 147 | } |
| 148 | |
| 149 | func Chmod(path string, mode int) (errno int) { |
| 150 | _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0); |
| 151 | errno = int(e1); |
| 152 | return; |
| 153 | } |
| 154 | |
| 155 | func Chown(path string, uid int, gid int) (errno int) { |
| 156 | _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid)); |
| 157 | errno = int(e1); |
| 158 | return; |
| 159 | } |
| 160 | |
| 161 | func Chroot(path string) (errno int) { |
| 162 | _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0); |
| 163 | errno = int(e1); |
| 164 | return; |
| 165 | } |
| 166 | |
| 167 | func Close(fd int) (errno int) { |
| 168 | _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0); |
| 169 | errno = int(e1); |
| 170 | return; |
| 171 | } |
| 172 | |
| 173 | func Dup(fd int) (nfd int, errno int) { |
| 174 | r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0); |
| 175 | nfd = int(r0); |
| 176 | errno = int(e1); |
| 177 | return; |
| 178 | } |
| 179 | |
| 180 | func Dup2(from int, to int) (errno int) { |
| 181 | _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0); |
| 182 | errno = int(e1); |
| 183 | return; |
| 184 | } |
| 185 | |
| 186 | func Exit(code int) { |
| 187 | Syscall(SYS_EXIT, uintptr(code), 0, 0); |
| 188 | return; |
| 189 | } |
| 190 | |
| 191 | func Fchdir(fd int) (errno int) { |
| 192 | _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0); |
| 193 | errno = int(e1); |
| 194 | return; |
| 195 | } |
| 196 | |
| 197 | func Fchflags(path string, flags int) (errno int) { |
| 198 | _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0); |
| 199 | errno = int(e1); |
| 200 | return; |
| 201 | } |
| 202 | |
| 203 | func Fchmod(fd int, mode int) (errno int) { |
| 204 | _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0); |
| 205 | errno = int(e1); |
| 206 | return; |
| 207 | } |
| 208 | |
| 209 | func Fchown(fd int, uid int, gid int) (errno int) { |
| 210 | _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)); |
| 211 | errno = int(e1); |
| 212 | return; |
| 213 | } |
| 214 | |
| 215 | func Flock(fd int, how int) (errno int) { |
| 216 | _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0); |
| 217 | errno = int(e1); |
| 218 | return; |
| 219 | } |
| 220 | |
| 221 | func Fpathconf(fd int, name int) (val int, errno int) { |
| 222 | r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0); |
| 223 | val = int(r0); |
| 224 | errno = int(e1); |
| 225 | return; |
| 226 | } |
| 227 | |
| 228 | func Fstat(fd int, stat *Stat_t) (errno int) { |
| 229 | _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0); |
| 230 | errno = int(e1); |
| 231 | return; |
| 232 | } |
| 233 | |
| 234 | func Fstatfs(fd int, stat *Statfs_t) (errno int) { |
| 235 | _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0); |
| 236 | errno = int(e1); |
| 237 | return; |
| 238 | } |
| 239 | |
| 240 | func Fsync(fd int) (errno int) { |
| 241 | _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0); |
| 242 | errno = int(e1); |
| 243 | return; |
| 244 | } |
| 245 | |
| 246 | func Ftruncate(fd int, length int64) (errno int) { |
| 247 | _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0); |
| 248 | errno = int(e1); |
| 249 | return; |
| 250 | } |
| 251 | |
| 252 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int) { |
| 253 | var _p0 *byte; |
| 254 | if len(buf) > 0 { |
| 255 | _p0 = &buf[0] |
| 256 | } |
| 257 | r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0); |
| 258 | n = int(r0); |
| 259 | errno = int(e1); |
| 260 | return; |
| 261 | } |
| 262 | |
| 263 | func Getdtablesize() (size int) { |
| 264 | r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0); |
| 265 | size = int(r0); |
| 266 | return; |
| 267 | } |
| 268 | |
| 269 | func Getegid() (egid int) { |
| 270 | r0, _, _ := Syscall(SYS_GETEGID, 0, 0, 0); |
| 271 | egid = int(r0); |
| 272 | return; |
| 273 | } |
| 274 | |
| 275 | func Geteuid() (uid int) { |
| 276 | r0, _, _ := Syscall(SYS_GETEUID, 0, 0, 0); |
| 277 | uid = int(r0); |
| 278 | return; |
| 279 | } |
| 280 | |
| 281 | func Getfsstat(buf []Statfs_t, flags int) (n int, errno int) { |
| 282 | var _p0 *Statfs_t; |
| 283 | if len(buf) > 0 { |
| 284 | _p0 = &buf[0] |
| 285 | } |
| 286 | r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags)); |
| 287 | n = int(r0); |
| 288 | errno = int(e1); |
| 289 | return; |
| 290 | } |
| 291 | |
| 292 | func Getgid() (gid int) { |
| 293 | r0, _, _ := Syscall(SYS_GETGID, 0, 0, 0); |
| 294 | gid = int(r0); |
| 295 | return; |
| 296 | } |
| 297 | |
| 298 | func Getpgid(pid int) (pgid int, errno int) { |
| 299 | r0, _, e1 := Syscall(SYS_GETPGID, uintptr(pid), 0, 0); |
| 300 | pgid = int(r0); |
| 301 | errno = int(e1); |
| 302 | return; |
| 303 | } |
| 304 | |
| 305 | func Getpgrp() (pgrp int) { |
| 306 | r0, _, _ := Syscall(SYS_GETPGRP, 0, 0, 0); |
| 307 | pgrp = int(r0); |
| 308 | return; |
| 309 | } |
| 310 | |
| 311 | func Getpid() (pid int) { |
| 312 | r0, _, _ := Syscall(SYS_GETPID, 0, 0, 0); |
| 313 | pid = int(r0); |
| 314 | return; |
| 315 | } |
| 316 | |
| 317 | func Getppid() (ppid int) { |
| 318 | r0, _, _ := Syscall(SYS_GETPPID, 0, 0, 0); |
| 319 | ppid = int(r0); |
| 320 | return; |
| 321 | } |
| 322 | |
| 323 | func Getpriority(which int, who int) (prio int, errno int) { |
| 324 | r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0); |
| 325 | prio = int(r0); |
| 326 | errno = int(e1); |
| 327 | return; |
| 328 | } |
| 329 | |
| 330 | func Getrlimit(which int, lim *Rlimit) (errno int) { |
| 331 | _, _, e1 := Syscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0); |
| 332 | errno = int(e1); |
| 333 | return; |
| 334 | } |
| 335 | |
| 336 | func Getrusage(who int, rusage *Rusage) (errno int) { |
| 337 | _, _, e1 := Syscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0); |
| 338 | errno = int(e1); |
| 339 | return; |
| 340 | } |
| 341 | |
| 342 | func Getsid(pid int) (sid int, errno int) { |
| 343 | r0, _, e1 := Syscall(SYS_GETSID, uintptr(pid), 0, 0); |
| 344 | sid = int(r0); |
| 345 | errno = int(e1); |
| 346 | return; |
| 347 | } |
| 348 | |
| 349 | func Gettimeofday(tv *Timeval) (errno int) { |
| 350 | _, _, e1 := Syscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0); |
| 351 | errno = int(e1); |
| 352 | return; |
| 353 | } |
| 354 | |
| 355 | func Getuid() (uid int) { |
| 356 | r0, _, _ := Syscall(SYS_GETUID, 0, 0, 0); |
| 357 | uid = int(r0); |
| 358 | return; |
| 359 | } |
| 360 | |
| 361 | func Issetugid() (tainted bool) { |
| 362 | r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0); |
| 363 | tainted = bool(r0 != 0); |
| 364 | return; |
| 365 | } |
| 366 | |
| 367 | func Kill(pid int, signum int, posix int) (errno int) { |
| 368 | _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)); |
| 369 | errno = int(e1); |
| 370 | return; |
| 371 | } |
| 372 | |
| 373 | func Kqueue() (fd int, errno int) { |
| 374 | r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0); |
| 375 | fd = int(r0); |
| 376 | errno = int(e1); |
| 377 | return; |
| 378 | } |
| 379 | |
| 380 | func Lchown(path string, uid int, gid int) (errno int) { |
| 381 | _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid)); |
| 382 | errno = int(e1); |
| 383 | return; |
| 384 | } |
| 385 | |
| 386 | func Link(path string, link string) (errno int) { |
| 387 | _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0); |
| 388 | errno = int(e1); |
| 389 | return; |
| 390 | } |
| 391 | |
| 392 | func Listen(s int, backlog int) (errno int) { |
| 393 | _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0); |
| 394 | errno = int(e1); |
| 395 | return; |
| 396 | } |
| 397 | |
| 398 | func Lstat(path string, stat *Stat_t) (errno int) { |
| 399 | _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0); |
| 400 | errno = int(e1); |
| 401 | return; |
| 402 | } |
| 403 | |
| 404 | func Mkdir(path string, mode int) (errno int) { |
| 405 | _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0); |
| 406 | errno = int(e1); |
| 407 | return; |
| 408 | } |
| 409 | |
| 410 | func Mkfifo(path string, mode int) (errno int) { |
| 411 | _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0); |
| 412 | errno = int(e1); |
| 413 | return; |
| 414 | } |
| 415 | |
| 416 | func Mknod(path string, mode int, dev int) (errno int) { |
| 417 | _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(dev)); |
| 418 | errno = int(e1); |
| 419 | return; |
| 420 | } |
| 421 | |
| 422 | func Open(path string, mode int, perm int) (fd int, errno int) { |
| 423 | r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm)); |
| 424 | fd = int(r0); |
| 425 | errno = int(e1); |
| 426 | return; |
| 427 | } |
| 428 | |
| 429 | func Pathconf(path string, name int) (val int, errno int) { |
| 430 | r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(name), 0); |
| 431 | val = int(r0); |
| 432 | errno = int(e1); |
| 433 | return; |
| 434 | } |
| 435 | |
| 436 | func Pread(fd int, p []byte, offset int64) (n int, errno int) { |
| 437 | var _p0 *byte; |
| 438 | if len(p) > 0 { |
| 439 | _p0 = &p[0] |
| 440 | } |
| 441 | r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0); |
| 442 | n = int(r0); |
| 443 | errno = int(e1); |
| 444 | return; |
| 445 | } |
| 446 | |
| 447 | func Pwrite(fd int, p []byte, offset int64) (n int, errno int) { |
| 448 | var _p0 *byte; |
| 449 | if len(p) > 0 { |
| 450 | _p0 = &p[0] |
| 451 | } |
| 452 | r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0); |
| 453 | n = int(r0); |
| 454 | errno = int(e1); |
| 455 | return; |
| 456 | } |
| 457 | |
| 458 | func Read(fd int, p []byte) (n int, errno int) { |
| 459 | var _p0 *byte; |
| 460 | if len(p) > 0 { |
| 461 | _p0 = &p[0] |
| 462 | } |
| 463 | r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p))); |
| 464 | n = int(r0); |
| 465 | errno = int(e1); |
| 466 | return; |
| 467 | } |
| 468 | |
| 469 | func Readlink(path string, buf []byte) (n int, errno int) { |
| 470 | var _p0 *byte; |
| 471 | if len(buf) > 0 { |
| 472 | _p0 = &buf[0] |
| 473 | } |
| 474 | r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf))); |
| 475 | n = int(r0); |
| 476 | errno = int(e1); |
| 477 | return; |
| 478 | } |
| 479 | |
| 480 | func Rename(from string, to string) (errno int) { |
| 481 | _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(StringBytePtr(from))), uintptr(unsafe.Pointer(StringBytePtr(to))), 0); |
| 482 | errno = int(e1); |
| 483 | return; |
| 484 | } |
| 485 | |
| 486 | func Revoke(path string) (errno int) { |
| 487 | _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0); |
| 488 | errno = int(e1); |
| 489 | return; |
| 490 | } |
| 491 | |
| 492 | func Rmdir(path string) (errno int) { |
| 493 | _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0); |
| 494 | errno = int(e1); |
| 495 | return; |
| 496 | } |
| 497 | |
| 498 | func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) { |
| 499 | r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)); |
| 500 | newoffset = int64(r0); |
| 501 | errno = int(e1); |
| 502 | return; |
| 503 | } |
| 504 | |
| 505 | func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (errno int) { |
| 506 | _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0); |
| 507 | errno = int(e1); |
| 508 | return; |
| 509 | } |
| 510 | |
| 511 | func Setegid(egid int) (errno int) { |
| 512 | _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0); |
| 513 | errno = int(e1); |
| 514 | return; |
| 515 | } |
| 516 | |
| 517 | func Seteuid(euid int) (errno int) { |
| 518 | _, _, e1 := Syscall(SYS_SETEUID, uintptr(euid), 0, 0); |
| 519 | errno = int(e1); |
| 520 | return; |
| 521 | } |
| 522 | |
| 523 | func Setgid(gid int) (errno int) { |
| 524 | _, _, e1 := Syscall(SYS_SETGID, uintptr(gid), 0, 0); |
| 525 | errno = int(e1); |
| 526 | return; |
| 527 | } |
| 528 | |
| 529 | func Setlogin(name string) (errno int) { |
| 530 | _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(StringBytePtr(name))), 0, 0); |
| 531 | errno = int(e1); |
| 532 | return; |
| 533 | } |
| 534 | |
| 535 | func Setpgid(pid int, pgid int) (errno int) { |
| 536 | _, _, e1 := Syscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0); |
| 537 | errno = int(e1); |
| 538 | return; |
| 539 | } |
| 540 | |
| 541 | func Setpriority(which int, who int, prio int) (errno int) { |
| 542 | _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)); |
| 543 | errno = int(e1); |
| 544 | return; |
| 545 | } |
| 546 | |
| 547 | func Setregid(rgid int, egid int) (errno int) { |
| 548 | _, _, e1 := Syscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0); |
| 549 | errno = int(e1); |
| 550 | return; |
| 551 | } |
| 552 | |
| 553 | func Setreuid(ruid int, euid int) (errno int) { |
| 554 | _, _, e1 := Syscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0); |
| 555 | errno = int(e1); |
| 556 | return; |
| 557 | } |
| 558 | |
| 559 | func Setrlimit(which int, lim *Rlimit) (errno int) { |
| 560 | _, _, e1 := Syscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0); |
| 561 | errno = int(e1); |
| 562 | return; |
| 563 | } |
| 564 | |
| 565 | func Setsid() (pid int, errno int) { |
| 566 | r0, _, e1 := Syscall(SYS_SETSID, 0, 0, 0); |
| 567 | pid = int(r0); |
| 568 | errno = int(e1); |
| 569 | return; |
| 570 | } |
| 571 | |
| 572 | func Settimeofday(tp *Timeval) (errno int) { |
| 573 | _, _, e1 := Syscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0); |
| 574 | errno = int(e1); |
| 575 | return; |
| 576 | } |
| 577 | |
| 578 | func Setuid(uid int) (errno int) { |
| 579 | _, _, e1 := Syscall(SYS_SETUID, uintptr(uid), 0, 0); |
| 580 | errno = int(e1); |
| 581 | return; |
| 582 | } |
| 583 | |
| 584 | func Stat(path string, stat *Stat_t) (errno int) { |
| 585 | _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0); |
| 586 | errno = int(e1); |
| 587 | return; |
| 588 | } |
| 589 | |
| 590 | func Statfs(path string, stat *Statfs_t) (errno int) { |
| 591 | _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0); |
| 592 | errno = int(e1); |
| 593 | return; |
| 594 | } |
| 595 | |
| 596 | func Symlink(path string, link string) (errno int) { |
| 597 | _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(StringBytePtr(link))), 0); |
| 598 | errno = int(e1); |
| 599 | return; |
| 600 | } |
| 601 | |
| 602 | func Sync() (errno int) { |
| 603 | _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0); |
| 604 | errno = int(e1); |
| 605 | return; |
| 606 | } |
| 607 | |
| 608 | func Truncate(path string, length int64) (errno int) { |
| 609 | _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), 0); |
| 610 | errno = int(e1); |
| 611 | return; |
| 612 | } |
| 613 | |
| 614 | func Umask(newmask int) (errno int) { |
| 615 | _, _, e1 := Syscall(SYS_UMASK, uintptr(newmask), 0, 0); |
| 616 | errno = int(e1); |
| 617 | return; |
| 618 | } |
| 619 | |
| 620 | func Undelete(path string) (errno int) { |
| 621 | _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0); |
| 622 | errno = int(e1); |
| 623 | return; |
| 624 | } |
| 625 | |
| 626 | func Unlink(path string) (errno int) { |
| 627 | _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, 0); |
| 628 | errno = int(e1); |
| 629 | return; |
| 630 | } |
| 631 | |
| 632 | func Unmount(path string, flags int) (errno int) { |
| 633 | _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), 0); |
| 634 | errno = int(e1); |
| 635 | return; |
| 636 | } |
| 637 | |
| 638 | func Write(fd int, p []byte) (n int, errno int) { |
| 639 | var _p0 *byte; |
| 640 | if len(p) > 0 { |
| 641 | _p0 = &p[0] |
| 642 | } |
| 643 | r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p))); |
| 644 | n = int(r0); |
| 645 | errno = int(e1); |
| 646 | return; |
| 647 | } |
| 648 | |
| 649 | func read(fd int, buf *byte, nbuf int) (n int, errno int) { |
| 650 | r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)); |
| 651 | n = int(r0); |
| 652 | errno = int(e1); |
| 653 | return; |
| 654 | } |
| 655 | |
| 656 | func write(fd int, buf *byte, nbuf int) (n int, errno int) { |
| 657 | r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)); |
| 658 | n = int(r0); |
| 659 | errno = int(e1); |
| 660 | return; |
| 661 | } |