Age | Commit message (Collapse) | Author |
|
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
|
|
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
|
|
Some applications needs it.
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
|
|
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@gentoo.org>
|
|
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@gmail.com>
|
|
|
|
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@gmail.com>
|
|
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@gmail.com>
|
|
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@gmail.com>
|
|
One test fails to compile with a gcc ICE, so disable it for now.
|
|
|
|
Fix typo in d81e53c5fa "New test targets 'compile' and 'run'" commit,
MAKE_SRCS variable was never defined.
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
|
|
On avr32/cris the build with MALLOC fails, when compiling
linuxthreads.
|
|
Both architectures are more or less deprecated.
No Linux upstream support, no gcc support for uClinux.
|
|
order
Implement simplest variant of /etc/gai.conf to control getaddrinfo
IPv6/IPv4 addresses sorting. Keep the default sort order - IPv6 first,
IPv4 second. To invert it, create /etc/gai.conf containing single line:
precedence ::ffff:0:0/96 100
Example before:
$ nslookup security.debian.org 8.8.8.8
Server: 8.8.8.8
Address 1: 8.8.8.8 google-public-dns-a.google.com
Name: security.debian.org
Address 1: 2001:a78:5:0:216:35ff:fe7f:be4f villa.debian.org
Address 2: 2001:a78:5:1:216:35ff:fe7f:6ceb lobos.debian.org
Address 3: 195.20.242.89 wieck.debian.org
Address 4: 212.211.132.250 lobos.debian.org
Address 5: 212.211.132.32 villa.debian.org
After patch & precedence set in /etc/gai.conf:
$ nslookup security.debian.org 8.8.8.8
Server: 8.8.8.8
Address 1: 8.8.8.8 google-public-dns-a.google.com
Name: security.debian.org
Address 1: 195.20.242.89 wieck.debian.org
Address 2: 212.211.132.250 lobos.debian.org
Address 3: 212.211.132.32 villa.debian.org
Address 4: 2001:a78:5:0:216:35ff:fe7f:be4f villa.debian.org
Address 5: 2001:a78:5:1:216:35ff:fe7f:6ceb lobos.debian.org
bloat-o-meter report:
function old new delta
getaddrinfo 726 1138 +412
gaih_inet 2660 2692 +32
.rodata 16618 16643 +25
__gai_precedence - 1 +1
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 4/0 up/down: 882/0) Total: 470 bytes
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
|
|
Argp is an advanced support for parsing unix-style argument vectors.
In addition to the common getopt interface, it provides automatic
response
to `--help' and `--version' options and use of custom parser in
conjunction
with argp native option parser, among others.
Argp support is required by elfutils package and prelink.
In uClibc argp functionalities has been moved from C library to
libuargp.so
Further the libc.so linker script contains an AS_NEEDED entry so that
it doesn't need to link libuargp.so explicitely.
Disable argp test if feature disabled.
Signed-off-by: Salvatore Cro <salvatore.cro@st.com>
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
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.
|