summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* alloca-opt: Fix warning on mingw.Bruno Haible2020-06-301-6/+9
| | | | | | | | Reported and solution by Eli Zaretskii <eliz@gnu.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-06/msg00069.html>. * lib/alloca.in.h: On mingw, include <alloca.h> and then test again whether alloca is defined.
* getrandom: Fix compilation errors on older versions of mingw.Bruno Haible2020-06-281-1/+10
| | | | | | | | | | Reported by Eli Zaretskii <eliz@gnu.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-06/msg00059.html>. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Test whether <bcrypt.h> exists. * lib/getrandom.c: If <bcrypt.h> is not available, include <ntdef.h> and define/declare BCRYPT_ALG_HANDLE, BCRYPT_USE_SYSTEM_PREFERRED_RNG, BCryptGenRandom ourselves.
* clean-temp: Fix wrong errno in error message.Bruno Haible2020-06-281-1/+2
| | | | | * lib/clean-temp.c (create_temp_dir): Save errno around unblock_fatal_signals call.
* fatal-signal: Make multithread-safe.Bruno Haible2020-06-281-0/+7
| | | | * lib/fatal-signal.c (at_fatal_signal): Don't free the old actions array.
* clean-temp: Don't force deletion of temporary files on native Windows.Bruno Haible2020-06-283-8/+12
| | | | | | | | * lib/clean-temp.h (open_temp, fopen_temp): Add delete_on_close argument. * lib/clean-temp.c (open_temp, fopen_temp): Likewise. * NEWS: Mention the change. * lib/javacomp.c (write_temp_file): Update.
* fatal-signal: Make multithread-safe.Bruno Haible2020-06-271-4/+35
| | | | | | | | | * lib/fatal-signal.c: Include glthread/lock.h. (at_fatal_signal_lock): New variable. (at_fatal_signal): Use it. (fatal_signals_block_lock, fatal_signals_block_counter): New variables. (block_fatal_signals, unblock_fatal_signals): Use them. * modules/fatal-signal (Depends-on): Add lock.
* getloadavg: don’t depend on fopen-gnuPaul Eggert2020-06-271-7/+14
| | | | | | | | This is for Emacs, which does not need fopen-gnu for anything else, and which would need it only on a NetBSD platform where getloadavg does not work (does that even happen?). * lib/getloadavg.c (getloadavg) [__NetBSD__]: Use open, not fopen. * modules/getloadavg (Depends-on): Remove fopen-gnu.
* fopen-gnu: Simplify code.Bruno Haible2020-06-271-16/+13
| | | | | | | * lib/fopen.c: Include <stdbool.h>. (rpl_fopen): Use a single variable open_flags instead of open_flags_standard and open_flags_gnu. Make open_flags_gnu a bool. * modules/fopen (Depends-on): Add stdbool.
* tmpfile: Fix a typo.Bruno Haible2020-06-271-2/+2
| | | | * lib/tmpfile.c: Fix a typo.
* canonicalize: Improve documentation.Bruno Haible2020-06-271-1/+2
| | | | | * lib/canonicalize.h (canonicalize_filename_mode): Document the failure return convention.
* xgetcwd: Improve documentation.Bruno Haible2020-06-271-1/+1
| | | | * lib/xgetcwd.c (xgetcwd): Document the failure return convention.
* getcwd: Improve documentation.Bruno Haible2020-06-271-4/+4
| | | | * lib/getcwd.c (__getcwd): Document the failure return convention.
* fchdir: Improve documentation.Bruno Haible2020-06-271-3/+4
| | | | | * lib/fchdir.c (get_name, _gl_register_fd): Document the failure return convention.
* filenamecat-lgpl: Set errno upon failure.Bruno Haible2020-06-271-10/+12
| | | | | | * lib/filenamecat-lgpl.c (mfile_name_concat): Document the failure return convention. * modules/filenamecat-lgpl (Depends-on): Add malloc-posix.
* areadlink-with-size: Set errno upon failure.Bruno Haible2020-06-272-1/+6
| | | | | | * lib/areadlink-with-size.c (areadlink_with_size): Set errno when malloc fails. * lib/areadlinkat-with-size.c (areadlinkat_with_size): Add comment.
* c-dtoastr, c-ldtoastr: new modulesMarc Nieper-Wißkirchen2020-06-254-6/+29
| | | | | | | | | | | | | | | | | These modules provide the same functionality as the modules dtoastr and ldtoastr except for the formatting taking place in the C locale. * MODULES.html.sh: Add c-dtoastr and c-ldtoastr. * lib/c-dtoastr.c, lib/c-ldtoastr.c: New files. * lib/ftoastr.c: Prefix exported functions when the macro C_LOCALE is defined. Use c_snprintf and c_strtod/c_strtold instead of snprintf and strtod/strtold whhen the macro C_LOCALE is defined. * lib/ftoastr.h: Add prototypes for c_dtoastr and c_ldtoastr. * modules/c-dtoastr, modules/c-dtoastr-tests, modules/c-ldtoastr, modules/c-ldtoastr-tests: New files. * tests/test-c-dtoastr.c, tests/test-c-dtoastr.sh, tests-c-ldtoastr.c tests-c-ldtoastr.sh: New files.
* tzset: Fix compilation warnings on mingw (regression from 2017-05-01).Bruno Haible2020-06-211-0/+3
| | | | * lib/tzset.c: Include <stdlib.h>, <string.h>.
* thread: Avoid possible compiler warnings in uses of gl_thread_exit.Bruno Haible2020-06-171-2/+2
| | | | * lib/glthread/thread.h (gl_thread_exit): Add a cast to void.
* thread, thrd: Avoid a compiler warning.Bruno Haible2020-06-171-1/+1
| | | | * lib/windows-thread.h (glwthread_thread_exit): Mark as non-returning.
* windows-thread: Avoid a compiler warning.Biswapriyo Nath2020-06-172-2/+2
| | | | | | | | * lib/windows-thread.h (glwthread_thread_exit): Change return type to void. * lib/windows-thread.c (glwthread_thread_exit): Likewise. Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
* unictype/joininggroup-name: Fix warning on 64-bit mingw.Bruno Haible2020-06-151-1/+1
| | | | | | | | Reported by Biswapriyo Nath <nathbappai@gmail.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-06/msg00036.html>. * lib/unictype/joininggroup_name.c (ELEM): Cast struct offset to size_t first.
* getloadavg: fix double-increment bugPaul Eggert2020-06-011-1/+1
| | | | | | | | * lib/getloadavg.c (getloadavg): Fix double-increment typo on Linux without glibc, Android, Cygwin. This fixes a bug I introduced in 2011-02-08T20:23:29Z!eggert@cs.ucla.edu. Problem and fix reported by Semen Verchenko in: https://lists.gnu.org/r/bug-gnulib/2020-06/msg00007.html
* tempname: use getrandom, not getentropyPaul Eggert2020-06-011-4/+3
| | | | | | | This removes a dependency, as getentropy depends on getrandom. * lib/tempname.c: Include sys/random.h instead of unistd.h. (RANDOM_BITS) [!_LIBC]: Use getrandom, not getentropy. * modules/tempname (Depends-on): Depend on getrandom, not getentropy.
* tempname: merge from glibc and coreutilsPaul Eggert2020-05-312-139/+145
| | | | | | | | | | | | | | | | | | | | | | | | | Also, merge in Gnulib’s more-recent methods of making it easier to share between Gnulib and glibc, and fix a few randomness glitches. * lib/tempname.c: Include libc-config.h, not config.h, if !_LIBC. (__set_errno): Remove; libc-config.h does that for us. Do not include <sys/time.h>. (__secure_getenv) [_LIBC]: New macro. (__try_tempname, __getpid, __gettimeofday) [!_LIBC]: Remove macros. (RANDOM_BITS): Rewrite. (RANDOM_VALUE_MAX, BASE_62_DIGITS, BASE_62_POWER): New macros. (random_value): New typedef. (try_file, try_dir, try_nocreate): Move up. (gen_tempname_len, try_tempname_len): New functions. (gen_tempname_len): Use a constant array rather than a switch. (try_tempname_len): Don’t assume string length fits in int. Generalize use of RANDOM_BITS. If _LIBC, don’t assume RANDOM_BITS has enough entropy (it’s a bit short). (__gen_tempname): Rewrite in terms of gen_tempname_len. (__try_tempname): Rewrite in terms of try_tempname_len. * lib/tempname.h (gen_tempname_len, try_tempname_len): New decls. * modules/tempname (Depends-on): Remove gettimeofday, sys_time. Add getentropy, libc-config.
* getentropy: Work around a macOS and Solaris problem.Bruno Haible2020-05-311-0/+11
| | | | | | | | | | | | * lib/unistd.in.h: Include <sys/random.h>, when needed for the 'getentropy' module. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize UNISTD_H_HAVE_SYS_RANDOM_H. * m4/sys_random_h.m4 (gl_HEADER_SYS_RANDOM): Set UNISTD_H_HAVE_SYS_RANDOM_H. * modules/unistd (Makefile.am): Substitute UNISTD_H_HAVE_SYS_RANDOM_H. * doc/glibc-functions/getentropy.texi: Document the macOS and Solaris problem. List more platforms.
* fnmatch: merge from glibcPaul Eggert2020-05-313-466/+502
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, merge in Gnulib’s more-recent methods of making it easier to share between Gnulib and glibc. * lib/fnmatch.c: Reorder includes to match glibc better. Include libc-config.h instead of config.h. Include alloca.h only if _LIBC || HAVE_ALLOCA. Do not include "../locale/elem-hash.h" if _LIBC. Define macros for btowc, etc. if _LIBC. All uses simplified. Define FALLTHROUGH if _LIBC, instead of including attribute.h. Include intprops.h, since glibc has it now. (SIZE_MAX): Remove; use (size_t) -1 instead. Omit the "Comment out all this code" ifdef, since Gnulib has never really needed it. (STREQ): Remove; no longer used. (__libc_use_alloca, alloca, alloca_account): Define as needed if !_LIBC. (ISWCTYPE): Remove; all uses replaced by iswctype. (HANDLE_MULTIBYTE): Remove. All uses removed by assuming true. (internal_function): Remove. All uses removed. (STRUCT): New macro. (WIDE_CHAR_VERSION): Define to 0 instead of leaving undefined. (WMEMCMP): New macro. (FINDIDX): Define if _LIBC, and include <locale/weight.h> and <locale/weightwc.h>. (fnmatch): Prefer __glibc_likely and __glibc_unlikely to __builtin_expect. Check for integer overflow more systematically. Account for alloca storage better when recursive. Use strnlen instead of strlen for efficiency. * lib/fnmatch_loop.c: Include stdint.h if _LIBC, for int32_t etc. (struct STRUCT): New type. (FCT, EXT): New ENDS and ALLOCA_USED args. All callers changed. (FCT): Prefer __glibc_unlikely to __builtin_expect. Simplify by assuming WIDE_CHAR_SUPPORT. Copy _LIBC code from glibc without worrying Gnulib compatibility. Cast cold to UCHAR to avoid signedness warning. (END): Check for invalid pattern. (EXT): Improve alloca/malloc checking (taken from glibc), and improve it some more by using intprops.h and checking for integer overflow and using bool for booleans. * lib/libc-config.h (compat_symbol): New macro. (versioned_symbol): Make it ‘extern int dummy’ so that it’s acceptable to non-GCC when a trailing semicolon is added. * modules/fnmatch (Depends-on): Add alloca-opt, intprops, libc-config, strnlen. Remove alloca.
* getrandom: Doc and test tweaks.Bruno Haible2020-05-311-1/+2
| | | | | | | | | | | | * lib/getrandom.c (getrandom): Mention that it never returns 0, and that it sets errno when failing. * tests/test-getrandom.c (main): Disable the high-quality check on those platforms on which it fails. * doc/glibc-functions/getrandom.texi: Add Minix, AIX, HP-UX, IRIX, Cygwin to the list of platforms that don't have the function. Add a note about the quality of the result. * doc/glibc-headers/sys_random.texi: Don't mention the 'getrandom' declaration; this is fixed by module 'getrandom'.
* getrandom: Add support for native Windows.Bruno Haible2020-05-311-2/+102
| | | | | | | | | | | | | | | | | | | | | | | | | * lib/getrandom.c: Include <errno.h>, <windows.h>, <bcrypt.h>, <wincrypt.h>. (CRYPT_VERIFY_CONTEXT): New macro. (LoadLibrary, CryptAcquireContext): Redirect to the variant with suffix 'A'. (GetProcAddress): New macro. (BCryptGenRandomFuncType): New type. (BCryptGenRandomFunc, initialized): New variables. (initialize): New function. (getrandom): On native Windows, use <bcrypt.h> API when available, and <wincrypt.h> API as fallback. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Set LIB_GETRANDOM. * modules/getrandom (Link): New section. * modules/getentropy (Link): Likewise. * modules/getrandom-tests (Makefile.am): Link test-getrandom against $(LIB_GETRANDOM). * modules/getentropy-tests (Makefile.am): Link test-getentropy against $(LIB_GETRANDOM). * modules/sys_random-c++-tests (Makefile.am): Link test-sys_random-c++ against $(LIB_GETRANDOM). * doc/glibc-functions/getrandom.texi: Mention the native Windows support.
* getrandom: Simplify the determination of the random number devices.Bruno Haible2020-05-311-0/+19
| | | | | | | | | Suggested by Paul Eggert in <https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00383.html>. * lib/getrandom.c (NAME_OF_RANDOM_DEVICE, NAME_OF_NONCE_DEVICE): New macros. * modules/getrandom (Depends-on): Remove crypto/gc-random.
* list: fix GCC warningsAkim Demaille2020-05-314-17/+23
| | | | | | | | | | | | | * lib/gl_anytree_list2.h (gl_tree_iterator_free) (gl_tree_next_node, gl_tree_node_nx_set_value) (gl_tree_previous_node, gl_tree_next_node): Mark unused arguments. * lib/gl_anytree_oset.h (gl_tree_iterator_free): Likewise. * lib/gl_anylinked_list2.h (gl_linked_node_value) (gl_linked_node_nx_set_value, gl_linked_iterator_free): Likewise. * lib/gl_anytreehash_list2.h (gl_tree_search_from_to): Avoid using the same variable name in nested scopes.
* list-c++, set-c++, oset-c++, map-c++, omap-c++: Don't fool the compiler.Bruno Haible2020-05-315-6/+50
| | | | | | | | | | | Reported by Akim Demaille in <https://lists.gnu.org/archive/html/bug-bison/2020-05/msg00102.html>. * lib/gl_list.hh (gl_List::iterator::next): Avoid a reinterpret_cast. * lib/gl_set.hh (gl_Set::iterator::next): Likewise. * lib/gl_oset.hh (gl_OSet::iterator::next): Likewise. * lib/gl_map.hh (gl_Map::iterator::next): Likewise. * lib/gl_omap.hh (gl_OMap::iterator::next): Likewise.
* wmempcpy: New module.Bruno Haible2020-05-312-0/+51
| | | | | | | | | | | | | | | | | Reported by Paul Eggert in <https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00387.html>. * lib/wchar.in.h (wmempcpy): New declaration. * lib/wmempcpy.c: New file. * m4/wmempcpy.m4: New file. * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wmempcpy is declared. (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WMEMPCPY, HAVE_WMEMPCPY. * modules/wchar (Makefile.am): Substitute GNULIB_WMEMPCPY, HAVE_WMEMPCPY. * modules/wmempcpy: New file. * tests/test-wchar-c++.cc: Check the signature of wmempcpy. * doc/glibc-functions/wmempcpy.texi: Mention the new module. * modules/mempcpy (Description): Fix typo.
* sys_random: Work around macOS bug.Bruno Haible2020-05-311-0/+8
| | | | | | | | | * m4/sys_random_h.m4 (gl_HEADER_SYS_RANDOM): Include <sys/types.h> and <stdlib.h> before <sys/random.h>. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Likewise. * lib/sys_random.in.h: On macOS, include <sys/types.h> and <stdlib.h> first. * doc/glibc-headers/sys_random.texi: Mention the macOS problem.
* getrandom: Override incompatible system function on Solaris 11.Bruno Haible2020-05-302-3/+21
| | | | | | | | | | | | | | | | * lib/sys_random.in.h (getrandom): Override if REPLACE_GETRANDOM is 1. * lib/getrandom.c (getrandom): When the system has getrandom, just invoke it. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Set REPLACE_GETRANDOM if the system's getrandom function's prototype is not the expected one. * m4/sys_random_h.m4 (gl_SYS_RANDOM_H_DEFAULTS): Initialize REPLACE_GETRANDOM. * modules/sys_random (Makefile.am): Substitute REPLACE_GETRANDOM. * modules/getrandom (modules/getrandom): Consider REPLACE_GETRANDOM. * tests/test-getrandom.c (main): Allow error EINVAL as an alternative to EAGAIN. * doc/glibc-functions/getrandom.texi: Mention the new module and the Solaris problem.
* sys_random: New module.Bruno Haible2020-05-301-5/+68
| | | | | | | | | | | | | | | * lib/sys_random.in.h: Use the common idioms for overridable header files. * m4/sys_random_h.m4: New file. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Require gl_SYS_RANDOM_H_DEFAULTS. * modules/sys_random: New file. * modules/getrandom (Files): Remove lib/sys_random.in.h. (Depends-on): Add sys_random. (configure.ac): Use gl_SYS_RANDOM_MODULE_INDICATOR, not gl_UNISTD_MODULE_INDICATOR. (Makefile.am): Don't generate sys/random.h here. * doc/glibc-headers/sys_random.texi: New file. * doc/gnulib.texi: Include it.
* unistd: Remove conflicting declaration of getrandom().Bruno Haible2020-05-301-18/+0
| | | | | | | | | | * lib/unistd.in.h (getrandom): Remove declaration. * m4/unistd_h.m4 (gl_UNISTD_H): Don't test whether getrandom is declared. (gl_UNISTD_H_DEFAULTS): Don't initialize GNULIB_GETRANDOM, HAVE_GETRANDOM. * modules/unistd (Makefile.am): Don't substitute GNULIB_GETRANDOM, HAVE_GETRANDOM.
* Don't assume that UNICODE is not defined.Bruno Haible2020-05-3039-27/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many Windows API functions are defined differently (redirecting to a function with suffix 'W') if the application defines the macro UNICODE than by default (redirecting to a function with suffix 'A'). * lib/clean-temp.c (OSVERSIONINFO, GetVersionEx): Redirect to the variant with suffix 'A'. * lib/dirent-private.h (WIN32_FIND_DATA): Likewise. * lib/gc-gnulib.c (CryptAcquireContext): Likewise. * lib/getaddrinfo.c (GetModuleHandle): Likewise. * lib/getlogin.c (GetUserName): Likewise. * lib/getlogin_r.c (GetUserName): Likewise. * lib/gettimeofday.c (LoadLibrary): Likewise. * lib/isatty.c (LoadLibrary, QueryFullProcessImageName): Likewise. * lib/link.c (GetModuleHandle, CreateHardLink): Likewise. * lib/localename.c (GetLocaleInfo, EnumSystemLocales): Likewise. * lib/mountlist.c (GetDriveType): Likewise. * lib/nonblocking.c (GetNamedPipeHandleState): Likewise. * lib/opendir.c (WIN32_FIND_DATA, GetFullPathName, FindFirstFile): Likewise. * lib/physmem.c (GetModuleHandle): Likewise. * lib/poll.c (GetModuleHandle, PeekConsoleInput, CreateEvent, PeekMessage, DispatchMessage): Likewise. * lib/progreloc.c (GetModuleFileName): Likewise. * lib/putenv.c (SetEnvironmentVariable): Likewise. * lib/read.c (GetNamedPipeHandleState): Likewise. * lib/readdir.c (FindNextFile): Likewise. * lib/relocatable.c (GetModuleFileName): Likewise. * lib/rename.c (MoveFileEx): Likewise. * lib/rewinddir.c (FindFirstFile): Likewise. * lib/select.c (GetModuleHandle, PeekConsoleInput, CreateEvent, PeekMessage, DispatchMessage): Likewise. * lib/sethostname.c (GetComputerNameEx, SetComputerNameEx): Likewise. * lib/socket.c (WSASocket): Likewise. * lib/stat-w32.c (LoadLibrary, GetFinalPathNameByHandle): Likewise. * lib/stat.c (WIN32_FIND_DATA, CreateFile, FindFirstFile): Likewise. * lib/stdio-read.c (GetNamedPipeHandleState): Likewise. * lib/stdio-write.c (GetNamedPipeHandleState): Likewise. * lib/tmpdir.c (GetTempPath): Likewise. * lib/tmpfile.c (OSVERSIONINFO, GetVersionEx, GetTempPath): Likewise. * lib/uname.c (OSVERSIONINFO, GetVersionEx): Likewise. * lib/utime.c (CreateFile, GetFileAttributes): Likewise. * lib/windows-cond.c (CreateEvent): Likewise. * lib/windows-rwlock.c (CreateEvent): Likewise. * lib/windows-timedmutex.c (CreateEvent): Likewise. * lib/windows-timedrecmutex.c (CreateEvent): Likewise. * lib/windows-timedrwlock.c (CreateEvent): Likewise. * lib/write.c (GetNamedPipeHandleState): Likewise.
* physmem: Fix compilation errors on MSVC.Bruno Haible2020-05-301-1/+1
| | | | | * lib/physmem.c (PFN_MS_EX): Use BOOL, not WINBOOL. * modules/physmem (Depends-on): Add unistd.
* fnmatch: Rely on more gnulib modules.Bruno Haible2020-05-301-57/+23
| | | | | | | | | | * modules/fnmatch (Depends-on): Add btowc, isblank, iswctype, wmemchr, wmempcpy, mempcpy. * lib/fnmatch.c: Assume that HAVE_WCTYPE_H, HAVE_BTOWC, HAVE_ISWCTYPE, HAVE_WMEMCHR, HAVE_WMEMPCPY, HAVE_ISBLANK, HAVE_DECL_ISBLANK, HAVE_MEMPCPY are all 1. * m4/fnmatch.m4 (gl_PREREQ_FNMATCH): Don't test for btowc, isblank, iswctype, mempcpy, wmemchr, wmemcpy, wmempcpy, <wctype.h>.
* Avoid dynamic lookup of Windows API functions when possible.Bruno Haible2020-05-292-4/+44
| | | | | | | | | | * lib/getaddrinfo.c (GetProcAddress, getaddrinfo_func, freeaddrinfo_func, getnameinfo_func, getaddrinfo_ptr, freeaddrinfo_ptr, getnameinfo_ptr): Don't define in a build for Windows XP or higher. (use_win32_p): Define differently. * lib/link.c (GetProcAddress, CreateHardLinkFuncType, CreateHardLinkFunc, initialized, initialize): Don't define in a build for Windows XP or higher.
* read-file: disable buffering if RF_SENSITIVE is setDaiki Ueno2020-05-291-2/+8
| | | | | | | * lib/read-file.c (read_file): Call setvbuf if RF_SENSITIVE. Suggested by Glenn Strauss. (fread_file): Suggest calling setvbuf before calling this function. Suggested by Bruno Haible.
* Fix compilation error on native Windows (regression from 2020-05-28).Bruno Haible2020-05-293-0/+14
| | | | | | | | | | | Reported by Daiki Ueno. * lib/gettimeofday.c (GetSystemTimePreciseAsFileTimeFunc): Define as macro when not using dynamic loading. * lib/isatty.c (GetNamedPipeClientProcessIdFunc, QueryFullProcessImageNameFunc): Likewise. * lib/stat-w32.c (GetFileInformationByHandleExFunc, GetFinalPathNameByHandleFunc): Likewise.
* Avoid dynamic loading of Windows API functions when possible.Bruno Haible2020-05-293-10/+28
| | | | | | | | | | | | | | | | | Reported by Steve Lhomme <robux4@ycbcr.xyz> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00182.html>. * lib/gettimeofday.c (GetProcAddress, GetSystemTimePreciseAsFileTimeFuncType, GetSystemTimePreciseAsFileTimeFunc, initialized, initialize): Don't define in a build for Windows 8 or higher. * lib/isatty.c (GetProcAddress, GetNamedPipeClientProcessIdFuncType, GetNamedPipeClientProcessIdFunc, QueryFullProcessImageNameFuncType, QueryFullProcessImageNameFunc, initialized, initialize): Don't define in a build for Windows Vista or higher. * lib/stat-w32.c (GetProcAddress, GetFileInformationByHandleExFuncType, GetFileInformationByHandleExFunc, GetFinalPathNameByHandleFuncType, GetFinalPathNameByHandleFunc, initialized, initialize): Likewise.
* Fix build errors due to read-file changes (regression from 2020-05-27).Bruno Haible2020-05-281-2/+2
| | | | | | | | | * lib/git-merge-changelog.c (read_changelog_file): Update read_file invocation. * tests/test-sameacls.c (main): Likewise. * tests/test-pipe-filter-gi1.c (main): Call read_file instead of read_binary_file. * tests/test-pipe-filter-ii1.c (main): Likewise.
* fts: Make more robust in multithreaded applications.Bruno Haible2020-05-281-1/+1
| | | | | * lib/fts.c (fts_open): Pass an O_CLOEXEC flag to open(). * modules/fts (Depends-on): Add 'open'.
* relocatable-prog: Make more robust in multithreaded applications.Bruno Haible2020-05-281-4/+9
| | | | | | | * lib/progreloc.c (O_CLOEXEC): Define fallback to 0 when use from module relocatable-prog-wrapper. (find_executable): Pass an O_CLOEXEC flag to open(). * modules/relocatable-prog (Depends-on): Add 'open'.
* getloadavg: Make more robust in multithreaded applications.Bruno Haible2020-05-281-19/+3
| | | | | | * lib/getloadavg.c (getloadavg): Pass an O_CLOEXEC flag to open(). Simplify use of O_CLOEXEC. * modules/getloadavg (Depends-on): Add 'open'.
* vma-iter: Make more robust in multithreaded applications.Bruno Haible2020-05-281-8/+8
| | | | | | * lib/vma-iter.c (rof_open, vma_iterate): Pass an O_CLOEXEC flag to open(). * modules/vma-iter (Depends-on): Add 'open'.
* truncate: Make more robust in multithreaded applications.Bruno Haible2020-05-281-2/+2
| | | | * lib/truncate.c (truncate): Pass an O_CLOEXEC flag to open().
* pagealign_alloc: Make more robust in multithreaded applications.Bruno Haible2020-05-281-1/+1
| | | | | | * lib/pagealign_alloc.c (pagealign_alloc): Pass an O_CLOEXEC flag to open(). * modules/pagealign_alloc (Depends-on): Add 'open'.