unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: Alistair Francis <alistair.francis@wdc.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH 01/16] linux: Always define STAT_IS_KERNEL_STAT
Date: Fri, 24 Jul 2020 10:17:25 +0200	[thread overview]
Message-ID: <20200724101725.2519f7ed@jawa> (raw)
In-Reply-To: <20200723194641.1949404-2-adhemerval.zanella@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 8485 bytes --]

Hi Adhemerval,

> It allows to check for its value instead of its existence.
> 
> Checked with a build for all affected ABIS.

Reviewed-by: Lukasz Majewski <lukma@denx.de>

> ---
>  sysdeps/unix/sysv/linux/alpha/kernel_stat.h             | 1 +
>  sysdeps/unix/sysv/linux/fxstat.c                        | 2 +-
>  sysdeps/unix/sysv/linux/fxstatat.c                      | 4 ++--
>  sysdeps/unix/sysv/linux/hppa/kernel_stat.h              | 1 +
>  sysdeps/unix/sysv/linux/kernel_stat.h                   | 1 +
>  sysdeps/unix/sysv/linux/lxstat.c                        | 2 +-
>  sysdeps/unix/sysv/linux/microblaze/kernel_stat.h        | 1 +
>  sysdeps/unix/sysv/linux/mips/kernel_stat.h              | 1 +
>  sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h | 1 +
>  sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h     | 1 +
>  sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h     | 1 +
>  sysdeps/unix/sysv/linux/xstat.c                         | 2 +-
>  sysdeps/unix/sysv/linux/xstatconv.c                     | 2 +-
>  sysdeps/unix/sysv/linux/xstatconv.h                     | 2 +-
>  14 files changed, 15 insertions(+), 7 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_stat.h
> b/sysdeps/unix/sysv/linux/alpha/kernel_stat.h index
> d637e099cf..9bcc96c577 100644 ---
> a/sysdeps/unix/sysv/linux/alpha/kernel_stat.h +++
> b/sysdeps/unix/sysv/linux/alpha/kernel_stat.h @@ -85,5 +85,6 @@
> struct glibc21_stat long __glibc_reserved[4];
>    };
>  
> +#define STAT_IS_KERNEL_STAT 0
>  #define XSTAT_IS_XSTAT64 1
>  #define STATFS_IS_STATFS64 0
> diff --git a/sysdeps/unix/sysv/linux/fxstat.c
> b/sysdeps/unix/sysv/linux/fxstat.c index ce474dcd47..a88404b5c3 100644
> --- a/sysdeps/unix/sysv/linux/fxstat.c
> +++ b/sysdeps/unix/sysv/linux/fxstat.c
> @@ -38,7 +38,7 @@ __fxstat (int vers, int fd, struct stat *buf)
>    if (vers == _STAT_VER_KERNEL)
>      return INLINE_SYSCALL (fstat, 2, fd, buf);
>  
> -#ifdef STAT_IS_KERNEL_STAT
> +#if STAT_IS_KERNEL_STAT
>    return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
>  #else
>    struct kernel_stat kbuf;
> diff --git a/sysdeps/unix/sysv/linux/fxstatat.c
> b/sysdeps/unix/sysv/linux/fxstatat.c index 3eb898e322..937fec45c2
> 100644 --- a/sysdeps/unix/sysv/linux/fxstatat.c
> +++ b/sysdeps/unix/sysv/linux/fxstatat.c
> @@ -37,7 +37,7 @@ int
>  __fxstatat (int vers, int fd, const char *file, struct stat *st, int
> flag) {
>    int result;
> -#ifdef STAT_IS_KERNEL_STAT
> +#if STAT_IS_KERNEL_STAT
>  # define kst (*st)
>  #else
>    struct kernel_stat kst;
> @@ -46,7 +46,7 @@ __fxstatat (int vers, int fd, const char *file,
> struct stat *st, int flag) result = INTERNAL_SYSCALL_CALL
> (newfstatat, fd, file, &kst, flag); if (!__glibc_likely
> (INTERNAL_SYSCALL_ERROR_P (result))) {
> -#ifdef STAT_IS_KERNEL_STAT
> +#if STAT_IS_KERNEL_STAT
>        return 0;
>  #else
>        return __xstat_conv (vers, &kst, st);
> diff --git a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h
> b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h index
> a3ac53a1ef..0cbd010fc3 100644 ---
> a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h +++
> b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h @@ -30,5 +30,6 @@ struct
> kernel_stat { #define _HAVE_STAT_NSEC
>  #define _HAVE_STAT64_NSEC
>  
> +#define STAT_IS_KERNEL_STAT 0
>  #define XSTAT_IS_XSTAT64 0
>  #define STATFS_IS_STATFS64 0
> diff --git a/sysdeps/unix/sysv/linux/kernel_stat.h
> b/sysdeps/unix/sysv/linux/kernel_stat.h index eecc962de3..ff54a4524c
> 100644 --- a/sysdeps/unix/sysv/linux/kernel_stat.h
> +++ b/sysdeps/unix/sysv/linux/kernel_stat.h
> @@ -34,5 +34,6 @@ struct kernel_stat
>  #define _HAVE_STAT64___ST_INO
>  #define _HAVE_STAT64_NSEC
>  
> +#define STAT_IS_KERNEL_STAT 0
>  #define XSTAT_IS_XSTAT64 0
>  #define STATFS_IS_STATFS64 0
> diff --git a/sysdeps/unix/sysv/linux/lxstat.c
> b/sysdeps/unix/sysv/linux/lxstat.c index e0cfc4f1fa..dcd685873d 100644
> --- a/sysdeps/unix/sysv/linux/lxstat.c
> +++ b/sysdeps/unix/sysv/linux/lxstat.c
> @@ -37,7 +37,7 @@ __lxstat (int vers, const char *name, struct stat
> *buf) if (vers == _STAT_VER_KERNEL)
>      return INLINE_SYSCALL (lstat, 2, name, buf);
>  
> -#ifdef STAT_IS_KERNEL_STAT
> +#if STAT_IS_KERNEL_STAT
>    return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
>  #else
>    struct kernel_stat kbuf;
> diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h
> b/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h index
> 765e0dca67..4daaedc4b6 100644 ---
> a/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h +++
> b/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h @@ -48,5 +48,6 @@
> struct kernel_stat #define _HAVE_STAT64___UNUSED5
>  };
>  
> +#define STAT_IS_KERNEL_STAT 0
>  #define XSTAT_IS_XSTAT64 0
>  #define STATFS_IS_STATFS64 0
> diff --git a/sysdeps/unix/sysv/linux/mips/kernel_stat.h
> b/sysdeps/unix/sysv/linux/mips/kernel_stat.h index
> 388df1bfff..e75f3e805b 100644 ---
> a/sysdeps/unix/sysv/linux/mips/kernel_stat.h +++
> b/sysdeps/unix/sysv/linux/mips/kernel_stat.h @@ -56,5 +56,6 @@ struct
> kernel_stat };
>  #endif
>  
> +#define STAT_IS_KERNEL_STAT 0
>  #define XSTAT_IS_XSTAT64 0
>  #define STATFS_IS_STATFS64 0
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h index
> c5948a4d3c..75610b8df3 100644 ---
> a/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h +++
> b/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h @@ -47,5
> +47,6 @@ struct kernel_stat #define _HAVE_STAT64___PAD2
>  #define _HAVE_STAT64_NSEC
>  
> +#define STAT_IS_KERNEL_STAT 0
>  #define XSTAT_IS_XSTAT64 0
>  #define STATFS_IS_STATFS64 0
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h
> b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h index
> a4416009f1..5c8cacaf67 100644 ---
> a/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h +++
> b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h @@ -31,5 +31,6
> @@ struct kernel_stat #define _HAVE_STAT_NSEC
>  #define _HAVE_STAT64_NSEC
>  
> +#define STAT_IS_KERNEL_STAT 0
>  #define XSTAT_IS_XSTAT64 0
>  #define STATFS_IS_STATFS64 0
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
> b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h index
> 30afb553b9..d14b2487ac 100644 ---
> a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h +++
> b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h @@ -44,5 +44,6
> @@ struct kernel_stat64 long int __glibc_reserved[3];
>    };
>  
> +#define STAT_IS_KERNEL_STAT 0
>  #define XSTAT_IS_XSTAT64 1
>  #define STATFS_IS_STATFS64 0
> diff --git a/sysdeps/unix/sysv/linux/xstat.c
> b/sysdeps/unix/sysv/linux/xstat.c index a93d635611..76c90e20c7 100644
> --- a/sysdeps/unix/sysv/linux/xstat.c
> +++ b/sysdeps/unix/sysv/linux/xstat.c
> @@ -37,7 +37,7 @@ __xstat (int vers, const char *name, struct stat
> *buf) if (vers == _STAT_VER_KERNEL)
>      return INLINE_SYSCALL (stat, 2, name, buf);
>  
> -#ifdef STAT_IS_KERNEL_STAT
> +#if STAT_IS_KERNEL_STAT
>    return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
>  #else
>    struct kernel_stat kbuf;
> diff --git a/sysdeps/unix/sysv/linux/xstatconv.c
> b/sysdeps/unix/sysv/linux/xstatconv.c index c01fb00a3a..3622a82cd0
> 100644 --- a/sysdeps/unix/sysv/linux/xstatconv.c
> +++ b/sysdeps/unix/sysv/linux/xstatconv.c
> @@ -20,7 +20,7 @@
>  #include <sys/stat.h>
>  #include <kernel_stat.h>
>  
> -#ifdef STAT_IS_KERNEL_STAT
> +#if STAT_IS_KERNEL_STAT
>  
>  /* Dummy.  */
>  struct kernel_stat;
> diff --git a/sysdeps/unix/sysv/linux/xstatconv.h
> b/sysdeps/unix/sysv/linux/xstatconv.h index 39102c9469..5319236cae
> 100644 --- a/sysdeps/unix/sysv/linux/xstatconv.h
> +++ b/sysdeps/unix/sysv/linux/xstatconv.h
> @@ -16,7 +16,7 @@
>     License along with the GNU C Library; if not, see
>     <https://www.gnu.org/licenses/>.  */
>  
> -#ifndef STAT_IS_KERNEL_STAT
> +#if !STAT_IS_KERNEL_STAT
>  extern int __xstat_conv (int vers, struct kernel_stat *kbuf, void
> *ubuf) attribute_hidden;
>  extern int __xstat64_conv (int vers, struct kernel_stat *kbuf, void
> *ubuf)




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-07-24  8:17 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 19:46 [PATCH 00/16] Add y2038 support for stat functions Adhemerval Zanella via Libc-alpha
2020-07-23 19:46 ` [PATCH 01/16] linux: Always define STAT_IS_KERNEL_STAT Adhemerval Zanella via Libc-alpha
2020-07-24  8:17   ` Lukasz Majewski [this message]
2020-07-23 19:46 ` [PATCH 02/16] linux: Define STAT64_IS_KERNEL_STAT64 Adhemerval Zanella via Libc-alpha
2020-07-24  8:20   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 03/16] linux: Consolidate xstat{64} Adhemerval Zanella via Libc-alpha
2020-07-23 20:51   ` Joseph Myers
2020-07-24  8:34   ` Lukasz Majewski
2020-09-09 14:46   ` Lukasz Majewski
2020-09-09 18:05     ` Adhemerval Zanella via Libc-alpha
2020-09-10  7:10       ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 04/16] linux: Consolidate lxstat{64} Adhemerval Zanella via Libc-alpha
2020-07-24  8:43   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 05/16] linux: Consolidate fxstat{64} Adhemerval Zanella via Libc-alpha
2020-07-24  9:04   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 06/16] linux: Consolidate fxstatat{64} Adhemerval Zanella via Libc-alpha
2020-07-24  9:14   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 07/16] Linux: Consolidate xmknod Adhemerval Zanella via Libc-alpha
2020-07-24  9:14   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 08/16] Remove internal usage of extensible stat functions Adhemerval Zanella via Libc-alpha
2020-07-24  9:16   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 09/16] Remove stat wrapper functions, move them to exported symbols Adhemerval Zanella via Libc-alpha
2020-07-24  9:23   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 10/16] Remove mknod wrapper functions, move them to symbols Adhemerval Zanella via Libc-alpha
2020-07-23 20:53   ` Joseph Myers
2020-07-23 20:58     ` Adhemerval Zanella via Libc-alpha
2020-07-23 21:01       ` Joseph Myers
2020-07-24  9:25   ` Lukasz Majewski
2020-10-12 22:27   ` Joseph Myers
2020-10-13  0:58     ` Adhemerval Zanella via Libc-alpha
2020-07-23 19:46 ` [PATCH 11/16] linux: Move the struct stat{64} to struct_stat.h Adhemerval Zanella via Libc-alpha
2020-07-24  9:27   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 12/16] linux: Implement {l}fstat{at} in terms of fstatat Adhemerval Zanella via Libc-alpha
2020-07-24  9:29   ` Lukasz Majewski
2020-07-23 19:46 ` [PATCH 13/16] linux: Disentangle fstatat from fxstatat Adhemerval Zanella via Libc-alpha
2020-07-24  9:39   ` Lukasz Majewski
2020-07-24 10:25   ` Florian Weimer via Libc-alpha
2020-07-24 14:39     ` Adhemerval Zanella via Libc-alpha
2020-07-23 19:46 ` [PATCH 14/16] linux: Move {f}xstat{at} to compat symbols Adhemerval Zanella via Libc-alpha
2020-07-24  9:40   ` Lukasz Majewski
2020-10-21  5:21   ` __xstat et al. as compat symbols (was: Re: [PATCH 14/16] linux: Move {f}xstat{at} to compat symbols) Florian Weimer via Libc-alpha
2020-10-21 11:59     ` Adhemerval Zanella via Libc-alpha
2020-10-21 12:57       ` __xstat et al. as compat symbols Florian Weimer via Libc-alpha
2020-10-21 13:09         ` Adhemerval Zanella via Libc-alpha
2020-10-22 10:08           ` Florian Weimer via Libc-alpha
2020-10-22 12:43             ` Adhemerval Zanella via Libc-alpha
2020-10-22 15:37               ` Florian Weimer via Libc-alpha
2020-10-22 16:40                 ` Adhemerval Zanella via Libc-alpha
2020-10-22 18:04                   ` Adhemerval Zanella via Libc-alpha
2020-07-23 19:46 ` [PATCH 15/16] linux: Add {f}stat{at} y2038 support Adhemerval Zanella via Libc-alpha
2020-07-23 20:55   ` Joseph Myers
2020-07-23 21:00     ` Adhemerval Zanella via Libc-alpha
2020-07-24 10:53   ` Lukasz Majewski
2020-07-30 12:42     ` Adhemerval Zanella via Libc-alpha
2020-08-02 19:46       ` Maciej W. Rozycki via Libc-alpha
2020-10-06  9:48   ` Lukasz Majewski
2020-10-07 12:52     ` Adhemerval Zanella via Libc-alpha
2020-10-07 14:25       ` Adhemerval Zanella via Libc-alpha
2020-10-07 20:20         ` Lukasz Majewski
2020-10-07 21:01           ` Adhemerval Zanella via Libc-alpha
2020-10-07 21:07         ` Adhemerval Zanella via Libc-alpha
2020-10-08  7:57           ` Lukasz Majewski
2020-10-09 14:05             ` Adhemerval Zanella via Libc-alpha
2020-10-09 15:39               ` Lukasz Majewski
2020-10-09 20:06                 ` Adhemerval Zanella via Libc-alpha
2020-10-13 13:58         ` Lukasz Majewski
2020-10-13 14:18           ` Adhemerval Zanella via Libc-alpha
2020-10-13 14:23             ` H.J. Lu via Libc-alpha
2020-10-13 14:27               ` Adhemerval Zanella via Libc-alpha
2020-10-13 18:14             ` Adhemerval Zanella via Libc-alpha
2020-10-13 21:20               ` Lukasz Majewski
2020-10-13 21:40             ` Lukasz Majewski
2020-10-14 13:15               ` Lukasz Majewski
2020-10-14 13:39                 ` Adhemerval Zanella via Libc-alpha
2020-07-23 19:46 ` [PATCH 16/16] linux: Move xmknoda{at} to compat symbols Adhemerval Zanella via Libc-alpha
2020-07-24 10:30   ` Florian Weimer via Libc-alpha
2020-07-24 12:34     ` Adhemerval Zanella via Libc-alpha
2020-07-24 12:43       ` Florian Weimer via Libc-alpha
2020-07-24 12:49         ` Adhemerval Zanella via Libc-alpha
2020-07-24 10:43   ` Lukasz Majewski

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=20200724101725.2519f7ed@jawa \
    --to=lukma@denx.de \
    --cc=adhemerval.zanella@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=libc-alpha@sourceware.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).