aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2002-07-25 21:07:08 +0000
committerJeff Johnston <jjohnstn@redhat.com>2002-07-25 21:07:08 +0000
commitdc8ac8e6504b4f1b1f3e0b1ccd93a559b878cda6 (patch)
treeb77f312ed54e5fa3b40b822dd48d504ce8c522aa
parentaa0ca6fd290c87adca6af8cb3422fff0bbff7169 (diff)
downloadnewlib-dc8ac8e6504b4f1b1f3e0b1ccd93a559b878cda6.zip
newlib-dc8ac8e6504b4f1b1f3e0b1ccd93a559b878cda6.tar.gz
newlib-dc8ac8e6504b4f1b1f3e0b1ccd93a559b878cda6.tar.bz2
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.
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/sys/linux/io64.c19
-rw-r--r--newlib/libc/sys/linux/sys/types.h2
3 files changed, 26 insertions, 0 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 02065d8..1ec9e59 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 90e4888..7f87c1e 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 41b26b6..4287a81 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 {