diff options
author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2009-01-22 16:04:28 +0000 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2009-01-22 16:04:28 +0000 |
commit | 91772298b0377ab805e19085f60a7808fe62d157 (patch) | |
tree | 520a9015fd8ce7aebbd503814b5758dfe9b07cba | |
parent | 2f22f00640b79531879bf21afc9727483934ac65 (diff) | |
download | uClibc-alpine-91772298b0377ab805e19085f60a7808fe62d157.tar.bz2 uClibc-alpine-91772298b0377ab805e19085f60a7808fe62d157.tar.xz |
Synch with trunk: miscellaneous changes, mostly cleanup,
code styling, comments. No object-code changes.
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
-rw-r--r-- | Rules.mak | 27 | ||||
-rw-r--r-- | extra/Configs/Config.in | 42 | ||||
-rw-r--r-- | include/fcntl.h | 10 | ||||
-rw-r--r-- | include/sched.h | 8 | ||||
-rw-r--r-- | include/sys/types.h | 2 | ||||
-rw-r--r-- | include/time.h | 2 | ||||
-rw-r--r-- | include/tls.h | 2 | ||||
-rw-r--r-- | include/unistd.h | 1 | ||||
-rw-r--r-- | ldso/libdl/libdl.c | 18 | ||||
-rw-r--r-- | libc/inet/resolv.c | 69 | ||||
-rw-r--r-- | libc/string/arm/strncmp.S | 101 | ||||
-rw-r--r-- | libc/string/i386/rawmemchr.c | 24 | ||||
-rw-r--r-- | libc/string/i386/strchrnul.c | 47 | ||||
-rw-r--r-- | libc/sysdeps/linux/arm/posix_fadvise.c | 19 | ||||
-rw-r--r-- | libc/sysdeps/linux/arm/posix_fadvise64.c | 17 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/_exit.c | 10 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/bits/sigcontext.h | 3 | ||||
-rw-r--r-- | libc/sysdeps/linux/i386/posix_fadvise64.S | 26 | ||||
-rw-r--r-- | libc/sysdeps/linux/ia64/bits/syscalls.h | 191 | ||||
-rw-r--r-- | libnsl/Makefile.in | 7 | ||||
-rw-r--r-- | libpthread/linuxthreads.old/sysdeps/pthread/pthread.h | 2 | ||||
-rw-r--r-- | libpthread/linuxthreads/sysdeps/pthread/pthread.h | 2 | ||||
-rw-r--r-- | libresolv/Makefile.in | 7 | ||||
-rw-r--r-- | test/regex/tst-regex2.c | 44 | ||||
-rw-r--r-- | test/regex/tst-regexloc.c | 15 |
25 files changed, 388 insertions, 308 deletions
@@ -185,7 +185,8 @@ ifeq ($(CONFIG_386)$(CONFIG_486)$(CONFIG_586)$(CONFIG_586MMX),y) # NB: this may make SSE insns segfault! # -O1 -march=pentium3, -Os -msse etc are known to be affected. # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13685 - OPTIMIZATION+=$(call check_gcc,-mpreferred-stack-boundary=2,) + # -m32 is needed if host is 64-bit + OPTIMIZATION+=$(call check_gcc,-m32 -mpreferred-stack-boundary=2,) else OPTIMIZATION+=$(call check_gcc,-mpreferred-stack-boundary=4,) endif @@ -432,6 +433,30 @@ ifndef LDPIEFLAG export LDPIEFLAG:=$(shell $(LD) --help 2>/dev/null | grep -q -- -pie && echo "-pie") endif +# Check for --as-needed support in linker +ifndef LD_FLAG_ASNEEDED +_LD_FLAG_ASNEEDED:=$(shell $(LD) --help 2>/dev/null | grep -- --as-needed) +ifneq ($(_LD_FLAG_ASNEEDED),) +export LD_FLAG_ASNEEDED:=--as-needed +endif +endif +ifndef LD_FLAG_NO_ASNEEDED +ifdef LD_FLAG_ASNEEDED +export LD_FLAG_NO_ASNEEDED:=--no-as-needed +endif +endif +ifndef CC_FLAG_ASNEEDED +ifdef LD_FLAG_ASNEEDED +export CC_FLAG_ASNEEDED:=-Wl,$(LD_FLAG_ASNEEDED) +endif +endif +ifndef CC_FLAG_NO_ASNEEDED +ifdef LD_FLAG_NO_ASNEEDED +export CC_FLAG_NO_ASNEEDED:=-Wl,$(LD_FLAG_NO_ASNEEDED) +endif +endif +link.asneeded = $(if $(and $(CC_FLAG_ASNEEDED),$(CC_FLAG_NO_ASNEEDED)),$(CC_FLAG_ASNEEDED) $(1) $(CC_FLAG_NO_ASNEEDED)) + # Check for AS_NEEDED support in linker script (binutils>=2.16.1 has it) ifndef ASNEEDED export ASNEEDED:=$(shell $(LD) --help 2>/dev/null | grep -q -- --as-needed && echo "AS_NEEDED ( $(UCLIBC_LDSO) )" || echo "$(UCLIBC_LDSO)") diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index 734545eb9..e6ea80a42 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -372,27 +372,6 @@ config UCLIBC_HAS_THREADS If your applications require pthreads, answer Y. -config UCLIBC_HAS_THREADS_NATIVE - bool "Native POSIX Thread Library (NPTL) Support" - depends on UCLIBC_HAS_THREADS - default n - help - If you want to compile uClibc with NPTL support, then answer Y. - - IMPORTANT NOTE! NPTL requires a Linux 2.6 kernel, binutils - at least version 2.16 and GCC with at least version 4.1.0. NPTL - will not work with older versions of any above sources. If you - ignore any of these guidelines, you do so at your own risk. Do - not ask for help on any of the development mailing lists. - - !!!! WARNING !!!! BIG FAT WARNING !!!! REALLY BIG FAT WARNING !!!! - - This is experimental code and at times it may not even build and - even if it does it might decide to do random damage. This code is - potentially hazardous to your health and sanity. It will remain - that way until further notice at which point this notice will - disappear. Thank you for your support and for not smoking. - config PTHREADS_DEBUG_SUPPORT bool "Build pthreads debugging support" default n @@ -424,6 +403,27 @@ config LINUXTHREADS_OLD the latest code from glibc, so it may be the only choice for the newer ports (like alpha/amd64/64bit arches and hppa). +config UCLIBC_HAS_THREADS_NATIVE + bool "Native POSIX Threading (NPTL) Support" + depends on UCLIBC_HAS_THREADS + default n + help + If you want to compile uClibc with NPTL support, then answer Y. + + IMPORTANT NOTE! NPTL requires a Linux 2.6 kernel, binutils + at least version 2.16 and GCC with at least version 4.1.0. NPTL + will not work with older versions of any above sources. If you + ignore any of these guidelines, you do so at your own risk. Do + not ask for help on any of the development mailing lists. + + !!!! WARNING !!!! BIG FAT WARNING !!!! REALLY BIG FAT WARNING !!!! + + This is experimental code and at times it may not even build and + even if it does it might decide to do random damage. This code is + potentially hazardous to your health and sanity. It will remain + that way until further notice at which point this notice will + disappear. Thank you for your support and for not smoking. + config LINUXTHREADS_NEW def_bool y depends on UCLIBC_HAS_THREADS && !LINUXTHREADS_OLD && !UCLIBC_HAS_THREADS_NATIVE diff --git a/include/fcntl.h b/include/fcntl.h index d7a8e8e35..8c3768216 100644 --- a/include/fcntl.h +++ b/include/fcntl.h @@ -80,11 +80,6 @@ extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64); # define fcntl fcntl64 # endif #endif - -#ifdef __UCLIBC_HAS_THREADS_NATIVE__ -extern int __fcntl_nocancel (int fd, int cmd, ...); -#endif - #ifdef __USE_LARGEFILE64 extern int fcntl64 (int __fd, int __cmd, ...); libc_hidden_proto(fcntl64) @@ -229,6 +224,11 @@ extern int __REDIRECT (posix_fallocate, (int __fd, __off64_t __offset, # define posix_fallocate posix_fallocate64 # endif # endif + +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ +extern int __fcntl_nocancel (int fd, int cmd, ...); +#endif + # ifdef __USE_LARGEFILE64 extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len); # endif diff --git a/include/sched.h b/include/sched.h index 37132c54b..0d110c303 100644 --- a/include/sched.h +++ b/include/sched.h @@ -79,14 +79,14 @@ extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize, /* Get the CPU affinity for a task */ extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize, cpu_set_t *__cpuset) __THROW; -#endif - -__END_DECLS -/* These are Linux specific. */ extern int __clone (int (*__fn) (void *__arg), void *__child_stack, int __flags, void *__arg, ...); extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base, size_t __child_stack_size, int __flags, void *__arg, ...); +#endif + +__END_DECLS + #endif /* sched.h */ diff --git a/include/sys/types.h b/include/sys/types.h index 8c0b5dce3..7e29dc832 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -1,5 +1,5 @@ /* Copyright (C) 1991,1992,1994,1995,1996,1997,1998,1999,2000,2001,2002 - Free Software Foundation, Inc. + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/include/time.h b/include/time.h index 99528fce7..4f060be03 100644 --- a/include/time.h +++ b/include/time.h @@ -195,7 +195,7 @@ extern double difftime (time_t __time1, time_t __time0) __THROW __attribute__ ((__const__)); #endif /* __UCLIBC_HAS_FLOATS__ */ -# define CLOCK_IDFIELD_SIZE 3 +#define CLOCK_IDFIELD_SIZE 3 /* Return the `time_t' representation of TP and normalize TP. */ extern time_t mktime (struct tm *__tp) __THROW; diff --git a/include/tls.h b/include/tls.h index a1da3827b..f88af405b 100644 --- a/include/tls.h +++ b/include/tls.h @@ -5,7 +5,7 @@ #include_next <tls.h> -#if USE_TLS && HAVE___THREAD \ +#if defined USE_TLS && USE_TLS && HAVE___THREAD \ && (!defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt) # define USE___THREAD 1 diff --git a/include/unistd.h b/include/unistd.h index 48757f244..eb0d94595 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -773,7 +773,6 @@ libc_hidden_proto(vfork) /* Special exit function which only terminates the current thread. */ extern void __exit_thread (int val) __attribute__ ((noreturn)); - /* Return the pathname of the terminal FD is open on, or NULL on errors. The returned storage is good only until the next call to this function. */ extern char *ttyname (int __fd) __THROW; diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c index 0e683e3ea..ab9abf5a9 100644 --- a/ldso/libdl/libdl.c +++ b/ldso/libdl/libdl.c @@ -32,7 +32,7 @@ #include <ldso.h> #include <stdio.h> -#include <string.h> +#include <string.h> /* Needed for 'strstr' prototype' */ #include <stdbool.h> #include <tls.h> @@ -86,9 +86,7 @@ extern char *_dl_debug; * the symbols that otherwise would have been loaded in from ldso... */ #ifdef __SUPPORT_LD_DEBUG__ -/* Needed for 'strstr' prototype' */ -#include <string.h> -char *_dl_debug = NULL; +char *_dl_debug = NULL; char *_dl_debug_symbols = NULL; char *_dl_debug_move = NULL; char *_dl_debug_reloc = NULL; @@ -100,8 +98,8 @@ int _dl_debug_file = 2; const char *_dl_progname = ""; /* Program name */ void *(*_dl_malloc_function)(size_t); void (*_dl_free_function) (void *p); -char *_dl_library_path = NULL; /* Where we look for libraries */ -char *_dl_ldsopath = NULL; /* Location of the shared lib loader */ +char *_dl_library_path = NULL; /* Where we look for libraries */ +char *_dl_ldsopath = NULL; /* Location of the shared lib loader */ int _dl_errno = 0; /* We can't use the real errno in ldso */ size_t _dl_pagesize = PAGE_SIZE; /* Store the page size for use later */ /* This global variable is also to communicate with debuggers such as gdb. */ @@ -272,9 +270,11 @@ remove_slotinfo(size_t idx, struct dtv_slotinfo_list *listp, size_t disp, void dl_cleanup(void) __attribute__ ((destructor)); void dl_cleanup(void) { - struct dyn_elf *d; - for (d = _dl_handles; d; d = d->next_handle) { - do_dlclose(d, 1); + struct dyn_elf *h, *n; + + for (h = _dl_handles; h; h = n) { + n = h->next_handle; + do_dlclose(h, 1); } } diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 16802856e..10e25fb5c 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -180,47 +180,47 @@ __UCLIBC_MUTEX_EXTERN(__resolv_lock); /* libc_hidden_proto(strnlen) */ /* Experimentally off - libc_hidden_proto(strstr) */ /* Experimentally off - libc_hidden_proto(strcasecmp) */ -libc_hidden_proto(socket) +/* libc_hidden_proto(socket) */ /* libc_hidden_proto(close) */ -libc_hidden_proto(fopen) +/* libc_hidden_proto(fopen) */ /* libc_hidden_proto(fclose) */ -libc_hidden_proto(random) -libc_hidden_proto(getservbyport) -libc_hidden_proto(uname) -libc_hidden_proto(inet_addr) -libc_hidden_proto(inet_aton) -libc_hidden_proto(inet_pton) -libc_hidden_proto(inet_ntop) -libc_hidden_proto(connect) -libc_hidden_proto(poll) -libc_hidden_proto(select) -libc_hidden_proto(recv) -libc_hidden_proto(send) -libc_hidden_proto(printf) -libc_hidden_proto(sprintf) -libc_hidden_proto(snprintf) -libc_hidden_proto(fgets) -libc_hidden_proto(gethostbyname) -libc_hidden_proto(gethostbyname_r) -libc_hidden_proto(gethostbyname2_r) -libc_hidden_proto(gethostbyaddr) -libc_hidden_proto(gethostbyaddr_r) -libc_hidden_proto(ns_name_uncompress) -libc_hidden_proto(ns_name_unpack) -libc_hidden_proto(ns_name_ntop) -libc_hidden_proto(res_init) -libc_hidden_proto(res_query) -libc_hidden_proto(res_querydomain) -libc_hidden_proto(gethostent_r) +/* libc_hidden_proto(random) */ +/* libc_hidden_proto(getservbyport) */ +/* libc_hidden_proto(gethostname) */ +/* libc_hidden_proto(uname) */ +/* libc_hidden_proto(inet_addr) */ +/* libc_hidden_proto(inet_aton) */ +/* libc_hidden_proto(inet_pton) */ +/* libc_hidden_proto(inet_ntop) */ +/* libc_hidden_proto(connect) */ +/* libc_hidden_proto(poll) */ +/* libc_hidden_proto(select) */ +/* libc_hidden_proto(recv) */ +/* libc_hidden_proto(send) */ +/* libc_hidden_proto(printf) */ +/* libc_hidden_proto(sprintf) */ +/* libc_hidden_proto(snprintf) */ +/* libc_hidden_proto(fgets) */ +/* libc_hidden_proto(getnameinfo) */ +/* libc_hidden_proto(gethostbyname) */ +/* libc_hidden_proto(gethostbyname_r) */ +/* libc_hidden_proto(gethostbyname2_r) */ +/* libc_hidden_proto(gethostbyaddr) */ +/* libc_hidden_proto(gethostbyaddr_r) */ +/* libc_hidden_proto(ns_name_uncompress) */ +/* libc_hidden_proto(ns_name_unpack) */ +/* libc_hidden_proto(ns_name_ntop) */ +/* libc_hidden_proto(res_init) */ +/* libc_hidden_proto(res_query) */ +/* libc_hidden_proto(res_querydomain) */ +/* libc_hidden_proto(gethostent_r) */ /* libc_hidden_proto(fprintf) */ -libc_hidden_proto(__h_errno_location) +/* libc_hidden_proto(__h_errno_location) */ #ifdef __UCLIBC_HAS_XLOCALE__ /* libc_hidden_proto(__ctype_b_loc) */ #elif defined __UCLIBC_HAS_CTYPE_TABLES__ /* libc_hidden_proto(__ctype_b) */ #endif -int getdomainname(char *name, size_t len); -libc_hidden_proto(getdomainname) #define MAX_RECURSE 5 @@ -1180,6 +1180,7 @@ struct hostent *gethostbyname2(const char *name, int family) return hp; #endif /* __UCLIBC_HAS_IPV6__ */ } +libc_hidden_def(gethostbyname2) #endif @@ -1256,7 +1257,7 @@ void res_close(void) which can have an alias. */ struct __res_state _res __attribute__((section (".bss"))); #else -struct __res_state _res __attribute__((section (".bss"))) ;//attribute_hidden; +struct __res_state _res __attribute__((section (".bss"))) attribute_hidden; # if defined __UCLIBC_HAS_THREADS_NATIVE__ # undef __resp diff --git a/libc/string/arm/strncmp.S b/libc/string/arm/strncmp.S deleted file mode 100644 index 8487639c8..000000000 --- a/libc/string/arm/strncmp.S +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2002 ARM Ltd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the company may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Adapted for uClibc from NetBSD strncmp.S, version 1.2 2003/04/05 - * by Erik Andersen <andersen@codepoet.org> - */ - -#include <features.h> -#include <bits/arm_asm.h> - -.text -.global strncmp -.type strncmp,%function -.align 4 - -#if defined(THUMB1_ONLY) -.thumb_func -strncmp: - /* if (len == 0) return 0 */ - cmp r2, #0 - bne 1f - mov r0, #0 - bx lr -1: - push {r4} - - /* ip == last src address to compare */ - add r4, r0, r2 -2: - cmp r4, r0 - beq 3f - ldrb r2, [r0] - add r0, r0, #1 - ldrb r3, [r1] - add r1, r1, #1 - cmp r2, #0 - beq 3f - cmp r2, r3 - beq 2b -3: - sub r0, r2, r3 - pop {r4} - bx lr -#else -strncmp: - /* if (len == 0) return 0 */ - cmp r2, #0 - IT(tt, eq) - moveq r0, #0 -#if defined(__USE_BX__) - bxeq lr -#else - moveq pc, lr -#endif - subs r2, r2, #1 - - /* ip == last src address to compare */ - add ip, r0, r2 -1: - ldrb r2, [r0], #1 - ldrb r3, [r1], #1 - cmp ip, r0 - IT(tt, cs) - cmpcs r2, #1 - cmpcs r2, r3 - beq 1b - sub r0, r2, r3 -#if defined(__USE_BX__) - bx lr -#else - mov pc, lr -#endif -#endif - -.size strncmp,.-strncmp - -libc_hidden_weak(strncmp) diff --git a/libc/string/i386/rawmemchr.c b/libc/string/i386/rawmemchr.c new file mode 100644 index 000000000..be0b142c3 --- /dev/null +++ b/libc/string/i386/rawmemchr.c @@ -0,0 +1,24 @@ +/* + * Adapted from strlen.c code + * + * Copyright (C) 2008 Denys Vlasenko <vda.linux@googlemail.com> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include <string.h> + +#undef rawmemchr +void *rawmemchr(const void *s, int c) +{ + void *eax; + int ecx, edi; + __asm__ __volatile__( + " repne; scasb\n" + " leal -1(%%edi), %%eax\n" + : "=&c" (ecx), "=&D" (edi), "=&a" (eax) + : "0" (0xffffffff), "1" (s), "2" (c) + ); + return eax; +} +libc_hidden_def(rawmemchr) diff --git a/libc/string/i386/strchrnul.c b/libc/string/i386/strchrnul.c new file mode 100644 index 000000000..c4da2b587 --- /dev/null +++ b/libc/string/i386/strchrnul.c @@ -0,0 +1,47 @@ +/* + * Adapted from strchr.c code + * + * Copyright (C) 2008 Denys Vlasenko <vda.linux@googlemail.com> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include <string.h> + +#undef strchrnul +//#define strchrnul TESTING +char *strchrnul(const char *s, int c) +{ + int esi; + char *eax; + __asm__ __volatile__( + " movb %%al, %%ah\n" + "1: lodsb\n" + " cmpb %%ah, %%al\n" + " je 2f\n" + " testb %%al, %%al\n" + " jnz 1b\n" + /* with this, we'd get strchr(): */ + /* " movl $1, %%esi\n" */ + "2: leal -1(%%esi), %%eax\n" + : "=a" (eax), "=&S" (esi) + : "0" (c), "1" (s) + /* no clobbers */ + ); + return eax; +} +#ifndef strchrnul +libc_hidden_def(strchrnul) +#else +/* Uncomment TESTING, gcc -D_GNU_SOURCE -m32 -Os strchrnul.c -o strchrnul + * and run ./strchrnul + */ +int main() +{ + static const char str[] = "abc.def"; + printf((char*)strchrnul(str, '.') - str == 3 ? "ok\n" : "BAD!\n"); + printf((char*)strchrnul(str, '*') - str == 7 ? "ok\n" : "BAD!\n"); + printf((char*)strchrnul(str, 0) - str == 7 ? "ok\n" : "BAD!\n"); + printf((char*)strchrnul(str+3, '.') - str == 3 ? "ok\n" : "BAD!\n"); +} +#endif diff --git a/libc/sysdeps/linux/arm/posix_fadvise.c b/libc/sysdeps/linux/arm/posix_fadvise.c index bb4ac7b0c..b23eb3d6b 100644 --- a/libc/sysdeps/linux/arm/posix_fadvise.c +++ b/libc/sysdeps/linux/arm/posix_fadvise.c @@ -9,12 +9,21 @@ */ #include <sys/syscall.h> #include <fcntl.h> + #if defined __NR_arm_fadvise64_64 + +/* Was named __libc_posix_fadvise for some inexplicable reason. +** google says only uclibc has *__libc*_posix_fadviseXXX, +** so it cannot be compat with anything. +** +** Remove this comment and one at the end after 0.9.31 +*/ + /* This is for the ARM version of fadvise64_64 which swaps the params * * about to avoid having ABI compat issues * */ #define __NR___syscall_arm_fadvise64_64 __NR_arm_fadvise64_64 -int __libc_posix_fadvise(int fd, off_t offset, off_t len, int advise) +int posix_fadvise(int fd, off_t offset, off_t len, int advise) { INTERNAL_SYSCALL_DECL (err); int ret = INTERNAL_SYSCALL (arm_fadvise64_64, err, 6, fd, advise, @@ -24,13 +33,15 @@ int __libc_posix_fadvise(int fd, off_t offset, off_t len, int advise) if (INTERNAL_SYSCALL_ERROR_P (ret, err)) return INTERNAL_SYSCALL_ERRNO (ret, err); return 0; - } -weak_alias(__libc_posix_fadvise, posix_fadvise); + +/* weak_alias(__libc_posix_fadvise, posix_fadvise); */ + #else + int posix_fadvise(int fd attribute_unused, off_t offset attribute_unused, off_t len attribute_unused, int advice attribute_unused) { return ENOSYS; } -#endif +#endif diff --git a/libc/sysdeps/linux/arm/posix_fadvise64.c b/libc/sysdeps/linux/arm/posix_fadvise64.c index 479b0c5a2..4b27381d1 100644 --- a/libc/sysdeps/linux/arm/posix_fadvise64.c +++ b/libc/sysdeps/linux/arm/posix_fadvise64.c @@ -20,11 +20,19 @@ #ifdef __UCLIBC_HAS_LFS__ #if defined __NR_arm_fadvise64_64 + +/* Was named __libc_posix_fadvise64 for some inexplicable reason. +** google says only uclibc has *__libc*_posix_fadviseXXX, +** so it cannot be compat with anything. +** +** Remove this comment and one at the end after 0.9.31 +*/ + /* This is for the ARM version of fadvise64_64 which swaps the params * about to avoid having ABI compat issues */ #define __NR___syscall_arm_fadvise64_64 __NR_arm_fadvise64_64 -int __libc_posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advise) +int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advise) { INTERNAL_SYSCALL_DECL (err); int ret = INTERNAL_SYSCALL (arm_fadvise64_64, err, 6, fd, advise, @@ -36,11 +44,16 @@ int __libc_posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advise) return INTERNAL_SYSCALL_ERRNO (ret, err); return 0; } -weak_alias(__libc_posix_fadvise64, posix_fadvise64); + +/* weak_alias(__libc_posix_fadvise64, posix_fadvise64); */ + #else + int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advise) { return ENOSYS; } + #endif + #endif diff --git a/libc/sysdeps/linux/common/_exit.c b/libc/sysdeps/linux/common/_exit.c index 518a6d2e8..a0b891d25 100644 --- a/libc/sysdeps/linux/common/_exit.c +++ b/libc/sysdeps/linux/common/_exit.c @@ -12,6 +12,9 @@ #include <unistd.h> #include <sys/types.h> #include <sys/syscall.h> +#ifdef __UCLIBC_HAS_THREADS__ +#include <sysdep.h> +#endif /* libc_hidden_proto(_exit) */ @@ -25,6 +28,13 @@ void attribute_noreturn _exit(int status) { /* The loop is added only to keep gcc happy. */ while(1) + { +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ +# ifdef __NR_exit_group + INLINE_SYSCALL(exit_group, 1, status); +# endif +#endif INLINE_SYSCALL(exit, 1, status); + } } libc_hidden_def(_exit) diff --git a/libc/sysdeps/linux/common/bits/sigcontext.h b/libc/sysdeps/linux/common/bits/sigcontext.h index 67dcf9498..35bf5bc89 100644 --- a/libc/sysdeps/linux/common/bits/sigcontext.h +++ b/libc/sysdeps/linux/common/bits/sigcontext.h @@ -25,5 +25,8 @@ we need sigcontext. */ # define sigcontext_struct sigcontext +# ifndef __user +# define __user +# endif # include <asm/sigcontext.h> #endif diff --git a/libc/sysdeps/linux/i386/posix_fadvise64.S b/libc/sysdeps/linux/i386/posix_fadvise64.S index b99b35ee7..17f006aa8 100644 --- a/libc/sysdeps/linux/i386/posix_fadvise64.S +++ b/libc/sysdeps/linux/i386/posix_fadvise64.S @@ -22,10 +22,17 @@ #include <bits/errno.h> #include <sys/syscall.h> +/* Was named __libc_posix_fadvise64 for some inexplicable reason. +** google says only uclibc has *__libc*_posix_fadviseXXX, +** so it cannot be compat with anything. +** +** Remove this comment and one at the end after 0.9.31 +*/ + .text -.global __libc_posix_fadvise64 -.type __libc_posix_fadvise64,%function -__libc_posix_fadvise64: +.global posix_fadvise64 +.type posix_fadvise64,%function +posix_fadvise64: #if defined __NR_fadvise64_64 /* Save regs */ pushl %ebp @@ -91,10 +98,11 @@ overflow: /* Successful; return the syscall's value. */ ret -.size __libc_posix_fadvise64,.-__libc_posix_fadvise64 - -libc_hidden_def(__libc_posix_fadvise64) -#if defined __UCLIBC_HAS_LFS__ && defined __UCLIBC_HAS_ADVANCED_REALTIME__ -weak_alias(__libc_posix_fadvise64,posix_fadvise64) -#endif +.size posix_fadvise64,.-posix_fadvise64 +/* +** libc_hidden_def(__libc_posix_fadvise64) +** #if defined __UCLIBC_HAS_LFS__ && defined __UCLIBC_HAS_ADVANCED_REALTIME__ +** weak_alias(__libc_posix_fadvise64,posix_fadvise64) +** #endif +*/ diff --git a/libc/sysdeps/linux/ia64/bits/syscalls.h b/libc/sysdeps/linux/ia64/bits/syscalls.h index 0c3d6ca3a..6722da933 100644 --- a/libc/sysdeps/linux/ia64/bits/syscalls.h +++ b/libc/sysdeps/linux/ia64/bits/syscalls.h @@ -30,30 +30,118 @@ #include <errno.h> -#define SYS_ify(syscall_name) (__NR_##syscall_name) - #undef IA64_USE_NEW_STUB -/* taken from asm-ia64/break.h */ +#undef _syscall0 +#define _syscall0(type,name) \ + type name(void) \ +{ \ +return (type) (INLINE_SYSCALL(name, 0)); \ +} + +#undef _syscall1 +#define _syscall1(type,name,type1,arg1) \ + type name(type1 arg1) \ +{ \ +return (type) (INLINE_SYSCALL(name, 1, arg1)); \ +} + +#undef _syscall2 +#define _syscall2(type,name,type1,arg1,type2,arg2) \ + type name(type1 arg1,type2 arg2) \ +{ \ +return (type) (INLINE_SYSCALL(name, 2, arg1, arg2)); \ +} + +#undef _syscall3 +#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ + type name(type1 arg1,type2 arg2,type3 arg3) \ +{ \ +return (type) (INLINE_SYSCALL(name, 3, arg1, arg2, arg3)); \ +} +#undef _syscall4 +#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ + type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ +{ \ +return (type) (INLINE_SYSCALL(name, 4, arg1, arg2, arg3, arg4)); \ +} + +#undef _syscall5 +#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ + type5,arg5) \ +type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ +{ \ +return (type) (INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5)); \ +} + +#undef _syscall6 +#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ + type5,arg5,type6,arg6) \ +type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \ +{ \ +return (type) (INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6)); \ +} + #define __IA64_BREAK_SYSCALL 0x100000 -#define ___IA64_BREAK_SYSCALL "0x100000" - -#define _DO_SYSCALL(name, nr, args...) \ - LOAD_ARGS_##nr (args) \ - register long _r8 __asm__ ("r8"); \ - register long _r10 __asm__ ("r10"); \ - register long _r15 __asm__ ("r15") = SYS_ify(name); \ - long _retval; \ - LOAD_REGS_##nr \ - __asm__ __volatile__ ("break " ___IA64_BREAK_SYSCALL ";;\n\t" \ - : "=r" (_r8), "=r" (_r10), "=r" (_r15) ASM_OUTARGS_##nr \ - : "2" (_r15) ASM_ARGS_##nr \ - : "memory" ASM_CLOBBERS_##nr); \ - _retval = _r8; \ - if (_r10 == -1) { \ - __set_errno (_retval); \ - _retval = -1; \ - } + +/* mostly taken from glibc sysdeps/unix/sysv/linux/ia64/sysdep.h */ +#define BREAK_INSN_1(num) "break " #num ";;\n\t" +#define BREAK_INSN(num) BREAK_INSN_1(num) + +/* On IA-64 we have stacked registers for passing arguments. The + "out" registers end up being the called function's "in" + registers. + + Also, since we have plenty of registers we have two return values + from a syscall. r10 is set to -1 on error, whilst r8 contains the + (non-negative) errno on error or the return value on success. + */ + +# define DO_INLINE_SYSCALL_NCS(name, nr, args...) \ + LOAD_ARGS_##nr (args) \ + register long _r8 __asm__ ("r8"); \ + register long _r10 __asm__ ("r10"); \ + register long _r15 __asm__ ("r15") = name; \ + long _retval; \ + LOAD_REGS_##nr \ + __asm __volatile (BREAK_INSN (__IA64_BREAK_SYSCALL) \ + : "=r" (_r8), "=r" (_r10), "=r" (_r15) \ + ASM_OUTARGS_##nr \ + : "2" (_r15) ASM_ARGS_##nr \ + : "memory" ASM_CLOBBERS_##nr); \ + _retval = _r8; + +#define DO_INLINE_SYSCALL(name, nr, args...) \ + DO_INLINE_SYSCALL_NCS (__NR_##name, nr, ##args) + +#undef INLINE_SYSCALL +#define INLINE_SYSCALL(name, nr, args...) \ + ({ \ + DO_INLINE_SYSCALL_NCS (__NR_##name, nr, args) \ + if (_r10 == -1) \ + { \ + __set_errno (_retval); \ + _retval = -1; \ + } \ + _retval; }) + +#undef INTERNAL_SYSCALL_DECL +#define INTERNAL_SYSCALL_DECL(err) long int err + +#undef INTERNAL_SYSCALL +#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ + ({ \ + DO_INLINE_SYSCALL_NCS (name, nr, args) \ + err = _r10; \ + _retval; }) +#define INTERNAL_SYSCALL(name, err, nr, args...) \ + INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) + +#undef INTERNAL_SYSCALL_ERROR_P +#define INTERNAL_SYSCALL_ERROR_P(val, err) (err == -1) + +#undef INTERNAL_SYSCALL_ERRNO +#define INTERNAL_SYSCALL_ERRNO(val, err) (val) #define LOAD_ARGS_0() #define LOAD_REGS_0 @@ -102,15 +190,6 @@ #define ASM_OUTARGS_5 ASM_OUTARGS_4, "=r" (_out4) #define ASM_OUTARGS_6 ASM_OUTARGS_5, "=r" (_out5) -#ifdef IA64_USE_NEW_STUB -#define ASM_ARGS_0 -#define ASM_ARGS_1 ASM_ARGS_0, "4" (_out0) -#define ASM_ARGS_2 ASM_ARGS_1, "5" (_out1) -#define ASM_ARGS_3 ASM_ARGS_2, "6" (_out2) -#define ASM_ARGS_4 ASM_ARGS_3, "7" (_out3) -#define ASM_ARGS_5 ASM_ARGS_4, "8" (_out4) -#define ASM_ARGS_6 ASM_ARGS_5, "9" (_out5) -#else #define ASM_ARGS_0 #define ASM_ARGS_1 ASM_ARGS_0, "3" (_out0) #define ASM_ARGS_2 ASM_ARGS_1, "4" (_out1) @@ -118,7 +197,6 @@ #define ASM_ARGS_4 ASM_ARGS_3, "6" (_out3) #define ASM_ARGS_5 ASM_ARGS_4, "7" (_out4) #define ASM_ARGS_6 ASM_ARGS_5, "8" (_out5) -#endif #define ASM_CLOBBERS_0 ASM_CLOBBERS_1, "out0" #define ASM_CLOBBERS_1 ASM_CLOBBERS_2, "out1" @@ -126,6 +204,7 @@ #define ASM_CLOBBERS_3 ASM_CLOBBERS_4, "out3" #define ASM_CLOBBERS_4 ASM_CLOBBERS_5, "out4" #define ASM_CLOBBERS_5 ASM_CLOBBERS_6, "out5" +#define ASM_CLOBBERS_6 ASM_CLOBBERS_6_COMMON , "b7" #define ASM_CLOBBERS_6_COMMON , "out6", "out7", \ /* Non-stacked integer registers, minus r8, r10, r15. */ \ "r2", "r3", "r9", "r11", "r12", "r13", "r14", "r16", "r17", "r18", \ @@ -138,55 +217,5 @@ /* Branch registers. */ \ "b6" -#ifdef IA64_USE_NEW_STUB -# define ASM_CLOBBERS_6 ASM_CLOBBERS_6_COMMON -#else -# define ASM_CLOBBERS_6 ASM_CLOBBERS_6_COMMON , "b7" -#endif - - - -#define _syscall0(type,name) \ -type name(void) \ -{ \ - _DO_SYSCALL(name, 0); return (type) _retval; \ -} - -#define _syscall1(type,name,type1,arg1) \ -type name(type1 arg1) \ -{ \ - _DO_SYSCALL(name, 1, arg1); return (type) _retval; \ -} - -#define _syscall2(type,name,type1,arg1,type2,arg2) \ -type name(type1 arg1, type2 arg2) \ -{ \ - _DO_SYSCALL(name, 2, arg1, arg2); return (type) _retval; \ -} - -#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ -type name(type1 arg1, type2 arg2, type3 arg3) \ -{ \ - _DO_SYSCALL(name, 3, arg1, arg2, arg3); return (type) _retval; \ -} - -#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ -type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ -{ \ - _DO_SYSCALL(name, 4, arg1, arg2, arg3, arg4); return (type) _retval; \ -} - -#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \ -type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ -{ \ - _DO_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5); return (type) _retval; \ -} - -#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \ -type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \ -{ \ - _DO_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6); return (type) _retval; \ -} - #endif /* __ASSEMBLER__ */ #endif /* _BITS_SYSCALLS_H */ diff --git a/libnsl/Makefile.in b/libnsl/Makefile.in index 0995b3c4f..03a7703f2 100644 --- a/libnsl/Makefile.in +++ b/libnsl/Makefile.in @@ -7,12 +7,7 @@ CFLAGS-libnsl := -DNOT_IN_libc -DIS_IN_libnsl $(SSP_ALL_CFLAGS) -LDFLAGS-libnsl.so := $(LDFLAGS) -ifdef ASNEEDED -ifeq ($(UCLIBC_HAS_SSP),y) -LDFLAGS-libnsl.so += -Wl,--no-as-needed -lc -Wl,--as-needed -endif -endif +LDFLAGS-libnsl.so := $(LDFLAGS) $(call link.asneeded,-lc) LIBS-libnsl.so := $(LIBS) diff --git a/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h b/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h index f8ab69721..6ef2dbe15 100644 --- a/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h +++ b/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h @@ -295,7 +295,7 @@ extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict #ifdef __USE_GNU /* Initialize thread attribute *ATTR with attributes corresponding to the - already running thread TH. It shall be called on unitialized ATTR + already running thread TH. It shall be called on uninitialized ATTR and destroyed with pthread_attr_destroy when no longer needed. */ extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW; #endif diff --git a/libpthread/linuxthreads/sysdeps/pthread/pthread.h b/libpthread/linuxthreads/sysdeps/pthread/pthread.h index 0b777be19..947f911a6 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/pthread.h +++ b/libpthread/linuxthreads/sysdeps/pthread/pthread.h @@ -292,7 +292,7 @@ extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict #ifdef __USE_GNU /* Initialize thread attribute *ATTR with attributes corresponding to the - already running thread TH. It shall be called on unitialized ATTR + already running thread TH. It shall be called on uninitialized ATTR and destroyed with pthread_attr_destroy when no longer needed. */ extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW; #endif diff --git a/libresolv/Makefile.in b/libresolv/Makefile.in index 4b4d781c1..5ccfeebbf 100644 --- a/libresolv/Makefile.in +++ b/libresolv/Makefile.in @@ -7,12 +7,7 @@ CFLAGS-libresolv := -DNOT_IN_libc -DIS_IN_libresolv $(SSP_ALL_CFLAGS) -LDFLAGS-libresolv.so := $(LDFLAGS) -ifdef ASNEEDED -ifeq ($(UCLIBC_HAS_SSP),y) -LDFLAGS-libresolv.so += -Wl,--no-as-needed -lc -Wl,--as-needed -endif -endif +LDFLAGS-libresolv.so := $(LDFLAGS) $(call link.asneeded,-lc) LIBS-libresolv.so := $(LIBS) diff --git a/test/regex/tst-regex2.c b/test/regex/tst-regex2.c index db7c533b3..2e2b85f62 100644 --- a/test/regex/tst-regex2.c +++ b/test/regex/tst-regex2.c @@ -27,6 +27,7 @@ do_test(void) struct stat st; unsigned len; int testno; + int exitcode = 0; int fd = open(fname, O_RDONLY); if (fd < 0) { @@ -71,14 +72,16 @@ do_test(void) char errstr[300]; regerror(err, &rbuf, errstr, sizeof(errstr)); puts(errstr); - return err; + exitcode = 1; + goto contin1; } regmatch_t pmatch[71]; err = regexec(&rbuf, string, 71, pmatch, 0); if (err == REG_NOMATCH) { puts("regexec failed"); - return 1; + exitcode = 1; + goto contin1; } if (testno == 0) { @@ -91,7 +94,8 @@ do_test(void) ) != 0 ) { puts("regexec without REG_NOSUB did not find the correct match"); - return 1; + exitcode = 1; + goto contin1; } if (i > 0) { @@ -102,7 +106,8 @@ do_test(void) || pmatch[l].rm_eo != pmatch[l].rm_so + 1 ) { printf("pmatch[%d] incorrect\n", l); - return 1; + exitcode = 1; + goto contin1; } } } @@ -118,6 +123,7 @@ do_test(void) stop.tv_usec -= start.tv_usec; printf(" %lu.%06lus\n", (unsigned long) stop.tv_sec, (unsigned long) stop.tv_usec); + contin1: regfree(&rbuf); } } @@ -140,22 +146,26 @@ do_test(void) s = re_compile_pattern(pat[i], strlen(pat[i]), &rpbuf); if (s != NULL) { printf("%s\n", s); - return 1; + exitcode = 1; + goto contin2; } memset(®s, 0, sizeof(regs)); match = re_search(&rpbuf, string, len, 0, len, ®s); if (match < 0) { printf("re_search failed (err:%d)\n", match); - return 1; + exitcode = 1; + goto contin2; } if (match + 13 > len) { printf("re_search: match+13 > len (%d > %d)\n", match + 13, len); - return 1; + exitcode = 1; + goto contin2; } if (match < len - 100) { printf("re_search: match < len-100 (%d < %d)\n", match, len - 100); - return 1; + exitcode = 1; + goto contin2; } if (strncmp(string + match, " ChangeLog.13 for earlier changes", sizeof(" ChangeLog.13 for earlier changes") - 1 @@ -163,7 +173,8 @@ do_test(void) ) { printf("re_search did not find the correct match" "(found '%s' instead)\n", string + match); - return 1; + exitcode = 1; + goto contin2; } if (testno == 2) { @@ -174,7 +185,8 @@ do_test(void) expected = 9; if (regs.num_regs != expected) { printf("incorrect num_regs %d, expected %d\n", regs.num_regs, expected); - return 1; + exitcode = 1; + goto contin2; } if (regs.start[0] != match || regs.end[0] != match + 13) { printf("incorrect regs.{start,end}[0] = { %d, %d }," @@ -182,7 +194,8 @@ do_test(void) regs.start[0], regs.end[0], match, match + 13 ); - return 1; + exitcode = 1; + goto contin2; } if (regs.start[regs.num_regs - 1] != -1 || regs.end[regs.num_regs - 1] != -1 @@ -191,7 +204,8 @@ do_test(void) " expected { -1, -1 }\n", regs.start[regs.num_regs - 1], regs.end[regs.num_regs - 1] ); - return 1; + exitcode = 1; + goto contin2; } if (i > 0) { @@ -207,7 +221,8 @@ do_test(void) regs.start[l], regs.end[l], match + j, match + j + 1 ); - return 1; + exitcode = 1; + goto contin2; } } } @@ -223,10 +238,11 @@ do_test(void) stop.tv_usec -= start.tv_usec; printf(" %lu.%06lus\n", (unsigned long) stop.tv_sec, (unsigned long) stop.tv_usec); + contin2: regfree(&rpbuf); } } - return 0; + return exitcode; } #define TIMEOUT 20 diff --git a/test/regex/tst-regexloc.c b/test/regex/tst-regexloc.c index 88ab58116..4bc65f660 100644 --- a/test/regex/tst-regexloc.c +++ b/test/regex/tst-regexloc.c @@ -24,10 +24,12 @@ int main (int argc, char *argv[]) { -#ifdef __UCLIBC_HAS_XLOCALE__ +/* If uclibc has extended locale, or if it's a host build + * (assuming host libc always has locale): */ +#if defined __UCLIBC_HAS_XLOCALE__ || !defined __UCLIBC__ regex_t re; regmatch_t mat[1]; - int res = 1; + int exitcode = 1; if (setlocale (LC_ALL, "de_DE.ISO-8859-1") == NULL) puts ("cannot set locale"); @@ -37,11 +39,14 @@ main (int argc, char *argv[]) puts ("no match"); else { - printf ("match from %d to %d\n", mat[0].rm_so, mat[0].rm_eo); - res = mat[0].rm_so != 0 || mat[0].rm_eo != 6; + exitcode = mat[0].rm_so != 0 || mat[0].rm_eo != 6; + printf ("match from %d to %d - %s\n", + mat[0].rm_so, mat[0].rm_eo, + exitcode ? "WRONG!" : "ok" + ); } - return res; + return exitcode; #else puts("Test requires locale; skipping"); return 0; |