// But, as fcntl is currently not exported and isn't called with F_DUP2FD,
// it doesn't matter.
//sys fcntl(fd int, cmd int, arg int) (val int, err error)
-//sys dup2(old int, new int) (val int, err error)
+//sys Dup2(old int, new int) (val int, err error)
//sysnb pipe(p *[2]_C_int) (err error)
func Pipe(p []int) (err error) {
//sys Chdir(path string) (err error)
//sys Chmod(path string, mode uint32) (err error)
//sys Chown(path string, uid int, gid int) (err error)
+//sys Chroot(path string) (err error)
//sys Close(fd int) (err error)
//sys Dup(fd int) (nfd int, err error)
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
import "unsafe"
//go:cgo_import_dynamic libc_fcntl fcntl "libc.a/shr_64.o"
-//go:cgo_import_dynamic libc_dup2 dup2 "libc.a/shr_64.o"
+//go:cgo_import_dynamic libc_Dup2 dup2 "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_pipe pipe "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_readlink readlink "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_utimes utimes "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_Chdir chdir "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_Chmod chmod "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_Chown chown "libc.a/shr_64.o"
+//go:cgo_import_dynamic libc_Chroot chroot "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_Close close "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_Dup dup "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_Faccessat faccessat "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_munmap munmap "libc.a/shr_64.o"
//go:linkname libc_fcntl libc_fcntl
-//go:linkname libc_dup2 libc_dup2
+//go:linkname libc_Dup2 libc_Dup2
//go:linkname libc_pipe libc_pipe
//go:linkname libc_readlink libc_readlink
//go:linkname libc_utimes libc_utimes
//go:linkname libc_Chdir libc_Chdir
//go:linkname libc_Chmod libc_Chmod
//go:linkname libc_Chown libc_Chown
+//go:linkname libc_Chroot libc_Chroot
//go:linkname libc_Close libc_Close
//go:linkname libc_Dup libc_Dup
//go:linkname libc_Faccessat libc_Faccessat
var (
libc_fcntl,
- libc_dup2,
+ libc_Dup2,
libc_pipe,
libc_readlink,
libc_utimes,
libc_Chdir,
libc_Chmod,
libc_Chown,
+ libc_Chroot,
libc_Close,
libc_Dup,
libc_Faccessat,
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func dup2(old int, new int) (val int, err error) {
- r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_dup2)), 2, uintptr(old), uintptr(new), 0, 0, 0, 0)
+func Dup2(old int, new int) (val int, err error) {
+ r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Dup2)), 2, uintptr(old), uintptr(new), 0, 0, 0, 0)
val = int(r0)
if e1 != 0 {
err = errnoErr(e1)
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Chroot(path string) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Chroot)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Close(fd int) (err error) {
_, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Close)), 1, uintptr(fd), 0, 0, 0, 0, 0)
if e1 != 0 {