From cc3fa755128c70f8afc2d604936f33e4d7d652d8 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 12 Nov 1997 00:06:02 +0000 Subject: Update. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1997-11-11 21:30 Ulrich Drepper * include/sys/stat.h: Define stat, fstat, lstat and *64 variants as macros so the the library compiles correctly even without optimization. * io/fstat.c: Undef fstat. * io/fstat64.c: Undef fstat64 * io/lstat.c: Undef lstat. * io/lstat64.c: Undef lstat64 * io/stat.c: Undef stat. * io/stat64.c: Undef stat64 * io/fts.c: Include to get macro definitions. * io/ftw.c: Likewise. * io/getdirname.c: Likewise. * Makefile (install): Run test-installation.pl if possible. * db2/Makefile: Update from db-2.3.12. * db2/db.h: Likewise. * db2/db_int.h: Likewise. * db2/btree/bt_cursor.c: Likewise. * db2/btree/bt_delete.c: Likewise. * db2/btree/bt_open.c: Likewise. * db2/btree/bt_put.c: Likewise. * db2/btree/bt_rec.c: Likewise. * db2/btree/bt_recno.c: Likewise. * db2/btree/bt_search.c: Likewise. * db2/btree/bt_split.c: Likewise. * db2/btree/bt_stat.c: Likewise. * db2/btree/btree.src: Likewise. * db2/btree/btree_auto.c: Likewise. * db2/btree/bt_cursor.c: Likewise. * db2/btree/bt_delete.c: Likewise. * db2/btree/bt_open.c: Likewise. * db2/btree/bt_put.c: Likewise. * db2/btree/bt_rec.c: Likewise. * db2/btree/bt_recno.c: Likewise. * db2/btree/bt_search.c: Likewise. * db2/btree/bt_split.c: Likewise. * db2/btree/bt_stat.c: Likewise. * db2/btree/btree.src: Likewise. * db2/btree/btree_auto.c: Likewise. * db2/common/db_appinit.c: Likewise. * db2/common/db_apprec.c: Likewise. * db2/common/db_byteorder.c: Likewise. * db2/common/db_region.c: Likewise. * db2/db/db.c: Likewise * db2/db/db.src: Likewise * db2/db/db_auto.c: Likewise * db2/db/db_dispatch.c: Likewise * db2/db/db_dup.c: Likewise * db2/db/db_overflow.c: Likewise * db2/db/db_pr.c: Likewise * db2/db/db_rec.c: Likewise * db2/db/db_ret.c: Likewise * db2/db/db_thread.c: Likewise * db2/db185/db185.c: Likewise. * db2/hash/hash.c: Likewise. * db2/hash/hash.src: Likewise. * db2/hash/hash_auto.c: Likewise. * db2/hash/hash_dup.c: Likewise. * db2/hash/hash_page.c: Likewise. * db2/hash/hash_rec.c: Likewise. * db2/include/btree_auto.h: Likewise. * db2/include/btree_ext.h: Likewise. * db2/include/clib_ext.h: Likewise. * db2/include/common_ext.h: Likewise. * db2/include/db.h.src: Likewise. * db2/include/db_am.h: Likewise. * db2/include/db_auto.h: Likewise. * db2/include/db_cxx.h: Likewise. * db2/include/db_ext.h: Likewise. * db2/include/db_int.h.src: Likewise. * db2/include/hash.h: Likewise. * db2/include/hash_auto.h: Likewise. * db2/include/hash_ext.h: Likewise. * db2/include/lock.h: Likewise. * db2/include/lock_ext.h: Likewise. * db2/include/log.h: Likewise. * db2/include/log_ext.h: Likewise. * db2/include/mp.h: Likewise. * db2/include/mp_ext.h: Likewise. * db2/include/mutex_ext.h: Likewise. * db2/include/os_ext.h: Likewise. * db2/include/os_func.h: Likewise. * db2/include/txn.h: Likewise. * db2/include/txn_ext.h: Likewise. * db2/lock/lock.c: Likewise. * db2/lock/lock_deadlock.c: Likewise. * db2/log/log.c: Likewise. * db2/log/log_archive.c: Likewise. * db2/log/log_auto.c: Likewise. * db2/log/log_findckp.c: Likewise. * db2/log/log_get.c: Likewise. * db2/log/log_put.c: Likewise. * db2/log/log_rec.c: Likewise. * db2/log/log_register.c: Likewise. * db2/mp/mp_bh.c: Likewise. * db2/mp/mp_fget.c: Likewise. * db2/mp/mp_fopen.c: Likewise. * db2/mp/mp_fput.c: Likewise. * db2/mp/mp_fset.c: Likewise. * db2/mp/mp_open.c: Likewise. * db2/mp/mp_pr.c: Likewise. * db2/mp/mp_region.c: Likewise. * db2/mp/mp_sync.c: Likewise. * db2/mutex/mutex.c: Likewise. * db2/os/os_abs.c: Likewise. * db2/os/os_dir.c: Likewise. * db2/os/os_fid.c: Likewise. * db2/os/os_fsync.c: Likewise. * db2/os/os_func.c: Likewise. * db2/os/os_map.c: Likewise. * db2/os/os_oflags.c: Likewise. * db2/os/os_open.c: Likewise. * db2/os/os_rpath.c: Likewise. * db2/os/os_rw.c: Likewise. * db2/os/os_seek.c: Likewise. * db2/os/os_sleep.c: Likewise. * db2/os/os_stat.c: Likewise. * db2/os/os_unlink.c: Likewise. * db2/progs/db_deadlock/db_deadlock.c: Likewise. * db2/progs/db_dump/db_dump.c: Likewise. * db2/progs/db_load/db_load.c: Likewise. * db2/progs/db_recover/db_recover.c: Likewise. * db2/progs/db_stat/db_stat.c: Likewise. * db2/txn/txn.c: Likewise. * db2/txn/txn_auto.c: Likewise. * db2/txn/txn_rec.c: Likewise. * db2/os/db_os_abs.c: Removed. * db2/os/db_os_dir.c: Removed. * db2/os/db_os_fid.c: Removed. * db2/os/db_os_lseek.c: Removed. * db2/os/db_os_mmap.c: Removed. * db2/os/db_os_open.c: Removed. * db2/os/db_os_rw.c: Removed. * db2/os/db_os_sleep.c: Removed. * db2/os/db_os_stat.c: Removed. * db2/os/db_os_unlink.c: Removed. * libio/stdio.h (fopen): Add __restrict to parameters. * manual/process.texi (system): Describe behaviour for NULL argument. * stdio-common/printf-parse.h: Parse hh modifier. * stdio-common/vfprintf.c: Handle hh modifier. * stdio-common/vfscanf.c: Likewise. * manual/stdio.texi: Describe hh modifier for scanf/printf. * math/complex.h: Don't define _Imaginary_I, but instead _Complex_I. gcc does no yet know the `imaginary' keyword. * math/test-math.c: Add little test for know gcc bug. * math/tgmath.h: Make complex versions of log10() only available if __USE_GNU. * stdlib/test-canon.c: Fix typo. * sysdeps/generic/setenv.c: Avoid compilation warnings. Reported by Jim Meyering. * sysdeps/generic/bits/errno.h: EILSEQ is an ISO C error number. * sysdeps/mach/hurd/bits/errno.h: Likewise. * sysdeps/standalone/bits/errno.h: Likewise. * sysdeps/unix/sysv/linux/bits/errno.h: Likewise. * sysdeps/i386/i586/memcpy.S: New file. * sysdeps/i386/i586/mempcpy.S: New file. * sysdeps/i386/i586/memset.S: Fix typo. * sysdeps/posix/getcwd.c: Define HAVE_MEMPCPY for _LIBC. Add casts. * sysdeps/posix/system.c: Add comment to explain code. * sysdeps/wordsize-32/inttypes.h: Include for wchar_t. Define PTRDIFF_{MIN,MAX}, SIG_ATOMIC_{MIN,MAX}, SIZE_MAX, WCHAR_{MIN,MAX}, WINT_{MIN,MAX}. Define wcstoimax, wcstoumax. * sysdeps/wordsize-64/inttypes.h: Likewise. * wcsmbs/wchar.h: Define WCHAR_{MIN,MAX} if not already defined. Declare __wcsto{l,ul,ll,ull}_internal only if not already done. * time/Makefile (routines): Add strfxtime. * time/strftime.c: Implement %F and %f format. * time/strfxtime.c: New file. * time/time.h: Define new types and symbols from ISO C 9X. * time/mktime.c: Little comment correction. 1997-11-10 Andreas Jaeger * sysdeps/libm-ieee754/s_sincosl.c: Fix typo. * sysdeps/libm-ieee754/s_tanl.c: Fix typo. * sysdeps/libm-ieee754/s_floorl.c: Correct typos. * sysdeps/libm-ieee754/e_remainderl.c: Replace EXTRACT_LDOUBLE_WORDS by GET_LDOUBLE_WORDS. * sysdeps/libm-ieee754/e_atan2l.c: Replace EXTRACT_LDOUBLE_WORDS by GET_LDOUBLE_WORDS. * sysdeps/libm-ieee754/s_scalbnl.c: Replace ";" by "," for correct variable declaration. * sysdeps/libm-ieee754/s_scalblnl.c: Likewise. * sysdeps/libm-ieee754/s_lrint.c (__lrint): Correct function. * math/libm-test.c (sqrt_test): Add test for sqrt (0.25). (asin_test): Add more test. 1997-11-10 23:34 Ulrich Drepper * sysdeps/libm-ieee754/e_asin.c: Add braces to make code clearer and to not confuse the poor compiler. * sysdeps/libm-ieee754/e_asinf.c: Likewise. Reported by vertex@cagent.com. 1997-11-09 Andreas Schwab * elf/dl-lookup.c (do_lookup): Don't accept the base version if we require a specific one. * libio/oldfreopen.c: Bind old symbols to version GLIBC_2.0. * libio/oldiofopen.c: Likewise. * libio/oldstdfiles.c: Likewise. * libc.map: Export them. 1997-11-10 07:40 H.J. Lu * stdlib/exit.c (exit): Handle recursive calls to exit (). 1997-11-09 Andreas Schwab * sysdeps/m68k/fpu/s_llrint.c: Fixed to take double argument instead of long double. * sysdeps/m68k/fpu/s_llrintf.c: New file. * sysdeps/m68k/fpu/s_llrintl.c: New file. * sysdeps/libm-ieee754/s_llrint.c: Make compilable and fix overflow condition. * sysdeps/libm-ieee754/s_llrintf.c: Fix overflow condition. * sysdeps/libm-ieee754/s_llrintl.c: Likewise. * sysdeps/libm-ieee754/s_llround.c: Likewise. * sysdeps/libm-ieee754/s_llroundf.c: Likewise. * sysdeps/libm-ieee754/s_llroundl.c: Likewise. * sysdeps/libm-ieee754/s_lrint.c: Likewise. * sysdeps/libm-ieee754/s_lrintf.c: Likewise. * sysdeps/libm-ieee754/s_lrintl.c: Likewise. * sysdeps/libm-ieee754/s_lround.c: Likewise. * sysdeps/libm-ieee754/s_lroundf.c: Likewise. * sysdeps/libm-ieee754/s_lroundl.c: Likewise. * math/libm-test.c: Test all three variants of lrint and llrint. Fix typos in lround and llround tests. Add tests for boundary cases for lrint and llround. 1997-11-08 Andreas Schwab * manual/arith.texi: Misc doc fixes. * manual/ctype.texi: Likewise. * manual/pattern.texi: Likewise. * manual/terminal.texi: Likewise. 1997-11-08 Andreas Schwab * sysdeps/unix/sysv/linux/xstatconv.c: Use struct assignment instead of memcpy to let the compiler use whatever it regards as optimal. * sysdeps/unix/sysv/linux/alpha/xstatconv.c: Likewise. 1997-11-08 Andreas Schwab * sysdeps/unix/sysv/linux/Makefile (sysdep_headers) [$(subdir)=misc]: Add sys/prctl.h. * sysdeps/unix/sysv/linux/Dist: Distribute it. 1997-11-08 Andreas Schwab * io/ftwtest-sh: Don't use the unknown which command, instead try pwd as /bin/pwd and /usr/bin/pwd. 1997-11-08 Andreas Schwab * manual/maint.texi (Tools for Installation): Don't recommend broken version 3.76.1 of make. (Porting): Fix wording. 1997-11-06 06:13 H.J. Lu * config.make.in (build-pic-default): New, defined with pic_default. * configure.in (pic_default): New, set to yes if PIC is default. * Makeconfig (CPPFLAGS-.o, CPPFLAGS-.op, CPPFLAGS-.og, CPPFLAGS-.ob): Add -DPIC if $(build-pic-default) is yes. 1997-11-09 18:15 Ulrich Drepper * Makerules (libc.so): Fix typo. * csu/Makefile (CFLAGS-initfini.s): Correctly fix moving function definition. Patch by Zack Weinberg . * stdlib/strtod.c: Handle numbers like 0.0e10000 correctly which produce ±0.0. Reported by Joe Keane . * sysdeps/libm-ieee754/s_ceill.c: Fix typos. * sysdeps/libm-ieee754/s_llrint.c: Correct code, it never worked. 1997-11-06 07:00 H.J. Lu * sysdeps/unix/sysv/i386/i686/time.S: Removed. 1997-11-08 14:07 Thorsten Kukuk * nis/libnsl.map: Add __do_niscall2 for nis_cachemgr. * nis/nis_call.c: Set UDP resend timeout correct. * nis/nss_compat/compat-grp.c: Rewritten to make it faster. * nis/nss_compat/compat-pwd.c: Likewise. * nis/nss_compat/compat-spwd.c: Likewise. * nis/ypclnt.c: Fix UDP resend timeout, fix yp_bind/do_ypcall interaction. * inet/protocols/routed.h: Include sys/socket.h. * inet/protocols/talkd.h: Likewise. * inet/protocols/timed.h: Include rpc/types.h. * sunrpc/rpc/pmap_clnt.h: Include rpc/clnt.h. 1997-11-06 01:39 Ulrich Drepper * Makerules (libc.so): Add missing closing brace. 1997-11-05 Brendan Kehoe * libio.h (__P): Name its arg `p' instead of `params'. This was added solely to work around problems with the definition of __P in the Solaris math.h header. --- ChangeLog | 347 ++++++++++++++++++++ Makeconfig | 12 +- Makefile | 7 + Makerules | 2 +- bits/errno.h | 1 + config.make.in | 1 + configure | 22 ++ configure.in | 14 + csu/Makefile | 2 +- db2/Makefile | 4 +- db2/btree/bt_cursor.c | 152 +++++---- db2/btree/bt_delete.c | 27 +- db2/btree/bt_open.c | 10 +- db2/btree/bt_put.c | 461 ++++++++++++++++---------- db2/btree/bt_rec.c | 116 ++++++- db2/btree/bt_recno.c | 39 +-- db2/btree/bt_search.c | 4 +- db2/btree/bt_split.c | 44 +-- db2/btree/bt_stat.c | 11 +- db2/btree/btree.src | 25 +- db2/btree/btree_auto.c | 294 +++++++++++++++-- db2/common/db_appinit.c | 40 ++- db2/common/db_apprec.c | 36 +- db2/common/db_byteorder.c | 14 +- db2/common/db_region.c | 103 +++--- db2/db.h | 135 +++++--- db2/db/db.c | 30 +- db2/db/db.src | 10 +- db2/db/db_auto.c | 75 +++-- db2/db/db_dispatch.c | 14 +- db2/db/db_dup.c | 4 +- db2/db/db_overflow.c | 32 +- db2/db/db_pr.c | 9 +- db2/db/db_rec.c | 21 +- db2/db/db_ret.c | 8 +- db2/db/db_thread.c | 10 +- db2/db185/db185.c | 18 +- db2/db_int.h | 28 +- db2/hash/hash.c | 135 +++++--- db2/hash/hash.src | 24 +- db2/hash/hash_auto.c | 274 ++++++++++++++-- db2/hash/hash_dup.c | 4 +- db2/hash/hash_page.c | 101 ++++-- db2/hash/hash_rec.c | 146 ++++++++- db2/include/btree_auto.h | 19 ++ db2/include/btree_ext.h | 17 +- db2/include/clib_ext.h | 2 +- db2/include/common_ext.h | 3 +- db2/include/db.h.src | 135 +++++--- db2/include/db_am.h | 6 +- db2/include/db_auto.h | 1 + db2/include/db_cxx.h | 19 +- db2/include/db_ext.h | 6 +- db2/include/db_int.h.src | 28 +- db2/include/hash.h | 6 +- db2/include/hash_auto.h | 18 + db2/include/hash_ext.h | 15 +- db2/include/lock.h | 5 +- db2/include/lock_ext.h | 2 +- db2/include/log.h | 19 +- db2/include/log_ext.h | 2 +- db2/include/mp.h | 41 +-- db2/include/mp_ext.h | 2 +- db2/include/mutex_ext.h | 4 +- db2/include/os_ext.h | 24 +- db2/include/os_func.h | 76 +++++ db2/include/txn.h | 8 +- db2/include/txn_ext.h | 2 +- db2/lock/lock.c | 16 +- db2/lock/lock_deadlock.c | 108 +++--- db2/log/log.c | 56 +++- db2/log/log_archive.c | 38 +-- db2/log/log_auto.c | 16 +- db2/log/log_findckp.c | 12 +- db2/log/log_get.c | 27 +- db2/log/log_put.c | 210 +++++++----- db2/log/log_rec.c | 12 +- db2/log/log_register.c | 12 +- db2/mp/mp_bh.c | 54 +-- db2/mp/mp_fget.c | 41 ++- db2/mp/mp_fopen.c | 34 +- db2/mp/mp_fput.c | 26 +- db2/mp/mp_fset.c | 18 +- db2/mp/mp_open.c | 9 +- db2/mp/mp_pr.c | 48 +-- db2/mp/mp_region.c | 33 +- db2/mp/mp_sync.c | 393 +++++++++++++++++----- db2/mutex/mutex.c | 21 +- db2/os/db_os_abs.c | 82 ----- db2/os/db_os_dir.c | 138 -------- db2/os/db_os_fid.c | 126 ------- db2/os/db_os_lseek.c | 60 ---- db2/os/db_os_mmap.c | 106 ------ db2/os/db_os_open.c | 147 --------- db2/os/db_os_rw.c | 75 ----- db2/os/db_os_sleep.c | 62 ---- db2/os/db_os_stat.c | 84 ----- db2/os/db_os_unlink.c | 35 -- db2/os/os_abs.c | 31 ++ db2/os/os_dir.c | 100 ++++++ db2/os/os_fid.c | 77 +++++ db2/os/os_fsync.c | 34 ++ db2/os/os_func.c | 153 +++++++++ db2/os/os_map.c | 71 ++++ db2/os/os_oflags.c | 48 +++ db2/os/os_open.c | 105 ++++++ db2/os/os_rpath.c | 42 +++ db2/os/os_rw.c | 74 +++++ db2/os/os_seek.c | 42 +++ db2/os/os_sleep.c | 54 +++ db2/os/os_stat.c | 80 +++++ db2/os/os_unlink.c | 34 ++ db2/progs/db_deadlock/db_deadlock.c | 24 +- db2/progs/db_dump/db_dump.c | 2 + db2/progs/db_load/db_load.c | 8 +- db2/progs/db_recover/db_recover.c | 4 +- db2/progs/db_stat/db_stat.c | 182 ++++++++--- db2/txn/txn.c | 31 +- db2/txn/txn_auto.c | 16 +- db2/txn/txn_rec.c | 6 +- include/sys/stat.h | 12 + inet/protocols/routed.h | 1 + inet/protocols/talkd.h | 1 + inet/protocols/timed.h | 2 + io/fstat.c | 3 +- io/fstat64.c | 1 + io/fts.c | 2 +- io/ftw.c | 2 +- io/ftwtest-sh | 3 +- io/getdirname.c | 2 +- io/lstat.c | 3 +- io/lstat64.c | 1 + io/stat.c | 3 +- io/stat64.c | 1 + libio/libio.h | 4 +- libio/stdio.h | 9 +- manual/arith.texi | 17 +- manual/ctype.texi | 2 +- manual/maint.texi | 18 +- manual/pattern.texi | 2 +- manual/process.texi | 4 + manual/stdio.texi | 11 + manual/terminal.texi | 4 +- math/complex.h | 2 +- math/libm-test.c | 108 ++++-- math/test-math.c | 6 +- math/tgmath.h | 6 +- nis/libnsl.map | 3 +- nis/nis_call.c | 9 +- nis/nis_callback.c | 1 + nis/nss_compat/compat-grp.c | 314 ++++++++++++++++-- nis/nss_compat/compat-pwd.c | 526 ++++++++++++++++++++++++++---- nis/nss_compat/compat-spwd.c | 280 +++++++++++++--- nis/ypclnt.c | 131 ++++---- stdio-common/printf-parse.h | 5 +- stdio-common/vfprintf.c | 61 +++- stdio-common/vfscanf.c | 19 +- stdlib/exit.c | 14 +- stdlib/strtod.c | 18 +- stdlib/test-canon.c | 2 +- sunrpc/rpc/pmap_clnt.h | 1 + sysdeps/generic/bits/errno.h | 1 + sysdeps/generic/setenv.c | 9 +- sysdeps/i386/i586/memcpy.S | 108 ++++++ sysdeps/i386/i586/mempcpy.S | 4 + sysdeps/i386/i586/memset.S | 2 +- sysdeps/libm-ieee754/e_asin.c | 21 +- sysdeps/libm-ieee754/e_asinf.c | 17 +- sysdeps/libm-ieee754/e_atan2l.c | 4 +- sysdeps/libm-ieee754/e_remainderl.c | 4 +- sysdeps/libm-ieee754/s_ceill.c | 4 +- sysdeps/libm-ieee754/s_floorl.c | 3 +- sysdeps/libm-ieee754/s_llrint.c | 14 +- sysdeps/libm-ieee754/s_llrintf.c | 2 +- sysdeps/libm-ieee754/s_llrintl.c | 4 +- sysdeps/libm-ieee754/s_llround.c | 9 +- sysdeps/libm-ieee754/s_llroundf.c | 4 +- sysdeps/libm-ieee754/s_llroundl.c | 9 +- sysdeps/libm-ieee754/s_lrint.c | 4 +- sysdeps/libm-ieee754/s_lrintf.c | 2 +- sysdeps/libm-ieee754/s_lrintl.c | 2 +- sysdeps/libm-ieee754/s_lround.c | 2 +- sysdeps/libm-ieee754/s_lroundf.c | 2 +- sysdeps/libm-ieee754/s_lroundl.c | 2 +- sysdeps/libm-ieee754/s_scalblnl.c | 2 +- sysdeps/libm-ieee754/s_scalbnl.c | 2 +- sysdeps/libm-ieee754/s_sincosl.c | 2 +- sysdeps/libm-ieee754/s_tanl.c | 2 +- sysdeps/m68k/fpu/s_llrint.c | 48 ++- sysdeps/m68k/fpu/s_llrintf.c | 66 ++++ sysdeps/m68k/fpu/s_llrintl.c | 65 ++++ sysdeps/mach/hurd/bits/errno.h | 23 +- sysdeps/posix/getcwd.c | 9 +- sysdeps/posix/system.c | 1 + sysdeps/standalone/bits/errno.h | 2 +- sysdeps/unix/sysv/i386/i686/time.S | 27 -- sysdeps/unix/sysv/linux/Dist | 1 + sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/alpha/xstatconv.c | 2 +- sysdeps/unix/sysv/linux/bits/errno.h | 3 +- sysdeps/unix/sysv/linux/xstatconv.c | 2 +- sysdeps/wordsize-32/inttypes.h | 56 ++++ sysdeps/wordsize-64/inttypes.h | 54 +++ test-installation.pl | 195 +++++++++++ time/Makefile | 2 +- time/mktime.c | 2 +- time/strftime.c | 6 + time/strfxtime.c | 33 ++ time/time.h | 43 ++- wcsmbs/wchar.h | 21 +- 210 files changed, 6498 insertions(+), 2663 deletions(-) create mode 100644 db2/include/os_func.h delete mode 100644 db2/os/db_os_abs.c delete mode 100644 db2/os/db_os_dir.c delete mode 100644 db2/os/db_os_fid.c delete mode 100644 db2/os/db_os_lseek.c delete mode 100644 db2/os/db_os_mmap.c delete mode 100644 db2/os/db_os_open.c delete mode 100644 db2/os/db_os_rw.c delete mode 100644 db2/os/db_os_sleep.c delete mode 100644 db2/os/db_os_stat.c delete mode 100644 db2/os/db_os_unlink.c create mode 100644 db2/os/os_abs.c create mode 100644 db2/os/os_dir.c create mode 100644 db2/os/os_fid.c create mode 100644 db2/os/os_fsync.c create mode 100644 db2/os/os_func.c create mode 100644 db2/os/os_map.c create mode 100644 db2/os/os_oflags.c create mode 100644 db2/os/os_open.c create mode 100644 db2/os/os_rpath.c create mode 100644 db2/os/os_rw.c create mode 100644 db2/os/os_seek.c create mode 100644 db2/os/os_sleep.c create mode 100644 db2/os/os_stat.c create mode 100644 db2/os/os_unlink.c create mode 100644 sysdeps/i386/i586/memcpy.S create mode 100644 sysdeps/i386/i586/mempcpy.S create mode 100644 sysdeps/m68k/fpu/s_llrintf.c create mode 100644 sysdeps/m68k/fpu/s_llrintl.c delete mode 100644 sysdeps/unix/sysv/i386/i686/time.S create mode 100644 test-installation.pl create mode 100644 time/strfxtime.c diff --git a/ChangeLog b/ChangeLog index f420373b2f..877ae6c470 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,350 @@ +1997-11-11 21:30 Ulrich Drepper + + * include/sys/stat.h: Define stat, fstat, lstat and *64 variants + as macros so the the library compiles correctly even without + optimization. + * io/fstat.c: Undef fstat. + * io/fstat64.c: Undef fstat64 + * io/lstat.c: Undef lstat. + * io/lstat64.c: Undef lstat64 + * io/stat.c: Undef stat. + * io/stat64.c: Undef stat64 + * io/fts.c: Include to get macro definitions. + * io/ftw.c: Likewise. + * io/getdirname.c: Likewise. + + * Makefile (install): Run test-installation.pl if possible. + + * db2/Makefile: Update from db-2.3.12. + * db2/db.h: Likewise. + * db2/db_int.h: Likewise. + * db2/btree/bt_cursor.c: Likewise. + * db2/btree/bt_delete.c: Likewise. + * db2/btree/bt_open.c: Likewise. + * db2/btree/bt_put.c: Likewise. + * db2/btree/bt_rec.c: Likewise. + * db2/btree/bt_recno.c: Likewise. + * db2/btree/bt_search.c: Likewise. + * db2/btree/bt_split.c: Likewise. + * db2/btree/bt_stat.c: Likewise. + * db2/btree/btree.src: Likewise. + * db2/btree/btree_auto.c: Likewise. + * db2/btree/bt_cursor.c: Likewise. + * db2/btree/bt_delete.c: Likewise. + * db2/btree/bt_open.c: Likewise. + * db2/btree/bt_put.c: Likewise. + * db2/btree/bt_rec.c: Likewise. + * db2/btree/bt_recno.c: Likewise. + * db2/btree/bt_search.c: Likewise. + * db2/btree/bt_split.c: Likewise. + * db2/btree/bt_stat.c: Likewise. + * db2/btree/btree.src: Likewise. + * db2/btree/btree_auto.c: Likewise. + * db2/common/db_appinit.c: Likewise. + * db2/common/db_apprec.c: Likewise. + * db2/common/db_byteorder.c: Likewise. + * db2/common/db_region.c: Likewise. + * db2/db/db.c: Likewise + * db2/db/db.src: Likewise + * db2/db/db_auto.c: Likewise + * db2/db/db_dispatch.c: Likewise + * db2/db/db_dup.c: Likewise + * db2/db/db_overflow.c: Likewise + * db2/db/db_pr.c: Likewise + * db2/db/db_rec.c: Likewise + * db2/db/db_ret.c: Likewise + * db2/db/db_thread.c: Likewise + * db2/db185/db185.c: Likewise. + * db2/hash/hash.c: Likewise. + * db2/hash/hash.src: Likewise. + * db2/hash/hash_auto.c: Likewise. + * db2/hash/hash_dup.c: Likewise. + * db2/hash/hash_page.c: Likewise. + * db2/hash/hash_rec.c: Likewise. + * db2/include/btree_auto.h: Likewise. + * db2/include/btree_ext.h: Likewise. + * db2/include/clib_ext.h: Likewise. + * db2/include/common_ext.h: Likewise. + * db2/include/db.h.src: Likewise. + * db2/include/db_am.h: Likewise. + * db2/include/db_auto.h: Likewise. + * db2/include/db_cxx.h: Likewise. + * db2/include/db_ext.h: Likewise. + * db2/include/db_int.h.src: Likewise. + * db2/include/hash.h: Likewise. + * db2/include/hash_auto.h: Likewise. + * db2/include/hash_ext.h: Likewise. + * db2/include/lock.h: Likewise. + * db2/include/lock_ext.h: Likewise. + * db2/include/log.h: Likewise. + * db2/include/log_ext.h: Likewise. + * db2/include/mp.h: Likewise. + * db2/include/mp_ext.h: Likewise. + * db2/include/mutex_ext.h: Likewise. + * db2/include/os_ext.h: Likewise. + * db2/include/os_func.h: Likewise. + * db2/include/txn.h: Likewise. + * db2/include/txn_ext.h: Likewise. + * db2/lock/lock.c: Likewise. + * db2/lock/lock_deadlock.c: Likewise. + * db2/log/log.c: Likewise. + * db2/log/log_archive.c: Likewise. + * db2/log/log_auto.c: Likewise. + * db2/log/log_findckp.c: Likewise. + * db2/log/log_get.c: Likewise. + * db2/log/log_put.c: Likewise. + * db2/log/log_rec.c: Likewise. + * db2/log/log_register.c: Likewise. + * db2/mp/mp_bh.c: Likewise. + * db2/mp/mp_fget.c: Likewise. + * db2/mp/mp_fopen.c: Likewise. + * db2/mp/mp_fput.c: Likewise. + * db2/mp/mp_fset.c: Likewise. + * db2/mp/mp_open.c: Likewise. + * db2/mp/mp_pr.c: Likewise. + * db2/mp/mp_region.c: Likewise. + * db2/mp/mp_sync.c: Likewise. + * db2/mutex/mutex.c: Likewise. + * db2/os/os_abs.c: Likewise. + * db2/os/os_dir.c: Likewise. + * db2/os/os_fid.c: Likewise. + * db2/os/os_fsync.c: Likewise. + * db2/os/os_func.c: Likewise. + * db2/os/os_map.c: Likewise. + * db2/os/os_oflags.c: Likewise. + * db2/os/os_open.c: Likewise. + * db2/os/os_rpath.c: Likewise. + * db2/os/os_rw.c: Likewise. + * db2/os/os_seek.c: Likewise. + * db2/os/os_sleep.c: Likewise. + * db2/os/os_stat.c: Likewise. + * db2/os/os_unlink.c: Likewise. + * db2/progs/db_deadlock/db_deadlock.c: Likewise. + * db2/progs/db_dump/db_dump.c: Likewise. + * db2/progs/db_load/db_load.c: Likewise. + * db2/progs/db_recover/db_recover.c: Likewise. + * db2/progs/db_stat/db_stat.c: Likewise. + * db2/txn/txn.c: Likewise. + * db2/txn/txn_auto.c: Likewise. + * db2/txn/txn_rec.c: Likewise. + * db2/os/db_os_abs.c: Removed. + * db2/os/db_os_dir.c: Removed. + * db2/os/db_os_fid.c: Removed. + * db2/os/db_os_lseek.c: Removed. + * db2/os/db_os_mmap.c: Removed. + * db2/os/db_os_open.c: Removed. + * db2/os/db_os_rw.c: Removed. + * db2/os/db_os_sleep.c: Removed. + * db2/os/db_os_stat.c: Removed. + * db2/os/db_os_unlink.c: Removed. + + * libio/stdio.h (fopen): Add __restrict to parameters. + + * manual/process.texi (system): Describe behaviour for NULL argument. + + * stdio-common/printf-parse.h: Parse hh modifier. + * stdio-common/vfprintf.c: Handle hh modifier. + * stdio-common/vfscanf.c: Likewise. + * manual/stdio.texi: Describe hh modifier for scanf/printf. + + * math/complex.h: Don't define _Imaginary_I, but instead _Complex_I. + gcc does no yet know the `imaginary' keyword. + + * math/test-math.c: Add little test for know gcc bug. + + * math/tgmath.h: Make complex versions of log10() only available + if __USE_GNU. + + * stdlib/test-canon.c: Fix typo. + + * sysdeps/generic/setenv.c: Avoid compilation warnings. + Reported by Jim Meyering. + + * sysdeps/generic/bits/errno.h: EILSEQ is an ISO C error number. + * sysdeps/mach/hurd/bits/errno.h: Likewise. + * sysdeps/standalone/bits/errno.h: Likewise. + * sysdeps/unix/sysv/linux/bits/errno.h: Likewise. + + * sysdeps/i386/i586/memcpy.S: New file. + * sysdeps/i386/i586/mempcpy.S: New file. + + * sysdeps/i386/i586/memset.S: Fix typo. + + * sysdeps/posix/getcwd.c: Define HAVE_MEMPCPY for _LIBC. Add casts. + + * sysdeps/posix/system.c: Add comment to explain code. + + * sysdeps/wordsize-32/inttypes.h: Include for wchar_t. + Define PTRDIFF_{MIN,MAX}, SIG_ATOMIC_{MIN,MAX}, SIZE_MAX, + WCHAR_{MIN,MAX}, WINT_{MIN,MAX}. + Define wcstoimax, wcstoumax. + * sysdeps/wordsize-64/inttypes.h: Likewise. + + * wcsmbs/wchar.h: Define WCHAR_{MIN,MAX} if not already defined. + Declare __wcsto{l,ul,ll,ull}_internal only if not already done. + + * time/Makefile (routines): Add strfxtime. + * time/strftime.c: Implement %F and %f format. + * time/strfxtime.c: New file. + * time/time.h: Define new types and symbols from ISO C 9X. + + * time/mktime.c: Little comment correction. + +1997-11-10 Andreas Jaeger + + * sysdeps/libm-ieee754/s_sincosl.c: Fix typo. + + * sysdeps/libm-ieee754/s_tanl.c: Fix typo. + + * sysdeps/libm-ieee754/s_floorl.c: Correct typos. + + * sysdeps/libm-ieee754/e_remainderl.c: Replace + EXTRACT_LDOUBLE_WORDS by GET_LDOUBLE_WORDS. + + * sysdeps/libm-ieee754/e_atan2l.c: Replace EXTRACT_LDOUBLE_WORDS + by GET_LDOUBLE_WORDS. + + * sysdeps/libm-ieee754/s_scalbnl.c: Replace ";" by "," for correct + variable declaration. + * sysdeps/libm-ieee754/s_scalblnl.c: Likewise. + + * sysdeps/libm-ieee754/s_lrint.c (__lrint): Correct function. + + * math/libm-test.c (sqrt_test): Add test for sqrt (0.25). + (asin_test): Add more test. + +1997-11-10 23:34 Ulrich Drepper + + * sysdeps/libm-ieee754/e_asin.c: Add braces to make code clearer + and to not confuse the poor compiler. + * sysdeps/libm-ieee754/e_asinf.c: Likewise. + Reported by vertex@cagent.com. + +1997-11-09 Andreas Schwab + + * elf/dl-lookup.c (do_lookup): Don't accept the base version if we + require a specific one. + + * libio/oldfreopen.c: Bind old symbols to version GLIBC_2.0. + * libio/oldiofopen.c: Likewise. + * libio/oldstdfiles.c: Likewise. + * libc.map: Export them. + +1997-11-10 07:40 H.J. Lu + + * stdlib/exit.c (exit): Handle recursive calls to exit (). + +1997-11-09 Andreas Schwab + + * sysdeps/m68k/fpu/s_llrint.c: Fixed to take double argument + instead of long double. + * sysdeps/m68k/fpu/s_llrintf.c: New file. + * sysdeps/m68k/fpu/s_llrintl.c: New file. + + * sysdeps/libm-ieee754/s_llrint.c: Make compilable and fix + overflow condition. + * sysdeps/libm-ieee754/s_llrintf.c: Fix overflow condition. + * sysdeps/libm-ieee754/s_llrintl.c: Likewise. + * sysdeps/libm-ieee754/s_llround.c: Likewise. + * sysdeps/libm-ieee754/s_llroundf.c: Likewise. + * sysdeps/libm-ieee754/s_llroundl.c: Likewise. + * sysdeps/libm-ieee754/s_lrint.c: Likewise. + * sysdeps/libm-ieee754/s_lrintf.c: Likewise. + * sysdeps/libm-ieee754/s_lrintl.c: Likewise. + * sysdeps/libm-ieee754/s_lround.c: Likewise. + * sysdeps/libm-ieee754/s_lroundf.c: Likewise. + * sysdeps/libm-ieee754/s_lroundl.c: Likewise. + + * math/libm-test.c: Test all three variants of lrint and llrint. + Fix typos in lround and llround tests. Add tests for boundary + cases for lrint and llround. + +1997-11-08 Andreas Schwab + + * manual/arith.texi: Misc doc fixes. + * manual/ctype.texi: Likewise. + * manual/pattern.texi: Likewise. + * manual/terminal.texi: Likewise. + +1997-11-08 Andreas Schwab + + * sysdeps/unix/sysv/linux/xstatconv.c: Use struct assignment + instead of memcpy to let the compiler use whatever it regards as + optimal. + * sysdeps/unix/sysv/linux/alpha/xstatconv.c: Likewise. + +1997-11-08 Andreas Schwab + + * sysdeps/unix/sysv/linux/Makefile (sysdep_headers) + [$(subdir)=misc]: Add sys/prctl.h. + * sysdeps/unix/sysv/linux/Dist: Distribute it. + +1997-11-08 Andreas Schwab + + * io/ftwtest-sh: Don't use the unknown which command, instead try + pwd as /bin/pwd and /usr/bin/pwd. + +1997-11-08 Andreas Schwab + + * manual/maint.texi (Tools for Installation): Don't recommend + broken version 3.76.1 of make. + (Porting): Fix wording. + +1997-11-06 06:13 H.J. Lu + + * config.make.in (build-pic-default): New, defined with + pic_default. + + * configure.in (pic_default): New, set to yes if PIC is + default. + + * Makeconfig (CPPFLAGS-.o, CPPFLAGS-.op, CPPFLAGS-.og, + CPPFLAGS-.ob): Add -DPIC if $(build-pic-default) is yes. + +1997-11-09 18:15 Ulrich Drepper + + * Makerules (libc.so): Fix typo. + + * csu/Makefile (CFLAGS-initfini.s): Correctly fix moving function + definition. Patch by Zack Weinberg . + + * stdlib/strtod.c: Handle numbers like 0.0e10000 correctly which + produce ±0.0. Reported by Joe Keane . + + * sysdeps/libm-ieee754/s_ceill.c: Fix typos. + * sysdeps/libm-ieee754/s_llrint.c: Correct code, it never worked. + +1997-11-06 07:00 H.J. Lu + + * sysdeps/unix/sysv/i386/i686/time.S: Removed. + +1997-11-08 14:07 Thorsten Kukuk + + * nis/libnsl.map: Add __do_niscall2 for nis_cachemgr. + + * nis/nis_call.c: Set UDP resend timeout correct. + + * nis/nss_compat/compat-grp.c: Rewritten to make it faster. + * nis/nss_compat/compat-pwd.c: Likewise. + * nis/nss_compat/compat-spwd.c: Likewise. + * nis/ypclnt.c: Fix UDP resend timeout, fix yp_bind/do_ypcall + interaction. + + * inet/protocols/routed.h: Include sys/socket.h. + * inet/protocols/talkd.h: Likewise. + * inet/protocols/timed.h: Include rpc/types.h. + * sunrpc/rpc/pmap_clnt.h: Include rpc/clnt.h. + +1997-11-06 01:39 Ulrich Drepper + + * Makerules (libc.so): Add missing closing brace. + +1997-11-05 Brendan Kehoe + + * libio.h (__P): Name its arg `p' instead of `params'. + This was added solely to work around problems with + the definition of __P in the Solaris math.h header. + 1997-11-06 00:06 Ulrich Drepper * argp/argp-help.c: Optimize a bit by using mempcpy. diff --git a/Makeconfig b/Makeconfig index 45e792fbc7..2eb1ce1975 100644 --- a/Makeconfig +++ b/Makeconfig @@ -529,6 +529,12 @@ LDFLAGS := -g endif +# If everything is compiled with -fPIC (implicitly) we must tell this by +# defining the PIC symbol. +ifeq (yes,$(build-pic-default)) +pic-default = -DPIC +endif + # Enable object files for different versions of the library. # Various things use $(object-suffixes) to know what all to make. # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX}) @@ -537,6 +543,7 @@ libtypes = $(foreach o,$(object-suffixes),$(libtype$o)) all-object-suffixes := .o .os .op .og .ob object-suffixes := ifeq (yes,$(build-static)) +CPPFLAGS-.o = $(pic-default) libtype.o := lib%.a object-suffixes += .o endif @@ -554,7 +561,7 @@ ifeq (yes,$(build-profile)) # Under --enable-profile, we will build a static library of profiled objects. # The profiled object files are named foo.op. object-suffixes += .op -CPPFLAGS-.op = -DPROF +CPPFLAGS-.op = -DPROF $(pic-default) CFLAGS-.op = -pg libtype.op = lib%_p.a endif @@ -563,6 +570,7 @@ ifeq (yes,$(build-omitfp)) # debugging information using -fomit-frame-pointer, and build an extra # library with debugging information. The debuggable objects are named foo.og. object-suffixes += .og +CPPFLAGS-.og = $(pic-default) CFLAGS-.og = -g CFLAGS-.o = -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES CFLAGS-.os += $(CFLAGS-.o) @@ -572,7 +580,7 @@ ifeq (yes,$(build-bounded)) # Under --enable-bounded, we build the library with `-fbounded-pointers -g' # to runtime bounds checking. The bounded-pointer objects are named foo.ob. object-suffixes += .ob -CPPFLAGS-.ob = -DBOUNDED_POINTERS +CPPFLAGS-.ob = -DBOUNDED_POINTERS $(pic-default) CFLAGS-.ob = -g -fbounded-pointers libtype.ob = lib%_b.a endif diff --git a/Makefile b/Makefile index 22cea63624..0d94985e39 100644 --- a/Makefile +++ b/Makefile @@ -124,6 +124,13 @@ ifeq (yes,$(build-shared)) install: -test ! -x $(common-objpfx)elf/ldconfig || \ $(common-objpfx)elf/ldconfig -d $(inst_slibdir) $(inst_libdir) +ifneq (no,$(PERL)) +ifeq (/usr,$(prefix)) +ifeq (,$(install_root)) + CC=$(CC) $(PERL) test-installation.pl $(common-objpfx) +endif +endif +endif endif endif diff --git a/Makerules b/Makerules index 2ba27c4bb2..b9c89a5a3e 100644 --- a/Makerules +++ b/Makerules @@ -692,7 +692,7 @@ $(inst_libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \ echo ' dependencies of $( $@.new mv -f $@.new $@ diff --git a/bits/errno.h b/bits/errno.h index 622c2c9de4..d1cb464b41 100644 --- a/bits/errno.h +++ b/bits/errno.h @@ -23,6 +23,7 @@ #define __Emath_defined 1 # define EDOM XXX <--- fill in what is actually needed +# define EILSEQ XXX <--- fill in what is actually needed # define ERANGE XXX <--- fill in what is actually needed #endif diff --git a/config.make.in b/config.make.in index ae4d898dd2..6fefeaade3 100644 --- a/config.make.in +++ b/config.make.in @@ -39,6 +39,7 @@ gnu-as = @gnu_as@ gnu-ld = @gnu_ld@ build-static = @static@ build-shared = @shared@ +build-pic-default= @pic_default@ build-profile = @profile@ build-omitfp = @omitfp@ build-bounded = @bounded@ diff --git a/configure b/configure index 2ef2feef14..c9613d27b1 100755 --- a/configure +++ b/configure @@ -2441,6 +2441,27 @@ if test $shared = default; then fi fi +echo $ac_n "checking whether -fPIC is default""... $ac_c" 1>&6 +echo "configure:2446: checking whether -fPIC is default" >&5 +if eval "test \"`echo '$''{'pic_default'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + pic_default=yes +cat > conftest.c <&5 1>&5"; then + pic_default=no +fi +rm -f conftest.* +fi + +echo "$ac_t""$pic_default" 1>&6 + + + @@ -2650,6 +2671,7 @@ s%@gnu_as@%$gnu_as%g s%@elf@%$elf%g s%@static@%$static%g s%@shared@%$shared%g +s%@pic_default@%$pic_default%g s%@profile@%$profile%g s%@omitfp@%$omitfp%g s%@bounded@%$bounded%g diff --git a/configure.in b/configure.in index 3b3be45c33..bdfe63c06a 100644 --- a/configure.in +++ b/configure.in @@ -971,6 +971,20 @@ if test $shared = default; then shared=no fi fi + +AC_CACHE_CHECK([whether -fPIC is default], pic_default, +[pic_default=yes +cat > conftest.c <&AC_FD_CC 1>&AC_FD_CC"; then + pic_default=no +fi +rm -f conftest.*]) +AC_SUBST(pic_default) + AC_SUBST(profile) AC_SUBST(omitfp) AC_SUBST(bounded) diff --git a/csu/Makefile b/csu/Makefile index bc66f674bc..cb9e6eb6aa 100644 --- a/csu/Makefile +++ b/csu/Makefile @@ -64,7 +64,7 @@ omit-deps += $(crtstuff) $(objpfx)crt%.o: $(objpfx)crt%.S $(objpfx)defs.h $(compile.S) -g0 $(ASFLAGS-.os) -o $@ -CFLAGS-initfini.s = -O0 -g0 -fPIC +CFLAGS-initfini.s = -g0 -fPIC -fno-inline-functions $(objpfx)initfini.s: initfini.c $(compile.c) -S $(CFLAGS-initfini.s) -finhibit-size-directive \ diff --git a/db2/Makefile b/db2/Makefile index e6b35aa51b..8e5cea7b17 100644 --- a/db2/Makefile +++ b/db2/Makefile @@ -58,8 +58,8 @@ libdb-routines := bt_close bt_compare bt_conv bt_cursor bt_delete \ bt_split bt_stat btree_auto db db_appinit db_apprec \ db_auto \ db_byteorder db_conv db_dispatch db_dup db_err db_log2 \ - db_os_abs db_os_dir db_os_fid db_os_lseek db_os_mmap \ - db_os_open db_os_rw db_os_sleep db_os_stat db_os_unlink \ + os_abs os_dir os_fid os_fsync os_func os_map os_oflags \ + os_open os_rpath os_rw os_seek os_sleep os_stat os_unlink \ db_overflow db_pr db_rec db_region db_ret db_salloc \ db_shash db_thread hash hash_auto hash_conv hash_debug \ hash_dup hash_func hash_page hash_rec hash_stat lock \ diff --git a/db2/btree/bt_cursor.c b/db2/btree/bt_cursor.c index a1266bcd3c..e5f3faeb70 100644 --- a/db2/btree/bt_cursor.c +++ b/db2/btree/bt_cursor.c @@ -8,7 +8,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "@(#)bt_cursor.c 10.33 (Sleepycat) 9/24/97"; +static const char sccsid[] = "@(#)bt_cursor.c 10.35 (Sleepycat) 10/25/97"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -62,10 +62,10 @@ __bam_cursor(dbp, txn, dbcp) DEBUG_LWRITE(dbp, txn, "bam_cursor", NULL, NULL, 0); - if ((dbc = (DBC *)calloc(1, sizeof(DBC))) == NULL) + if ((dbc = (DBC *)__db_calloc(1, sizeof(DBC))) == NULL) return (ENOMEM); - if ((cp = (CURSOR *)calloc(1, sizeof(CURSOR))) == NULL) { - free(dbc); + if ((cp = (CURSOR *)__db_calloc(1, sizeof(CURSOR))) == NULL) { + __db_free(dbc); return (ENOMEM); } @@ -474,7 +474,7 @@ __bam_c_rget(dbp, cp, key, data, flags) __bam_stkrel(dbp); err: (void)memp_fput(dbp->mpf, cp->page, 0); - free(dbt.data); + __db_free(dbt.data); return (ret); } @@ -1422,7 +1422,7 @@ __bam_c_physdel(dbp, cp, h) DB_LOCK lock; db_indx_t indx; db_pgno_t pgno, next_pgno, prev_pgno; - int local, ret; + int local, normal, ret; t = dbp->internal; ret = 0; @@ -1457,51 +1457,65 @@ __bam_c_physdel(dbp, cp, h) local = 0; /* - * If we're deleting a duplicate entry, call the common code to do - * the work. + * If we're deleting a duplicate entry and there are other duplicate + * entries remaining, call the common code to do the work and fix up + * the parent page as necessary. Otherwise, do a normal btree delete. + * + * There are 5 possible cases: + * + * 1. It's not a duplicate item: do a normal btree delete. + * 2. It's a duplicate item: + * 2a: We delete an item from a page of duplicates, but there are + * more items on the page. + * 2b: We delete the last item from a page of duplicates, deleting + * the last duplicate. + * 2c: We delete the last item from a page of duplicates, but there + * is a previous page of duplicates. + * 2d: We delete the last item from a page of duplicates, but there + * is a following page of duplicates. + * + * In the case of: + * + * 1: There's nothing further to do. + * 2a: There's nothing further to do. + * 2b: Do the normal btree delete instead of a duplicate delete, as + * that deletes both the duplicate chain and the parent page's + * entry. + * 2c: There's nothing further to do. + * 2d: Delete the duplicate, and update the parent page's entry. */ if (TYPE(h) == P_DUPLICATE) { pgno = PGNO(h); prev_pgno = PREV_PGNO(h); next_pgno = NEXT_PGNO(h); - if ((ret = __db_drem(dbp, &h, indx, __bam_free)) != 0) - goto err; - /* - * There are 4 cases: - * - * 1. We removed an item on a page, but there are more items - * on the page. - * 2. We removed the last item on a page, removing the last - * duplicate. - * 3. We removed the last item on a page, but there is a - * following page of duplicates. - * 4. We removed the last item on a page, but there is a - * previous page of duplicates. - * - * In case 1, h != NULL, h->pgno == pgno - * In case 2, h == NULL, - * prev_pgno == PGNO_INVALID, next_pgno == PGNO_INVALID - * In case 3, h != NULL, next_pgno != PGNO_INVALID - * In case 4, h == NULL, prev_pgno != PGNO_INVALID - * - * In case 1, there's nothing else to do. - * In case 2, remove the entry from the parent page. - * In case 3 or 4, if the deleted page was the first in a chain - * of duplicate pages, update the parent page's entry. - * - * Test: - * If there were previous pages of duplicates or we didn't - * empty the current page of duplicates, we don't need to - * touch the parent page. - */ - if (prev_pgno != PGNO_INVALID || (h != NULL && pgno == h->pgno)) - goto done; + if (NUM_ENT(h) == 1 && + prev_pgno == PGNO_INVALID && next_pgno == PGNO_INVALID) + normal = 1; + else { + normal = 0; - /* - * Release any page we're holding and the lock on the deleted - * page. - */ + /* Delete the duplicate. */ + if ((ret = __db_drem(dbp, &h, indx, __bam_free)) != 0) + goto err; + + /* + * 2a: h != NULL, h->pgno == pgno + * 2b: We don't reach this clause, as the above test + * was true. + * 2c: h == NULL, prev_pgno != PGNO_INVALID + * 2d: h != NULL, next_pgno != PGNO_INVALID + * + * Test for 2a and 2c: if we didn't empty the current + * page or there was a previous page of duplicates, we + * don't need to touch the parent page. + */ + if ((h != NULL && pgno == h->pgno) || + prev_pgno != PGNO_INVALID) + goto done; + } + + /* Release any page we're holding and its lock. */ if (local) { if (h != NULL) (void)memp_fput(dbp->mpf, h, 0); @@ -1519,37 +1533,33 @@ __bam_c_physdel(dbp, cp, h) } local = 1; - /* - * If we deleted the last duplicate, we can fall out and do a - * normal btree delete in the context of the parent page. If - * not, we have to update the parent's page. - */ + /* Switch to the parent page's entry. */ indx = cp->indx; - if (next_pgno != PGNO_INVALID) { - /* - * Copy, delete, update and re-insert the parent page's - * entry. - */ - bo = *GET_BOVERFLOW(h, indx); - (void)__db_ditem(dbp, h, indx, BOVERFLOW_SIZE); - bo.pgno = next_pgno; - memset(&dbt, 0, sizeof(dbt)); - dbt.data = &bo; - dbt.size = BOVERFLOW_SIZE; - (void)__db_pitem(dbp, - h, indx, BOVERFLOW_SIZE, &dbt, NULL); - - /* Discard the parent page. */ - (void)memp_fput(dbp->mpf, h, 0); - (void)__BT_TLPUT(dbp, lock); - local = 0; + if (normal) + goto btd; - goto done; - } + /* + * Copy, delete, update, add-back the parent page's data entry. + * + * XXX + * This may be a performance/logging problem. We should add a + * log message which simply logs/updates a random set of bytes + * on a page, and use it instead of doing a delete/add pair. + */ + indx += O_INDX; + bo = *GET_BOVERFLOW(h, indx); + (void)__db_ditem(dbp, h, indx, BOVERFLOW_SIZE); + bo.pgno = next_pgno; + memset(&dbt, 0, sizeof(dbt)); + dbt.data = &bo; + dbt.size = BOVERFLOW_SIZE; + (void)__db_pitem(dbp, h, indx, BOVERFLOW_SIZE, &dbt, NULL); + (void)memp_fset(dbp->mpf, h, DB_MPOOL_DIRTY); + goto done; } /* Otherwise, do a normal btree delete. */ - if ((ret = __bam_ditem(dbp, h, indx)) != 0) +btd: if ((ret = __bam_ditem(dbp, h, indx)) != 0) goto err; if ((ret = __bam_ditem(dbp, h, indx)) != 0) goto err; @@ -1584,7 +1594,7 @@ __bam_c_physdel(dbp, cp, h) } ret = __bam_dpage(dbp, &dbt); - free(dbt.data); + __db_free(dbt.data); } err: diff --git a/db2/btree/bt_delete.c b/db2/btree/bt_delete.c index 98929540e4..9593d0109c 100644 --- a/db2/btree/bt_delete.c +++ b/db2/btree/bt_delete.c @@ -47,7 +47,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "@(#)bt_delete.c 10.21 (Sleepycat) 9/3/97"; +static const char sccsid[] = "@(#)bt_delete.c 10.22 (Sleepycat) 11/2/97"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -266,9 +266,10 @@ __bam_ditem(dbp, h, indx) case B_DUPLICATE: case B_OVERFLOW: nbytes = BINTERNAL_SIZE(bi->len); + bo = (BOVERFLOW *)bi->data; goto offpage; case B_KEYDATA: - nbytes = BKEYDATA_SIZE(bi->len); + nbytes = BINTERNAL_SIZE(bi->len); break; default: return (__db_pgfmt(dbp, h->pgno)); @@ -289,7 +290,7 @@ __bam_ditem(dbp, h, indx) if (indx > 0 && h->inp[indx] == h->inp[indx - P_INDX]) return (__bam_adjindx(dbp, h, indx, indx - P_INDX, 0)); - if (indx < (u_int32_t)(NUM_ENT(h) - P_INDX) && + if (indx + P_INDX < (u_int32_t)NUM_ENT(h) && h->inp[indx] == h->inp[indx + P_INDX]) return (__bam_adjindx(dbp, h, indx, indx + O_INDX, 0)); @@ -301,9 +302,9 @@ __bam_ditem(dbp, h, indx) case B_DUPLICATE: case B_OVERFLOW: nbytes = BOVERFLOW_SIZE; + bo = GET_BOVERFLOW(h, indx); offpage: /* Delete duplicate/offpage chains. */ - bo = GET_BOVERFLOW(h, indx); if (B_TYPE(bo->type) == B_DUPLICATE) { if ((ret = __db_ddup(dbp, bo->pgno, __bam_free)) != 0) @@ -523,7 +524,7 @@ __bam_dpages(dbp, t) /* * If we deleted the next-to-last item from the root page, the tree - * has collapsed a level. Try and write lock the remaining root + 1 + * can collapse a level. Try and write lock the remaining root + 1 * page and copy it onto the root page. If we can't get the lock, * that's okay, the tree just stays a level deeper than we'd like. */ @@ -546,8 +547,8 @@ __bam_dpages(dbp, t) b.data = P_ENTRY(epg->page, 0); b.size = BINTERNAL_SIZE(((BINTERNAL *)b.data)->len); __bam_rsplit_log(dbp->dbenv->lg_info, dbp->txn, - &h->lsn, 0, dbp->log_fileid, h->pgno, &a, &b, - &epg->page->lsn); + &h->lsn, 0, dbp->log_fileid, h->pgno, &a, + RE_NREC(epg->page), &b, &epg->page->lsn); } /* @@ -565,15 +566,19 @@ __bam_dpages(dbp, t) if (TYPE(h) == P_IRECNO || (TYPE(h) == P_IBTREE && F_ISSET(dbp, DB_BT_RECNUM))) RE_NREC_SET(epg->page, rcnt); + (void)memp_fset(dbp->mpf, epg->page, DB_MPOOL_DIRTY); - /* Free the last page in that level of the btree. */ - ++t->lstat.bt_freed; + /* + * Free the last page in that level of the btree and discard + * the lock. (The call to __bam_free discards our reference + * to the page.) + */ (void)__bam_free(dbp, h); + (void)__BT_TLPUT(dbp, lock); + ++t->lstat.bt_freed; /* Adjust the cursors. */ __bam_ca_move(dbp, t, h->pgno, PGNO_ROOT); - - (void)__BT_TLPUT(dbp, lock); } /* Release the top page in the subtree. */ diff --git a/db2/btree/bt_open.c b/db2/btree/bt_open.c index 354888c6c2..2361f69a3e 100644 --- a/db2/btree/bt_open.c +++ b/db2/btree/bt_open.c @@ -47,7 +47,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "@(#)bt_open.c 10.20 (Sleepycat) 8/19/97"; +static const char sccsid[] = "@(#)bt_open.c 10.21 (Sleepycat) 10/25/97"; #endif /* not lint */ /* @@ -95,7 +95,7 @@ __bam_open(dbp, type, dbinfo) int ret; /* Allocate the btree internal structure. */ - if ((t = (BTREE *)calloc(1, sizeof(BTREE))) == NULL) + if ((t = (BTREE *)__db_calloc(1, sizeof(BTREE))) == NULL) return (ENOMEM); t->bt_sp = t->bt_csp = t->bt_stack; @@ -179,7 +179,7 @@ einval: ret = EINVAL; err: if (t != NULL) { /* If we allocated room for key/data return, discard it. */ if (t->bt_rkey.data != NULL) - free(t->bt_rkey.data); + __db_free(t->bt_rkey.data); FREE(t, sizeof(BTREE)); } @@ -201,7 +201,7 @@ __bam_bdup(orig, new) ot = orig->internal; - if ((t = (BTREE *)calloc(1, sizeof(*t))) == NULL) + if ((t = (BTREE *)__db_calloc(1, sizeof(*t))) == NULL) return (ENOMEM); /* @@ -248,7 +248,7 @@ __bam_keyalloc(t) * Recno keys are always the same size, and we don't want to have * to check for space on each return. Allocate it now. */ - if ((t->bt_rkey.data = (void *)malloc(sizeof(db_recno_t))) == NULL) + if ((t->bt_rkey.data = (void *)__db_malloc(sizeof(db_recno_t))) == NULL) return (ENOMEM); t->bt_rkey.ulen = sizeof(db_recno_t); return (0); diff --git a/db2/btree/bt_put.c b/db2/btree/bt_put.c index af09f76d41..b3d775bb0f 100644 --- a/db2/btree/bt_put.c +++ b/db2/btree/bt_put.c @@ -47,7 +47,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "@(#)bt_put.c 10.25 (Sleepycat) 9/17/97"; +static const char sccsid[] = "@(#)bt_put.c 10.31 (Sleepycat) 10/26/97"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES @@ -66,7 +66,10 @@ static const char sccsid[] = "@(#)bt_put.c 10.25 (Sleepycat) 9/17/97"; static int __bam_fixed __P((BTREE *, DBT *)); static int __bam_lookup __P((DB *, DBT *, int *)); static int __bam_ndup __P((DB *, PAGE *, u_int32_t)); -static int __bam_partial __P((DB *, DBT *, PAGE *, u_int32_t)); +static int __bam_ovput __P((DB *, PAGE *, u_int32_t, DBT *)); +static int __bam_partial __P((DB *, DBT *, PAGE *, u_int32_t, u_int32_t)); +static u_int32_t + __bam_partsize __P((DB *, DBT *, PAGE *, u_int32_t)); /* * __bam_put -- @@ -333,21 +336,6 @@ miss: ++t->lstat.bt_cache_miss; slow: return (__bam_search(dbp, key, S_INSERT, 1, NULL, exactp)); } -/* - * OVPUT -- - * Copy an overflow item onto a page. - */ -#undef OVPUT -#define OVPUT(h, indx, bo) do { \ - DBT __hdr; \ - memset(&__hdr, 0, sizeof(__hdr)); \ - __hdr.data = &bo; \ - __hdr.size = BOVERFLOW_SIZE; \ - if ((ret = __db_pitem(dbp, \ - h, indx, BOVERFLOW_SIZE, &__hdr, NULL)) != 0) \ - return (ret); \ -} while (0) - /* * __bam_iitem -- * Insert an item into the tree. @@ -365,19 +353,18 @@ __bam_iitem(dbp, hp, indxp, key, data, op, flags) { BTREE *t; BKEYDATA *bk; - BOVERFLOW kbo, dbo; DBT tdbt; PAGE *h; db_indx_t indx; - u_int32_t have_bytes, need_bytes, needed; - int bigkey, bigdata, dcopy, dupadjust, ret; + u_int32_t data_size, have_bytes, need_bytes, needed; + int bigkey, bigdata, dupadjust, replace, ret; t = dbp->internal; h = *hp; indx = *indxp; - dupadjust = 0; bk = NULL; /* XXX: Shut the compiler up. */ + dupadjust = replace = 0; /* * If it's a page of duplicates, call the common code to do the work. @@ -385,7 +372,7 @@ __bam_iitem(dbp, hp, indxp, key, data, op, flags) * !!! * Here's where the hp and indxp are important. The duplicate code * may decide to rework/rearrange the pages and indices we're using, - * so the caller must understand that the stack has to change. + * so the caller must understand that the page stack may change. */ if (TYPE(h) == P_DUPLICATE) { /* Adjust the index for the new item if it's a DB_AFTER op. */ @@ -401,24 +388,7 @@ __bam_iitem(dbp, hp, indxp, key, data, op, flags) return (__db_dput(dbp, data, hp, indxp, __bam_new)); } - /* - * XXX - * Handle partial puts. - * - * This is truly awful from a performance standput. We don't optimize - * for partial puts at all, we delete the record and add it back in, - * regardless of size or if we're simply overwriting current data. - * The hash access method does this a lot better than we do, and we're - * eventually going to have to fix it. - */ - if (F_ISSET(data, DB_DBT_PARTIAL)) { - tdbt = *data; - if ((ret = __bam_partial(dbp, &tdbt, h, indx)) != 0) - return (ret); - data = &tdbt; - } - - /* If it's a short fixed-length record, fix it up. */ + /* Handle fixed-length records: build the real record. */ if (F_ISSET(dbp, DB_RE_FIXEDLEN) && data->size != t->bt_recno->re_len) { tdbt = *data; if ((ret = __bam_fixed(t, &tdbt)) != 0) @@ -427,30 +397,15 @@ __bam_iitem(dbp, hp, indxp, key, data, op, flags) } /* - * If the key or data item won't fit on a page, store it in the - * overflow pages. - * - * !!! - * From this point on, we have to recover the allocated overflow - * pages on error. + * Figure out how much space the data will take, including if it's a + * partial record. If either of the key or data items won't fit on + * a page, we'll have to store them on overflow pages. */ - bigkey = bigdata = 0; - if (LF_ISSET(BI_NEWKEY) && key->size > t->bt_ovflsize) { - B_TSET(kbo.type, B_OVERFLOW, 0); - kbo.tlen = key->size; - if ((ret = __db_poff(dbp, key, &kbo.pgno, __bam_new)) != 0) - goto err; - bigkey = 1; - } - if (data->size > t->bt_ovflsize) { - B_TSET(dbo.type, B_OVERFLOW, 0); - dbo.tlen = data->size; - if ((ret = __db_poff(dbp, data, &dbo.pgno, __bam_new)) != 0) - goto err; - bigdata = 1; - } + bigkey = LF_ISSET(BI_NEWKEY) && key->size > t->bt_ovflsize; + data_size = F_ISSET(data, DB_DBT_PARTIAL) ? + __bam_partsize(dbp, data, h, indx) : data->size; + bigdata = data_size > t->bt_ovflsize; - dcopy = 0; needed = 0; if (LF_ISSET(BI_NEWKEY)) { /* If BI_NEWKEY is set we're adding a new key and data pair. */ @@ -461,7 +416,7 @@ __bam_iitem(dbp, hp, indxp, key, data, op, flags) if (bigdata) needed += BOVERFLOW_PSIZE; else - needed += BKEYDATA_PSIZE(data->size); + needed += BKEYDATA_PSIZE(data_size); } else { /* * We're either overwriting the data item of a key/data pair @@ -482,16 +437,8 @@ __bam_iitem(dbp, hp, indxp, key, data, op, flags) if (bigdata) need_bytes += BOVERFLOW_PSIZE; else - need_bytes += BKEYDATA_PSIZE(data->size); + need_bytes += BKEYDATA_PSIZE(data_size); - /* - * If we're overwriting a data item, we copy it if it's not a - * special record type and it's the same size (including any - * alignment) and do a delete/insert otherwise. - */ - if (op == DB_CURRENT && !bigdata && - B_TYPE(bk->type) == B_KEYDATA && have_bytes == need_bytes) - dcopy = 1; if (have_bytes < need_bytes) needed += need_bytes - have_bytes; } @@ -505,9 +452,15 @@ __bam_iitem(dbp, hp, indxp, key, data, op, flags) * check in the btree split code, so we don't undo it there!?!? */ if (P_FREESPACE(h) < needed || - (t->bt_maxkey != 0 && NUM_ENT(h) > t->bt_maxkey)) { - ret = DB_NEEDSPLIT; - goto err; + (t->bt_maxkey != 0 && NUM_ENT(h) > t->bt_maxkey)) + return (DB_NEEDSPLIT); + + /* Handle partial puts: build the real record. */ + if (F_ISSET(data, DB_DBT_PARTIAL)) { + tdbt = *data; + if ((ret = __bam_partial(dbp, &tdbt, h, indx, data_size)) != 0) + return (ret); + data = &tdbt; } /* @@ -515,10 +468,10 @@ __bam_iitem(dbp, hp, indxp, key, data, op, flags) * * 1. Append a new key/data pair. * 2. Insert a new key/data pair. - * 3. Copy the data item. - * 4. Delete/insert the data item. - * 5. Append a new data item. - * 6. Insert a new data item. + * 3. Append a new data item (a new duplicate). + * 4. Insert a new data item (a new duplicate). + * 5. Overflow item: delete and re-add the data item. + * 6. Replace the data item. */ if (LF_ISSET(BI_NEWKEY)) { switch (op) { @@ -533,42 +486,17 @@ __bam_iitem(dbp, hp, indxp, key, data, op, flags) } /* Add the key. */ - if (bigkey) - OVPUT(h, indx, kbo); - else { - DBT __data; - memset(&__data, 0, sizeof(__data)); - __data.data = key->data; - __data.size = key->size; + if (bigkey) { + if ((ret = __bam_ovput(dbp, h, indx, key)) != 0) + return (ret); + } else if ((ret = __db_pitem(dbp, h, indx, - BKEYDATA_SIZE(key->size), NULL, &__data)) != 0) - goto err; - } + BKEYDATA_SIZE(key->size), NULL, key)) != 0) + return (ret); ++indx; } else { switch (op) { - case DB_CURRENT: /* 3. Copy the data item. */ - /* - * If we're not logging and it's possible, overwrite - * the current item. - * - * XXX - * We should add a separate logging message so that - * we can do this anytime it's possible, including - * for partial record puts. - */ - if (dcopy && !DB_LOGGING(dbp)) { - bk->len = data->size; - memcpy(bk->data, data->data, data->size); - goto done; - } - /* 4. Delete/insert the data item. */ - if (TYPE(h) == P_LBTREE) - ++indx; - if ((ret = __bam_ditem(dbp, h, indx)) != 0) - goto err; - break; - case DB_AFTER: /* 5. Append a new data item. */ + case DB_AFTER: /* 3. Append a new data item. */ if (TYPE(h) == P_LBTREE) { /* * Adjust the cursor and copy in the key for @@ -576,7 +504,7 @@ __bam_iitem(dbp, hp, indxp, key, data, op, flags) */ if ((ret = __bam_adjindx(dbp, h, indx + P_INDX, indx, 1)) != 0) - goto err; + return (ret); indx += 3; dupadjust = 1; @@ -589,7 +517,7 @@ __bam_iitem(dbp, hp, indxp, key, data, op, flags) *indxp += 1; } break; - case DB_BEFORE: /* 6. Insert a new data item. */ + case DB_BEFORE: /* 4. Insert a new data item. */ if (TYPE(h) == P_LBTREE) { /* * Adjust the cursor and copy in the key for @@ -597,43 +525,62 @@ __bam_iitem(dbp, hp, indxp, key, data, op, flags) */ if ((ret = __bam_adjindx(dbp, h, indx, indx, 1)) != 0) - goto err; + return (ret); ++indx; dupadjust = 1; } else __bam_ca_di(dbp, h->pgno, indx, 1); break; + case DB_CURRENT: + if (TYPE(h) == P_LBTREE) + ++indx; + + /* + * 5. Delete/re-add the data item. + * + * If we're dealing with offpage items, we have to + * delete and then re-add the item. + */ + if (bigdata || B_TYPE(bk->type) == B_OVERFLOW) { + if ((ret = __bam_ditem(dbp, h, indx)) != 0) + return (ret); + break; + } + + /* 6. Replace the data item. */ + replace = 1; + break; default: abort(); } } /* Add the data. */ - if (bigdata) - OVPUT(h, indx, dbo); - else { + if (bigdata) { + if ((ret = __bam_ovput(dbp, h, indx, data)) != 0) + return (ret); + } else { BKEYDATA __bk; - DBT __hdr, __data; - memset(&__data, 0, sizeof(__data)); - __data.data = data->data; - __data.size = data->size; + DBT __hdr; if (LF_ISSET(BI_DELETED)) { B_TSET(__bk.type, B_KEYDATA, 1); - __bk.len = __data.size; + __bk.len = data->size; __hdr.data = &__bk; __hdr.size = SSZA(BKEYDATA, data); ret = __db_pitem(dbp, h, indx, - BKEYDATA_SIZE(__data.size), &__hdr, &__data); - } else + BKEYDATA_SIZE(data->size), &__hdr, data); + } else if (replace) + ret = __bam_ritem(dbp, h, indx, data); + else ret = __db_pitem(dbp, h, indx, - BKEYDATA_SIZE(data->size), NULL, &__data); + BKEYDATA_SIZE(data->size), NULL, data); if (ret != 0) - goto err; + return (ret); } -done: ++t->lstat.bt_added; + ++t->lstat.bt_added; ret = memp_fset(dbp->mpf, h, DB_MPOOL_DIRTY); @@ -645,21 +592,205 @@ done: ++t->lstat.bt_added; if (dupadjust && P_FREESPACE(h) <= dbp->pgsize / 2) { --indx; if ((ret = __bam_ndup(dbp, h, indx)) != 0) - goto err; + return (ret); } if (t->bt_recno != NULL) F_SET(t->bt_recno, RECNO_MODIFIED); - if (0) { -err: if (bigkey) - (void)__db_doff(dbp, kbo.pgno, __bam_free); - if (bigdata) - (void)__db_doff(dbp, dbo.pgno, __bam_free); - } return (ret); } +/* + * __bam_partsize -- + * Figure out how much space a partial data item is in total. + */ +static u_int32_t +__bam_partsize(dbp, data, h, indx) + DB *dbp; + DBT *data; + PAGE *h; + u_int32_t indx; +{ + BKEYDATA *bk; + u_int32_t nbytes; + + /* + * Figure out how much total space we'll need. If the record doesn't + * already exist, it's simply the data we're provided. + */ + if (indx >= NUM_ENT(h)) + return (data->doff + data->size); + + /* + * Otherwise, it