...
Run Format

Source file src/syscall/zsyscall_openbsd_386.go

Documentation: syscall

     1  // mksyscall.pl -l32 -openbsd -tags openbsd,386 syscall_bsd.go syscall_openbsd.go syscall_openbsd_386.go
     2  // Code generated by the command above; DO NOT EDIT.
     3  
     4  // +build openbsd,386
     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  	if e1 != 0 {
   236  		err = errnoErr(e1)
   237  	}
   238  	return
   239  }
   240  
   241  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   242  
   243  func futimes(fd int, timeval *[2]Timeval) (err error) {
   244  	_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
   245  	if e1 != 0 {
   246  		err = errnoErr(e1)
   247  	}
   248  	return
   249  }
   250  
   251  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   252  
   253  func fcntl(fd int, cmd int, arg int) (val int, err error) {
   254  	r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
   255  	val = int(r0)
   256  	if e1 != 0 {
   257  		err = errnoErr(e1)
   258  	}
   259  	return
   260  }
   261  
   262  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   263  
   264  func pipe2(p *[2]_C_int, flags int) (err error) {
   265  	_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
   266  	if e1 != 0 {
   267  		err = errnoErr(e1)
   268  	}
   269  	return
   270  }
   271  
   272  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   273  
   274  func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) {
   275  	r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)
   276  	nfd = int(r0)
   277  	if e1 != 0 {
   278  		err = errnoErr(e1)
   279  	}
   280  	return
   281  }
   282  
   283  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   284  
   285  func getdents(fd int, buf []byte) (n int, err error) {
   286  	var _p0 unsafe.Pointer
   287  	if len(buf) > 0 {
   288  		_p0 = unsafe.Pointer(&buf[0])
   289  	} else {
   290  		_p0 = unsafe.Pointer(&_zero)
   291  	}
   292  	r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
   293  	n = int(r0)
   294  	if e1 != 0 {
   295  		err = errnoErr(e1)
   296  	}
   297  	return
   298  }
   299  
   300  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   301  
   302  func Access(path string, mode uint32) (err error) {
   303  	var _p0 *byte
   304  	_p0, err = BytePtrFromString(path)
   305  	if err != nil {
   306  		return
   307  	}
   308  	_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
   309  	if e1 != 0 {
   310  		err = errnoErr(e1)
   311  	}
   312  	return
   313  }
   314  
   315  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   316  
   317  func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
   318  	_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
   319  	if e1 != 0 {
   320  		err = errnoErr(e1)
   321  	}
   322  	return
   323  }
   324  
   325  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   326  
   327  func Chdir(path string) (err error) {
   328  	var _p0 *byte
   329  	_p0, err = BytePtrFromString(path)
   330  	if err != nil {
   331  		return
   332  	}
   333  	_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
   334  	if e1 != 0 {
   335  		err = errnoErr(e1)
   336  	}
   337  	return
   338  }
   339  
   340  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   341  
   342  func Chflags(path string, flags int) (err error) {
   343  	var _p0 *byte
   344  	_p0, err = BytePtrFromString(path)
   345  	if err != nil {
   346  		return
   347  	}
   348  	_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
   349  	if e1 != 0 {
   350  		err = errnoErr(e1)
   351  	}
   352  	return
   353  }
   354  
   355  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   356  
   357  func Chmod(path string, mode uint32) (err error) {
   358  	var _p0 *byte
   359  	_p0, err = BytePtrFromString(path)
   360  	if err != nil {
   361  		return
   362  	}
   363  	_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
   364  	if e1 != 0 {
   365  		err = errnoErr(e1)
   366  	}
   367  	return
   368  }
   369  
   370  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   371  
   372  func Chown(path string, uid int, gid int) (err error) {
   373  	var _p0 *byte
   374  	_p0, err = BytePtrFromString(path)
   375  	if err != nil {
   376  		return
   377  	}
   378  	_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
   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  	if e1 != 0 {
   395  		err = errnoErr(e1)
   396  	}
   397  	return
   398  }
   399  
   400  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   401  
   402  func Close(fd int) (err error) {
   403  	_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
   404  	if e1 != 0 {
   405  		err = errnoErr(e1)
   406  	}
   407  	return
   408  }
   409  
   410  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   411  
   412  func Dup(fd int) (nfd int, err error) {
   413  	r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
   414  	nfd = int(r0)
   415  	if e1 != 0 {
   416  		err = errnoErr(e1)
   417  	}
   418  	return
   419  }
   420  
   421  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   422  
   423  func Dup2(from int, to int) (err error) {
   424  	_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
   425  	if e1 != 0 {
   426  		err = errnoErr(e1)
   427  	}
   428  	return
   429  }
   430  
   431  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   432  
   433  func Fchdir(fd int) (err error) {
   434  	_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
   435  	if e1 != 0 {
   436  		err = errnoErr(e1)
   437  	}
   438  	return
   439  }
   440  
   441  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   442  
   443  func Fchflags(fd int, flags int) (err error) {
   444  	_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)
   445  	if e1 != 0 {
   446  		err = errnoErr(e1)
   447  	}
   448  	return
   449  }
   450  
   451  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   452  
   453  func Fchmod(fd int, mode uint32) (err error) {
   454  	_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
   455  	if e1 != 0 {
   456  		err = errnoErr(e1)
   457  	}
   458  	return
   459  }
   460  
   461  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   462  
   463  func Fchown(fd int, uid int, gid int) (err error) {
   464  	_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
   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 Flock(fd int, how int) (err error) {
   474  	_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 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 Fpathconf(fd int, name int) (val int, err error) {
   484  	r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
   485  	val = int(r0)
   486  	if e1 != 0 {
   487  		err = errnoErr(e1)
   488  	}
   489  	return
   490  }
   491  
   492  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   493  
   494  func Fstat(fd int, stat *Stat_t) (err error) {
   495  	_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
   496  	if e1 != 0 {
   497  		err = errnoErr(e1)
   498  	}
   499  	return
   500  }
   501  
   502  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   503  
   504  func Fstatfs(fd int, stat *Statfs_t) (err error) {
   505  	_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
   506  	if e1 != 0 {
   507  		err = errnoErr(e1)
   508  	}
   509  	return
   510  }
   511  
   512  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   513  
   514  func Fsync(fd int) (err error) {
   515  	_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
   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 Ftruncate(fd int, length int64) (err error) {
   525  	_, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 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 Getegid() (egid int) {
   535  	r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)
   536  	egid = int(r0)
   537  	return
   538  }
   539  
   540  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   541  
   542  func Geteuid() (uid int) {
   543  	r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)
   544  	uid = int(r0)
   545  	return
   546  }
   547  
   548  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   549  
   550  func Getgid() (gid int) {
   551  	r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)
   552  	gid = int(r0)
   553  	return
   554  }
   555  
   556  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   557  
   558  func Getpgid(pid int) (pgid int, err error) {
   559  	r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
   560  	pgid = int(r0)
   561  	if e1 != 0 {
   562  		err = errnoErr(e1)
   563  	}
   564  	return
   565  }
   566  
   567  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   568  
   569  func Getpgrp() (pgrp int) {
   570  	r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)
   571  	pgrp = int(r0)
   572  	return
   573  }
   574  
   575  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   576  
   577  func Getpid() (pid int) {
   578  	r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
   579  	pid = int(r0)
   580  	return
   581  }
   582  
   583  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   584  
   585  func Getppid() (ppid int) {
   586  	r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)
   587  	ppid = int(r0)
   588  	return
   589  }
   590  
   591  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   592  
   593  func Getpriority(which int, who int) (prio int, err error) {
   594  	r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
   595  	prio = int(r0)
   596  	if e1 != 0 {
   597  		err = errnoErr(e1)
   598  	}
   599  	return
   600  }
   601  
   602  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   603  
   604  func Getrlimit(which int, lim *Rlimit) (err error) {
   605  	_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
   606  	if e1 != 0 {
   607  		err = errnoErr(e1)
   608  	}
   609  	return
   610  }
   611  
   612  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   613  
   614  func Getrusage(who int, rusage *Rusage) (err error) {
   615  	_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
   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 Getsid(pid int) (sid int, err error) {
   625  	r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
   626  	sid = int(r0)
   627  	if e1 != 0 {
   628  		err = errnoErr(e1)
   629  	}
   630  	return
   631  }
   632  
   633  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   634  
   635  func Gettimeofday(tv *Timeval) (err error) {
   636  	_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
   637  	if e1 != 0 {
   638  		err = errnoErr(e1)
   639  	}
   640  	return
   641  }
   642  
   643  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   644  
   645  func Getuid() (uid int) {
   646  	r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)
   647  	uid = int(r0)
   648  	return
   649  }
   650  
   651  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   652  
   653  func Issetugid() (tainted bool) {
   654  	r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)
   655  	tainted = bool(r0 != 0)
   656  	return
   657  }
   658  
   659  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   660  
   661  func Kill(pid int, signum Signal) (err error) {
   662  	_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)
   663  	if e1 != 0 {
   664  		err = errnoErr(e1)
   665  	}
   666  	return
   667  }
   668  
   669  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   670  
   671  func Kqueue() (fd int, err error) {
   672  	r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
   673  	fd = int(r0)
   674  	if e1 != 0 {
   675  		err = errnoErr(e1)
   676  	}
   677  	return
   678  }
   679  
   680  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   681  
   682  func Lchown(path string, uid int, gid int) (err error) {
   683  	var _p0 *byte
   684  	_p0, err = BytePtrFromString(path)
   685  	if err != nil {
   686  		return
   687  	}
   688  	_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
   689  	if e1 != 0 {
   690  		err = errnoErr(e1)
   691  	}
   692  	return
   693  }
   694  
   695  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   696  
   697  func Link(path string, link string) (err error) {
   698  	var _p0 *byte
   699  	_p0, err = BytePtrFromString(path)
   700  	if err != nil {
   701  		return
   702  	}
   703  	var _p1 *byte
   704  	_p1, err = BytePtrFromString(link)
   705  	if err != nil {
   706  		return
   707  	}
   708  	_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
   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 Listen(s int, backlog int) (err error) {
   718  	_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
   719  	if e1 != 0 {
   720  		err = errnoErr(e1)
   721  	}
   722  	return
   723  }
   724  
   725  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   726  
   727  func Lstat(path string, stat *Stat_t) (err error) {
   728  	var _p0 *byte
   729  	_p0, err = BytePtrFromString(path)
   730  	if err != nil {
   731  		return
   732  	}
   733  	_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
   734  	if e1 != 0 {
   735  		err = errnoErr(e1)
   736  	}
   737  	return
   738  }
   739  
   740  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   741  
   742  func Mkdir(path string, mode uint32) (err error) {
   743  	var _p0 *byte
   744  	_p0, err = BytePtrFromString(path)
   745  	if err != nil {
   746  		return
   747  	}
   748  	_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
   749  	if e1 != 0 {
   750  		err = errnoErr(e1)
   751  	}
   752  	return
   753  }
   754  
   755  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   756  
   757  func Mkfifo(path string, mode uint32) (err error) {
   758  	var _p0 *byte
   759  	_p0, err = BytePtrFromString(path)
   760  	if err != nil {
   761  		return
   762  	}
   763  	_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
   764  	if e1 != 0 {
   765  		err = errnoErr(e1)
   766  	}
   767  	return
   768  }
   769  
   770  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   771  
   772  func Mknod(path string, mode uint32, dev int) (err error) {
   773  	var _p0 *byte
   774  	_p0, err = BytePtrFromString(path)
   775  	if err != nil {
   776  		return
   777  	}
   778  	_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
   779  	if e1 != 0 {
   780  		err = errnoErr(e1)
   781  	}
   782  	return
   783  }
   784  
   785  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   786  
   787  func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
   788  	_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
   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 Open(path string, mode int, perm uint32) (fd int, err error) {
   798  	var _p0 *byte
   799  	_p0, err = BytePtrFromString(path)
   800  	if err != nil {
   801  		return
   802  	}
   803  	r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
   804  	fd = int(r0)
   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 Pathconf(path string, name int) (val int, err error) {
   814  	var _p0 *byte
   815  	_p0, err = BytePtrFromString(path)
   816  	if err != nil {
   817  		return
   818  	}
   819  	r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)
   820  	val = int(r0)
   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 Pread(fd int, p []byte, offset int64) (n int, err error) {
   830  	var _p0 unsafe.Pointer
   831  	if len(p) > 0 {
   832  		_p0 = unsafe.Pointer(&p[0])
   833  	} else {
   834  		_p0 = unsafe.Pointer(&_zero)
   835  	}
   836  	r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
   837  	n = int(r0)
   838  	if e1 != 0 {
   839  		err = errnoErr(e1)
   840  	}
   841  	return
   842  }
   843  
   844  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   845  
   846  func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
   847  	var _p0 unsafe.Pointer
   848  	if len(p) > 0 {
   849  		_p0 = unsafe.Pointer(&p[0])
   850  	} else {
   851  		_p0 = unsafe.Pointer(&_zero)
   852  	}
   853  	r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
   854  	n = int(r0)
   855  	if e1 != 0 {
   856  		err = errnoErr(e1)
   857  	}
   858  	return
   859  }
   860  
   861  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   862  
   863  func read(fd int, p []byte) (n int, err error) {
   864  	var _p0 unsafe.Pointer
   865  	if len(p) > 0 {
   866  		_p0 = unsafe.Pointer(&p[0])
   867  	} else {
   868  		_p0 = unsafe.Pointer(&_zero)
   869  	}
   870  	r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
   871  	n = int(r0)
   872  	if e1 != 0 {
   873  		err = errnoErr(e1)
   874  	}
   875  	return
   876  }
   877  
   878  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   879  
   880  func Readlink(path string, buf []byte) (n int, err error) {
   881  	var _p0 *byte
   882  	_p0, err = BytePtrFromString(path)
   883  	if err != nil {
   884  		return
   885  	}
   886  	var _p1 unsafe.Pointer
   887  	if len(buf) > 0 {
   888  		_p1 = unsafe.Pointer(&buf[0])
   889  	} else {
   890  		_p1 = unsafe.Pointer(&_zero)
   891  	}
   892  	r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))
   893  	n = int(r0)
   894  	if e1 != 0 {
   895  		err = errnoErr(e1)
   896  	}
   897  	return
   898  }
   899  
   900  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   901  
   902  func Rename(from string, to string) (err error) {
   903  	var _p0 *byte
   904  	_p0, err = BytePtrFromString(from)
   905  	if err != nil {
   906  		return
   907  	}
   908  	var _p1 *byte
   909  	_p1, err = BytePtrFromString(to)
   910  	if err != nil {
   911  		return
   912  	}
   913  	_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
   914  	if e1 != 0 {
   915  		err = errnoErr(e1)
   916  	}
   917  	return
   918  }
   919  
   920  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   921  
   922  func Revoke(path string) (err error) {
   923  	var _p0 *byte
   924  	_p0, err = BytePtrFromString(path)
   925  	if err != nil {
   926  		return
   927  	}
   928  	_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)
   929  	if e1 != 0 {
   930  		err = errnoErr(e1)
   931  	}
   932  	return
   933  }
   934  
   935  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   936  
   937  func Rmdir(path string) (err error) {
   938  	var _p0 *byte
   939  	_p0, err = BytePtrFromString(path)
   940  	if err != nil {
   941  		return
   942  	}
   943  	_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
   944  	if e1 != 0 {
   945  		err = errnoErr(e1)
   946  	}
   947  	return
   948  }
   949  
   950  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   951  
   952  func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
   953  	r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)
   954  	newoffset = int64(int64(r1)<<32 | int64(r0))
   955  	if e1 != 0 {
   956  		err = errnoErr(e1)
   957  	}
   958  	return
   959  }
   960  
   961  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   962  
   963  func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {
   964  	_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
   965  	if e1 != 0 {
   966  		err = errnoErr(e1)
   967  	}
   968  	return
   969  }
   970  
   971  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   972  
   973  func Setegid(egid int) (err error) {
   974  	_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)
   975  	if e1 != 0 {
   976  		err = errnoErr(e1)
   977  	}
   978  	return
   979  }
   980  
   981  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   982  
   983  func Seteuid(euid int) (err error) {
   984  	_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
   985  	if e1 != 0 {
   986  		err = errnoErr(e1)
   987  	}
   988  	return
   989  }
   990  
   991  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   992  
   993  func Setgid(gid int) (err error) {
   994  	_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
   995  	if e1 != 0 {
   996  		err = errnoErr(e1)
   997  	}
   998  	return
   999  }
  1000  
  1001  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1002  
  1003  func Setlogin(name string) (err error) {
  1004  	var _p0 *byte
  1005  	_p0, err = BytePtrFromString(name)
  1006  	if err != nil {
  1007  		return
  1008  	}
  1009  	_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)
  1010  	if e1 != 0 {
  1011  		err = errnoErr(e1)
  1012  	}
  1013  	return
  1014  }
  1015  
  1016  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1017  
  1018  func Setpgid(pid int, pgid int) (err error) {
  1019  	_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
  1020  	if e1 != 0 {
  1021  		err = errnoErr(e1)
  1022  	}
  1023  	return
  1024  }
  1025  
  1026  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1027  
  1028  func Setpriority(which int, who int, prio int) (err error) {
  1029  	_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
  1030  	if e1 != 0 {
  1031  		err = errnoErr(e1)
  1032  	}
  1033  	return
  1034  }
  1035  
  1036  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1037  
  1038  func Setregid(rgid int, egid int) (err error) {
  1039  	_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
  1040  	if e1 != 0 {
  1041  		err = errnoErr(e1)
  1042  	}
  1043  	return
  1044  }
  1045  
  1046  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1047  
  1048  func Setreuid(ruid int, euid int) (err error) {
  1049  	_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
  1050  	if e1 != 0 {
  1051  		err = errnoErr(e1)
  1052  	}
  1053  	return
  1054  }
  1055  
  1056  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1057  
  1058  func Setrlimit(which int, lim *Rlimit) (err error) {
  1059  	_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
  1060  	if e1 != 0 {
  1061  		err = errnoErr(e1)
  1062  	}
  1063  	return
  1064  }
  1065  
  1066  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1067  
  1068  func Setsid() (pid int, err error) {
  1069  	r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
  1070  	pid = int(r0)
  1071  	if e1 != 0 {
  1072  		err = errnoErr(e1)
  1073  	}
  1074  	return
  1075  }
  1076  
  1077  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1078  
  1079  func Settimeofday(tp *Timeval) (err error) {
  1080  	_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
  1081  	if e1 != 0 {
  1082  		err = errnoErr(e1)
  1083  	}
  1084  	return
  1085  }
  1086  
  1087  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1088  
  1089  func Setuid(uid int) (err error) {
  1090  	_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
  1091  	if e1 != 0 {
  1092  		err = errnoErr(e1)
  1093  	}
  1094  	return
  1095  }
  1096  
  1097  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1098  
  1099  func Stat(path string, stat *Stat_t) (err error) {
  1100  	var _p0 *byte
  1101  	_p0, err = BytePtrFromString(path)
  1102  	if err != nil {
  1103  		return
  1104  	}
  1105  	_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
  1106  	if e1 != 0 {
  1107  		err = errnoErr(e1)
  1108  	}
  1109  	return
  1110  }
  1111  
  1112  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1113  
  1114  func Statfs(path string, stat *Statfs_t) (err error) {
  1115  	var _p0 *byte
  1116  	_p0, err = BytePtrFromString(path)
  1117  	if err != nil {
  1118  		return
  1119  	}
  1120  	_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
  1121  	if e1 != 0 {
  1122  		err = errnoErr(e1)
  1123  	}
  1124  	return
  1125  }
  1126  
  1127  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1128  
  1129  func Symlink(path string, link string) (err error) {
  1130  	var _p0 *byte
  1131  	_p0, err = BytePtrFromString(path)
  1132  	if err != nil {
  1133  		return
  1134  	}
  1135  	var _p1 *byte
  1136  	_p1, err = BytePtrFromString(link)
  1137  	if err != nil {
  1138  		return
  1139  	}
  1140  	_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
  1141  	if e1 != 0 {
  1142  		err = errnoErr(e1)
  1143  	}
  1144  	return
  1145  }
  1146  
  1147  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1148  
  1149  func Sync() (err error) {
  1150  	_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
  1151  	if e1 != 0 {
  1152  		err = errnoErr(e1)
  1153  	}
  1154  	return
  1155  }
  1156  
  1157  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1158  
  1159  func Truncate(path string, length int64) (err error) {
  1160  	var _p0 *byte
  1161  	_p0, err = BytePtrFromString(path)
  1162  	if err != nil {
  1163  		return
  1164  	}
  1165  	_, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)
  1166  	if e1 != 0 {
  1167  		err = errnoErr(e1)
  1168  	}
  1169  	return
  1170  }
  1171  
  1172  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1173  
  1174  func Umask(newmask int) (oldmask int) {
  1175  	r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)
  1176  	oldmask = int(r0)
  1177  	return
  1178  }
  1179  
  1180  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1181  
  1182  func Unlink(path string) (err error) {
  1183  	var _p0 *byte
  1184  	_p0, err = BytePtrFromString(path)
  1185  	if err != nil {
  1186  		return
  1187  	}
  1188  	_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)
  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 Unmount(path string, flags int) (err error) {
  1198  	var _p0 *byte
  1199  	_p0, err = BytePtrFromString(path)
  1200  	if err != nil {
  1201  		return
  1202  	}
  1203  	_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
  1204  	if e1 != 0 {
  1205  		err = errnoErr(e1)
  1206  	}
  1207  	return
  1208  }
  1209  
  1210  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1211  
  1212  func write(fd int, p []byte) (n int, err error) {
  1213  	var _p0 unsafe.Pointer
  1214  	if len(p) > 0 {
  1215  		_p0 = unsafe.Pointer(&p[0])
  1216  	} else {
  1217  		_p0 = unsafe.Pointer(&_zero)
  1218  	}
  1219  	r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
  1220  	n = int(r0)
  1221  	if e1 != 0 {
  1222  		err = errnoErr(e1)
  1223  	}
  1224  	return
  1225  }
  1226  
  1227  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1228  
  1229  func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
  1230  	r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)
  1231  	ret = uintptr(r0)
  1232  	if e1 != 0 {
  1233  		err = errnoErr(e1)
  1234  	}
  1235  	return
  1236  }
  1237  
  1238  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1239  
  1240  func munmap(addr uintptr, length uintptr) (err error) {
  1241  	_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
  1242  	if e1 != 0 {
  1243  		err = errnoErr(e1)
  1244  	}
  1245  	return
  1246  }
  1247  
  1248  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1249  
  1250  func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
  1251  	r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
  1252  	n = int(r0)
  1253  	if e1 != 0 {
  1254  		err = errnoErr(e1)
  1255  	}
  1256  	return
  1257  }
  1258  
  1259  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1260  
  1261  func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
  1262  	r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
  1263  	n = int(r0)
  1264  	if e1 != 0 {
  1265  		err = errnoErr(e1)
  1266  	}
  1267  	return
  1268  }
  1269  
  1270  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1271  
  1272  func utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error) {
  1273  	var _p0 *byte
  1274  	_p0, err = BytePtrFromString(path)
  1275  	if err != nil {
  1276  		return
  1277  	}
  1278  	_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flag), 0, 0)
  1279  	if e1 != 0 {
  1280  		err = errnoErr(e1)
  1281  	}
  1282  	return
  1283  }
  1284  
  1285  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1286  
  1287  func getcwd(buf []byte) (n int, err error) {
  1288  	var _p0 unsafe.Pointer
  1289  	if len(buf) > 0 {
  1290  		_p0 = unsafe.Pointer(&buf[0])
  1291  	} else {
  1292  		_p0 = unsafe.Pointer(&_zero)
  1293  	}
  1294  	r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0)
  1295  	n = int(r0)
  1296  	if e1 != 0 {
  1297  		err = errnoErr(e1)
  1298  	}
  1299  	return
  1300  }
  1301  

View as plain text