diff options
-rw-r--r-- | ChangeLog | 42 | ||||
-rw-r--r-- | fedora/branch.mk | 4 | ||||
-rw-r--r-- | fedora/glibc.spec.in | 8 | ||||
-rw-r--r-- | libio/Makefile | 3 | ||||
-rw-r--r-- | libio/fileops.c | 11 | ||||
-rw-r--r-- | libio/genops.c | 2 | ||||
-rw-r--r-- | libio/libio.h | 1 | ||||
-rw-r--r-- | libio/tst-setvbuf1.c | 39 | ||||
-rw-r--r-- | libio/wfiledoalloc.c | 32 | ||||
-rw-r--r-- | libio/wgenops.c | 8 | ||||
-rw-r--r-- | libio/wmemstream.c | 2 | ||||
-rw-r--r-- | libio/wstrops.c | 6 | ||||
-rw-r--r-- | stdlib/Makefile | 2 | ||||
-rw-r--r-- | stdlib/strtod_l.c | 2 | ||||
-rw-r--r-- | stdlib/tst-strtod2.c | 25 | ||||
-rw-r--r-- | stdlib/tst-strtod3.c | 55 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/bits/statvfs.h | 6 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/clone.S | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/internal_statvfs.c | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S | 3 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/x86_64/clone.S | 4 |
21 files changed, 206 insertions, 57 deletions
@@ -1,3 +1,45 @@ +2006-12-13 Ulrich Drepper <drepper@redhat.com> + + * sysdeps/unix/sysv/linux/bits/statvfs.h: Define ST_RELATIME. + * sysdeps/unix/sysv/linux/internal_statvfs.c (__statvfs_getflags): + Handle relatime mount option. + + [BZ #2337] + * libio/Makefile (tests): Add tst-setvbuf1. + * libio/tst-setvbuf1.c: New file. + +2006-12-08 Jakub Jelinek <jakub@redhat.com> + + [BZ #2337] + * libio/genops.c (__uflow): Fix a typo. + * libio/wfiledoalloc.c (_IO_wfile_doallocate): Don't stat + nor set _IO_LINE_BUF bit here. Size the wide buffer based on + the narrow buffer size. + +2006-11-24 Jakub Jelinek <jakub@redhat.com> + + [BZ #2337] + * libio/libio.h (_IO_FLAGS2_USER_WBUF): Define. + * libio/wgenops.c (_IO_wsetb, _IO_wdefault_finish): Test and set + _IO_FLAGS2_USER_WBUF bit in _flags2 instead of _IO_USER_BUF bit + in _flags. + * libio/wstrops.c (_IO_wstr_overflow, enlarge_userbuf, + _IO_wstr_finish): Likewise. + * libio/wmemstream.c (open_wmemstream): Likewise. + * libio/fileops.c (_IO_new_file_close_it): Call _IO_set[bgp] + even for wide streams. + +2006-12-13 Jakub Jelinek <jakub@redhat.com> + + * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S: Include + kernel-features.h. + +2006-12-11 Ulrich Drepper <drepper@redhat.com> + + * stdlib/strtod_l.c (____STRTOF_INTERNAL): Parse thousand + separators also if no non-zero digits found. + * stdlib/Makefile (tests): Add tst-strtod3. + 2006-12-10 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/netlinkaccess.h: Include linux/if_addr.h diff --git a/fedora/branch.mk b/fedora/branch.mk index 41c73b2..3548ef2 100644 --- a/fedora/branch.mk +++ b/fedora/branch.mk @@ -3,5 +3,5 @@ glibc-branch := fedora glibc-base := HEAD DIST_BRANCH := devel COLLECTION := dist-fc7 -fedora-sync-date := 2006-12-10 10:06 UTC -fedora-sync-tag := fedora-glibc-20061210T1006 +fedora-sync-date := 2006-12-14 08:50 UTC +fedora-sync-tag := fedora-glibc-20061214T0850 diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in index 96fd4ac..1233cba 100644 --- a/fedora/glibc.spec.in +++ b/fedora/glibc.spec.in @@ -1,4 +1,4 @@ -%define glibcrelease 12 +%define glibcrelease 13 %define auxarches i586 i686 athlon sparcv9 alphaev6 %define xenarches i686 athlon %ifarch %{xenarches} @@ -1544,6 +1544,12 @@ rm -f *.filelist* %endif %changelog +* Thu Dec 14 2006 Jakub Jelinek <jakub@redhat.com> 2.5.90-13 +- fix setcontext on ppc32 (#219107) +- fix wide stdio after setvbuf (#217064, BZ#2337) +- handle realtime mount option in statvfs +- revert i?86/x86_64 clone CFI temporarily + * Sun Dec 10 2006 Jakub Jelinek <jakub@redhat.com> 2.5.90-12 - fix hasmntopt (#218802) - fix setusershell and getusershell (#218782) diff --git a/libio/Makefile b/libio/Makefile index 0529744..553fbda 100644 --- a/libio/Makefile +++ b/libio/Makefile @@ -57,7 +57,8 @@ tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc \ bug-ungetc2 bug-ftell bug-ungetc3 bug-ungetc4 tst-fopenloc2 \ tst-memstream1 tst-memstream2 \ tst-wmemstream1 tst-wmemstream2 \ - bug-memstream1 bug-wmemstream1 + bug-memstream1 bug-wmemstream1 \ + tst-setvbuf1 test-srcs = test-freopen all: # Make this the default target; it will be defined in Rules. diff --git a/libio/fileops.c b/libio/fileops.c index cf7fd65..dbd7a7a 100644 --- a/libio/fileops.c +++ b/libio/fileops.c @@ -174,14 +174,8 @@ _IO_new_file_close_it (fp) close_status = _IO_SYSCLOSE (fp); /* Free buffer. */ - if (fp->_mode <= 0) - { - INTUSE(_IO_setb) (fp, NULL, NULL, 0); - _IO_setg (fp, NULL, NULL, NULL); - _IO_setp (fp, NULL, NULL); - } #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T - else + if (fp->_mode > 0) { if (_IO_have_wbackup (fp)) INTUSE(_IO_free_wbackup_area) (fp); @@ -190,6 +184,9 @@ _IO_new_file_close_it (fp) _IO_wsetp (fp, NULL, NULL); } #endif + INTUSE(_IO_setb) (fp, NULL, NULL, 0); + _IO_setg (fp, NULL, NULL, NULL); + _IO_setp (fp, NULL, NULL); INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp); fp->_flags = _IO_MAGIC|CLOSED_FILEBUF_FLAGS; diff --git a/libio/genops.c b/libio/genops.c index 5f22352..8d62da7 100644 --- a/libio/genops.c +++ b/libio/genops.c @@ -367,7 +367,7 @@ __uflow (fp) #endif if (fp->_mode == 0) - _IO_fwide (fp, -11); + _IO_fwide (fp, -1); if (_IO_in_put_mode (fp)) if (INTUSE(_IO_switch_to_get_mode) (fp) == EOF) return EOF; diff --git a/libio/libio.h b/libio/libio.h index 6f9c418..428e035 100644 --- a/libio/libio.h +++ b/libio/libio.h @@ -142,6 +142,7 @@ #ifdef _LIBC # define _IO_FLAGS2_FORTIFY 4 #endif +#define _IO_FLAGS2_USER_WBUF 8 /* These are "formatting flags" matching the iostream fmtflags enum values. */ #define _IO_SKIPWS 01 diff --git a/libio/tst-setvbuf1.c b/libio/tst-setvbuf1.c new file mode 100644 index 0000000..9222d40 --- /dev/null +++ b/libio/tst-setvbuf1.c @@ -0,0 +1,39 @@ +/* Dereived from the test case in BZ #2337. */ +#include <errno.h> +#include <error.h> +#include <fcntl.h> +#include <locale.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <wchar.h> + + +static char buf[512] __attribute__ ((aligned (4096))); + + +static int +do_test (void) +{ + setlocale (LC_ALL, "de_DE.UTF-8"); + + FILE *fp = fdopen (dup (STDOUT_FILENO), "a"); + if (fp == NULL) + error (EXIT_FAILURE, errno, "fdopen(,\"a\")"); + + setvbuf (fp, buf, _IOFBF, sizeof (buf)); + + /* fwprintf to unbuffered stream. */ + fwprintf (fp, L"hello.\n"); + + fclose (fp); + + /* touch my buffer */ + buf[45] = 'a'; + + return 0; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/libio/wfiledoalloc.c b/libio/wfiledoalloc.c index 2f8140b..67a0517 100644 --- a/libio/wfiledoalloc.c +++ b/libio/wfiledoalloc.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1993, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1997, 1999, 2000, 2002, 2006 + 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,35 +86,20 @@ _IO_wfile_doallocate (fp) _IO_FILE *fp; { _IO_size_t size; - int couldbetty; wchar_t *p; - struct _G_stat64 st; /* Allocate room for the external buffer. */ if (fp->_IO_buf_base == NULL) INTUSE(_IO_file_doallocate) (fp); - if (fp->_fileno < 0 || _IO_SYSSTAT (fp, &st) < 0) - { - couldbetty = 0; - size = _IO_BUFSIZ; -#if 0 - /* do not try to optimise fseek() */ - fp->_flags |= __SNPT; -#endif - } - else - { - couldbetty = S_ISCHR (st.st_mode); -#if _IO_HAVE_ST_BLKSIZE - size = st.st_blksize <= 0 ? _IO_BUFSIZ : st.st_blksize; -#else - size = _IO_BUFSIZ; -#endif - } + /* If narrow buffer is user allocated (set by setvbuf etc.), + use that size as the size of the wide buffer, when it is + allocated by _IO_file_doallocate, multiply that by size + of the wide character. */ + size = fp->_IO_buf_end - fp->_IO_buf_base; + if ((fp->_flags & _IO_USER_BUF)) + size = (size + sizeof (wchar_t) - 1) / sizeof (wchar_t); ALLOC_WBUF (p, size * sizeof (wchar_t), EOF); INTUSE(_IO_wsetb) (fp, p, p + size, 1); - if (couldbetty && isatty (fp->_fileno)) - fp->_flags |= _IO_LINE_BUF; return 1; } diff --git a/libio/wgenops.c b/libio/wgenops.c index 355fd26..760a413 100644 --- a/libio/wgenops.c +++ b/libio/wgenops.c @@ -115,14 +115,14 @@ _IO_wsetb (f, b, eb, a) wchar_t *eb; int a; { - if (f->_wide_data->_IO_buf_base && !(f->_flags & _IO_USER_BUF)) + if (f->_wide_data->_IO_buf_base && !(f->_flags2 & _IO_FLAGS2_USER_WBUF)) FREE_BUF (f->_wide_data->_IO_buf_base, _IO_wblen (f) * sizeof (wchar_t)); f->_wide_data->_IO_buf_base = b; f->_wide_data->_IO_buf_end = eb; if (a) - f->_flags &= ~_IO_USER_BUF; + f->_flags2 &= ~_IO_FLAGS2_USER_WBUF; else - f->_flags |= _IO_USER_BUF; + f->_flags2 |= _IO_FLAGS2_USER_WBUF; } INTDEF(_IO_wsetb) @@ -198,7 +198,7 @@ _IO_wdefault_finish (fp, dummy) int dummy; { struct _IO_marker *mark; - if (fp->_wide_data->_IO_buf_base && !(fp->_flags & _IO_USER_BUF)) + if (fp->_wide_data->_IO_buf_base && !(fp->_flags2 & _IO_FLAGS2_USER_WBUF)) { FREE_BUF (fp->_wide_data->_IO_buf_base, _IO_wblen (fp) * sizeof (wchar_t)); diff --git a/libio/wmemstream.c b/libio/wmemstream.c index 5779318..7bf6a42 100644 --- a/libio/wmemstream.c +++ b/libio/wmemstream.c @@ -92,7 +92,7 @@ open_wmemstream (bufloc, sizeloc) _IO_fwide (&new_f->fp._sf._sbf._f, 1); _IO_wstr_init_static (&new_f->fp._sf._sbf._f, buf, _IO_BUFSIZ / sizeof (wchar_t), buf); - new_f->fp._sf._sbf._f._flags &= ~_IO_USER_BUF; + new_f->fp._sf._sbf._f._flags2 &= ~_IO_FLAGS2_USER_WBUF; new_f->fp._sf._s._allocate_buffer = (_IO_alloc_type) malloc; new_f->fp._sf._s._free_buffer = (_IO_free_type) free; diff --git a/libio/wstrops.c b/libio/wstrops.c index 8b862fb..c5aae7b 100644 --- a/libio/wstrops.c +++ b/libio/wstrops.c @@ -88,7 +88,7 @@ _IO_wstr_overflow (fp, c) pos = fp->_wide_data->_IO_write_ptr - fp->_wide_data->_IO_write_base; if (pos >= (_IO_size_t) (_IO_wblen (fp) + flush_only)) { - if (fp->_flags & _IO_USER_BUF) /* not allowed to enlarge */ + if (fp->_flags2 & _IO_FLAGS2_USER_WBUF) /* not allowed to enlarge */ return WEOF; else { @@ -182,7 +182,7 @@ enlarge_userbuf (_IO_FILE *fp, _IO_off64_t offset, int reading) _IO_ssize_t oldend = wd->_IO_write_end - wd->_IO_write_base; /* Try to enlarge the buffer. */ - if (fp->_flags & _IO_USER_BUF) + if (fp->_flags2 & _IO_FLAGS2_USER_WBUF) /* User-provided buffer. */ return 1; @@ -335,7 +335,7 @@ _IO_wstr_finish (fp, dummy) _IO_FILE *fp; int dummy; { - if (fp->_wide_data->_IO_buf_base && !(fp->_flags & _IO_USER_BUF)) + if (fp->_wide_data->_IO_buf_base && !(fp->_flags2 & _IO_FLAGS2_USER_WBUF)) (((_IO_strfile *) fp)->_s._free_buffer) (fp->_wide_data->_IO_buf_base); fp->_wide_data->_IO_buf_base = NULL; diff --git a/stdlib/Makefile b/stdlib/Makefile index 37400ec..64a237f 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -67,7 +67,7 @@ tests := tst-strtol tst-strtod testmb testrand testsort testdiv \ tst-xpg-basename tst-random tst-random2 tst-bsearch \ tst-limits tst-rand48 bug-strtod tst-setcontext \ test-a64l tst-qsort tst-system testmb2 bug-strtod2 \ - tst-atof1 tst-atof2 tst-strtod2 + tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 include ../Makeconfig diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c index b926aeb..b4e4819 100644 --- a/stdlib/strtod_l.c +++ b/stdlib/strtod_l.c @@ -721,7 +721,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc) c = *++cp; } - if (grouping && dig_no > 0) + if (grouping && cp > start_of_digits) { /* Check the grouping of the digits. */ #ifdef USE_WIDE_CHAR diff --git a/stdlib/tst-strtod2.c b/stdlib/tst-strtod2.c new file mode 100644 index 0000000..925ea9c --- /dev/null +++ b/stdlib/tst-strtod2.c @@ -0,0 +1,25 @@ +#include <stdio.h> +#include <stdlib.h> + +static int +do_test (void) +{ + int status = 0; + const char s[] = "0x"; + char *ep; + double r = strtod (s, &ep); + if (r != 0) + { + printf ("r = %g, expect 0\n", r); + status = 1; + } + if (ep != s + 1) + { + printf ("strtod parsed %ju characters, expected 1\n", ep - s); + status = 1; + } + return status; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/stdlib/tst-strtod3.c b/stdlib/tst-strtod3.c new file mode 100644 index 0000000..23abec1 --- /dev/null +++ b/stdlib/tst-strtod3.c @@ -0,0 +1,55 @@ +#include <locale.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +static const struct +{ + const char *in; + const char *out; + double expected; +} tests[] = + { + { "000,,,e1", ",,,e1", 0.0 }, + { "000e1", "", 0.0 }, + { "000,1e1", ",1e1", 0.0 } + }; +#define NTESTS (sizeof (tests) / sizeof (tests[0])) + + +static int +do_test (void) +{ + if (setlocale (LC_ALL, "en_US.ISO-8859-1") == NULL) + { + puts ("could not set locale"); + return 1; + } + + int status = 0; + + for (int i = 0; i < NTESTS; ++i) + { + char *ep; + double r = __strtod_internal (tests[i].in, &ep, 1); + + if (strcmp (ep, tests[i].out) != 0) + { + printf ("%d: got rest string \"%s\", expected \"%s\"\n", + i, ep, tests[i].out); + status = 1; + } + + if (r != tests[i].expected) + { + printf ("%d: got wrong results %g, expected %g\n", + i, r, tests[i].expected); + status = 1; + } + } + + return status; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/sysdeps/unix/sysv/linux/bits/statvfs.h b/sysdeps/unix/sysv/linux/bits/statvfs.h index cca0871..84717c3 100644 --- a/sysdeps/unix/sysv/linux/bits/statvfs.h +++ b/sysdeps/unix/sysv/linux/bits/statvfs.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1997,1998,2000,2001,2002,2006 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 @@ -101,7 +101,9 @@ enum # define ST_IMMUTABLE ST_IMMUTABLE ST_NOATIME = 1024, /* Do not update access times. */ # define ST_NOATIME ST_NOATIME - ST_NODIRATIME = 2048 /* Do not update directory access times. */ + ST_NODIRATIME = 2048, /* Do not update directory access times. */ # define ST_NODIRATIME ST_NODIRATIME + ST_RELATIME = 4096 /* Update atime relative to mtime/ctime. */ +# define ST_RELATIME ST_RELATIME #endif /* Use GNU. */ }; diff --git a/sysdeps/unix/sysv/linux/i386/clone.S b/sysdeps/unix/sysv/linux/i386/clone.S index f73a4b5..54524ec 100644 --- a/sysdeps/unix/sysv/linux/i386/clone.S +++ b/sysdeps/unix/sysv/linux/i386/clone.S @@ -120,9 +120,6 @@ L(pseudo_end): ret L(thread_start): - cfi_startproc; - /* Clearing frame pointer is insufficient, use CFI. */ - cfi_undefined (eip); /* Note: %esi is zero. */ movl %esi,%ebp /* terminate the stack frame */ #ifdef RESET_PID @@ -155,7 +152,6 @@ L(nomoregetpid): jmp L(haspid) .previous #endif - cfi_endproc; cfi_startproc PSEUDO_END (BP_SYM (__clone)) diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.c b/sysdeps/unix/sysv/linux/internal_statvfs.c index 73317ec..28c1cb6 100644 --- a/sysdeps/unix/sysv/linux/internal_statvfs.c +++ b/sysdeps/unix/sysv/linux/internal_statvfs.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2003, 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1998-2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -156,6 +156,8 @@ __statvfs_getflags (const char *name, int fstype, struct stat64 *st) result |= ST_NOATIME; else if (strcmp (opt, "nodiratime") == 0) result |= ST_NODIRATIME; + else if (strcmp (opt, "relatime") == 0) + result |= ST_RELATIME; /* We can stop looking for more entries. */ success = true; diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S index 7e9213c..1f2e250 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S @@ -1,5 +1,5 @@ /* Jump to a new context. - Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005, 2006 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 @@ -20,6 +20,7 @@ #include <sysdep.h> #include <rtld-global-offsets.h> #include <shlib-compat.h> +#include <kernel-features.h> #define __ASSEMBLY__ #include <asm/ptrace.h> diff --git a/sysdeps/unix/sysv/linux/x86_64/clone.S b/sysdeps/unix/sysv/linux/x86_64/clone.S index db42f20..8a12b09 100644 --- a/sysdeps/unix/sysv/linux/x86_64/clone.S +++ b/sysdeps/unix/sysv/linux/x86_64/clone.S @@ -89,9 +89,6 @@ L(pseudo_end): ret L(thread_start): - cfi_startproc; - /* Clearing frame pointer is insufficient, use CFI. */ - cfi_undefined (rip); /* Clear the frame pointer. The ABI suggests this be done, to mark the outermost frame obviously. */ xorl %ebp, %ebp @@ -116,7 +113,6 @@ L(thread_start): /* Call exit with return value from function call. */ movq %rax, %rdi call HIDDEN_JUMPTARGET (_exit) - cfi_endproc; cfi_startproc; PSEUDO_END (BP_SYM (__clone)) |