summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* timespec: fix resolution confusionPaul Eggert2018-09-1013-44/+62
| | | | | | | | | | | In normal usage, clock resolution is given in seconds, but the code was mistakenly using inverse seconds and calling it “resolution”. Fix this, partly by renaming two identifiers. The old names will be kept for a bit, to ease transition. * lib/timespec.h (TIMESPEC_HZ, LOG10_TIMESPEC_HZ): New constants, replacing TIMESPEC_RESOLUTION and LOG10_TIMESPEC_RESOLUTION, which are now obsolescent. All uses changed.
* mktime: simplify in prep for glibc mergePaul Eggert2018-09-093-10/+9
| | | | | | * lib/mktime.c, lib/timegm.c [_LIBC]: Include mktime-internal.h (a small file just for glibc) instead of using a typedef.
* intprops: minor clarification of codePaul Eggert2018-09-072-2/+8
| | | | | * lib/intprops.h (_GL_BINARY_OP_OVERFLOW): Use _GL_INT_CONVERT rather than reinventing it.
* Fix a comment.Bruno Haible2018-09-072-1/+6
| | | | * tests/test-posix_spawn3.c (parent_main): Fix typo in comment.
* posix_spawn_file_actions_addchdir: Add tests.Bruno Haible2018-09-074-0/+212
| | | | | | * tests/test-posix_spawn_file_actions_addchdir.c: New file. * tests/test-posix_spawn4.c: New file. * modules/posix_spawn_file_actions_addchdir-tests: New file.
* posix_spawn_file_actions_addchdir: New module.Bruno Haible2018-09-0719-48/+275
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suggested by Eric Blake in <https://lists.gnu.org/archive/html/bug-findutils/2018-09/msg00007.html>. * lib/spawn.in.h (posix_spawn_file_actions_addchdir): New declaration. * lib/spawn_int.h (struct __spawn_action): Add tag 'spawn_do_chdir' and union member 'chdir_action'. * lib/spawn_faction_addchdir.c: New file. * lib/spawni.c (__spawni): Implement the spawn_do_chdir action. * lib/spawn_faction_addclose.c: Test REPLACE_POSIX_SPAWN instead of HAVE_WORKING_POSIX_SPAWN. * lib/spawn_faction_adddup2.c: Likewise. * lib/spawn_faction_addopen.c: Likewise. * m4/posix_spawn_faction_addchdir.m4: New file. * m4/posix_spawn.m4 (gl_POSIX_SPAWN_BODY): Test whether module 'posix_spawn_file_actions_addchdir' is present and whether posix_spawn_file_actions_addchdir_np exists. Define REPLACE_POSIX_SPAWN instead of HAVE_WORKING_POSIX_SPAWN. * m4/spawn_h.m4 (gl_SPAWN_H): Test whether posix_spawn_file_actions_addchdir is declared. (gl_SPAWN_H_DEFAULTS): Initialize GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR, HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR, REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR. * modules/spawn (Makefile.am): Substitute GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR, HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR, REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR. * modules/posix_spawn_file_actions_addchdir: New file. * modules/posix_spawn_file_actions_addclose (Depends-on, configure.ac): Test also REPLACE_POSIX_SPAWN. * modules/posix_spawn_file_actions_adddup2 (Depends-on, configure.ac): Likewise. * modules/posix_spawn_file_actions_addopen (Depends-on, configure.ac): Likewise. * tests/test-spawn-c++.cc (posix_spawn_file_actions_addchdir): Check signature. * doc/posix-functions/posix_spawn.texi: Mention the new module. * doc/posix-functions/posix_spawnp.texi: Likewise.
* Fix typo in comment in yesterday's commit.Bruno Haible2018-09-071-1/+1
|
* stddef: Override max_align_t on NetBSD 8.0/x86.Bruno Haible2018-09-063-4/+36
| | | | | | * m4/stddef_h.m4 (gl_STDDEF_H): When testing for max_align_t, test also the value of __alignof__ (max_align_t). * doc/posix-headers/stddef.texi: Mention the issue.
* fcntl: Fix F_DUPFD_CLOEXEC behaviour on Haiku.Bruno Haible2018-09-063-3/+22
| | | | | | * lib/fcntl.c (rpl_fcntl): For F_DUPFD_CLOEXEC, don't even try the system fcntl. * doc/posix-functions/fcntl.texi: Document the issue.
* count-trailing-zeros tests: Rely on limits-h module.Bruno Haible2018-09-063-5/+8
| | | | | | * tests/test-count-trailing-zeros.c (ULLONG_MAX): Remove fallback definition. * modules/count-trailing-zeros-tests (Depends-on): Add 'limits-h'.
* count-leading-zeros tests: Rely on limits-h module.Bruno Haible2018-09-063-5/+14
| | | | | | * tests/test-count-leading-zeros.c (ULLONG_MAX): Remove fallback definition. * modules/count-leading-zeros-tests (Depends-on): Add 'limits-h'.
* count-one-bits tests: Rely on limits-h module.Bruno Haible2018-09-062-5/+1
| | | | | * tests/test-count-one-bits.c (ULLONG_MAX): Remove fallback definition. * modules/count-one-bits-tests (Depends-on): Add 'limits-h'.
* xstrtoll: Rely on limits-h module.Bruno Haible2018-09-064-15/+9
| | | | | | | * lib/xstrtol.c: Don't include intprops.h. (ULLONG_MAX, LLONG_MAX, LLONG_MIN): Remove fallback definitions. * modules/xstrtol (Depends-on): Remove 'intprops'. * modules/xstrtoll (Depends-on): Add 'limits-h'.
* strtoll, strtoull: Rely on limits-h module.Bruno Haible2018-09-064-29/+10
| | | | | | | * lib/strtol.c (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove macros. (ULLONG_MAX, LLONG_MAX, LLONG_MIN): Remove fallback definitions. * modules/strtoll (Depends-on): Add limits-h. * modules/strtoull (Depends-on): Likewise.
* intprops tests: Fix compilation error with pre-C99 compiler.Bruno Haible2018-09-062-14/+26
| | | | | * tests/test-intprops.c (verify_stmt): New macro. (VERIFY, main): Use it.
* limits-h: Provide numerical limits macros.Bruno Haible2018-09-065-27/+146
| | | | | | | | | | | | | * lib/limits.in.h (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Define also for IRIX and for GCC. (WORD_BIT, LONG_BIT): Define. * m4/limits-h.m4 (gl_LIMITS_H): Set LIMITS_H to non-empty also when <limits.h> does not define LLONG_MAX or WORD_BIT. * tests/test-limits-h.c (TYPE_SIGNED, TYPE_WIDTH, TYPE_MINIMUM, TYPE_MAXIMUM): New macros, from intprops.h. Add tests for CHAR_BIT, WORD_BIT, LONG_BIT, <type>_MIN, and <type>_MAX. * doc/posix-headers/limits.texi: Document what the 'limits-h' module provides.
* fcntl: Don't access nonexistent optional argument.Bruno Haible2018-09-062-2/+186
| | | | | | | | | Reported by Frank Busse <f.busse@imperial.ac.uk> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-09/msg00018.html>. * lib/fcntl.c (rpl_fcntl): For actions that don't take an argument, don't consume an argument. For actions that take an 'int' argument, consume an 'int' argument.
* doc: mention environ pitfallEric Blake2018-09-052-0/+13
| | | | | | | | | | Based on a bug report to the Cygwin list: https://cygwin.com/ml/cygwin/2018-05/msg00321.html * doc/posix-functions/environ.texi (environ): Assigning NULL to environ is a glibc extension. Signed-off-by: Eric Blake <eblake@redhat.com>
* gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.Bruno Haible2018-09-032-4/+29
| | | | | | | | | Reported by Antoine Luong <antoine.luong@c-s.fr> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-09/msg00008.html>. * gnulib-tool (func_import): For the tests, set a dotfirst flag. (func_emit_lib_Makefile_am): Consider the dotfirst flag. (func_emit_tests_Makefile_am): Don't consider the dotfirst flag.
* mktime: fix unlikely race+overflow bugPaul Eggert2018-09-022-1/+11
| | | | | | | | Problem reported by Alexandre Oliva in: https://sourceware.org/bugzilla/show_bug.cgi?id=16346 * lib/mktime.c (__mktime_internal): Access *OFFSET only once, to avoid an unlikely race if the compiler delays a load and if this cascades into a signed integer overflow.
* mktime, timegm: simplify glibc time64_tPaul Eggert2018-09-013-2/+10
| | | | | | | | | * lib/mktime.c, lib/timegm.c (mktime_offset_t) [_LIBC]: Now long int, not time_t, since long int is the longstanding type for this in glibc and there is no need to change it even if time_t becomes 64 bits - even int would do, though this would be a change to the glibc generated code. When this change is merged into glibc, it should simplify the time_t vs time64_t situation.
* mktime, timegm: simplify merge to glibcPaul Eggert2018-09-014-74/+109
| | | | | | | | | | | | | | | | | | | | Move code around to make a merge to glibc easier to audit. This should not change behavior. * lib/mktime.c: Include more standard files unconditionally. (NEED_MKTIME_INTERNAL, NEED_MKTIME_WINDOWS) (NEED_MKTIME_WORKING): Give default values to pacify -Wundef, which glibc uses. Default NEED_MKTIME_WORKING to DEBUG_MKTIME, to simplify later conditionals; default the others to zero. In uses of these conditionals, explicitly spell out how _LIBC affects things, so it’s easier to review from a glibc viewpoint. (my_tzset, __tzset) [!_LIBC]: New function and macro, to better compartmentalize tzset issues. Move system-dependent tzsettish code here from mktime. (mktime): Move tzsettish code to my_tzset, and move localtime_offset to within mktime so that it doesn’t need a separate ifdef. * lib/mktime-internal.h (__gmtime_r, __localtime_r, __mktime_internal): Move these macros here from lib/mktime.c and lib/gmtime.c.
* autoupdateKarl Berry2018-08-302-3/+3
|
* autoupdateKarl Berry2018-08-281-471/+421
|
* intprops: avoid evaluation of some expressionsPaul Eggert2018-08-272-7/+19
| | | | | | | | | This makes EXPR_SIGNED (e) easier to use, as it no longer evaluates the expression E. Formerly, E was required to be free of side effects. * lib/intprops.h (_GL_INT_CONVERT, _GL_INT_NEGATE_CONVERT) (EXPR_SIGNED, TYPE_WIDTH, _GL_INT_MINIMUM, _GL_INT_MAXIMUM) (_GL_SIGNED_INT_MAXIMUM): Do not evaluate the expression arg.
* autoupdatePaul Eggert2018-08-251-2/+2
|
* autoupdateKarl Berry2018-08-251-73/+80
|
* autoupdateKarl Berry2018-08-241-34/+35
|
* getcwd: Add cross-compilation guesses.Bruno Haible2018-08-232-5/+26
| | | | | | | | | | Reported by Sergio Durigan Junior <sergiodj@redhat.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00130.html>. Based on a patch by Paul Eggert. * m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Add cross-compilation guesses for all GNU systems.
* ; autoupdatePaul Eggert2018-08-222-3/+6
|
* autoupdateKarl Berry2018-08-201-219/+219
|
* glob-h: Formalize side effects from other modules.Bruno Haible2018-08-193-4/+15
| | | | | * m4/glob_h.m4 (gl_REPLACE_GLOB_H): New macro. * m4/glob.m4 (gl_GLOB): Invoke it.
* fnmatch-h: Formalize side effects from other modules.Bruno Haible2018-08-193-4/+15
| | | | | * m4/fnmatch_h.m4 (gl_REPLACE_FNMATCH_H): New macro. * m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Invoke it.
* limits-h: Formalize side effects from other modules.Bruno Haible2018-08-193-3/+16
| | | | | * m4/limits-h.m4 (gl_REPLACE_LIMITS_H): New macro. * m4/stdint.m4 (gl_STDINT_H): Invoke it.
* getpass: Move declaration to <unistd.h>.Bruno Haible2018-08-1911-57/+107
| | | | | | | | | | | | | | | | | | | | | | | | * lib/unistd.in.h (getpass): New declaration. * lib/getpass.h: Replace with a stub that just includes <unistd.h>. * m4/getpass.m4 (gl_FUNC_GETPASS): Declare through AC_DEFUN_ONCE. Require gl_UNISTD_H_DEFAULTS. Don't test whether getpass is declared. (gl_FUNC_GETPASS_GNU): Require gl_UNISTD_H_DEFAULTS and gl_FUNC_GETPASS. On glibc systems, don't set REPLACE_GETPASS to 1. * modules/getpass (Depends-on): Add 'unistd'. (configure.ac): Test also REPLACE_GETPASS. Define a module indicator. (Include): Specify <unistd.h> instead of "getpass.h". * modules/getpass-gnu (Depends-on): Merely depend on 'getpass'. (configure.ac): Sync with the configure.ac section of modules/getpass. (Include): Specify <unistd.h> instead of "getpass.h". * m4/unistd_h.m4 (gl_UNISTD_H): Test whether getpass is declared. (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_GETPASS, HAVE_GETPASS, REPLACE_GETPASS. * modules/unistd (Makefile.am): Substitute GNULIB_GETPASS, HAVE_GETPASS, REPLACE_GETPASS. * tests/test-unistd-c++.cc: Test also the declaration of 'getpass'. * doc/glibc-functions/getpass.texi: A length limit exists also on uClibc and musl. * NEWS: Mention the change.
* glob: Fix over-optimization due to attribute __nonnull__.Bruno Haible2018-08-192-0/+11
| | | | * lib/glob.c (_GL_ARG_NONNULL): Define to empty.
* glob: Fix another compilation error when glob.h is not replaced.Bruno Haible2018-08-193-3/+16
| | | | | | | | Reported by Reuben Thomas <rrt@sc3d.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00112.html>. * m4/glob.m4 (gl_GLOB): Set GLOB_H to non-empty when needed. * m4/glob_h.m4 (gl_GLOB_H): Define through AC_DEFUN_ONCE.
* fnmatch: Avoid conflicting macro definitions of 'fnmatch'.Bruno Haible2018-08-192-6/+9
| | | | | | | | Reported by Reuben Thomas <rrt@sc3d.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00108.html>. * m4/fnmatch.m4 (gl_PREREQ_FNMATCH): Don't define 'fnmatch' as a macro in config.h.
* Avoid -Wcast-function-type warnings from casts after GetProcAddress.Bruno Haible2018-08-188-0/+46
| | | | | | | | | | | | | | Reported by Andy Moreton <andrewjmoreton@gmail.com> in <https://lists.gnu.org/archive/html/emacs-devel/2018-08/msg00468.html>. Solution proposed by Eli Zaretskii. * lib/getaddrinfo.c (GetProcAddress): Cast result to 'void *' first. * lib/gettimeofday.c (GetProcAddress): Likewise. * lib/link.c (GetProcAddress): Likewise. * lib/physmem.c (GetProcAddress): Likewise. * lib/poll.c (GetProcAddress): Likewise. * lib/select.c (GetProcAddress): Likewise. * lib/stat-w32.c (GetProcAddress): Likewise.
* glob: Fix another compilation error when glob.h is not replaced.Bruno Haible2018-08-182-1/+7
| | | | | | Reported and fix proposed by Reuben Thomas <rrt@sc3d.org> again. * lib/globfree.c: Include <libc-config.h>.
* glob: Fix compilation error when glob.h is not replaced.Bruno Haible2018-08-183-1/+10
| | | | | | | | Reported and fix proposed by Reuben Thomas <rrt@sc3d.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00096.html>. * lib/glob_pattern_p.c: Include <libc-config.h>. * modules/glob (Depends-on): Add libc-config.
* scratch_buffer: Add tests.Bruno Haible2018-08-183-0/+148
| | | | | * tests/test-scratch-buffer.c: New file. * modules/scratch_buffer-tests: New file.
* scratch_buffer: Fix include file.Bruno Haible2018-08-182-0/+15
| | | | | | | | Reported by Reuben Thomas <rrt@sc3d.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00082.html>. * lib/scratch_buffer.h: Include <libc-config.h> first. Add double-inclusion guard.
* glob-h: Revert Paul Eggert's revert.Bruno Haible2018-08-183-2/+29
| | | | | * m4/glob_h.m4: Revert to previous state. * modules/glob-h: Likewise.
* glob-h: always build glob.hPaul Eggert2018-08-183-23/+13
| | | | | | | | | | This works around a problem reported by Reuben Thomas in: http://lists.gnu.org/r/bug-gnulib/2018-08/msg00079.html This workaround always builds glob.h, even on platforms that do not need it; perhaps this could be improved someday. * m4/glob_h.m4 (gl_GLOB_H): Do not set or use GLOB_H, since glob.h is always created now. * modules/glob-h (BUILT_SOURCES, glob.h): Always build glob.h.
* autoupdateKarl Berry2018-08-141-36/+50
|
* monetary: Simplify m4 code.Bruno Haible2018-08-142-9/+8
| | | | | * m4/monetary_h.m4 (gl_MONETARY_H): Define through AC_DEFUN_ONCE. (gl_MONETARY_H_BODY): Inline into gl_MONETARY_H. Remove macro.
* fnmatch-gnu: Revert part of last commit (unneeded).Bruno Haible2018-08-143-25/+0
|
* fnmatch, fnmatch-gnu: Fix compilation error on Mac OS X.Bruno Haible2018-08-143-4/+38
| | | | | | | | | | | Reported by Jeroen Meijer <jjgmeijer@gmail.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00046.html> and by Paul J. Lucas <paul@lucasmail.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00069.html>. * m4/fnmatch_h.m4 (gl_FNMATCH_H): Define through AC_DEFUN_ONCE. (gl_FNMATCH_H_GNU): New macro. * m4/fnmatch.m4 (gl_FUNC_FNMATCH_GNU): Require gl_FNMATCH_H_GNU.
* autoupdateKarl Berry2018-08-131-111/+115
|