...
Run Format

Source file src/syscall/zsyscall_solaris_amd64.go

Documentation: syscall

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

View as plain text