mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-30 13:56:45 -04:00
syscall: call getfsstat via libc on openbsd
On openbsd, call getfsstat directly via libc, instead of calling it via syscall.Syscall. Updates golang/go#63900 Change-Id: I99a3555b3207754b107dbabf63440569fca93eea Reviewed-on: https://go-review.googlesource.com/c/sys/+/538976 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Josh Rickmar <jrick@zettaport.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
@@ -137,18 +137,13 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||
}
|
||||
|
||||
func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
var bufptr *Statfs_t
|
||||
var bufsize uintptr
|
||||
if len(buf) > 0 {
|
||||
_p0 = unsafe.Pointer(&buf[0])
|
||||
bufptr = &buf[0]
|
||||
bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
|
||||
}
|
||||
r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
|
||||
n = int(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
return getfsstat(bufptr, bufsize, flags)
|
||||
}
|
||||
|
||||
//sysnb getresuid(ruid *_C_int, euid *_C_int, suid *_C_int)
|
||||
@@ -326,6 +321,7 @@ func Uname(uname *Utsname) error {
|
||||
//sys write(fd int, p []byte) (n int, err error)
|
||||
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||
//sys getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error)
|
||||
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
||||
//sys pledge(promises *byte, execpromises *byte) (err error)
|
||||
//sys unveil(path *byte, flags *byte) (err error)
|
||||
|
||||
Reference in New Issue
Block a user