summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* linkat: Work around AIX 7.1 bug.Bruno Haible2010-07-311-2/+26
|
* duplocale: Work around AIX 7.1 bug.Bruno Haible2010-07-311-1/+3
|
* dirfd: Avoid link error on AIX 7.1.Bruno Haible2010-07-311-2/+13
|
* strtod: next round of AIX fixesEric Blake2010-07-301-4/+14
| | | | | | | | | | * 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>
* strtod: fix bug in replacement function on AIXEric Blake2010-07-301-4/+9
| | | | | | | | | | * 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>
* unistr/u*-chr, unistr/u*-strchr: Fix link errors and warnings.Bruno Haible2010-07-281-0/+2
|
* Use spaces for indentation, not tabs.Bruno Haible2010-07-286-21/+21
|
* mbspcasecmp: Fix function specification.Bruno Haible2010-07-282-11/+9
|
* timespec: use cast and not conditional, as truncation isn't possiblePaul R. Eggert2010-07-261-4/+28
| | | | | | * 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.
* unistr/u8-chr, unistr/u8-strchr: use Boyer-Moore like algorithm.Paolo Bonzini2010-07-232-71/+246
| | | | | * lib/unistr/u8-chr.c, lib/unistr/u8-strchr.c: Add Boyer-Moore like operation. * modules/unistr/u8-chr: Depend on memchr.
* unistr/u8-strchr: Optimize non-ASCII argument case.Bruno Haible2010-07-181-3/+3
|
* getcwd: on Solaris, work better if ancestors are inaccessiblePaul R. Eggert2010-07-141-8/+25
| | | | | | | | | | | | | | | | * 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.
* pthread: Add enough so that coreutils/src/sort.c compiles.Paul R. Eggert2010-07-131-17/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* striconveh: Simplify last commit.Bruno Haible2010-07-131-8/+3
|
* striconveh: Don't malloc memory if the result buffer is sufficient.Bruno Haible2010-07-131-7/+16
|
* strtod: Add safety check.Bruno Haible2010-07-131-1/+6
|
* memcoll: clarify sizes versus lengths, document better, and tweak perfPaul R. Eggert2010-07-122-30/+28
| | | | | | | | | | | * 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.
* New module '_Exit'.Bruno Haible2010-07-122-0/+50
|
* strtod: make it more-accurate typically, and don't require libmPaul R. Eggert2010-07-121-203/+216
| | | | | | | | | | | | | | | | | | | | | * 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.
* unistr/u8-strchr: Optimize ASCII argument case.Pádraig Brady2010-07-111-6/+21
|
* (x)memcoll: minor tweaksPaul Eggert2010-07-084-24/+17
| | | | | | | | | | | | | | | | * 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.
* (x)memcoll: speedup when input is known to be NUL delimitedChen Guo2010-07-084-40/+85
| | | | | | | | | | | | | * 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.
* fsusage: Clarify which code applies to which platforms.Bruno Haible2010-07-041-5/+8
|
* hash: once again explicitly disallow insertion of NULLJim Meyering2010-07-041-1/+8
| | | | | | | | * 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".
* hash: extend module to deal with non-pointer keysJim Meyering2010-07-012-18/+43
| | | | | | | | * 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.
* string: Fix syntax error with g++ 2.96.Bruno Haible2010-06-301-16/+22
|
* memmem: slight optimizationEric Blake2010-06-221-19/+40
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix HAVE_CALLOC_POSIX misnomer.Bruno Haible2010-06-221-1/+1
|
* Fix HAVE_REALLOC_POSIX misnomer.Bruno Haible2010-06-221-1/+1
|
* Fix HAVE_MALLOC_POSIX misnomer.Bruno Haible2010-06-221-1/+1
|
* stdio.in.h: fix compilation failure when using HP-UX 11's C compilerRichard Lloyd2010-06-201-1/+1
| | | | | * lib/stdio.in.h: Remove excess _GL_CXXALIAS_RPL macro argument. This macro takes 3 arguments, not 4.
* select: Correct timeout.René Berber2010-06-151-1/+1
|
* priv-set: Don't assume that priv.h exists merely because getppriv does.Paul Eggert2010-06-142-2/+2
| | | | | | | | | 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.
* inttostr: add a new function, inttostr, and testsJim Meyering2010-06-107-64/+69
| | | | | | | | | | | | | | | | | 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.
* Avoid relocwrapper link errors due to gnulib replacement functions.Bruno Haible2010-06-091-4/+16
|
* Avoid relocwrapper link errors due to gnulib replacement functions.Bruno Haible2010-06-097-0/+23
|
* Module setenv does not depend on 'malloc-posix', 'realloc-posix'.Bruno Haible2010-06-091-0/+3
|
* regex: avoid new dead-code warning with gcc-4.6.0Jim Meyering2010-06-071-1/+3
| | | | | | * 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.
* time: Undefine more broken macros.Bruno Haible2010-06-031-2/+7
|
* time: work with mingw + pthreads-win32 libraryEric Blake2010-06-021-1/+6
| | | | | | | | | | | | | | | | | | | | 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>
* Don't use conversion with transliteration in u{8,16,32}_strcoll.Bruno Haible2010-05-244-10/+15
|
* regex: Don't require alloca.Bruno Haible2010-05-241-0/+2
|
* git-merge-changelog: Enable --split-merged-entry by default.Bruno Haible2010-05-231-3/+4
|
* Avoid valgrind error reports from libunistring.Bruno Haible2010-05-191-0/+9
|
* New module 'libunistring-optional'.Bruno Haible2010-05-1811-0/+0
|
* Fix collision between gnulib's and libintl's printf replacements.Bruno Haible2010-05-163-10/+18
|
* error: Use system's fcntl function.Bruno Haible2010-05-091-0/+3
|
* verify: adjust formatting to be more consistentJim Meyering2010-05-091-3/+3
| | | | | * lib/verify.h (_GL_GENSYM): Add a space before each of a few argument-list '('s, and after one comma.
* error: More reliable output on mingw.Bruno Haible2010-05-091-2/+27
|
* vasnprintf: Fix syntax errors in libintl build on mingw.Bruno Haible2010-05-091-1/+3
|