[PATCH v4] posix: Sync tempname with gnulib

Bruno Haible bruno@clisp.org
Tue Apr 9 22:20:37 GMT 2024


Hi Adhemerval,

Just a few comments, concentrating on the differences between gnulib
and glibc.

> The 044bf893ac removed __path_search, which is now moved to another
> gnulib shared files (stdio-common/tmpdir.{c,h}) and this patch
> also fixes direxists to use __stat64_time64 instead of __xstat64.

Thanks; I now see that I had suggested this in
<https://lists.gnu.org/r/bug-gnulib/2022-08/msg00077.html>.

1) In gnulib, tmpdir.h and tmpdir.c are under LGPLv3+.
   For glibc, the license header needs to be changed to LGPLv2+.
   That is

     s/version 3/version 2.1/

   But before doing this, you need to get permission to do it.
   Since the copyright header says "(C) FSF", you need to ask the FSF's
   copyright clerk for this permission. Last I tried, this process is
   very VERY *VERY* slow.
   Alternatively, you can ask the contributors of significant changes
   for their permission.
   - For tmpdir.h, on its way
     gettext/lib/tmpdir.h -> gettext/gettext-tools/lib/tmpdir.h -> gnulib/lib/tmpdir.h
     that's only me. (I checked the git history.)
   - For tmpdir.c, on its way
     glibc/sysdeps/posix/tempname.c -> gettext/lib/tmpdir.c ->
     gettext/gettext-tools/lib/tmpdir.c -> gnulib/lib/tmpdir.c
     that's only me (2011-08-23) and Paul Eggert (2013-07-15).
     (I checked the git history.)

   I hereby give the permission to relax the license of tmpdir.[hc]
   to LGPLv2+.

   Paul, do you do the same?

2) In tmpdir.c: Please conditionalize the
     #include "pathmax.h"
   with
     #ifndef _LIBC
   not
     #if defined _WIN32 && ! defined __CYGWIN__
   so that this change can be merged back to gnulib.

3) In sysdeps/posix/tempname.c:

+#if !_LIBC
   *r = mix_random_values (v, clock ());
+#endif

   How about adding a comment here?

  /* In glibc, clock_gettime is expected to always succeed.  */
+#if !_LIBC
   *r = mix_random_values (v, clock ());
+#endif


Bruno





More information about the Libc-alpha mailing list