Commit Graph

30166 Commits

Author SHA1 Message Date
H.J. Lu eb2c88c7c8 Remove alignments on jump targets in memset
X86-64 memset-vec-unaligned-erms.S aligns many jump targets, which
increases code sizes, but not necessarily improve performance.  As
memset benchtest data of align vs no align on various Intel and AMD
processors

https://sourceware.org/bugzilla/attachment.cgi?id=9277

shows that aligning jump targets isn't necessary.

	[BZ #20115]
	* sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S (__memset):
	Remove alignments on jump targets.
2016-05-19 08:49:55 -07:00
Joseph Myers bb37c73778 conformtest: Correct pwd.h expectations for XPG3.
This patch corrects some conformtest expectations for pwd.h for XPG4.

Tested for x86_64 and x86.

	* conform/data/pwd.h-data (endpwent): Do not expect for [XPG3].
	(getpwent): Likewise.
	(setpwent): Likewise.
	* conform/Makefile (test-xfail-XPG3/pwd.h/conform): Remove
	variable.
2016-05-19 14:48:30 +00:00
Joseph Myers 4c9695fa8e conformtest: Correct search.h expectations for XPG3.
This patch corrects some conformtest expectations for search.h for
XPG3.

Tested for x86_64 and x86.

	* conform/data/search.h-data (insque): Do not expect for [XPG3].
	(remque): Likewise.
	* conform/Makefile (test-xfail-XPG3/search.h/conform): Remove
	variable.
2016-05-19 14:35:41 +00:00
Joseph Myers b3d7eaf10a Update libm-test.inc comment about NaN signs.
libm-test.inc has a comment about signs of NaNs not being tested.
This is out of date since:

commit ce66581742
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sat Nov 16 12:48:35 2013 +0000

    Test signs of NaNs in libm-test.inc where appropriate.

This patch removes the inaccurate statement.

	* math/libm-test.inc: Update comment not to refer to signs of NaNs
	not being tested.
2016-05-18 21:57:25 +00:00
H.J. Lu 16cd2b35c2 Don't call internal _Unwind_Resume via PLT
There is no need to call the internal funtion, _Unwind_Resume, which
is defined in unwind-forcedunwind.c, via PLT.

	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
	(__condvar_cleanup2): Remove JUMPTARGET from  _Unwind_Resume
	call.
	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
	(__condvar_cleanup1): Likewise.
2016-05-18 13:43:26 -07:00
H.J. Lu d29261db22 Don't call internal __pthread_unwind via PLT
Add PTHREAD_UNWIND to replace JUMPTARGET(__pthread_unwind) and define
it to __GI___pthread_unwind within libpthread.

	* sysdeps/unix/sysv/linux/x86_64/cancellation.S (PTHREAD_UNWIND):
	New
	(__pthread_unwind): Renamed to ...
	(PTHREAD_UNWIND): This.
	(__pthread_enable_asynccancel): Replace
	JUMPTARGET(__pthread_unwind) with PTHREAD_UNWIND.
2016-05-18 13:41:55 -07:00
Joseph Myers 48526672b6 Add CLONE_NEWCGROUP from Linux 4.6 to bits/sched.h.
This patch adds CLONE_NEWCGROUP, new in Linux 4.6, to
sysdeps/unix/sysv/linux/bits/sched.h.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	* sysdeps/unix/sysv/linux/bits/sched.h [__USE_GNU]
	(CLONE_NEWCGROUP): New macro.
2016-05-18 17:46:52 +00:00
Joseph Myers 2a1aa52824 Add Q_GETNEXTQUOTA from Linux 4.6 to sys/quota.h.
This patch adds Q_GETNEXTQUOTA, new in Linux 4.6, to
sysdeps/unix/sysv/linux/sys/quota.h.

Tested for x86_64 and x86 (testsuite, and that installed shared
libraries are unchanged by the patch).

	* sysdeps/unix/sysv/linux/sys/quota.h [_LINUX_QUOTA_VERSION >= 2]
	(Q_GETNEXTQUOTA): New macro.
2016-05-18 13:15:11 +00:00
H.J. Lu 447720b03b Clear destination buffer updated by the previous run
Clear the destination buffer updated by the previous run in bench-memcpy.c
and test-memcpy.c to catch the error when the following implementations do
not copy anything.

	[BZ #19907]
	* benchtests/bench-memcpy.c (do_one_test): Clear the destination
	buffer updated by the previous run.
	* string/test-memcpy.c (do_one_test): Likewise.
	* benchtests/bench-memmove.c (do_one_test): Add a comment.
	* string/test-memmove.c (do_one_test): Likewise.
2016-05-18 05:51:59 -07:00
Joseph Myers 0014680d6a Do not declare grantpt, ptsname, unlockpt in stdlib.h for XPG3 (bug 20094).
stdlib.h declares grantpt, ptsname, unlockpt for __USE_XOPEN.  This
patch corrects the condition to __USE_XOPEN_EXTENDED (these functions
are new in XPG4).

Tested for x86_64 and x86 (testsuite, and that installed shared
libraries are unchanged by the patch).

	[BZ #20094]
	* stdlib/stdlib.h (grantpt): Declare if [__USE_XOPEN_EXTENDED],
	not [__USE_XOPEN].
	(unlockpt): Likewise.
	(ptsname): Likewise.
	* conform/Makefile (test-xfail-XPG3/stdlib.h/conform): Remove
	variable.
2016-05-17 15:51:55 +00:00
Joseph Myers 9ff81856db Make sys/stat.h define S_IFSOCK, S_ISSOCK for XPG4 (bug 20076).
sys/stat.h should define S_IFSOCK and S_ISSOCK for XPG4 (XNS), but
does not.  This patch corrects the relevant header conditionals.

Tested for x86_64 and x86 (testsuite, and that installed shared
libraries are unchanged by the patch).

	[BZ #20076]
	* io/sys/stat.h (S_IFSOCK): Define for [__USE_XOPEN_EXTENDED]
	instead of [__USE_UNIX98].
	(S_ISSOCK): Likewise.
	* conform/Makefile (test-xfail-XPG4/sys/stat.h/conform): Remove
	variable.
2016-05-17 15:50:00 +00:00
Joseph Myers b098852ac2 Fix stdlib.h rand_r namespace (bug 20074).
stdlib.h declares rand_r if __USE_POSIX; i.e., POSIX.1:1990.  But
rand_r was added along with threads, so the condition should be
__USE_POSIX199506.  This patch corrects the condition.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	[BZ #20074]
	* stdlib/stdlib.h (rand_r): Declare if [__USE_POSIX199506], not if
	[__USE_POSIX].
	* conform/Makefile (test-xfail-XPG4/stdlib.h/conform): Remove
	variable.
2016-05-17 15:48:29 +00:00
Joseph Myers 4242d9683f Correct ttyslot header declaration conditions (bug 20051).
UNIX98 and XPG4 have ttyslot in <stdlib.h>.  glibc, however, has it in
<unistd.h>, for __USE_MISC || (__USE_XOPEN_EXTENDED && !__USE_UNIX98),
but no supported standard has it in <unistd.h>.

This patch adds a properly conditioned declaration to <stdlib.h> (only
enabled for the relevant standards, not for __USE_MISC or __USE_GNU).
The <unistd.h> declaration is restricted to __USE_MISC.  Some relevant
XFAILs are removed.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	[BZ #20051]
	* posix/unistd.h [__USE_XOPEN_EXTENDED && !__USE_UNIX98]
	(ttyslot): Do not declare.
	* stdlib/stdlib.h [__USE_XOPEN_EXTENDED && !__USE_XOPEN2K]
	(ttyslot): New prototype.
	* conform/Makefile (test-xfail-XPG4/unistd.h/conform): Remove
	variable.
	(test-xfail-UNIX98/stdlib.h/conform): Likewise.
2016-05-17 15:47:20 +00:00
Stefan Liebler b3a810d0d3 Fix tst-cancel17/tst-cancelx17, which sometimes segfaults while exiting.
The testcase tst-cancel[x]17 ends sometimes with a segmentation fault.
This happens in one of 10000 cases. Then the real testcase has already
exited with success and returned from do_test(). The segmentation fault
occurs after returning from main in _dl_fini().

In those cases, the aio_read(&a) was not canceled because the read
request was already in progress. In the meanwhile aio_write(ap) wrote
something to the pipe and the read request is able to read the
requested byte.
The read request hasn't finished before returning from do_test().
After it finishes, it writes the return value and error code from the
read syscall to the struct aiocb a, which lies on the stack of do_test.
The stack of the subsequent function call of _dl_fini or _dl_sort_fini,
which is inlined in _dl_fini is corrupted.

In case of S390, it reads a zero and decrements it by 1:
unsigned int k = nmaps - 1;
struct link_map **runp = maps[k]->l_initfini;
The load from unmapped memory leads to the segmentation fault.
The stack corruption also happens on other architectures.
I saw them e.g. on x86 and ppc, too.

This patch adds an aio_suspend call to ensure, that the read request
is finished before returning from do_test().

ChangeLog:

	* nptl/tst-cancel17.c (do_test): Wait for finishing aio_read(&a).
2016-05-17 10:45:48 +02:00
Florian Weimer e2cd73a2cc tst-mallocfork2: Fix race condition, use fewer resources
The first SIGUSR1 signal could arrive when sigusr1_sender_pid
was still 0.  As a result, kill would send SIGSTOP to the
entire process group.  This would cause the test to hang before
printing any output.

This commit also adds a sched_yield to the signal source, so that
it does not flood the parent process with signals it has never a
chance to handle.

Even with these changes, tst-mallocfork2 still fails reliably
after the fix in commit commit 56290d6e76
(Increase fork signal safety for single-threaded processes) is
backed out.
2016-05-13 20:43:14 +02:00
Joseph Myers fdbdbc83a5 conformtest: Correct some stdlib.h expectations for XPG3.
This patch corrects some spurious conformtest stdlib.h expectations
for XPG3 (not based on a full review of the expectations for that
standard, so other issues may remain).

Tested for x86_64 and x86.

	* conform/data/stdlib.h-data (a64l): Do not expect for [XPG3].
	(ecvt): Likewise.
	(fcvt): Likewise.
	(gcvt): Likewise.
	(getsubopt): Likewise.
	(grantpt): Likewise.
	(initstate): Likewise.
	(l64a): Likewise.
	(mktemp): Likewise.
	(mkstemp): Likewise.
	(ptsname): Likewise.
	(random): Likewise.
	(realpath): Likewise.
	(setstate): Likewise.
	(srandom): Likewise.
	(ttyslot): Likewise.
	(unlockpt): Likewise.
	(valloc): Likewise.
2016-05-13 17:26:04 +00:00
Joseph Myers 8142262bc5 conformtest: Do not expect strdup in string.h for XPG3.
This patch corrects a spurious conformtest expectation of strdup in
string.h for XPG3.

Tested for x86_64 and x86.

	* conform/data/string.h-data (strdup): Do not expect for [XPG3].
	* conform/Makefile (test-xfail-XPG3/string.h/conform): Remove
	variable.
2016-05-13 16:57:09 +00:00
H.J. Lu 4facca0b0e Call init_cpu_features only if SHARED is defined
In static executable, since init_cpu_features is called early from
__libc_start_main, there is no need to call it again in dl_platform_init.

	[BZ #20072]
	* sysdeps/i386/dl-machine.h (dl_platform_init): Call
	init_cpu_features only if SHARED is defined.
	* sysdeps/x86_64/dl-machine.h (dl_platform_init): Likewise.
2016-05-13 08:29:33 -07:00
H.J. Lu 9e4ec3e816 Support non-inclusive caches on Intel processors
* sysdeps/x86/cacheinfo.c (init_cacheinfo): Check and support
	non-inclusive caches on Intel processors.
2016-05-13 07:18:35 -07:00
Florian Weimer 4cf6c72fd2 malloc: Rewrite dumped heap for compatibility in __malloc_set_state
This will allow us to change many aspects of the malloc implementation
while preserving compatibility with existing Emacs binaries.

As a result, existing Emacs binaries will have a larger RSS, and Emacs
needs a few more milliseconds to start.  This overhead is specific
to Emacs (and will go away once Emacs switches to its internal malloc).

The new checks to make free and realloc compatible with the dumped heap
are confined to the mmap paths, which are already quite slow due to the
munmap overhead.

This commit weakens some security checks, but only for heap pointers
in the dumped main arena.  By default, this area is empty, so those
checks are as effective as before.
2016-05-13 14:16:39 +02:00
Joseph Myers 567c710bca conformtest: Correct time.h XPG3 expectations.
This patch corrects spurious conformtest expectations of getdate and
getdate_err for XPG3.  (This is not based on a full review of the
expectations, so there may be other issues where the header and tests
agree but are both incorrect.)

Tested for x86_64 and x86.

	* conform/data/time.h-data (getdate_err): Do not expect for
	[XPG3].
	(getdate): Likewise.
	* conform/Makefile (test-xfail-XPG3/time.h/conform): Remove
	variable.
2016-05-12 20:47:15 +00:00
Joseph Myers 7f8843c92a conformtest: Correct some unistd.h expectations for XPG3, XPG4.
The conformtest tests of unistd.h fail for XPG3 because of various
expectations that are incorrect for XPG3.  This patch corrects those
bogus expectations, and one bogus expectation for XPG4.  (This is not
based on a full review of the standards so there may well still be
other bugs in the expectations for this header.)

Tested for x86_64 and x86.

	* conform/data/unistd.h-data (F_LOCK): Do not expect for [XPG3].
	(F_ULOCK): Likewise.
	(F_TEST): Likewise.
	(F_TLOCK): Likewise.
	(useconds_t): Likewise.
	(intptr_t): Do not expect for [XPG3] or [XPG4].
	(brk): Do not expect for [XPG3]
	(fchown): Likewise.
	(fchdir): Likewise.
	(ftruncate): Likewise.
	(getdtablesize): Likewise.
	(gethostid): Likewise.
	(getpagesize): Likewise.
	(getpgid): Likewise.
	(getsid): Likewise.
	(getwd): Likewise.
	(lchown): Likewise.
	(lockf): Likewise.
	(readlink): Likewise.
	(sbrk): Likewise.
	(setpgrp): Likewise.
	(setregid): Likewise.
	(setreuid): Likewise.
	(symlink): Likewise.
	(sync): Likewise.
	(truncate): Likewise.
	(ualarm): Likewise.
	(usleep): Likewise.
	(vfork): Likewise.
	* conform/Makefile (test-xfail-XPG3/unistd.h/conform): Remove
	variable.
2016-05-12 17:39:04 +00:00
Joseph Myers 612fe43275 Declare gethostname for XPG4 (bug 20054).
unistd.h declares gethostname for __USE_UNIX98 || __USE_XOPEN2K.  But
it's also in XPG4 (XNS volume - C438 - not the main definitions of
system interfaces and headers in C435).  This patch corrects the
condition.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	[BZ #20054]
	* posix/unistd.h (gethostname): Declare if [__USE_XOPEN_EXTENDED],
	not [__USE_UNIX98].
	* conform/data/unistd.h-data (gethostname): Do not expect for
	[XPG3].
2016-05-12 16:50:43 +00:00
Joseph Myers ca927ec4c2 conformtest: Do not expect S_IF* in fcntl.h.
The conform/ tests for fcntl.h are failing for XPG3 and XPG4 because
of missing S_IFSOCK.

This is a case of a bogus test.  The relevant wording requiring such
constants is, in current POSIX (and this requirement dates back as far
as XPG4), "The <fcntl.h> header shall define the symbolic constants
for file modes for use as values of mode_t as described in
<sys/stat.h>.".  Note that this is *file modes* not *file types*.
That makes sense, since the point is presumably for use with functions
such as open that are declared in fcntl.h, where file modes are
relevant but file types aren't.  So this patch removes all those
spurious S_IF* expectations for fcntl.h (the macros are generally
still *allowed* through the permission to make everything from
sys/stat.h visible).

Tested for x86_64 and x86.

	* conform/data/fcntl.h-data [!POSIX] (S_IFMT): Do not expect.
	[!POSIX] (S_IFBLK): Likewise.
	[!POSIX] (S_IFCHR): Likewise.
	[!POSIX] (S_IFIFO): Likewise.
	[!POSIX] (S_IFREG): Likewise.
	[!POSIX] (S_IFDIR): Likewise.
	[!POSIX] (S_IFLNK): Likewise.
	[!POSIX] (S_IFSOCK): Likewise.
	* conform/Makefile (test-xfail-XPG3/fcntl.h/conform): Remove
	variable.
	(test-xfail-XPG4/fcntl.h/conform): Likewise.
2016-05-12 16:46:55 +00:00
Wilco Dijkstra a8c5a2a952 This is an optimized memset for AArch64. Memset is split into 4 main cases:
small sets of up to 16 bytes, medium of 16..96 bytes which are fully unrolled.
Large memsets of more than 96 bytes align the destination and use an unrolled
loop processing 64 bytes per iteration.  Memsets of zero of more than 256 use
the dc zva instruction, and there are faster versions for the common ZVA sizes
64 or 128.  STP of Q registers is used to reduce codesize without loss of
performance.

The speedup on test-memset is 1% on Cortex-A57 and 8% on Cortex-A53.

	* sysdeps/aarch64/memset.S (__memset):
	Rewrite of optimized memset.
2016-05-12 16:44:53 +01:00
Florian Weimer 56290d6e76 Increase fork signal safety for single-threaded processes [BZ #19703]
This provides a band-aid and addresses the scenario where fork is
called from a signal handler while the process is in the malloc
subsystem (or has acquired the libio list lock).  It does not
address the general issue of async-signal-safety of fork;
multi-threaded processes are not covered, and some glibc
subsystems have fork handlers which are not async-signal-safe.
2016-05-12 15:26:55 +02:00
Florian Weimer cd065b6843 getaddrinfo: Convert from extend_alloca to struct scratch_buffer 2016-05-12 14:07:56 +02:00
Joseph Myers b7db760660 Declare tcgetsid for XPG4 (bug 20055).
termios.h should declare tcgetsid for XPG4, but only does so for
__USE_UNIX98 || __USE_XOPEN2K8 at present.  This patch fixes the
declaration conditions.  A spurious conformtest expectation of this
declaration for XPG3 is removed, and two XFAILs that are fixed by
these changes are also removed.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	[BZ #20055]
	* termios/termios.h (pid_t): Define for [__USE_XOPEN_EXTENDED]
	instead of [__USE_UNIX98].
	(tcgetsid): Declare for [__USE_XOPEN_EXTENDED] instead of
	[__USE_UNIX98].
	* conform/data/termios.h-data (tcgetsid): Do not expect for
	[XPG3].
	* conform/Makefile (test-xfail-XPG3/termios.h/conform): Remove
	variable.
	(test-xfail-XPG4/termios.h/conform): Likewise.
2016-05-11 18:05:37 +00:00
Florian Weimer 1ac3eaa6bc localedef: Do not compile with mcheck
__malloc_initialize_hook is deprecated.
2016-05-11 16:56:59 +02:00
Stefan Liebler c64a10e544 S390: Use fPIC to avoid R_390_GOT12 relocation in gcrt1.o.
if glibc is build with -march=z900 | -march=z990,
the startup file gcrt1.o (used if you link with gcc -pg)
contains R_390_GOT12 | R_390_GOT20 relocations.
Thus, an entry in the GOT can be addressed relative to the GOT pointer
with a 12 | 20 bit displacement value.
The startup files should not contain R_390_GOT12,
R_390_GOT20 relocations, but R_390_GOTENT ones.

This patch removes the overrides of pic-ccflag and
the default pic-ccflag = -fPIC in Makeconfig
is used instead to get the R_390_GOTENT relocations in gcrt1.o.

ChangeLog:

	* sysdeps/s390/s390-32/Makefile (pic-ccflag): Remove.
	* sysdeps/s390/s390-64/Makefile: Likewise.
2016-05-11 15:51:25 +02:00
H.J. Lu 2a1f15b1a9 Remove x86 ifunc-defines.sym and rtld-global-offsets.sym
Merge x86 ifunc-defines.sym with x86 cpu-features-offsets.sym.  Remove
x86 ifunc-defines.sym and rtld-global-offsets.sym.  No code changes on
i686 and x86-64.

	* sysdeps/i386/i686/multiarch/Makefile (gen-as-const-headers):
	Remove ifunc-defines.sym.
	* sysdeps/x86_64/multiarch/Makefile (gen-as-const-headers):
	Likewise.
	* sysdeps/i386/i686/multiarch/ifunc-defines.sym: Removed.
	* sysdeps/x86/rtld-global-offsets.sym: Likewise.
	* sysdeps/x86_64/multiarch/ifunc-defines.sym: Likewise.
	* sysdeps/x86/Makefile (gen-as-const-headers): Remove
	rtld-global-offsets.sym.
	* sysdeps/x86_64/multiarch/ifunc-defines.sym: Merged with ...
	* sysdeps/x86/cpu-features-offsets.sym: This.
	* sysdeps/x86/cpu-features.h: Include <cpu-features-offsets.h>
	instead of <ifunc-defines.h> and <rtld-global-offsets.h>.
2016-05-11 05:51:39 -07:00
Joseph Myers 8da7d8f877 Fix sys/stat.h fchmod namespace (bug 20073).
sys/stat.h declares fchmod if __USE_POSIX (i.e. POSIX.1:1990).  But it
was actually added in 1993 and also in XPG4.  This patch changes the
conditions to the correct __USE_POSIX199309 || __USE_XOPEN_EXTENDED.

Tested for x86_64 and x86 (testsuite, and that installed shared
libraries are unchanged by the patch).

	[BZ #20073]
	* io/sys/stat.h (fchmod): Declare for
	[__USE_POSIX199309 || __USE_XOPEN_EXTENDED], not [__USE_POSIX].
	* conform/Makefile (test-xfail-XPG3/sys/stat.h/conform): Remove
	variable.
2016-05-10 21:52:08 +00:00
Joseph Myers 23f3a3b5d4 conformtest: Correct some sys/stat.h expectations for XPG3.
This patch fixes various conformtest sys/stat.h expectations that were
incorrect for XPG3 (not based on a full review, so not necessarily an
exhaustive set of such corrections).  Most of these corrections fix
spurious failures shown in testing (but that for fchmod introduces a
correct failure, as that function is wrongly declared for XPG3, so
this doesn't eliminate any XFAILs).

Tested for x86_64 and x86.

	* conform/data/sys/stat.h-data [XPG3] (S_IFLNK): Do not expect.
	[XPG3] (S_IFSOCK): Likewise.
	[XPG3] (S_ISVTX): Likewise.
	[XPG3] (S_ISLNK): Likewise.
	[XPG3] (S_ISSOCK): Likewise.
	[XPG3] (fchmod): Likewise.
	[XPG3] (lstat): Likewise.
	[XPG3] (mknod): Likewise.
2016-05-10 17:48:23 +00:00
Joseph Myers 77d21a1f4f conformtest: Fix st_blksize, st_blocks expectations for XPG3, XPG4.
The conformtest expectations expect the struct stat fields st_blksize
and st_blocks to be of types blksize_t and blkcnt_t.  But XPG4 does
not have those types, using long instead, and XPG3 does not have these
fields at all.  This patch adjusts the expectations for those
standards, XFAILing them for XPG4 to allow for systems where the
typedefs don't correspond to long.

Tested for x86_64 and x86.

	* conform/data/sys/stat.h-data (st_blksize): Do not expect for
	[XPG3].  Expect type long and XFAIL for [XPG4].
	(st_blocks): Likewise.
2016-05-10 15:20:09 +00:00
Joseph Myers 46c1ffa4d5 Declare pthread_atfork in unistd.h for UNIX98 (bug 20044).
For UNIX98 (only), unistd.h should declare pthread_atfork, but that
declaration is missing.  This patch adds it.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	[BZ #20044]
	* posix/unistd.h [__USE_UNIX98 && !__USE_XOPEN2K]
	(pthread_atfork): New prototype.
	* conform/Makefile (test-xfail-UNIX98/unistd.h/conform): Remove
	variable.
2016-05-10 14:57:58 +00:00
Joseph Myers b9eca49e37 Declare cuserid in unistd.h for UNIX98 and before (bug 20043).
For UNIX98 and older X/Open standards, unistd.h should have a
declaration of the legacy cuserid function, but such a declaration is
missing.  This patch adds that missing declaration.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	[BZ #20043]
	* posix/unistd.h [__USE_XOPEN && !__USE_XOPEN2K] (cuserid): New
	prototype.
2016-05-10 14:56:49 +00:00
Florian Weimer 4efdc6d956 resolv: Call gmtime_r instead of gmtime in p_secstodate [BZ #20017] 2016-05-10 10:50:24 +02:00
Florian Weimer 8db2cf163e getaddrinfo: Restore RES_USE_INET6 flag on error path [BZ #19994] 2016-05-10 10:09:24 +02:00
Joseph Myers 9e6e128d14 conformtest: Remove some bogus sys/types.h expectations for XPG3 and XPG4.
The conformtest tests for sys/types.h for XPG3 and XPG4 fail because
of missing blksize_t.  This is a bug in the expectations; that type is
not part of those standards.  This patch stops the tests from
expecting it, and some other types that also are not part of XPG3 and
XPG4.

Tested for x86_64 and x86.

	* conform/data/sys/types.h-data (blkcnt_t): Do not expect for
	[XPG3 || XPG4].
	(blksize_t): Likewise.
	(clockid_t): Likewise.
	* conform/Makefile (test-xfail-XPG3/sys/types.h/conform): Remove
	variable.
	(test-xfail-XPG4/sys/types.h/conform): Likewise.
2016-05-09 21:10:10 +00:00
Stefan Liebler b91a333ecb S390: Add support for vdso getcpu symbol.
This patch adds support for symbol __kernel_getcpu in vDSO,
which is available with kernel 4.5.
Now sched_getcpu is using this symbol if available in mapped vDSO
by defining macro HAVE_GETCPU_VSYSCALL. If not available at runtime,
the former syscall is used.
2016-05-09 11:05:45 +02:00
H.J. Lu a9558b49b3 Move sysdeps/x86_64/cacheinfo.c to sysdeps/x86
Move sysdeps/x86_64/cacheinfo.c to sysdeps/x86.  No code changes on x86
and x86_64.

	* sysdeps/i386/cacheinfo.c: Include <sysdeps/x86/cacheinfo.c>
	instead of <sysdeps/x86_64/cacheinfo.c>.
	* sysdeps/x86_64/cacheinfo.c: Moved to ...
	* sysdeps/x86/cacheinfo.c: Here.
2016-05-08 08:49:18 -07:00
Neskie Manuel b86970392c localedata: chr_US: new Cherokee locale [BZ #12143] 2016-05-07 20:01:55 -04:00
Dimitris Pappas 5301c98776 charmaps: IBM875: fix mapping of iota/upsilon variants [BZ #18453]
The letters ΐ/ϊ and ΰ/ϋ are swapped in the EBCDIC 875 map.
Verified against the original IBM spec.
2016-05-07 19:55:55 -04:00
Samuel Thibault 04794f3e7e Revert "aio: fix newp->running data race"
This reverts commit fd67a9cf7b.
2016-05-04 15:52:30 +02:00
Florian Weimer 66355680f8 malloc: Adjust header file guard in malloc-internal.h 2016-05-04 15:27:15 +02:00
Samuel Thibault fd67a9cf7b aio: fix newp->running data race
* sysdeps/pthread/aio_misc.c (__aio_enqueue_request): Do not write
	`running` field of `newp` when a thread was started to process it,
	since that thread will not take `__aio_requests_mutex`, and the field
	already has the proper value actually.
2016-05-04 15:14:29 +02:00
Florian Weimer 066746783d getnameinfo: Return EAI_OVERFLOW in more cases [BZ #19787]
The AF_LOCAL and AF_INET/AF_INET6 non-numerci service conversion
did not return EAI_OVERFLOW if the supplied buffer was too small,
silently returning truncated data.  In the AF_INET/AF_INET6
numeric cases, the snprintf return value checking was incorrect.
2016-05-04 14:48:01 +02:00
Florian Weimer 1c3490d4b2 getnameinfo: Avoid calling strnlen on uninitialized buffer
In the numeric AF_INET/AF_INET6 case, if inet_ntop fails
as the result of a short host buffer, we used to call strnlen
on the uninitialized host buffer.
2016-05-04 14:48:01 +02:00
Florian Weimer c9b0e6a432 getnameinfo: Reduce line length and add missing comments 2016-05-04 14:48:01 +02:00
Gabriel F. T. Gomes eb3b8a4924 powerpc: Fix operand prefixes
The file sysdeps/powerpc/sysdeps.h defines aliases for condition register
operands.  E.g.: 'cr7' means condition register 7.  On the one hand, this
increases readability, as it makes it easier for readers to know whether the
operand is a condition register, a general purpose register or an immediate.
On the other hand, this permits that condition registers be written as if they
were general purpose, and vice-versa, thus reducing the readability of the
code.

This commit removes some of these unintentional misuses.

The changes have no effect on the final code.  Checked with objdump.
2016-05-04 09:14:52 -03:00