Update dependencies
This commit is contained in:
31
vendor/modernc.org/libc/libc_linux.go
generated
vendored
31
vendor/modernc.org/libc/libc_linux.go
generated
vendored
@ -6,6 +6,7 @@ package libc // import "modernc.org/libc"
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
@ -41,6 +42,7 @@ import (
|
||||
|
||||
var (
|
||||
in6_addr_any in.In6_addr
|
||||
_ = X__ctype_b_loc
|
||||
)
|
||||
|
||||
type (
|
||||
@ -223,7 +225,7 @@ func Xopen64(t *TLS, pathname uintptr, flags int32, args uintptr) int32 {
|
||||
//TODO- flags |= fcntl.O_LARGEFILE
|
||||
var mode types.Mode_t
|
||||
if args != 0 {
|
||||
mode = *(*types.Mode_t)(unsafe.Pointer(args))
|
||||
mode = (types.Mode_t)(VaUint32(&args))
|
||||
}
|
||||
fdcwd := fcntl.AT_FDCWD
|
||||
n, _, err := unix.Syscall6(unix.SYS_OPENAT, uintptr(fdcwd), pathname, uintptr(flags|unix.O_LARGEFILE), uintptr(mode), 0, 0)
|
||||
@ -1964,3 +1966,30 @@ func Xctime_r(t *TLS, timep, buf uintptr) uintptr {
|
||||
copy((*RawMem)(unsafe.Pointer(buf))[:26:26], s)
|
||||
return buf
|
||||
}
|
||||
|
||||
// ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
|
||||
func Xpwrite(t *TLS, fd int32, buf uintptr, count types.Size_t, offset types.Off_t) types.Ssize_t {
|
||||
var n int
|
||||
var err error
|
||||
switch {
|
||||
case count == 0:
|
||||
n, err = unix.Pwrite(int(fd), nil, int64(offset))
|
||||
default:
|
||||
n, err = unix.Pwrite(int(fd), (*RawMem)(unsafe.Pointer(buf))[:count:count], int64(offset))
|
||||
if dmesgs {
|
||||
dmesg("%v: fd %v, off %#x, count %#x\n%s", origin(1), fd, offset, count, hex.Dump((*RawMem)(unsafe.Pointer(buf))[:count:count]))
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
if dmesgs {
|
||||
dmesg("%v: %v FAIL", origin(1), err)
|
||||
}
|
||||
t.setErrno(err)
|
||||
return -1
|
||||
}
|
||||
|
||||
if dmesgs {
|
||||
dmesg("%v: ok", origin(1))
|
||||
}
|
||||
return types.Ssize_t(n)
|
||||
}
|
||||
|
Reference in New Issue
Block a user