Update.
2000-07-12 Bruno Haible <haible@clisp.cons.org> * iconv/gconv_open.c (__gconv_open): Merge duplicated code. 2000-07-12 Bruno Haible <haible@clisp.cons.org> * iconv/gconv_builtin.c (__gconv_get_builtin_trans): Initialize __modname. 2000-07-12 Bruno Haible <haible@clisp.cons.org> * iconv/gconv_open.c (__gconv_open): Initialize result->__steps[cnt].__data. 2000-07-12 Mark Kettenis <kettenis@gnu.org> * nss/getent.c (services_keys): Pass port number in network byte order in call to getservbyport. 2000-07-11 Andreas Jaeger <aj@suse.de> * stdlib/Makefile (test-canon-ARGS): Fix for building in the source dir. * intl/Makefile (do-gettext-test): Likewise. * dirent/Makefile (opendir-tst1-ARGS): Likewise. 2000-07-11 Andreas Schwab <schwab@suse.de> * Makeconfig (run-program-prefix): New rule. (built-program-cmd): Use run-program-prefix.
This commit is contained in:
parent
50a6564365
commit
9f835f5fb4
31
ChangeLog
31
ChangeLog
|
@ -1,3 +1,34 @@
|
||||||
|
2000-07-12 Bruno Haible <haible@clisp.cons.org>
|
||||||
|
|
||||||
|
* iconv/gconv_open.c (__gconv_open): Merge duplicated code.
|
||||||
|
|
||||||
|
2000-07-12 Bruno Haible <haible@clisp.cons.org>
|
||||||
|
|
||||||
|
* iconv/gconv_builtin.c (__gconv_get_builtin_trans): Initialize
|
||||||
|
__modname.
|
||||||
|
|
||||||
|
2000-07-12 Bruno Haible <haible@clisp.cons.org>
|
||||||
|
|
||||||
|
* iconv/gconv_open.c (__gconv_open): Initialize
|
||||||
|
result->__steps[cnt].__data.
|
||||||
|
|
||||||
|
2000-07-12 Mark Kettenis <kettenis@gnu.org>
|
||||||
|
|
||||||
|
* nss/getent.c (services_keys): Pass port number in network byte
|
||||||
|
order in call to getservbyport.
|
||||||
|
|
||||||
|
2000-07-11 Andreas Jaeger <aj@suse.de>
|
||||||
|
|
||||||
|
* stdlib/Makefile (test-canon-ARGS): Fix for building in the
|
||||||
|
source dir.
|
||||||
|
* intl/Makefile (do-gettext-test): Likewise.
|
||||||
|
* dirent/Makefile (opendir-tst1-ARGS): Likewise.
|
||||||
|
|
||||||
|
2000-07-11 Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
* Makeconfig (run-program-prefix): New rule.
|
||||||
|
(built-program-cmd): Use run-program-prefix.
|
||||||
|
|
||||||
2000-07-12 Ulrich Drepper <drepper@redhat.com>
|
2000-07-12 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* locale/langinfo.h: Make CRNCYSTR, RADIXCHAR, THOUSANDS_SEP, YESEXPR,
|
* locale/langinfo.h: Make CRNCYSTR, RADIXCHAR, THOUSANDS_SEP, YESEXPR,
|
||||||
|
|
14
Makeconfig
14
Makeconfig
|
@ -475,20 +475,18 @@ elf-objpfx = $(common-objpfx)elf/
|
||||||
# How to run a program we just linked with our library.
|
# How to run a program we just linked with our library.
|
||||||
# The program binary is assumed to be $(word 2,$^).
|
# The program binary is assumed to be $(word 2,$^).
|
||||||
built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^))
|
built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^))
|
||||||
ifneq (yes,$(build-shared))
|
ifeq (yes,$(build-shared))
|
||||||
built-program-cmd = $(built-program-file)
|
|
||||||
else
|
|
||||||
comma = ,
|
comma = ,
|
||||||
sysdep-library-path = \
|
sysdep-library-path = \
|
||||||
$(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
|
$(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
|
||||||
$(filter -Wl$(comma)-rpath-link=%,\
|
$(filter -Wl$(comma)-rpath-link=%,\
|
||||||
$(sysdep-LDFLAGS)))))
|
$(sysdep-LDFLAGS)))))
|
||||||
define built-program-cmd
|
run-program-prefix = $(elf-objpfx)$(rtld-installed-name) \
|
||||||
$(elf-objpfx)$(rtld-installed-name) \
|
--library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path))
|
||||||
--library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
|
else
|
||||||
$(built-program-file)
|
run-program-prefix =
|
||||||
endef
|
|
||||||
endif
|
endif
|
||||||
|
built-program-cmd = $(run-program-prefix) $(built-program-file)
|
||||||
|
|
||||||
ifndef LD
|
ifndef LD
|
||||||
LD := ld -X
|
LD := ld -X
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
|
# Copyright (C) 1991,92,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc.
|
||||||
# This file is part of the GNU C Library.
|
# This file is part of the GNU C Library.
|
||||||
|
|
||||||
# The GNU C Library is free software; you can redistribute it and/or
|
# The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
@ -32,4 +32,4 @@ tests := list tst-seekdir opendir-tst1
|
||||||
|
|
||||||
include ../Rules
|
include ../Rules
|
||||||
|
|
||||||
opendir-tst1-ARGS = --test-dir=${objdir}
|
opendir-tst1-ARGS = --test-dir=${common-objpfx}dirent
|
||||||
|
|
|
@ -77,6 +77,7 @@ __gconv_get_builtin_trans (const char *name, struct __gconv_step *step)
|
||||||
step->__end_fct = map[cnt].end;
|
step->__end_fct = map[cnt].end;
|
||||||
step->__counter = INT_MAX;
|
step->__counter = INT_MAX;
|
||||||
step->__shlib_handle = NULL;
|
step->__shlib_handle = NULL;
|
||||||
|
step->__modname = NULL;
|
||||||
|
|
||||||
step->__min_needed_from = map[cnt].min_needed_from;
|
step->__min_needed_from = map[cnt].min_needed_from;
|
||||||
step->__max_needed_from = map[cnt].max_needed_from;
|
step->__max_needed_from = map[cnt].max_needed_from;
|
||||||
|
|
|
@ -184,14 +184,10 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle,
|
||||||
|
|
||||||
/* Call all initialization functions for the transformation
|
/* Call all initialization functions for the transformation
|
||||||
step implementations. */
|
step implementations. */
|
||||||
for (cnt = 0; cnt < nsteps - 1; ++cnt)
|
for (cnt = 0; cnt < nsteps; ++cnt)
|
||||||
{
|
{
|
||||||
size_t size;
|
size_t size;
|
||||||
|
|
||||||
/* If this is the last step we must not allocate an
|
|
||||||
output buffer. */
|
|
||||||
result->__data[cnt].__flags = conv_flags;
|
|
||||||
|
|
||||||
/* Would have to be done if we would not clear the whole
|
/* Would have to be done if we would not clear the whole
|
||||||
array above. */
|
array above. */
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -205,16 +201,6 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle,
|
||||||
/* We use the `mbstate_t' member in DATA. */
|
/* We use the `mbstate_t' member in DATA. */
|
||||||
result->__data[cnt].__statep = &result->__data[cnt].__state;
|
result->__data[cnt].__statep = &result->__data[cnt].__state;
|
||||||
|
|
||||||
/* Allocate the buffer. */
|
|
||||||
size = (GCONV_NCHAR_GOAL * steps[cnt].__max_needed_to);
|
|
||||||
|
|
||||||
result->__data[cnt].__outbuf = (char *) malloc (size);
|
|
||||||
if (result->__data[cnt].__outbuf == NULL)
|
|
||||||
goto bail;
|
|
||||||
|
|
||||||
result->__data[cnt].__outbufend =
|
|
||||||
result->__data[cnt].__outbuf + size;
|
|
||||||
|
|
||||||
/* Now see whether we can use any of the transliteration
|
/* Now see whether we can use any of the transliteration
|
||||||
modules for this step. */
|
modules for this step. */
|
||||||
for (runp = trans; runp != NULL; runp = runp->next)
|
for (runp = trans; runp != NULL; runp = runp->next)
|
||||||
|
@ -255,57 +241,33 @@ __gconv_open (const char *toset, const char *fromset, __gconv_t *handle,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Now handle the last entry. */
|
result->__steps[cnt].__data = &result->__data[cnt];
|
||||||
result->__data[cnt].__flags = conv_flags | __GCONV_IS_LAST;
|
|
||||||
/* Would have to be done if we would not clear the whole
|
|
||||||
array above. */
|
|
||||||
#if 0
|
|
||||||
result->__data[cnt].__invocation_counter = 0;
|
|
||||||
result->__data[cnt].__internal_use = 0;
|
|
||||||
#endif
|
|
||||||
result->__data[cnt].__statep = &result->__data[cnt].__state;
|
|
||||||
|
|
||||||
/* Now see whether we can use the transliteration module
|
/* If this is the last step we must not allocate an
|
||||||
for this step. */
|
output buffer. */
|
||||||
for (runp = trans; runp != NULL; runp = runp->next)
|
if (cnt < nsteps - 1)
|
||||||
for (n = 0; n < runp->ncsnames; ++n)
|
|
||||||
if (__strcasecmp (steps[cnt].__from_name, runp->csnames[n]) == 0)
|
|
||||||
{
|
{
|
||||||
void *data = NULL;
|
result->__data[cnt].__flags = conv_flags;
|
||||||
|
|
||||||
/* Match! Now try the initializer. */
|
/* Allocate the buffer. */
|
||||||
if (runp->trans_init_fct == NULL
|
size = (GCONV_NCHAR_GOAL * steps[cnt].__max_needed_to);
|
||||||
|| (runp->trans_init_fct (data, steps[cnt].__to_name)
|
|
||||||
== __GCONV_OK))
|
|
||||||
{
|
|
||||||
/* Append at the end of the list. */
|
|
||||||
struct __gconv_trans_data *newp;
|
|
||||||
struct __gconv_trans_data *endp;
|
|
||||||
struct __gconv_trans_data *lastp;
|
|
||||||
|
|
||||||
newp = (struct __gconv_trans_data *)
|
result->__data[cnt].__outbuf = (char *) malloc (size);
|
||||||
malloc (sizeof (struct __gconv_trans_data));
|
if (result->__data[cnt].__outbuf == NULL)
|
||||||
if (newp == NULL)
|
goto bail;
|
||||||
goto bail;
|
|
||||||
|
|
||||||
newp->__trans_fct = runp->trans_fct;
|
result->__data[cnt].__outbufend =
|
||||||
newp->__trans_context_fct = runp->trans_context_fct;
|
result->__data[cnt].__outbuf + size;
|
||||||
newp->__trans_end_fct = runp->trans_end_fct;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Handle the last entry. */
|
||||||
|
result->__data[cnt].__flags = conv_flags | __GCONV_IS_LAST;
|
||||||
|
|
||||||
lastp = NULL;
|
|
||||||
for (endp = result->__data[cnt].__trans;
|
|
||||||
endp != NULL; endp = endp->__next)
|
|
||||||
lastp = endp;
|
|
||||||
|
|
||||||
if (lastp == NULL)
|
|
||||||
result->__data[cnt].__trans = newp;
|
|
||||||
else
|
|
||||||
lastp->__next = newp;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res != __GCONV_OK)
|
if (res != __GCONV_OK)
|
||||||
|
|
|
@ -51,7 +51,7 @@ ifneq ($(strip $(MSGFMT)),:)
|
||||||
.PHONY: do-gettext-test
|
.PHONY: do-gettext-test
|
||||||
tests: do-gettext-test
|
tests: do-gettext-test
|
||||||
do-gettext-test: tst-gettext.sh $(objpfx)tst-gettext
|
do-gettext-test: tst-gettext.sh $(objpfx)tst-gettext
|
||||||
$(SHELL) -e $< $(common-objpfx) $(objpfx)
|
$(SHELL) -e $< $(common-objpfx) $(common-objpfx)intl/
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
2000-07-12 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* spinlock.c: Fix code for TEST_FOR_COMPARE_AND_SWAP being defined.
|
||||||
|
Add tests also to new alternative spinlock implementation.
|
||||||
|
* spinlock.h: Likewise.
|
||||||
|
Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
|
||||||
|
|
||||||
2000-07-06 Ulrich Drepper <drepper@redhat.com>
|
2000-07-06 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* Version: Export __sigaction.
|
* Version: Export __sigaction.
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wait.h>
|
#include <sys/wait.h>
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,6 +24,11 @@
|
||||||
#include "spinlock.h"
|
#include "spinlock.h"
|
||||||
#include "restart.h"
|
#include "restart.h"
|
||||||
|
|
||||||
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
static void __pthread_acquire(int * spinlock);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* The status field of a spinlock is a pointer whose least significant
|
/* The status field of a spinlock is a pointer whose least significant
|
||||||
bit is a locked flag.
|
bit is a locked flag.
|
||||||
|
|
||||||
|
@ -59,10 +64,10 @@ void internal_function __pthread_lock(struct _pthread_fastlock * lock,
|
||||||
#if defined TEST_FOR_COMPARE_AND_SWAP
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
if (!__pthread_has_cas)
|
if (!__pthread_has_cas)
|
||||||
#endif
|
#endif
|
||||||
#if !defined HAS_COMPARE_AND_SWAP
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
{
|
{
|
||||||
__pthread_acquire(&lock->__spinlock);
|
__pthread_acquire(&lock->__spinlock);
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -147,7 +152,7 @@ int __pthread_unlock(struct _pthread_fastlock * lock)
|
||||||
#if defined TEST_FOR_COMPARE_AND_SWAP
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
if (!__pthread_has_cas)
|
if (!__pthread_has_cas)
|
||||||
#endif
|
#endif
|
||||||
#if !defined HAS_COMPARE_AND_SWAP
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
{
|
{
|
||||||
WRITE_MEMORY_BARRIER();
|
WRITE_MEMORY_BARRIER();
|
||||||
lock->__spinlock = 0;
|
lock->__spinlock = 0;
|
||||||
|
@ -237,7 +242,9 @@ struct wait_node {
|
||||||
};
|
};
|
||||||
|
|
||||||
static long wait_node_free_list;
|
static long wait_node_free_list;
|
||||||
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
static int wait_node_free_list_spinlock;
|
static int wait_node_free_list_spinlock;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Allocate a new node from the head of the free list using an atomic
|
/* Allocate a new node from the head of the free list using an atomic
|
||||||
operation, or else using malloc if that list is empty. A fundamental
|
operation, or else using malloc if that list is empty. A fundamental
|
||||||
|
@ -247,8 +254,33 @@ static int wait_node_free_list_spinlock;
|
||||||
|
|
||||||
static struct wait_node *wait_node_alloc(void)
|
static struct wait_node *wait_node_alloc(void)
|
||||||
{
|
{
|
||||||
|
#if defined HAS_COMPARE_AND_SWAP
|
||||||
long oldvalue, newvalue;
|
long oldvalue, newvalue;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
if (!__pthread_has_cas)
|
||||||
|
#endif
|
||||||
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
{
|
||||||
|
struct wait_node *new_node = 0;
|
||||||
|
|
||||||
|
__pthread_acquire(&wait_node_free_list_spinlock);
|
||||||
|
if (wait_node_free_list != 0) {
|
||||||
|
new_node = (struct wait_node *) wait_node_free_list;
|
||||||
|
wait_node_free_list = (long) new_node->next;
|
||||||
|
}
|
||||||
|
WRITE_MEMORY_BARRIER();
|
||||||
|
wait_node_free_list_spinlock = 0;
|
||||||
|
|
||||||
|
if (new_node == 0)
|
||||||
|
return malloc(sizeof *wait_node_alloc());
|
||||||
|
|
||||||
|
return new_node;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined HAS_COMPARE_AND_SWAP
|
||||||
do {
|
do {
|
||||||
oldvalue = wait_node_free_list;
|
oldvalue = wait_node_free_list;
|
||||||
|
|
||||||
|
@ -257,10 +289,10 @@ static struct wait_node *wait_node_alloc(void)
|
||||||
|
|
||||||
newvalue = (long) ((struct wait_node *) oldvalue)->next;
|
newvalue = (long) ((struct wait_node *) oldvalue)->next;
|
||||||
WRITE_MEMORY_BARRIER();
|
WRITE_MEMORY_BARRIER();
|
||||||
} while (! compare_and_swap(&wait_node_free_list, oldvalue, newvalue,
|
} while (! __compare_and_swap(&wait_node_free_list, oldvalue, newvalue));
|
||||||
&wait_node_free_list_spinlock));
|
|
||||||
|
|
||||||
return (struct wait_node *) oldvalue;
|
return (struct wait_node *) oldvalue;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return a node to the head of the free list using an atomic
|
/* Return a node to the head of the free list using an atomic
|
||||||
|
@ -268,37 +300,53 @@ static struct wait_node *wait_node_alloc(void)
|
||||||
|
|
||||||
static void wait_node_free(struct wait_node *wn)
|
static void wait_node_free(struct wait_node *wn)
|
||||||
{
|
{
|
||||||
|
#if defined HAS_COMPARE_AND_SWAP
|
||||||
long oldvalue, newvalue;
|
long oldvalue, newvalue;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
if (!__pthread_has_cas)
|
||||||
|
#endif
|
||||||
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
{
|
||||||
|
__pthread_acquire(&wait_node_free_list_spinlock);
|
||||||
|
wn->next = (struct wait_node *) wait_node_free_list;
|
||||||
|
wait_node_free_list = (long) wn;
|
||||||
|
WRITE_MEMORY_BARRIER();
|
||||||
|
wait_node_free_list_spinlock = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined HAS_COMPARE_AND_SWAP
|
||||||
do {
|
do {
|
||||||
oldvalue = wait_node_free_list;
|
oldvalue = wait_node_free_list;
|
||||||
wn->next = (struct wait_node *) oldvalue;
|
wn->next = (struct wait_node *) oldvalue;
|
||||||
newvalue = (long) wn;
|
newvalue = (long) wn;
|
||||||
WRITE_MEMORY_BARRIER();
|
WRITE_MEMORY_BARRIER();
|
||||||
} while (! compare_and_swap(&wait_node_free_list, oldvalue, newvalue,
|
} while (! __compare_and_swap(&wait_node_free_list, oldvalue, newvalue));
|
||||||
&wait_node_free_list_spinlock));
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined HAS_COMPARE_AND_SWAP
|
||||||
|
|
||||||
/* Remove a wait node from the specified queue. It is assumed
|
/* Remove a wait node from the specified queue. It is assumed
|
||||||
that the removal takes place concurrently with only atomic insertions at the
|
that the removal takes place concurrently with only atomic insertions at the
|
||||||
head of the queue. */
|
head of the queue. */
|
||||||
|
|
||||||
static void wait_node_dequeue(struct wait_node **pp_head,
|
static void wait_node_dequeue(struct wait_node **pp_head,
|
||||||
struct wait_node **pp_node,
|
struct wait_node **pp_node,
|
||||||
struct wait_node *p_node,
|
struct wait_node *p_node)
|
||||||
int *spinlock)
|
|
||||||
{
|
{
|
||||||
long oldvalue, newvalue;
|
|
||||||
|
|
||||||
/* If the node is being deleted from the head of the
|
/* If the node is being deleted from the head of the
|
||||||
list, it must be deleted using atomic compare-and-swap.
|
list, it must be deleted using atomic compare-and-swap.
|
||||||
Otherwise it can be deleted in the straightforward way. */
|
Otherwise it can be deleted in the straightforward way. */
|
||||||
|
|
||||||
if (pp_node == pp_head) {
|
if (pp_node == pp_head) {
|
||||||
oldvalue = (long) p_node;
|
long oldvalue = (long) p_node;
|
||||||
newvalue = (long) p_node->next;
|
long newvalue = (long) p_node->next;
|
||||||
|
|
||||||
if (compare_and_swap((long *) pp_node, oldvalue, newvalue, spinlock))
|
if (__compare_and_swap((long *) pp_node, oldvalue, newvalue))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Oops! Compare and swap failed, which means the node is
|
/* Oops! Compare and swap failed, which means the node is
|
||||||
|
@ -314,12 +362,46 @@ static void wait_node_dequeue(struct wait_node **pp_head,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
void __pthread_alt_lock(struct _pthread_fastlock * lock,
|
void __pthread_alt_lock(struct _pthread_fastlock * lock,
|
||||||
pthread_descr self)
|
pthread_descr self)
|
||||||
{
|
{
|
||||||
struct wait_node wait_node;
|
#if defined HAS_COMPARE_AND_SWAP
|
||||||
long oldstatus, newstatus;
|
long oldstatus, newstatus;
|
||||||
|
#endif
|
||||||
|
struct wait_node wait_node;
|
||||||
|
|
||||||
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
if (!__pthread_has_cas)
|
||||||
|
#endif
|
||||||
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
{
|
||||||
|
int suspend_needed = 0;
|
||||||
|
__pthread_acquire(&lock->__spinlock);
|
||||||
|
|
||||||
|
if (lock->__status == 0)
|
||||||
|
lock->__status = 1;
|
||||||
|
else {
|
||||||
|
if (self == NULL)
|
||||||
|
self = thread_self();
|
||||||
|
|
||||||
|
wait_node.abandoned = 0;
|
||||||
|
wait_node.next = (struct wait_node *) lock->__status;
|
||||||
|
wait_node.thr = self = thread_self();
|
||||||
|
suspend_needed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
WRITE_MEMORY_BARRIER();
|
||||||
|
lock->__spinlock = 0;
|
||||||
|
|
||||||
|
if (suspend_needed)
|
||||||
|
suspend (self);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined HAS_COMPARE_AND_SWAP
|
||||||
do {
|
do {
|
||||||
oldstatus = lock->__status;
|
oldstatus = lock->__status;
|
||||||
if (oldstatus == 0) {
|
if (oldstatus == 0) {
|
||||||
|
@ -344,6 +426,7 @@ void __pthread_alt_lock(struct _pthread_fastlock * lock,
|
||||||
|
|
||||||
if (oldstatus != 0)
|
if (oldstatus != 0)
|
||||||
suspend(self);
|
suspend(self);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Timed-out lock operation; returns 0 to indicate timeout. */
|
/* Timed-out lock operation; returns 0 to indicate timeout. */
|
||||||
|
@ -351,8 +434,11 @@ void __pthread_alt_lock(struct _pthread_fastlock * lock,
|
||||||
int __pthread_alt_timedlock(struct _pthread_fastlock * lock,
|
int __pthread_alt_timedlock(struct _pthread_fastlock * lock,
|
||||||
pthread_descr self, const struct timespec *abstime)
|
pthread_descr self, const struct timespec *abstime)
|
||||||
{
|
{
|
||||||
|
long oldstatus;
|
||||||
|
#if defined HAS_COMPARE_AND_SWAP
|
||||||
|
long newstatus;
|
||||||
|
#endif
|
||||||
struct wait_node *p_wait_node = wait_node_alloc();
|
struct wait_node *p_wait_node = wait_node_alloc();
|
||||||
long oldstatus, newstatus;
|
|
||||||
|
|
||||||
/* Out of memory, just give up and do ordinary lock. */
|
/* Out of memory, just give up and do ordinary lock. */
|
||||||
if (p_wait_node == 0) {
|
if (p_wait_node == 0) {
|
||||||
|
@ -360,6 +446,32 @@ int __pthread_alt_timedlock(struct _pthread_fastlock * lock,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
if (!__pthread_has_cas)
|
||||||
|
#endif
|
||||||
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
{
|
||||||
|
__pthread_acquire(&lock->__spinlock);
|
||||||
|
|
||||||
|
if (lock->__status == 0)
|
||||||
|
lock->__status = 1;
|
||||||
|
else {
|
||||||
|
if (self == NULL)
|
||||||
|
self = thread_self();
|
||||||
|
|
||||||
|
p_wait_node->abandoned = 0;
|
||||||
|
p_wait_node->next = (struct wait_node *) lock->__status;
|
||||||
|
p_wait_node->thr = self = thread_self();
|
||||||
|
}
|
||||||
|
|
||||||
|
WRITE_MEMORY_BARRIER();
|
||||||
|
lock->__spinlock = 0;
|
||||||
|
oldstatus = 1; /* force suspend */
|
||||||
|
goto suspend;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined HAS_COMPARE_AND_SWAP
|
||||||
do {
|
do {
|
||||||
oldstatus = lock->__status;
|
oldstatus = lock->__status;
|
||||||
if (oldstatus == 0) {
|
if (oldstatus == 0) {
|
||||||
|
@ -376,6 +488,11 @@ int __pthread_alt_timedlock(struct _pthread_fastlock * lock,
|
||||||
MEMORY_BARRIER();
|
MEMORY_BARRIER();
|
||||||
} while(! compare_and_swap(&lock->__status, oldstatus, newstatus,
|
} while(! compare_and_swap(&lock->__status, oldstatus, newstatus,
|
||||||
&lock->__spinlock));
|
&lock->__spinlock));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
suspend:
|
||||||
|
#endif
|
||||||
|
|
||||||
/* If we did not get the lock, do a timed suspend. If we wake up due
|
/* If we did not get the lock, do a timed suspend. If we wake up due
|
||||||
to a timeout, then there is a race; the old lock owner may try
|
to a timeout, then there is a race; the old lock owner may try
|
||||||
|
@ -402,24 +519,50 @@ int __pthread_alt_timedlock(struct _pthread_fastlock * lock,
|
||||||
|
|
||||||
void __pthread_alt_unlock(struct _pthread_fastlock *lock)
|
void __pthread_alt_unlock(struct _pthread_fastlock *lock)
|
||||||
{
|
{
|
||||||
long oldstatus;
|
|
||||||
struct wait_node *p_node, **pp_node, *p_max_prio, **pp_max_prio;
|
struct wait_node *p_node, **pp_node, *p_max_prio, **pp_max_prio;
|
||||||
struct wait_node ** const pp_head = (struct wait_node **) &lock->__status;
|
struct wait_node ** const pp_head = (struct wait_node **) &lock->__status;
|
||||||
int maxprio;
|
int maxprio;
|
||||||
|
|
||||||
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
if (!__pthread_has_cas)
|
||||||
|
#endif
|
||||||
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
{
|
||||||
|
__pthread_acquire(&lock->__spinlock);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
||||||
/* If no threads are waiting for this lock, try to just
|
/* If no threads are waiting for this lock, try to just
|
||||||
atomically release it. */
|
atomically release it. */
|
||||||
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
oldstatus = lock->__status;
|
if (!__pthread_has_cas)
|
||||||
if (oldstatus == 0 || oldstatus == 1) {
|
#endif
|
||||||
if (compare_and_swap_with_release_semantics (&lock->__status, oldstatus,
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
0, &lock->__spinlock))
|
{
|
||||||
return;
|
if (lock->__status == 0 || lock->__status == 1) {
|
||||||
else
|
lock->__status = 0;
|
||||||
continue;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined HAS_COMPARE_AND_SWAP
|
||||||
|
{
|
||||||
|
long oldstatus = lock->__status;
|
||||||
|
if (oldstatus == 0 || oldstatus == 1) {
|
||||||
|
if (__compare_and_swap_with_release_semantics (&lock->__status, oldstatus, 0))
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Process the entire queue of wait nodes. Remove all abandoned
|
/* Process the entire queue of wait nodes. Remove all abandoned
|
||||||
wait nodes and put them into the global free queue, and
|
wait nodes and put them into the global free queue, and
|
||||||
|
@ -435,7 +578,18 @@ void __pthread_alt_unlock(struct _pthread_fastlock *lock)
|
||||||
|
|
||||||
if (p_node->abandoned) {
|
if (p_node->abandoned) {
|
||||||
/* Remove abandoned node. */
|
/* Remove abandoned node. */
|
||||||
wait_node_dequeue(pp_head, pp_node, p_node, &lock->__spinlock);
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
if (!__pthread_has_cas)
|
||||||
|
#endif
|
||||||
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
*pp_node = p_node->next;
|
||||||
|
#endif
|
||||||
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
#if defined HAS_COMPARE_AND_SWAP
|
||||||
|
wait_node_dequeue(pp_head, pp_node, p_node);
|
||||||
|
#endif
|
||||||
wait_node_free(p_node);
|
wait_node_free(p_node);
|
||||||
READ_MEMORY_BARRIER();
|
READ_MEMORY_BARRIER();
|
||||||
p_node = *pp_node;
|
p_node = *pp_node;
|
||||||
|
@ -469,12 +623,33 @@ void __pthread_alt_unlock(struct _pthread_fastlock *lock)
|
||||||
whole unlock operation. */
|
whole unlock operation. */
|
||||||
|
|
||||||
if (!testandset(&p_max_prio->abandoned)) {
|
if (!testandset(&p_max_prio->abandoned)) {
|
||||||
wait_node_dequeue(pp_head, pp_max_prio, p_max_prio, &lock->__spinlock);
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
if (!__pthread_has_cas)
|
||||||
|
#endif
|
||||||
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
*pp_max_prio = p_max_prio->next;
|
||||||
|
#endif
|
||||||
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
#if defined HAS_COMPARE_AND_SWAP
|
||||||
|
wait_node_dequeue(pp_head, pp_max_prio, p_max_prio);
|
||||||
|
#endif
|
||||||
WRITE_MEMORY_BARRIER();
|
WRITE_MEMORY_BARRIER();
|
||||||
restart(p_max_prio->thr);
|
restart(p_max_prio->thr);
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
if (!__pthread_has_cas)
|
||||||
|
#endif
|
||||||
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
{
|
||||||
|
WRITE_MEMORY_BARRIER();
|
||||||
|
lock->__spinlock = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -486,8 +661,6 @@ int __pthread_has_cas = 0;
|
||||||
|
|
||||||
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
|
||||||
static void __pthread_acquire(int * spinlock);
|
|
||||||
|
|
||||||
int __pthread_compare_and_swap(long * ptr, long oldval, long newval,
|
int __pthread_compare_and_swap(long * ptr, long oldval, long newval,
|
||||||
int * spinlock)
|
int * spinlock)
|
||||||
{
|
{
|
||||||
|
|
|
@ -105,7 +105,7 @@ static inline int __pthread_trylock (struct _pthread_fastlock * lock)
|
||||||
#if defined TEST_FOR_COMPARE_AND_SWAP
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
if (!__pthread_has_cas)
|
if (!__pthread_has_cas)
|
||||||
#endif
|
#endif
|
||||||
#if !defined HAS_COMPARE_AND_SWAP
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
{
|
{
|
||||||
return (testandset(&lock->__spinlock) ? EBUSY : 0);
|
return (testandset(&lock->__spinlock) ? EBUSY : 0);
|
||||||
}
|
}
|
||||||
|
@ -140,13 +140,26 @@ static inline void __pthread_alt_init_lock(struct _pthread_fastlock * lock)
|
||||||
|
|
||||||
static inline int __pthread_alt_trylock (struct _pthread_fastlock * lock)
|
static inline int __pthread_alt_trylock (struct _pthread_fastlock * lock)
|
||||||
{
|
{
|
||||||
|
#if defined HAS_COMPARE_AND_SWAP
|
||||||
long oldstatus;
|
long oldstatus;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
if (!__pthread_has_cas)
|
||||||
|
#endif
|
||||||
|
#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
|
||||||
|
{
|
||||||
|
return (testandset(&lock->__spinlock) ? EBUSY : 0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined HAS_COMPARE_AND_SWAP
|
||||||
do {
|
do {
|
||||||
oldstatus = lock->__status;
|
oldstatus = lock->__status;
|
||||||
if (oldstatus != 0) return EBUSY;
|
if (oldstatus != 0) return EBUSY;
|
||||||
} while(! compare_and_swap(&lock->__status, 0, 1, &lock->__spinlock));
|
} while(! compare_and_swap(&lock->__status, 0, 1, &lock->__spinlock));
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initializers for both lock variants */
|
/* Initializers for both lock variants */
|
||||||
|
|
|
@ -389,7 +389,7 @@ enum
|
||||||
# define N_SIGN_POSN __N_SIGN_POSN
|
# define N_SIGN_POSN __N_SIGN_POSN
|
||||||
#endif
|
#endif
|
||||||
_NL_MONETARY_CRNCYSTR,
|
_NL_MONETARY_CRNCYSTR,
|
||||||
#define CRNCYSTR __CRNCYSTR
|
#define CRNCYSTR _NL_MONETARY_CRNCYSTR
|
||||||
__INT_P_CS_PRECEDES,
|
__INT_P_CS_PRECEDES,
|
||||||
#ifdef __USE_GNU
|
#ifdef __USE_GNU
|
||||||
# define INT_P_CS_PRECEDES __INT_P_CS_PRECEDES
|
# define INT_P_CS_PRECEDES __INT_P_CS_PRECEDES
|
||||||
|
|
|
@ -76,7 +76,6 @@ distribute := CHECKSUMS README SUPPORTED ChangeLog \
|
||||||
include ../Makeconfig
|
include ../Makeconfig
|
||||||
|
|
||||||
ifeq (no,$(cross-compiling))
|
ifeq (no,$(cross-compiling))
|
||||||
ifeq (yes,$(build-shared))
|
|
||||||
locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \
|
locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \
|
||||||
tst_iswctype tst_iswdigit tst_iswgraph \
|
tst_iswctype tst_iswdigit tst_iswgraph \
|
||||||
tst_iswlower tst_iswprint tst_iswpunct \
|
tst_iswlower tst_iswprint tst_iswpunct \
|
||||||
|
@ -94,7 +93,6 @@ locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \
|
||||||
|
|
||||||
tests = $(locale_test_suite)
|
tests = $(locale_test_suite)
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
# Files to install.
|
# Files to install.
|
||||||
install-others := $(addprefix $(inst_i18ndir)/, $(charmaps) $(locales) \
|
install-others := $(addprefix $(inst_i18ndir)/, $(charmaps) $(locales) \
|
||||||
|
@ -117,7 +115,6 @@ CFLAGS-tst-trans.c = -Wno-format
|
||||||
|
|
||||||
|
|
||||||
ifeq (no,$(cross-compiling))
|
ifeq (no,$(cross-compiling))
|
||||||
ifeq (yes,$(build-shared))
|
|
||||||
# We have to generate locales
|
# We have to generate locales
|
||||||
LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 \
|
LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 \
|
||||||
en_US.ISO-8859-1 ja_JP.EUC-JP
|
en_US.ISO-8859-1 ja_JP.EUC-JP
|
||||||
|
@ -130,9 +127,9 @@ generated-dirs += $(LOCALES)
|
||||||
# Dependency for the locale files. We actually make it depend only on
|
# Dependency for the locale files. We actually make it depend only on
|
||||||
# one of the files.
|
# one of the files.
|
||||||
$(addprefix $(objpfx),$(CTYPE_FILES)): %: \
|
$(addprefix $(objpfx),$(CTYPE_FILES)): %: \
|
||||||
gen-locale.sh Makefile $(common-objpfx)locale/localedef \
|
gen-locale.sh $(common-objpfx)locale/localedef Makefile \
|
||||||
$(addprefix charmaps/,$(CHARMAPS)) $(addprefix locales/,$(LOCALE_SRCS))
|
$(addprefix charmaps/,$(CHARMAPS)) $(addprefix locales/,$(LOCALE_SRCS))
|
||||||
@$(SHELL) -e gen-locale.sh $(common-objpfx) $@
|
@$(SHELL) -e gen-locale.sh $(common-objpfx) '$(built-program-cmd)' $@
|
||||||
|
|
||||||
$(addsuffix .out,$(addprefix $(objpfx),$(locale_test_suite))): %: \
|
$(addsuffix .out,$(addprefix $(objpfx),$(locale_test_suite))): %: \
|
||||||
$(addprefix $(objpfx),$(CTYPE_FILES))
|
$(addprefix $(objpfx),$(CTYPE_FILES))
|
||||||
|
@ -143,27 +140,26 @@ tests: do-collate-test do-tst-fmon do-tst-locale do-tst-rpmatch do-tst-trans \
|
||||||
do-tst-mbswcs do-tst-ctype
|
do-tst-mbswcs do-tst-ctype
|
||||||
do-collate-test: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \
|
do-collate-test: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \
|
||||||
$(test-input-data) $(addprefix $(objpfx),$(CTYPE_FILES))
|
$(test-input-data) $(addprefix $(objpfx),$(CTYPE_FILES))
|
||||||
$(SHELL) -e $< $(common-objpfx) $(test-input)
|
$(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' $(test-input)
|
||||||
do-tst-fmon: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data do-collate-test \
|
do-tst-fmon: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data do-collate-test \
|
||||||
$(addprefix $(objpfx),$(CTYPE_FILES))
|
$(addprefix $(objpfx),$(CTYPE_FILES))
|
||||||
$(SHELL) -e $< $(common-objpfx) tst-fmon.data
|
$(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' tst-fmon.data
|
||||||
do-tst-locale: tst-locale.sh $(ld-test-srcs) \
|
do-tst-locale: tst-locale.sh $(common-objpfx)locale/localedef $(ld-test-srcs) \
|
||||||
$(addprefix $(objpfx),$(CTYPE_FILES))
|
$(addprefix $(objpfx),$(CTYPE_FILES))
|
||||||
$(SHELL) -e $< $(common-objpfx)
|
$(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)'
|
||||||
do-tst-rpmatch: tst-rpmatch.sh $(objpfx)tst-rpmatch do-tst-fmon \
|
do-tst-rpmatch: tst-rpmatch.sh $(objpfx)tst-rpmatch do-tst-fmon \
|
||||||
$(addprefix $(objpfx),$(CTYPE_FILES))
|
$(addprefix $(objpfx),$(CTYPE_FILES))
|
||||||
$(SHELL) -e $< $(common-objpfx)
|
$(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)'
|
||||||
do-tst-trans: tst-trans.sh $(objpfx)tst-trans \
|
do-tst-trans: tst-trans.sh $(objpfx)tst-trans \
|
||||||
$(addprefix $(objpfx),$(CTYPE_FILES))
|
$(addprefix $(objpfx),$(CTYPE_FILES))
|
||||||
$(SHELL) -e $< $(common-objpfx)
|
$(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)'
|
||||||
do-tst-mbswcs: tst-mbswcs.sh $(objpfx)tst-mbswcs1 $(objpfx)tst-mbswcs2 \
|
do-tst-mbswcs: tst-mbswcs.sh $(objpfx)tst-mbswcs1 $(objpfx)tst-mbswcs2 \
|
||||||
$(objpfx)tst-mbswcs3 $(objpfx)tst-mbswcs4 $(objpfx)tst-mbswcs5 \
|
$(objpfx)tst-mbswcs3 $(objpfx)tst-mbswcs4 $(objpfx)tst-mbswcs5 \
|
||||||
$(addprefix $(objpfx),$(CTYPE_FILES))
|
$(addprefix $(objpfx),$(CTYPE_FILES))
|
||||||
$(SHELL) -e $< $(common-objpfx)
|
$(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)'
|
||||||
do-tst-ctype: tst-ctype.sh $(objpfx)tst-ctype do-collate-test \
|
do-tst-ctype: tst-ctype.sh $(objpfx)tst-ctype do-collate-test \
|
||||||
$(addprefix $(objpfx),$(CTYPE_FILES))
|
$(addprefix $(objpfx),$(CTYPE_FILES))
|
||||||
$(SHELL) -e $< $(common-objpfx)
|
$(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)'
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Sometimes the whole collection of locale files should be installed.
|
# Sometimes the whole collection of locale files should be installed.
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
common_objpfx="$1"; shift
|
common_objpfx="$1"; shift
|
||||||
|
localedef="$1"; shift
|
||||||
locfile="$1"; shift
|
locfile="$1"; shift
|
||||||
|
|
||||||
generate_locale ()
|
generate_locale ()
|
||||||
|
@ -27,8 +28,7 @@ generate_locale ()
|
||||||
input=$2
|
input=$2
|
||||||
out=$3
|
out=$3
|
||||||
I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
|
I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
|
||||||
${common_objpfx}elf/ld.so --library-path $common_objpfx \
|
${localedef} --quiet -c -f $charmap -i $input \
|
||||||
${common_objpfx}locale/localedef --quiet -c -f $charmap -i $input \
|
|
||||||
${common_objpfx}localedata/$out
|
${common_objpfx}localedata/$out
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
@ -38,8 +38,9 @@ generate_locale ()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
locale=`echo $locfile|sed 's|.*/\([^/.]*\)[.].*/LC_CTYPE|\1|'`
|
locfile=`echo $locfile|sed 's|.*/\([^/]*/LC_CTYPE\)|\1|'`
|
||||||
charmap=`echo $locfile|sed 's|.*/[^/.]*[.]\(.*\)/LC_CTYPE|\1|'`
|
locale=`echo $locfile|sed 's|\([^.]*\)[.].*/LC_CTYPE|\1|'`
|
||||||
|
charmap=`echo $locfile|sed 's|[^.]*[.]\(.*\)/LC_CTYPE|\1|'`
|
||||||
|
|
||||||
echo "Generating locale $locale.$charmap: this might take a while..."
|
echo "Generating locale $locale.$charmap: this might take a while..."
|
||||||
generate_locale $charmap $locale $locale.$charmap
|
generate_locale $charmap $locale $locale.$charmap
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
common_objpfx=$1; shift
|
common_objpfx=$1; shift
|
||||||
|
run_program_prefix=$1; shift
|
||||||
lang=$*
|
lang=$*
|
||||||
|
|
||||||
id=${PPID:-100}
|
id=${PPID:-100}
|
||||||
|
@ -11,13 +12,13 @@ status=0
|
||||||
for l in $lang; do
|
for l in $lang; do
|
||||||
cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
|
cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
|
||||||
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \
|
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \
|
||||||
LC_ALL=$l ${common_objpfx}elf/ld.so --library-path $common_objpfx \
|
LC_ALL=$l ${run_program_prefix} \
|
||||||
${common_objpfx}localedata/collate-test $id < $cns.in \
|
${common_objpfx}localedata/collate-test $id < $cns.in \
|
||||||
> ${common_objpfx}localedata/$cns.out || status=1
|
> ${common_objpfx}localedata/$cns.out || status=1
|
||||||
cmp -s $cns.in ${common_objpfx}localedata/$cns.out || status=1
|
cmp -s $cns.in ${common_objpfx}localedata/$cns.out || status=1
|
||||||
|
|
||||||
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \
|
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \
|
||||||
LC_ALL=$l ${common_objpfx}elf/ld.so --library-path $common_objpfx \
|
LC_ALL=$l ${run_program_prefix} \
|
||||||
${common_objpfx}localedata/xfrm-test $id < $cns.in \
|
${common_objpfx}localedata/xfrm-test $id < $cns.in \
|
||||||
> ${common_objpfx}localedata/$cns.xout || status=1
|
> ${common_objpfx}localedata/$cns.xout || status=1
|
||||||
cmp -s $cns.in ${common_objpfx}localedata/$cns.xout || status=1
|
cmp -s $cns.in ${common_objpfx}localedata/$cns.xout || status=1
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
common_objpfx=$1; shift
|
common_objpfx=$1; shift
|
||||||
|
tst_ctype=$1; shift
|
||||||
status=0
|
status=0
|
||||||
|
|
||||||
# Run the test programs.
|
# Run the test programs.
|
||||||
|
@ -30,8 +31,7 @@ for loc in de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 ja_JP.EUC-JP; do
|
||||||
input=/dev/null
|
input=/dev/null
|
||||||
fi
|
fi
|
||||||
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
||||||
LC_ALL=$loc ${common_objpfx}elf/ld.so --library-path $common_objpfx \
|
LC_ALL=$loc ${tst_ctype} < $input \
|
||||||
${common_objpfx}localedata/tst-ctype < $input \
|
|
||||||
>> ${common_objpfx}localedata/tst-ctype.out || status=1
|
>> ${common_objpfx}localedata/tst-ctype.out || status=1
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,8 @@ case $1 in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
common_objpfx=$1
|
common_objpfx=$1
|
||||||
datafile=$2
|
run_program_prefix=$2
|
||||||
|
datafile=$3
|
||||||
|
|
||||||
here=`pwd`
|
here=`pwd`
|
||||||
|
|
||||||
|
@ -37,19 +38,17 @@ for cns in `cd ./tst-fmon-locales && ls tstfmon_*`; do
|
||||||
fn=charmaps/ISO-8859-1
|
fn=charmaps/ISO-8859-1
|
||||||
I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
|
I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
|
||||||
LOCPATH=${common_objpfx}localedata LC_ALL=C LANGUAGE=C \
|
LOCPATH=${common_objpfx}localedata LC_ALL=C LANGUAGE=C \
|
||||||
${common_objpfx}elf/ld.so --library-path $common_objpfx \
|
${run_program_prefix} ${common_objpfx}locale/localedef \
|
||||||
${common_objpfx}locale/localedef \
|
|
||||||
--quiet -i $cn -f $fn ${common_objpfx}localedata/$cns
|
--quiet -i $cn -f $fn ${common_objpfx}localedata/$cns
|
||||||
done
|
done
|
||||||
|
|
||||||
# Run the tests.
|
# Run the tests.
|
||||||
IFS=" " # This is a TAB
|
# There's a TAB for IFS
|
||||||
while read locale format value expect; do
|
while IFS=" " read locale format value expect; do
|
||||||
if [ -n "$format" ]; then
|
if [ -n "$format" ]; then
|
||||||
LOCPATH=${common_objpfx}localedata \
|
LOCPATH=${common_objpfx}localedata \
|
||||||
GCONV_PATH=${common_objpfx}/iconvdata \
|
GCONV_PATH=${common_objpfx}/iconvdata \
|
||||||
${common_objpfx}elf/ld.so --library-path $common_objpfx \
|
${run_program_prefix} ${common_objpfx}localedata/tst-fmon \
|
||||||
${common_objpfx}localedata/tst-fmon \
|
|
||||||
"$locale" "$format" "$value" "$expect"
|
"$locale" "$format" "$value" "$expect"
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
if [ $DEBUG -eq 1 ]; then
|
if [ $DEBUG -eq 1 ]; then
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
common_objpfx=$1; shift
|
common_objpfx=$1; shift
|
||||||
|
localedef=$1; shift
|
||||||
|
|
||||||
test_locale ()
|
test_locale ()
|
||||||
{
|
{
|
||||||
|
@ -32,8 +33,7 @@ test_locale ()
|
||||||
fi
|
fi
|
||||||
I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
|
I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
|
||||||
LOCPATH=${common_objpfx}localedata LC_ALL=C LANGUAGE=C \
|
LOCPATH=${common_objpfx}localedata LC_ALL=C LANGUAGE=C \
|
||||||
${common_objpfx}elf/ld.so --library-path $common_objpfx \
|
${localedef} --quiet -c -f $charmap -i $input \
|
||||||
${common_objpfx}locale/localedef --quiet -c -f $charmap -i $input \
|
|
||||||
${rep} ${common_objpfx}localedata/$out
|
${rep} ${common_objpfx}localedata/$out
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|
|
@ -19,33 +19,29 @@
|
||||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
common_objpfx=$1; shift
|
common_objpfx=$1; shift
|
||||||
|
run_program_prefix=$1; shift
|
||||||
|
|
||||||
status=0
|
status=0
|
||||||
|
|
||||||
# Run the test programs.
|
# Run the test programs.
|
||||||
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
||||||
${common_objpfx}elf/ld.so --library-path $common_objpfx \
|
${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs1 \
|
||||||
${common_objpfx}localedata/tst-mbswcs1 \
|
|
||||||
> ${common_objpfx}localedata/tst-mbswcs.out || status=1
|
> ${common_objpfx}localedata/tst-mbswcs.out || status=1
|
||||||
|
|
||||||
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
||||||
${common_objpfx}elf/ld.so --library-path $common_objpfx \
|
${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs2 \
|
||||||
${common_objpfx}localedata/tst-mbswcs2 \
|
|
||||||
>> ${common_objpfx}localedata/tst-mbswcs.out || status=1
|
>> ${common_objpfx}localedata/tst-mbswcs.out || status=1
|
||||||
|
|
||||||
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
||||||
${common_objpfx}elf/ld.so --library-path $common_objpfx \
|
${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs3 \
|
||||||
${common_objpfx}localedata/tst-mbswcs3 \
|
|
||||||
>> ${common_objpfx}localedata/tst-mbswcs.out || status=1
|
>> ${common_objpfx}localedata/tst-mbswcs.out || status=1
|
||||||
|
|
||||||
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
||||||
${common_objpfx}elf/ld.so --library-path $common_objpfx \
|
${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs4 \
|
||||||
${common_objpfx}localedata/tst-mbswcs4 \
|
|
||||||
>> ${common_objpfx}localedata/tst-mbswcs.out || status=1
|
>> ${common_objpfx}localedata/tst-mbswcs.out || status=1
|
||||||
|
|
||||||
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
||||||
${common_objpfx}elf/ld.so --library-path $common_objpfx \
|
${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs5 \
|
||||||
${common_objpfx}localedata/tst-mbswcs5 \
|
|
||||||
>> ${common_objpfx}localedata/tst-mbswcs.out || status=1
|
>> ${common_objpfx}localedata/tst-mbswcs.out || status=1
|
||||||
|
|
||||||
exit $status
|
exit $status
|
||||||
|
|
|
@ -20,14 +20,14 @@
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
common_objpfx=$1
|
common_objpfx=$1
|
||||||
IFS="&"
|
tst_rpmatch=$2
|
||||||
|
|
||||||
rc=0
|
rc=0
|
||||||
while read locale string result dummy; do
|
while IFS=\& read locale string result dummy; do
|
||||||
if [ "$locale" != "#" ]; then
|
if [ "$locale" != "#" ]; then
|
||||||
LOCPATH=${common_objpfx}localedata \
|
LOCPATH=${common_objpfx}localedata \
|
||||||
GCONV_PATH=${common_objpfx}/iconvdata \
|
GCONV_PATH=${common_objpfx}/iconvdata \
|
||||||
${common_objpfx}elf/ld.so --library-path $common_objpfx \
|
${tst_rpmatch} $locale $string $result \
|
||||||
${common_objpfx}localedata/tst-rpmatch $locale $string $result \
|
|
||||||
|| exit 1
|
|| exit 1
|
||||||
fi
|
fi
|
||||||
done <<EOF
|
done <<EOF
|
||||||
|
|
|
@ -19,10 +19,11 @@
|
||||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
common_objpfx=$1
|
common_objpfx=$1
|
||||||
|
run_program_prefix=$2
|
||||||
|
|
||||||
# Generate the necessary locale data.
|
# Generate the necessary locale data.
|
||||||
I18NPATH=. GCONV_PATH=${common_objpfx}/iconvdata \
|
I18NPATH=. GCONV_PATH=${common_objpfx}/iconvdata \
|
||||||
${common_objpfx}elf/ld.so --library-path $common_objpfx \
|
${run_program_prefix} \
|
||||||
${common_objpfx}locale/localedef --quiet \
|
${common_objpfx}locale/localedef --quiet \
|
||||||
-i tests/trans.def -f charmaps/ISO-8859-1 \
|
-i tests/trans.def -f charmaps/ISO-8859-1 \
|
||||||
${common_objpfx}localedata/tt_TT ||
|
${common_objpfx}localedata/tt_TT ||
|
||||||
|
@ -30,7 +31,7 @@ exit 1
|
||||||
|
|
||||||
# Run the test program.
|
# Run the test program.
|
||||||
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
||||||
LC_ALL=tt_TT ${common_objpfx}elf/ld.so --library-path $common_objpfx \
|
LC_ALL=tt_TT ${run_program_prefix} \
|
||||||
${common_objpfx}localedata/tst-trans > ${common_objpfx}localedata/tst-trans.out
|
${common_objpfx}localedata/tst-trans > ${common_objpfx}localedata/tst-trans.out
|
||||||
|
|
||||||
exit $?
|
exit $?
|
||||||
|
|
|
@ -366,7 +366,7 @@ services_keys (int number, char *key[])
|
||||||
*proto++ = '\0';
|
*proto++ = '\0';
|
||||||
|
|
||||||
if (isdigit (key[i][0]))
|
if (isdigit (key[i][0]))
|
||||||
serv = getservbyport (atol (key[i]), proto);
|
serv = getservbyport (htons (atol (key[i])), proto);
|
||||||
else
|
else
|
||||||
serv = getservbyname (key[i], proto);
|
serv = getservbyname (key[i], proto);
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ clean-mpn:
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Testdir has to be named stdlib and needs to be writable
|
# Testdir has to be named stdlib and needs to be writable
|
||||||
test-canon-ARGS = --test-dir=${objdir}/stdlib
|
test-canon-ARGS = --test-dir=${common-objpfx}stdlib
|
||||||
|
|
||||||
# Run a test on the header files we use.
|
# Run a test on the header files we use.
|
||||||
tests: $(objpfx)isomac
|
tests: $(objpfx)isomac
|
||||||
|
|
Loading…
Reference in New Issue