bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org, Paul Eggert <eggert@cs.ucla.edu>
Cc: bug-gnulib@gnu.org
Subject: [PATCH v2 6/6] stdlib: Assume FACCESSAT_NEVER_EOVERFLOWS on realpath
Date: Mon, 28 Dec 2020 10:59:44 -0300	[thread overview]
Message-ID: <20201228135944.1018303-6-adhemerval.zanella@linaro.org> (raw)
In-Reply-To: <20201228135944.1018303-1-adhemerval.zanella@linaro.org>

The faccessat (..., AT_EACCESS) on Linux fallback will either use
__NR_faccessat for __libc_enable_secure or LFS  fstatat call.  Neither
fallbacks returns EOVERFLOW in failure case.

Checked on x86_64-linux-gnu.
---
 stdlib/canonicalize.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/stdlib/canonicalize.c b/stdlib/canonicalize.c
index 69f978da78..5aac8d457c 100644
--- a/stdlib/canonicalize.c
+++ b/stdlib/canonicalize.c
@@ -44,15 +44,10 @@
 
 #ifdef _LIBC
 # include <shlib-compat.h>
-# include <sysdep.h>
-# ifdef __ASSUME_FACCESSAT2
-#  define FACCESSAT_NEVER_EOVERFLOWS __ASSUME_FACCESSAT2
-# else
-#  define FACCESSAT_NEVER_EOVERFLOWS true
-# endif
 # define GCC_LINT 1
 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
 # define FUNC_REALPATH_WORKS 1
+# define FACCESSAT_NEVER_EOVERFLOWS true
 #else
 # define __canonicalize_file_name canonicalize_file_name
 # define __realpath realpath
@@ -82,7 +77,7 @@
 # define __pathconf pathconf
 # define __rawmemchr rawmemchr
 # define __readlink readlink
-# define __stat stat
+# define FACCESSAT_NEVER_EOVERFLOWS false
 #endif
 
 /* Suppress bogus GCC -Wmaybe-uninitialized warnings.  */
@@ -95,9 +90,6 @@
 #ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
 # define DOUBLE_SLASH_IS_DISTINCT_ROOT false
 #endif
-#ifndef FACCESSAT_NEVER_EOVERFLOWS
-# define FACCESSAT_NEVER_EOVERFLOWS false
-#endif
 
 #if !FUNC_REALPATH_WORKS || defined _LIBC
 
-- 
2.25.1



  parent reply	other threads:[~2020-12-28 14:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28 13:59 [PATCH v2 1/6] Import idx.h from gnulib Adhemerval Zanella
2020-12-28 13:59 ` [PATCH v2 2/6] Import filename.h " Adhemerval Zanella
2020-12-28 13:59 ` [PATCH v2 3/6] malloc: Add scratch_buffer_dupfree Adhemerval Zanella
2020-12-28 13:59 ` [PATCH v2 4/6] stdlib: Sync canonicalize with gnulib [BZ #10635] [BZ #26592] [BZ #26341] [BZ #24970] Adhemerval Zanella
2020-12-28 21:07   ` Paul Eggert
2020-12-28 13:59 ` [PATCH v2 5/6] stdlibc: Simplify realpath via scratch_buffer_dupfree Adhemerval Zanella
2020-12-28 13:59 ` Adhemerval Zanella [this message]
2020-12-28 21:14   ` [PATCH v2 6/6] stdlib: Assume FACCESSAT_NEVER_EOVERFLOWS on realpath Paul Eggert
2020-12-28 21:50     ` 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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=20201228135944.1018303-6-adhemerval.zanella@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=bug-gnulib@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --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).