diff options
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 5 | ||||
-rw-r--r-- | newlib/libc/sys/linux/io64.c | 19 | ||||
-rw-r--r-- | newlib/libc/sys/linux/sys/types.h | 2 |
3 files changed, 26 insertions, 0 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 02065d80f..1ec9e5987 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,5 +1,10 @@ 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. + +2002-07-25 Jeff Johnston <jjohnstn@redhat.com> + * libc/sys/linux/Makefile.am: Add fclean.c. * libc/sys/linux/Makefile.in: Regenerated. * libc/sys/linux/fclean.c: New file. 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 { |