[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r9158 - in /fsf/trunk/libc: ./ libio/ locale/ localedata/ localedata/locales/ login/ malloc/ nis/nss_nis/ nscd/ nss/nss_file...
- To: commits@xxxxxxxxxx
- Subject: [commits] r9158 - in /fsf/trunk/libc: ./ libio/ locale/ localedata/ localedata/locales/ login/ malloc/ nis/nss_nis/ nscd/ nss/nss_file...
- From: eglibc@xxxxxxxxxx
- Date: Fri, 30 Oct 2009 07:04:30 -0000
Author: eglibc
Date: Fri Oct 30 00:04:29 2009
New Revision: 9158
Log:
Import glibc-mainline for 2009-10-30
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/libio/ioputs.c
fsf/trunk/libc/locale/iso-639.def
fsf/trunk/libc/localedata/ChangeLog
fsf/trunk/libc/localedata/locales/POSIX
fsf/trunk/libc/localedata/locales/crh_UA
fsf/trunk/libc/localedata/locales/en_US
fsf/trunk/libc/localedata/locales/it_CH
fsf/trunk/libc/localedata/locales/it_IT
fsf/trunk/libc/login/utmp_file.c
fsf/trunk/libc/malloc/malloc.c
fsf/trunk/libc/malloc/memusage.c
fsf/trunk/libc/malloc/memusagestat.c
fsf/trunk/libc/nis/nss_nis/nis-grp.c
fsf/trunk/libc/nscd/aicache.c
fsf/trunk/libc/nscd/dbg_log.c
fsf/trunk/libc/nscd/grpcache.c
fsf/trunk/libc/nscd/hstcache.c
fsf/trunk/libc/nscd/initgrcache.c
fsf/trunk/libc/nscd/pwdcache.c
fsf/trunk/libc/nss/nss_files/files-hosts.c
fsf/trunk/libc/resolv/res_send.c
fsf/trunk/libc/sysdeps/generic/netinet/ip.h
fsf/trunk/libc/sysdeps/gnu/getutmp.c
fsf/trunk/libc/sysdeps/pthread/aio_misc.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/faccessat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/fchmodat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/fchownat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/fcntl.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/futimesat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/fxstatat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/fxstatat64.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/getpt.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fchownat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fcntl.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fxstatat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/siginfo.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/linkat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/mkdirat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/openat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/fchownat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/readlinkat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/renameat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/siginfo.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/symlinkat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/ttyname.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/unlinkat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
fsf/trunk/libc/sysdeps/unix/sysv/linux/xmknodat.c
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Fri Oct 30 00:04:29 2009
@@ -1,3 +1,130 @@
+2009-10-29 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * locale/iso-639.def: Add sml entry.
+
+ [BZ #10391]
+ * resolv/res_send.c (send_dg): Initialize resplen.
+
+ [BZ #10446]
+ * sysdeps/unix/sysv/linux/ia64/bits/siginfo.h: Match sigevent
+ definition to the kernel's.
+ * sysdeps/unix/sysv/linux/s390/bits/siginfo.h: Likewise.
+
+2009-08-18 Anders Johansson <ajohansson@xxxxxxxxxx>
+
+ * nscd/aicache.c: Fix mixing up dataset and dataset->resp
+ offsets and record sizes in assert()s and response sending.
+ * nscd/grpcache.c: Likewise.
+ * nscd/hstcache.c: Likewise.
+ * nscd/initgrcache.c: Likewise.
+ * nscd/pwdcache.c: Likewise.
+
+2009-10-29 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ [BZ #10540]
+ * nss/nss_files/files-hosts.c (_nss_files_gethostbyname4_r): If
+ /etc/hosts does not exist set errnop and herrnop appropriately.
+ Patch by Steve Langasek <vorlon@xxxxxxxxxx>.
+
+ [BZ #10553]
+ * malloc/malloc.c (malloc_info): Fix typos in format strings.
+ Patch by John Sullivan <jsrhbz@xxxxxxxxxxxxxxxxxxxx>.
+
+ [BZ #10564]
+ * login/utmp_file.c (TIMEOUT): Increase to 10.
+
+ [BZ #10609]
+ * sysdeps/unix/sysv/linux/faccessat.c: Fix handling of empty parameters
+ for file names in case the syscall is not available.
+ * sysdeps/unix/sysv/linux/fchmodat.c: Likewise.
+ * sysdeps/unix/sysv/linux/fchownat.c: Likewise.
+ * sysdeps/unix/sysv/linux/futimesat.c: Likewise.
+ * sysdeps/unix/sysv/linux/fxstatat.c: Likewise.
+ * sysdeps/unix/sysv/linux/fxstatat64.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/fchownat.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/fxstatat.c: Likewise.
+ * sysdeps/unix/sysv/linux/linkat.c: Likewise.
+ * sysdeps/unix/sysv/linux/mkdirat.c: Likewise.
+ * sysdeps/unix/sysv/linux/openat.c: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/fchownat.c: Likewise.
+ * sysdeps/unix/sysv/linux/readlinkat.c: Likewise.
+ * sysdeps/unix/sysv/linux/renameat.c: Likewise.
+ * sysdeps/unix/sysv/linux/symlinkat.c: Likewise.
+ * sysdeps/unix/sysv/linux/unlinkat.c: Likewise.
+ * sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c: Likewise.
+ * sysdeps/unix/sysv/linux/xmknodat.c: Likewise.
+
+ [BZ #10643]
+ * sysdeps/pthread/aio_misc.c (__aio_enqueue_request): If thread
+ creation filed, remove the request from the 'requests' list and signal
+ the caller that the request is finished.
+
+ [BZ #10692]
+ * nis/nss_nis/nis-grp.c (internal_nis_getgrent_r): Don't free buffer
+ in error if batch_read. Patch by Joe Landers <jlanders@xxxxxxxxxx>.
+
+ [BZ #10713]
+ * nis/nss_nis/nis-grp.c (internal_nis_endgrent): Start freeing blocks
+ from intern.start. Patch by Joe Landers <jlanders@xxxxxxxxxx>.
+
+ [BZ #10780]
+ * libio/ioputs.c (_IO_puts): Make sure to not return a number which
+ overflows the int return type.
+
+ [BZ #10717]
+ * malloc/memusagestat.c (main): Fix repairing of trace files. We also
+ have to compute maxsize_total, we have to update the variables, and
+ the also_total handling must happen after the repair.
+
+ [BZ #10742]
+ * nscd/dbg_log.c (dbg_log): Print timestamp before the message text.
+ Based on patch by Jeffrey Bastian <jbastian@xxxxxxxxxx>.
+
+2009-10-27 Andreas Schwab <schwab@xxxxxxxxxx>
+
+ * sysdeps/unix/sysv/linux/getpt.c (__posix_openpt): Make sure
+ errno is always set when returning unsuccessfully.
+
+2009-10-29 Andreas Schwab <schwab@xxxxxxxxxx>
+
+ * malloc/memusage.c (update_data): Fix index wraparound handling
+ so that buffer_cnt is actually reset.
+
+2009-10-29 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ [BZ #10784]
+ * sysdeps/unix/sysv/linux/ttyname.c (getttyname): Always copy name
+ of the directory we look at into the static buffer if there is one
+ at the start of the loop.
+
+ [BZ #10789]
+ * sysdeps/generic/netinet/ip.h: Define IPTOS_ENC* and IPTOS_DSCP*
+ macros. Patch by Philip Prindeville <philipp@xxxxxxxxxxxxxxxxxxxxx>.
+
+ [BZ #10840]
+ * sysdeps/unix/sysv/linux/kernel-features.h: Define
+ __ASSUME_F_GETOWN_EX.
+ * sysdeps/unix/sysv/linux/fcntl.c: Implement F_GETOWN using F_GETOWN_EX
+ if possible.
+ * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.
+
+ * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Define F_OWNER_*
+ and f_owner_ex.
+ * sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise.
+
+ [BZ #10847]
+ * sysdeps/gnu/getutmp.c: Allow compatibility code to play around with
+ getutmpx symbol.
+
+ [BZ #10823]
+ * resolv/res_send.c (__libc_res_nsend): Fix copying of IPv4 server
+ addresses. Patch by Petar Bogdanovic <petar@xxxxxxxxxx>.
+
2009-10-24 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
* sysdeps/ieee754/ldbl-128/w_expl.c: Add hidden_def (__expl).
Modified: fsf/trunk/libc/libio/ioputs.c
==============================================================================
--- fsf/trunk/libc/libio/ioputs.c (original)
+++ fsf/trunk/libc/libio/ioputs.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,1996,1997,1998,1999,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1993,1996-1999,2003,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,6 +27,7 @@
#include "libioP.h"
#include <string.h>
+#include <limits.h>
int
_IO_puts (str)
@@ -40,7 +41,7 @@
|| _IO_fwide (_IO_stdout, -1) == -1)
&& _IO_sputn (_IO_stdout, str, len) == len
&& _IO_putc_unlocked ('\n', _IO_stdout) != EOF)
- result = len + 1;
+ result = MIN (INT_MAX, len + 1);
_IO_release_lock (_IO_stdout);
return result;
Modified: fsf/trunk/libc/locale/iso-639.def
==============================================================================
--- fsf/trunk/libc/locale/iso-639.def (original)
+++ fsf/trunk/libc/locale/iso-639.def Fri Oct 30 00:04:29 2009
@@ -84,6 +84,7 @@
DEFINE_LANGUAGE_CODE3 ("Cebuano", ceb, ceb)
DEFINE_LANGUAGE_CODE3 ("Celtic (Other)", cel, cel)
DEFINE_LANGUAGE_CODE3 ("Central American Indian (Other)", cai, cai)
+DEFINE_LANGUAGE_CODE3 ("Central Sama", sml, sml)
DEFINE_LANGUAGE_CODE3 ("Chagatai", chg, chg)
DEFINE_LANGUAGE_CODE3 ("Chamic languages", cmc, cmc)
DEFINE_LANGUAGE_CODE ("Chamorro", ch, cha, cha)
Modified: fsf/trunk/libc/localedata/ChangeLog
==============================================================================
--- fsf/trunk/libc/localedata/ChangeLog (original)
+++ fsf/trunk/libc/localedata/ChangeLog Fri Oct 30 00:04:29 2009
@@ -1,3 +1,17 @@
+2009-10-29 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ [BZ #10425]
+ * locales/it_IT: Fix date_fmt.
+ * locales/it_CH: Likewise.
+ Patch by Nicolo' Chieffo <nicolo.chieffo@xxxxxxxxx>.
+
+ * locales/POSIX: Define yesstr and nostr.
+ * locales/en_US: Likewise.
+ Patch by Petr Machata <pmachata@xxxxxxxxxx>.
+
+ * locales/crh_UA: Fix first day of week and a few spellings.
+ Patch by Reþat SABIQ <tilde.birlik@xxxxxxxxx>.
+
2009-10-15 Ulrich Drepper <drepper@xxxxxxxxxx>
* SUPPORTED (SUPPORTED-LOCALES): Add ps_AF.UTF-8.
Modified: fsf/trunk/libc/localedata/locales/POSIX
==============================================================================
--- fsf/trunk/libc/localedata/locales/POSIX (original)
+++ fsf/trunk/libc/localedata/locales/POSIX Fri Oct 30 00:04:29 2009
@@ -328,4 +328,8 @@
yesexpr "<U005E><U005B><U0079><U0059><U005D>"
#
noexpr "<U005E><U005B><U006E><U004E><U005D>"
+#
+yesstr "<U0059><U0065><U0073>"
+#
+nostr "<U004E><U006F>"
END LC_MESSAGES
Modified: fsf/trunk/libc/localedata/locales/crh_UA
==============================================================================
--- fsf/trunk/libc/localedata/locales/crh_UA (original)
+++ fsf/trunk/libc/localedata/locales/crh_UA Fri Oct 30 00:04:29 2009
@@ -1,14 +1,14 @@
comment_char %
escape_char /
%
-% Crimean Tatar Language Locale for Ukraine (latin)
-% Source: Reshat Sabiq (Re<U015F>at)
-% Contact: Reshat Sabiq (Re<U015F>at)
-% Email: <tatar.iqtelif.i18n@xxxxxxxxx>
+% Crimean Tatar (Crimean Turkish) Language Locale for Ukraine (latin)
+% Source: Re<U015F>at SABIQ
+% Contact: Re<U015F>at SABIQ
+% Email: <tilde.birlik@xxxxxxxxx>
% Language: crh
% Territory: UA
-% Revision: 0.3
-% Date: 2006-10-09
+% Revision: 0.4
+% Date: 2009-08-16
% Application: general
% Users: general
% Charset: UTF-8
@@ -16,17 +16,17 @@
% for commercial purposes.
LC_IDENTIFICATION
-title "Crimean Tatar language locale for Ukraine"
+title "Crimean Tatar (Crimean Turkish) language locale for Ukraine"
source ""
address ""
-contact "Reshat Sabiq (Re<U015F>at)"
-email "tatar.iqtelif.i18n@xxxxxxxxx"
+contact "Re<U015F>at SABIQ"
+email "tilde.birlik@xxxxxxxxx"
tel ""
fax ""
language "Crimean Tatar"
territory "Ukraine"
-revision "0.3"
-date "2006-10-09"
+revision "0.4"
+date "2009-08-16"
category crh_UA:2000;LC_IDENTIFICATION
category crh_UA:2000;LC_CTYPE
@@ -124,11 +124,10 @@
END LC_CTYPE
LC_MESSAGES
-% TODO: No is "yoq"; is it OK that it corresponds with English "yes"?
yesstr "<U0065><U0062><U0065><U0074>"
-nostr "<U0079><U006F><U0071>"
-yesexpr "<U005E><U005B><U0045><U0065><U005D><U002E><U002A>"
-noexpr "<U005E><U005B><U0059><U0079><U004E><U006E><U005D><U002E><U002A>"
+nostr "<U0068><U0061><U0079><U0131><U0072>"
+yesexpr "<U005E><U005B><U0079><U0059><U0065><U0045><U005D>"
+noexpr "<U005E><U005B><U006E><U004E><U0068><U0048><U005D>"
END LC_MESSAGES
LC_MONETARY
@@ -157,9 +156,9 @@
LC_TIME
day "<U0042><U0061><U007A><U0061><U0072>";/
- "<U0042><U0061><U007A><U0061><U0072><U0020><U0065><U0072><U0074><U0065><U0073><U0069>";/
+ "<U0042><U0061><U007A><U0061><U0072><U0065><U0072><U0074><U0065><U0073><U0069>";/
"<U0053><U0061><U006C><U0131>";/
- "<U00C7><U0061><U0072><U015F><U0065><U006E><U0062><U0065>";/
+ "<U00C7><U0061><U0072><U015F><U0065><U006D><U0062><U0065>";/
"<U0043><U0075><U006D><U0061><U0061><U0071><U015F><U0061><U006D><U0131>";/
"<U0043><U0075><U006D><U0061>";/
"<U0043><U0075><U006D><U0061><U0065><U0072><U0074><U0065><U0073><U0069>"
@@ -198,12 +197,14 @@
<U0020><U0025><U0059><U0020><U0025><U0054>"
d_fmt "<U0025><U0064><U002E><U0025><U006D><U002E><U0025><U0059>"
t_fmt "<U0025><U0054>"
-am_pm "<U00D6><U0041>";"<U00D6><U0053>"
+am_pm "<U00DC><U0045>";"<U00DC><U0053>"
t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/
<U0020><U0025><U0070>"
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
+first_weekday 2
+first_workday 2
END LC_TIME
LC_PAPER
Modified: fsf/trunk/libc/localedata/locales/en_US
==============================================================================
--- fsf/trunk/libc/localedata/locales/en_US (original)
+++ fsf/trunk/libc/localedata/locales/en_US Fri Oct 30 00:04:29 2009
@@ -132,6 +132,8 @@
LC_MESSAGES
yesexpr "<U005E><U005B><U0079><U0059><U005D><U002E><U002A>"
noexpr "<U005E><U005B><U006E><U004E><U005D><U002E><U002A>"
+yesstr "<U0059><U0065><U0073>"
+nostr "<U004E><U006F>"
END LC_MESSAGES
LC_PAPER
Modified: fsf/trunk/libc/localedata/locales/it_CH
==============================================================================
--- fsf/trunk/libc/localedata/locales/it_CH (original)
+++ fsf/trunk/libc/localedata/locales/it_CH Fri Oct 30 00:04:29 2009
@@ -97,9 +97,9 @@
t_fmt "<U0025><U0054>"
am_pm "";""
t_fmt_ampm ""
-date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
-<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
-<U0025><U005A><U0020><U0025><U0059>"
+date_fmt "<U0025><U0061><U0020><U0025><U0065><U0020><U0025>\
+<U0062><U0020><U0025><U0059><U002C><U0020><U0025><U0048><U002E>\
+<U0025><U004D><U002E><U0025><U0053><U002C><U0020><U0025><U005A>"
END LC_TIME
LC_PAPER
Modified: fsf/trunk/libc/localedata/locales/it_IT
==============================================================================
--- fsf/trunk/libc/localedata/locales/it_IT (original)
+++ fsf/trunk/libc/localedata/locales/it_IT Fri Oct 30 00:04:29 2009
@@ -121,9 +121,9 @@
t_fmt "<U0025><U0054>"
am_pm "";""
t_fmt_ampm ""
-date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
-<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
-<U0025><U005A><U0020><U0025><U0059>"
+date_fmt "<U0025><U0061><U0020><U0025><U0065><U0020><U0025>\
+<U0062><U0020><U0025><U0059><U002C><U0020><U0025><U0048><U002E>\
+<U0025><U004D><U002E><U0025><U0053><U002C><U0020><U0025><U005A>"
END LC_TIME
LC_PAPER
Modified: fsf/trunk/libc/login/utmp_file.c
==============================================================================
--- fsf/trunk/libc/login/utmp_file.c (original)
+++ fsf/trunk/libc/login/utmp_file.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2004, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2004, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>
and Paul Janzen <pcj@xxxxxxxxxxxx>, 1996.
@@ -45,7 +45,7 @@
/* Locking timeout. */
#ifndef TIMEOUT
-# define TIMEOUT 1
+# define TIMEOUT 10
#endif
/* Do-nothing handler for locking timeout. */
Modified: fsf/trunk/libc/malloc/malloc.c
==============================================================================
--- fsf/trunk/libc/malloc/malloc.c (original)
+++ fsf/trunk/libc/malloc/malloc.c Fri Oct 30 00:04:29 2009
@@ -6474,8 +6474,8 @@
fprintf (fp,
"<total type=\"fast\" count=\"%zu\" size=\"%zu\"/>\n"
"<total type=\"rest\" count=\"%zu\" size=\"%zu\"/>\n"
- "<system type=\"current\" size=\"%zu\n/>\n"
- "<system type=\"max\" size=\"%zu\n/>\n"
+ "<system type=\"current\" size=\"%zu\"/>\n"
+ "<system type=\"max\" size=\"%zu\"/>\n"
"<aspace type=\"total\" size=\"%zu\"/>\n"
"<aspace type=\"mprotect\" size=\"%zu\"/>\n"
"</malloc>\n",
Modified: fsf/trunk/libc/malloc/memusage.c
==============================================================================
--- fsf/trunk/libc/malloc/memusage.c (original)
+++ fsf/trunk/libc/malloc/memusage.c Fri Oct 30 00:04:29 2009
@@ -163,15 +163,16 @@
if (fd != -1)
{
uatomic32_t idx = catomic_exchange_and_add (&buffer_cnt, 1);
- if (idx >= 2 * buffer_size)
+ if (idx + 1 >= 2 * buffer_size)
{
/* We try to reset the counter to the correct range. If
this fails because of another thread increasing the
counter it does not matter since that thread will take
care of the correction. */
- uatomic32_t reset = idx % (2 * buffer_size);
- catomic_compare_and_exchange_val_acq (&buffer_cnt, reset, idx);
- idx = reset;
+ uatomic32_t reset = (idx + 1) % (2 * buffer_size);
+ catomic_compare_and_exchange_val_acq (&buffer_cnt, reset, idx + 1);
+ if (idx >= 2 * buffer_size)
+ idx = reset - 1;
}
assert (idx < 2 * DEFAULT_BUFFER_SIZE);
Modified: fsf/trunk/libc/malloc/memusagestat.c
==============================================================================
--- fsf/trunk/libc/malloc/memusagestat.c (original)
+++ fsf/trunk/libc/malloc/memusagestat.c Fri Oct 30 00:04:29 2009
@@ -191,37 +191,43 @@
maxsize_heap = headent[1].heap;
maxsize_stack = headent[1].stack;
maxsize_total = headent[0].stack;
+
+ if (maxsize_heap == 0 && maxsize_stack == 0)
+ {
+ /* The program aborted before memusage was able to write the
+ information about the maximum heap and stack use. Repair
+ the file now. */
+ struct entry next;
+
+ while (1)
+ {
+ if (read (fd, &next, sizeof (next)) == 0)
+ break;
+ if (next.heap > maxsize_heap)
+ maxsize_heap = next.heap;
+ if (next.stack > maxsize_stack)
+ maxsize_stack = next.stack;
+ if (maxsize_heap + maxsize_stack > maxsize_total)
+ maxsize_total = maxsize_heap + maxsize_stack;
+ }
+
+ headent[0].stack = maxsize_total;
+ headent[1].heap = maxsize_heap;
+ headent[1].stack = maxsize_stack;
+ headent[1].time_low = next.time_low;
+ headent[1].time_high = next.time_high;
+
+ /* Write the computed values in the file. */
+ lseek (fd, 0, SEEK_SET);
+ write (fd, headent, 2 * sizeof (struct entry));
+ }
+
if (also_total)
{
/* We use one scale and since we also draw the total amount of
memory used we have to adapt the maximum. */
maxsize_heap = maxsize_total;
maxsize_stack = maxsize_total;
- }
-
- if (maxsize_heap == 0 && maxsize_stack == 0)
- {
- /* The program aborted before memusage was able to write the
- information about the maximum heap and stack use. Repair
- the file now. */
- struct entry next;
-
- while (1)
- {
- if (read (fd, &next, sizeof (next)) == 0)
- break;
- if (next.heap > headent[1].heap)
- headent[1].heap = next.heap;
- if (next.stack > headent[1].stack)
- headent[1].stack = next.stack;
- }
-
- headent[1].time_low = next.time_low;
- headent[1].time_high = next.time_high;
-
- /* Write the computed values in the file. */
- lseek (fd, sizeof (struct entry), SEEK_SET);
- write (fd, &headent[1], sizeof (struct entry));
}
start_time = ((uint64_t) headent[0].time_high) << 32 | headent[0].time_low;
Modified: fsf/trunk/libc/nis/nss_nis/nis-grp.c
==============================================================================
--- fsf/trunk/libc/nis/nss_nis/nis-grp.c (original)
+++ fsf/trunk/libc/nis/nss_nis/nis-grp.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-1999, 2001-2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1999,2001-2004,2006,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@xxxxxxx>, 1996.
@@ -55,7 +55,7 @@
oldkeylen = 0;
}
- struct response_t *curr = intern.next;
+ struct response_t *curr = intern.start;
while (curr != NULL)
{
@@ -203,16 +203,17 @@
}
if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
- {
- free (result);
- *errnop = ERANGE;
- return NSS_STATUS_TRYAGAIN;
- }
+ {
+ if (!batch_read)
+ free (result);
+ *errnop = ERANGE;
+ return NSS_STATUS_TRYAGAIN;
+ }
char *p = strncpy (buffer, result, len);
buffer[len] = '\0';
while (isspace (*p))
- ++p;
+ ++p;
if (!batch_read)
free (result);
@@ -280,7 +281,7 @@
enum nss_status retval = yperr2nss (yperr);
if (retval == NSS_STATUS_TRYAGAIN)
- *errnop = errno;
+ *errnop = errno;
return retval;
}
@@ -329,7 +330,7 @@
enum nss_status retval = yperr2nss (yperr);
if (retval == NSS_STATUS_TRYAGAIN)
- *errnop = errno;
+ *errnop = errno;
return retval;
}
Modified: fsf/trunk/libc/nscd/aicache.c
==============================================================================
--- fsf/trunk/libc/nscd/aicache.c (original)
+++ fsf/trunk/libc/nscd/aicache.c Fri Oct 30 00:04:29 2009
@@ -453,13 +453,13 @@
{
assert (db->wr_fd != -1);
assert ((char *) &dataset->resp > (char *) db->data);
- assert ((char *) &dataset->resp - (char *) db->head + total
+ assert ((char *) dataset - (char *) db->head + total
<= (sizeof (struct database_pers_head)
+ db->head->module * sizeof (ref_t)
+ db->head->data_size));
ssize_t written;
written = sendfileall (fd, db->wr_fd, (char *) &dataset->resp
- - (char *) db->head, total);
+ - (char *) db->head, dataset->head.recsize);
# ifndef __ASSUME_SENDFILE
if (written == -1 && errno == ENOSYS)
goto use_write;
@@ -470,7 +470,7 @@
use_write:
# endif
#endif
- writeall (fd, &dataset->resp, total);
+ writeall (fd, &dataset->resp, dataset->head.recsize);
}
goto out;
Modified: fsf/trunk/libc/nscd/dbg_log.c
==============================================================================
--- fsf/trunk/libc/nscd/dbg_log.c (original)
+++ fsf/trunk/libc/nscd/dbg_log.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998, 2000, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (c) 1998, 2000, 2004, 2005, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@xxxxxxxxxxxxxxxxxxx>, 1998.
@@ -53,14 +53,23 @@
dbg_log (const char *fmt,...)
{
va_list ap;
- char msg[512], msg2[512];
+ char msg2[512];
va_start (ap, fmt);
- vsnprintf (msg2, sizeof (msg), fmt, ap);
+ vsnprintf (msg2, sizeof (msg2), fmt, ap);
if (debug_level > 0)
{
- snprintf (msg, sizeof (msg), "%d: %s%s", getpid (), msg2,
+ time_t t = time (NULL);
+
+ struct tm now;
+ localtime_r (&t, &now);
+
+ char buf[256];
+ strftime (buf, sizeof (buf), "%c", &now);
+
+ char msg[512];
+ snprintf (msg, sizeof (msg), "%s - %d: %s%s", buf, getpid (), msg2,
msg2[strlen (msg2) - 1] == '\n' ? "" : "\n");
if (dbgout)
{
Modified: fsf/trunk/libc/nscd/grpcache.c
==============================================================================
--- fsf/trunk/libc/nscd/grpcache.c (original)
+++ fsf/trunk/libc/nscd/grpcache.c Fri Oct 30 00:04:29 2009
@@ -295,14 +295,14 @@
{
assert (db->wr_fd != -1);
assert ((char *) &dataset->resp > (char *) db->data);
- assert ((char *) &dataset->resp - (char *) db->head
+ assert ((char *) dataset - (char *) db->head
+ total
<= (sizeof (struct database_pers_head)
+ db->head->module * sizeof (ref_t)
+ db->head->data_size));
written = sendfileall (fd, db->wr_fd,
(char *) &dataset->resp
- - (char *) db->head, total);
+ - (char *) db->head, dataset->head.recsize);
# ifndef __ASSUME_SENDFILE
if (written == -1 && errno == ENOSYS)
goto use_write;
@@ -313,7 +313,7 @@
use_write:
# endif
#endif
- written = writeall (fd, &dataset->resp, total);
+ written = writeall (fd, &dataset->resp, dataset->head.recsize);
}
/* Add the record to the database. But only if it has not been
Modified: fsf/trunk/libc/nscd/hstcache.c
==============================================================================
--- fsf/trunk/libc/nscd/hstcache.c (original)
+++ fsf/trunk/libc/nscd/hstcache.c Fri Oct 30 00:04:29 2009
@@ -337,7 +337,7 @@
{
assert (db->wr_fd != -1);
assert ((char *) &dataset->resp > (char *) db->data);
- assert ((char *) &dataset->resp - (char *) db->head
+ assert ((char *) dataset - (char *) db->head
+ total
<= (sizeof (struct database_pers_head)
+ db->head->module * sizeof (ref_t)
Modified: fsf/trunk/libc/nscd/initgrcache.c
==============================================================================
--- fsf/trunk/libc/nscd/initgrcache.c (original)
+++ fsf/trunk/libc/nscd/initgrcache.c Fri Oct 30 00:04:29 2009
@@ -350,14 +350,14 @@
{
assert (db->wr_fd != -1);
assert ((char *) &dataset->resp > (char *) db->data);
- assert ((char *) &dataset->resp - (char *) db->head
+ assert ((char *) dataset - (char *) db->head
+ total
<= (sizeof (struct database_pers_head)
+ db->head->module * sizeof (ref_t)
+ db->head->data_size));
written = sendfileall (fd, db->wr_fd,
(char *) &dataset->resp
- - (char *) db->head, total);
+ - (char *) db->head, dataset->head.recsize);
# ifndef __ASSUME_SENDFILE
if (written == -1 && errno == ENOSYS)
goto use_write;
@@ -368,7 +368,7 @@
use_write:
# endif
#endif
- written = writeall (fd, &dataset->resp, total);
+ written = writeall (fd, &dataset->resp, dataset->head.recsize);
}
Modified: fsf/trunk/libc/nscd/pwdcache.c
==============================================================================
--- fsf/trunk/libc/nscd/pwdcache.c (original)
+++ fsf/trunk/libc/nscd/pwdcache.c Fri Oct 30 00:04:29 2009
@@ -290,14 +290,14 @@
{
assert (db->wr_fd != -1);
assert ((char *) &dataset->resp > (char *) db->data);
- assert ((char *) &dataset->resp - (char *) db->head
+ assert ((char *) dataset - (char *) db->head
+ total
<= (sizeof (struct database_pers_head)
+ db->head->module * sizeof (ref_t)
+ db->head->data_size));
written = sendfileall (fd, db->wr_fd,
(char *) &dataset->resp
- - (char *) db->head, total);
+ - (char *) db->head, dataset->head.recsize );
# ifndef __ASSUME_SENDFILE
if (written == -1 && errno == ENOSYS)
goto use_write;
@@ -308,7 +308,7 @@
use_write:
# endif
#endif
- written = writeall (fd, &dataset->resp, total);
+ written = writeall (fd, &dataset->resp, dataset->head.recsize);
}
Modified: fsf/trunk/libc/nss/nss_files/files-hosts.c
==============================================================================
--- fsf/trunk/libc/nss/nss_files/files-hosts.c (original)
+++ fsf/trunk/libc/nss/nss_files/files-hosts.c Fri Oct 30 00:04:29 2009
@@ -1,5 +1,5 @@
/* Hosts file parser in nss_files module.
- Copyright (C) 1996-2001, 2003-2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1996-2001, 2003-2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -423,6 +423,11 @@
if (! keep_stream)
internal_endent ();
}
+ else
+ {
+ *errnop = errno;
+ *herrnop = NO_DATA;
+ }
__libc_lock_unlock (lock);
Modified: fsf/trunk/libc/resolv/res_send.c
==============================================================================
--- fsf/trunk/libc/resolv/res_send.c (original)
+++ fsf/trunk/libc/resolv/res_send.c Fri Oct 30 00:04:29 2009
@@ -219,33 +219,33 @@
{
int ns;
- if (inp->sin6_family == AF_INET) {
- struct sockaddr_in *in4p = (struct sockaddr_in *) inp;
+ if (inp->sin6_family == AF_INET) {
+ struct sockaddr_in *in4p = (struct sockaddr_in *) inp;
in_port_t port = in4p->sin_port;
in_addr_t addr = in4p->sin_addr.s_addr;
- for (ns = 0; ns < MAXNS; ns++) {
- const struct sockaddr_in *srv =
+ for (ns = 0; ns < MAXNS; ns++) {
+ const struct sockaddr_in *srv =
(struct sockaddr_in *)EXT(statp).nsaddrs[ns];
- if ((srv != NULL) && (srv->sin_family == AF_INET) &&
- (srv->sin_port == port) &&
- (srv->sin_addr.s_addr == INADDR_ANY ||
- srv->sin_addr.s_addr == addr))
- return (1);
- }
- } else if (inp->sin6_family == AF_INET6) {
- for (ns = 0; ns < MAXNS; ns++) {
- const struct sockaddr_in6 *srv = EXT(statp).nsaddrs[ns];
- if ((srv != NULL) && (srv->sin6_family == AF_INET6) &&
- (srv->sin6_port == inp->sin6_port) &&
- !(memcmp(&srv->sin6_addr, &in6addr_any,
- sizeof (struct in6_addr)) &&
- memcmp(&srv->sin6_addr, &inp->sin6_addr,
- sizeof (struct in6_addr))))
- return (1);
- }
- }
+ if ((srv != NULL) && (srv->sin_family == AF_INET) &&
+ (srv->sin_port == port) &&
+ (srv->sin_addr.s_addr == INADDR_ANY ||
+ srv->sin_addr.s_addr == addr))
+ return (1);
+ }
+ } else if (inp->sin6_family == AF_INET6) {
+ for (ns = 0; ns < MAXNS; ns++) {
+ const struct sockaddr_in6 *srv = EXT(statp).nsaddrs[ns];
+ if ((srv != NULL) && (srv->sin6_family == AF_INET6) &&
+ (srv->sin6_port == inp->sin6_port) &&
+ !(memcmp(&srv->sin6_addr, &in6addr_any,
+ sizeof (struct in6_addr)) &&
+ memcmp(&srv->sin6_addr, &inp->sin6_addr,
+ sizeof (struct in6_addr))))
+ return (1);
+ }
+ }
return (0);
}
@@ -445,7 +445,7 @@
malloc(sizeof (struct sockaddr_in6));
if (EXT(statp).nsaddrs[n] != NULL) {
memset (mempcpy(EXT(statp).nsaddrs[n],
- &statp->nsaddr_list[ns],
+ &statp->nsaddr_list[n],
sizeof (struct sockaddr_in)),
'\0',
sizeof (struct sockaddr_in6)
@@ -1003,9 +1003,10 @@
int orig_anssizp = *anssizp;
struct timespec now, timeout, finish;
struct pollfd pfd[1];
- int ptimeout;
+ int ptimeout;
struct sockaddr_in6 from;
- int resplen, n;
+ int resplen = 0;
+ int n;
/*
* Compute time for the total operation.
@@ -1050,7 +1051,7 @@
evSubTime(&timeout, &finish, &now);
need_recompute = 0;
}
- /* Convert struct timespec in milliseconds. */
+ /* Convert struct timespec in milliseconds. */
ptimeout = timeout.tv_sec * 1000 + timeout.tv_nsec / 1000000;
n = 0;
@@ -1244,7 +1245,7 @@
/* record the error */
statp->_flags |= RES_F_EDNS0ERR;
goto err_out;
- }
+ }
#endif
if (!(statp->options & RES_INSECURE2)
&& (recvresp1 || !res_queriesmatch(buf, buf + buflen,
Modified: fsf/trunk/libc/sysdeps/generic/netinet/ip.h
==============================================================================
--- fsf/trunk/libc/sysdeps/generic/netinet/ip.h (original)
+++ fsf/trunk/libc/sysdeps/generic/netinet/ip.h Fri Oct 30 00:04:29 2009
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,92,93,95,96,97,98,99,2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,95,96,97,98,99,2000,2009 Free Software
+ Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -153,6 +154,41 @@
#define IP_MAXPACKET 65535 /* maximum packet size */
/*
+ * Definitions for Explicit Congestion Notification (ECN)
+ *
+ * Taken from RFC-3168, Section 5.
+ */
+
+#define IPTOS_ECN_MASK 0x03
+#define IPTOS_ECN(x) ((x) & IPTOS_ECN_MASK)
+#define IPTOS_ECN_NOT_ECT 0x00
+#define IPTOS_ECN_ECT1 0x01
+#define IPTOS_ECN_ECT0 0x02
+#define IPTOS_ECN_CE 0x03
+
+/*
+ * Definitions for IP differentiated services code points (DSCP)
+ *
+ * Taken from RFC-2597, Section 6 and RFC-2598, Section 2.3.
+ */
+
+#define IPTOS_DSCP_MASK 0xfc
+#define IPTOS_DSCP(x) ((x) & IPTOS_DSCP_MASK)
+#define IPTOS_DSCP_AF11 0x28
+#define IPTOS_DSCP_AF12 0x30
+#define IPTOS_DSCP_AF13 0x38
+#define IPTOS_DSCP_AF21 0x48
+#define IPTOS_DSCP_AF22 0x50
+#define IPTOS_DSCP_AF23 0x58
+#define IPTOS_DSCP_AF31 0x68
+#define IPTOS_DSCP_AF32 0x70
+#define IPTOS_DSCP_AF33 0x78
+#define IPTOS_DSCP_AF41 0x88
+#define IPTOS_DSCP_AF42 0x90
+#define IPTOS_DSCP_AF43 0x98
+#define IPTOS_DSCP_EF 0xb8
+
+/*
* Definitions for IP type of service (ip_tos)
*/
#define IPTOS_TOS_MASK 0x1E
Modified: fsf/trunk/libc/sysdeps/gnu/getutmp.c
==============================================================================
--- fsf/trunk/libc/sysdeps/gnu/getutmp.c (original)
+++ fsf/trunk/libc/sysdeps/gnu/getutmp.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,10 +19,12 @@
#include <assert.h>
#include <string.h>
#include <utmp.h>
+#ifndef _UTMPX_H
/* This is an ugly hack but we must not see the getutmpx declaration. */
-#define getutmpx XXXgetutmpx
-#include <utmpx.h>
-#undef getutmpx
+# define getutmpx XXXgetutmpx
+# include <utmpx.h>
+# undef getutmpx
+#endif
void
getutmp (const struct utmpx *utmpx, struct utmp *utmp)
Modified: fsf/trunk/libc/sysdeps/pthread/aio_misc.c
==============================================================================
--- fsf/trunk/libc/sysdeps/pthread/aio_misc.c (original)
+++ fsf/trunk/libc/sysdeps/pthread/aio_misc.c Fri Oct 30 00:04:29 2009
@@ -1,5 +1,5 @@
/* Handle general operations.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2006, 2007
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2006, 2007, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -372,9 +372,13 @@
/* Simply enqueue it after the running one according to the
priority. */
+ last = NULL;
while (runp->next_prio != NULL
&& runp->next_prio->aiocbp->aiocb.__abs_prio >= prio)
- runp = runp->next_prio;
+ {
+ last = runp;
+ runp = runp->next_prio;
+ }
newp->next_prio = runp->next_prio;
runp->next_prio = newp;
@@ -403,6 +407,7 @@
}
newp->next_prio = NULL;
+ last = NULL;
}
if (running == yes)
@@ -423,7 +428,8 @@
running = newp->running = allocated;
/* Now try to start a thread. */
- if (aio_create_helper_thread (&thid, handle_fildes_io, newp) == 0)
+ result = aio_create_helper_thread (&thid, handle_fildes_io, newp);
+ if (result == 0)
/* We managed to enqueue the request. All errors which can
happen now can be recognized by calls to `aio_return' and
`aio_error'. */
@@ -434,10 +440,14 @@
running = newp->running = yes;
if (nthreads == 0)
- /* We cannot create a thread in the moment and there is
- also no thread running. This is a problem. `errno' is
- set to EAGAIN if this is only a temporary problem. */
- result = -1;
+ {
+ /* We cannot create a thread in the moment and there is
+ also no thread running. This is a problem. `errno' is
+ set to EAGAIN if this is only a temporary problem. */
+ __aio_remove_request (last, newp, 0);
+ }
+ else
+ result = 0;
}
}
}
@@ -459,6 +469,8 @@
{
/* Something went wrong. */
__aio_free_request (newp);
+ aiocbp->aiocb.__error_code = result;
+ __set_errno (result);
newp = NULL;
}
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/faccessat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/faccessat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/faccessat.c Fri Oct 30 00:04:29 2009
@@ -1,5 +1,5 @@
/* Test for access to file, relative to open directory. Linux version.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -72,6 +72,12 @@
if (fd != AT_FDCWD && file[0] != '/')
{
size_t filelen = strlen (file);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/fchmodat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/fchmodat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/fchmodat.c Fri Oct 30 00:04:29 2009
@@ -1,5 +1,5 @@
/* Change the protections of file relative to open directory. Linux version.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -71,6 +71,12 @@
if (fd != AT_FDCWD && file[0] != '/')
{
size_t filelen = strlen (file);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/fchownat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/fchownat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/fchownat.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -66,6 +66,12 @@
if (fd != AT_FDCWD && file[0] != '/')
{
size_t filelen = strlen (file);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/fcntl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/fcntl.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/fcntl.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002, 2003, 2004, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,6 +23,40 @@
#include <stdarg.h>
#include <sys/syscall.h>
+#include <kernel-features.h>
+
+
+#ifdef __ASSUME_F_GETOWN_EX
+# define miss_F_GETOWN_EX 0
+#else
+static int miss_F_GETOWN_EX;
+#endif
+
+
+static int
+do_fcntl (int fd, int cmd, void *arg)
+{
+ if (cmd != F_GETOWN || miss_F_GETOWN_EX)
+ return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+
+ INTERNAL_SYSCALL_DECL (err);
+ struct f_owner_ex fex;
+ int res = INTERNAL_SYSCALL (fcntl, err, 3, fd, F_GETOWN_EX, &fex);
+ if (!INTERNAL_SYSCALL_ERROR_P (res, err))
+ return fex.type == F_OWNER_GID ? -fex.pid : fex.pid;
+
+#ifndef __ASSUME_F_GETOWN_EX
+ if (INTERNAL_SYSCALL_ERRNO (res, err) == EINVAL)
+ {
+ res = INLINE_SYSCALL (fcntl, 3, fd, F_GETOWN, arg);
+ miss_F_GETOWN_EX = 1;
+ return res;
+ }
+#endif
+
+ __set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
+ return -1;
+}
#ifndef NO_CANCELLATION
@@ -36,7 +70,7 @@
arg = va_arg (ap, void *);
va_end (ap);
- return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+ return do_fcntl (fd, cmd, arg);
}
#endif
@@ -52,11 +86,11 @@
va_end (ap);
if (SINGLE_THREAD_P || cmd != F_SETLKW)
- return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+ return do_fcntl (fd, cmd, arg);
int oldtype = LIBC_CANCEL_ASYNC ();
- int result = INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+ int result = do_fcntl (fd, cmd, arg);
LIBC_CANCEL_RESET (oldtype);
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/futimesat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/futimesat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/futimesat.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -76,6 +76,12 @@
else if (fd != AT_FDCWD && file[0] != '/')
{
size_t filelen = strlen (file);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/fxstatat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/fxstatat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/fxstatat.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -85,6 +85,12 @@
if (fd != AT_FDCWD && file[0] != '/')
{
size_t filelen = strlen (file);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/fxstatat64.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/fxstatat64.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/fxstatat64.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -90,6 +90,12 @@
if (fd != AT_FDCWD && file[0] != '/')
{
size_t filelen = strlen (file);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/getpt.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/getpt.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/getpt.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2001, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Zack Weinberg <zack@xxxxxxxxxxxxxxxxxxxxxx>, 1998.
@@ -64,9 +64,10 @@
}
/* If /dev/pts is not mounted then the UNIX98 pseudo terminals
- are not usable. */
+ are not usable. */
__close (fd);
have_no_dev_ptmx = 1;
+ __set_errno (ENOENT);
}
else
{
@@ -76,6 +77,8 @@
return -1;
}
}
+ else
+ __set_errno (ENOENT);
return -1;
}
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h Fri Oct 30 00:04:29 2009
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007
+ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -168,6 +168,23 @@
};
#endif
+#ifdef __USE_GNU
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_GID /* Process group. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
+ };
+#endif
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
#ifdef __USE_BSD
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fchownat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fchownat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fchownat.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -63,6 +63,12 @@
if (fd != AT_FDCWD && file[0] != '/')
{
size_t filelen = strlen (file);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fcntl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fcntl.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fcntl.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000,2002,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000,2002,2003,2004,2006,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,6 +29,13 @@
/* This variable is shared with all files that check for fcntl64. */
int __have_no_fcntl64;
#endif
+
+#ifdef __ASSUME_F_GETOWN_EX
+# define miss_F_GETOWN_EX 0
+#else
+static int miss_F_GETOWN_EX;
+#endif
+
#if defined NO_CANCELLATION && __ASSUME_FCNTL64 == 0
# define __fcntl_nocancel __libc_fcntl
@@ -119,6 +126,26 @@
assert (F_SETLK - F_SETLKW == F_SETLK64 - F_SETLKW64);
return INLINE_SYSCALL (fcntl, 3, fd, cmd + F_SETLK - F_SETLK64, &fl);
}
+ case F_GETOWN:
+ if (! miss_F_GETOWN_EX)
+ {
+ INTERNAL_SYSCALL_DECL (err);
+ struct f_owner_ex fex;
+ int res = INTERNAL_SYSCALL (fcntl, err, 3, fd, F_GETOWN_EX, &fex);
+ if (!INTERNAL_SYSCALL_ERROR_P (res, err))
+ return fex.type == F_OWNER_GID ? -fex.pid : fex.pid;
+
+#ifndef __ASSUME_F_GETOWN_EX
+ if (INTERNAL_SYSCALL_ERRNO (res, err) == EINVAL)
+ miss_F_GETOWN_EX = 1;
+ else
+#endif
+ {
+ __set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
+ return -1;
+ }
+ }
+ /* FALLTHROUGH */
default:
return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
}
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fxstatat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fxstatat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fxstatat.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -86,6 +86,12 @@
if (fd != AT_FDCWD && file[0] != '/')
{
size_t filelen = strlen (file);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h Fri Oct 30 00:04:29 2009
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/IA64.
- Copyright (C) 1999, 2000, 2004, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1999,2000,2004,2006,2007,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -161,6 +161,23 @@
};
#endif
+#ifdef __USE_GNU
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_GID /* Process group. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
+ };
+#endif
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/siginfo.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/siginfo.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/siginfo.h Fri Oct 30 00:04:29 2009
@@ -1,5 +1,5 @@
/* siginfo_t, sigevent and constants. Linux/ia64 version.
- Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000-2004, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@xxxxxxxxxx>.
@@ -310,6 +310,10 @@
{
int _pad[__SIGEV_PAD_SIZE];
+ /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
+ thread to receive the signal. */
+ __pid_t _tid;
+
struct
{
void (*_function) (sigval_t); /* Function to start. */
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h Fri Oct 30 00:04:29 2009
@@ -542,3 +542,8 @@
# define __ASSUME_PREADV 1
# define __ASSUME_PWRITEV 1
#endif
+
+/* Support for F_GETOWN_EX was introduced in 2.6.32. */
+#if __LINUX_KERNEL_VERSION >= 0x020620
+# define __ASSUME_F_GETOWN_EX 1
+#endif
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/linkat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/linkat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/linkat.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -66,6 +66,12 @@
if (fromfd != AT_FDCWD && from[0] != '/')
{
size_t filelen = strlen (from);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
- the file descriptor number
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/mkdirat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/mkdirat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/mkdirat.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -57,6 +57,12 @@
if (fd != AT_FDCWD && file[0] != '/')
{
size_t filelen = strlen (file);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/openat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/openat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/openat.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -110,6 +110,12 @@
if (fd != AT_FDCWD && file[0] != '/')
{
size_t filelen = strlen (file);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h Fri Oct 30 00:04:29 2009
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/PowerPC.
- Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007
+ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -168,6 +168,23 @@
};
#endif
+#ifdef __USE_GNU
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_GID /* Process group. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
+ };
+#endif
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
#ifdef __USE_BSD
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/fchownat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/fchownat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/fchownat.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -66,6 +66,12 @@
if (fd != AT_FDCWD && file[0] != '/')
{
size_t filelen = strlen (file);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/readlinkat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/readlinkat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/readlinkat.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -59,6 +59,12 @@
if (fd != AT_FDCWD && path[0] != '/')
{
size_t pathlen = strlen (path);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/renameat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/renameat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/renameat.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -135,6 +135,12 @@
if (oldfd != AT_FDCWD && old[0] != '/')
{
size_t filelen = strlen (old);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
- the file descriptor number
@@ -154,6 +160,12 @@
if (newfd != AT_FDCWD && new[0] != '/')
{
size_t filelen = strlen (new);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
- the file descriptor number
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h Fri Oct 30 00:04:29 2009
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 2000,2001,2002,2004,2006,2007 Free Software Foundation, Inc.
+ Copyright (C) 2000,2001,2002,2004,2006,2007,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -183,6 +183,23 @@
};
#endif
+#ifdef __USE_GNU
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_GID /* Process group. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
+ };
+#endif
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
#ifdef __USE_BSD
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/siginfo.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/siginfo.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/siginfo.h Fri Oct 30 00:04:29 2009
@@ -1,5 +1,5 @@
/* siginfo_t, sigevent and constants. S/390 version.
- Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,7 +26,7 @@
#if (!defined __have_sigval_t \
&& (defined _SIGNAL_H || defined __need_siginfo_t \
- || defined __need_sigevent_t))
+ || defined __need_sigevent_t))
# define __have_sigval_t 1
/* Type for data associated with a signal. */
@@ -96,7 +96,7 @@
struct
{
void *si_addr; /* Faulting insn/memory ref. */
- int si_trapno;
+ int si_trapno;
} _sigfault;
/* SIGPOLL. */
@@ -282,6 +282,10 @@
{
int _pad[__SIGEV_PAD_SIZE];
+ /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
+ thread to receive the signal. */
+ __pid_t _tid;
+
struct
{
void (*_function) (sigval_t); /* Function to start. */
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h Fri Oct 30 00:04:29 2009
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007
+ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -168,6 +168,23 @@
};
#endif
+#ifdef __USE_GNU
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_GID /* Process group. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
+ };
+#endif
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
#ifdef __USE_BSD
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h Fri Oct 30 00:04:29 2009
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/SPARC.
- Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007
+ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -184,6 +184,23 @@
__off64_t l_len; /* Size of the locked area; zero means until EOF. */
__pid_t l_pid; /* Process holding the lock. */
short int __unused;
+ };
+#endif
+
+#ifdef __USE_GNU
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_GID /* Process group. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
};
#endif
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/symlinkat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/symlinkat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/symlinkat.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -57,6 +57,12 @@
if (tofd != AT_FDCWD && to[0] != '/')
{
size_t tolen = strlen (to);
+ if (__builtin_expect (tolen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/ttyname.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/ttyname.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/ttyname.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,93,1996-2002,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,1996-2002,2006,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -58,6 +58,11 @@
*dostat = -1;
return NULL;
}
+
+ /* Prepare for the loop. If we already have a buffer copy the directory
+ name we look at into it. */
+ if (devlen < namelen)
+ *((char *) __mempcpy (getttyname_name, dev, devlen - 1)) = '/';
while ((d = __readdir64 (dirstream)) != NULL)
if ((d->d_fileno == myino || *dostat)
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/unlinkat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/unlinkat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/unlinkat.c Fri Oct 30 00:04:29 2009
@@ -1,5 +1,5 @@
/* unlinkat -- Remove a link by relative name.
- Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -64,6 +64,12 @@
if (fd != AT_FDCWD && file[0] != '/')
{
size_t filelen = strlen (file);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -72,6 +72,12 @@
if (fd != AT_FDCWD && file[0] != '/')
{
size_t filelen = strlen (file);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h Fri Oct 30 00:04:29 2009
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/x86-64.
- Copyright (C) 2001, 2002, 2004, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2001,2002,2004,2006,2007,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -182,6 +182,23 @@
};
#endif
+#ifdef __USE_GNU
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_GID /* Process group. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
+ };
+#endif
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
#ifdef __USE_BSD
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/xmknodat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/xmknodat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/xmknodat.c Fri Oct 30 00:04:29 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -72,6 +72,12 @@
if (fd != AT_FDCWD && file[0] != '/')
{
size_t filelen = strlen (file);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/