summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* sys_resource-c++-tests: New module.Bruno Haible2017-05-063-0/+60
| | | | | | * tests/test-sys_resource-c++.cc: New file. (getrusage): Declare, missing since 2012-04-13. * modules/sys_resource-c++-tests: New file.
* strings-c++-tests: New module.Bruno Haible2017-05-063-0/+60
| | | | | | * tests/test-strings-c++.cc: New file. (ffs): Declare, missing since 2011-07-12. * modules/strings-c++-tests: New file.
* string-c++-tests: Update.Bruno Haible2017-05-062-0/+14
| | | | | * tests/test-string-c++.cc (ffsl): Declare, missing since 2011-07-15. (ffsll): Declare, missing since 2011-07-15.
* stdlib-c++-tests: Update.Bruno Haible2017-05-062-0/+46
| | | | | | | | | | * tests/test-stdlib-c++.cc (posix_openpt): Declare, missing since 2011-10-18. (ptsname_r): Declare, missing since 2011-11-07. (qsort_r): Declare, missing since 2014-08-29. (random, srandom, initstate, setstate): Declare, missing since 2012-01-14. (secure_getenv): Declare, missing since 2013-02-05.
* stdio-c++-tests: Update.Bruno Haible2017-05-062-0/+9
| | | | * tests/test-stdio-c++.cc (pclose): Declare, missing since 2011-09-18.
* signal-h-c++-tests: Update.Bruno Haible2017-05-062-1/+5
| | | | * tests/test-signal-h-c++.cc (raise): Remove redundant declaration.
* math-c++-tests: Update.Bruno Haible2017-05-062-14/+31
| | | | | | * tests/test-math-c++.cc (fmaf): Declare, missing since 2011-10-17. (fma): Declare, missing since 2011-10-17. (fmal): Declare, missing since 2011-10-17.
* locale-c++-tests: Update.Bruno Haible2017-05-062-0/+10
| | | | | * tests/test-locale-c++.cc (localeconv): Declare, missing since 2012-03-25.
* inttypes-c++-tests: New module.Bruno Haible2017-05-063-0/+65
| | | | | | | * tests/test-inttypes-c++.cc: New file. (strtoimax): Declare, missing since 2012-01-05. (strtoumax): Declare, missing since 2012-01-05. * modules/inttypes-c++-tests: New file.
* dirent-c++-tests: Update.Bruno Haible2017-05-062-2/+25
| | | | | | * tests/test-dirent-c++.cc (readdir): Declare, missing since 2011-09-13. (rewinddir): Declare, missing since 2011-09-13. (dirfd): Declare, missing since 2010-03-08.
* argp: Fix mistake in 2017-04-23 commit.Bruno Haible2017-05-052-1/+7
| | | | | * lib/argp-help.c (__argp_failure): If GNULIB_STRERROR_R_POSIX is set, assume that strerror_r returns 'int', not 'char *'.
* argp: Fix typo.Reuben Thomas2017-05-042-1/+6
| | | | * lib/argp-help.c (argp_doc): Fix spelling mistake in comment.
* utimens: port to Emacs + MS-WindowsPaul Eggert2017-05-022-2/+17
| | | | | | | | Skip the new MS-Windows-specific code if Emacs. * lib/utimens.c [EMACS_CONFIGUATION]: Avoid new MS-Windows-specific code. (USE_SETFILETIME): New macro. (fdutimens): Use it.
* tzset: update doc for TZ problems on MS-WindowsPaul Eggert2017-05-0110-0/+52
| | | | | | | | | * doc/posix-functions/ctime.texi, doc/posix-functions/daylight.texi: * doc/posix-functions/localtime.texi, doc/posix-functions/mktime.texi: * doc/posix-functions/strftime.texi, doc/posix-functions/timezone.texi: * doc/posix-functions/tzname.texi, doc/posix-functions/tzset.texi: * doc/posix-functions/wcsftime.texi: Mention some issues with TZ under MS-Windows.
* copy-file: Fix build error on mingw.Bruno Haible2017-05-012-0/+6
| | | | * modules/copy-file (Depends-on): Add 'close'.
* Fix recent ChangeLog entry.Bruno Haible2017-05-011-1/+1
|
* tzset: Work around TZ problem on native Windows.Bruno Haible2017-05-017-11/+38
| | | | | | | | | | | | * m4/tzset.m4 (gl_FUNC_TZSET): Require AC_CANONICAL_HOST. On native Windows, set REPLACE_TZSET to 1. * lib/tzset.c (tzset): On native Windows, fix TZ if necessary, and invoke '_tzset' instead of 'tzset'. * doc/posix-functions/tzset.texi: Mention the native Windows workaround. * modules/time_rz (Depends-on): Add tzset. * lib/time_rz.c (tzset): Remove fallback definition. * m4/time_rz.m4 (gl_TIME_RZ): Don't test for tzset.
* mktime: Fix dependencies.Bruno Haible2017-05-012-0/+6
| | | | * modules/mktime (Depends-on): Add 'time'.
* New module 'localtime-buffer', split off from module 'gettimeofday'.Bruno Haible2017-05-0115-97/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/localtime-buffer.h: New file. * lib/localtime-buffer.c: New file, extracted from lib/gettimeofday.c. * lib/time.in.h (tzset): New declaration. (localtime, gmtime): Don't test GNULIB_GETTIMEOFDAY. * lib/tzset.c: New file, extracted from lib/gettimeofday.c. * lib/gettimeofday.c: Include localtime-buffer.h. Remove code that was moved to lib/localtime-buffer.c or lib/tzset.c. * m4/localtime-buffer.m4: New file. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize GNULIB_TZSET, HAVE_TZSET, REPLACE_TZSET. * m4/tzset.m4 (gl_FUNC_TZSET): Move code from m4/gettimeofday.m4 to here, with modifications. Set HAVE_TZSET, REPLACE_TZSET. Invoke gl_LOCALTIME_BUFFER_NEEDED. (gl_FUNC_TZSET_CLOBBER): Don't require gl_HEADER_SYS_TIME_H; not needed since 2007-01-18. * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Remove code that deals with tzset. (gl_FUNC_GETTIMEOFDAY_CLOBBER): Require gl_LOCALTIME_BUFFER_DEFAULTS. Invoke gl_LOCALTIME_BUFFER_NEEDED instead of gl_GETTIMEOFDAY_REPLACE_LOCALTIME. (gl_GETTIMEOFDAY_REPLACE_LOCALTIME): Remove macro. * modules/localtime-buffer: New file. * modules/time (Depends-on): Remove 'gettimeofday'. (Makefile.am): Substitute GNULIB_TZSET, HAVE_TZSET, REPLACE_TZSET. Don't substitute GNULIB_GETTIMEOFDAY. * modules/tzset (Description): Enable hyperlink to POSIX spec. (Files): Add lib/tzset.c. (Depends-on): Remove gettimeofday. Add localtime-buffer, time. (configure.ac): Arrange to conditionally compile lib/tzset.c. Invoke gl_TIME_MODULE_INDICATOR. * modules/gettimeofday (Depends-on): Add localtime-buffer.
* copy-file: Preserve sub-second time stamps.Bruno Haible2017-05-014-21/+21
| | | | | | | | | | * lib/copy-file.c: Include stat-time.h, utimens.h instead of <utime.h>. (qcopy_file_preserving): Use 'struct timespec' and utimens() to transport the time stamps from the original file to the destination file. * m4/copy-file.m4 (gl_COPY_FILE): Don't test for utime, utimes. * modules/copy-file (Depends-on): Add stat-time, utimns instead of utime-h.
* wctype: Fix problems if <wchar.h> gets included after <wctype.h>.Bruno Haible2017-05-012-4/+13
| | | | | | * lib/wctype.in.h: Include not only <ctype.h> but also <wchar.h>. Do so also on MSVC. Reported by Eli Zaretskii <eliz@gnu.org>.
* wchar: Fix compilation error with the original mingw.org mingw.Bruno Haible2017-05-016-15/+41
| | | | | | | | | | | | * lib/wchar.in.h (rpl_wint_t): If <crtdefs.h> does not exist, include <stddef.h> instead. * m4/wint_t.m4 (gl_TYPE_WINT_T_PREREQ): New macro, extracted from gl_WCTYPE_H. * m4/wctype_h.m4 (gl_WCTYPE_H): Don't set HAVE_CRTDEFS_H here; require gl_TYPE_WINT_T_PREREQ instead. * m4/wchar_h.m4 (gl_WCHAR_H): Require gl_TYPE_WINT_T_PREREQ. * modules/wchar (Makefile.am): Substitute HAVE_CRTDEFS_H. Reported by Eli Zaretskii <eliz@gnu.org>.
* utimecmp: Add support for native Windows.Bruno Haible2017-05-012-0/+9
| | | | * lib/utimecmp.c (SYSCALL_RESOLUTION): Set to 100 on native Windows.
* utimens: Add support for native Windows.Bruno Haible2017-05-013-0/+93
| | | | | | | | * lib/utimens.c: Include <windows.h>, msvc-nothrow.h. (fdutimens): Provide a native Windows implementation, like utime.c with added tv_nsec support. * modules/utimens (Depends-on): Add msvc-nothrow, utime. Suggested by Tim Rühsen <tim.ruehsen@gmx.de>.
* wcsftime: New module.Bruno Haible2017-04-308-6/+145
| | | | | | | | | | | | | * lib/wchar.in.h (wcsftime): New declaration. * lib/wcsftime.c: New file. * m4/wcsftime.m4: New file. * m4/wchar_h.m4 (gl_WCHAR_H): Test for wcsftime declaration. (gl_HEADER_TIME_H_DEFAULTS): Initialize GNULIB_WCSFTIME, HAVE_WCSFTIME, REPLACE_WCSFTIME. * modules/wchar (Makefile.am): Substitute GNULIB_WCSFTIME, HAVE_WCSFTIME, REPLACE_WCSFTIME. * modules/wcsftime: New file. * doc/posix-functions/wcsftime.texi: Mention the new module.
* strftime-fixes: New module.Bruno Haible2017-04-309-11/+125
| | | | | | | | | | | | | | * lib/time.in.h (strftime): New declaration. * lib/strftime-fixes.c: New file. * m4/strftime.m4 (gl_FUNC_GNU_STRFTIME): Inline gl_FUNC_STRFTIME macro. (gl_FUNC_STRFTIME): Remove macro. * m4/strftime-fixes.m4: New file. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize GNULIB_STRFTIME, REPLACE_STRFTIME. * modules/time (Makefile.am): Substitute GNULIB_STRFTIME, REPLACE_STRFTIME. * modules/strftime-fixes: New file. * doc/posix-functions/strftime.texi: Mention the new module.
* mktime: Work around TZ problem on native Windows.Bruno Haible2017-04-306-29/+112
| | | | | | | | | | | | | | | | | | | | * lib/mktime.c: Add #ifs to make the algorithmic workaround independent from the native Windows workaround. * m4/mktime.m4 (gl_FUNC_MKTIME_WORKS): New macro, extracted from gl_FUNC_MKTIME. If guessing, set gl_cv_func_working_mktime to 'guessing no'. (gl_FUNC_MKTIME): Require it. Require AC_CANONICAL_HOST. Set REPLACE_MKTIME to 1 on native Windows. Define NEED_MKTIME_WORKING, NEED_MKTIME_WINDOWS. (gl_FUNC_MKTIME_INTERNAL): Require gl_FUNC_MKTIME_WORKS, not gl_FUNC_MKTIME. Set WANT_MKTIME_INTERNAL, not REPLACE_MKTIME. Define NEED_MKTIME_INTERNAL. * m4/timegm.m4 (gl_FUNC_TIMEGM): Require gl_FUNC_MKTIME_WORKS, not gl_FUNC_MKTIME. Cope with 'guessing yes' value. * modules/mktime-internal (configure.ac): Test WANT_MKTIME_INTERNAL, not REPLACE_MKTIME. * doc/posix-functions/mktime.texi: Mention the native Windows workaround.
* localtime: New module.Bruno Haible2017-04-308-5/+105
| | | | | | | | | | | * lib/time.in.h (localtime): Declare also if requested by module 'localtime'. * lib/localtime.c: New file. * m4/localtime.m4: New file. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize GNULIB_LOCALTIME. * modules/time (Makefile.am): Substitute GNULIB_LOCALTIME. * modules/localtime: New file. * doc/posix-functions/localtime.texi: Mention the new module.
* ctime: New module.Bruno Haible2017-04-308-5/+119
| | | | | | | | | | | * lib/time.in.h (ctime): New declaration. * lib/ctime.c: New file. * m4/ctime.m4: New file. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize GNULIB_CTIME, REPLACE_CTIME. * modules/time (Makefile.am): Substitute GNULIB_CTIME, REPLACE_CTIME. * modules/ctime: New file. * doc/posix-functions/ctime.texi: Mention the new module.
* gettimeofday: Provide higher resolution on native Windows.Bruno Haible2017-04-303-13/+67
| | | | | | | | | | * lib/gettimeofday.c: Don't include <sys/timeb.h>. (GetSystemTimePreciseAsFileTimeFuncType): New variable. (initialize): Initialize it. (gettimeofday) [WINDOWS_NATIVE]: Use it, and convert from FILETIME to 'struct timeval'. Don't use _ftime(). * m4/gettimeofday.m4 (gl_PREREQ_GETTIMEOFDAY): Don't test for <sys/timeb.h> and _ftime.
* Document the problem with the Cygwin environment variable TZ.Bruno Haible2017-04-308-1/+34
| | | | | | | | | | * doc/posix-functions/tzset.texi: Add note about TZ. * doc/posix-functions/ctime.texi: Likewise. * doc/posix-functions/localtime.texi: Likewise. * doc/posix-functions/mktime.texi: Likewise. * doc/posix-functions/strftime.texi: Likewise. * doc/posix-functions/wcsftime.texi: Likewise. * doc/pastposix-functions/ftime.texi: Likewise.
* utime-tests: New module.Bruno Haible2017-04-304-0/+171
| | | | | | * tests/test-utime.c: New file, based on tests/test-utimens.h. * tests/test-utimens-common.h: Include <sys/stat.h>. * modules/utime-tests: New file.
* utime: New module.Bruno Haible2017-04-308-6/+373
| | | | | | | | | | | | | | | * lib/utime.in.h: Add comment for snippets. (utime): New declaration. * lib/utime.c: New file. * m4/utime.m4: New file. * m4/utime_h.m4 (gl_UTIME_H): Test for utime declaration. (gl_UTIME_H_DEFAULTS): Initialize GNULIB_UTIME, HAVE_UTIME, REPLACE_UTIME. * modules/utime-h (Depends-on): Add snippets. (Makefile.am): Substitute GNULIB_UTIME, HAVE_UTIME, REPLACE_UTIME. Insert snippets. * modules/utime: New file. * doc/posix-functions/utime.texi: Mention the new module.
* utime-h: Modernize handling of 'struct utimbuf'.Bruno Haible2017-04-308-55/+82
| | | | | | | | | | | | | | | | | * lib/utime.in.h: Include next <utime.h> if it exists. (utimbuf): Define to _utimbuf on native Windows. * m4/utime-h.m4 (gl_UTIME_H): Check for prerequisites of include_next. Set UTIME_H on native Windows. (gl_UTIME_MODULE_INDICATOR, gl_HEADER_UTIME_H_DEFAULTS): New macros. * modules/utime-h (Depends-on): Add include_next. (Makefile.am): Substitute also HAVE_UTIME_H, INCLUDE_NEXT, PRAGMA_SYSTEM_HEADER, PRAGMA_COLUMNS, NEXT_UTIME_H. * lib/utimens.c (utimbuf): Remove fallback definition. * m4/utimens.m4 (gl_UTIMENS): Don't require gl_CHECK_TYPE_STRUCT_UTIMBUF. * m4/utimbuf.m4: Remove file. * modules/utimens (Files): Remove m4/utimbuf.m4.
* Make use of module 'utime-h'.Bruno Haible2017-04-306-11/+16
| | | | | | | | | * modules/copy-file (Depends-on): Add utime-h. * lib/copy-file.c: Assume that <utime.h> exists. * m4/copy-file.m4 (gl_COPY_FILE): Don't test for <utime.h>. * modules/utimens (Depends-on): Add utime-h. * lib/utimens.c: Assume that <utime.h> exists.
* utime-h: New module.Bruno Haible2017-04-307-4/+136
| | | | | | | | | | * m4/utime_h.m4: New file. * lib/utime.in.h: New file. * modules/utime-h: New file. * doc/posix-headers/utime.texi: Mention the new module. * tests/test-utime-h.c: New file. * modules/utime-h-tests: New file.
* Fix a few typos.Bruno Haible2017-04-306-5/+16
| | | | | | | | * m4/fstat.m4 (gl_FUNC_FSTAT): Require AC_CANONICAL_HOST. * m4/stat.m4 (gl_FUNC_STAT): Fix comment. * doc/posix-functions/fstat.texi: Fix a plural typo. * doc/posix-functions/stat.texi: Likewise. * m4/include_next.m4: Update comments.
* error: Fix mistake in 2017-04-23 commit.Bruno Haible2017-04-292-1/+7
| | | | | * lib/error.c (print_errno_message): If GNULIB_STRERROR_R_POSIX is set, assume that strerror_r returns 'int', not 'char *'.
* stat: Fix time_t values and other problems on native Windows platforms.Bruno Haible2017-04-295-101/+401
| | | | | | | | | | | | | | | | * doc/posix-functions/stat.texi: Mention the problem with the Microsoft implementations of stat(). * lib/stat.c: Include filename.h instead of dosname.h. Include malloca.h, stat-w32.h. (is_unc_root): New function. (rpl_stat): New implementation for native Windows. Remove REPLACE_FUNC_STAT_DIR code. * m4/stat.m4 (gl_FUNC_STAT): On native Windows, set REPLACE_STAT always. Don't define REPLACE_FUNC_STAT_DIR. (gl_PREREQ_STAT): Require gl_HEADER_SYS_STAT_H. * modules/stat (Files): Add lib/stat-w32.h, lib/stat-w32.c. (Depends-on): Remove dosname. Add filename, malloca. (configure.ac): Also compile lib/stat-w32.c.
* fstat: Fix time_t values on native Windows platforms.Bruno Haible2017-04-297-46/+401
| | | | | | | | | | | | | | | | * doc/posix-functions/fstat.texi: Mention the problem with st_*time. * lib/stat-w32.h: New file. * lib/stat-w32.c: New file. * lib/fstat.c: Don't include msvc-inval.h. Include msvc-nothrow.h, stat-w32.h instead. (fstat_nothrow): Remove function. (rpl_fstat): Implement by means of _gl_fstat_by_handle. * m4/fstat.m4 (gl_FUNC_FSTAT): On native Windows, set REPLACE_FSTAT always. (gl_PREREQ_FSTAT): Require gl_HEADER_SYS_STAT_H. * modules/fstat (Files): Add lib/stat-w32.h, lib/stat-w32.c. (Depends-on): Remove msvc-inval. Add pathmax, msvc-nothrow. (configure.ac): Also compile lib/stat-w32.c.
* getopt: port to Solaris 10 with circa-1997 glibc getopt.hPaul Eggert2017-04-292-0/+10
| | | | | | | Problem reported by Assaf Gordon and Gavin Smith in: http://lists.gnu.org/archive/html/bug-gnulib/2017-04/msg00157.html * lib/getopt-pfx-ext.h (_getopt_internal) [__GETOPT_PREFIX]: #define this, too.
* strerror_r-posix: Fixes for MSVC 14.Bruno Haible2017-04-293-0/+123
| | | | | | * lib/strerror_r.c: Include <stdarg.h>. (strerror_r): Provide error messages for errno values 100...140. * doc/posix-functions/strerror_r.texi: Mention the MSVC 14 problem.
* noreturn: New module.Bruno Haible2017-04-297-0/+297
| | | | | | | | | * lib/noreturn.h: New file. * modules/noreturn: New file. * tests/test-noreturn.c: New file. * modules/noreturn-tests: New file. * tests/test-noreturn-c++.cc: New file. * modules/noreturn-c++-tests: New file.
* wctype-h: Fix compilation error with the original mingw.org mingw.Bruno Haible2017-04-274-5/+28
| | | | | | | | | * m4/wctype_h.m4 (gl_WCTYPE_H): Test for <crtdefs.h>. Set HAVE_CRTDEFS_H. * modules/wctype-h (Makefile.am): Substitute HAVE_CRTDEFS_H. * lib/wctype.in.h (rpl_wint_t): If <crtdefs.h> does not exist, include <stddef.h> instead. Reported and proposed by Eli Zaretskii <eliz@gnu.org>.
* nap.h: Fix compilation on non windows platformsPádraig Brady2017-04-262-1/+6
| | | | * tests/nap.h: Move misplaced endif.
* time_rz: fix heap buffer overflow vulnerabilityPádraig Brady2017-04-263-2/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This issue has been assigned CVE-2017-7476 and was detected with American Fuzzy Lop 2.41b run on the coreutils date(1) program with ASAN enabled. ERROR: AddressSanitizer: heap-buffer-overflow on address 0x... WRITE of size 8 at 0x60d00000cff8 thread T0 #1 0x443020 in extend_abbrs lib/time_rz.c:88 #2 0x443356 in save_abbr lib/time_rz.c:155 #3 0x44393f in localtime_rz lib/time_rz.c:290 #4 0x41e4fe in parse_datetime2 lib/parse-datetime.y:1798 A minimized reproducer is the following 120 byte TZ value, which goes beyond the value of ABBR_SIZE_MIN (119) on x86_64. Extend the aa...b portion to overwrite more of the heap. date -d $(printf 'TZ="aaa%020daaaaaab%089d"') localtime_rz and mktime_z were affected since commit 4bc76593. parse_datetime was affected since commit 4e6e16b3f. * lib/time_rz.c (save_abbr): Rearrange the calculation determining whether there is enough buffer space available. The rearrangement ensures we're only dealing with positive numbers, thus avoiding the problematic promotion of signed to unsigned causing an invalid comparison when zone_copy is more than ABBR_SIZE_MIN bytes beyond the start of the buffer. * tests/test-parse-datetime.c (main): Add a test case written by Paul Eggert, which overwrites enough of the heap so that standard glibc will fail with "free(): invalid pointer" without the patch applied. Reported and analyzed at https://bugzilla.redhat.com/1444774
* xalloc: add missing integer overflow checkPaul Eggert2017-04-262-0/+8
| | | | | * lib/xalloc.h (x2nrealloc): Also check for multiplication overflow when P is null.
* parse-datetime: make it standalonePaul Eggert2017-04-252-0/+20
| | | | | | * lib/parse-datetime.y: Include <stdarg.h>, for va_start etc. (_GL_ATTRIBUTE_FORMAT): New macro. These are needed to get './gnulib-tool --test parse-datetime' to work.
* nap.h: Port to native Windows.Bruno Haible2017-04-252-12/+34
| | | | | | | | * tests/nap.h (nap_get_stat): Renamed from get_stat. Remove argument fd; use nap_fd instead. On native Windows, close and reopen nap_fd. (nap_works): Don't compare the ctimes, because on native Windows, these are the creation times. (nap): Update.
* nap.h: Fix logic.Bruno Haible2017-04-252-3/+17
| | | | * tests/nap.h (nap): Avoid signed integer overflow in loop.