diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-06-07 00:02:14 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-06-07 00:02:14 +0000 |
commit | 9a8fcca0b33c26759134a545ac45251df53418a3 (patch) | |
tree | 981351d75ac1c612d7f356b0438ec5f1a3227c12 /sysdeps/unix | |
parent | e0082312bcfdce398099d58add30cc02b79f129b (diff) | |
download | glibc-9a8fcca0b33c26759134a545ac45251df53418a3.tar glibc-9a8fcca0b33c26759134a545ac45251df53418a3.tar.gz glibc-9a8fcca0b33c26759134a545ac45251df53418a3.tar.bz2 glibc-9a8fcca0b33c26759134a545ac45251df53418a3.zip |
Update.
* sysdeps/unix/sysv/linux/kernel-features.h: Define
__ASSUME_SIOCGIFNAME for kernel >= 2.1.50.
* sysdeps/unix/sysv/linux/if_index.c: Correct typo (SIOGIFNAME ->
SIOCGIFNAME) and use __ASSUME_SIOCGIFNAME.
* sysdeps/libm-ieee754/w_j0.c: Remove __ from symbol definitions.
* sysdeps/libm-ieee754/w_j0f.c: Likewise.
* sysdeps/libm-ieee754/w_j0l.c: Likewise.
* sysdeps/libm-ieee754/w_j1.c: Likewise.
* sysdeps/libm-ieee754/w_j1f.c: Likewise.
* sysdeps/libm-ieee754/w_j1l.c: Likewise.
* sysdeps/libm-ieee754/w_jn.c: Likewise.
* sysdeps/libm-ieee754/w_jnf.c: Likewise.
* sysdeps/libm-ieee754/w_jnl.c: Likewise.
* stdio-common.c: Correct typos.
* math/libm-test.c (jn_test): Adjust delta.
(y1_test): Likewise.
(yn_test): Likewise.
* elf/do-lookup.h: It should never happen that if we expect a versioned
symbol from a file the file has no version table. This should have
been checked in dl-version.c.
* elf/dl-lookup.c: Include assert.h.
Diffstat (limited to 'sysdeps/unix')
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/sigaction.c | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/if_index.c | 48 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/kernel-features.h | 5 |
3 files changed, 40 insertions, 15 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/sigaction.c b/sysdeps/unix/sysv/linux/i386/sigaction.c index fddb22a4e0..c126cdaee8 100644 --- a/sysdeps/unix/sysv/linux/i386/sigaction.c +++ b/sysdeps/unix/sysv/linux/i386/sigaction.c @@ -75,7 +75,7 @@ __sigaction (int sig, const struct sigaction *act, struct sigaction *oact) { 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_SIGINFO) ? &restore_rt : &restore); diff --git a/sysdeps/unix/sysv/linux/if_index.c b/sysdeps/unix/sysv/linux/if_index.c index 9b3db6abfb..67fba93cd4 100644 --- a/sysdeps/unix/sysv/linux/if_index.c +++ b/sysdeps/unix/sysv/linux/if_index.c @@ -26,6 +26,8 @@ #include <sys/ioctl.h> #include <bits/libc-lock.h> +#include "kernel-features.h" + /* Try to get a socket to talk to the kernel. */ #if defined SIOGIFINDEX || defined SIOGIFNAME static int @@ -120,8 +122,12 @@ if_nameindex (void) unsigned int nifs, i; int rq_len; struct if_nameindex *idx = NULL; +# if __ASSUME_SIOCGIFNAME == 0 static int old_siocgifconf; -#define RQ_IFS 4 +# else +# define old_siocgifconf 0 +# endif +# define RQ_IFS 4 if (fd < 0) return NULL; @@ -136,7 +142,9 @@ if_nameindex (void) ifc.ifc_len = 0; if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0 || ifc.ifc_len == 0) { +# if __ASSUME_SIOCGIFNAME == 0 old_siocgifconf = 1; +# endif rq_len = RQ_IFS * sizeof (struct ifreq); } else @@ -199,24 +207,31 @@ if_nameindex (void) char * if_indextoname (unsigned int ifindex, char *ifname) { -#ifndef SIOGIFINDEX +#if !defined SIOGIFINDEX && __ASSUME_SIOCGIFNAME == 0 __set_errno (ENOSYS); return NULL; #else +# if __ASSUME_SIOCGIFNAME == 0 struct if_nameindex *idx; struct if_nameindex *p; char *result = NULL; +# endif -#ifdef SIOGIFNAME +# if defined SIOCGIFNAME || __ASSUME_SIOCGIFNAME > 0 /* 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; +# if __ASSUME_SIOCGIFNAME == 0 + static int siocgifname_works_not; - if (!siogifname_works_not) + if (!siocgifname_works_not) +# endif { +# if __ASSUME_SIOCGIFNAME == 0 int serrno = errno; +# endif + int status; fd = opensock (); @@ -224,23 +239,27 @@ if_indextoname (unsigned int ifindex, char *ifname) return NULL; ifr.ifr_ifindex = ifindex; - if (__ioctl (fd, SIOGIFNAME, &ifr) < 0) + status = __ioctl (fd, SIOCGIFNAME, &ifr); + + __close (fd); + +# if __ASSUME_SIOCGIFNAME == 0 + if (status < 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 - { - __close (fd); - return strncpy (ifname, ifr.ifr_name, IFNAMSIZ); - } - - __close (fd); + return strncpy (ifname, ifr.ifr_name, IFNAMSIZ); __set_errno (serrno); +# else + return status < 0 ? NULL : strncpy (ifname, ifr.ifr_name, IFNAMSIZ); +# endif } -#endif +# endif +# if __ASSUME_SIOCGIFNAME == 0 idx = if_nameindex (); if (idx != NULL) @@ -255,5 +274,6 @@ if_indextoname (unsigned int ifindex, char *ifname) if_freenameindex (idx); } return result; +# endif #endif } diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 1bd7ba4ba8..db2bfe24d5 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -69,3 +69,8 @@ #if __LINUX_KERNEL_VERSION >= 131584 # define __ASSUME_SETRESUID_SYSCALL 1 #endif + +/* The SIOCGIFNAME ioctl is available starting with 2.1.50. */ +#if __LINUX_KERNEL_VERSION >= 131408 +# define __ASSUME_SIOCGIFNAME 1 +#endif |