mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-31 22:36:44 -04:00
unix: add Faccessat on Solaris
Change-Id: Ie720f7c4d496e67f2a81de379374c2ec1f95bb96 Reviewed-on: https://go-review.googlesource.com/119556 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
6c888cc515
commit
f24d3d461d
@@ -595,6 +595,7 @@ func Poll(fds []PollFd, timeout int) (n int, err error) {
|
|||||||
//sys Dup(fd int) (nfd int, err error)
|
//sys Dup(fd int) (nfd int, err error)
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
//sys Exit(code int)
|
//sys Exit(code int)
|
||||||
|
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
//sys Fchdir(fd int) (err error)
|
//sys Fchdir(fd int) (err error)
|
||||||
//sys Fchmod(fd int, mode uint32) (err error)
|
//sys Fchmod(fd int, mode uint32) (err error)
|
||||||
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import (
|
|||||||
//go:cgo_import_dynamic libc_dup dup "libc.so"
|
//go:cgo_import_dynamic libc_dup dup "libc.so"
|
||||||
//go:cgo_import_dynamic libc_dup2 dup2 "libc.so"
|
//go:cgo_import_dynamic libc_dup2 dup2 "libc.so"
|
||||||
//go:cgo_import_dynamic libc_exit exit "libc.so"
|
//go:cgo_import_dynamic libc_exit exit "libc.so"
|
||||||
|
//go:cgo_import_dynamic libc_faccessat faccessat "libc.so"
|
||||||
//go:cgo_import_dynamic libc_fchdir fchdir "libc.so"
|
//go:cgo_import_dynamic libc_fchdir fchdir "libc.so"
|
||||||
//go:cgo_import_dynamic libc_fchmod fchmod "libc.so"
|
//go:cgo_import_dynamic libc_fchmod fchmod "libc.so"
|
||||||
//go:cgo_import_dynamic libc_fchmodat fchmodat "libc.so"
|
//go:cgo_import_dynamic libc_fchmodat fchmodat "libc.so"
|
||||||
@@ -169,6 +170,7 @@ import (
|
|||||||
//go:linkname procDup libc_dup
|
//go:linkname procDup libc_dup
|
||||||
//go:linkname procDup2 libc_dup2
|
//go:linkname procDup2 libc_dup2
|
||||||
//go:linkname procExit libc_exit
|
//go:linkname procExit libc_exit
|
||||||
|
//go:linkname procFaccessat libc_faccessat
|
||||||
//go:linkname procFchdir libc_fchdir
|
//go:linkname procFchdir libc_fchdir
|
||||||
//go:linkname procFchmod libc_fchmod
|
//go:linkname procFchmod libc_fchmod
|
||||||
//go:linkname procFchmodat libc_fchmodat
|
//go:linkname procFchmodat libc_fchmodat
|
||||||
@@ -298,6 +300,7 @@ var (
|
|||||||
procDup,
|
procDup,
|
||||||
procDup2,
|
procDup2,
|
||||||
procExit,
|
procExit,
|
||||||
|
procFaccessat,
|
||||||
procFchdir,
|
procFchdir,
|
||||||
procFchmod,
|
procFchmod,
|
||||||
procFchmodat,
|
procFchmodat,
|
||||||
@@ -695,6 +698,19 @@ func Exit(code int) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFaccessat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = e1
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func Fchdir(fd int) (err error) {
|
func Fchdir(fd int) (err error) {
|
||||||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0)
|
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user