bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: truncate: Work around trailing slash bug in truncate() on AIX


From: Bruno Haible
Subject: Re: truncate: Work around trailing slash bug in truncate() on AIX
Date: Sat, 09 Jan 2021 08:22:15 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-197-generic; KDE/5.18.0; x86_64; ; )

> 2021-01-05  Bruno Haible  <bruno@clisp.org>
> 
>       truncate: Work around trailing slash bug in truncate() on AIX 7.2.
>       * m4/truncate.m4 (gl_FUNC_TRUNCATE): Add a test whether truncate
>       rejects trailing slashes. Set REPLACE_TRUNCATE and define
>       TRUNCATE_TRAILING_SLASH_BUG if not.
>       * lib/truncate.c (orig_truncate): New function.
>       (truncate): Add alternative implementation when
>       TRUNCATE_TRAILING_SLASH_BUG is defined.
>       * modules/truncate (Depends-on): Add sys_stat, stat.

Oops, I forgot to document this workaround.


2021-01-09  Bruno Haible  <bruno@clisp.org>

        truncate: Document last workaround.
        * doc/posix-functions/truncate.texi: Document the AIX bug.

diff --git a/doc/posix-functions/truncate.texi 
b/doc/posix-functions/truncate.texi
index 85a4dbe..8ee1fa7 100644
--- a/doc/posix-functions/truncate.texi
+++ b/doc/posix-functions/truncate.texi
@@ -15,6 +15,10 @@ mingw, MSVC 14, Android 4.4 with @code{AC_SYS_LARGEFILE} in 
effect.
 On platforms where @code{off_t} is a 32-bit type, this function is not
 applicable to arbitrary lengths for files larger than 2 GB@.  The fix is to
 use the @code{AC_SYS_LARGEFILE} macro.
+@item
+This function does not fail when the file name argument ends in a slash
+and (without the slash) names a non-directory, on some platforms:
+AIX 7.2.
 @end itemize
 
 Portability problems not fixed by Gnulib:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]