+1997-03-25 02:15 Ulrich Drepper <drepper@cygnus.com>
+
+ * gmon/gmon.c: Optimize a bit by using more sets of records to
+ write in a single writev call.
+
+ * math/math.h: Add definitions of macros __MATHCALLX and __MATHDECLX.
+ * math/mathcalls.h: Use __MATHCALLX for fabs, infnan, copysign,
+ nan, isnan, nextafter, trunc, __fpclassify and signbit to mark as
+ `const'.
+ Use __MATHDECLX for isinf and finite.
+
+ * sysdeps/generic/setenv.c [_LIBC]: Define __clearenv and make
+ clearenv a weak alias.
+
+ Implement complex exponential function.
+ * sysdeps/libm-ieee754/s_cexp.c: New file.
+ * sysdeps/libm-ieee754/s_cexpf.c: New file.
+ * sysdeps/libm-ieee754/s_cexpl.c: New file.
+
+ * sysdeps/libm-ieee754/s_nan.c: Define function as __nan and make
+ nan a weak alias.
+ * sysdeps/libm-ieee754/s_nanf.c: Likewise for nanf.
+ * sysdeps/libm-ieee754/s_nanl.c: Likewise for nanl.
+
+ * sysdeps/unix/sysv/linux/iovec.h: Don't use kernel header because
+ of type clashes. Add all definitions here.
+
+ * sysdeps/unix/sysv/linux/shmat.c: Likewise. Correct types according
+ to XPG4.2.
+ * sysdeps/unix/sysv/linux/shmdt.c: Likewise.
+ * sysdeps/unix/sysv/linux/msgrcv.c: Likewise.
+
+ * sysvipc/sys/shm.h (shmat, shmdt): Correct types.
+
+ * sysdeps/unix/sysv/linux/sys/kd.h: Define _LINUX_TYPES_H to avoid
+ use of kernel types.
+
+1997-03-25 00:00 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/unix/sysv/linux/netinet/ip.h (struct ip_timestamp):
+ Correct typos. Reported by a sun <asun@zoology.washington.edu>.
+
+1997-03-20 21:58 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * sysdeps/libm-ieee754/s_asinhl.c: Fix sign of result.
+
+1997-03-20 16:20 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * sysdeps/libm-ieee754/e_atan2l.c: Fix typo.
+
+1997-03-20 14:23 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * sysdeps/m68k/fpu/__math.h (__logb, logb): Don't define.
+ * sysdeps/m68k/fpu/s_logb.c: Removed.
+ * sysdeps/m68k/fpu/s_logbf.c: Removed.
+ * sysdeps/m68k/fpu/s_logbl.c: Removed.
+
+ * sysdeps/m68k/fpu/__math.h (__ieee754_atan2, __ieee754_pow):
+ Don't define here.
+ * sysdeps/m68k/fpu/e_atan2.c: Rewritten.
+ * sysdeps/m68k/fpu/e_pow.c: Likewise.
+ * sysdeps/m68k/fpu/e_atan2f.c: Based on e_atan2.c.
+ * sysdeps/m68k/fpu/e_atan2l.c: Likewise.
+ * sysdeps/m68k/fpu/e_powf.c: Based on e_pow.c.
+ * sysdeps/m68k/fpu/e_powl.c: Likewise.
+
+ * sysdeps/m68k/fpu/s_log2.c: New file.
+ * sysdeps/m68k/fpu/s_log2f.c: New file.
+ * sysdeps/m68k/fpu/s_log2l.c: New file.
+ * sysdeps/m68k/fpu/s_exp2.c: New file.
+ * sysdeps/m68k/fpu/s_exp2f.c: New file.
+ * sysdeps/m68k/fpu/s_exp2l.c: New file.
+
+1997-03-20 14:46 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * Makeconfig (all): Make sure this is always the default goal.
+
+1997-03-20 11:09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * math/libm-test.c: Increase epsilon in many places. Fix many
+ typos. Allow optinal argument also for short option.
+
+1997-03-20 11:09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * math/Makefile ($(objpfx)$(tests)): Link against libm.
+
+1997-03-24 23:14 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/libm-ieee754/s_fpclassifyl.c: Correct recognition of
+ denormalized numbers.
+
+ * sysdeps/i386/huge_val.h: Remove references to byte order macros.
+ Don't include <endian.h>.
+
+1997-03-19 15:18 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+ * sysdeps/m68k/huge_val.h: Remove references to byte order macros.
+ Don't include <endian.h>.
+
+1997-03-24 23:09 Ulrich Drepper <drepper@cygnus.com>
+
+ * inet/rcmd.c (iruserok): Use access instead of euidaccess.
+
+1997-03-15 18:08 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * math/cmathcalls.h: Remove whitespace before function name in use
+ of __MATHDECL macro, to make it compilable with a traditional
+ preprocessor.
+
+1997-03-24 15:31 Ulrich Drepper <drepper@cygnus.com>
+
+ * configure.in: Use AC_PROG_CC instead of AC_PROG_TOOL to find
+ compiler.
+
+1997-03-24 02:34 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/libm-ieee754/s_finitel.c (__finitel): Shift return value
+ by 31 positions to get 0/1 result.
+ Patch by Joe Keane <jgk@jgk.org>.
+
+1997-03-23 12:15 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * posix/getopt.c (__getopt_nonoption_flags): Make it extern
+ to prevent from ld linking in getopt.o even if there is another
+ incompatible one.
+
+ * posix/getopt_init.c (__getopt_nonoption_flags): Remove extern.
+
+1997-03-23 23:30 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
+
+ * nis/nis_call.c (__do_niscall): Print message if cold start file
+ does not exist.
+ * nis/nis_file.c: Don't print error messages.
+ * nis/nis_local_name.c (nis_local_host): Fix pointer errors.
+ * nis/rpcsvc/ypclnt.h: Fix copyright and prototypes.
+ * nis/rpcsvc/nis.h: Likewise.
+ * nis/ypclnt.c: Fix prototypes.
+
+1997-03-24 01:36 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/libm-i387/e_scalb.S: Pop additional result before
+ returning.
+ * sysdeps/libm-i387/e_scalbf.S: Likewise.
+ * sysdeps/libm-i387/e_scalbl.S: Likewise.
+ Reported by Andreas Jaeger <aj@arthur.pfalz.de>.
+
+ * elf/rtld.c (dl_main): Set main_map->l_opencount to 1 also if
+ dynamic linker was called implicitly by the kernel.
+ Reported by Eric Youngdale <eric@andante.jic.com>.
+
+ * math/Makefile (CFLAGS-test-float.c, CFLAGS-test-double.c,
+ CFLAGS-test-longdouble.c): New variables. Set to -fno-inline to
+ prevent clever optimizations which corrupt the tests.
+
+1997-03-23 21:33 Andreas Jaeger <aj@arthur.pfalz.de>
+
+ * math/libm-test.c (scalb_test): New function.
+ (sqrt_test): New function.
+ (scalbn_test): New function.
+ (ilogb_test): New function.
+ (main): Added calls for new test functions.
+ (ldexp_test): Add another test for ldexp(x,0).
+
+1997-03-23 12:35 Andreas Jaeger <aj@arthur.pfalz.de>
+
+ * math/libm-test.c (remquo_test): Correct messages so that they
+ match the tests.
+ (copysign_test): Likewise.
+
+1997-03-23 16:28 Ulrich Drepper <drepper@cygnus.com>
+
+ * stdio-common/Makefile (routines): Add printf_size.
+
+ * stdio-common/printf.h: Add declarations for printf_size and
+ printf_size_info.
+
+ * stdio-common/printf-parse.h (__printf_arginfo_table): Correct
+ declaration.
+ (parse_one_spec): Test whether __printf_function_table is not NULL
+ before using registered handlers and don't test
+ __printf_arginfo_table. Update nargs also when handler is
+ registered.
+
+ * stdio-common/vfprintf.c (vfprintf): Count number of specifiers
+ processed in fast loop.
+
+ * stdio-common/printf_size: New file.
+
1997-03-23 02:11 Ulrich Drepper <drepper@cygnus.com>
* time/sys/time.h: Make values ITIMER_* also available as macros.
New functions. Test these functions.
(main): Call above new functions.
-1997-03-22 04:53 Ulrich Drepper <drepper@cygnus.com>
+1997-03-22 04:53 Ulgmon_out_readrich Drepper <drepper@cygnus.com>
* Net release 2.0.2.
This makefile requires GNU Make.
endif
+all: # Make this the default goal
+
ifneq "$(origin +included-Makeconfig)" "file"
+included-Makeconfig := yes
test -n "$MSGFMT" || MSGFMT=":"
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1125: checking build system type" >&5
-
-build_alias=$build
-case "$build_alias" in
-NONE)
- case $nonopt in
- NONE) build_alias=$host_alias ;;
- *) build_alias=$nonopt ;;
- esac ;;
-esac
-
-build=`$ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$build" 1>&6
-
-if test $host != $build; then
- ac_tool_prefix=${host_alias}-
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1127: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- ac_tool_prefix=
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
fi
-# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1151: checking for $ac_word" >&5
+echo "configure:1156: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ ac_prog_rejected=no
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
break
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="gcc"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
fi
fi
CC="$ac_cv_prog_CC"
echo "$ac_t""no" 1>&6
fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1204: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext <<EOF
+#line 1214 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:1218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1238: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:1243: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1267: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+ if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+ elif test $ac_cv_prog_cc_g = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-O2"
+ fi
+else
+ GCC=
+ test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
if test $host != $build; then
# Extract the first word of "gcc cc", so it can be a program name with args.
set dummy gcc cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1183: checking for $ac_word" >&5
+echo "configure:1298: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1210: checking how to run the C preprocessor" >&5
+echo "configure:1325: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1225 "configure"
+#line 1340 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1346: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1242 "configure"
+#line 1357 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1363: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
fi
echo "$ac_t""$CPP" 1>&6
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:1386: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`$ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+if test $host != $build; then
+ ac_tool_prefix=${host_alias}-
+else
+ ac_tool_prefix=
+fi
+
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1273: checking for $ac_word" >&5
+echo "configure:1412: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1304: checking for $ac_word" >&5
+echo "configure:1443: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1335: checking for $ac_word" >&5
+echo "configure:1474: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "bash", so it can be a program name with args.
set dummy bash; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1370: checking for $ac_word" >&5
+echo "configure:1509: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_BASH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "ksh", so it can be a program name with args.
set dummy ksh; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1411: checking for $ac_word" >&5
+echo "configure:1550: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_KSH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for signed size_t type""... $ac_c" 1>&6
-echo "configure:1453: checking for signed size_t type" >&5
+echo "configure:1592: checking for signed size_t type" >&5
if eval "test \"`echo '$''{'libc_cv_signed_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for libc-friendly stddef.h""... $ac_c" 1>&6
-echo "configure:1477: checking for libc-friendly stddef.h" >&5
+echo "configure:1616: checking for libc-friendly stddef.h" >&5
if eval "test \"`echo '$''{'libc_cv_friendly_stddef'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1482 "configure"
+#line 1621 "configure"
#include "confdefs.h"
#define __need_size_t
#define __need_wchar_t
if (&size == NULL || &wchar == NULL) abort ();
; return 0; }
EOF
-if { (eval echo configure:1497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_friendly_stddef=yes
else
fi
echo $ac_n "checking whether we need to use -P to assemble .S files""... $ac_c" 1>&6
-echo "configure:1516: checking whether we need to use -P to assemble .S files" >&5
+echo "configure:1655: checking whether we need to use -P to assemble .S files" >&5
if eval "test \"`echo '$''{'libc_cv_need_minus_P'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for assembler global-symbol directive""... $ac_c" 1>&6
-echo "configure:1539: checking for assembler global-symbol directive" >&5
+echo "configure:1678: checking for assembler global-symbol directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_global_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for .set assembler directive""... $ac_c" 1>&6
-echo "configure:1569: checking for .set assembler directive" >&5
+echo "configure:1708: checking for .set assembler directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_set_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for .symver assembler directive""... $ac_c" 1>&6
-echo "configure:1603: checking for .symver assembler directive" >&5
+echo "configure:1742: checking for .symver assembler directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_symver_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo "$ac_t""$libc_cv_asm_symver_directive" 1>&6
echo $ac_n "checking for ld --version-script""... $ac_c" 1>&6
-echo "configure:1622: checking for ld --version-script" >&5
+echo "configure:1761: checking for ld --version-script" >&5
if eval "test \"`echo '$''{'libc_cv_ld_version_script_option'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
EOF
if ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.s 1>&5 2>&5; then
if { ac_try='${CC-cc} $CFLAGS --shared -o conftest.so conftest.o
- -Wl,--version-script,conftest.map'; { (eval echo configure:1639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
+ -Wl,--version-script,conftest.map'; { (eval echo configure:1778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
then
libc_cv_ld_version_script_option=yes
else
if test $elf = yes; then
echo $ac_n "checking for .previous assembler directive""... $ac_c" 1>&6
-echo "configure:1669: checking for .previous assembler directive" >&5
+echo "configure:1808: checking for .previous assembler directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_previous_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
.section foo_section
.previous
EOF
- if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_asm_previous_directive=yes
else
libc_cv_asm_previous_directive=no
else
echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6
-echo "configure:1693: checking for .popsection assembler directive" >&5
+echo "configure:1832: checking for .popsection assembler directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_popsection_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
.pushsection foo_section
.popsection
EOF
- if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_asm_popsection_directive=yes
else
libc_cv_asm_popsection_directive=no
if test $elf != yes; then
echo $ac_n "checking for .init and .fini sections""... $ac_c" 1>&6
-echo "configure:1721: checking for .init and .fini sections" >&5
+echo "configure:1860: checking for .init and .fini sections" >&5
if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1726 "configure"
+#line 1865 "configure"
#include "confdefs.h"
int main() {
asm (".text");
; return 0; }
EOF
-if { (eval echo configure:1735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_have_initfini=yes
else
libc_cv_asm_underscores=no
else
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
-echo "configure:1760: checking for _ prefix on C symbol names" >&5
+echo "configure:1899: checking for _ prefix on C symbol names" >&5
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1765 "configure"
+#line 1904 "configure"
#include "confdefs.h"
asm ("_glibc_foobar:");
int main() {
glibc_foobar ();
; return 0; }
EOF
-if { (eval echo configure:1772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
libc_cv_asm_underscores=yes
else
libc_cv_asm_weakext_directive=no
else
echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&6
-echo "configure:1799: checking for assembler .weak directive" >&5
+echo "configure:1938: checking for assembler .weak directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test $libc_cv_asm_weak_directive = no; then
echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&6
-echo "configure:1822: checking for assembler .weakext directive" >&5
+echo "configure:1961: checking for assembler .weakext directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6
-echo "configure:1859: checking for ld --no-whole-archive" >&5
+echo "configure:1998: checking for ld --no-whole-archive" >&5
if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
EOF
if { ac_try='${CC-cc} $CFLAGS
-nostdlib -nostartfiles -Wl,--no-whole-archive
- -o conftest conftest.c'; { (eval echo configure:1870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c'; { (eval echo configure:2009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_ld_no_whole_archive=yes
else
libc_cv_ld_no_whole_archive=no
echo "$ac_t""$libc_cv_ld_no_whole_archive" 1>&6
echo $ac_n "checking for gcc -fno-exceptions""... $ac_c" 1>&6
-echo "configure:1881: checking for gcc -fno-exceptions" >&5
+echo "configure:2020: checking for gcc -fno-exceptions" >&5
if eval "test \"`echo '$''{'libc_cv_gcc_no_exceptions'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
EOF
if { ac_try='${CC-cc} $CFLAGS
-nostdlib -nostartfiles -fno-exceptions
- -o conftest conftest.c'; { (eval echo configure:1892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c'; { (eval echo configure:2031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_no_exceptions=yes
else
libc_cv_gcc_no_exceptions=no
fi
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
-echo "configure:1944: checking OS release for uname" >&5
+echo "configure:2083: checking OS release for uname" >&5
if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
uname_release="$libc_cv_uname_release"
echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
-echo "configure:1966: checking OS version for uname" >&5
+echo "configure:2105: checking OS version for uname" >&5
if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
-echo "configure:1988: checking stdio selection" >&5
+echo "configure:2127: checking stdio selection" >&5
case $stdio in
libio) cat >> confdefs.h <<\EOF
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@LN_S@%$LN_S%g
s%@MSGFMT@%$MSGFMT%g
+s%@CC@%$CC%g
+s%@BUILD_CC@%$BUILD_CC%g
+s%@CPP@%$CPP%g
s%@build@%$build%g
s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
-s%@CC@%$CC%g
-s%@BUILD_CC@%$BUILD_CC%g
-s%@CPP@%$CPP%g
s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g
s%@BASH@%$BASH%g
AC_PROG_LN_S
AC_CHECK_PROGS(MSGFMT, msgfmt gmsgfmt, :)
-AC_CHECK_TOOL(CC, gcc)
+AC_PROG_CC
if test $host != $build; then
AC_CHECK_PROG(BUILD_CC, gcc cc)
fi
main_map->l_phdr = phdr;
main_map->l_phnum = phent;
main_map->l_entry = *user_entry;
+ main_map->l_opencount = 1;
}
/* Scan the program header table for the dynamic section. */
int fd;
{
u_char tag = GMON_TAG_CG_ARC;
- struct gmon_cg_arc_record raw_arc
+ struct gmon_cg_arc_record raw_arc[4]
__attribute__ ((aligned (__alignof__ (char*))));
int from_index, to_index, from_len;
u_long frompc;
- struct iovec iov[2] =
+ struct iovec iov[8] =
{
{ &tag, sizeof (tag) },
- { &raw_arc, sizeof (struct gmon_cg_arc_record) }
+ { &raw_arc[0], sizeof (struct gmon_cg_arc_record) },
+ { &tag, sizeof (tag) },
+ { &raw_arc[1], sizeof (struct gmon_cg_arc_record) },
+ { &tag, sizeof (tag) },
+ { &raw_arc[2], sizeof (struct gmon_cg_arc_record) },
+ { &tag, sizeof (tag) },
+ { &raw_arc[3], sizeof (struct gmon_cg_arc_record) },
};
+ int nfilled = 0;
from_len = _gmonparam.fromssize / sizeof (*_gmonparam.froms);
for (from_index = 0; from_index < from_len; ++from_index)
to_index != 0;
to_index = _gmonparam.tos[to_index].link)
{
- *(char **) raw_arc.from_pc = (char *)frompc;
- *(char **) raw_arc.self_pc = (char *)_gmonparam.tos[to_index].selfpc;
- *(int *) raw_arc.count = _gmonparam.tos[to_index].count;
-
- __writev (fd, iov, 2);
+ if (nfilled > 3)
+ {
+ __writev (fd, iov, 2 * nfilled);
+ nfilled = 0;
+ }
+ *(char **) raw_arc[nfilled].from_pc = (char *)frompc;
+ *(char **) raw_arc[nfilled].self_pc =
+ (char *)_gmonparam.tos[to_index].selfpc;
+ *(int *) raw_arc[nfilled].count = _gmonparam.tos[to_index].count;
+ ++nfilled;
}
}
+ __writev (fd, iov, 2 * nfilled);
}
{
struct __bb *grp;
u_char tag = GMON_TAG_BB_COUNT;
- int ncounts;
- int i;
+ size_t ncounts;
+ size_t i;
struct iovec bbhead[2] =
{
{ &tag, sizeof (tag) },
{ &ncounts, sizeof (ncounts) }
};
- struct iovec bbbody[2];
+ struct iovec bbbody[8];
+ size_t nfilled;
- bbbody[0].iov_len = sizeof (grp->addresses[0]);
- bbbody[1].iov_len = sizeof (grp->addresses[0]);
+ for (i = 0; i < (sizeof (bbbody) / sizeof (bbbody[0])); i += 2)
+ {
+ bbbody[i].iov_len = sizeof (grp->addresses[0]);
+ bbbody[i + 1].iov_len = sizeof (grp->counts[0]);
+ }
/* Write each group of basic-block info (all basic-blocks in a
compilation unit form a single group). */
+ nfilled = 0;
for (grp = __bb_head; grp; grp = grp->next)
{
ncounts = grp->ncounts;
+ if (nfilled > 0)
+ {
+ __writev (fd, bbbody, nfilled);
+ nfilled = 0;
+ }
__writev (fd, bbhead, 2);
for (i = 0; i < ncounts; ++i)
{
- bbbody[0].iov_base = (char *) &grp->addresses[i];
- bbbody[1].iov_base = &grp->counts[i];
- __writev (fd, bbbody, 2);
+ if (nfilled > (sizeof (bbbody) / sizeof (bbbody[0])) - 2)
+ {
+ __writev (fd, bbbody, nfilled);
+ nfilled = 0;
+ }
+
+ bbbody[nfilled++].iov_base = (char *) &grp->addresses[i];
+ bbbody[nfilled++].iov_base = &grp->counts[i];
}
}
+ if (nfilled > 0)
+ __writev (fd, bbbody, nfilled);
}
* reading an NFS mounted file system, can't read files that
* are protected read/write owner only.
*/
- if (__euidaccess (pbuf, R_OK) != 0)
+ if (__access (pbuf, R_OK) != 0)
hostf = NULL;
else
{
w_log w_log10 w_pow w_remainder w_scalb w_sinh w_sqrt \
s_signbit s_fpclassify s_fmax s_fmin s_fdim s_nan s_trunc \
s_remquo \
- conj cimag creal cabs
+ conj cimag creal cabs s_cexp
libm-routines = $(libm-support) $(libm-calls) \
$(patsubst %_rf,%f_r,$(libm-calls:=f)) \
$(long-m-$(long-double-fcts))
# XXX This test is disabled for now since the functions are too buggy.
#test-longdouble-yes = test-longdouble
+CFLAGS-test-float.c = -fno-inline
+CFLAGS-test-double.c = -fno-inline
+CFLAGS-test-longdouble.c = -fno-inline
LDLIBS-test-float = libm
LDLIBS-test-double = libm
LDLIBS-test-longdouble = libm
$(objpfx)libieee.a: $(objpfx)ieee-math.o
rm -f $@
ln $< $@
+
+ifeq ($(build-shared),yes)
+$(addprefix $(objpfx),$(tests)): $(objpfx)libm.so$(libm.so-version)
+else
+$(addprefix $(objpfx),$(tests)): $(objpfx)libm.a
+endif
/* Absolute value, projections, conjugates, and projection. */
/* Absolute value of Z. */
-__MATHDECL (_Mdouble_, cabs, (_Mdouble_complex_ __z));
+__MATHDECL (_Mdouble_,cabs, (_Mdouble_complex_ __z));
/* Argument value of Z. */
-__MATHDECL (_Mdouble_, carg, (_Mdouble_complex_ __z));
+__MATHDECL (_Mdouble_,carg, (_Mdouble_complex_ __z));
/* Complex conjugate of Z. */
__MATHCALL (conj, (_Mdouble_complex_ __z));
/* Decomposing complex values. */
/* Imaginary part of Z. */
-__MATHDECL (_Mdouble_, cimag, (_Mdouble_complex_ __z));
+__MATHDECL (_Mdouble_,cimag, (_Mdouble_complex_ __z));
/* Real part of Z. */
-__MATHDECL (_Mdouble_, creal, (_Mdouble_complex_ __z));
+__MATHDECL (_Mdouble_,creal, (_Mdouble_complex_ __z));
/* Now some optimized versions. GCC has handy notations for these
/* This program isn't finished yet.
It has tests for acos, acosh, asin, asinh, atan, atan2, atanh,
- cbrt, ceil, cos, cosh, exp, exp2, expm1, fabs, floor, fpclassify,
- frexp, hypot, ldexp,
- log, log10, log1p, log2, logb, modf,
- pow, sin, sinh, tan, tanh.
+ cbrt, ceil, copysign, cos, cosh, exp, exp2, expm1,
+ fabs, fdim, floor, fmin, fmax, fpclassify,
+ frexp, hypot, ilogb, ldexp,
+ log, log10, log1p, log2, logb, modf, nextafter,
+ pow, scalb, scalbn, sin, sinh, sqrt, tan, tanh, trunc.
Tests for the other libm-functions will come later.
The routines using random variables are still under construction. I don't
# define _GNU_SOURCE
#endif
+#include <complex.h>
#include <math.h>
#include <float.h>
INVALID_EXCEPTION);
check_eps ("cos (pi/3) == 0.5", FUNC(cos) (M_PI / 3.0),
- 0.5, CHOOSE (0, 1e-15L, 1e-7L));
- check_eps ("cos (pi/2) == 0.5", FUNC(cos) (M_PI_2),
+ 0.5, CHOOSE (4e-18L, 1e-15L, 1e-7L));
+ check_eps ("cos (pi/2) == 0", FUNC(cos) (M_PI_2),
0, CHOOSE (1e-19L, 1e-16L, 1e-7L));
}
check_isinfp ("exp (+inf) == +inf", FUNC(exp) (plus_infty));
check ("exp (-inf) == 0", FUNC(exp) (minus_infty), 0);
- check ("exp (1) == e", FUNC(exp) (1), M_E);
+ check_eps ("exp (1) == e", FUNC(exp) (1), M_E, CHOOSE (4e-18L, 0, 0));
}
check_isinfp ("expm1 (+inf) == +inf", FUNC(expm1) (plus_infty));
check ("expm1 (-inf) == -1", FUNC(expm1) (minus_infty), -1);
- check ("expm1 (1) == e-1", FUNC(expm1) (1), M_E - 1.0);
+ check_eps ("expm1 (1) == e-1", FUNC(expm1) (1), M_E - 1.0,
+ CHOOSE (4e-18L, 0, 0));
}
static void
+ilogb_test (void)
+{
+
+ /* XXX Are these tests correct? I couldn't find any specification */
+#if 0
+ /* the source suggests that the following calls should fail -
+ but shall we test these special cases or just ignore them? */
+ check_isinfp ("ilogb (+inf) == +inf", FUNC(ilogb) (plus_infty));
+ check_isinfp ("ilogb (-inf) == +inf", FUNC(ilogb) (minus_infty));
+
+ check_isinfn_exc ("ilogb (+0) == -inf plus divide-by-zero exception",
+ FUNC(ilogb) (0), DIVIDE_BY_ZERO_EXCEPTION);
+
+ check_isinfn_exc ("ilogb (-0) == -inf plus divide-by-zero exception",
+ FUNC(ilogb) (minus_zero), DIVIDE_BY_ZERO_EXCEPTION);
+#endif
+ check ("ilogb (1) == 0", FUNC(ilogb) (1), 0);
+ check ("ilogb (e) == 1", FUNC(ilogb) (M_E), 1);
+ check ("ilogb (1024) == 10", FUNC(ilogb) (1024), 10);
+ check ("ilogb (-2000) == 10", FUNC(ilogb) (-2000), 10);
+
+}
+
+
+static void
ldexp_test (void)
{
+ MATHTYPE x;
+
check ("ldexp (0, 0) == 0", FUNC(ldexp) (0, 0), 0);
check_isinfp ("ldexp (+inf, 1) == +inf", FUNC(ldexp) (plus_infty, 1));
check ("ldexp (0.8, 4) == 12.8", FUNC(ldexp) (0.8L, 4), 12.8L);
check ("ldexp (-0.854375, 5) == -27.34", FUNC(ldexp) (-0.854375L, 5), -27.34L);
+
+ x = random_greater (0.0);
+ check_ext ("ldexp (x, 0) == x", FUNC(ldexp) (x, 0L), x, x);
+
}
FUNC(log) (-1), INVALID_EXCEPTION);
check_isinfp ("log (+inf) == +inf", FUNC(log) (plus_infty));
- check_eps ("log (e) == 1", FUNC(log) (M_E), 1, CHOOSE (0, 0, 9e-8L));
- check ("log (1/e) == -1", FUNC(log) (1.0 / M_E), -1);
+ check_eps ("log (e) == 1", FUNC(log) (M_E), 1, CHOOSE (1e-18L, 0, 9e-8L));
+ check_eps ("log (1/e) == -1", FUNC(log) (1.0 / M_E), -1,
+ CHOOSE (2e-18L, 0, 0));
check ("log (2) == M_LN2", FUNC(log) (2), M_LN2);
- check ("log (10) == M_LN10", FUNC(log) (10), M_LN10);
+ check_eps ("log (10) == M_LN10", FUNC(log) (10), M_LN10,
+ CHOOSE (1e-18L, 0, 0));
}
check_isinfp ("log10 (+inf) == +inf", FUNC(log10) (plus_infty));
- check ("log10 (0.1) == -1", FUNC(log10) (0.1L), -1);
- check ("log10 (10) == 1", FUNC(log10) (10.0), 1);
- check ("log10 (100) == 2", FUNC(log10) (100.0), 2);
+ check_eps ("log10 (0.1) == -1", FUNC(log10) (0.1L), -1,
+ CHOOSE (1e-18L, 0, 0));
+ check_eps ("log10 (10) == 1", FUNC(log10) (10.0), 1,
+ CHOOSE (1e-18L, 0, 0));
+ check_eps ("log10 (100) == 2", FUNC(log10) (100.0), 2,
+ CHOOSE (1e-18L, 0, 0));
check ("log10 (10000) == 4", FUNC(log10) (10000.0), 4);
check_eps ("log10 (e) == M_LOG10E", FUNC(log10) (M_E), M_LOG10E,
- CHOOSE (9e-20, 0, 9e-8));
+ CHOOSE (1e-18, 0, 9e-8));
}
check_isinfp ("log1p (+inf) == +inf", FUNC(log1p) (plus_infty));
- check ("log1p (e-1) == 1", FUNC(log1p) (M_E - 1.0), 1);
+ check_eps ("log1p (e-1) == 1", FUNC(log1p) (M_E - 1.0), 1,
+ CHOOSE (1e-18L, 0, 0));
}
static void
+scalb_test (void)
+{
+ MATHTYPE x;
+
+ check ("scalb (0, 0) == 0", FUNC(scalb) (0, 0), 0);
+
+ check_isinfp ("scalb (+inf, 1) == +inf", FUNC(scalb) (plus_infty, 1));
+ check_isinfn ("scalb (-inf, 1) == -inf", FUNC(scalb) (minus_infty, 1));
+ check_isnan ("scalb (NaN, 1) == NaN", FUNC(scalb) (nan_value, 1));
+
+ check ("scalb (0.8, 4) == 12.8", FUNC(scalb) (0.8L, 4), 12.8L);
+ check ("scalb (-0.854375, 5) == -27.34", FUNC(scalb) (-0.854375L, 5), -27.34L);
+
+ x = random_greater (0.0);
+ check_ext ("scalb (x, 0) == x", FUNC(scalb) (x, 0L), x, x);
+}
+
+
+static void
+scalbn_test (void)
+{
+ MATHTYPE x;
+
+ check ("scalbn (0, 0) == 0", FUNC(scalbn) (0, 0), 0);
+
+ check_isinfp ("scalbn (+inf, 1) == +inf", FUNC(scalbn) (plus_infty, 1));
+ check_isinfn ("scalbn (-inf, 1) == -inf", FUNC(scalbn) (minus_infty, 1));
+ check_isnan ("scalbn (NaN, 1) == NaN", FUNC(scalbn) (nan_value, 1));
+
+ check ("scalbn (0.8, 4) == 12.8", FUNC(scalbn) (0.8L, 4), 12.8L);
+ check ("scalbn (-0.854375, 5) == -27.34", FUNC(scalbn) (-0.854375L, 5), -27.34L);
+
+ x = random_greater (0.0);
+ check_ext ("scalbn (x, 0) == x", FUNC(scalbn) (x, 0L), x, x);
+}
+
+
+static void
sin_test (void)
{
check ("sin (+0) == +0", FUNC(sin) (0), 0);
FUNC(sin) (minus_infty),
INVALID_EXCEPTION);
- check ("sin (pi/6) == 0.5", FUNC(sin) (M_PI / 6.0), 0.5);
+ check_eps ("sin (pi/6) == 0.5", FUNC(sin) (M_PI / 6.0), 0.5,
+ CHOOSE (4e-18L, 0, 0));
check ("sin (pi/2) == 1", FUNC(sin) (M_PI_2), 1);
}
static void
tan_test (void)
{
- check ("tan (+0) == -0", FUNC(tan) (0), 0);
+ check ("tan (+0) == +0", FUNC(tan) (0), 0);
check ("tan (-0) == -0", FUNC(tan) (minus_zero), minus_zero);
check_isnan_exc ("tan (+inf) == NaN plus invalid exception",
FUNC(tan) (plus_infty), INVALID_EXCEPTION);
check_isnan_exc ("tan (-inf) == NaN plus invalid exception",
FUNC(tan) (minus_infty), INVALID_EXCEPTION);
- check_eps ("tan (pi/4) == 1", FUNC(tan) (M_PI_4), 1, CHOOSE (0, 1e-15L, 0));
+ check_eps ("tan (pi/4) == 1", FUNC(tan) (M_PI_4), 1,
+ CHOOSE (2e-18L, 1e-15L, 0));
}
check ("pow (-0.9, +inf) == +0", FUNC(pow) (-0.9L, plus_infty), 0);
check ("pow (-1e-7, +inf) == +0", FUNC(pow) (-1e-7L, plus_infty), 0);
- check ("pow (+1.1, -inf) == +inf", FUNC(pow) (1.1, minus_infty), 0);
- check ("pow (+inf, -inf) == +inf", FUNC(pow) (plus_infty, minus_infty), 0);
- check ("pow (-1.1, -inf) == +inf", FUNC(pow) (-1.1, minus_infty), 0);
- check ("pow (-inf, -inf) == +inf", FUNC(pow) (minus_infty, minus_infty), 0);
+ check ("pow (+1.1, -inf) == 0", FUNC(pow) (1.1, minus_infty), 0);
+ check ("pow (+inf, -inf) == 0", FUNC(pow) (plus_infty, minus_infty), 0);
+ check ("pow (-1.1, -inf) == 0", FUNC(pow) (-1.1, minus_infty), 0);
+ check ("pow (-inf, -inf) == 0", FUNC(pow) (minus_infty, minus_infty), 0);
- check_isinfp ("pow (0.9, -inf) == +0", FUNC(pow) (0.9L, minus_infty));
- check_isinfp ("pow (1e-7, -inf) == +0", FUNC(pow) (1e-7L, minus_infty));
- check_isinfp ("pow (-0.9, -inf) == +0", FUNC(pow) (-0.9L, minus_infty));
- check_isinfp ("pow (-1e-7, -inf) == +0", FUNC(pow) (-1e-7L, minus_infty));
+ check_isinfp ("pow (0.9, -inf) == +inf", FUNC(pow) (0.9L, minus_infty));
+ check_isinfp ("pow (1e-7, -inf) == +inf", FUNC(pow) (1e-7L, minus_infty));
+ check_isinfp ("pow (-0.9, -inf) == +inf", FUNC(pow) (-0.9L, minus_infty));
+ check_isinfp ("pow (-1e-7, -inf) == +inf", FUNC(pow) (-1e-7L, minus_infty));
check_isinfp ("pow (+inf, 1e-7) == +inf", FUNC(pow) (plus_infty, 1e-7L));
check_isinfp ("pow (+inf, 1) == +inf", FUNC(pow) (plus_infty, 1));
check_isnan_exc ("pow (+1, +inf) == NaN", FUNC(pow) (1, plus_infty),
INVALID_EXCEPTION);
- check_isnan_exc ("pow (-1, +inf) == NaN", FUNC(pow) (1, plus_infty),
+ check_isnan_exc ("pow (-1, +inf) == NaN", FUNC(pow) (-1, plus_infty),
INVALID_EXCEPTION);
- check_isnan_exc ("pow (+1, -inf) == NaN", FUNC(pow) (1, plus_infty),
+ check_isnan_exc ("pow (+1, -inf) == NaN", FUNC(pow) (1, minus_infty),
INVALID_EXCEPTION);
- check_isnan_exc ("pow (-1, -inf) == NaN", FUNC(pow) (1, plus_infty),
+ check_isnan_exc ("pow (-1, -inf) == NaN", FUNC(pow) (-1, minus_infty),
INVALID_EXCEPTION);
check_isnan_exc ("pow (-0.1, 1.1) == NaN", FUNC(pow) (-0.1, 1.1),
check ("pow (-0, 2) == +0", FUNC(pow) (minus_zero, 2), 0);
check ("pow (-0, 11.1) == +0", FUNC(pow) (minus_zero, 11.1), 0);
- x = random_greater (0.0);
+ x = random_greater (1.0);
check_isinfp_ext ("pow (x, +inf) == +inf for |x| > 1",
FUNC(pow) (x, plus_infty), x);
check_ext ("pow (x, +inf) == +0 for |x| < 1",
FUNC(pow) (x, plus_infty), 0.0, x);
- x = random_greater (0.0);
+ x = random_greater (1.0);
check_ext ("pow (x, -inf) == +0 for |x| > 1",
FUNC(pow) (x, minus_infty), 0.0, x);
FUNC(pow) (minus_infty, x), minus_zero, x);
x = ((rand () % 1000000) + 1) * -2.0; /* Get random even integer < 0 */
- check_ext ("pow (-inf, y) == 0 for y < 0 and not an odd integer",
+ check_ext ("pow (-inf, y) == +0 for y < 0 and not an odd integer",
FUNC(pow) (minus_infty, x), 0.0, x);
x = (rand () % 1000000) * 2.0 + 1; /* Get random odd integer > 0 */
minus_zero);
/* XXX More correctly we would have to check the sign of the NaN. */
- check_isnan ("copysign (+NaN, 0) = +inf", FUNC(copysign) (nan_value, 0));
- check_isnan ("copysign (+NaN, -0) = -inf", FUNC(copysign) (nan_value,
+ check_isnan ("copysign (+NaN, 0) = +NaN", FUNC(copysign) (nan_value, 0));
+ check_isnan ("copysign (+NaN, -0) = -NaN", FUNC(copysign) (nan_value,
minus_zero));
- check_isnan ("copysign (-NaN, 0) = +inf", FUNC(copysign) (-nan_value, 0));
- check_isnan ("copysign (-NaN, -0) = -inf", FUNC(copysign) (-nan_value,
+ check_isnan ("copysign (-NaN, 0) = +NaN", FUNC(copysign) (-nan_value, 0));
+ check_isnan ("copysign (-NaN, -0) = -NaN", FUNC(copysign) (-nan_value,
minus_zero));
}
static void
+sqrt_test (void)
+{
+ MATHTYPE x;
+
+
+ /* XXX Tests fuer negative x are missing */
+ check ("sqrt (0) == 0", FUNC(sqrt) (0), 0);
+ check_isnan ("sqrt (NaN) == NaN", FUNC(sqrt) (nan_value));
+ check_isinfp ("sqrt (+inf) == +inf", FUNC(sqrt) (plus_infty));
+
+ x = random_value (0, 10000);
+ check_ext ("sqrt (x*x) == x", sqrt (x*x), x, x);
+ check ("sqrt (4) == 2", FUNC(sqrt) (4), 2);
+}
+
+
+static void
remquo_test (void)
{
int quo;
result = FUNC(remquo) (-1.625, 1.0, &quo);
check ("remquo(-1.625, 1.0, &x) == 0.375", result, 0.375);
- check ("remquo(-1.625, 1.0, &x) puts 1 in x", quo, -1);
+ check ("remquo(-1.625, 1.0, &x) puts -1 in x", quo, -1);
result = FUNC(remquo) (1.625, -1.0, &quo);
check ("remquo(1.125, -1.0, &x) == 0.125", result, 0.125);
- check ("remquo(1.125, -1.0, &x) puts 1 in x", quo, -1);
+ check ("remquo(1.125, -1.0, &x) puts -1 in x", quo, -1);
result = FUNC(remquo) (-1.625, -1.0, &quo);
check ("remquo(-1.125, -1.0, &x) == 0.125", result, 0.125);
static void
+cexp_test (void)
+{
+ __complex__ MATHTYPE result;
+
+ result = FUNC(cexp) (plus_zero + 1.0i * plus_zero);
+ check ("real(cexp(0 + 0i)) = 1", __real__ result, 1);
+ check ("imag(cexp(0 + 0i)) = 0", __imag__ result, 0);
+ result = FUNC(cexp) (minus_zero + 1.0i * plus_zero);
+ check ("real(cexp(-0 + 0i)) = 1", __real__ result, 1);
+ check ("imag(cexp(-0 + 0i)) = 0", __imag__ result, 0);
+ result = FUNC(cexp) (plus_zero + 1.0i * minus_zero);
+ check ("real(cexp(0 - 0i)) = 1", __real__ result, 1);
+ check ("imag(cexp(0 - 0i)) = 0", __imag__ result, 0);
+ result = FUNC(cexp) (minus_zero + 1.0i * minus_zero);
+ check ("real(cexp(-0 - 0i)) = 1", __real__ result, 1);
+ check ("imag(cexp(-0 - 0i)) = 0", __imag__ result, 0);
+
+ result = FUNC(cexp) (plus_infty + 1.0i * plus_zero);
+ check_isinfp ("real(cexp(+inf + 0i)) = +inf", __real__ result);
+ check ("imag(cexp(+inf + 0i)) = 0", __imag__ result, 0);
+ result = FUNC(cexp) (plus_infty + 1.0i * minus_zero);
+ check_isinfp ("real(cexp(+inf - 0i)) = +inf", __real__ result);
+ check ("imag(cexp(+inf - 0i)) = 0", __imag__ result, 0);
+
+ result = FUNC(cexp) (minus_infty + 1.0i * plus_zero);
+ check ("real(cexp(-inf + 0i)) = 0", __real__ result, 0);
+ check ("imag(cexp(-inf + 0i)) = 0", __imag__ result, 0);
+ result = FUNC(cexp) (minus_infty + 1.0i * minus_zero);
+ check ("real(cexp(-inf - 0i)) = 0", __real__ result, 0);
+ check ("imag(cexp(-inf - 0i)) = 0", __imag__ result, 0);
+}
+
+
+static void
inverse_func_pair_test (const char *test_name,
mathfunc f1, mathfunc inverse,
MATHTYPE x, MATHTYPE epsilon)
inverse_functions (void)
{
inverse_func_pair_test ("asin(sin(x)) == x",
- FUNC(sin), FUNC(asin), 1.0, CHOOSE (0, 0, 1e-7L));
+ FUNC(sin), FUNC(asin), 1.0, CHOOSE (2e-18L, 0, 1e-7L));
inverse_func_pair_test ("sin(asin(x)) == x",
FUNC(asin), FUNC(sin), 1.0, 0.0);
inverse_func_pair_test ("acos(cos(x)) == x",
- FUNC(cos), FUNC(acos), 1.0, CHOOSE (0, 1e-15L, 0));
+ FUNC(cos), FUNC(acos), 1.0, CHOOSE (4e-18L, 1e-15L, 0));
inverse_func_pair_test ("cos(acos(x)) == x",
FUNC(acos), FUNC(cos), 1.0, 0.0);
inverse_func_pair_test ("atan(tan(x)) == x",
- FUNC(tan), FUNC(atan), 1.0, 0.0);
+ FUNC(tan), FUNC(atan), 1.0, CHOOSE (2e-18L, 0, 0));
inverse_func_pair_test ("tan(atan(x)) == x",
- FUNC(atan), FUNC(tan), 1.0, CHOOSE (0, 1e-15L, 0));
+ FUNC(atan), FUNC(tan), 1.0, CHOOSE (2e-18L, 1e-15L, 0));
inverse_func_pair_test ("asinh(sinh(x)) == x",
- FUNC(sinh), FUNC(asinh), 1.0, CHOOSE (1e-18L, 0, 0));
+ FUNC(sinh), FUNC(asinh), 1.0, CHOOSE (1e-18L, 0, 1e-7));
inverse_func_pair_test ("sinh(asinh(x)) == x",
- FUNC(asinh), FUNC(sinh), 1.0, 0.0);
+ FUNC(asinh), FUNC(sinh), 1.0, CHOOSE (2e-18L, 0, 0));
inverse_func_pair_test ("acosh(cosh(x)) == x",
FUNC(cosh), FUNC(acosh), 1.0, CHOOSE (1e-18L, 1e-15L, 0));
FUNC(acosh), FUNC(cosh), 1.0, 0.0);
inverse_func_pair_test ("atanh(tanh(x)) == x",
- FUNC(tanh), FUNC(atanh), 1.0, CHOOSE (0, 1e-15L, 0));
+ FUNC(tanh), FUNC(atanh), 1.0, CHOOSE (1e-18L, 1e-15L, 0));
inverse_func_pair_test ("tanh(atanh(x)) == x",
FUNC(atanh), FUNC(tanh), 1.0, 0.0);
static void
identities (void)
{
- identities1_test (0.2L, CHOOSE (1e-19L, 0, 0));
- identities1_test (0.9L, 0);
+ identities1_test (0.2L, CHOOSE (1e-18L, 0, 2e-7));
+ identities1_test (0.9L, CHOOSE (1e-18L, 0, 0));
identities1_test (0, 0);
- identities1_test (-1, CHOOSE (0, 0, 1e-7));
+ identities1_test (-1, CHOOSE (1e-18L, 0, 1e-7));
identities2_test (0.2L, CHOOSE (0, 1e-16, 0));
identities2_test (0.9L, CHOOSE (0, 1e-15, 0));
identities2_test (0, 0);
identities2_test (-1, CHOOSE (1e-18L, 1e-15, 0));
- identities3_test (0.2L, CHOOSE (0, 0, 1e-7));
+ identities3_test (0.2L, CHOOSE (1e-18L, 0, 1e-7));
identities3_test (0.9L, CHOOSE (1e-18L, 1e-15, 1e-6));
identities3_test (0, CHOOSE (0, 0, 1e-6));
identities3_test (-1, CHOOSE (1e-18L, 0, 1e-6));
this_does_nothing ();
- check_isinfp ("isinf (1/0) == +1", Inf_var);
- check_isinfn ("isinf (-1/0) == -1", -Inf_var);
+ check_isinfp ("isinf (inf) == +1", Inf_var);
+ check_isinfn ("isinf (-inf) == -1", -Inf_var);
check_bool ("!isinf (1)", !(FUNC(isinf) (one_var)));
- check_bool ("!isinf (0/0)", !(FUNC(isinf) (NaN_var)));
+ check_bool ("!isinf (NaN)", !(FUNC(isinf) (NaN_var)));
- check_isnan ("isnan (0/0)", NaN_var);
- check_isnan ("isnan (-(0/0))", -NaN_var);
+ check_isnan ("isnan (NaN)", NaN_var);
+ check_isnan ("isnan (-NaN)", -NaN_var);
check_bool ("!isnan (1)", !(FUNC(isnan) (one_var)));
- check_bool ("!isnan (0/0)", !(FUNC(isnan) (Inf_var)));
+ check_bool ("!isnan (inf)", !(FUNC(isnan) (Inf_var)));
check_bool ("inf == inf", Inf_var == Inf_var);
check_bool ("-inf == -inf", -Inf_var == -Inf_var);
static void
initialize (void)
{
+ fpstack_test ("*init*");
plus_zero = 0.0;
nan_value = plus_zero / plus_zero; /* Suppress GCC warning */
- minus_zero = copysign (0.0, -1.0);
+ minus_zero = FUNC (copysign) (0.0, -1.0);
plus_infty = CHOOSE (HUGE_VALL, HUGE_VAL, HUGE_VALF);
minus_infty = -CHOOSE (HUGE_VALL, HUGE_VAL, HUGE_VALF);
while (1)
{
- c = getopt_long (argc, argv, "vs",
+ c = getopt_long (argc, argv, "v::s",
long_options, &option_index);
/* Detect the end of the options. */
#endif
expm1_test ();
frexp_test ();
+ ilogb_test ();
ldexp_test ();
log_test ();
log10_test ();
#endif
logb_test ();
modf_test ();
+ scalb_test ();
+ scalbn_test ();
sin_test ();
sinh_test ();
tan_test ();
fmax_test ();
nextafter_test ();
copysign_test ();
+ sqrt_test ();
trunc_test ();
#if 0
/* XXX I'm not sure what is the correct result. */
remquo_test ();
#endif
+ cexp_test ();
identities ();
inverse_functions ();
#define __MATHDECL(type, function,suffix, args) \
__MATHDECL_1(type, function,suffix, args); \
__MATHDECL_1(type, __CONCAT(__,function),suffix, args)
+#define __MATHCALLX(function,suffix, args, attrib) \
+ __MATHDECLX (_Mdouble_,function,suffix, args, attrib)
+#define __MATHDECLX(type, function,suffix, args, attrib) \
+ __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \
+ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib)
#define __MATHDECL_1(type, function,suffix, args) \
extern type __MATH_PRECNAME(function,suffix) args
__MATHCALL (ceil,, (_Mdouble_ __x));
/* Absolute value of X. */
-__MATHCALL (fabs,, (_Mdouble_ __x));
+__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
/* Largest integer not greater than X. */
__MATHCALL (floor,, (_Mdouble_ __x));
#ifdef __USE_MISC
/* Return 0 if VALUE is finite or NaN, +1 if it
is +Infinity, -1 if it is -Infinity. */
-__MATHDECL (int,isinf,, (_Mdouble_ __value));
+__MATHDECLX (int,isinf,, (_Mdouble_ __value), (__const__));
/* Return nonzero if VALUE is finite and not NaN. */
-__MATHDECL (int,finite,, (_Mdouble_ __value));
+__MATHDECLX (int,finite,, (_Mdouble_ __value), (__const__));
/* Deal with an infinite or NaN result.
If ERROR is ERANGE, result is +Inf;
otherwise result is NaN.
This will set `errno' to either ERANGE or EDOM,
and may return an infinity or NaN, or may do something else. */
-__MATHCALL (infnan,, (int __error));
+__MATHCALLX (infnan,, (int __error), (__const__));
/* Return X times (2 to the Nth power). */
__MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
#if defined __USE_MISC || defined __USE_ISOC9X
/* Return X with its signed changed to Y's. */
-__MATHCALL (copysign,, (_Mdouble_ __x, _Mdouble_ __y));
+__MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
#endif
#ifdef __USE_ISOC9X
/* Return representation of NaN for double type. */
-__MATHCALL (nan,, (__const char *__tagb));
+__MATHCALLX (nan,, (__const char *__tagb), (__const__));
#endif
#if defined __USE_MISC || defined __USE_XOPEN
/* Return nonzero if VALUE is not a number. */
-__MATHDECL (int,isnan,, (_Mdouble_ __value));
+__MATHDECLX (int,isnan,, (_Mdouble_ __value), (__const__));
/* Return the binary exponent of X, which must be nonzero. */
__MATHDECL (int,ilogb,, (_Mdouble_ __x));
__MATHCALL (rint,, (_Mdouble_ __x));
/* Return X + epsilon if X < Y, X - epsilon if X > Y. */
-__MATHCALL (nextafter,, (_Mdouble_ __x, _Mdouble_ __y));
+__MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
/* Return the remainder of integer divison X / Y with infinite precision. */
__MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y));
/* Round X to the integral value in floating-point format nearest but
not larger in magnitude. */
-__MATHCALL (trunc,, (_Mdouble_ __x));
+__MATHCALLX (trunc,, (_Mdouble_ __x), (__const__));
/* Compute remainder of X and Y and put in *QUO a value with sign of x/y
and magnitude congruent `mod 2^n' to the magnitude of the integral
/* Classify given number. */
-__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value));
+__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value))
+ __attribute__ ((__const__));
/* Test for negative number. */
-__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value));
+__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value))
+ __attribute__ ((__const__));
#endif /* Use ISO C 9X. */
{
dir = readColdStartFile ();
if (dir == NULL)
- return NIS_UNAVAIL;
+ {
+ fputs (_("Error: could not find a NIS_COLD_START file\n"), stderr);
+ return NIS_UNAVAIL;
+ }
server = dir->do_servers.do_servers_val;
server_len = dir->do_servers.do_servers_len;
}
in = fopen (cold_start_file, "rb");
if (in == NULL)
- {
- printf (_("Error while opening %s for reading: %m"), cold_start_file);
- return NULL;
- }
+ return NULL;
memset (&obj, '\0', sizeof (obj));
xdrstdio_create (&xdrs, in, XDR_DECODE);
if (!xdr_directory_obj (&xdrs, &obj))
- {
- printf (_("Error while reading %s: %m"), cold_start_file);
- return NULL;
- }
+ return NULL;
return nis_clone_directory (&obj, NULL);
}
out = fopen (cold_start_file, "wb");
if (out == NULL)
- {
- printf (_("Error while opening %s for writing: %m"), cold_start_file);
- return FALSE;
- }
+ return FALSE;
xdrstdio_create (&xdrs, out, XDR_ENCODE);
- /* XXX The following cast is bad! Shouldn't the XDR functions take
- pointers to const objects? */
if (!xdr_directory_obj (&xdrs, (directory_obj *) obj))
- {
- printf (_("Error while writing %s: %m"), cold_start_file);
- return FALSE;
- }
+ return FALSE;
return TRUE;
}
void
nis_free_endpoints (endpoint *ep, unsigned int len)
{
- int i;
+ unsigned int i;
if (ep == NULL)
return;
void
nis_free_servers (nis_server *obj, unsigned int len)
{
- int i;
+ unsigned int i;
if (obj == NULL)
return;
if (__nishostname[0] == '\0')
{
- char *cp = __nishostname;
-
if (gethostname (__nishostname, NIS_MAXNAMELEN) < 0)
- cp = stpcpy (cp, "\0");
+ __nishostname[0] = '\0';
+ else
+ {
+ char *cp;
+ len = strlen(__nishostname);
- len = cp - __nishostname;
+ /* Hostname already fully qualified? */
+ if (__nishostname[len - 1] == '.')
+ return __nishostname;
- /* Hostname already fully qualified? */
- if (__nishostname[len - 1] == '.')
- return __nishostname;
+ if ((strlen (__nishostname) + strlen (nis_local_directory ()) + 1) >
+ NIS_MAXNAMELEN)
+ {
+ __nishostname[0] = '\0';
+ return __nishostname;
+ }
- if (strlen (__nishostname + strlen (nis_local_directory ()) + 1) >
- NIS_MAXNAMELEN)
- {
- __nishostname[0] = '\0';
- return __nishostname;
+ cp = &__nishostname[len];
+ *cp++ = '.';
+ strncpy (cp, nis_local_directory (), NIS_MAXNAMELEN - len -1);
+ __nishostname[NIS_MAXNAMELEN] = '\0';
}
-
- *cp++ = '.';
- stpcpy (cp, nis_local_directory ());
}
return __nishostname;
extern nis_error * nis_updkeys_3_svc();
#endif /* Old Style C */
struct rpcgen_table {
+#if defined __cplusplus || __STDC__
+ char *(*proc)(void);
+#else
char *(*proc)();
+#endif
xdrproc_t xdr_arg;
unsigned len_arg;
xdrproc_t xdr_res;
-/*
-** Copyright (c) 1996 Thorsten Kukuk, Germany
-**
-** This 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.
-**
-** This 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 this library; if not, write to the Free
-** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-** Author: Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
-**
-*/
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
+
+ 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. */
+
#ifndef __RPCSVC_YPCLNT_H__
#define __RPCSVC_YPCLNT_H__
__BEGIN_DECLS
/* struct ypall_callback * is the arg which must be passed to yp_all */
-struct ypall_callback {
- int (*foreach)();
- char *data;
-};
+struct ypall_callback
+ {
+ int (*foreach) __P ((int __status, char *__key, int __keylen,
+ char *__val, int __vallen, char *__data));
+ char *data;
+ };
/* External NIS client function references. */
extern int yp_bind __P ((__const char *));
extern void yp_unbind __P ((__const char *));
extern int yp_get_default_domain __P ((char **));
-extern int yp_match __P ((__const char *, __const char *, __const char *,
+extern int yp_match __P ((__const char *, __const char *, __const char *,
__const int, char **, int *));
-extern int yp_first __P ((__const char *, __const char *, char **,
+extern int yp_first __P ((__const char *, __const char *, char **,
int *, char **, int *));
-extern int yp_next __P ((__const char *, __const char *, __const char *,
+extern int yp_next __P ((__const char *, __const char *, __const char *,
__const int, char **, int *, char **, int *));
extern int yp_master __P ((__const char *, __const char *, char **));
extern int yp_order __P ((__const char *, __const char *, unsigned int *));
-extern int yp_all __P ((__const char *, __const char *,
+extern int yp_all __P ((__const char *, __const char *,
__const struct ypall_callback *));
extern __const char *yperr_string __P ((__const int));
extern __const char *ypbinderr_string __P ((__const int));
#endif
/* Exist only under BSD and Linux systems */
-extern int __yp_check __P ((char **));
+extern int __yp_check __P ((char **));
__END_DECLS
}
if (clnt_call (client, YPBINDPROC_DOMAIN,
- (xdrproc_t) xdr_domainname, &domain,
+ (xdrproc_t) xdr_domainname, (caddr_t) &domain,
(xdrproc_t) xdr_ypbind_resp,
- &ypbr, TIMEOUT) != RPC_SUCCESS)
+ (caddr_t) &ypbr, TIMEOUT) != RPC_SUCCESS)
{
clnt_destroy (client);
if (is_new)
}
static void *ypall_data;
-static int (*ypall_foreach) ();
+static int (*ypall_foreach) __P ((int status, char *key, int keylen,
+ char *val, int vallen, char *data));
static bool_t
__xdr_ypresp_all (XDR * xdrs, u_long * objp)
ypall_foreach = incallback->foreach;
ypall_data = (void *) incallback->data;
- result = clnt_call (clnt, YPPROC_ALL, (xdrproc_t) xdr_ypreq_nokey, &req,
- (xdrproc_t) __xdr_ypresp_all, &status, TIMEOUT);
+ result = clnt_call (clnt, YPPROC_ALL, (xdrproc_t) xdr_ypreq_nokey,
+ (caddr_t) &req, (xdrproc_t) __xdr_ypresp_all,
+ (caddr_t) &status, TIMEOUT);
if (result != RPC_SUCCESS)
{
/* Bash 2.0 gives us an environment variable containing flags
indicating ARGV elements that should not be considered arguments. */
-char *__getopt_nonoption_flags;
+/* Defined in getopt_init.c */
+extern char *__getopt_nonoption_flags;
+
static int nonoption_flags_max_len;
static int nonoption_flags_len;
#include "../stdio-common/_itoa.h"
-/* External variable to synchronize work. */
-extern char *__getopt_nonoption_flags;
+/* Variable to synchronize work. */
+char *__getopt_nonoption_flags;
extern pid_t __libc_pid;
routines := \
ctermid cuserid \
vfprintf vprintf printf_fp reg-printf printf-prs _itoa printf_fphex \
- fprintf printf snprintf sprintf asprintf dprintf \
+ printf_size fprintf printf snprintf sprintf asprintf dprintf \
vfscanf \
fscanf scanf sscanf \
perror psignal \
/* Internal header for parsing printf format strings.
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997 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
}
-/* This is defined in reg-printf.c. */
-extern printf_arginfo_function **__printf_arginfo_table;
+/* These are defined in reg-printf.c. */
+extern printf_arginfo_function *__printf_arginfo_table[];
+extern printf_function **__printf_function_table;
/* FORMAT must point to a '%' at the beginning of a spec. Fills in *SPEC
/* Get the format specification. */
spec->info.spec = (wchar_t) *format++;
- if (__printf_arginfo_table != NULL &&
- __printf_arginfo_table[spec->info.spec] != NULL)
+ if (__printf_function_table != NULL
+ && spec->info.spec <= UCHAR_MAX
+ && __printf_arginfo_table[spec->info.spec] != NULL)
/* We don't try to get the types for all arguments if the format
uses more than one. The normal case is covered though. */
spec->ndata_args = (*__printf_arginfo_table[spec->info.spec])
spec->ndata_args = 0;
break;
}
+ }
- if (spec->data_arg == -1 && spec->ndata_args > 0)
- {
- /* There are args consumed, but no positional spec.
- Use the next sequential arg position. */
- spec->data_arg = posn;
- posn += spec->ndata_args;
- nargs += spec->ndata_args;
- }
+ if (spec->data_arg == -1 && spec->ndata_args > 0)
+ {
+ /* There are args consumed, but no positional spec. Use the
+ next sequential arg position. */
+ spec->data_arg = posn;
+ nargs += spec->ndata_args;
}
if (spec->info.spec == L'\0')
-/* Copyright (C) 1991, 92, 93, 95, 96 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 95, 96, 97 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 PA_FLAG_PTR (1 << 11)
+
+/* Function which can be registered as `printf'-handlers. */
+
+/* Print floating point value using using abbreviations for the orders
+ of magnitude used for numbers ('k' for kilo, 'm' for mega etc). If
+ the format specifier is a uppercase character powers of 1000 are
+ used. Otherwise powers of 1024. */
+extern int printf_size __P ((FILE *__fp, __const struct printf_info *__info,
+ __const void *__const *args));
+
+/* This is the appropriate argument information function for `printf_size'. */
+extern int printf_size_info __P ((__const struct printf_info *__info,
+ size_t __n, int *__argtypes));
+
+
__END_DECLS
#endif /* printf.h */
--- /dev/null
+/* Print size value using units for orders of magnitude.
+ Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+ Based on a proposal by Larry McVoy <lm@sgi.com>.
+
+ 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 <ctype.h>
+#include <ieee754.h>
+#include <math.h>
+#include <printf.h>
+#ifdef USE_IN_LIBIO
+# include <libioP.h>
+#else
+# include <stdio.h>
+#endif
+
+
+/* This defines make it possible to use the same code for GNU C library and
+ the GNU I/O library. */
+#ifdef USE_IN_LIBIO
+# define PUT(f, s, n) _IO_sputn (f, s, n)
+# define PAD(f, c, n) _IO_padn (f, c, n)
+/* We use this file GNU C library and GNU I/O library. So make
+ names equal. */
+# undef putc
+# define putc(c, f) _IO_putc_unlocked (c, f)
+# define size_t _IO_size_t
+# define FILE _IO_FILE
+#else /* ! USE_IN_LIBIO */
+# define PUT(f, s, n) fwrite (s, 1, n, f)
+# define PAD(f, c, n) __printf_pad (f, c, n)
+ssize_t __printf_pad __P ((FILE *, char pad, int n)); /* In vfprintf.c. */
+#endif /* USE_IN_LIBIO */
+\f
+/* Macros for doing the actual output. */
+
+#define outchar(ch) \
+ do \
+ { \
+ register const int outc = (ch); \
+ if (putc (outc, fp) == EOF) \
+ return -1; \
+ ++done; \
+ } while (0)
+
+#define PRINT(ptr, len) \
+ do \
+ { \
+ register size_t outlen = (len); \
+ if (len > 20) \
+ { \
+ if (PUT (fp, ptr, outlen) != outlen) \
+ return -1; \
+ ptr += outlen; \
+ done += outlen; \
+ } \
+ else \
+ { \
+ while (outlen-- > 0) \
+ outchar (*ptr++); \
+ } \
+ } while (0)
+
+#define PADN(ch, len) \
+ do \
+ { \
+ if (PAD (fp, ch, len) != len) \
+ return -1; \
+ done += len; \
+ } \
+ while (0)
+\f
+/* Prototype for helper functions. */
+extern int __printf_fp (FILE *fp, const struct printf_info *info,
+ const void *const *args);
+
+\f
+int
+printf_size (FILE *fp, const struct printf_info *info, const void *const *args)
+{
+ /* Units for the both formats. */
+ static const char units[2][8] =
+ {
+ " kmgtps", /* For binary format. */
+ " KMGTPS" /* For decimal format. */
+ };
+ const char *tag = units[isupper (info->spec) != 0];
+ int divisor = isupper (info->spec) ? 1000 : 1024;
+
+ /* The floating-point value to output. */
+ union
+ {
+ union ieee754_double dbl;
+ union ieee854_long_double ldbl;
+ }
+ fpnum;
+ const void *ptr = &fpnum;
+
+ int negative = 0;
+
+ /* "NaN" or "Inf" for the special cases. */
+ const char *special = NULL;
+
+ struct printf_info fp_info;
+ int done = 0;
+
+
+ /* Fetch the argument value. */
+ if (info->is_long_double && sizeof (long double) > sizeof (double))
+ {
+ fpnum.ldbl.d = *(const long double *) args[0];
+
+ /* Check for special values: not a number or infinity. */
+ if (__isnanl (fpnum.ldbl.d))
+ {
+ special = "nan";
+ negative = 0;
+ }
+ else if (__isinfl (fpnum.ldbl.d))
+ {
+ special = "inf";
+
+ negative = fpnum.ldbl.d < 0;
+ }
+ else
+ while (fpnum.ldbl.d >= divisor && tag[1] != '\0')
+ {
+ fpnum.ldbl.d /= divisor;
+ ++tag;
+ }
+ }
+ else
+ {
+ fpnum.dbl.d = *(const double *) args[0];
+
+ /* Check for special values: not a number or infinity. */
+ if (__isnan (fpnum.dbl.d))
+ {
+ special = "nan";
+ negative = 0;
+ }
+ else if (__isinf (fpnum.dbl.d))
+ {
+ special = "inf";
+
+ negative = fpnum.dbl.d < 0;
+ }
+ else
+ while (fpnum.dbl.d >= divisor && tag[1] != '\0')
+ {
+ fpnum.dbl.d /= divisor;
+ ++tag;
+ }
+ }
+
+ if (special)
+ {
+ int width = info->prec > info->width ? info->prec : info->width;
+
+ if (negative || info->showsign || info->space)
+ --width;
+ width -= 3;
+
+ if (!info->left && width > 0)
+ PADN (' ', width);
+
+ if (negative)
+ outchar ('-');
+ else if (info->showsign)
+ outchar ('+');
+ else if (info->space)
+ outchar (' ');
+
+ PRINT (special, 3);
+
+ if (info->left && width > 0)
+ PADN (' ', width);
+
+ return done;
+ }
+
+ /* Prepare to print the number. We want to use `__printf_fp' so we
+ have to prepare a `printf_info' structure. */
+ fp_info.spec = 'f';
+ fp_info.prec = info->prec < 0 ? 3 : info->prec;
+ fp_info.is_long_double = info->is_long_double;
+ fp_info.is_short = info->is_short;
+ fp_info.is_long = info->is_long;
+ fp_info.alt = info->alt;
+ fp_info.space = info->space;
+ fp_info.left = info->left;
+ fp_info.showsign = info->showsign;
+ fp_info.group = info->group;
+ fp_info.extra = info->extra;
+ fp_info.pad = info->pad;
+
+ if (fp_info.left && fp_info.pad == L' ')
+ {
+ /* We must do the padding ourself since the unit character must
+ be placed before the padding spaces. */
+ fp_info.width = 0;
+
+ done = __printf_fp (fp, &fp_info, &ptr);
+ if (done > 0)
+ {
+ outchar (*tag);
+ if (info->width > done)
+ PADN (' ', info->width - done);
+ }
+ }
+ else
+ {
+ /* We can let __printf_fp do all the printing and just add our
+ unit character afterwards. */
+ fp_info.width = info->width - 1;
+
+ done = __printf_fp (fp, &fp_info, &ptr);
+ if (done > 0)
+ outchar (*tag);
+ }
+
+ return done;
+}
+\f
+/* This is the function used by `vfprintf' to determine number and
+ type of the arguments. */
+int
+printf_size_info (const struct printf_info *info, size_t n, int *argtypes)
+{
+ /* We need only one double or long double argument. */
+ if (n >= 1)
+ argtypes[0] = PA_DOUBLE | (info->is_long_double ? PA_FLAG_LONG_DOUBLE : 0);
+
+ return 1;
+}
is_long = sizeof (size_t) > sizeof (unsigned int);
JUMP (*++f, step4_jumps);
-
/* Process current format. */
while (1)
{
goto do_positional;
}
+ /* The format is correctly handled. */
+ ++nspecs_done;
+
/* Look for next format specifier. */
f = find_spec ((end_of_spec = ++f), &mbstate);
# define UNLOCK
#endif
+/* In the GNU C library we must keep the namespace clean. */
+#ifdef _LIBC
+# define clearenv __clearenv
+#endif
+
+
/* If this variable is not a null pointer we allocated the current
environment. */
static char **last_environ;
return 0;
}
+#ifdef _LIBC
+# undef clearenv
+weak_alias (__clearenv, clearenv)
+#endif
#include <features.h>
#include <sys/cdefs.h>
-#include <endian.h>
/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
-#if __BYTE_ORDER == __BIG_ENDIAN
-#define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
-#endif
-#if __BYTE_ORDER == __LITTLE_ENDIAN
#define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
-#endif
#define __huge_val_t union { unsigned char __c[8]; double __d; }
#ifdef __GNUC__
#ifdef __USE_ISOC9X
-#if __BYTE_ORDER == __BIG_ENDIAN
-#define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 }
-#endif
-#if __BYTE_ORDER == __LITTLE_ENDIAN
#define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f }
-#endif
#define __huge_valf_t union { unsigned char __c[4]; float __f; }
#ifdef __GNUC__
#endif /* GCC. */
-#if __BYTE_ORDER == __BIG_ENDIAN
-#define __HUGE_VALL_bytes { 0x7f, 0xff, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-#endif
-#if __BYTE_ORDER == __LITTLE_ENDIAN
#define __HUGE_VALL_bytes { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 }
-#endif
#define __huge_vall_t union { unsigned char __c[12]; long double __ld; }
#ifdef __GNUC__
fldl 12(%esp)
fldl 4(%esp)
fscale
+ fstp %st(1)
ret
END(__ieee754_scalb)
flds 8(%esp)
flds 4(%esp)
fscale
+ fstp %st(1)
ret
END(__ieee754_scalbf)
fldt 16(%esp)
fldt 4(%esp)
fscale
+ fstp %st(1)
ret
END(__ieee754_scalbl)
case 1: {
u_int32_t sz;
GET_LDOUBLE_EXP(sz,z);
- SET_LDOUBLE_EXP(z,sy ^ 0x8000);
+ SET_LDOUBLE_EXP(z,sz ^ 0x8000);
}
return z ; /* atan(-,+) */
case 2: return pi-(z-pi_lo);/* atan(+,-) */
t = x*x;
w =__log1pl(fabsl(x)+t/(one+__ieee754_sqrtl(one+t)));
}
- if(hx>0x7fff) return w; else return -w;
+ if(hx>0x8000) return -w; else return w;
}
weak_alias (__asinhl, asinhl)
--- /dev/null
+/* Return value of complex exponential function for float complex value.
+ 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 <complex.h>
+#include <math.h>
+
+
+__complex__ float
+__cexpf (__complex__ float x)
+{
+ __complex__ float retval;
+
+ if (isfinite (__real__ x))
+ {
+ if (isfinite (__imag__ x))
+ {
+ retval = __expf (__real__ x) * (__cosf (__imag__ x)
+ + 1i * __sinf (__imag__ x));
+ }
+ else
+ /* If the imaginary part is +-inf or NaN and the real part is
+ not +-inf the result is NaN + iNan. */
+ retval = __nanf ("") + 1.0i * __nanf ("");
+ }
+ else if (__isinff (__real__ x))
+ {
+ if (isfinite (__imag__ x))
+ {
+ if (signbit (__real__ x) == 0 && __imag__ x == 0.0)
+ retval = HUGE_VALF;
+ else
+ retval = ((signbit (__real__ x) ? 0.0 : HUGE_VALF)
+ * (__cosf (__imag__ x) + 1i * __sinf (__imag__ x)));
+ }
+ else if (signbit (__real__ x))
+ retval = HUGE_VALF + 1.0i * __nanf ("");
+ else
+ retval = 0.0;
+ }
+ else
+ /* If the real part is NaN the result is NaN + iNan. */
+ retval = __nanf ("") + 1.0i * __nanf ("");
+
+ return retval;
+}
+weak_alias (__cexpf, cexpf)
--- /dev/null
+/* Return value of complex exponential function for long double complex value.
+ 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 <complex.h>
+#include <math.h>
+
+
+__complex__ long double
+__cexpl (__complex__ long double x)
+{
+ __complex__ long double retval;
+
+ if (isfinite (__real__ x))
+ {
+ if (isfinite (__imag__ x))
+ {
+ retval = __expl (__real__ x) * (__cosl (__imag__ x)
+ + 1i * __sinl (__imag__ x));
+ }
+ else
+ /* If the imaginary part is +-inf or NaN and the real part is
+ not +-inf the result is NaN + iNan. */
+ retval = __nanl ("") + 1.0i * __nanl ("");
+ }
+ else if (__isinfl (__real__ x))
+ {
+ if (isfinite (__imag x))
+ {
+ if (signbit (__real__ x) == 0 && __imag__ x == 0.0)
+ retval = HUGE_VALL;
+ else
+ retval = ((signbit (__real__ x) ? 0.0 : HUGE_VALL)
+ * (__cosl (__imag__ x) + 1i * __sinl (__imag__ x)));
+ }
+ else if (signbit (__real__ x))
+ retval = HUGE_VALL + 1.0i * __nanl ("");
+ else
+ retval = 0.0;
+ }
+ else
+ /* If the real part is NaN the result is NaN + iNan. */
+ retval = __nanl ("") + 1.0i * __nanl ("");
+
+ return retval;
+}
+weak_alias (__cexpl, cexpl)
{
int32_t exp;
GET_LDOUBLE_EXP(exp,x);
- return (int)((u_int32_t)((exp&0x7fff)-0x7fff)>>15);
+ return (int)((u_int32_t)((exp&0x7fff)-0x7fff)>>31);
}
weak_alias (__finitel, finitel)
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+ Fixed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
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
int
__fpclassifyl (long double x)
{
- u_int32_t ex, hx, lx;
+ u_int32_t ex, hx, lx, m;
int retval = FP_NORMAL;
GET_LDOUBLE_WORDS (ex, hx, lx, x);
- hx &= 0x7fffffff;
- hx |= lx;
+ m = (hx & 0x7fffffff) | lx;
ex &= 0x7fff;
- if ((ex | hx) == 0)
+ if ((ex | m) == 0)
retval = FP_ZERO;
- else if (ex == 0)
+ else if (ex == 0 && (hx & 0x80000000) == 0)
retval = FP_SUBNORMAL;
else if (ex == 0x7fff)
- retval = hx != 0 ? FP_NAN : FP_INFINITE;
+ retval = m != 0 ? FP_NAN : FP_INFINITE;
return retval;
}
double
-nan (const char *tagp)
+__nan (const char *tagp)
{
#ifdef HANDLE_TAGP
/* If we ever should have use of the TAGP parameter we will use the
return nan_value.d;
#endif
}
+weak_alias (__nan, nan)
float
-nanf (const char *tagp)
+__nanf (const char *tagp)
{
#ifdef HANDLE_TAGP
/* If we ever should have use of the TAGP parameter we will use the
return nan_value.f;
#endif
}
+weak_alias (__nanf, nanf)
long double
-nanl (const char *tagp)
+__nanl (const char *tagp)
{
#ifdef HANDLE_TAGP
/* If we ever should have use of the TAGP parameter we will use the
return nan_value.d;
#endif
}
+weak_alias (__nanl, nanl)
__inline_mathop(__rint, int)
__inline_mathop(__expm1, etoxm1)
__inline_mathop(__log1p, lognp1)
-__inline_mathop(__logb, log2)
__inline_mathop(__significand, getman)
__inline_mathop(__log2, log2)
__inline_mathop(rint, int)
__inline_mathop(expm1, etoxm1)
__inline_mathop(log1p, lognp1)
-__inline_mathop(logb, log2)
#endif
#ifdef __USE_MISC
return __result; \
} \
\
-__m81_defun (float_type, __CONCAT(__ieee754_atan2,s), \
- (float_type __y, float_type __x)) \
-{ \
- float_type __pi, __pi_2; \
- \
- __asm ("fmovecr%.x %#0, %0" : "=f" (__pi)); \
- __asm ("fscale%.w %#-1, %0" : "=f" (__pi_2) : "0" (__pi)); \
- if (__x > 0) \
- { \
- if (__y > 0) \
- { \
- if (__x > __y) \
- return __m81_u(__CONCAT(__atan,s)) (__y / __x); \
- else \
- return __pi_2 - __m81_u(__CONCAT(__atan,s)) (__x / __y); \
- } \
- else \
- { \
- if (__x > -__y) \
- return __m81_u(__CONCAT(__atan,s)) (__y / __x); \
- else \
- return -__pi_2 - __m81_u(__CONCAT(__atan,s)) (__x / __y); \
- } \
- } \
- else \
- { \
- if (__y > 0) \
- { \
- if (-__x < __y) \
- return __pi + __m81_u(__CONCAT(__atan,s)) (__y / __x); \
- else \
- return __pi_2 - __m81_u(__CONCAT(__atan,s)) (__x / __y); \
- } \
- else \
- { \
- if (-__x > -__y) \
- return -__pi + __m81_u(__CONCAT(__atan,s)) (__y / __x); \
- else \
- return -__pi_2 - __m81_u(__CONCAT(__atan,s)) (__x / __y); \
- } \
- } \
-} \
- \
-__m81_defun (float_type, __CONCAT(__ieee754_pow,s), \
- (float_type __x, float_type __y)) \
-{ \
- float_type __result; \
- if (__x == 0.0) \
- { \
- if (__y <= 0.0) \
- __result = 0.0 / 0.0; \
- else \
- __result = 0.0; \
- } \
- else if (__y == 0.0 || __x == 1.0) \
- __result = 1.0; \
- else if (__y == 1.0) \
- __result = __x; \
- else if (__y == 2.0) \
- __result = __x * __x; \
- else if (__x == 10.0) \
- __asm("ftentox%.x %1, %0" : "=f" (__result) : "f" (__y)); \
- else if (__x == 2.0) \
- __asm("ftwotox%.x %1, %0" : "=f" (__result) : "f" (__y)); \
- else if (__x < 0.0) \
- { \
- float_type __temp = __m81_u (__CONCAT(__rint,s)) (__y); \
- if (__y == __temp) \
- { \
- int __i = (int) __y; \
- __result = (__m81_u(__CONCAT(__ieee754_exp,s)) \
- (__y * __m81_u(__CONCAT(__ieee754_log,s)) (-__x))); \
- if (__i & 1) \
- __result = -__result; \
- } \
- else \
- __result = 0.0 / 0.0; \
- } \
- else \
- __result = (__m81_u(__CONCAT(__ieee754_exp,s)) \
- (__y * __m81_u(__CONCAT(__ieee754_log,s)) (__x))); \
- return __result; \
-} \
- \
__m81_defun (float_type, __CONCAT(__ieee754_scalb,s), \
(float_type __x, float_type __n)) \
{ \
-#define FUNC __ieee754_atan2
-#include <e_fmod.c>
+/* Copyright (C) 1997 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
+ 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. */
+
+#define __LIBC_M81_MATH_INLINES
+#include <math.h>
+#include "math_private.h"
+
+#ifndef SUFF
+#define SUFF
+#endif
+#ifndef float_type
+#define float_type double
+#endif
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
+float_type
+__CONCATX(__ieee754_atan2,SUFF) (float_type y, float_type x)
+{
+ float_type pi, pi_2, z;
+
+ __asm ("fmovecr%.x %#0, %0" : "=f" (pi));
+ __asm ("fscale%.w %#-1, %0" : "=f" (pi_2) : "0" (pi));
+ if (x != x || y != y)
+ z = x + y;
+ else if (y == 0)
+ {
+ if (signbit (x))
+ z = signbit (y) ? -pi : pi;
+ else
+ z = y;
+ }
+ else if (__m81_u(__CONCATX(__isinf,SUFF)) (x))
+ {
+ if (__m81_u(__CONCATX(__isinf,SUFF)) (y))
+ {
+ float_type pi_4;
+ __asm ("fscale%.w %#-1, %0" : "=f" (pi_4) : "0" (pi_2));
+ z = x > 0 ? pi_4 : 3 * pi_4;
+ }
+ else
+ z = x > 0 ? 0 : pi;
+ if (signbit (y))
+ z = -z;
+ }
+ else if (__m81_u(__CONCATX(__isinf,SUFF)) (y))
+ z = y > 0 ? pi_2 : -pi_2;
+ else if (x > 0)
+ {
+ if (y > 0)
+ {
+ if (x > y)
+ z = __m81_u(__CONCATX(__atan,SUFF)) (y / x);
+ else
+ z = pi_2 - __m81_u(__CONCATX(__atan,SUFF)) (x / y);
+ }
+ else
+ {
+ if (x > -y)
+ z = __m81_u(__CONCATX(__atan,SUFF)) (y / x);
+ else
+ z = -pi_2 - __m81_u(__CONCATX(__atan,SUFF)) (x / y);
+ }
+ }
+ else
+ {
+ if (y < 0)
+ {
+ if (-x > y)
+ z = -pi + __m81_u(__CONCATX(__atan,SUFF)) (y / x);
+ else
+ z = -pi_2 - __m81_u(__CONCATX(__atan,SUFF)) (x / y);
+ }
+ else
+ {
+ if (-x > y)
+ z = pi + __m81_u(__CONCATX(__atan,SUFF)) (y / x);
+ else
+ z = pi_2 - __m81_u(__CONCATX(__atan,SUFF)) (x / y);
+ }
+ }
+ return z;
+}
-#define FUNC __ieee754_atan2f
-#include <e_fmodf.c>
+#define SUFF f
+#define float_type float
+#include <e_atan2.c>
-#define FUNC __ieee754_atan2l
-#include <e_fmodl.c>
+#define SUFF l
+#define float_type long double
+#include <e_atan2.c>
-#define FUNC __ieee754_pow
-#include <e_fmod.c>
+/* Copyright (C) 1997 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
+ 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. */
+
+#define __LIBC_M81_MATH_INLINES
+#include <math.h>
+#include "math_private.h"
+
+#ifndef SUFF
+#define SUFF
+#endif
+#ifndef float_type
+#define float_type double
+#endif
+
+#define __CONCATX(a,b) __CONCAT(a,b)
+
+float_type
+__CONCATX(__ieee754_pow,SUFF) (float_type x, float_type y)
+{
+ float_type z;
+ float_type ax;
+
+ if (y == 0.0)
+ return 1.0;
+ if (x != x || y != y)
+ return x + y;
+
+ if (__m81_u(__CONCATX(__isinf,SUFF)) (y))
+ {
+ ax = __CONCATX(fabs,SUFF) (x);
+ if (ax == 1)
+ return y - y;
+ if (ax > 1)
+ return y > 0 ? y : 0;
+ else
+ return y < 0 ? -y : 0;
+ }
+
+ if (__CONCATX(fabs,SUFF) (y) == 1)
+ return y > 0 ? x : 1 / x;
+
+ if (y == 2)
+ return x * x;
+ if (y == 0 && x >= 0)
+ return __m81_u(__CONCATX(__ieee754_sqrt,SUFF)) (x);
+
+ if (x == 10.0)
+ {
+ __asm ("ftentox%.x %1, %0" : "=f" (z) : "f" (y));
+ return z;
+ }
+ if (x == 2.0)
+ {
+ __asm ("ftwotox%.x %1, %0" : "=f" (z) : "f" (y));
+ return z;
+ }
+
+ ax = __CONCATX(fabs,SUFF) (x);
+ if (__m81_u(__CONCATX(__isinf,SUFF)) (x) || x == 0 || ax == 1)
+ {
+ z = ax;
+ if (y < 0)
+ z = 1 / z;
+ if (signbit (x))
+ {
+ float_type temp = __m81_u (__CONCATX(__rint,SUFF)) (y);
+ if (y != temp)
+ {
+ if (x == -1)
+ z = (z - z) / (z - z);
+ }
+ else
+ {
+ if (sizeof (float_type) == sizeof (float))
+ {
+ long i = (long) y;
+ if (i & 1)
+ z = -z;
+ }
+ else
+ {
+ long long i = (long long) y;
+ if ((float_type) i == y && i & 1)
+ z = -z;
+ }
+ }
+ }
+ return z;
+ }
+
+ if (x < 0.0)
+ {
+ float_type temp = __m81_u (__CONCATX(__rint,SUFF)) (y);
+ if (y == temp)
+ {
+ long long i = (long long) y;
+ z = (__m81_u(__CONCATX(__ieee754_exp,SUFF))
+ (y * __m81_u(__CONCATX(__ieee754_log,SUFF)) (-x)));
+ if (sizeof (float_type) == sizeof (float))
+ {
+ long i = (long) y;
+ if (i & 1)
+ z = -z;
+ }
+ else
+ {
+ /* If the conversion to long long was inexact assume that y
+ is an even integer. */
+ if ((float_type) i == y && i & 1)
+ z = -z;
+ }
+ }
+ else
+ z = (x - x) / (x - x);
+ }
+ else
+ z = (__m81_u(__CONCATX(__ieee754_exp,SUFF))
+ (y * __m81_u(__CONCATX(__ieee754_log,SUFF)) (x)));
+ return z;
+}
-#define FUNC __ieee754_powf
-#include <e_fmodf.c>
+#define SUFF f
+#define float_type float
+#include <e_pow.c>
-#define FUNC __ieee754_powl
-#include <e_fmodl.c>
+#define SUFF l
+#define float_type long double
+#include <e_pow.c>
-#define FUNC logb
+#define FUNC exp2
#include <s_atan.c>
-#define FUNC logbf
+#define FUNC exp2f
#include <s_atanf.c>
-#define FUNC logbl
+#define FUNC exp2l
#include <s_atanl.c>
--- /dev/null
+#define FUNC log2
+#include <s_atan.c>
--- /dev/null
+#define FUNC log2f
+#include <s_atanf.c>
--- /dev/null
+#define FUNC log2l
+#include <s_atanl.c>
#include <features.h>
#include <sys/cdefs.h>
-#include <endian.h>
/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
-#if __BYTE_ORDER == __BIG_ENDIAN
#define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
-#endif
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
-#endif
#define __huge_val_t union { unsigned char __c[8]; double __d; }
#ifdef __GNUC__
#ifdef __USE_ISOC9X
-#if __BYTE_ORDER == __BIG_ENDIAN
#define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 }
-#endif
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f }
-#endif
#define __huge_valf_t union { unsigned char __c[4]; float __f; }
#ifdef __GNUC__
#endif /* GCC. */
-#if __BYTE_ORDER == __BIG_ENDIAN
#define __HUGE_VALL_bytes { 0x7f, 0xff, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-#endif
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define __HUGE_VALL_bytes { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 }
-#endif
#define __huge_vall_t union { unsigned char __c[12]; long double __ld; }
#ifdef __GNUC__
-/* The Linux kernel header defines `struct iovec' for us. */
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-#include <linux/uio.h>
+ 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. */
+
+#ifndef _IOVEC_H
+
+#define _IOVEC_H 1
+
+#include <sys/types.h>
+
+
+/* We should normally use the Linux kernel header file to define this
+ type and macros but this calls for trouble because of the header
+ includes other kernel headers. */
+
+/* Size of object which can be written atomically.
+
+ This macro has different values in different kernel versions. The
+ latest versions of ther kernel use 1024 and this is good choice. Since
+ the C library implementation of readv/writev is able to emulate the
+ functionality even if the currently running kernel does not support
+ this large value the readv/writev call will not fail because of this. */
+#define UIO_MAXIOV 1024
+
+
+/* Structure for scatter/gather I/O. */
+struct iovec
+ {
+ void *iov_base; /* Pointer to data. */
+ size_t iov_len; /* Length of data. */
+ };
+
+#endif /* iovec.h */
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-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 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.
+ 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. */
+ 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 <sys/msg.h>
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-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 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.
+ 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. */
+ 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 <sys/msg.h>
#include <stdlib.h> /* for definition of NULL */
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-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 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.
+ 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. */
+ 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 <sys/msg.h>
int msqid;
void *msgp;
size_t msgsz;
- long msgtyp;
+ long int msgtyp;
int msgflg;
{
/* The problem here is that Linux' calling convention only allows up to
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-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 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.
+ 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. */
+ 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 <sys/msg.h>
u_int8_t ipt_len; /* size of structure (variable) */
u_int8_t ipt_ptr; /* index of current entry */
#if __BYTE_ORDER == __LITTLE_ENDIAN
- u_int8_t ipt_flg:4, /* flags, see below */
+ u_int8_t ipt_flg:4; /* flags, see below */
u_int8_t ipt_oflw:4; /* overflow counter */
#endif
#if __BYTE_ORDER == __BIG_ENDIAN
- u_int8_t ipt_oflw:4, /* overflow counter */
+ u_int8_t ipt_oflw:4; /* overflow counter */
u_int8_t ipt_flg:4; /* flags, see below */
#endif
u_int32_t data[9];
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-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 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.
+ 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. */
+ 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 <sys/sem.h>
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-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 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.
+ 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. */
+ 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 <sys/sem.h>
#include <stdlib.h> /* for definition of NULL */
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-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 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.
+ 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. */
+ 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 <sys/sem.h>
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-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 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.
+ 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. */
+ 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 <sys/shm.h>
segment of the calling process. SHMADDR and SHMFLG determine how
and where the segment is attached. */
-char *
+void *
shmat (shmid, shmaddr, shmflg)
int shmid;
- char *shmaddr;
+ const void *shmaddr;
int shmflg;
{
int retval;
unsigned long raddr;
retval = __ipc (IPCOP_shmat, shmid, shmflg, (int) &raddr, shmaddr);
- return retval < 0 ? (char *) retval : (char *) raddr;
+ return retval < 0 ? (void *) retval : (void *) raddr;
}
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-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 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.
+ 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. */
+ 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 <sys/shm.h>
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-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 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.
+ 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. */
+ 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 <sys/shm.h>
int
shmdt (shmaddr)
- char *shmaddr;
+ const void *shmaddr;
{
return __ipc (IPCOP_shmdt, 0, 0, 0, shmaddr);
}
-/* Copyright (C) 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-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 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.
+ 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. */
+ 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 <sys/shm.h>
#include <stdlib.h> /* for definition of NULL */
+/* Copyright (C) 1996, 1997 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
+ 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. */
+
+#ifndef _SYS_KD_H
+#define _SYS_KD_H 1
+
+/* Make sure the <linux/types.h> header is not loaded. */
+#define _LINUX_TYPES_H 1
+
#include <linux/kd.h>
+
+#endif /* sys/kd.h */
-/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
__BEGIN_DECLS
/* The following System V style IPC functions implement a shared memory
- facility. The definition is found in XPG2. */
+ facility. The definition is found in XPG4.2. */
/* Shared memory control operation. */
extern int shmctl __P ((int __shmid, int __cmd, struct shmid_ds *__buf));
extern int shmget __P ((key_t __key, int __size, int __shmflg));
/* Attach shared memory segment. */
-extern char *shmat __P ((int __shmid, char *__shmaddr, int __shmflg));
+extern void *shmat __P ((int __shmid, __const void *__shmaddr, int __shmflg));
/* Detach shared memory segment. */
-extern int shmdt __P ((char *__shmaddr));
+extern int shmdt __P ((__const void *__shmaddr));
__END_DECLS