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, upstream has been updated
via 40effcf4c1e9a2fb9169d9189bdc9b1c888f9345 (commit)
via 730db44f0824f505a31822e250b9f04b9f8e7a1b (commit)
via 272e4fa4d38440d5c01259fce7d74f8c0a9d300f (commit)
via c846358a61434e6cb9b1f73bc35df0e5404f52d2 (commit)
via 6cba32e6e9a1910ea0a5277fd39484047094e478 (commit)
via 97c9f52239301c81c021b8be187ac07ddf33496d (commit)
via d0f60a600bafc3f6dfc844418d310cf6a4e38c92 (commit)
via 4da43e9f2e4f2f7593427003e37b87287c7b16cf (commit)
via eee76e42f32f90af4e64a254810fcb767297fecf (commit)
via 9277fe13156a6ff2b055fe8a58d2863115c36b6a (commit)
via 63729418992d5f63965a88fa2ac3570e3d270479 (commit)
via 09ff424905d5de0b2a21a3960d9756a90b07ba26 (commit)
via 534f44d53146457b3ca686c47efb9207543b88e1 (commit)
via bf6f1313132a3d99d645ea8b6661c23d68235278 (commit)
via 5c3661fda947c1bc5e597be081c355b51c595794 (commit)
via bfb988452cc66ddf93f69a199c50ea1c14e9ccb7 (commit)
via 9faa7e94b824e1dc5fd9ce1b6f16c1b3f13c601a (commit)
via fdebbe2044653c5c84172524ed6e036d38716d88 (commit)
via 74e49a5e545576f1436a510495e2e8a682b0db4d (commit)
from 39206e01eb5d27b61410a05f2ccf6051a305db02 (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 40effcf4c1e9a2fb9169d9189bdc9b1c888f9345
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Tue Mar 24 00:11:49 2015 +0100
mips: switch float_t to float
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 730db44f0824f505a31822e250b9f04b9f8e7a1b
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Tue Mar 24 00:11:47 2015 +0100
libm: honor NO_LONG_DOUBLE in ldouble_wrappers
Fixes SH build breakage due to attempts to define hidden defs for
unavailable long double functions.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 272e4fa4d38440d5c01259fce7d74f8c0a9d300f
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Tue Mar 24 00:11:44 2015 +0100
libcrypt: Rename some internal macros
to avoid clashes
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit c846358a61434e6cb9b1f73bc35df0e5404f52d2
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Tue Mar 24 00:11:41 2015 +0100
buildsys: fix IS_IN_lib* for .s
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 6cba32e6e9a1910ea0a5277fd39484047094e478
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Tue Mar 24 00:11:38 2015 +0100
utmp: indent
indent only, no code changes
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 97c9f52239301c81c021b8be187ac07ddf33496d
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Tue Mar 24 00:11:28 2015 +0100
utmp: Remove unneeded aliases
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit d0f60a600bafc3f6dfc844418d310cf6a4e38c92
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Tue Mar 24 00:11:24 2015 +0100
utmp: add _unlocked suffix to internal helpers
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 4da43e9f2e4f2f7593427003e37b87287c7b16cf
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Tue Mar 24 00:11:21 2015 +0100
buildsys: HAS_UTMP (XPG2, SVr4 compat) knob
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit eee76e42f32f90af4e64a254810fcb767297fecf
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Tue Mar 24 00:11:15 2015 +0100
libc: TIME64_COMPAT32 for sparc, mips
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 9277fe13156a6ff2b055fe8a58d2863115c36b6a
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Tue Mar 24 00:09:45 2015 +0100
Revert "utent.c, wtent.c: move functions from utxent.c"
This reverts commit 84135275cfeebc0b233c1c96eeada4d4178a0b18.
This change is said to make systemd deadlock (cannot reproduce this)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Conflicts:
include/utmp.h
commit 63729418992d5f63965a88fa2ac3570e3d270479
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Sun Mar 22 14:47:29 2015 +0100
test: add utmpx test
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 09ff424905d5de0b2a21a3960d9756a90b07ba26
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Sun Mar 22 14:47:29 2015 +0100
libc: add getrandom(2)
Introduce a <sys/random.h> for it.
/* FIXME: aren't there a couple of __restrict and const missing ?
*/
extern int getrandom(void *__buf, size_t count, unsigned int flags)
__nonnull ((1)) __wur;
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 534f44d53146457b3ca686c47efb9207543b88e1
Author: Khem Raj <raj.khem(a)gmail.com>
Date: Sat Jun 23 16:51:52 2012 -0700
librt: Use -nodefaultlibs instead of -nostdlib
nostdlib disables linking in startup files too which is not
what we want here since it needs to resolve __dso_handle
which comes from crtbeginS.o, otherwise librt has this
undefined reference to a weak undefined __dso_handle that
shows up as error (with gold linker)
when shared libraries are being built which are
linking in librt
Signed-off-by: Khem Raj <raj.khem(a)gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit bf6f1313132a3d99d645ea8b6661c23d68235278
Author: Khem Raj <raj.khem(a)gmail.com>
Date: Sat Jun 23 15:59:01 2012 -0700
nptl/atfork: Hide pthread_atfork in shared versions
Signed-off-by: Khem Raj <raj.khem(a)gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 5c3661fda947c1bc5e597be081c355b51c595794
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Sun Mar 22 14:47:29 2015 +0100
libc: Fix vfprintf compilation without HAS_FLOATS
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit bfb988452cc66ddf93f69a199c50ea1c14e9ccb7
Author: Khem Raj <raj.khem(a)gmail.com>
Date: Sat Jun 23 14:21:17 2012 -0700
nptl/arm: Move aeabi_read_tp to uclibc_nonshared.a
Otherwise it creates wrong references from shared libs
Signed-off-by: Khem Raj <raj.khem(a)gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 9faa7e94b824e1dc5fd9ce1b6f16c1b3f13c601a
Author: Khem Raj <raj.khem(a)gmail.com>
Date: Sat Jun 23 13:26:30 2012 -0700
atexit_old: Do not add it to shared libc
atexit should only be in either uclibc_nonshared.a
shared libc case or libc.a in static build case
Signed-off-by: Khem Raj <raj.khem(a)gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit fdebbe2044653c5c84172524ed6e036d38716d88
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Sun Mar 22 14:47:29 2015 +0100
test: enable libm test log2
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
commit 74e49a5e545576f1436a510495e2e8a682b0db4d
Author: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
Date: Sun Mar 22 14:47:29 2015 +0100
extra: add clang flags for gen_bits_syscall_h
Closes bugzilla #6008
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop(a)gmail.com>
-----------------------------------------------------------------------
Summary of changes:
Makefile.in | 2 +
Makerules | 4 +-
extra/Configs/Config.in | 29 ++-
extra/Configs/Config.in.arch | 2 +-
extra/scripts/gen_bits_syscall_h.sh | 1 +
include/utmp.h | 8 +
ldso/ldso/sh/dl-syscalls.h | 2 +-
libc/misc/utmp/Makefile.in | 4 +-
libc/misc/utmp/utent.c | 272 +++++++++-------------
libc/misc/utmp/utxent.c | 5 +-
libc/misc/utmp/wtent.c | 15 +-
libc/stdio/_fpmaxtostr.h | 22 +-
libc/stdio/_vfprintf.c | 15 --
libc/stdlib/Makefile.in | 4 +-
libc/sysdeps/linux/arm/Makefile.arch | 4 +-
libc/sysdeps/linux/common/Makefile.in | 1 +
libc/sysdeps/linux/common/bits/kernel-features.h | 5 +
libc/sysdeps/linux/common/bits/utmp.h | 4 +-
libc/sysdeps/linux/common/bits/utmpx.h | 2 +-
libc/sysdeps/linux/common/getrandom.c | 14 ++
libc/sysdeps/linux/common/stubs.c | 4 +
libc/sysdeps/linux/common/sys/random.h | 33 +++
libc/sysdeps/linux/mips/bits/mathdef.h | 7 +-
libc/sysdeps/linux/mips/bits/wordsize.h | 3 +
libc/sysdeps/linux/powerpc/bits/wordsize.h | 2 +-
libc/sysdeps/linux/sparc/bits/wordsize.h | 1 +
libc/sysdeps/linux/x86_64/bits/wordsize.h | 9 +-
libcrypt/sha256.c | 18 +-
libcrypt/sha512.c | 18 +-
libm/ldouble_wrappers.c | 15 +-
libpthread/nptl/pthread_atfork.c | 12 +-
librt/Makefile.in | 3 +
libutil/Makefile.in | 8 +
libutil/logout.c | 2 +-
libutil/logwtmp.c | 2 +-
test/.gitignore | 1 +
test/math/libm-test.inc | 6 -
test/misc/Makefile.in | 4 +
test/misc/tst-utmp.c | 15 ++
test/misc/tst-utmpx.c | 2 +
40 files changed, 322 insertions(+), 258 deletions(-)
create mode 100644 libc/sysdeps/linux/common/getrandom.c
create mode 100644 libc/sysdeps/linux/common/sys/random.h
create mode 100644 test/misc/tst-utmpx.c
diff --git a/Makefile.in b/Makefile.in
index 5d60dda..2233be8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -294,6 +294,7 @@ HEADERS_RM-$(UCLIBC_HAS_THREADS) += *thread*.h semaphore.h
\
bits/initspin.h
HEADERS_RM-$(UCLIBC_HAS_THREADS_NATIVE) += atomic.h bits/atomic.h
HEADERS_RM-$(UCLIBC_HAS_OBSTACK) += obstack.h
+HEADERS_RM-$(UCLIBC_HAS_UTMP) += bits/utmp.h utmp.h
HEADERS_RM-$(UCLIBC_HAS_UTMPX) += bits/utmpx.h utmpx.h
HEADERS_RM-$(UCLIBC_HAS_WCHAR) += wchar.h wctype.h
HEADERS_RM-$(UCLIBC_HAS_WORDEXP) += wordexp.h
@@ -310,6 +311,7 @@ HEADERS_RM-$(UCLIBC_LINUX_SPECIFIC) += \
sys/perm.h \
sys/personality.h \
sys/prctl.h \
+ sys/random.h \
sys/reboot.h \
sys/sendfile.h \
bits/signalfd.h \
diff --git a/Makerules b/Makerules
index a60338a..fd6bb19 100644
--- a/Makerules
+++ b/Makerules
@@ -29,7 +29,9 @@ objs: all_objs
# apply unconditional per-directory flags
define add_IS_IN_lib
ifneq ($(strip $(2)),)
-__add_IS_IN_lib := $(2) $(2:.o=.i) $(2:.os=.i) $(2:.oS=.i)
+__add_IS_IN_lib := $(2)
+__add_IS_IN_lib += $(2:.o=.i) $(2:.os=.i) $(2:.oS=.i)
+__add_IS_IN_lib += $(2:.o=.s) $(2:.os=.s) $(2:.oS=.s)
$$(__add_IS_IN_lib): CFLAGS-for-library-members:=$(CFLAGS-$(1)) -DIN_LIB=$(word 1,$(subst
/, ,$(1)))
endif
endef
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index f5210cd..7546e96 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -700,6 +700,25 @@ config COMPAT_ATEXIT
Enable this option if you want to update from 0.9.28 to git/0.9.29,
else you will be missing atexit() until you rebuild all apps.
+config UCLIBC_HAS_UTMPX
+ bool "utmpx based support for tracking login/logouts to/from the
system"
+ depends on UCLIBC_HAS_UTMP # TODO, remove this, it's backward
+ help
+ Answer y to enable support for accessing user accounting database.
+ It can be used to track all login/logout to the system.
+
+config UCLIBC_HAS_UTMP
+ bool "utmp support (XPG2, SVr4 compat)"
+ help
+ Answer y to enable legacy SVID support for accessing
+ user accounting database:
+ getutent(), getutid(), getutline(), pututline(),
+ setutent(), endutent(), utmpname() in utmp.h
+ It can be used to track all login/logout to the system.
+
+ If unsure, just answer N and use utmpx.h and corresponding
+ POSIX functions.
+
config UCLIBC_SUSV2_LEGACY
bool "Enable SuSv2 LEGACY functions"
help
@@ -1025,7 +1044,7 @@ config UCLIBC_LINUX_SPECIFIC
help
accept4(), bdflush(),
capget(), capset(), eventfd(), fallocate(),
- fstatfs(), inotify_*(), ioperm(), iopl(),
+ fstatfs(), getrandom(), inotify_*(), ioperm(), iopl(),
madvise(), modify_ldt(), pipe2(), personality(),
prctl()/arch_prctl(), pivot_root(), modify_ldt(),
ppoll(), readahead(), reboot(), remap_file_pages(),
@@ -2042,14 +2061,6 @@ config UCLIBC_HAS_GNU_GLOB
Most people will answer N.
-config UCLIBC_HAS_UTMPX
- bool "utmpx based support for tracking login/logouts to/from the
system"
- help
- Answer y to enable support for accessing user accounting database.
- It can be used to track all login/logout to the system.
-
- If unsure, just answer N.
-
endmenu
diff --git a/extra/Configs/Config.in.arch b/extra/Configs/Config.in.arch
index 68e03bf..0dae84b 100644
--- a/extra/Configs/Config.in.arch
+++ b/extra/Configs/Config.in.arch
@@ -191,7 +191,7 @@ config UCLIBC_HAS_FENV
config UCLIBC_HAS_LONG_DOUBLE_MATH
bool "Enable long double support"
depends on DO_C99_MATH
- depends on TARGET_i386 || TARGET_m68k || TARGET_sparc || TARGET_x86_64 || TARGET_powerpc
|| TARGET_sh || TARGET_microblaze || TARGET_xtensa
+ depends on TARGET_aarch64 || TARGET_alpha || TARGET_i386 || TARGET_ia64 || TARGET_m68k
|| TARGET_powerpc || TARGET_s390 || TARGET_sparc || TARGET_tile || TARGET_x86_64
default y
help
If you want the uClibc math library to contain the full set of C99
diff --git a/extra/scripts/gen_bits_syscall_h.sh b/extra/scripts/gen_bits_syscall_h.sh
index c44cd8f..bfd06b8 100755
--- a/extra/scripts/gen_bits_syscall_h.sh
+++ b/extra/scripts/gen_bits_syscall_h.sh
@@ -23,6 +23,7 @@ fi
case $CC in
*icc*) CC_SYSNUM_ARGS="-dM" ;;
+*clang*) CC_SYSNUM_ARGS="-dM" ;;
*) CC_SYSNUM_ARGS="-dN" ;;
esac
diff --git a/include/utmp.h b/include/utmp.h
index 2908e33..754f767 100644
--- a/include/utmp.h
+++ b/include/utmp.h
@@ -56,29 +56,37 @@ extern void logwtmp (const char *__ut_line, const char *__ut_name,
/* Append entry UTMP to the wtmp-like file WTMP_FILE. */
extern void updwtmp (const char *__wtmp_file, const struct utmp *__utmp)
__THROW;
+libc_hidden_proto(updwtmp)
/* Change name of the utmp file to be examined. */
extern int utmpname (const char *__file) __THROW;
+libc_hidden_proto(utmpname)
/* Read next entry from a utmp-like file. */
extern struct utmp *getutent (void) __THROW;
+libc_hidden_proto(getutent)
/* Reset the input stream to the beginning of the file. */
extern void setutent (void) __THROW;
+libc_hidden_proto(setutent)
/* Close the current open file. */
extern void endutent (void) __THROW;
+libc_hidden_proto(endutent)
/* Search forward from the current point in the utmp file until the
next entry with a ut_type matching ID->ut_type. */
extern struct utmp *getutid (const struct utmp *__id) __THROW;
+libc_hidden_proto(getutid)
/* Search forward from the current point in the utmp file until the
next entry with a ut_line matching LINE->ut_line. */
extern struct utmp *getutline (const struct utmp *__line) __THROW;
+libc_hidden_proto(getutline)
/* Write out entry pointed to by UTMP_PTR into the utmp file. */
extern struct utmp *pututline (const struct utmp *__utmp_ptr) __THROW;
+libc_hidden_proto(pututline)
#if 0 /* def __USE_MISC */
diff --git a/ldso/ldso/sh/dl-syscalls.h b/ldso/ldso/sh/dl-syscalls.h
index f9f13c7..b99a9b5 100644
--- a/ldso/ldso/sh/dl-syscalls.h
+++ b/ldso/ldso/sh/dl-syscalls.h
@@ -1,4 +1,4 @@
-#if __GNUC_PREREQ (4, 1)
+#if __GNUC_PREREQ (4, 1) && !__GNUC_PREREQ (4, 9)
#warning !!! gcc 4.1 and later have problems with __always_inline so redefined as inline
# ifdef __always_inline
# undef __always_inline
diff --git a/libc/misc/utmp/Makefile.in b/libc/misc/utmp/Makefile.in
index 535efb1..715341c 100644
--- a/libc/misc/utmp/Makefile.in
+++ b/libc/misc/utmp/Makefile.in
@@ -7,7 +7,9 @@
subdirs += libc/misc/utmp
-CSRC-y := utent.c wtent.c
+CSRC-y :=
+CSRC-$(if $(findstring y,$(UCLIBC_HAS_UTMP)$(UCLIBC_HAS_UTMPX)),y) += wtent.c
+CSRC-$(UCLIBC_HAS_UTMP) += utent.c
CSRC-$(UCLIBC_HAS_UTMPX) += utxent.c
MISC_UTMP_DIR := $(top_srcdir)libc/misc/utmp
diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c
index a35bb2b..4d71f5e 100644
--- a/libc/misc/utmp/utent.c
+++ b/libc/misc/utmp/utent.c
@@ -1,3 +1,4 @@
+/* vi: set sw=4 ts=4: */
/* utent.c <ndf(a)linux.mit.edu> */
/* Let it be known that this is very possibly the worst standard ever. HP-UX
does one thing, someone else does another, linux another... If anyone
@@ -19,12 +20,9 @@
#include <errno.h>
#include <string.h>
#include <utmp.h>
-#ifdef __UCLIBC_HAS_UTMPX__
-# include <utmpx.h>
-#endif
#include <not-cancel.h>
-
#include <bits/uClibc_mutex.h>
+
__UCLIBC_MUTEX_STATIC(utmplock, PTHREAD_MUTEX_INITIALIZER);
/* Some global crap */
@@ -36,212 +34,174 @@ static const char *static_ut_name = default_file_name;
/* This function must be called with the LOCK held */
static void __setutent_unlocked(void)
{
- if (static_fd < 0) {
- static_fd = open_not_cancel_2(static_ut_name, O_RDWR | O_CLOEXEC);
if (static_fd < 0) {
- static_fd = open_not_cancel_2(static_ut_name, O_RDONLY | O_CLOEXEC);
- if (static_fd < 0) {
- return; /* static_fd remains < 0 */
- }
- }
+ static_fd = open_not_cancel_2(static_ut_name, O_RDWR | O_CLOEXEC);
+ if (static_fd < 0) {
+ static_fd = open_not_cancel_2(static_ut_name, O_RDONLY | O_CLOEXEC);
+ if (static_fd < 0) {
+ return; /* static_fd remains < 0 */
+ }
+ }
#ifndef __ASSUME_O_CLOEXEC
- /* Make sure the file will be closed on exec() */
- fcntl_not_cancel(static_fd, F_SETFD, FD_CLOEXEC);
+ /* Make sure the file will be closed on exec() */
+ fcntl_not_cancel(static_fd, F_SETFD, FD_CLOEXEC);
#endif
- return;
- }
- lseek(static_fd, 0, SEEK_SET);
+ return;
+ }
+ lseek(static_fd, 0, SEEK_SET);
}
#if defined __UCLIBC_HAS_THREADS__
-static void __setutent(void)
+void setutent(void)
{
- __UCLIBC_MUTEX_LOCK(utmplock);
- __setutent_unlocked();
- __UCLIBC_MUTEX_UNLOCK(utmplock);
+ __UCLIBC_MUTEX_LOCK(utmplock);
+ __setutent_unlocked();
+ __UCLIBC_MUTEX_UNLOCK(utmplock);
}
#else
-static void __setutent(void);
-strong_alias(__setutent_unlocked,__setutent)
-#endif
-strong_alias(__setutent,setutent)
-
-#ifdef __UCLIBC_HAS_UTMPX__
-strong_alias(__setutent,setutxent)
+strong_alias(__setutent_unlocked,setutent)
#endif
+libc_hidden_def(setutent)
/* This function must be called with the LOCK held */
static struct utmp *__getutent_unlocked(void)
{
- if (static_fd < 0) {
- __setutent();
if (static_fd < 0) {
- return NULL;
+ __setutent_unlocked();
+ if (static_fd < 0)
+ return NULL;
}
- }
- if (read_not_cancel(static_fd, &static_utmp, sizeof(static_utmp)) ==
sizeof(static_utmp)) {
- return &static_utmp;
- }
+ if (read_not_cancel(static_fd, &static_utmp,
+ sizeof(static_utmp)) == sizeof(static_utmp)) {
+ return &static_utmp;
+ }
- return NULL;
+ return NULL;
}
#if defined __UCLIBC_HAS_THREADS__
-static struct utmp *__getutent(void)
+struct utmp *getutent(void)
{
- struct utmp *ret;
+ struct utmp *ret;
- __UCLIBC_MUTEX_LOCK(utmplock);
- ret = __getutent_unlocked();
- __UCLIBC_MUTEX_UNLOCK(utmplock);
- return ret;
+ __UCLIBC_MUTEX_LOCK(utmplock);
+ ret = __getutent_unlocked();
+ __UCLIBC_MUTEX_UNLOCK(utmplock);
+ return ret;
}
#else
-static struct utmp *__getutent(void);
-strong_alias(__getutent_unlocked,__getutent)
-#endif
-strong_alias(__getutent,getutent)
-
-#ifdef __UCLIBC_HAS_UTMPX__
-struct utmpx *getutxent(void)
-{
- return (struct utmpx *) __getutent ();
-}
+strong_alias(__getutent_unlocked,getutent)
#endif
+libc_hidden_def(getutent)
static void __endutent(void)
{
- __UCLIBC_MUTEX_LOCK(utmplock);
- if (static_fd >= 0)
- close_not_cancel_no_status(static_fd);
- static_fd = -1;
- __UCLIBC_MUTEX_UNLOCK(utmplock);
+ __UCLIBC_MUTEX_LOCK(utmplock);
+ if (static_fd >= 0)
+ close_not_cancel_no_status(static_fd);
+ static_fd = -1;
+ __UCLIBC_MUTEX_UNLOCK(utmplock);
}
strong_alias(__endutent,endutent)
-
-#ifdef __UCLIBC_HAS_UTMPX__
-strong_alias(__endutent,endutxent)
-#endif
+libc_hidden_def(endutent)
/* This function must be called with the LOCK held */
static struct utmp *__getutid_unlocked(const struct utmp *utmp_entry)
{
- struct utmp *lutmp;
- unsigned type;
-
- /* We use the fact that constants we are interested in are: */
- /* RUN_LVL=1, ... OLD_TIME=4; INIT_PROCESS=5, ... USER_PROCESS=8 */
- type = utmp_entry->ut_type - 1;
- type /= 4;
-
- while ((lutmp = __getutent_unlocked()) != NULL) {
- if (type == 0 && lutmp->ut_type == utmp_entry->ut_type) {
- /* one of RUN_LVL, BOOT_TIME, NEW_TIME, OLD_TIME */
- return lutmp;
- }
- if (type == 1 && strncmp(lutmp->ut_id, utmp_entry->ut_id,
sizeof(lutmp->ut_id)) == 0) {
- /* INIT_PROCESS, LOGIN_PROCESS, USER_PROCESS, DEAD_PROCESS */
- return lutmp;
+ struct utmp *lutmp;
+ unsigned type;
+
+ /* We use the fact that constants we are interested in are: */
+ /* RUN_LVL=1, ... OLD_TIME=4; INIT_PROCESS=5, ... USER_PROCESS=8 */
+ type = utmp_entry->ut_type - 1;
+ type /= 4;
+
+ while ((lutmp = __getutent_unlocked()) != NULL) {
+ if (type == 0 && lutmp->ut_type == utmp_entry->ut_type) {
+ /* one of RUN_LVL, BOOT_TIME, NEW_TIME, OLD_TIME */
+ return lutmp;
+ }
+ if (type == 1
+ && strncmp(lutmp->ut_id, utmp_entry->ut_id,
+ sizeof(lutmp->ut_id)) == 0) {
+ /* INIT_PROCESS, LOGIN_PROCESS, USER_PROCESS, DEAD_PROCESS */
+ return lutmp;
+ }
}
- }
- return NULL;
+ return NULL;
}
#if defined __UCLIBC_HAS_THREADS__
-static struct utmp *__getutid(const struct utmp *utmp_entry)
+struct utmp *getutid(const struct utmp *utmp_entry)
{
- struct utmp *ret;
+ struct utmp *ret;
- __UCLIBC_MUTEX_LOCK(utmplock);
- ret = __getutid_unlocked(utmp_entry);
- __UCLIBC_MUTEX_UNLOCK(utmplock);
- return ret;
+ __UCLIBC_MUTEX_LOCK(utmplock);
+ ret = __getutid_unlocked(utmp_entry);
+ __UCLIBC_MUTEX_UNLOCK(utmplock);
+ return ret;
}
#else
-static struct utmp *__getutid(const struct utmp *utmp_entry);
-strong_alias(__getutid_unlocked,__getutid)
+strong_alias(__getutid_unlocked,getutid)
#endif
-strong_alias(__getutid,getutid)
+libc_hidden_def(getutid)
-#ifdef __UCLIBC_HAS_UTMPX__
-struct utmpx *getutxid(const struct utmpx *utmp_entry)
+struct utmp *getutline(const struct utmp *utmp_entry)
{
- return (struct utmpx *) __getutid ((const struct utmp *) utmp_entry);
-}
-#endif
-
-static struct utmp *__getutline(const struct utmp *utmp_entry)
-{
- struct utmp *lutmp;
-
- __UCLIBC_MUTEX_LOCK(utmplock);
- while ((lutmp = __getutent_unlocked()) != NULL) {
- if (lutmp->ut_type == USER_PROCESS || lutmp->ut_type == LOGIN_PROCESS) {
- if (strncmp(lutmp->ut_line, utmp_entry->ut_line, sizeof(lutmp->ut_line)) ==
0) {
- break;
- }
+ struct utmp *lutmp;
+
+ __UCLIBC_MUTEX_LOCK(utmplock);
+ while ((lutmp = __getutent_unlocked()) != NULL) {
+ if (lutmp->ut_type == USER_PROCESS || lutmp->ut_type == LOGIN_PROCESS) {
+ if (strncmp(lutmp->ut_line, utmp_entry->ut_line,
+ sizeof(lutmp->ut_line)) == 0) {
+ break;
+ }
+ }
}
- }
- __UCLIBC_MUTEX_UNLOCK(utmplock);
- return lutmp;
+ __UCLIBC_MUTEX_UNLOCK(utmplock);
+ return lutmp;
}
-strong_alias(__getutline,getutline)
-
-#ifdef __UCLIBC_HAS_UTMPX__
-struct utmpx *getutxline(const struct utmpx *utmp_entry)
-{
- return (struct utmpx *) __getutline ((const struct utmp *) utmp_entry);
-}
-#endif
+libc_hidden_def(getutline)
-static struct utmp *__pututline(const struct utmp *utmp_entry)
+struct utmp *pututline(const struct utmp *utmp_entry)
{
- __UCLIBC_MUTEX_LOCK(utmplock);
- /* Ignore the return value. That way, if they've already positioned
- the file pointer where they want it, everything will work out. */
- lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
-
- if (__getutid_unlocked(utmp_entry) != NULL)
+ __UCLIBC_MUTEX_LOCK(utmplock);
+ /* Ignore the return value. That way, if they've already positioned
+ the file pointer where they want it, everything will work out. */
lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
- else
- lseek(static_fd, (off_t) 0, SEEK_END);
- if (write(static_fd, utmp_entry, sizeof(struct utmp)) != sizeof(struct utmp))
- utmp_entry = NULL;
- __UCLIBC_MUTEX_UNLOCK(utmplock);
- return (struct utmp *)utmp_entry;
-}
-strong_alias(__pututline,pututline)
+ if (__getutid_unlocked(utmp_entry) != NULL)
+ lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
+ else
+ lseek(static_fd, (off_t) 0, SEEK_END);
+ if (write(static_fd, utmp_entry, sizeof(struct utmp))
+ != sizeof(struct utmp))
+ utmp_entry = NULL;
-#ifdef __UCLIBC_HAS_UTMPX__
-struct utmpx *pututxline (const struct utmpx *utmp_entry)
-{
- return (struct utmpx *) __pututline ((const struct utmp *) utmp_entry);
+ __UCLIBC_MUTEX_UNLOCK(utmplock);
+ return (struct utmp *)utmp_entry;
}
-#endif
+libc_hidden_def(pututline)
-static int __utmpname(const char *new_ut_name)
+int utmpname(const char *new_ut_name)
{
- __UCLIBC_MUTEX_LOCK(utmplock);
- if (new_ut_name != NULL) {
- if (static_ut_name != default_file_name)
- free((char *)static_ut_name);
- static_ut_name = strdup(new_ut_name);
- if (static_ut_name == NULL) {
- /* We should probably whine about out-of-memory
- * errors here... Instead just reset to the default */
- static_ut_name = default_file_name;
+ __UCLIBC_MUTEX_LOCK(utmplock);
+ if (new_ut_name != NULL) {
+ if (static_ut_name != default_file_name)
+ free((char *)static_ut_name);
+ static_ut_name = strdup(new_ut_name);
+ if (static_ut_name == NULL) {
+ /* We should probably whine about out-of-memory
+ * errors here... Instead just reset to the default */
+ static_ut_name = default_file_name;
+ }
}
- }
- if (static_fd >= 0) {
- close_not_cancel_no_status(static_fd);
- static_fd = -1;
- }
- __UCLIBC_MUTEX_UNLOCK(utmplock);
- return 0; /* or maybe return -(static_ut_name != new_ut_name)? */
+ if (static_fd >= 0) {
+ close_not_cancel_no_status(static_fd);
+ static_fd = -1;
+ }
+ __UCLIBC_MUTEX_UNLOCK(utmplock);
+ return 0; /* or maybe return -(static_ut_name != new_ut_name)? */
}
-strong_alias(__utmpname,utmpname)
-
-#ifdef __UCLIBC_HAS_UTMPX__
-strong_alias(__utmpname,utmpxname)
-#endif
+libc_hidden_def(utmpname)
diff --git a/libc/misc/utmp/utxent.c b/libc/misc/utmp/utxent.c
index 71157cc..c32e4da 100644
--- a/libc/misc/utmp/utxent.c
+++ b/libc/misc/utmp/utxent.c
@@ -1,3 +1,4 @@
+/* vi: set sw=4 ts=4: */
/*
* utexent.c : Support for accessing user accounting database.
* Copyright (C) 2010 STMicroelectronics Ltd.
@@ -13,7 +14,6 @@
#include <utmpx.h>
#include <utmp.h>
-#if 0 /* moved to utent.c */
void setutxent(void)
{
setutent ();
@@ -49,12 +49,10 @@ int utmpxname (const char *new_ut_name)
return utmpname (new_ut_name);
}
-/* moved to wtent.c */
void updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx)
{
updwtmp (wtmpx_file, (const struct utmp *) utmpx);
}
-#endif
/* Copy the information in UTMPX to UTMP. */
void getutmp (const struct utmpx *utmpx, struct utmp *utmp)
@@ -107,3 +105,4 @@ void getutmpx (const struct utmp *utmp, struct utmpx *utmpx)
utmpx->ut_time = utmp->ut_time;
#endif
}
+
diff --git a/libc/misc/utmp/wtent.c b/libc/misc/utmp/wtent.c
index 9b3ad50..30939ea 100644
--- a/libc/misc/utmp/wtent.c
+++ b/libc/misc/utmp/wtent.c
@@ -1,3 +1,4 @@
+/* vi: set sw=4 ts=4: */
/*
* Copyright (C) 2000-2006 Erik Andersen <andersen(a)uclibc.org>
*
@@ -11,9 +12,6 @@
#include <time.h>
#include <unistd.h>
#include <utmp.h>
-#ifdef __UCLIBC_HAS_UTMPX__
-# include <utmpx.h>
-#endif
#include <fcntl.h>
#include <sys/file.h>
#include <not-cancel.h>
@@ -36,7 +34,7 @@ void logwtmp (const char *line, const char *name, const char *host)
}
#endif
-static void __updwtmp(const char *wtmp_file, const struct utmp *lutmp)
+void updwtmp(const char *wtmp_file, const struct utmp *lutmp)
{
int fd;
@@ -49,11 +47,4 @@ static void __updwtmp(const char *wtmp_file, const struct utmp *lutmp)
}
}
}
-strong_alias(__updwtmp,updwtmp)
-
-#ifdef __UCLIBC_HAS_UTMPX__
-void updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx)
-{
- __updwtmp (wtmpx_file, (const struct utmp *) utmpx);
-}
-#endif
+libc_hidden_def(updwtmp)
diff --git a/libc/stdio/_fpmaxtostr.h b/libc/stdio/_fpmaxtostr.h
index b4e7321..7694629 100644
--- a/libc/stdio/_fpmaxtostr.h
+++ b/libc/stdio/_fpmaxtostr.h
@@ -11,39 +11,39 @@
#define _FPMAXTOSTR_H 1
#include <features.h>
-#ifdef __UCLIBC_HAS_FLOATS__
-
#define __need_size_t
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <printf.h>
#include <sys/types.h>
-#include <float.h>
-#include <bits/uClibc_fpmax.h>
+
+#ifdef __UCLIBC_HAS_FLOATS__
+# include <float.h>
+# include <bits/uClibc_fpmax.h>
/* WARNING: Adjust _fp_out_wide() in _vfprintf.c if this changes! */
/* With 32 bit ints, we can get 9 decimal digits per block. */
-#define DIGITS_PER_BLOCK 9
+# define DIGITS_PER_BLOCK 9
-#define NUM_DIGIT_BLOCKS ((DECIMAL_DIG+DIGITS_PER_BLOCK-1)/DIGITS_PER_BLOCK)
+# define NUM_DIGIT_BLOCKS ((DECIMAL_DIG+DIGITS_PER_BLOCK-1)/DIGITS_PER_BLOCK)
/* WARNING: Adjust _fp_out_wide() in _vfprintf.c if this changes! */
/* extra space for '-', '.', 'e+###', and nul */
-#define BUF_SIZE ( 3 + NUM_DIGIT_BLOCKS * DIGITS_PER_BLOCK )
+# define BUF_SIZE ( 3 + NUM_DIGIT_BLOCKS * DIGITS_PER_BLOCK )
/* psm: why do these internals differ? */
-#ifdef __USE_OLD_VFPRINTF__
+# ifdef __USE_OLD_VFPRINTF__
typedef void (__fp_outfunc_t)(FILE *fp, intptr_t type, intptr_t len, intptr_t buf);
extern size_t _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info *info,
__fp_outfunc_t fp_outfunc) attribute_hidden;
-#else
+# else
typedef size_t (__fp_outfunc_t)(FILE *fp, intptr_t type, intptr_t len, intptr_t buf);
extern ssize_t _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info *info,
__fp_outfunc_t fp_outfunc) attribute_hidden;
-#endif
+# endif
-#endif /* __UCLIBC_HAS_FLOATS__ */
+# endif /* __UCLIBC_HAS_FLOATS__ */
#endif /* _FPMAXTOSTR_H */
diff --git a/libc/stdio/_vfprintf.c b/libc/stdio/_vfprintf.c
index 01ee218..a795f49 100644
--- a/libc/stdio/_vfprintf.c
+++ b/libc/stdio/_vfprintf.c
@@ -121,18 +121,6 @@
#error Apparently, LONG_LONG_MAX is defined but LLONG_MAX is not. You need to fix your
toolchain headers to support the standard macros for (unsigned) long long.
#endif
-/**********************************************************************/
-/* These provide some control over printf's feature set */
-
-/* Now controlled by uClibc_config.h. */
-/* #define __UCLIBC_HAS_FLOATS__ 1 */
-
-/* Now controlled by uClibc_config.h. */
-/* #define __UCLIBC_HAS_PRINTF_M_SPEC__ */
-
-
-/**********************************************************************/
-
#include "_fpmaxtostr.h"
#undef __STDIO_HAS_VSNPRINTF
@@ -142,9 +130,6 @@
/**********************************************************************/
-/* Now controlled by uClibc_config.h. */
-/* #define __UCLIBC_HAS_GLIBC_CUSTOM_PRINTF__ */
-
#ifdef __UCLIBC_MJN3_ONLY__
# ifdef L_register_printf_function
/* emit only once */
diff --git a/libc/stdlib/Makefile.in b/libc/stdlib/Makefile.in
index 880de78..071f911 100644
--- a/libc/stdlib/Makefile.in
+++ b/libc/stdlib/Makefile.in
@@ -61,7 +61,6 @@ CSRC-$(if $(findstring
yyy,$(UCLIBC_HAS_FLOATS)$(UCLIBC_HAS_WCHAR)$(UCLIBC_HAS_X
# multi source _atexit.c
CSRC-y += __cxa_atexit.c __cxa_finalize.c __exit_handler.c exit.c on_exit.c
-CSRC-$(COMPAT_ATEXIT) += old_atexit.c
STDLIB_DIR := $(top_srcdir)libc/stdlib
STDLIB_OUT := $(top_builddir)libc/stdlib
@@ -71,11 +70,12 @@ STDLIB_OBJ := $(patsubst %.c,$(STDLIB_OUT)/%.o,$(CSRC-y))
libc-y += $(STDLIB_OBJ)
libc-static-y += $(STDLIB_OUT)/atexit.o $(STDLIB_OUT)/system.o
+libc-static-$(COMPAT_ATEXIT) += $(STDLIB_OUT)/old_atexit.o
libc-shared-y += $(STDLIB_OUT)/system.oS
# this should always be the PIC version, because it could be used in shared libs
libc-nonshared-y += $(STDLIB_OUT)/atexit.os
-
+libc-nonshared-$(COMPAT_ATEXIT) += $(STDLIB_OUT)/old_atexit.os
libc-nomulti-y += $(STDLIB_OUT)/labs.o $(STDLIB_OUT)/atol.o
$(STDLIB_OUT)/_stdlib_strto_l.o $(STDLIB_OUT)/_stdlib_strto_ll.o
libc-nomulti-$(UCLIBC_HAS_XLOCALE) += $(STDLIB_OUT)/_stdlib_strto_l_l.o
$(STDLIB_OUT)/_stdlib_strto_ll_l.o
diff --git a/libc/sysdeps/linux/arm/Makefile.arch b/libc/sysdeps/linux/arm/Makefile.arch
index 3054273..cda3db2 100644
--- a/libc/sysdeps/linux/arm/Makefile.arch
+++ b/libc/sysdeps/linux/arm/Makefile.arch
@@ -13,7 +13,9 @@ SSRC-y := \
vfork.S clone.S
SSRC-$(UCLIBC_HAS_LFS) += mmap64.S
-SSRC-$(UCLIBC_HAS_THREADS_NATIVE) += libc-aeabi_read_tp.S libc-thumb_atomics.S
+SSRC-$(UCLIBC_HAS_THREADS_NATIVE) += libc-thumb_atomics.S
+libc-nonshared-$(UCLIBC_HAS_THREADS_NATIVE) += $(ARCH_OUT)/libc-aeabi_read_tp.os
+libc-static-$(UCLIBC_HAS_THREADS_NATIVE) += $(ARCH_OUT)/libc-aeabi_read_tp.o
CSRC-$(UCLIBC_HAS_CONTEXT_FUNCS) += makecontext.c
SSRC-$(UCLIBC_HAS_CONTEXT_FUNCS) += getcontext.S setcontext.S swapcontext.S
diff --git a/libc/sysdeps/linux/common/Makefile.in
b/libc/sysdeps/linux/common/Makefile.in
index 8ee956b..8252598 100644
--- a/libc/sysdeps/linux/common/Makefile.in
+++ b/libc/sysdeps/linux/common/Makefile.in
@@ -27,6 +27,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
eventfd.c \
eventfd_read.c \
eventfd_write.c \
+ getrandom.c \
inotify.c \
ioperm.c \
iopl.c \
diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h
b/libc/sysdeps/linux/common/bits/kernel-features.h
index 6184c2b..708bb49 100644
--- a/libc/sysdeps/linux/common/bits/kernel-features.h
+++ b/libc/sysdeps/linux/common/bits/kernel-features.h
@@ -507,3 +507,8 @@
#if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100
# define __ASSUME_GETCPU_SYSCALL 1
#endif
+
+/* getrandom syscall (widely) appeared around 4.0.0 */
+#if __LINUX_KERNEL_VERSION >= 0x040000
+# define __ASSUME_GETRANDOM_SYSCALL 1
+#endif
diff --git a/libc/sysdeps/linux/common/bits/utmp.h
b/libc/sysdeps/linux/common/bits/utmp.h
index c13380a..6ece31e 100644
--- a/libc/sysdeps/linux/common/bits/utmp.h
+++ b/libc/sysdeps/linux/common/bits/utmp.h
@@ -36,7 +36,7 @@
previous logins. */
struct lastlog
{
-#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+#ifdef __WORDSIZE_TIME64_COMPAT32
int32_t ll_time;
#else
__time_t ll_time;
@@ -69,7 +69,7 @@ struct utmp
/* The ut_session and ut_tv fields must be the same size when compiled
32- and 64-bit. This allows data files and shared memory to be
shared between 32- and 64-bit applications. */
-#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+#ifdef __WORDSIZE_TIME64_COMPAT32
int32_t ut_session; /* Session ID, used for windowing. */
struct
{
diff --git a/libc/sysdeps/linux/common/bits/utmpx.h
b/libc/sysdeps/linux/common/bits/utmpx.h
index 87626f0..815fc90 100644
--- a/libc/sysdeps/linux/common/bits/utmpx.h
+++ b/libc/sysdeps/linux/common/bits/utmpx.h
@@ -66,7 +66,7 @@ struct utmpx
/* The fields ut_session and ut_tv must be the same size when compiled
32- and 64-bit. This allows files and shared memory to be shared
between 32- and 64-bit applications. */
-#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+#ifdef __WORDSIZE_TIME64_COMPAT32
__int32_t ut_session; /* Session ID, used for windowing. */
struct
{
diff --git a/libc/sysdeps/linux/common/getrandom.c
b/libc/sysdeps/linux/common/getrandom.c
new file mode 100644
index 0000000..d33d522
--- /dev/null
+++ b/libc/sysdeps/linux/common/getrandom.c
@@ -0,0 +1,14 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * getrandom() for uClibc
+ *
+ * Copyright (C) 2015 Bernhard Reutner-Fischer
+ *
+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/random.h>
+#ifdef __NR_getrandom
+_syscall3(int, getrandom, void *, buf, size_t, buflen, unsigned int, flags)
+#endif
diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c
index 2c50307..19a3371 100644
--- a/libc/sysdeps/linux/common/stubs.c
+++ b/libc/sysdeps/linux/common/stubs.c
@@ -157,6 +157,10 @@ make_stub(getpeername)
make_stub(getpgrp)
#endif
+#if !defined __NR_getrandom && defined __UCLIBC_LINUX_SPECIFIC__
+make_stub(getrandom)
+#endif
+
#if !defined __NR_getsockname && !defined __NR_socketcall && defined
__UCLIBC_HAS_SOCKET__
make_stub(getsockname)
#endif
diff --git a/libc/sysdeps/linux/common/sys/random.h
b/libc/sysdeps/linux/common/sys/random.h
new file mode 100644
index 0000000..42f8025
--- /dev/null
+++ b/libc/sysdeps/linux/common/sys/random.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 2015 Bernhard Reutner-Fischer
+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
+*/
+
+#ifndef _SYS_RANDOM_H
+#define _SYS_RANDOM_H 1
+#include <features.h>
+
+__BEGIN_DECLS
+
+#if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU
+# if 0 /*def __ASSUME_GETRANDOM_SYSCALL */
+# include <linux/random.h>
+# else
+# undef GRND_NONBLOCK
+# undef GRND_RANDOM
+/*
+ * Flags for getrandom(2)
+ *
+ * GRND_NONBLOCK Don't block and return EAGAIN instead
+ * GRND_RANDOM Use the /dev/random pool instead of /dev/urandom
+ */
+# define GRND_NONBLOCK 0x0001
+# define GRND_RANDOM 0x0002
+# endif
+/* FIXME: aren't there a couple of __restrict and const missing ? */
+extern int getrandom(void *__buf, size_t count, unsigned int flags)
+ __nonnull ((1)) __wur;
+#endif
+
+__END_DECLS
+
+#endif /* sys/random.h */
diff --git a/libc/sysdeps/linux/mips/bits/mathdef.h
b/libc/sysdeps/linux/mips/bits/mathdef.h
index 1c636a1..6afe20d 100644
--- a/libc/sysdeps/linux/mips/bits/mathdef.h
+++ b/libc/sysdeps/linux/mips/bits/mathdef.h
@@ -25,10 +25,9 @@
#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
# define _MATH_H_MATHDEF 1
-/* Normally, there is no long double type and the `float' and `double'
- expressions are evaluated as `double'. */
-typedef double float_t; /* `float' expressions are evaluated as
- `double'. */
+/* MIPS has both `float' and `double' arithmetic. */
+typedef float float_t; /* `float' expressions are evaluated as
+ `float'. */
typedef double double_t; /* `double' expressions are evaluated as
`double'. */
diff --git a/libc/sysdeps/linux/mips/bits/wordsize.h
b/libc/sysdeps/linux/mips/bits/wordsize.h
index 39e1506..fe13080 100644
--- a/libc/sysdeps/linux/mips/bits/wordsize.h
+++ b/libc/sysdeps/linux/mips/bits/wordsize.h
@@ -16,3 +16,6 @@
<http://www.gnu.org/licenses/>. */
#define __WORDSIZE _MIPS_SZPTR
+#if _MIPS_SIM == _ABI64
+# define __WORDSIZE_TIME64_COMPAT32 1
+#endif
diff --git a/libc/sysdeps/linux/powerpc/bits/wordsize.h
b/libc/sysdeps/linux/powerpc/bits/wordsize.h
index cf93423..3e8a1e0 100644
--- a/libc/sysdeps/linux/powerpc/bits/wordsize.h
+++ b/libc/sysdeps/linux/powerpc/bits/wordsize.h
@@ -2,7 +2,7 @@
#if defined __powerpc64__
# define __WORDSIZE 64
-# define __WORDSIZE_COMPAT32 1
+# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
#endif
diff --git a/libc/sysdeps/linux/sparc/bits/wordsize.h
b/libc/sysdeps/linux/sparc/bits/wordsize.h
index c0e600e..aa15dbc 100644
--- a/libc/sysdeps/linux/sparc/bits/wordsize.h
+++ b/libc/sysdeps/linux/sparc/bits/wordsize.h
@@ -2,6 +2,7 @@
#if defined __arch64__ || defined __sparcv9
# define __WORDSIZE 64
+# define __WORDSIZE_TIME64_COMPAT32 1
#else
# define __WORDSIZE 32
#endif
diff --git a/libc/sysdeps/linux/x86_64/bits/wordsize.h
b/libc/sysdeps/linux/x86_64/bits/wordsize.h
index e555241..9db982c 100644
--- a/libc/sysdeps/linux/x86_64/bits/wordsize.h
+++ b/libc/sysdeps/linux/x86_64/bits/wordsize.h
@@ -1,9 +1,12 @@
/* Determine the wordsize from the preprocessor defines. */
-#if defined __x86_64__
+#if defined __x86_64__ && !defined __ILP32__
# define __WORDSIZE 64
-/* This makes /var/run/utmp compatible with 32-bit environment: */
-# define __WORDSIZE_COMPAT32 1
#else
# define __WORDSIZE 32
#endif
+
+#ifdef __x86_64__
+/* This makes /var/run/utmp compatible with 32-bit environment: */
+# define __WORDSIZE_TIME64_COMPAT32 1
+#endif
diff --git a/libcrypt/sha256.c b/libcrypt/sha256.c
index 6bc2d8b..3e12b5c 100644
--- a/libcrypt/sha256.c
+++ b/libcrypt/sha256.c
@@ -108,12 +108,12 @@ sha256_process_block (const void *buffer, size_t len, struct
sha256_ctx *ctx)
uint32_t h_save = h;
/* Operators defined in FIPS 180-2:4.1.2. */
-#define Ch(x, y, z) ((x & y) ^ (~x & z))
-#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
-#define S0(x) (CYCLIC (x, 2) ^ CYCLIC (x, 13) ^ CYCLIC (x, 22))
-#define S1(x) (CYCLIC (x, 6) ^ CYCLIC (x, 11) ^ CYCLIC (x, 25))
-#define R0(x) (CYCLIC (x, 7) ^ CYCLIC (x, 18) ^ (x >> 3))
-#define R1(x) (CYCLIC (x, 17) ^ CYCLIC (x, 19) ^ (x >> 10))
+#define _Ch(x, y, z) ((x & y) ^ (~x & z))
+#define _Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
+#define _S0(x) (CYCLIC (x, 2) ^ CYCLIC (x, 13) ^ CYCLIC (x, 22))
+#define _S1(x) (CYCLIC (x, 6) ^ CYCLIC (x, 11) ^ CYCLIC (x, 25))
+#define _R0(x) (CYCLIC (x, 7) ^ CYCLIC (x, 18) ^ (x >> 3))
+#define _R1(x) (CYCLIC (x, 17) ^ CYCLIC (x, 19) ^ (x >> 10))
/* It is unfortunate that C does not provide an operator for
cyclic rotation. Hope the C compiler is smart enough. */
@@ -126,13 +126,13 @@ sha256_process_block (const void *buffer, size_t len, struct
sha256_ctx *ctx)
++words;
}
for (unsigned int t = 16; t < 64; ++t)
- W[t] = R1 (W[t - 2]) + W[t - 7] + R0 (W[t - 15]) + W[t - 16];
+ W[t] = _R1 (W[t - 2]) + W[t - 7] + _R0 (W[t - 15]) + W[t - 16];
/* The actual computation according to FIPS 180-2:6.2.2 step 3. */
for (unsigned int t = 0; t < 64; ++t)
{
- uint32_t T1 = h + S1 (e) + Ch (e, f, g) + K[t] + W[t];
- uint32_t T2 = S0 (a) + Maj (a, b, c);
+ uint32_t T1 = h + _S1 (e) + _Ch (e, f, g) + K[t] + W[t];
+ uint32_t T2 = _S0 (a) + _Maj (a, b, c);
h = g;
g = f;
f = e;
diff --git a/libcrypt/sha512.c b/libcrypt/sha512.c
index 079caee..b2e36a3 100644
--- a/libcrypt/sha512.c
+++ b/libcrypt/sha512.c
@@ -139,12 +139,12 @@ sha512_process_block (const void *buffer, size_t len, struct
sha512_ctx *ctx)
uint64_t h_save = h;
/* Operators defined in FIPS 180-2:4.1.2. */
-#define Ch(x, y, z) ((x & y) ^ (~x & z))
-#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
-#define S0(x) (CYCLIC (x, 28) ^ CYCLIC (x, 34) ^ CYCLIC (x, 39))
-#define S1(x) (CYCLIC (x, 14) ^ CYCLIC (x, 18) ^ CYCLIC (x, 41))
-#define R0(x) (CYCLIC (x, 1) ^ CYCLIC (x, 8) ^ (x >> 7))
-#define R1(x) (CYCLIC (x, 19) ^ CYCLIC (x, 61) ^ (x >> 6))
+#define _Ch(x, y, z) ((x & y) ^ (~x & z))
+#define _Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
+#define _S0(x) (CYCLIC (x, 28) ^ CYCLIC (x, 34) ^ CYCLIC (x, 39))
+#define _S1(x) (CYCLIC (x, 14) ^ CYCLIC (x, 18) ^ CYCLIC (x, 41))
+#define _R0(x) (CYCLIC (x, 1) ^ CYCLIC (x, 8) ^ (x >> 7))
+#define _R1(x) (CYCLIC (x, 19) ^ CYCLIC (x, 61) ^ (x >> 6))
/* It is unfortunate that C does not provide an operator for
cyclic rotation. Hope the C compiler is smart enough. */
@@ -157,13 +157,13 @@ sha512_process_block (const void *buffer, size_t len, struct
sha512_ctx *ctx)
++words;
}
for (unsigned int t = 16; t < 80; ++t)
- W[t] = R1 (W[t - 2]) + W[t - 7] + R0 (W[t - 15]) + W[t - 16];
+ W[t] = _R1 (W[t - 2]) + W[t - 7] + _R0 (W[t - 15]) + W[t - 16];
/* The actual computation according to FIPS 180-2:6.3.2 step 3. */
for (unsigned int t = 0; t < 80; ++t)
{
- uint64_t T1 = h + S1 (e) + Ch (e, f, g) + K[t] + W[t];
- uint64_t T2 = S0 (a) + Maj (a, b, c);
+ uint64_t T1 = h + _S1 (e) + _Ch (e, f, g) + K[t] + W[t];
+ uint64_t T2 = _S0 (a) + _Maj (a, b, c);
h = g;
g = f;
f = e;
diff --git a/libm/ldouble_wrappers.c b/libm/ldouble_wrappers.c
index b4215cb..840293f 100644
--- a/libm/ldouble_wrappers.c
+++ b/libm/ldouble_wrappers.c
@@ -16,27 +16,28 @@
#include "math.h"
#include <complex.h>
-#define WRAPPER1(func) \
+#if !defined __NO_LONG_DOUBLE_MATH
+# define WRAPPER1(func) \
long double func##l(long double x) \
{ \
return (long double) func((double) x); \
}
-#define WRAPPER2(func) \
+# define WRAPPER2(func) \
long double func##l(long double x, long double y) \
{ \
return (long double) func((double) x, (double) y); \
}
-#define int_WRAPPER1(func) \
+# define int_WRAPPER1(func) \
int func##l(long double x) \
{ \
return func((double) x); \
}
-#define long_WRAPPER1(func) \
+# define long_WRAPPER1(func) \
long func##l(long double x) \
{ \
return func((double) x); \
}
-#define long_long_WRAPPER1(func) \
+# define long_long_WRAPPER1(func) \
long long func##l(long double x) \
{ \
return func((double) x); \
@@ -447,4 +448,6 @@ int_WRAPPER1(__isinf)
libm_hidden_def(__isinfl)
# endif
-#endif
+#endif /* __DO_C99_MATH__ */
+
+#endif /* __NO_LONG_DOUBLE_MATH */
diff --git a/libpthread/nptl/pthread_atfork.c b/libpthread/nptl/pthread_atfork.c
index 3c12cd4..39ac3e2 100644
--- a/libpthread/nptl/pthread_atfork.c
+++ b/libpthread/nptl/pthread_atfork.c
@@ -37,13 +37,17 @@
#include <fork.h>
/* This is defined by newer gcc version unique for each module. */
-extern void *__dso_handle __attribute__ ((__weak__));
- //,__visibility__ ("hidden")));
+extern void *__dso_handle __attribute__ ((__weak__,
+ __visibility__ ("hidden")));
/* Hide the symbol so that no definition but the one locally in the
executable or DSO is used. */
int
+#ifndef __pthread_atfork
+/* Don't mark the compatibility function as hidden. */
+attribute_hidden
+#endif
__pthread_atfork (
void (*prepare) (void),
void (*parent) (void),
@@ -52,4 +56,8 @@ __pthread_atfork (
return __register_atfork (prepare, parent, child,
&__dso_handle == NULL ? NULL : __dso_handle);
}
+#ifndef __pthread_atfork
+extern int pthread_atfork (void (*prepare) (void), void (*parent) (void),
+ void (*child) (void)) attribute_hidden;
strong_alias (__pthread_atfork, pthread_atfork)
+#endif
diff --git a/librt/Makefile.in b/librt/Makefile.in
index 8555e94..fbbf5b4 100644
--- a/librt/Makefile.in
+++ b/librt/Makefile.in
@@ -15,6 +15,9 @@ LIBS-librt.so := $(LIBS)
ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
LIBS-librt.so += $(top_builddir)lib/libdl.so $(top_builddir)lib/libpthread.so
endif
+START_FILE-librt.so := $(SHARED_START_FILES)
+END_FILE-librt.so := $(SHARED_END_FILES)
+
librt_FULL_NAME := librt-$(VERSION).so
diff --git a/libutil/Makefile.in b/libutil/Makefile.in
index f904fc7..98b178e 100644
--- a/libutil/Makefile.in
+++ b/libutil/Makefile.in
@@ -27,6 +27,14 @@ ifneq ($(UCLIBC_HAS_PTY),y)
libutil_SRC := $(filter-out $(libutil_DIR)/openpty.c $(libutil_DIR)/forkpty.c \
,$(libutil_SRC))
endif
+ifeq ($(UCLIBC_HAS_UTMP)$(UCLIBC_HAS_UTMPX),)
+libutil_SRC := $(filter-out \
+ $(libutil_DIR)/logwtmp.c \
+ $(libutil_DIR)/login.c \
+ $(libutil_DIR)/logout.c \
+ ,$(libutil_SRC))
+endif
+
libutil_OBJ := $(patsubst $(libutil_DIR)/%.c,$(libutil_OUT)/%.o,$(libutil_SRC))
ifeq ($(DOPIC),y)
diff --git a/libutil/logout.c b/libutil/logout.c
index 9c7440b..4580455 100644
--- a/libutil/logout.c
+++ b/libutil/logout.c
@@ -50,7 +50,7 @@ logout (const char *line)
memset (ut->ut_host, 0, sizeof ut->ut_host);
#endif
#if _HAVE_UT_TV - 0
-# if !defined __WORDSIZE_COMPAT32 || __WORDSIZE_COMPAT32 == 0
+# if !defined __WORDSIZE_TIME64_COMPAT32
gettimeofday (&ut->ut_tv, NULL);
# else
{
diff --git a/libutil/logwtmp.c b/libutil/logwtmp.c
index 2a6f28a..6a53b5f 100644
--- a/libutil/logwtmp.c
+++ b/libutil/logwtmp.c
@@ -23,7 +23,7 @@ void logwtmp(const char *line, const char *name, const char *host)
strncpy(lutmp.ut_line, line, sizeof(lutmp.ut_line)-1);
strncpy(lutmp.ut_name, name, sizeof(lutmp.ut_name)-1);
strncpy(lutmp.ut_host, host, sizeof(lutmp.ut_host)-1);
-#if !defined __WORDSIZE_COMPAT32 || __WORDSIZE_COMPAT32 == 0
+#if !defined __WORDSIZE_TIME64_COMPAT32
gettimeofday(&lutmp.ut_tv, NULL);
#else
{
diff --git a/test/.gitignore b/test/.gitignore
index 5944f0a..beb5095 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -163,6 +163,7 @@ misc/tst-seekdir
misc/tst-statfs
misc/tst-statvfs
misc/tst-utmp
+misc/tst-utmpx
mmap/mmap
mmap/mmap2
mmap/mmap64
diff --git a/test/math/libm-test.inc b/test/math/libm-test.inc
index 8f0db3c..f50b48b 100644
--- a/test/math/libm-test.inc
+++ b/test/math/libm-test.inc
@@ -3418,8 +3418,6 @@ log1p_test (void)
END (log1p);
}
-
-#if 0
static void
log2_test (void)
{
@@ -3449,8 +3447,6 @@ log2_test (void)
END (log2);
}
-#endif
-
static void
logb_test (void)
@@ -4968,9 +4964,7 @@ main (int argc, char **argv)
log_test ();
log10_test ();
log1p_test ();
-#if 0
log2_test ();
-#endif
logb_test ();
modf_test ();
ilogb_test ();
diff --git a/test/misc/Makefile.in b/test/misc/Makefile.in
index 1e0da6f..2fb9652 100644
--- a/test/misc/Makefile.in
+++ b/test/misc/Makefile.in
@@ -16,6 +16,10 @@ ifeq ($(UCLIBC_HAS_GLOB),)
TESTS_DISABLED += bug-glob2
endif
+ifeq ($(UCLIBC_HAS_UTMPX),)
+TESTS_DISABLED += tst-utmpx
+endif
+
DODIFF_dirent := 1
DODIFF_dirent64 := 1
DODIFF_tst-statfs := 1
diff --git a/test/misc/tst-utmp.c b/test/misc/tst-utmp.c
index 08a6f8e..1b0333a 100644
--- a/test/misc/tst-utmp.c
+++ b/test/misc/tst-utmp.c
@@ -37,6 +37,21 @@
# include <utmp.h>
#endif
+#ifndef _HAVE_UT_TYPE
+# define _HAVE_UT_TYPE 0
+#endif
+#ifndef _HAVE_UT_PID
+# define _HAVE_UT_PID 0
+#endif
+#ifndef _HAVE_UT_ID
+# define _HAVE_UT_ID 0
+#endif
+#ifndef _HAVE_UT_TV
+# define _HAVE_UT_TV 0
+#endif
+#ifndef _HAVE_UT_HOST
+# define _HAVE_UT_HOST 0
+#endif
#if _HAVE_UT_TYPE || defined UTMPX
diff --git a/test/misc/tst-utmpx.c b/test/misc/tst-utmpx.c
new file mode 100644
index 0000000..edb5551
--- /dev/null
+++ b/test/misc/tst-utmpx.c
@@ -0,0 +1,2 @@
+#define UTMPX
+#include "tst-utmp.c"
hooks/post-receive
--
uClibc-ng - small C library for embedded systems