Age | Commit message (Collapse) | Author |
|
Commit e3c3bf2b58 introduce use of pselect6, but has following disadvantages:
* Use of userspace types in args67 structure - it breaks, for example,
configs when 32-bit uClibc-ng compiled against 64-bit kernel. Syscall
will always return EINVAL. We must use __kernel_* types and
__SYSCALL_SIGSET_T_SIZE.
* It have excess checks for NSEC_PER_SEC. Original code from select()
implementation has struct timeval => struct timespec conversion,
kernel select() syscall implementation do the same.
But none of libc versions (glibc, eglibc, musl) I know, perform similar
checks for pselect() - there is no structure fields conversions,
just struct timespec through all the calls.
To have such checks in uClibc-ng we need one example, at least.
* It is possible to avoid extra userspace reads from kernel code if
sigmask == NULL. I suggest to do it, for a few bytes cost.
* Commit didn't add test case to testsuite.
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
|
|
|
|
vfork internally unwinds stack up one frame, saving the original return
address in the a3 of the unwound frame. To do this in windowed ABI it
needs to exchange two topmost bits of the original return address and of
the helper entry point. Current code doesn't do it correctly for
addresses above 0x40000000, resulting in illegal instruction exception
for configurations that put code high, e.g. for noMMU.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
|
|
|
|
The R6 version of MIPS does not support the bltzal instruction. This
patch changes dl-startup.h and dl-sysdep.h to use lapc on R6 instead.
lapc is a new R6 insruction so older systems need to continue to use
bltzal in order to load register $31.
Signed-off-by: Steve Ellcey <sellcey@imgtec.com>
|
|
These MIPS specific versions of memcpy.S and memset.S are faster than
the current ones and match what is in newlib and glibc. They also have
support for the mips32r6 and mips64r6 architectures.
Signed-off-by: Steve Ellcey <sellcey@imgtec.com>
|
|
Linux has a pselect syscall since 2.6.something. Using it
rather than emulating it with sigprocmask+select+sigprocmask
is smaller code, and works properly. (The emulation has
race conditions when unblocked signals arrive before or
after the select)
The tv.nsec >= 1E9 handling comes from uclibc's linux select()
implementation, which itself uses pselect() internally if the
pselect syscall exists. I though it would be good to do the
same here.
Note that although the libc pselect() API has 6 arguments,
the linux kernel syscall as 7 arguments. There is an extra,
somewhat vestigial, sizeof the signal mask argument.
Signed-off-by: Nicolas S. Dade <nic.dade@gmail.com>
|
|
Avoid a lot of copy'n'paste code, no functionality change
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
|
|
Patch from OpenWrt.
Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
|
|
Use the arch specific thread stack size for nptl if the size
returned by getrlimits exceeds it - fixes threads on systems
with only 16 MB RAM.
Patch from OpenWRT
Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
|
|
Fixes compilation of some faulty applictions.
Patch from Freetz.org
Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
|
|
lookups
The latter half of gethostbyname2_r (doing AAAA queries) is rather dramatically different
from the corresponding portion of gethostbyname_r (doing A queries). This leads to problems
like calls to getaddrinfo only returning one IPv6 address, even when multiple exist.
Seems to be entirely a case of divergent evolution -- a half-decade of fixes for the IPv4
code but no love for IPv6. Until now. ;)
DNS behaviour for IPv6 is really no different than for IPv4 -- beyond the difference in
address sizes, there's no need for the functions to be so different.
Consequently, this patch really is almost just a cut-and-paste of gethostbyname_r, with
the appropriate substitutions of in6_addr, AF_INET6, etc; while holding on to the few
extra bits that actually belong in there (eg #ifdef __UCLIBC_HAS_IPV6__).
Signed-off-by: Wes Campaigne <westacular@gmail.com>
|
|
Commit 2dab3f5a "resolv: tiny shrinkage in /etc/hosts handling" leads to
that read_etc_hosts_r() provide garbage pointer at the end of h_aliases
list if more than four hostnames follow a dotted quad in /etc/hosts
Test-case:
Add following line to /etc/hosts
63.63.0.2 host1 alias2 alias3 alias4 alias5
#include <stdio.h>
#include <errno.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
int main (void)
{
int i;
char *a;
struct hostent *he;
struct in_addr ipv4addr;
inet_pton(AF_INET, "63.63.0.2", &ipv4addr);
he = gethostbyaddr(&ipv4addr, sizeof ipv4addr, AF_INET);
if (he == NULL)
exit(1);
printf("Host name: '%s'\n", he->h_name);
i = 0;
while ((a = he->h_aliases[i]) != NULL) {
printf("Host alias: '%s'\n", a);
++i;
}
return 0;
}
Wrong output:
Host name: 'host1'
Host alias: 'alias2'
Host alias: 'alias3'
Host alias: 'alias4'
Host alias: 'alias5'
Host alias: '??'
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
This reverts commit 4a05ed87ceb946608100642121c32e642b58cd0d.
This breaks SSP detection for gcc, which might be problematic
for some projects. Revert it after some discussion with
buildroot and openembedded people.
|
|
Idea from different projects as OpenWrt and others.
https://lists.openwrt.org/pipermail/openwrt-devel/2013-November/022299.html
https://github.com/wl500g/toolchain/blob/master/toolchain/uClibc/patches/0.9.32/980-stack-cache-maxsize.patch
|
|
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
|
Uclibc's canonicalize_file_name() is allocating temprary buffer of 4kB
(PATH_MAX), and passing it to realpath() as second argument. Function is
not checking if realpath() fails and memory is lost.
|
|
improved solution from http://freetz.org/ticket/842
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
glibc commits
4822a2a520 Add x32 support to TLS_LE/TLS_IE/TLS_GD
63fb881a04 tls-macros-mips.h: Load $gp as required.
Merge 32-bit and 64-bit versions.
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Patch is from Timo Teras
Refs.:
http://lists.uclibc.org/pipermail/uclibc/2012-October/047059.html
http://git.alpinelinux.org/cgit/aports/tree/main/libc0.9.32/uclibc-dlclose-fix.patch
|
|
Commit 4139fe5aec935ba3f462dcaf6aafb6e5eadf1ab9 fixes SIGSTOPed syslogd issue.
but introduced new one - messages will be lost when socket buffer gets full,
not only if syslogd is stalled, but even if it accepts message slower than
someone sends and possibly leads to security hole, when important messages get
lost as result of attacker flooding.
Patch adds 1 second waiting for socket buffer can accept the message, helps
when syslogd is working hard. If it's stalled/SIGSTOPed, message will be sent
to errout as before. After that, further non-blocking /dev/log connect attempts
will fail immediately with EAGAIN error until syslogd reads some from it.
function old new delta
openlog_intern 259 355 +96
static.tv - 8 +8
.rodata 151 159 +8
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 112/0) Total: 112 bytes
Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
|
|
If syslogd is stopped and restarted while a process has the log open, the next
message that process produces will be logged to the console and not to the new
instance of syslogd. Further messages will be routed correctly, but not the
first one.
Based on original patch
Bug 3889 - syslog loses messages when syslogd restarted
https://bugs.busybox.net/show_bug.cgi?id=3889
function old new delta
openlog 33 68 +35
__vsyslog 851 848 -3
openlog_intern 318 259 -59
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 35/-62) Total: -27 bytes
Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
|
|
Some programs trying to use NI_IDN flag in case of it defined in netdb.h,
so hide it to suppress bad values for ai_flags.
Inspired by OpenWRT issue #12323
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
set error events
https://bugs.busybox.net/show_bug.cgi?id=3211
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Free 1k of static data (.bss)
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
http://bugs.busybox.net/show_bug.cgi?id=5588
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
|
|
|
|
Save 20 bytes per FILE structure, avoid indirect call for
read/write/seek/close operations for normal streams.
Additionally, custom streams has fileno = -2 now, like in glibc.
bloat-o-meter report (UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y):
function old new delta
fopencookie 69 131 +62
ftello64 233 260 +27
fseeko64 298 319 +21
fclose 423 442 +19
.rodata 16696 16708 +12
fileno_unlocked 53 45 -8
__ns_name_pack 859 851 -8
vswscanf 184 144 -40
vdprintf 231 187 -44
vsscanf 210 151 -59
vswprintf 269 201 -68
vsnprintf 249 181 -68
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/7 up/down: 141/-295) Total: -154 bytes
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Taken from Freetz.org.
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
This reverts commit ea21c7610aa1131b37a4533cf13dd89f727fb83f.
This was accidently pushed, before first coffee.
Sorry this is a bad commit.
|
|
The current (arbitrary) limit of 128 characters for path names has
proven too short for Android builds, as longer path names are used
there.
Change conf.c, so it can handle path lengths up to PATH_MAX characters.
Signed-off-by: Markus Mayer <mmayer@broadcom.com>
|
|
error out on internal NPTL used signals.
|
|
|
|
Using non-generic ulps file reduces failure counts for
math tests. Generated with nsim emulator running
test-{double,idouble,float,ifloat} -u and
gen-libm-test.pl on the build host.
|
|
When cross-compiling on other Unix systems like
FreeBSD 10.x, perl is not in /usr/bin. Use env
to find the perl interpreter and use no fixed path
when executing via make.
|
|
In gcc 5.x there is a compile failure, for sh2 builds
as shad no longer is accepted. Strange that it is working for
4.9.x. Add back old assembly code.
|
|
|
|
|
|
Fixes inetd compile. From OpenWrt.
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Reduce the initial buffer size for open_memstream (used by vasprintf),
as most strings are usually smaller than that.
Realloc the buffer after finishing the string to further reduce size.
Problem appears in case of UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y,
see http://dev.openwrt.org/ticket/13024
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
This fix commit 76dfc7ce8c "Some requested additional malloc entry points"
from 2004's
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
These are already used by some applications, so add it.
|
|
Only alpha, hppa and sparc need non-default value.
|
|
glibc [BZ# 16922]
* sysdeps/mips/sys/asm.h (INT_SUB): Fix definition.
(LONG_SUB): Ditto.
(PTR_SUB): Ditto.
glibc commit 5057ad3b50
Signed-off-by: Steve Ellcey <sellcey@mips.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Get rid of NIOS support. We try to support NIOSII.
|