diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2002-07-25 21:07:08 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2002-07-25 21:07:08 +0000 |
commit | dc8ac8e6504b4f1b1f3e0b1ccd93a559b878cda6 (patch) | |
tree | b77f312ed54e5fa3b40b822dd48d504ce8c522aa /newlib/libc | |
parent | aa0ca6fd290c87adca6af8cb3422fff0bbff7169 (diff) | |
download | cygnal-dc8ac8e6504b4f1b1f3e0b1ccd93a559b878cda6.tar.gz cygnal-dc8ac8e6504b4f1b1f3e0b1ccd93a559b878cda6.tar.bz2 cygnal-dc8ac8e6504b4f1b1f3e0b1ccd93a559b878cda6.zip |
2002-07-25 Jeff Johnston <jjohnstn@redhat.com>
* libc/sys/linux/io64.c (truncate64, ftruncate64): Added.
* libc/sys/linux/sys/types.h (off64_t): Definition added.
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/sys/linux/io64.c | 19 | ||||
-rw-r--r-- | newlib/libc/sys/linux/sys/types.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/newlib/libc/sys/linux/io64.c b/newlib/libc/sys/linux/io64.c index 90e48888e..7f87c1e9b 100644 --- a/newlib/libc/sys/linux/io64.c +++ b/newlib/libc/sys/linux/io64.c @@ -14,10 +14,29 @@ #include <sys/ioctl.h> #include <machine/syscall.h> +#define __NR___truncate64 __NR_truncate64 +#define __NR___ftruncate64 __NR_ftruncate64 + _syscall2(int,fstat64,int,fd,struct stat64 *,st) _syscall2(int,lstat64,const char *,name,struct stat64 *,st) _syscall2(int,stat64,const char *,name,struct stat64 *,st) +static _syscall3(int,__truncate64,const char *,name,int,high,int,low) + +int __libc_truncate64(const char *name, off64_t length) +{ + return __truncate64(name,(length >> 32), (length & 0xffffffff)); +} +weak_alias(__libc_truncate64,truncate64) + +static _syscall3(int,__ftruncate64,int,fd,int,high,int,low); + +int __libc_ftruncate64(int fd, off64_t length) +{ + return __ftruncate64(fd,(length >> 32),(length & 0xffffffff)); +} +weak_alias(__libc_ftruncate64,ftruncate64) + static _syscall5(void,_llseek,int,fd,off_t,hi,off_t,lo,loff_t *,pos,int,whence) loff_t __libc_lseek64(int fd, loff_t offset, int whence) diff --git a/newlib/libc/sys/linux/sys/types.h b/newlib/libc/sys/linux/sys/types.h index 41b26b63d..4287a81bc 100644 --- a/newlib/libc/sys/linux/sys/types.h +++ b/newlib/libc/sys/linux/sys/types.h @@ -143,10 +143,12 @@ typedef long fd_mask; #define __ssize_t_defined #define __key_t_defined #define __off_t_defined +#define __off64_t_defined typedef __ino64_t ino64_t; typedef __uint32_t uintptr_t; typedef __int32_t intptr_t; +typedef __off64_t off64_t; #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) typedef struct _physadr { |