]> Savannah Git Hosting - gnulib.git/commitdiff
getusershell: Optimize stdio accesses when possible.
authorBruno Haible <bruno@clisp.org>
Sun, 7 Mar 2021 01:21:49 +0000 (02:21 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 7 Mar 2021 10:01:57 +0000 (11:01 +0100)
* lib/getusershell.c: Test GNULIB_GETUSERSHELL_SINGLE_THREAD instead of
USE_UNLOCKED_IO.
* modules/getusershell (Depends-on): Add unlocked-io-internal.
* doc/multithread.texi: Document GNULIB_GETUSERSHELL_SINGLE_THREAD.

ChangeLog
doc/multithread.texi
lib/getusershell.c
modules/getusershell

index 80d97a0f0594572d7e7cfc420ebb50ac7fedbfc2..d6e8d542de6b6146cc64c9c696b3b40f4a13ca69 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2021-03-06  Bruno Haible  <bruno@clisp.org>
+
+       getusershell: Optimize stdio accesses when possible.
+       * lib/getusershell.c: Test GNULIB_GETUSERSHELL_SINGLE_THREAD instead of
+       USE_UNLOCKED_IO.
+       * modules/getusershell (Depends-on): Add unlocked-io-internal.
+       * doc/multithread.texi: Document GNULIB_GETUSERSHELL_SINGLE_THREAD.
+
 2021-03-06  Bruno Haible  <bruno@clisp.org>
 
        unlocked-io-internal: New module.
index 7fe19a781791af5e5b23c52a0e932bc2fd763e8d..a63d3ee0fa6c6ab1f49866a34e304f8e1b8b799f 100644 (file)
@@ -274,4 +274,8 @@ You may define the C macro @code{GNULIB_WCHAR_SINGLE}, if all the programs in
 your package are single-threaded and won't change the locale after it has
 been initialized.  This macro optimizes the functions @code{mbrtowc} and
 @code{wcwidth}.
+@item
+You may define the C macro @code{GNULIB_GETUSERSHELL_SINGLE_THREAD}, if all the
+programs in your package invoke the functions @code{setusershell},
+@code{getusershell}, @code{endusershell} only from a single thread.
 @end itemize
index 6ae941052d5369690de865075a34d18879868c12..be8a068455e6c3dbb1bc2328e69eb0f6711fabe0 100644 (file)
@@ -39,7 +39,7 @@
 #include "stdio--.h"
 #include "xalloc.h"
 
-#if USE_UNLOCKED_IO
+#if GNULIB_GETUSERSHELL_SINGLE_THREAD
 # include "unlocked-io.h"
 #endif
 
index 26f99e58cadecc1839668e717ad446327f9dbf58..ed2f30f3c50d818d41329e0051e3fa90137e5a94 100644 (file)
@@ -8,8 +8,9 @@ m4/getusershell.m4
 Depends-on:
 unistd
 extensions
-fopen-safer     [test $HAVE_GETUSERSHELL = 0]
-xalloc          [test $HAVE_GETUSERSHELL = 0]
+fopen-safer          [test $HAVE_GETUSERSHELL = 0]
+unlocked-io-internal [test $HAVE_GETUSERSHELL = 0]
+xalloc               [test $HAVE_GETUSERSHELL = 0]
 
 configure.ac:
 gl_FUNC_GETUSERSHELL