about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/mips
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/mips')
-rw-r--r--sysdeps/unix/sysv/linux/mips/fxstat.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/lxstat.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h80
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/xstat64.c2
-rw-r--r--sysdeps/unix/sysv/linux/mips/xstat.c1
9 files changed, 80 insertions, 11 deletions
diff --git a/sysdeps/unix/sysv/linux/mips/fxstat.c b/sysdeps/unix/sysv/linux/mips/fxstat.c
index 16c3cefee2..4585c2362b 100644
--- a/sysdeps/unix/sysv/linux/mips/fxstat.c
+++ b/sysdeps/unix/sysv/linux/mips/fxstat.c
@@ -39,4 +39,3 @@ __fxstat (int vers, int fd, struct stat *buf)
       }
     }
 }
-hidden_def (__fxstat)
diff --git a/sysdeps/unix/sysv/linux/mips/lxstat.c b/sysdeps/unix/sysv/linux/mips/lxstat.c
index eb07549adf..62a3b15b32 100644
--- a/sysdeps/unix/sysv/linux/mips/lxstat.c
+++ b/sysdeps/unix/sysv/linux/mips/lxstat.c
@@ -39,4 +39,3 @@ __lxstat (int vers, const char *name, struct stat *buf)
       }
     }
 }
-hidden_def (__lxstat)
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c b/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
index 3fcdd9f1ee..e6c1cacd4b 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
@@ -31,5 +31,3 @@ __fxstat64 (int vers, int fd, struct stat64 *buf)
   return r ?: __xstat64_conv (vers, &kbuf, buf);
 
 }
-
-hidden_def (__fxstat64)
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c
index 58410a1441..e384dbab8b 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c
@@ -30,4 +30,3 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
   int r = INLINE_SYSCALL_CALL (newfstatat, fd, file, &kst, flag);
   return r ?: __xstat_conv (vers, &kst, st);
 }
-libc_hidden_def (__fxstatat)
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
index e5416d8971..cfd172d301 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
@@ -33,4 +33,3 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
     }
   return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
 }
-libc_hidden_def (__fxstatat64)
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h b/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h
new file mode 100644
index 0000000000..7f226416f9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h
@@ -0,0 +1,80 @@
+/* Struct stat/stat64 to stat/stat64 conversion for Linux.
+   Copyright (C) 2020 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, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sys/stat.h>
+#include <kernel_stat.h>
+
+static inline int
+__cp_kstat_stat (const struct kernel_stat *kst, struct stat *st)
+{
+  st->st_dev = kst->st_dev;
+  memset (&st->st_pad1, 0, sizeof (st->st_pad1));
+  st->st_ino = kst->st_ino;
+  if (st->st_ino != kst->st_ino)
+    return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW);
+  st->st_mode = kst->st_mode;
+  st->st_nlink = kst->st_nlink;
+  st->st_uid = kst->st_uid;
+  st->st_gid = kst->st_gid;
+  st->st_rdev = kst->st_rdev;
+  memset (&st->st_pad2, 0, sizeof (st->st_pad2));
+  st->st_size = kst->st_size;
+  if (st->st_size != kst->st_size)
+    return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW);
+  st->st_pad3 = 0;
+  st->st_atim.tv_sec = kst->st_atime_sec;
+  st->st_atim.tv_nsec = kst->st_atime_nsec;
+  st->st_mtim.tv_sec = kst->st_mtime_sec;
+  st->st_mtim.tv_nsec = kst->st_mtime_nsec;
+  st->st_ctim.tv_sec = kst->st_ctime_sec;
+  st->st_ctim.tv_nsec = kst->st_ctime_nsec;
+  st->st_blksize = kst->st_blksize;
+  st->st_blocks = kst->st_blocks;
+  if (st->st_blocks != kst->st_blocks)
+    return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW);
+  memset (&st->st_pad5, 0, sizeof (st->st_pad5));
+
+  return 0;
+}
+
+static inline int
+__cp_kstat_stat64 (const struct kernel_stat *kst, struct stat64 *st)
+{
+  st->st_dev = kst->st_dev;
+  memset (&st->st_pad1, 0, sizeof (st->st_pad1));
+  st->st_ino = kst->st_ino;
+  st->st_mode = kst->st_mode;
+  st->st_nlink = kst->st_nlink;
+  st->st_uid = kst->st_uid;
+  st->st_gid = kst->st_gid;
+  st->st_rdev = kst->st_rdev;
+  memset (&st->st_pad2, 0, sizeof (st->st_pad2));
+  st->st_pad3 = 0;
+  st->st_size = kst->st_size;
+  st->st_blksize = kst->st_blksize;
+  st->st_blocks = kst->st_blocks;
+  st->st_atim.tv_sec = kst->st_atime_sec;
+  st->st_atim.tv_nsec = kst->st_atime_nsec;
+  st->st_mtim.tv_sec = kst->st_mtime_sec;
+  st->st_mtim.tv_nsec = kst->st_mtime_nsec;
+  st->st_ctim.tv_sec = kst->st_ctime_sec;
+  st->st_ctim.tv_nsec = kst->st_ctime_nsec;
+  memset (&st->st_pad4, 0, sizeof (st->st_pad4));
+
+  return 0;
+}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c b/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
index 28bac57e58..0f3934f8c8 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
@@ -29,5 +29,3 @@ __lxstat64 (int vers, const char *name, struct stat64 *buf)
   int r = INLINE_SYSCALL_CALL (lstat, name, &kbuf);
   return r ?: __xstat64_conv (vers, &kbuf, buf);
 }
-
-hidden_def (__lxstat64)
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c b/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
index 99b03c7593..64d2952276 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
@@ -30,5 +30,3 @@ __xstat64 (int vers, const char *name, struct stat64 *buf)
   int r = INLINE_SYSCALL_CALL (stat, name, &kbuf);
   return r ?: __xstat64_conv (vers, &kbuf, buf);
 }
-
-hidden_def (__xstat64)
diff --git a/sysdeps/unix/sysv/linux/mips/xstat.c b/sysdeps/unix/sysv/linux/mips/xstat.c
index 835691cf89..d6ff5ccbe0 100644
--- a/sysdeps/unix/sysv/linux/mips/xstat.c
+++ b/sysdeps/unix/sysv/linux/mips/xstat.c
@@ -39,4 +39,3 @@ __xstat (int vers, const char *name, struct stat *buf)
       }
     }
 }
-hidden_def (__xstat)