This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via c8b14823b5325da8b51b49a121fadb7a54dbb5c9 (commit)
via 63317e68f9bf9c619868bd85c5d1f07f6c338036 (commit)
via 09a1526c1d63f7b9a19c014e792008b15011afbc (commit)
via de272b8d01d6367d2c607b6cef3a68cbb547666b (commit)
via 2111d89d34f49518e4010efaf6f4db7b9d94f3a4 (commit)
via ad88c73c0755d5326e426215400273bf9ddc1801 (commit)
via 628da1ef4b93799e29407757818f12460520a786 (commit)
via 06819b3a9e4691e395e2d94feafaa833cab576dc (commit)
via acae54ec7f291cb89d0f998d3889b4e63aa5dd9d (commit)
via 95581e1079a50bd9e56129e9c319a748555783a2 (commit)
via a7bbbfaa704b6000c285aecb2828b9726a9710e0 (commit)
via e6af2c68730120e0c1a8a6db332d5aeff0397b9d (commit)
from 5c40e928facb9bbcb301942a22b47d3991a024b6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c8b14823b5325da8b51b49a121fadb7a54dbb5c9
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Thu Jan 7 22:19:01 2016 +0100
disable always failing tst-signal7
The required test for the internal NPTL used signals isn't
implemented.
commit 63317e68f9bf9c619868bd85c5d1f07f6c338036
Author: Yoshinori Sato <ysato(a)users.sourceforge.jp>
Date: Mon Jan 4 22:44:26 2016 +0900
Remove alias.
open_cancel and open2_cancel have diffrent argument on open.
So can't alias this functions.
Signed-off-by: Yoshinori Sato <ysato(a)users.sourceforge.jp>
commit 09a1526c1d63f7b9a19c014e792008b15011afbc
Author: Yoshinori Sato <ysato(a)users.sourceforge.jp>
Date: Mon Jan 4 22:44:25 2016 +0900
openat argument fix.
If argument passing to register case (ex. -mregparam=3).
This case set all parameters set to register from caller.
But callee refer to stack. So can't get parameter.
Signed-off-by: Yoshinori Sato <ysato(a)users.sourceforge.jp>
commit de272b8d01d6367d2c607b6cef3a68cbb547666b
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sun Jan 3 19:44:54 2016 +0100
pthread_atfork handlers not removed during dlclose
Invoke pthread_atfork handler cleanup when removing the associated DSO...
If a program loads a DSO (dlopen) that sets up a pthread_atfork handler(s), and
then subsequently closes the DSO, the handler(s) are left in place. If fork()
is subsequently called, the handlers are invoked even though the DSO has been
removed causing crashes or unpredictable code execution. This is because the
code in __cxa_finalize(atexit.c)to invoke the unregister_atfork() routine is
ifdef'd out with the comment that it hasn't been "looked into this
yet...".
Refs.:
http://bugs.busybox.net/show_bug.cgi?id=8211
http://sourceware.org/bugzilla/show_bug.cgi?id=13502
Add test-case, enable cleanup for NPTL only.
Signed-off-by: John Ata <john.ata(a)baesystems.com>
Signed-off-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
commit 2111d89d34f49518e4010efaf6f4db7b9d94f3a4
Author: Yoshinori Sato <ysato(a)users.sourceforge.jp>
Date: Fri Jan 1 19:49:25 2016 +0900
__ARCH_HAS_DEPRECATED_SYSCALLS__ case fix. getdents is deprecated.
Signed-off-by: Yoshinori Sato <ysato(a)users.sourceforge.jp>
commit ad88c73c0755d5326e426215400273bf9ddc1801
Author: Yoshinori Sato <ysato(a)users.sourceforge.jp>
Date: Fri Jan 1 19:48:49 2016 +0900
h8300: vfork flags update.
Signed-off-by: Yoshinori Sato <ysato(a)users.sourceforge.jp>
commit 628da1ef4b93799e29407757818f12460520a786
Author: Anthony G. Basile <blueness(a)gentoo.org>
Date: Sat Jan 2 16:20:25 2016 -0500
extra/Configs/Config.in: add syncfs() to Linux-specific functions
syncfs() was recently added (commit dfa593d4d). But man sync(2) specifies
that syncfs() is Linux-specific. This was overlooked in the original
commit so we add it to the set of Linux-specific functions supported by
uClibc.
Signed-off-by: Anthony G. Basile <blueness(a)gentoo.org>
commit 06819b3a9e4691e395e2d94feafaa833cab576dc
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sun Jan 3 19:20:40 2016 +0100
libc: getpass,getutent: allocate buffer dynamically
Saves 0.6k bss with default buffer size(256).
text data bss dec hex filename
- 1172 8 408 1588 634 libc/misc/utmp/utent.os
- 429 0 256 685 2ad libc/unistd/getpass.os
+ 1208 8 28 1244 4dc libc/misc/utmp/utent.os
+ 471 0 4 475 1db libc/unistd/getpass.os
================================================================
+78 -632
Signed-off-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
commit acae54ec7f291cb89d0f998d3889b4e63aa5dd9d
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sun Jan 3 19:20:23 2016 +0100
remove pregenerated locale support, we don't support it
commit 95581e1079a50bd9e56129e9c319a748555783a2
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sat Jan 2 16:55:40 2016 +0100
libc/inet: Unbreak gethostent()
Although gethostent() is obsoleted, there is no reason to keep it broken.
Fix two problems:
* commit f65e66078b "resolver: switch to config parser" leave an extra
break
statement in case of GETHOSTENT in __read_etc_hosts_r. In result,
output buffer wasn't initialized at all.
* gethostent static buffer has insufficient size to store aliases,
so __read_etc_hosts_r always returns ERANGE. Restore ALIAS_DIM define.
Add test-case.
Signed-off-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
commit a7bbbfaa704b6000c285aecb2828b9726a9710e0
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sat Jan 2 16:51:55 2016 +0100
Use dynamic buffers for gethostent/gethostbyname/gethostbyaddr
Save ~1k static space (.bss)
text data bss dec hex filename
- 68 0 126 194 c2 libc/inet/gethostent.os
- 79 0 460 539 21b libc/inet/gethostbyname2.os
- 83 0 460 543 21f libc/inet/gethostbyaddr.os
+ 98 0 24 122 7a libc/inet/gethostent.os
+ 110 0 24 134 86 libc/inet/gethostbyname2.os
+ 113 0 24 137 89 libc/inet/gethostbyaddr.os
==================================================================
+91 -974
Signed-off-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
commit e6af2c68730120e0c1a8a6db332d5aeff0397b9d
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sat Jan 2 16:48:54 2016 +0100
libc/pwd_grp: Allocate buffers for non-reentrant functions dynamically
Saves 3k bss with default buffer size(256).
text data bss dec hex filename
- 61 0 272 333 14d fgetgrent.os
- 61 0 284 345 159 fgetpwent.os
- 61 0 292 353 161 fgetspent.os
- 57 0 272 329 149 getgrent.os
- 61 0 272 333 14d getgrgid.os
- 61 0 272 333 14d getgrnam.os
- 57 0 284 341 155 getpwent.os
- 61 0 284 345 159 getpwnam.os
- 61 0 284 345 159 getpwuid.os
- 57 0 292 349 15d getspent.os
- 61 0 292 353 161 getspnam.os
- 61 0 292 353 161 sgetspent.os
+ 94 0 20 114 72 fgetgrent.os
+ 94 0 32 126 7e fgetpwent.os
+ 94 0 40 134 86 fgetspent.os
+ 87 0 20 107 6b getgrent.os
+ 94 0 20 114 72 getgrgid.os
+ 94 0 20 114 72 getgrnam.os
+ 87 0 32 119 77 getpwent.os
+ 94 0 32 126 7e getpwnam.os
+ 94 0 32 126 7e getpwuid.os
+ 87 0 40 127 7f getspent.os
+ 94 0 40 134 86 getspnam.os
+ 94 0 40 134 86 sgetspent.os
=====================================================
+387 -3024
Signed-off-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
-----------------------------------------------------------------------
Summary of changes:
extra/Configs/Config.in | 29 ++-----------
extra/locale/Makefile.in | 22 ----------
extra/scripts/randconfig.sh | 2 -
libc/inet/resolv.c | 75 +++++++++++++++++----------------
libc/misc/utmp/utent.c | 12 ++++--
libc/pwd_grp/pwd_grp_internal.c | 10 +++--
libc/stdlib/_atexit.c | 9 ++--
libc/sysdeps/linux/common/Makefile.in | 1 +
libc/sysdeps/linux/common/getdents.c | 2 +-
libc/sysdeps/linux/common/open.c | 10 ++++-
libc/sysdeps/linux/common/openat.c | 15 ++++++-
libc/sysdeps/linux/h8300/vfork.S | 2 +-
libc/unistd/getpass.c | 8 +++-
test/inet/gethost.c | 40 ++++++++++++++++++
test/nptl/Makefile.in | 10 ++++-
test/nptl/libatfork.c | 27 ++++++++++++
test/nptl/tst-atfork2.c | 24 +++++++++++
17 files changed, 192 insertions(+), 106 deletions(-)
create mode 100644 test/inet/gethost.c
create mode 100644 test/nptl/libatfork.c
create mode 100644 test/nptl/tst-atfork2.c
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index 64c1870..943adc7 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -959,8 +959,9 @@ config UCLIBC_LINUX_SPECIFIC
sched_getaffinity(), sched_setaffinity(), sendfile(),
setfsgid(), setfsuid(), setresgid(), setresuid(),
splice(), vmsplice(), tee(), signalfd(), statfs(),
- swapoff(), swapon(), sync_file_range(), _sysctl(),
- sysinfo(), timerfd_*(), vhangup(), umount(), umount2()
+ swapoff(), swapon(), sync_file_range(), syncfs(),
+ _sysctl(), sysinfo(), timerfd_*(), vhangup(), umount(),
+ umount2()
config UCLIBC_HAS_GNU_ERROR
bool "Support GNU extensions for error-reporting"
@@ -1472,17 +1473,6 @@ config UCLIBC_BUILD_MINIMAL_LOCALE
If you do not need all locales that are available on your
host-box, then set this to 'Y'.
-config UCLIBC_PREGENERATED_LOCALE_DATA
- bool "Use Pre-generated Locale Data"
- depends on UCLIBC_HAS_LOCALE && !TARGET_metag
- help
- Use pre-built locale data.
-
- Note that these pregenerated locales are sensitive to your
- target architecture (endianess, bitcount).
-
- Saying N here is highly recommended.
-
endchoice
config UCLIBC_BUILD_MINIMAL_LOCALES
@@ -1497,19 +1487,6 @@ config UCLIBC_BUILD_MINIMAL_LOCALES
default:
en_US
-config UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA
- bool "Automagically Download the Pre-generated Locale Data (if necessary)"
- depends on UCLIBC_PREGENERATED_LOCALE_DATA
- help
- If you would like the build process to use 'wget' to automatically
- download the pregenerated locale data, enable this option. Otherwise
- you will need to obtain the locale data yourself from:
-
http://www.uclibc.org/downloads/uClibc-locale-*.tgz
- and place the uClibc-locale-*.tgz tarball in the extra/locale/
- directory.
-
- Note that the use of pregenerated locale data is discouraged.
-
config UCLIBC_HAS_XLOCALE
bool "Extended Locale Support (experimental/incomplete)"
depends on UCLIBC_HAS_LOCALE
diff --git a/extra/locale/Makefile.in b/extra/locale/Makefile.in
index efd07ed..117993f 100644
--- a/extra/locale/Makefile.in
+++ b/extra/locale/Makefile.in
@@ -190,26 +190,6 @@ $(locale_OUT)/locale_collate.h: $(locale_OUT)/gen_collate
$(locale_OUT)/locale_t
$(SED) -e "s/^.*COL_IDX_\([^, ]*\).*$$/\1/" | sort | uniq | \
xargs $< $(locale_DIR)/collation $(FLAG-locale-verbose) -o $@
-$(locale_OUT)/$(LOCALE_DATA_FILENAME):
-ifeq ($(UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA),y)
- ( cd $(@D); $(WGET)
http://www.uclibc.org/downloads/$(@F) )
-endif
-
-ifeq ($(UCLIBC_PREGENERATED_LOCALE_DATA),y)
-
-$(locale_SRC): $(locale_OUT)/$(LOCALE_DATA_FILENAME)
- zcat $< | $(TAR) -xv -C $(@D) -f -
- touch $@
- # we use the one in locale_DIR
- #$(RM) $(locale_OUT)/locale_mmap.h
-
-# for arch specific versions we have to at least overwrite
-# lt_defines.h/locale_data.c/uClibc_locale_data.h
-
-$(locale_OUT)/uClibc_locale_data.h: $(locale_SRC)
-
-else
-
$(locale_SRC): $(locale_OUT)/gen_ldc $(locale_OUT)/lt_defines.h
@$(disp_gen)
$(Q)$< $@
@@ -219,8 +199,6 @@ $(locale_OUT)/uClibc_locale_data.h: $(locale_OUT)/lt_defines.h
$(locale_OUT)/c8t
$(Q)grep -v "define __LC" $< > $@
$(Q)cat $(wordlist 2,4,$^) >> $@
-endif
-
$(top_builddir)include/bits/uClibc_locale_data.h: $(locale_OUT)/uClibc_locale_data.h |
$(top_builddir)include/bits/uClibc_config.h
@$(disp_gen)
$(Q)$(AWK) 'BEGIN{i=1}{if (/WANT_/) i=/endif/;else if (i) print $0}' \
diff --git a/extra/scripts/randconfig.sh b/extra/scripts/randconfig.sh
index 4c7126b..d83731b 100755
--- a/extra/scripts/randconfig.sh
+++ b/extra/scripts/randconfig.sh
@@ -10,9 +10,7 @@ test "x$AWK" = "x" && AWK=awk
test "x$ARCH" = "x" && ARCH=`uname -m`
KCONFIG_ALLCONFIG=.config.allconfig
(echo TARGET_$ARCH=y
- echo '# UCLIBC_PREGENERATED_LOCALE_DATA is not set'
echo '# DOMULTI is not set'
- echo '# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA is not set'
) > $KCONFIG_ALLCONFIG
export KCONFIG_ALLCONFIG
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index c7487a6..dea451a 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -297,6 +297,7 @@ Domain name in a message can be represented as either:
#include <stdio.h>
#include <stdio_ext.h>
#include <signal.h>
+#include <malloc.h>
#include <errno.h>
#include <sys/poll.h>
#include <sys/socket.h>
@@ -336,6 +337,8 @@ Domain name in a message can be represented as either:
#define MAX_RECURSE 5
#define MAXALIASES (4)
+/* 1:ip + 1:full + MAX_ALIASES:aliases + 1:NULL */
+#define ALIAS_DIM (2 + MAXALIASES + 1)
#define BUFSZ (80) /* one line */
#define NS_TYPE_ELT 0x40 /*%< EDNS0 extended label type */
@@ -1649,9 +1652,8 @@ int __read_etc_hosts_r(
result_buf->h_aliases = tok+1;
if (action == GETHOSTENT) {
/* Return whatever the next entry happens to be. */
- break;
- }
- if (action == GET_HOSTS_BYADDR) {
+ ;
+ } else if (action == GET_HOSTS_BYADDR) {
if (strcmp(name, *tok) != 0)
continue;
} else { /* GET_HOSTS_BYNAME */
@@ -2601,23 +2603,38 @@ libc_hidden_def(gethostent_r)
#endif /* L_gethostent_r */
+#ifndef __UCLIBC_HAS_IPV6__
+ #define GETXX_BUFSZ (sizeof(struct in_addr) + sizeof(struct in_addr *) * 2 + \
+ /*sizeof(char *)*ALIAS_DIM */+ 384/*namebuffer*/ + 32/* margin */)
+#else
+ #define GETXX_BUFSZ (sizeof(struct in6_addr) + sizeof(struct in6_addr *) * 2 + \
+ /*sizeof(char *)*ALIAS_DIM */+ 384/*namebuffer*/ + 32/* margin */)
+#endif /* __UCLIBC_HAS_IPV6__ */
+
+#define __INIT_GETXX_BUF(sz) \
+ if (buf == NULL) \
+ buf = (char *)__uc_malloc((sz));
+
#ifdef L_gethostent
struct hostent *gethostent(void)
{
static struct hostent hoste;
- static char buf[
+ static char *buf = NULL;
+ struct hostent *host = NULL;
#ifndef __UCLIBC_HAS_IPV6__
- sizeof(struct in_addr) + sizeof(struct in_addr *) * 2 +
+ #define HOSTENT_BUFSZ (sizeof(struct in_addr) + sizeof(struct in_addr *) * 2 + \
+ sizeof(char *)*ALIAS_DIM + BUFSZ /*namebuffer*/ + 2 /* margin */)
#else
- sizeof(struct in6_addr) + sizeof(struct in6_addr *) * 2 +
+ #define HOSTENT_BUFSZ (sizeof(struct in6_addr) + sizeof(struct in6_addr *) * 2 + \
+ sizeof(char *)*ALIAS_DIM + BUFSZ /*namebuffer*/ + 2 /* margin */)
#endif /* __UCLIBC_HAS_IPV6__ */
- BUFSZ /*namebuffer*/ + 2 /* margin */];
- struct hostent *host;
- gethostent_r(&hoste, buf, sizeof(buf), &host, &h_errno);
+ __INIT_GETXX_BUF(HOSTENT_BUFSZ);
+ gethostent_r(&hoste, buf, HOSTENT_BUFSZ, &host, &h_errno);
return host;
}
+#undef HOSTENT_BUFSZ
#endif /* L_gethostent */
@@ -2625,18 +2642,20 @@ struct hostent *gethostent(void)
struct hostent *gethostbyname2(const char *name, int family)
{
-#ifndef __UCLIBC_HAS_IPV6__
- return family == AF_INET ? gethostbyname(name) : (struct hostent*)NULL;
-#else
static struct hostent hoste;
- static char buf[sizeof(struct in6_addr) +
- sizeof(struct in6_addr *) * 2 +
- /*sizeof(char *)*ALIAS_DIM +*/ 384/*namebuffer*/ + 32/* margin */];
+ static char *buf = NULL;
struct hostent *hp;
- gethostbyname2_r(name, family, &hoste, buf, sizeof(buf), &hp, &h_errno);
+ __INIT_GETXX_BUF(GETXX_BUFSZ);
+#ifndef __UCLIBC_HAS_IPV6__
+ if (family != AF_INET)
+ return (struct hostent*)NULL;
+ gethostbyname_r(name, &hoste, buf, GETXX_BUFSZ, &hp, &h_errno);
+#else
+ gethostbyname2_r(name, family, &hoste, buf, GETXX_BUFSZ, &hp, &h_errno);
+#endif /* __UCLIBC_HAS_IPV6__ */
+
return hp;
-#endif
}
libc_hidden_def(gethostbyname2)
#endif /* L_gethostbyname2 */
@@ -2646,18 +2665,7 @@ libc_hidden_def(gethostbyname2)
struct hostent *gethostbyname(const char *name)
{
-#ifndef __UCLIBC_HAS_IPV6__
- static struct hostent hoste;
- static char buf[sizeof(struct in_addr) +
- sizeof(struct in_addr *) * 2 +
- /*sizeof(char *)*ALIAS_DIM +*/ 384/*namebuffer*/ + 32/* margin */];
- struct hostent *hp;
-
- gethostbyname_r(name, &hoste, buf, sizeof(buf), &hp, &h_errno);
- return hp;
-#else
return gethostbyname2(name, AF_INET);
-#endif
}
libc_hidden_def(gethostbyname)
#endif /* L_gethostbyname */
@@ -2668,16 +2676,11 @@ libc_hidden_def(gethostbyname)
struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type)
{
static struct hostent hoste;
- static char buf[
-#ifndef __UCLIBC_HAS_IPV6__
- sizeof(struct in_addr) + sizeof(struct in_addr *)*2 +
-#else
- sizeof(struct in6_addr) + sizeof(struct in6_addr *)*2 +
-#endif /* __UCLIBC_HAS_IPV6__ */
- /*sizeof(char *)*ALIAS_DIM +*/ 384 /*namebuffer*/ + 32 /* margin */];
+ static char *buf = NULL;
struct hostent *hp;
- gethostbyaddr_r(addr, len, type, &hoste, buf, sizeof(buf), &hp, &h_errno);
+ __INIT_GETXX_BUF(GETXX_BUFSZ);
+ gethostbyaddr_r(addr, len, type, &hoste, buf, GETXX_BUFSZ, &hp, &h_errno);
return hp;
}
libc_hidden_def(gethostbyaddr)
diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c
index 3671bb0..16f4b11 100644
--- a/libc/misc/utmp/utent.c
+++ b/libc/misc/utmp/utent.c
@@ -18,6 +18,7 @@
#include <fcntl.h>
#include <paths.h>
#include <errno.h>
+#include <malloc.h>
#include <string.h>
#include "internal/utmp.h"
#include <not-cancel.h>
@@ -27,7 +28,7 @@ __UCLIBC_MUTEX_STATIC(utmplock, PTHREAD_MUTEX_INITIALIZER);
/* Some global crap */
static int static_fd = -1;
-static struct UT static_utmp;
+static struct UT *static_utmp = NULL;
static const char default_file[] = __DEFAULT_PATH_UTMP;
static const char *current_file = default_file;
@@ -72,9 +73,12 @@ static struct UT *__get_unlocked(void)
return NULL;
}
- if (read_not_cancel(static_fd, &static_utmp,
- sizeof(static_utmp)) == sizeof(static_utmp)) {
- return &static_utmp;
+ if (static_utmp == NULL)
+ static_utmp = (struct UT *)__uc_malloc(sizeof(struct UT));
+
+ if (read_not_cancel(static_fd, static_utmp,
+ sizeof(struct UT)) == sizeof(struct UT)) {
+ return static_utmp;
}
return NULL;
diff --git a/libc/pwd_grp/pwd_grp_internal.c b/libc/pwd_grp/pwd_grp_internal.c
index 104f532..f82c298 100644
--- a/libc/pwd_grp/pwd_grp_internal.c
+++ b/libc/pwd_grp/pwd_grp_internal.c
@@ -26,6 +26,7 @@
#include <string.h>
#include <stddef.h>
#include <errno.h>
+#include <malloc.h>
#include <assert.h>
#include <ctype.h>
#include <pwd.h>
@@ -92,14 +93,17 @@ libc_hidden_def(GETXXKEY_R_FUNC)
GETXXKEY_ENTTYPE *GETXXKEY_FUNC(GETXXKEY_ADD_PARAMS)
{
- static char buffer[GETXXKEY_BUFLEN];
+ static char *buffer = NULL;
static GETXXKEY_ENTTYPE resultbuf;
GETXXKEY_ENTTYPE *result;
+ if (buffer == NULL)
+ buffer = (char *)__uc_malloc(GETXXKEY_BUFLEN);
+
# ifdef GETXXKEY_ADD_VARIABLES
- REENTRANT_NAME(GETXXKEY_ADD_VARIABLES, &resultbuf, buffer, sizeof(buffer),
&result);
+ REENTRANT_NAME(GETXXKEY_ADD_VARIABLES, &resultbuf, buffer, GETXXKEY_BUFLEN,
&result);
# else
- REENTRANT_NAME(&resultbuf, buffer, sizeof(buffer), &result);
+ REENTRANT_NAME(&resultbuf, buffer, GETXXKEY_BUFLEN, &result);
# endif
return result;
}
diff --git a/libc/stdlib/_atexit.c b/libc/stdlib/_atexit.c
index 3faa9f0..8a31967 100644
--- a/libc/stdlib/_atexit.c
+++ b/libc/stdlib/_atexit.c
@@ -43,6 +43,9 @@
#include <stdio.h>
#include <errno.h>
#include <atomic.h>
+#if defined __UCLIBC_HAS_THREADS__ && defined __UCLIBC_HAS_THREADS_NATIVE__
+# include <fork.h>
+#endif
#include <bits/uClibc_mutex.h>
__UCLIBC_MUTEX_EXTERN(__atexit_lock) attribute_hidden;
@@ -208,17 +211,15 @@ void __cxa_finalize(void *dso_handle)
}
}
-#if 0 /* haven't looked into this yet... */
/*
* Remove the registered fork handlers. We do not have to
* unregister anything if the program is going to terminate anyway.
*/
#ifdef UNREGISTER_ATFORK
- if (d != NULL) {
- UNREGISTER_ATFORK(d);
+ if (dso_handle != NULL) {
+ UNREGISTER_ATFORK(dso_handle);
}
#endif
-#endif
}
#endif
diff --git a/libc/sysdeps/linux/common/Makefile.in
b/libc/sysdeps/linux/common/Makefile.in
index ade0ac3..887dc3d 100644
--- a/libc/sysdeps/linux/common/Makefile.in
+++ b/libc/sysdeps/linux/common/Makefile.in
@@ -56,6 +56,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
swapoff.c \
swapon.c \
sync_file_range.c \
+ syncfs.c \
sysctl.c \
sysinfo.c \
tee.c \
diff --git a/libc/sysdeps/linux/common/getdents.c b/libc/sysdeps/linux/common/getdents.c
index b65524e..8f371eb 100644
--- a/libc/sysdeps/linux/common/getdents.c
+++ b/libc/sysdeps/linux/common/getdents.c
@@ -91,7 +91,7 @@ ssize_t __getdents (int fd, char *buf, size_t nbytes)
const size_t size_diff = (offsetof (struct dirent, d_name)
- offsetof (struct kernel_dirent, d_name));
-# ifdef __ARCH_HAS_DEPRECATED_SYSCALLS__
+# ifndef __ARCH_HAS_DEPRECATED_SYSCALLS__
red_nbytes = MIN (nbytes - ((nbytes /
(offsetof (struct dirent, d_name) + 14)) * size_diff),
nbytes - size_diff);
diff --git a/libc/sysdeps/linux/common/open.c b/libc/sysdeps/linux/common/open.c
index aab0fb5..fd37ea0 100644
--- a/libc/sysdeps/linux/common/open.c
+++ b/libc/sysdeps/linux/common/open.c
@@ -57,6 +57,12 @@ int open(const char *file, int oflag, ...)
lt_strong_alias(open)
lt_libc_hidden(open)
#if !defined(__NR_open)
-strong_alias_untyped(open,__open2_nocancel)
-strong_alias_untyped(open,__open_nocancel)
+int __open2_nocancel(const char *file, int oflag)
+{
+ return open(file, oflag);
+}
+int __open_nocancel(const char *file, int oflag, mode_t mode)
+{
+ return open(file, oflag, mode);
+}
#endif
diff --git a/libc/sysdeps/linux/common/openat.c b/libc/sysdeps/linux/common/openat.c
index f6032da..f71567c 100644
--- a/libc/sysdeps/linux/common/openat.c
+++ b/libc/sysdeps/linux/common/openat.c
@@ -8,11 +8,24 @@
#include <sys/syscall.h>
#include <fcntl.h>
+#include <stdarg.h>
#ifdef __NR_openat
# define __NR___syscall_openat __NR_openat
static __inline__ _syscall4(int, __syscall_openat, int, fd, const char *, file, int,
oflag, mode_t, mode)
-strong_alias_untyped(__syscall_openat,openat)
+
+int __openat(int fd, const char *file, int o_flag, ...)
+{
+ va_list ap;
+ mode_t mode;
+
+ va_start(ap, o_flag);
+ mode = va_arg(ap, int);
+ va_end(ap);
+ return __syscall_openat(fd, file, o_flag, mode);
+}
+
+strong_alias_untyped(__openat,openat)
libc_hidden_def(openat)
#else
/* should add emulation with open() and /proc/self/fd/ ... */
diff --git a/libc/sysdeps/linux/h8300/vfork.S b/libc/sysdeps/linux/h8300/vfork.S
index 1c70dd2..24370df 100644
--- a/libc/sysdeps/linux/h8300/vfork.S
+++ b/libc/sysdeps/linux/h8300/vfork.S
@@ -56,7 +56,7 @@ done:
jmp @er2
vfork_args:
- .long 0x80004100 /* CLONE_VFORK | CLONE_VM | SIGCHLD */
+ .long 0x00004111 /* CLONE_VFORK | CLONE_VM | SIGCHLD */
.long 0
.long 0
.long 0
diff --git a/libc/unistd/getpass.c b/libc/unistd/getpass.c
index a490abe..c46d3d4 100644
--- a/libc/unistd/getpass.c
+++ b/libc/unistd/getpass.c
@@ -19,6 +19,7 @@
#include <string.h>
#include <termios.h>
#include <unistd.h>
+#include <malloc.h>
#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
@@ -38,9 +39,12 @@ char * getpass (const char *prompt)
FILE *in, *out;
struct termios s, t;
int tty_changed;
- static char buf[PWD_BUFFER_SIZE];
+ static char *buf = NULL;
int nread;
+ if (buf == NULL)
+ buf = (char *)__uc_malloc(PWD_BUFFER_SIZE);
+
/* Try to write to and read from the terminal if we can.
If we can't open the terminal, use stderr and stdin. */
@@ -74,7 +78,7 @@ char * getpass (const char *prompt)
fflush(out);
/* Read the password. */
- if (!fgets (buf, sizeof(buf), in))
+ if (!fgets (buf, PWD_BUFFER_SIZE, in))
buf[0] = '\0';
nread = strlen(buf);
if (nread > 0 && buf[nread - 1] == '\n')
diff --git a/test/inet/gethost.c b/test/inet/gethost.c
new file mode 100644
index 0000000..77467e9
--- /dev/null
+++ b/test/inet/gethost.c
@@ -0,0 +1,40 @@
+#include <errno.h>
+#include <netdb.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <arpa/inet.h>
+#include <sys/socket.h>
+
+int main(void)
+{
+ in_addr_t addr = inet_addr("127.0.0.1");
+ struct hostent *hent;
+
+ hent = gethostent();
+ if (hent == NULL) {
+ printf("gethostent(%d):%s\n", errno, hstrerror(h_errno));
+ exit(1);
+ }
+
+ hent = gethostbyname("localhost");
+ if (hent == NULL) {
+ printf("gethostbyname(%d):%s\n", errno, hstrerror(h_errno));
+ exit(1);
+ }
+
+ hent = gethostbyname2("localhost", AF_INET);
+ if (hent == NULL) {
+ printf("gethostbyname2(%d):%s\n", errno, hstrerror(h_errno));
+ exit(1);
+ }
+
+ hent = gethostbyaddr(&addr, sizeof(addr), AF_INET);
+ if (hent == NULL) {
+ printf("gethostbyaddr(%d):%s\n", errno, hstrerror(h_errno));
+ exit(1);
+ }
+
+ return 0;
+}
+
diff --git a/test/nptl/Makefile.in b/test/nptl/Makefile.in
index 09e2804..d43db2b 100644
--- a/test/nptl/Makefile.in
+++ b/test/nptl/Makefile.in
@@ -40,9 +40,10 @@ TESTS := tst-align tst-align2 tst-atfork1 tst-attr1 tst-attr2
tst-attr3 \
tst-cleanupx2 tst-cleanupx3 tst-cleanupx4 tst-cond22 tst-cond23 \
tst-getpid1 tst-getpid2 tst-getpid3 tst-join6 tst-tsd6 \
tst-oddstacklimit tst-oncex3 tst-oncex4 tst-rwlock2a \
- tst-basic7 tst-signal7 tst-vfork1x tst-vfork2x tst-sem10 tst-sem11 \
+ tst-basic7 tst-vfork1x tst-vfork2x tst-sem10 tst-sem11 \
tst-sem12 tst-typesizes tst-initializers1-c89 tst-initializers1-c99 \
- tst-initializers1-gnu89 tst-initializers1-gnu99
+ tst-initializers1-gnu89 tst-initializers1-gnu99 \
+ tst-atfork2
#
# These are for the RT library and POSIX timers.
@@ -151,6 +152,8 @@ CFLAGS_tst-initializers1-gnu99 = $(CFLAGS-tst-initializers1)
-std=gnu99
EXTRA_LDFLAGS = $(if $(findstring -lpthread,$(LDFLAGS_$@)),,-lpthread)
+LDFLAGS_tst-atfork2 := -ldl
+LDFLAGS_libatfork.so := -shared -static-libgcc -lpthread
LDFLAGS_tst-cleanup4 := tst-cleanup4aux.o
LDFLAGS_tst-cleanupx4 := tst-cleanup4aux.o
LDFLAGS_tst-clock2 := -lrt
@@ -207,6 +210,9 @@ tst-tls5: tst-tls5mod.so
tst-cleanupx4 : tst-cleanup4aux.o
tst-fini1: tst-fini1mod.so
+tst-atfork2: libatfork.so
+tst-atfork2_glibc: libatfork.so.glibc
+
OPTS_tst-cancel7 = -c ./tst-cancel7
OPTS_tst-mqueue7 = -- ./tst-mqueue7
OPTS_tst-exec4 = ./tst-exec4
diff --git a/test/nptl/libatfork.c b/test/nptl/libatfork.c
new file mode 100644
index 0000000..f4ddca0
--- /dev/null
+++ b/test/nptl/libatfork.c
@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include <pthread.h>
+
+static void atfork_prepare(void)
+{
+ /* nothing to do */
+}
+
+static void atfork_parent(void)
+{
+ /* nothing to do */
+}
+
+static void atfork_child(void)
+{
+ /* nothing to do */
+}
+
+static __attribute__((constructor)) void init(void)
+{
+ pthread_atfork(atfork_prepare, atfork_parent, atfork_child);
+}
+
+static __attribute__((destructor)) void done(void)
+{
+ /* nothing to do */
+}
diff --git a/test/nptl/tst-atfork2.c b/test/nptl/tst-atfork2.c
new file mode 100644
index 0000000..1c303de
--- /dev/null
+++ b/test/nptl/tst-atfork2.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <dlfcn.h>
+
+int main(int argc, char *argv[])
+{
+ void *h;
+ pid_t pid;
+
+ h = dlopen("libatfork.so", RTLD_NOW);
+ if (!h)
+ {
+ printf("Failed to open libatfork.so\n");
+ return 1;
+ }
+ dlclose(h);
+
+ if ((pid = fork()) < 0) {
+ printf("Fork failed\n");
+ return 1;
+ }
+
+ return 0;
+}
hooks/post-receive
--
uClibc-ng - small C library for embedded systems