mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall: use 64-bit file size for truncation on Linux
Truncate and Ftruncate for 32-bit Linux should use 64-bit offset system calls. R=rsc CC=golang-dev, royger https://golang.org/cl/2943041
This commit is contained in:
parent
6101788972
commit
fa7341aafd
7 changed files with 54 additions and 50 deletions
|
|
@ -273,14 +273,6 @@ func Fsync(fd int) (errno int) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Ftruncate(fd int, length int64) (errno int) {
|
||||
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32))
|
||||
errno = int(e1)
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Getdents(fd int, buf []byte) (n int, errno int) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(buf) > 0 {
|
||||
|
|
@ -645,14 +637,6 @@ func Times(tms *Tms) (ticks uintptr, errno int) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Truncate(path string, length int64) (errno int) {
|
||||
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), uintptr(length>>32))
|
||||
errno = int(e1)
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Umask(mask int) (oldmask int) {
|
||||
r0, _, _ := Syscall(SYS_UMASK, uintptr(mask), 0, 0)
|
||||
oldmask = int(r0)
|
||||
|
|
@ -888,6 +872,14 @@ func Fstatfs(fd int, buf *Statfs_t) (errno int) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Ftruncate(fd int, length int64) (errno int) {
|
||||
_, _, e1 := Syscall(SYS_FTRUNCATE64, uintptr(fd), uintptr(length), uintptr(length>>32))
|
||||
errno = int(e1)
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Getegid() (egid int) {
|
||||
r0, _, _ := Syscall(SYS_GETEGID, 0, 0, 0)
|
||||
egid = int(r0)
|
||||
|
|
@ -1033,6 +1025,14 @@ func Statfs(path string, buf *Statfs_t) (errno int) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Truncate(path string, length int64) (errno int) {
|
||||
_, _, e1 := Syscall(SYS_TRUNCATE64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), uintptr(length>>32))
|
||||
errno = int(e1)
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Gettimeofday(tv *Timeval) (errno int) {
|
||||
_, _, e1 := Syscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
||||
errno = int(e1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue