| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* tests/test-calloc-gnu.c (main): Mark the pointer variable as
'volatile', to defeat compiler optimizations.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tests/test-getrandom.c (main): Omit assertion that
getrandom (b, sizeof b, GRND_RANDOM | GRND_NONBLOCK) < sizeof b
when b’s size is 100000. This assertion fails with Linux kernel
5.6.13, as that kernel ignores the GRND_RANDOM flag.
The separate blocking pool is going away in the Linux kernel, and
they’ve added a flag GRND_INSECURE instead; see:
https://lore.kernel.org/linux-api/705c5a091b63cc5da70c99304bb97e0109be0a26.1577088521.git.luto@kernel.org/
The assertion was iffy anyway; what’s to prevent a kernel from
lazily filling a large buffer with random bytes?
|
|
|
|
| |
* tests/test-read-file.c (test_read_file): Now static.
|
|
|
|
|
| |
* tests/test-getentropy.c (main): Add one more test.
* tests/test-unistd-c++.cc: Check the signature of getentropy.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
* tests/test-sys_random-c++.cc: New file.
* modules/sys_random-c++-tests: New file.
* modules/sys_random-tests (Depends-on): Depend on it.
|
|
|
|
|
| |
* tests/test-sys_random.c: New file.
* modules/sys_random-tests: New file.
|
|
|
|
|
| |
* tests/test-getrandom.c: New file.
* modules/getrandom-tests: New file.
|
|
|
|
| |
* tests/test-fopen-gnu.c (DATA): Use safer escape sequence.
|
|
|
|
|
|
| |
* tests/test-explicit_bzero.c: Now noinline.
Suggested by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2020-05/msg00300.html
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
* lib/fopen.c (rpl_fopen): Pass O_BINARY to open, if a 'b' flag is
specified on Windows.
* tests/test-fopen-gnu.c (DATA): New define.
(main): Add test for reading binary files with an 'e' flag.
|
|
|
|
|
|
|
|
|
|
| |
* lib/read-file.h (RF_SENSITIVE): New define.
* lib/read-file.c (fread_file, read_file): Take into account of
RF_SENSITIVE flag.
* modules/read-file (Depends-on): Add explicit_bzero.
This adds an alternative behavior of those functions to explicitly
clear the internal memory block when it becomes unused. This is
useful for reading sensitive information from a file.
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/read-file.h (RF_BINARY): New define.
(fread_file, read_file): Take FLAGS argument.
(read_binary_file): Remove.
* lib/read-file.c (internal_read_file): Merge into ...
(read_file): ... here.
* modules/read-file-tests (Files): Add "tests/macros.h".
* tests/test-read-file.c (main): Refactor using ASSERT macro.
* NEWS: Mention this change.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* MODULES.html.sh (func_all_modules):
* lib/unistd.in.h (getentropy, getrandom):
* m4/unistd_h.m4 (gl_UNISTD_H, gl_UNISTD_H_DEFAULTS):
* modules/unistd (unistd.h):
Add support for getentropy, getrandom.
* doc/glibc-functions/getentropy.texi (getentropy):
* doc/glibc-functions/getrandom.texi (getrandom):
These are now fixed on some platforms.
* lib/getentropy.c, lib/getrandom.c, lib/sys_random.in.h:
* m4/getentropy.m4, m4/getrandom.m4:
* modules/getentropy, modules/getentropy-tests:
* modules/getrandom, modules/getrandom-tests:
* tests/test-getentropy.c, tests/test-getrandom.c:
New files.
|
|
|
|
|
| |
* tests/test-explicit_bzero.c (do_secret_stuff, test_stack):
Now static.
|
|
|
|
|
| |
* tests/test-fopen-gnu.c: New file.
* modules/fopen-gnu-tests: New file.
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/open.c (open): When have_cloexec is still undecided, do pass a
O_CLOEXEC flag to orig_open.
* lib/openat.c (rpl_openat): When have_cloexec is still undecided, do
pass a O_CLOEXEC flag to orig_openat.
* tests/test-open.h (test_open): Verify that O_CLOEXEC is honoured.
* modules/open-tests (Depends-on): Add fcntl.
* modules/openat-tests (Depends-on): Likewise.
* modules/fcntl-safer-tests (Depends-on): Likewise.
|
|
|
|
|
|
| |
* lib/fopen.c (rpl_fopen): Parse the mode string. Recognize "r+" as a
write access. Pass the right flags to open().
* tests/test-fopen.h (test_fopen): Add a few more tests on directories.
|
|
|
|
|
|
|
| |
* m4/gnulib-common.m4 (gl_COMMON_BODY): Fix a typo.
* tests/test-ignore-value.c: Include attribute.h.
(_GL_ATTRIBUTE_RETURN_CHECK): Remove macro. Use NODISCARD instead.
* modules/ignore-value-tests (Depends-on): Add attribute.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Suggested by Marc Nieper-Wißkirchen <marc.nieper+gnu@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-04/msg00092.html>.
* lib/gl_list.h (struct gl_list_implementation): Add fields
remove_first, remove_last.
(gl_list_remove_first, gl_list_remove_last): New functions.
* lib/gl_array_list.c (gl_array_remove_first, gl_array_remove_last): New
functions, based on gl_array_remove_at.
(gl_array_list_implementation): Implement the new operations.
* lib/gl_carray_list.c (gl_carray_remove_first, gl_carray_remove_last):
New functions, based on gl_carray_remove_at.
(gl_carray_list_implementation): Implement the new operations.
* lib/gl_anylinked_list2.h (gl_linked_remove_first,
gl_linked_remove_last): New functions, based on gl_linked_remove_at.
* lib/gl_linked_list.c (gl_linked_list_implementation): Implement the
new operations.
* lib/gl_linkedhash_list.c (gl_linkedhash_list_implementation):
Likewise.
* lib/gl_anytree_list2.h (gl_tree_remove_first, gl_tree_remove_last):
New functions, based on gl_tree_remove_at.
* lib/gl_avltree_list.c (gl_avltree_list_implementation): Implement the
new operations.
* lib/gl_avltreehash_list.c (gl_avltreehash_list_implementation):
Likewise.
* lib/gl_rbtree_list.c (gl_rbtree_list_implementation): Likewise.
* lib/gl_rbtreehash_list.c (gl_rbtreehash_list_implementation):
Likewise.
* lib/gl_sublist.c (gl_sublist_remove_first, gl_sublist_remove_last):
New functions, based on gl_sublist_remove_at.
(gl_sublist_list_implementation): Implement the new operations.
* lib/gl_list.hh (class gl_List): Add methods remove_first,
remove_last.
* tests/test-array_list.c (main): Test also gl_list_remove_first and
gl_list_remove_last.
* tests/test-avltree_list.c (main): Likewise.
* tests/test-avltreehash_list.c (main): Likewise.
* tests/test-carray_list.c (main): Likewise.
* tests/test-linked_list.c (main): Likewise.
* tests/test-linkedhash_list.c (main): Likewise.
* tests/test-rbtree_list.c (main): Likewise.
* tests/test-rbtreehash_list.c (main): Likewise.
|
|
|
|
|
|
|
|
|
| |
* tests/test-posix_spawn5.c: Include findprog.h.
(test): New function, extracted from main.
(main): Invoke it. Also, invoke it with a program name such as
"bin/pwd".
* modules/posix_spawn_file_actions_addfchdir-tests (Depends-on): Add
findprog.
|
|
|
|
|
|
|
|
|
| |
* tests/test-posix_spawn4.c: Include findprog.h.
(test): New function, extracted from main.
(main): Invoke it. Also, invoke it with a program name such as
"bin/pwd".
* modules/posix_spawn_file_actions_addchdir-tests (Depends-on): Add
findprog.
|
|
|
|
|
|
|
|
|
| |
Some implementation could add canaries after free failling the test.
* tests/test-explicit_bzero.c (test_heap): Handle implementations of
free() that overwrite the memory with canaries.
Signed-off-by: Bastien Roucariès <rouca@debian.org>
|
|
|
|
|
| |
* tests/test-explicit_bzero.c: New file.
* modules/explicit_bzero-tests: New file.
|
|
|
|
|
|
|
|
|
|
|
| |
Induce the changes by running this:
re='by perl'; g grep -l "$re"|xargs perl -pi -e "s/$re/by perl/"
* build-aux/announce-gen: Change "by perl" to "by perl".
* build-aux/gitlog-to-changelog: Likewise.
* build-aux/prefix-gnulib-mk: Likewise.
* build-aux/update-copyright: Likewise.
* build-aux/useless-if-before-free: Likewise.
* tests/test-update-copyright.sh: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are split from fchmodat, fchownat. GNU Emacs needs the
POSIX-specified fchmodat, but not the gnulib-specified chmodat and
lchmodat. Split the latter two into a new module chmodat.
Similarly for fchownat. This the same basic idea for why statat
was split from fstatat on 2013-01-23.
* lib/chmodat.c, lib/openat.h (CHMODAT_INLINE):
Rename from FCHMODAT_INLINE. All uses changed.
* lib/chownat.c, lib/openat.h (CHOWNAT_INLINE):
Rename from FCHOWNAT_INLINE. All uses changed.
* lib/openat.h:
(chownat, lchownat): Define if GNULIB_CHOWNAT, not GNULIB_FCHOWNAT.
(chmodat, lchmodat): Define if GNULIB_CHMODAT, not GNULIB_FCHMODAT.
* modules/chmodat, modules/chownat, tests/test-chownat.c: New files.
* modules/fchmodat (Files:): Remove lib/fchmodat.c.
(configure.ac): Remove fchmodat module indicator.
(Makefile.am): Omit chmodat.c.
(Maintainer): Add self.
* modules/fchownat: Similarly, but for chown.
* tests/test-fchownat.c (BASE): Don't define if already defined.
(do_chown, do_lchown) [!TEST_CHOWNAT]: Test fchownat instead.
|
|
|
|
|
|
|
|
|
|
| |
Reported by Christian Biesinger in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-02/msg00064.html>.
* lib/wctype.in.h (iswdigit, iswxdigit): Don't declare if the
corresponding module is not enabled.
* tests/test-wctype-h-c++.cc (iswdigit, iswxdigit): Don't check the
prototype if the corresponding module is not enabled.
|
|
|
|
| |
* tests/test-ptsname_r.c: Don't include null-ptr.h if we don't need it.
|
|
|
|
|
| |
* tests/test-lchmod.c: New file.
* modules/lchmod-tests: New file.
|
|
|
|
|
|
| |
* tests/test-fchmodat.c (BASE): New macro.
(main): Use it, to avoid conflicts with other unit tests. Verify that
fchmodat changed the file permission bits.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix lchmod, and fchmodat with AT_SYMLINK_NOFOLLOW, so that
they act like chmod on non-symlinks.
* NEWS:
* doc/glibc-functions/lchmod.texi (lchmod):
* doc/posix-functions/fchmodat.texi (fchmodat):
Mention this.
* lib/fchmodat.c: Define __need_system_sys_stat_h before including
config.h, and undef it after including sys/stat.h the first time.
Include fcntl.h, stdio.h, unistd.h, intprops.h, and include
sys/stat.h a second time after defining orig_fchmodat.
(orig_fchmodat) [HAVE_FCHMODAT]: New function.
(fchmodat) [HAVE_FCHMODAT]: Work around the AT_SYMLINK_NOFOLLOW bug.
* lib/lchmod.c: New file.
* lib/sys_stat.in.h (fchmodat, lchmod):
Support replacing these functions.
* m4/fchmodat.m4 (gl_FUNC_FCHMODAT): If fchmodat exists,
test that AT_SYMLINK_NOFOLLOW works on non-symlinks.
* m4/lchmod.m4 (gl_FUNC_LCHMOD): Check for lstat.
Test that lchmod works on non-symlinks.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS):
Default REPLACE_FCHMODAT and REPLACE_LCHMOD to 0.
* modules/fchmodat (Depends-on): Add fstatat, intprops, lchmod, unistd.
(Depends-on, configure.ac): Check REPLACE_FCHMODAT too.
* modules/lchmod (Files): Add lib/lchmod.c.
(Depends-on): Add errno, fcntl-h, fchmodat, intprops, lstat, unistd.
(configure.ac): Compile lchmod.c if needed.
(lib_SOURCES): Add lchmod.c.
* modules/sys_stat (sys/stat.h): Substitute REPLACE_FCHMODAT
and REPLACE_LCHMOD.
* tests/test-fchmodat.c: Include fcntl.h, sys/stat.h.
(main): Test fchmodat with AT_SYMLINK_NOFOLLOW on non-symlinks.
|
|
|
|
|
|
|
|
| |
* tests/test-canonicalize.c: Protect the inclusion of null-ptr.h
with the same guard as that used to protect usage of the null_ptr
function, so that one doesn't get a -Wunused warning
about the function being defined but unused.
* tests/test-canonicalize-lgpl.c: Likewise.
|
|
|
|
|
| |
* tests/test-omap-c++.cc: New file.
* modules/omap-c++-tests: New file.
|
|
|
|
|
| |
* tests/test-map-c++.cc: New file.
* modules/map-c++-tests: New file.
|
|
|
|
|
| |
* tests/test-oset-c++.cc: New file.
* modules/oset-c++-tests: New file.
|
|
|
|
|
| |
* tests/test-set-c++.cc: New file.
* modules/set-c++-tests: New file.
|
|
|
|
|
| |
* tests/test-list-c++.cc: New file.
* modules/list-c++-tests: New file.
|
|
|
|
|
|
| |
* tests/test-c32isxdigit.c: New file, based on tests/test-iswxdigit.c.
* tests/test-c32isxdigit.sh: New file.
* modules/c32isxdigit-tests: New file.
|
|
|
|
|
|
| |
* tests/test-c32isupper.c: New file.
* tests/test-c32isupper.sh: New file.
* modules/c32isupper-tests: New file.
|
|
|
|
|
|
| |
* tests/test-c32isspace.c: New file.
* tests/test-c32isspace.sh: New file.
* modules/c32isspace-tests: New file.
|
|
|
|
|
|
| |
* tests/test-c32ispunct.c: New file.
* tests/test-c32ispunct.sh: New file.
* modules/c32ispunct-tests: New file.
|
|
|
|
|
|
| |
* tests/test-c32isprint.c: New file.
* tests/test-c32isprint.sh: New file.
* modules/c32isprint-tests: New file.
|
|
|
|
|
|
| |
* tests/test-c32islower.c: New file.
* tests/test-c32islower.sh: New file.
* modules/c32islower-tests: New file.
|
|
|
|
|
|
| |
* tests/test-c32isgraph.c: New file.
* tests/test-c32isgraph.sh: New file.
* modules/c32isgraph-tests: New file.
|
|
|
|
|
|
| |
* tests/test-c32isdigit.c: New file, based on tests/test-iswdigit.c.
* tests/test-c32isdigit.sh: New file.
* modules/c32isdigit-tests: New file.
|