* sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c: New. * sysdeps/unix/sysv...
authorAlexandre Oliva <aoliva@redhat.com>
Sat, 5 Apr 2003 19:57:35 +0000 (19:57 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Sat, 5 Apr 2003 19:57:35 +0000 (19:57 +0000)
2003-04-05  Alexandre Oliva  <aoliva@redhat.com>

* sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c: New.
* sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c: New.
* sysdeps/unix/sysv/linux/kernel-features.h: fcntl64 is available
on mips n32.
* sysdeps/unix/sysv/linux/mips/kernel_stat.h: Explain why
XSTAT_IS_XSTAT64 must not be used for mips n64.  Use 64-bit data
structure on n32 as well.
* sysdeps/unix/sysv/linux/mips/bits/stat.h: Use POSIX-compliant
data types on n32 and n64.

ChangeLog
sysdeps/unix/sysv/linux/kernel-features.h
sysdeps/unix/sysv/linux/mips/bits/stat.h
sysdeps/unix/sysv/linux/mips/kernel_stat.h
sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c [new file with mode: 0644]

index 35a4b26857eb012f852c6bec31c2d151a7f08601..30686e33aab194a338329321d11f2948ff19d81a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2003-04-05  Alexandre Oliva  <aoliva@redhat.com>
+
+       * sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c: New.
+       * sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c: New.
+       * sysdeps/unix/sysv/linux/kernel-features.h: fcntl64 is available
+       on mips n32.
+       * sysdeps/unix/sysv/linux/mips/kernel_stat.h: Explain why 
+       XSTAT_IS_XSTAT64 must not be used for mips n64.  Use 64-bit data
+       structure on n32 as well.
+       * sysdeps/unix/sysv/linux/mips/bits/stat.h: Use POSIX-compliant
+       data types on n32 and n64.
+
 2003-04-05  Ulrich Drepper  <drepper@redhat.com>
 
        * malloc/thread-m.h [PTHREAD_MUTEX_INITIALIZER]: If
index b016b6c0771a832281d191cb7739b53d7c6bd76a..168715e665507fd4f8d1f259694843c29a1d0c45 100644 (file)
 # define __ASSUME_GETDENTS64_SYSCALL   1
 #endif
 
+#if defined __mips__ && defined _ABIN32 && _MIPS_SIM == _ABIN32
+# define __ASSUME_FCNTL64              1
+#endif
+
 /* The late 2.5 kernels saw a lot of new CLONE_* flags.  Summarize
    their availability with one define.  The changes were made first
    for i386 and the have to be done separately for the other archs.
index c0e6984d11d367825dc143ea3e0fdddf3c8cf0c1..c3819d398165613fb71d46085e0b6da5fd8c46cf 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1992,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003
+       Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -33,6 +34,7 @@
 #define _MKNOD_VER             _MKNOD_VER_LINUX /* The bits defined below.  */
 
 
+#if _MIPS_SIM == _MIPS_SIM_ABI32
 /* Structure describing file characteristics.  */
 struct stat
   {
@@ -106,6 +108,71 @@ struct stat64
     long int st_pad4[14];
   };
 #endif
+#else
+struct stat
+  {
+    __dev_t st_dev;
+    int        st_pad1[3];             /* Reserved for st_dev expansion  */
+#ifndef __USE_FILE_OFFSET64
+    __ino_t st_ino;
+#else
+    __ino64_t st_ino;
+#endif
+    __mode_t st_mode;
+    __nlink_t st_nlink;
+    __uid_t st_uid;
+    __gid_t st_gid;
+    __dev_t st_rdev;
+#if !defined __USE_FILE_OFFSET64
+    unsigned int st_pad2[2];   /* Reserved for st_rdev expansion  */
+    __off_t st_size;
+    int st_pad3;
+#else
+    unsigned int st_pad2[3];   /* Reserved for st_rdev expansion  */
+    __off64_t st_size;
+#endif
+    __time_t st_atime;
+    int __reserved0;
+    __time_t st_mtime;
+    int __reserved1;
+    __time_t st_ctime;
+    int __reserved2;
+    __blksize_t st_blksize;
+    unsigned int st_pad4;
+#ifndef __USE_FILE_OFFSET64
+    __blkcnt_t st_blocks;
+#else
+    __blkcnt64_t st_blocks;
+#endif
+    int st_pad5[14];
+  };
+
+#ifdef __USE_LARGEFILE64
+struct stat64
+  {
+    __dev_t st_dev;
+    unsigned int st_pad1[3];   /* Reserved for st_dev expansion  */
+    __ino64_t st_ino;
+    __mode_t st_mode;
+    __nlink_t st_nlink;
+    __uid_t st_uid;
+    __gid_t st_gid;
+    __dev_t st_rdev;
+    unsigned int st_pad2[3];   /* Reserved for st_rdev expansion  */
+    __off64_t st_size;
+    __time_t st_atime;
+    int __reserved0;
+    __time_t st_mtime;
+    int __reserved1;
+    __time_t st_ctime;
+    int __reserved2;
+    __blksize_t st_blksize;
+    unsigned int st_pad3;
+    __blkcnt64_t st_blocks;
+    int st_pad4[14];
+};
+#endif
+#endif
 
 /* Tell code we have these members.  */
 #define        _STATBUF_ST_BLKSIZE
index b5fcd008b0717db331de2d0218b2df2d605f15c5..3f1bce57c5c42879f2e3de85be6b9556164e9421 100644 (file)
@@ -1,17 +1,20 @@
-/* Definition of `struct stat' used in the kernel..  */
-#if defined _ABI64 && _MIPS_SIM == _ABI64
+/* As tempting as it is to define XSTAT_IS_XSTAT64 for n64, the
+   userland data structures are not identical, because of different
+   padding.  */
+/* Definition of `struct stat' used in the kernel.  */
+#if _MIPS_SIM != _MIPS_SIM_ABI32
 struct kernel_stat
   {
     unsigned int st_dev;
     unsigned int __pad1[3];
-    unsigned long st_ino;
+    unsigned long long st_ino;
     unsigned int st_mode;
     unsigned int st_nlink;
     int st_uid;
     int st_gid;
     unsigned int st_rdev;
     unsigned int __pad2[3];
-    long st_size;
+    long long st_size;
     unsigned int st_atime;
     unsigned int __unused1;
     unsigned int st_mtime;
@@ -20,7 +23,7 @@ struct kernel_stat
     unsigned int __unused3;
     unsigned int st_blksize;
     unsigned int __pad3;
-    unsigned long st_blocks;
+    unsigned long long st_blocks;
   };
 #else
 struct kernel_stat
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/ftruncate64.c
new file mode 100644 (file)
index 0000000..42efcba
--- /dev/null
@@ -0,0 +1,28 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/types.h>
+
+#include <sysdep.h>
+
+extern int ftruncate (int fd, off64_t length);
+
+int __ftruncate64 (int fd, off64_t length) {
+  return ftruncate (fd, length);
+}
+weak_alias (__ftruncate64, ftruncate64)
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/truncate64.c
new file mode 100644 (file)
index 0000000..339023f
--- /dev/null
@@ -0,0 +1,30 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/types.h>
+
+#include <sysdep.h>
+#include <bp-checks.h>
+
+extern int truncate (const char *__unbounded path, int dummy,
+                    off64_t length);
+
+int truncate64 (const char *__unbounded path, int dummy,
+               off64_t length) {
+  return truncate (path, dummy, length);
+}