lib


Log

Author Commit Date CI Message
Eric Blake 89b0db35 2010-09-17T15:08:29 fdutimens, fdutimensat: update signature, again In general, merging: f<act>(fd,args) and <act>at(dir,name,args) should produce: fd<act>at(fd,dir,name,args) * lib/utimens.h (gl_futimens): Delete, and move signature... (fdutimens): ...here. (fdutimensat): Rearrange signature. (lutimensat): Rename variable for clarity. * lib/fdutimensat.c (fdutimensat): Update signature. * lib/utimens.c (fdutimens): Likewise. (gl_futimens): Delete. (utimens, lutimens): Update callers. * lib/futimens.c (futimens): Likewise. * tests/test-fdutimensat.c: Likewise. * tests/test-utimens.c: Likewise. * tests/test-futimens.h: Update comment. * NEWS: Mention this. Suggested by Paul Eggert. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 18aae5b7 2010-09-17T08:29:16 fdutimensat: drop atflag validation * lib/fdutimensat.c (fdutimensat): Allow AT_SYMLINK_NOFOLLOW even with valid fd, to close a race scenario where futimens is unsupported and FILE was replaced by a symlink. * tests/test-fdutimensat.c (do_fdutimens, main): Adjust test accordingly. Suggested by Paul Eggert. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible ad739a2b 2010-09-17T04:13:58 unlockpt: Fix declaration within GNULIB_POSIXCHECK. * lib/stdlib.in.h (unlockpt): Fix warning declaration.
Bruno Haible 858adc30 2010-09-17T04:05:32 login_tty: Make the replacement code work on BSD systems. * lib/login_tty.c: Include <sys/ioctl.h>. (login_tty): Use ioctl TIOCSCTTY when available. * modules/login_tty (Depends-on): Add sys_ioctl. Reported by Mats Erik Andersson <mats.andersson@gisladisker.se>.
Bruno Haible 12e33440 2010-09-17T03:16:53 New module 'tcgetsid'. * lib/tcgetsid.c: New file. * m4/tcgetsid.m4: New file. * modules/tcgetsid: New file. * modules/termios (Depends-on): Add c++defs, warn-on-use. (Makefile.am): Ensure c++defs.h, warn-on-use.h get included. Substitute GNULIB_TCGETSID, HAVE_TCGETSID. * lib/termios.in.h: Include <sys/types.h>. (tcgetsid): New declaration. * m4/termios_h.m4 (gl_TERMIOS_H): Check whether tcgetsid is declared. (gl_TERMIOS_H_DEFAULTS): Initialize GNULIB_TCGETSID, HAVE_TCGETSID. * doc/posix-functions/tcgetsid.texi: Mention the new module. * tests/test-termios-c++.cc: Check GNULIB_NAMESPACE::tcgetsid.
Bruno Haible 6dcf524e 2010-09-17T02:02:23 New module 'termios'. * modules/termios: New file. * lib/termios.in.h: New file. * m4/termios_h.m4: New file. * doc/posix-headers/termios.texi: Mention the new module.
Eric Blake 9ea0943b 2010-09-16T17:12:35 fdutimensat: add an atflag parameter * lib/fdutimensat.c (fdutimensat): Add new parameter. * lib/utimens.h (fdutimensat): Update prototype. * tests/test-fdutimensat.c: Adjust test to match. * NEWS: Document the change. Suggested by Paul Eggert. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible 61d87288 2010-09-17T00:23:14 Fix typos in comments.
Bruno Haible 556455d6 2010-09-16T02:25:57 stdlib: clarify MirBSD WEXITSTATUS bug * lib/stdlib.in.h: Clarify the MirBSD bug regarding WEXITSTATUS. * doc/posix-headers/stdlib.texi (stdlib.h): Likewise.
Eric Blake 91935a63 2010-09-15T15:25:43 stdlib: work around MirBSD WEXITSTATUS bug * lib/stdlib.in.h (includes): Guarantee WEXITSTATUS. * modules/stdlib (Depends-on): Add sys_wait. * tests/test-sys_wait.c (main): Enhance test. * tests/test-stdlib.c (main): Likewise. * doc/posix-headers/stdlib.texi (stdlib.h): Document the bug. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible c98cb289 2010-09-15T02:43:33 unistr/base: Avoid link errors when module 'libunistring' is also used. * lib/unistr.in.h (u8_mbtouc_unsafe, u16_mbtouc_unsafe, u32_mbtouc_unsafe, u8_mbtouc, u16_mbtouc, u32_mbtouc, u8_mbtoucr, u16_mbtoucr, u32_mbtoucr, u8_uctomb_aux, u16_uctomb_aux, u32_uctomb): Declare also when HAVE_LIBUNISTRING is set. Reported by Pádraig Brady <P@draigbrady.com>.
Paul Eggert 93785052 2010-09-14T09:03:55 fts, getcwd, glob: audit for dirfd returning -1 * lib/fts.c (opendir): Remove #define; no longer used. (opendirat): New arg PDIR_FD. All callers changed. (fts_build, _opendir2): Use new opendirat to avoid the need for dirfd, or for checking whether dirfd returns a negative value. Don't use opendir; always use openat followed by fdopendir. * lib/getcwd.c (__getcwd): Don't reset fd; fdopendir no longer clobbers it. * lib/glob.c (link_exists_p): Add comment explaining why dirfd never returns -1 here. * modules/fts (Depends-on): Remove dirfd. * modules/getcwd (Depends-on): Likewise.
Paul Eggert 0971365e 2010-09-13T12:38:41 fts: use O_NOFOLLOW to avoid race condition when opening a directory * lib/fts.c (opendirat): New arg extra_flags. (__opendir2): Use it to avoid following symlinks when opening a directory, if symlinks are not supposed to be followed. See <http://lists.gnu.org/archive/html/bug-gnulib/2010-09/msg00213.html>.
Paul Eggert 970c9038 2010-09-13T12:21:47 fdopendir: preserve argument fd before returning * lib/fdopendir.c: Adjust comments to say POSIX, not Solaris. (fdopendir_with_dup, fd_clone_opendir): New static functions. (fdopendir): Use them, arranging for FD to be open to the same directory that it was when it started. (It might be temporarily closed while fdopendir is running, so this not thread- or signal-safe.) Be careful to do the right thing even when file descriptors are scarce and dup fails with errno == EMFILE. See <http://lists.gnu.org/archive/html/bug-gnulib/2010-09/msg00208.html>.
Jim Meyering 40af2cd5 2010-09-13T07:29:18 fts: don't operate on an invalid file descriptor after failed dup * lib/fts.c (fts_build): Don't call set_cloexec_flag on a negative file descriptor.
Paul Eggert cd3df448 2010-09-12T14:21:52 savedir: add streamsavedir, deprecate fdsavedir * NEWS: Mention deprecation of fdsavedir. * lib/savedir.c (streamsavedir): New extern function, whose name ends in "savedir" to be consistent with the others. This differs from savedirstream in that it doesn't close its argument. The next version of GNU tar will use this instead of fdsavedir, to avoid some race conditions and conserve file descriptors. (savedirstream): Reimplement as a wrapper around streamsavedir. (fdsavedir): Add a comment deprecating this function. As far as I know, only GNU tar used it, and GNU tar doesn't need it any more. * lib/savedir.h (streamsavedir): New decl. (fdsavedir): Add a comment deprecating this.
Bruno Haible 7356a7c0 2010-09-10T21:42:19 relocatable-prog-wrapper: Fix compilation failure due to O_EXEC. * lib/progreloc.c (O_EXEC): Define fallback.
Paul Eggert ffb0b299 2010-09-10T11:55:27 fcntl-h: define O_CLOEXEC and O_EXEC if not defined; use new defines * doc/posix-headers/fcntl.texi (fcntl.h): Document that O_CLOEXEC is now defined to 0 if it is not defined, like other flags. Also, O_EXEC is now defined to be O_RDONLY if O_EXEC is not defined. Similarly for O_SEARCH; this last was already true, but not documented. * lib/fcntl.in.h (O_CLOEXEC): Define to 0 if not defined. * lib/dup-safer-flag.c (O_CLOEXEC): Remove now-useless #define. * lib/dup3.c, lib/pipe2.c, tests/test-dup-safer.c, tests/test-fcntl.c: Likewise. * lib/popen-safer.c (open_noinherit): Check whether O_CLOEXEC is zero, not whether it is defined. * tests/test-dup3.c, tests/test-pipe2.c (main): Likewise. * lib/progreloc.c (find_executable): Use O_EXEC rather than O_RDONLY. * lib/open.c (open): Check for O_SEARCH as well as for O_RDONLY.
Bruno Haible 3f322af6 2010-09-10T20:23:49 langinfo, nl_langinfo: Fix for IRIX 5.3. * m4/langinfo_h.m4 (gl_LANGINFO_H): Test whether langinfo.h defines T_FMT_AMPM, YESEXPR. Set HAVE_LANGINFO_T_FMT_AMPM, HAVE_LANGINFO_YESEXPR. * modules/langinfo (Makefile.am): Substitute HAVE_LANGINFO_T_FMT_AMPM, HAVE_LANGINFO_YESEXPR. * lib/langinfo.in.h (T_FMT_AMPM, GNULIB_defined_T_FMT_AMPM): Define if HAVE_LANGINFO_T_FMT_AMPM is 0. (YESEXPR, NOEXPR, GNULIB_defined_YESEXPR): Define if HAVE_LANGINFO_YESEXPR is 0. * lib/nl_langinfo.c (rpl_nl_langinfo): Handle also T_FMT_AMPM, YESEXPR, NOEXPR. * doc/posix-headers/langinfo.texi: Mention the IRIX 5.3 problem. * doc/posix-functions/nl_langinfo.texi: Likewise. Reported by Eric Blake.
Bruno Haible cc85acd7 2010-09-10T12:02:44 pty, readutmp: Fix for FreeBSD 8.0 and OpenBSD 4.6. * doc/glibc-functions/login_tty.texi: Mention the include file problem on FreeBSD 8.0 and OpenBSD 4.6. * lib/pty.in.h: Include <sys/types.h> before <libutil.h>. * m4/pty_h.m4 (gl_PTY_H): Likewise. * m4/pty.m4 (gl_FUNC_FORKPTY, gl_FUNC_OPENPTY): Likewise. * m4/readutmp.m4 (gl_READUTMP): Include <sys/types.h> before <utmp.h>. Invoke AC_INCLUDES_DEFAULT instead of using the undocumented variable ac_includes_default. Reported by Mats Erik Andersson <mats.andersson@gisladisker.se>.
Eric Blake c753b7ca 2010-09-09T17:05:15 strsignal: work around NetBSD bug * m4/strsignal.m4 (gl_FUNC_STRSIGNAL): Also check in <unistd.h>. * lib/string.in.h (includes): Likewise. * doc/posix-functions/strsignal.texi (strsignal): Document the bug. Reported by Nelson H. F. Beebe. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 74faf641 2010-09-01T21:34:44 strtod: work around IRIX 6.5 bug IRIX mis-parses "1e 1" as 10.0 and "" instead of 1.0 and "e 1". Because the original parse may differ from the reparse in terms of whether the value overflows, we have to do an errno dance. * lib/strtod.c (strtod): Reparse number on shorter string if exponent parse was invalid. * tests/test-strtod.c (main): Add check for "0x1p 2". Reported by Tom G. Christensen. Signed-off-by: Eric Blake <eblake@redhat.com>
Karl Berry 29c7cb2d 2010-09-07T17:44:22 regex documentation update from Reuben Thomas <rrt@sc3d.org>, 20 Aug 2010 12:04:39 +0100
Bruno Haible 043938ff 2010-09-05T10:42:02 uniwidth/width: Update comment. * lib/uniwidth/width.c (uc_width): Update comment for Unicode >= 3.1. Reported by Emanuele Giaquinta <emanuele.giaquinta@gmail.com>.
Bruno Haible c7ddffce 2010-09-04T13:40:30 strdup: Fix compilation error in C++ mode. * lib/string.in.h (strdup): In C++ mode with GNULIB_NAMESPACE, undefine the macro.
Bruno Haible a16c31d9 2010-09-04T13:35:19 dirfd: Fix compilation error in C++ mode on MacOS X, *BSD, IRIX. * lib/dirent.in.h (dirfd): In C++ mode with GNULIB_NAMESPACE, turn the macro into a function. Reported by Jarno Rajahalme <jarno.rajahalme@nsn.com>.
Paul Eggert 0fd6a77f 2010-09-02T12:51:40 hash: fix safe_hasher const typo * lib/hash.c (safe_hasher): Result is pointer, not pointer to const; otherwise, there is a type error later.
Bruno Haible 0ad84b52 2010-09-02T11:15:39 wctype: Avoid compilation error on IRIX 6.5.30. * lib/wctype.in.h (iswblank): Declare with a replacement if REPLACE_ISWBLANK is set. * m4/wctype_h.m4 (gl_WCTYPE_H): Check also whether iswblank is declared. Set REPLACE_ISWBLANK. * modules/wctype (Makefile.am): Substitute REPLACE_ISWBLANK. * doc/posix-functions/iswblank.texi: Mention the IRIX 6.5.30 problem. * doc/posix-headers/wctype.texi: Likewise. Reported by Tom G. Christensen <tgc@jupiterrise.com>.
Paul Eggert 24816be6 2010-09-01T13:45:53 fcntl-h, etc.: prefer O_SEARCH to O_RDONLY when applicable POSIX 2008 specifies a new 'open' flag O_SEARCH, which can be used when one needs search access to a directory but not read access. On systems where it is available, it works in some cases where O_RDONLY does not, namely on directories that are searchable but not readable, and which need only to be searchable. If O_SEARCH is not available, fall back to the traditional method of using O_RDONLY. * lib/fcntl.in.h (O_SEARCH): #define to O_RDONLY if not defined. * lib/chdir-long.c (cdb_advance_fd): Use O_SEARCH, not O_RDONLY, when opening a directory that needs only to be searchable. * lib/chdir-safer.c (chdir_no_follow): Likewise. * lib/fts.c (diropen, fts_open, fd_ring_check): Likewise. * lib/openat-proc.c (openat_proc_name): Likewise. * lib/openat.c (openat_needs_fchdir): Likewise. * lib/save-cwd.c (save_cwd): Likewise. * lib/savewd.c (savewd_save, savewd_chdir): Likewise.
Eric Blake c0ebdfe2 2010-08-31T10:10:32 hash: factor, and guard against misbehaving hasher function * lib/hash.c (safe_hasher): New function, to encapsulate the checking of table->hasher's return value. Also protect against a hash value so large that adding it to table->bucket results in a NULL pointer. (hash_lookup, hash_get_next, hash_find_entry, transfer_entries): Use it in place of open-coded check-and-abort.
Bruno Haible e8504907 2010-08-31T08:43:53 hash: silence spurious clang warning * lib/hash.c (hash_get_next): Remove unnecessary test against NULL. Reported by Eric Blake.
Bruno Haible 4ebe9ebc 2010-08-29T21:13:46 Make the module 'realloc-gnu' work again on AIX and OSF/1.
Bruno Haible 9f802acb 2010-08-29T19:29:56 Make the module 'calloc-gnu' work again on AIX and OSF/1.
Bruno Haible 560be60e 2010-08-29T19:20:47 Make the module 'malloc-gnu' work again on AIX and OSF/1.
Bruno Haible 32a3eff7 2010-08-28T16:22:14 read-file: Don't occupy too much unused memory.
Giuseppe Scrivano 3e53db21 2010-08-28T16:12:37 read-file: Avoid memory reallocations with regular files. * lib/read-file.c: Include <sys/stat.h>, <stdio.h>, <stdint.h>. (fread_file): With regular files, use the remaining length as the initial buffer size. Check against overflow. * modules/read-file (Depends-on): Add ftello, malloc-posix, stdint, sys_stat.
Bruno Haible 63d392e0 2010-08-28T11:12:58 Avoid relocwrapper link errors due to gnulib replacement functions.
Erik Faye-Lund 0a051206 2010-08-26T09:48:55 poll: return immediately on POLLHUP. * lib/poll.c (poll): Always set timeout before wait_timeout is computed.
Bruno Haible a9ec89b0 2010-08-24T09:37:58 priv-set: fix comment
Paul Eggert 5a2d7e19 2010-08-23T22:34:00 priv-set: fix comments * lib/priv-set.c (priv_set_remove, priv_set_restore): Fix comments to match code, as suggested by David Bartley in: http://lists.gnu.org/archive/html/bug-tar/2010-08/msg00018.html
Paolo Bonzini 51c2a233 2010-08-23T09:35:43 poll, select: handle ERROR_BROKEN_PIPE. * lib/poll.c (win32_compute_revents): Return POLLHUP when PeekNamedPipe fails with ERROR_BROKEN_PIPE. * lib/select.c (win32_compute_revents): Do not mark a pipe as writeable if PeekNamedPipe fails with ERROR_BROKEN_PIPE.
Giuseppe Scrivano 06728e05 2010-08-22T10:20:42 fts: allow compilation with C++ * lib/fts_.h: Specify extern "C" linkage with C++.
Bruno Haible c5728261 2010-08-16T02:09:11 stpncpy: Allow stpncpy to be defined as a macro.
Bruno Haible a6e3f90b 2010-08-15T00:42:00 Rename module 'memxfrm' to 'amemxfrm'.
Bruno Haible 4e487569 2010-08-15T00:19:47 New module 'astrxfrm'.
Brian Gough fb0f15d4 2010-08-14T19:57:11 git-merge-changelog: add doc relating to use with bzr and hg.
Paul Eggert b88cc81f 2010-08-10T10:39:30 strtod: fix const diagnostic * lib/strtod.c (strtod): Don't assign const char * to char *, as this elicits a warning from GCC when warnings are enabled.
Pádraig Brady 91fd3b18 2010-06-10T15:12:48 copy-acl: ignore ENOTSUP on HP-UX Fixes Coreutils bug 6053. * lib/acl-internal.h (ACL_NOT_WELL_SUPPORTED): Move definition up, so that it is available for HP-UX. * lib/copy-acl.c (qcopy_acl): Use it. Reported by Patrick M. Callahan. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake be5bb85c 2010-08-09T11:16:07 readlinkat: split into its own module * modules/symlinkat: Split readlinkat... * modules/readlinkat: ...into separate module. * m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Move readlinkat check... * m4/readlinkat.m4 (gl_FUNC_READLINAT): ...to new file. * lib/symlinkat.c (readlinkat): Move... * lib/readlinkat.c: ...into new file. * modules/symlinkat-tests: Split readlinkat test... * modules/readlinkat-tests: ...into separate module. * tests/test-symlinkat.c: Split... * tests/test-readlinkat.c: ...into new file. * NEWS: Document the split. * doc/posix-functions/readlinkat.texi (readlinkat): Likewise. * lib/unistd.in.h (readlinkat): Likewise. Suggested by Bruno Haible. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible acc26249 2010-08-08T12:31:10 memxfrm: Speed up.
Bruno Haible 1b274345 2010-07-31T22:10:38 unistr/u8-strstr, unistr/u16-strstr: Optimize the one-character case.
Bruno Haible 1027106b 2010-07-31T21:32:47 unistr/u8-chr, unistr/u8-strchr: Optimize and add comments.
Bruno Haible 9a09e829 2010-07-31T21:28:55 unistr/u8-strchr: Fix several bugs.
Bruno Haible 772a6b7e 2010-07-31T15:20:35 linkat: Work around AIX 7.1 bug.
Bruno Haible ba62d45b 2010-07-31T11:45:41 duplocale: Work around AIX 7.1 bug.
Bruno Haible d614713a 2010-07-30T23:54:44 dirfd: Avoid link error on AIX 7.1.
Eric Blake e95ae6d7 2010-07-30T16:01:41 strtod: next round of AIX fixes * lib/strtod.c (strtod): Work around AIX bug of parsing p with no exponent. * tests/test-strtod.c (main): Enhance tests. * doc/posix-functions/strtod.texi (strtod): Document next bug. Reported by Rainer Tammer. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake f4c549fa 2010-07-29T17:32:23 strtod: fix bug in replacement function on AIX * lib/strtod.c (strtod): Special case broken "0x" parse in underlying strtod. * tests/test-strtod.c (main): Document AIX 7.1 bugs. * doc/posix-functions/strtod.texi (strtod): Likewise. Reported by Rainer Tammer. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible 9ce199fb 2010-07-28T23:00:52 unistr/u*-chr, unistr/u*-strchr: Fix link errors and warnings.
Bruno Haible 7816a90a 2010-07-28T10:08:37 Use spaces for indentation, not tabs.
Bruno Haible fa8d7866 2010-07-28T00:53:16 mbspcasecmp: Fix function specification.
Paul R. Eggert 84ee3b1c 2010-07-26T10:56:32 timespec: use cast and not conditional, as truncation isn't possible * lib/timespec.h (timespec_cmp): Use cast to pacify gcc -Wconversion instead of a conditional. Comment about the situation in more detail. This undoes most of the 2009-10-29 patch.
Paolo Bonzini b48afd89 2010-07-20T15:47:47 unistr/u8-chr, unistr/u8-strchr: use Boyer-Moore like algorithm. * lib/unistr/u8-chr.c, lib/unistr/u8-strchr.c: Add Boyer-Moore like operation. * modules/unistr/u8-chr: Depend on memchr.
Bruno Haible e240ab43 2010-07-18T17:23:36 unistr/u8-strchr: Optimize non-ASCII argument case.
Paul R. Eggert b1ef417a 2010-07-14T00:06:03 getcwd: on Solaris, work better if ancestors are inaccessible * lib/getcwd.c (__getcwd): If getcwd returns EINVAL for zero buffer and size, try again with a large buffer. This works better on Solaris, since its getcwd succeeds even if the path to the root is inaccessible, and this is helpful in common cases such as .zfs hidden directories. Problem reported by J Chapman Flack in http://lists.gnu.org/archive/html/bug-tar/2010-06/msg00000.html Use system getcwd if it's declared, not merely if it's partly working; use the partly-working test only to avoid needless effort if the system getcwd fails. * m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Omit comment that was already obsolete and is now even more obsolete. * modules/getcwd (Depends-on): Depend on strdup, since __getcwd now might call strdup.
Paul R. Eggert 7f2ece89 2010-07-13T15:55:36 pthread: Add enough so that coreutils/src/sort.c compiles. * lib/pthread.in.h: Add self to author comment. Conditionalize on _GL_PTHREAD_H, not PTHREAD_H_, for consistency with the rest of gnulib. Include <sched.h> and <time.h>, as per POSIX. Include <sys/types.h>, in case it defines pthread_t. (pthread_t, pthread_attr_t, pthread_barrier_t, pthread_barrierattr_t): (pthread_cond_t, pthread_condattr_t, pthread_key_t, pthread_mutex_t): (pthread_mutexattr_t, pthread_once_t, pthread_rwlock_t): (pthread_rwlockattr_t, pthread_spinlock_t): New typedefs, if HAVE_PTHREAD_T is not defined. (PTHREAD_COND_INITIALIZER, PTHREAD_MUTEX_INITIALIZER): (PTHREAD_ONCE_INIT, PTHREAD_RWLOCK_INITIALIZER): (PTHREAD_BARRIER_SERIAL_THREAD, PTHREAD_CANCEL_DEFERRED): (PTHREAD_CANCEL_ASYNCHRONOUS, PTHREAD_CANCEL_ENABLE): (PTHREAD_CANCEL_DISABLE, PTHREAD_CANCELED, PTHREAD_CREATE_JOINABLE): (PTHREAD_CREATE_DETACHED, PTHREAD_INHERIT_SCHED): (PTHREAD_EXPLICIT_SCHED, PTHREAD_MUTEX_DEFAULT, PTHREAD_MUTEX_NORMAL): (PTHREAD_MUTEX_ERRORCHECK, PTHREAD_MUTEX_RECURSIVE): (PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_ROBUST, PTHREAD_PRIO_NONE): (PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT, PTHREAD_PROCESS_PRIVATE): (PTHREAD_PROCESS_SHARED, PTHREAD_SCOPE_SYSTEM, PTHREAD_SCOPE_PROCESS): New macros. (pthread_cond_destroy, pthread_cond_init, pthread_cond_signal): (pthread_cond_wait, pthread_exit, pthread_mutex_destroy): (pthread_mutex_init, pthread_mutex_lock, pthread_mutex_unlock): (pthread_spin_init, pthread_spin_lock, pthread_spin_trylock); (pthread_spin_unlock): New dummy functions. (pthread_create): Return EAGAIN; don't set errno. * m4/pthread.m4 (gl_PTHREAD_CHECK): Check for pthread_t, and require AC_C_INLINE. * modules/pthread (Depends-on): Add sched, time. (pthread.h): Use AM_V_GEN.
Bruno Haible 5432287a 2010-07-13T23:43:14 striconveh: Simplify last commit.
Bruno Haible 8099cad6 2010-07-13T23:36:41 striconveh: Don't malloc memory if the result buffer is sufficient.
Bruno Haible 911a49d5 2010-07-13T10:07:23 strtod: Add safety check.
Paul R. Eggert 444cc405 2010-07-12T10:58:35 memcoll: clarify sizes versus lengths, document better, and tweak perf * lib/memcoll.c (strcoll_loop, memcoll0): Improve quality of descriptive comments. Name variables consistently as to whether they are lengths (which do not include terminating null) versus sizes (which do). * lib/xmemcoll.c (xmemcoll0): Likewise. * lib/memcoll.c (strcoll_loop): Tweak the way that the diff is returned when s1size == 0; this is easier to compile and saves about 17% of memcoll's code space on x86-64 with GCC 4.1.2.
Bruno Haible 5518d301 2010-07-12T18:54:13 New module '_Exit'.
Paul R. Eggert 3458f09c 2010-07-12T09:14:10 strtod: make it more-accurate typically, and don't require libm * lib/strtod.c (_GL_ARG_NONNULL): Remove; no longer needed. Include limits.h. Don't include string.h. (HAVE_LDEXP_IN_LIBC, HAVE_RAW_DECL_STRTOD): Define to 0 if not defined. (locale_isspace): New function, so that no casts are needed to check whether *s is a space. (ldexp): Provide an unused dummy if not available. (scale_radix_exp, parse_number, underlying_strtod): New functions. (strtod): Use them. This implementation prefers to use the underlying strtod if available, falling back on our own code only to fix known bugs. This is more likely to produce an accurate result. Also, it avoids the use of libm functions. * m4/strtod.m4 (gl_FUNC_STRTOD): Don't invoke _AC_LIBOBJ_STRTOD; no longer needed. Invoke AC_LIBOBJ([strtod]); don't know why this was absent, but it caused a test failure with coreutils. (gl_PREREQ_STRTOD): Check wither ldexp can be used without linking with libm. * modules/strtod (Makefile.am, Link): libm is no longer needed. * modules/strtod-tests (Makefile.am): Likewise.
Pádraig Brady a365288b 2010-07-11T15:28:55 unistr/u8-strchr: Optimize ASCII argument case.
Paul Eggert 277aeb36 2010-07-08T18:16:40 (x)memcoll: minor tweaks * lib/memcoll.c (strcoll_loop): Prefer the style where 'const' is after the type that it qualifies. (memcoll0): Likewise. * lib/memcoll.h (memcoll0): Likewise. * lib/xmemcoll.c (collate_error, xmemcoll0): Likewise. * lib/xmemcoll.h (xmemcoll0): Likewise. * lib/memcoll.c (memcoll0): Correct the comment. This function differs from memcoll in that the NUL byte is part of the argument. Omit the abort-checks, as performance is a real issue here. Plus, the checks were wrong anyway (an off-by-one error). Omit local variable 'diff', as it's a bit clearer that way. * m4/memcoll.m4 (gl_MEMCOLL): Omit AC_FUNC_STRCOLL, as it's no longer needed.
Chen Guo 9f31a791 2010-07-08T15:50:11 (x)memcoll: speedup when input is known to be NUL delimited * lib/memcoll.c: Include stdlib. (memcoll0) New function. (strcoll_loop) New function, refactored for use in both memcoll and memcoll0. * lib/memcoll.h: Add prototype for memcoll0. * lib/xmemcoll.c: (xmemcoll0) New function. (collate_error) New function, refactored for use in both xmemcoll and xmemcoll0. * lib/xmemcoll.h: Add prototype for xmemcoll0. * m4/memcoll.m4: add inline invocation.
Bruno Haible 6892ce27 2010-07-04T23:48:16 fsusage: Clarify which code applies to which platforms.
Jim Meyering fbc47512 2010-07-04T10:54:38 hash: once again explicitly disallow insertion of NULL * lib/hash.c (hash_insert0): Reinstate just-removed test: inserting a NULL pointer cannot work with these functions. Add a comment with details. This reverts part of the 2010-07-01 commit, 5bef1a35 "hash: extend module to deal with non-pointer keys".
Jim Meyering 5bef1a35 2010-07-01T23:17:25 hash: extend module to deal with non-pointer keys * lib/hash.c (hash_insert0): New interface, much like hash_insert but that allows insertion of non-pointer entries. Do not disallow an ENTRY value of NULL. (hash_insert): This is now just a thin wrapper. Call hash_insert0. * lib/hash.h (hash_insert0): Declare.
Bruno Haible 7740412b 2010-06-30T02:19:54 string: Fix syntax error with g++ 2.96.
Eric Blake fffd5fac 2010-06-21T16:16:44 memmem: slight optimization For any needle, the factorization 0/n has a local period of 1, so it is a critical factorization iff the entire needle consists only of a single repeated byte, in which case 1/n-1 would also be critical. Starting with a comparison of x[0] and x[1] in the maximal suffix check will either find the 0/n case or move on to something else, so we can optimize and start with the x[1] vs. x[2] case to begin with. To avoid out-of-bounds references, we must then special case needles of length two or less. However, for these cases, we can determine a critical factorization without any probes of the needle (we already require a non-empty needle; a 1-byte needle can factor as either 0/1 or 1/0 but the rest of our code assumes a non-empty suffix; and of the two 2-byte needle patterns, "aa" can factor as either 0/2 or 1/1 but with best performance for 1/1, and "ab" must be factored as 1/1). * lib/str-two-way.h (critical_factorization): Update comments. Reduce work during factorization phase. Reported by Carlos Bueno <carlos@bueno.org>. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible 12619428 2010-06-22T00:20:46 Fix HAVE_CALLOC_POSIX misnomer.
Bruno Haible 8924d470 2010-06-22T00:11:19 Fix HAVE_REALLOC_POSIX misnomer.
Bruno Haible 3ac9b457 2010-06-22T00:06:29 Fix HAVE_MALLOC_POSIX misnomer.
Richard Lloyd 86ba51d2 2010-06-20T13:31:40 stdio.in.h: fix compilation failure when using HP-UX 11's C compiler * lib/stdio.in.h: Remove excess _GL_CXXALIAS_RPL macro argument. This macro takes 3 arguments, not 4.
René Berber 3bf58aa1 2010-06-15T10:29:07 select: Correct timeout.
Paul Eggert 823b6cf1 2010-06-14T12:20:22 priv-set: Don't assume that priv.h exists merely because getppriv does. See Jan Andersen's bug report about AIX 5L in http://lists.gnu.org/archive/html/bug-tar/2010-06/msg00019.html * m4/priv-set.m4 (gl_PRIV_SET): Check for priv.h. * lib/priv-set.c: Do nothing unless HAVE_PRIV_H. * lib/priv-set.h: Likewise. * tests/test-priv-set.c: Likewise.
Jim Meyering db74d417 2010-06-09T18:22:25 inttostr: add a new function, inttostr, and tests The namesake function was not available. The existence of the template file, inttostr.c makes its addition nontrivial. * lib/anytostr.c: Rename from inttostr.c. (anytostr): Rename from inttostr. * lib/inttostr.c: New file. * modules/inttostr (Files): Add anytostr.c. (Makefile.am): Set lib_SOURCES instead of ... * m4/inttostr.m4: Remove uses of AC_LIBOBJ. * lib/imaxtostr.c: Update use. s/inttostr/anytostr/ * lib/offtostr.c: Likewise. * lib/uinttostr.c: Likewise. * lib/umaxtostr.c: Likewise. * modules/inttostr-tests: New file. * tests/test-inttostr.c: New file. Test these functions.
Bruno Haible 16290063 2010-06-09T15:30:40 Avoid relocwrapper link errors due to gnulib replacement functions.
Bruno Haible fc06be3f 2010-06-09T12:47:59 Avoid relocwrapper link errors due to gnulib replacement functions.
Bruno Haible 7c59efd8 2010-06-09T12:40:40 Module setenv does not depend on 'malloc-posix', 'realloc-posix'.
Jim Meyering 7873eb96 2010-06-07T07:58:49 regex: avoid new dead-code warning with gcc-4.6.0 * lib/regex_internal.c (re_string_reconstruct): #if-0-out a dead if-block containing a while-loop. It's been unused for at least 5 years.
Bruno Haible 820ad111 2010-06-03T16:25:01 time: Undefine more broken macros.
Eric Blake df6774c0 2010-06-02T11:08:06 time: work with mingw + pthreads-win32 library When using the pthreads-win32 library with mingw, struct timespec is available in <pthread.h>. Meanwhile, that header has some rather buggy macros for localtime_r and gmtime_r that interfere with proper gnulib replacement header actions. Tested in a cross-compilation environment: Fedora 13 with mingw32-gcc and mingw32-pthreads installed. * m4/time_h.m4 (gl_CHECK_TYPE_STRUCT_TIMESPEC): Set new variable if timespec is defined only in pthread.h. * modules/time (Makefile.am): Substitute it. * lib/time.in.h (!TIME_H_DEFINES_STRUCT_TIMESPEC): Include <pthread.h>, when needed. (GNULIB_TIME_R): Undefine broken localtime_r and gmtime_r macros from the library. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible d270926f 2010-05-24T23:00:42 Don't use conversion with transliteration in u{8,16,32}_strcoll.
Bruno Haible 5a4965c0 2010-05-24T12:23:03 regex: Don't require alloca.
Bruno Haible e967460a 2010-05-23T18:03:16 git-merge-changelog: Enable --split-merged-entry by default.
Bruno Haible 1fcaaedf 2010-05-19T22:11:00 Avoid valgrind error reports from libunistring.
Bruno Haible 1495c20d 2010-05-18T20:11:42 New module 'libunistring-optional'.
Bruno Haible a43e2416 2010-05-16T14:16:03 Fix collision between gnulib's and libintl's printf replacements.
Bruno Haible 047f9441 2010-05-09T12:16:00 error: Use system's fcntl function.