public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: YunQiang Su <yunqiang.su@cipunited.com>
To: libc-alpha@sourceware.org
Cc: aurelien@aurel32.net, adhemerval.zanella@linaro.org,
	jiaxun.yang@flygoat.com, macro@orcam.me.uk, syq@debian.org,
	YunQiang Su <yunqiang.su@cipunited.com>
Subject: [PATCH v2 2/2] MIPS: N64, make xstat as wrapper of generic fstatat
Date: Fri, 19 Mar 2021 01:18:37 +0000	[thread overview]
Message-ID: <20210319011837.3883510-2-yunqiang.su@cipunited.com> (raw)
In-Reply-To: <20210319011837.3883510-1-yunqiang.su@cipunited.com>

fxstatat as wrapper of fstatat
fxstatat64 as wrapper of fstatat64

fxstat, lxstat, xstat as wrapper of fxstatat
fxstat64, lxstat64, xstat64 as wrapper of fxstatat64
---
 .../unix/sysv/linux/mips/mips64/n64/fxstat.c  | 27 +++++++++++++
 .../sysv/linux/mips/mips64/n64/fxstat64.c     | 28 ++++++++++++++
 .../sysv/linux/mips/mips64/n64/fxstatat.c     | 38 +++++++++++++++++++
 .../sysv/linux/mips/mips64/n64/fxstatat64.c   | 34 +++++++++++++++++
 .../unix/sysv/linux/mips/mips64/n64/lxstat.c  | 27 +++++++++++++
 .../sysv/linux/mips/mips64/n64/lxstat64.c     | 27 +++++++++++++
 .../unix/sysv/linux/mips/mips64/n64/xstat.c   | 27 +++++++++++++
 .../unix/sysv/linux/mips/mips64/n64/xstat64.c | 28 ++++++++++++++
 8 files changed, 236 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/fxstat.c
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/fxstat64.c
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/fxstatat.c
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/fxstatat64.c
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/lxstat.c
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/lxstat64.c
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/xstat.c
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/xstat64.c

diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/fxstat.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/fxstat.c
new file mode 100644
index 0000000000..037b2bb080
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/fxstat.c
@@ -0,0 +1,27 @@
+/* fxstat using old-style Unix stat system call.
+   Copyright (C) 1991-2021 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 <fcntl.h>
+
+/* Get information about the file NAME in BUF.  */
+int
+__fxstat (int vers, int fd, struct stat *buf)
+{
+   return __fxstatat(vers, fd, "", buf, AT_EMPTY_PATH);
+}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/fxstat64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/fxstat64.c
new file mode 100644
index 0000000000..4c2d461667
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/fxstat64.c
@@ -0,0 +1,28 @@
+/* fxstat64 using 64-bit MIPS fstat system call.
+   Copyright (C) 1997-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 <fcntl.h>
+
+/* Get information about the file FD in BUF.  */
+
+int
+__fxstat64 (int vers, int fd, struct stat64 *buf)
+{
+    return __fxstatat64(vers, fd, "", buf, AT_EMPTY_PATH);
+}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/fxstatat.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/fxstatat.c
new file mode 100644
index 0000000000..6d94f12bce
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/fxstatat.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2005-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/>.  */
+
+/* Ho hum, since fxstatat == fxstatat64 we must get rid of the
+   prototype or gcc will complain since they don't strictly match.  */
+
+#include <sys/syscall.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* Get information about the file NAME relative to FD in ST.  */
+int
+__fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
+{
+  if (__builtin_expect (vers != _STAT_VER_LINUX, 0))
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  return __fstatat(fd, file, st, flag);
+
+}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/fxstatat64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/fxstatat64.c
new file mode 100644
index 0000000000..b5b0eac92f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/fxstatat64.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 2005-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 <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* Get information about the file NAME in BUF.  */
+
+int
+__fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
+{
+  if (__builtin_expect (vers != _STAT_VER_LINUX, 0))
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  return __fstatat64_time64(fd, file, st, flag);
+}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/lxstat.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/lxstat.c
new file mode 100644
index 0000000000..43dd4e76b7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/lxstat.c
@@ -0,0 +1,27 @@
+/* lxstat using old-style Unix stat system call.
+   Copyright (C) 1991-2021 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 <fcntl.h>
+
+/* Get information about the file NAME in BUF.  */
+int
+__lxstat (int vers, const char *name, struct stat *buf)
+{
+   return __fxstatat(vers, AT_FDCWD, name, buf, AT_SYMLINK_NOFOLLOW);
+}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/lxstat64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/lxstat64.c
new file mode 100644
index 0000000000..232878a74a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/lxstat64.c
@@ -0,0 +1,27 @@
+/* lxstat64 using 64-bit MIPS lstat system call.
+   Copyright (C) 1997-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 <fcntl.h>
+
+/* Get information about the file NAME in BUF.  */
+int
+__lxstat64 (int vers, const char *name, struct stat64 *buf)
+{
+    return __fxstatat64(vers, AT_FDCWD, name, buf, AT_SYMLINK_NOFOLLOW);
+}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/xstat.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/xstat.c
new file mode 100644
index 0000000000..68e62fc3b3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/xstat.c
@@ -0,0 +1,27 @@
+/* xstat using old-style Unix stat system call.
+   Copyright (C) 1991-2021 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 <fcntl.h>
+
+/* Get information about the file NAME in BUF.  */
+int
+__xstat (int vers, const char *name, struct stat *buf)
+{
+   return __fxstatat(vers, AT_FDCWD, name, buf, 0);
+}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/xstat64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/xstat64.c
new file mode 100644
index 0000000000..06f9738a65
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/xstat64.c
@@ -0,0 +1,28 @@
+/* xstat64 using 64-bit MIPS stat system call.
+   Copyright (C) 1991-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 <fcntl.h>
+
+/* Get information about the file NAME in BUF.  */
+
+int
+__xstat64 (int vers, const char *name, struct stat64 *buf)
+{
+    return __fxstatat64(vers, AT_FDCWD, name, buf, 0);
+}
-- 
2.31.0


  reply	other threads:[~2021-03-19  1:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19  1:18 [PATCH v2 1/2] fstatat64: use statx on kernel using uint32 for time YunQiang Su
2021-03-19  1:18 ` YunQiang Su [this message]
2021-03-19 10:07   ` [PATCH v2 2/2] MIPS: N64, make xstat as wrapper of generic fstatat Andreas Schwab
2021-03-19 18:42   ` Adhemerval Zanella
2021-03-22  2:23     ` 回复: " yunqiang.su
2021-03-19 18:38 ` [PATCH v2 1/2] fstatat64: use statx on kernel using uint32 for time Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210319011837.3883510-2-yunqiang.su@cipunited.com \
    --to=yunqiang.su@cipunited.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=aurelien@aurel32.net \
    --cc=jiaxun.yang@flygoat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=macro@orcam.me.uk \
    --cc=syq@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).