OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1292 lines
47 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../glibc/glibc-2.11.3-branch-update-26-gb72646a.patch
  5. # Copyright (C) 2011 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. diff --git a/ChangeLog b/ChangeLog
  17. index 49dcad6..3d76b4d 100644
  18. --- a/ChangeLog
  19. +++ b/ChangeLog
  20. @@ -1,3 +1,131 @@
  21. +2011-02-02 Ulrich Drepper <drepper@gmail.com>
  22. +
  23. + * elf/dl-runtime.c (_dl_call_pltexit): Pass correct address of the
  24. + function to the callback.
  25. + Patch partly by Jiri Olsa <jolsa@redhat.com>.
  26. +
  27. +2011-02-02 Andreas Schwab <schwab@redhat.com>
  28. +
  29. + * shadow/sgetspent.c: Check return value of __sgetspent_r instead
  30. + of errno.
  31. +
  32. +2010-10-01 Andreas Schwab <schwab@redhat.com>
  33. +
  34. + * sysdeps/posix/getaddrinfo.c (gaih_inet): Don't discard result of
  35. + decoding ACE if AI_CANONIDN.
  36. +
  37. +2011-01-17 Ulrich Drepper <drepper@gmail.com>
  38. +
  39. + * io/fcntl.h: Define AT_NO_AUTOMOUNT.
  40. +
  41. + * sysdeps/unix/sysv/linux/i386/bits/mman.h: Define MADV_HUGEPAGE and
  42. + MADV_NOHUGEPAGE.
  43. + * sysdeps/unix/sysv/linux/ia64/bits/mman.h: Likewise.
  44. + * sysdeps/unix/sysv/linux/powerpc/bits/mman.h: Likewise.
  45. + * sysdeps/unix/sysv/linux/s390/bits/mman.h: Likewise.
  46. + * sysdeps/unix/sysv/linux/sh/bits/mman.h: Likewise.
  47. + * sysdeps/unix/sysv/linux/sparc/bits/mman.h: Likewise.
  48. + * sysdeps/unix/sysv/linux/x86_64/bits/mman.h: Likewise.
  49. +
  50. + * sysdeps/unix/sysv/linux/bits/socket.h: Define AF_CAIF, AF_ALG,
  51. + PF_CAIF, and PF_ALG.
  52. + * sysdeps/unix/sysv/linux/sparc/bits/socket.h: Likewise.
  53. +
  54. +2011-01-15 Ulrich Drepper <drepper@gmail.com>
  55. +
  56. + [BZ #6812]
  57. + * nscd/hstcache.c (tryagain): Define.
  58. + (cache_addhst): Return tryagain not notfound for temporary errors.
  59. + (addhstbyX): Also set h_errno to TRY_AGAIN when memory allocation
  60. + failed.
  61. +
  62. +2011-01-13 Ulrich Drepper <drepper@gmail.com>
  63. +
  64. + [BZ #12397]
  65. + * sysdeps/unix/sysv/linux/mkdirat.c (mkdirat): Fix handling of missing
  66. + syscall.
  67. +
  68. + [BZ #10484]
  69. + * nss/nss_files/files-hosts.c (HOST_DB_LOOKUP): Handle overflows of
  70. + temporary buffer used to handle multi lookups locally.
  71. + * include/alloca.h: Add libc_hidden_proto for __libc_alloca_cutoff.
  72. +
  73. +2011-01-12 Ulrich Drepper <drepper@gmail.com>
  74. +
  75. + * elf/dl-dst.h (DL_DST_REQUIRED): Allow l_origin to be NULL when
  76. + loader is ld.so.
  77. +
  78. +2010-03-12 Andreas Schwab <schwab@redhat.com>
  79. +
  80. + * elf/dl-dst.h: Include "trusted-dirs.h".
  81. + (DL_DST_REQUIRED): Take $LIB into account.
  82. +
  83. +2011-01-10 Paul Pluzhnikov <ppluzhnikov@google.com>
  84. +
  85. + * sysdeps/i386/Makefile: stdlib/cxa_finalize.c needs 16-byte stack
  86. + alignment for SSE2.
  87. +
  88. +2011-01-12 Ulrich Drepper <drepper@gmail.com>
  89. +
  90. + [BZ #12394]
  91. + * stdio-common/printf_fp.c (__printf_fp): Add more room for grouping
  92. + characters. When rounding increased number of integer digits recompute
  93. + number of groups.
  94. + * stdio-common/tst-grouping.c: New file.
  95. + * stdio-common/Makefile: Add rules to build and run tst-grouping.
  96. +
  97. +2011-01-04 David S. Miller <davem@sunset.davemloft.net>
  98. +
  99. + [BZ #11155]
  100. + * sysdeps/unix/sysv/linux/sparc/sparc64/fxstat.c: Use i386's
  101. + implementation just like for lxstat, fxstatat, et al.
  102. +
  103. +2010-12-27 Jim Meyering <meyering@redhat.com>
  104. +
  105. + [BZ #12348]
  106. + * posix/regexec.c (build_trtable): Return failure indication upon
  107. + calloc failure. Otherwise, re_search_internal could infloop on OOM.
  108. +
  109. +2010-12-25 Ulrich Drepper <drepper@gmail.com>
  110. +
  111. + [BZ #12207]
  112. + * malloc/malloc.c (do_check_malloc_state): Use fastbin macro.
  113. +
  114. +2010-12-19 Ulrich Drepper <drepper@gmail.com>
  115. +
  116. + * sysdeps/unix/readdir_r.c (__READDIR_R): Compute reclen more
  117. + accurately.
  118. + * sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Define
  119. + GETDENTS_64BIT_ALIGNED.
  120. +
  121. +2010-12-10 Andreas Schwab <schwab@redhat.com>
  122. +
  123. + * wcsmbs/wchar.h (wcpcpy, wcpncpy): Add __restrict.
  124. + * wcsmbs/bits/wchar2.h (__wmemmove_chk_warn, wmemmove, wmemset):
  125. + Remove __restrict.
  126. + (wcscpy, __wcpcpy_chk, __wcpcpy_alias, wcpcpy, wcsncpy, wcpncpy)
  127. + (wcscat, wcsncat, __wcrtomb_chk, wcrtomb): Add __restrict.
  128. +
  129. +2010-12-09 Ulrich Drepper <drepper@gmail.com>
  130. +
  131. + [BZ #11655]
  132. + * stdlib/msort.c (qsort_r): Make sure both phys_pages and pagesize
  133. + are initialized.
  134. +
  135. +2010-12-09 Jakub Jelinek <jakub@redhat.com>
  136. +
  137. + * string/bits/string3.h (memmove, bcopy): Remove __restrict.
  138. +
  139. +2010-11-30 Ulrich Drepper <drepper@gmail.com>
  140. +
  141. + * sysdeps/i386/fpu/libm-test-ulps: Relax ynf(10,0.75) test expectations.
  142. +
  143. +2010-11-24 Andreas Schwab <schwab@redhat.com>
  144. +
  145. + * resolv/nss_dns/dns-host.c (getanswer_r): Don't handle ttl == 0
  146. + specially.
  147. + (gaih_getanswer_slice): Likewise.
  148. +
  149. 2010-05-31 Petr Baudis <pasky@suse.cz>
  150. [BZ #11149]
  151. diff --git a/elf/dl-dst.h b/elf/dl-dst.h
  152. index 76076a6..9d219e2 100644
  153. --- a/elf/dl-dst.h
  154. +++ b/elf/dl-dst.h
  155. @@ -1,6 +1,5 @@
  156. /* Handling of dynamic sring tokens.
  157. - Copyright (C) 1999,2001,2002,2003,2004,2006,2007
  158. - Free Software Foundation, Inc.
  159. + Copyright (C) 1999,2001-2004,2006,2007,2011 Free Software Foundation, Inc.
  160. This file is part of the GNU C Library.
  161. The GNU C Library is free software; you can redistribute it and/or
  162. @@ -18,6 +17,8 @@
  163. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  164. 02111-1307 USA. */
  165. +#include "trusted-dirs.h"
  166. +
  167. /* Determine the number of DST elements in the name. Only if IS_PATH is
  168. nonzero paths are recognized (i.e., multiple, ':' separated filenames). */
  169. #define DL_DST_COUNT(name, is_path) \
  170. @@ -31,6 +32,11 @@
  171. __cnt; })
  172. +#ifdef SHARED
  173. +# define IS_RTLD(l) (l) == &GL(dl_rtld_map)
  174. +#else
  175. +# define IS_RTLD(l) 0
  176. +#endif
  177. /* Guess from the number of DSTs the length of the result string. */
  178. #define DL_DST_REQUIRED(l, name, len, cnt) \
  179. ({ \
  180. @@ -39,28 +45,32 @@
  181. \
  182. if (__cnt > 0) \
  183. { \
  184. - size_t origin_len; \
  185. + size_t dst_len; \
  186. /* Now we make a guess how many extra characters on top of the \
  187. length of S we need to represent the result. We know that \
  188. we have CNT replacements. Each at most can use \
  189. - MAX (strlen (ORIGIN), strlen (_dl_platform)) \
  190. - minus 7 (which is the length of "$ORIGIN"). \
  191. + MAX (MAX (strlen (ORIGIN), strlen (_dl_platform)), \
  192. + strlen (DL_DST_LIB)) \
  193. + minus 4 (which is the length of "$LIB"). \
  194. \
  195. First get the origin string if it is not available yet. \
  196. - This can only happen for the map of the executable. */ \
  197. + This can only happen for the map of the executable or, when \
  198. + auditing, in ld.so. */ \
  199. DL_DST_REQ_STATIC (l) \
  200. if ((l)->l_origin == NULL) \
  201. { \
  202. - assert ((l)->l_name[0] == '\0'); \
  203. + assert ((l)->l_name[0] == '\0' || IS_RTLD (l)); \
  204. (l)->l_origin = _dl_get_origin (); \
  205. - origin_len = ((l)->l_origin && (l)->l_origin != (char *) -1 \
  206. + dst_len = ((l)->l_origin && (l)->l_origin != (char *) -1 \
  207. ? strlen ((l)->l_origin) : 0); \
  208. } \
  209. else \
  210. - origin_len = (l)->l_origin == (char *) -1 \
  211. + dst_len = (l)->l_origin == (char *) -1 \
  212. ? 0 : strlen ((l)->l_origin); \
  213. - \
  214. - __len += __cnt * (MAX (origin_len, GLRO(dl_platformlen)) - 7); \
  215. + dst_len = MAX (MAX (dst_len, GLRO(dl_platformlen)), \
  216. + strlen (DL_DST_LIB)); \
  217. + if (dst_len > 4) \
  218. + __len += __cnt * (dst_len - 4); \
  219. } \
  220. \
  221. __len; })
  222. @@ -72,7 +82,7 @@
  223. if ((l) == NULL) \
  224. { \
  225. const char *origin = _dl_get_origin (); \
  226. - origin_len = (origin && origin != (char *) -1 ? strlen (origin) : 0); \
  227. + dst_len = (origin && origin != (char *) -1 ? strlen (origin) : 0); \
  228. } \
  229. else
  230. #endif
  231. diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c
  232. index 6847eda..ae2d05c 100644
  233. --- a/elf/dl-runtime.c
  234. +++ b/elf/dl-runtime.c
  235. @@ -1,5 +1,5 @@
  236. /* On-demand PLT fixup for shared objects.
  237. - Copyright (C) 1995-2009, 2010 Free Software Foundation, Inc.
  238. + Copyright (C) 1995-2009, 2010, 2011 Free Software Foundation, Inc.
  239. This file is part of the GNU C Library.
  240. The GNU C Library is free software; you can redistribute it and/or
  241. @@ -446,6 +446,7 @@ _dl_call_pltexit (struct link_map *l, ElfW(Word) reloc_arg,
  242. /* Set up the sym parameter. */
  243. ElfW(Sym) sym = *defsym;
  244. + sym.st_value = DL_FIXUP_VALUE_ADDR (reloc_result->addr);
  245. /* Get the symbol name. */
  246. const char *strtab = (const void *) D_PTR (reloc_result->bound,
  247. diff --git a/include/alloca.h b/include/alloca.h
  248. index 9a4b5c7..b99c3d1 100644
  249. --- a/include/alloca.h
  250. +++ b/include/alloca.h
  251. @@ -14,6 +14,7 @@ extern void *__alloca (size_t __size);
  252. extern int __libc_use_alloca (size_t size) __attribute__ ((const));
  253. extern int __libc_alloca_cutoff (size_t size) __attribute__ ((const));
  254. +libc_hidden_proto (__libc_alloca_cutoff)
  255. #define __MAX_ALLOCA_CUTOFF 65536
  256. diff --git a/include/atomic.h b/include/atomic.h
  257. index 37d0111..fc4023b 100644
  258. --- a/include/atomic.h
  259. +++ b/include/atomic.h
  260. @@ -33,7 +33,7 @@
  261. the multi-thread case. The interfaces have the prefix
  262. "catomic_".
  263. - - support functions like barriers. They also have the preifx
  264. + - support functions like barriers. They also have the prefix
  265. "atomic_".
  266. Architectures must provide a few lowlevel macros (the compare
  267. diff --git a/io/fcntl.h b/io/fcntl.h
  268. index 2a2a29d..50559ca 100644
  269. --- a/io/fcntl.h
  270. +++ b/io/fcntl.h
  271. @@ -1,4 +1,4 @@
  272. -/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006,2007, 2009
  273. +/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006,2007,2009,2010,2011
  274. Free Software Foundation, Inc.
  275. This file is part of the GNU C Library.
  276. @@ -64,6 +64,8 @@ __BEGIN_DECLS
  277. # define AT_REMOVEDIR 0x200 /* Remove directory instead of
  278. unlinking file. */
  279. # define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
  280. +# define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount
  281. + traversal. */
  282. # define AT_EACCESS 0x200 /* Test access permitted for
  283. effective IDs, not real IDs. */
  284. #endif
  285. diff --git a/malloc/malloc.c b/malloc/malloc.c
  286. index 29c7992..8f5ab77 100644
  287. --- a/malloc/malloc.c
  288. +++ b/malloc/malloc.c
  289. @@ -2832,7 +2832,7 @@ static void do_check_malloc_state(mstate av)
  290. max_fast_bin = fastbin_index(get_max_fast ());
  291. for (i = 0; i < NFASTBINS; ++i) {
  292. - p = av->fastbins[i];
  293. + p = fastbin (av, i);
  294. /* The following test can only be performed for the main arena.
  295. While mallopt calls malloc_consolidate to get rid of all fast
  296. diff --git a/nptl/ChangeLog b/nptl/ChangeLog
  297. index 73c65e6..aeb7183 100644
  298. --- a/nptl/ChangeLog
  299. +++ b/nptl/ChangeLog
  300. @@ -1,3 +1,9 @@
  301. +2011-01-13 Ulrich Drepper <drepper@gmail.com>
  302. +
  303. + [BZ #10484]
  304. + * Versions [libc] (GLIBC_PRIVATE): Export __libc_alloca_cutoff.
  305. + * alloca_cutoff.c: Add libc_hidden_def.
  306. +
  307. 2010-08-12 H.J. Lu <hongjiu.lu@intel.com>
  308. * nptl/sysdeps/unix/sysv/linux/i386/Makefile: New file.
  309. diff --git a/nptl/Versions b/nptl/Versions
  310. index 09098bf..285ff4c 100644
  311. --- a/nptl/Versions
  312. +++ b/nptl/Versions
  313. @@ -27,6 +27,7 @@ libc {
  314. pthread_cond_broadcast; pthread_cond_timedwait;
  315. }
  316. GLIBC_PRIVATE {
  317. + __libc_alloca_cutoff;
  318. # Internal libc interface to libpthread
  319. __libc_dl_error_tsd;
  320. }
  321. diff --git a/nptl/alloca_cutoff.c b/nptl/alloca_cutoff.c
  322. index ba26ceb..bbd930a 100644
  323. --- a/nptl/alloca_cutoff.c
  324. +++ b/nptl/alloca_cutoff.c
  325. @@ -1,5 +1,5 @@
  326. /* Determine whether block of given size can be allocated on the stack or not.
  327. - Copyright (C) 2002 Free Software Foundation, Inc.
  328. + Copyright (C) 2002, 2011 Free Software Foundation, Inc.
  329. This file is part of the GNU C Library.
  330. The GNU C Library is free software; you can redistribute it and/or
  331. @@ -34,3 +34,4 @@ __libc_alloca_cutoff (size_t size)
  332. assume the maximum available stack space. */
  333. ?: __MAX_ALLOCA_CUTOFF * 4));
  334. }
  335. +libc_hidden_def (__libc_alloca_cutoff)
  336. diff --git a/nscd/hstcache.c b/nscd/hstcache.c
  337. index 228f6fd..a6055cf 100644
  338. --- a/nscd/hstcache.c
  339. +++ b/nscd/hstcache.c
  340. @@ -1,5 +1,5 @@
  341. /* Cache handling for host lookup.
  342. - Copyright (C) 1998-2008, 2009 Free Software Foundation, Inc.
  343. + Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc.
  344. This file is part of the GNU C Library.
  345. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
  346. @@ -77,6 +77,20 @@ static const hst_response_header notfound =
  347. };
  348. +/* This is the standard reply in case there are temporary problems. */
  349. +static const hst_response_header tryagain =
  350. +{
  351. + .version = NSCD_VERSION,
  352. + .found = 0,
  353. + .h_name_len = 0,
  354. + .h_aliases_cnt = 0,
  355. + .h_addrtype = -1,
  356. + .h_length = -1,
  357. + .h_addr_list_cnt = 0,
  358. + .error = TRY_AGAIN
  359. +};
  360. +
  361. +
  362. static void
  363. cache_addhst (struct database_dyn *db, int fd, request_header *req,
  364. const void *key, struct hostent *hst, uid_t owner,
  365. @@ -111,11 +125,15 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
  366. else
  367. {
  368. /* We have no data. This means we send the standard reply for this
  369. - case. */
  370. + case. Possibly this is only temporary. */
  371. ssize_t total = sizeof (notfound);
  372. + assert (sizeof (notfound) == sizeof (tryagain));
  373. +
  374. + const hst_response_header *resp = (errval == EAGAIN
  375. + ? &tryagain : &notfound);
  376. if (fd != -1 &&
  377. - TEMP_FAILURE_RETRY (send (fd, &notfound, total,
  378. + TEMP_FAILURE_RETRY (send (fd, resp, total,
  379. MSG_NOSIGNAL)) != total)
  380. all_written = false;
  381. @@ -135,7 +153,7 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
  382. ? db->negtimeout : ttl);
  383. /* This is the reply. */
  384. - memcpy (&dataset->resp, &notfound, total);
  385. + memcpy (&dataset->resp, resp, total);
  386. /* Copy the key data. */
  387. memcpy (dataset->strdata, key, req->key_len);
  388. @@ -490,6 +508,7 @@ addhstbyX (struct database_dyn *db, int fd, request_header *req,
  389. /* We set the error to indicate this is (possibly) a
  390. temporary error and that it does not mean the entry
  391. is not available at all. */
  392. + h_errno = TRY_AGAIN;
  393. errval = EAGAIN;
  394. break;
  395. }
  396. diff --git a/nss/nss_files/files-hosts.c b/nss/nss_files/files-hosts.c
  397. index e5f5b48..83de650 100644
  398. --- a/nss/nss_files/files-hosts.c
  399. +++ b/nss/nss_files/files-hosts.c
  400. @@ -1,5 +1,5 @@
  401. /* Hosts file parser in nss_files module.
  402. - Copyright (C) 1996-2001, 2003-2008, 2009 Free Software Foundation, Inc.
  403. + Copyright (C) 1996-2001, 2003-2009, 2011 Free Software Foundation, Inc.
  404. This file is part of the GNU C Library.
  405. The GNU C Library is free software; you can redistribute it and/or
  406. @@ -129,19 +129,22 @@ _nss_files_get##name##_r (proto, \
  407. && _res_hconf.flags & HCONF_FLAG_MULTI) \
  408. { \
  409. /* We have to get all host entries from the file. */ \
  410. - const size_t tmp_buflen = MIN (buflen, 4096); \
  411. - char tmp_buffer[tmp_buflen] \
  412. + size_t tmp_buflen = MIN (buflen, 4096); \
  413. + char tmp_buffer_stack[tmp_buflen] \
  414. __attribute__ ((__aligned__ (__alignof__ (struct hostent_data))));\
  415. + char *tmp_buffer = tmp_buffer_stack; \
  416. struct hostent tmp_result_buf; \
  417. int naddrs = 1; \
  418. int naliases = 0; \
  419. char *bufferend; \
  420. + bool tmp_buffer_malloced = false; \
  421. \
  422. while (result->h_aliases[naliases] != NULL) \
  423. ++naliases; \
  424. \
  425. bufferend = (char *) &result->h_aliases[naliases + 1]; \
  426. \
  427. + again: \
  428. while ((status = internal_getent (&tmp_result_buf, tmp_buffer, \
  429. tmp_buflen, errnop H_ERRNO_ARG \
  430. EXTRA_ARGS_VALUE)) \
  431. @@ -182,7 +185,7 @@ _nss_files_get##name##_r (proto, \
  432. } \
  433. /* If the real name is different add it also to the \
  434. aliases. This means that there is a duplication \
  435. - in the alias list but this is really the users \
  436. + in the alias list but this is really the user's \
  437. problem. */ \
  438. if (strcmp (old_result->h_name, \
  439. tmp_result_buf.h_name) != 0) \
  440. @@ -204,7 +207,7 @@ _nss_files_get##name##_r (proto, \
  441. *errnop = ERANGE; \
  442. *herrnop = NETDB_INTERNAL; \
  443. status = NSS_STATUS_TRYAGAIN; \
  444. - break; \
  445. + goto out; \
  446. } \
  447. \
  448. new_h_addr_list = \
  449. @@ -268,8 +271,54 @@ _nss_files_get##name##_r (proto, \
  450. } \
  451. } \
  452. \
  453. - if (status != NSS_STATUS_TRYAGAIN) \
  454. + if (status == NSS_STATUS_TRYAGAIN) \
  455. + { \
  456. + size_t newsize = 2 * tmp_buflen; \
  457. + if (tmp_buffer_malloced) \
  458. + { \
  459. + char *newp = realloc (tmp_buffer, newsize); \
  460. + if (newp != NULL) \
  461. + { \
  462. + assert ((((uintptr_t) newp) \
  463. + & (__alignof__ (struct hostent_data) - 1)) \
  464. + == 0); \
  465. + tmp_buffer = newp; \
  466. + tmp_buflen = newsize; \
  467. + goto again; \
  468. + } \
  469. + } \
  470. + else if (!__libc_use_alloca (buflen + newsize)) \
  471. + { \
  472. + tmp_buffer = malloc (newsize); \
  473. + if (tmp_buffer != NULL) \
  474. + { \
  475. + assert ((((uintptr_t) tmp_buffer) \
  476. + & (__alignof__ (struct hostent_data) - 1)) \
  477. + == 0); \
  478. + tmp_buffer_malloced = true; \
  479. + tmp_buflen = newsize; \
  480. + goto again; \
  481. + } \
  482. + } \
  483. + else \
  484. + { \
  485. + tmp_buffer \
  486. + = extend_alloca (tmp_buffer, tmp_buflen, \
  487. + newsize \
  488. + + __alignof__ (struct hostent_data)); \
  489. + tmp_buffer = (char *) (((uintptr_t) tmp_buffer \
  490. + + __alignof__ (struct hostent_data) \
  491. + - 1) \
  492. + & ~(__alignof__ (struct hostent_data)\
  493. + - 1)); \
  494. + goto again; \
  495. + } \
  496. + } \
  497. + else \
  498. status = NSS_STATUS_SUCCESS; \
  499. + out: \
  500. + if (tmp_buffer_malloced) \
  501. + free (tmp_buffer); \
  502. } \
  503. \
  504. \
  505. diff --git a/posix/regexec.c b/posix/regexec.c
  506. index 8481b61..5019003 100644
  507. --- a/posix/regexec.c
  508. +++ b/posix/regexec.c
  509. @@ -3347,6 +3347,8 @@ build_trtable (const re_dfa_t *dfa, re_dfastate_t *state)
  510. {
  511. state->trtable = (re_dfastate_t **)
  512. calloc (sizeof (re_dfastate_t *), SBC_MAX);
  513. + if (BE (state->trtable == NULL, 0))
  514. + return 0;
  515. return 1;
  516. }
  517. return 0;
  518. diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
  519. index 8592183..fe4ac2d 100644
  520. --- a/resolv/nss_dns/dns-host.c
  521. +++ b/resolv/nss_dns/dns-host.c
  522. @@ -599,7 +599,6 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
  523. int (*name_ok) (const char *);
  524. u_char packtmp[NS_MAXCDNAME];
  525. int have_to_map = 0;
  526. - int32_t ttl = 0;
  527. uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
  528. buffer += pad;
  529. if (__builtin_expect (buflen < sizeof (struct host_data) + pad, 0))
  530. @@ -733,7 +732,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
  531. cp += INT16SZ; /* type */
  532. class = __ns_get16 (cp);
  533. cp += INT16SZ; /* class */
  534. - ttl = __ns_get32 (cp);
  535. + int32_t ttl = __ns_get32 (cp);
  536. cp += INT32SZ; /* TTL */
  537. n = __ns_get16 (cp);
  538. cp += INT16SZ; /* len */
  539. @@ -907,7 +906,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
  540. {
  541. register int nn;
  542. - if (ttlp != NULL && ttl != 0)
  543. + if (ttlp != NULL)
  544. *ttlp = ttl;
  545. if (canonp != NULL)
  546. *canonp = bp;
  547. @@ -1163,7 +1162,7 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
  548. if (*firstp)
  549. {
  550. - if (ttl != 0 && ttlp != NULL)
  551. + if (ttlp != NULL)
  552. *ttlp = ttl;
  553. (*pat)->name = canon ?: h_name;
  554. diff --git a/shadow/sgetspent.c b/shadow/sgetspent.c
  555. index ec7f384..f3dce53 100644
  556. --- a/shadow/sgetspent.c
  557. +++ b/shadow/sgetspent.c
  558. @@ -1,4 +1,4 @@
  559. -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
  560. +/* Copyright (C) 1996, 1997, 2011 Free Software Foundation, Inc.
  561. This file is part of the GNU C Library.
  562. The GNU C Library is free software; you can redistribute it and/or
  563. @@ -49,8 +49,8 @@ sgetspent (const char *string)
  564. }
  565. while (buffer != NULL
  566. - && __sgetspent_r (string, &resbuf, buffer, buffer_size, &result) != 0
  567. - && errno == ERANGE)
  568. + && (__sgetspent_r (string, &resbuf, buffer, buffer_size, &result)
  569. + == ERANGE))
  570. {
  571. char *new_buf;
  572. buffer_size += BUFLEN_SPWD;
  573. diff --git a/stdio-common/Makefile b/stdio-common/Makefile
  574. index 9cbf143..6aabfb6 100644
  575. --- a/stdio-common/Makefile
  576. +++ b/stdio-common/Makefile
  577. @@ -1,4 +1,4 @@
  578. -# Copyright (C) 1991-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
  579. +# Copyright (C) 1991-2009, 2011 Free Software Foundation, Inc.
  580. # This file is part of the GNU C Library.
  581. # The GNU C Library is free software; you can redistribute it and/or
  582. @@ -60,7 +60,7 @@ tests := tstscanf test_rdwr test-popen tstgetln test-fseek \
  583. tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \
  584. tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \
  585. bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \
  586. - scanf16 scanf17 tst-setvbuf1
  587. + scanf16 scanf17 tst-setvbuf1 tst-grouping
  588. test-srcs = tst-unbputc tst-printf
  589. @@ -128,6 +128,7 @@ test-vfprintf-ENV = LOCPATH=$(common-objpfx)localedata
  590. scanf13-ENV = LOCPATH=$(common-objpfx)localedata
  591. bug14-ENV = LOCPATH=$(common-objpfx)localedata
  592. bug15-ENV = LOCPATH=$(common-objpfx)localedata
  593. +tst-grouping-ENV = LOCPATH=$(common-objpfx)localedata
  594. ifneq (,$(filter %REENTRANT, $(defines)))
  595. CPPFLAGS += -D_IO_MTSAFE_IO
  596. diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c
  597. index b60ddec..e9ff168 100644
  598. --- a/stdio-common/printf_fp.c
  599. +++ b/stdio-common/printf_fp.c
  600. @@ -1,5 +1,5 @@
  601. /* Floating point output for `printf'.
  602. - Copyright (C) 1995-2003, 2006, 2007, 2008 Free Software Foundation, Inc.
  603. + Copyright (C) 1995-2003, 2006-2008, 2011 Free Software Foundation, Inc.
  604. This file is part of the GNU C Library.
  605. Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
  606. @@ -884,7 +884,9 @@ ___printf_fp (FILE *fp,
  607. /* Guess the number of groups we will make, and thus how
  608. many spaces we need for separator characters. */
  609. ngroups = __guess_grouping (intdig_max, grouping);
  610. - chars_needed += ngroups;
  611. + /* Allocate one more character in case rounding increases the
  612. + number of groups. */
  613. + chars_needed += ngroups + 1;
  614. }
  615. /* Allocate buffer for output. We need two more because while rounding
  616. @@ -1088,9 +1090,16 @@ ___printf_fp (FILE *fp,
  617. --wcp;
  618. if (grouping)
  619. - /* Add in separator characters, overwriting the same buffer. */
  620. - wcp = group_number (wstartp, wcp, intdig_no, grouping, thousands_sepwc,
  621. - ngroups);
  622. + {
  623. + /* Rounding might have changed the number of groups. We allocated
  624. + enough memory but we need here the correct number of groups. */
  625. + if (intdig_no != intdig_max)
  626. + ngroups = __guess_grouping (intdig_no, grouping);
  627. +
  628. + /* Add in separator characters, overwriting the same buffer. */
  629. + wcp = group_number (wstartp, wcp, intdig_no, grouping, thousands_sepwc,
  630. + ngroups);
  631. + }
  632. /* Write the exponent if it is needed. */
  633. if (type != 'f')
  634. @@ -1210,7 +1219,7 @@ ___printf_fp (FILE *fp,
  635. tmpptr = buffer;
  636. if (__builtin_expect (info->i18n, 0))
  637. - {
  638. + {
  639. #ifdef COMPILE_WPRINTF
  640. wstartp = _i18n_number_rewrite (wstartp, wcp,
  641. wbuffer + wbuffer_to_alloc);
  642. @@ -1224,7 +1233,7 @@ ___printf_fp (FILE *fp,
  643. assert ((uintptr_t) buffer <= (uintptr_t) tmpptr);
  644. assert ((uintptr_t) tmpptr < (uintptr_t) buffer_end);
  645. #endif
  646. - }
  647. + }
  648. PRINT (tmpptr, wstartp, wide ? wcp - wstartp : cp - tmpptr);
  649. diff --git a/stdio-common/tst-grouping.c b/stdio-common/tst-grouping.c
  650. new file mode 100644
  651. index 0000000..e8f4b8c
  652. --- /dev/null
  653. +++ b/stdio-common/tst-grouping.c
  654. @@ -0,0 +1,83 @@
  655. +/* BZ 12394, test by Bruno Haible. */
  656. +#include <locale.h>
  657. +#include <stdio.h>
  658. +#include <stdlib.h>
  659. +#include <string.h>
  660. +
  661. +
  662. +static int
  663. +do_test (void)
  664. +{
  665. + char buf1[1000];
  666. + char buf2[1000];
  667. + int result = 0;
  668. +
  669. + if (setlocale (LC_NUMERIC, "de_DE.UTF-8") == NULL)
  670. + return 1;
  671. +
  672. + sprintf (buf1, "%'.2f", 999.996);
  673. + sprintf (buf2, "%'.2f", 1000.004);
  674. + printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
  675. + if (strcmp (buf1, buf2) != 0)
  676. + result |= 2;
  677. +
  678. + sprintf (buf1, "%'.2f", 999999.996);
  679. + sprintf (buf2, "%'.2f", 1000000.004);
  680. + printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
  681. + if (strcmp (buf1, buf2) != 0)
  682. + result |= 2;
  683. +
  684. + sprintf (buf1, "%'.2f", 999999999.996);
  685. + sprintf (buf2, "%'.2f", 1000000000.004);
  686. + printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
  687. + if (strcmp (buf1, buf2) != 0)
  688. + result |= 2;
  689. +
  690. + sprintf (buf1, "%'.2f", 999999999999.996);
  691. + sprintf (buf2, "%'.2f", 1000000000000.004);
  692. + printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
  693. + if (strcmp (buf1, buf2) != 0)
  694. + result |= 2;
  695. +
  696. + sprintf (buf1, "%'.2f", 999999999999999.996);
  697. + sprintf (buf2, "%'.2f", 1000000000000000.004);
  698. + printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
  699. + if (strcmp (buf1, buf2) != 0)
  700. + result |= 2;
  701. +
  702. + sprintf (buf1, "%'.5g", 999.996);
  703. + sprintf (buf2, "%'.5g", 1000.004);
  704. + printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
  705. + if (strcmp (buf1, buf2) != 0)
  706. + result |= 4;
  707. +
  708. + sprintf (buf1, "%'.4g", 9999.996);
  709. + sprintf (buf2, "%'.4g", 10000.004);
  710. + printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
  711. + if (strcmp (buf1, buf2) != 0)
  712. + result |= 8;
  713. +
  714. + sprintf (buf1, "%'.5g", 99999.996);
  715. + sprintf (buf2, "%'.5g", 100000.004);
  716. + printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
  717. + if (strcmp (buf1, buf2) != 0)
  718. + result |= 8;
  719. +
  720. + sprintf (buf1, "%'.6g", 999999.996);
  721. + sprintf (buf2, "%'.6g", 1000000.004);
  722. + printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
  723. + if (strcmp (buf1, buf2) != 0)
  724. + result |= 8;
  725. +
  726. + sprintf (buf1, "%'.7g", 9999999.996);
  727. + sprintf (buf2, "%'.7g", 10000000.004);
  728. + printf ("%d: \"%s\" vs \"%s\"\n", __LINE__, buf1, buf2);
  729. + if (strcmp (buf1, buf2) != 0)
  730. + result |= 8;
  731. +
  732. + return result;
  733. +}
  734. +
  735. +
  736. +#define TEST_FUNCTION do_test ()
  737. +#include "../test-skeleton.c"
  738. diff --git a/stdlib/msort.c b/stdlib/msort.c
  739. index 35cd4d0..fc58f0d 100644
  740. --- a/stdlib/msort.c
  741. +++ b/stdlib/msort.c
  742. @@ -25,6 +25,7 @@
  743. #include <unistd.h>
  744. #include <memcopy.h>
  745. #include <errno.h>
  746. +#include <atomic.h>
  747. struct msort_param
  748. {
  749. @@ -182,7 +183,7 @@ qsort_r (void *b, size_t n, size_t s, __compar_d_fn_t cmp, void *arg)
  750. static long int phys_pages;
  751. static int pagesize;
  752. - if (phys_pages == 0)
  753. + if (pagesize == 0)
  754. {
  755. phys_pages = __sysconf (_SC_PHYS_PAGES);
  756. @@ -197,6 +198,9 @@ qsort_r (void *b, size_t n, size_t s, __compar_d_fn_t cmp, void *arg)
  757. a quarter of the physical memory. */
  758. phys_pages /= 4;
  759. + /* Make sure phys_pages is written to memory. */
  760. + atomic_write_barrier ();
  761. +
  762. pagesize = __sysconf (_SC_PAGESIZE);
  763. }
  764. diff --git a/string/bits/string3.h b/string/bits/string3.h
  765. index 1d759f1..1647725 100644
  766. --- a/string/bits/string3.h
  767. +++ b/string/bits/string3.h
  768. @@ -1,4 +1,4 @@
  769. -/* Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
  770. +/* Copyright (C) 2004, 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
  771. This file is part of the GNU C Library.
  772. The GNU C Library is free software; you can redistribute it and/or
  773. @@ -53,8 +53,7 @@ __NTH (memcpy (void *__restrict __dest, __const void *__restrict __src,
  774. }
  775. __extern_always_inline void *
  776. -__NTH (memmove (void *__restrict __dest, __const void *__restrict __src,
  777. - size_t __len))
  778. +__NTH (memmove (void *__dest, __const void *__src, size_t __len))
  779. {
  780. return __builtin___memmove_chk (__dest, __src, __len, __bos0 (__dest));
  781. }
  782. @@ -88,8 +87,7 @@ __NTH (memset (void *__dest, int __ch, size_t __len))
  783. #ifdef __USE_BSD
  784. __extern_always_inline void
  785. -__NTH (bcopy (__const void *__restrict __src, void *__restrict __dest,
  786. - size_t __len))
  787. +__NTH (bcopy (__const void *__src, void *__dest, size_t __len))
  788. {
  789. (void) __builtin___memmove_chk (__dest, __src, __len, __bos0 (__dest));
  790. }
  791. diff --git a/sysdeps/i386/Makefile b/sysdeps/i386/Makefile
  792. index ef45ce6..3d9f3fc 100644
  793. --- a/sysdeps/i386/Makefile
  794. +++ b/sysdeps/i386/Makefile
  795. @@ -47,6 +47,7 @@ endif
  796. # And a couple of other routines
  797. ifeq ($(subdir),stdlib)
  798. CFLAGS-exit.c += -mpreferred-stack-boundary=4
  799. +CFLAGS-cxa_finalize.c += -mpreferred-stack-boundary=4
  800. endif
  801. ifeq ($(subdir),elf)
  802. CFLAGS-dl-init.c += -mpreferred-stack-boundary=4
  803. diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps
  804. index 5231789..4b1a9e7 100644
  805. --- a/sysdeps/i386/fpu/libm-test-ulps
  806. +++ b/sysdeps/i386/fpu/libm-test-ulps
  807. @@ -857,8 +857,8 @@ ifloat: 1
  808. ildouble: 2
  809. ldouble: 2
  810. Test "yn (10, 0.75) == -2133501638.90573424452445412893839236":
  811. -float: 1
  812. -ifloat: 1
  813. +float: 2
  814. +ifloat: 2
  815. ildouble: 4
  816. ldouble: 4
  817. Test "yn (10, 1.0) == -121618014.278689189288130426667971145":
  818. diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
  819. index 8b7e38f..0217cc6 100644
  820. --- a/sysdeps/posix/getaddrinfo.c
  821. +++ b/sysdeps/posix/getaddrinfo.c
  822. @@ -963,6 +963,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
  823. make a copy. */
  824. if (out == canon)
  825. goto make_copy;
  826. + canon = out;
  827. }
  828. else
  829. #endif
  830. diff --git a/sysdeps/unix/readdir_r.c b/sysdeps/unix/readdir_r.c
  831. index 9372791..e166174 100644
  832. --- a/sysdeps/unix/readdir_r.c
  833. +++ b/sysdeps/unix/readdir_r.c
  834. @@ -117,7 +117,8 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result)
  835. #ifdef GETDENTS_64BIT_ALIGNED
  836. /* The d_reclen value might include padding which is not part of
  837. the DIRENT_TYPE data structure. */
  838. - reclen = MIN (reclen, sizeof (DIRENT_TYPE));
  839. + reclen = MIN (reclen,
  840. + offsetof (DIRENT_TYPE, d_name) + sizeof (dp->d_name));
  841. #endif
  842. *result = memcpy (entry, dp, reclen);
  843. #ifdef GETDENTS_64BIT_ALIGNED
  844. diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
  845. index f23b338..d77e34b 100644
  846. --- a/sysdeps/unix/sysv/linux/bits/socket.h
  847. +++ b/sysdeps/unix/sysv/linux/bits/socket.h
  848. @@ -1,5 +1,5 @@
  849. /* System-specific socket constants and types. Linux version.
  850. - Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008, 2009
  851. + Copyright (C) 1991, 1992, 1994-2001, 2004, 2006-2010, 2011
  852. Free Software Foundation, Inc.
  853. This file is part of the GNU C Library.
  854. @@ -109,7 +109,9 @@ enum __socket_type
  855. #define PF_ISDN 34 /* mISDN sockets. */
  856. #define PF_PHONET 35 /* Phonet sockets. */
  857. #define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */
  858. -#define PF_MAX 37 /* For now.. */
  859. +#define PF_CAIF 37 /* CAIF sockets. */
  860. +#define PF_ALG 38 /* Algorithm sockets. */
  861. +#define PF_MAX 39 /* For now.. */
  862. /* Address families. */
  863. #define AF_UNSPEC PF_UNSPEC
  864. @@ -150,6 +152,8 @@ enum __socket_type
  865. #define AF_ISDN PF_ISDN
  866. #define AF_PHONET PF_PHONET
  867. #define AF_IEEE802154 PF_IEEE802154
  868. +#define AF_CAIF PF_CAIF
  869. +#define AF_ALG PF_ALG
  870. #define AF_MAX PF_MAX
  871. /* Socket level values. Others are defined in the appropriate headers.
  872. diff --git a/sysdeps/unix/sysv/linux/i386/bits/mman.h b/sysdeps/unix/sysv/linux/i386/bits/mman.h
  873. index 7ac1aff..10fbd7e 100644
  874. --- a/sysdeps/unix/sysv/linux/i386/bits/mman.h
  875. +++ b/sysdeps/unix/sysv/linux/i386/bits/mman.h
  876. @@ -1,5 +1,5 @@
  877. /* Definitions for POSIX memory map interface. Linux/i386 version.
  878. - Copyright (C) 1997,2000,2003,2005,2006,2009,2010
  879. + Copyright (C) 1997,2000,2003,2005,2006,2009,2010,2011
  880. Free Software Foundation, Inc.
  881. This file is part of the GNU C Library.
  882. @@ -96,6 +96,8 @@
  883. # define MADV_DOFORK 11 /* Do inherit across fork. */
  884. # define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
  885. # define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
  886. +# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
  887. +# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
  888. # define MADV_HWPOISON 100 /* Poison a page for testing. */
  889. #endif
  890. diff --git a/sysdeps/unix/sysv/linux/ia64/bits/mman.h b/sysdeps/unix/sysv/linux/ia64/bits/mman.h
  891. index 1b278c7..8b13989 100644
  892. --- a/sysdeps/unix/sysv/linux/ia64/bits/mman.h
  893. +++ b/sysdeps/unix/sysv/linux/ia64/bits/mman.h
  894. @@ -1,5 +1,5 @@
  895. /* Definitions for POSIX memory map interface. Linux/ia64 version.
  896. - Copyright (C) 1997,1998,2000,2003,2005,2006,2009
  897. + Copyright (C) 1997,1998,2000,2003,2005,2006,2009,2011
  898. Free Software Foundation, Inc.
  899. This file is part of the GNU C Library.
  900. @@ -95,6 +95,8 @@
  901. # define MADV_DOFORK 11 /* Do inherit across fork. */
  902. # define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
  903. # define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
  904. +# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
  905. +# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
  906. # define MADV_HWPOISON 100 /* Poison a page for testing. */
  907. #endif
  908. diff --git a/sysdeps/unix/sysv/linux/mkdirat.c b/sysdeps/unix/sysv/linux/mkdirat.c
  909. index aa89d08..73ebbe6 100644
  910. --- a/sysdeps/unix/sysv/linux/mkdirat.c
  911. +++ b/sysdeps/unix/sysv/linux/mkdirat.c
  912. @@ -1,4 +1,4 @@
  913. -/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
  914. +/* Copyright (C) 2005, 2006, 2009, 2011 Free Software Foundation, Inc.
  915. This file is part of the GNU C Library.
  916. The GNU C Library is free software; you can redistribute it and/or
  917. @@ -43,7 +43,7 @@ mkdirat (fd, file, mode)
  918. {
  919. res = INLINE_SYSCALL (mkdirat, 3, fd, file, mode);
  920. # ifndef __ASSUME_ATFCTS
  921. - if (res == -1 && res == ENOSYS)
  922. + if (res == -1 && errno == ENOSYS)
  923. __have_atfcts = -1;
  924. else
  925. # endif
  926. diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
  927. index e6580f8..c9b3f3f 100644
  928. --- a/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
  929. +++ b/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
  930. @@ -1,5 +1,5 @@
  931. /* Definitions for POSIX memory map interface. Linux/PowerPC version.
  932. - Copyright (C) 1997,2000,2003,2005,2006,2008,2009
  933. + Copyright (C) 1997,2000,2003,2005,2006,2008,2009,2011
  934. Free Software Foundation, Inc.
  935. This file is part of the GNU C Library.
  936. @@ -96,6 +96,8 @@
  937. # define MADV_DOFORK 11 /* Do inherit across fork. */
  938. # define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
  939. # define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
  940. +# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
  941. +# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
  942. # define MADV_HWPOISON 100 /* Poison a page for testing. */
  943. #endif
  944. diff --git a/sysdeps/unix/sysv/linux/s390/bits/mman.h b/sysdeps/unix/sysv/linux/s390/bits/mman.h
  945. index daeafd4..51053db 100644
  946. --- a/sysdeps/unix/sysv/linux/s390/bits/mman.h
  947. +++ b/sysdeps/unix/sysv/linux/s390/bits/mman.h
  948. @@ -1,5 +1,5 @@
  949. /* Definitions for POSIX memory map interface. Linux/s390 version.
  950. - Copyright (C) 2000-2003,2005,2006,2009 Free Software Foundation, Inc.
  951. + Copyright (C) 2000-2003,2005,2006,2009,2011 Free Software Foundation, Inc.
  952. This file is part of the GNU C Library.
  953. The GNU C Library is free software; you can redistribute it and/or
  954. @@ -94,6 +94,8 @@
  955. # define MADV_DOFORK 11 /* Do inherit across fork. */
  956. # define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
  957. # define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
  958. +# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
  959. +# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
  960. # define MADV_HWPOISON 100 /* Poison a page for testing. */
  961. #endif
  962. diff --git a/sysdeps/unix/sysv/linux/sh/bits/mman.h b/sysdeps/unix/sysv/linux/sh/bits/mman.h
  963. index aee0011..2097358 100644
  964. --- a/sysdeps/unix/sysv/linux/sh/bits/mman.h
  965. +++ b/sysdeps/unix/sysv/linux/sh/bits/mman.h
  966. @@ -1,5 +1,5 @@
  967. /* Definitions for POSIX memory map interface. Linux/SH version.
  968. - Copyright (C) 1997,1999,2000,2003,2005,2006,2009
  969. + Copyright (C) 1997,1999,2000,2003,2005,2006,2009,2011
  970. Free Software Foundation, Inc.
  971. This file is part of the GNU C Library.
  972. @@ -94,6 +94,8 @@
  973. # define MADV_DOFORK 11 /* Do inherit across fork. */
  974. # define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
  975. # define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
  976. +# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
  977. +# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
  978. # define MADV_HWPOISON 100 /* Poison a page for testing. */
  979. #endif
  980. diff --git a/sysdeps/unix/sysv/linux/sparc/bits/mman.h b/sysdeps/unix/sysv/linux/sparc/bits/mman.h
  981. index 71a3aa6..c0ffb3a 100644
  982. --- a/sysdeps/unix/sysv/linux/sparc/bits/mman.h
  983. +++ b/sysdeps/unix/sysv/linux/sparc/bits/mman.h
  984. @@ -1,5 +1,5 @@
  985. /* Definitions for POSIX memory map interface. Linux/SPARC version.
  986. - Copyright (C) 1997,1999,2000,2003,2005,2006,2009
  987. + Copyright (C) 1997,1999,2000,2003,2005,2006,2009,2011
  988. Free Software Foundation, Inc.
  989. This file is part of the GNU C Library.
  990. @@ -97,6 +97,8 @@
  991. # define MADV_DOFORK 11 /* Do inherit across fork. */
  992. # define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
  993. # define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
  994. +# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
  995. +# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
  996. # define MADV_HWPOISON 100 /* Poison a page for testing. */
  997. #endif
  998. diff --git a/sysdeps/unix/sysv/linux/sparc/bits/socket.h b/sysdeps/unix/sysv/linux/sparc/bits/socket.h
  999. index a148072..141ea27 100644
  1000. --- a/sysdeps/unix/sysv/linux/sparc/bits/socket.h
  1001. +++ b/sysdeps/unix/sysv/linux/sparc/bits/socket.h
  1002. @@ -1,5 +1,5 @@
  1003. /* System-specific socket constants and types. Linux/SPARC version.
  1004. - Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008, 2009
  1005. + Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008, 2009, 2011
  1006. Free Software Foundation, Inc.
  1007. This file is part of the GNU C Library.
  1008. @@ -108,7 +108,9 @@ enum __socket_type
  1009. #define PF_ISDN 34 /* mISDN sockets. */
  1010. #define PF_PHONET 35 /* Phonet sockets. */
  1011. #define PF_IEEE802154 36 /* IEEE 802.15.4 sockets. */
  1012. -#define PF_MAX 37 /* For now.. */
  1013. +#define PF_CAIF 37 /* CAIF sockets. */
  1014. +#define PF_ALG 38 /* Algorithm sockets. */
  1015. +#define PF_MAX 39 /* For now.. */
  1016. /* Address families. */
  1017. #define AF_UNSPEC PF_UNSPEC
  1018. @@ -149,6 +151,8 @@ enum __socket_type
  1019. #define AF_ISDN PF_ISDN
  1020. #define AF_PHONET PF_PHONET
  1021. #define AF_IEEE802154 PF_IEEE802154
  1022. +#define AF_CAIF PF_CAIF
  1023. +#define AF_ALG PF_ALG
  1024. #define AF_MAX PF_MAX
  1025. /* Socket level values. Others are defined in the appropriate headers.
  1026. @@ -233,8 +237,8 @@ enum
  1027. #define MSG_MORE MSG_MORE
  1028. MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file
  1029. - descriptor received through
  1030. - SCM_RIGHTS. */
  1031. + descriptor received through
  1032. + SCM_RIGHTS. */
  1033. #define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
  1034. };
  1035. diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/fxstat.c b/sysdeps/unix/sysv/linux/sparc/sparc64/fxstat.c
  1036. index 6b37477..e328ccb 100644
  1037. --- a/sysdeps/unix/sysv/linux/sparc/sparc64/fxstat.c
  1038. +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/fxstat.c
  1039. @@ -1 +1 @@
  1040. -#include "../../fxstat.c"
  1041. +#include "../../i386/fxstat.c"
  1042. diff --git a/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c b/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
  1043. index adb92db..12ca1a1 100644
  1044. --- a/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
  1045. +++ b/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
  1046. @@ -1,4 +1,5 @@
  1047. #define readdir64_r __no_readdir64_r_decl
  1048. +#define GETDENTS_64BIT_ALIGNED 1
  1049. #include <sysdeps/unix/readdir_r.c>
  1050. #undef readdir64_r
  1051. weak_alias (__readdir_r, readdir64_r)
  1052. diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/mman.h b/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
  1053. index 6f3ad0d..9829710 100644
  1054. --- a/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
  1055. +++ b/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
  1056. @@ -1,5 +1,6 @@
  1057. /* Definitions for POSIX memory map interface. Linux/x86_64 version.
  1058. - Copyright (C) 2001,2003,2005,2006,2009,2010 Free Software Foundation, Inc.
  1059. + Copyright (C) 2001,2003,2005,2006,2009,2010,2011
  1060. + Free Software Foundation, Inc.
  1061. This file is part of the GNU C Library.
  1062. The GNU C Library is free software; you can redistribute it and/or
  1063. @@ -96,6 +97,8 @@
  1064. # define MADV_DOFORK 11 /* Do inherit across fork. */
  1065. # define MADV_MERGEABLE 12 /* KSM may merge identical pages. */
  1066. # define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */
  1067. +# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */
  1068. +# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */
  1069. # define MADV_HWPOISON 100 /* Poison a page for testing. */
  1070. #endif
  1071. diff --git a/wcsmbs/bits/wchar2.h b/wcsmbs/bits/wchar2.h
  1072. index 2ec4ce1..c38eaa3 100644
  1073. --- a/wcsmbs/bits/wchar2.h
  1074. +++ b/wcsmbs/bits/wchar2.h
  1075. @@ -1,5 +1,5 @@
  1076. /* Checking macros for wchar functions.
  1077. - Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
  1078. + Copyright (C) 2005, 2006, 2007, 2010 Free Software Foundation, Inc.
  1079. This file is part of the GNU C Library.
  1080. The GNU C Library is free software; you can redistribute it and/or
  1081. @@ -60,15 +60,13 @@ extern wchar_t *__REDIRECT_NTH (__wmemmove_alias, (wchar_t *__s1,
  1082. __const wchar_t *__s2,
  1083. size_t __n), wmemmove);
  1084. extern wchar_t *__REDIRECT_NTH (__wmemmove_chk_warn,
  1085. - (wchar_t *__restrict __s1,
  1086. - __const wchar_t *__restrict __s2, size_t __n,
  1087. - size_t __ns1), __wmemmove_chk)
  1088. + (wchar_t *__s1, __const wchar_t *__s2,
  1089. + size_t __n, size_t __ns1), __wmemmove_chk)
  1090. __warnattr ("wmemmove called with length bigger than size of destination "
  1091. "buffer");
  1092. __extern_always_inline wchar_t *
  1093. -__NTH (wmemmove (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
  1094. - size_t __n))
  1095. +__NTH (wmemmove (wchar_t *__s1, __const wchar_t *__s2, size_t __n))
  1096. {
  1097. if (__bos0 (__s1) != (size_t) -1)
  1098. {
  1099. @@ -129,7 +127,7 @@ extern wchar_t *__REDIRECT_NTH (__wmemset_chk_warn,
  1100. "buffer");
  1101. __extern_always_inline wchar_t *
  1102. -__NTH (wmemset (wchar_t *__restrict __s, wchar_t __c, size_t __n))
  1103. +__NTH (wmemset (wchar_t *__s, wchar_t __c, size_t __n))
  1104. {
  1105. if (__bos0 (__s) != (size_t) -1)
  1106. {
  1107. @@ -152,7 +150,7 @@ extern wchar_t *__REDIRECT_NTH (__wcscpy_alias,
  1108. __const wchar_t *__restrict __src), wcscpy);
  1109. __extern_always_inline wchar_t *
  1110. -__NTH (wcscpy (wchar_t *__dest, __const wchar_t *__src))
  1111. +__NTH (wcscpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src))
  1112. {
  1113. if (__bos (__dest) != (size_t) -1)
  1114. return __wcscpy_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t));
  1115. @@ -160,14 +158,15 @@ __NTH (wcscpy (wchar_t *__dest, __const wchar_t *__src))
  1116. }
  1117. -extern wchar_t *__wcpcpy_chk (wchar_t *__dest, __const wchar_t *__src,
  1118. +extern wchar_t *__wcpcpy_chk (wchar_t *__restrict __dest,
  1119. + __const wchar_t *__restrict __src,
  1120. size_t __destlen) __THROW;
  1121. -extern wchar_t *__REDIRECT_NTH (__wcpcpy_alias, (wchar_t *__dest,
  1122. - __const wchar_t *__src),
  1123. - wcpcpy);
  1124. +extern wchar_t *__REDIRECT_NTH (__wcpcpy_alias,
  1125. + (wchar_t *__restrict __dest,
  1126. + __const wchar_t *__restrict __src), wcpcpy);
  1127. __extern_always_inline wchar_t *
  1128. -__NTH (wcpcpy (wchar_t *__dest, __const wchar_t *__src))
  1129. +__NTH (wcpcpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src))
  1130. {
  1131. if (__bos (__dest) != (size_t) -1)
  1132. return __wcpcpy_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t));
  1133. @@ -190,7 +189,8 @@ extern wchar_t *__REDIRECT_NTH (__wcsncpy_chk_warn,
  1134. "buffer");
  1135. __extern_always_inline wchar_t *
  1136. -__NTH (wcsncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n))
  1137. +__NTH (wcsncpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src,
  1138. + size_t __n))
  1139. {
  1140. if (__bos (__dest) != (size_t) -1)
  1141. {
  1142. @@ -220,7 +220,8 @@ extern wchar_t *__REDIRECT_NTH (__wcpncpy_chk_warn,
  1143. "buffer");
  1144. __extern_always_inline wchar_t *
  1145. -__NTH (wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n))
  1146. +__NTH (wcpncpy (wchar_t *__restrict __dest, __const wchar_t *__restrict __src,
  1147. + size_t __n))
  1148. {
  1149. if (__bos (__dest) != (size_t) -1)
  1150. {
  1151. @@ -243,7 +244,7 @@ extern wchar_t *__REDIRECT_NTH (__wcscat_alias,
  1152. __const wchar_t *__restrict __src), wcscat);
  1153. __extern_always_inline wchar_t *
  1154. -__NTH (wcscat (wchar_t *__dest, __const wchar_t *__src))
  1155. +__NTH (wcscat (wchar_t *__restrict __dest, __const wchar_t *__restrict __src))
  1156. {
  1157. if (__bos (__dest) != (size_t) -1)
  1158. return __wcscat_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t));
  1159. @@ -260,7 +261,8 @@ extern wchar_t *__REDIRECT_NTH (__wcsncat_alias,
  1160. size_t __n), wcsncat);
  1161. __extern_always_inline wchar_t *
  1162. -__NTH (wcsncat (wchar_t *__dest, __const wchar_t *__src, size_t __n))
  1163. +__NTH (wcsncat (wchar_t *__restrict __dest, __const wchar_t *__restrict __src,
  1164. + size_t __n))
  1165. {
  1166. if (__bos (__dest) != (size_t) -1)
  1167. return __wcsncat_chk (__dest, __src, __n,
  1168. @@ -428,14 +430,16 @@ fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
  1169. #endif
  1170. -extern size_t __wcrtomb_chk (char *__s, wchar_t __wchar, mbstate_t *__p,
  1171. - size_t __buflen) __THROW __wur;
  1172. +extern size_t __wcrtomb_chk (char *__restrict __s, wchar_t __wchar,
  1173. + mbstate_t *__restrict __p,
  1174. + size_t __buflen) __THROW __wur;
  1175. extern size_t __REDIRECT_NTH (__wcrtomb_alias,
  1176. (char *__restrict __s, wchar_t __wchar,
  1177. mbstate_t *__restrict __ps), wcrtomb) __wur;
  1178. __extern_always_inline __wur size_t
  1179. -__NTH (wcrtomb (char *__s, wchar_t __wchar, mbstate_t *__ps))
  1180. +__NTH (wcrtomb (char *__restrict __s, wchar_t __wchar,
  1181. + mbstate_t *__restrict __ps))
  1182. {
  1183. /* We would have to include <limits.h> to get a definition of MB_LEN_MAX.
  1184. But this would only disturb the namespace. So we define our own
  1185. diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h
  1186. index eb5b244..fc2c6a4 100644
  1187. --- a/wcsmbs/wchar.h
  1188. +++ b/wcsmbs/wchar.h
  1189. @@ -561,11 +561,13 @@ extern long double wcstold_l (__const wchar_t *__restrict __nptr,
  1190. #ifdef __USE_XOPEN2K8
  1191. /* Copy SRC to DEST, returning the address of the terminating L'\0' in
  1192. DEST. */
  1193. -extern wchar_t *wcpcpy (wchar_t *__dest, __const wchar_t *__src) __THROW;
  1194. +extern wchar_t *wcpcpy (wchar_t *__restrict __dest,
  1195. + __const wchar_t *__restrict __src) __THROW;
  1196. /* Copy no more than N characters of SRC to DEST, returning the address of
  1197. the last character written into DEST. */
  1198. -extern wchar_t *wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n)
  1199. +extern wchar_t *wcpncpy (wchar_t *__restrict __dest,
  1200. + __const wchar_t *__restrict __src, size_t __n)
  1201. __THROW;
  1202. #endif /* use GNU */