]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Updated to fedora-glibc-2_3-20050718T0425
authorRoland McGrath <roland@gnu.org>
Mon, 18 Jul 2005 04:41:16 +0000 (04:41 +0000)
committerRoland McGrath <roland@gnu.org>
Mon, 18 Jul 2005 04:41:16 +0000 (04:41 +0000)
96 files changed:
ChangeLog
config.h.in
config.make.in
configure.in
debug/chk_fail.c
elf/Makefile
elf/dl-close.c
elf/unload6.c [new file with mode: 0644]
elf/unload6mod1.c [new file with mode: 0644]
elf/unload6mod2.c [new file with mode: 0644]
elf/unload6mod3.c [new file with mode: 0644]
fedora/branch.mk
grp/putgrent.c
hesiod/README.hesiod
hesiod/hesiod.c
hesiod/hesiod_p.h
iconvdata/ibm930.h
iconvdata/ibm939.c
iconvdata/ibm939.h
iconvdata/testdata/IBM930..UTF8
iconvdata/testdata/IBM939..UTF8
include/rpc/pmap_clnt.h
include/stdlib.h
include/string.h
io/sys/sendfile.h
locale/iso-4217.def
localedata/ChangeLog
localedata/SUPPORTED
localedata/locales/fa_IR
localedata/locales/mn_MN
localedata/locales/pa_IN
localedata/locales/sr_CS [new file with mode: 0644]
malloc/Makefile
malloc/malloc.c
manual/string.texi
nis/nis_removemember.c
nis/nis_table.c
nis/nss_compat/compat-grp.c
nis/nss_compat/compat-pwd.c
nis/nss_compat/compat-spwd.c
nptl/ChangeLog
nptl/Makefile
nptl/pthread_create.c
nptl/sysdeps/pthread/bits/libc-lock.h
nptl/sysdeps/pthread/pthread.h
nptl/tst-cancel17.c
nptl/tst-initializers1.c [new file with mode: 0644]
nscd/Makefile
nscd/connections.c
nscd/nscd_helper.c
nscd/nscd_stat.c
nscd/selinux.c
posix/fnmatch.c
posix/regcomp.c
posix/regex_internal.c
posix/regex_internal.h
posix/regexec.c
pwd/putpwent.c
stdio-common/vfscanf.c
stdlib/random_r.c
stdlib/stdlib.h
string/Makefile
string/tst-strfry.c [new file with mode: 0644]
sunrpc/Makefile
sunrpc/bindrsvprt.c
sunrpc/pm_getmaps.c
sunrpc/pm_getport.c
sunrpc/pmap_rmt.c
sunrpc/rpc_main.c
sunrpc/tst-xdrmem.c [new file with mode: 0644]
sunrpc/xdr.c
sunrpc/xdr_stdio.c
sysdeps/generic/strnlen.c
sysdeps/ia64/strlen.S
sysdeps/posix/posix_fallocate.c
sysdeps/posix/posix_fallocate64.c
sysdeps/posix/sigignore.c
sysdeps/posix/signal.c
sysdeps/posix/sigset.c
sysdeps/posix/sysv_signal.c
sysdeps/s390/s390-64/bcopy.S
sysdeps/unix/sysv/linux/dl-execstack.c
sysdeps/unix/sysv/linux/ia64/has_cpuclock.c
sysdeps/unix/sysv/linux/if_index.c
sysdeps/unix/sysv/linux/ifaddrs.c
sysdeps/unix/sysv/linux/netlinkaccess.h
sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c
sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c
sysdeps/unix/sysv/linux/sleep.c
sysdeps/unix/sysv/linux/sys/quota.h
sysdeps/unix/sysv/linux/sysctl.c
sysdeps/unix/sysv/linux/system.c
time/Makefile
time/mktime.c
time/strptime_l.c
time/tst-strptime2.c [new file with mode: 0644]

index 755fcd696518897f6aca1faa3b6661575ce0312a..d21576710148bb4336ea0bcbb37434f04ed5c88c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,261 @@
+2005-07-15  Andreas Jaeger  <aj@suse.de>
+
+       [BZ #1079]
+       * include/stdlib.h: Remove malloc attribute from __posix_memalign.
+       * stdlib/stdlib.h: Likewise.
+
+2005-07-13  Ulrich Drepper  <drepper@redhat.com>
+
+       * nscd/nscd_helper.c: Add a few __builtin_expect.
+
+       [BZ #1080]
+       * nscd/connections.c (send_ro_fd): Make sure BUF is aligned correctly.
+       * nscd/nscd_helper.c (wait_on_socket): New function.
+       (get_mapping): Use wait_on_socket instead of poll.  The former handles
+       EINTR of poll correctly.
+       (__nscd_open_socket): Likewise.
+       (get_mapping): Make sure BUF is aligned correctly.
+       (get_mapping): Use munmap on correct pointer.
+
+2005-07-12  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #1106]
+       * sysdeps/unix/sysv/linux/ia64/has_cpuclock.c: Include not-cancel.h.
+       (has_cpuclock): Use open_not_cancel_2 instead of open, read_not_cancel
+       instead of read and close_not_cancel_no_status instead of close.
+
+       [BZ #1106]
+       * sysdeps/s390/s390-64/bcopy.S (__bcopy): Use
+       HIDDEN_BUILTIN_JUMPTARGET to jump to memmove.
+
+2005-07-05  Thorsten Kukuk  <kukuk@suse.de>
+
+       [BZ #1111]
+       * nis/nss_compat/compat-grp.c (internal_getgrgid_r): Check if NSS
+       module provides getgrgid_r.
+       (getgrnam_plusgroup): Preserve original return value.
+       * nis/nss_compat/compat-pwd.c (getpwnam_plususer): Preserve
+       original return value.
+       * nis/nss_compat/compat-spwd.c (getspnam_plususer): Likewise.
+
+2005-07-05  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1101]
+       * posix/regex_internal.c (build_wcs_buffer): Use MB_LEN_MAX not
+       MB_CUR_MAX.
+       (build_wcs_upper_buffer): Likewise.
+
+2005-06-16  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #1016]
+       * sysdeps/ia64/strlen.S (strlen): Change l2 into a local label.
+
+2005-06-23  Thorsten Kukuk  <kukuk@suse.de>
+
+       [BZ #1109]
+       * nscd/nscd_stat.c (receive_print_stats): Replace YESSTR/NOSTR
+       with own translation.
+
+2005-06-25  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #1097]
+       * sunrpc/xdr.c (xdr_hyper, xdr_u_hyper): When decoding, cast
+       t2 to uint32_t instead of ulong.
+       * sunrpc/Makefile (tests): Add tst-xdrmem.
+       * sunrpc/tst-xdrmem.c: New test.
+
+2005-06-20  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #653]
+       * sysdeps/unix/sysv/linux/sys/quota.h: Add definitions and types for
+       _LINUX_QUOTA_VERSION >= 2.
+       (_LINUX_QUOTA_VERSION): Define if not yet defined.
+
+2005-06-17  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1106]
+       * time/mktime.c: Always include <string.h> for prototype of
+       implicitly used memcpy.
+
+       [BZ #1104]
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c
+       (truncate64): Use __truncate, not truncate.
+       (__have_no_truncate64): Renamed from have_no_truncate64.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c
+       (__have_no_truncate64): Renamed from have_no_truncate64.
+
+2005-06-17  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1106]
+       * sysdeps/posix/sigignore.c: Include <string.h> to tell the compiler
+       to use __GI_memset.
+       * sysdeps/posix/signal.c: Likewise.
+       * sysdeps/posix/sigset.c: Likewise.
+       * sysdeps/posix/sysv_signal.c: Likewise.
+       * sysdeps/unix/sysv/linux/sleep.c: Likewise.
+       * sysdeps/unix/sysv/linux/sysctl.c: Likewise.
+       * sysdeps/unix/sysv/linux/system.c: Likewise.
+
+2005-06-15  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #1088]
+       * hesiod/hesiod.c (hesiod_init): Don't check for ctx->classes[0] == 0
+       or both classes equal here.
+       (parse_config_file): If both classes are equal, clear the second one.
+
+2005-06-08  Karl Kelley  <kekelley@iastate.edu>
+
+       [BZ #1088]
+       * hesiod/hesiod_p.h (struct hesiod_p): Add classes array.
+       * hesiod/hesiod.c (hesiod_init): Initialize classes.  Fail if no
+       valid classes were given or if both are equal.
+       (hesiod_resolve): Use ctx->classes instead of hardcoded C_IN
+       and C_HS order.
+       (parse_config_file): Handle classes keyword.
+       * hesiod/README.hesiod: Mention addition of the classes keyword.
+
+2005-06-14  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1085]
+       * configure.in: Add test for availability of libaudit.
+       * config.h.in: Define HAVE_LIBAUDIT.
+       * config.make.in: Define have-libaudit.
+       * nscd/Makefile: If libaudit is available, link nscd with it.
+       * nscd/selinux.c: If HAVE_LIBAUDIT is defined, log using libaudit.
+       Patch by Steve Grubb <sgrubb@redhat.com>.
+
+       [BZ #1083]
+       * sysdeps/posix/posix_fallocate64.c: Use __libc_pread64 instead of
+       __pread64.
+
+       [BZ #1087]
+       * include/string.h: Use libc_hidden_proto for strnlen.
+       * sysdeps/generic/strnlen.c: Add libc_hidden_def.
+
+2005-06-13  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #1096]
+       * sysdeps/unix/sysv/linux/netlinkaccess.h (__netlink_sendreq,
+       __netlink_receive): Remove prototypes.
+       (__netlink_request): New prototype.
+       * sysdeps/unix/sysv/linux/ifaddrs.c: Include <alloca.h> and
+       <stdint.h>.
+       (__netlink_sendreq): Make static.
+       (__netlink_receive): Rename to...
+       (__netlink_request): ... this.  Add type argument, call
+       __netlink_sendreq.  If MSG_TRUNC is set after recvmsg, retry
+       with a bigger buffer.  Don't record buffers that contain no
+       messages we are expecting.
+       (getifaddrs): Use __netlink_request instead of __netlink_sendreq
+       and __netlink_receive pairs.  Formatting.
+       * sysdeps/unix/sysv/linux/if_index.c (if_nameindex_netlink): Use
+       __netlink_request instead of __netlink_sendreq and __netlink_receive
+       pair.
+
+2005-05-23  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1086]
+       * sunrpc/bindrsvprt.c (LOWPORT): Apparently some mountd
+       implementations are broken and don't accept ports < 512.
+
+2005-05-22  Dmitry V. Levin  <ldv@altlinux.org>
+
+       [BZ #961]
+       * io/sys/sendfile.h: Remove __nonnull from sendfile and sendfile64
+       declarations.
+
+2005-05-23  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1086]
+       * sunrpc/pm_getport.c (__get_socket): New function.
+       (pmap_getport): Use it to open a non-reserved socket to the portmapper
+       for TCP.
+       * include/rpc/pmap_clnt.h (__get_socket): Declare.
+       * sunrpc/pm_getmaps.c (pmap_getmaps): Use __get_socket to get an
+       non-reserved socket for the portmapper.
+       Based on a patch by Steve Dickson <steved@redhat.com>.
+
+       [BZ #1086]
+       * sunrpc/bindrsvprt.c (bindresvport): Try harder to find a port.
+       If we tried looking at the usual range without success extend the
+       range to even lower ports.
+
+2005-05-19  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #955]
+       * iconvdata/ibm939.c (BODY): Avoid segfaults with input characters
+       <UFFFF> and above.
+
+2005-05-06  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #934]
+       * posix/regex_internal.h: Include bits/libc-lock.h or define dummy
+       __libc_lock_* macros if not _LIBC.
+       (struct re_dfa_t): Add lock.
+       * posix/regcomp.c (re_compile_internal): Add __libc_lock_init.
+       * posix/regexec.c (regexec, re_search_stub): Add locking.
+
+2005-04-29  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #1083]
+       * sysdeps/posix/posix_fallocate.c (posix_fallocate): If len == 0,
+       call ftruncate if offset is bigger than current size.  Make sure
+       the file is offset + len bytes long if that is more than current size.
+       Don't overwrite previous content of the file.
+       * sysdeps/posix/posix_fallocate64.c (__posix_fallocate64_l64):
+       Likewise.
+
+2005-04-29  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1093]
+       * nis/nis_table.c: Fix realloc handling.
+       * nis/nis_removemember.c: Likewise.
+
+2005-04-27  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1094]
+       * nscd/connections.c (nscd_run): Use time() value in prune_cache
+       call, not timeout value, since the latter might be from another clock.
+
 2005-04-27  Roland McGrath  <roland@redhat.com>
 
        [BZ #877]
        * posix/unistd.h: Remove __nonnull from acct decl.
 
+2005-04-26  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1105]
+       * time/strptime_l.c (__strptime_internal): Handle 'z' to set
+       tm_gmtoff.
+       * time/Makefile (tests): Add tst-strptime2.
+       * time/tst-strptime2.c: New file.
+
+2005-04-26  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #1081]
+       * elf/dl-close.c: Include stddef.h.
+       (_dl_close): If called recursively, just remember GC needs to be rerun
+       and decrease l_direct_opencount.  Avoid GC if l_direct_opencount
+       decreased to 1.  Rerun GC at the end if any destructor unloaded some
+       additional libraries.
+       * elf/Makefile: Add rules to build and run unload6 test.
+       * elf/unload6.c: New test.
+       * elf/unload6mod1.c: New file.
+       * elf/unload6mod2.c: New file.
+       * elf/unload6mod3.c: New file.
+
+2005-04-26  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1110]
+       * stdio-common/vfscanf.c: Correctly account for characters of
+       decimal points right after +-.
+
+2005-04-24  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1110]
+       * stdio-common/vfscanf.c: Fix parsing of decimal point after +-.
+       Patch by Hamed Malek <hamed@bamdad.org>.
+
 2005-04-14  Roland McGrath  <roland@redhat.com>
 
        [BZ #253]
        * posix/Makefile: Add rules to build and run tst-execvp3.
        * posix/tst-execvp3.c: New file.
 
+2005-04-12  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1090]
+       * stdlib/random_r.c (__initstate_r): Don't use non-existing state.
+       * string/tst-strfry.c: New file.
+       * string/Makefile (tests): Add tst-strfry.
+
+2005-04-11  James A. Morrison  <ja2morri@uwaterloo.ca>
+
+       * manual/string.texi: Fix typo in wmemcpy decl.
+
 2005-04-07  Roland McGrath  <roland@redhat.com>
 
        * po/libc.pot: Regenerated.
 
+2005-04-04  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #1082]
+       * sunrpc/pmap_rmt.c (xdr_rmtcall_args): Use a dummy arglen instead
+       of trying to encode uninitialized arglen.
+
+2005-03-29  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #1087]
+       * posix/fnmatch.c (fnmatch): For short patterns or strings attempt to
+       avoid calling mbsrtowcs twice.
+
+2005-02-27  Denis Barbier  <barbier@debian.org>
+
+       [BZ #549]
+       * locale/iso-4217.def: Add CSD currency.
+
+2005-03-21  Thorsten Kukuk  <kukuk@suse.de>
+
+       [BZ #1098]
+       * sunrpc/xdr_stdio.c (xdrstdio_getlong, xdrstdio_putlong):
+       Convert correctly between long/int on 64bit big-endian.
+
+2005-03-15  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #779]
+       * malloc/malloc.c (public_mTRIm): Initialize malloc if not yet
+       initialized.
+
+2005-03-05  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1101]
+       * posix/regex_internal.c [_LIBC] (build_wcs_buffer): Avoid using
+       dynamically sized array.
+       (build_wcs_upper_buffer): Likewise.
+
+2005-02-22  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #1095]
+       * malloc/Makefile (CFLAGS-mcheck-init.c): Add.
+       * sunrpc/Makefile: Add $(PIC-ccflag) to CFLAGS-x* for
+       librpcsvc.a objects.
+
+2005-02-21  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1107]
+       * iconvdata/ibm930.h: Correct Yen mapping.
+       * iconvdata/ibm939.h: Likewise.
+       * iconvdata/testdata/IBM930..UTF8: Adjust test data.
+       * iconvdata/testdata/IBM939..UTF8: Likewise.
+       Patch by Jiro Sekiba <SEKIBA@jp.ibm.com>.
+
+2005-02-11  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #1100]
+       * debug/chk_fail.c (__chk_fail): Add a while (1) loop around
+       __libc_message to kill GCC warning about noreturn function returning.
+
+2005-02-07  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/sysv/linux/dl-execstack.c: Include sysdep.h.
+       (_dl_make_stack_executable): Make sure registers are set correctly.
+
+2005-01-30  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1103]
+       * nscd/nscd_helper.c (get_mapping): Use MSG_NOSIGNAL if available.
+       * nscd/connections.c (send_ro_fd): Likewise.
+
+2005-01-26  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1100]
+       * debug/chk_fail.c (__chk_fail): Print program name in final message.
+
+2005-01-14  GOTO Masanori  <gotom@debian.or.jp>
+
+       [BZ #1108]
+       * sunrpc/rpc_main.c (s_output): Generate #include <rpc/pmap_clnt.h>
+       irrespective of Cflag.
+
+2005-01-11  Thorsten Kukuk  <kukuk@suse.de>
+
+       [BZ #1099]
+       * grp/putgrent.c (putgrent): Don't write 0 as group
+       ID if groupname starts with + or -.
+       * pwd/putpwent.c (putpwent): Don't write 0 as user or
+       group ID if user name starts with + or -.
+
 2005-04-05  Roland McGrath  <roland@redhat.com>
 
        * NEWS, version.h (VERSION): 2.3.5.
index db3defc6b09502bab86879329c46c1eab0acbce4..5406d41111261457b70588756d15679310970be9 100644 (file)
@@ -21,6 +21,9 @@
 /* Define if building with SELinux support.  Set by --with-selinux.  */
 #undef HAVE_SELINUX
 
+/* Defined if building with SELinux support & audit libs are detected. */
+#undef HAVE_LIBAUDIT
+
 /* Define if using XCOFF. Set by --with-xcoff.  */
 #undef HAVE_XCOFF
 
index 81cb95b77f42ead7ab920d1f1995a9eb68325a3f..222fb33bd333e5a631926abdad396f8f0540266b 100644 (file)
@@ -59,6 +59,7 @@ enable-check-abi = @enable_check_abi@
 have-forced-unwind = @libc_cv_forced_unwind@
 have-fpie = @libc_cv_fpie@
 have-selinux = @have_selinux@
+have-libaudit = @have_libaudit@
 have-cc-with-libunwind = @libc_cv_cc_with_libunwind@
 fno-unit-at-a-time = @fno_unit_at_a_time@
 bind-now = @bindnow@
index 559bee0173fb77f78ea204468c9133f790225e1a..ab4975e481862f7379d68689450fe3cbfa6fe585 100644 (file)
@@ -1965,6 +1965,14 @@ fi
 # Check if we're building with SELinux support.
 if test "x$have_selinux" = xyes; then
   AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
+
+  # See if we have the libaudit library
+  AC_CHECK_LIB(audit, audit_log_avc,
+              have_libaudit=yes, have_libaudit=no)
+  if test "x$have_libaudit" = xyes; then
+    AC_DEFINE(HAVE_LIBAUDIT,1,[SELinux libaudit support])
+  fi
+  AC_SUBST(have_libaudit)
 fi
 AC_SUBST(have_selinux)
 
index dc1c3d70b6cf2c1921dd6393fb9f83995995f2a9..987331bd9d477a516b1c8647ac88d90ec69c6d38 100644 (file)
 #include <stdlib.h>
 
 
+extern char **__libc_argv attribute_hidden;
+
 void
 __attribute__ ((noreturn))
 __chk_fail (void)
 {
-  __libc_fatal ("*** buffer overflow detected ***\n");
+  /* The loop is added only to keep gcc happy.  */
+  while (1)
+    __libc_message (1, "*** buffer overflow detected ***: %s terminated\n",
+                   __libc_argv[0] ?: "<unknown>");
 }
 libc_hidden_def (__chk_fail)
index 04ff7f42a12f202f6637deea274f14205648ce10..72aa0d9572123fc5a373715acedd32c799fa2c7e 100644 (file)
@@ -86,6 +86,7 @@ distribute    := rtld-Rules \
                   tst-deep1mod1.c tst-deep1mod2.c tst-deep1mod3.c \
                   unload3mod1.c unload3mod2.c unload3mod3.c unload3mod4.c \
                   unload4mod1.c unload4mod2.c unload4mod3.c unload4mod4.c \
+                  unload6mod1.c unload6mod2.c unload6mod3.c \
                   order2mod1.c order2mod2.c order2mod3.c order2mod4.c
 
 CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables
@@ -158,7 +159,7 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
         tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-align \
         tst-align2 $(tests-execstack-$(have-z-execstack)) tst-dlmodcount \
         tst-dlopenrpath tst-deep1 tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
-        unload3 unload4 unload5 tst-global1 order2
+        unload3 unload4 unload5 unload6 tst-global1 order2
 #       reldep9
 test-srcs = tst-pathopt
 tests-vis-yes = vismain
@@ -196,6 +197,7 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
                tst-dlmopen1mod \
                unload3mod1 unload3mod2 unload3mod3 unload3mod4 \
                unload4mod1 unload4mod2 unload4mod3 unload4mod4 \
+               unload6mod1 unload6mod2 unload6mod3 \
                order2mod1 order2mod2 order2mod3 order2mod4
 ifeq (yes,$(have-initfini-array))
 modules-names += tst-array2dep
@@ -433,6 +435,9 @@ $(objpfx)unload3mod2.so: $(objpfx)unload3mod3.so
 $(objpfx)unload3mod3.so: $(objpfx)unload3mod4.so
 $(objpfx)unload4mod1.so: $(objpfx)unload4mod2.so $(objpfx)unload4mod3.so
 $(objpfx)unload4mod2.so: $(objpfx)unload4mod4.so $(objpfx)unload4mod3.so
+$(objpfx)unload6mod1.so: $(libdl)
+$(objpfx)unload6mod2.so: $(libdl)
+$(objpfx)unload6mod3.so: $(libdl)
 
 LDFLAGS-tst-tlsmod5.so = -nostdlib
 LDFLAGS-tst-tlsmod6.so = -nostdlib
@@ -701,6 +706,10 @@ $(objpfx)unload5: $(libdl)
 $(objpfx)unload5.out: $(objpfx)unload3mod1.so $(objpfx)unload3mod2.so \
                      $(objpfx)unload3mod3.so $(objpfx)unload3mod4.so
 
+$(objpfx)unload6: $(libdl)
+$(objpfx)unload6.out: $(objpfx)unload6mod1.so $(objpfx)unload6mod2.so \
+                     $(objpfx)unload6mod3.so
+
 ifdef libdl
 $(objpfx)tst-tls9-static: $(common-objpfx)dlfcn/libdl.a
 $(objpfx)tst-tls9-static.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
index df4f5aed8732d795d2ee228c7ca52420291f2af2..f54cc03286d82dfecaeff5d8cd92375fb650753b 100644 (file)
@@ -20,6 +20,7 @@
 #include <assert.h>
 #include <dlfcn.h>
 #include <libintl.h>
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -105,9 +106,6 @@ _dl_close (void *_map)
   struct link_map *map = _map;
   unsigned int i;
   Lmid_t ns = map->l_ns;
-#ifdef USE_TLS
-  bool any_tls = false;
-#endif
 
   /* First see whether we can remove the object at all.  */
   if (__builtin_expect (map->l_flags_1 & DF_1_NODELETE, 0)
@@ -124,9 +122,17 @@ _dl_close (void *_map)
   /* One less direct use.  */
   --map->l_direct_opencount;
 
-  /* Decrement the reference count.  */
-  if (map->l_direct_opencount > 1 || map->l_type != lt_loaded)
+  /* If _dl_close is called recursively (some destructor call dlclose),
+     just record that the parent _dl_close will need to do garbage collection
+     again and return.  */
+  static enum { not_pending, pending, rerun } dl_close_state;
+
+  if (map->l_direct_opencount > 0 || map->l_type != lt_loaded
+      || dl_close_state != not_pending)
     {
+      if (map->l_direct_opencount == 0 && map->l_type == lt_loaded)
+       dl_close_state = rerun;
+
       /* There are still references to this object.  Do nothing more.  */
       if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
        GLRO(dl_debug_printf) ("\nclosing file=%s; direct_opencount == %u\n",
@@ -136,12 +142,18 @@ _dl_close (void *_map)
       return;
     }
 
+ retry:
+  dl_close_state = pending;
+
+#ifdef USE_TLS
+  bool any_tls = false;
+#endif
   const unsigned int nloaded = GL(dl_ns)[ns]._ns_nloaded;
   char used[nloaded];
   char done[nloaded];
   struct link_map *maps[nloaded];
 
-  /* Run over the list and assign indeces to the link maps and enter
+  /* Run over the list and assign indexes to the link maps and enter
      them into the MAPS array.  */
   int idx = 0;
   for (struct link_map *l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
@@ -278,7 +290,7 @@ _dl_close (void *_map)
          if (imap->l_searchlist.r_list == NULL
              && imap->l_initfini != NULL)
            {
-             /* The object is still used.  But the object we are
+             /* The object is still used.  But one of the objects we are
                 unloading right now is responsible for loading it.  If
                 the current object does not have it's own scope yet we
                 have to create one.  This has to be done before running
@@ -294,15 +306,27 @@ _dl_close (void *_map)
              imap->l_searchlist.r_nlist = cnt;
 
              for (cnt = 0; imap->l_scope[cnt] != NULL; ++cnt)
-               if (imap->l_scope[cnt] == &map->l_searchlist)
+               /* This relies on l_scope[] entries being always set either
+                  to its own l_symbolic_searchlist address, or some other map's
+                  l_searchlist address.  */
+               if (imap->l_scope[cnt] != &imap->l_symbolic_searchlist)
                  {
-                   imap->l_scope[cnt] = &imap->l_searchlist;
-                   break;
+                   struct link_map *tmap;
+
+                   tmap = (struct link_map *) ((char *) imap->l_scope[cnt]
+                                               - offsetof (struct link_map,
+                                                           l_searchlist));
+                   assert (tmap->l_ns == ns);
+                   if (tmap->l_idx != -1)
+                     {
+                       imap->l_scope[cnt] = &imap->l_searchlist;
+                       break;
+                     }
                  }
            }
 
          /* The loader is gone, so mark the object as not having one.
-            Note: l_idx == -1 -> object will be removed.  */
+            Note: l_idx != -1 -> object will be removed.  */
          if (imap->l_loader != NULL && imap->l_loader->l_idx != -1)
            imap->l_loader = NULL;
 
@@ -514,8 +538,12 @@ _dl_close (void *_map)
   _r_debug.r_state = RT_CONSISTENT;
   GLRO(dl_debug_state) ();
 
-  /* Release the lock.  */
+  /* Recheck if we need to retry, release the lock.  */
  out:
+  if (dl_close_state == rerun)
+    goto retry;
+
+  dl_close_state = not_pending;
   __rtld_lock_unlock_recursive (GL(dl_load_lock));
 }
 libc_hidden_def (_dl_close)
@@ -586,7 +614,7 @@ libc_freeres_fn (free_mem)
        free_slotinfo (&GL(dl_tls_dtv_slotinfo_list));
       else
 # endif
-        /* The first element of the list does not have to be deallocated.
+       /* The first element of the list does not have to be deallocated.
           It was allocated in the dynamic linker (i.e., with a different
           malloc), and in the static library it's in .bss space.  */
        free_slotinfo (&GL(dl_tls_dtv_slotinfo_list)->next);
diff --git a/elf/unload6.c b/elf/unload6.c
new file mode 100644 (file)
index 0000000..1efc7eb
--- /dev/null
@@ -0,0 +1,30 @@
+#include <dlfcn.h>
+#include <stdio.h>
+
+int
+main (void)
+{
+  void *h = dlopen ("unload6mod1.so", RTLD_LAZY);
+  if (h == NULL)
+    {
+      puts ("dlopen unload6mod1.so failed");
+      return 1;
+    }
+
+  int (*fn) (int);
+  fn = dlsym (h, "foo");
+  if (fn == NULL)
+    {
+      puts ("dlsym failed");
+      return 1;
+    }
+
+  int val = fn (16);
+  if (val != 24)
+    {
+      printf ("foo returned %d != 24\n", val);
+      return 1;
+    }
+
+  return 0;
+}
diff --git a/elf/unload6mod1.c b/elf/unload6mod1.c
new file mode 100644 (file)
index 0000000..24f2e5a
--- /dev/null
@@ -0,0 +1,16 @@
+#include <dlfcn.h>
+#include <stdio.h>
+
+int
+foo (int i)
+{
+  void *h = dlopen ("unload6mod2.so", RTLD_LAZY);
+  if (h == NULL)
+    {
+      puts ("dlopen unload6mod2.so failed");
+      return 1;
+    }
+
+  dlclose (h);
+  return i + 8;
+}
diff --git a/elf/unload6mod2.c b/elf/unload6mod2.c
new file mode 100644 (file)
index 0000000..980efa4
--- /dev/null
@@ -0,0 +1,23 @@
+#include <dlfcn.h>
+#include <stdio.h>
+#include <unistd.h>
+
+static void *h;
+
+static void __attribute__((constructor))
+mod2init (void)
+{
+  h = dlopen ("unload6mod3.so", RTLD_LAZY);
+  if (h == NULL)
+    {
+      puts ("dlopen unload6mod3.so failed");
+      fflush (stdout);
+      _exit (1);
+    }
+}
+
+static void __attribute__((destructor))
+mod2fini (void)
+{
+  dlclose (h);
+}
diff --git a/elf/unload6mod3.c b/elf/unload6mod3.c
new file mode 100644 (file)
index 0000000..7b29e1d
--- /dev/null
@@ -0,0 +1,23 @@
+#include <dlfcn.h>
+#include <stdio.h>
+#include <unistd.h>
+
+static void *h;
+
+static void __attribute__((constructor))
+mod3init (void)
+{
+  h = dlopen ("unload6mod1.so", RTLD_LAZY);
+  if (h == NULL)
+    {
+      puts ("dlopen unload6mod1.so failed");
+      fflush (stdout);
+      _exit (1);
+    }
+}
+
+static void __attribute__((destructor))
+mod3fini (void)
+{
+  dlclose (h);
+}
index 5c9f791034c1bd2639a3a09b18c5b1601ffc0f34..4e83198b679579c3778ada63cf993fe287e4ab6d 100644 (file)
@@ -3,5 +3,5 @@ glibc-branch := fedora-2_3
 glibc-base := glibc-2_3-branch
 DIST_BRANCH := FC-3
 COLLECTION := dist-fc3-updates-candidate
-fedora-2_3-sync-date := 2005-07-04 11:33 UTC
-fedora-2_3-sync-tag := fedora-glibc-2_3-20050704T1133
+fedora-2_3-sync-date := 2005-07-18 04:25 UTC
+fedora-2_3-sync-tag := fedora-glibc-2_3-20050718T0425
index cb9b6b1f79956802ecf8c23c5977b3f4946151c1..8280b0cb2f2d8a1ca89c85a39b49da324e390d72 100644 (file)
@@ -44,8 +44,13 @@ putgrent (gr, stream)
 
   flockfile (stream);
 
-  retval = fprintf (stream, "%s:%s:%u:",
-                   gr->gr_name, _S (gr->gr_passwd), gr->gr_gid);
+  if (gr->gr_name[0] == '+' || gr->gr_name[0] == '-')
+    retval = fprintf (stream, "%s:%s::",
+                     gr->gr_name, _S (gr->gr_passwd));
+  else
+    retval = fprintf (stream, "%s:%s:%lu:",
+                     gr->gr_name, _S (gr->gr_passwd),
+                     (unsigned long int) gr->gr_gid);
   if (__builtin_expect (retval, 0) < 0)
     {
       funlockfile (stream);
index 18cd5d45dd4ddf567a434aa3bd40ffb711993d17..259ce8d44756619176b7476240a4264c61202074 100644 (file)
@@ -71,6 +71,14 @@ will want to create your own.  It should look something like:
 
   rhs=.your.domain
   lhs=.ns
+  classes=in,hs
+
+The optional classes settings specifies which DNS classes Hesiod
+should do lookups in.  Possible values are IN (the preferred class)
+and  HS (the deprecated class, still used by some sites).
+You may specify both classes separated by a comma to try one class
+first and then the other if no entry is available in the first
+class.  The default value of the classes variable is `IN,HS'.
 
 The value of rhs can be overridden by the environment variable
 `HES_DOMAIN'.
index 7fffb310f1a741733c3e2dc6cb9dd108d025be91..b73aa3ce94ed2edbeae7b967a60f0774e14d0f93 100644 (file)
@@ -83,6 +83,9 @@ hesiod_init(void **context) {
        ctx->LHS = NULL;
        ctx->RHS = NULL;
        ctx->res = NULL;
+       /* Set default query classes. */
+       ctx->classes[0] = C_IN;
+       ctx->classes[1] = C_HS;
 
        configname = __secure_getenv("HESIOD_CONFIG");
        if (!configname)
@@ -234,15 +237,12 @@ hesiod_resolve(void *context, const char *name, const char *type) {
                return (NULL);
        }
 
-       if ((retvec = get_txt_records(ctx, C_IN, bindname))) {
-               free(bindname);
-               return (retvec);
-       }
+       retvec = get_txt_records(ctx, ctx->classes[0], bindname);
+
+       if (retvec == NULL && (errno == ENOENT || errno == ECONNREFUSED) && ctx->classes[1])
+               retvec = get_txt_records(ctx, ctx->classes[1], bindname);
 
-       if (errno != ENOENT && errno != ECONNREFUSED)
-               return (NULL);
 
-       retvec = get_txt_records(ctx, C_HS, bindname);
        free(bindname);
        return (retvec);
 }
@@ -261,7 +261,6 @@ hesiod_free_list(void *context, char **list) {
  */
 static int
 parse_config_file(struct hesiod_p *ctx, const char *filename) {
-       char *key, *data, *cp, **cpp;
        char buf[MAXDNAME+7];
        FILE *fp;
 
@@ -272,6 +271,9 @@ parse_config_file(struct hesiod_p *ctx, const char *filename) {
        free(ctx->RHS);
        free(ctx->LHS);
        ctx->RHS = ctx->LHS = 0;
+       /* Set default query classes. */
+       ctx->classes[0] = C_IN;
+       ctx->classes[1] = C_HS;
 
        /*
         * Now open and parse the file...
@@ -280,6 +282,8 @@ parse_config_file(struct hesiod_p *ctx, const char *filename) {
                return (-1);
 
        while (fgets(buf, sizeof(buf), fp) != NULL) {
+               char *key, *data, *cp, **cpp;
+
                cp = buf;
                if (*cp == '#' || *cp == '\n' || *cp == '\r')
                        continue;
@@ -297,17 +301,36 @@ parse_config_file(struct hesiod_p *ctx, const char *filename) {
                        cp++;
                *cp++ = '\0';
 
-               if (strcmp(key, "lhs") == 0)
+               cpp = NULL;
+               if (strcasecmp(key, "lhs") == 0)
                        cpp = &ctx->LHS;
-               else if (strcmp(key, "rhs") == 0)
+               else if (strcasecmp(key, "rhs") == 0)
                        cpp = &ctx->RHS;
-               else
-                       continue;
-
-               *cpp = malloc(strlen(data) + 1);
-               if (!*cpp)
-                       goto cleanup;
-               strcpy(*cpp, data);
+               if (cpp) {
+                       *cpp = strdup(data);
+                       if (!*cpp)
+                               goto cleanup;
+               } else if (strcasecmp(key, "classes") == 0) {
+                       int n = 0;
+                       while (*data && n < 2) {
+                               cp = strchrnul(data, ',');
+                               if (*cp != '\0')
+                                       *cp++ = '\0';
+                               if (strcasecmp(data, "IN") == 0)
+                                       ctx->classes[n++] = C_IN;
+                               else if (strcasecmp(data, "HS") == 0)
+                                       ctx->classes[n++] = C_HS;
+                               data = cp;
+                       }
+                       if (n == 0) {
+                               /* Restore the default.  Better than
+                                  nother at all.  */
+                               ctx->classes[0] = C_IN;
+                               ctx->classes[1] = C_HS;
+                       } else if (n == 1
+                                  || ctx->classes[0] == ctx->classes[1])
+                               ctx->classes[1] = 0;
+               }
        }
        fclose(fp);
        return (0);
index 71aca0976d54a68e57b7f0f8bd2e0889555c1275..5010d71bc91879c46e3ece62d951d442835fb9af 100644 (file)
@@ -41,6 +41,7 @@ struct hesiod_p {
        void            (*res_set)(struct hesiod_p *, struct __res_state *,
                                   void (*)(void *));
        struct __res_state * (*res_get)(struct hesiod_p *);
+       int             classes[2];     /* The class search order. */
 };
 
 #define MAX_HESRESP    1024
index cbf24c39c2c6f51aeb5d5116dc3d4fe1e4f6262f..739a88fe9ddfea058a419128fb54389709dee151 100644 (file)
@@ -45,7 +45,7 @@ static const uint16_t __ibm930sb_to_ucs4[256] =
   /* 0x40 */ 0x0020, 0xFF61, 0xFF62, 0xFF63, 0xFF64, 0xFF65, 0xFF66, 0xFF67,
   /* 0x48 */ 0xFF68, 0xFF69, 0x00A3, 0x002E, 0x003C, 0x0028, 0x002B, 0x007C,
   /* 0x50 */ 0x0026, 0xFF6A, 0xFF6B, 0xFF6C, 0xFF6D, 0xFF6E, 0xFF6F, 0x0000,
-  /* 0x58 */ 0xFF70, 0x0000, 0x0021, 0x005C, 0x002A, 0x0029, 0x003B, 0x00AC,
+  /* 0x58 */ 0xFF70, 0x0000, 0x0021, 0x00A5, 0x002A, 0x0029, 0x003B, 0x00AC,
   /* 0x60 */ 0x002D, 0x002F, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066,
   /* 0x68 */ 0x0067, 0x0068, 0x0000, 0x002C, 0x0025, 0x005F, 0x003E, 0x003F,
   /* 0x70 */ 0x005B, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
index aae08ba3d10326b9a7d96de792a10551002b77f9..50b083f4925067d620d6c38180f13f4730d20b23 100644 (file)
@@ -1,5 +1,5 @@
 /* Conversion to and from IBM939.
-   Copyright (C) 2000-2002 Free Software Foundation, Inc.
+   Copyright (C) 2000-2002, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Masahide Washizawa <washi@yamato.ibm.co.jp>, 2000.
 
@@ -200,16 +200,14 @@ enum
     if (__builtin_expect (ch >= 0xffff, 0))                                  \
       {                                                                              \
        UNICODE_TAG_HANDLER (ch, 4);                                          \
-       rp1 = NULL;                                                           \
-       rp2 = NULL;                                                           \
+       goto ibm939_invalid_char;                                             \
       }                                                                              \
-    else                                                                     \
-      while (ch > rp1->end)                                                  \
-       ++rp1;                                                                \
+                                                                             \
+    while (ch > rp1->end)                                                    \
+      ++rp1;                                                                 \
                                                                              \
     /* Use the UCS4 table for single byte.  */                               \
-    if (__builtin_expect (rp1 == NULL, 0)                                    \
-       || __builtin_expect (ch < rp1->start, 0)                              \
+    if (__builtin_expect (ch < rp1->start, 0)                                \
        || (cp = __ucs4_to_ibm939sb[ch + rp1->idx],                           \
            __builtin_expect (cp[0], L'\1') == L'\0' && ch != '\0'))          \
       {                                                                              \
@@ -217,12 +215,12 @@ enum
        while (ch > rp2->end)                                                 \
          ++rp2;                                                              \
                                                                              \
-       if (__builtin_expect (rp2 == NULL, 0)                                 \
-           || __builtin_expect (ch < rp2->start, 0)                          \
+       if (__builtin_expect (ch < rp2->start, 0)                             \
            || (cp = __ucs4_to_ibm939db[ch + rp2->idx],                       \
                __builtin_expect (cp[0], L'\1')==L'\0' && ch != '\0'))        \
          {                                                                   \
            /* This is an illegal character.  */                              \
+         ibm939_invalid_char:                                                \
            STANDARD_TO_LOOP_ERR_HANDLER (4);                                 \
          }                                                                   \
        else                                                                  \
index 0597294ac665f1adeeaabe07ed34a2449d8a6b82..900a5e2445c9ca0f7b9a211c14d66d93ec9fc8e6 100644 (file)
@@ -56,7 +56,7 @@ static const uint16_t __ibm939sb_to_ucs4[256] =
   /* 0x98 */ 0x0071, 0x0072, 0xFF89, 0xFF8A, 0xFF8B, 0xFF8C, 0xFF8D, 0xFF8E,
   /* 0xa0 */ 0x203E, 0x007E, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078,
   /* 0xa8 */ 0x0079, 0x007A, 0xFF8F, 0xFF90, 0xFF91, 0x005B, 0xFF92, 0xFF93,
-  /* 0xb0 */ 0x005E, 0x00A3, 0x005C, 0xFF94, 0xFF95, 0xFF96, 0xFF97, 0xFF98,
+  /* 0xb0 */ 0x005E, 0x00A3, 0x00A5, 0xFF94, 0xFF95, 0xFF96, 0xFF97, 0xFF98,
   /* 0xb8 */ 0xFF99, 0xFF9A, 0xFF9B, 0xFF9C, 0xFF9D, 0x005D, 0xFF9E, 0xFF9F,
   /* 0xc0 */ 0x007B, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
   /* 0xc8 */ 0x0048, 0x0049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
index 89df7f15ac5cf41bf1ba0e7941884a6fb47bf352..639a16fdacca776c3d551ad9d0bef150d6c56f40 100644 (file)
Binary files a/iconvdata/testdata/IBM930..UTF8 and b/iconvdata/testdata/IBM930..UTF8 differ
index 89df7f15ac5cf41bf1ba0e7941884a6fb47bf352..639a16fdacca776c3d551ad9d0bef150d6c56f40 100644 (file)
Binary files a/iconvdata/testdata/IBM939..UTF8 and b/iconvdata/testdata/IBM939..UTF8 differ
index 2d02ff20964fc2596b38ff909b3dba5de2024633..9a2208228758761482eefbadc7d09876f67e0cae 100644 (file)
@@ -5,4 +5,8 @@ libc_hidden_proto (pmap_getport)
 libc_hidden_proto (pmap_set)
 libc_hidden_proto (pmap_unset)
 
+/* Defined in pm_getport.c.  */
+extern int __get_socket (struct sockaddr_in *saddr)
+     attribute_hidden internal_function;
+
 #endif
index 7723bf68561c4ac861e4e4535a498b74f8758d37..49e87576f3c08765c028e8ec87c3e3cd904d559f 100644 (file)
@@ -95,8 +95,8 @@ extern int __cxa_atexit_internal (void (*func) (void *), void *arg, void *d)
 
 extern void __cxa_finalize (void *d);
 
-extern int __posix_memalign (void **memptr, size_t alignment, size_t size)
-     __attribute_malloc__;
+extern int __posix_memalign (void **memptr, size_t alignment, size_t size);
+
 extern void *__libc_memalign (size_t alignment, size_t size)
      __attribute_malloc__;
 
index 738dd8e27c83b0a1b3ac40acc80c663cc32a7d1d..532d5ed33300a07a826838dc5449a4f08554d700 100644 (file)
@@ -96,6 +96,7 @@ libc_hidden_builtin_proto (strcmp)
 libc_hidden_builtin_proto (strcpy)
 libc_hidden_builtin_proto (strcspn)
 libc_hidden_builtin_proto (strlen)
+libc_hidden_builtin_proto (strnlen)
 libc_hidden_builtin_proto (strncmp)
 libc_hidden_builtin_proto (strncpy)
 libc_hidden_builtin_proto (strpbrk)
index 24256b5414df3fdcef7811e14736459b8b796c34..4c1367b6be75a8edf42709a8b40ad00b113f6b15 100644 (file)
@@ -32,19 +32,19 @@ __BEGIN_DECLS
    case of error.  */
 #ifndef __USE_FILE_OFFSET64
 extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *__offset,
-                        size_t __count) __THROW __nonnull ((3));
+                        size_t __count) __THROW;
 #else
 # ifdef __REDIRECT_NTH
 extern ssize_t __REDIRECT_NTH (sendfile,
                               (int __out_fd, int __in_fd, __off64_t *__offset,
-                               size_t __count), sendfile64) __nonnull ((3));
+                               size_t __count), sendfile64);
 # else
 #  define sendfile sendfile64
 # endif
 #endif
 #ifdef __USE_LARGEFILE64
 extern ssize_t sendfile64 (int __out_fd, int __in_fd, __off64_t *__offset,
-                          size_t __count) __THROW __nonnull ((3));
+                          size_t __count) __THROW;
 #endif
 
 __END_DECLS
index 01a69950dc94ed62e814582054af9046fb01909d..b7c05a351d0296a8e2f5caf61a9b30d5c04727a8 100644 (file)
@@ -43,6 +43,7 @@ DEFINE_INT_CURR("CLP")                /* Chilean Peso  */
 DEFINE_INT_CURR("CNY")         /* China Yuan Renminbi  */
 DEFINE_INT_CURR("COP")         /* Colombian Peso  */
 DEFINE_INT_CURR("CRC")         /* Costa Rican Colon  */
+DEFINE_INT_CURR("CSD")         /* Serbian Dinar  */
 DEFINE_INT_CURR("CUP")         /* Cuban Peso  */
 DEFINE_INT_CURR("CVE")         /* Cape Verde Escudo  */
 DEFINE_INT_CURR("CYP")         /* Cypriot Pound  */
index 6ec526dc1ff384391c2210ccbbf4f811d18bbced..c04fe161e5513dfdabeceadc63c41cb7d281543d 100644 (file)
@@ -1,8 +1,48 @@
+2005-05-28  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #622]
+       * locales/pa_IN (am_pm): Fix typos.
+       Patch by Denis Barbier <barbier@linuxfr.org>.
+
+2005-05-22  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1092]
+       * locales/mn_MN: Update.  Patch by Sanlig Badral <s_badral@yahoo.com>.
+
+2005-04-28  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #1084]
+       * SUPPORTED: Add UTF-8 locales where UTF-8 was not already supported.
+
+2005-04-26  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1091]
+       * locales/fa_IR: Add alt_digits, change date and time
+       representation, and various cleanups.
+       Patch by Hamed Malek <hamed@bamdad.org>.
+
 2005-03-21  Jakub Jelinek  <jakub@redhat.com>
 
        [BZ #823]
        * charmaps/WINDOWS-31J: Add % before alias keyword.
 
+2005-03-18  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #1084]
+       * SUPPORTED (SUPPORTED-LOCALES): Add af_ZA.UTF-8.
+
+2005-02-27  Denis Barbier  <barbier@debian.org>
+
+       [BZ #38]
+       * locales/sr_CS: New file.
+       Contributed by Danilo Segan <dsegan@gmx.net>
+       * SUPPORTED: Add sr_CS/ISO-8859-5 and sr_CS.UTF-8/UTF-8.
+
+2005-03-18  Andreas Schwab  <schwab@suse.de>
+
+       [BZ #622]
+       * locales/pa_IN (am_pm): Fix character names.
+
 2004-12-19  Roland McGrath  <roland@frob.com>
 
        * gen-unicode-ctype.c (output_tables): Fix email address in output.
index b5865ef856569b14a06c4eb8d5ea3523a1095d9b..5f8acd14c159c757360aed9272862f475d74ce1e 100644 (file)
@@ -1,12 +1,15 @@
 # This file names the currently supported and somewhat tested locales.
 # If you have any additions please file a glibc bug report.
 SUPPORTED-LOCALES=\
+aa_DJ.UTF-8/UTF-8 \
 aa_DJ/ISO-8859-1 \
 aa_ER/UTF-8 \
 aa_ER@saaho/UTF-8 \
 aa_ET/UTF-8 \
+af_ZA.UTF-8/UTF-8 \
 af_ZA/ISO-8859-1 \
 am_ET/UTF-8 \
+an_ES.UTF-8/UTF-8 \
 an_ES/ISO-8859-15 \
 ar_AE.UTF-8/UTF-8 \
 ar_AE/ISO-8859-6 \
@@ -50,8 +53,10 @@ bg_BG.UTF-8/UTF-8 \
 bg_BG/CP1251 \
 bn_BD/UTF-8 \
 bn_IN/UTF-8 \
+br_FR.UTF-8/UTF-8 \
 br_FR/ISO-8859-1 \
 br_FR@euro/ISO-8859-15 \
+bs_BA.UTF-8/UTF-8 \
 bs_BA/ISO-8859-2 \
 byn_ER/UTF-8 \
 ca_ES.UTF-8/UTF-8 \
@@ -179,6 +184,7 @@ fr_LU@euro/ISO-8859-15 \
 ga_IE.UTF-8/UTF-8 \
 ga_IE/ISO-8859-1 \
 ga_IE@euro/ISO-8859-15 \
+gd_GB.UTF-8/UTF-8 \
 gd_GB/ISO-8859-15 \
 gez_ER/UTF-8 \
 gez_ER@abegede/UTF-8 \
@@ -210,7 +216,9 @@ iw_IL.UTF-8/UTF-8 \
 iw_IL/ISO-8859-8 \
 ja_JP.EUC-JP/EUC-JP \
 ja_JP.UTF-8/UTF-8 \
+ka_GE.UTF-8/UTF-8 \
 ka_GE/GEORGIAN-PS \
+kk_KZ.UTF-8/UTF-8 \
 kk_KZ/PT154 \
 kl_GL.UTF-8/UTF-8 \
 kl_GL/ISO-8859-1 \
@@ -219,12 +227,14 @@ ko_KR.EUC-KR/EUC-KR \
 ko_KR.UTF-8/UTF-8 \
 kw_GB.UTF-8/UTF-8 \
 kw_GB/ISO-8859-1 \
+lg_UG.UTF-8/UTF-8 \
 lg_UG/ISO-8859-10 \
 lo_LA/UTF-8 \
 lt_LT.UTF-8/UTF-8 \
 lt_LT/ISO-8859-13 \
 lv_LV.UTF-8/UTF-8 \
 lv_LV/ISO-8859-13 \
+mi_NZ.UTF-8/UTF-8 \
 mi_NZ/ISO-8859-13 \
 mk_MK.UTF-8/UTF-8 \
 mk_MK/ISO-8859-5 \
@@ -248,8 +258,10 @@ nn_NO.UTF-8/UTF-8 \
 nn_NO/ISO-8859-1 \
 no_NO.UTF-8/UTF-8 \
 no_NO/ISO-8859-1 \
+oc_FR.UTF-8/UTF-8 \
 oc_FR/ISO-8859-1 \
 om_ET/UTF-8 \
+om_KE.UTF-8/UTF-8 \
 om_KE/ISO-8859-1 \
 pa_IN/UTF-8 \
 pl_PL.UTF-8/UTF-8 \
@@ -272,12 +284,17 @@ sk_SK.UTF-8/UTF-8 \
 sk_SK/ISO-8859-2 \
 sl_SI.UTF-8/UTF-8 \
 sl_SI/ISO-8859-2 \
+so_DJ.UTF-8/UTF-8 \
 so_DJ/ISO-8859-1 \
 so_ET/UTF-8 \
+so_KE.UTF-8/UTF-8 \
 so_KE/ISO-8859-1 \
+so_SO.UTF-8/UTF-8 \
 so_SO/ISO-8859-1 \
 sq_AL.UTF-8/UTF-8 \
 sq_AL/ISO-8859-1 \
+sr_CS.UTF-8/UTF-8 \
+sr_CS/ISO-8859-5 \
 st_ZA.UTF-8/UTF-8 \
 st_ZA/ISO-8859-1 \
 sv_FI.UTF-8/UTF-8 \
@@ -288,12 +305,14 @@ sv_SE/ISO-8859-1 \
 sv_SE.ISO-8859-15/ISO-8859-15 \
 ta_IN/UTF-8 \
 te_IN/UTF-8 \
+tg_TJ.UTF-8/UTF-8 \
 tg_TJ/KOI8-T \
 th_TH.UTF-8/UTF-8 \
 th_TH/TIS-620 \
 ti_ER/UTF-8 \
 ti_ET/UTF-8 \
 tig_ER/UTF-8 \
+tl_PH.UTF-8/UTF-8 \
 tl_PH/ISO-8859-1 \
 tr_TR.UTF-8/UTF-8 \
 tr_TR/ISO-8859-9 \
@@ -310,6 +329,7 @@ wa_BE@euro/ISO-8859-15 \
 wa_BE.UTF-8/UTF-8 \
 xh_ZA.UTF-8/UTF-8 \
 xh_ZA/ISO-8859-1 \
+yi_US.UTF-8/UTF-8 \
 yi_US/CP1255 \
 zh_CN.GB18030/GB18030 \
 zh_CN.GBK/GBK \
@@ -317,6 +337,7 @@ zh_CN.UTF-8/UTF-8 \
 zh_CN/GB2312 \
 zh_HK.UTF-8/UTF-8 \
 zh_HK/BIG5-HKSCS \
+zh_SG.UTF-8/UTF-8 \
 zh_SG.GBK/GBK \
 zh_SG/GB2312 \
 zh_TW.EUC-TW/EUC-TW \
index 8f65b1edd89f02ce1abc9a0bb4da9b11a8c43c5e..15fb535640c53f321160d676c12232c0b0d4375b 100644 (file)
@@ -10,8 +10,8 @@ escape_char  /
 % Fax: +98 21 6019568
 % Language: fa
 % Territory: IR
-% Revision: 2.4
-% Date: 2004-09-04
+% Revision: 3.0
+% Date: 2005-04-06
 % Users: general
 % Repertoiremap:
 % Charset: UTF-8
@@ -28,28 +28,31 @@ tel        "+98 21 6022372"
 fax        "+98 21 6019568"
 language   "Persian"
 territory  "Iran"
-revision   "2.3"
-date       "2004-03-16"
+revision   "3.0"
+date       "2005-04-06"
 %
-category  "fa_IR:2004";LC_IDENTIFICATION
-category  "fa_IR:2004";LC_CTYPE
-category  "fa_IR:2004";LC_COLLATE
-category  "fa_IR:2004";LC_TIME
-category  "fa_IR:2004";LC_NUMERIC
-category  "fa_IR:2004";LC_MONETARY
-category  "fa_IR:2004";LC_MESSAGES
-category  "fa_IR:2004";LC_PAPER
-category  "fa_IR:2004";LC_NAME
-category  "fa_IR:2004";LC_ADDRESS
-category  "fa_IR:2004";LC_TELEPHONE
+category  "fa_IR:2005";LC_IDENTIFICATION
+category  "fa_IR:2005";LC_CTYPE
+category  "fa_IR:2005";LC_COLLATE
+category  "fa_IR:2005";LC_TIME
+category  "fa_IR:2005";LC_NUMERIC
+category  "fa_IR:2005";LC_MONETARY
+category  "fa_IR:2005";LC_MESSAGES
+category  "fa_IR:2005";LC_PAPER
+category  "fa_IR:2005";LC_NAME
+category  "fa_IR:2005";LC_ADDRESS
+category  "fa_IR:2005";LC_TELEPHONE
 
 END LC_IDENTIFICATION
 
 LC_CTYPE
 copy "i18n"
 
+% Persian uses the alternate digits U+06F0..U+06F9
 outdigit <U06F0>..<U06F9>
 
+% This is used in the scanf family of functions to read Persian numbers
+% using "%Id" and such.
 map to_inpunct; /
   (<U0030>,<U06F0>); /
   (<U0031>,<U06F1>); /
@@ -64,6 +67,8 @@ map to_inpunct; /
   (<U002E>,<U066B>); /
   (<U002C>,<U066C>)
 
+% This is used in the printf family of functions to write Persian floating
+% point numbers using "%If" and such.
 map to_outpunct; /
   (<U002E>,<U066B>); /
   (<U002C>,<U066C>)
@@ -76,7 +81,7 @@ copy "iso14651_t1"
 % kinds), BEH, PEH, TEH, JEEM, TCHEH, HAH, KHAH, DAL, THAL, REH, ZAIN, JEH,
 % SEEN, SHEEN, SAD, DAD, TAH, ZAH, AIN, GHAIN, FEH, QAF, KAF, GAF, LAM,
 % MEEM, NOON, WAW, HEH, YEH.
-% The various kind of HAMZA are sorted as ALEF WITH HAMZA ABOVE, ALEF WITH
+% The various kinds of HAMZA are sorted as ALEF WITH HAMZA ABOVE, ALEF WITH
 % HAMZA BELOW, WAW WITH HAMZA ABOVE, YEH WITH HAMZA ABOVE.
 
 collating-symbol <AHY> % accent hamza over yeh
@@ -122,7 +127,7 @@ reorder-after <waw>
 <heh>
 <yeh>
 
-% Persian uses fatha, kasra, damma, fathatan, kasratan, dammatan order.
+% Persian uses this order: Fatha, Kasra, Damma, Fathatan, Kasratan, Dammatan.
 
 reorder-after <U066D>
 <U064E> IGNORE;IGNORE;IGNORE;<U064E> %<fatha_no>
@@ -148,7 +153,7 @@ reorder-after <UFE7F>
 <U0655> IGNORE;IGNORE;IGNORE;<U0655> %<hamzabelow_no>
 <U0670> IGNORE;IGNORE;IGNORE;<U0670> %<supalef_no>
 
-% Persian digits are sorted before Arabic ones: they are the basic forms.
+% The Persian digits are sorted before the Arabic ones: they are the basic forms.
 reorder-after <U0660>
 <U06F0> <0>;<BAS>;<MIN>;IGNORE
 <U0660> <0>;<PCL>;<MIN>;IGNORE
@@ -292,14 +297,72 @@ grouping          3
 END LC_NUMERIC
 
 LC_TIME
-abday   "<U06CC><U002E>";"<U062F><U002E>";"<U0633><U002E>";/
-        "<U0686><U002E>";"<U067E><U002E>";"<U062C><U002E>";/
-        "<U0634><U002E>"
-day     "<U06CC><U06A9><U200C><U0634><U0646><U0628><U0647>";/
+% Alternative digits are used for Persian numerals in date and time. This is
+% a hack, until a new prefix is defined for alternative digits.
+alt_digits     "<U06F0><U06F0>";"<U06F0><U06F1>";/
+               "<U06F0><U06F2>";"<U06F0><U06F3>";/
+               "<U06F0><U06F4>";"<U06F0><U06F5>";/
+               "<U06F0><U06F6>";"<U06F0><U06F7>";/
+               "<U06F0><U06F8>";"<U06F0><U06F9>";/
+               "<U06F1><U06F0>";"<U06F1><U06F1>";/
+               "<U06F1><U06F2>";"<U06F1><U06F3>";/
+               "<U06F1><U06F4>";"<U06F1><U06F5>";/
+               "<U06F1><U06F6>";"<U06F1><U06F7>";/
+               "<U06F1><U06F8>";"<U06F1><U06F9>";/
+               "<U06F2><U06F0>";"<U06F2><U06F1>";/
+               "<U06F2><U06F2>";"<U06F2><U06F3>";/
+               "<U06F2><U06F4>";"<U06F2><U06F5>";/
+               "<U06F2><U06F6>";"<U06F2><U06F7>";/
+               "<U06F2><U06F8>";"<U06F2><U06F9>";/
+               "<U06F3><U06F0>";"<U06F3><U06F1>";/
+               "<U06F3><U06F2>";"<U06F3><U06F3>";/
+               "<U06F3><U06F4>";"<U06F3><U06F5>";/
+               "<U06F3><U06F6>";"<U06F3><U06F7>";/
+               "<U06F3><U06F8>";"<U06F3><U06F9>";/
+               "<U06F4><U06F0>";"<U06F4><U06F1>";/
+               "<U06F4><U06F2>";"<U06F4><U06F3>";/
+               "<U06F4><U06F4>";"<U06F4><U06F5>";/
+               "<U06F4><U06F6>";"<U06F4><U06F7>";/
+               "<U06F4><U06F8>";"<U06F4><U06F9>";/
+               "<U06F5><U06F0>";"<U06F5><U06F1>";/
+               "<U06F5><U06F2>";"<U06F5><U06F3>";/
+               "<U06F5><U06F4>";"<U06F5><U06F5>";/
+               "<U06F5><U06F6>";"<U06F5><U06F7>";/
+               "<U06F5><U06F8>";"<U06F5><U06F9>";/
+               "<U06F6><U06F0>";"<U06F6><U06F1>";/
+               "<U06F6><U06F2>";"<U06F6><U06F3>";/
+               "<U06F6><U06F4>";"<U06F6><U06F5>";/
+               "<U06F6><U06F6>";"<U06F6><U06F7>";/
+               "<U06F6><U06F8>";"<U06F6><U06F9>";/
+               "<U06F7><U06F0>";"<U06F7><U06F1>";/
+               "<U06F7><U06F2>";"<U06F7><U06F3>";/
+               "<U06F7><U06F4>";"<U06F7><U06F5>";/
+               "<U06F7><U06F6>";"<U06F7><U06F7>";/
+               "<U06F7><U06F8>";"<U06F7><U06F9>";/
+               "<U06F8><U06F0>";"<U06F8><U06F1>";/
+               "<U06F8><U06F2>";"<U06F8><U06F3>";/
+               "<U06F8><U06F4>";"<U06F8><U06F5>";/
+               "<U06F8><U06F6>";"<U06F8><U06F7>";/
+               "<U06F8><U06F8>";"<U06F8><U06F9>";/
+               "<U06F9><U06F0>";"<U06F9><U06F1>";/
+               "<U06F9><U06F2>";"<U06F9><U06F3>";/
+               "<U06F9><U06F4>";"<U06F9><U06F5>";/
+               "<U06F9><U06F6>";"<U06F9><U06F7>";/
+               "<U06F9><U06F8>";"<U06F9><U06F9>"
+% Persian doesn't have abbreviations for weekdays and month names, so
+% "abday" is the same as "day" and "abmon" is the same as "mon"
+abday   "<U06CC><U06A9><U0634><U0646><U0628><U0647>";/
         "<U062F><U0648><U0634><U0646><U0628><U0647>";/
         "<U0633><U0647><U200C><U0634><U0646><U0628><U0647>";/
         "<U0686><U0647><U0627><U0631><U0634><U0646><U0628><U0647>";/
-        "<U067E><U0646><U062C><U200C><U0634><U0646><U0628><U0647>";/
+        "<U067E><U0646><U062C><U0634><U0646><U0628><U0647>";/
+        "<U062C><U0645><U0639><U0647>";/
+        "<U0634><U0646><U0628><U0647>"
+day     "<U06CC><U06A9><U0634><U0646><U0628><U0647>";/
+        "<U062F><U0648><U0634><U0646><U0628><U0647>";/
+        "<U0633><U0647><U200C><U0634><U0646><U0628><U0647>";/
+        "<U0686><U0647><U0627><U0631><U0634><U0646><U0628><U0647>";/
+        "<U067E><U0646><U062C><U0634><U0646><U0628><U0647>";/
         "<U062C><U0645><U0639><U0647>";/
         "<U0634><U0646><U0628><U0647>"
 mon     "<U0698><U0627><U0646><U0648><U06CC><U0647>";/
@@ -314,33 +377,68 @@ mon     "<U0698><U0627><U0646><U0648><U06CC><U0647>";/
         "<U0627><U0643><U062A><U0628><U0631>";/
         "<U0646><U0648><U0627><U0645><U0628><U0631>";/
         "<U062F><U0633><U0627><U0645><U0628><U0631>"
-abmon   "<U0698><U0627><U0646>";"<U0641><U0648><U0631>";/
-        "<U0645><U0627><U0631>";"<U0622><U0648><U0631>";/
-        "<U0645><U0640><U0647>";"<U0698><U0648><U0646>";/
-        "<U0698><U0648><U06CC>";"<U0627><U0648><U062A>";/
-        "<U0633><U067E><U062A>";"<U0627><U0643><U062A>";/
-        "<U0646><U0648><U0627>";"<U062F><U0633><U0627>"
-am_pm   "<U0635><U0628><U062D>";"<U0639><U0635><U0631>"
-d_t_fmt "<U202B><U0025><U0041><U0020><U0025><U0065><U0020><U0025>/
-<U0042><U0020><U0025><U0059><U060C><U0020><U0025><U0049><U003A>/
-<U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070><U202C>"
-d_fmt   "<U0025><U0059><U002F><U0025><U006D><U002F><U0025><U0064>"
-t_fmt   "<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
-t_fmt_ampm    "<U202B><U0025><U0049><U003A><U0025><U004D><U003A><U0025>/
-<U0053><U0020><U0025><U0070><U202C>"
-%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>"
+abmon   "<U0698><U0627><U0646><U0648><U06CC><U0647>";/
+        "<U0641><U0648><U0631><U06CC><U0647>";/
+        "<U0645><U0627><U0631><U0633>";/
+        "<U0622><U0648><U0631><U06CC><U0644>";/
+        "<U0645><U0647>";/
+        "<U0698><U0648><U0626><U0646>";/
+        "<U0698><U0648><U0626><U06CC><U0647>";/
+        "<U0627><U0648><U062A>";/
+        "<U0633><U067E><U062A><U0627><U0645><U0628><U0631>";/
+        "<U0627><U0643><U062A><U0628><U0631>";/
+        "<U0646><U0648><U0627><U0645><U0628><U0631>";/
+        "<U062F><U0633><U0627><U0645><U0628><U0631>"
+% Persian does not have the 12-hour format
+am_pm   "";""
+t_fmt_ampm    ""
+%
+% Appropriate date representation (%x)
+%       "%Oy/%Om/%Od"
+d_fmt   "<U0025><U004F><U0079><U002F>/
+<U0025><U004F><U006D><U002F>/
+<U0025><U004F><U0064>"
+%
+% Appropriate time representation (%X)
+%       "%OH:%OM:%OS"
+t_fmt   "<U0025><U004F><U0048><U003A>/
+<U0025><U004F><U004D><U003A>/
+<U0025><U004F><U0053>"
+%
+% FIXME: need to add "HAMZA ABOVE" after January, February, May, July when used
+% before a year
+%
+% Appropriate date and time representation (%c)
+%       "<RLE>%A %Oe %B %Oy<ARABIC COMMA> %OH:%OM:%OS<PDF>"
+d_t_fmt "<U202B><U0025><U0041><U0020>/
+<U0025><U004F><U0065><U0020>/
+<U0025><U0042><U0020>/
+<U0025><U004F><U0079><U060C><U0020>/
+<U0025><U004F><U0048><U003A>/
+<U0025><U004F><U004D><U003A>/
+<U0025><U004F><U0053><U202C>"
+%
+% Appropriate date representation (date(1))
+%       "<RLE>%A %Oe %B %Oy<ARABIC COMMA> <SEEN><ALEF><AIN><TEH> %OH:%OM:%OS (%Z)<PDF>"
+date_fmt "<U202B><U0025><U0041><U0020>/
+<U0025><U004F><U0065><U0020>/
+<U0025><U0042><U0020>/
+<U0025><U004F><U0079><U060C><U0020>/
+<U0633><U0627><U0639><U062A><U0020>/
+<U0025><U004F><U0048><U003A>/
+<U0025><U004F><U004D><U003A>/
+<U0025><U004F><U0053><U0020>/
+<U0028><U0025><U005A><U0029><U202C>"
 first_weekday 7
 first_workday 7
 cal_direction 3
-%week    7;19971206;4
-%time_zone "???"
 END LC_TIME
 
 LC_MESSAGES
-yesexpr "<U005E><U005B><U0079><U0059><U0628><U0066><U005D><U002E><U002A>"
-noexpr  "<U005E><U005B><U006E><U004E><U062E><U0646><U006F><U005D><U002E><U002A>"
+% This is "^[yY<ALEF MADDA><BEH>Hf].*"
+yesexpr "<U005E><U005B><U0079><U0059><U0622><U0628><U0048><U0066><U005D><U002E><U002A>"
+% This is "^[nN<KHAH><NOON>ok].*"
+noexpr  "<U005E><U005B><U006E><U004E><U062E><U0646><U006F><U006B><U005D><U002E><U002A>"
 END LC_MESSAGES
 
 LC_PAPER
@@ -348,18 +446,6 @@ height   297
 width    210
 END LC_PAPER
 
-LC_TELEPHONE
-tel_int_fmt    "<U202A><U002B><U0025><U0063><U0020><U0025><U0061><U0020>/
-<U0025><U006C><U202C>"
-tel_dom_fmt    "<U202A><U0025><U0041><U2012><U0025><U006C><U202C>"
-int_select     "<U0030><U0030>"
-int_prefix     "<U0039><U0038>"
-END LC_TELEPHONE
-
-LC_MEASUREMENT
-measurement    1
-END LC_MEASUREMENT
-
 LC_NAME
 name_gen    ""
 name_miss   "<U062E><U0627><U0646><U0645>"
@@ -371,7 +457,6 @@ name_fmt    "<U0025><U0064><U0025><U0074><U0025><U0073><U0025><U0074>/
 END LC_NAME
 
 LC_ADDRESS
-% FIXME
 postal_fmt    "<U0025><U0066><U0025><U004E><U0025><U0061><U0025><U004E>/
 <U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
 <U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
@@ -388,3 +473,15 @@ lang_ab        "<U0066><U0061>"
 lang_term      "<U0066><U0061><U0073>"
 lang_lib       "<U0070><U0065><U0072>"
 END LC_ADDRESS
+
+LC_TELEPHONE
+tel_int_fmt    "<U202A><U002B><U0025><U0063><U0020><U0025><U0061><U0020>/
+<U0025><U006C><U202C>"
+tel_dom_fmt    "<U202A><U0025><U0041><U2012><U0025><U006C><U202C>"
+int_select     "<U0030><U0030>"
+int_prefix     "<U0039><U0038>"
+END LC_TELEPHONE
+
+LC_MEASUREMENT
+measurement    1
+END LC_MEASUREMENT
index 5bea18cc4b939e77ff2376cf12d44c59d8fa4284..2921487314dd2aadcf911b03e39fb709d1ce0264 100644 (file)
@@ -1,25 +1,27 @@
-comment_char %
 escape_char /
+comment_char %
 % Mongolian language (cyrillic) locale for Mongolia
 % Sanlig Badral <badral@chinggis.com>
-% Revision: 0.9 (2003-2-27)
+% Revision: 1.0 (2005-5-21)
 % Charsets: UTF-8
 % Distribution and use is free, also
 % for commercial purposes.
 
 LC_IDENTIFICATION
 title      "Mongolian locale for Mongolia"
-source     "OPENMN"
+source     "Sanlig Badral"
 address    ""
 contact    ""
-email      "bug-glibc-locales@gnu.org"
+email      "badral@chinggis.com"
 tel        ""
 fax        ""
 language   "Mongolian"
 territory  "Mongolia"
-revision   "0.9"
-date       "2003-02-27"
-
+revision   "1.0"
+date       "2005-05-21"
+audience   "general"
+application   "GNU locale"
+%
 category  "mn_MN:2000";LC_IDENTIFICATION
 category  "mn_MN:2000";LC_CTYPE
 category  "mn_MN:2000";LC_COLLATE
@@ -64,6 +66,82 @@ END LC_COLLATE
 
 LC_CTYPE
 copy "i18n"
+translit_start
+include "translit_combining";""
+% cyrillic -> latin for mongolian
+% CYRILLIC CAPITAL LETTERS IN ALPHABETICAL ORDER.
+<U0410> "<U0041>"
+<U0411> "<U0042>"
+<U0412> "<U0056>"
+<U0413> "<U0047>"
+<U0414> "<U0044>"
+<U0415> "<U0059><U0065>" % Ye
+<U0401> "<U0059><U006F>" % Yo
+<U0416> "<U004A>"
+<U0417> "<U005A>"
+<U0418> "<U0049>"
+<U0419> "<U0049>"
+<U041A> "<U004B>"
+<U041B> "<U004C>"
+<U041C> "<U004D>"
+<U041D> "<U004E>"
+<U041E> "<U004F>"
+<U04E8> "<U004F><U0065>" % Oe
+<U041F> "<U0050>"
+<U0420> "<U0052>"
+<U0421> "<U0053>"
+<U0422> "<U0054>"
+<U0423> "<U0055>"
+<U04AE> "<U0055><U0065>" % Ue
+<U0424> "<U0046>"
+<U0425> "<U0048>"
+<U0426> "<U0043>"
+<U0427> "<U0043><U0068>" % Ch
+<U0428> "<U0053><U0068>" % Sh
+<U0429> "<U0053><U0068>" % Sh
+<U042A> "<U0022>" % "
+<U042B> "<U0059>"
+<U042C> "<U0027>" % '
+<U042D> "<U0045>" 
+<U042E> "<U0059><U0075>" % Yu
+<U042F> "<U0059><U0061>" % Ya
+% CYRILLIC SMALL LETTERS IN ALPHABETICAL ORDER.
+<U0430> "<U0061>"
+<U0431> "<U0062>"
+<U0432> "<U0076>"
+<U0433> "<U0067>"
+<U0434> "<U0064>"
+<U0435> "<U0079><U0065>" %ye
+<U0451> "<U0079><U006F>" %yo
+<U0436> "<U006A>"
+<U0437> "<U007A>"
+<U0438> "<U0069>"
+<U0439> "<U0069>"
+<U043A> "<U006B>"
+<U043B> "<U006C>"
+<U043C> "<U006D>"
+<U043D> "<U006E>"
+<U043E> "<U006F>"
+<U04E9> "<U006F><U0065>" % oe
+<U043F> "<U0070>"
+<U0440> "<U0072>"
+<U0441> "<U0073>"
+<U0442> "<U0074>"
+<U0443> "<U0075>"
+<U04AF> "<U0075><U0065>" % ue
+<U0444> "<U0066>"
+<U0445> "<U0068>"
+<U0446> "<U0043>"
+<U0447> "<U0063><U0068>" % ch
+<U0448> "<U0073><U0068>" % sh
+<U0449> "<U0073><U0068>" % sh
+<U044A> "<U0022>" % "
+<U044B> "<U0079>"
+<U044C> "<U0027>" % '
+<U044D> "<U0065>"
+<U044E> "<U0079><U0075>" % yu
+<U044F> "<U0079><U0061>" % ya
+translit_end
 END LC_CTYPE
 
 LC_MONETARY
@@ -106,28 +184,28 @@ day   "<U041D><U044F><U043C>";/
       "<U0411><U0430><U0430><U0441><U0430><U043D>";/
       "<U0411><U044F><U043C><U0431><U0430>"
 % Abbreviated month names (%b)
-abmon       "<U0031><U002D><U0440>";"<U0032><U002D><U0440>";/
-            "<U0033><U002D><U0440>";"<U0034><U002D><U0440>";/
-            "<U0035><U002D><U0440>";"<U0036><U002D><U0440>";/
-            "<U0037><U002D><U0440>";"<U0038><U002D><U0440>";/
-            "<U0039><U002D><U0440>";"<U0031><U0030><U002D><U0440>";/
-            "<U0031><U0031><U002D><U0440>";"<U0031><U0032><U002D><U0440>"
+abmon       "<U0425><U0443><U043B>";"<U04AE><U0445><U044D>";/
+            "<U0411><U0430><U0440>";"<U0422><U0443><U0443>";/
+            "<U041B><U0443><U0443>";"<U041C><U043E><U0433>";/
+            "<U041C><U043E><U0440>";"<U0425><U043E><U043D>";/
+            "<U0411><U0438><U0447>";"<U0422><U0430><U0445>";/
+            "<U041D><U043E><U0445>";"<U0413><U0430><U0445>"
 % Full month names (%B)
-mon         "<U041D><U044D><U0433><U0434><U04AF><U0433><U044D><U044D><U0440><U0020><U0441><U0430><U0440>";/
-            "<U0425><U043E><U0451><U0440><U0434><U0443><U0433><U0430><U0430><U0440><U0020><U0441><U0430><U0440>";/
-            "<U0413><U0443><U0440><U0430><U0432><U0434><U0443><U0433><U0430><U0430><U0440><U0020><U0441><U0430><U0440>";/
-            "<U0414><U04E9><U0440><U04E9><U0432><U0434><U04AF><U0433><U044D><U044D><U0440><U0020><U0441><U0430><U0440>";/
-            "<U0422><U0430><U0432><U0434><U0443><U0433><U0430><U0430><U0440><U0020><U0441><U0430><U0440>";/
-            "<U0417><U0443><U0440><U0433><U0430><U0430><U0434><U0443><U0433><U0430><U0440><U0020><U0441><U0430><U0440>";/
-            "<U0414><U043E><U043B><U043E><U043E><U0434><U0443><U0433><U0430><U0430><U0440><U0020><U0441><U0430><U0440>";/
-            "<U041D><U0430><U0439><U043C><U0434><U0443><U0433><U0430><U0430><U0440><U0020><U0441><U0430><U0440>";/
-            "<U0415><U0441><U0434><U04AF><U0433><U044D><U044D><U0440><U0020><U0441><U0430><U0440>";/
-            "<U0410><U0440><U0430><U0432><U0434><U0443><U0433><U0430><U0430><U0440><U0020><U0441><U0430><U0440>";/
-            "<U0410><U0440><U0432><U0430><U043D><U043D><U044D><U0433><U0434><U04AF><U0433><U044D><U044D><U0440><U0020><U0441><U0430><U0440>";/
-            "<U0410><U0440><U0432><U0430><U043D><U0445><U043E><U0451><U0440><U0434><U0433><U0430><U0430><U0440><U0020><U0441><U0430><U0440>"
+mon         "<U0425><U0443><U043B><U0433><U0430><U043D><U0430><U0020><U0441><U0430><U0440><U044B><U043D>";/
+            "<U04AE><U0445><U044D><U0440><U0020><U0441><U0430><U0440><U044B><U043D>";/
+            "<U0411><U0430><U0440><U0020><U0441><U0430><U0440><U044B><U043D>";/
+            "<U0422><U0443><U0443><U043B><U0430><U0439><U0020><U0441><U0430><U0440><U044B><U043D>";/
+            "<U041B><U0443><U0443><U0020><U0441><U0430><U0440><U044B><U043D>";/
+            "<U041C><U043E><U0433><U043E><U0439><U0020><U0441><U0430><U0440><U044B><U043D>";/
+            "<U041C><U043E><U0440><U044C><U0020><U0441><U0430><U0440><U044B><U043D>";/
+            "<U0425><U043E><U043D><U044C><U0020><U0441><U0430><U0440><U044B><U043D>";/
+            "<U0411><U0438><U0447><U0020><U0441><U0430><U0440><U044B><U043D>";/
+            "<U0422><U0430><U0445><U0438><U0430><U0020><U0441><U0430><U0440><U044B><U043D>";/
+            "<U041D><U043E><U0445><U043E><U0439><U0020><U0441><U0430><U0440><U044B><U043D>";/
+            "<U0413><U0430><U0445><U0430><U0439><U0020><U0441><U0430><U0440><U044B><U043D>"
 % Appropriate date and time representation
-% "%a %d %b %Y %T %Z"
-d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
+% "%Y %b %d, %a %T"
+d_t_fmt "<U0025><U0059><U0020><U0025><U0062><U0020><U0025><U0064><U002C><U0020><U0025><U0061><U0020><U0025><U0054>"
 
 % Appropriate date representation
 % "%Y.%m.%d"
@@ -139,8 +217,9 @@ t_fmt   "<U0025><U0054>"
 am_pm   "";""
 t_fmt_ampm ""
 % Full date and time representation
-% "%a %b %e %H:%M:%S %Z %Y"
-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>"
+% "%Z %Y ony %B %e, %a %H:%M:%S"
+date_fmt  "<U0025><U005A><U0020><U0025><U0059><U0020><U043E><U043D><U044B><U0020><U0025><U0042><U0020>";/
+         "<U0025><U0065><U002C><U0020><U0025><U0061><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
 END LC_TIME
 
 LC_MESSAGES
@@ -157,7 +236,6 @@ END LC_PAPER
 LC_NAME
 name_fmt    "<U0025><U0064><U0025><U0074><U0025><U0067><U0025><U0074>/
 <U0025><U006D><U0025><U0074><U0025><U0066>"
-
 name_miss   "<U0425><U0430><U0442><U0430><U0433><U0442><U0430><U0439>"
 name_mr     "<U041D><U043E><U0451><U043D>"
 name_mrs    "<U0425><U0430><U0442><U0430><U0433><U0442><U0430><U0439>"
@@ -170,7 +248,6 @@ postal_fmt    "<U0025><U0066><U0025><U004E><U0025><U0061><U0025><U004E>/
 <U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
 <U004E><U0025><U0025><U007A><U0020><U0025><U0054><U0025>/
 <U004E><U0025><U0063><U0025><U004E>"
-
 country_name  "<U004D><U006F><U006E><U0067><U006F><U006C><U0069><U0061>"
 country_post  "<U004D><U004E>"
 country_ab2   "<U004D><U004E>"
index 2a2072837b03be1492b4eb13cee39ba11d7205b0..f7b0bf217371d768d4752462d5210aaaab5bcf08 100644 (file)
@@ -5,7 +5,7 @@ escape_char     /
 
 LC_IDENTIFICATION
 title      "Punjabi language locale for Indian Punjabi(Gurmukhi)"
-source     "IndLinux.org"      
+source     "IndLinux.org"
 address    ""
 contact    ""
 email      "bug-glibc-locales@gnu.org"
@@ -14,7 +14,7 @@ fax        ""
 language   "Punjabi"
 territory  "India"
 revision   "0.2"
-date       "2004-09-30"        
+date       "2004-09-30"
 %
 category  "pa_IN:2000";LC_IDENTIFICATION
 category  "pa_IN:2000";LC_CTYPE
@@ -122,8 +122,8 @@ mon         "<U0A1C><U0A28><U0A35><U0A30><U0A40>";/
 
 %
 % Equivalent of AM PM
-am_pm       "<U0A38><U035><U0A47><U0A30><U0A47>";/
-            "<U0A36><U0A3E><U02E>"
+am_pm       "<U0A38><U0A35><U0A47><U0A30><U0A47>";/
+            "<U0A36><U0A3E><U0A2E>"
 
 %
 % Appropriate date and time representation
diff --git a/localedata/locales/sr_CS b/localedata/locales/sr_CS
new file mode 100644 (file)
index 0000000..1a01f2f
--- /dev/null
@@ -0,0 +1,349 @@
+comment_char %
+escape_char  /
+%
+% Serbian Language Locale for Serbia and Montenegro
+% Source: sr_YU locale
+% Address:
+%
+% Contact: Danilo Segan
+% Email: dsegan@gmx.net
+% Tel: +381 63 8626082
+% Fax: none
+% Language: sr
+% Territory: CS
+% Revision: 1.2
+% Date: 2004-08-09
+% Application: general
+% Users: general
+% Charset: UTF-8, ISO-8859-5
+% Distribution and use is free, also
+% for commercial purposes.
+%
+% TODO:
+% -- fix LC_COLLATE to work correctly for latin alphabet too
+%
+
+LC_IDENTIFICATION
+title      "Serbian locale for Serbia and Montenegro"
+source     "sr_YU locale"
+address    ""
+contact    "Danilo Segan"
+email      "bug-glibc-locales@gnu.org"
+tel        ""
+fax        ""
+language   "Serbian"
+territory  "Serbia and Montenegro"
+revision   "1.2"
+date       "2004-08-09"
+audience   "general"
+application   "GNU locale"
+abbreviation  ""
+%
+category  "i18n:1997";LC_IDENTIFICATION
+category  "i18n:1997";LC_CTYPE
+category  "i18n:1997";LC_COLLATE
+category  "i18n:1997";LC_MONETARY
+category  "i18n:1997";LC_NUMERIC
+category  "i18n:1997";LC_TIME
+category  "i18n:1997";LC_MESSAGES
+category  "i18n:1997";LC_PAPER
+category  "i18n:1997";LC_NAME
+category  "i18n:1997";LC_ADDRESS
+category  "i18n:1997";LC_TELEPHONE
+category  "i18n:1997";LC_MEASUREMENT
+END LC_IDENTIFICATION
+
+LC_CTYPE
+copy "i18n"
+translit_start
+include "translit_combining";""
+
+% cyrillic -> latin
+<U0452> "<U0111>";"<U0064><U006A>" % d-
+<U0453> "<U0067><U006A>" % gj
+<U0455> "<U0064><U007A>" % dz
+<U0458> "<U006A>" % j
+<U0459> "<U006C><U006A>" % lj
+<U045A> "<U006E><U006A>" % nj
+<U045B> "<U0107>";"<U0063>" % c'
+<U045C> "<U006B><U006A>" % kj
+<U045F> "<U0064><U017E>";"<U0064><U007A>" % dz<
+
+<U0402> "<U0110>";"<U0044><U006A>" % D-
+<U0403> "<U0047><U006A>" % Gj
+<U0405> "<U0044><U007A>" % Dz
+<U0408> "<U004A>" % J
+<U0409> "<U004C><U006A>" % Lj
+<U040A> "<U004E><U006A>" % Nj
+<U040B> "<U0106>";"<U0043>" % C'
+<U040C> "<U004B><U006A>" % Kj
+<U040F> "<U0044><U017E>";"<U0064><U007A>" % Dz<
+
+<U0430> "<U0061>"
+<U0431> "<U0062>"
+<U0446> "<U0063>"
+<U0434> "<U0064>"
+<U0435> "<U0065>"
+<U0444> "<U0066>"
+<U0433> "<U0067>"
+<U0445> "<U0068>"
+<U0438> "<U0069>"
+<U043A> "<U006B>"
+<U043B> "<U006C>"
+<U043C> "<U006D>"
+<U043D> "<U006E>"
+<U043E> "<U006F>"
+<U043F> "<U0070>"
+<U0440> "<U0072>"
+<U0441> "<U0073>"
+<U0442> "<U0074>"
+<U0443> "<U0075>"
+<U0432> "<U0076>"
+<U0437> "<U007A>"
+<U0436> "<U017E>";"<U007A>" % z<
+<U0448> "<U0161>";"<U0073>" % s<
+<U0447> "<U010D>";"<U0063>" % c<
+
+<U0410> "<U0041>"
+<U0411> "<U0042>"
+<U0426> "<U0043>"
+<U0414> "<U0044>"
+<U0415> "<U0045>"
+<U0424> "<U0046>"
+<U0413> "<U0047>"
+<U0425> "<U0048>"
+<U0418> "<U0049>"
+<U041A> "<U004B>"
+<U041B> "<U004C>"
+<U041C> "<U004D>"
+<U041D> "<U004E>"
+<U041E> "<U004F>"
+<U041F> "<U0050>"
+<U0420> "<U0052>"
+<U0421> "<U0053>"
+<U0422> "<U0054>"
+<U0423> "<U0055>"
+<U0412> "<U0056>"
+<U0417> "<U005A>"
+<U0416> "<U017D>";"<U005A>" % z<
+<U0428> "<U0160>";"<U0053>" % s<
+<U0427> "<U010C>";"<U0063>" % c<
+
+translit_end
+END LC_CTYPE
+
+
+LC_COLLATE
+
+copy "iso14651_t1"
+
+collating-symbol  <d-z-sh>
+collating-symbol  <l-j-sh>
+collating-symbol  <n-j-sh>
+
+collating-symbol <cacute>
+collating-symbol <ccaron>
+collating-symbol <d//>
+collating-symbol <scaron>
+collating-symbol <zcaron>
+
+collating-symbol <CAP-MIN>
+collating-symbol <MIN-CAP>
+
+reorder-after <MIN>
+<MIN-CAP>
+reorder-after <CAP>
+<CAP-MIN>
+
+reorder-after <c>
+<cacute>
+<ccaron>
+<d>
+<d-z-sh>
+<d//>
+reorder-after <l>
+<l-j-sh>
+reorder-after <n>
+<n-j-sh>
+reorder-after <s>
+<scaron>
+reorder-after <z>
+<zcaron>
+
+reorder-after <U0063>
+<U0107>        <cacute>;<PCT>;<MIN>;IGNORE
+<U010D>        <ccaron>;<PCT>;<MIN>;IGNORE
+reorder-after <U0043>
+<U0106>        <cacute>;<PCT>;<CAP>;IGNORE
+<U010C>        <ccaron>;<PCT>;<CAP>;IGNORE
+
+reorder-after <U0064>
+<d-z<> <d-z-sh>;<PCT>;<MIN>;IGNORE
+<dz<>  <d-z-sh>;<PCT>;<MIN>;IGNORE
+<d-Z<> <d-z-sh>;<PCT>;<MIN-CAP>;IGNORE
+<U0111>        <d//>;<PCT>;<MIN>;IGNORE
+reorder-after <U0044>
+<D-Z<> <d-z-sh>;<PCT>;<CAP>;IGNORE
+<DZ<>  <d-z-sh>;<PCT>;<CAP>;IGNORE
+<D-z<> <d-z-sh>;<PCT>;<CAP-MIN>;IGNORE
+<Dz<>  <d-z-sh>;<PCT>;<CAP-MIN>;IGNORE
+<U0110>        <d//>;<PCT>;<CAP>;IGNORE
+
+reorder-after <U006C>
+<l-j>  <l-j-sh>;<PCT>;<MIN>;IGNORE
+<lj>   <l-j-sh>;<PCT>;<MIN>;IGNORE
+<l-J>  <l-j-sh>;<PCT>;<MIN-CAP>;IGNORE
+reorder-after <U004C>
+<L-J>  <l-j-sh>;<PCT>;<CAP>;IGNORE
+<LJ>   <l-j-sh>;<PCT>;<CAP>;IGNORE
+<L-j>  <l-j-sh>;<PCT>;<CAP-MIN>;IGNORE
+<Lj>   <l-j-sh>;<PCT>;<CAP-MIN>;IGNORE
+
+reorder-after <U006E>
+<n-j>  <n-j-sh>;<PCT>;<MIN>;IGNORE
+<nj>   <n-j-sh>;<PCT>;<MIN>;IGNORE
+<n-J>  <n-j-sh>;<PCT>;<MIN-CAP>;IGNORE
+reorder-after <U004E>
+<N-J>  <n-j-sh>;<PCT>;<CAP>;IGNORE
+<NJ>   <n-j-sh>;<PCT>;<CAP>;IGNORE
+<N-j>  <n-j-sh>;<PCT>;<CAP-MIN>;IGNORE
+<Nj>   <n-j-sh>;<PCT>;<CAP-MIN>;IGNORE
+
+reorder-after <U0073>
+<U0161>        <scaron>;<PCT>;<MIN>;IGNORE
+reorder-after <U0053>
+<U0160>        <scaron>;<PCT>;<CAP>;IGNORE
+
+reorder-after <U007A>
+<U017E>        <zcaron>;<PCT>;<MIN>;IGNORE
+reorder-after <U005A>
+<U017D>        <zcaron>;<PCT>;<CAP>;IGNORE
+
+reorder-end
+
+END LC_COLLATE
+
+LC_MONETARY
+int_curr_symbol           "<U0043><U0053><U0044><U0020>"
+currency_symbol           "<U0434><U0438><U043D>"
+mon_decimal_point         "<U002C>"
+mon_thousands_sep         "<U002E>"
+mon_grouping              3;3
+positive_sign             ""
+negative_sign             "<U002D>"
+int_frac_digits           2
+frac_digits               2
+p_cs_precedes             0
+p_sep_by_space            1
+n_cs_precedes             0
+n_sep_by_space            1
+p_sign_posn               1
+n_sign_posn               1
+END LC_MONETARY
+
+LC_NUMERIC
+decimal_point             "<U002C>"
+thousands_sep             ""
+grouping                  0;0
+END LC_NUMERIC
+
+LC_TIME
+
+abday   "<U043D><U0435><U0434>";"<U043F><U043E><U043D>";/
+        "<U0443><U0442><U043E>";"<U0441><U0440><U0435>";/
+        "<U0447><U0435><U0442>";"<U043F><U0435><U0442>";/
+        "<U0441><U0443><U0431>"
+day     "<U043D><U0435><U0434><U0435><U0459><U0430>";/
+        "<U043F><U043E><U043D><U0435><U0434><U0435><U0459><U0430><U043A>";/
+        "<U0443><U0442><U043E><U0440><U0430><U043A>";/
+        "<U0441><U0440><U0435><U0434><U0430>";/
+        "<U0447><U0435><U0442><U0432><U0440><U0442><U0430><U043A>";/
+        "<U043F><U0435><U0442><U0430><U043A>";/
+        "<U0441><U0443><U0431><U043E><U0442><U0430>"
+abmon   "<U0458><U0430><U043D>";"<U0444><U0435><U0431>";/
+        "<U043C><U0430><U0440>";"<U0430><U043F><U0440>";/
+        "<U043C><U0430><U0458>";"<U0458><U0443><U043D>";/
+        "<U0458><U0443><U043B>";"<U0430><U0432><U0433>";/
+        "<U0441><U0435><U043F>";"<U043E><U043A><U0442>";/
+        "<U043D><U043E><U0432>";"<U0434><U0435><U0446>"
+mon     "<U0458><U0430><U043D><U0443><U0430><U0440>";/
+        "<U0444><U0435><U0431><U0440><U0443><U0430><U0440>";/
+        "<U043C><U0430><U0440><U0442>";/
+        "<U0430><U043F><U0440><U0438><U043B>";/
+        "<U043C><U0430><U0458>";/
+        "<U0458><U0443><U043D>";/
+        "<U0458><U0443><U043B>";/
+        "<U0430><U0432><U0433><U0443><U0441><U0442>";/
+        "<U0441><U0435><U043F><U0442><U0435><U043C><U0431><U0430><U0440>";/
+        "<U043E><U043A><U0442><U043E><U0431><U0430><U0440>";/
+        "<U043D><U043E><U0432><U0435><U043C><U0431><U0430><U0440>";/
+        "<U0434><U0435><U0446><U0435><U043C><U0431><U0430><U0440>"
+
+d_t_fmt "<U0025><U0041><U002C><U0020><U0025><U0064><U002E><U0020>/
+<U0025><U0042><U0020><U0025><U0059><U002E><U0020><U0025><U0054>/
+<U0020><U0025><U005A>"
+d_fmt   "<U0025><U0064><U002E><U0025><U006D><U002E><U0025><U0059><U002E>"
+t_fmt   "<U0025><U0054>"
+am_pm   "";""
+t_fmt_ampm "<U0025><U0054>"
+date_fmt  "<U0025><U0061><U002C><U0020><U0025><U0065><U002E><U0020>/
+<U0025><U0062><U0020><U0025><U0059><U002E><U0020><U0020><U0025><U0048>/
+<U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U000A>"
+week    7;19971201;4
+first_weekday 2
+first_workday 2
+END LC_TIME
+
+LC_MESSAGES
+yesexpr "<U005E><U005B><U0414><U0434><U0044><U0064><U0059><U0079><U005D>"
+noexpr  "<U005E><U005B><U041D><U043D><U004E><U006E><U005D>"
+END LC_MESSAGES
+
+LC_PAPER
+height   297
+width    210
+END LC_PAPER
+
+LC_NAME
+name_fmt    "<U0025><U0064><U0025><U0074><U0025><U0067><U0025><U0074>/
+<U0025><U006D><U0025><U0074><U0025><U0066>"
+name_gen    ""
+name_mr     "<U0433><U002D><U0434><U0438><U043D>"
+name_mrs    "<U0433><U002D><U0452><U0430>"
+name_miss   "<U0433><U002D><U0452><U0438><U0446><U0430>"
+name_ms     "<U0433><U002D><U0452><U0430>"
+END LC_NAME
+
+LC_ADDRESS
+postal_fmt    "<U0025><U0066><U0025><U004E><U0025><U0061><U0025><U004E>/
+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0073>/
+<U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025>/
+<U004E><U0025><U0025><U007A><U0020><U0025><U0054><U0025>/
+<U004E><U0025><U0063><U0025><U004E>"
+country_ab2   "<U0043><U0053>"
+country_ab3   "<U0053><U0043><U0047>"
+% FIXME: country_post is probably incorrect
+country_post  "<U0053><U0043><U0047>"
+country_name  "<U0421><U0440><U0431><U0438><U0458><U0430><U0020><U0438>/
+<U0020><U0426><U0440><U043D><U0430><U0020><U0413><U043E><U0440><U0430>"
+country_num   891
+country_car   "<U0053><U0043><U0047>"
+% FIXME: ISBN code is what? "86" that preceedes all the numbers?
+country_isbn  "<U0038><U0036>"
+lang_name     "<U0441><U0440><U043F><U0441><U043A><U0438>"
+lang_term     "<U0073><U0072><U0070>"
+lang_lib      "<U0073><U0063><U0063>"
+lang_ab              "<U0073><U0072>"
+END LC_ADDRESS
+
+LC_TELEPHONE
+tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
+<U006C>"
+tel_dom_fmt    "<U0025><U0041><U0020><U0025><U006C>"
+int_prefix     "<U0033><U0038><U0031>"
+int_select     "<U0039><U0039>"
+END LC_TELEPHONE
+
+LC_MEASUREMENT
+measurement    1
+END LC_MEASUREMENT
index 0512c498398eb5d69c61f22e9430d3d876d34d61..45e8f59ab4d84cb4afab4daf8ac8f6855e7e67e4 100644 (file)
@@ -101,6 +101,8 @@ $(objpfx)memusagestat: $(memusagestat-modules:%=$(objpfx)%.o)
 
 include ../Rules
 
+CFLAGS-mcheck-init.c = $(PIC-ccflag)
+
 $(objpfx)libmcheck.a: $(objpfx)mcheck-init.o
        -rm -f $@
        $(patsubst %/,cd % &&,$(objpfx)) \
index e3ccbde7b5b84affbf6ff2387a5151310235f0a3..35ec8d6a569da7e2986886bf33a166838f894354 100644 (file)
@@ -3766,6 +3766,8 @@ public_mTRIm(size_t s)
 {
   int result;
 
+  if(__malloc_initialized < 0)
+    ptmalloc_init ();
   (void)mutex_lock(&main_arena.mutex);
   result = mTRIm(s);
   (void)mutex_unlock(&main_arena.mutex);
index 21ab71461aa0240f527521aaa37c0f5cf6eaa9c8..84ac439a3fe0131abd83b4c81bd96f32640e4759 100644 (file)
@@ -386,7 +386,7 @@ memcpy (new, old, arraysize * sizeof (struct foo));
 
 @comment wchar.h
 @comment ISO
-@deftypefun {wchar_t *} wmemcpy (wchar_t *restrict @var{wto}, const wchar_t *restruct @var{wfrom}, size_t @var{size})
+@deftypefun {wchar_t *} wmemcpy (wchar_t *restrict @var{wto}, const wchar_t *restrict @var{wfrom}, size_t @var{size})
 The @code{wmemcpy} function copies @var{size} wide characters from the object
 beginning at @var{wfrom} into the object beginning at @var{wto}.  The
 behavior of this function is undefined if the two arrays @var{wto} and
index b9e27ab48c9b156367dd6c3e9ce007867fa38793..0ad221338781e3f5c359d3d55339242debadff75 100644 (file)
@@ -92,9 +92,13 @@ nis_removemember (const_nis_name member, const_nis_name group)
       /* This realloc() call always decreases the size.  This cannot
         fail.  We still have the test but do not recover memory
         (i.e., we overwrite the input pointer).  */
-      newmem = realloc (newmem, k * sizeof (char*));
-      if (newmem == NULL)
-       return NIS_NOMEMORY;
+      nis_name *newp = realloc (newmem, k * sizeof (char*));
+      if (newp == NULL)
+       {
+         free (newmem);
+         return NIS_NOMEMORY;
+       }
+      newmem = newp;
 
       NIS_RES_OBJECT (res)->GR_data.gr_members.gr_members_val = newmem;
       NIS_RES_OBJECT (res)->GR_data.gr_members.gr_members_len = k;
index 13acdfdf503db7a5577505cc464691fda8eb5f5e..f746b7c629f936f0f7a120a4e4216725379d32ee 100644 (file)
@@ -94,9 +94,10 @@ __create_ib_request (const_nis_name name, unsigned int flags)
       if ((search_len + 1) >= size)
         {
           size += 1;
-          search_val = realloc (search_val, size * sizeof (nis_attr));
-         if (search_val == NULL)
+         nis_attr *newp = realloc (search_val, size * sizeof (nis_attr));
+         if (newp == NULL)
            goto free_null;
+         search_val = newp;
        }
       search_val[search_len].zattr_ndx = strdup (key);
       if ((search_val[search_len].zattr_ndx) == NULL)
index 08bf5d2f80a4b2f2b9af35ebf12a5ee144183ef5..ae009bc96691661ae2e646fa0c825d7fefa62c8a 100644 (file)
@@ -229,9 +229,10 @@ getgrnam_plusgroup (const char *name, struct group *result, ent_t *ent,
   if (!nss_getgrnam_r)
     return NSS_STATUS_UNAVAIL;
 
-  if (nss_getgrnam_r (name, result, buffer, buflen, errnop) !=
-      NSS_STATUS_SUCCESS)
-    return NSS_STATUS_NOTFOUND;
+  enum nss_status status = nss_getgrnam_r (name, result, buffer, buflen,
+                                          errnop);
+  if (status != NSS_STATUS_SUCCESS)
+    return status;
 
   if (in_blacklist (result->gr_name, strlen (result->gr_name), ent))
     return NSS_STATUS_NOTFOUND;
@@ -551,7 +552,7 @@ internal_getgrgid_r (gid_t gid, struct group *result, ent_t *ent,
             !(parse_res = _nss_files_parse_grent (p, result, data, buflen,
                                                   errnop)));
 
-      if (parse_res == -1)
+      if (__builtin_expect (parse_res == -1, 0))
        /* The parser ran out of space.  */
        goto erange_reset;
 
@@ -589,9 +590,11 @@ internal_getgrgid_r (gid_t gid, struct group *result, ent_t *ent,
       /* +:... */
       if (result->gr_name[0] == '+' && result->gr_name[1] == '\0')
        {
-         enum nss_status status;
+         if (!nss_getgrgid_r)
+           return NSS_STATUS_UNAVAIL;
 
-         status = nss_getgrgid_r (gid, result, buffer, buflen, errnop);
+         enum nss_status status = nss_getgrgid_r (gid, result, buffer, buflen,
+                                                  errnop);
          if (status == NSS_STATUS_RETURN) /* We couldn't parse the entry */
            return NSS_STATUS_NOTFOUND;
          else
index 89a6a7013e14ff6505066754d4e091c2dba6c982..bf6014bf53211181dfe73189115e40a0a9a15eb6 100644 (file)
@@ -453,29 +453,27 @@ static enum nss_status
 getpwnam_plususer (const char *name, struct passwd *result, ent_t *ent,
                   char *buffer, size_t buflen, int *errnop)
 {
-  struct passwd pwd;
-  char *p;
-  size_t plen;
-
   if (!nss_getpwnam_r)
     return NSS_STATUS_UNAVAIL;
 
+  struct passwd pwd;
   memset (&pwd, '\0', sizeof (struct passwd));
 
   copy_pwd_changes (&pwd, result, NULL, 0);
 
-  plen = pwd_need_buflen (&pwd);
+  size_t plen = pwd_need_buflen (&pwd);
   if (plen > buflen)
     {
       *errnop = ERANGE;
       return NSS_STATUS_TRYAGAIN;
     }
-  p = buffer + (buflen - plen);
+  char *p = buffer + (buflen - plen);
   buflen -= plen;
 
-  if (nss_getpwnam_r (name, result, buffer, buflen, errnop) !=
-      NSS_STATUS_SUCCESS)
-    return NSS_STATUS_NOTFOUND;
+  enum nss_status status = nss_getpwnam_r (name, result, buffer, buflen,
+                                          errnop);
+  if (status != NSS_STATUS_SUCCESS)
+    return status;
 
   if (in_blacklist (result->pw_name, strlen (result->pw_name), ent))
     return NSS_STATUS_NOTFOUND;
index 4ca6368139c733e1a3dcffc922acdf2a761860f1..16453160132b4f9ccc711cef2fefc8c3cc9dda1b 100644 (file)
@@ -401,13 +401,10 @@ static enum nss_status
 getspnam_plususer (const char *name, struct spwd *result, ent_t *ent,
                   char *buffer, size_t buflen, int *errnop)
 {
-  struct spwd pwd;
-  char *p;
-  size_t plen;
-
   if (!nss_getspnam_r)
     return NSS_STATUS_UNAVAIL;
 
+  struct spwd pwd;
   memset (&pwd, '\0', sizeof (struct spwd));
   pwd.sp_warn = -1;
   pwd.sp_inact = -1;
@@ -416,18 +413,19 @@ getspnam_plususer (const char *name, struct spwd *result, ent_t *ent,
 
   copy_spwd_changes (&pwd, result, NULL, 0);
 
-  plen = spwd_need_buflen (&pwd);
+  size_t plen = spwd_need_buflen (&pwd);
   if (plen > buflen)
     {
       *errnop = ERANGE;
       return NSS_STATUS_TRYAGAIN;
     }
-  p = buffer + (buflen - plen);
+  char *p = buffer + (buflen - plen);
   buflen -= plen;
 
-  if (nss_getspnam_r (name, result, buffer, buflen, errnop) !=
-      NSS_STATUS_SUCCESS)
-    return NSS_STATUS_NOTFOUND;
+  enum nss_status status = nss_getspnam_r (name, result, buffer, buflen,
+                                          errnop);
+  if (status != NSS_STATUS_SUCCESS)
+    return status;
 
   if (in_blacklist (result->sp_namp, strlen (result->sp_namp), ent))
     return NSS_STATUS_NOTFOUND;
index 370b69a074b39873ee460b938bc59cc21cc3ea29..13ae7372bc0a452aed2ea1ae0e28543d590a1391 100644 (file)
@@ -1,3 +1,39 @@
+2005-07-11  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #1102]
+       * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
+       PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
+       PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
+       PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
+       PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
+       PTHREAD_COND_INITIALIZER): Supply zeros for all fields
+       in the structure.
+       * Makefile (tests): Add tst-initializers1.
+       (CFLAGS-tst-initializers1.c): Set.
+       * tst-initializers1.c: New test.
+
+2005-05-03  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #915]
+       * sysdeps/pthread/pthread.h: Avoid empty initializers.
+
+2005-04-27  Ulrich Drepper  <drepper@redhat.com>
+
+       * tst-cancel17.c (do_test): Add arbitrary factor to make sure
+       aio_write blocks.
+
+2005-04-05  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #1102]
+       * sysdeps/pthread/pthread.h (__pthread_cleanup_routine): Use
+       __inline instead of inline.
+       * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_routine): Likewise.
+
+2005-03-23  Ulrich Drepper  <drepper@redhat.com>
+
+       * pthread_create.c (__pthread_create_2_1): Rename syscall error
+       variable to scerr.
+
 2005-02-25  Roland McGrath  <roland@redhat.com>
 
        * alloca_cutoff.c: Correct license text.
        * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk,
        __timer_signal_thread_tclk): Remove.
        * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed.
-       * sysdeps/unix/sysv/linux/ia64/bits/posix_>opt.h: Removed.
+       * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed.
        * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed.
 
 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
index 8d18946e6fb0426ee2b7959b1b52416eac70c7ef..d4dc88a73262e97af9c29ee228a1172aa7a48c82 100644 (file)
@@ -241,7 +241,7 @@ tests = tst-attr1 tst-attr2 tst-attr3 \
        tst-backtrace1 \
        tst-oddstacklimit \
        tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x \
-       tst-getpid1 tst-getpid2
+       tst-getpid1 tst-getpid2 tst-initializers1
 xtests = tst-setuid1 tst-setuid1-static
 
 # Files which must not be linked with libpthread.
@@ -410,6 +410,7 @@ CFLAGS-tst-cleanupx4.c += -fexceptions
 CFLAGS-tst-oncex3.c += -fexceptions
 CFLAGS-tst-oncex4.c += -fexceptions
 CFLAGS-tst-align.c += $(stack-align-test-flags)
+CFLAGS-tst-initializers1.c += -W -Wall -Werror
 
 tst-cancel7-ARGS = --command "$(built-program-cmd)"
 tst-cancelx7-ARGS = $(tst-cancel7-ARGS)
index bf41e9fcc99e0f3a755505d626fa066628c00904..b88ab14e168fe994bec3b0a3231866edc5c23a52 100644 (file)
@@ -406,14 +406,14 @@ __pthread_create_2_1 (newthread, attr, start_routine, arg)
       && __builtin_expect ((iattr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0, 0)
       && (iattr->flags & (ATTR_FLAG_SCHED_SET | ATTR_FLAG_POLICY_SET)) != 0)
     {
-      INTERNAL_SYSCALL_DECL (err);
+      INTERNAL_SYSCALL_DECL (scerr);
 
       /* Use the scheduling parameters the user provided.  */
       if (iattr->flags & ATTR_FLAG_POLICY_SET)
        pd->schedpolicy = iattr->schedpolicy;
       else if ((pd->flags & ATTR_FLAG_POLICY_SET) == 0)
        {
-         pd->schedpolicy = INTERNAL_SYSCALL (sched_getscheduler, err, 1, 0);
+         pd->schedpolicy = INTERNAL_SYSCALL (sched_getscheduler, scerr, 1, 0);
          pd->flags |= ATTR_FLAG_POLICY_SET;
        }
 
@@ -422,14 +422,14 @@ __pthread_create_2_1 (newthread, attr, start_routine, arg)
                sizeof (struct sched_param));
       else if ((pd->flags & ATTR_FLAG_SCHED_SET) == 0)
        {
-         INTERNAL_SYSCALL (sched_getparam, err, 2, 0, &pd->schedparam);
+         INTERNAL_SYSCALL (sched_getparam, scerr, 2, 0, &pd->schedparam);
          pd->flags |= ATTR_FLAG_SCHED_SET;
        }
 
       /* Check for valid priorities.  */
-      int minprio = INTERNAL_SYSCALL (sched_get_priority_min, err, 1,
+      int minprio = INTERNAL_SYSCALL (sched_get_priority_min, scerr, 1,
                                      iattr->schedpolicy);
-      int maxprio = INTERNAL_SYSCALL (sched_get_priority_max, err, 1,
+      int maxprio = INTERNAL_SYSCALL (sched_get_priority_max, scerr, 1,
                                      iattr->schedpolicy);
       if (pd->schedparam.sched_priority < minprio
          || pd->schedparam.sched_priority > maxprio)
index 8310092e7ecd8c8c01b5e3a270f75ed0ff17c312..3a51ab0dcccb02271befcb47186f18a8641983bd 100644 (file)
@@ -408,7 +408,7 @@ extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer
 
 
 /* Normal cleanup handling, based on C cleanup attribute.  */
-extern inline void
+extern __inline void
 __libc_cleanup_routine (struct __pthread_cleanup_frame *f)
 {
   if (f->__do_it)
index 57024e1e845ce23268907c4d302d128dcab8af73..92e66f7c72dc29cc8069d982a18bdc332e244f20 100644 (file)
@@ -62,22 +62,22 @@ enum
 
 /* Mutex initializers.  */
 #define PTHREAD_MUTEX_INITIALIZER \
-  { }
+  { { 0, 0, 0, 0, 0, 0 } }
 #ifdef __USE_GNU
 # if __WORDSIZE == 64
 #  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
-  { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } }
+  { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0 } }
 #  define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
-  { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } }
+  { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0 } }
 #  define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
-  { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } }
+  { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0 } }
 # else
 #  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
-  { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } }
+  { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, 0 } }
 #  define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
-  { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } }
+  { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, 0 } }
 #  define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
-  { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } }
+  { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, 0 } }
 # endif
 #endif
 
@@ -93,8 +93,13 @@ enum
 };
 
 /* Read-write lock initializers.  */
-# define PTHREAD_RWLOCK_INITIALIZER \
-  { }
+# if __WORDSIZE == 64
+#  define PTHREAD_RWLOCK_INITIALIZER \
+  { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
+# else
+#  define PTHREAD_RWLOCK_INITIALIZER \
+  { { 0, 0, 0, 0, 0, 0, 0, 0 } }
+# endif
 # ifdef __USE_GNU
 #  if __WORDSIZE == 64
 #   define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
@@ -102,7 +107,7 @@ enum
       PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
 #  else
 #   define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
-  { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
+  { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, 0 } }
 #  endif
 # endif
 #endif  /* Unix98 or XOpen2K */
@@ -140,7 +145,7 @@ enum
 
 
 /* Conditional variable handling.  */
-#define PTHREAD_COND_INITIALIZER { }
+#define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } }
 
 
 /* Cleanup buffers */
@@ -527,7 +532,7 @@ class __pthread_cleanup_class
    function the compiler is free to decide inlining the change when
    needed or fall back on the copy which must exist somewhere
    else.  */
-extern inline void
+extern __inline void
 __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
 {
   if (__frame->__do_it)
index 9fb089ac839020530925d2fa1311d411f84c960a..269d141e4c3feb5d82681b458b7bfded79221d6f 100644 (file)
@@ -228,7 +228,7 @@ do_test (void)
 
   size_t len2 = fpathconf (fds[1], _PC_PIPE_BUF);
   size_t page_size = sysconf (_SC_PAGESIZE);
-  len2 = (len2 < page_size ? page_size : len2) + sizeof (mem) + 1;
+  len2 = 20 * (len2 < page_size ? page_size : len2) + sizeof (mem) + 1;
   char *mem2 = malloc (len2);
   if (mem2 == NULL)
     {
diff --git a/nptl/tst-initializers1.c b/nptl/tst-initializers1.c
new file mode 100644 (file)
index 0000000..ccd2728
--- /dev/null
@@ -0,0 +1,48 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2005.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <pthread.h>
+
+pthread_mutex_t mtx_normal = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t mtx_recursive = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+pthread_mutex_t mtx_errorchk = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
+pthread_mutex_t mtx_adaptive = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP;
+pthread_rwlock_t rwl_normal = PTHREAD_RWLOCK_INITIALIZER;
+pthread_rwlock_t rwl_writer
+  = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP;
+pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
+
+int
+main (void)
+{
+  if (mtx_normal.__data.__kind != PTHREAD_MUTEX_TIMED_NP)
+    return 1;
+  if (mtx_recursive.__data.__kind != PTHREAD_MUTEX_RECURSIVE_NP)
+    return 1;
+  if (mtx_errorchk.__data.__kind != PTHREAD_MUTEX_ERRORCHECK_NP)
+    return 1;
+  if (mtx_adaptive.__data.__kind != PTHREAD_MUTEX_ADAPTIVE_NP)
+    return 1;
+  if (rwl_normal.__data.__flags != PTHREAD_RWLOCK_PREFER_READER_NP)
+    return 1;
+  if (rwl_writer.__data.__flags
+      != PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP)
+    return 1;
+  return 0;
+}
index 75a9d434f47d0ac9da51ef7ca077f5818b65f76a..dcdd8b48942793739f37a73677e3ca1b4daed13e 100644 (file)
@@ -53,8 +53,12 @@ endif
 
 all-nscd-modules := $(nscd-modules) selinux
 ifeq (yes,$(have-selinux))
+ifeq (yes,$(have-libaudit))
+libaudit = -laudit
+endif
+
 nscd-modules += selinux
-selinux-LIBS := -lselinux
+selinux-LIBS := -lselinux $(libaudit)
 endif
 
 LDLIBS-nscd = $(selinux-LIBS)
index 897f4747de14b0d7fb7ddc5fcb5e2fc6e3ac0ca8..7d0063aed0c7de0bd98b62e04f1c64f36046c85b 100644 (file)
@@ -621,7 +621,10 @@ send_ro_fd (struct database_dyn *db, char *key, int fd)
 
   /* Send the control message.  We repeat when we are interrupted but
      everything else is ignored.  */
-  (void) TEMP_FAILURE_RETRY (sendmsg (fd, &msg, 0));
+#ifndef MSG_NOSIGNAL
+# define MSG_NOSIGNAL 0
+#endif
+  (void) TEMP_FAILURE_RETRY (sendmsg (fd, &msg, MSG_NOSIGNAL));
 
   if (__builtin_expect (debug_level > 0, 0))
     dbg_log (_("provide access to FD %d, for %s"), db->ro_fd, key);
@@ -1173,8 +1176,7 @@ handle_request: request received (Version = %d)"), req.version);
          /* The pthread_cond_timedwait() call timed out.  It is time
                 to clean up the cache.  */
          assert (my_number < lastdb);
-         prune_cache (&dbs[my_number],
-                      prune_ts.tv_sec + (prune_ts.tv_nsec >= 500000000));
+         prune_cache (&dbs[my_number], time (NULL));
 
          if (clock_gettime (timeout_clock, &prune_ts) == -1)
            /* Should never happen.  */
index 12c10664af3ec6ffbeb2c5f00023ad473ff6b64e..b7f0239a23ecc65d974e5e2a9de9e2e0ab2011e2 100644 (file)
@@ -196,7 +196,10 @@ get_mapping (request_type type, const char *key,
     /* Failure or timeout.  */
     goto out_close2;
 
-  if (TEMP_FAILURE_RETRY (__recvmsg (sock, &msg, 0)) != keylen)
+#ifndef MSG_NOSIGNAL
+# define MSG_NOSIGNAL 0
+#endif
+  if (TEMP_FAILURE_RETRY (__recvmsg (sock, &msg, MSG_NOSIGNAL)) != keylen)
     goto out_close2;
 
   mapfd = *(int *) CMSG_DATA (cmsg);
index 92316422788af57566afe0e111306f5507767b11..a595a0b88fe635486534ef5e7cd50357ed9ea016 100644 (file)
@@ -143,8 +143,8 @@ receive_print_stats (void)
   int fd;
   int i;
   uid_t uid = getuid ();
-  const char *yesstr = nl_langinfo (YESSTR);
-  const char *nostr = nl_langinfo (NOSTR);
+  const char *yesstr = _("yes");
+  const char *nostr = _("no");
 
   /* Find out whether there is another user but root allowed to
      request statistics.  */
index f57f0920aea78534f39cc8c27c790aaa512e94dd..4dc4df36488ac10299c707b1f75a02120ea62ca2 100644 (file)
@@ -18,6 +18,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include "config.h"
 #include <error.h>
 #include <errno.h>
 #include <libintl.h>
@@ -30,6 +31,9 @@
 #include <selinux/avc.h>
 #include <selinux/flask.h>
 #include <selinux/selinux.h>
+#ifdef HAVE_LIBAUDIT
+#include <libaudit.h>
+#endif
 
 #include "dbg_log.h"
 #include "selinux.h"
@@ -66,6 +70,11 @@ static struct avc_entry_ref aeref;
 /* Thread to listen for SELinux status changes via netlink.  */
 static pthread_t avc_notify_thread;
 
+#ifdef HAVE_LIBAUDIT
+/* Prototype for supporting the audit daemon */
+static void log_callback (const char *fmt, ...);
+#endif
+
 /* Prototypes for AVC callback functions.  */
 static void *avc_create_thread (void (*run) (void));
 static void avc_stop_thread (void *thread);
@@ -77,7 +86,11 @@ static void avc_free_lock (void *lock);
 /* AVC callback structures for use in avc_init.  */
 static const struct avc_log_callback log_cb =
 {
+#ifdef HAVE_LIBAUDIT
+  .func_log = log_callback,
+#else
   .func_log = dbg_log,
+#endif
   .func_audit = NULL
 };
 static const struct avc_thread_callback thread_cb =
@@ -93,6 +106,30 @@ static const struct avc_lock_callback lock_cb =
   .func_free_lock = avc_free_lock
 };
 
+#ifdef HAVE_LIBAUDIT
+/* The audit system's netlink socket descriptor */
+static int audit_fd = -1;
+
+/* When an avc denial occurs, log it to audit system */
+static void 
+log_callback (const char *fmt, ...)
+{
+  va_list ap;
+
+  va_start (ap, fmt);
+  audit_log_avc (audit_fd, AUDIT_USER_AVC, fmt, ap);
+  va_end (ap);
+}
+
+/* Initialize the connection to the audit system */
+static void 
+audit_init (void)
+{
+  audit_fd = audit_open ();
+  if (audit_fd < 0)
+     dbg_log (_("Failed opening connection to the audit subsystem"));
+}
+#endif /* HAVE_LIBAUDIT */
 
 /* Determine if we are running on an SELinux kernel. Set selinux_enabled
    to the result.  */
@@ -182,6 +219,9 @@ nscd_avc_init (void)
     error (EXIT_FAILURE, errno, _("Failed to start AVC"));
   else
     dbg_log (_("Access Vector Cache (AVC) started"));
+#ifdef HAVE_LIBAUDIT
+  audit_init ();
+#endif
 }
 
 
@@ -262,6 +302,9 @@ void
 nscd_avc_destroy (void)
 {
   avc_destroy ();
+#ifdef HAVE_LIBAUDIT
+  audit_close (audit_fd);
+#endif
 }
 
 #endif /* HAVE_SELINUX */
index e409ed7300a88ad875e82a4f84ebe7d631d7af7e..3fa7c322d1dc5fa26ca48059717e1a38f0f688c5 100644 (file)
@@ -327,31 +327,74 @@ fnmatch (pattern, string, flags)
     {
       mbstate_t ps;
       size_t n;
+      const char *p;
       wchar_t *wpattern;
       wchar_t *wstring;
 
       /* Convert the strings into wide characters.  */
       memset (&ps, '\0', sizeof (ps));
-      n = mbsrtowcs (NULL, &pattern, 0, &ps);
-      if (__builtin_expect (n == (size_t) -1, 0))
-       /* Something wrong.
-          XXX Do we have to set `errno' to something which mbsrtows hasn't
-          already done?  */
-       return -1;
-      wpattern = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
-      assert (mbsinit (&ps));
-      (void) mbsrtowcs (wpattern, &pattern, n + 1, &ps);
+      p = pattern;
+#ifdef _LIBC
+      n = strnlen (pattern, 1024);
+#else
+      n = strlen (pattern);
+#endif
+      if (__builtin_expect (n < 1024, 1))
+       {
+         wpattern = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
+         n = mbsrtowcs (wpattern, &p, n + 1, &ps);
+         if (__builtin_expect (n == (size_t) -1, 0))
+           /* Something wrong.
+              XXX Do we have to set `errno' to something which mbsrtows hasn't
+              already done?  */
+           return -1;
+         if (p)
+           memset (&ps, '\0', sizeof (ps));
+       }
+      if (__builtin_expect (p != NULL, 0))
+       {
+         n = mbsrtowcs (NULL, &pattern, 0, &ps);
+         if (__builtin_expect (n == (size_t) -1, 0))
+           /* Something wrong.
+              XXX Do we have to set `errno' to something which mbsrtows hasn't
+              already done?  */
+           return -1;
+         wpattern = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
+         assert (mbsinit (&ps));
+         (void) mbsrtowcs (wpattern, &pattern, n + 1, &ps);
+       }
 
       assert (mbsinit (&ps));
-      n = mbsrtowcs (NULL, &string, 0, &ps);
-      if (__builtin_expect (n == (size_t) -1, 0))
-       /* Something wrong.
-          XXX Do we have to set `errno' to something which mbsrtows hasn't
-          already done?  */
-       return -1;
-      wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
-      assert (mbsinit (&ps));
-      (void) mbsrtowcs (wstring, &string, n + 1, &ps);
+#ifdef _LIBC
+      n = strnlen (string, 1024);
+#else
+      n = strlen (string);
+#endif
+      p = string;
+      if (__builtin_expect (n < 1024, 1))
+       {
+         wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
+         n = mbsrtowcs (wstring, &p, n + 1, &ps);
+         if (__builtin_expect (n == (size_t) -1, 0))
+           /* Something wrong.
+              XXX Do we have to set `errno' to something which mbsrtows hasn't
+              already done?  */
+           return -1;
+         if (p)
+           memset (&ps, '\0', sizeof (ps));
+       }
+      if (__builtin_expect (p != NULL, 0))
+       {
+         n = mbsrtowcs (NULL, &string, 0, &ps);
+         if (__builtin_expect (n == (size_t) -1, 0))
+           /* Something wrong.
+              XXX Do we have to set `errno' to something which mbsrtows hasn't
+              already done?  */
+           return -1;
+         wstring = (wchar_t *) alloca ((n + 1) * sizeof (wchar_t));
+         assert (mbsinit (&ps));
+         (void) mbsrtowcs (wstring, &string, n + 1, &ps);
+       }
 
       return internal_fnwmatch (wpattern, wstring, wstring + n,
                                flags & FNM_PERIOD, flags);
index 72bf187b14be96f7edcaa98a0639216ebca5ba6a..2100bb542066c5761bef00889907a8a8727f9905 100644 (file)
@@ -779,6 +779,8 @@ re_compile_internal (preg, pattern, length, syntax)
     }
   preg->used = sizeof (re_dfa_t);
 
+  __libc_lock_init (dfa->lock);
+
   err = init_dfa (dfa, length);
   if (BE (err != REG_NOERROR, 0))
     {
index 001b50b13482a8f0e173a5548fb48fc5ed2e414d..d590104fce3db4baa3e398c13157764f6fbda072 100644 (file)
@@ -214,7 +214,8 @@ build_wcs_buffer (pstr)
      re_string_t *pstr;
 {
 #ifdef _LIBC
-  unsigned char buf[pstr->mb_cur_max];
+  unsigned char buf[MB_LEN_MAX];
+  assert (MB_LEN_MAX >= pstr->mb_cur_max);
 #else
   unsigned char buf[64];
 #endif
@@ -282,7 +283,8 @@ build_wcs_upper_buffer (pstr)
   mbstate_t prev_st;
   int src_idx, byte_idx, end_idx, mbclen, remain_len;
 #ifdef _LIBC
-  unsigned char buf[pstr->mb_cur_max];
+  unsigned char buf[MB_LEN_MAX];
+  assert (MB_LEN_MAX >= pstr->mb_cur_max);
 #else
   unsigned char buf[64];
 #endif
index 18865a7266447e6c0dfe274c2bbb0480ab3ef026..e48627766f3a05edd608f735ea24aff2da79f17f 100644 (file)
 #if defined HAVE_WCTYPE_H || defined _LIBC
 # include <wctype.h>
 #endif /* HAVE_WCTYPE_H || _LIBC */
+#if defined _LIBC
+# include <bits/libc-lock.h>
+#else
+# define __libc_lock_define(CLASS,NAME)
+# define __libc_lock_init(NAME) do { } while (0)
+# define __libc_lock_lock(NAME) do { } while (0)
+# define __libc_lock_unlock(NAME) do { } while (0)
+#endif
 
 /* In case that the system doesn't have isblank().  */
 #if !defined _LIBC && !defined HAVE_ISBLANK && !defined isblank
@@ -650,6 +658,7 @@ struct re_dfa_t
 #ifdef DEBUG
   char* re_str;
 #endif
+  __libc_lock_define (, lock)
 };
 
 #ifndef RE_NO_INTERNAL_PROTOTYPES
index 91b48dd4a205f413d044aa476e2f0c81cf87c3ea..021fcf4060fee1ac5c9c1a969238562672d222fc 100644 (file)
@@ -219,6 +219,7 @@ regexec (preg, string, nmatch, pmatch, eflags)
 {
   reg_errcode_t err;
   int start, length;
+  re_dfa_t *dfa = (re_dfa_t *)preg->buffer;
 
   if (eflags & ~(REG_NOTBOL | REG_NOTEOL | REG_STARTEND))
     return REG_BADPAT;
@@ -233,12 +234,15 @@ regexec (preg, string, nmatch, pmatch, eflags)
       start = 0;
       length = strlen (string);
     }
+
+  __libc_lock_lock (dfa->lock);
   if (preg->no_sub)
     err = re_search_internal (preg, string, length, start, length - start,
                              length, 0, NULL, eflags);
   else
     err = re_search_internal (preg, string, length, start, length - start,
                              length, nmatch, pmatch, eflags);
+  __libc_lock_unlock (dfa->lock);
   return err != REG_NOERROR;
 }
 
@@ -402,6 +406,7 @@ re_search_stub (bufp, string, length, start, range, stop, regs, ret_len)
   regmatch_t *pmatch;
   int nregs, rval;
   int eflags = 0;
+  re_dfa_t *dfa = (re_dfa_t *)bufp->buffer;
 
   /* Check for out-of-range.  */
   if (BE (start < 0 || start > length, 0))
@@ -411,6 +416,8 @@ re_search_stub (bufp, string, length, start, range, stop, regs, ret_len)
   else if (BE (start + range < 0, 0))
     range = -start;
 
+  __libc_lock_lock (dfa->lock);
+
   eflags |= (bufp->not_bol) ? REG_NOTBOL : 0;
   eflags |= (bufp->not_eol) ? REG_NOTEOL : 0;
 
@@ -439,7 +446,10 @@ re_search_stub (bufp, string, length, start, range, stop, regs, ret_len)
     nregs = bufp->re_nsub + 1;
   pmatch = re_malloc (regmatch_t, nregs);
   if (BE (pmatch == NULL, 0))
-    return -2;
+    {
+      rval = -2;
+      goto out;
+    }
 
   result = re_search_internal (bufp, string, length, start, range, stop,
                               nregs, pmatch, eflags);
@@ -469,6 +479,8 @@ re_search_stub (bufp, string, length, start, range, stop, regs, ret_len)
        rval = pmatch[0].rm_so;
     }
   re_free (pmatch);
+ out:
+  __libc_lock_unlock (dfa->lock);
   return rval;
 }
 
index 8b7767bd4a7e12ae2f03d193eecbe1cafe2a66d8..a265719d3682a9d5ff69d86b8734645a78a3c1d8 100644 (file)
@@ -20,7 +20,7 @@
 #include <stdio.h>
 #include <pwd.h>
 
-#define _S(x)  x ? x : ""
+#define _S(x)  x ?: ""
 
 /* Write an entry to the given stream.
    This must know the format of the password file.  */
@@ -35,11 +35,21 @@ putpwent (p, stream)
       return -1;
     }
 
-  if (fprintf (stream, "%s:%s:%lu:%lu:%s:%s:%s\n",
-              p->pw_name, _S (p->pw_passwd),
-              (unsigned long int) p->pw_uid, (unsigned long int) p->pw_gid,
-              _S (p->pw_gecos), _S (p->pw_dir), _S (p->pw_shell)) < 0)
-    return -1;
-
+  if (p->pw_name[0] == '+' || p->pw_name[0] == '-')
+    {
+      if (fprintf (stream, "%s:%s:::%s:%s:%s\n",
+                  p->pw_name, _S (p->pw_passwd),
+                  _S (p->pw_gecos), _S (p->pw_dir), _S (p->pw_shell)) < 0)
+       return -1;
+    }
+  else
+    {
+      if (fprintf (stream, "%s:%s:%lu:%lu:%s:%s:%s\n",
+                  p->pw_name, _S (p->pw_passwd),
+                  (unsigned long int) p->pw_uid,
+                  (unsigned long int) p->pw_gid,
+                  _S (p->pw_gecos), _S (p->pw_dir), _S (p->pw_shell)) < 0)
+       return -1;
+    }
   return 0;
 }
index c641d2d37104c89847de88fb4749db13407d56f7..b95c40b84b7b6167cc8de4f2537d42c224f7ab5f 100644 (file)
@@ -1602,6 +1602,8 @@ _IO_vfscanf (s, format, argptr, errp)
          if (c == EOF)
            input_error ();
 
+         got_dot = got_e = 0;
+
          /* Check for a sign.  */
          if (c == L_('-') || c == L_('+'))
            {
@@ -1629,14 +1631,13 @@ _IO_vfscanf (s, format, argptr, errp)
                  const char *cmpp = decimal;
                  int avail = width > 0 ? width : INT_MAX;
 
-                 while ((unsigned char) *cmpp == c && avail > 0)
+                 while ((unsigned char) *cmpp == c && avail-- > 0)
                    if (*++cmpp == '\0')
                      break;
                    else
                      {
                        if (inchar () == EOF)
                          break;
-                       --avail;
                      }
 
                  if (*cmpp != '\0')
@@ -1652,6 +1653,17 @@ _IO_vfscanf (s, format, argptr, errp)
 
                      conv_error ();
                    }
+                 else
+                   {
+                     /* Add all the characters.  */
+                     for (cmpp = decimal; *cmpp != '\0'; ++cmpp)
+                       ADDW ((unsigned char) *cmpp);
+                     if (width > 0)
+                       width = avail;
+                     got_dot = 1;
+
+                     c = inchar ();
+                   }
                  if (width > 0)
                    width = avail;
 #endif
@@ -1759,7 +1771,6 @@ _IO_vfscanf (s, format, argptr, errp)
                }
            }
 
-         got_dot = got_e = 0;
          do
            {
              if (ISDIGIT (c))
index e955ea576a5e1ed5606358a4dd2771bd37c78d26..404006f2cd32e1c28f586732dab0dfa9efe9dffc 100644 (file)
@@ -236,23 +236,20 @@ __initstate_r (seed, arg_state, n, buf)
      size_t n;
      struct random_data *buf;
 {
-  int type;
-  int degree;
-  int separation;
-  int32_t *state;
-  int old_type;
-  int32_t *old_state;
-
   if (buf == NULL)
     goto fail;
 
-  old_type = buf->rand_type;
-  old_state = buf->state;
-  if (old_type == TYPE_0)
-    old_state[-1] = TYPE_0;
-  else
-    old_state[-1] = (MAX_TYPES * (buf->rptr - old_state)) + old_type;
+  int32_t *old_state = buf->state;
+  if (old_state != NULL)
+    {
+      int old_type = buf->rand_type;
+      if (old_type == TYPE_0)
+       old_state[-1] = TYPE_0;
+      else
+       old_state[-1] = (MAX_TYPES * (buf->rptr - old_state)) + old_type;
+    }
 
+  int type;
   if (n >= BREAK_3)
     type = n < BREAK_4 ? TYPE_3 : TYPE_4;
   else if (n < BREAK_1)
@@ -267,13 +264,13 @@ __initstate_r (seed, arg_state, n, buf)
   else
     type = n < BREAK_2 ? TYPE_1 : TYPE_2;
 
-  degree = random_poly_info.degrees[type];
-  separation = random_poly_info.seps[type];
+  int degree = random_poly_info.degrees[type];
+  int separation = random_poly_info.seps[type];
 
   buf->rand_type = type;
   buf->rand_sep = separation;
   buf->rand_deg = degree;
-  state = &((int32_t *) arg_state)[1]; /* First location.  */
+  int32_t *state = &((int32_t *) arg_state)[1];        /* First location.  */
   /* Must set END_PTR before srandom.  */
   buf->end_ptr = &state[degree];
 
index 1bda32262bc4e74158ed21c3c362e0e61d16cd92..cb19fcb03d8d3b7000744ffa63496228fad951b2 100644 (file)
@@ -614,7 +614,7 @@ extern void *valloc (size_t __size) __THROW __attribute_malloc__;
 #ifdef __USE_XOPEN2K
 /* Allocate memory of SIZE bytes with an alignment of ALIGNMENT.  */
 extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
-     __THROW __attribute_malloc__ __nonnull ((1));
+     __THROW __nonnull ((1));
 #endif
 
 __BEGIN_NAMESPACE_STD
index 66469f586ed7ae9bf800f0643607e045e7681f46..7a77e35732aa78549c725b1162b15a885501b44d 100644 (file)
@@ -52,7 +52,7 @@ strop-tests   := memchr memcmp memcpy memmove mempcpy memset memccpy  \
 tests          := tester inl-tester noinl-tester testcopy test-ffs     \
                   tst-strlen stratcliff tst-svc tst-inlcall            \
                   bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap      \
-                  tst-strtok tst-strxfrm bug-strcoll1                  \
+                  tst-strtok tst-strxfrm bug-strcoll1 tst-strfry       \
                   $(addprefix test-,$(strop-tests))
 distribute     := memcopy.h pagecopy.h tst-svc.expect test-string.h
 
diff --git a/string/tst-strfry.c b/string/tst-strfry.c
new file mode 100644 (file)
index 0000000..2b40a39
--- /dev/null
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#include <string.h>
+
+static int
+do_test (void)
+{
+  char str[] = "this is a test";
+
+  strfry (str);
+
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
index 284e355cc3b71af4a3e6d7b204fe510fcd5a082d..083ab676aba5c13086f89b8ebeb6b53f19f41b3f 100644 (file)
@@ -85,6 +85,7 @@ all: # Make this the default target; it will be defined in Rules.
 
 include ../Makeconfig
 
+tests = tst-xdrmem
 xtests := tst-getmyaddr
 
 ifeq ($(have-thread-library),yes)
@@ -107,19 +108,19 @@ librpcsvc-inhibit-o = .os # Build no shared rpcsvc library.
 omit-deps = $(librpcsvc-routines)
 endif
 
-CFLAGS-xbootparam_prot.c = -Wno-unused
-CFLAGS-xnlm_prot.c = -Wno-unused
-CFLAGS-xrstat.c = -Wno-unused
-CFLAGS-xyppasswd.c = -Wno-unused
-CFLAGS-xklm_prot.c = -Wno-unused
-CFLAGS-xrex.c = -Wno-unused
-CFLAGS-xsm_inter.c = -Wno-unused
-CFLAGS-xmount.c = -Wno-unused
-CFLAGS-xrusers.c = -Wno-unused
-CFLAGS-xspray.c = -Wno-unused
-CFLAGS-xnfs_prot.c = -Wno-unused
-CFLAGS-xrquota.c = -Wno-unused
-CFLAGS-xkey_prot.c = -Wno-unused
+CFLAGS-xbootparam_prot.c = -Wno-unused $(PIC-ccflag)
+CFLAGS-xnlm_prot.c = -Wno-unused $(PIC-ccflag)
+CFLAGS-xrstat.c = -Wno-unused $(PIC-ccflag)
+CFLAGS-xyppasswd.c = -Wno-unused $(PIC-ccflag)
+CFLAGS-xklm_prot.c = -Wno-unused $(PIC-ccflag)
+CFLAGS-xrex.c = -Wno-unused $(PIC-ccflag)
+CFLAGS-xsm_inter.c = -Wno-unused $(PIC-ccflag)
+CFLAGS-xmount.c = -Wno-unused $(PIC-ccflag)
+CFLAGS-xrusers.c = -Wno-unused $(PIC-ccflag)
+CFLAGS-xspray.c = -Wno-unused $(PIC-ccflag)
+CFLAGS-xnfs_prot.c = -Wno-unused $(PIC-ccflag)
+CFLAGS-xrquota.c = -Wno-unused $(PIC-ccflag)
+CFLAGS-xkey_prot.c = -Wno-unused $(PIC-ccflag)
 CFLAGS-auth_unix.c = -fexceptions
 CFLAGS-key_call.c = -fexceptions
 CFLAGS-pmap_rmt.c = -fexceptions
index 374518716ef8665f5ff4d4c0f924bbab47d4a976..f58d3b2a8b22bcc3c7f3c406a49515ceb020caf1 100644 (file)
 int
 bindresvport (int sd, struct sockaddr_in *sin)
 {
-  int res;
   static short port;
   struct sockaddr_in myaddr;
   int i;
 
 #define STARTPORT 600
+#define LOWPORT 512
 #define ENDPORT (IPPORT_RESERVED - 1)
 #define NPORTS (ENDPORT - STARTPORT + 1)
+  static short startport = STARTPORT;
 
   if (sin == (struct sockaddr_in *) 0)
     {
@@ -68,17 +69,29 @@ bindresvport (int sd, struct sockaddr_in *sin)
     {
       port = (__getpid () % NPORTS) + STARTPORT;
     }
-  res = -1;
-  __set_errno (EADDRINUSE);
 
-  for (i = 0; i < NPORTS && res < 0 && errno == EADDRINUSE; ++i)
+  /* Initialize to make gcc happy.  */
+  int res = -1;
+
+  int nports = ENDPORT - startport + 1;
+ again:
+  for (i = 0; i < nports; ++i)
     {
       sin->sin_port = htons (port++);
       if (port > ENDPORT)
        {
-         port = STARTPORT;
+         port = startport;
        }
       res = __bind (sd, sin, sizeof (struct sockaddr_in));
+      if (res >= 0 || errno != EADDRINUSE)
+       break;
+    }
+
+  if (i == nports && startport != LOWPORT)
+    {
+      startport = LOWPORT;
+      nports = STARTPORT - LOWPORT;
+      goto again;
     }
 
   return res;
index d1d4ca87699ff51a67b7b16a4529f14afdbde608..2a6876d9d808b8e3665cab8585880ba1aa0c43bb 100644 (file)
@@ -44,9 +44,12 @@ static char sccsid[] = "@(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro";
 #include <rpc/pmap_clnt.h>
 #include <sys/socket.h>
 #include <netdb.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <errno.h>
 #include <libintl.h>
+#include <unistd.h>
+
 
 /*
  * Get a copy of the current port maps.
@@ -56,13 +59,19 @@ struct pmaplist *
 pmap_getmaps (struct sockaddr_in *address)
 {
   struct pmaplist *head = (struct pmaplist *) NULL;
-  int socket = -1;
   struct timeval minutetimeout;
   CLIENT *client;
+  bool closeit = false;
 
   minutetimeout.tv_sec = 60;
   minutetimeout.tv_usec = 0;
   address->sin_port = htons (PMAPPORT);
+
+  /* Don't need a reserved port to get ports from the portmapper.  */
+  int socket = __get_socket (address);
+  if (socket != -1)
+    closeit = true;
+
   client = INTUSE(clnttcp_create) (address, PMAPPROG,
                                   PMAPVERS, &socket, 50, 500);
   if (client != (CLIENT *) NULL)
@@ -75,7 +84,9 @@ pmap_getmaps (struct sockaddr_in *address)
        }
       CLNT_DESTROY (client);
     }
-  /* (void)close(socket); CLNT_DESTROY already closed it */
+  /* We only need to close the socket here if we opened  it.  */
+  if (closeit)
+    (void) __close (socket);
   address->sin_port = 0;
   return head;
 }
index 00e1ba95bf00bf965707c195f14fee07e03a45dc..2d309841f3d47cc100da102c51af4c5111cab380 100644 (file)
@@ -38,6 +38,8 @@ static char sccsid[] = "@(#)pmap_getport.c 1.9 87/08/11 Copyr 1984 Sun Micro";
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
 
+#include <stdbool.h>
+#include <unistd.h>
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>
 #include <rpc/pmap_clnt.h>
@@ -48,6 +50,41 @@ static const struct timeval timeout =
 static const struct timeval tottimeout =
 {60, 0};
 
+/*
+ * Create a socket that is locally bound to a non-reserve port. For
+ * any failures, -1 is returned which will cause the RPC code to
+ * create the socket.
+ */
+int
+internal_function
+__get_socket (struct sockaddr_in *saddr)
+{
+  int so = __socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
+  if (so < 0)
+    return -1;
+
+  struct sockaddr_in laddr;
+  socklen_t namelen = sizeof (laddr);
+  laddr.sin_family = AF_INET;
+  laddr.sin_port = 0;
+  laddr.sin_addr.s_addr = htonl (INADDR_ANY);
+
+  int cc = __bind (so, (struct sockaddr *) &laddr, namelen);
+  if (__builtin_expect (cc < 0, 0))
+    {
+    fail:
+      __close (so);
+      return -1;
+    }
+
+  cc = __connect (so, (struct sockaddr *) saddr, namelen);
+  if (__builtin_expect (cc < 0, 0))
+    goto fail;
+
+  return so;
+}
+
+
 /*
  * Find the mapped port for program,version.
  * Calls the pmap service remotely to do the lookup.
@@ -64,11 +101,18 @@ pmap_getport (address, program, version, protocol)
   int socket = -1;
   CLIENT *client;
   struct pmap parms;
+  bool closeit = false;
 
   address->sin_port = htons (PMAPPORT);
   if (protocol == IPPROTO_TCP)
-    client = INTUSE(clnttcp_create) (address, PMAPPROG, PMAPVERS, &socket,
-                                    RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
+    {
+      /* Don't need a reserved port to get ports from the portmapper.  */
+      socket = __get_socket(address);
+      if (socket != -1)
+       closeit = true;
+      client = INTUSE(clnttcp_create) (address, PMAPPROG, PMAPVERS, &socket,
+                                      RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
+    }
   else
     client = INTUSE(clntudp_bufcreate) (address, PMAPPROG, PMAPVERS, timeout,
                                        &socket, RPCSMALLMSGSIZE,
@@ -93,7 +137,9 @@ pmap_getport (address, program, version, protocol)
        }
       CLNT_DESTROY (client);
     }
-  /* (void)close(socket); CLNT_DESTROY already closed it */
+  /* We only need to close the socket here if we opened  it.  */
+  if (closeit)
+    (void) __close (socket);
   address->sin_port = 0;
   return port;
 }
index 644d503a1fdebd0d318e09f6519688a4ea39599e..e06884891991320a069263e10b917017a9d83193 100644 (file)
@@ -125,8 +125,9 @@ xdr_rmtcall_args (XDR *xdrs, struct rmtcallargs *cap)
       INTUSE(xdr_u_long) (xdrs, &(cap->vers)) &&
       INTUSE(xdr_u_long) (xdrs, &(cap->proc)))
     {
+      u_long dummy_arglen = 0;
       lenposition = XDR_GETPOS (xdrs);
-      if (!INTUSE(xdr_u_long) (xdrs, &(cap->arglen)))
+      if (!INTUSE(xdr_u_long) (xdrs, &dummy_arglen))
        return FALSE;
       argposition = XDR_GETPOS (xdrs);
       if (!(*(cap->xdr_args)) (xdrs, cap->args_ptr))
index fee83514d1a7d394b325c44879c782913b2f577d..acc0132603a8b809192440f785f65f44d9443320 100644 (file)
@@ -695,11 +695,9 @@ s_output (int argc, const char *argv[], const char *infile, const char *define,
 
   fprintf (fout, "#include <stdio.h>\n");
   fprintf (fout, "#include <stdlib.h>\n");
+  fprintf (fout, "#include <rpc/pmap_clnt.h>\n");
   if (Cflag)
-    {
-      fprintf (fout, "#include <rpc/pmap_clnt.h>\n");
-      fprintf (fout, "#include <string.h>\n");
-    }
+    fprintf (fout, "#include <string.h>\n");
   if (strcmp (svcclosetime, "-1") == 0)
     indefinitewait = 1;
   else if (strcmp (svcclosetime, "0") == 0)
diff --git a/sunrpc/tst-xdrmem.c b/sunrpc/tst-xdrmem.c
new file mode 100644 (file)
index 0000000..0c9929c
--- /dev/null
@@ -0,0 +1,205 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2005.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+#include <rpc/rpc.h>
+
+static int
+do_test (void)
+{
+  XDR xdrs;
+  unsigned char buf[8192];
+  int v_int;
+  u_int v_u_int;
+  long v_long;
+  u_long v_u_long;
+  quad_t v_hyper;
+  u_quad_t v_u_hyper;
+  quad_t v_longlong_t;
+  u_quad_t v_u_longlong_t;
+  short v_short;
+  u_short v_u_short;
+  char v_char;
+  u_char v_u_char;
+  bool_t v_bool;
+  enum_t v_enum;
+  char *v_wrapstring;
+
+  xdrmem_create (&xdrs, (char *) buf, sizeof (buf), XDR_ENCODE);
+
+#define TESTS \
+  T(int, 0)                            \
+  T(int, CHAR_MAX)                     \
+  T(int, CHAR_MIN)                     \
+  T(int, SHRT_MAX)                     \
+  T(int, SHRT_MIN)                     \
+  T(int, INT_MAX)                      \
+  T(int, INT_MIN)                      \
+  T(int, 0x123)                                \
+  T(u_int, 0)                          \
+  T(u_int, UCHAR_MAX)                  \
+  T(u_int, USHRT_MAX)                  \
+  T(u_int, UINT_MAX)                   \
+  T(u_int, 0xdeadbeef)                 \
+  T(u_int, 0x12345678)                 \
+  T(long, 0)                           \
+  T(long, 2147483647L)                 \
+  T(long, -2147483648L)                        \
+  T(long, -305419896L)                 \
+  T(long, -305419896L)                 \
+  T(u_long, 0)                         \
+  T(u_long, 0xffffffffUL)              \
+  T(u_long, 0xdeadbeefUL)              \
+  T(u_long, 0x12345678UL)              \
+  T(hyper, 0)                          \
+  T(hyper, CHAR_MAX)                   \
+  T(hyper, CHAR_MIN)                   \
+  T(hyper, SHRT_MAX)                   \
+  T(hyper, SHRT_MIN)                   \
+  T(hyper, INT_MAX)                    \
+  T(hyper, INT_MIN)                    \
+  T(hyper, LONG_MAX)                   \
+  T(hyper, LONG_MIN)                   \
+  T(hyper, LONG_LONG_MAX)              \
+  T(hyper, LONG_LONG_MIN)              \
+  T(hyper, 0x12312345678LL)            \
+  T(hyper, 0x12387654321LL)            \
+  T(u_hyper, 0)                                \
+  T(u_hyper, UCHAR_MAX)                        \
+  T(u_hyper, USHRT_MAX)                        \
+  T(u_hyper, UINT_MAX)                 \
+  T(u_hyper, ULONG_MAX)                        \
+  T(u_hyper, ULONG_LONG_MAX)           \
+  T(u_hyper, 0xdeadbeefdeadbeefULL)    \
+  T(u_hyper, 0x12312345678ULL)         \
+  T(u_hyper, 0x12387654321ULL)         \
+  T(longlong_t, 0)                     \
+  T(longlong_t, CHAR_MAX)              \
+  T(longlong_t, CHAR_MIN)              \
+  T(longlong_t, SHRT_MAX)              \
+  T(longlong_t, SHRT_MIN)              \
+  T(longlong_t, INT_MAX)               \
+  T(longlong_t, INT_MIN)               \
+  T(longlong_t, LONG_MAX)              \
+  T(longlong_t, LONG_MIN)              \
+  T(longlong_t, LONG_LONG_MAX)         \
+  T(longlong_t, LONG_LONG_MIN)         \
+  T(longlong_t, 0x12312345678LL)       \
+  T(longlong_t, 0x12387654321LL)       \
+  T(u_longlong_t, 0)                   \
+  T(u_longlong_t, UCHAR_MAX)           \
+  T(u_longlong_t, USHRT_MAX)           \
+  T(u_longlong_t, UINT_MAX)            \
+  T(u_longlong_t, ULONG_MAX)           \
+  T(u_longlong_t, ULONG_LONG_MAX)      \
+  T(u_longlong_t, 0xdeadbeefdeadbeefULL)\
+  T(u_longlong_t, 0x12312345678ULL)    \
+  T(u_longlong_t, 0x12387654321ULL)    \
+  T(short, CHAR_MAX)                   \
+  T(short, CHAR_MIN)                   \
+  T(short, SHRT_MAX)                   \
+  T(short, SHRT_MIN)                   \
+  T(short, 0x123)                      \
+  T(u_short, 0)                                \
+  T(u_short, UCHAR_MAX)                        \
+  T(u_short, USHRT_MAX)                        \
+  T(u_short, 0xbeef)                   \
+  T(u_short, 0x5678)                   \
+  T(char, CHAR_MAX)                    \
+  T(char, CHAR_MIN)                    \
+  T(char, 0x23)                                \
+  T(u_char, 0)                         \
+  T(u_char, UCHAR_MAX)                 \
+  T(u_char, 0xef)                      \
+  T(u_char, 0x78)                      \
+  T(bool, 0)                           \
+  T(bool, 1)                           \
+  T(enum, 0)                           \
+  T(enum, CHAR_MAX)                    \
+  T(enum, CHAR_MIN)                    \
+  T(enum, SHRT_MAX)                    \
+  T(enum, SHRT_MIN)                    \
+  T(enum, INT_MAX)                     \
+  T(enum, INT_MIN)                     \
+  T(enum, 0x123)                       \
+  S(wrapstring, (char *) "")           \
+  S(wrapstring, (char *) "hello, world")
+
+#define T(type, val) \
+  v_##type = val;                      \
+  if (! xdr_##type (&xdrs, &v_##type)) \
+    {                                  \
+      puts ("encoding of " #type       \
+           " " #val " failed");        \
+      return 1;                                \
+    }
+#define S(type, val) T(type, val)
+
+  TESTS
+#undef T
+#undef S
+
+  xdr_destroy (&xdrs);
+
+  xdrmem_create (&xdrs, (char *) buf, sizeof (buf), XDR_DECODE);
+
+#define T(type, val) \
+  v_##type = 0x15;                     \
+  if (! xdr_##type (&xdrs, &v_##type)) \
+    {                                  \
+      puts ("decoding of " #type       \
+           " " #val " failed");        \
+      return 1;                                \
+    }                                  \
+  if (v_##type != val)                 \
+    {                                  \
+      puts ("decoded value differs, "  \
+           "type " #type " " #val);    \
+      return 1;                                \
+    }
+#define S(type, val) \
+  v_##type = NULL;                     \
+  if (! xdr_##type (&xdrs, &v_##type)) \
+    {                                  \
+      puts ("decoding of " #type       \
+           " " #val " failed");        \
+      return 1;                                \
+    }                                  \
+  if (strcmp (v_##type, val))          \
+    {                                  \
+      puts ("decoded value differs, "  \
+           "type " #type " " #val);    \
+      return 1;                                \
+    }                                  \
+  free (v_##type);                     \
+  v_##type = NULL;
+
+  TESTS
+#undef T
+#undef S
+
+  xdr_destroy (&xdrs);
+
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
index d99a9985c4375fe6e906de67cf2baad7156b7de2..4213907d96a78a57f23cb4c03ce60794dbabdba7 100644 (file)
@@ -240,7 +240,7 @@ xdr_hyper (XDR *xdrs, quad_t *llp)
       if (!XDR_GETLONG(xdrs, &t1) || !XDR_GETLONG(xdrs, &t2))
        return FALSE;
       *llp = ((quad_t) t1) << 32;
-      *llp |= t2;
+      *llp |= (uint32_t) t2;
       return TRUE;
     }
 
@@ -274,7 +274,7 @@ xdr_u_hyper (XDR *xdrs, u_quad_t *ullp)
       if (!XDR_GETLONG(xdrs, &t1) || !XDR_GETLONG(xdrs, &t2))
        return FALSE;
       *ullp = ((u_quad_t) t1) << 32;
-      *ullp |= t2;
+      *ullp |= (uint32_t) t2;
       return TRUE;
     }
 
index 4daa062c82557bfc3cfb16a025bd439ca3ae0db0..e73c5a5202528f8810b2b35c417c658a7af76ca0 100644 (file)
@@ -108,20 +108,20 @@ xdrstdio_destroy (XDR *xdrs)
 static bool_t
 xdrstdio_getlong (XDR *xdrs, long *lp)
 {
-  int32_t mycopy;
+  u_int32_t mycopy;
 
-  if (fread ((caddr_t) & mycopy, 4, 1, (FILE *) xdrs->x_private) != 1)
+  if (fread ((caddr_t) &mycopy, 4, 1, (FILE *) xdrs->x_private) != 1)
     return FALSE;
-  *lp = (int32_t) ntohl (mycopy);
+  *lp = (long) ntohl (mycopy);
   return TRUE;
 }
 
 static bool_t
 xdrstdio_putlong (XDR *xdrs, const long *lp)
 {
-  long mycopy = htonl (*lp);
-  lp = &mycopy;
-  if (fwrite ((caddr_t) lp, 4, 1, (FILE *) xdrs->x_private) != 1)
+  int32_t mycopy = htonl ((u_int32_t) *lp);
+
+  if (fwrite ((caddr_t) &mycopy, 4, 1, (FILE *) xdrs->x_private) != 1)
     return FALSE;
   return TRUE;
 }
index c83520e3495cf71ab115ba29e9bd9362d00fbc33..6e526bbebac5c9f0d6b2c49c28aded34d9b1c71c 100644 (file)
@@ -158,3 +158,4 @@ __strnlen (const char *str, size_t maxlen)
   return char_ptr - str;
 }
 weak_alias (__strnlen, strnlen)
+libc_hidden_def (strnlen)
index a05b054ed8a8c51a8986a956af1b6234bab82fe5..e765f2f43327416d2d76590def5c4521ed4448b0 100644 (file)
@@ -73,7 +73,7 @@ ENTRY(strlen)
        ld8     val1 = [str], 8;;
        nop.b   0
        nop.b   0
-l2:    ld8.s   val2 = [str], 8         // don't bomb out here
+.l2:   ld8.s   val2 = [str], 8         // don't bomb out here
        czx1.r  pos0 = val1     
        ;;
        cmp.ne  p6, p0 = 8, pos0
@@ -81,7 +81,7 @@ l2:   ld8.s   val2 = [str], 8         // don't bomb out here
        chk.s   val2, .recovery
 .back:
        mov     val1 = val2     
-       br.cond.dptk l2
+       br.cond.dptk    .l2
 .foundit:
        sub     tmp = str, origadd      // tmp = crt address - orig
        add     len = len, pos0;;
index 838e7a004aaef880f0258377ca14ec7873266474..cbaeb494871468751f02fc0e406835efa8fa1008 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2003, 2005 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,9 +29,8 @@ posix_fallocate (int fd, __off_t offset, __off_t len)
 {
   struct stat64 st;
   struct statfs f;
-  size_t step;
 
-  /* `off_t´ is a signed type.  Therefore we can determine whether
+  /* `off_t' is a signed type.  Therefore we can determine whether
      OFFSET + LEN is too large if it is a negative value.  */
   if (offset < 0 || len < 0)
     return EINVAL;
@@ -47,24 +46,48 @@ posix_fallocate (int fd, __off_t offset, __off_t len)
   if (! S_ISREG (st.st_mode))
     return ENODEV;
 
+  if (len == 0)
+    {
+      if (st.st_size < offset)
+       {
+         int ret = __ftruncate (fd, offset);
+
+         if (ret != 0)
+           ret = errno;
+         return ret;
+       }
+      return 0;
+    }
+
   /* We have to know the block size of the filesystem to get at least some
      sort of performance.  */
   if (__fstatfs (fd, &f) != 0)
     return errno;
 
-  /* Align OFFSET to block size and adjust LEN.  */
-  step = (offset + f.f_bsize - 1) % ~f.f_bsize;
-  offset += step;
+  /* Try to play safe.  */
+  if (f.f_bsize == 0)
+    f.f_bsize = 512;
 
   /* Write something to every block.  */
-  while (len > step)
+  for (offset += (len - 1) % f.f_bsize; len > 0; offset += f.f_bsize)
     {
-      len -= step;
+      len -= f.f_bsize;
+
+      if (offset < st.st_size)
+       {
+         unsigned char c;
+         ssize_t rsize = __pread (fd, &c, 1, offset);
+
+         if (rsize < 0)
+           return errno;
+         /* If there is a non-zero byte, the block must have been
+            allocated already.  */
+         else if (rsize == 1 && c != 0)
+           continue;
+       }
 
       if (__pwrite (fd, "", 1, offset) != 1)
        return errno;
-
-      offset += step;
     }
 
   return 0;
index 0eba4161a5c66e737097fb82731ba290f5c0b974..64ca9ae83d49f149ffd9110cd4f161b87c953704 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2003, 2004, 2005 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,9 +29,8 @@ __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
 {
   struct stat64 st;
   struct statfs64 f;
-  size_t step;
 
-  /* `off64_t´ is a signed type.  Therefore we can determine whether
+  /* `off64_t' is a signed type.  Therefore we can determine whether
      OFFSET + LEN is too large if it is a negative value.  */
   if (offset < 0 || len < 0)
     return EINVAL;
@@ -47,24 +46,48 @@ __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
   if (! S_ISREG (st.st_mode))
     return ENODEV;
 
+  if (len == 0)
+    {
+      if (st.st_size < offset)
+       {
+         int ret = __ftruncate64 (fd, offset);
+
+         if (ret != 0)
+           ret = errno;
+         return ret;
+       }
+      return 0;
+    }
+
   /* We have to know the block size of the filesystem to get at least some
      sort of performance.  */
   if (__fstatfs64 (fd, &f) != 0)
     return errno;
 
-  /* Align OFFSET to block size and adjust LEN.  */
-  step = (offset + f.f_bsize - 1) % ~f.f_bsize;
-  offset += step;
+  /* Try to play safe.  */
+  if (f.f_bsize == 0)
+    f.f_bsize = 512;
 
   /* Write something to every block.  */
-  while (len > step)
+  for (offset += (len - 1) % f.f_bsize; len > 0; offset += f.f_bsize)
     {
-      len -= step;
-
-      if (__pwrite64 (fd, "", 1, offset) != 1)
+      len -= f.f_bsize;
+
+      if (offset < st.st_size)
+       {
+         unsigned char c;
+         ssize_t rsize = __libc_pread64 (fd, &c, 1, offset);
+
+         if (rsize < 0)
+           return errno;
+         /* If there is a non-zero byte, the block must have been
+            allocated already.  */
+         else if (rsize == 1 && c != 0)
+           continue;
+       }
+
+      if (__libc_pwrite64 (fd, "", 1, offset) != 1)
        return errno;
-
-      offset += step;
     }
 
   return 0;
index 361a19e0dcb1c28c45ca546cd34774ef14287549..4fff563197cb4ac8489262d2b2beb56105f2c3fc 100644 (file)
@@ -22,6 +22,8 @@
 #define __need_NULL
 #include <stddef.h>
 #include <signal.h>
+#include <string.h>    /* For the real memset prototype.  */
+
 
 int
 sigignore (sig)
index 9a8efee043a3398d97c972c9add6c43db8244f2c..076d120e3568d8073861a122e35f497f078fd436 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <errno.h>
 #include <signal.h>
+#include <string.h>    /* For the real memset prototype.  */
 
 
 sigset_t _sigintr attribute_hidden;            /* Set by siginterrupt.  */
index 873c1cb1e61e5a6e87a7ee57830458708ecbc890..e995c73898b62eadb6e945bfe56cbea98d566f35 100644 (file)
@@ -20,6 +20,7 @@
 #define __need_NULL
 #include <stddef.h>
 #include <signal.h>
+#include <string.h>    /* For the real memset prototype.  */
 
 
 /* Set the disposition for SIG.  */
index ca2e84f3727925b16849efdc71aac737de14d94f..990805120684ead8d7d7ded0f53348c1474a6b49 100644 (file)
@@ -18,6 +18,8 @@
 
 #include <errno.h>
 #include <signal.h>
+#include <string.h>    /* For the real memset prototype.  */
+
 
 /* Tolerate non-threads versions of Posix */
 #ifndef SA_ONESHOT
index ff7966723b5e02bf02c3041b308f5c65adbaeabe..f0df54c3404f00fa7c2d9cc751a36a3c3cace586 100644 (file)
@@ -59,14 +59,10 @@ ENTRY(__bcopy)
        jo      .L6
        br      %r14
 .L7:                               # destructive overlay, can not use mvcle
-       lgr    %r1,%r2              # bcopy is called with source,dest
-       lgr    %r2,%r3              # memmove with dest,source! Oh, well...
-       lgr    %r3,%r1
-#ifdef PIC
-       jg     memmove@PLT
-#else
-       jg     memmove
-#endif
+       lgr     %r1,%r2             # bcopy is called with source,dest
+       lgr     %r2,%r3             # memmove with dest,source! Oh, well...
+       lgr     %r3,%r1
+       jg      HIDDEN_BUILTIN_JUMPTARGET(memmove)
 
 END(__bcopy)
 
index 6ef9679045a3019e152087763b5fe6d9337ef80d..0a5b83b69cea75b18ada91a85a20d77bcfb3a839 100644 (file)
@@ -24,6 +24,7 @@
 #include <stdbool.h>
 #include <stackinfo.h>
 #include <caller.h>
+#include <sysdep.h>
 
 #include "kernel-features.h"
 
@@ -38,6 +39,7 @@ _dl_make_stack_executable (void **stack_endp)
   /* This gives us the highest/lowest page that needs to be changed.  */
   uintptr_t page = ((uintptr_t) *stack_endp
                    & -(intptr_t) GLRO(dl_pagesize));
+  int result = 0;
 
   /* Challenge the caller.  */
   if (__builtin_expect (__check_caller (RETURN_ADDRESS (0),
@@ -60,7 +62,10 @@ _dl_make_stack_executable (void **stack_endp)
        no_growsupdown = true;
       else
 # endif
-       return errno;
+       {
+         result = errno;
+         goto out;
+       }
     }
 #endif
 
@@ -85,7 +90,10 @@ _dl_make_stack_executable (void **stack_endp)
       else
        {
          if (errno != ENOMEM)  /* Unexpected failure mode.  */
-           return errno;
+           {
+             result = errno;
+             goto out;
+           }
 
          if (size == GLRO(dl_pagesize))
            /* We just tried to mprotect the top hole page and failed.
@@ -108,7 +116,10 @@ _dl_make_stack_executable (void **stack_endp)
       else
        {
          if (errno != ENOMEM)  /* Unexpected failure mode.  */
-           return errno;
+           {
+             result = errno;
+             goto out;
+           }
 
          if (size == GLRO(dl_pagesize))
            /* We just tried to mprotect the lowest hole page and failed.
@@ -133,6 +144,11 @@ _dl_make_stack_executable (void **stack_endp)
   /* Remember that we changed the permission.  */
   GL(dl_stack_flags) |= PF_X;
 
-  return 0;
+ out:
+#ifdef check_consistency
+  check_consistency ();
+#endif
+
+  return result;
 }
 rtld_hidden_def (_dl_make_stack_executable)
index ee191612721495ff1023c670368b9a3ce758fc99..883508a562cbadcfe9bd53966a002af8a58e8422 100644 (file)
@@ -21,7 +21,7 @@
 #include <unistd.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-
+#include <not-cancel.h>
 
 static int itc_usable;
 
@@ -31,18 +31,18 @@ has_cpuclock (void)
   if (__builtin_expect (itc_usable == 0, 0))
     {
       int newval = 1;
-      int fd = open ("/proc/sal/itc_drift", O_RDONLY);
+      int fd = open_not_cancel_2 ("/proc/sal/itc_drift", O_RDONLY);
       if (__builtin_expect (fd != -1, 1))
        {
          char buf[16];
          /* We expect the file to contain a single digit followed by
             a newline.  If the format changes we better not rely on
             the file content.  */
-         if (read (fd, buf, sizeof buf) != 2 || buf[0] != '0'
-             || buf[1] != '\n')
+         if (read_not_cancel (fd, buf, sizeof buf) != 2
+             || buf[0] != '0' || buf[1] != '\n')
            newval = -1;
 
-         close (fd);
+         close_not_cancel_no_status (fd);
        }
 
       itc_usable = newval;
index 377ccf51993c2a488fdf31170d4c5763b9777aa5..f434bbe7d1843ed4443d7294843caf6a2131145c 100644 (file)
@@ -188,12 +188,8 @@ if_nameindex_netlink (void)
 
 
   /* Tell the kernel that we wish to get a list of all
-     active interfaces.  */
-  if (__netlink_sendreq (&nh, RTM_GETLINK) < 0)
-    goto exit_close;
-
-  /* Collect all data for every interface.  */
-  if (__netlink_receive (&nh) < 0)
+     active interfaces.  Collect all data for every interface.  */
+  if (__netlink_request (&nh, RTM_GETLINK) < 0)
     goto exit_free;
 
   /* Count the interfaces.  */
@@ -290,7 +286,6 @@ if_nameindex_netlink (void)
 
  exit_free:
   __netlink_free_handle (&nh);
- exit_close:
   __netlink_close (&nh);
 
   return idx;
index 8a052e212db41e0513c08d87a9ce5d866e756a82..6f43475ca92eb09fcf005c9c0412d11848ba6482 100644 (file)
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <alloca.h>
 #include <assert.h>
 #include <errno.h>
 #include <ifaddrs.h>
@@ -24,6 +25,7 @@
 #include <netinet/in.h>
 #include <netpacket/packet.h>
 #include <stdbool.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/ioctl.h>
@@ -84,7 +86,7 @@ __netlink_free_handle (struct netlink_handle *h)
 }
 
 
-int
+static int
 __netlink_sendreq (struct netlink_handle *h, int type)
 {
   struct
@@ -114,15 +116,39 @@ __netlink_sendreq (struct netlink_handle *h, int type)
 
 
 int
-__netlink_receive (struct netlink_handle *h)
+__netlink_request (struct netlink_handle *h, int type)
 {
   struct netlink_res *nlm_next;
-  char buf[4096];
-  struct iovec iov = { buf, sizeof (buf) };
+  struct netlink_res **new_nlm_list;
+  static volatile size_t buf_size = 4096;
+  char *buf;
   struct sockaddr_nl nladdr;
   struct nlmsghdr *nlmh;
-  int read_len;
+  ssize_t read_len;
   bool done = false;
+  bool use_malloc = false;
+
+  if (__netlink_sendreq (h, type) < 0)
+    return -1;
+
+  size_t this_buf_size = buf_size;
+  if (__libc_use_alloca (this_buf_size))
+    buf = alloca (this_buf_size);
+  else
+    {
+      buf = malloc (this_buf_size);
+      if (buf != NULL)
+       use_malloc = true;
+      else
+       goto out_fail;
+    }
+
+  struct iovec iov = { buf, this_buf_size };
+
+  if (h->nlm_list != NULL)
+    new_nlm_list = &h->end_ptr->next;
+  else
+    new_nlm_list = &h->nlm_list;
 
   while (! done)
     {
@@ -136,33 +162,66 @@ __netlink_receive (struct netlink_handle *h)
 
       read_len = TEMP_FAILURE_RETRY (__recvmsg (h->fd, &msg, 0));
       if (read_len < 0)
-       return -1;
+       goto out_fail;
 
-      if (msg.msg_flags & MSG_TRUNC)
-       return -1;
+      if (nladdr.nl_pid != 0)
+       continue;
 
-      nlm_next = (struct netlink_res *) malloc (sizeof (struct netlink_res)
-                                               + read_len);
-      if (nlm_next == NULL)
-       return -1;
-      nlm_next->next = NULL;
-      nlm_next->nlh = memcpy (nlm_next + 1, buf, read_len);
-      nlm_next->size = read_len;
-      nlm_next->seq = h->seq;
-      if (h->nlm_list == NULL)
-       h->nlm_list = nlm_next;
-      else
-       h->end_ptr->next = nlm_next;
-      h->end_ptr = nlm_next;
+      if (__builtin_expect (msg.msg_flags & MSG_TRUNC, 0))
+       {
+         if (this_buf_size >= SIZE_MAX / 2)
+           goto out_fail;
+
+         nlm_next = *new_nlm_list;
+         while (nlm_next != NULL)
+           {
+             struct netlink_res *tmpptr;
+
+             tmpptr = nlm_next->next;
+             free (nlm_next);
+             nlm_next = tmpptr;
+           }
+         *new_nlm_list = NULL;
+
+         if (__libc_use_alloca (2 * this_buf_size))
+           buf = extend_alloca (buf, this_buf_size, 2 * this_buf_size);
+         else
+           {
+             this_buf_size *= 2;
+
+             char *new_buf = realloc (use_malloc ? buf : NULL, this_buf_size);
+             if (new_buf == NULL)
+               goto out_fail;
+             new_buf = buf;
 
+             use_malloc = true;
+           }
+         buf_size = this_buf_size;
+
+         iov.iov_base = buf;
+         iov.iov_len = this_buf_size;
+
+         /* Increase sequence number, so that we can distinguish
+            between old and new request messages.  */
+         h->seq++;
+
+         if (__netlink_sendreq (h, type) < 0)
+           goto out_fail;
+
+         continue;
+       }
+
+      size_t count = 0;
+      size_t remaining_len = read_len;
       for (nlmh = (struct nlmsghdr *) buf;
-          NLMSG_OK (nlmh, (size_t) read_len);
-          nlmh = (struct nlmsghdr *) NLMSG_NEXT (nlmh, read_len))
+          NLMSG_OK (nlmh, remaining_len);
+          nlmh = (struct nlmsghdr *) NLMSG_NEXT (nlmh, remaining_len))
        {
-         if (nladdr.nl_pid != 0 || (pid_t) nlmh->nlmsg_pid != h->pid
+         if ((pid_t) nlmh->nlmsg_pid != h->pid
              || nlmh->nlmsg_seq != h->seq)
            continue;
 
+         ++count;
          if (nlmh->nlmsg_type == NLMSG_DONE)
            {
              /* We found the end, leave the loop.  */
@@ -176,11 +235,38 @@ __netlink_receive (struct netlink_handle *h)
                errno = EIO;
              else
                errno = -nlerr->error;
-             return -1;
+             goto out_fail;
            }
        }
+
+      /* If there was nothing with the expected nlmsg_pid and nlmsg_seq,
+        there is no point to record it.  */
+      if (count == 0)
+       continue;
+
+      nlm_next = (struct netlink_res *) malloc (sizeof (struct netlink_res)
+                                               + read_len);
+      if (nlm_next == NULL)
+       goto out_fail;
+      nlm_next->next = NULL;
+      nlm_next->nlh = memcpy (nlm_next + 1, buf, read_len);
+      nlm_next->size = read_len;
+      nlm_next->seq = h->seq;
+      if (h->nlm_list == NULL)
+       h->nlm_list = nlm_next;
+      else
+       h->end_ptr->next = nlm_next;
+      h->end_ptr = nlm_next;
     }
+
+  if (use_malloc)
+    free (buf);
   return 0;
+
+out_fail:
+  if (use_malloc)
+    free (buf);
+  return -1;
 }
 
 
@@ -268,7 +354,7 @@ getifaddrs (struct ifaddrs **ifap)
   unsigned int i, newlink, newaddr, newaddr_idx;
   int *map_newlink_data;
   size_t ifa_data_size = 0;  /* Size to allocate for all ifa_data.  */
-  char *ifa_data_ptr;        /* Pointer to the unused part of memory for
+  char *ifa_data_ptr;  /* Pointer to the unused part of memory for
                                ifa_data.  */
   int result = 0;
 
@@ -288,28 +374,20 @@ getifaddrs (struct ifaddrs **ifap)
 #endif
 
   /* Tell the kernel that we wish to get a list of all
-     active interfaces.  */
-  if (__netlink_sendreq (&nh, RTM_GETLINK) < 0)
-    {
-      result = -1;
-      goto exit_close;
-    }
-  /* Collect all data for every interface.  */
-  if (__netlink_receive (&nh) < 0)
+     active interfaces, collect all data for every interface.  */
+  if (__netlink_request (&nh, RTM_GETLINK) < 0)
     {
       result = -1;
       goto exit_free;
     }
 
-
   /* Now ask the kernel for all addresses which are assigned
-     to an interface.  Since we store the addresses after the
-     interfaces in the list, we will later always find the
-     interface before the corresponding addresses.  */
+     to an interface and collect all data for every interface.
+     Since we store the addresses after the interfaces in the
+     list, we will later always find the interface before the
+     corresponding addresses.  */
   ++nh.seq;
-  if (__netlink_sendreq (&nh, RTM_GETADDR) < 0
-      /* Collect all data for every interface.  */
-      || __netlink_receive (&nh) < 0)
+  if (__netlink_request (&nh, RTM_GETADDR) < 0)
     {
       result = -1;
       goto exit_free;
@@ -327,7 +405,7 @@ getifaddrs (struct ifaddrs **ifap)
        continue;
 
       /* Walk through all entries we got from the kernel and look, which
-         message type they contain.  */
+        message type they contain.  */
       for (nlh = nlp->nlh; NLMSG_OK (nlh, size); nlh = NLMSG_NEXT (nlh, size))
        {
          /* Check if the message is what we want.  */
@@ -423,7 +501,7 @@ getifaddrs (struct ifaddrs **ifap)
              /* Interfaces are stored in the first "newlink" entries
                 of our list, starting in the order as we got from the
                 kernel.  */
-              ifa_index = map_newlink (ifim->ifi_index - 1, ifas,
+             ifa_index = map_newlink (ifim->ifi_index - 1, ifas,
                                       map_newlink_data, newlink);
              ifas[ifa_index].ifa.ifa_flags = ifim->ifi_flags;
 
@@ -767,8 +845,6 @@ getifaddrs (struct ifaddrs **ifap)
 
  exit_free:
   __netlink_free_handle (&nh);
-
- exit_close:
   __netlink_close (&nh);
 
   return result;
index 6672e714ff4f4b3e9dcfe1cd096ffe7ac293e9cc..f0b8e364bca94f9fb4fc22cb86a0bb52123eb741 100644 (file)
@@ -55,8 +55,7 @@ extern int __no_netlink_support attribute_hidden;
 extern int __netlink_open (struct netlink_handle *h);
 extern void __netlink_close (struct netlink_handle *h);
 extern void __netlink_free_handle (struct netlink_handle *h);
-extern int __netlink_sendreq (struct netlink_handle *h, int type);
-extern int __netlink_receive (struct netlink_handle *h);
+extern int __netlink_request (struct netlink_handle *h, int type);
 
 
 #endif /* netlinkaccess.h */
index e79d74cb7574bafa9063634558f22d25beacb858..069f94bd9d1203ab68354448e9e7fc74f83aeefa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2001,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2002, 2005 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
@@ -28,7 +28,7 @@
 #ifdef __NR_ftruncate64
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
 /* The variable is shared between all wrappers around *truncate64 calls.  */
-extern int have_no_truncate64;
+extern int __have_no_truncate64;
 #endif
 
 
@@ -39,7 +39,7 @@ __ftruncate64 (fd, length)
      off64_t length;
 {
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
-  if (! have_no_truncate64)
+  if (! __have_no_truncate64)
 #endif
     {
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
@@ -57,7 +57,7 @@ __ftruncate64 (fd, length)
 
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
       __set_errno (saved_errno);
-      have_no_truncate64 = 1;
+      __have_no_truncate64 = 1;
 #endif
     }
 
index ce8ebc2a97d79c2cd9db0a5fb5c0075f71bdd987..01698a419f06d8835392aa3c2219d82b6460dd96 100644 (file)
@@ -29,7 +29,7 @@
 #ifdef __NR_truncate64
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
 /* The variable is shared between all wrappers around *truncate64 calls.  */
-int have_no_truncate64;
+int __have_no_truncate64;
 #endif
 
 
@@ -40,7 +40,7 @@ truncate64 (path, length)
      off64_t length;
 {
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
-  if (! have_no_truncate64)
+  if (! __have_no_truncate64)
 #endif
     {
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
@@ -58,7 +58,7 @@ truncate64 (path, length)
 
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
       __set_errno (saved_errno);
-      have_no_truncate64 = 1;
+      __have_no_truncate64 = 1;
 #endif
     }
 
index d94e4f62fd4d605d3a5f944716903c58060f3ef1..4f2b8acc554d64fbb6729bc2d3db0245f7f8082a 100644 (file)
@@ -21,6 +21,7 @@
 #include <errno.h>
 #include <time.h>
 #include <signal.h>
+#include <string.h>    /* For the real memset prototype.  */
 #include <unistd.h>
 #include <sys/param.h>
 
index a8baf40a9109b627344a07d0d51b9be109ba8e36..be2810e0c740d95c81444fc67da270fd9b535bf1 100644 (file)
 #include <features.h>
 #include <sys/types.h>
 
+/*
+ * Select between different incompatible quota versions.
+ * Default to the version used by Linux kernel version 2.4.22
+ * or later.  */
+#ifndef _LINUX_QUOTA_VERSION
+# define _LINUX_QUOTA_VERSION 2
+#endif
+
 /*
  * Convert diskblocks to blocks and the other way around.
  * currently only to fool the BSD source. :-)
 #define SUBCMDSHIFT 8
 #define QCMD(cmd, type)  (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
 
-#define Q_QUOTAON  0x0100      /* enable quotas */
-#define Q_QUOTAOFF 0x0200      /* disable quotas */
-#define Q_GETQUOTA 0x0300      /* get limits and usage */
-#define Q_SETQUOTA 0x0400      /* set limits and usage */
-#define Q_SETUSE   0x0500      /* set usage */
-#define Q_SYNC     0x0600      /* sync disk copy of a filesystems quotas */
-#define Q_SETQLIM  0x0700      /* set limits */
-#define Q_GETSTATS 0x0800      /* get collected stats */
-#define Q_RSQUASH  0x1000      /* set root_squash option */
+#if _LINUX_QUOTA_VERSION < 2
+# define Q_QUOTAON  0x0100     /* enable quotas */
+# define Q_QUOTAOFF 0x0200     /* disable quotas */
+# define Q_GETQUOTA 0x0300     /* get limits and usage */
+# define Q_SETQUOTA 0x0400     /* set limits and usage */
+# define Q_SETUSE   0x0500     /* set usage */
+# define Q_SYNC     0x0600     /* sync disk copy of a filesystems quotas */
+# define Q_SETQLIM  0x0700     /* set limits */
+# define Q_GETSTATS 0x0800     /* get collected stats */
+# define Q_RSQUASH  0x1000     /* set root_squash option */
+#else
+# define Q_SYNC     0x800001   /* sync disk copy of a filesystems quotas */
+# define Q_QUOTAON  0x800002   /* turn quotas on */
+# define Q_QUOTAOFF 0x800003   /* turn quotas off */
+# define Q_GETFMT   0x800004   /* get quota format used on given filesystem */
+# define Q_GETINFO  0x800005   /* get information about quota files */
+# define Q_SETINFO  0x800006   /* set information about quota files */
+# define Q_GETQUOTA 0x800007   /* get user quota structure */
+# define Q_SETQUOTA 0x800008   /* set user quota structure */
+#endif
 
 /*
  * The following structure defines the format of the disk quota file
  * (as it appears on disk) - the file is an array of these structures
  * indexed by user or group number.
  */
+#if _LINUX_QUOTA_VERSION < 2
 struct dqblk
   {
     u_int32_t dqb_bhardlimit;  /* absolute limit on disk blks alloc */
@@ -120,13 +140,45 @@ struct dqblk
     time_t dqb_btime;          /* time limit for excessive disk use */
     time_t dqb_itime;          /* time limit for excessive files */
   };
+#else
+
+/* Flags that indicate which fields in dqblk structure are valid.  */
+#define QIF_BLIMITS    1
+#define QIF_SPACE      2
+#define QIF_ILIMITS    4
+#define QIF_INODES     8
+#define QIF_BTIME      16
+#define QIF_ITIME      32
+#define QIF_LIMITS     (QIF_BLIMITS | QIF_ILIMITS)
+#define QIF_USAGE      (QIF_SPACE | QIF_INODES)
+#define QIF_TIMES      (QIF_BTIME | QIF_ITIME)
+#define QIF_ALL                (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
+
+struct dqblk
+  {
+    u_int64_t dqb_bhardlimit;  /* absolute limit on disk quota blocks alloc */
+    u_int64_t dqb_bsoftlimit;  /* preferred limit on disk quota blocks */
+    u_int64_t dqb_curspace;    /* current quota block count */
+    u_int64_t dqb_ihardlimit;  /* maximum # allocated inodes */
+    u_int64_t dqb_isoftlimit;  /* preferred inode limit */
+    u_int64_t dqb_curinodes;   /* current # allocated inodes */
+    u_int64_t dqb_btime;       /* time limit for excessive disk use */
+    u_int64_t dqb_itime;       /* time limit for excessive files */
+    u_int32_t dqb_valid;       /* bitmask of QIF_* constants */
+  };
+#endif
 
 /*
  * Shorthand notation.
  */
 #define        dq_bhardlimit   dq_dqb.dqb_bhardlimit
 #define        dq_bsoftlimit   dq_dqb.dqb_bsoftlimit
-#define        dq_curblocks    dq_dqb.dqb_curblocks
+#if _LINUX_QUOTA_VERSION < 2
+# define dq_curblocks  dq_dqb.dqb_curblocks
+#else
+# define dq_curspace   dq_dqb.dqb_curspace
+# define dq_valid      dq_dqb.dqb_valid
+#endif
 #define        dq_ihardlimit   dq_dqb.dqb_ihardlimit
 #define        dq_isoftlimit   dq_dqb.dqb_isoftlimit
 #define        dq_curinodes    dq_dqb.dqb_curinodes
@@ -135,6 +187,7 @@ struct dqblk
 
 #define dqoff(UID)      ((loff_t)((UID) * sizeof (struct dqblk)))
 
+#if _LINUX_QUOTA_VERSION < 2
 struct dqstats
   {
     u_int32_t lookups;
@@ -147,6 +200,22 @@ struct dqstats
     u_int32_t free_dquots;
     u_int32_t syncs;
   };
+#else
+
+/* Flags that indicate which fields in dqinfo structure are valid.  */
+# define IIF_BGRACE    1
+# define IIF_IGRACE    2
+# define IIF_FLAGS     4
+# define IIF_ALL       (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
+
+struct dqinfo
+  {
+    u_int64_t dqi_bgrace;
+    u_int64_t dqi_igrace;
+    u_int32_t dqi_flags;
+    u_int32_t dqi_valid;
+  };
+#endif
 
 __BEGIN_DECLS
 
index 7e601acf2c113006529ecf95714658a9a119cb14..1cdeb12638b135aa485b695b9c55eefa40b864a0 100644 (file)
@@ -18,6 +18,7 @@
    02111-1307 USA.  */
 
 #include <errno.h>
+#include <string.h>    /* For the real memset prototype.  */
 #include <sys/sysctl.h>
 
 #include <sysdep.h>
index 3fdff04c22d51bc66f81ce8f1d98a6203ba31e2f..688487cb9f11d91f02f9c455fba8b5e3b38f3139 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <sched.h>
 #include <signal.h>
+#include <string.h>    /* For the real memset prototype.  */
 #include <sysdep.h>
 #include <unistd.h>
 #include <sys/wait.h>
index 7acc964fdc24d0000e0ac7fe16b9c47d31216501..799a8b70fa0fbc1b49a2483c518fbb2b0f7be721 100644 (file)
@@ -35,7 +35,7 @@ distribute := datemsk
 
 tests  := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
           tst-getdate tst-mktime tst-mktime2 tst-ftime_l tst-strftime \
-          tst-mktime3
+          tst-mktime3 tst-strptime2
 
 include ../Rules
 
index c6ae56ee6024de3c7c72820029606ebe1624466a..f011412327c11f116e405966fb8f0182b4970415 100644 (file)
 
 #include <limits.h>
 
+#include <string.h>            /* For the real memcpy prototype.  */
+
 #if DEBUG
 # include <stdio.h>
 # include <stdlib.h>
-# include <string.h>
 /* Make it work even if the system's libc has its own mktime routine.  */
 # define mktime my_mktime
 #endif /* DEBUG */
index cf0ab7153d99c025c9f12c5299926fa309bafb33..ccb838a229f1d050e3008d15b3ad309ffe188dce 100644 (file)
@@ -687,6 +687,42 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
        case 'Z':
          /* XXX How to handle this?  */
          break;
+       case 'z':
+         /* We recognize two formats: if two digits are given, these
+            specify hours.  If fours digits are used, minutes are
+            also specified.  */
+         {
+           val = 0;
+           while (*rp == ' ')
+             ++rp;
+           if (*rp != '+' && *rp != '-')
+             return NULL;
+           bool neg = *rp++ == '-';
+           int n = 0;
+           while (n < 4 && *rp >= '0' && *rp <= '9')
+             {
+               val = val * 10 + *rp++ - '0';
+               ++n;
+             }
+           if (n == 2)
+             val *= 100;
+           else if (n != 4)
+             /* Only two or four digits recognized.  */
+             return NULL;
+           else
+             {
+               /* We have to convert the minutes into decimal.  */
+               if (val % 100 >= 60)
+                 return NULL;
+               val = (val / 100) * 100 + ((val % 100) * 50) / 30;
+             }
+           if (val > 1200)
+             return NULL;
+           tm->tm_gmtoff = (val * 3600) / 100;
+           if (neg)
+             tm->tm_gmtoff = -tm->tm_gmtoff;
+         }
+         break;
        case 'E':
 #ifdef _NL_CURRENT
          switch (*fmt++)
diff --git a/time/tst-strptime2.c b/time/tst-strptime2.c
new file mode 100644 (file)
index 0000000..73552bb
--- /dev/null
@@ -0,0 +1,59 @@
+#include <limits.h>
+#include <stdio.h>
+#include <time.h>
+
+
+static const struct
+{
+  const char *fmt;
+  long int gmtoff;
+} tests[] =
+  {
+    { "1113472456 +1000", 36000 },
+    { "1113472456 -1000", -36000 },
+    { "1113472456 +10", 36000 },
+    { "1113472456 -10", -36000 },
+    { "1113472456 +1030", 37800 },
+    { "1113472456 -1030", -37800 },
+    { "1113472456 +0030", 1800 },
+    { "1113472456 -0030", -1800 },
+    { "1113472456 -1330", LONG_MAX },
+    { "1113472456 +1330", LONG_MAX },
+    { "1113472456 -1060", LONG_MAX },
+    { "1113472456 +1060", LONG_MAX },
+    { "1113472456  1030", LONG_MAX },
+  };
+#define ntests (sizeof (tests) / sizeof (tests[0]))
+
+
+int
+main (void)
+{
+  int result = 0;
+
+  for (int i = 0; i < ntests; ++i)
+    {
+      struct tm tm;
+
+      if (strptime (tests[i].fmt, "%s %z", &tm) == NULL)
+       {
+         if (tests[i].gmtoff != LONG_MAX)
+           {
+             printf ("round %d: strptime unexpectedly failed\n", i);
+             result = 1;
+           }
+         continue;
+       }
+
+      if (tm.tm_gmtoff != tests[i].gmtoff)
+       {
+         printf ("round %d: tm_gmtoff is %ld\n", i, (long int) tm.tm_gmtoff);
+         result = 1;
+       }
+    }
+
+  if (result == 0)
+    puts ("all OK");
+
+  return 0;
+}