This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.
Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
>>>>> Ulrich Drepper writes: > I just want to share this with you > drepper@myware glibc-devel-19990607$ libio/tst_wprintf > Hello world! Congratulations! > I.e., I have wide character streams (at least output) working now. I > hope to check all the code in next week but want to merge all needed > changes since 2.1. into the release branch first. If somebody has the > time to produce this patch I'd appreciate this. I'll probably not > have the time since wide char stream input is waiting for me to debug > it. Let me know when you have time (shouldn't take long). I'm appending a patch. I ask the port maintainers to check that I didn't miss one of their important patches since I've only added everything that's looked important to me;-). Please note that I did not check the patches (i.e. if they compile). I ask others with faster machines to do so. Andreas 1999-06-12 Ulrich Drepper <drepper@cygnus.com> * locale/lc-time.c: Add free_mem function to free if necessary statically allocated memory. 1999-06-10 Jakub Jelinek <jj@ultra.linux.cz> * sysdeps/libm-ieee754/s_truncl.c: Subtract exponent bias from the raw exponent. 1999-06-11 Ulrich Drepper <drepper@cygnus.com> * inet/arpa/tftp.h: Move attribute declaration in right position. 1999-06-11 Ulrich Drepper <drepper@cygnus.com> * resolv/nss_dns/dns-host.c (getanswer_r): Correctly track usage of user-provided buffer. 1999-06-10 Ulrich Drepper <drepper@cygnus.com> * stdio-common/printf-parse.h (parse_one_spec): Add support for a and A format. * shadow/fgetspent_r.c (__fgetspent_r): Set errno to ENOENT for returning after last entry. * pwd/fgetpwent_r.c (__fgetpwent_r): Likewise. 1999-06-09 Ulrich Drepper <drepper@cygnus.com> * pwd/fgetpwent_r.c: Set errno in the correct way. * shadow/fgetspent_r.c: Likewise. * pwd/fgetpwent.c: Handle long lines correctly. Little optimizations. Free static buffer when debugging memory handling. * shadow/fgetspent.c: Likewise. * grp/fgetgrent.c: Little optimization in loop. 1999-06-09 Jakub Jelinek <jj@ultra.linux.cz> * stdlib/longlong.h: gas changed sethi handling when without %hi(). Fix assembly. 1999-06-08 Ulrich Drepper <drepper@cygnus.com> * misc/daemon.c: Call fork. * grp/fgetgrent.c (buffer): Make file local variable. (free_mem): New function. Call for malloc debugging. 1999-06-08 Ulrich Drepper <drepper@cygnus.com> * ctype/ctype.h: Protect __tobody code by __extension__. 1999-06-13 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sysdeps/unix/sysv/linux/if_index.c: Replace SIOG* with SIOCG*. 1999-06-07 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/sys/sysmacros.h (makedev): Handle signed parameters. 1999-06-06 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/i386/sigaction.c: Correct restorer function handling. * sysdeps/unix/sysv/linux/i386/sigaction.c (SA_RESTORER): New #define. 1999-06-06 Andi Kleen <ak@muc.de> * sysdeps/unix/sysv/linux/i386/sigaction.c (__sigaction): Set SA_RESTORER flag. 1999-06-05 Philip Blundell <philb@gnu.org> * sysdeps/arm/dl-machine.h (elf_machine_load_address): Fix problems with GOT addressing. 1999-06-02 Jakub Jelinek <jj@ultra.linux.cz> * stdlib/longlong.h: Define UDIV_TIME on sparc64. 1999-06-01 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sysdeps/unix/sysv/linux/net/if_arp.h (ARPHRD_DDCMP): Add it (from Linux 2.3.4). 1999-05-30 Andreas Jaeger <aj@arthur.rhein-neckar.de> * manual/stdio.texi: Fix some typos. 1999-05-29 Andreas Jaeger <aj@arthur.rhein-neckar.de> * manual/stdio.texi (Formatted Output Functions): Mention semantics of snprintf in glibc 2.0. Reported by Ben Pfaff <pfaffben@msu.edu>. 1999-05-27 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * malloc/malloc.h: Properly handle future GCC versions. 1999-05-25 Ulrich Drepper <drepper@cygnus.com> * sysdeps/posix/getcwd.c (__getcwd): Fix potential memory leaks. ============================================================ Index: locale/lc-time.c --- locale/lc-time.c 1997/06/21 01:23:14 1.4 +++ locale/lc-time.c 1999/06/13 14:22:13 @@ -1,5 +1,5 @@ /* Define current locale data for LC_TIME category. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1999 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 @@ -174,3 +174,16 @@ return result; } + + +/* Free all resources if necessary. */ +static void __attribute__ ((unused)) +free_mem (void) +{ + if (eras != NULL) + free (eras); + if (alt_digits != NULL) + free (alt_digits); +} + +text_set_element (__libc_subfreeres, free_mem); ============================================================ Index: sysdeps/libm-ieee754/s_truncl.c --- sysdeps/libm-ieee754/s_truncl.c 1997/03/22 15:58:30 1.1 +++ sysdeps/libm-ieee754/s_truncl.c 1999/06/13 14:22:13 @@ -1,5 +1,5 @@ /* Truncate argument to nearest integral value not larger than the argument. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -32,7 +32,7 @@ GET_LDOUBLE_WORDS (se, i0, i1, x); sx = se & 0x8000; - j0 = se & 0x7fff; + j0 = (se & 0x7fff) - 0x3fff; if (j0 < 31) { if (j0 < 0) ============================================================ Index: inet/arpa/tftp.h --- inet/arpa/tftp.h 1999/05/17 16:47:48 1.6 +++ inet/arpa/tftp.h 1999/06/13 14:22:14 @@ -56,7 +52,7 @@ unsigned short tu_block; /* block # */ short tu_code; /* error code */ char tu_stuff[1]; /* request packet stuff */ - } th_u __attribute__ ((__packed__)); + } __attribute__ ((__packed__)) th_u; char th_data[1]; /* data or error string */ } __attribute__ ((__packed__)); ============================================================ Index: resolv/nss_dns/dns-host.c --- resolv/nss_dns/dns-host.c 1999/02/06 23:57:37 1.14 +++ resolv/nss_dns/dns-host.c 1999/06/13 14:22:16 @@ -323,6 +323,15 @@ int (*name_ok) __P ((const char *)); u_char packtmp[NS_MAXCDNAME]; + if (linebuflen < 0) + { + /* The buffer is too small. */ + too_small: + *errnop = ERANGE; + *h_errnop = NETDB_INTERNAL; + return NSS_STATUS_TRYAGAIN; + } + tname = qname; result->h_name = NULL; end_of_message = answer->buf + anslen; @@ -358,11 +367,7 @@ if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1) { if (errno == EMSGSIZE) - { - *errnop = ERANGE; - *h_errnop = NETDB_INTERNAL; - return NSS_STATUS_TRYAGAIN; - } + goto too_small; n = -1; } @@ -393,6 +398,8 @@ result->h_name = bp; bp += n; linebuflen -= n; + if (linebuflen < 0) + goto too_small; /* The qname can be abbreviated, but h_name is now absolute. */ qname = result->h_name; } @@ -606,6 +613,7 @@ linebuflen -= nn; } + linebuflen -= sizeof (align) - ((u_long) bp % sizeof (align)); bp += sizeof (align) - ((u_long) bp % sizeof (align)); if (n >= linebuflen) ============================================================ Index: stdio-common/printf-parse.h --- stdio-common/printf-parse.h 1998/07/31 11:12:46 1.12 +++ stdio-common/printf-parse.h 1999/06/13 14:22:17 @@ -1,5 +1,5 @@ /* Internal header for parsing printf format strings. - Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of th GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -358,6 +358,8 @@ case L'f': case L'g': case L'G': + case L'a': + case L'A': if (spec->info.is_long_double) spec->data_arg_type = PA_DOUBLE|PA_FLAG_LONG_DOUBLE; else ============================================================ Index: shadow/fgetspent_r.c --- shadow/fgetspent_r.c 1998/08/08 19:45:56 1.10 +++ shadow/fgetspent_r.c 1999/06/13 14:22:17 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 1999 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 @@ -53,13 +53,15 @@ { funlockfile (stream); *result = NULL; + __set_errno (ENOENT); return errno; } if (p == NULL || buffer[buflen - 1] != '\xff') { funlockfile (stream); *result = NULL; - return errno = ERANGE; + __set_errno (ERANGE); + return errno; } /* Skip leading blanks. */ ============================================================ Index: shadow/fgetspent.c --- shadow/fgetspent.c 1997/06/21 01:28:10 1.5 +++ shadow/fgetspent.c 1999/06/13 14:22:17 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,6 +19,7 @@ #include <errno.h> #include <bits/libc-lock.h> #include <shadow.h> +#include <stdio.h> #include <stdlib.h> @@ -28,16 +29,21 @@ /* We need to protect the dynamic buffer handling. */ __libc_lock_define_initialized (static, lock); +static char *buffer; + /* Read one shadow entry from the given stream. */ struct spwd * fgetspent (FILE *stream) { - static char *buffer; static size_t buffer_size; static struct spwd resbuf; + fpos_t pos; struct spwd *result; int save; + if (fgetpos (stream, &pos) != 0) + return NULL; + /* Get lock. */ __libc_lock_lock (lock); @@ -49,8 +55,8 @@ } while (buffer != NULL - && __fgetspent_r (stream, &resbuf, buffer, buffer_size, &result) != 0 - && errno == ERANGE) + && (__fgetspent_r (stream, &resbuf, buffer, buffer_size, &result) + == ERANGE)) { char *new_buf; buffer_size += BUFLEN_SPWD; @@ -64,6 +70,10 @@ __set_errno (save); } buffer = new_buf; + + /* Reset the stream. */ + if (fsetpos (stream, &pos) != 0) + buffer = NULL; } if (buffer == NULL) @@ -76,3 +86,14 @@ return result; } + + +/* Free all resources if necessary. */ +static void __attribute__ ((unused)) +free_mem (void) +{ + if (buffer != NULL) + free (buffer); +} + +text_set_element (__libc_subfreeres, free_mem); ============================================================ Index: pwd/fgetpwent_r.c --- pwd/fgetpwent_r.c 1998/08/08 19:44:22 1.10 +++ pwd/fgetpwent_r.c 1999/06/13 14:22:17 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1996, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -86,13 +86,15 @@ { funlockfile (stream); *result = NULL; + __set_errno (ENOENT); return errno; } if (p == NULL || buffer[buflen - 1] != '\xff') { funlockfile (stream); *result = NULL; - return errno = ERANGE; + __set_errno (ERANGE); + return errno; } /* Skip leading blanks. */ ============================================================ Index: grp/fgetgrent.c --- grp/fgetgrent.c 1999/06/07 20:18:31 1.10.2.1 +++ grp/fgetgrent.c 1999/06/13 14:22:17 @@ -26,11 +26,12 @@ /* We need to protect the dynamic buffer handling. */ __libc_lock_define_initialized (static, lock); +static char *buffer; + /* Read one entry from the given stream. */ struct group * fgetgrent (FILE *stream) { - static char *buffer; static size_t buffer_size; static struct group resbuf; fpos_t pos; @@ -85,3 +86,14 @@ return result; } + + +/* Free all resources if necessary. */ +static void __attribute__ ((unused)) +free_mem (void) +{ + if (buffer != NULL) + free (buffer); +} + +text_set_element (__libc_subfreeres, free_mem); ============================================================ Index: stdlib/longlong.h --- stdlib/longlong.h 1999/05/25 16:50:26 1.11.2.1 +++ stdlib/longlong.h 1999/06/13 14:22:18 @@ -1220,7 +1220,7 @@ srlx %7,32,%5 mulx %3,%5,%3 mulx %2,%5,%5 - sethi 0x80000000,%2 + sethi %%hi(0x80000000),%2 addcc %4,%3,%4 srlx %4,32,%4 add %2,%2,%2 @@ -1237,6 +1237,7 @@ : "cc"); \ } while (0) #define UMUL_TIME 96 +#define UDIV_TIME 230 #endif /* __sparc_v9__ */ #if defined (__vax__) && W_TYPE_SIZE == 32 ============================================================ Index: misc/daemon.c --- misc/daemon.c 1998/07/16 10:57:08 1.2 +++ misc/daemon.c 1999/06/13 14:22:18 @@ -45,7 +45,7 @@ { int fd; - switch (__fork()) { + switch (fork()) { case -1: return (-1); case 0: ============================================================ Index: ctype/ctype.h --- ctype/ctype.h 1999/05/24 16:20:49 1.28 +++ ctype/ctype.h 1999/06/13 14:22:19 @@ -165,20 +165,21 @@ #if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus # define __tobody(c, f, a) \ - ({ int __res; \ - if (sizeof (c) > 1) \ - { \ - if (__builtin_constant_p (c)) \ - { \ - int __c = (c); \ - __res = __c < -128 || __c > 255 ? __c : a[__c]; \ - } \ - else \ - __res = f (c); \ - } \ - else \ - __res = a[(int) (c)]; \ - __res; }) + (__extension__ \ + ({ int __res; \ + if (sizeof (c) > 1) \ + { \ + if (__builtin_constant_p (c)) \ + { \ + int __c = (c); \ + __res = __c < -128 || __c > 255 ? __c : a[__c]; \ + } \ + else \ + __res = f (c); \ + } \ + else \ + __res = a[(int) (c)]; \ + __res; })) # define tolower(c) __tobody (c, tolower, __ctype_tolower) # define toupper(c) __tobody (c, toupper, __ctype_toupper) ============================================================ Index: sysdeps/unix/sysv/linux/if_index.c --- sysdeps/unix/sysv/linux/if_index.c 1999/04/28 23:04:24 1.14 +++ sysdeps/unix/sysv/linux/if_index.c 1999/06/13 14:22:19 @@ -27,7 +27,7 @@ #include <bits/libc-lock.h> /* Try to get a socket to talk to the kernel. */ -#if defined SIOGIFINDEX || defined SIOGIFNAME +#if defined SIOCGIFINDEX || defined SIOCGIFNAME static int internal_function opensock (void) @@ -71,7 +71,7 @@ unsigned int if_nametoindex (const char *ifname) { -#ifndef SIOGIFINDEX +#ifndef SIOCGIFINDEX __set_errno (ENOSYS); return 0; #else @@ -82,7 +82,7 @@ return 0; strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); - if (__ioctl (fd, SIOGIFINDEX, &ifr) < 0) + if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0) { int saved_errno = errno; __close (fd); @@ -111,7 +111,7 @@ struct if_nameindex * if_nameindex (void) { -#ifndef SIOGIFINDEX +#ifndef SIOCGIFINDEX __set_errno (ENOSYS); return NULL; #else @@ -172,7 +172,7 @@ struct ifreq *ifr = &ifc.ifc_req[i]; idx[i].if_name = __strdup (ifr->ifr_name); if (idx[i].if_name == NULL - || __ioctl (fd, SIOGIFINDEX, ifr) < 0) + || __ioctl (fd, SIOCGIFINDEX, ifr) < 0) { int saved_errno = errno; unsigned int j; @@ -199,7 +199,7 @@ char * if_indextoname (unsigned int ifindex, char *ifname) { -#ifndef SIOGIFINDEX +#ifndef SIOCGIFINDEX __set_errno (ENOSYS); return NULL; #else @@ -207,14 +207,14 @@ struct if_nameindex *p; char *result = NULL; -#ifdef SIOGIFNAME +#ifdef SIOCGIFNAME /* We may be able to do the conversion directly, rather than searching a list. This ioctl is not present in kernels before version 2.1.50. */ struct ifreq ifr; int fd; - static int siogifname_works_not; + static int siocgifname_works_not; - if (!siogifname_works_not) + if (!siocgifname_works_not) { int serrno = errno; @@ -224,10 +224,10 @@ return NULL; ifr.ifr_ifindex = ifindex; - if (__ioctl (fd, SIOGIFNAME, &ifr) < 0) + if (__ioctl (fd, SIOCGIFNAME, &ifr) < 0) { if (errno == EINVAL) - siogifname_works_not = 1; /* Don't make the same mistake twice. */ + siocgifname_works_not = 1; /* Don't make the same mistake twice. */ } else { ============================================================ Index: sysdeps/unix/sysv/linux/sys/sysmacros.h --- sysdeps/unix/sysv/linux/sys/sysmacros.h 1999/01/21 14:28:43 1.7 +++ sysdeps/unix/sysv/linux/sys/sysmacros.h 1999/06/13 14:22:19 @@ -27,11 +27,13 @@ #if defined __GNUC__ && __GNUC__ >= 2 # define major(dev) ((int)(((dev) >> 8) & 0xff)) # define minor(dev) ((int)((dev) & 0xff)) -# define makedev(major, minor) (((major) << 8) | (minor)) +# define makedev(major, minor) ((((unsigned int) (major)) << 8) \ + | ((unsigned int) (minor))) #else # define major(dev) (((dev).__val[0] >> 8) & 0xff) # define minor(dev) ((dev).__val[0] & 0xff) -# define makedev(major, minor) { (((major) << 8) | (minor)), 0 } +# define makedev(major, minor) { ((((unsigned int) (major)) << 8) \ + | ((unsigned int) (minor))), 0 } #endif #endif /* sys/sysmacros.h */ ============================================================ Index: sysdeps/unix/sysv/linux/i386/sigaction.c --- sysdeps/unix/sysv/linux/i386/sigaction.c 1998/10/31 10:28:07 1.15 +++ sysdeps/unix/sysv/linux/i386/sigaction.c 1999/06/13 14:22:19 @@ -1,5 +1,5 @@ /* POSIX.1 `sigaction' call for Linux/i386. - Copyright (C) 1991, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1991, 95, 96, 97, 98, 99 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 @@ -30,6 +30,8 @@ translate it here. */ #include <kernel_sigaction.h> +/* We do not globally define the SA_RESTORER flag so do it here. */ +#define SA_RESTORER 0x04000000 extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *, struct kernel_sigaction *, size_t); @@ -38,6 +40,8 @@ functions which have RT equivalents. */ int __libc_missing_rt_sigs; +static void restore_rt (void) asm ("__restore_rt"); +static void restore (void) asm ("__restore"); /* If ACT is not NULL, change the action for SIG to *ACT. If OACT is not NULL, put the old action for SIG in *OACT. */ @@ -58,10 +62,10 @@ { kact.k_sa_handler = act->sa_handler; memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t)); - kact.sa_flags = act->sa_flags; + kact.sa_flags = act->sa_flags | SA_RESTORER; - kact.sa_restorer = ((act->sa_flags & SA_NOMASK) - ? &&restore_nomask : &&restore); + kact.sa_restorer = ((act->sa_flags & SA_SIGINFO) + ? &restore_rt : &restore); } /* XXX The size argument hopefully will have to be changed to the @@ -90,10 +94,9 @@ { k_newact.k_sa_handler = act->sa_handler; k_newact.sa_mask = act->sa_mask.__val[0]; - k_newact.sa_flags = act->sa_flags; + k_newact.sa_flags = act->sa_flags | SA_RESTORER; - k_newact.sa_restorer = ((act->sa_flags & SA_NOMASK) - ? &&restore_nomask : &&restore); + k_newact.sa_restorer = &restore; } asm volatile ("pushl %%ebx\n" @@ -119,41 +122,33 @@ } return 0; - - restore: - asm ( -#ifdef PIC - " pushl %%ebx\n" - " call 0f\n" - "0: popl %%ebx\n" - " addl $_GLOBAL_OFFSET_TABLE_+[.-0b], %%ebx\n" - " addl $8, %%esp\n" - " call __sigsetmask@PLT\n" - " addl $8, %%esp\n" - " popl %%ebx\n" -#else - " addl $4, %%esp\n" - " call __sigsetmask\n" - " addl $4, %%esp\n" -#endif - " popl %%eax\n" - " popl %%ecx\n" - " popl %%edx\n" - " popf\n" - " ret" - : : ); - - restore_nomask: - asm (" addl $4, %%esp\n" - " popl %%eax\n" - " popl %%ecx\n" - " popl %%edx\n" - " popf\n" - " ret" - : : ); - - /* NOTREACHED */ - return -1; } weak_alias (__sigaction, sigaction) + +#define RESTORE(name, syscall) RESTORE2 (name, syscall) +#define RESTORE2(name, syscall) \ +asm \ + ( \ + ".align 16\n" \ + "__" #name ":\n" \ + " movl $" #syscall ", %eax\n" \ + " int $0x80" \ + ); + +/* The return code for realtime-signals. */ +RESTORE (restore_rt, __NR_rt_sigreturn) + +/* For the boring old signals. */ +# undef RESTORE2 +# define RESTORE2(name, syscall) \ +asm \ + ( \ + ".align 8\n" \ + "__" #name ":\n" \ + " popl %eax\n" \ + " movl $" #syscall ", %eax\n" \ + " int $0x80" \ + ); + +RESTORE (restore, __NR_sigreturn) ============================================================ Index: sysdeps/arm/dl-machine.h --- sysdeps/arm/dl-machine.h 1999/03/02 08:06:57 1.12 +++ sysdeps/arm/dl-machine.h 1999/06/13 14:22:20 @@ -52,22 +52,14 @@ /* Return the run-time load address of the shared object. */ -// patb static inline Elf32_Addr __attribute__ ((unused)) elf_machine_load_address (void) { - Elf32_Addr addr; - asm (" ldr ip,.L1 - ldr r3,.L3 - add r3, r3, sl - ldr ip,[sl, ip] - sub ip, r3, ip - b .L2 - .L1: .word _dl_start(GOT) - .L3: .word _dl_start(GOTOFF) - .L2: mov %0, ip" - : "=r" (addr) : : "ip", "r3"); - return addr; + extern void __dl_start asm ("_dl_start"); + Elf32_Addr got_addr = (Elf32_Addr) &__dl_start; + Elf32_Addr pcrel_addr; + asm ("adr %0, _dl_start" : "=r" (pcrel_addr)); + return pcrel_addr - got_addr; } ============================================================ Index: manual/stdio.texi --- manual/stdio.texi 1999/03/10 16:04:31 1.97 +++ manual/stdio.texi 1999/06/13 14:22:27 @@ -1616,6 +1616,12 @@ @end smallexample In practice, it is often easier just to use @code{asprintf}, below. + +@strong{Attention:} In the GNU C library version 2.0 the return value +is the number of characters stored, not including the terminating null. +If this value equals @code{@var{size} - 1}, then there was not enough +space in @var{s} for all the output. This change was necessary with +the adoption of snprintf by ISO C9x. @end deftypefun @node Dynamic Output @@ -2205,7 +2211,7 @@ Now let's look at how to define the handler and arginfo functions which are passed as arguments to @code{register_printf_function}. -@strong{Compatibility Note:} The interface change in the GNU libc +@strong{Compatibility Note:} The interface changed in the GNU libc version 2.0. Previously the third argument was of type @code{va_list *}. @@ -4347,7 +4353,7 @@ produced no output since the class with the numeric value @code{6} is not defined. Although a class with numeric value @code{5} is also not defined by default, the call the @code{addseverity} introduces it and -the second call to @code{fmtmsg} produces the above outout. +the second call to @code{fmtmsg} produces the above output. When we change the environment of the program to contain @code{SEV_LEVEL=XXX,6,NOTE} when running it we get a different result: ============================================================ Index: sysdeps/unix/sysv/linux/net/if_arp.h --- sysdeps/unix/sysv/linux/net/if_arp.h 1999/03/29 00:54:14 1.9 +++ sysdeps/unix/sysv/linux/net/if_arp.h 1999/06/13 14:22:27 @@ -92,6 +92,7 @@ #define ARPHRD_PPP 512 #define ARPHRD_HDLC 513 /* (Cisco) HDLC. */ #define ARPHRD_LAPB 516 /* LAPB. */ +#define ARPHRD_DDCMP 517 /* Digital's DDCMP. */ #define ARPHRD_TUNNEL 768 /* IPIP tunnel. */ #define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel. */ ============================================================ Index: malloc/malloc.h --- malloc/malloc.h 1999/05/23 13:01:33 1.11 +++ malloc/malloc.h 1999/06/13 14:22:28 @@ -60,7 +60,7 @@ /* GCC can always grok prototypes. For C++ programs we add throw() to help it optimize the function calls. But this works only with gcc 2.8.x and egcs. */ -# if defined __cplusplus && __GNUC_MINOR__ >= 8 +# if defined __cplusplus && (__GNUC__ >= 3 || __GNUC_MINOR__ >= 8) # define __THROW throw () # else # define __THROW ============================================================ Index: sysdeps/posix/getcwd.c --- sysdeps/posix/getcwd.c 1998/10/18 15:34:15 1.34 +++ sysdeps/posix/getcwd.c 1999/06/13 14:22:28 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,92,93,94,95,96,97,98 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,93,94,95,96,97,98,99 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 @@ -211,8 +211,9 @@ = "../../../../../../../../../../../../../../../../../../../../../../../\ ../../../../../../../../../../../../../../../../../../../../../../../../../../\ ../../../../../../../../../../../../../../../../../../../../../../../../../.."; - const char *dotp, *dotlist; - size_t dotsize; + const char *dotp = &dots[sizeof (dots)]; + const char *dotlist = dots; + size_t dotsize = sizeof (dots) - 1; dev_t rootdev, thisdev; ino_t rootino, thisino; char *path; @@ -244,18 +245,15 @@ *--pathp = '\0'; if (__lstat (".", &st) < 0) - return NULL; + goto lose2; thisdev = st.st_dev; thisino = st.st_ino; if (__lstat ("/", &st) < 0) - return NULL; + goto lose2; rootdev = st.st_dev; rootino = st.st_ino; - dotsize = sizeof (dots) - 1; - dotp = &dots[sizeof (dots)]; - dotlist = dots; while (!(thisdev == rootdev && thisino == rootino)) { register DIR *dirstream; @@ -273,7 +271,7 @@ { new = malloc (dotsize * 2 + 1); if (new == NULL) - return NULL; + goto lose; #ifdef HAVE_MEMPCPY dotp = mempcpy (new, dots, dotsize); #else @@ -375,7 +373,6 @@ if (tmp == NULL) { (void) __closedir (dirstream); - free (path); __set_errno (ENOMEM);/* closedir might have changed it.*/ goto lose; } @@ -412,6 +409,9 @@ lose: if (dotlist != dots) free ((__ptr_t) dotlist); + lose2: + if (buf == NULL) + free (path); return NULL; } -- Andreas Jaeger aj@arthur.rhein-neckar.de jaeger@informatik.uni-kl.de for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |