inet: adjust handling of cacnonname in getaddrinfo

Posix says that canonname should use the text representation of an IP address
when a numerical nodename given
See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html

Signed-off-by: Ed Wildgoose <lists@wildgooses.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
getaddrinfo(): avoid call to __check_pf() when not needed

__check_pf() function is called from getaddrinfo() and it calls
getifaddrs(), which is too much overhead especially if RSBAC-Net
is enabled. So with this patch __check_pf() is being called only
when AI_ADDRCONFIG hint flag is specified - just when we really
need that check.

Signed-off-by: Alexander Komyagin <komyagin@altell.ru>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
parse_config: tweak indentation

and shuffle tokens memsetting around.
No obj-code changes.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
resolv: Fix /etc/hosts for more than MAXALIASES aliases

PR networking/4916

Reserve space for the terminating 0 alias and zero out the
scratch-buffer so the last entry of the alias list is empty.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
resolv: remove unused variables

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
resolv: tiny shrinkage in /etc/hosts handling

-4b

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
ipc: eventually use stat64 in ftok()

PR 4201
ftok() always used 32bit stat

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
wchar: Fix BOM emitting in iconv_open()

Fix incorrect output of BOM when converting charactersets by name. Only
affective when iconv/locale enabled.

Signed-off-by: Ed Wildgoose <lists@wildgooses.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
test: Ignore various test objects in locale

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
locale: avoid segfault freelocale()

PR 4964

Eric Nadler writes:
It looks to me like the base structure is not fully initialized
with 0 (only a subset of the structure is initialized).
This later results in a free of base->collate.index2weight in
_locale_set_l.
This free tries to free uninitialized memory and segfaults.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
ldd: silence warnings

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
config: Fix alphabetical sort order of targets

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
sysconf: use getrlimit to determine ARG_MAX

getrlimit previously was only called for NPTL (why?), fix that to be
used everywhere.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
linuxthreads.old: only declare __pthread_xxx funcs hidden inside of libpthread

These stubs get used in libc as forwarding funcs, so we don't want them
labeled as hidden.  Otherwise, attempting to use them in other libraries
(like libdl) will result in references to symbols that only libpthread
provides.  Such as:
	/usr/bin/python2.6: can't resolve symbol '__pthread_mutex_lock' in lib '/lib/libdl.so.0'.

This also brings the old code in line with the newer linuxthreads.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
getconf: include a newline in error messages

The normal error() func implicitly appends a newline, so make sure we do
the same.  Otherwise getconf outputs an error message like so:
prompt$ getconf -h
Unrecognized variable `-h'prompt$

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
linuxthreads.old: fix typo in pthread_mutex_unlock hidden prototype

Reported-by: Tony Wu <tung7970@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
linuxthreads.old: fix set-but-unused warning

Move spin_count down to the code block where it's used to fix the warning:

libpthread/linuxthreads.old/spinlock.c: In function '__pthread_lock':
libpthread/linuxthreads.old/spinlock.c:70:7: warning:
	variable 'spin_count' set but not used [-Wunused-but-set-variable]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
linuxthreads.old: pass back up saved_errno value in manager init

This matches the newer linuxthreads code, and fixes the build warning:

libpthread/linuxthreads.old/manager.c: In function 'pthread_handle_create':
libpthread/linuxthreads.old/manager.c:487:7: warning:
	variable 'saved_errno' set but not used [-Wunused-but-set-variable]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
linuxthreads.old: refactor nommu logic a little to avoid mmu warning

Should be no functional changes; just fixing:

libpthread/linuxthreads.old/manager.c: In function 'pthread_free':
libpthread/linuxthreads.old/manager.c:707:9: warning:
	variable 'h_bottom_save' set but not used [-Wunused-but-set-variable]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
atomic.h: handle new mips R10K errata

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>