GNU/Hurd's readlink system call is partly implemented in userspace, which
also allocates a buffer on the stack for the result, and thus needs one
more path.
---
 stdlib/tst-canon-bz26341.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/stdlib/tst-canon-bz26341.c b/stdlib/tst-canon-bz26341.c
index 6d054596b5..0ddd9aed15 100644
--- a/stdlib/tst-canon-bz26341.c
+++ b/stdlib/tst-canon-bz26341.c
@@ -72,10 +72,11 @@ do_realpath (void *arg)
      If realpath uses more than 2 * PATH_MAX plus some slack it will trigger
      a stackoverflow.  */
 
+  const size_t syscall_usage = 1 * PATH_MAX + 1024;
   const size_t realpath_usage = 2 * PATH_MAX + 1024;
   const size_t thread_usage = 1 * PATH_MAX + 1024;
   size_t stack_size = support_small_thread_stack_size ()
-                     - realpath_usage - thread_usage;
+                     - syscall_usage - realpath_usage - thread_usage;
   char stack[stack_size];
   char *resolved = stack + stack_size - thread_usage + 1024;
 
-- 
2.30.2


Reply via email to