From: Bruno Haible Date: Fri, 27 Dec 2024 22:39:52 +0000 (+0100) Subject: Rename module sys_random to sys_random-h. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=05eea16acedef95c076c92de94a4931c93d0f788;p=gnulib.git Rename module sys_random to sys_random-h. * modules/sys_random-h: Renamed from modules/sys_random. * modules/sys_random-h-tests: Renamed from modules/sys_random-tests. * modules/sys_random-h-c++-tests: Renamed from modules/sys_random-c++-tests. * tests/test-sys_random-h.c: Renamed from tests/test-sys_random.c. * tests/test-sys_random-h-c++.cc: Renamed from tests/test-sys_random-c++.cc. * doc/glibc-headers/sys_random.texi: Update. * modules/* (Depends-on): Update. * modules/sys_random: New file. --- diff --git a/ChangeLog b/ChangeLog index 81bc906b37..549d5b34d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2024-12-27 Bruno Haible + + Rename module sys_random to sys_random-h. + * modules/sys_random-h: Renamed from modules/sys_random. + * modules/sys_random-h-tests: Renamed from modules/sys_random-tests. + * modules/sys_random-h-c++-tests: Renamed from + modules/sys_random-c++-tests. + * tests/test-sys_random-h.c: Renamed from tests/test-sys_random.c. + * tests/test-sys_random-h-c++.cc: Renamed from + tests/test-sys_random-c++.cc. + * doc/glibc-headers/sys_random.texi: Update. + * modules/* (Depends-on): Update. + * modules/sys_random: New file. + 2024-12-27 Bruno Haible Rename module sys_msg to sys_msg-h. diff --git a/doc/glibc-headers/sys_random.texi b/doc/glibc-headers/sys_random.texi index 4a51840265..05437a81c8 100644 --- a/doc/glibc-headers/sys_random.texi +++ b/doc/glibc-headers/sys_random.texi @@ -16,8 +16,8 @@ Documentation: @uref{https://www.kernel.org/doc/man-pages/online/pages/man2/getrandom.2.html,,man getrandom}. @end itemize -Gnulib module: sys_random -@mindex sys_random +Gnulib module: sys_random-h +@mindex sys_random-h Portability problems fixed by Gnulib: @itemize diff --git a/modules/getrandom b/modules/getrandom index 845e352ae2..7a75292675 100644 --- a/modules/getrandom +++ b/modules/getrandom @@ -6,7 +6,7 @@ lib/getrandom.c m4/getrandom.m4 Depends-on: -sys_random +sys_random-h fcntl-h [test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1] minmax [test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1] stdbool-h [test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1] diff --git a/modules/posixcheck b/modules/posixcheck index a73443bbac..56743bba97 100644 --- a/modules/posixcheck +++ b/modules/posixcheck @@ -34,7 +34,7 @@ string-h strings-h sys_file-h sys_ioctl-h -sys_random +sys_random-h sys_resource sys_select sys_socket diff --git a/modules/sys_random b/modules/sys_random index 1f86b97b9b..cd4e4f627b 100644 --- a/modules/sys_random +++ b/modules/sys_random @@ -1,46 +1,20 @@ Description: A GNU-like . +Status: +deprecated + +Notice: +This module is deprecated. Use the module 'sys_random-h' instead. + Files: -lib/sys_random.in.h -m4/sys_random_h.m4 Depends-on: -gen-header -include_next -snippet/arg-nonnull -snippet/c++defs -snippet/warn-on-use +sys_random-h configure.ac: -gl_SYS_RANDOM_H -gl_SYS_RANDOM_H_REQUIRE_DEFAULTS -AC_PROG_MKDIR_P Makefile.am: -BUILT_SOURCES += sys/random.h - -# We need the following in order to create when the system -# doesn't have one. -sys/random.h: sys_random.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) - $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys' - $(AM_V_at)$(SED_HEADER_STDOUT) \ - -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \ - -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ - -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ - -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ - -e 's|@''NEXT_SYS_RANDOM_H''@|$(NEXT_SYS_RANDOM_H)|g' \ - -e 's|@''HAVE_SYS_RANDOM_H''@|$(HAVE_SYS_RANDOM_H)|g' \ - -e 's/@''GNULIB_GETRANDOM''@/$(GNULIB_GETRANDOM)/g' \ - -e 's/@''HAVE_GETRANDOM''@/$(HAVE_GETRANDOM)/g' \ - -e 's/@''REPLACE_GETRANDOM''@/$(REPLACE_GETRANDOM)/g' \ - -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ - -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ - -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ - $(srcdir)/sys_random.in.h > $@-t - $(AM_V_at)mv $@-t $@ -MOSTLYCLEANFILES += sys/random.h sys/random.h-t -MOSTLYCLEANDIRS += sys Include: @@ -49,4 +23,3 @@ License: LGPLv2+ Maintainer: -all diff --git a/modules/sys_random-c++-tests b/modules/sys_random-c++-tests deleted file mode 100644 index 3c006edb7e..0000000000 --- a/modules/sys_random-c++-tests +++ /dev/null @@ -1,19 +0,0 @@ -Files: -tests/test-sys_random-c++.cc -tests/signature.h - -Status: -c++-test - -Depends-on: -ansi-c++-opt - -configure.ac: - -Makefile.am: -if ANSICXX -TESTS += test-sys_random-c++ -check_PROGRAMS += test-sys_random-c++ -test_sys_random_c___SOURCES = test-sys_random-c++.cc -test_sys_random_c___LDADD = $(LDADD) $(GETRANDOM_LIB) -endif diff --git a/modules/sys_random-h b/modules/sys_random-h new file mode 100644 index 0000000000..1f86b97b9b --- /dev/null +++ b/modules/sys_random-h @@ -0,0 +1,52 @@ +Description: +A GNU-like . + +Files: +lib/sys_random.in.h +m4/sys_random_h.m4 + +Depends-on: +gen-header +include_next +snippet/arg-nonnull +snippet/c++defs +snippet/warn-on-use + +configure.ac: +gl_SYS_RANDOM_H +gl_SYS_RANDOM_H_REQUIRE_DEFAULTS +AC_PROG_MKDIR_P + +Makefile.am: +BUILT_SOURCES += sys/random.h + +# We need the following in order to create when the system +# doesn't have one. +sys/random.h: sys_random.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys' + $(AM_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_RANDOM_H''@|$(NEXT_SYS_RANDOM_H)|g' \ + -e 's|@''HAVE_SYS_RANDOM_H''@|$(HAVE_SYS_RANDOM_H)|g' \ + -e 's/@''GNULIB_GETRANDOM''@/$(GNULIB_GETRANDOM)/g' \ + -e 's/@''HAVE_GETRANDOM''@/$(HAVE_GETRANDOM)/g' \ + -e 's/@''REPLACE_GETRANDOM''@/$(REPLACE_GETRANDOM)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + $(srcdir)/sys_random.in.h > $@-t + $(AM_V_at)mv $@-t $@ +MOSTLYCLEANFILES += sys/random.h sys/random.h-t +MOSTLYCLEANDIRS += sys + +Include: + + +License: +LGPLv2+ + +Maintainer: +all diff --git a/modules/sys_random-h-c++-tests b/modules/sys_random-h-c++-tests new file mode 100644 index 0000000000..3b0e61b88a --- /dev/null +++ b/modules/sys_random-h-c++-tests @@ -0,0 +1,19 @@ +Files: +tests/test-sys_random-h-c++.cc +tests/signature.h + +Status: +c++-test + +Depends-on: +ansi-c++-opt + +configure.ac: + +Makefile.am: +if ANSICXX +TESTS += test-sys_random-h-c++ +check_PROGRAMS += test-sys_random-h-c++ +test_sys_random_h_c___SOURCES = test-sys_random-h-c++.cc +test_sys_random_h_c___LDADD = $(LDADD) $(GETRANDOM_LIB) +endif diff --git a/modules/sys_random-h-tests b/modules/sys_random-h-tests new file mode 100644 index 0000000000..b5f3803b63 --- /dev/null +++ b/modules/sys_random-h-tests @@ -0,0 +1,11 @@ +Files: +tests/test-sys_random-h.c + +Depends-on: +sys_random-h-c++-tests + +configure.ac: + +Makefile.am: +TESTS += test-sys_random-h +check_PROGRAMS += test-sys_random-h diff --git a/modules/sys_random-tests b/modules/sys_random-tests deleted file mode 100644 index 2208c5a7e3..0000000000 --- a/modules/sys_random-tests +++ /dev/null @@ -1,11 +0,0 @@ -Files: -tests/test-sys_random.c - -Depends-on: -sys_random-c++-tests - -configure.ac: - -Makefile.am: -TESTS += test-sys_random -check_PROGRAMS += test-sys_random diff --git a/tests/test-sys_random-c++.cc b/tests/test-sys_random-c++.cc deleted file mode 100644 index 1146f3115f..0000000000 --- a/tests/test-sys_random-c++.cc +++ /dev/null @@ -1,35 +0,0 @@ -/* Test of substitute in C++ mode. - Copyright (C) 2020-2024 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* Written by Bruno Haible , 2020. */ - -#define GNULIB_NAMESPACE gnulib -#include - -#include - -#include "signature.h" - - -#if GNULIB_TEST_GETRANDOM -SIGNATURE_CHECK (GNULIB_NAMESPACE::getrandom, ssize_t, (void *, size_t, unsigned int)); -#endif - - -int -main () -{ -} diff --git a/tests/test-sys_random-h-c++.cc b/tests/test-sys_random-h-c++.cc new file mode 100644 index 0000000000..1146f3115f --- /dev/null +++ b/tests/test-sys_random-h-c++.cc @@ -0,0 +1,35 @@ +/* Test of substitute in C++ mode. + Copyright (C) 2020-2024 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible , 2020. */ + +#define GNULIB_NAMESPACE gnulib +#include + +#include + +#include "signature.h" + + +#if GNULIB_TEST_GETRANDOM +SIGNATURE_CHECK (GNULIB_NAMESPACE::getrandom, ssize_t, (void *, size_t, unsigned int)); +#endif + + +int +main () +{ +} diff --git a/tests/test-sys_random-h.c b/tests/test-sys_random-h.c new file mode 100644 index 0000000000..16cacd31d7 --- /dev/null +++ b/tests/test-sys_random-h.c @@ -0,0 +1,32 @@ +/* Test of substitute. + Copyright (C) 2020-2024 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#include + +/* Check that the necessary constants are defined. */ +int flags[] = + { + GRND_RANDOM, + GRND_NONBLOCK + }; + +int +main (void) +{ + return 0; +} diff --git a/tests/test-sys_random.c b/tests/test-sys_random.c deleted file mode 100644 index 16cacd31d7..0000000000 --- a/tests/test-sys_random.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Test of substitute. - Copyright (C) 2020-2024 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#include - -#include - -/* Check that the necessary constants are defined. */ -int flags[] = - { - GRND_RANDOM, - GRND_NONBLOCK - }; - -int -main (void) -{ - return 0; -}