Ulrich Drepper [Tue, 15 Dec 2009 20:32:27 +0000 (12:32 -0800)]
Avoid ELF lookup race.
On some architectures the update of the l_used field in the lookup
functions races with setting the other bits in the bitfield. Simply
avoid this and optimize use of l_used in general.
Ulrich Drepper [Wed, 25 Nov 2009 02:50:32 +0000 (18:50 -0800)]
Optimize grantpt.
grantpt was performing two consecutive calls to stat with the same
file name. Avoid this by creating a special version of the ptsname
function which allows to pass the stat result back to the caller.
Ulrich Drepper [Wed, 25 Nov 2009 02:24:14 +0000 (18:24 -0800)]
Prevent unintended file desriptor leak in grantpt.
The pt_chown program is completely transparently called. It might
not be able to live with the various file descriptors the program
has open at the time of the call (e.g., under SELinux). Close all
but the needed descriptor and connect stdin, stdout, and stderr
with /dev/null. pt_chown shouldn't print anything when called to
do real work.
Ulrich Drepper [Wed, 25 Nov 2009 01:50:27 +0000 (17:50 -0800)]
Don't get tty group info multiple times in grantpt.
This is a minor optimization. The tty group mustn't change so a
successful call to getgrnam will always return the same information.
Cache it and reuse it.
Ulrich Drepper [Sun, 22 Nov 2009 19:07:04 +0000 (11:07 -0800)]
Update ntp_gettime for Linux.
The ntp_gettime implementation of NTP exports the tai field the kernel
now produces. This requires an ABI change since the ntptimeval structure
changed. Upstream kept the same name, there is nothing to do. This
patch changes the ntptimeval structure but keeps the old ntp_gettime
definition. A new ntp_gettimex function which is transparently invoked
through the old name is introduced. This has the advantage that even
object files can remain compatible. This wouldn't be the case if
symbol versioning would be used to overload the name ntp_gettime.
Jakub Jelinek [Wed, 18 Nov 2009 02:04:51 +0000 (18:04 -0800)]
Fix sync_file_range on ppc/ppc64.
I've noticed that sync_file_range is a stub on ppc/ppc64.
The kernel on these arches provides sync_file_range2 syscall with swapped
parameters.
The following completely untested patch ought to fix this.
Paolo Bonzini [Wed, 18 Nov 2009 00:23:24 +0000 (16:23 -0800)]
Fix ranges with multibyte characters as endpoints.
This is another bug in computing the fastmap. It was reported by a user
of sed because it usually does not happen with !_LIBC. However, it is
there in that case too.
The bug is that whenever we have a range at the beginning of the regex,
the regex must be tested on any possible multibyte character. The reason
why _LIBC masks it, is that in general there is a collation symbol for
each possible multibyte-character lead byte, so all the lead bytes are
in general already part of the fastmap.
The tests use cyrillic characters as an example. With _LIBC, they pass
without the patch too, but you can make them fail by removing collation
symbols handling.
Andreas Schwab [Tue, 10 Nov 2009 15:36:50 +0000 (07:36 -0800)]
Handle running out of buffer space with IPv6 mapping enabled.
With big DNS answers like the one you get for goodtimesdot.com you can
get a truncated address list if IPv6 mapping is enabled. Instead tell
the caller to resize the buffer.
Andreas Schwab [Fri, 6 Nov 2009 17:29:24 +0000 (09:29 -0800)]
Correct readahead syscall wrapper on powerpc32.
Due to alignment of 64bit parameters there is a dummy second argument.
But other than that the syscall arguments are directly mapped to the
function arguments.
Jakub Jelinek [Fri, 6 Nov 2009 17:27:41 +0000 (09:27 -0800)]
Fix R_PPC64_{JMP_IREL,IRELATIVE} handling in dl-conflict.c.
I've just committed STT_GNU_IFUNC ppc/ppc64 support into prelink,
and this patch is needed on the glibc side. Without it ld.so segfaults,
as in dl-conflict.c sym_map is always NULL. While dl-machine.h could use
RESOLVE_CONFLICT_FIND_MAP macro to compute it, it doesn't make sense,
because with prelink we know it is already properly relocated (all relative
relocations are applied by prelink).
Jakub Jelinek [Fri, 6 Nov 2009 17:26:31 +0000 (09:26 -0800)]
Fix preadv, pwritev and fallocate for -D_FILE_OFFSET_BITS=64.
As reported in http://bugzilla.redhat.com/533063 , preadv/pwritev prototypes
are wrong on 32-bit arches with -D_FILE_OFFSET_BITS=64 and as I've just
found, fallocate is wrong too.
The problem is that only off_t is remapped to the 64-bit type transparently,
__off_t is not.