+2004-09-26 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/alpha/alphaev6/memcpy.S: Mark .prologue.
+ * sysdeps/unix/alpha/sysdep.h (LEAF, ENTRY): Align entry points
+ to 16 byte boundaries.
+
+2004-09-26 Ulrich Drepper <drepper@redhat.com>
+
+ * elf/readlib.c (process_file): Before complaining about too-short
+ file, check that it potentially be an ELF file. Also complain about
+ empty files. [BZ #151].
+
+ * scripts/test-installation.pl: Fix ld.so recognition for new
+ LD_TRACE_LOADED_OBJECTS output format.
+ Patch by <jsberg04+computing.glibc@ftml.net> [BZ #407].
+
+ * elf/dl-support.c (_dl_non_dynamic_init): Fix cleaning of
+ environment. [BZ #384]
+
+ * sunrpc/clnt_udp.c (is_network_up): Use getifaddrs instead of ioctl.
+ * sunrpc/get_myaddr.c (get_myaddress): Likewise.
+ * sunrpc/pmap_clnt.c (__get_myaddress): Likewise.
+ * sunrpc/pmap_rmt.c (getbroadcastnets): Likewise. Change interface
+ to avoid buffer overrun and remove now useless parameters.
+ (clnt_broadcast): Adjust caller. [BZ #381].
+
+ * sysdeps/generic/s_fdim.c: Handle +inf/+inf
+ * sysdeps/generic/s_fdimf.c: Likewise.
+ * sysdeps/generic/s_fdiml.c: Likewise.
+ * sysdeps/i386/i686/fpu/s_fdim.S: Likewise.
+ * sysdeps/i386/i686/fpu/s_fdimf.S: Likewise.
+ * sysdeps/i386/i686/fpu/s_fdiml.S: Likewise.
+ * sysdeps/powerpc/fpu/s_fdim.c: Likewise.
+ * sysdeps/powerpc/fpu/s_fdimf.c: Likewise.
+ * sysdeps/x86_64/fpu/s_fdiml.S: Likewise.
+ * math/libm-test.inc (fdim_test): Add test case. [BZ #376].
+
+ * sysdeps/generic/bits/types.h: Fix __SQUAD_TYPE and __UQUAD_TYPE
+ for compilers without __GLIBC_HAVE_LONG_LONG. [BZ #362]
+
+ * sysdeps/posix/getaddrinfo.c (getaddrinfo): Remove incorrect
+ requirement on socktype and protocol.
+ (gaih_inet): If numeric port number is given, return records for all
+ possible socket types.
+ * posix/tst-getaddrinfo2.c: New file.
+ * posix/Makefile (tests): Add tst-getaddrinfo2. [BZ #358]
+
2004-09-25 Ulrich Drepper <drepper@redhat.com>
* locale/loadlocale.c (_nl_intern_locale_data): Recognize LC_CTYPE
are done. First set to -1 to signal initialization is ongoing.
Protect against concurrent callers with recursive lock.
* intl/finddomain.c (_nl_find_domain): Protect calls to
- _nl_make_l10nflist.
+ _nl_make_l10nflist. [BZ #322]
+
* sysdeps/posix/getaddrinfo.c (getaddrinfo): If determinination of
source address fails, initialized source_addr_len field so that
- duplicate address recognition does not copy junk. [BZ #322]
+ duplicate address recognition does not copy junk.
2004-09-25 Jakub Jelinek <jakub@redhat.com>
if (__libc_enable_secure)
{
- static const char *unsecure_envvars[] =
- {
- UNSECURE_ENVVARS,
+ static const char unsecure_envvars[] =
+ UNSECURE_ENVVARS
#ifdef EXTRA_UNSECURE_ENVVARS
EXTRA_UNSECURE_ENVVARS
#endif
- };
- size_t cnt;
+ ;
+ const char *cp = unsecure_envvars;
- for (cnt = 0;
- cnt < sizeof (unsecure_envvars) / sizeof (unsecure_envvars[0]);
- ++cnt)
- unsetenv (unsecure_envvars[cnt]);
+ while (cp < unsecure_envvars + sizeof (unsecure_envvars))
+ {
+ __unsetenv (cp);
+ cp = (const char *) __rawmemchr (cp, '\0') + 1;
+ }
if (__access ("/etc/suid-debug", F_OK) != 0)
- unsetenv ("MALLOC_CHECK_");
+ __unsetenv ("MALLOC_CHECK_");
}
#ifdef DL_PLATFORM_INIT
if ((size_t) statbuf.st_size < sizeof (struct exec)
|| (size_t) statbuf.st_size < sizeof (ElfW(Ehdr)))
{
- error (0, 0, _("File %s is too small, not checked."), file_name);
+ if (statbuf.st_size == 0)
+ error (0, 0, _("File %s is empty, not checked."), file_name);
+ else
+ {
+ char buf[SELFMAG];
+ size_t n = MIN (statbuf.st_size, SELFMAG);
+ if (fread (buf, n, 1, file) == 1 && memcmp (buf, ELFMAG, n) == 0)
+ error (0, 0, _("File %s is too small, not checked."), file_name);
+ }
fclose (file);
return 1;
}
# This file is updated automatically by Makefile.
glibc-branch := fedora
glibc-base := HEAD
-fedora-sync-date := 2004-09-26 08:23 UTC
-fedora-sync-tag := fedora-glibc-20040926T0823
+fedora-sync-date := 2004-09-27 06:11 UTC
+fedora-sync-tag := fedora-glibc-20040927T0611
-%define glibcrelease 58
+%define glibcrelease 59
%define auxarches i586 i686 athlon sparcv9 alphaev6
%define prelinkarches noarch
%define nptlarches i386 i686 athlon x86_64 ia64 s390 s390x sparcv9 ppc ppc64
%endif
%changelog
+* Mon Sep 27 2004 Jakub Jelinek <jakub@redhat.com> 2.3.3-59
+- update from CVS
+ - fix BZ #151, #362, #381, #407
+ - fdim fix for +inf/+inf (BZ #376)
+
* Sun Sep 26 2004 Jakub Jelinek <jakub@redhat.com> 2.3.3-58
- update from CVS
- vasprintf fix (BZ #346)
TEST_ff_f (fdim, nan_value, minus_infty, nan_value);
TEST_ff_f (fdim, nan_value, nan_value, nan_value);
+ TEST_ff_f (fdim, plus_infty, plus_infty, 0);
+
END (fdim);
}
bug-regex17 bug-regex18 bug-regex19 bug-regex20 \
bug-regex21 bug-regex22 bug-regex23 tst-nice tst-nanosleep \
transbug tst-rxspencer tst-pcre tst-boost \
- bug-ga1 tst-vfork1 tst-vfork2 tst-waitid
+ bug-ga1 tst-vfork1 tst-vfork2 tst-waitid \
+ tst-getaddrinfo2
xtests := bug-ga2
ifeq (yes,$(build-shared))
test-srcs := globtest
--- /dev/null
+/* Test by David L Stevens <dlstevens@us.ibm.com> [BZ #358] */
+#include <errno.h>
+#include <netdb.h>
+#include <unistd.h>
+#include <sys/socket.h>
+
+static int
+do_test (void)
+{
+ const char portstr[] = "583";
+ int port = atoi (portstr);
+ struct addrinfo hints, *aires, *pai;
+ int rv;
+ int res = 1;
+
+ memset (&hints, 0, sizeof (hints));
+ hints.ai_family = AF_INET;
+ rv = getaddrinfo (NULL, portstr, &hints, &aires);
+ if (rv == 0)
+ {
+ struct sockaddr_in *psin = 0;
+ int got_tcp, got_udp;
+ int err = 0;
+
+ got_tcp = got_udp = 0;
+ for (pai = aires; pai; pai = pai->ai_next)
+ {
+ printf ("ai_family=%d, ai_addrlen=%d, ai_socktype=%d",
+ (int) pai->ai_family, (int) pai->ai_addrlen,
+ (int) pai->ai_socktype);
+ if (pai->ai_family == AF_INET)
+ printf (", port=%d",
+ ntohs (((struct sockaddr_in *) pai->ai_addr)->sin_port));
+ puts ("");
+
+ err |= pai->ai_family != AF_INET;
+ err |= pai->ai_addrlen != sizeof (struct sockaddr_in);
+ err |= pai->ai_addr == 0;
+ if (pai->ai_family == AF_INET)
+ err |=
+ ntohs (((struct sockaddr_in *) pai->ai_addr)->sin_port) != port;
+ got_tcp |= pai->ai_socktype == SOCK_STREAM;
+ got_udp |= pai->ai_socktype == SOCK_DGRAM;
+ if (err)
+ break;
+ }
+ if (err)
+ {
+ printf ("FAIL getaddrinfo IPv4 socktype 0,513: "
+ "fam %d alen %d addr 0x%08X addr/fam %d "
+ "addr/port %d H[%d]\n",
+ pai->ai_family, pai->ai_addrlen, psin,
+ psin ? psin->sin_family : 0,
+ psin ? psin->sin_port : 0,
+ psin ? htons (psin->sin_port) : 0);
+ }
+ else if (got_tcp && got_udp)
+ {
+ printf ("SUCCESS getaddrinfo IPv4 socktype 0,513\n");
+ res = 0;
+ }
+ else
+ printf ("FAIL getaddrinfo IPv4 socktype 0,513 TCP %d"
+ " UDP %d\n", got_tcp, got_udp);
+ freeaddrinfo (aires);
+ }
+ else
+ printf ("FAIL getaddrinfo IPv4 socktype 0,513 returns %d "
+ "(\"%s\")\n", rv, gai_strerror (rv));
+
+ return res;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
#! /usr/bin/perl -w
-# Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999, 2004 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1997.
}
}
if (/$ld_so_name/) {
- ($version1, $version2) =
- /$ld_so_name\.so\.([0-9\.]*)\s*=>.*\.so\.([0-9\.]*)/;
- if ($version1 ne $version2 || $version1 ne $ld_so_version) {
+ ($version1) = /$ld_so_name\.so\.([0-9\.]*)/;
+ if ($version1 ne $ld_so_version) {
print "The dynamic linker $ld_so_name.so is not correctly installed.\n";
print "Please check your installation!\n";
print "Offending line of ldd output: $_\n";
#include <errno.h>
#include <rpc/pmap_clnt.h>
#include <net/if.h>
+#include <ifaddrs.h>
#ifdef USE_IN_LIBIO
# include <wchar.h>
#endif
static int
is_network_up (int sock)
{
- struct ifconf ifc;
- char buf[UDPMSGSIZE];
- struct ifreq ifreq, *ifr;
- int n;
-
- ifc.ifc_len = sizeof (buf);
- ifc.ifc_buf = buf;
- if (__ioctl(sock, SIOCGIFCONF, (char *) &ifc) == 0)
+ struct ifaddrs *ifa;
+
+ if (getifaddrs (&ifa) != 0)
+ return 0;
+
+ struct ifaddrs *run = ifa;
+ while (run != NULL)
{
- ifr = ifc.ifc_req;
- for (n = ifc.ifc_len / sizeof (struct ifreq); n > 0; n--, ifr++)
- {
- ifreq = *ifr;
- if (__ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0)
- break;
+ if ((run->ifa_flags & IFF_UP) != 0
+ && run->ifa_addr->sa_family == AF_INET)
+ break;
- if ((ifreq.ifr_flags & IFF_UP)
- && ifr->ifr_addr.sa_family == AF_INET)
- return 1;
- }
+ run = run->ifa_next;
}
- return 0;
+
+ freeifaddrs (ifa);
+
+ return run != NULL;
}
static enum clnt_stat
#include <unistd.h>
#include <libintl.h>
#include <net/if.h>
+#include <ifaddrs.h>
#include <sys/ioctl.h>
/* Order of following two #includes reversed by roland@gnu */
#include <netinet/in.h>
void
get_myaddress (struct sockaddr_in *addr)
{
- int s;
- char buf[BUFSIZ];
- struct ifconf ifc;
- struct ifreq ifreq, *ifr;
- int len, loopback = 0;
+ struct ifaddrs *ifa;
- if ((s = __socket (AF_INET, SOCK_DGRAM, 0)) < 0)
+ if (getifaddrs (&ifa) == 0)
{
- perror ("get_myaddress: socket");
- exit (1);
- }
- ifc.ifc_len = sizeof (buf);
- ifc.ifc_buf = buf;
- if (__ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0)
- {
- perror (_("get_myaddress: ioctl (get interface configuration)"));
+ perror ("get_myaddress: getifaddrs");
exit (1);
}
+ int loopback = 0;
+ struct ifaddrs *run;
+
again:
- ifr = ifc.ifc_req;
- for (len = ifc.ifc_len; len; len -= sizeof ifreq)
+ run = ifa;
+ while (run != NULL)
{
- ifreq = *ifr;
- if (__ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0)
+ if ((run->ifa_flags & IFF_UP) && run->ifa_addr->sa_family == AF_INET
+ && (!(run->ifa_flags & IFF_LOOPBACK)
+ || (loopback == 1 && (run->ifa_flags & IFF_LOOPBACK))))
{
- perror ("get_myaddress: ioctl");
- exit (1);
- }
- if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET)
- && (!(ifreq.ifr_flags & IFF_LOOPBACK) ||
- (loopback == 1 && (ifreq.ifr_flags & IFF_LOOPBACK))))
- {
- *addr = *((struct sockaddr_in *) &ifr->ifr_addr);
+ *addr = *((struct sockaddr_in *) run->ifa_addr);
addr->sin_port = htons (PMAPPORT);
- __close (s);
- return;
+ goto out;
}
- ifr++;
+
+ run = run->ifa_next;
}
+
if (loopback == 0)
{
loopback = 1;
goto again;
}
- __close (s);
+ out:
+ freeifaddrs (ifa);
+
+ /* The function is horribly specified. It does not return any error
+ if no interface is up. Probably this won't happen (at least
+ loopback is there) but still... */
}
#include <unistd.h>
#include <libintl.h>
#include <net/if.h>
+#include <ifaddrs.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <netinet/in.h>
static bool_t
__get_myaddress (struct sockaddr_in *addr)
{
- int s;
- char buf[BUFSIZ];
- struct ifconf ifc;
- struct ifreq ifreq, *ifr;
- int len, loopback = 1;
+ struct ifaddrs *ifa;
- if ((s = __socket (AF_INET, SOCK_DGRAM, 0)) < 0)
+ if (getifaddrs (&ifa) == 0)
{
- perror ("__get_myaddress: socket");
- exit (1);
- }
- ifc.ifc_len = sizeof (buf);
- ifc.ifc_buf = buf;
- if (__ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0)
- {
- perror (_("__get_myaddress: ioctl (get interface configuration)"));
+ perror ("get_myaddress: getifaddrs");
exit (1);
}
+ int loopback = 1;
+ struct ifaddrs *run;
+
again:
- ifr = ifc.ifc_req;
- for (len = ifc.ifc_len; len; len -= sizeof ifreq)
+ run = ifa;
+ while (run != NULL)
{
- ifreq = *ifr;
- if (__ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0)
- {
- perror ("__get_myaddress: ioctl");
- exit (1);
- }
- if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET)
- && ((ifreq.ifr_flags & IFF_LOOPBACK) || (loopback == 0)))
- {
- *addr = *((struct sockaddr_in *) &ifr->ifr_addr);
- addr->sin_port = htons (PMAPPORT);
- __close (s);
- return TRUE;
- }
- ifr++;
+ if ((run->ifa_flags & IFF_UP) && run->ifa_addr->sa_family == AF_INET
+ && ((run->ifa_flags & IFF_LOOPBACK) || loopback == 0))
+ {
+ *addr = *((struct sockaddr_in *) run->ifa_addr);
+ addr->sin_port = htons (PMAPPORT);
+ goto out;
+ }
+
+ run = run->ifa_next;
}
+
if (loopback == 1)
{
loopback = 0;
goto again;
}
- __close (s);
- return FALSE;
+ out:
+ freeifaddrs (ifa);
+
+ return run == NULL ? FALSE : TRUE;
}
#undef _POSIX_SOURCE /* Ultrix <sys/param.h> needs --roland@gnu */
#include <sys/param.h> /* Ultrix needs before net/if --roland@gnu */
#include <net/if.h>
+#include <ifaddrs.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
#define MAX_BROADCAST_SIZE 1400
static int
internal_function
-getbroadcastnets (struct in_addr *addrs, int sock, char *buf)
- /* int sock: any valid socket will do */
- /* char *buf: why allocate more when we can use existing... */
+getbroadcastnets (struct in_addr *addrs, int naddrs)
{
- struct ifconf ifc;
- struct ifreq ifreq, *ifr;
- struct sockaddr_in *sin;
- int n, i;
+ struct ifaddrs *ifa;
- ifc.ifc_len = UDPMSGSIZE;
- ifc.ifc_buf = buf;
- if (__ioctl (sock, SIOCGIFCONF, (char *) &ifc) < 0)
+ if (getifaddrs (&ifa) == 0)
{
- perror (_("broadcast: ioctl (get interface configuration)"));
- return (0);
+ perror ("broadcast: getifaddrs");
+ return 0;
}
- ifr = ifc.ifc_req;
- for (i = 0, n = ifc.ifc_len / sizeof (struct ifreq); n > 0; n--, ifr++)
+
+ int i = 0;
+ struct ifaddrs *run = ifa;
+ while (run != NULL && i < naddrs)
{
- ifreq = *ifr;
- if (__ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0)
- {
- perror (_("broadcast: ioctl (get interface flags)"));
- continue;
- }
- if ((ifreq.ifr_flags & IFF_BROADCAST) &&
- (ifreq.ifr_flags & IFF_UP) &&
- ifr->ifr_addr.sa_family == AF_INET)
- {
- sin = (struct sockaddr_in *) &ifr->ifr_addr;
-#ifdef SIOCGIFBRDADDR /* 4.3BSD */
- if (__ioctl (sock, SIOCGIFBRDADDR, (char *) &ifreq) < 0)
- {
- addrs[i++] = inet_makeaddr (inet_netof
- /* Changed to pass struct instead of s_addr member
- by roland@gnu. */
- (sin->sin_addr), INADDR_ANY);
- }
- else
- {
- addrs[i++] = ((struct sockaddr_in *)
- &ifreq.ifr_addr)->sin_addr;
- }
-#else /* 4.2 BSD */
- addrs[i++] = inet_makeaddr (inet_netof
- (sin->sin_addr.s_addr), INADDR_ANY);
-#endif
- }
+ if ((run->ifa_flags & IFF_BROADCAST) != 0
+ && (run->ifa_flags & IFF_UP) != 0
+ && run->ifa_addr->sa_family == AF_INET)
+ /* Copy the broadcast address. */
+ addrs[i++] = ((struct sockaddr_in *) run->ifa_broadaddr)->sin_addr;
+
+ run = run->ifa_next;
}
+
+ freeifaddrs (ifa);
+
return i;
}
#endif /* def SO_BROADCAST */
fd.fd = sock;
fd.events = POLLIN;
- nets = getbroadcastnets (addrs, sock, inbuf);
+ nets = getbroadcastnets (addrs, sizeof (addrs) / sizeof (addrs[0]));
__bzero ((char *) &baddr, sizeof (baddr));
baddr.sin_family = AF_INET;
baddr.sin_port = htons (PMAPPORT);
.set noat
ENTRY(memcpy)
+ .prologue 0
mov $16, $0 # E : copy dest to return
ble $18, $nomoredata # U : done with the copy?
/* bits/types.h -- definitions of __*_t types underlying *_t types.
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004 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
#define __SLONGWORD_TYPE long int
#define __ULONGWORD_TYPE unsigned long int
#if __WORDSIZE == 32
-# define __SQUAD_TYPE long long int
-# define __UQUAD_TYPE unsigned long long int
+# define __SQUAD_TYPE __quad_t
+# define __UQUAD_TYPE __u_quad_t
# define __SWORD_TYPE int
# define __UWORD_TYPE unsigned int
# define __SLONG32_TYPE long int
/* Return positive difference between arguments.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
/* Raise invalid flag. */
return x - y;
- return x < y ? 0 : x - y;
+ return x <= y ? 0 : x - y;
}
weak_alias (__fdim, fdim)
#ifdef NO_LONG_DOUBLE
/* Return positive difference between arguments.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
/* Raise invalid flag. */
return x - y;
- return x < y ? 0 : x - y;
+ return x <= y ? 0 : x - y;
}
weak_alias (__fdimf, fdimf)
/* Return positive difference between arguments.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
/* Raise invalid flag. */
return x - y;
- return x < y ? 0 : x - y;
+ return x <= y ? 0 : x - y;
}
weak_alias (__fdiml, fdiml)
/* Compute positive difference.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
fucomi %st(1), %st
jp 1f
- fsubrp %st, %st(1)
+ jc 3f
+ fstp %st(1)
fldz
- fcomi %st(1), %st
- fcmovb %st(1), %st
jmp 2f
+3: fsubrp %st, %st(1)
+ ret
+
1: fucomi %st(0), %st
fcmovnu %st(1), %st
2: fstp %st(1)
/* Compute positive difference.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
fucomi %st(1), %st
jp 1f
- fsubrp %st, %st(1)
+ jc 3f
+ fstp %st(1)
fldz
- fcomi %st(1), %st
- fcmovb %st(1), %st
jmp 2f
+3: fsubrp %st, %st(1)
+ ret
+
1: fucomi %st(0), %st
fcmovnu %st(1), %st
2: fstp %st(1)
/* Compute positive difference.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
fucomi %st(1), %st
jp 1f
- fsubrp %st, %st(1)
+ jc 3f
+ fstp %st(1)
fldz
- fcomi %st(1), %st
- fcmovb %st(1), %st
jmp 2f
+3: fsubrp %st, %st(1)
+ ret
+
1: fucomi %st(0), %st
fcmovnu %st(1), %st
2: fstp %st(1)
}
else
{
- st = __alloca (sizeof (struct gaih_servtuple));
- st->next = NULL;
- st->socktype = tp->socktype;
- st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY)
- ? req->ai_protocol : tp->protocol);
- st->port = htons (service->num);
+ if (req->ai_socktype || req->ai_protocol)
+ {
+ st = __alloca (sizeof (struct gaih_servtuple));
+ st->next = NULL;
+ st->socktype = tp->socktype;
+ st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY)
+ ? req->ai_protocol : tp->protocol);
+ st->port = htons (service->num);
+ }
+ else
+ {
+ /* Neither socket type nor protocol is set. Return all
+ socket types we know about. */
+ struct gaih_servtuple **lastp = &st;
+ for (tp = gaih_inet_typeproto + 1; tp->name[0]; ++tp)
+ if ((tp->protoflag & GAI_PROTO_NOSERVICE) == 0)
+ {
+ struct gaih_servtuple *newp;
+
+ newp = __alloca (sizeof (struct gaih_servtuple));
+ newp->next = NULL;
+ newp->socktype = tp->socktype;
+ newp->protocol = tp->protocol;
+ newp->port = htons (service->num);
+
+ *lastp = newp;
+ lastp = &newp->next;
+ }
+ }
}
}
else if (req->ai_socktype || req->ai_protocol)
gaih_service.num = -1;
}
- else
- /* Can't specify a numerical socket unless a protocol family was
- given. */
- if (hints->ai_socktype == 0 && hints->ai_protocol == 0)
- return EAI_SERVICE;
+
pservice = &gaih_service;
}
else
/* Return positive difference between arguments.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2004 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
double
__fdim (double x, double y)
{
- return x < y ? 0 : x - y;
+ return x <= y ? 0 : x - y;
}
weak_alias (__fdim, fdim)
#ifdef NO_LONG_DOUBLE
/* Return positive difference between arguments.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2004 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
float
__fdimf (float x, float y)
{
- return x < y ? 0 : x - y;
+ return x <= y ? 0 : x - y;
}
weak_alias (__fdimf, fdimf)
#define LEAF(name, framesize) \
.globl name; \
- .align 3; \
+ .align 4; \
.ent name, 0; \
__LABEL(name) \
.frame sp, framesize, ra
#define ENTRY(name) \
.globl name; \
- .align 3; \
+ .align 4; \
.ent name, 0; \
__LABEL(name) \
.frame sp, 0, ra
/* Compute positive difference.
- Copyright (C) 1997, 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2002, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
fucomi %st(1), %st
jp 1f
- fsubrp %st, %st(1)
+ jc 3f
+ fstp %st(1)
fldz
- fcomi %st(1), %st
- fcmovb %st(1), %st
jmp 2f
+3: fsubrp %st, %st(1)
+ ret
+
1: fucomi %st(0), %st
fcmovnu %st(1), %st
2: fstp %st(1)