summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/alpha/Dist1
-rw-r--r--sysdeps/arm/sysdep.h6
-rw-r--r--sysdeps/generic/_G_config.h1
-rw-r--r--sysdeps/generic/e_acoshl.c2
-rw-r--r--sysdeps/generic/e_acosl.c2
-rw-r--r--sysdeps/generic/e_asinl.c2
-rw-r--r--sysdeps/generic/e_atan2l.c2
-rw-r--r--sysdeps/generic/e_expl.c2
-rw-r--r--sysdeps/generic/e_fmodl.c2
-rw-r--r--sysdeps/generic/e_j0l.c4
-rw-r--r--sysdeps/generic/e_j1l.c4
-rw-r--r--sysdeps/generic/e_jnl.c4
-rw-r--r--sysdeps/generic/e_lgammal_r.c3
-rw-r--r--sysdeps/generic/e_log10l.c2
-rw-r--r--sysdeps/generic/e_logl.c2
-rw-r--r--sysdeps/generic/e_powl.c2
-rw-r--r--sysdeps/generic/e_sqrtl.c2
-rw-r--r--sysdeps/generic/s_exp2l.c5
-rw-r--r--sysdeps/libm-i387/i686/s_fdim.S41
-rw-r--r--sysdeps/libm-i387/i686/s_fdimf.S41
-rw-r--r--sysdeps/libm-i387/i686/s_fdiml.S41
-rw-r--r--sysdeps/libm-i387/i686/s_fmax.S40
-rw-r--r--sysdeps/libm-i387/i686/s_fmaxf.S40
-rw-r--r--sysdeps/libm-i387/i686/s_fmaxl.S40
-rw-r--r--sysdeps/libm-i387/i686/s_fmin.S38
-rw-r--r--sysdeps/libm-i387/i686/s_fminf.S38
-rw-r--r--sysdeps/libm-i387/i686/s_fminl.S38
-rw-r--r--sysdeps/libm-i387/s_fdim.S51
-rw-r--r--sysdeps/libm-i387/s_fdimf.S51
-rw-r--r--sysdeps/libm-i387/s_fdiml.S51
-rw-r--r--sysdeps/libm-i387/s_fmax.S44
-rw-r--r--sysdeps/libm-i387/s_fmaxf.S44
-rw-r--r--sysdeps/libm-i387/s_fmaxl.S44
-rw-r--r--sysdeps/libm-i387/s_fmin.S44
-rw-r--r--sysdeps/libm-i387/s_fminf.S44
-rw-r--r--sysdeps/libm-i387/s_fminl.S44
-rw-r--r--sysdeps/libm-ieee754/s_ilogb.c4
-rw-r--r--sysdeps/libm-ieee754/s_ilogbf.c8
-rw-r--r--sysdeps/libm-ieee754/s_ilogbl.c4
-rw-r--r--sysdeps/libm-ieee754/s_llrintf.c12
-rw-r--r--sysdeps/libm-ieee754/s_lrint.c10
-rw-r--r--sysdeps/libm-ieee754/s_lrintf.c12
-rw-r--r--sysdeps/libm-ieee754/s_nanf.c2
-rw-r--r--sysdeps/libm-ieee754/s_nanl.c2
-rw-r--r--sysdeps/posix/ctermid.c7
-rw-r--r--sysdeps/unix/sysv/linux/Dist4
-rw-r--r--sysdeps/unix/sysv/linux/Makefile2
-rw-r--r--sysdeps/unix/sysv/linux/_G_config.h1
-rw-r--r--sysdeps/unix/sysv/linux/accept.S1
-rw-r--r--sysdeps/unix/sysv/linux/connect.S1
-rw-r--r--sysdeps/unix/sysv/linux/getcwd.c50
-rw-r--r--sysdeps/unix/sysv/linux/net/if.h17
-rw-r--r--sysdeps/unix/sysv/linux/recv.S1
-rw-r--r--sysdeps/unix/sysv/linux/recvfrom.S1
-rw-r--r--sysdeps/unix/sysv/linux/recvmsg.S1
-rw-r--r--sysdeps/unix/sysv/linux/send.S1
-rw-r--r--sysdeps/unix/sysv/linux/sendmsg.S1
-rw-r--r--sysdeps/unix/sysv/linux/sendto.S1
-rw-r--r--sysdeps/unix/sysv/linux/sys/quota.h2
59 files changed, 886 insertions, 81 deletions
diff --git a/sysdeps/alpha/Dist b/sysdeps/alpha/Dist
index 581022f6c0..0807ce1e69 100644
--- a/sysdeps/alpha/Dist
+++ b/sysdeps/alpha/Dist
@@ -1,4 +1,3 @@
-setjmp_aux.c
divrem.h
divl.S divq.S reml.S remq.S
_mcount.S
diff --git a/sysdeps/arm/sysdep.h b/sysdeps/arm/sysdep.h
index b7964a35b1..8d1e2972df 100644
--- a/sysdeps/arm/sysdep.h
+++ b/sysdeps/arm/sysdep.h
@@ -43,13 +43,13 @@
#endif
-/* ARM 6 needs slightly different handling */
-#ifdef __arm6__
+/* APCS-32 doesn't preserve the condition codes across function call. */
+#ifdef __APCS_32__
#define LOADREGS(cond, base, reglist...)\
ldm##cond base,reglist
#define RETINSTR(instr, regs...)\
instr regs
-#else /* arm 3 */
+#else /* APCS-26 */
#define LOADREGS(cond, base, reglist...)\
ldm##cond base,reglist^
#define RETINSTR(instr, regs...)\
diff --git a/sysdeps/generic/_G_config.h b/sysdeps/generic/_G_config.h
index a9a182169b..fc102c23a4 100644
--- a/sysdeps/generic/_G_config.h
+++ b/sysdeps/generic/_G_config.h
@@ -9,6 +9,7 @@
#include <bits/types.h>
#define __need_size_t
#define __need_wint_t
+#define __need_NULL
#include <stddef.h>
#ifndef _WINT_T
/* Integral type unchanged by default argument promotions that can
diff --git a/sysdeps/generic/e_acoshl.c b/sysdeps/generic/e_acoshl.c
index 2c7e8ca3cd..2c2fbe8eb4 100644
--- a/sysdeps/generic/e_acoshl.c
+++ b/sysdeps/generic/e_acoshl.c
@@ -10,5 +10,5 @@ __ieee754_acoshl (long double x)
return 0.0;
}
-stub_warning (__ieee754_acoshl)
+stub_warning (acoshl)
#include <stub-tag.h>
diff --git a/sysdeps/generic/e_acosl.c b/sysdeps/generic/e_acosl.c
index f7ee70d592..d844d885b8 100644
--- a/sysdeps/generic/e_acosl.c
+++ b/sysdeps/generic/e_acosl.c
@@ -10,5 +10,5 @@ __ieee754_acosl (long double x)
return 0.0;
}
-stub_warning (__ieee754_acosl)
+stub_warning (acosl)
#include <stub-tag.h>
diff --git a/sysdeps/generic/e_asinl.c b/sysdeps/generic/e_asinl.c
index 271a375fa2..3b26f030ef 100644
--- a/sysdeps/generic/e_asinl.c
+++ b/sysdeps/generic/e_asinl.c
@@ -10,5 +10,5 @@ __ieee754_asinl (long double x)
return 0.0;
}
-stub_warning (__ieee754_asinl)
+stub_warning (asinl)
#include <stub-tag.h>
diff --git a/sysdeps/generic/e_atan2l.c b/sysdeps/generic/e_atan2l.c
index 00d43d95c2..0caed8a32f 100644
--- a/sysdeps/generic/e_atan2l.c
+++ b/sysdeps/generic/e_atan2l.c
@@ -10,5 +10,5 @@ __ieee754_atan2l (long double x, long double y)
return 0.0;
}
-stub_warning (__ieee754_atan2l)
+stub_warning (atan2l)
#include <stub-tag.h>
diff --git a/sysdeps/generic/e_expl.c b/sysdeps/generic/e_expl.c
index 9d6a4bd4bd..f9467c38ab 100644
--- a/sysdeps/generic/e_expl.c
+++ b/sysdeps/generic/e_expl.c
@@ -10,5 +10,5 @@ __ieee754_expl (long double x)
return 0.0;
}
-stub_warning (__ieee754_expl)
+stub_warning (expl)
#include <stub-tag.h>
diff --git a/sysdeps/generic/e_fmodl.c b/sysdeps/generic/e_fmodl.c
index 950ba085b5..380da24e41 100644
--- a/sysdeps/generic/e_fmodl.c
+++ b/sysdeps/generic/e_fmodl.c
@@ -10,5 +10,5 @@ __ieee754_fmodl (long double x, long double y)
return 0.0;
}
-stub_warning (__ieee754_fmodl)
+stub_warning (fmodl)
#include <stub-tag.h>
diff --git a/sysdeps/generic/e_j0l.c b/sysdeps/generic/e_j0l.c
index 1e36bf76ad..624914b9ff 100644
--- a/sysdeps/generic/e_j0l.c
+++ b/sysdeps/generic/e_j0l.c
@@ -10,7 +10,7 @@ __ieee754_j0l (long double x)
return 0.0;
}
-stub_warning (__ieee754_j0l)
+stub_warning (j0l)
long double
__ieee754_y0l (long double x)
@@ -20,5 +20,5 @@ __ieee754_y0l (long double x)
return 0.0;
}
-stub_warning (__ieee754_y0l)
+stub_warning (y0l)
#include <stub-tag.h>
diff --git a/sysdeps/generic/e_j1l.c b/sysdeps/generic/e_j1l.c
index a1d30e2501..c2ae40e05c 100644
--- a/sysdeps/generic/e_j1l.c
+++ b/sysdeps/generic/e_j1l.c
@@ -10,7 +10,7 @@ __ieee754_j1l (long double x)
return 0.0;
}
-stub_warning (__ieee754_j1l)
+stub_warning (j1l)
long double
__ieee754_y1l (long double x)
@@ -20,5 +20,5 @@ __ieee754_y1l (long double x)
return 0.0;
}
-stub_warning (__ieee754_y1l)
+stub_warning (y1l)
#include <stub-tag.h>
diff --git a/sysdeps/generic/e_jnl.c b/sysdeps/generic/e_jnl.c
index 78915ec817..411598d40a 100644
--- a/sysdeps/generic/e_jnl.c
+++ b/sysdeps/generic/e_jnl.c
@@ -10,7 +10,7 @@ __ieee754_jnl (int n, long double x)
return 0.0;
}
-stub_warning (__ieee754_jnl)
+stub_warning (jnl)
long double
__ieee754_ynl (int n, long double x)
@@ -20,5 +20,5 @@ __ieee754_ynl (int n, long double x)
return 0.0;
}
-stub_warning (__ieee754_ynl)
+stub_warning (ynl)
#include <stub-tag.h>
diff --git a/sysdeps/generic/e_lgammal_r.c b/sysdeps/generic/e_lgammal_r.c
index bba92bb5e2..0c1bc661ad 100644
--- a/sysdeps/generic/e_lgammal_r.c
+++ b/sysdeps/generic/e_lgammal_r.c
@@ -10,5 +10,6 @@ __ieee754_lgammal_r (long double x, int *signgamp)
return 0.0;
}
-stub_warning (__ieee754_lgammal_r)
+stub_warning (lgammal)
+stub_warning (lgammal_r)
#include <stub-tag.h>
diff --git a/sysdeps/generic/e_log10l.c b/sysdeps/generic/e_log10l.c
index fef310308a..5bc264b32c 100644
--- a/sysdeps/generic/e_log10l.c
+++ b/sysdeps/generic/e_log10l.c
@@ -10,5 +10,5 @@ __ieee754_log10l (long double x)
return 0.0;
}
-stub_warning (__ieee754_log10l)
+stub_warning (log10l)
#include <stub-tag.h>
diff --git a/sysdeps/generic/e_logl.c b/sysdeps/generic/e_logl.c
index 3fe7a48459..9ba9cfc799 100644
--- a/sysdeps/generic/e_logl.c
+++ b/sysdeps/generic/e_logl.c
@@ -10,5 +10,5 @@ __ieee754_logl (long double x)
return 0.0;
}
-stub_warning (__ieee754_logl)
+stub_warning (logl)
#include <stub-tag.h>
diff --git a/sysdeps/generic/e_powl.c b/sysdeps/generic/e_powl.c
index 96ec53943e..afc2248b6b 100644
--- a/sysdeps/generic/e_powl.c
+++ b/sysdeps/generic/e_powl.c
@@ -10,5 +10,5 @@ __ieee754_powl (long double x, long double y)
return 0.0;
}
-stub_warning (__ieee754_powl)
+stub_warning (powl)
#include <stub-tag.h>
diff --git a/sysdeps/generic/e_sqrtl.c b/sysdeps/generic/e_sqrtl.c
index d5380809ed..7680bdb145 100644
--- a/sysdeps/generic/e_sqrtl.c
+++ b/sysdeps/generic/e_sqrtl.c
@@ -10,5 +10,5 @@ __ieee754_sqrtl (long double x)
return 0.0;
}
-stub_warning (__ieee754_sqrtl)
+stub_warning (sqrtl)
#include <stub-tag.h>
diff --git a/sysdeps/generic/s_exp2l.c b/sysdeps/generic/s_exp2l.c
index 46ecc4eae3..64ef6d3d50 100644
--- a/sysdeps/generic/s_exp2l.c
+++ b/sysdeps/generic/s_exp2l.c
@@ -3,13 +3,12 @@
#include <errno.h>
long double
-__exp2l (long double x)
+__ieee754_exp2l (long double x)
{
- fputs ("__exp2l not implemented\n", stderr);
+ fputs ("__ieee754_exp2l not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
}
-weak_alias (__exp2l, exp2l)
stub_warning (exp2l)
#include <stub-tag.h>
diff --git a/sysdeps/libm-i387/i686/s_fdim.S b/sysdeps/libm-i387/i686/s_fdim.S
new file mode 100644
index 0000000000..1ecae61aa9
--- /dev/null
+++ b/sysdeps/libm-i387/i686/s_fdim.S
@@ -0,0 +1,41 @@
+/* Compute positive difference.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fdim)
+ fldl 4(%esp) // x
+ fldl 12(%esp) // x : y
+
+ fucomi %st(1), %st
+ jp 1f
+
+ fsubp %st(1), %st
+ fldz
+ fcmovnb %st(1), %st
+ jmp 2f
+
+1: fucomi %st(0), %st
+ fcmovu %st, %st(1)
+2: fstp %st(1)
+ ret
+END(__fdim)
+weak_alias (__fdim, fdim)
diff --git a/sysdeps/libm-i387/i686/s_fdimf.S b/sysdeps/libm-i387/i686/s_fdimf.S
new file mode 100644
index 0000000000..0d2ef3cc1a
--- /dev/null
+++ b/sysdeps/libm-i387/i686/s_fdimf.S
@@ -0,0 +1,41 @@
+/* Compute positive difference.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fdimf)
+ flds 4(%esp) // x
+ flds 8(%esp) // x : y
+
+ fucomi %st(1), %st
+ jp 1f
+
+ fsubp %st(1), %st
+ fldz
+ fcmovnb %st(1), %st
+ jmp 2f
+
+1: fucomi %st(0), %st
+ fcmovu %st, %st(1)
+2: fstp %st(1)
+ ret
+END(__fdimf)
+weak_alias (__fdimf, fdimf)
diff --git a/sysdeps/libm-i387/i686/s_fdiml.S b/sysdeps/libm-i387/i686/s_fdiml.S
new file mode 100644
index 0000000000..94510df756
--- /dev/null
+++ b/sysdeps/libm-i387/i686/s_fdiml.S
@@ -0,0 +1,41 @@
+/* Compute positive difference.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fdiml)
+ fldt 4(%esp) // x
+ fldt 16(%esp) // x : y
+
+ fucomi %st(1), %st
+ jp 1f
+
+ fsubp %st(1), %st
+ fldz
+ fcmovnb %st(1), %st
+ jmp 2f
+
+1: fucomi %st(0), %st
+ fcmovu %st, %st(1)
+2: fstp %st(1)
+ ret
+END(__fdiml)
+weak_alias (__fdiml, fdiml)
diff --git a/sysdeps/libm-i387/i686/s_fmax.S b/sysdeps/libm-i387/i686/s_fmax.S
new file mode 100644
index 0000000000..3639ba7470
--- /dev/null
+++ b/sysdeps/libm-i387/i686/s_fmax.S
@@ -0,0 +1,40 @@
+/* Compute maximum of two numbers, regarding NaN as missing argument.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fmax)
+ fldl 4(%esp) // x
+ fldl 12(%esp) // x : y
+
+ fucomi %st(0), %st
+ fcmovu %st(1), %st // now %st contains y if not NaN, x otherwise
+
+ fxch
+
+ fucomi %st(1), %st
+ fcmovb %st(1), %st
+
+ fstp %st(1)
+
+ ret
+END(__fmax)
+weak_alias (__fmax, fmax)
diff --git a/sysdeps/libm-i387/i686/s_fmaxf.S b/sysdeps/libm-i387/i686/s_fmaxf.S
new file mode 100644
index 0000000000..ad948d0b62
--- /dev/null
+++ b/sysdeps/libm-i387/i686/s_fmaxf.S
@@ -0,0 +1,40 @@
+/* Compute maximum of two numbers, regarding NaN as missing argument.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fmaxf)
+ flds 4(%esp) // x
+ flds 8(%esp) // x : y
+
+ fucomi %st(0), %st
+ fcmovu %st(1), %st // now %st contains y if not NaN, x otherwise
+
+ fxch
+
+ fucomi %st(1), %st
+ fcmovb %st(1), %st
+
+ fstp %st(1)
+
+ ret
+END(__fmaxf)
+weak_alias (__fmaxf, fmaxf)
diff --git a/sysdeps/libm-i387/i686/s_fmaxl.S b/sysdeps/libm-i387/i686/s_fmaxl.S
new file mode 100644
index 0000000000..14859b0a6d
--- /dev/null
+++ b/sysdeps/libm-i387/i686/s_fmaxl.S
@@ -0,0 +1,40 @@
+/* Compute maximum of two numbers, regarding NaN as missing argument.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fmaxl)
+ fldt 4(%esp) // x
+ fldt 16(%esp) // x : y
+
+ fucomi %st(0), %st
+ fcmovu %st(1), %st // now %st contains y if not NaN, x otherwise
+
+ fxch
+
+ fucomi %st(1), %st
+ fcmovb %st(1), %st
+
+ fstp %st(1)
+
+ ret
+END(__fmaxl)
+weak_alias (__fmaxl, fmaxl)
diff --git a/sysdeps/libm-i387/i686/s_fmin.S b/sysdeps/libm-i387/i686/s_fmin.S
new file mode 100644
index 0000000000..9df029996d
--- /dev/null
+++ b/sysdeps/libm-i387/i686/s_fmin.S
@@ -0,0 +1,38 @@
+/* Compute minimum of two numbers, regarding NaN as missing argument.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fmin)
+ fldl 4(%esp) // x
+ fldl 12(%esp) // x : y
+
+ fucomi %st(0), %st
+ fcmovu %st(1), %st // now %st contains y if not NaN, x otherwise
+
+ fucomi %st(1), %st
+ fcmovb %st(1), %st
+
+ fstp %st(1)
+
+ ret
+END(__fmin)
+weak_alias (__fmin, fmin)
diff --git a/sysdeps/libm-i387/i686/s_fminf.S b/sysdeps/libm-i387/i686/s_fminf.S
new file mode 100644
index 0000000000..a1d1497c15
--- /dev/null
+++ b/sysdeps/libm-i387/i686/s_fminf.S
@@ -0,0 +1,38 @@
+/* Compute minimum of two numbers, regarding NaN as missing argument.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fminf)
+ flds 4(%esp) // x
+ flds 8(%esp) // x : y
+
+ fucomi %st(0), %st
+ fcmovu %st(1), %st // now %st contains y if not NaN, x otherwise
+
+ fucomi %st(1), %st
+ fcmovb %st(1), %st
+
+ fstp %st(1)
+
+ ret
+END(__fminf)
+weak_alias (__fminf, fminf)
diff --git a/sysdeps/libm-i387/i686/s_fminl.S b/sysdeps/libm-i387/i686/s_fminl.S
new file mode 100644
index 0000000000..089be40bd4
--- /dev/null
+++ b/sysdeps/libm-i387/i686/s_fminl.S
@@ -0,0 +1,38 @@
+/* Compute minimum of two numbers, regarding NaN as missing argument.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fminl)
+ fldt 4(%esp) // x
+ fldt 16(%esp) // x : y
+
+ fucomi %st(0), %st
+ fcmovu %st(1), %st // now %st contains y if not NaN, x otherwise
+
+ fucomi %st(1), %st
+ fcmovb %st(1), %st
+
+ fstp %st(1)
+
+ ret
+END(__fminl)
+weak_alias (__fminl, fminl)
diff --git a/sysdeps/libm-i387/s_fdim.S b/sysdeps/libm-i387/s_fdim.S
new file mode 100644
index 0000000000..758d6ec915
--- /dev/null
+++ b/sysdeps/libm-i387/s_fdim.S
@@ -0,0 +1,51 @@
+/* Compute positive difference.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fdim)
+ fldl 4(%esp) // x
+ fldl 12(%esp) // x : y
+
+ fucom %st(1)
+ fnstsw
+ sahf
+ jp 1f
+
+ fsubp %st(1), %st
+ jc 2f
+
+ fstp %st(0)
+ fldz
+ jmp 2f
+
+1: fxam
+ fnstsw
+ andb $0x45, %ah
+ cmpb $0x01, %ah
+ je 3f
+
+ fxch
+3: fstp %st(1)
+
+2: ret
+END(__fdim)
+weak_alias (__fdim, fdim)
diff --git a/sysdeps/libm-i387/s_fdimf.S b/sysdeps/libm-i387/s_fdimf.S
new file mode 100644
index 0000000000..862f28e0eb
--- /dev/null
+++ b/sysdeps/libm-i387/s_fdimf.S
@@ -0,0 +1,51 @@
+/* Compute positive difference.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fdimf)
+ flds 4(%esp) // x
+ flds 8(%esp) // x : y
+
+ fucom %st(1)
+ fnstsw
+ sahf
+ jp 1f
+
+ fsubp %st(1), %st
+ jc 2f
+
+ fstp %st(0)
+ fldz
+ jmp 2f
+
+1: fxam
+ fnstsw
+ andb $0x45, %ah
+ cmpb $0x01, %ah
+ je 3f
+
+ fxch
+3: fstp %st(1)
+
+2: ret
+END(__fdimf)
+weak_alias (__fdimf, fdimf)
diff --git a/sysdeps/libm-i387/s_fdiml.S b/sysdeps/libm-i387/s_fdiml.S
new file mode 100644
index 0000000000..428ae36343
--- /dev/null
+++ b/sysdeps/libm-i387/s_fdiml.S
@@ -0,0 +1,51 @@
+/* Compute positive difference.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fdiml)
+ fldt 4(%esp) // x
+ fldt 16(%esp) // x : y
+
+ fucom %st(1)
+ fnstsw
+ sahf
+ jp 1f
+
+ fsubp %st(1), %st
+ jc 2f
+
+ fstp %st(0)
+ fldz
+ jmp 2f
+
+1: fxam
+ fnstsw
+ andb $0x45, %ah
+ cmpb $0x01, %ah
+ je 3f
+
+ fxch
+3: fstp %st(1)
+
+2: ret
+END(__fdiml)
+weak_alias (__fdiml, fdiml)
diff --git a/sysdeps/libm-i387/s_fmax.S b/sysdeps/libm-i387/s_fmax.S
new file mode 100644
index 0000000000..3dbaa139ad
--- /dev/null
+++ b/sysdeps/libm-i387/s_fmax.S
@@ -0,0 +1,44 @@
+/* Compute maximum of two numbers, regarding NaN as missing argument.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fmax)
+ fldl 12(%esp) // y
+ fxam
+ fnstsw
+ fldl 4(%esp) // y : x
+
+ andb $0x45, %ah
+ cmpb $0x01, %ah
+ je 1f // y == NaN
+
+ fucom %st(1)
+ fnstsw
+ sahf
+ jnc 1f
+
+ fxch %st(1)
+1: fstp %st(1)
+
+ ret
+END(__fmax)
+weak_alias (__fmax, fmax)
diff --git a/sysdeps/libm-i387/s_fmaxf.S b/sysdeps/libm-i387/s_fmaxf.S
new file mode 100644
index 0000000000..5dd94a43c4
--- /dev/null
+++ b/sysdeps/libm-i387/s_fmaxf.S
@@ -0,0 +1,44 @@
+/* Compute maximum of two numbers, regarding NaN as missing argument.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fmaxf)
+ flds 8(%esp) // y
+ fxam
+ fnstsw
+ flds 4(%esp) // y : x
+
+ andb $0x45, %ah
+ cmpb $0x01, %ah
+ je 1f // y == NaN
+
+ fucom %st(1)
+ fnstsw
+ sahf
+ jnc 1f
+
+ fxch %st(1)
+1: fstp %st(1)
+
+ ret
+END(__fmaxf)
+weak_alias (__fmaxf, fmaxf)
diff --git a/sysdeps/libm-i387/s_fmaxl.S b/sysdeps/libm-i387/s_fmaxl.S
new file mode 100644
index 0000000000..d833bd1985
--- /dev/null
+++ b/sysdeps/libm-i387/s_fmaxl.S
@@ -0,0 +1,44 @@
+/* Compute maximum of two numbers, regarding NaN as missing argument.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fmaxl)
+ fldt 16(%esp) // y
+ fxam
+ fnstsw
+ fldt 4(%esp) // y : x
+
+ andb $0x45, %ah
+ cmpb $0x01, %ah
+ je 1f // y == NaN
+
+ fucom %st(1)
+ fnstsw
+ sahf
+ jnc 1f
+
+ fxch %st(1)
+1: fstp %st(1)
+
+ ret
+END(__fmaxl)
+weak_alias (__fmaxl, fmaxl)
diff --git a/sysdeps/libm-i387/s_fmin.S b/sysdeps/libm-i387/s_fmin.S
new file mode 100644
index 0000000000..1ac46c7d21
--- /dev/null
+++ b/sysdeps/libm-i387/s_fmin.S
@@ -0,0 +1,44 @@
+/* Compute minimum of two numbers, regarding NaN as missing argument.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fmin)
+ fldl 4(%esp) // x
+ fldl 12(%esp) // x : y
+
+ fxam
+ fnstsw
+ andb $0x45, %ah
+ cmpb $0x01, %ah
+ je 1f // y == NaN
+
+ fucom %st(1)
+ fnstsw
+ sahf
+ jc 2f
+
+1: fxch %st(1)
+2: fstp %st(1)
+
+ ret
+END(__fmin)
+weak_alias (__fmin, fmin)
diff --git a/sysdeps/libm-i387/s_fminf.S b/sysdeps/libm-i387/s_fminf.S
new file mode 100644
index 0000000000..7dd346d2bc
--- /dev/null
+++ b/sysdeps/libm-i387/s_fminf.S
@@ -0,0 +1,44 @@
+/* Compute minimum of two numbers, regarding NaN as missing argument.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fminf)
+ flds 4(%esp) // x
+ flds 8(%esp) // x : y
+
+ fxam
+ fnstsw
+ andb $0x45, %ah
+ cmpb $0x01, %ah
+ je 1f // y == NaN
+
+ fucom %st(1)
+ fnstsw
+ sahf
+ jc 2f
+
+1: fxch %st(1)
+2: fstp %st(1)
+
+ ret
+END(__fminf)
+weak_alias (__fminf, fminf)
diff --git a/sysdeps/libm-i387/s_fminl.S b/sysdeps/libm-i387/s_fminl.S
new file mode 100644
index 0000000000..883735d32c
--- /dev/null
+++ b/sysdeps/libm-i387/s_fminl.S
@@ -0,0 +1,44 @@
+/* Compute minimum of two numbers, regarding NaN as missing argument.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+
+ .text
+ENTRY(__fminl)
+ fldt 4(%esp) // x
+ fldt 16(%esp) // x : y
+
+ fxam
+ fnstsw
+ andb $0x45, %ah
+ cmpb $0x01, %ah
+ je 1f // y == NaN
+
+ fucom %st(1)
+ fnstsw
+ sahf
+ jc 2f
+
+1: fxch %st(1)
+2: fstp %st(1)
+
+ ret
+END(__fminl)
+weak_alias (__fminl, fminl)
diff --git a/sysdeps/libm-ieee754/s_ilogb.c b/sysdeps/libm-ieee754/s_ilogb.c
index 0c28b689b9..820f01c9b2 100644
--- a/sysdeps/libm-ieee754/s_ilogb.c
+++ b/sysdeps/libm-ieee754/s_ilogb.c
@@ -37,7 +37,7 @@ static char rcsid[] = "$NetBSD: s_ilogb.c,v 1.9 1995/05/10 20:47:28 jtc Exp $";
if(hx<0x00100000) {
GET_LOW_WORD(lx,x);
if((hx|lx)==0)
- return 0x80000001; /* ilogb(0) = 0x80000001 */
+ return FP_ILOGB0; /* ilogb(0) = FP_ILOGB0 */
else /* subnormal x */
if(hx==0) {
for (ix = -1043; lx>0; lx<<=1) ix -=1;
@@ -47,7 +47,7 @@ static char rcsid[] = "$NetBSD: s_ilogb.c,v 1.9 1995/05/10 20:47:28 jtc Exp $";
return ix;
}
else if (hx<0x7ff00000) return (hx>>20)-1023;
- else return 0x7fffffff;
+ else return FP_ILOGBNAN;
}
weak_alias (__ilogb, ilogb)
#ifdef NO_LONG_DOUBLE
diff --git a/sysdeps/libm-ieee754/s_ilogbf.c b/sysdeps/libm-ieee754/s_ilogbf.c
index 2440803c20..e652b93619 100644
--- a/sysdeps/libm-ieee754/s_ilogbf.c
+++ b/sysdeps/libm-ieee754/s_ilogbf.c
@@ -8,7 +8,7 @@
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
@@ -32,13 +32,13 @@ static char rcsid[] = "$NetBSD: s_ilogbf.c,v 1.4 1995/05/10 20:47:31 jtc Exp $";
GET_FLOAT_WORD(hx,x);
hx &= 0x7fffffff;
if(hx<0x00800000) {
- if(hx==0)
- return 0x80000001; /* ilogb(0) = 0x80000001 */
+ if(hx==0)
+ return FP_ILOGB0; /* ilogb(0) = FP_ILOGB0 */
else /* subnormal x */
for (ix = -126,hx<<=8; hx>0; hx<<=1) ix -=1;
return ix;
}
else if (hx<0x7f800000) return (hx>>23)-127;
- else return 0x7fffffff;
+ else return FP_ILOGBNAN;
}
weak_alias (__ilogbf, ilogbf)
diff --git a/sysdeps/libm-ieee754/s_ilogbl.c b/sysdeps/libm-ieee754/s_ilogbl.c
index 11372e0dc8..d44229dcda 100644
--- a/sysdeps/libm-ieee754/s_ilogbl.c
+++ b/sysdeps/libm-ieee754/s_ilogbl.c
@@ -41,7 +41,7 @@ static char rcsid[] = "$NetBSD: $";
if(es==0) {
GET_LDOUBLE_WORDS(es,hx,lx,x);
if((hx|lx)==0)
- return 0x80000001; /* ilogbl(0) = 0x80000001 */
+ return FP_ILOGB0; /* ilogbl(0) = FP_ILOGB0 */
else /* subnormal x */
if(hx==0) {
for (ix = -16415; lx>0; lx<<=1) ix -=1;
@@ -51,6 +51,6 @@ static char rcsid[] = "$NetBSD: $";
return ix;
}
else if (es<0x7fff) return es-0x3fff;
- else return 0x7fffffff;
+ else return FP_ILOGBNAN;
}
weak_alias (__ilogbl, ilogbl)
diff --git a/sysdeps/libm-ieee754/s_llrintf.c b/sysdeps/libm-ieee754/s_llrintf.c
index 83cb7fdd37..a812377d19 100644
--- a/sysdeps/libm-ieee754/s_llrintf.c
+++ b/sysdeps/libm-ieee754/s_llrintf.c
@@ -34,17 +34,17 @@ long long int
__llrintf (float x)
{
int32_t j0;
- u_int32_t i, i0;
+ u_int32_t i0;
volatile float w;
float t;
long long int result;
int sx;
- GET_FLOAT_WORD (i, x);
+ GET_FLOAT_WORD (i0, x);
sx = i0 >> 31;
j0 = ((i0 >> 23) & 0xff) - 0x7f;
- i0 = i & 0x7fffff;
+ i0 &= 0x7fffff;
i0 |= 0x800000;
if (j0 < (int32_t) (sizeof (long long int) * 8) - 1)
@@ -57,10 +57,10 @@ __llrintf (float x)
{
w = two23[sx] + x;
t = w - two23[sx];
- GET_FLOAT_WORD (i, t);
- i0 = i & 0x7fffff;
- i0 |= 0x800000;
+ GET_FLOAT_WORD (i0, t);
j0 = ((i0 >> 23) & 0xff) - 0x7f;
+ i0 &= 0x7fffff;
+ i0 |= 0x800000;
result = i0 >> (23 - j0);
}
diff --git a/sysdeps/libm-ieee754/s_lrint.c b/sysdeps/libm-ieee754/s_lrint.c
index 8fe7d24e14..8f0d717963 100644
--- a/sysdeps/libm-ieee754/s_lrint.c
+++ b/sysdeps/libm-ieee754/s_lrint.c
@@ -34,7 +34,7 @@ long int
__lrint (double x)
{
int32_t j0;
- u_int32_t i0,i1,i;
+ u_int32_t i0,i1;
volatile double w;
double t;
long int result;
@@ -55,9 +55,9 @@ __lrint (double x)
w = two52[sx] + x;
t = w - two52[sx];
EXTRACT_WORDS (i0, i1, t);
- i0 = i & 0xfffff;
- i0 |= 0x100000;
j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
+ i0 &= 0xfffff;
+ i0 |= 0x100000;
result = i0 >> (20 - j0);
}
@@ -71,9 +71,9 @@ __lrint (double x)
w = two52[sx] + x;
t = w - two52[sx];
EXTRACT_WORDS (i0, i1, t);
- i0 = i & 0xfffff;
- i0 |= 0x100000;
j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
+ i0 &= 0xfffff;
+ i0 |= 0x100000;
result = ((long int) i0 << (j0 - 20)) | (i1 >> (52 - j0));
}
diff --git a/sysdeps/libm-ieee754/s_lrintf.c b/sysdeps/libm-ieee754/s_lrintf.c
index d80d81a718..210ffec501 100644
--- a/sysdeps/libm-ieee754/s_lrintf.c
+++ b/sysdeps/libm-ieee754/s_lrintf.c
@@ -34,17 +34,17 @@ long int
__lrintf (float x)
{
int32_t j0;
- u_int32_t i, i0;
+ u_int32_t i0;
volatile float w;
float t;
long int result;
int sx;
- GET_FLOAT_WORD (i, x);
+ GET_FLOAT_WORD (i0, x);
sx = i0 >> 31;
j0 = ((i0 >> 23) & 0xff) - 0x7f;
- i0 = i & 0x7fffff;
+ i0 &= 0x7fffff;
i0 |= 0x800000;
if (j0 < (int32_t) (sizeof (long int) * 8) - 1)
@@ -57,10 +57,10 @@ __lrintf (float x)
{
w = two23[sx] + x;
t = w - two23[sx];
- GET_FLOAT_WORD (i, t);
- i0 = i & 0x7fffff;
- i0 |= 0x800000;
+ GET_FLOAT_WORD (i0, t);
j0 = ((i0 >> 23) & 0xff) - 0x7f;
+ i0 &= 0x7fffff;
+ i0 |= 0x800000;
result = i0 >> (23 - j0);
}
diff --git a/sysdeps/libm-ieee754/s_nanf.c b/sysdeps/libm-ieee754/s_nanf.c
index 862327aa1e..b59040ac82 100644
--- a/sysdeps/libm-ieee754/s_nanf.c
+++ b/sysdeps/libm-ieee754/s_nanf.c
@@ -35,6 +35,6 @@ __nanf (const char *tagp)
return strtof (buf, NULL);
}
- return NANF;
+ return NAN;
}
weak_alias (__nanf, nanf)
diff --git a/sysdeps/libm-ieee754/s_nanl.c b/sysdeps/libm-ieee754/s_nanl.c
index 223f95082e..bd42689b78 100644
--- a/sysdeps/libm-ieee754/s_nanl.c
+++ b/sysdeps/libm-ieee754/s_nanl.c
@@ -35,6 +35,6 @@ __nanl (const char *tagp)
return strtold (buf, NULL);
}
- return NANL;
+ return NAN;
}
weak_alias (__nanl, nanl)
diff --git a/sysdeps/posix/ctermid.c b/sysdeps/posix/ctermid.c
index 410e3ece44..ea1f9a098e 100644
--- a/sysdeps/posix/ctermid.c
+++ b/sysdeps/posix/ctermid.c
@@ -29,11 +29,8 @@ ctermid (s)
{
static char name[L_ctermid];
- if (name[0] == '\0')
- (void) strcpy(name, "/dev/tty");
-
if (s == NULL)
- return(name);
+ s = name;
- return(strcpy(s, name));
+ return strcpy (s, "/dev/tty");
}
diff --git a/sysdeps/unix/sysv/linux/Dist b/sysdeps/unix/sysv/linux/Dist
index 2896953cb7..70baab50ee 100644
--- a/sysdeps/unix/sysv/linux/Dist
+++ b/sysdeps/unix/sysv/linux/Dist
@@ -5,6 +5,8 @@ kernel_sigaction.h
kernel_stat.h
kernel_termios.h
llseek.c
+s_pread64.c
+s_pwrite64.c
siglist.h
socketcall.h
sysctl.c
@@ -12,6 +14,7 @@ termio.h
net/ethernet.h
net/if.h
net/if_arp.h
+net/if_packet.h
net/if_ppp.h
net/if_slip.h
net/ppp-comp.h
@@ -28,6 +31,7 @@ netinet/tcp.h
netinet/udp.h
netipx/ipx.h
nfs/nfs.h
+scsi/sg.h
sys/acct.h
sys/debugreg.h
sys/fsuid.h
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 005278068a..7331b38588 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -52,7 +52,7 @@ endif
ifeq ($(subdir),socket)
sysdep_headers += net/if.h net/if_ppp.h net/ppp-comp.h \
net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
- net/if_slip.h
+ net/if_slip.h net/if_packet.h
sysdep_routines += cmsg_nxthdr
endif
diff --git a/sysdeps/unix/sysv/linux/_G_config.h b/sysdeps/unix/sysv/linux/_G_config.h
index ccb84ad8f7..9ad897644e 100644
--- a/sysdeps/unix/sysv/linux/_G_config.h
+++ b/sysdeps/unix/sysv/linux/_G_config.h
@@ -9,6 +9,7 @@
#include <bits/types.h>
#define __need_size_t
#define __need_wint_t
+#define __need_NULL
#include <stddef.h>
#ifndef _WINT_T
/* Integral type unchanged by default argument promotions that can
diff --git a/sysdeps/unix/sysv/linux/accept.S b/sysdeps/unix/sysv/linux/accept.S
index 014684c708..b713a6e267 100644
--- a/sysdeps/unix/sysv/linux/accept.S
+++ b/sysdeps/unix/sysv/linux/accept.S
@@ -1,3 +1,4 @@
#define socket accept
#define NARGS 3
#include <socket.S>
+strong_alias (__accept, __libc_accept)
diff --git a/sysdeps/unix/sysv/linux/connect.S b/sysdeps/unix/sysv/linux/connect.S
index 93aad35d85..2840c58174 100644
--- a/sysdeps/unix/sysv/linux/connect.S
+++ b/sysdeps/unix/sysv/linux/connect.S
@@ -1,3 +1,4 @@
#define socket connect
#define NARGS 3
#include <socket.S>
+strong_alias (__connect, __libc_connect)
diff --git a/sysdeps/unix/sysv/linux/getcwd.c b/sysdeps/unix/sysv/linux/getcwd.c
index eea0b469e1..2af3b78da5 100644
--- a/sysdeps/unix/sysv/linux/getcwd.c
+++ b/sysdeps/unix/sysv/linux/getcwd.c
@@ -23,23 +23,26 @@
#include <stdlib.h>
#include <unistd.h>
-/* #define NDEBUG 1 */
-#include <assert.h>
/* The "proc" filesystem provides an easy method to retrieve the value.
For each process, the corresponding directory contains a symbolic link
named `cwd'. Reading the content of this link immediate gives us the
information. But we have to take care for systems which do not have
the proc filesystem mounted. Use the POSIX implementation in this case. */
-static char *generic_getcwd (char *buf, size_t size);
+static char *generic_getcwd (char *buf, size_t size) internal_function;
char *
__getcwd (char *buf, size_t size)
{
+ static int no_new_dcache = 0;
int save_errno;
char *path;
int n;
char *result;
+ size_t alloc_size = size;
+
+ if (no_new_dcache)
+ return generic_getcwd (buf, size);
if (size == 0)
{
@@ -49,39 +52,56 @@ __getcwd (char *buf, size_t size)
return NULL;
}
- size = PATH_MAX + 1;
+ alloc_size = PATH_MAX + 1;
}
if (buf != NULL)
path = buf;
else
{
- path = malloc (size);
+ path = malloc (alloc_size);
if (path == NULL)
return NULL;
}
save_errno = errno;
- n = __readlink ("/proc/self/cwd", path, size);
+
+ n = __readlink ("/proc/self/cwd", path, alloc_size - 1);
if (n != -1)
{
- if (n >= size)
+ if (n >= alloc_size - 1)
{
- /* This should never happen when we allocate the buffer here. */
- assert (buf == NULL);
- __set_errno (ERANGE);
- return NULL;
+ if (size > 0)
+ return NULL;
}
- path[n] = '\0';
- return buf ?: (char *) realloc (path, (size_t) n + 1);
+ else
+ if (path[0] == '/')
+ {
+ path[n] = '\0';
+ return buf ?: (char *) realloc (path, (size_t) n + 1);
+ }
+ else
+ no_new_dcache = 1;
}
+ /* Set to no_new_dcache only if error indicates that proc doesn't exist. */
+ if (errno != EACCES && errno != ENAMETOOLONG)
+ no_new_dcache = 1;
+
/* Something went wrong. Restore the error number and use the generic
version. */
__set_errno (save_errno);
+
+ /* Don't put restrictions on the length of the path unless the user does. */
+ if (size == 0)
+ {
+ free (path);
+ path = NULL;
+ }
+
result = generic_getcwd (path, size);
- if (result == NULL && buf == NULL)
+ if (result == NULL && buf == NULL && size != 0)
free (path);
return result;
@@ -89,6 +109,6 @@ __getcwd (char *buf, size_t size)
weak_alias (__getcwd, getcwd)
/* Get the code for the generic version. */
-#define GETCWD_STORAGE_CLASS static
+#define GETCWD_STORAGE_CLASS static internal_function
#define __getcwd generic_getcwd
#include <sysdeps/posix/getcwd.c>
diff --git a/sysdeps/unix/sysv/linux/net/if.h b/sysdeps/unix/sysv/linux/net/if.h
index f4c1a48579..861ca261de 100644
--- a/sysdeps/unix/sysv/linux/net/if.h
+++ b/sysdeps/unix/sysv/linux/net/if.h
@@ -150,20 +150,21 @@ struct ifconf
/* Convert an interface name to an index, and vice versa. */
-unsigned int if_nametoindex(const char *ifname);
-char *if_indextoname(unsigned int ifindex, char *ifname);
+extern unsigned int if_nametoindex __P ((__const char *__ifname));
+extern char *if_indextoname __P ((unsigned int __ifindex, char *__ifname));
/* Return a list of all interfaces and their indices. */
-struct if_nameindex {
- unsigned int if_index; /* 1, 2, ... */
- char *if_name; /* null terminated name: "eth0", ... */
-};
+struct if_nameindex
+ {
+ unsigned int if_index; /* 1, 2, ... */
+ char *if_name; /* null terminated name: "eth0", ... */
+ };
-struct if_nameindex *if_nameindex(void);
+extern struct if_nameindex *if_nameindex __P ((void));
/* Free the data returned from if_nameindex. */
-void if_freenameindex(struct if_nameindex *ptr);
+extern void if_freenameindex __P ((struct if_nameindex *__ptr));
#endif /* net/if.h */
diff --git a/sysdeps/unix/sysv/linux/recv.S b/sysdeps/unix/sysv/linux/recv.S
index ae17ba3fd3..d895080f9a 100644
--- a/sysdeps/unix/sysv/linux/recv.S
+++ b/sysdeps/unix/sysv/linux/recv.S
@@ -1,3 +1,4 @@
#define socket recv
#define NARGS 4
#include <socket.S>
+strong_alias (__recv, __libc_recv)
diff --git a/sysdeps/unix/sysv/linux/recvfrom.S b/sysdeps/unix/sysv/linux/recvfrom.S
index ed03d3c44b..a2c94a71bc 100644
--- a/sysdeps/unix/sysv/linux/recvfrom.S
+++ b/sysdeps/unix/sysv/linux/recvfrom.S
@@ -1,3 +1,4 @@
#define socket recvfrom
#define NARGS 6
#include <socket.S>
+strong_alias (__recvfrom, __libc_recvfrom)
diff --git a/sysdeps/unix/sysv/linux/recvmsg.S b/sysdeps/unix/sysv/linux/recvmsg.S
index bb897d2b63..e5d8cdd16a 100644
--- a/sysdeps/unix/sysv/linux/recvmsg.S
+++ b/sysdeps/unix/sysv/linux/recvmsg.S
@@ -1,3 +1,4 @@
#define socket recvmsg
#define NARGS 3
#include <socket.S>
+strong_alias (__recvmsg, __libc_recvmsg)
diff --git a/sysdeps/unix/sysv/linux/send.S b/sysdeps/unix/sysv/linux/send.S
index 596135e690..5191265f62 100644
--- a/sysdeps/unix/sysv/linux/send.S
+++ b/sysdeps/unix/sysv/linux/send.S
@@ -1,3 +1,4 @@
#define socket send
#define NARGS 4
#include <socket.S>
+strong_alias (__send, __libc_send)
diff --git a/sysdeps/unix/sysv/linux/sendmsg.S b/sysdeps/unix/sysv/linux/sendmsg.S
index f0aabb7023..6f511af1c7 100644
--- a/sysdeps/unix/sysv/linux/sendmsg.S
+++ b/sysdeps/unix/sysv/linux/sendmsg.S
@@ -1,3 +1,4 @@
#define socket sendmsg
#define NARGS 3
#include <socket.S>
+strong_alias (__sendmsg, __libc_sendmsg)
diff --git a/sysdeps/unix/sysv/linux/sendto.S b/sysdeps/unix/sysv/linux/sendto.S
index 3464d46e52..b34a609a93 100644
--- a/sysdeps/unix/sysv/linux/sendto.S
+++ b/sysdeps/unix/sysv/linux/sendto.S
@@ -1,3 +1,4 @@
#define socket sendto
#define NARGS 6
#include <socket.S>
+strong_alias (__sendto, __libc_sendto)
diff --git a/sysdeps/unix/sysv/linux/sys/quota.h b/sysdeps/unix/sysv/linux/sys/quota.h
index 3a1c696790..47e88d7176 100644
--- a/sysdeps/unix/sysv/linux/sys/quota.h
+++ b/sysdeps/unix/sysv/linux/sys/quota.h
@@ -1,3 +1,3 @@
/* The kernel header file contains all declarations and definitions. */
-#include <asm/types.h>
+#include <sys/types.h>
#include <linux/quota.h>