Ensure we have the off64_t variant of every function that takes an off_t.

Change-Id: Ib2eee0cf13162be3b62559b84e90c6dcf5aab1c3
This commit is contained in:
Elliott Hughes
2013-09-19 16:27:24 -07:00
parent f8e71bac14
commit b4f7616fd6
18 changed files with 298 additions and 12 deletions

View File

@@ -118,7 +118,7 @@ int __openat:openat (int, const char*, int, mode_t) 1
int close (int) 1
int creat(const char*, mode_t) stub
off_t lseek(int, off_t, int) 1
int __llseek:_llseek (int, unsigned long, unsigned long, loff_t*, int) 1
int __llseek:_llseek (int, unsigned long, unsigned long, off64_t*, int) 1
pid_t getpid () 1
void * mmap(void *, size_t, int, int, int, long) stub
void * __mmap2:mmap2(void*, size_t, int, int, int, long) 1
@@ -153,7 +153,8 @@ int fchown:fchown(int, uid_t, gid_t) -1,-1,1
void sync(void) 1
int __fcntl64:fcntl64(int, int, void *) 1
int __fstatfs64:fstatfs64(int, size_t, struct statfs *) 1
ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) 1
ssize_t sendfile(int out_fd, int in_fd, off_t* offset, size_t count) 1
ssize_t sendfile64(int out_fd, int in_fd, off64_t* offset, size_t count) 1
int fstatat:fstatat64(int dirfd, const char *path, struct stat *buf, int flags) 1
int mkdirat(int dirfd, const char *pathname, mode_t mode) 1
int fchownat(int dirfd, const char *path, uid_t owner, gid_t group, int flags) 1
@@ -191,6 +192,7 @@ int faccessat(int, const char *, int, int) 1
int symlink(const char *, const char *) 1
int fchdir(int) 1
int truncate(const char*, off_t) 1
int truncate64(const char*, off64_t) 1
int setxattr(const char *, const char *, const void *, size_t, int) 1
int lsetxattr(const char *, const char *, const void *, size_t, int) 1
ssize_t getxattr(const char *, const char *, void *, size_t) 1

View File

@@ -84,6 +84,7 @@ syscall_src += arch-arm/syscalls/sync.S
syscall_src += arch-arm/syscalls/__fcntl64.S
syscall_src += arch-arm/syscalls/__fstatfs64.S
syscall_src += arch-arm/syscalls/sendfile.S
syscall_src += arch-arm/syscalls/sendfile64.S
syscall_src += arch-arm/syscalls/fstatat.S
syscall_src += arch-arm/syscalls/mkdirat.S
syscall_src += arch-arm/syscalls/fchownat.S
@@ -116,6 +117,7 @@ syscall_src += arch-arm/syscalls/faccessat.S
syscall_src += arch-arm/syscalls/symlink.S
syscall_src += arch-arm/syscalls/fchdir.S
syscall_src += arch-arm/syscalls/truncate.S
syscall_src += arch-arm/syscalls/truncate64.S
syscall_src += arch-arm/syscalls/setxattr.S
syscall_src += arch-arm/syscalls/lsetxattr.S
syscall_src += arch-arm/syscalls/getxattr.S

View File

@@ -0,0 +1,15 @@
/* autogenerated by gensyscalls.py */
#include <asm/unistd.h>
#include <linux/err.h>
#include <machine/asm.h>
ENTRY(sendfile64)
mov ip, r7
ldr r7, =__NR_sendfile64
swi #0
mov r7, ip
cmn r0, #(MAX_ERRNO + 1)
bxls lr
neg r0, r0
b __set_errno
END(sendfile64)

View File

@@ -0,0 +1,15 @@
/* autogenerated by gensyscalls.py */
#include <asm/unistd.h>
#include <linux/err.h>
#include <machine/asm.h>
ENTRY(truncate64)
mov ip, r7
ldr r7, =__NR_truncate64
swi #0
mov r7, ip
cmn r0, #(MAX_ERRNO + 1)
bxls lr
neg r0, r0
b __set_errno
END(truncate64)

View File

@@ -87,6 +87,7 @@ syscall_src += arch-mips/syscalls/sync.S
syscall_src += arch-mips/syscalls/__fcntl64.S
syscall_src += arch-mips/syscalls/__fstatfs64.S
syscall_src += arch-mips/syscalls/sendfile.S
syscall_src += arch-mips/syscalls/sendfile64.S
syscall_src += arch-mips/syscalls/fstatat.S
syscall_src += arch-mips/syscalls/mkdirat.S
syscall_src += arch-mips/syscalls/fchownat.S
@@ -119,6 +120,7 @@ syscall_src += arch-mips/syscalls/faccessat.S
syscall_src += arch-mips/syscalls/symlink.S
syscall_src += arch-mips/syscalls/fchdir.S
syscall_src += arch-mips/syscalls/truncate.S
syscall_src += arch-mips/syscalls/truncate64.S
syscall_src += arch-mips/syscalls/setxattr.S
syscall_src += arch-mips/syscalls/lsetxattr.S
syscall_src += arch-mips/syscalls/getxattr.S

View File

@@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <asm/unistd.h>
.text
.globl sendfile64
.align 4
.ent sendfile64
sendfile64:
.set noreorder
.cpload $t9
li $v0, __NR_sendfile64
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end sendfile64

View File

@@ -0,0 +1,22 @@
/* autogenerated by gensyscalls.py */
#include <asm/unistd.h>
.text
.globl truncate64
.align 4
.ent truncate64
truncate64:
.set noreorder
.cpload $t9
li $v0, __NR_truncate64
syscall
bnez $a3, 1f
move $a0, $v0
j $ra
nop
1:
la $t9,__set_errno
j $t9
nop
.set reorder
.end truncate64

View File

@@ -88,6 +88,7 @@ syscall_src += arch-x86/syscalls/sync.S
syscall_src += arch-x86/syscalls/__fcntl64.S
syscall_src += arch-x86/syscalls/__fstatfs64.S
syscall_src += arch-x86/syscalls/sendfile.S
syscall_src += arch-x86/syscalls/sendfile64.S
syscall_src += arch-x86/syscalls/fstatat.S
syscall_src += arch-x86/syscalls/mkdirat.S
syscall_src += arch-x86/syscalls/fchownat.S
@@ -120,6 +121,7 @@ syscall_src += arch-x86/syscalls/faccessat.S
syscall_src += arch-x86/syscalls/symlink.S
syscall_src += arch-x86/syscalls/fchdir.S
syscall_src += arch-x86/syscalls/truncate.S
syscall_src += arch-x86/syscalls/truncate64.S
syscall_src += arch-x86/syscalls/setxattr.S
syscall_src += arch-x86/syscalls/lsetxattr.S
syscall_src += arch-x86/syscalls/getxattr.S

View File

@@ -0,0 +1,30 @@
/* autogenerated by gensyscalls.py */
#include <linux/err.h>
#include <machine/asm.h>
#include <asm/unistd.h>
ENTRY(sendfile64)
pushl %ebx
pushl %ecx
pushl %edx
pushl %esi
mov 20(%esp), %ebx
mov 24(%esp), %ecx
mov 28(%esp), %edx
mov 32(%esp), %esi
movl $__NR_sendfile64, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx
popl %ecx
popl %ebx
ret
END(sendfile64)

View File

@@ -0,0 +1,27 @@
/* autogenerated by gensyscalls.py */
#include <linux/err.h>
#include <machine/asm.h>
#include <asm/unistd.h>
ENTRY(truncate64)
pushl %ebx
pushl %ecx
pushl %edx
mov 16(%esp), %ebx
mov 20(%esp), %ecx
mov 24(%esp), %edx
movl $__NR_truncate64, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx
popl %ebx
ret
END(truncate64)

View File

@@ -25,16 +25,16 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <unistd.h>
extern int __llseek(int fd, unsigned long offset_hi, unsigned long offset_lo, loff_t* result, int whence);
extern int __llseek(int fd, unsigned long offset_hi, unsigned long offset_lo, off64_t* result, int whence);
off64_t lseek64(int fd, off64_t off, int whence)
{
loff_t result;
off64_t lseek64(int fd, off64_t off, int whence) {
off64_t result;
if (__llseek(fd, (unsigned long)(off >> 32),(unsigned long)(off), &result, whence) < 0) {
return -1;
}
if ( __llseek(fd, (unsigned long)(off >> 32),(unsigned long)(off), &result, whence ) < 0 )
return -1;
return result;
return result;
}

View File

@@ -25,6 +25,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _SYS_SENDFILE_H_
#define _SYS_SENDFILE_H_
@@ -33,7 +34,8 @@
__BEGIN_DECLS
extern ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
extern ssize_t sendfile(int out_fd, int in_fd, off_t* offset, size_t count);
extern ssize_t sendfile64(int out_fd, int in_fd, off64_t* offset, size_t count);
__END_DECLS

View File

@@ -65,7 +65,7 @@ typedef __kernel_nlink_t nlink_t;
typedef __kernel_off_t off_t;
#endif
typedef __kernel_loff_t loff_t;
typedef loff_t off64_t; /* GLibc-specific */
typedef loff_t off64_t;
typedef __kernel_pid_t pid_t;

View File

@@ -122,6 +122,7 @@ extern int chown(const char *, uid_t, gid_t);
extern int fchown(int, uid_t, gid_t);
extern int lchown(const char *, uid_t, gid_t);
extern int truncate(const char *, off_t);
extern int truncate64(const char *, off64_t);
extern char *getcwd(char *, size_t);
extern int sync(void);