diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2025-03-04 15:13:41 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2025-03-21 15:46:48 -0300 |
commit | 1894e219dc530d7074085e95ffe3c1e66cebc072 (patch) | |
tree | 38f725283bca1b4e545d25f0fbff8308e737979b /stdlib | |
parent | 855561a1fbc601aa6c373c8a036d472cb52786e7 (diff) | |
download | glibc-1894e219dc530d7074085e95ffe3c1e66cebc072.zip glibc-1894e219dc530d7074085e95ffe3c1e66cebc072.tar.gz glibc-1894e219dc530d7074085e95ffe3c1e66cebc072.tar.bz2 |
Remove eloop-threshold.h
On both Linux and Hurd the __eloop_threshold() is always a constant
(40 and 32 respectively), so there is no need to always call
__sysconf (_SC_SYMLOOP_MAX) for Linux case (!SYMLOOP_MAX). To avoid
a name clash with gnulib, rename the new file min-eloop-threshold.h.
Checked on x86_64-linux-gnu and with a build for x86_64-gnu.
Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/canonicalize.c | 6 | ||||
-rw-r--r-- | stdlib/tst-canon-bz26341.c | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/stdlib/canonicalize.c b/stdlib/canonicalize.c index 528bf49..dca6fca 100644 --- a/stdlib/canonicalize.c +++ b/stdlib/canonicalize.c @@ -36,17 +36,19 @@ #include <sys/stat.h> #include <unistd.h> -#include <eloop-threshold.h> #include <filename.h> #include <idx.h> #include <intprops.h> #include <scratch_buffer.h> #ifdef _LIBC +# include <min-eloop-threshold.h> # include <shlib-compat.h> # define GCC_LINT 1 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) #else +# include <eloop-threshold.h> +# define MIN_ELOOP_THRESHOLD __eloop_threshold () # define __canonicalize_file_name canonicalize_file_name # define __realpath realpath # define __strdup strdup @@ -310,7 +312,7 @@ realpath_stk (const char *name, char *resolved, struct realpath_bufs *bufs) } if (0 <= n) { - if (++num_links > __eloop_threshold ()) + if (++num_links > MIN_ELOOP_THRESHOLD) { __set_errno (ELOOP); goto error; diff --git a/stdlib/tst-canon-bz26341.c b/stdlib/tst-canon-bz26341.c index a9b823b..b62b2ca 100644 --- a/stdlib/tst-canon-bz26341.c +++ b/stdlib/tst-canon-bz26341.c @@ -23,7 +23,7 @@ #include <unistd.h> #define __sysconf sysconf -#include <eloop-threshold.h> +#include <min-eloop-threshold.h> #include <support/check.h> #include <support/support.h> #include <support/temp_file.h> @@ -54,7 +54,7 @@ create_link (void) /* Create MAXLINKS symbolic links to the temporary filename. On exit, linkname has the last link created. */ char *prevlink = filename; - int maxlinks = __eloop_threshold (); + int maxlinks = MIN_ELOOP_THRESHOLD; for (int i = 0; i < maxlinks; i++) { linkname = xasprintf ("%s%d", filename, i); |