summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore27
-rw-r--r--BUILD/SETUP.sh2
-rwxr-xr-xBUILD/compile-solaris-sparc-purify19
-rw-r--r--BitKeeper/etc/config1
-rw-r--r--BitKeeper/etc/gone1271
-rw-r--r--BitKeeper/etc/logging_ok20
-rwxr-xr-xBitKeeper/triggers/post-commit9
-rwxr-xr-xBuild-tools/Do-compile62
-rwxr-xr-xBuild-tools/Do-linux-build2
-rwxr-xr-xBuild-tools/mysql-copyright-29
-rw-r--r--Docs/Makefile.am6
-rwxr-xr-xDocs/Support/docbook-fixup.pl2
-rwxr-xr-xDocs/Support/update-reserved-words.pl3
-rw-r--r--Docs/manual.de.texi2
-rw-r--r--Docs/manual.ja.texi4
-rw-r--r--Docs/manual.texi4113
-rw-r--r--Docs/mirrors.texi28
-rw-r--r--Makefile.am2
-rw-r--r--VC++Files/bdb/bdb.dsp707
-rw-r--r--VC++Files/bdb/build_win32/Berkeley_DB.dsw569
-rw-r--r--VC++Files/bdb/build_win32/db_archive.dsp151
-rw-r--r--VC++Files/bdb/build_win32/db_buildall.dsp128
-rw-r--r--VC++Files/bdb/build_win32/db_checkpoint.dsp151
-rw-r--r--VC++Files/bdb/build_win32/db_deadlock.dsp151
-rw-r--r--VC++Files/bdb/build_win32/db_dll.dsp753
-rw-r--r--VC++Files/bdb/build_win32/db_dump.dsp151
-rw-r--r--VC++Files/bdb/build_win32/db_java.dsp174
-rw-r--r--VC++Files/bdb/build_win32/db_load.dsp151
-rw-r--r--VC++Files/bdb/build_win32/db_printlog.dsp151
-rw-r--r--VC++Files/bdb/build_win32/db_recover.dsp151
-rw-r--r--VC++Files/bdb/build_win32/db_stat.dsp151
-rw-r--r--VC++Files/bdb/build_win32/db_static.dsp714
-rw-r--r--VC++Files/bdb/build_win32/db_tcl.dsp135
-rw-r--r--VC++Files/bdb/build_win32/db_test.dsp99
-rw-r--r--VC++Files/bdb/build_win32/db_upgrade.dsp151
-rw-r--r--VC++Files/bdb/build_win32/db_verify.dsp151
-rw-r--r--VC++Files/bdb/build_win32/ex_access.dsp151
-rw-r--r--VC++Files/bdb/build_win32/ex_btrec.dsp151
-rw-r--r--VC++Files/bdb/build_win32/ex_env.dsp151
-rw-r--r--VC++Files/bdb/build_win32/ex_lock.dsp151
-rw-r--r--VC++Files/bdb/build_win32/ex_mpool.dsp151
-rw-r--r--VC++Files/bdb/build_win32/ex_tpcb.dsp151
-rw-r--r--VC++Files/bdb/build_win32/excxx_access.dsp151
-rw-r--r--VC++Files/bdb/build_win32/excxx_btrec.dsp151
-rw-r--r--VC++Files/bdb/build_win32/excxx_env.dsp151
-rw-r--r--VC++Files/bdb/build_win32/excxx_lock.dsp151
-rw-r--r--VC++Files/bdb/build_win32/excxx_mpool.dsp151
-rw-r--r--VC++Files/bdb/build_win32/excxx_tpcb.dsp151
-rw-r--r--VC++Files/client/mysql.dsp3
-rw-r--r--VC++Files/client/mysqladmin.dsp3
-rw-r--r--VC++Files/client/mysqlcheck.dsp71
-rw-r--r--VC++Files/client/mysqlclient.dsp44
-rw-r--r--VC++Files/client/mysqldump.dsp5
-rw-r--r--VC++Files/client/mysqlimport.dsp5
-rw-r--r--VC++Files/client/mysqlshow.dsp5
-rw-r--r--VC++Files/comp_err/comp_err.dsp58
-rw-r--r--VC++Files/contrib/asm386/zlibvc.dsp651
-rw-r--r--VC++Files/contrib/asm386/zlibvc.dsw41
-rw-r--r--VC++Files/contrib/minizip/zlibvc.dsp651
-rw-r--r--VC++Files/contrib/minizip/zlibvc.dsw41
-rw-r--r--VC++Files/innobase/innobase.dsp25
-rw-r--r--VC++Files/libmysql/libmySQL.dsp19
-rw-r--r--VC++Files/libmysqld/examples/test_libmysqld.dsp66
-rw-r--r--VC++Files/libmysqld/libmysqld.dsp405
-rw-r--r--VC++Files/libmysqltest/myTest.dsp3
-rw-r--r--VC++Files/libmysqltest/mytest.c170
-rw-r--r--VC++Files/merge/merge.dsp8
-rw-r--r--VC++Files/my_print_defaults/my_print_defaults.dsp101
-rw-r--r--VC++Files/myisam/myisam.dsp8
-rw-r--r--VC++Files/mysql.dsw126
-rw-r--r--VC++Files/mysqlbinlog/mysqlbinlog.dsp2
-rw-r--r--VC++Files/mysqlcheck/mysqlcheck.dsp8
-rw-r--r--VC++Files/mysqldemb/mysqldemb.dsp392
-rw-r--r--VC++Files/mysqlmanager/MySqlManager.dsp3
-rw-r--r--VC++Files/mysqlserver/mysqlserver.dsp84
-rw-r--r--VC++Files/mysqlshutdown/mysqlshutdown.c198
-rw-r--r--VC++Files/mysqlwatch/mysqlwatch.c745
-rw-r--r--VC++Files/mysys/mysys.dsp47
-rw-r--r--VC++Files/pack_isam/pack_isam.dsp3
-rw-r--r--VC++Files/perror/perror.dsp4
-rw-r--r--VC++Files/replace/replace.dsp3
-rw-r--r--VC++Files/sql/mysqld.dsp13
-rw-r--r--VC++Files/sql/mysqld.dsw29
-rw-r--r--VC++Files/strings/MASM6x/strings.dsp244
-rw-r--r--VC++Files/strings/MASM6x/strings.dsw29
-rw-r--r--VC++Files/strings/noMASM/strings.dsw29
-rw-r--r--VC++Files/strings/strings.dsw29
-rw-r--r--VC++Files/test1/test1.dsp3
-rw-r--r--VC++Files/thr_insert_test/thr_insert_test.dsp4
-rw-r--r--VC++Files/thr_test/thr_test.dsp3
-rw-r--r--VC++Files/vio/vio.dsp2
-rw-r--r--VC++Files/winmysqladmin/db.cpp80
-rw-r--r--VC++Files/winmysqladmin/db.h32
-rw-r--r--VC++Files/winmysqladmin/images/Goahead.icobin0 -> 766 bytes
-rw-r--r--VC++Files/winmysqladmin/images/HELP.ICObin0 -> 766 bytes
-rw-r--r--VC++Files/winmysqladmin/images/INFO.ICObin0 -> 766 bytes
-rw-r--r--VC++Files/winmysqladmin/images/Info.bmpbin0 -> 644 bytes
-rw-r--r--VC++Files/winmysqladmin/images/MYINI.ICObin0 -> 766 bytes
-rw-r--r--VC++Files/winmysqladmin/images/Myini.bmpbin0 -> 644 bytes
-rw-r--r--VC++Files/winmysqladmin/images/Noentry.icobin0 -> 766 bytes
-rw-r--r--VC++Files/winmysqladmin/images/SETUP.BMPbin0 -> 86878 bytes
-rw-r--r--VC++Files/winmysqladmin/images/Setup 16.bmpbin0 -> 86880 bytes
-rw-r--r--VC++Files/winmysqladmin/images/Table.icobin0 -> 1078 bytes
-rw-r--r--VC++Files/winmysqladmin/images/Working.icobin0 -> 766 bytes
-rw-r--r--VC++Files/winmysqladmin/images/database.icobin0 -> 1078 bytes
-rw-r--r--VC++Files/winmysqladmin/images/find.icobin0 -> 766 bytes
-rw-r--r--VC++Files/winmysqladmin/images/green.icobin0 -> 766 bytes
-rw-r--r--VC++Files/winmysqladmin/images/help.bmpbin0 -> 644 bytes
-rw-r--r--VC++Files/winmysqladmin/images/initsetup.cpp42
-rw-r--r--VC++Files/winmysqladmin/images/killdb.icobin0 -> 1078 bytes
-rw-r--r--VC++Files/winmysqladmin/images/logo.icobin0 -> 2022 bytes
-rw-r--r--VC++Files/winmysqladmin/images/multitrg.icobin0 -> 766 bytes
-rw-r--r--VC++Files/winmysqladmin/images/mysql-07.bmpbin0 -> 9618 bytes
-rw-r--r--VC++Files/winmysqladmin/images/mysql-17.bmpbin0 -> 3806 bytes
-rw-r--r--VC++Files/winmysqladmin/images/mysql.BMPbin0 -> 8760 bytes
-rw-r--r--VC++Files/winmysqladmin/images/red.icobin0 -> 766 bytes
-rw-r--r--VC++Files/winmysqladmin/images/red22.BMPbin0 -> 2104 bytes
-rw-r--r--VC++Files/winmysqladmin/images/see.bmpbin0 -> 644 bytes
-rw-r--r--VC++Files/winmysqladmin/initsetup.cpp40
-rw-r--r--VC++Files/winmysqladmin/initsetup.h38
-rw-r--r--VC++Files/winmysqladmin/main.cpp2529
-rw-r--r--VC++Files/winmysqladmin/main.h314
-rw-r--r--VC++Files/winmysqladmin/mysql.h293
-rw-r--r--VC++Files/winmysqladmin/mysql_com.h242
-rw-r--r--VC++Files/winmysqladmin/mysql_version.h20
-rw-r--r--VC++Files/winmysqladmin/winmysqladmin.cpp38
-rw-r--r--VC++Files/zlib/zlib.dsp3
-rw-r--r--acinclude.m414
-rw-r--r--bdb/dist/acconfig.h1
-rw-r--r--bdb/dist/aclocal/mutex.m412
-rw-r--r--bdb/include/mutex.h22
-rw-r--r--client/client_priv.h4
-rw-r--r--client/mysql.cc289
-rw-r--r--client/mysqladmin.c95
-rw-r--r--client/mysqlbinlog.cc83
-rw-r--r--client/mysqlcheck.c8
-rw-r--r--client/mysqldump.c69
-rw-r--r--client/mysqlimport.c10
-rw-r--r--client/mysqlmanager-pwgen.c7
-rw-r--r--client/mysqlmanagerc.c8
-rw-r--r--client/mysqlshow.c4
-rw-r--r--client/mysqltest.c443
-rw-r--r--configure.in74
-rw-r--r--dbug/dbug.c9
-rw-r--r--extra/resolve_stack_dump.c127
-rw-r--r--include/Makefile.am16
-rw-r--r--include/config-os2.h63
-rw-r--r--include/config-win.h67
-rw-r--r--include/ft_global.h6
-rw-r--r--include/my_aes.h66
-rw-r--r--include/my_alloc.h28
-rw-r--r--include/my_getopt.h2
-rw-r--r--include/my_global.h120
-rw-r--r--include/my_no_pthread.h2
-rw-r--r--include/my_pthread.h34
-rw-r--r--include/my_semaphore.h30
-rw-r--r--include/my_sys.h253
-rw-r--r--include/myisam.h188
-rw-r--r--include/myisammrg.h10
-rw-r--r--include/mysql.h64
-rw-r--r--include/mysql_com.h13
-rw-r--r--include/mysql_embed.h4
-rw-r--r--include/mysql_version.h.in10
-rw-r--r--include/mysqld_error.h20
-rw-r--r--include/raid.h11
-rw-r--r--include/rijndael.h42
-rw-r--r--include/sha1.h67
-rw-r--r--include/sslopt-case.h48
-rw-r--r--include/sslopt-longopts.h2
-rw-r--r--include/sslopt-usage.h2
-rw-r--r--include/thr_alarm.h9
-rw-r--r--include/violite.h10
-rw-r--r--innobase/btr/btr0btr.c30
-rw-r--r--innobase/btr/btr0cur.c99
-rw-r--r--innobase/btr/btr0sea.c165
-rw-r--r--innobase/buf/buf0buf.c114
-rw-r--r--innobase/buf/buf0lru.c39
-rw-r--r--innobase/buf/buf0rea.c29
-rw-r--r--innobase/configure.in7
-rw-r--r--innobase/data/data0data.c115
-rw-r--r--innobase/dict/dict0crea.c1
-rw-r--r--innobase/dict/dict0dict.c57
-rw-r--r--innobase/dict/dict0load.c711
-rw-r--r--innobase/dict/dict0mem.c3
-rw-r--r--innobase/fil/fil0fil.c9
-rw-r--r--innobase/fsp/fsp0fsp.c52
-rw-r--r--innobase/ha/ha0ha.c56
-rw-r--r--innobase/ibuf/ibuf0ibuf.c63
-rw-r--r--innobase/include/btr0btr.h18
-rw-r--r--innobase/include/btr0cur.h3
-rw-r--r--innobase/include/btr0sea.h3
-rw-r--r--innobase/include/buf0buf.h27
-rw-r--r--innobase/include/buf0buf.ic41
-rw-r--r--innobase/include/buf0rea.h2
-rw-r--r--innobase/include/data0data.h10
-rw-r--r--innobase/include/data0data.ic24
-rw-r--r--innobase/include/dict0dict.h20
-rw-r--r--innobase/include/dict0mem.h4
-rw-r--r--innobase/include/dyn0dyn.h18
-rw-r--r--innobase/include/dyn0dyn.ic4
-rw-r--r--innobase/include/fsp0fsp.h10
-rw-r--r--innobase/include/ha0ha.h10
-rw-r--r--innobase/include/ha0ha.ic10
-rw-r--r--innobase/include/ibuf0ibuf.h6
-rw-r--r--innobase/include/lock0lock.h20
-rw-r--r--innobase/include/log0log.h88
-rw-r--r--innobase/include/log0log.ic106
-rw-r--r--innobase/include/log0recv.h7
-rw-r--r--innobase/include/os0file.h24
-rw-r--r--innobase/include/os0sync.ic14
-rw-r--r--innobase/include/os0thread.h42
-rw-r--r--innobase/include/page0page.h2
-rw-r--r--innobase/include/page0page.ic42
-rw-r--r--innobase/include/pars0grm.h168
-rw-r--r--innobase/include/rem0rec.ic2
-rw-r--r--innobase/include/row0mysql.h13
-rw-r--r--innobase/include/srv0srv.h8
-rw-r--r--innobase/include/srv0start.h2
-rw-r--r--innobase/include/sync0arr.h2
-rw-r--r--innobase/include/sync0rw.ic3
-rw-r--r--innobase/include/sync0sync.h12
-rw-r--r--innobase/include/sync0sync.ic4
-rw-r--r--innobase/include/trx0roll.h8
-rw-r--r--innobase/include/trx0sys.h63
-rw-r--r--innobase/include/trx0trx.h39
-rw-r--r--innobase/include/univ.i59
-rw-r--r--innobase/include/ut0dbg.h13
-rw-r--r--innobase/include/ut0mem.h2
-rw-r--r--innobase/include/ut0mem.ic2
-rw-r--r--innobase/include/ut0ut.h21
-rw-r--r--innobase/include/ut0ut.ic22
-rw-r--r--innobase/lock/lock0lock.c551
-rw-r--r--innobase/log/log0log.c227
-rw-r--r--innobase/log/log0recv.c312
-rw-r--r--innobase/mem/mem0dbg.c2
-rw-r--r--innobase/mem/mem0pool.c53
-rw-r--r--innobase/mtr/mtr0log.c41
-rw-r--r--innobase/mtr/mtr0mtr.c2
-rw-r--r--innobase/os/os0file.c208
-rw-r--r--innobase/os/os0sync.c2
-rw-r--r--innobase/os/os0thread.c86
-rw-r--r--innobase/page/page0cur.c31
-rw-r--r--innobase/page/page0page.c60
-rw-r--r--innobase/pars/lexyy.c6690
-rw-r--r--innobase/pars/pars0grm.c663
-rw-r--r--innobase/pars/pars0grm.h168
-rw-r--r--innobase/pars/pars0grm.y11
-rw-r--r--innobase/pars/pars0lex.l34
-rw-r--r--innobase/pars/pars0opt.c3
-rw-r--r--innobase/rem/rem0cmp.c13
-rw-r--r--innobase/row/row0ins.c43
-rw-r--r--innobase/row/row0mysql.c84
-rw-r--r--innobase/row/row0purge.c8
-rw-r--r--innobase/row/row0umod.c5
-rw-r--r--innobase/row/row0upd.c30
-rw-r--r--innobase/row/row0vers.c22
-rw-r--r--innobase/srv/srv0srv.c387
-rw-r--r--innobase/srv/srv0start.c115
-rw-r--r--innobase/sync/sync0arr.c97
-rw-r--r--innobase/sync/sync0rw.c23
-rw-r--r--innobase/sync/sync0sync.c55
-rw-r--r--innobase/thr/thr0loc.c12
-rw-r--r--innobase/trx/trx0roll.c29
-rw-r--r--innobase/trx/trx0sys.c147
-rw-r--r--innobase/trx/trx0trx.c178
-rw-r--r--innobase/trx/trx0undo.c4
-rw-r--r--innobase/ut/ut0mem.c10
-rw-r--r--innobase/ut/ut0ut.c99
-rw-r--r--isam/create.c4
-rw-r--r--isam/isamchk.c12
-rw-r--r--isam/isamlog.c2
-rw-r--r--isam/pack_isam.c9
-rw-r--r--isam/test2.c2
-rw-r--r--isam/test3.c2
-rw-r--r--libmysql/Makefile.am16
-rw-r--r--libmysql/Makefile.shared16
-rw-r--r--libmysql/libmysql.c416
-rw-r--r--libmysql/libmysql.def3
-rw-r--r--libmysql/manager.c28
-rw-r--r--libmysql/net.c826
-rw-r--r--libmysqld/Makefile.am6
-rw-r--r--libmysqld/embedded_priv.h3
-rw-r--r--libmysqld/examples/Makefile.am2
-rw-r--r--libmysqld/lib_sql.cc152
-rw-r--r--libmysqld/lib_vio.c2
-rw-r--r--libmysqld/libmysqld.c3
-rw-r--r--libmysqld/libmysqld.def7
-rwxr-xr-xltconfig4
-rw-r--r--mit-pthreads/.cvsignore6
-rw-r--r--mit-pthreads/COPYRIGHT31
-rw-r--r--mit-pthreads/Changes-mysql237
-rw-r--r--mit-pthreads/FAQ122
-rw-r--r--mit-pthreads/GNUmakefile129
-rw-r--r--mit-pthreads/NOTES59
-rw-r--r--mit-pthreads/NOTES_OSR5_BUILD_SKUNKWARE9745
-rw-r--r--mit-pthreads/README40
-rw-r--r--mit-pthreads/TODO-mysql4
-rw-r--r--mit-pthreads/Whats_New198
-rw-r--r--mit-pthreads/bin/.cvsignore1
-rw-r--r--mit-pthreads/bin/Makefile.in48
-rw-r--r--mit-pthreads/bin/finger/.cvsignore1
-rwxr-xr-xmit-pthreads/bin/finger/Makefile.in60
-rwxr-xr-xmit-pthreads/bin/finger/finger.c231
-rwxr-xr-xmit-pthreads/bin/finger/net.c189
-rwxr-xr-xmit-pthreads/config/COPYING.GNU339
-rwxr-xr-xmit-pthreads/config/COPYRIGHT4
-rwxr-xr-xmit-pthreads/config/GNUmakefile.in129
-rw-r--r--mit-pthreads/config/Makefile.in56
-rw-r--r--mit-pthreads/config/acconfig.h73
-rwxr-xr-xmit-pthreads/config/aclocal.m494
-rwxr-xr-xmit-pthreads/config/config.flags.in80
-rwxr-xr-xmit-pthreads/config/config.guess505
-rwxr-xr-xmit-pthreads/config/config.h.in324
-rwxr-xr-xmit-pthreads/config/config.sub794
-rwxr-xr-xmit-pthreads/config/configure3336
-rwxr-xr-xmit-pthreads/config/configure.in745
-rwxr-xr-xmit-pthreads/config/configure.org2874
-rwxr-xr-xmit-pthreads/config/install-sh238
-rwxr-xr-xmit-pthreads/configure18
-rwxr-xr-xmit-pthreads/gen/GNUmakefile.inc9
-rw-r--r--mit-pthreads/gen/Makefile.inc24
-rw-r--r--mit-pthreads/gen/ctime.c1315
-rw-r--r--mit-pthreads/gen/difftime.c46
-rw-r--r--mit-pthreads/gen/directory.c322
-rw-r--r--mit-pthreads/gen/eprintf.c18
-rw-r--r--mit-pthreads/gen/getcwd.c248
-rw-r--r--mit-pthreads/gen/getpwent.c109
-rw-r--r--mit-pthreads/gen/getpwnamuid.c138
-rw-r--r--mit-pthreads/gen/getwd.c57
-rw-r--r--mit-pthreads/gen/isatty.c95
-rw-r--r--mit-pthreads/gen/popen.c117
-rw-r--r--mit-pthreads/gen/pwd_internal.c97
-rw-r--r--mit-pthreads/gen/pwd_internal.h29
-rw-r--r--mit-pthreads/gen/syslog.c216
-rw-r--r--mit-pthreads/gen/time.c51
-rw-r--r--mit-pthreads/gen/ttyname.c147
-rw-r--r--mit-pthreads/include/Makefile.inc30
-rwxr-xr-xmit-pthreads/include/arpa/inet.h61
-rwxr-xr-xmit-pthreads/include/arpa/nameser.h279
-rw-r--r--mit-pthreads/include/dirent.h97
-rw-r--r--mit-pthreads/include/endian.h95
-rw-r--r--mit-pthreads/include/errno.h52
-rw-r--r--mit-pthreads/include/math.h85
-rw-r--r--mit-pthreads/include/netdb.h146
-rw-r--r--mit-pthreads/include/pthread.h371
-rw-r--r--mit-pthreads/include/pthread/ac-types.h10
-rwxr-xr-xmit-pthreads/include/pthread/cleanup.h59
-rwxr-xr-xmit-pthreads/include/pthread/cond.h102
-rw-r--r--mit-pthreads/include/pthread/config.h5
-rwxr-xr-xmit-pthreads/include/pthread/debug_out.h44
-rwxr-xr-xmit-pthreads/include/pthread/fd.h122
-rwxr-xr-xmit-pthreads/include/pthread/fd_pipe.h54
-rwxr-xr-xmit-pthreads/include/pthread/kernel.h71
-rwxr-xr-xmit-pthreads/include/pthread/kthread.h67
-rwxr-xr-xmit-pthreads/include/pthread/mutex.h102
-rw-r--r--mit-pthreads/include/pthread/paths.h12
-rwxr-xr-xmit-pthreads/include/pthread/prio_queue.h78
-rwxr-xr-xmit-pthreads/include/pthread/pthread_attr.h122
-rwxr-xr-xmit-pthreads/include/pthread/pthread_once.h58
-rwxr-xr-xmit-pthreads/include/pthread/queue.h67
-rwxr-xr-xmit-pthreads/include/pthread/sleep.h63
-rwxr-xr-xmit-pthreads/include/pthread/specific.h66
-rwxr-xr-xmit-pthreads/include/pthread/state.def64
-rwxr-xr-xmit-pthreads/include/pthread/types.h46
-rwxr-xr-xmit-pthreads/include/pthread/unistd.h159
-rwxr-xr-xmit-pthreads/include/pthread/util.h89
-rwxr-xr-xmit-pthreads/include/pthread/version.h43
-rwxr-xr-xmit-pthreads/include/pthread/xtypes.h13
-rw-r--r--mit-pthreads/include/pwd.h93
-rw-r--r--mit-pthreads/include/resolv.h179
-rw-r--r--mit-pthreads/include/sched.h57
-rw-r--r--mit-pthreads/include/signal.h81
-rw-r--r--mit-pthreads/include/stdio.h371
-rw-r--r--mit-pthreads/include/stdlib.h127
-rw-r--r--mit-pthreads/include/string.h85
-rw-r--r--mit-pthreads/include/syslog.h101
-rw-r--r--mit-pthreads/include/time.h102
-rw-r--r--mit-pthreads/include/timers.h45
-rw-r--r--mit-pthreads/include/tzfile.h154
-rw-r--r--mit-pthreads/include/unistd.h183
-rw-r--r--mit-pthreads/lib/.cvsignore1
-rw-r--r--mit-pthreads/lib/Makefile.in48
-rw-r--r--mit-pthreads/lib/libpthreadutil/.cvsignore1
-rwxr-xr-xmit-pthreads/lib/libpthreadutil/Makefile.in65
-rwxr-xr-xmit-pthreads/lib/libpthreadutil/pthread_atexit.c135
-rwxr-xr-xmit-pthreads/lib/libpthreadutil/pthread_tad.c170
-rwxr-xr-xmit-pthreads/lib/libpthreadutil/pthreadutil.h75
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/__math.h16
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/__signal.h106
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/__stdio.h13
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/__stdlib.h3
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/__string.h19
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/__time.h21
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/__unistd.h6
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/cdefs.h62
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/compat.h1
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/dirent.h7
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/signal.h3
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/socket.h296
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/timers.h60
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/uio.h12
-rwxr-xr-xmit-pthreads/machdep/bsdi-1.1/compat.h43
-rwxr-xr-xmit-pthreads/machdep/bsdi-1.1/dirent.h73
-rwxr-xr-xmit-pthreads/machdep/bsdi-1.1/errno.h160
-rwxr-xr-xmit-pthreads/machdep/bsdi-1.1/socket.h277
-rwxr-xr-xmit-pthreads/machdep/bsdi-1.1/timers.h59
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__math.h6
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__path.h13
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__signal.h7
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__stdio.h7
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__stdlib.h60
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__string.h19
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__time.h63
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__unistd.h109
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/compat.h65
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/dirent.h65
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/errno.h162
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/time.h6
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/timers.h45
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/wait.h159
-rw-r--r--mit-pthreads/machdep/engine-alpha-netbsd-1.1.c196
-rw-r--r--mit-pthreads/machdep/engine-alpha-netbsd-1.1.h111
-rw-r--r--mit-pthreads/machdep/engine-alpha-netbsd-1.3.c204
-rw-r--r--mit-pthreads/machdep/engine-alpha-netbsd-1.3.h114
-rw-r--r--mit-pthreads/machdep/engine-alpha-osf1.c207
-rw-r--r--mit-pthreads/machdep/engine-alpha-osf1.h110
-rw-r--r--mit-pthreads/machdep/engine-arm32-netbsd-1.3.c203
-rw-r--r--mit-pthreads/machdep/engine-arm32-netbsd-1.3.h102
-rw-r--r--mit-pthreads/machdep/engine-hppa-hpux-10.20.c169
-rw-r--r--mit-pthreads/machdep/engine-hppa-hpux-10.20.h143
-rw-r--r--mit-pthreads/machdep/engine-hppa-hpux-9.03.c153
-rw-r--r--mit-pthreads/machdep/engine-hppa-hpux-9.03.h141
-rw-r--r--mit-pthreads/machdep/engine-i386-bsdi-1.1.c180
-rw-r--r--mit-pthreads/machdep/engine-i386-bsdi-1.1.h84
-rw-r--r--mit-pthreads/machdep/engine-i386-bsdi-2.0.c210
-rw-r--r--mit-pthreads/machdep/engine-i386-bsdi-2.0.h98
-rw-r--r--mit-pthreads/machdep/engine-i386-freebsd-1.1.c179
-rw-r--r--mit-pthreads/machdep/engine-i386-freebsd-1.1.h83
-rw-r--r--mit-pthreads/machdep/engine-i386-freebsd-2.0.c208
-rw-r--r--mit-pthreads/machdep/engine-i386-freebsd-2.0.h97
-rw-r--r--mit-pthreads/machdep/engine-i386-linux-1.0.c503
-rw-r--r--mit-pthreads/machdep/engine-i386-linux-1.0.h98
-rw-r--r--mit-pthreads/machdep/engine-i386-linux-2.0.c504
-rw-r--r--mit-pthreads/machdep/engine-i386-linux-2.0.h99
-rw-r--r--mit-pthreads/machdep/engine-i386-netbsd-0.9.c155
-rw-r--r--mit-pthreads/machdep/engine-i386-netbsd-0.9.h83
-rw-r--r--mit-pthreads/machdep/engine-i386-netbsd-1.0.c218
-rw-r--r--mit-pthreads/machdep/engine-i386-netbsd-1.0.h97
-rw-r--r--mit-pthreads/machdep/engine-i386-netbsd-1.3.c225
-rw-r--r--mit-pthreads/machdep/engine-i386-netbsd-1.3.h98
-rw-r--r--mit-pthreads/machdep/engine-i386-openbsd-2.0.c215
-rw-r--r--mit-pthreads/machdep/engine-i386-openbsd-2.0.h97
-rwxr-xr-xmit-pthreads/machdep/engine-i386-sco-3.2v5.c1072
-rw-r--r--mit-pthreads/machdep/engine-i386-sco-3.2v5.h104
-rw-r--r--mit-pthreads/machdep/engine-ip22-irix-5.2.c225
-rw-r--r--mit-pthreads/machdep/engine-ip22-irix-5.2.h108
-rw-r--r--mit-pthreads/machdep/engine-m68000-netbsd.c256
-rw-r--r--mit-pthreads/machdep/engine-m68000-netbsd.h107
-rw-r--r--mit-pthreads/machdep/engine-powerpc-netbsd.c227
-rw-r--r--mit-pthreads/machdep/engine-powerpc-netbsd.h109
-rw-r--r--mit-pthreads/machdep/engine-r2000-ultrix-4.2.c209
-rw-r--r--mit-pthreads/machdep/engine-r2000-ultrix-4.2.h107
-rw-r--r--mit-pthreads/machdep/engine-romp-bsd.c99
-rw-r--r--mit-pthreads/machdep/engine-romp-bsd.h100
-rw-r--r--mit-pthreads/machdep/engine-sparc-netbsd-1.3.c232
-rw-r--r--mit-pthreads/machdep/engine-sparc-netbsd-1.3.h106
-rw-r--r--mit-pthreads/machdep/engine-sparc-sunos-4.1.3.c227
-rw-r--r--mit-pthreads/machdep/engine-sparc-sunos-4.1.3.h105
-rw-r--r--mit-pthreads/machdep/engine-sparc-sunos-5.3.c308
-rw-r--r--mit-pthreads/machdep/engine-sparc-sunos-5.3.h129
-rwxr-xr-xmit-pthreads/machdep/freebsd-1.1/compat.h43
-rwxr-xr-xmit-pthreads/machdep/freebsd-1.1/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/freebsd-1.1/socket.h267
-rwxr-xr-xmit-pthreads/machdep/freebsd-1.1/timers.h68
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__math.h6
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__path.h14
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__signal.h8
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__stdio.h8
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__stdlib.h66
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__string.h21
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__time.h70
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__unistd.h113
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/compat.h43
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/errno.h160
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/timers.h45
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/wait.h162
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/__math.h3
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/__signal.h28
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/__stdio.h11
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/__stdlib.h24
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/__string.h20
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/__time.h31
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/__unistd.h68
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/cdefs.h67
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/compat.h45
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/dirent.h61
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/socket.h171
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/stdtypes.h74
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/time.h228
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/timers.h71
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/uio.h25
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/wait.h92
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/__math.h3
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/__signal.h28
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/__stdio.h8
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/__stdlib.h24
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/__string.h20
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/__time.h31
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/__unistd.h66
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/cdefs.h61
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/compat.h45
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/dirent.h61
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/socket.h171
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/stdtypes.h74
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/time.h228
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/timers.h68
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/uio.h25
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/wait.h92
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/__math.h4
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/__signal.h15
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/__stdio.h6
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/__stdlib.h30
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/__string.h5
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/__time.h21
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/__unistd.h8
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/compat.h45
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/dirent.h21
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/socket.h304
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/timers.h18
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/wait.h104
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__math.h4
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__path.h14
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__signal.h24
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__stdio.h7
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__stdlib.h20
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__string.h18
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__time.h72
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__unistd.h56
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/cdefs.h23
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/compat.h47
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/dirent.h27
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/errno.h12
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/socket.h193
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/timers.h71
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/uio.h15
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/wait.h98
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__math.h4
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__path.h14
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__signal.h86
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__stdio.h12
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__stdlib.h20
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__string.h18
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__time.h78
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__unistd.h62
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/cdefs.h36
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/compat.h47
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/dirent.h27
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/errno.h12
-rw-r--r--mit-pthreads/machdep/linux-2.0/extra/bits/local_lim.h15
-rw-r--r--mit-pthreads/machdep/linux-2.0/extra/bits/pthreadtypes.h0
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/extra/bits/socket.h198
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/socket.h13
-rw-r--r--mit-pthreads/machdep/linux-2.0/socketcall.h0
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/timers.h71
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/uio.h15
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/wait.h98
-rwxr-xr-xmit-pthreads/machdep/netbsd-0.9/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__math.h6
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__path.h14
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__signal.h8
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__stdio.h8
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__stdlib.h60
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__string.h20
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__time.h69
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__unistd.h107
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/compat.h43
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/errno.h160
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/time.h125
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/timers.h45
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/wait.h158
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__math.h6
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__path.h14
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__signal.h27
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__stdio.h8
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__stdlib.h60
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__string.h20
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__time.h69
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__unistd.h107
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/compat.h43
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/dirent.h95
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/errno.h170
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/time.h153
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/timers.h45
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/wait.h163
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__math.h6
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__path.h14
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__signal.h8
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__stdio.h8
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__stdlib.h66
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__string.h21
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__time.h70
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__unistd.h109
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/compat.h43
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/errno.h160
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/timers.h45
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/wait.h162
-rw-r--r--mit-pthreads/machdep/posix-alpha-osf1.h7
-rw-r--r--mit-pthreads/machdep/posix-bsdi-1.1.h34
-rw-r--r--mit-pthreads/machdep/posix-bsdi-2.0.h34
-rw-r--r--mit-pthreads/machdep/posix-freebsd-1.1.h33
-rw-r--r--mit-pthreads/machdep/posix-freebsd-2.0.h31
-rw-r--r--mit-pthreads/machdep/posix-hpux-10.20.h23
-rw-r--r--mit-pthreads/machdep/posix-hpux-9.03.h23
-rw-r--r--mit-pthreads/machdep/posix-i386-sco-3.2v5.h35
-rw-r--r--mit-pthreads/machdep/posix-irix-5.2.h31
-rw-r--r--mit-pthreads/machdep/posix-linux-1.0.h31
-rw-r--r--mit-pthreads/machdep/posix-linux-2.0.h31
-rw-r--r--mit-pthreads/machdep/posix-netbsd-0.9.h22
-rw-r--r--mit-pthreads/machdep/posix-netbsd-1.0.h31
-rw-r--r--mit-pthreads/machdep/posix-netbsd-1.1.h31
-rw-r--r--mit-pthreads/machdep/posix-openbsd-2.0.h31
-rw-r--r--mit-pthreads/machdep/posix-romp-bsd.h33
-rw-r--r--mit-pthreads/machdep/posix-sco-3.2v5.h35
-rw-r--r--mit-pthreads/machdep/posix-sunos-4.1.3.h27
-rw-r--r--mit-pthreads/machdep/posix-sunos-5.3.h22
-rw-r--r--mit-pthreads/machdep/posix-sunos-5.5.h22
-rw-r--r--mit-pthreads/machdep/posix-ultrix-4.2.h24
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__math.h5
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__path.h12
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__signal.h11
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__stdio.h4
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__stdlib.h28
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__string.h14
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__time.h2
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__unistd.h73
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/cdefs.h61
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/compat.h45
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/fcntlcom.h163
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/signal.h98
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/stat.h94
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/time.h69
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/timers.h68
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/wait.h22
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/__math.h16
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/__signal.h19
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/__stdio.h6
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/__stdlib.h27
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/__string.h12
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/__time.h69
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/__unistd.h47
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/cdefs.h59
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/compat.h45
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/socket.h180
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/timers.h72
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/uio.h40
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/__math.h16
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/__signal.h19
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/__stdio.h6
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/__stdlib.h27
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/__string.h12
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/__time.h69
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/__unistd.h47
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/cdefs.h59
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/compat.h45
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/socket.h180
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/timers.h70
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/uio.h40
-rw-r--r--mit-pthreads/machdep/syscall-alpha-netbsd-1.1.S206
-rw-r--r--mit-pthreads/machdep/syscall-alpha-netbsd-1.3.S228
-rw-r--r--mit-pthreads/machdep/syscall-alpha-osf1.S97
-rw-r--r--mit-pthreads/machdep/syscall-arm32-netbsd-1.3.S193
-rw-r--r--mit-pthreads/machdep/syscall-hppa-hpux-10.20.S23
-rw-r--r--mit-pthreads/machdep/syscall-hppa-hpux-9.03.S23
-rw-r--r--mit-pthreads/machdep/syscall-i386-bsdi-1.1.S288
-rw-r--r--mit-pthreads/machdep/syscall-i386-bsdi-2.0.S294
-rw-r--r--mit-pthreads/machdep/syscall-i386-freebsd-1.1.S293
-rw-r--r--mit-pthreads/machdep/syscall-i386-freebsd-2.0.S240
-rw-r--r--mit-pthreads/machdep/syscall-i386-linux-1.0.S406
-rw-r--r--mit-pthreads/machdep/syscall-i386-linux-2.0.S389
-rw-r--r--mit-pthreads/machdep/syscall-i386-netbsd-0.9.S229
-rw-r--r--mit-pthreads/machdep/syscall-i386-netbsd-1.0.S158
-rw-r--r--mit-pthreads/machdep/syscall-i386-netbsd-1.1.S181
-rw-r--r--mit-pthreads/machdep/syscall-i386-netbsd-1.3.S200
-rw-r--r--mit-pthreads/machdep/syscall-i386-openbsd-2.0.S237
-rw-r--r--mit-pthreads/machdep/syscall-i386-sco-3.2v5.S442
-rw-r--r--mit-pthreads/machdep/syscall-ip22-irix-5.2.S106
-rw-r--r--mit-pthreads/machdep/syscall-m68000-netbsd.S83
-rw-r--r--mit-pthreads/machdep/syscall-powerpc-netbsd.S185
-rw-r--r--mit-pthreads/machdep/syscall-r2000-ultrix-4.2.S166
-rw-r--r--mit-pthreads/machdep/syscall-romp-bsd.S327
-rw-r--r--mit-pthreads/machdep/syscall-sparc-netbsd-1.1.S102
-rw-r--r--mit-pthreads/machdep/syscall-sparc-netbsd-1.3.S172
-rw-r--r--mit-pthreads/machdep/syscall-sparc-sunos-4.1.3.S113
-rw-r--r--mit-pthreads/machdep/syscall-sparc-sunos-5.3.S65
-rw-r--r--mit-pthreads/machdep/syscall-sparc-sunos4.S113
-rw-r--r--mit-pthreads/machdep/syscall-template-alpha-netbsd-1.1.S46
-rw-r--r--mit-pthreads/machdep/syscall-template-alpha-netbsd-1.3.S53
-rw-r--r--mit-pthreads/machdep/syscall-template-alpha-osf1.S46
-rw-r--r--mit-pthreads/machdep/syscall-template-arm32-netbsd-1.3.S55
-rw-r--r--mit-pthreads/machdep/syscall-template-hppa-hpux-10.20.S27
-rw-r--r--mit-pthreads/machdep/syscall-template-hppa-hpux-9.03.S27
-rw-r--r--mit-pthreads/machdep/syscall-template-i386-bsdi-2.0.S48
-rw-r--r--mit-pthreads/machdep/syscall-template-i386-freebsd-2.0.S59
-rw-r--r--mit-pthreads/machdep/syscall-template-i386-netbsd-1.1.S49
-rw-r--r--mit-pthreads/machdep/syscall-template-i386-netbsd-1.3.S56
-rw-r--r--mit-pthreads/machdep/syscall-template-i386-netbsd1.0.S49
-rw-r--r--mit-pthreads/machdep/syscall-template-i386-openbsd-2.0.S48
-rw-r--r--mit-pthreads/machdep/syscall-template-i386-sco-3.2v5.S67
-rw-r--r--mit-pthreads/machdep/syscall-template-ip22-irix-5.2.S51
-rw-r--r--mit-pthreads/machdep/syscall-template-m68000-netbsd.S43
-rw-r--r--mit-pthreads/machdep/syscall-template-powerpc-netbsd.S45
-rw-r--r--mit-pthreads/machdep/syscall-template-r2000-ultrix-4.2.S77
-rw-r--r--mit-pthreads/machdep/syscall-template-sparc-netbsd-1.1.S40
-rw-r--r--mit-pthreads/machdep/syscall-template-sparc-netbsd-1.3.S48
-rw-r--r--mit-pthreads/machdep/syscall-template-sparc-sunos-5.3.S45
-rw-r--r--mit-pthreads/machdep/syscall-template-sparc-sunos4.S40
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/__math.h2
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/__signal.h66
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/__stdio.h7
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/__stdlib.h21
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/__string.h17
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/__time.h69
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/__unistd.h51
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/cdefs.h66
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/compat.h45
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/dirent.h61
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/errno.h180
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/time.h83
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/timers.h68
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/wait.h121
-rw-r--r--mit-pthreads/machdep/unistd-i386-freebsd-1.1.h178
-rw-r--r--mit-pthreads/machdep/unistd-i386-linux-1.0.h59
-rw-r--r--mit-pthreads/machdep/unistd-i386-linux-2.0.h59
-rw-r--r--mit-pthreads/machdep/unistd-sparc-sunos-4.1.3.h215
-rw-r--r--mit-pthreads/net/GNUmakefile.inc14
-rw-r--r--mit-pthreads/net/Makefile.inc13
-rw-r--r--mit-pthreads/net/gethostbyaddr.c161
-rw-r--r--mit-pthreads/net/gethostbyname.c167
-rw-r--r--mit-pthreads/net/gethostent.c162
-rw-r--r--mit-pthreads/net/gethostname.c22
-rw-r--r--mit-pthreads/net/getnetbyaddr.c65
-rw-r--r--mit-pthreads/net/getnetbyname.c72
-rw-r--r--mit-pthreads/net/getnetent.c145
-rw-r--r--mit-pthreads/net/getproto.c65
-rw-r--r--mit-pthreads/net/getprotoent.c143
-rw-r--r--mit-pthreads/net/getprotoname.c73
-rw-r--r--mit-pthreads/net/getservbyname.c76
-rw-r--r--mit-pthreads/net/getservbyport.c68
-rw-r--r--mit-pthreads/net/getservent.c146
-rw-r--r--mit-pthreads/net/herror.c92
-rw-r--r--mit-pthreads/net/inet_addr.c156
-rw-r--r--mit-pthreads/net/inet_lnaof.c61
-rw-r--r--mit-pthreads/net/inet_makeaddr.c64
-rw-r--r--mit-pthreads/net/inet_netof.c60
-rw-r--r--mit-pthreads/net/inet_network.c98
-rw-r--r--mit-pthreads/net/inet_ntoa.c85
-rw-r--r--mit-pthreads/net/net_internal.c78
-rw-r--r--mit-pthreads/net/net_internal.h58
-rw-r--r--mit-pthreads/net/proto_internal.c78
-rw-r--r--mit-pthreads/net/proto_internal.h58
-rw-r--r--mit-pthreads/net/res_comp.c340
-rw-r--r--mit-pthreads/net/res_debug.c749
-rw-r--r--mit-pthreads/net/res_init.c55
-rw-r--r--mit-pthreads/net/res_internal.c576
-rw-r--r--mit-pthreads/net/res_internal.h85
-rw-r--r--mit-pthreads/net/res_mkquery.c212
-rw-r--r--mit-pthreads/net/res_query.c97
-rw-r--r--mit-pthreads/net/res_querydomain.c66
-rw-r--r--mit-pthreads/net/res_search.c168
-rw-r--r--mit-pthreads/net/res_send.c313
-rw-r--r--mit-pthreads/net/serv_internal.c80
-rw-r--r--mit-pthreads/net/serv_internal.h58
-rwxr-xr-xmit-pthreads/patches/Streepy.html2873
-rwxr-xr-xmit-pthreads/patches/Streepy2.html93
-rwxr-xr-xmit-pthreads/patches/bill_lear70
-rwxr-xr-xmit-pthreads/patches/chris_demetriou149
-rwxr-xr-xmit-pthreads/patches/mevans642
-rwxr-xr-xmit-pthreads/patches/p15390
-rwxr-xr-xmit-pthreads/patches/p15596
-rw-r--r--mit-pthreads/pthreads/GNUmakefile.inc46
-rw-r--r--mit-pthreads/pthreads/Makefile.inc75
-rw-r--r--mit-pthreads/pthreads/_exit.c80
-rw-r--r--mit-pthreads/pthreads/cleanup.c84
-rw-r--r--mit-pthreads/pthreads/cond.c437
-rw-r--r--mit-pthreads/pthreads/condattr.c90
-rw-r--r--mit-pthreads/pthreads/dump_state.c88
-rw-r--r--mit-pthreads/pthreads/errno.c53
-rw-r--r--mit-pthreads/pthreads/fd.c1083
-rw-r--r--mit-pthreads/pthreads/fd_kern.c1950
-rw-r--r--mit-pthreads/pthreads/fd_pipe.c257
-rw-r--r--mit-pthreads/pthreads/fd_sysv.c897
-rw-r--r--mit-pthreads/pthreads/file.c129
-rw-r--r--mit-pthreads/pthreads/globals.c85
-rw-r--r--mit-pthreads/pthreads/info.c77
-rw-r--r--mit-pthreads/pthreads/init.cc9
-rw-r--r--mit-pthreads/pthreads/malloc.c383
-rw-r--r--mit-pthreads/pthreads/mutex.c371
-rw-r--r--mit-pthreads/pthreads/mutexattr.c90
-rw-r--r--mit-pthreads/pthreads/panic.c58
-rw-r--r--mit-pthreads/pthreads/prio_queue.c176
-rw-r--r--mit-pthreads/pthreads/process.c208
-rw-r--r--mit-pthreads/pthreads/pthread.c293
-rw-r--r--mit-pthreads/pthreads/pthread_attr.c255
-rw-r--r--mit-pthreads/pthreads/pthread_cancel.c258
-rw-r--r--mit-pthreads/pthreads/pthread_detach.c92
-rw-r--r--mit-pthreads/pthreads/pthread_init.c135
-rw-r--r--mit-pthreads/pthreads/pthread_join.c139
-rw-r--r--mit-pthreads/pthreads/pthread_kill.c93
-rw-r--r--mit-pthreads/pthreads/pthread_once.c59
-rw-r--r--mit-pthreads/pthreads/queue.c143
-rw-r--r--mit-pthreads/pthreads/readv.c85
-rw-r--r--mit-pthreads/pthreads/schedparam.c170
-rw-r--r--mit-pthreads/pthreads/select.c255
-rw-r--r--mit-pthreads/pthreads/sig.c452
-rw-r--r--mit-pthreads/pthreads/signal.c653
-rw-r--r--mit-pthreads/pthreads/sleep.c367
-rw-r--r--mit-pthreads/pthreads/specific.c198
-rw-r--r--mit-pthreads/pthreads/stat.c116
-rw-r--r--mit-pthreads/pthreads/wait.c159
-rw-r--r--mit-pthreads/pthreads/wrapper.c149
-rw-r--r--mit-pthreads/pthreads/writev.c89
-rwxr-xr-xmit-pthreads/scripts/GNUmakefile.inc24
-rw-r--r--mit-pthreads/scripts/Makefile.inc30
-rwxr-xr-xmit-pthreads/scripts/pgcc.sh32
-rwxr-xr-xmit-pthreads/stdio/GNUmakefile.inc26
-rw-r--r--mit-pthreads/stdio/Makefile.inc20
-rwxr-xr-xmit-pthreads/stdio/README41
-rw-r--r--mit-pthreads/stdio/clrerr.c51
-rw-r--r--mit-pthreads/stdio/fclose.c73
-rw-r--r--mit-pthreads/stdio/fdopen.c93
-rw-r--r--mit-pthreads/stdio/feof.c55
-rw-r--r--mit-pthreads/stdio/ferror.c55
-rw-r--r--mit-pthreads/stdio/fflush.c98
-rw-r--r--mit-pthreads/stdio/fgetc.c65
-rw-r--r--mit-pthreads/stdio/fgetline.c170
-rw-r--r--mit-pthreads/stdio/fgetpos.c85
-rw-r--r--mit-pthreads/stdio/fgets.c110
-rw-r--r--mit-pthreads/stdio/fileno.c55
-rw-r--r--mit-pthreads/stdio/findfp.c161
-rw-r--r--mit-pthreads/stdio/flags.c93
-rw-r--r--mit-pthreads/stdio/floatio.h47
-rw-r--r--mit-pthreads/stdio/fopen.c90
-rw-r--r--mit-pthreads/stdio/fprintf.c71
-rw-r--r--mit-pthreads/stdio/fpurge.c73
-rw-r--r--mit-pthreads/stdio/fputc.c73
-rw-r--r--mit-pthreads/stdio/fputs.c67
-rw-r--r--mit-pthreads/stdio/fread.c84
-rw-r--r--mit-pthreads/stdio/freopen.c149
-rw-r--r--mit-pthreads/stdio/fscanf.c73
-rw-r--r--mit-pthreads/stdio/fseek.c248
-rw-r--r--mit-pthreads/stdio/fsetpos.c54
-rw-r--r--mit-pthreads/stdio/ftell.c90
-rw-r--r--mit-pthreads/stdio/funopen.c105
-rw-r--r--mit-pthreads/stdio/fvwrite.c190
-rw-r--r--mit-pthreads/stdio/fvwrite.h54
-rw-r--r--mit-pthreads/stdio/fwalk.c132
-rw-r--r--mit-pthreads/stdio/fwrite.c80
-rw-r--r--mit-pthreads/stdio/getc.c58
-rw-r--r--mit-pthreads/stdio/getc_unlocked.c55
-rw-r--r--mit-pthreads/stdio/getchar.c58
-rw-r--r--mit-pthreads/stdio/getchar_unlocked.c54
-rw-r--r--mit-pthreads/stdio/gets.c71
-rw-r--r--mit-pthreads/stdio/getw.c51
-rw-r--r--mit-pthreads/stdio/glue.h49
-rw-r--r--mit-pthreads/stdio/local.h90
-rw-r--r--mit-pthreads/stdio/makebuf.c122
-rw-r--r--mit-pthreads/stdio/mktemp.c126
-rw-r--r--mit-pthreads/stdio/perror.c67
-rw-r--r--mit-pthreads/stdio/printf.c56
-rw-r--r--mit-pthreads/stdio/putc.c60
-rw-r--r--mit-pthreads/stdio/putc_unlocked.c56
-rw-r--r--mit-pthreads/stdio/putchar.c60
-rw-r--r--mit-pthreads/stdio/putchar_unlocked.c56
-rw-r--r--mit-pthreads/stdio/puts.c71
-rw-r--r--mit-pthreads/stdio/putw.c64
-rw-r--r--mit-pthreads/stdio/refill.c189
-rw-r--r--mit-pthreads/stdio/remove.c50
-rw-r--r--mit-pthreads/stdio/rewind.c55
-rw-r--r--mit-pthreads/stdio/rget.c58
-rw-r--r--mit-pthreads/stdio/scanf.c72
-rw-r--r--mit-pthreads/stdio/setbuf.c52
-rw-r--r--mit-pthreads/stdio/setbuffer.c64
-rw-r--r--mit-pthreads/stdio/setvbuf.c154
-rw-r--r--mit-pthreads/stdio/snprintf.c79
-rw-r--r--mit-pthreads/stdio/sprintf.c78
-rw-r--r--mit-pthreads/stdio/sscanf.c79
-rw-r--r--mit-pthreads/stdio/stdio.c104
-rw-r--r--mit-pthreads/stdio/strerror.c72
-rw-r--r--mit-pthreads/stdio/tempnam.c87
-rw-r--r--mit-pthreads/stdio/tmpfile.c80
-rw-r--r--mit-pthreads/stdio/tmpnam.c55
-rw-r--r--mit-pthreads/stdio/ungetc.c155
-rw-r--r--mit-pthreads/stdio/vfprintf.c788
-rw-r--r--mit-pthreads/stdio/vfscanf.c750
-rw-r--r--mit-pthreads/stdio/vprintf.c51
-rw-r--r--mit-pthreads/stdio/vscanf.c55
-rw-r--r--mit-pthreads/stdio/vsnprintf.c65
-rw-r--r--mit-pthreads/stdio/vsprintf.c62
-rw-r--r--mit-pthreads/stdio/vsscanf.c62
-rw-r--r--mit-pthreads/stdio/wbuf.c89
-rw-r--r--mit-pthreads/stdio/wsetup.c91
-rw-r--r--mit-pthreads/stdio/xprintf.c883
-rwxr-xr-xmit-pthreads/stdlib/GNUmakefile.inc7
-rw-r--r--mit-pthreads/stdlib/Makefile.inc10
-rw-r--r--mit-pthreads/stdlib/abort.c67
-rw-r--r--mit-pthreads/stdlib/atexit.h46
-rw-r--r--mit-pthreads/stdlib/exit.c89
-rw-r--r--mit-pthreads/stdlib/getopt.c135
-rw-r--r--mit-pthreads/stdlib/rand.c64
-rw-r--r--mit-pthreads/stdlib/random.c389
-rw-r--r--mit-pthreads/stdlib/strtod.c178
-rw-r--r--mit-pthreads/stdlib/strtol.c131
-rw-r--r--mit-pthreads/stdlib/strtoul.c109
-rw-r--r--mit-pthreads/stdlib/system.c83
-rwxr-xr-xmit-pthreads/string/GNUmakefile.inc7
-rw-r--r--mit-pthreads/string/Makefile.inc8
-rw-r--r--mit-pthreads/string/strtok.c119
-rw-r--r--mit-pthreads/tests/.cvsignore1
-rw-r--r--mit-pthreads/tests/Makefile.in164
-rwxr-xr-xmit-pthreads/tests/README26
-rw-r--r--mit-pthreads/tests/bench_fcntl.c82
-rw-r--r--mit-pthreads/tests/bench_pipe.c115
-rw-r--r--mit-pthreads/tests/bench_read.c88
-rw-r--r--mit-pthreads/tests/p_bench_getpid.c78
-rw-r--r--mit-pthreads/tests/p_bench_mutex.c78
-rw-r--r--mit-pthreads/tests/p_bench_pthread_create.c92
-rw-r--r--mit-pthreads/tests/p_bench_read.c103
-rw-r--r--mit-pthreads/tests/p_bench_semaphore.c82
-rw-r--r--mit-pthreads/tests/p_bench_yield.c123
-rw-r--r--mit-pthreads/tests/test_create.c35
-rw-r--r--mit-pthreads/tests/test_cwd.c11
-rw-r--r--mit-pthreads/tests/test_execve.c57
-rw-r--r--mit-pthreads/tests/test_fcntl.c32
-rw-r--r--mit-pthreads/tests/test_fork.c60
-rw-r--r--mit-pthreads/tests/test_netdb.c110
-rw-r--r--mit-pthreads/tests/test_pause.c19
-rw-r--r--mit-pthreads/tests/test_preemption.c38
-rw-r--r--mit-pthreads/tests/test_preemption_float.c98
-rw-r--r--mit-pthreads/tests/test_pthread_cond_timedwait.c93
-rw-r--r--mit-pthreads/tests/test_pthread_join.c78
-rw-r--r--mit-pthreads/tests/test_pthread_mutex.c221
-rw-r--r--mit-pthreads/tests/test_pw.c20
-rw-r--r--mit-pthreads/tests/test_readdir.c42
-rw-r--r--mit-pthreads/tests/test_select.c115
-rw-r--r--mit-pthreads/tests/test_setjmp.c13
-rw-r--r--mit-pthreads/tests/test_sleep.c46
-rw-r--r--mit-pthreads/tests/test_sock_1.c204
-rw-r--r--mit-pthreads/tests/test_sock_2.c116
-rw-r--r--mit-pthreads/tests/test_sock_2a.c87
-rw-r--r--mit-pthreads/tests/test_stdio_1.c124
-rw-r--r--mit-pthreads/tests/test_switch.c97
-rw-r--r--myisam/ft_boolean_search.c121
-rw-r--r--myisam/ft_dump.c24
-rw-r--r--myisam/ft_eval.c62
-rw-r--r--myisam/ft_nlq_search.c63
-rw-r--r--myisam/ft_parser.c4
-rw-r--r--myisam/ft_static.c26
-rw-r--r--myisam/ft_test1.c12
-rw-r--r--myisam/ft_update.c43
-rw-r--r--myisam/mi_cache.c64
-rw-r--r--myisam/mi_check.c1092
-rw-r--r--myisam/mi_close.c8
-rw-r--r--myisam/mi_create.c13
-rw-r--r--myisam/mi_delete_all.c2
-rw-r--r--myisam/mi_dynrec.c67
-rw-r--r--myisam/mi_extra.c47
-rw-r--r--myisam/mi_key.c3
-rw-r--r--myisam/mi_locking.c2
-rw-r--r--myisam/mi_open.c46
-rw-r--r--myisam/mi_packrec.c8
-rw-r--r--myisam/mi_static.c6
-rw-r--r--myisam/mi_statrec.c2
-rw-r--r--myisam/mi_test1.c2
-rw-r--r--myisam/mi_test2.c39
-rw-r--r--myisam/mi_test3.c10
-rw-r--r--myisam/mi_unique.c18
-rw-r--r--myisam/mi_update.c27
-rw-r--r--myisam/mi_write.c22
-rw-r--r--myisam/myisamchk.c419
-rw-r--r--myisam/myisamdef.h34
-rw-r--r--myisam/myisamlog.c4
-rw-r--r--myisam/myisampack.c16
-rw-r--r--myisam/sort.c541
-rw-r--r--myisammrg/myrg_delete.c9
-rw-r--r--myisammrg/myrg_extra.c12
-rw-r--r--myisammrg/myrg_locking.c4
-rw-r--r--myisammrg/myrg_open.c8
-rw-r--r--myisammrg/myrg_rnext.c3
-rw-r--r--myisammrg/myrg_rprev.c3
-rw-r--r--myisammrg/myrg_rrnd.c10
-rw-r--r--myisammrg/myrg_rsame.c10
-rw-r--r--myisammrg/myrg_update.c3
-rw-r--r--myisammrg/myrg_write.c2
-rw-r--r--mysql-test/include/master-slave.inc4
-rw-r--r--mysql-test/install_test_db.sh35
-rw-r--r--mysql-test/mysql-test-run.sh74
-rw-r--r--mysql-test/r/bigint.result3
-rw-r--r--mysql-test/r/create.result2
-rw-r--r--mysql-test/r/ctype_latin1_de.result5
-rw-r--r--mysql-test/r/distinct.result30
-rw-r--r--mysql-test/r/fulltext.result11
-rw-r--r--mysql-test/r/func_if.result6
-rw-r--r--mysql-test/r/func_math.result15
-rw-r--r--mysql-test/r/func_str.result39
-rw-r--r--mysql-test/r/func_test.result6
-rw-r--r--mysql-test/r/grant_cache.result4
-rw-r--r--mysql-test/r/group_by.result50
-rw-r--r--mysql-test/r/innodb.result44
-rw-r--r--mysql-test/r/innodb_handler.result139
-rw-r--r--mysql-test/r/insert.result28
-rw-r--r--mysql-test/r/insert_select.result2
-rw-r--r--mysql-test/r/key.result31
-rw-r--r--mysql-test/r/merge.result99
-rw-r--r--mysql-test/r/multi_update.result69
-rw-r--r--mysql-test/r/myisam.result25
-rw-r--r--mysql-test/r/olap.result27
-rw-r--r--mysql-test/r/query_cache.result42
-rw-r--r--mysql-test/r/rpl000001.result20
-rw-r--r--mysql-test/r/rpl000002.result5
-rw-r--r--mysql-test/r/rpl000003.result1
-rw-r--r--mysql-test/r/rpl000004.result3
-rw-r--r--mysql-test/r/rpl000005.result1
-rw-r--r--mysql-test/r/rpl000006.result1
-rw-r--r--mysql-test/r/rpl000007.result3
-rw-r--r--mysql-test/r/rpl000008.result1
-rw-r--r--mysql-test/r/rpl000009.result1
-rw-r--r--mysql-test/r/rpl000010.result1
-rw-r--r--mysql-test/r/rpl000011.result2
-rw-r--r--mysql-test/r/rpl000012.result1
-rw-r--r--mysql-test/r/rpl000013.result1
-rw-r--r--mysql-test/r/rpl000015.result1
-rw-r--r--mysql-test/r/rpl000017.result4
-rw-r--r--mysql-test/r/rpl_alter.result21
-rw-r--r--mysql-test/r/rpl_compat.result77
-rw-r--r--mysql-test/r/rpl_empty_master_crash.result7
-rw-r--r--mysql-test/r/rpl_get_lock.result10
-rw-r--r--mysql-test/r/rpl_log.result3
-rw-r--r--mysql-test/r/rpl_log_pos.result (renamed from mysql-test/r/rpl000014.result)21
-rw-r--r--mysql-test/r/rpl_magic.result1
-rw-r--r--mysql-test/r/rpl_mystery22.result2
-rw-r--r--mysql-test/r/rpl_rotate_logs.result (renamed from mysql-test/r/rpl000016.result)27
-rw-r--r--mysql-test/r/rpl_skip_error.result1
-rw-r--r--mysql-test/r/rpl_sporadic_master.result2
-rw-r--r--mysql-test/r/select.result24
-rw-r--r--mysql-test/r/select_found.result18
-rw-r--r--mysql-test/r/truncate.result2
-rw-r--r--mysql-test/r/type_decimal.result52
-rw-r--r--mysql-test/r/union.result6
-rw-r--r--mysql-test/r/user_var.result2
-rw-r--r--mysql-test/r/variables.result289
-rw-r--r--mysql-test/t/bigint.test8
-rw-r--r--mysql-test/t/create.test2
-rw-r--r--mysql-test/t/ctype_latin1_de.test3
-rw-r--r--mysql-test/t/distinct.test24
-rw-r--r--mysql-test/t/fulltext.test5
-rw-r--r--mysql-test/t/func_if.test4
-rw-r--r--mysql-test/t/func_math.test5
-rw-r--r--mysql-test/t/func_str.test14
-rw-r--r--mysql-test/t/func_test.test2
-rw-r--r--mysql-test/t/group_by.test39
-rw-r--r--mysql-test/t/innodb.test36
-rw-r--r--mysql-test/t/innodb_handler.test76
-rw-r--r--mysql-test/t/insert.test27
-rw-r--r--mysql-test/t/key.test20
-rw-r--r--mysql-test/t/merge.test29
-rw-r--r--mysql-test/t/multi_update.test78
-rw-r--r--mysql-test/t/myisam.test27
-rw-r--r--mysql-test/t/olap.test27
-rw-r--r--mysql-test/t/query_cache.test37
-rw-r--r--mysql-test/t/rpl000001.test52
-rw-r--r--mysql-test/t/rpl000002.test5
-rw-r--r--mysql-test/t/rpl000003.test1
-rw-r--r--mysql-test/t/rpl000004.test3
-rw-r--r--mysql-test/t/rpl000005.test1
-rw-r--r--mysql-test/t/rpl000006.test1
-rw-r--r--mysql-test/t/rpl000007.test2
-rw-r--r--mysql-test/t/rpl000009.test19
-rw-r--r--mysql-test/t/rpl000011.test2
-rw-r--r--mysql-test/t/rpl000013.test1
-rw-r--r--mysql-test/t/rpl000017.test4
-rw-r--r--mysql-test/t/rpl000018.test5
-rw-r--r--mysql-test/t/rpl_alter.test19
-rw-r--r--mysql-test/t/rpl_compat.test86
-rw-r--r--mysql-test/t/rpl_empty_master_crash.test8
-rw-r--r--mysql-test/t/rpl_get_lock.test6
-rw-r--r--mysql-test/t/rpl_log_pos.test (renamed from mysql-test/t/rpl000014.test)21
-rw-r--r--mysql-test/t/rpl_magic.test1
-rw-r--r--mysql-test/t/rpl_mystery22.test3
-rw-r--r--mysql-test/t/rpl_rotate_logs-master.opt (renamed from mysql-test/t/rpl000016-master.opt)0
-rw-r--r--mysql-test/t/rpl_rotate_logs-slave-master-info.opt (renamed from mysql-test/t/rpl000016-slave-master-info.opt)0
-rwxr-xr-xmysql-test/t/rpl_rotate_logs-slave.sh (renamed from mysql-test/t/rpl000016-slave.sh)0
-rw-r--r--mysql-test/t/rpl_rotate_logs.test (renamed from mysql-test/t/rpl000016.test)59
-rw-r--r--mysql-test/t/rpl_skip_error.test2
-rw-r--r--mysql-test/t/rpl_sporadic_master.test3
-rw-r--r--mysql-test/t/select.test24
-rw-r--r--mysql-test/t/select_found.test17
-rw-r--r--mysql-test/t/truncate.test2
-rw-r--r--mysql-test/t/type_decimal.test8
-rw-r--r--mysql-test/t/union.test9
-rw-r--r--mysql-test/t/user_var.test2
-rw-r--r--mysql-test/t/variables-master.opt1
-rw-r--r--mysql-test/t/variables.test204
-rw-r--r--mysys/Makefile.am12
-rw-r--r--mysys/array.c113
-rw-r--r--mysys/checksum.c14
-rw-r--r--mysys/default.c2
-rw-r--r--mysys/getvar.c112
-rw-r--r--mysys/mf_fn_ext.c12
-rw-r--r--mysys/mf_iocache.c211
-rw-r--r--mysys/mf_iocache2.c63
-rw-r--r--mysys/mf_keycache.c142
-rw-r--r--mysys/mf_tempfile.c4
-rw-r--r--mysys/mulalloc.c16
-rw-r--r--mysys/my_aes.c225
-rw-r--r--mysys/my_alloc.c50
-rw-r--r--mysys/my_chsize.c24
-rw-r--r--mysys/my_div.c8
-rw-r--r--mysys/my_error.c32
-rw-r--r--mysys/my_gethostbyname.c4
-rw-r--r--mysys/my_getopt.c181
-rw-r--r--mysys/my_init.c3
-rw-r--r--mysys/my_net.c5
-rw-r--r--mysys/my_once.c20
-rw-r--r--mysys/my_open.c33
-rw-r--r--mysys/my_os2cond.c24
-rw-r--r--mysys/my_os2dirsrch.c66
-rw-r--r--mysys/my_os2dirsrch.h20
-rw-r--r--mysys/my_os2dlfcn.c4
-rw-r--r--mysys/my_os2file64.c152
-rw-r--r--mysys/my_os2mutex.c8
-rw-r--r--mysys/my_os2thread.c13
-rw-r--r--mysys/my_os2tls.c44
-rw-r--r--mysys/my_port.c40
-rw-r--r--mysys/my_pthread.c74
-rw-r--r--mysys/my_read.c19
-rw-r--r--mysys/my_semaphore.c104
-rw-r--r--mysys/my_static.h32
-rw-r--r--mysys/my_tempnam.c4
-rw-r--r--mysys/my_thr_init.c17
-rw-r--r--mysys/my_winsem.c4
-rw-r--r--mysys/mysys_priv.h6
-rw-r--r--mysys/queues.c10
-rw-r--r--mysys/raid.cc17
-rw-r--r--mysys/rijndael.c1397
-rw-r--r--mysys/safemalloc.c262
-rw-r--r--mysys/sha1.c392
-rw-r--r--mysys/thr_alarm.c146
-rw-r--r--mysys/thr_mutex.c4
-rw-r--r--mysys/thr_rwlock.c94
-rw-r--r--os2/BldLevel.RESbin0 -> 127 bytes
-rw-r--r--os2/BldLevel.cmd4
-rw-r--r--os2/BldLevel.rc2
-rw-r--r--os2/ChangeLog.os222
-rw-r--r--os2/Makefile.am15
-rw-r--r--os2/MySQL-All.icc13
-rw-r--r--os2/MySQL-Client.icc7
-rw-r--r--os2/MySQL-Client.irs2335
-rw-r--r--os2/MySQL-Lib.icc72
-rw-r--r--os2/MySQL-Opt.icc7
-rw-r--r--os2/MySQL-ReadLine.icc27
-rw-r--r--os2/MySQL-Source.icc65
-rw-r--r--os2/MySQL-Sql.irs (renamed from os2/MySQL-binlog.irs)2
-rw-r--r--os2/MySQL-Util.icc3
-rw-r--r--os2/MySQL-Util.irs1226
-rw-r--r--os2/MySQL-binlog.icc68
-rw-r--r--os2/MySQL-sql.irs13
-rw-r--r--os2/ReadMe.txt44
-rw-r--r--os2/build-all.cmd1
-rw-r--r--os2/build-all.log39
-rw-r--r--os2/include/Makefile.am23
-rw-r--r--os2/include/config.h13
-rw-r--r--os2/include/pwd.h1
-rw-r--r--os2/include/sgtty.h1
-rw-r--r--os2/include/sys/Makefile.am22
-rw-r--r--os2/include/sys/file.h1
-rw-r--r--os2/include/termio.h156
-rw-r--r--os2/mysql.base127
-rw-r--r--os2/mysql.ih7
-rw-r--r--os2/readme.os2190
-rw-r--r--os2/rint.objbin334 -> 334 bytes
-rw-r--r--readline/display.c2
-rw-r--r--scripts/Makefile.am5
-rw-r--r--scripts/make_binary_distribution.sh8
-rw-r--r--scripts/mysql_fix_privilege_tables.sh70
-rw-r--r--scripts/mysql_install_db.sh25
-rw-r--r--scripts/mysql_new_fix_privilege_tables.sh25
-rw-r--r--scripts/mysql_secure_installation.sh308
-rw-r--r--scripts/mysql_tableinfo.sh478
-rw-r--r--scripts/mysql_zap.sh2
-rw-r--r--scripts/mysqld_multi.sh9
-rw-r--r--scripts/mysqlhotcopy.sh14
-rw-r--r--sql-bench/Makefile.am8
-rw-r--r--sql-bench/crash-me.sh35
-rw-r--r--sql-bench/innotest1.sh141
-rw-r--r--sql-bench/innotest1a.sh107
-rw-r--r--sql-bench/innotest1b.sh100
-rw-r--r--sql-bench/innotest2.sh149
-rw-r--r--sql-bench/innotest2a.sh93
-rw-r--r--sql-bench/innotest2b.sh103
-rw-r--r--sql-bench/limits/mysql.cfg10
-rw-r--r--sql-bench/server-cfg.sh2
-rw-r--r--sql/Makefile.am9
-rw-r--r--sql/convert.cc2
-rw-r--r--sql/field.cc884
-rw-r--r--sql/field.h62
-rw-r--r--sql/filesort.cc15
-rw-r--r--sql/gen_lex_hash.cc17
-rw-r--r--sql/ha_berkeley.cc18
-rw-r--r--sql/ha_berkeley.h4
-rw-r--r--sql/ha_heap.cc19
-rw-r--r--sql/ha_innodb.cc752
-rw-r--r--sql/ha_innodb.h11
-rw-r--r--sql/ha_isam.h13
-rw-r--r--sql/ha_myisam.cc56
-rw-r--r--sql/ha_myisam.h18
-rw-r--r--sql/ha_myisammrg.cc26
-rw-r--r--sql/ha_myisammrg.h12
-rw-r--r--sql/handler.cc53
-rw-r--r--sql/handler.h18
-rw-r--r--sql/hostname.cc4
-rw-r--r--sql/item.cc4
-rw-r--r--sql/item.h54
-rw-r--r--sql/item_cmpfunc.cc90
-rw-r--r--sql/item_cmpfunc.h71
-rw-r--r--sql/item_create.cc35
-rw-r--r--sql/item_create.h9
-rw-r--r--sql/item_func.cc299
-rw-r--r--sql/item_func.h86
-rw-r--r--sql/item_strfunc.cc242
-rw-r--r--sql/item_strfunc.h48
-rw-r--r--sql/item_sum.cc9
-rw-r--r--sql/item_sum.h17
-rw-r--r--sql/item_timefunc.cc14
-rw-r--r--sql/item_timefunc.h43
-rw-r--r--sql/item_uniq.h1
-rw-r--r--sql/key.cc2
-rw-r--r--sql/lex.h48
-rw-r--r--sql/lock.cc7
-rw-r--r--sql/log.cc1169
-rw-r--r--sql/log_event.cc865
-rw-r--r--sql/log_event.h494
-rw-r--r--sql/mini_client.cc195
-rw-r--r--sql/mini_client.h19
-rw-r--r--sql/mysql_priv.h219
-rw-r--r--sql/mysqld.cc1618
-rw-r--r--sql/net_pkg.cc29
-rw-r--r--sql/net_serv.cc173
-rw-r--r--sql/nt_servc.cc10
-rw-r--r--sql/opt_range.cc34
-rw-r--r--sql/opt_range.h10
-rw-r--r--sql/opt_sum.cc6
-rw-r--r--sql/procedure.h4
-rw-r--r--sql/records.cc9
-rw-r--r--sql/repl_failsafe.cc250
-rw-r--r--sql/repl_failsafe.h1
-rw-r--r--sql/set_var.cc1357
-rw-r--r--sql/set_var.h440
-rw-r--r--sql/share/czech/errmsg.txt10
-rw-r--r--sql/share/danish/errmsg.txt10
-rw-r--r--sql/share/dutch/errmsg.txt13
-rw-r--r--sql/share/english/errmsg.txt10
-rw-r--r--sql/share/estonian/errmsg.txt10
-rw-r--r--sql/share/french/errmsg.txt12
-rw-r--r--sql/share/german/errmsg.txt10
-rw-r--r--sql/share/greek/errmsg.txt10
-rw-r--r--sql/share/hungarian/errmsg.txt10
-rw-r--r--sql/share/italian/errmsg.txt10
-rw-r--r--sql/share/japanese/errmsg.txt10
-rw-r--r--sql/share/korean/errmsg.txt10
-rw-r--r--sql/share/norwegian-ny/errmsg.txt10
-rw-r--r--sql/share/norwegian/errmsg.txt10
-rw-r--r--sql/share/polish/errmsg.txt10
-rw-r--r--sql/share/portuguese/errmsg.txt154
-rw-r--r--sql/share/romanian/errmsg.txt10
-rw-r--r--sql/share/russian/errmsg.txt10
-rw-r--r--sql/share/slovak/errmsg.txt10
-rw-r--r--sql/share/spanish/errmsg.txt10
-rw-r--r--sql/share/swedish/errmsg.txt10
-rw-r--r--sql/share/ukrainian/errmsg.txt10
-rw-r--r--sql/slave.cc1723
-rw-r--r--sql/slave.h210
-rw-r--r--sql/sql_acl.cc610
-rw-r--r--sql/sql_acl.h96
-rw-r--r--sql/sql_base.cc226
-rw-r--r--sql/sql_cache.cc231
-rw-r--r--sql/sql_cache.h20
-rw-r--r--sql/sql_class.cc97
-rw-r--r--sql/sql_class.h230
-rw-r--r--sql/sql_db.cc11
-rw-r--r--sql/sql_delete.cc68
-rw-r--r--sql/sql_handler.cc7
-rw-r--r--sql/sql_insert.cc66
-rw-r--r--sql/sql_lex.cc40
-rw-r--r--sql/sql_lex.h105
-rw-r--r--sql/sql_load.cc47
-rw-r--r--sql/sql_olap.cc194
-rw-r--r--sql/sql_parse.cc541
-rw-r--r--sql/sql_rename.cc2
-rw-r--r--sql/sql_repl.cc412
-rw-r--r--sql/sql_repl.h17
-rw-r--r--sql/sql_select.cc578
-rw-r--r--sql/sql_show.cc93
-rw-r--r--sql/sql_string.cc4
-rw-r--r--sql/sql_table.cc104
-rw-r--r--sql/sql_test.cc13
-rw-r--r--sql/sql_union.cc7
-rw-r--r--sql/sql_update.cc93
-rw-r--r--sql/sql_yacc.yy977
-rw-r--r--sql/stacktrace.c6
-rw-r--r--sql/structs.h46
-rw-r--r--sql/table.cc48
-rw-r--r--sql/table.h27
-rw-r--r--sql/time.cc2
-rw-r--r--sql/udf_example.cc8
-rw-r--r--sql/uniques.cc2
-rw-r--r--sql/unireg.cc2
-rw-r--r--sql/unireg.h5
-rw-r--r--stamp-h.in1
-rw-r--r--strings/ctype-latin1_de.c4
-rw-r--r--strings/ctype-tis620.c30
-rw-r--r--support-files/my-huge.cnf.sh17
-rw-r--r--support-files/my-large.cnf.sh17
-rw-r--r--support-files/my-medium.cnf.sh15
-rw-r--r--support-files/my-small.cnf.sh15
-rw-r--r--support-files/mysql.server.sh30
-rw-r--r--support-files/mysql.spec.sh100
-rw-r--r--tests/function.res6
-rw-r--r--tests/function.tst2
-rw-r--r--tests/grant.pl75
-rw-r--r--tests/grant.res72
-rwxr-xr-xtests/truncate.pl125
-rw-r--r--tools/mysqlmanager.c154
-rw-r--r--vio/test-ssl.c5
-rw-r--r--vio/vio.c10
-rw-r--r--vio/viosocket.c23
-rw-r--r--vio/viossl.c19
-rw-r--r--vio/viosslfactories.c126
1343 files changed, 47583 insertions, 105249 deletions
diff --git a/.bzrignore b/.bzrignore
index 6a02b58dca9..72a0438577a 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -223,6 +223,7 @@ libmysql/*.c
libmysql/conf_to_src
libmysql/my_static.h
libmysql/mysys_priv.h
+libmysql/net.c
libmysql_r/*.c
libmysql_r/acconfig.h
libmysql_r/conf_to_src
@@ -286,6 +287,7 @@ libmysqld/password.c
libmysqld/procedure.cc
libmysqld/records.cc
libmysqld/repl_failsafe.cc
+libmysqld/set_var.cc
libmysqld/simple-test
libmysqld/slave.cc
libmysqld/spatial.cc
@@ -306,6 +308,7 @@ libmysqld/sql_list.cc
libmysqld/sql_load.cc
libmysqld/sql_manager.cc
libmysqld/sql_map.cc
+libmysqld/sql_olap.cc
libmysqld/sql_parse.cc
libmysqld/sql_rename.cc
libmysqld/sql_repl.cc
@@ -336,6 +339,13 @@ linked_server_sources
linked_tools_sources
locked
mit-pthreads/config.flags
+mit-pthreads/include/bits
+mit-pthreads/include/pthread/machdep.h
+mit-pthreads/include/pthread/posix.h
+mit-pthreads/include/sys
+mit-pthreads/machdep.c
+mit-pthreads/pg++
+mit-pthreads/pgcc
mit-pthreads/syscall.S
myisam/FT1.MYD
myisam/FT1.MYI
@@ -346,6 +356,7 @@ myisam/mi_test1
myisam/mi_test2
myisam/mi_test3
myisam/mi_test_all
+myisam/myisam.log
myisam/myisamchk
myisam/myisamlog
myisam/myisampack
@@ -353,6 +364,8 @@ myisam/rt_test
myisam/sp_test
myisam/test1.MYD
myisam/test1.MYI
+myisam/test2.MYD
+myisam/test2.MYI
mysql-4.0.2-alpha-pc-linux-gnu-i686.tar.gz
mysql-4.0.2-alpha.tar.gz
mysql-max-4.0.2-alpha-pc-linux-gnu-i686.tar.gz
@@ -375,8 +388,10 @@ mysql.proj
mysqld.S
mysqld.sym
mysys/#mf_iocache.c#
+mysys/charset2html
mysys/getopt.c
mysys/getopt1.c
+mysys/ste5KbMa
mysys/test_charset
mysys/test_dir
mysys/test_io_cache
@@ -399,7 +414,9 @@ scripts/mysql_find_rows
scripts/mysql_fix_extensions
scripts/mysql_fix_privilege_tables
scripts/mysql_install_db
+scripts/mysql_secure_installation
scripts/mysql_setpermission
+scripts/mysql_tableinfo
scripts/mysql_zap
scripts/mysqlaccess
scripts/mysqlbug
@@ -417,6 +434,12 @@ sql-bench/copy-db
sql-bench/crash-me
sql-bench/gif/*
sql-bench/graph-compare-results
+sql-bench/innotest1
+sql-bench/innotest1a
+sql-bench/innotest1b
+sql-bench/innotest2
+sql-bench/innotest2a
+sql-bench/innotest2b
sql-bench/output/*
sql-bench/run-all-tests
sql-bench/server-cfg
@@ -452,6 +475,7 @@ sql/sql_yacc.cc
sql/sql_yacc.h
sql/sql_yacc.yy.orig
stamp-h
+stamp-h.in
strings/conf_to_src
strings/ctype_autoconf.c
strings/ctype_extra_sources.c
@@ -469,6 +493,7 @@ support-files/mysql-log-rotate
support-files/mysql.server
support-files/mysql.spec
tags
+tests/client_test
tmp/*
tools/my_vsnprintf.c
tools/mysqlmanager
@@ -478,5 +503,3 @@ vio/test-ssl
vio/test-sslclient
vio/test-sslserver
vio/viotest-ssl
-tests/client_test
-mysys/charset2html
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index d46216bea93..859150c3954 100644
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -48,7 +48,7 @@ fast_cflags="-O3 -fno-omit-frame-pointer"
# this is one is for someone who thinks 1% speedup is worth not being
# able to backtrace
reckless_cflags="-O3 -fomit-frame-pointer "
-debug_cflags="-DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DSAFE_MUTEX -O1"
+debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX -O1"
base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
diff --git a/BUILD/compile-solaris-sparc-purify b/BUILD/compile-solaris-sparc-purify
index e0878da2099..2fb5c88cd7b 100755
--- a/BUILD/compile-solaris-sparc-purify
+++ b/BUILD/compile-solaris-sparc-purify
@@ -1,17 +1,30 @@
#! /bin/sh
+
+while test $# -gt 0
+do
+ case "$1" in
+ --debug) EXTRA_CONFIG_FLAGS=--with-debug; shift ;;
+ -h | --help ) cat <<EOF; exit 0 ;;
+Usage: $0 [-h|-n] [configure-options]
+ --debug Compile with DBUG enabled
+EOF
+ *) echo "No such option '$1'" ; exit ;;
+ esac
+done
+
gmake -k clean || true
/bin/rm -f */.deps/*.P config.cache
-
aclocal && autoheader && aclocal && automake && autoconf
(cd bdb/dist && sh s_all)
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
-CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_purify -DEXTRA_DEBUG -O2" CXX=gcc CXXLD=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_purify -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-berkeley-db --with-innodb
+CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_purify -DEXTRA_DEBUG -O2" CXX=gcc CXXLD=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_purify -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-berkeley-db --with-innodb $EXTRA_CONFIG_FLAGS
gmake -j 4
-cd sql ; rm mysqld ;
+cd sql ; mv mysqld mysqld-org ;
make CXXLD="purify -best-effort g++" mysqld ; mv mysqld mysqld-purify
make CXXLD="quantify -best-effort g++" mysqld ; mv mysqld mysqld-quantify
make CXXLD="purecov -best-effort g++" mysqld ; mv mysqld mysqld-purecov
+mv mysqld-org mysqld
diff --git a/BitKeeper/etc/config b/BitKeeper/etc/config
index 257f193723f..85b5a871301 100644
--- a/BitKeeper/etc/config
+++ b/BitKeeper/etc/config
@@ -68,4 +68,5 @@ pager:
#
hours:
[serg:]checkout:get
+[arjen:]checkout:get
checkout:edit
diff --git a/BitKeeper/etc/gone b/BitKeeper/etc/gone
index 6b1abae9b61..03c7cacb8bc 100644
--- a/BitKeeper/etc/gone
+++ b/BitKeeper/etc/gone
@@ -164,9 +164,7 @@ BK|sql-bench/Results-linux/wisconsin-mysql_fast-Linux_2.2.13_SMP_alpha|197001010
BK|sql-bench/Results/ATIS-mysql-Linux_2.2.10_i686|19700101030959|02025|3fa4d167cceff7e8
BK|sql-bench/Results/ATIS-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02312|84ca3b85ff306133
BK|sql-bench/Results/ATIS-mysql-Linux_2.2.14_i686_xeon|19700101030959|02044|3e820c28bf4af63a
-BK|sql-bench/Results/ATIS-mysql-SunOS_5.5.1_sun4u|19700101030959|02031|dfb4c5f6b6db3b49
BK|sql-bench/Results/ATIS-mysql-SunOS_5.6_sun4m|19700101030959|02032|62028e0375b3b8b
-BK|sql-bench/Results/ATIS-mysql-SunOS_5.7_sun4u|19700101030959|02034|be0d9789776c5ed7
BK|sql-bench/Results/ATIS-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02304|cbe120d860296d2f
BK|sql-bench/Results/ATIS-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02027|a74e7b82d3908fa9
BK|sql-bench/Results/ATIS-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02313|8c6fc2968f78773
@@ -228,9 +226,7 @@ BK|sql-bench/Results/Attic/wisconsin-pg_fast-Linux_2.2.10_i686-cmp-mysql,pg|1970
BK|sql-bench/Results/RUN-mysql-Linux_2.2.10_i686|19700101030959|02041|712f52be5d195406
BK|sql-bench/Results/RUN-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02038|8ee87b26b91c86fe
BK|sql-bench/Results/RUN-mysql-Linux_2.2.14_i686_xeon|19700101030959|02055|17854e751e1d9d1d
-BK|sql-bench/Results/RUN-mysql-SunOS_5.5.1_sun4u|19700101030959|02058|afbba182428e20df
BK|sql-bench/Results/RUN-mysql-SunOS_5.6_sun4m|19700101030959|02059|eafc8188345e262b
-BK|sql-bench/Results/RUN-mysql-SunOS_5.7_sun4u|19700101030959|02061|86e1dc0e25a8b8f
BK|sql-bench/Results/RUN-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02310|a902e1a967d79c42
BK|sql-bench/Results/RUN-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02030|413ab3b8a99e61e9
BK|sql-bench/Results/RUN-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02046|a910a9b3fde431e1
@@ -238,9 +234,7 @@ BK|sql-bench/Results/RUN-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|02165|e0f0
BK|sql-bench/Results/alter-table-mysql-Linux_2.2.10_i686|19700101030959|02081|93b78a85b720a186
BK|sql-bench/Results/alter-table-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02314|4ae4b989301df98b
BK|sql-bench/Results/alter-table-mysql-Linux_2.2.14_i686_xeon|19700101030959|02057|64cc4b874cd6fabf
-BK|sql-bench/Results/alter-table-mysql-SunOS_5.5.1_sun4u|19700101030959|02087|9d7e75667fcb29ec
BK|sql-bench/Results/alter-table-mysql-SunOS_5.6_sun4m|19700101030959|02088|8a1bd6589a189890
-BK|sql-bench/Results/alter-table-mysql-SunOS_5.7_sun4u|19700101030959|02090|ce74c2f623d3bb3
BK|sql-bench/Results/alter-table-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02316|1390155aad5b6e86
BK|sql-bench/Results/alter-table-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02317|9090bebb62ef164b
BK|sql-bench/Results/alter-table-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02094|4e02d36dc17ecbfa
@@ -248,9 +242,7 @@ BK|sql-bench/Results/alter-table-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|02
BK|sql-bench/Results/big-tables-mysql-Linux_2.2.10_i686|19700101030959|02109|99daa1c5370d077d
BK|sql-bench/Results/big-tables-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02315|2804ec3c95be436a
BK|sql-bench/Results/big-tables-mysql-Linux_2.2.14_i686_xeon|19700101030959|02074|290c2c3de9d8e6b
-BK|sql-bench/Results/big-tables-mysql-SunOS_5.5.1_sun4u|19700101030959|02115|7d7b6c0bf58b9b79
BK|sql-bench/Results/big-tables-mysql-SunOS_5.6_sun4m|19700101030959|02116|f351a7f3e1e2257e
-BK|sql-bench/Results/big-tables-mysql-SunOS_5.7_sun4u|19700101030959|02118|ebc379b231312bbe
BK|sql-bench/Results/big-tables-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02318|c5eabcb89ceac698
BK|sql-bench/Results/big-tables-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02319|856d503725373684
BK|sql-bench/Results/big-tables-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02122|a442a8aff47fae20
@@ -258,9 +250,7 @@ BK|sql-bench/Results/big-tables-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|022
BK|sql-bench/Results/connect-mysql-Linux_2.2.10_i686|19700101030959|02137|c92505d77e19d5ec
BK|sql-bench/Results/connect-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02084|e7e2959b7387251f
BK|sql-bench/Results/connect-mysql-Linux_2.2.14_i686_xeon|19700101030959|02071|ea19dc3ec55b3618
-BK|sql-bench/Results/connect-mysql-SunOS_5.5.1_sun4u|19700101030959|02142|a9493110fe62e0b1
BK|sql-bench/Results/connect-mysql-SunOS_5.6_sun4m|19700101030959|02143|a10e3ddfa26a3e7f
-BK|sql-bench/Results/connect-mysql-SunOS_5.7_sun4u|19700101030959|02145|c67beb9e9d2cf32e
BK|sql-bench/Results/connect-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02320|ce69cc65bc827b5c
BK|sql-bench/Results/connect-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02066|f801e08429a4f7c6
BK|sql-bench/Results/connect-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02086|1d95d36fd717990
@@ -268,9 +258,7 @@ BK|sql-bench/Results/connect-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|02244|
BK|sql-bench/Results/create-mysql-Linux_2.2.10_i686|19700101030959|02161|9e7822f66df6aa76
BK|sql-bench/Results/create-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02102|34ded91c5fc25de9
BK|sql-bench/Results/create-mysql-Linux_2.2.14_i686_xeon|19700101030959|02139|50d15991293030ef
-BK|sql-bench/Results/create-mysql-SunOS_5.5.1_sun4u|19700101030959|02166|bbb5de66fc56de7b
BK|sql-bench/Results/create-mysql-SunOS_5.6_sun4m|19700101030959|02221|9233114ae6f8c5f
-BK|sql-bench/Results/create-mysql-SunOS_5.7_sun4u|19700101030959|02223|7ee13bfcafeab498
BK|sql-bench/Results/create-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02321|e985e71d552ff09e
BK|sql-bench/Results/create-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02099|483dcf223d5abf81
BK|sql-bench/Results/create-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02112|a140e5e229a53b7b
@@ -278,9 +266,7 @@ BK|sql-bench/Results/create-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|02246|1
BK|sql-bench/Results/insert-mysql-Linux_2.2.10_i686|19700101030959|02242|763edf9aec633f51
BK|sql-bench/Results/insert-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02130|5be3d6f299738a31
BK|sql-bench/Results/insert-mysql-Linux_2.2.14_i686_xeon|19700101030959|02141|c683ee4b9d214298
-BK|sql-bench/Results/insert-mysql-SunOS_5.5.1_sun4u|19700101030959|02247|8a9ae41f9a79f79
BK|sql-bench/Results/insert-mysql-SunOS_5.6_sun4m|19700101030959|02248|3402d060ae20e19
-BK|sql-bench/Results/insert-mysql-SunOS_5.7_sun4u|19700101030959|02250|78efa132c6e252b9
BK|sql-bench/Results/insert-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02322|ed252140ff399961
BK|sql-bench/Results/insert-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02114|29a3b8a1ca8aa9d
BK|sql-bench/Results/insert-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02148|e65dd14f2ed9abbf
@@ -288,9 +274,7 @@ BK|sql-bench/Results/insert-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|02259|b
BK|sql-bench/Results/select-mysql-Linux_2.2.10_i686|19700101030959|02268|a2e264d777b787d
BK|sql-bench/Results/select-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02227|308117295c3bc096
BK|sql-bench/Results/select-mysql-Linux_2.2.14_i686_xeon|19700101030959|02152|ead3f11b46ac626f
-BK|sql-bench/Results/select-mysql-SunOS_5.5.1_sun4u|19700101030959|02273|c9a1a498a052e268
BK|sql-bench/Results/select-mysql-SunOS_5.6_sun4m|19700101030959|02274|4da215905bce988d
-BK|sql-bench/Results/select-mysql-SunOS_5.7_sun4u|19700101030959|02276|632c92971c61e34a
BK|sql-bench/Results/select-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02323|e8c0871a668a610d
BK|sql-bench/Results/select-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02127|963a98ed526e2be4
BK|sql-bench/Results/select-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02254|f9ab7726ff14ea90
@@ -298,9 +282,7 @@ BK|sql-bench/Results/select-pg_fast-Linux_2.2.14_5.0_i686|19700101030959|02261|1
BK|sql-bench/Results/wisconsin-mysql-Linux_2.2.10_i686|19700101030959|02288|301a82b12a84922b
BK|sql-bench/Results/wisconsin-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02280|d01900af34fb33b8
BK|sql-bench/Results/wisconsin-mysql-Linux_2.2.14_i686_xeon|19700101030959|02154|7525b23938631801
-BK|sql-bench/Results/wisconsin-mysql-SunOS_5.5.1_sun4u|19700101030959|02297|379705afa2e12378
BK|sql-bench/Results/wisconsin-mysql-SunOS_5.6_sun4m|19700101030959|02298|ec61b14072715dc8
-BK|sql-bench/Results/wisconsin-mysql-SunOS_5.7_sun4u|19700101030959|02300|f27927f8c64ea8ad
BK|sql-bench/Results/wisconsin-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02324|ec075a89dbdbbe6a
BK|sql-bench/Results/wisconsin-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02325|233d5aa529979990
BK|sql-bench/Results/wisconsin-pg_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02295|ec361eee4f4128cd
@@ -343,7 +325,6 @@ monty@donna.mysql.com|sql-bench/Results-linux/select-mysql_dbug-Linux_2.2.14_my_
monty@donna.mysql.com|sql-bench/Results-linux/select-mysql_dbug_full-Linux_2.2.14_my_SMP_i686|20001218140918|07610|cffd7d282a90113a
monty@donna.mysql.com|sql-bench/Results-linux/wisconsin-mysql_dbug-Linux_2.2.14_my_SMP_i686|20001218140918|10615|8dcd7271a9137341
monty@donna.mysql.com|sql-bench/Results-linux/wisconsin-mysql_dbug_full-Linux_2.2.14_my_SMP_i686|20001218140918|13213|4398328883aa75da
-mwagner@evoq.home.mwagner.org|mysql-test/chew_on_this/select.res|20001014084759|41327|1295456b9394876
mwagner@evoq.home.mwagner.org|mysql-test/chew_on_this/select.res|20001014084759|41327|1295456b93948768
mwagner@evoq.home.mwagner.org|mysql-test/mybin/start-mysqld|20001016055648|54840|9c8f21a7ab97793a
mwagner@evoq.home.mwagner.org|mysql-test/mybin/stop-mysqld|20001016055653|20710|89a1194045f05d1c
@@ -384,37 +365,18 @@ mwagner@evoq.home.mwagner.org|mysql-test/var/lib/README|20001009213643|15351|3b6
mwagner@evoq.home.mwagner.org|mysql-test/var/log/README|20001009213643|16203|df5481fdbe6e5b6e
mwagner@evoq.home.mwagner.org|mysql-test/var/run/README|20001009213643|17062|acb305e4c2ed5990
mwagner@evoq.home.mwagner.org|mysql-test/var/tmp/README|20001009213643|17904|b32d866bfd50e72e
-mwagner@work.mysql.com|mysql-test/r/3.23/sel000001.result|20001010091454|28284|383913ae4505ec86
-mwagner@work.mysql.com|mysql-test/r/3.23/sel000002.result|20001010091454|29230|d1787e6fd5dbc1cc
sasha@mysql.sashanet.com|BitKeeper/etc/logging_ok|20000801000905|12967|5b7d847a2158554
sasha@mysql.sashanet.com|libmysql_r/acconfig.h|20001128060846|51084|65f1202b3b5c345f
sasha@mysql.sashanet.com|mysql-test/README.gcov|20001012045950|28177|5a6da067a30780ce
-sasha@mysql.sashanet.com|mysql-test/README.gcov|20001214012355|41825|2de7575ca81155e5
sasha@mysql.sashanet.com|mysql-test/README|20001010001022|12739|108667adaeabe3f5
sasha@mysql.sashanet.com|mysql-test/r/3.23/alt000001.result|20001122072330|24729|393103dbf15f35c9
-sasha@mysql.sashanet.com|mysql-test/r/3.23/ins000001.result|20001018175743|49824|f45c599efdf8352b
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000001.a.result|20001118063528|39426|2987b17db06808c3
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000001.b.result|20001118063528|44057|62e1fa91167cacc3
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000002.result|20001118063528|46039|109f5ceed1e0d64
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000003.result|20001118063528|48148|68d6ee00beaa011
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000004.a.result|20001118063528|50132|3415f066cb91c460
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000004.b.result|20001118063528|52094|352b35351551485
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000005.result|20001118063528|54071|a50962bc2340ab9a
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000006.result|20001118063528|56081|5653051e8ce6b4aa
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000007.result|20001121063807|21606|e0c3b6134e0884da
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000008.result|20001121063807|23636|c5cfee19ca5a7da9
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000009.result|20001121063807|25633|ed8042446ab97926
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000010.result|20001122072330|29430|3228109b8965b0f8
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000011.result|20001125024912|48851|c29dce30aa97f265
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000012.result|20001126062901|05938|35d6596da7b90fc5
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000012.status.result|20001126062901|09395|bbbd650b5beea32f
-sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000013.result|20001202171150|03876|ac5024e6cf6daac6
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000013.status.result|20001202171150|06069|6bee190c298cc9fd
-sasha@mysql.sashanet.com|mysql-test/r/3.23/sel000003.result|20001011230020|64653|d7b657b1e3a286a7
-sasha@mysql.sashanet.com|mysql-test/r/3.23/sel000100.res|20001205131218|23520|84ed46856cb3a69f
sasha@mysql.sashanet.com|mysql-test/r/3.23/shw000001.result|20001121234128|16652|8b20b03d8319b9a5
-sasha@mysql.sashanet.com|mysql-test/r/slave-running.result|20001208141122|24303|f73e49462cf59e1f
-sasha@mysql.sashanet.com|mysql-test/r/slave-stopped.result|20001208141122|28916|25c134b1a4f1993a
sasha@mysql.sashanet.com|mysql-test/std_data/select-key.master|20001009234916|07315|e6b83af25df0ce5
sasha@mysql.sashanet.com|mysql-test/std_data/simple-select.master|20001009234916|08299|6f3eb98812926caf
sasha@mysql.sashanet.com|mysql-test/t/3.23/select-key.test|20001009234859|21197|5d785cef5c02c070
@@ -423,3 +385,1236 @@ sasha@mysql.sashanet.com|mysql-test/t/include/master-slave.inc|20001118030458|01
sasha@work.mysql.com|BitKeeper/etc/logging_ok|20001214015456|29919|32b6551b8288c2fa
serg@serg.mysql.com|mysql-test/r/3.23/mrg000001.dummy.result|20001206231604|05053|bf7e6d609f22b897
serg@serg.mysql.com|mysql-test/r/3.23/mrg000001.result|20001206231609|46662|db2ef2e717ab8332
+BK|Docs/Attic/myisam.doc|19700101030959|00502|519bb06ecc870298
+BK|Docs/Flags/island.eps|19700101030959|00181|8cec5a55768bc59e
+BK|libmysql/violite.c|19700101030959|02600|984c09cffe14a11b
+BK|mysql.proj|19700101030959|00071|3e34edc585d18be8
+BK|sql-bench/Results-win32/wisconsin-mysql-win98|19700101030959|02547|8b3da9c5c5d2365b
+BK|sql-bench/Results/connect-mysql-3.21-Linux_2.2.1_i686|19700101030959|02134|c0c26d4320182d85
+BK|sql-bench/Results/create-mysql_3.21-Linux_2.0.35_i686|19700101030959|02225|df1b037d17b33587
+BK|sql/share/estonia/errmsg.sys|19700101030959|01836|83b86d7ed4cdd5d0
+BK|sql/share/french/errmsg.sys|19700101030959|01838|9f024dc5e6fe50f5
+BK|sql/share/romania/errmsg.sys|19700101030959|01871|e08aa93bae96d25e
+BK|strings/Attic/bootstrap-ctype.c|19700101030959|01360|6d2a8cda2d6a35ff
+BK|strings/Attic/ctype-dos.c|19700101030959|01344|f77bd08acf13a8c1
+BK|strings/Attic/ctype-estonia.c|19700101030959|01345|fc8a69424f7cb66b
+BK|strings/Attic/ctype-german1.c|19700101030959|01346|f7830c509bb358f7
+BK|strings/Attic/ctype-hp8.c|19700101030959|01349|749e1be0f028d349
+BK|strings/Attic/ctype-koi8_ru.c|19700101030959|01351|8ff4188c642c9bd
+BK|strings/READ-ME|19700101030959|01362|ed6c5184d4bf6b7c
+BK|support-files/Attic/my-large.cfg.sh|19700101030959|02586|842c8e76253c9396
+BK|vio/VioSSL.cc|19700101030959|00013|6e85340b11fa42a8
+BK|vio/VioSocket.h|19700101030959|00019|a26d535bd5a1a6
+BK|vio/viotypes.h|19700101030959|00027|f5a38e7326bd50f3
+Sinisa@sinisa.nasamreza.org|=6|20010818122920|53462|33f33b0a159dc5d5
+Sinisa@sinisa.nasamreza.org|mysql-test/r/sel000004.result|20020522133259|25000|4b5fbc60d0d9754f
+Sinisa@sinisa.nasamreza.org|mysql-test/t/sel000004.test|20020522133300|08911|21904fbd1c95cb1
+ccarkner@nslinuxw10.bedford.progress.com|mysql-test/r/isolation.result|20010327145543|25059|4da11e109a3d93a9
+jani@hynda.mysql.fi|client/mysqlcheck|20010419221207|26716|363e3278166d84ec
+miguel@hegel.local|zlib/contrib/asm386/gvmat32.asm|20020319032514|12654|31093c1a846dfdc7
+miguel@hegel.local|zlib/contrib/asm386/gvmat32c.c|20020319032514|19182|2a8eba5481c46eab
+miguel@hegel.local|zlib/contrib/asm586/match.s|20020319032514|51538|dc1a34b5eb2a7c11
+miguel@hegel.local|zlib/contrib/delphi2/d_zlib.cpp|20020319032514|31641|d6f37620ac7b27fa
+miguel@hegel.local|zlib/contrib/delphi2/zlib.cpp|20020319032515|22372|4257437d415259e2
+miguel@hegel.local|zlib/crc32.c|20020319032516|20397|b327da5b8cf9eae8
+miguel@hegel.local|zlib/inffast.c|20020319032517|65269|bf247ff4aa2bf54b
+miguel@hegel.local|zlib/inffixed.h|20020319032517|12923|e86ef8e2efe23f77
+miguel@hegel.local|zlib/msdos/zlib.def|20020319032518|18787|165cd7dcff6ac9f
+miguel@hegel.local|zlib/trees.c|20020319032519|43770|4fbd4d005e26d38
+miguel@hegel.local|zlib/uncompr.c|20020319032519|57111|82eac43195d1222c
+miguel@hegel.local|zlib/zlib.dsp|20020319032519|12016|6eec436fab260061
+miguel@hegel.local|zlib/zlib.html|20020319032519|31060|7a635f4ac95fc56b
+monty@donna.mysql.com|mysql-test/include/have_default_master.inc|20010104005638|23980|a54c86e65a6c4af
+monty@donna.mysql.com|sql-bench/Results/ATIS-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|14777|e625af7f600bf930
+monty@donna.mysql.com|sql-bench/Results/create-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|20766|4e5a2ab4907748d4
+monty@donna.mysql.fi|sql/violite.c|20010523223654|08838|53d4251a69d3c
+monty@hundin.mysql.fi|sql-bench/Results/RUN-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|63204|e938a858bd12aa8d
+monty@hundin.mysql.fi|sql-bench/Results/big-tables-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|42711|788ad492867b1226
+monty@hundin.mysql.fi|sql-bench/Results/connect-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|46284|5316add301edb60
+monty@narttu.mysql.com|sql-bench/Results/insert-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|29606|975e26cac59161fa
+monty@narttu.mysql.fi|sql-bench/Results/big-tables-mysql-Linux_2.2.13_SMP_alpha|20001014001004|18602|e8cc899bb933532f
+mwagner@cash.mwagner.org|Docs/include.de.texi|20020223092123|06028|112aac21b3489888
+mwagner@evoq.home.mwagner.org|Docs/Books/dubois.eps|20001231203219|33725|aa3d9c08bbcc149b
+mwagner@evoq.home.mwagner.org|Docs/Books/in_21.eps|20001231203220|05743|83a7604251d68ebd
+mwagner@evoq.home.mwagner.org|Docs/Books/pthreads.eps|20001231203220|18899|d60ad51891ef4c49
+mwagner@evoq.home.mwagner.org|Docs/Books/realmen.eps|20001231203220|22075|1ceb4839e835dad4
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000006.xml|20001017133623|51441|8ad8f44f49b21246
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000013.xml|20001017133713|03416|2717cbfbe5730174
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000021.xml|20001017133713|15460|2763b87c1549ba87
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000026.xml|20001017133713|25860|15145e496417646f
+nick@nick.leippe.com|mysql-test/t/rpl_empty_master_crash.test|20020531235552|52328|99464e737639ccc6
+sasha@mysql.sashanet.com|mysql-test/r/df_crash.result|20010406010433|59989|4a3dbee64843953d
+sasha@mysql.sashanet.com|mysql-test/std_data/m.MRG|20001212152450|17736|3f5632c37af00f18
+sasha@mysql.sashanet.com|mysql-test/t/3.23/alt000001.test|20001122072330|31588|633aed61c4bad94c
+sasha@mysql.sashanet.com|mysql-test/t/binlog-backup-restore.test|20010424233926|25316|d5b0b9bd83738a9f
+sasha@mysql.sashanet.com|vio/test-ssl|20010828000105|24508|ed0a50364f2a51d7
+serg@serg.mysql.com|mysql-test/r/ft0000001.d.result|20001211130756|19773|7c549555fbc7663e
+serg@serg.mysql.com|mysql-test/r/ft0000001.e.result|20001212121413|40468|c58d30fd7fe86f4f
+serg@serg.mysql.com|mysql-test/t/sel000015.test|20001211130731|27841|7442bf9cbc96fe07
+serg@serg.mysql.com|mysql-test/t/sel000024.test|20001211130731|07099|849f47e6cbdc4fe3
+tim@threads.polyesthetic.msg|bdb/build_win32/db_int.h|20010305004134|30736|9ee5645850a336a0
+tim@threads.polyesthetic.msg|bdb/build_win32/ex_btrec.dsp|20010305004135|08710|c87137287d8d67dc
+tim@threads.polyesthetic.msg|bdb/build_win32/ex_env.dsp|20010305004135|09533|1732d5e41efda77
+tim@threads.polyesthetic.msg|bdb/build_win32/excxx_lock.dsp|20010305004135|14943|257abf03544f6270
+tim@threads.polyesthetic.msg|bdb/dist/template/rec_qam|20010305004137|28066|6eecf6833de0af98
+tim@threads.polyesthetic.msg|bdb/dist/template/rec_txn|20010305004137|29072|1ff22b797deb0e1b
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_rename.html|20010305004144|37128|36796ad9e106c3f0
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_h_hash.html|20010305004144|09702|73f14897664d9d08
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_q_extentsize.html|20010305004144|13496|f2fe41a5d8c46658
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_re_pad.html|20010305004144|16373|8a1de721eb6fc53f
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_sync.html|20010305004144|19394|7a067029b6e1496b
+tim@threads.polyesthetic.msg|bdb/docs/api_c/dbt.html|20010305004144|04896|ae7a81c9c5f574f6
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_close.html|20010305004144|28399|a8e722cbb66c9d7b
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lk_conflicts.html|20010305004145|07137|58d9f7179bc864a3
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_server.html|20010305004145|31969|c13b793b525d504b
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_tmp_dir.html|20010305004145|34771|b563e87af5431824
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_verbose.html|20010305004145|38421|344f5119536cae0
+tim@threads.polyesthetic.msg|bdb/docs/api_c/log_file.html|20010305004145|48705|574444b46b801f9c
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_map.html|20010305004144|16369|d90bbc8462ef43a6
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_realloc.html|20010305004144|19375|e8e78e57c005c7c4
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/cxx_pindex.html|20010305004147|08181|9ff6b69b56f988dd
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_append_recno.html|20010305004146|08075|a158b1fdba756ce
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_errcall.html|20010305004146|10727|28a7a1fa2b3b73ee
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_h_nelem.html|20010305004146|19017|1829bc583d9c7554
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_re_delim.html|20010305004146|22753|81d9df93c3511df3
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_re_len.html|20010305004146|23672|e09bb30e40208dfb
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_remove.html|20010305004146|38809|5efece7ecdfc4df7
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_region_init.html|20010305004146|59589|2d70678382bbbf9a
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lsn_class.html|20010305004145|24210|34809f73e15540ad
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_fclose.html|20010305004146|22608|cc4a5776ac69d660
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_abort.html|20010305004147|01091|81177bcb2e5f4502
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_checkpoint.html|20010305004147|02999|173930473e76d008
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_key_range.html|20010305004147|31461|8834de5873a6acb5
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_stat.html|20010305004147|57008|bc253f0883e9c82b
+tim@threads.polyesthetic.msg|bdb/docs/api_java/dbenv_class.html|20010305004147|12326|92c7a4a6c22090c7
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_errcall.html|20010305004147|07189|4e206d08cbb39ab7
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lk_detect.html|20010305004147|15549|9fc15a1a95b0dfa1
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lk_max_lockers.html|20010305004147|18755|7896265ea77829b3
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_rec_init.html|20010305004147|25237|1fdb2c5fc3b6407
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_tx_recover.html|20010305004148|00983|40280da113fc9d2b
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_tx_timestamp.html|20010305004148|02804|457eeb135f1f8bc0
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_strerror.html|20010305004148|04588|fceebaa94cf9aafd
+tim@threads.polyesthetic.msg|bdb/docs/api_java/lock_stat.html|20010305004148|10140|71b81d8567befc43
+tim@threads.polyesthetic.msg|bdb/docs/api_java/log_flush.html|20010305004148|14794|1691d6a3c8cc284e
+tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_fclose.html|20010305004148|20518|d08f0c134361f802
+tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_prepare.html|20010305004148|33784|510a245c80e715c
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_get.html|20010305004148|42753|127bd361ee695c71
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_is_byteswapped.html|20010305004148|45596|8fb9e2c58051c769
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_stat.html|20010305004148|51363|3bb57be2de907fd2
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/txn_commit.html|20010305004148|64051|25150b20b84cd519
+tim@threads.polyesthetic.msg|bdb/docs/images/api.gif|20010305004148|02578|dec2d4fe5f39dffe
+tim@threads.polyesthetic.msg|bdb/docs/images/ref.gif|20010305004148|06650|add30c753dc1972d
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/open.html|20010305004148|23468|c9a7e23579a5e93a
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/bt_recnum.html|20010305004149|20770|f081f10254e86e75
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/h_hash.html|20010305004149|25978|3a0174586fbcfcdf
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/h_nelem.html|20010305004149|26871|979995db477052ad
+tim@threads.polyesthetic.msg|bdb/docs/ref/arch/apis.html|20010305004149|36488|a84570e410b11a6a
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/intro.html|20010305004149|49652|f261022c26987d7f
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/osf1.html|20010305004149|53358|9d4ebabfe3af8970
+tim@threads.polyesthetic.msg|bdb/docs/ref/cam/intro.html|20010305004149|04558|4c497b1a18c4c7f5
+tim@threads.polyesthetic.msg|bdb/docs/ref/install/file.html|20010305004150|21159|d4ba2317db7c064b
+tim@threads.polyesthetic.msg|bdb/docs/ref/install/magic.txt|20010305004150|21985|3894a46ea11ce25a
+tim@threads.polyesthetic.msg|bdb/docs/ref/java/faq.html|20010305004150|27218|7ca2474ba1f6676f
+tim@threads.polyesthetic.msg|bdb/docs/ref/lock/cam_conv.html|20010305004150|31862|63844ff6fa95f0c
+tim@threads.polyesthetic.msg|bdb/docs/ref/lock/nondb.html|20010305004150|36156|863fe076a46378d7
+tim@threads.polyesthetic.msg|bdb/docs/ref/lock/twopl.html|20010305004150|39650|b3f3aee667bc381d
+tim@threads.polyesthetic.msg|bdb/docs/ref/log/limits.html|20010305004150|43198|26fac1e32387b7c9
+tim@threads.polyesthetic.msg|bdb/docs/ref/rpc/intro.html|20010305004150|13549|ad16bc20623e1192
+tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/errors.html|20010305004150|19994|be11ff6410e1db2c
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/app.html|20010305004151|42111|6dc3c82982164fa8
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/intro.html|20010305004151|49773|22096cea9fe159ac
+tim@threads.polyesthetic.msg|bdb/docs/ref/txn/other.html|20010305004151|63311|4991722636b3a46d
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/log_register.html|20010305004151|23513|399320e965adf598
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/txn_stat.html|20010305004151|33181|516f1870c6127351
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/value_set.html|20010305004151|34118|f0b0c770a81b90b6
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/set_paniccall.html|20010305004152|46636|8f9741244fb6e9f6
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/tmp.html|20010305004152|50733|ef3450f6fa89f2dc
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/txn_check.html|20010305004152|51549|2405b25bc92cc476
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/renumber.html|20010305004152|60219|d6cd798434da81aa
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/toc.html|20010305004152|61902|9c94c533ada43c1a
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade/process.html|20010305004151|64704|78f9ca966a587234
+tim@threads.polyesthetic.msg|bdb/include/db_auto.h|20010305004137|26350|994ddc84db334345
+tim@threads.polyesthetic.msg|bdb/include/hash_auto.h|20010305004138|09216|1b79cdd426d7ef25
+tim@threads.polyesthetic.msg|bdb/include/rpc_client_ext.h|20010305004138|28220|85436ca9b5691338
+tim@threads.polyesthetic.msg|bdb/rpc_client/db_server_clnt.c|20010305004141|41933|b548b860f765c597
+tim@threads.polyesthetic.msg|bdb/rpc_server/db_server_xdr.c|20010305004141|53794|336ef020b4a22c05
+tim@threads.polyesthetic.msg|bdb/txn/txn_auto.c|20010305004143|19863|6eb282f016f606d9
+BK|sql-bench/Results-win32/connect-mysql-win98|19700101030959|02535|2a11d5e3dfc0bc67
+BK|sql-bench/Results-win32/select-mysql-win98|19700101030959|02544|f370fac2d66a9faf
+BK|sql-bench/Results/ATIS-mysql_3.21-Linux_2.0.35_i686|19700101030959|02036|c25425e045ca8dfc
+BK|sql-bench/Results/alter-table-mysql_3.21-Linux_2.0.35_i686|19700101030959|02092|762639f2560976bd
+BK|sql/Attic/mini_client.c|19700101030959|01910|9a3778c387d06a81
+BK|sql/Attic/mybinlogdump.cc|19700101030959|01908|5dbdd2bde98d6169
+BK|strings/Attic/ctype-croat.c|19700101030959|01341|d2d805ee6f10cbcc
+BK|strings/Attic/ctype-hungarian.c|19700101030959|01350|5cf0bf7fa0312637
+BK|strings/Attic/ctype-latin1.c|19700101030959|01353|cc63880f19c2303e
+BK|strings/Attic/ctype-latin2.c|19700101030959|01354|31895c4b83654342
+BK|strings/Attic/ctype-win1250.c|19700101030959|01357|1ce7a24255780a1
+BK|support-files/Attic/my-example.cnf.sh|19700101030959|02584|87a7e1f4d24b62a9
+BK|support-files/Attic/my-small.cfg.sh|19700101030959|02588|85023c559a1d96c
+BK|vio/VioConnectorFd.cc|19700101030959|00007|ddbd7821c43c83a2
+BK|vio/VioSSLFactoriesFd.cc|19700101030959|00016|89f6bf5073937947
+Sinisa@sinisa.nasamreza.org|mysql-test/t/sel000004.test|20020522133624|23665|445526a8a20de101
+miguel@hegel.local|zlib/contrib/delphi2/readme.txt|20020319032515|03494|65d16837f8579e23
+miguel@hegel.local|zlib/contrib/iostream2/zstream.h|20020319032515|02537|351f26518ea48196
+miguel@hegel.local|zlib/infcodes.h|20020319032517|58960|3a02220a89c9a4fa
+miguel@hegel.local|zlib/inflate.c|20020319032517|19311|fb22a3a1ab6fb1a0
+miguel@hegel.local|zlib/infutil.c|20020319032518|05244|a9b414f0f4ea0868
+miguel@hegel.local|zlib/nt/zlib.dnt|20020319032519|16279|22a0ed3b86ff8c2
+miguel@hegel.local|zlib/zlib.3|20020319032519|04298|ec5cb4f64476f6a
+monty@donna.mysql.com|mysql-test/r/have_default_master.require|20010104005638|27332|1465255ffdaf82f
+monty@hundin.mysql.fi|sql-bench/Results/ATIS-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|59551|d002b0bc548ff8b3
+monty@hundin.mysql.fi|sql-bench/Results/connect-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|08804|1b715c6fd72e913e
+monty@hundin.mysql.fi|sql-bench/Results/create-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|49804|26e09af61f88d8c9
+monty@narttu.mysql.com|sql-bench/Results/alter-table-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|13605|ee94f987797ca948
+monty@narttu.mysql.com|sql-bench/Results/select-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|35818|34a39fbcb58d8945
+monty@narttu.mysql.com|sql-bench/Results/wisconsin-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|37931|2db07249379f36
+monty@narttu.mysql.com|sql-bench/Results/wisconsin-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|40155|8101a5823c17e58a
+monty@narttu.mysql.fi|sql-bench/Results/RUN-mysql-Linux_2.2.13_SMP_alpha|20001014001004|13092|583091e05a25fb6
+monty@narttu.mysql.fi|sql-bench/Results/alter-table-mysql-Linux_2.2.13_SMP_alpha|20001014001004|15829|6c20c9ef46f82241
+monty@narttu.mysql.fi|sql-bench/Results/insert-mysql-Linux_2.2.14_my_SMP_i686|20001218015323|07880|e1771e0a164bc310
+monty@narttu.mysql.fi|sql-bench/Results/wisconsin-mysql-Linux_2.2.13_SMP_alpha|20001014001004|32465|fc410754151d622c
+mwagner@evoq.home.mwagner.org|Docs/Books/dbi.eps|20001231203219|30594|6ad58f9457e2a564
+mwagner@evoq.home.mwagner.org|Docs/Books/ecomm.eps|20001231203220|02445|58ae914b5d5ea49
+mwagner@evoq.home.mwagner.org|Docs/Books/msql.eps|20001231203220|12487|ffe7d62847663250
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000009.xml|20001017133629|19814|8677613dc624cb0c
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000029.xml|20001017133713|31058|3aba1eb23ef86c9e
+sasha@mysql.sashanet.com|mysql-test/t/rpl000018-master.sh|20010127223331|13256|bc8072e13b26b005
+serg@serg.mysql.com|mysql-test/t/sel000007.test|20001211130730|24336|f431e4f4739a24c3
+serg@serg.mysql.com|mysql-test/t/sel000021.test|20001211130731|57561|94dd47de2872264a
+tim@threads.polyesthetic.msg|bdb/build_vxworks/db_int.h|20010305004134|18702|40ba51edce41403f
+tim@threads.polyesthetic.msg|bdb/build_win32/db_tcl.dsp|20010305004135|02285|5ad951d774e41520
+tim@threads.polyesthetic.msg|bdb/build_win32/ex_lock.dsp|20010305004135|10303|286d2566e786dde
+tim@threads.polyesthetic.msg|bdb/build_win32/excxx_env.dsp|20010305004135|14159|b0bf2649a4c797ac
+tim@threads.polyesthetic.msg|bdb/build_win32/excxx_mpool.dsp|20010305004135|15715|d17a5d09f09f5217
+tim@threads.polyesthetic.msg|bdb/build_win32/include.tcl|20010305004135|17284|f8bffb5e2510f229
+tim@threads.polyesthetic.msg|bdb/db/db_auto.c|20010305004136|32432|3186e950cc321ae7
+tim@threads.polyesthetic.msg|bdb/dist/build/chk.tags|20010305004137|19101|7a5b14d33d4078cc
+tim@threads.polyesthetic.msg|bdb/dist/config.guess|20010305004136|14678|ead1d91caeaa748c
+tim@threads.polyesthetic.msg|bdb/dist/template/rec_btree|20010305004137|23131|65d6b0b2f5b7a6d2
+tim@threads.polyesthetic.msg|bdb/dist/template/rec_db|20010305004137|25141|52c5797539878fca
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_append_recno.html|20010305004144|38070|bdf0130e642f74fa
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_bt_prefix.html|20010305004144|41420|d6e443a7e47c9b3a
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_errpfx.html|20010305004144|05859|756b9b73dd28b8d9
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_feedback.html|20010305004144|06786|90d495e78318a332
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_re_source.html|20010305004144|17353|6d12ac12652acc31
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_stat.html|20010305004144|18351|578f6f99f8e247ff
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lk_max.html|20010305004145|08849|a2dc11fa8b2f1c9
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_pageyield.html|20010305004145|28418|8aa4a6cb2f18cad7
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_rec_init.html|20010305004145|30192|bf7da051ef6689ba
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_tx_max.html|20010305004145|35672|71a739e46faf33a9
+tim@threads.polyesthetic.msg|bdb/docs/api_c/lock_vec.html|20010305004145|45892|cc79e33b82b7a275
+tim@threads.polyesthetic.msg|bdb/docs/api_c/log_register.html|20010305004145|52499|5381c1fad82d6527
+tim@threads.polyesthetic.msg|bdb/docs/api_c/log_stat.html|20010305004145|53440|36b87b19ee2c5bba
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_close.html|20010305004144|08984|8981d16589844161
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_seek.html|20010305004144|21048|fdf1b31d3f6c7473
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_unlink.html|20010305004144|22800|c42b13fd26f2e90
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_cursor.html|20010305004145|29241|4f0225f98f4a11c
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_del.html|20010305004145|31220|43fa05f2dfa86dbc
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_join.html|20010305004146|02717|9c4819679501ad6e
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_remove.html|20010305004146|06326|8c537fc5e326293b
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_h_ffactor.html|20010305004146|17155|a67084c644c38114
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_re_pad.html|20010305004146|24627|f2e0c2c2c3806a97
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_stat.html|20010305004146|26537|3473827de856d680
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_verify.html|20010305004146|29479|14db455da528229d
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbc_class.html|20010305004145|15353|2a31b398c37d674b
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbc_get.html|20010305004146|34739|36e2dbe65e3442e3
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_rec_init.html|20010305004146|58586|77916e00d1361c7b
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_server.html|20010305004146|60631|bb74806839e8eb58
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_tx_max.html|20010305004146|01212|910d1c17dd000729
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/get_errno.html|20010305004145|22249|e1a57c1c5f1d2695
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_compare.html|20010305004146|13902|3225b4c32016c9b1
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_get.html|20010305004146|17104|aee6162219c71617
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_trickle.html|20010305004146|34409|c9df8540b9ebc898
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_begin.html|20010305004147|02053|3a2d1488ec9d8655
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_class.html|20010305004145|26179|5e57abe095aceca9
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_class.html|20010305004147|09609|b957a4d2b77acb1e
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_append_recno.html|20010305004147|36282|d28bf857803b93a2
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_re_len.html|20010305004147|53997|8448826ea78c630e
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_open.html|20010305004147|02873|2df0f0ef544da715
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_data_dir.html|20010305004147|06162|b7b3f35e96804650
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lg_dir.html|20010305004147|12366|484cad2123994e14
+tim@threads.polyesthetic.msg|bdb/docs/api_java/lsn_class.html|20010305004147|20619|b1458208b6c81016
+tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_fput.html|20010305004148|23268|6ba75e517a259703
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_del.html|20010305004148|41829|400c7a72fb10d6f4
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_get_join.html|20010305004148|43762|1c737805c2c49cf9
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/count.html|20010305004148|11236|8fd8daf2e2cbd7c7
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/curclose.html|20010305004148|12231|8b6b8442fc8382f7
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/curput.html|20010305004148|16324|c7e4fa0a68170c3d
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/cursor.html|20010305004148|17350|6dbcdb3b7d552f58
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/sync.html|20010305004148|33751|381722c07c9d8825
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/byteorder.html|20010305004149|21617|999a22f727e2dae0
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/dup.html|20010305004149|23371|523731632fca7343
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/extentsize.html|20010305004149|24263|fdcfb5572974545c
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/malloc.html|20010305004149|29537|cb0e6d7e9448d93e
+tim@threads.polyesthetic.msg|bdb/docs/ref/arch/bigpic.html|20010305004149|37519|ab5254bc99af0d5c
+tim@threads.polyesthetic.msg|bdb/docs/ref/arch/script.html|20010305004149|39400|6796fd0a63161a0c
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/flags.html|20010305004149|46003|a739404f90eb8c3d
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/install.html|20010305004149|48752|660222dd1feffc4
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/irix.html|20010305004149|50564|95833aedc3a82f0
+tim@threads.polyesthetic.msg|bdb/docs/ref/debug/printlog.html|20010305004149|09591|9fa9894f839fad95
+tim@threads.polyesthetic.msg|bdb/docs/ref/debug/runtime.html|20010305004149|10629|d50f2fea4a8e58c
+tim@threads.polyesthetic.msg|bdb/docs/ref/dumpload/format.html|20010305004149|13995|9fa10ca3c7ae6751
+tim@threads.polyesthetic.msg|bdb/docs/ref/env/intro.html|20010305004149|19435|96dd1090729e06b
+tim@threads.polyesthetic.msg|bdb/docs/ref/env/remote.html|20010305004149|23518|52a3a79fdff8f7bd
+tim@threads.polyesthetic.msg|bdb/docs/ref/intro/dbisnot.html|20010305004149|29466|5ce7aed7ce41c9e6
+tim@threads.polyesthetic.msg|bdb/docs/ref/java/conf.html|20010305004150|26401|ef560bcf13a71cd5
+tim@threads.polyesthetic.msg|bdb/docs/ref/log/config.html|20010305004150|41449|aedc53caf49c51c9
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/scope.html|20010305004150|59326|2987f97781410bc1
+tim@threads.polyesthetic.msg|bdb/docs/ref/refs/embedded.html|20010305004150|03865|d25b9719d24df88c
+tim@threads.polyesthetic.msg|bdb/docs/ref/refs/witold.html|20010305004150|65330|ad6c866cf48734b5
+tim@threads.polyesthetic.msg|bdb/docs/ref/sendmail/intro.html|20010305004150|16532|ecac45d7e2bcf51c
+tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/close.html|20010305004150|18046|1fe3a82f28e7ed32
+tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/keydata.html|20010305004150|23810|530b1581aeba63ca
+tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/put.html|20010305004150|25774|bdd2629c212af471
+tim@threads.polyesthetic.msg|bdb/docs/ref/toc.html|20010305004148|08788|ab1fa294d5ef4b69
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/reclimit.html|20010305004151|53098|5f54174bf6026bd5
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/recovery.html|20010305004151|53956|6e3a0c07b997c3b2
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/throughput.html|20010305004151|55655|8a7d5a958df7f91a
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.2.0/intro.html|20010305004151|02261|8bfd3804a2da1598
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/dbenv_cxx.html|20010305004151|09872|7f4fd0ebace36d8e
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/disk.html|20010305004151|11685|eb79d1157ef44d3c
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/java.html|20010305004151|17120|300acccbb633e335
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/jump_set.html|20010305004151|18936|718c098a91db9dba
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/lock_notheld.html|20010305004151|20761|ed6853b6daa5531b
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/open.html|20010305004151|27357|8b1e2a969e97069a
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/intro.html|20010305004152|41719|64592a50b1c634d6
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/set_tx_recover.html|20010305004152|47442|ada65907ba98eee8
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/toc.html|20010305004152|49908|af1a24798980ad1
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/incomplete.html|20010305004152|56914|af86a649a878a124
+tim@threads.polyesthetic.msg|bdb/hash/hash_auto.c|20010305004137|61459|d17c6a6ed4f181d1
+tim@threads.polyesthetic.msg|bdb/include/clib_ext.h|20010305004137|19207|ed9d9f7965f0e1d3
+tim@threads.polyesthetic.msg|bdb/rpc_server/gen_db_server.c|20010305004141|54931|d5602f9bd5c930e
+BK|Docs/Flags/island.gif|19700101030959|00142|e274d5e96ee0975a
+BK|Docs/Flags/south-africa1.txt|19700101030959|00232|87a53fdcd2149c6e
+BK|client/Attic/net.c|19700101030959|00583|c18042da6fa4e693
+BK|extra/Attic/print_defaults.c|19700101030959|01513|362952979aa7b330
+BK|sql-bench/Results-win32/RUN-mysql-win98|19700101030959|02526|7f09e396772a8665
+BK|sql-bench/Results-win32/insert-mysql-win98|19700101030959|02541|6d6cafc85a6c837
+BK|sql-bench/Results/RUN-mysql-3.21-Linux_2.2.1_i686|19700101030959|02050|f6fdd64859e11de9
+BK|sql-bench/Results/big-tables-mysql_3.21-Linux_2.0.35_i686|19700101030959|02120|190e827e569c99a4
+BK|sql-bench/Results/create-mysql-3.21-Linux_2.2.1_i686|19700101030959|02158|51581b24f45e0f5c
+Sinisa@sinisa.nasamreza.org|mysql-test/r/sel000004.result|20020522121240|20995|360af2095c88cb8c
+arjen@co3064164-a.bitbike.com|Docs/section.Comparisons.texi|20011108043647|22614|692b647b
+ccarkner@nslinuxw10.bedford.progress.com|mysql-test/t/isolation.test|20010327145543|39049|6a39e4138dd4a456
+miguel@hegel.local|zlib/algorithm.txt|20020319032513|12903|fbc4dda3d31c2005
+miguel@hegel.local|zlib/contrib/README.contrib|20020319032514|04353|24cb75bee0a061fb
+miguel@hegel.local|zlib/contrib/asm386/zlibvc.def|20020319032514|31637|605ee23b8a4a6a1a
+miguel@hegel.local|zlib/contrib/delphi2/zlib.bpg|20020319032515|09768|93c030edcca1838
+miguel@hegel.local|zlib/contrib/delphi2/zlib.bpr|20020319032515|16113|7a2fa98af2345144
+miguel@hegel.local|zlib/contrib/minizip/unzip.h|20020319032516|21001|bac981086af91a30
+miguel@hegel.local|zlib/contrib/minizip/zip.c|20020319032516|27911|e82bf7774e1ece95
+miguel@hegel.local|zlib/zutil.h|20020319032520|12556|1e431b0173278fb2
+monty@donna.mysql.com|innobase/ib_config.h.in|20010217121901|07616|9e57db8504e55b7
+monty@donna.mysql.com|innobase/ib_config.h|20010217121901|04019|7539e26ffc614439
+monty@narttu.mysql.com|sql-bench/Results/insert-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|27509|d12a7edef05d7185
+mwagner@evoq.home.mwagner.org|Docs/Books/manual.eps|20001231203220|09365|2a7145f88960c7ec
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000025.xml|20001017133713|24071|3e766aa1e43b303
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000030.xml|20001017133600|63205|c2b25781eefaee9
+serg@serg.mysql.com|mysql-test/t/sel000006.test|20001211130730|19922|291cc6c8d85e51df
+serg@serg.mysql.com|mysql-test/t/sel000016.test|20001211130731|32739|f495235f14c47ec
+tim@threads.polyesthetic.msg|bdb/build_win32/db_stat.dsp|20010305004135|00560|f77417f5d9984986
+tim@threads.polyesthetic.msg|bdb/dist/config.sub|20010305004136|16944|17e9990a298261a
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_remove.html|20010305004144|36184|668fa1d67a4f6941
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_malloc.html|20010305004144|01594|3581879fef5af695
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_flags.html|20010305004145|03778|b2a1f3c8498e6d95
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lk_detect.html|20010305004145|07983|d9ed73495defdc19
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lk_max_lockers.html|20010305004145|24923|f22d5d4640436efe
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lk_max_locks.html|20010305004145|09704|1baf2d63a6fb418d
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_tas_spins.html|20010305004145|33848|91c7091deca3d97f
+tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_fclose.html|20010305004145|55335|b52c7d599d83c26
+tim@threads.polyesthetic.msg|bdb/docs/api_c/txn_abort.html|20010305004145|65162|a53425dd70214619
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/cxx_index.html|20010305004145|07331|a0bc165de8a0554c
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_feedback.html|20010305004146|15263|a08620d86f05ec8c
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_malloc.html|20010305004145|12423|b0aa5802da5bef4d
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbc_dup.html|20010305004146|33708|75df863b4bc13aaa
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_close.html|20010305004146|36778|5cc705b97b86972c
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_cachesize.html|20010305004146|39807|b82ed49a47415fec
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lk_detect.html|20010305004146|49591|13e53300b722cf1e
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_panicstate.html|20010305004146|57577|ad2d38e398cafd31
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lock_get.html|20010305004146|61648|527d63a8526f336c
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_put.html|20010305004146|18207|66077da9630fa8c2
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_sync.html|20010305004146|33235|253961279934d3c8
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_h_hash.html|20010305004147|48174|c6eb825c706a9548
+tim@threads.polyesthetic.msg|bdb/docs/api_java/lock_detect.html|20010305004148|06490|14d4e7c7dca0dad7
+tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_fsync.html|20010305004148|25118|e767b233fe7730a2
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/dbc_put.html|20010305004148|57122|290ecb1275d4270
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/env_open.html|20010305004148|59088|39b63925d45a637e
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/tcl_pindex.html|20010305004148|00553|259f0e062eee63c7
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/ops.html|20010305004148|25566|9b24db9ba4f45724
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/bt_compare.html|20010305004149|18156|c1e847e651704c89
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/bt_minkey.html|20010305004149|19013|b4708e561be92b83
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/intro.html|20010305004149|27745|dd1647202258ee28
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/recno.html|20010305004149|32283|c2ae722138309e95
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/select.html|20010305004149|34120|57b1c99f6a8ea93f
+tim@threads.polyesthetic.msg|bdb/docs/ref/distrib/layout.html|20010305004149|12589|5aeb292fbd987cf8
+tim@threads.polyesthetic.msg|bdb/docs/ref/env/error.html|20010305004149|18447|acbbdb848c9fe70f
+tim@threads.polyesthetic.msg|bdb/docs/ref/intro/terrain.html|20010305004149|33850|b396d6447a59435f
+tim@threads.polyesthetic.msg|bdb/docs/ref/lock/intro.html|20010305004150|34434|e1e07e71f3198be
+tim@threads.polyesthetic.msg|bdb/docs/ref/tcl/program.html|20010305004151|23138|2f5bf497ae226ed5
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/archival.html|20010305004151|42978|7631314d840be181
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/logfile.html|20010305004151|50590|1c3002fcb6581e8c
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/read.html|20010305004151|52265|fc8b056380e09887
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/func.html|20010305004151|15332|c06e5bc63ddf7a64
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/logalloc.html|20010305004152|43372|30563c544b8ddd54
+tim@threads.polyesthetic.msg|bdb/docs/sleepycat/contact.html|20010305004152|04402|55b4da3d7bf7655b
+tim@threads.polyesthetic.msg|bdb/docs/utility/db_archive.html|20010305004152|07446|ab2c66e01b3e3626
+tim@threads.polyesthetic.msg|bdb/docs/utility/db_recover.html|20010305004152|12771|1b63f2acdc0b0af7
+tim@threads.polyesthetic.msg|bdb/include/env_ext.h|20010305004138|05832|33a5fdef1aeecefd
+tim@threads.polyesthetic.msg|bdb/include/txn_ext.h|20010305004138|34549|9db24c14f204890c
+BK|Docs/Flags/kroatia.eps|19700101030959|00185|f50fcd444e7efceb
+BK|Docs/Flags/south-africa1.gif|19700101030959|00154|1ea38de5a535f732
+BK|sql-bench/Results/insert-mysql_3.21-Linux_2.0.35_i686|19700101030959|02252|60c0965dff31db07
+BK|sql-bench/Results/select-mysql_3.21-Linux_2.0.35_i686|19700101030959|02278|5fadbac5f98696a
+BK|sql/share/danish/errmsg.sys|19700101030959|01831|3a6d0fb8451a3313
+BK|sql/share/dutch/errmsg.sys|19700101030959|01833|b5aff4d08478bafd
+BK|sql/share/italian/errmsg.sys|19700101030959|01846|c5108ecb850b79a
+BK|sql/share/portuguese/errmsg.sys|19700101030959|01859|c0187322f8c9d805
+BK|vio/VioAcceptorFd.cc|19700101030959|00005|a5a08947a31f88de
+BK|vio/vio-global.h|19700101030959|00021|c261412c01b2f4
+miguel@hegel.local|zlib/ChangeLog|20020319032513|28917|5d5425fc84737083
+miguel@hegel.local|zlib/compress.c|20020319032513|32512|70bccb304651dba9
+miguel@hegel.local|zlib/contrib/asm386/mkgvmt32.bat|20020319032514|25425|422cbe16a6e74695
+miguel@hegel.local|zlib/contrib/delphi2/zlib32.bpr|20020319032515|35585|41ac53acb8008ff7
+miguel@hegel.local|zlib/contrib/delphi2/zlib32.cpp|20020319032515|41979|3b0f51435e880afe
+miguel@hegel.local|zlib/contrib/minizip/ChangeLogUnzip|20020319032515|15183|50464416f4a3768f
+miguel@hegel.local|zlib/index|20020319032517|33542|5443c9f841db4a47
+miguel@hegel.local|zlib/infblock.c|20020319032517|39853|540cc1b743be5f58
+mikef@nslinux.bedford.progress.com|mysql-test/r/have_gemini.require|20010321203410|47052|206702c48b2e206b
+monty@donna.mysql.com|sql-bench/Results/ATIS-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|14134|cf0d806760eefef2
+monty@donna.mysql.com|sql-bench/Results/big-tables-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|18309|c87333d6fe04433e
+monty@donna.mysql.com|sql-bench/Results/connect-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|19522|ab58fffa30dce97e
+monty@donna.mysql.com|sql-bench/Results/insert-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|22042|27b7a557c3cb07a
+monty@donna.mysql.com|sql-bench/Results/wisconsin-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|24748|6a468dcd3e6f5405
+monty@hundin.mysql.fi|sql-bench/Results/RUN-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|35759|11038a44f73070e7
+monty@hundin.mysql.fi|sql-bench/Results/big-tables-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|05113|b6be70bb51013cad
+monty@hundin.mysql.fi|sql-bench/Results/select-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|19688|4ffc9cf4be665ea2
+monty@hundin.mysql.fi|sql-bench/Results/wisconsin-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|60398|8ba598d217450157
+monty@hundin.mysql.fi|support-files/make_mysql_pkg.sh|20010915122456|03682|c616a18bed4b9c2
+monty@narttu.mysql.com|sql-bench/Results/ATIS-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|04677|f761da5546f0d362
+monty@narttu.mysql.com|sql-bench/Results/RUN-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171904|13285|a88e954bc8de5460
+monty@narttu.mysql.com|sql-bench/Results/big-tables-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|17580|28b688e2cd4b6bb3
+monty@narttu.mysql.fi|sql-bench/Results/connect-mysql-Linux_2.2.13_SMP_alpha|20001014001004|21372|84df7c6446e51e26
+monty@narttu.mysql.fi|sql-bench/Results/connect-mysql-Linux_2.2.14_my_SMP_i686|20001218015323|00237|45d2cdf9bea9cc37
+monty@narttu.mysql.fi|sql-bench/Results/wisconsin-mysql-Linux_2.2.14_my_SMP_i686|20001218015323|15116|b7552710d35202b6
+mwagner@evoq.home.mwagner.org|Docs/Books/sql-99.eps|20001231203220|25230|cec4ae16fee4c640
+mwagner@evoq.home.mwagner.org|mysql-test/chew_on_this/select.tst|20001013104933|54568|2e626fa07144d2c8
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000002.xml|20001013074610|25702|8cd06da5293a7147
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000008.xml|20001017133627|18273|1d6082f0905c51b6
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000018.xml|20001017133713|10435|82e2e7bde83f56d8
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000022.xml|20001017133713|17202|da2083ef423ae39a
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000027.xml|20001017133713|27519|95e7de3e9934b570
+sasha@mysql.sashanet.com|mysql-test/r/mrg000002.result|20001212152450|11492|745be0854aaaaf5e
+sasha@mysql.sashanet.com|mysql-test/t/fulltext_join.test|20010730234357|20865|e347c8f04405c916
+serg@serg.mysql.com|mysql-test/r/ft0000002.b.result|20001212120058|34425|5de41ce15ae1cedb
+serg@serg.mysql.com|mysql-test/t/sel000017.test|20001211130731|37659|7c39f2b45a6aa780
+serg@serg.mysql.com|mysql-test/t/sel000018.test|20001211130731|42584|16207f3ad74de75e
+serg@serg.mysql.com|mysql-test/t/sel000022.test|20001211130731|62553|6e3e5435e66875e9
+serg@serg.mysql.com|mysql-test/t/sel000023.test|20001211130731|02042|7bdfcfaa278f837d
+serg@serg.mysql.com|mysql-test/t/sel000025.test|20001211130731|12136|65b32b4b67e4c77
+tfr@sarvik.tfr.cafe.ee|Docs/Flags/costarica.eps|20020228162345|64529|31ade79a89683616
+tim@cane.mysql.fi|mysql-test/r/delete.result|20001221095802|20463|e866a6678e29f186
+tim@threads.polyesthetic.msg|bdb/build_win32/db_deadlock.dsp|20010305004134|28374|befd45d29eaeb672
+tim@threads.polyesthetic.msg|bdb/build_win32/db_dump.dsp|20010305004134|29985|e07d2a82708b61
+tim@threads.polyesthetic.msg|bdb/build_win32/db_recover.dsp|20010305004134|34274|835c32ab73359256
+tim@threads.polyesthetic.msg|bdb/build_win32/db_static.dsp|20010305004135|01425|78ea414467defc70
+tim@threads.polyesthetic.msg|bdb/build_win32/ex_access.dsp|20010305004135|07926|8dd6017efffae14e
+tim@threads.polyesthetic.msg|bdb/build_win32/ex_mpool.dsp|20010305004135|11076|9eb937bc70c1573
+tim@threads.polyesthetic.msg|bdb/build_win32/excxx_access.dsp|20010305004135|12614|31e87b6228470681
+tim@threads.polyesthetic.msg|bdb/dist/build/chk.def|20010305004137|13920|bb65b471d09f7c58
+tim@threads.polyesthetic.msg|bdb/dist/build/chk.srcfiles|20010305004137|18056|ae884700cd110cbf
+tim@threads.polyesthetic.msg|bdb/dist/template/rec_crdel|20010305004137|24191|58795c0c5232f80d
+tim@threads.polyesthetic.msg|bdb/docs/api_c/c_index.html|20010305004143|28133|1a854fa55012906
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_del.html|20010305004144|11427|e8bffcf9be371317
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_get.html|20010305004144|29265|7e0018b93ee31eba
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_get_type.html|20010305004144|31538|d66aa1642a4d20e2
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_open.html|20010305004144|34314|59dfa6e5198c382e
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_realloc.html|20010305004144|03204|a9be244baf966892
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_verify.html|20010305004144|21372|cf80f5ba845eac2e
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_remove.html|20010305004144|31547|a71d5e1ca41324a7
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_cachesize.html|20010305004144|32567|f4c341d3f2c09469
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_errcall.html|20010305004145|00341|ba09eec1ba15f15f
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lk_max_objects.html|20010305004145|25791|1a428bbee06cb5cc
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_mp_mmapsize.html|20010305004145|26668|21f27997f00accfe
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_mutexlocks.html|20010305004145|27540|85bbd53b877cafe1
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_paniccall.html|20010305004144|07360|97a1d58189199453
+tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_fget.html|20010305004145|56294|460714b5c2e3e1c5
+tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_register.html|20010305004145|61165|8b9dff9b5043da58
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_malloc.html|20010305004144|15535|5579a0604e14e1e7
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_rename.html|20010305004144|20199|3f8c7b6674cda105
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_write.html|20010305004144|24518|63567be42d586fde
+tim@threads.polyesthetic.msg|bdb/docs/api_c/txn_commit.html|20010305004145|02592|8950b5e11c8b0778
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_errpfx.html|20010305004146|14381|1f26e7b0bb5a067f
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_sync.html|20010305004146|27538|dadf1f745e44faa7
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_errpfx.html|20010305004146|42728|d26da4bab9538234
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lg_dir.html|20010305004146|46674|c08aac264e7faa97
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_pageyield.html|20010305004146|56583|db4e5bdf71e171c0
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_version.html|20010305004146|06444|1cff25c44cbea934
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/pindex.src|20010305004145|09392|d65361c4acfcef06
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_commit.html|20010305004147|03924|65afb8caf9c470ae
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/what.html|20010305004145|27185|a64f42c697273c44
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_close.html|20010305004147|24101|21595167f4fdbe88
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_del.html|20010305004147|25922|f4f15b362b114506
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_remove.html|20010305004147|34343|49d3b8c7e5a5b000
+tim@threads.polyesthetic.msg|bdb/docs/api_java/dbc_class.html|20010305004147|11473|8ee03c40ae0dbcb8
+tim@threads.polyesthetic.msg|bdb/docs/api_java/dbc_put.html|20010305004147|00700|da0f0fa974385abd
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_shm_key.html|20010305004147|28699|8c576698882f0edc
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_tas_spins.html|20010305004147|30425|2f9963827fbcb3f
+tim@threads.polyesthetic.msg|bdb/docs/api_java/log_archive.html|20010305004148|11996|b4a9483dbb5a2b58
+tim@threads.polyesthetic.msg|bdb/docs/api_java/log_compare.html|20010305004148|12947|756622b42572ecb
+tim@threads.polyesthetic.msg|bdb/docs/api_java/log_put.html|20010305004148|16729|ad7e9f382abde491
+tim@threads.polyesthetic.msg|bdb/docs/api_java/log_stat.html|20010305004148|18608|d186a08662046aba
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_join.html|20010305004148|46525|cb3eb61ed17a1f8
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/env_remove.html|20010305004148|60117|9090900413ff0280
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/pindex.src|20010305004148|39123|f8754fff24f2cb24
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/error.html|20010305004148|19390|45ac854e68196844
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/verify.html|20010305004149|01382|badaeba91bda50e1
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/bt_prefix.html|20010305004149|19903|4e7602aa68d50fe1
+tim@threads.polyesthetic.msg|bdb/docs/ref/arch/utilities.html|20010305004149|40326|54d7014fab332c7a
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/sco.html|20010305004149|55174|e25f6271a1b753d0
+tim@threads.polyesthetic.msg|bdb/docs/ref/dumpload/utility.html|20010305004149|15969|8fc100fdb58adb3c
+tim@threads.polyesthetic.msg|bdb/docs/ref/env/create.html|20010305004149|17402|9f454cb1910df0b8
+tim@threads.polyesthetic.msg|bdb/docs/ref/env/naming.html|20010305004149|20447|1f041789686cc8a0
+tim@threads.polyesthetic.msg|bdb/docs/ref/install/magic.s5.le.txt|20010305004150|23615|528ef76418c8b45c
+tim@threads.polyesthetic.msg|bdb/docs/ref/intro/data.html|20010305004149|26092|33fbf7496c58cf63
+tim@threads.polyesthetic.msg|bdb/docs/ref/intro/distrib.html|20010305004149|30742|84b56709310017f2
+tim@threads.polyesthetic.msg|bdb/docs/ref/intro/products.html|20010305004149|32785|f37221772a3b589d
+tim@threads.polyesthetic.msg|bdb/docs/ref/java/compat.html|20010305004150|25581|b39d173789bbf70d
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/dbsizes.html|20010305004150|52571|d70da530573b9b38
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/errorret.html|20010305004150|55412|23491397d7e704e9
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/recimp.html|20010305004150|60288|bbdb0feb7d467a80
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/version.html|20010305004150|62172|d266e819d1531df8
+tim@threads.polyesthetic.msg|bdb/docs/ref/refs/hash_usenix.ps|20010305004150|05408|11cad226b0aa012b
+tim@threads.polyesthetic.msg|bdb/docs/ref/refs/refs.html|20010305004150|64422|30490b237ba9b61
+tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/handles.html|20010305004150|21935|18a14f4a50e7bad0
+tim@threads.polyesthetic.msg|bdb/docs/ref/tcl/using.html|20010305004151|23908|28856d8c72d0660b
+tim@threads.polyesthetic.msg|bdb/docs/ref/test/run.html|20010305004151|39305|63c0398e7e2a29e2
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.2.0/toc.html|20010305004151|04069|670791f294a61494
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/db.html|20010305004151|07207|e7d63f4bb8e989e8
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/log_stat.html|20010305004151|24428|20b5898ba061557d
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/memp_stat.html|20010305004151|25363|79e1141c63f7357
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/xa.html|20010305004152|00602|1af042e462ab829
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/config.html|20010305004152|38401|d2ace28f39ab0f8d
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/sysmem.html|20010305004152|48282|3d088eb0ef1b27e0
+tim@threads.polyesthetic.msg|bdb/docs/sleepycat/legal.html|20010305004152|02616|7388af4c578cacf6
+tim@threads.polyesthetic.msg|bdb/docs/utility/db_checkpoint.html|20010305004152|08309|c040e4424edcc451
+tim@threads.polyesthetic.msg|bdb/include/common_ext.h|20010305004137|20146|35c8aab64ee3b8fd
+tim@threads.polyesthetic.msg|bdb/include/log_auto.h|20010305004138|13513|8d52dd0884d03051
+tim@threads.polyesthetic.msg|bdb/include/os_ext.h|20010305004138|20730|a1771032b4d2d53b
+tim@threads.polyesthetic.msg|bdb/include/rpc_server_ext.h|20010305004138|29091|952741fb85de2b80
+tonu@x3.internalnet|include/vio.h|20010520213124|42404|c62fd2b86c03da7d
+BK|Docs/Flags/kroatia.gif|19700101030959|00146|bea7bbe0316d462d
+BK|Docs/Flags/kroatia.txt|19700101030959|00224|dde7f89f25d616b2
+BK|mit-pthreads/pgcc|19700101030959|00596|154a03d0c1a0a600
+BK|sql-bench/Results-win32/ATIS-mysql-win98|19700101030959|02523|cd0705815d3af451
+BK|sql-bench/Results-win32/big-tables-mysql-win98|19700101030959|02532|99a1882effebbdf2
+BK|sql-bench/Results/ATIS-mysql-3.21-Linux_2.2.1_i686|19700101030959|02022|660fb76ed6ccfb6f
+BK|sql-bench/Results/RUN-mysql_3.21-Linux_2.0.35_i686|19700101030959|02064|ea8672d8473435
+BK|sql-bench/Results/big-tables-mysql-3.21-Linux_2.2.1_i686|19700101030959|02106|baa649caba113497
+BK|sql-bench/Results/select-mysql-3.21-Linux_2.2.1_i686|19700101030959|02265|ed3687e713ff0571
+BK|sql/Attic/lex_hash.h|19700101030959|01912|14f912771118b50c
+BK|sql/share/czech/errmsg.sys|19700101030959|01828|93104a2bd5c732a
+BK|sql/share/greek/errmsg.sys|19700101030959|01842|fedf585fa73e7cf1
+BK|sql/share/slovak/errmsg.sys|19700101030959|01862|148510616ae825cf
+BK|sql/violite.c|19700101030959|01738|d7b85be615595ace
+BK|strings/Attic/ctype-cp1251.c|19700101030959|01339|cdf74b9168408b3
+BK|strings/Attic/ctype-dec8.c|19700101030959|01343|68f257dd2202d0c7
+BK|vio/VioConnectorFd.h|19700101030959|00008|58bc11cdc885b951
+BK|vio/VioPipe.cc|19700101030959|00011|12cf83b9a2f48f6c
+BK|vio/VioSSLAcceptorFd.cc|19700101030959|00015|4c828f3688ed74ec
+BK|vio/version.cc|19700101030959|00020|7237acf12bed4a97
+arjen@fred.bitbike.com|scripts/mysql_fix_extensions.sh|20020516001337|12363|f1048a78f4759b4d
+miguel@hegel.local|zlib/contrib/asm386/zlibvc.dsw|20020319032514|44870|3209982720f131ab
+miguel@hegel.local|zlib/contrib/asm686/match.s|20020319032514|64199|4164951e8e19f116
+miguel@hegel.local|zlib/contrib/iostream/zfstream.h|20020319032515|61553|2b4d88acc2d3b714
+miguel@hegel.local|zlib/contrib/minizip/zip.def|20020319032516|34413|e9bda2081d65c22e
+miguel@hegel.local|zlib/contrib/minizip/zlibvc.def|20020319032516|47259|6dc42f99d2d55cad
+miguel@hegel.local|zlib/contrib/untgz/untgz.c|20020319032516|07726|b74e9dde74642756
+miguel@hegel.local|zlib/contrib/visual-basic.txt|20020319032516|14096|cd461e762199bb09
+miguel@hegel.local|zlib/deflate.h|20020319032516|33700|3a012bc1f5dfbc74
+miguel@hegel.local|zlib/inftrees.c|20020319032517|25758|4fcb97357cdbc40
+miguel@hegel.local|zlib/trees.h|20020319032519|50674|87161133bc2155fd
+monty@hundin.mysql.fi|sql-bench/Results/alter-table-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|01419|14360865bbba479f
+monty@narttu.mysql.com|sql-bench/Results/create-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|23516|441a6aefd381e319
+monty@narttu.mysql.fi|sql-bench/Results/RUN-mysql-Linux_2.2.14_my_SMP_i686|20001218015322|21374|d4766c7f8e70d7a2
+monty@narttu.mysql.fi|sql-bench/Results/alter-table-mysql-Linux_2.2.14_my_SMP_i686|20001218015322|25875|155a83b53c0e9d6
+monty@narttu.mysql.fi|sql-bench/Results/insert-mysql-Linux_2.2.13_SMP_alpha|20001014001004|26814|688809eb8ea77b3d
+monty@narttu.mysql.fi|sql-bench/Results/select-mysql-Linux_2.2.14_my_SMP_i686|20001218015323|11605|ee2a063d66a183d
+monty@work.mysql.com|fs/fsck.mysql|20010411110350|07619|87170d4358b50d60
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000001.xml|20001013051507|22498|f0eb64c0346366db
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000004.xml|20001017133600|56955|515488ef221523d9
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000005.xml|20001017133618|09973|a6344e46ba572dc3
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000014.xml|20001017133713|05036|bcf55df6a036bd8f
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000019.xml|20001017133713|12133|c0f0b05e481b90e7
+mwagner@evoq.home.mwagner.org|mysql-test/xml/xsl/README|20001013051514|26509|cd4bb681e5a0cd10
+sasha@mysql.sashanet.com|mysql-test/std_data/m.frm|20001212152450|13897|e351dfe0b6824c0c
+sasha@mysql.sashanet.com|mysql-test/t/3.23/shw000001.test|20001121234128|21322|770d96a2c1c65b20
+sasha@mysql.sashanet.com|mysql-test/t/mrg000002.test|20001212152450|20137|16b3a176adc0f311
+serg@serg.mysql.com|mysql-test/r/ft0000002.c.result|20001212120059|07173|cd66b90918a87531
+serg@serg.mysql.com|mysql-test/t/sel000026.test|20001211130731|17211|d8aa2d614f23b1
+serg@serg.mysql.com|mysql-test/t/sel000029.test|20001211130731|32917|6aae34dbb3ee86d9
+tfr@sarvik.tfr.cafe.ee|Docs/Flags/costarica.gif|20020228162348|36945|364ca7338682f71
+tim@threads.polyesthetic.msg|bdb/build_win32/db_archive.dsp|20010305004134|25535|e3da826e91bb086
+tim@threads.polyesthetic.msg|bdb/build_win32/db_printlog.dsp|20010305004134|32975|163f6e1073a5f396
+tim@threads.polyesthetic.msg|bdb/build_win32/db_verify.dsp|20010305004135|04464|e9a4938542f86cea
+tim@threads.polyesthetic.msg|bdb/build_win32/ex_tpcb.dsp|20010305004135|11838|644b38dae8b38152
+tim@threads.polyesthetic.msg|bdb/build_win32/libdb.rc|20010305004135|20964|906f4936ec6a8398
+tim@threads.polyesthetic.msg|bdb/dist/template/db_server_proc|20010305004137|21042|2e8b49d42aefab55
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_err.html|20010305004143|33003|3696088bd85eeda3
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_get_byteswapped.html|20010305004144|30478|bcab4145183a7be2
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_put.html|20010305004144|35267|ea78709ffb6cd7e8
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_cachesize.html|20010305004144|02131|47a3c8ca486eb013
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_errcall.html|20010305004144|04030|faf92be4ee8bc634
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_flags.html|20010305004144|07758|4cd3700ae4387d22
+tim@threads.polyesthetic.msg|bdb/docs/api_c/dbc_close.html|20010305004144|22419|a3ad4ea563bafc42
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_create.html|20010305004144|05736|3e73dd35fe5dcc8
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_data_dir.html|20010305004144|33569|437cec65e441c60
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lg_bsize.html|20010305004145|04625|1eb03c137a42e80f
+tim@threads.polyesthetic.msg|bdb/docs/api_c/lock_get.html|20010305004145|42084|63399d204f1885fa
+tim@threads.polyesthetic.msg|bdb/docs/api_c/lock_put.html|20010305004145|44022|f5bc2f52e55f16e1
+tim@threads.polyesthetic.msg|bdb/docs/api_c/lock_stat.html|20010305004145|44954|d9a98bb949070b
+tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_fput.html|20010305004145|58291|4a7aace7db01ee15
+tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_fset.html|20010305004145|59241|ecb97931b222568d
+tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_fsync.html|20010305004145|60192|a95ab802bb28646f
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_free.html|20010305004144|13076|ed61d2dfea9e069e
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_open.html|20010305004144|17474|8c812591efc8abe6
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_unmap.html|20010305004144|23658|d85790692f3b536e
+tim@threads.polyesthetic.msg|bdb/docs/api_c/txn_stat.html|20010305004145|04637|f57a656bfbac12bf
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_get_type.html|20010305004146|01846|398668783c4070db
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_bt_compare.html|20010305004146|08946|d888d1ebe056bc6b
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_bt_minkey.html|20010305004146|09837|d6181e52342005c
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_lorder.html|20010305004146|19980|a46750a29588268c
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbc_del.html|20010305004146|32671|424fc0ebb3b4c5cf
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_data_dir.html|20010305004146|40779|9176f081597e4f27
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_errfile.html|20010305004145|18322|f9543c9e65ed6a1d
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_error_stream.html|20010305004145|19317|a4101c1d68559fa2
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lk_max.html|20010305004146|50580|52ac3c4ca2876de
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lock_id.html|20010305004146|08539|b3c7995efbe12c16
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lock_stat.html|20010305004146|10635|2112ceb0894b34d8
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lock_vec.html|20010305004146|11739|c55deaa5173a3323
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_unregister.html|20010305004146|21535|8fa1fe691751d6ad
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_get_type.html|20010305004147|29592|4cfb6f09cbe0b8ae
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_open.html|20010305004147|32409|bfc13736b96ac509
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_put.html|20010305004147|33389|c476abe5599f21cf
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_bt_compare.html|20010305004147|37206|e972f964d042b35e
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_bt_minkey.html|20010305004147|38144|c7e1f184bdca25fa
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_feedback.html|20010305004147|45141|69b4c07b3dbe383
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_h_ffactor.html|20010305004147|47226|edcc10024104d57e
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_q_extentsize.html|20010305004147|52035|6ac26239fc538cb
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_sync.html|20010305004147|58064|42391f7d5f200b90
+tim@threads.polyesthetic.msg|bdb/docs/api_java/dbc_count.html|20010305004147|62108|9c239575f4550756
+tim@threads.polyesthetic.msg|bdb/docs/api_java/dbc_dup.html|20010305004147|64103|aa141014c4d7f9b0
+tim@threads.polyesthetic.msg|bdb/docs/api_java/dbc_get.html|20010305004147|65144|e66e387b83681e73
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_close.html|20010305004147|01809|c4e2ec77d7d14d4f
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_remove.html|20010305004147|04039|e92277e3dfd9bba1
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lk_conflicts.html|20010305004147|14497|8951eb975a90918b
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_mp_mmapsize.html|20010305004147|20894|b7dea9108fa65dfa
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_server.html|20010305004147|27545|d901cdab9698605d
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_tx_max.html|20010305004147|33999|70f356b8b67782fe
+tim@threads.polyesthetic.msg|bdb/docs/api_java/lock_class.html|20010305004147|19738|880aa614d1469304
+tim@threads.polyesthetic.msg|bdb/docs/api_java/log_register.html|20010305004148|17668|c68fc6fb22dd594a
+tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_stat.html|20010305004148|27008|4628462474db62b4
+tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_sync.html|20010305004148|27969|5b401daadc7261eb
+tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_checkpoint.html|20010305004148|31832|2565ac892d04b63d
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_open.html|20010305004148|47486|f588cc9bc694cbf0
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_put.html|20010305004148|48549|380c7caeced55512
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/dbc_dup.html|20010305004148|55139|325121689412d70b
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/tcl_index.html|20010305004148|61088|443e6b9a10ef4139
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/txn_abort.html|20010305004148|63068|8cc23b6ef6f457d2
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/version.html|20010305004148|65038|eeb51f4de1bbfe8e
+tim@threads.polyesthetic.msg|bdb/docs/index.html|20010305004143|26935|450dd5db21a9bb64
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/close.html|20010305004148|10227|ed6f7427edc0431
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/curget.html|20010305004148|15271|d7dd42affcd54073
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/h_ffactor.html|20010305004149|25120|5eb87b7ce99f3362
+tim@threads.polyesthetic.msg|bdb/docs/ref/arch/smallpic.gif|20010305004149|42169|fdf77055d7e711
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/hpux.html|20010305004149|47818|d34942564699608
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/linux.html|20010305004149|51464|f9f2d09dc6df75e
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/notes.html|20010305004149|52391|97e9b52853db15ea
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/sunos.html|20010305004149|58008|fc41965e9d95985c
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/ultrix.html|20010305004149|59865|a1dd780edcde11f6
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_win/notes.html|20010305004149|01764|4058bf968f287f7
+tim@threads.polyesthetic.msg|bdb/docs/ref/debug/intro.html|20010305004149|06616|57ef29f26341ea
+tim@threads.polyesthetic.msg|bdb/docs/ref/install/magic.s5.be.txt|20010305004150|22805|cf7d25e758432ab6
+tim@threads.polyesthetic.msg|bdb/docs/ref/intro/what.html|20010305004150|00539|dd70b9e6e085725d
+tim@threads.polyesthetic.msg|bdb/docs/ref/lock/dead.html|20010305004150|33535|f5c7debd9ba739bb
+tim@threads.polyesthetic.msg|bdb/docs/ref/lock/max.html|20010305004150|35299|f0fb32ebc251f636
+tim@threads.polyesthetic.msg|bdb/docs/ref/lock/notxn.html|20010305004150|37003|beec805d9f05e2bc
+tim@threads.polyesthetic.msg|bdb/docs/ref/lock/stdmode.html|20010305004150|38797|4048a052ea129ca3
+tim@threads.polyesthetic.msg|bdb/docs/ref/mp/intro.html|20010305004150|45138|34937731cafcf1b1
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/mt.html|20010305004150|57429|552ab570b657fc0e
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/namespace.html|20010305004150|58394|182f8f762343bdc1
+tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/intro.html|20010305004150|22878|7544c4688623a54c
+tim@threads.polyesthetic.msg|bdb/docs/ref/tcl/error.html|20010305004151|21581|37b817c57777b460
+tim@threads.polyesthetic.msg|bdb/docs/ref/tcl/intro.html|20010305004151|20749|d66c6c398e2ace0b
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/deadlock.html|20010305004151|46421|34914b9dc6b01703
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/put.html|20010305004151|51420|8cc785aeecff8535
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/term.html|20010305004151|54819|d6f3fa4fc5a630ec
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/transapp.txt|20010305004151|57368|337576ea2aae23b0
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/why.html|20010305004151|56525|c941c1a56a0adbaf
+tim@threads.polyesthetic.msg|bdb/docs/ref/txn/config.html|20010305004151|59874|c7337cb30f9bf66
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.2.0/system.html|20010305004151|03146|eae0256a127c3c89
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/close.html|20010305004151|05457|c79c866b393785cc
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/dbinfo.html|20010305004151|10780|7529af7145c0680a
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/envopen.html|20010305004151|14369|5e768fd180f471e4
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/lock_detect.html|20010305004151|19846|fb307b10156762ca
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/txn_commit.html|20010305004151|32241|e1debf9ea769426c
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/disk.html|20010305004152|39192|2abdaf9059265ba9
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/callback.html|20010305004152|53656|64a2b2b85cc253c1
+tim@threads.polyesthetic.msg|bdb/docs/sleepycat/license.html|20010305004152|03483|9371001bbf0ba2dd
+tim@threads.polyesthetic.msg|bdb/docs/utility/index.html|20010305004152|05717|66c82ee036c1b369
+tim@threads.polyesthetic.msg|bdb/qam/qam_auto.c|20010305004141|31764|361954d3f149feb0
+tim@threads.polyesthetic.msg|bdb/test/logtrack.list|20010305004142|05743|7f4f1382b37d98e5
+BK|Docs/Flags/south-africa1.eps|19700101030959|00193|111e4f92f4562e9d
+BK|sql-bench/Results-win32/create-mysql-win98|19700101030959|02538|f66c2cb2909c4792
+BK|sql-bench/Results/wisconsin-mysql_3.21-Linux_2.0.35_i686|19700101030959|02302|31703d40ea6b4f66
+BK|sql/share/english/errmsg.sys|19700101030959|01834|f29bd4ea5aaf54c8
+BK|sql/share/german/errmsg.sys|19700101030959|01840|1ea60675399c84c
+BK|sql/share/korean/errmsg.sys|19700101030959|01850|a30e3687ae75a7c9
+miguel@hegel.local|zlib/contrib/delphi/zlib.mak|20020319032514|11153|7b97eb8cf290a42
+miguel@hegel.local|zlib/contrib/minizip/zlibvc.dsp|20020319032516|54044|ec35fd54c9b49987
+miguel@hegel.local|zlib/faq|20020319032517|20799|b0d0840d3b9faf07
+miguel@hegel.local|zlib/zlib.h|20020319032519|20598|fbec7833981c782f
+monty@donna.mysql.com|sql-bench/Results/big-tables-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|17709|6d8209bf72b663ed
+monty@hundin.mysql.fi|sql-bench/Results/ATIS-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|32241|dd306b2e583ebde4
+monty@hundin.mysql.fi|sql-bench/Results/select-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|56860|b01175ad38fd12b6
+monty@hundin.mysql.fi|sql-bench/Results/wisconsin-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|23386|1ed1dc6abd24e7e3
+monty@narttu.mysql.com|sql-bench/Results/big-tables-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|15583|a2a77f37b689cd63
+monty@narttu.mysql.fi|sql-bench/Results/create-mysql-Linux_2.2.14_my_SMP_i686|20001218015323|04134|d46860c29c5d51ee
+monty@work.mysql.com|libmysqld/WHITEPAPER|20010411110351|28263|da1226799debcf3f
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000007.xml|20001017133625|48163|bfcb6d85276be7e8
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000016.xml|20001017133713|07087|32f1ef2e3d214be0
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000023.xml|20001017133713|20719|11993b379b9838be
+sasha@mysql.sashanet.com|mysql-test/t/identity.test|20010910233028|36116|326f469b59105404
+serg@serg.mysql.com|mysql-test/r/ft0000001.a.result|20001211130756|05199|3d17aff15fa5a9f1
+serg@serg.mysql.com|mysql-test/r/ft0000001.c.result|20001211130756|14950|1040289a75243a92
+serg@serg.mysql.com|mysql-test/t/3.23/mrg000001.test|20001206231615|27540|e0327f9d1e6cb4e
+serg@serg.mysql.com|mysql-test/t/sel000009.test|20001211130730|33139|a455c38f5c942cd1
+serg@serg.mysql.com|mysql-test/t/sel000019.test|20001211130731|47552|8fd63c8dc6be8dbc
+serg@serg.mysql.com|mysql-test/t/sel000020.test|20001211130731|52532|c5758ad18a6dff1e
+tim@threads.polyesthetic.msg|bdb/dist/build/chk.offt|20010305004137|16371|25759c9294db634e
+tim@threads.polyesthetic.msg|bdb/dist/template/rec_log|20010305004137|27185|3fe6d62c43bc553a
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_fd.html|20010305004144|28004|15a01776b340a959
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_key_range.html|20010305004144|33389|1060761b1e359d85
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_paniccall.html|20010305004144|02405|ac7f63325b4499ce
+tim@threads.polyesthetic.msg|bdb/docs/api_c/dbc_del.html|20010305004144|24335|2685f75d28e4ad99
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_open.html|20010305004144|29421|e4c9706220a4cd9b
+tim@threads.polyesthetic.msg|bdb/docs/api_c/lock_id.html|20010305004145|43025|c9ee776f928a38f
+tim@threads.polyesthetic.msg|bdb/docs/api_c/log_archive.html|20010305004145|46850|490428ce45f9f918
+tim@threads.polyesthetic.msg|bdb/docs/api_c/log_flush.html|20010305004145|49632|bb8bc4fc43c9f63d
+tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_fopen.html|20010305004145|57267|d032a963a0103472
+tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_stat.html|20010305004145|62160|55a9521fe04b03bd
+tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_sync.html|20010305004145|63168|b387035a94c20c50
+tim@threads.polyesthetic.msg|bdb/docs/api_c/txn_begin.html|20010305004145|00608|557b34fd3e7363
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_close.html|20010305004145|28189|cc570e65ac7d22f
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_get.html|20010305004145|34357|3b6e6005f3f17f2a
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_cachesize.html|20010305004146|12541|3befdbaf98d5a04e
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_dup_compare.html|20010305004146|13472|91f36955a213e0f4
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_pagesize.html|20010305004146|20914|b8d544ec3e102c6c
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbc_count.html|20010305004146|31395|bc025b8894450525
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbenv_class.html|20010305004145|16297|5ab8aaf8a531f76b
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_open.html|20010305004146|37756|66ac1ae7fa67ca4a
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_errcall.html|20010305004146|41745|bae25b45b0196773
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lk_max_locks.html|20010305004146|51576|bbde4ffbcc607f61
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lk_max_objects.html|20010305004146|53572|c47424e4d13d5327
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_stat.html|20010305004146|20379|dc2d4ffe7950fc09
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_fput.html|20010305004146|26004|7ee8cda6287dee81
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_stat.html|20010305004146|31867|d370717a78971be1
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_stat.html|20010305004147|06751|e8e25f86f8541696
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lg_max.html|20010305004147|13429|c9f705492162e175
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_region_init.html|20010305004147|26379|30534afa94cbf54e
+tim@threads.polyesthetic.msg|bdb/docs/api_java/lock_put.html|20010305004148|09226|5af89e4cbf29c694
+tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_trickle.html|20010305004148|28912|4d5c4e83a4a5c638
+tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_class.html|20010305004147|23221|c7bb2a3393ca9488
+tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_stat.html|20010305004148|34772|9a6ef8c262f218f9
+tim@threads.polyesthetic.msg|bdb/docs/images/sleepycat.gif|20010305004148|07668|ea63aaaa508ef096
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/get.html|20010305004148|20425|96c9c9a01c32d16
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/put.html|20010305004148|28752|8e18b0af61eb7f0f
+tim@threads.polyesthetic.msg|bdb/docs/ref/arch/bigpic.gif|20010305004149|41251|fe43e7415b3bbdb0
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/freebsd.html|20010305004149|46918|8ed2a42e1668004c
+tim@threads.polyesthetic.msg|bdb/docs/ref/dumpload/text.html|20010305004149|14998|88b57a73860b423
+tim@threads.polyesthetic.msg|bdb/docs/ref/lock/page.html|20010305004150|37863|d56876b2565cbee
+tim@threads.polyesthetic.msg|bdb/docs/ref/perl/intro.html|20010305004150|47570|ce7e794e619e1e1d
+tim@threads.polyesthetic.msg|bdb/docs/ref/pindex.src|20010305004149|02223|7d74723f9fd25801
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/environ.html|20010305004150|54494|dc4a48aa531bd399
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/solaris.txt|20010305004150|63135|8b6bb29de0d58ffe
+tim@threads.polyesthetic.msg|bdb/docs/ref/tcl/faq.html|20010305004151|22367|f8433900f7f85400
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.2.0/disk.html|20010305004151|01410|94dc4e6e3668e613
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/cxx.html|20010305004151|06323|7f3bfc9bba854d48
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/btstat.html|20010305004152|37584|40a76aef8b25a948
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/tcl.html|20010305004152|49096|f5c85b09c33bda4
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/intro.html|20010305004152|57734|984a9f7dd07e0c14
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/set_flags.html|20010305004152|61061|213809ca8d7802d0
+tim@threads.polyesthetic.msg|bdb/docs/ref/xa/intro.html|20010305004152|00728|8ac020ffb869e9a8
+tim@threads.polyesthetic.msg|bdb/docs/utility/db_deadlock.html|20010305004152|09191|f23f99911c3e5784
+tim@threads.polyesthetic.msg|bdb/docs/utility/db_verify.html|20010305004152|15424|4fee9bfa2f9ab41a
+tim@threads.polyesthetic.msg|bdb/include/hash_ext.h|20010305004138|10079|5b31ff8413481606
+tim@threads.polyesthetic.msg|bdb/include/qam_auto.h|20010305004138|24568|96f6c045fd0d6cab
+tim@threads.polyesthetic.msg|bdb/rpc_server/db_server_svc.c|20010305004141|50897|35804eb82b953f49
+BK|Docs/Flags/island.txt|19700101030959|00220|301ede0f81c5f3e1
+BK|client/violite.c|19700101030959|00561|afa871b4aab14371
+BK|include/Attic/config-win32.h|19700101030959|00116|65db818ec7e8f21b
+BK|sql-bench/Results/connect-mysql_3.21-Linux_2.0.35_i686|19700101030959|02146|650abd213e6828c6
+BK|sql-bench/Results/insert-mysql-3.21-Linux_2.2.1_i686|19700101030959|02239|fd082017c7c57a6
+BK|sql-bench/Results/wisconsin-mysql-3.21-Linux_2.2.1_i686|19700101030959|02290|8147dc16a1dc6c47
+BK|sql/ha_hash.h|19700101030959|01902|27e36916116beb3e
+BK|sql/share/hungarian/errmsg.sys|19700101030959|01845|aff82c16a77fc800
+BK|sql/share/japanese/errmsg.sys|19700101030959|01848|302478c84697dc00
+BK|sql/share/norwegian/.cvsignore|19700101030959|01853|a91d63182f0b2366
+BK|sql/share/russian/errmsg.sys|19700101030959|01860|72688df0beeabcb3
+BK|sql/share/spanish/errmsg.sys|19700101030959|01865|10c8f32da39070b2
+BK|strings/Attic/ctype-cp1257.c|19700101030959|01340|732611cbc74aeafc
+BK|strings/Attic/ctype-hebrew.c|19700101030959|01348|d3b4a000d51e76dc
+BK|strings/Attic/ctype-win1251ukr.c|19700101030959|01359|b5a7cca889bbef58
+BK|strings/Attic/memory.h|19700101030959|01336|450f586e82a26d99
+BK|tests/fork_test.pl|19700101030959|01945|3d3535329ed8cd5e
+BK|vio/VioAcceptorFd.h|19700101030959|00006|7f9c4358477ba9a3
+BK|vio/VioFd.h|19700101030959|00010|8294293a88c7b4b8
+BK|vio/VioPipe.h|19700101030959|00012|21cebbe61a1da546
+miguel@hegel.local|zlib/contrib/iostream/zfstream.cpp|20020319032515|55262|dce18d1a5d7096b7
+miguel@hegel.local|zlib/contrib/minizip/miniunz.c|20020319032515|21943|6a80009b319b1b9e
+miguel@hegel.local|zlib/contrib/minizip/unzip.def|20020319032516|14456|b4162b8c833ab6c7
+miguel@hegel.local|zlib/descrip.mms|20020319032517|08063|7d61d33062ef53ec
+miguel@hegel.local|zlib/minigzip.c|20020319032518|25601|37f8eacb80c7f8fc
+miguel@hegel.local|zlib/os2/zlib.def|20020319032519|28842|1166a95d83c5f52c
+monty@donna.mysql.com|sql-bench/Results/alter-table-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|17106|6e532c1936df1737
+monty@donna.mysql.com|sql-bench/Results/connect-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|18910|7ed15d6fd1a5944c
+monty@donna.mysql.com|sql-bench/Results/select-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|24071|4f7795c27eaab86b
+monty@hundin.mysql.fi|sql-bench/Results/alter-table-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|39143|662b96bc66bc91b6
+monty@hundin.mysql.fi|sql-bench/Results/create-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|12309|f3b1d326092bf44
+monty@narttu.mysql.com|sql-bench/Results/ATIS-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|07879|2ac8fe298953d43
+monty@narttu.mysql.com|sql-bench/Results/RUN-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|09727|79ac0482599eace1
+monty@narttu.mysql.fi|sql-bench/Results/ATIS-mysql-Linux_2.2.13_SMP_alpha|20001014001004|08145|21ddf9425cbdd58
+monty@narttu.mysql.fi|sql-bench/Results/big-tables-mysql-Linux_2.2.14_my_SMP_i686|20001218015322|30548|f1127add9307098b
+monty@narttu.mysql.fi|sql-bench/Results/create-mysql-Linux_2.2.13_SMP_alpha|20001014001004|23947|2c9af91e9771f618
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000003.xml|20001013074610|26659|1a622b8d30d7ade8
+sasha@mysql.sashanet.com|build-tags|20011201050944|25384|b6f6fff142121618
+sasha@mysql.sashanet.com|mysql-test/t/3.23/sel000004.test|20001103140433|32471|daf9ad4a1a31cd3c
+sasha@mysql.sashanet.com|sounds/compilation_finished.au.gz|20010814034002|63992|70bd14095a918139
+serg@serg.mysql.com|mysql-test/t/sel000013.test|20001211130731|18090|ce8aa504ba4f74ba
+serg@serg.mysql.com|mysql-test/t/sel000028.test|20001211130731|28317|db9bfc0a808fb629
+serg@serg.mysql.com|mysql-test/t/sel000030.test|20001211130732|03110|a29683eac3e7b706
+tim@cane.mysql.fi|mysql-test/t/delete.test|20001221095802|36821|389410e29f2cebe5
+tim@threads.polyesthetic.msg|bdb/btree/btree_auto.c|20010305004134|12592|a683156a176761f
+tim@threads.polyesthetic.msg|bdb/build_win32/db_checkpoint.dsp|20010305004134|26943|8071af22db95b1db
+tim@threads.polyesthetic.msg|bdb/build_win32/db_upgrade.dsp|20010305004135|03711|90fd250190af4984
+tim@threads.polyesthetic.msg|bdb/dist/install-sh|20010305004136|21695|1858c24340b72628
+tim@threads.polyesthetic.msg|bdb/dist/template/gen_client_ret|20010305004137|22087|786a5e65119b3991
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_close.html|20010305004144|26254|fda0b4dfa946f44e
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_create.html|20010305004143|29368|a87157ea60c82ee2
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_cursor.html|20010305004144|27133|7431dd96ed3492c
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_lsn.html|20010305004143|34135|5edb9bce1118feae
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_bt_compare.html|20010305004144|39551|e55a311bb0be93a8
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_dup_compare.html|20010305004144|03068|a833bfc727a794e7
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_errfile.html|20010305004144|00766|f07d3c57bb3c8fbd
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_pagesize.html|20010305004144|12535|9644fa0f538cde17
+tim@threads.polyesthetic.msg|bdb/docs/api_c/dbc_count.html|20010305004144|23385|c3cd00c48b4babf5
+tim@threads.polyesthetic.msg|bdb/docs/api_c/dbc_dup.html|20010305004144|25301|3bdf8b0a687b43f3
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_errpfx.html|20010305004145|01527|806c8c438d0ee36c
+tim@threads.polyesthetic.msg|bdb/docs/api_c/hsearch.html|20010305004144|08165|a8b76d897a8216d8
+tim@threads.polyesthetic.msg|bdb/docs/api_c/lock_detect.html|20010305004145|41159|8fe406dce10e0bb
+tim@threads.polyesthetic.msg|bdb/docs/api_c/log_put.html|20010305004145|51546|11a1bec49bb90419
+tim@threads.polyesthetic.msg|bdb/docs/api_c/log_unregister.html|20010305004145|54401|45b8f9d3f8eb3d80
+tim@threads.polyesthetic.msg|bdb/docs/api_c/memp_trickle.html|20010305004145|64180|8b1adf1404d7a5f
+tim@threads.polyesthetic.msg|bdb/docs/api_c/pindex.src|20010305004143|31726|d1ecd116c42e0e23
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_class.html|20010305004145|08391|3129ff8c53721fe8
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_fd.html|20010305004145|33050|99ec316575f80428
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_rename.html|20010305004146|07200|9c0a820e864220b3
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_bt_prefix.html|20010305004146|11627|ecd8f927371a5dbd
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_h_hash.html|20010305004146|18078|afe952f65389d93b
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_paniccall.html|20010305004145|13411|6bc911c9d64e9237
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_flags.html|20010305004146|44734|8136e8e1ae16dc02
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lg_bsize.html|20010305004146|45706|7fd917bea6b163bf
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lg_max.html|20010305004146|47638|4f7ba5f02c66c0de
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_mp_mmapsize.html|20010305004146|54573|c21e3f9c5a29b0ab
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_strerror.html|20010305004146|05414|7e1cbfbd096ca
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_archive.html|20010305004146|12836|d47f39e6dad7ee50
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_register.html|20010305004146|19292|55470e0d79382beb
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_fget.html|20010305004146|23710|bfe74f8c299c2995
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_fset.html|20010305004146|27124|e52fa0488faa893
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_register.html|20010305004146|29358|cba6f572fe27c7a
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_get_byteswapped.html|20010305004147|28706|edbc66a9d5491a1
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_join.html|20010305004147|30506|a3a6dead9cae65f9
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_rename.html|20010305004147|35341|19b20feaa815bc27
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_h_nelem.html|20010305004147|49144|fc6f22a4c285fcef
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_re_source.html|20010305004147|55969|b29827dbf47537d1
+tim@threads.polyesthetic.msg|bdb/docs/api_java/dbc_close.html|20010305004147|61116|e3bf1f36bc0e8e7e
+tim@threads.polyesthetic.msg|bdb/docs/api_java/dbt_class.html|20010305004147|13192|f6b04ff142e332f8
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_error_stream.html|20010305004147|15677|a738119910b452b8
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_feedback.html|20010305004147|09255|9748745e65f070d5
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lk_max_locks.html|20010305004147|17677|f0114205b169de39
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_pageyield.html|20010305004147|23054|774b3da0306a6767
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_panicstate.html|20010305004147|24142|72846d9a97cb80bb
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_tmp_dir.html|20010305004147|32251|f23e4f614f6d975a
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_verbose.html|20010305004148|03690|9dcda0399c8256e7
+tim@threads.polyesthetic.msg|bdb/docs/api_java/except_class.html|20010305004147|16978|195c00e4a7cbe648
+tim@threads.polyesthetic.msg|bdb/docs/api_java/lock_id.html|20010305004148|08326|737cf8d8dc74084e
+tim@threads.polyesthetic.msg|bdb/docs/api_java/log_get.html|20010305004148|15736|5fbbbd4baa60e052
+tim@threads.polyesthetic.msg|bdb/docs/api_java/mem_class.html|20010305004147|21486|2e5052b5b2bea584
+tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_fopen.html|20010305004148|22355|f7cf58725aa1c406
+tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_register.html|20010305004148|26052|8331390a1c66fefd
+tim@threads.polyesthetic.msg|bdb/docs/api_java/pindex.src|20010305004147|10521|de828917f041d27b
+tim@threads.polyesthetic.msg|bdb/docs/api_java/runrec_class.html|20010305004147|22358|49c5cb3efe0c201
+tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_commit.html|20010305004148|32812|c265042f3340baa1
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_close.html|20010305004148|38213|f40794b17e0fe443
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_remove.html|20010305004148|50431|3b2be4b0b1b3dc98
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_sync.html|20010305004148|52310|3b615ca64d934602
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/env_close.html|20010305004148|58109|bf191b2673a2b19e
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/pagesize.html|20010305004149|30437|eb4800704ae1131b
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/renumber.html|20010305004149|33199|b7df79bf32240b5c
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/qnx.html|20010305004149|54263|6d2849a8e8038dc9
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_vxworks/intro.html|20010305004149|62808|2eed15d25078711
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_vxworks/notes.html|20010305004149|63758|7e53a042c5c4d350
+tim@threads.polyesthetic.msg|bdb/docs/ref/java/program.html|20010305004150|28026|e9bbc08bccf5d396
+tim@threads.polyesthetic.msg|bdb/docs/ref/lock/am_conv.html|20010305004150|30986|3bab32d969f21b77
+tim@threads.polyesthetic.msg|bdb/docs/ref/lock/config.html|20010305004150|32692|a593ea4c87467ddd
+tim@threads.polyesthetic.msg|bdb/docs/ref/log/intro.html|20010305004150|42339|31e7055d83ca8757
+tim@threads.polyesthetic.msg|bdb/docs/ref/mp/config.html|20010305004150|46018|771c2c91fc0b6b17
+tim@threads.polyesthetic.msg|bdb/docs/ref/txn/nested.html|20010305004151|62443|6860bbf2f29aa93b
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/dup.html|20010305004152|40004|911018877c118b45
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/tx_recover.html|20010305004152|62754|132a354cde7a8286
+tim@threads.polyesthetic.msg|bdb/docs/ref/xa/config.html|20010305004152|64479|3f3f449c305e66b4
+tim@threads.polyesthetic.msg|bdb/docs/ref/xa/faq.html|20010305004152|65373|7aa890c7b70f1293
+tim@threads.polyesthetic.msg|bdb/docs/utility/db_upgrade.html|20010305004152|14532|6444f26a93f77ea
+tim@threads.polyesthetic.msg|bdb/include/crdel_auto.h|20010305004137|21088|1b8255da47550ece
+tim@threads.polyesthetic.msg|bdb/include/db_server.h|20010305004137|34247|61a33aa05bf368a7
+tim@threads.polyesthetic.msg|bdb/include/mutex_ext.h|20010305004138|19006|f20f47ddc346598b
+tim@threads.polyesthetic.msg|bdb/include/qam_ext.h|20010305004138|25430|9993db1fb3428b6d
+tim@threads.polyesthetic.msg|bdb/include/tcl_ext.h|20010305004138|31857|6759d22aa2ff5f39
+tim@threads.polyesthetic.msg|bdb/include/txn_auto.h|20010305004138|33645|e3f49e94fd291c45
+tim@threads.polyesthetic.msg|bdb/rpc_client/gen_client.c|20010305004141|43060|ad86f092d0996a68
+tim@threads.polyesthetic.msg|bdb/rpc_server/db_server_proc.sed|20010305004141|49906|1a9af8e5b051acbd
+tim@threads.polyesthetic.msg|bdb/test/include.tcl|20010305004141|34016|20fc297b040cbe2
+BK|client/Attic/libmysql.c|19700101030959|00582|72949a7043113807
+BK|mit-pthreads/pg++|19700101030959|00597|3beac0502025d766
+BK|myisam/ft_search.c|19700101030959|01642|c011cb6e8041bb59
+BK|mysys/test_vsnprintf.c|19700101030959|01502|e3d568aca62dc81e
+BK|strings/Attic/ctype-usa7.c|19700101030959|01356|d19d859dca5675f
+BK|strings/Attic/ctype-win1251.c|19700101030959|01358|762607f4fd7d52ad
+BK|tests/fork3_test.pl|19700101030959|01947|c4a7bffb4f8e813c
+BK|vio/VioSSLFactoriesFd.h|19700101030959|00017|1d63ae149a63f85
+BK|vio/VioSocket.cc|19700101030959|00018|71c615783f29b5e1
+Sinisa@sinisa.nasamreza.org|scripts/mysql_new_fix_privilege_tables.sh|20011226144909|43765|b1664b401375eece
+miguel@hegel.local|zlib/contrib/iostream/test.cpp|20020319032515|48225|a2ea8d4d7c66cf71
+miguel@hegel.local|zlib/contrib/minizip/unzip.c|20020319032516|07891|c66c95e17321206d
+miguel@hegel.local|zlib/deflate.c|20020319032516|26978|e22894a54233bc25
+miguel@hegel.local|zlib/infcodes.c|20020319032517|52620|dffb42fdf2fb2372
+miguel@hegel.local|zlib/inffast.h|20020319032517|06651|215e4a4ccfc886fc
+miguel@hegel.local|zlib/maketree.c|20020319032518|19299|7f281aef3547fee
+miguel@hegel.local|zlib/msdos/zlib.rc|20020319032518|25240|f8a286fa8371ee09
+miguel@hegel.local|zlib/zutil.c|20020319032520|05372|6f0d1763c5deb409
+monty@donna.mysql.com|sql-bench/Results/alter-table-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|16525|2f516d2c108a9e05
+monty@donna.mysql.com|sql-bench/Results/insert-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|22723|a85a6f0477c13f83
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000017.xml|20001017133713|08762|81423597605ff77f
+sasha@mysql.sashanet.com|build-tags|20011125054855|05181|7afb7e785b80f97
+sasha@mysql.sashanet.com|mysql-test/r/binlog-backup-restore.result|20010424233926|16010|605de78abda64d27
+sasha@mysql.sashanet.com|mysql-test/r/identity.result|20010910233028|16331|e41453a364242503
+serg@serg.mysql.com|mysql-test/t/sel000010.test|20001211130731|03554|ca07085ae92255f1
+tim@threads.polyesthetic.msg|bdb/build_win32/excxx_tpcb.dsp|20010305004135|16510|159c727e2c15105e
+tim@threads.polyesthetic.msg|bdb/dist/build/chk.define|20010305004137|15254|aa9a626e58631003
+tim@threads.polyesthetic.msg|bdb/dist/template/rec_hash|20010305004137|26120|dcbdd106ae17b865
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_bt_minkey.html|20010305004144|40498|e2d52ba2d0174432
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_re_delim.html|20010305004144|14446|e0a7face764111b9
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_upgrade.html|20010305004144|20363|5e6210d6f09a0c3e
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_errfile.html|20010305004144|06564|3b6b0822f29fc3d4
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_panicstate.html|20010305004145|29311|43228366ca64363c
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_dirfree.html|20010305004144|09784|d59f36547c7b5384
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_dirlist.html|20010305004144|10606|24e75ccc86809023
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_ioinfo.html|20010305004144|14713|80365bb8c66ae84c
+tim@threads.polyesthetic.msg|bdb/docs/api_c/txn_checkpoint.html|20010305004145|01607|4a1704dbfcaad5dc
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_get_byteswapped.html|20010305004146|00979|a44d5d57d050b466
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_put.html|20010305004146|05435|2792034e8c83c56
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_errfile.html|20010305004145|11465|f6eddb9ab7ef07d0
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_flags.html|20010305004146|16174|1146625feeb3bb0b
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_re_source.html|20010305004146|25550|46998978715ccc1
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lk_conflicts.html|20010305004146|48615|5bba88df4cc6dfba
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_lk_max_lockers.html|20010305004146|52578|ebb61fd669c2eefb
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_tx_timestamp.html|20010305004146|03286|6396a1145f8e41c1
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lock_class.html|20010305004145|23233|ed88ab78cccbef8d
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/mempfile_class.html|20010305004145|25191|672b4aa787b4aeca
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_id.html|20010305004147|04873|162661f4c2dc09d6
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/txn_prepare.html|20010305004147|05797|818b4163518bace5
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_cursor.html|20010305004147|25020|2181d652bd1c1ff
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_fd.html|20010305004147|26830|1f70020c37023baa
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_bt_prefix.html|20010305004147|39088|a3269aad23e6dbc
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_dup_compare.html|20010305004147|40992|3dabd840a1d9e5f3
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_errcall.html|20010305004147|41930|4e4743f5b4277199
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_re_delim.html|20010305004147|53019|78fcf2d750fb26ef
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_cachesize.html|20010305004147|05132|f3700cd19856f14e
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lk_max_objects.html|20010305004147|19812|d1ed194631ffeb2a
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_mutexlocks.html|20010305004147|21961|aad8e4a059075bb6
+tim@threads.polyesthetic.msg|bdb/docs/api_java/java_index.html|20010305004147|18736|8ecfcef4a702011d
+tim@threads.polyesthetic.msg|bdb/docs/api_java/log_unregister.html|20010305004148|19590|eee284e0da176d0a
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_count.html|20010305004148|40010|4812f3756a75437
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_rename.html|20010305004148|49486|909bc643d5455b54
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/dbc_del.html|20010305004148|54185|7e94f9f01e7e4453
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/dbc_get.html|20010305004148|56098|5bbb80cf51aff594
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/join.html|20010305004148|22331|acc16686a78a732
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/cachesize.html|20010305004149|22486|99dcd466dc881093
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/aix.html|20010305004149|44137|e8ae448bdb85fa22
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/conf.html|20010305004149|45053|d0378c69618b790b
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_win/faq.html|20010305004149|65331|34704a907168cea7
+tim@threads.polyesthetic.msg|bdb/docs/ref/debug/common.html|20010305004149|07598|607061232e2532df
+tim@threads.polyesthetic.msg|bdb/docs/ref/debug/compile.html|20010305004149|08609|12785e3091b78bfd
+tim@threads.polyesthetic.msg|bdb/docs/ref/intro/where.html|20010305004150|01442|6cb9ec27f19ecbbb
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/diskspace.html|20010305004150|53502|959508f155721ee8
+tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/example.txt|20010305004150|28042|9ff88f22565208bf
+tim@threads.polyesthetic.msg|bdb/docs/ref/txn/limits.html|20010305004151|61583|3004b7a93dab148b
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.2.0/convert.html|20010305004151|00512|d7f18eb34c1b6ae
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/db_cxx.html|20010305004151|08078|5c17d6a360205140
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/lock_stat.html|20010305004151|22568|c49716e693ce225b
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/log_register.html|20010305004152|42524|7177eeb2fc099317
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/memp_register.html|20010305004152|44171|7d92464a1029d53e
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/put.html|20010305004152|44997|961a1a689be6ce
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/set_feedback.html|20010305004152|45815|6d7de50be92a5488
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/db_dump.html|20010305004152|54477|7d1cac3358c0482e
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/handle.html|20010305004152|56086|bb8a73b74d4399ae
+tim@threads.polyesthetic.msg|bdb/docs/utility/berkeley_db_svc.html|20010305004152|06576|91fe012778882ce4
+tim@threads.polyesthetic.msg|bdb/docs/utility/db_dump.html|20010305004152|10062|5de7ade427f20332
+tim@threads.polyesthetic.msg|bdb/include/btree_ext.h|20010305004137|18246|5d53d710f170c6b6
+tim@threads.polyesthetic.msg|bdb/include/gen_server_ext.h|20010305004138|07539|fd7bcfe6bbca8bcb
+tim@threads.polyesthetic.msg|bdb/include/mp_ext.h|20010305004138|17070|a528b772d42d6455
+BK|include/Attic/mysql_com.h.in|19700101030959|00115|85b1ea7ced528c32
+BK|libmysql/configure.in|19700101030959|02603|c6fc04d4e3d6e291
+BK|myisam/Attic/ft_global.h|19700101030959|01673|fe46fb515f1e375
+BK|sql-bench/Results-win32/alter-table-mysql-win98|19700101030959|02529|e8743982f790462
+BK|sql-bench/Results/alter-table-mysql-3.21-Linux_2.2.1_i686|19700101030959|02073|f6f7ccd7b3c35f97
+BK|sql/Attic/mini_client_errors.c|19700101030959|01909|29edad51a5d0b068
+BK|sql/Attic/net_serv.c|19700101030959|01911|52dabcd773a39e10
+BK|strings/Attic/ctype-greek.c|19700101030959|01347|90acdff1195209ca
+BK|strings/Attic/ctype-koi8_ukr.c|19700101030959|01352|a04aa14a6d62335a
+BK|support-files/Attic/my-huge.cfg.sh|19700101030959|02585|589bdcd2d2c4360b
+BK|support-files/Attic/my-medium.cfg.sh|19700101030959|02587|c49880d26ef0648e
+BK|vio/Vio.cc|19700101030959|00003|60737ce02ab2bc25
+miguel@hegel.local|zlib/contrib/asm686/readme.686|20020319032514|04933|15e2bf4653b71f3e
+miguel@hegel.local|zlib/contrib/minizip/minizip.c|20020319032515|28588|97181367a7bc47d8
+miguel@hegel.local|zlib/inftrees.h|20020319032517|32227|ffcbe51816466e5c
+miguel@hegel.local|zlib/zconf.h|20020319032519|63437|c6b6b636c7e88d90
+monty@donna.mysql.com|sql-bench/Results/wisconsin-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|25437|24a02e007a58bf73
+monty@hundin.mysql.fi|sql-bench/Results/insert-mysql-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010605132759|53328|fd2699adb3190d07
+monty@narttu.mysql.com|sql-bench/Results/connect-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|19531|7dd5ac726f86cf0b
+monty@narttu.mysql.com|sql-bench/Results/connect-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|21574|1cf5d5f0d70a3fa0
+monty@narttu.mysql.com|sql-bench/Results/create-mysql_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|25516|fc207468e871ff69
+monty@narttu.mysql.com|sql-bench/Results/select-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|33684|ddcf36cdf3f72e8c
+mwagner@evoq.home.mwagner.org|Docs/Books/prof.eps|20001231203220|15779|dc69b039543a57d7
+mwagner@evoq.home.mwagner.org|mysql-test/xml/README|20001013051440|12362|877d76bcd19f7193
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000020.xml|20001017133713|13843|8849bbf91a4fd5ec
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000028.xml|20001017133713|29282|c72bfec6600949b
+nick@nick.leippe.com|mysql-test/r/rpl_empty_master_crash.result|20020531235552|47718|615f521be2132141
+sasha@mysql.sashanet.com|mysql-test/t/3.23/sel000005.test|20001103140433|36002|982fde89a4d6d886
+serg@serg.mysql.com|mysql-test/r/ft0000001.b.result|20001211130756|10153|505c4c00a0bddfc4
+serg@serg.mysql.com|mysql-test/t/sel000011.test|20001211130731|08373|c2a971726c9d18d6
+tfr@sarvik.tfr.cafe.ee|Docs/Flags/costarica.txt|20020228162350|33044|e155c53c10374ff
+tim@threads.polyesthetic.msg|bdb/build_win32/db_java.dsp|20010305004134|31520|e3941d5a9810b360
+tim@threads.polyesthetic.msg|bdb/build_win32/excxx_btrec.dsp|20010305004135|13384|61b563f4ac1f73eb
+tim@threads.polyesthetic.msg|bdb/docs/api_c/c_pindex.html|20010305004145|05766|697acebf58a8db4
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_h_nelem.html|20010305004144|10635|bd8371e033b15c8f
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_re_len.html|20010305004144|15420|f30d68257bd60e1e
+tim@threads.polyesthetic.msg|bdb/docs/api_c/dbc_put.html|20010305004144|27355|a2c4a52329376657
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_tx_recover.html|20010305004145|36580|8dd351545b444a24
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_tx_timestamp.html|20010305004145|37492|ddb77d7dfb531085
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_strerror.html|20010305004145|39331|7f090bf26bdd4dc
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_exists.html|20010305004144|12261|23f077e82ca8f827
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_fsync.html|20010305004144|13884|f59339ff63d95e7d
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_read.html|20010305004144|18372|c8f6ece1ed408bf8
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_key_range.html|20010305004146|03630|d79b373af096cb7
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_upgrade.html|20010305004146|28493|c6231eb2f9989284
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbc_put.html|20010305004146|35761|11e6aa2492dd1032
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbt_class.html|20010305004145|17281|fb91648586c1aa77
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_paniccall.html|20010305004145|20292|2080056f15faa516
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_tx_recover.html|20010305004146|02235|cdf13797131b2d97
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/except_class.html|20010305004145|21277|59839667e43592e
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_flush.html|20010305004146|16027|3976f77e905f35eb
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_get.html|20010305004147|27733|87b8316c55b24739
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_verify.html|20010305004147|60082|20873ab17f6ed922
+tim@threads.polyesthetic.msg|bdb/docs/api_java/dbc_del.html|20010305004147|63111|6ec2b8a4b8dde996
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lg_bsize.html|20010305004147|11335|6c67beed877df84c
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_lk_max.html|20010305004147|16607|12b6e34ac5a53281
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_version.html|20010305004148|05599|854d26806930cab6
+tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_fset.html|20010305004148|24178|5c5371a93b83275
+tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_begin.html|20010305004148|30859|553bf78bd7fc3e0a
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_cursor.html|20010305004148|40924|e035b3c11a91c5d6
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/db_get_type.html|20010305004148|44686|7202f3ca793e6ec3
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/txn.html|20010305004148|62085|8e345950e6029230
+tim@threads.polyesthetic.msg|bdb/docs/images/prev.gif|20010305004148|04639|9448d24755d708a0
+tim@threads.polyesthetic.msg|bdb/docs/images/ps.gif|20010305004148|05648|f6b1b372cb2cda4c
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/logrec.html|20010305004149|28646|5edeb34d63936e2
+tim@threads.polyesthetic.msg|bdb/docs/ref/arch/progmodel.html|20010305004149|38491|caa422dc155b6370
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_win/intro.html|20010305004149|00770|2975a07b53b12046
+tim@threads.polyesthetic.msg|bdb/docs/ref/intro/need.html|20010305004149|31743|43950806e35d71f
+tim@threads.polyesthetic.msg|bdb/docs/ref/refs/bdb_usenix.ps|20010305004150|02162|9851f6cdeff17481
+tim@threads.polyesthetic.msg|bdb/docs/ref/rpc/server.html|20010305004150|14510|79f560205494295
+tim@threads.polyesthetic.msg|bdb/docs/ref/test/faq.html|20010305004151|38444|f95038006d18229
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/admin.html|20010305004151|41323|cf867ed0b00cccef
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/data_open.html|20010305004151|45592|413c1d8aba9d8018
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/dbenv.html|20010305004151|08972|f9863847dc1ed617
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/join.html|20010305004151|18031|ec21d874caa0654
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/stat.html|20010305004151|29377|775d75e3ba02d15c
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/toc.html|20010305004151|30301|16e7d8e76496cbc9
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.1/env.html|20010305004152|40827|381e366a9c9c9a37
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/disk.html|20010305004152|55280|61799ebebe78ebb2
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/mutexlock.html|20010305004152|58567|972b710c5bdba67c
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.2/notfound.html|20010305004152|59393|dc91c094aba92838
+tim@threads.polyesthetic.msg|bdb/docs/utility/db_load.html|20010305004152|10976|981095940db0197
+tim@threads.polyesthetic.msg|bdb/docs/utility/db_printlog.html|20010305004152|11895|fcc4075ad0232842
+tim@threads.polyesthetic.msg|bdb/include/db_ext.h|20010305004137|29469|a1e210bbd0de0a48
+tim@threads.polyesthetic.msg|bdb/include/gen_client_ext.h|20010305004138|06647|5c621cacb18b38
+tim@threads.polyesthetic.msg|bdb/include/lock_ext.h|20010305004138|11814|ccd0785bb206933f
+tim@threads.polyesthetic.msg|bdb/log/log_auto.c|20010305004137|49459|fe8c0369965f7151
+tim@threads.polyesthetic.msg|bdb/rpc_server/db_server.x|20010305004141|47705|811aeb6b630fe7aa
+BK|include/Attic/m_ctype.h.in|19700101030959|00114|f671e3c2d611ba97
+BK|sql/share/norwegian-ny/.cvsignore|19700101030959|01855|469064b5190d703d
+BK|sql/share/swedish/errmsg.sys|19700101030959|01866|dd772e93db859993
+BK|strings/Attic/ctype-danish.c|19700101030959|01342|dc5451066eb272ae
+BK|strings/Attic/ctype-swe7.c|19700101030959|01355|bb1b012225d7d02c
+BK|strings/Attic/ptr_cmp.c|19700101030959|01337|57e682a26e769597
+BK|vio/VioFd.cc|19700101030959|00009|6e444647affef63b
+BK|vio/vioelitexx.cc|19700101030959|00022|3eaba70da792a7fc
+miguel@hegel.local|zlib/adler32.c|20020319032513|04487|f98728c6da1ac164
+miguel@hegel.local|zlib/contrib/asm386/zlibvc.dsp|20020319032514|38372|a1c6749052ce48a
+miguel@hegel.local|zlib/contrib/delphi2/zlib.pas|20020319032515|28965|3c94d3f5262cbbdd
+miguel@hegel.local|zlib/contrib/iostream2/zstream_test.cpp|20020319032515|08848|63f635d540de8c48
+miguel@hegel.local|zlib/contrib/minizip/readme.txt|20020319032516|00611|7547b986c067c008
+miguel@hegel.local|zlib/contrib/minizip/zlibvc.dsw|20020319032516|60515|17f28194a5cd80ea
+miguel@hegel.local|zlib/example.c|20020319032517|14327|490f57a4a9440dfa
+miguel@hegel.local|zlib/infblock.h|20020319032517|46202|4526bc327b4160ab
+miguel@hegel.local|zlib/infutil.h|20020319032518|12977|13089e09be34788c
+miguel@hegel.local|zlib/readme|20020319032519|35257|80a41fc822f5f4
+mikef@nslinux.bedford.progress.com|mysql-test/include/have_gemini.inc|20010321203410|40631|42f94f0dfd0f7b18
+monty@donna.mysql.com|sql-bench/Results/RUN-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|15344|d922a0fcc1009130
+monty@donna.mysql.com|sql-bench/Results/RUN-pg_fast-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|15933|840503a555e420ec
+monty@donna.mysql.com|sql-bench/Results/create-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|20136|241c337935ae1524
+monty@hundin.mysql.fi|sql-bench/Results/insert-pg-Linux_2.4.0_64GB_SMP_i686-cmp-mysql,pg|20010603134548|15984|a0143553cccb54e2
+monty@narttu.mysql.fi|sql-bench/Results/select-mysql-Linux_2.2.13_SMP_alpha|20001014001004|29737|db59425a7f4aa93f
+monty@work.mysql.com|libmysqld/README|20010411110351|24268|434e9cae5fa9a4c4
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000010.xml|20001017133713|64368|9b98c9cce8fac145
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000012.xml|20001017133713|01909|a410d08dc4cfee11
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000024.xml|20001017133713|22352|dd067aa28220fa4c
+serg@serg.mysql.com|mysql-test/r/ft0000002.a.result|20001212120058|27306|a89b4db1db19f944
+serg@serg.mysql.com|mysql-test/t/sel000014.test|20001211130731|22977|74cb8c70f1d73fcc
+tim@threads.polyesthetic.msg|bdb/build_win32/db_dll.dsp|20010305004134|29137|4e9dda53c84511b6
+tim@threads.polyesthetic.msg|bdb/build_win32/db_load.dsp|20010305004134|32237|e83a2af8e24a715d
+tim@threads.polyesthetic.msg|bdb/docs/api_c/dbc_get.html|20010305004144|26284|4bf7579a92c35195
+tim@threads.polyesthetic.msg|bdb/docs/api_c/dbm.html|20010305004144|04019|ebf1d8e329b06bba
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_feedback.html|20010305004145|02860|87a78f97ba545aba
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lg_max.html|20010305004145|06288|319c24b5245b0685
+tim@threads.polyesthetic.msg|bdb/docs/api_c/log_compare.html|20010305004145|47782|4f12fdf04d30ab94
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_sleep.html|20010305004144|21928|4b962c8b82989d8c
+tim@threads.polyesthetic.msg|bdb/docs/api_c/set_func_yield.html|20010305004144|25375|ca5e359bcbeca7fd
+tim@threads.polyesthetic.msg|bdb/docs/api_c/txn_id.html|20010305004144|04952|1e71088a7e8f6678
+tim@threads.polyesthetic.msg|bdb/docs/api_c/txn_prepare.html|20010305004145|03605|19f84203db4e6608
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_err.html|20010305004145|10496|77022bd5af575696
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/dbc_close.html|20010305004146|30462|2adba79b482ee157
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_tas_spins.html|20010305004146|64671|a107049f4776b358
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_verbose.html|20010305004146|04365|e804a65368b5cdc1
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lock_put.html|20010305004146|09587|9eb85a1c9e88621
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/log_file.html|20010305004146|14965|9a724b41d84e0c31
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_fopen.html|20010305004146|24842|abfef0a4db99c8e1
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_errpfx.html|20010305004147|42881|c446da51277796df
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_flags.html|20010305004147|46212|b6b9d271bd42a94e
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_upgrade.html|20010305004147|59076|782fa4cc6c633990
+tim@threads.polyesthetic.msg|bdb/docs/api_java/deadlock_class.html|20010305004147|14282|b587b2d8c9e5d0b0
+tim@threads.polyesthetic.msg|bdb/docs/api_java/get_errno.html|20010305004147|17836|89a89f8efe3a9360
+tim@threads.polyesthetic.msg|bdb/docs/api_java/java_pindex.html|20010305004148|35859|f8bc0811d8eda8e9
+tim@threads.polyesthetic.msg|bdb/docs/api_java/lock_get.html|20010305004148|07401|fd52de261831f9b5
+tim@threads.polyesthetic.msg|bdb/docs/api_java/lock_vec.html|20010305004148|11077|df5eb838fdbe1eab
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/curdel.html|20010305004148|13236|39bf0a8cba99c064
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/delete.html|20010305004148|18364|9195664374690b24
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/opensub.html|20010305004148|24500|81c79cce793fb343
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/stability.html|20010305004148|30129|a92faac934d69cef
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/solaris.html|20010305004149|57063|3a85fb541538d0d7
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/test.html|20010305004149|58940|b2c2f275a0c3e783
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_win/test.html|20010305004149|02729|84090b57cb7f0cf8
+tim@threads.polyesthetic.msg|bdb/docs/ref/env/open.html|20010305004149|21520|37a6e67d520d6c00
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/appsignals.html|20010305004150|48930|3ab63bf9399d7ead
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/byteorder.html|20010305004150|49835|f7fa52b53e4c8838
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/compatible.html|20010305004150|50729|237b98e6a6d7ed35
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/extending.html|20010305004150|56407|6a86a40872d6b8bc
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/runtime.html|20010305004150|61233|6853fdbfe15df788
+tim@threads.polyesthetic.msg|bdb/docs/ref/refs/bdb_usenix.html|20010305004150|00758|bad2247b4f8c582b
+tim@threads.polyesthetic.msg|bdb/docs/ref/rpc/client.html|20010305004150|12568|824178f8626e45b7
+tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/del.html|20010305004150|19030|514a1bd568ed4c1d
+tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/get.html|20010305004150|20970|211de230d6a6cbc5
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/env_open.html|20010305004151|47233|c8d61102658c3bbf
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/filesys.html|20010305004151|48077|ebee24f726f99bf6
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/intro.html|20010305004151|16219|7ecd16967b0bc868
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/lock_put.html|20010305004151|21664|fd9ed0b04b465af
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/rmw.html|20010305004151|28431|992b0143d13a3ec0
+tim@threads.polyesthetic.msg|bdb/docs/utility/db_stat.html|20010305004152|13652|9582c327964e1f9
+tim@threads.polyesthetic.msg|bdb/include/btree_auto.h|20010305004137|17274|84d4451c78faf67e
+BK|sql/share/polish/errmsg.sys|19700101030959|01857|126b03af92054f0f
+BK|strings/Attic/ct_init.c|19700101030959|01338|f0948bdd35ceedc3
+BK|strings/Attic/ctype.c.in|19700101030959|01361|8bf48d4bcbc5f675
+BK|vio/Vio.h|19700101030959|00004|f4416b2949647602
+BK|vio/VioSSL.h|19700101030959|00014|70d367b7ec8cac3e
+BK|vio/violite.h|19700101030959|00023|58d2942a52ea7a83
+miguel@hegel.local|zlib/contrib/asm586/readme.586|20020319032514|57815|f60bfeefb27217d
+miguel@hegel.local|zlib/contrib/delphi/zlibdef.pas|20020319032514|18918|658cb04db561e3db
+miguel@hegel.local|zlib/contrib/delphi2/d_zlib.bpr|20020319032514|25335|c267d77cc2e2a2c8
+miguel@hegel.local|zlib/contrib/minizip/zip.h|20020319032516|40925|17fd39ccb4ea294c
+miguel@hegel.local|zlib/gzio.c|20020319032517|27098|e02d23e656c19359
+monty@donna.mysql.com|sql-bench/Results/select-pg-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817132749|23395|8ef771713f89e1
+monty@narttu.mysql.com|sql-bench/Results/alter-table-mysql-Linux_2.2.14_my_SMP_i686-cmp-mysql,pg|20000817171625|11725|dfc480becae45236
+monty@narttu.mysql.fi|sql-bench/Results/ATIS-mysql-Linux_2.2.14_my_SMP_i686|20001218015322|06287|d275df58a04737c8
+mwagner@evoq.home.mwagner.org|Docs/Books/algor.eps|20001231203219|20480|481984607c98d715
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000011.xml|20001017133713|00331|432156d127cbd22f
+mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000015.xml|20001017133749|30814|b72689a8f9b21372
+mwagner@evoq.home.mwagner.org|mysql-test/xml/xsl/mysqltest.xsl|20001013051514|27425|1b8f6ec4f1b5f634
+sasha@mysql.sashanet.com|mysql-test/t/df_crash.test|20010406010433|65180|4c365178fe437f6
+serg@serg.mysql.com|mysql-test/t/sel000008.test|20001211130730|28581|b338ef585cadf7ae
+serg@serg.mysql.com|mysql-test/t/sel000012.test|20001211130731|13215|ae64bff363c42e92
+serg@serg.mysql.com|mysql-test/t/sel000027.test|20001211130731|23677|ab44bb57a580de9
+tim@threads.polyesthetic.msg|bdb/db/crdel_auto.c|20010305004136|27298|ee4146a08fd175c1
+tim@threads.polyesthetic.msg|bdb/dist/config.hin|20010305004136|15955|fdecb7a06fa137a7
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_join.html|20010305004144|32446|a58c2d81ecfea5b
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_h_ffactor.html|20010305004144|08766|41352ddf74ccc338
+tim@threads.polyesthetic.msg|bdb/docs/api_c/db_set_lorder.html|20010305004144|11587|e24ae76325374653
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_lg_dir.html|20010305004145|05444|26be310214a2ff8f
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_region_init.html|20010305004145|31081|2ca19f76ee1ae790
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_set_shm_key.html|20010305004145|32880|cf5aaa6a995cbf55
+tim@threads.polyesthetic.msg|bdb/docs/api_c/env_version.html|20010305004145|40251|9bf7f99fefacc2bf
+tim@threads.polyesthetic.msg|bdb/docs/api_c/log_get.html|20010305004145|50583|24cdf17ba55cbecf
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_open.html|20010305004146|04518|ab95c48ac26ad3f7
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_q_extentsize.html|20010305004146|21826|b17e340a68ede3ac
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/db_set_realloc.html|20010305004145|14370|64d967a58c328957
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_feedback.html|20010305004146|43755|1d5bd8dfe2d8034e
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_mutexlocks.html|20010305004146|55575|f73e7ffdd2d8d62f
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_shm_key.html|20010305004146|62685|65b2c2f848ddf31e
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/env_set_tmp_dir.html|20010305004146|00169|6c815da1fad27537
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/lock_detect.html|20010305004146|07495|bb50519c431233ed
+tim@threads.polyesthetic.msg|bdb/docs/api_cxx/memp_fsync.html|20010305004146|28227|76d47da7c5dc8932
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_cachesize.html|20010305004147|40035|22d172a2d29f276b
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_lorder.html|20010305004147|50103|f64cbdd62bbbdd7c
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_pagesize.html|20010305004147|51079|d899ea90b20b7b31
+tim@threads.polyesthetic.msg|bdb/docs/api_java/db_set_re_pad.html|20010305004147|54985|2729c192747ac7af
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_errpfx.html|20010305004147|08227|a3b9a09670f6912
+tim@threads.polyesthetic.msg|bdb/docs/api_java/env_set_flags.html|20010305004147|10283|690847bb5e205c21
+tim@threads.polyesthetic.msg|bdb/docs/api_java/log_file.html|20010305004148|13857|74a49bae2532199a
+tim@threads.polyesthetic.msg|bdb/docs/api_java/memp_fget.html|20010305004148|21431|ca84dee01997eb89
+tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_abort.html|20010305004148|29858|ec9a3517748bfa3
+tim@threads.polyesthetic.msg|bdb/docs/api_java/txn_id.html|20010305004148|01920|798720b73cc9391
+tim@threads.polyesthetic.msg|bdb/docs/api_tcl/dbc_close.html|20010305004148|53244|ef431e58d72accc3
+tim@threads.polyesthetic.msg|bdb/docs/images/next.gif|20010305004148|03600|ddab96466674135b
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/curdup.html|20010305004148|14243|5c855e1f5b99d990
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/partial.html|20010305004148|26629|db4a970c839b3051
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/stat.html|20010305004148|32050|fafc0f88571d9395
+tim@threads.polyesthetic.msg|bdb/docs/ref/am/upgrade.html|20010305004149|00532|c7499736f03c1a1c
+tim@threads.polyesthetic.msg|bdb/docs/ref/am_conf/re_source.html|20010305004149|31346|b000d11ca4a0f9a
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_unix/shlib.html|20010305004149|56099|7168ed40f2e1155d
+tim@threads.polyesthetic.msg|bdb/docs/ref/build_vxworks/faq.html|20010305004149|61835|cdb7646d3d2e6374
+tim@threads.polyesthetic.msg|bdb/docs/ref/env/region.html|20010305004149|22506|cc94139c8daa7f6a
+tim@threads.polyesthetic.msg|bdb/docs/ref/env/security.html|20010305004149|24507|e455f95aee7f5cd2
+tim@threads.polyesthetic.msg|bdb/docs/ref/intro/dbis.html|20010305004149|28303|e672b7615d70be2c
+tim@threads.polyesthetic.msg|bdb/docs/ref/program/copy.html|20010305004150|51641|bcf5ff9656fafcd3
+tim@threads.polyesthetic.msg|bdb/docs/ref/refs/libtp_usenix.ps|20010305004150|08667|73329b041f7e8c41
+tim@threads.polyesthetic.msg|bdb/docs/ref/simple_tut/open.html|20010305004150|24776|5d6eb5c3df68eeee
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/checkpoint.html|20010305004151|43948|29e077c954369ed
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/cursor.html|20010305004151|44775|824b2f28c9e8d610
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/inc.html|20010305004151|48911|5ea32b4e2a2107b3
+tim@threads.polyesthetic.msg|bdb/docs/ref/transapp/writetest.txt|20010305004151|58289|4de1fc39894cd760
+tim@threads.polyesthetic.msg|bdb/docs/ref/txn/intro.html|20010305004151|60722|85fabd5518fb26be
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/eacces.html|20010305004151|12569|f0299373d8b2f65c
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/eagain.html|20010305004151|13462|920800d8eb450f79
+tim@threads.polyesthetic.msg|bdb/docs/ref/upgrade.3.0/txn_begin.html|20010305004151|31307|53512180de5fec80
+tim@threads.polyesthetic.msg|bdb/include/log_ext.h|20010305004138|14339|2988f11d4545c76b
+tim@threads.polyesthetic.msg|bdb/include/xa_ext.h|20010305004138|36449|50918e5ef9f095b6
+tim@threads.polyesthetic.msg|bdb/java/src/com/sleepycat/db/DbConstants.java|20010305004138|56622|15fa87eda6b72302
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index 31c8d0a3253..1e82492161d 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -3,11 +3,14 @@ Administrator@co3064164-a.rochd1.qld.optushome.com.au
Administrator@fred.
Miguel@light.local
Sinisa@sinisa.nasamreza.org
+WAX@sergbook.mysql.com
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
akishkin@work.mysql.com
arjen@co3064164-a.bitbike.com
arjen@fred.bitbike.com
arjen@george.bitbike.com
+bar@bar.mysql.r18.ru
+bar@bar.udmsearch.izhnet.ru
bar@gw.udmsearch.izhnet.ru
bell@sanja.is.com.ua
davida@isil.mysql.com
@@ -33,6 +36,7 @@ miguel@light.local
monty@bitch.mysql.fi
monty@donna.mysql.fi
monty@hundin.mysql.fi
+monty@mashka.mysql.fi
monty@narttu.
monty@narttu.mysql.fi
monty@tik.
@@ -41,11 +45,17 @@ monty@tramp.mysql.fi
monty@work.mysql.com
mwagner@cash.mwagner.org
mwagner@evoq.mwagner.org
+nick@mysql.com
nick@nick.leippe.com
paul@central.snake.net
paul@teton.kitebird.com
+peter@linux.local
+peter@mysql.com
ram@gw.udmsearch.izhnet.ru
+ram@ram.(none)
root@x3.internalnet
+salle@geopard.(none)
+salle@geopard.online.bg
sasha@mysql.sashanet.com
serg@serg.mysql.com
serg@sergbook.mysql.com
@@ -63,14 +73,10 @@ tonu@hundin.mysql.fi
tonu@volk.internalnet
tonu@x153.internalnet
tonu@x3.internalnet
+venu@myvenu.com
venu@work.mysql.com
+walrus@mysql.com
worm@altair.is.lan
zak@balfor.local
zak@linux.local
-venu@myvenu.com
-walrus@mysql.com
-ram@ram.(none)
-WAX@sergbook.mysql.com
-bar@bar.udmsearch.izhnet.ru
-nick@mysql.com
-bar@bar.mysql.r18.ru
+zgreant@mysql.com
diff --git a/BitKeeper/triggers/post-commit b/BitKeeper/triggers/post-commit
index dea8c2a2a5d..f8ab599fc98 100755
--- a/BitKeeper/triggers/post-commit
+++ b/BitKeeper/triggers/post-commit
@@ -46,9 +46,10 @@ From: $FROM
To: $INTERNALS
Subject: bk commit into 4.1 tree
-Below is the list of changes that have just been committed into a
-4.1 repository of $USER. When $USER does a push, they will be propogated to
-the main repository and within 24 hours after the push to the public repository.
+Below is the list of changes that have just been committed into a local
+4.1 repository of $USER. When $USER does a push these changes will
+be propagated to the main repository and, within 24 hours after the
+push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
@@ -79,5 +80,5 @@ EOF
fi
else
- echo "commit failed because '$BK_STATUS', sorry life is hard..."
+ echo "commit failed because '$BK_STATUS', you may need to re-clone..."
fi
diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile
index e05f19181c0..061b0c4147f 100755
--- a/Build-tools/Do-compile
+++ b/Build-tools/Do-compile
@@ -2,17 +2,17 @@
use Getopt::Long;
$opt_distribution=$opt_user=$opt_result=$opt_config_options=$opt_config_env="";
-$opt_dbd_options=$opt_perl_options=$opt_suffix="";
+$opt_dbd_options=$opt_perl_options=$opt_make_options=$opt_suffix="";
$opt_tmp=$opt_version_suffix="";
$opt_help=$opt_Information=$opt_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_no_mysqltest=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=0;
$opt_innodb=$opt_bdb=0;
-GetOptions("Information","help","distribution=s","user=s","result=s","delete","no-test","no-mysqltest","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s","tcpip","suffix=s","build-thread=i","innodb","bdb","use-old-distribution","enable-shared","no-crash-me","no-strip","version-suffix=s", "with-other-libc=s") || usage();
+GetOptions("Information","help","distribution=s","user=s","result=s","delete","no-test","no-mysqltest","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","make-options=s", "sur","with-small-disk","dbd-options=s","tcpip","suffix=s","build-thread=i","innodb","bdb","use-old-distribution","enable-shared","no-crash-me","no-strip","version-suffix=s", "with-other-libc=s") || usage();
usage() if ($opt_help || $opt_Information);
usage() if (!$opt_distribution);
-if (($opt_innodb || $opt_bdb) && $opt_version_suffix eq "")
+if ($opt_bdb && $opt_version_suffix eq "")
{
$opt_version_suffix="-max";
}
@@ -75,6 +75,19 @@ $ENV{"PERL5LIB"}="$pwd/$host/perl5:$pwd/$host/perl5/site_perl";
$slave_port=$mysql_tcp_port+16;
$manager_port=$mysql_tcp_port+1;
+if ($opt_stage == 0)
+{
+ system("mkdir Logs") if (! -d "Logs");
+ system("mv $log ${log}-old") if (-f $log);
+ unlink($log);
+}
+
+open(LOG,">>$log") || abort("Can't open log file, error $?");
+select LOG;
+$|=1;
+select STDOUT;
+$|=1;
+
if (-x "$host/bin/mysqladmin")
{
log_system("$host/bin/mysqladmin --no-defaults -u root -S $mysql_unix_port -s shutdown");
@@ -97,25 +110,22 @@ if ($opt_stage == 0)
}
rm_all("$host/test");
system("mkdir $host/test") if (! -d "$host/test");
- system("mkdir Logs") if (! -d "Logs");
- system("mv $log ${log}-old") if (-f $log);
- unlink($log);
}
-open(LOG,">>$log") || abort("Can't open log file, error $?");
-select LOG;
-$|=1;
-select STDOUT;
-$|=1;
-
safe_cd($host);
if ($opt_stage == 0 && ! $opt_use_old_distribution)
{
safe_system("gunzip < $opt_distribution | $tar xf -");
# Fix file times; This is needed because the time for files may be
- # in the future
- system("touch timestamp; find . -newer timestamp -print | xargs touch; rm -f timestamp");
+ # in the future. The following is done this way to ensure that
+ # we don't get any errors from xargs touch
+ system("touch timestamp");
+ sleep(2);
+ system("touch timestamp2");
+ system("find . -newer timestamp -print | xargs touch");
+ unlink("timestamp");
+ unlink("timestamp2");
sleep(2);
# Ensure that files we don't want to rebuild are newer than other files
safe_cd($ver);
@@ -149,7 +159,7 @@ if ($opt_stage <= 1)
}
if ($opt_with_other_libc)
{
- $opt_with_other_libc = "--with-other-libc=$opt_with_other_libc";
+ $opt_with_other_libc = "--with-other-libc=$opt_with_other_libc";
}
if (!$opt_enable_shared)
{
@@ -172,8 +182,11 @@ if ($opt_stage <= 1)
if ($opt_stage <= 2)
{
+ my ($command);
unlink($opt_distribution) if ($opt_delete && !$opt_use_old_distribution);
- safe_system("$make");
+ $command=$make;
+ $command.= " $opt_make_options" if (defined($opt_make_options) && $opt_make_options ne "");
+ safe_system($command);
}
#
@@ -225,7 +238,7 @@ if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest)
{
system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir);
safe_cd("${test_dir}/mysql-test");
- check_system("./mysql-test-run --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
+ check_system("./mysql-test-run --warnings --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
}
# Start the server if we are going to run any of the benchmarks
@@ -241,7 +254,7 @@ if (!$opt_no_test)
$extra="";
if ($opt_bdb)
{
- $extra.=" -O bdb_cache_size=16M";
+ $extra.=" --bdb_cache_size=16M --bdb_max_lock=60000"
}
if ($opt_innodb)
{
@@ -368,6 +381,9 @@ To set up the environment, like 'CC=cc CXX=gcc CXXFLAGS=-O3'
--dbd-options 'options'
Options for Makefile.PL when configuring msql-mysql-modules.
+--make-options 'options'
+Options to make after configure. (Like 'CXXLD=gcc')
+
--version-suffix suffix
Can be used to set a suffix (normally 'com' or '-max') for a distribution
@@ -547,13 +563,17 @@ sub rm_all
sub kill_all
{
my ($pattern) = @_;
- my ($USER,$BSD,$LINUX,$pscmd, $user, $pid);
+ my ($USER,$BSD,$LINUX, $pscmd, $user, $pid);
$user=$ENV{'USER'};
- $BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4";
+ $BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4" || $^O eq 'darwin';
$LINUX = $^O eq 'linux';
$pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef";
- open(PS, "$pscmd|") || die "can't run $pscmd: $!";
+ if (!open(PS, "$pscmd|"))
+ {
+ print "Warning: Can't run $pscmd: $!\n";
+ exit;
+ }
# Catch any errors with eval. A bad pattern, for instance.
process:
diff --git a/Build-tools/Do-linux-build b/Build-tools/Do-linux-build
index a8b12d8b4ae..44a9ad05fa2 100755
--- a/Build-tools/Do-linux-build
+++ b/Build-tools/Do-linux-build
@@ -16,6 +16,7 @@ BUILD/compile-pentium-max $OTHER_LIBC \
--prefix=/usr/local/mysql --with-extra-charset=complex \
--enable-thread-safe-client --enable-local-infile \
--with-server-suffix=-max
+nm -n sql/mysqld | gzip -9 -v 2>&1 > sql/mysqld.sym.gz
scripts/make_binary_distribution
make dist
Build-tools/Do-rpm --local
@@ -23,4 +24,5 @@ BUILD/compile-pentium --with-other-libc=$OTHER_LIBC_DIR \
--with-comment="Official MySQL Binary" \
--prefix=/usr/local/mysql --with-extra-charset=complex \
--enable-thread-safe-client --enable-local-infile
+nm -n sql/mysqld | gzip -9 -v 2>&1 > sql/mysqld.sym.gz
scripts/make_binary_distribution
diff --git a/Build-tools/mysql-copyright-2 b/Build-tools/mysql-copyright-2
index 5aeb4bb81db..a0d30f308e5 100755
--- a/Build-tools/mysql-copyright-2
+++ b/Build-tools/mysql-copyright-2
@@ -89,13 +89,18 @@ sub add_copyright
elsif ($ARGV =~ /\.c$/ ||
$ARGV =~ /\.cc$/ ||
$ARGV =~ /\.h$/ ||
- $ARGV =~ /\.yy$/ ||
- $ARGV =~ /-x86\.s$/)
+ $ARGV =~ /\.yy$/)
{
$start_copyright="/* ";
$line_copyright= " ";
$end_copyright= " */";
}
+ elsif ($ARGV =~ /-x86\.s$/)
+ {
+ $start_copyright="# ";
+ $line_copyright= "# ";
+ $end_copyright= "";
+ }
elsif ($ARGV =~ /\.s$/)
{
$start_copyright="! ";
diff --git a/Docs/Makefile.am b/Docs/Makefile.am
index 156d26a9a02..80832719893 100644
--- a/Docs/Makefile.am
+++ b/Docs/Makefile.am
@@ -27,7 +27,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) $(BUILT_SOURCES) mysqld_error.txt \
all: $(targets) txt_files
txt_files: ../INSTALL-SOURCE ../COPYING ../COPYING.LIB \
- ../MIRRORS INSTALL-BINARY
+ INSTALL-BINARY # ../MIRRORS
CLEAN_FILES: $(BUILD_SOURCES)
touch $(BUILD_SOURCES)
@@ -254,8 +254,8 @@ INSTALL-BINARY: mysql.info $(GT)
../COPYING.LIB: mysql.info $(GT)
perl -w $(GT) mysql.info "LGPL license" "Function Index" > $@
-../MIRRORS: manual.texi $(srcdir)/Support/generate-mirror-listing.pl
- perl -w $(srcdir)/Support/generate-mirror-listing.pl manual.texi > $@
+#../MIRRORS: manual.texi $(srcdir)/Support/generate-mirror-listing.pl
+# perl -w $(srcdir)/Support/generate-mirror-listing.pl manual.texi > $@
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/Docs/Support/docbook-fixup.pl b/Docs/Support/docbook-fixup.pl
index f9934822f40..48ab085ad3e 100755
--- a/Docs/Support/docbook-fixup.pl
+++ b/Docs/Support/docbook-fixup.pl
@@ -38,7 +38,7 @@ $data =~ s/FIXUPmdashFIXUP/\&mdash\;/g;
$data =~ s/FIXUPdoubledashFIXUP/--/g;
-$data =~ s/FIXUPstrongFIXUP/<emphasis\ role\=bold>/g;
+$data =~ s/FIXUPstrongFIXUP/<emphasis\ role\=\"bold\">/g;
$data =~ s/FIXUPendstrongFIXUP/<\/emphasis>/g;
$data =~ s/FIXUPemphFIXUP/<emphasis>/g;
diff --git a/Docs/Support/update-reserved-words.pl b/Docs/Support/update-reserved-words.pl
index 6164698943f..2920e083c9c 100755
--- a/Docs/Support/update-reserved-words.pl
+++ b/Docs/Support/update-reserved-words.pl
@@ -6,6 +6,7 @@
# 2001-12-07 Fixup by arjen@mysql.com, add column headings for multitable.
# 2002-05-01 Fixup by arjen@mysql.com, use 3 columns instead of 4.
# 2002-05-03 Fixup by arjen@mysql.com, fill last row to full # of columns.
+# 2002-06-14 Fixup by arjen@mysql.com, Issue a "bk edit manual.texi".
print STDERR "Scanning lex.h for symbols..\n";
open LEX, "<../sql/lex.h";
@@ -48,6 +49,8 @@ for( ; $i%3; $i++) {
$list .= sprintf "%s\n", $pre[$i%3];
}
+`bk edit manual.texi`;
+
open OLD, "<manual.texi";
open NEW, ">manual-tmp.texi";
diff --git a/Docs/manual.de.texi b/Docs/manual.de.texi
index 94c822b94da..01d1b008ebe 100644
--- a/Docs/manual.de.texi
+++ b/Docs/manual.de.texi
@@ -47852,7 +47852,7 @@ angeben. Ansonsten kann jeder beliebige Benutzer mit einem Konto auf der
Maschine @code{mysql -u root datenbank} eingeben und tun, was er will.
-@node File permissions , , Changing MySQL user, Installation Issues
+@node File permissions, , Changing MySQL user, Installation Issues
@c German node Dateirechte
@appendixsubsec Probleme mit Dateirechten
diff --git a/Docs/manual.ja.texi b/Docs/manual.ja.texi
index dea7046b538..2a0b0fbf34b 100644
--- a/Docs/manual.ja.texi
+++ b/Docs/manual.ja.texi
@@ -23949,7 +23949,7 @@ Uptime: 10077 Threads: 1 Questions: 9 Slow queries: 0 Opens: 6 Flush tables
@item Max memory used @tab mysqld ¤Î¥³¡¼¥É¤Ë¤è¤Ã¤ÆÄ¾Àܳä¤êÅö¤Æ¤é¤ì¤ëºÇÂç¥á¥â¥ê¡¼ÎÌ (only available when @strong{MySQL} is compiled with --with-debug)
@end multitable
-If you do @code{myslqadmin shutdown} on a socket (in other words, on a
+If you do @code{mysqladmin shutdown} on a socket (in other words, on a
the computer where @code{mysqld} is running), @code{mysqladmin} will
wait until the @code{MySQL} @code{pid-file} is removed to ensure that
the @code{mysqld server} has stopped properly.
@@ -34271,7 +34271,7 @@ Some small changes to the join table optimizer to make some joins faster.
@code{MYSQL} ¤È¤È¤·¤Æ¥³¡¼¥ë¤Ç¤­¤º¡¢¤³¤ÎÂå¤ï¤ê¤Ë @code{mysql_field_count()} ¤ò
»ÈÍѤ·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
@item
-@code{LIBEWRAP} ¤ÎÄɲÃ; Patch by Henning P . Schmiedehausen.
+@code{LIBWRAP} ¤ÎÄɲÃ; Patch by Henning P . Schmiedehausen.
@item
Don't allow @code{AUTO_INCREMENT} for other than numerical columns.
@item
diff --git a/Docs/manual.texi b/Docs/manual.texi
index b11cbc8faba..5d4394a7d66 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -234,7 +234,7 @@ security bug in @code{MySQL Server}, you should send an e-mail to
* What-is:: What Is MySQL?
* What is MySQL AB:: What Is MySQL AB?
* Licensing and Support:: MySQL Support and Licensing
-* MySQL 4.0 In A Nutshell:: MySQL 4.0 In A Nutshell
+* MySQL 4.0 In A Nutshell:: MySQL 4.x In A Nutshell
* MySQL Information Sources:: MySQL Information Sources
* Compatibility:: How Standards-compatible Is MySQL?
* TODO:: MySQL and the future (The TODO)
@@ -260,6 +260,9 @@ The most recent version of this manual is available at
including Texinfo, plain text, Info, HTML, PostScript, PDF,
and Windows HLP versions.
+@cindex manual, available formats
+@cindex Texinfo
+
The primary document is the Texinfo file.
The HTML version is produced automatically using a modified version of
@code{texi2html}.
@@ -273,12 +276,9 @@ our searchable PHP version at @uref{http://www.mysql.com/doc/}.
If you have any suggestions concerning additions or corrections to this
manual, please send them to the documentation team at @email{docs@@mysql.com}.
-@cindex manual, available formats
-@cindex Texinfo
-
-This manual is written and maintained by David Axmark, Michael (Monty)
-Widenius, Jeremy Cole, Arjen Lentz, and Paul DuBois. For other
-contributors, see @ref{Credits}.
+This manual was initially written by David Axmark and Michael (Monty)
+Widenius. It is currently maintained by Michael (Monty) Widenius,
+Arjen Lentz, and Paul DuBois. For other contributors, see @ref{Credits}.
The copyright (2002) to this manual is owned by the Swedish company
@code{MySQL AB}. @xref{Copyright}.
@@ -319,8 +319,7 @@ character.''
Italic font is used for emphasis, @emph{like this}.
@item @strong{boldface}
-Boldface font is used for access privilege names (for example, ``do not grant
-the @strong{process} privilege lightly'') and occasionally to convey
+Boldface font is used in table headings and to convey
@strong{especially strong emphasis}.
@end table
@@ -547,15 +546,13 @@ of the @code{MySQL Database Software}. @xref{MySQL 4.0 In A Nutshell}.
@item
Written in C and C++. Tested with a broad range of different compilers.
@item
-No memory leaks. The @code{MySQL} code has been tested with Purify,
-a commercial memory leakage detector.
-@item
Works on many different platforms. @xref{Which OS}.
@item
Uses GNU Automake (1.4), Autoconf (Version 2.52 or newer), and Libtool for
portability.
@item
-APIs for C, C++, Eiffel, Java, Perl, PHP, Python, and Tcl. @xref{Clients}.
+APIs for C, C++, Eiffel, Java, Perl, PHP, Python, Ruby, and Tcl.
+@xref{Clients}.
@item
Fully multi-threaded using kernel threads. This means it can easily
use multiple CPUs if available.
@@ -571,6 +568,10 @@ In-memory hash tables which are used as temporary tables.
SQL functions are implemented through a highly optimised class library and
should be as fast as possible! Usually there isn't any memory allocation
at all after query initialisation.
+@item
+The @code{MySQL} code gets tested with Purify
+(a commercial memory leakage detector) as well as with Valgrind,
+a GPL tool (@uref{http://developer.kde.org/~sewardj/}).
@end itemize
@item Column Types
@@ -745,7 +746,7 @@ well-tested each of them is:
@item Replication -- Gamma
Large server clusters using replication are in production use, with
good results. Work on enhanced replication features is continuing
-in @code{MySQL} 4.0.
+in @code{MySQL} 4.x.
@item @code{InnoDB} tables -- Stable (in 3.23 from 3.23.49)
The @code{InnoDB} transactional table handler has now been declared
@@ -779,7 +780,7 @@ insert of many rows.
@item Locking -- Gamma
This is very system-dependent. On some systems there are big problems
using standard OS locking (@code{fcntl()}). In these cases, you should
-run @code{mysqld} with the @code{--skip-locking} flag.
+run @code{mysqld} with the @code{--skip-external-locking} flag.
Problems are known to occur on some Linux systems, and on SunOS when
using NFS-mounted filesystems.
@@ -1052,8 +1053,8 @@ tricky questions are answered by Michael @code{Monty} Widenius, principal
author of the @code{MySQL Server}.
@xref{Support}.
-To order support at various levels, please visit the order section at
-@uref{https://order.mysql.com/} or contact our sales staff at
+For more information and ordering support at various levels, see
+@uref{http://www.mysql.com/support/} or contact our sales staff at
@email{sales@@mysql.com}.
@@ -1097,11 +1098,9 @@ as a training partner, please visit the training section at
@uref{http://www.mysql.com/training/} or contact us at:
@email{training@@mysql.com}.
-We plan to release the @code{MySQL Certification Program} in 2002. For
-details see @uref{http://www.mysql.com/training/certification.html}.
-If you would like to be kept informed about the
-@code{MySQL Certification Program},
-please e-mail @email{certification@@mysql.com}.
+The @code{MySQL Certification Program} is being released in the second
+half of 2002. For details please see
+@uref{http://www.mysql.com/training/certification.html}.
@node Business Services Consulting, Business Services Commercial licenses, Business Services Training, MySQL AB business model and services
@@ -1140,7 +1139,8 @@ This means that the @code{MySQL} software can be used free of charge
under the @code{GPL}. If you do not want to be bound by the @code{GPL}
terms (like the requirement that your own application becomes @code{GPL}
as well), you may purchase a commercial license for the same product
-from @code{MySQL AB} at @uref{https://order.mysql.com/}.
+from @code{MySQL AB}.
+See @uref{http://www.mysql.com/support/arrangements/price.html}.
Since @code{MySQL AB} owns the copyright to the @code{MySQL} source code,
we are able to employ @code{Dual Licensing} which means that the same
product is available under @code{GPL} and under a commercial
@@ -1210,9 +1210,8 @@ For press service and inquiries not covered in our News releases
If you have a valid support contract with @code{MySQL AB}, you will
get timely, precise answers to your technical questions about the
@code{MySQL} software. For more information, see @ref{Support}.
-You can order your support contract at
-@uref{https://order.mysql.com/}, or send an e-mail message to
-@email{sales@@mysql.com}.
+On our website, see @uref{http://www.mysql.com/support/}, or send
+an e-mail message to @email{sales@@mysql.com}.
For information about @code{MySQL} training, please visit the training
section at @uref{http://www.mysql.com/training/}. If you have
@@ -1222,9 +1221,6 @@ training staff at @email{training@@mysql.com}.
For information on the @code{MySQL Certification Program}, please see
@uref{http://www.mysql.com/training/certification.html}.
-If you would like to be kept informed about the
-@code{MySQL Certification Program}, please e-mail
-@email{certification@@mysql.com}.
@xref{Business Services Training}.
If you're interested in consulting, please visit the consulting
@@ -1235,7 +1231,10 @@ consulting staff at @email{consulting@@mysql.com}.
Commercial licenses may be purchased online at
@uref{https://order.mysql.com/}. There you will also find information
-on how to fax your purchase order to @code{MySQL AB}. If you have
+on how to fax your purchase order to @code{MySQL AB}. More information
+about licensing can be found at
+@uref{http://www.mysql.com/support/arrangements/price.html}.
+If you have
questions regarding licensing or you want a quote for a high-volume
license deal, please fill in the contact form on our web site
(@uref{http://www.mysql.com/}) or send an e-mail message
@@ -1258,7 +1257,7 @@ For more information on the @code{MySQL} trademark policy, refer to
@xref{MySQL AB Logos and Trademarks}.
If you are interested in any of the @code{MySQL AB} jobs listed in our
-jobs section (@uref{http://www.mysql.com/development/jobs/}),
+jobs section (@uref{http://www.mysql.com/company/jobs/}),
please send an e-mail message to @email{jobs@@mysql.com}.
Please do not send your CV as an attachment, but rather as plain text
at the end of your e-mail message.
@@ -1339,7 +1338,7 @@ not third-party products that access the @code{MySQL} server, though we
try to help with these where we can.
Detailed information about our various support options is given at
-@uref{https://order.mysql.com/}, where support contracts can also be
+@uref{http://www.mysql.com/support/}, where support contracts can also be
ordered online. If you have restricted access to the Internet, contact
our sales staff at @email{sales@@mysql.com}.
@@ -1435,6 +1434,8 @@ Since the @code{MySQL} software is released under the @code{GPL},
it may often be used for free, but for certain uses you may want
or need to buy commercial licenses from @code{MySQL AB} at
@uref{https://order.mysql.com/}.
+See @uref{http://www.mysql.com/support/arrangements.html} for
+more information.
Older versions of @code{MySQL} (3.22 and earlier) are subject to a
more strict license
@@ -1456,20 +1457,21 @@ automatically give you the right to use @code{MySQL AB} trademarks.
@subsubsection Using the MySQL Software Under a Commercial License
The @code{GPL} license is contagious in the sense that when a program
-is linked to a @code{GPL} program the resulting product must also be
-released under @code{GPL} lest you break the license terms and forfeit
-your right to use the @code{GPL} program altogether.
+is linked to a @code{GPL} program all the source code for all the parts
+of the resulting product must also be released under the @code{GPL}.
+Otherwise you break the license terms and forfeit your right to use the
+@code{GPL} program altogether and also risk damages.
You need a commercial license:
@itemize @bullet
@item
-When you link a program with code from the @code{MySQL} software or from
-@code{GPL} released clients and don't want the resulting product to be
-@code{GPL}, maybe because you want to build a commercial product or keep
-the added non-@code{GPL} code closed source for other reasons. When
-purchasing commercial licenses, you are not using the @code{MySQL} software
-under @code{GPL} even though it's the same code.
+When you link a program with any @code{GPL} code from the @code{MySQL}
+software and don't want the resulting product to be @code{GPL}, maybe
+because you want to build a commercial product or keep the added
+non-@code{GPL} code closed source for other reasons. When purchasing
+commercial licenses, you are not using the @code{MySQL} software under
+@code{GPL} even though it's the same code.
@item
When you distribute a non-@code{GPL} application that @strong{only} works with the
@@ -1495,10 +1497,11 @@ If you require a license, you will need one for each installation of the
is no artificial limit on the number of clients that connect to the server
in any way.
-To purchase commercial licenses and support, please visit the order section
-of our web site at @uref{https://order.mysql.com/}. If you have special
-licensing needs or you have restricted access to the Internet, please contact
-our sales staff at @email{sales@@mysql.com}.
+For commercial licenses, please visit our website at
+@uref{http://www.mysql.com/support/arrangements/price.html}.
+For support contracts, see @uref{http://www.mysql.com/support/}.
+If you have special needs or you have restricted access to the Internet,
+please contact our sales staff at @email{sales@@mysql.com}.
@node Using the MySQL software for free under GPL, , Using the MySQL software under a commercial license, MySQL licenses
@@ -1507,37 +1510,39 @@ our sales staff at @email{sales@@mysql.com}.
@cindex licensing, free
@cindex free licensing
-You can use the @code{MySQL} software for free under the @code{GPL}:
+You can use the @code{MySQL} software for free under the @code{GPL} if
+you adhere to the conditions of the @code{GPL}.
+For more complete coverage of the common questions about the @code{GPL}
+see the generic FAQ from the Free Software Foundation at
+@uref{http://www.gnu.org/licenses/gpl-faq.html}.
+Some common cases:
@itemize @bullet
@item
-When you link a program with code from the @code{MySQL} software and
-release the resulting product under @code{GPL}.
+When you distribute both your own application as well as the @code{MySQL}
+source code under the @code{GPL} with your product.
@item
-When you distribute the @code{MySQL} source code bundled with
-other programs that are not linked to or dependent on @code{MySQL Server}
+When you distribute the @code{MySQL} source code bundled with other
+programs that are not linked to or dependent on the @code{MySQL} system
for their functionality even if you sell the distribution commercially.
+This is called mere aggregation in the @code{GPL} license.
@item
-When using the @code{MySQL} software internally in your company.
+If you are not distributing @strong{any} part of the @code{MySQL}
+system, you can use it for free.
@item
@cindex ISP services
@cindex services, ISP
@cindex services, web
@cindex Internet Service Providers
-When you are an Internet Service Provider (ISPs) offering web
-hosting with @code{MySQL} servers for your customers.
-On the other hand, we do encourage people to use ISPs that have
-@code{MySQL} support, as this will give them the confidence that if
-they have some problem with the @code{MySQL} installation, their ISP
-will in fact have the resources to solve the problem for them.
-
-All ISPs that want to keep themselves up-to-date should subscribe
-to our @code{announce} mailing list so that they can be aware of
-critical issues that may be relevant for their @code{MySQL} installations.
-
+When you are an Internet Service Provider (ISP), offering web hosting
+with @code{MySQL} servers for your customers.
+However, we do encourage people to use ISPs that have MySQL support,
+as this will give them the confidence that if they have some problem
+with the @code{MySQL} installation, their ISP will in fact have the
+resources to solve the problem for them.
Note that even if an ISP does not have a commercial license for
@code{MySQL Server}, they should at least give their customers read
access to the source of the @code{MySQL} installation so that the
@@ -1546,12 +1551,13 @@ customers can verify that it is patched correctly.
@item
@cindex web server, running
@cindex running a web server
-When you use the @code{MySQL} Database Software in conjunction with
-a web server, you do not need a commercial license. This is true even
-if you run a commercial web server that uses @code{MySQL Server}, because
-you are not selling an embedded @code{MySQL} version yourself. However,
-in this case we would like you to purchase @code{MySQL} support because
-the @code{MySQL} software is helping your enterprise.
+When you use the @code{MySQL} Database Software in conjunction with a
+web server, you do not need a commercial license (so long as it is not
+a product you distribute). This is true even if you run a commercial
+web server that uses @code{MySQL Server}, because you are not
+distributing any part of the @code{MySQL} system. However, in this
+case we would like you to purchase @code{MySQL} support because the
+@code{MySQL} software is helping your enterprise.
@end itemize
If your use of @code{MySQL} database software does not require a commercial
@@ -1615,7 +1621,7 @@ to do so.
We have designed a set of special @emph{Conditional Use} logos that may be
downloaded from our web site at
-@uref{http://www.mysql.com/downloads/logos.html}
+@uref{http://www.mysql.com/press/logos.html}
and used on third-party web sites without written permission from
@code{MySQL AB}.
The use of these logos is not entirely unrestricted but, as the name
@@ -1704,12 +1710,10 @@ domain names is not allowed without written permission from @code{MySQL AB}.
@node MySQL 4.0 In A Nutshell, MySQL Information Sources, Licensing and Support, Introduction
-@section MySQL 4.0 In A Nutshell
-
-Dateline: 16 October 2001, Uppsala, Sweden
+@section MySQL 4.x In A Nutshell
Long promised by @code{MySQL AB} and long awaited by our users,
-MySQL Server 4.0 is now available in alpha version for download from
+MySQL Server 4.0 is now available in beta version for download from
@uref{http://www.mysql.com/} and our mirrors.
Main new features of MySQL Server 4.0 are geared toward our existing
@@ -1721,8 +1725,8 @@ Other new features target the users of embedded databases.
* Nutshell Stepwise Rollout:: Stepwise Rollout
* Nutshell Ready for Immediate Development Use:: Ready for Immediate Development Use
* Nutshell Embedded MySQL:: Embedded MySQL
-* Nutshell Other features:: Other Features Available From MySQL 4.0.0
-* Nutshell Future features:: Future MySQL 4.0 Features
+* Nutshell Other features:: Other Features Available From MySQL 4.0
+* Nutshell Future features:: Future MySQL 4.x Features
* Nutshell 4.1 development release:: MySQL 4.1, The Following Development Release
@end menu
@@ -1730,25 +1734,25 @@ Other new features target the users of embedded databases.
@node Nutshell Stepwise Rollout, Nutshell Ready for Immediate Development Use, MySQL 4.0 In A Nutshell, MySQL 4.0 In A Nutshell
@subsection Stepwise Rollout
-The rollout of MySQL Server 4.0 will come in several steps, with
-the first version labelled 4.0.0 already containing most of the
-new features. Additional features will be incorporated into
-MySQL 4.0.1, 4.0.2, and onward; very probably within a couple of months,
-MySQL 4.0 will be labelled beta. Further new features will then
-be added in MySQL 4.1, which is targeted for alpha release
-in third quarter 2002.
+The rollout of MySQL Server 4.x comes in several steps, with
+the first version labelled 4.0.0-alpha already containing most of the
+new features. Additional features have since been incorporated into
+MySQL 4.0.1, 4.0.2, and onward; MySQL 4.0.3 has been labelled beta.
+Further new features are being added in MySQL 4.1, targeted for
+alpha release in third quarter 2002.
@node Nutshell Ready for Immediate Development Use, Nutshell Embedded MySQL, Nutshell Stepwise Rollout, MySQL 4.0 In A Nutshell
@subsection Ready for Immediate Development Use
Users are not recommended to switch their production systems
-to MySQL Server 4.0 until it is released in beta version.
+to a MySQL Server 4.x until it is released in beta version
+(such as 4.0.3 beta).
However, even the initial release has passed our extensive
test suite without any errors on any of the platforms we test on.
Due to the large number of new features, we thus recommend
-MySQL Server 4.0 even in alpha form for development use, with
-the release schedule of MySQL Server 4.0 being such that it will
+MySQL Server 4.x even in alpha form for development use, with
+the release schedule of MySQL Server 4.x being such that it will
reach stable state before the deployment of user applications
now under development.
@@ -1761,8 +1765,8 @@ applications. Using the embedded MySQL server library, one can
embed MySQL Server into various applications and electronics devices, where
the end user has no knowledge of there actually being an underlying
database. Embedded MySQL Server is ideal for use behind
-the scenes in internet appliances, public kiosks, turnkey
-hardware/software combination units, high performance internet
+the scenes in Internet appliances, public kiosks, turnkey
+hardware/software combination units, high performance Internet
servers, self-contained databases distributed on CD-ROM, etc.
Many users of @code{libmysqld} will benefit from the MySQL
@@ -1773,7 +1777,7 @@ client library, so it is convenient and easy to use. @xref{libmysqld}.
@node Nutshell Other features, Nutshell Future features, Nutshell Embedded MySQL, MySQL 4.0 In A Nutshell
-@subsection Other Features Available From MySQL 4.0.0
+@subsection Other Features Available From MySQL 4.0
@itemize @bullet
@item
@@ -1783,25 +1787,11 @@ such as bulk @code{INSERT}s, searching on packed indexes, creation of
@code{FULLTEXT} indexes, as well as @code{COUNT(DISTINCT)}.
@item
-The table handler @code{InnoDB} is now offered as a feature of the
+The @code{InnoDB} table handler is now offered as a feature of the
standard MySQL server, including full support for @code{transactions}
and @code{row-level locking}.
@item
-MySQL Server 4.0 will support secure traffic between the client and the server,
-greatly increasing security against malicious intrusion and unauthorised
-access. Web applications being a cornerstone of MySQL use, web developers
-have been able to use @code{Secure Socket Layer} (@code{SSL}) to secure the
-traffic between the the end user browser and the web application, be it
-written in PHP, Perl, ASP or using any other web development tool. However,
-the traffic between the development tool and the @code{mysqld} server
-process has been protected only by virtue of them being processes
-residing on computers within the same firewall. In MySQL Server 4.0,
-the @code{mysqld} server daemon process can itself use @code{SSL},
-thus enabling secure traffic to MySQL databases from, say, a Windows
-application residing outside the firewall.
-
-@item
Our German, Austrian, and Swiss users will note that we have a new character
set, @code{latin_de}, which corrects the @emph{German sorting order},
placing German umlauts in the same order as German telephone books.
@@ -1828,17 +1818,17 @@ possible to know how many rows a query would have returned without a
@node Nutshell Future features, Nutshell 4.1 development release, Nutshell Other features, MySQL 4.0 In A Nutshell
-@subsection Future MySQL 4.0 Features
+@subsection Future MySQL 4.x Features
-For the upcoming MySQL Server 4.0 releases (4.0.1, 4.0.2, and onward),
+For the upcoming MySQL Server 4.x releases,
expect the following features now still under development:
@itemize @bullet
@item
Mission-critical, heavy-load users of MySQL Server will appreciate
the additions to our replication system and our online hot backup.
-Later versions of 4.0 will include @code{fail-safe replication};
-already existing in 4.0.0, the @code{LOAD DATA FROM MASTER} command
+Later versions of 4.x will include @code{fail-safe replication};
+already existing in 4.0, the @code{LOAD DATA FROM MASTER} command
will soon automate slave setup. The @code{online backup} will make
it easy to add a new replication slave without taking down
the master, and have a very low performance penalty on
@@ -1869,7 +1859,6 @@ in the client.
@node Nutshell 4.1 development release, , Nutshell Future features, MySQL 4.0 In A Nutshell
@subsection MySQL 4.1, The Following Development Release
-Internally, through a new .frm file format for table definitions,
MySQL Server 4.0 lays the foundation for the new features of
MySQL Server 4.1 and onward,
such as @code{nested subqueries}, @code{stored procedures}, and
@@ -2574,7 +2563,7 @@ but without concessions to speed and quality of the code.
@cindex ANSI mode, running
If you start @code{mysqld} with the @code{--ansi} option, the following
-behavior of MySQL Server changes:
+behaviour of MySQL Server changes:
@itemize @bullet
@item
@@ -2655,10 +2644,10 @@ directory.
This has a few implications:
-@cindex database names, case sensitivity
-@cindex table names, case sensitivity
-@cindex case sensitivity, of database names
-@cindex case sensitivity, of table names
+@cindex database names, case-sensitivity
+@cindex table names, case-sensitivity
+@cindex case-sensitivity, of database names
+@cindex case-sensitivity, of table names
@itemize @minus
@@ -2758,7 +2747,7 @@ Strings may be enclosed by either @samp{"} or @samp{'}, not just by @samp{'}.
Use of the escape @samp{\} character.
@item
-The @code{SET OPTION} statement. @xref{SET OPTION, , @code{SET OPTION}}.
+The @code{SET} statement. @xref{SET OPTION, , @code{SET}}.
@item
You don't need to name all selected columns in the @code{GROUP BY} part.
@@ -2877,7 +2866,7 @@ extra conditions in this case.
@end itemize
@menu
-* ANSI diff Sub-selects:: Sub-@code{SELECT}s
+* ANSI diff Sub-selects:: Sub@code{SELECT}s
* ANSI diff SELECT INTO TABLE:: @code{SELECT INTO TABLE}
* ANSI diff Transactions:: Transactions and Atomic Operations
* ANSI diff Triggers:: Stored Procedures and Triggers
@@ -2893,16 +2882,16 @@ That is the latest version of the TODO list in this manual. @xref{TODO}.
@node ANSI diff Sub-selects, ANSI diff SELECT INTO TABLE, Differences from ANSI, Differences from ANSI
-@subsubsection Sub-@code{SELECT}s
+@subsubsection Sub@code{SELECT}s
-@cindex sub-selects
+@cindex sub@code{SELECT}s
MySQL Server currently only supports nested queries of the form
@code{INSERT ... SELECT ...} and @code{REPLACE ... SELECT ...}.
You can, however, use the function @code{IN()} in other contexts.
-Sub-selects are scheduled for implementation in Version 4.x.
+Subselects are currently being implemented in the 4.1 development tree.
-Meanwhile, you can often rewrite the query without a sub-select:
+Meanwhile, you can often rewrite the query without a subselect:
@example
SELECT * FROM table1 WHERE id IN (SELECT id FROM table2);
@@ -2932,7 +2921,7 @@ For more complicated subqueries you can often create temporary tables
to hold the subquery. In some cases, however, this option will not
work. The most frequently encountered of these cases arises with
@code{DELETE} statements, for which standard SQL does not support joins
-(except in sub-selects). For this situation there are two options
+(except in subselects). For this situation there are two options
available until subqueries are supported by MySQL Server.
The first option is to use a procedural programming language (such as
@@ -3203,7 +3192,7 @@ transactions are deleted.
The planned update language will be able to handle stored procedures.
Our aim is to have stored procedures implemented in MySQL Server around
-version 4.1. We are also looking at triggers.
+version 5.0. We are also looking at triggers.
@node ANSI diff Foreign Keys, ANSI diff Views, ANSI diff Triggers, Differences from ANSI
@@ -3297,7 +3286,7 @@ to back up or restore individual tables.
@cindex views
-It is planned to implement views in MySQL Server around version 4.1.
+It is planned to implement views in MySQL Server around version 5.0.
Views are mostly useful for letting users access a set of relations as one
table (in read-only mode). Many SQL databases don't allow one to update
@@ -3566,14 +3555,16 @@ numerical column, MySQL Server will store 0 into it.
@item
If you try to store @code{NULL} into a column that doesn't take
@code{NULL} values, MySQL Server will store 0 or @code{''} (empty
-string) in it instead. (This behavior can, however, be changed with the
+string) in it instead. (This behaviour can, however, be changed with the
-DDONT_USE_DEFAULT_FIELDS compile option.)
@item
-MySQL allows you to store some wrong date values into
-@code{DATE} and @code{DATETIME} columns (like 2000-02-31 or 2000-02-00).
-If the date is totally wrong, MySQL Server will store the special
-0000-00-00 date value in the column.
+MySQL allows you to store some wrong date values into @code{DATE} and
+@code{DATETIME} columns (like 2000-02-31 or 2000-02-00). The idea is
+that it's not the SQL server job to validate date. If MySQL can store a
+date and retrieve exactly the same date, then MySQL will store the
+date. If the date is totally wrong (outside the server's ability to store
+it), then the special date value 0000-00-00 will be stored in the column.
@item
If you set an @code{ENUM} column to an unsupported value, it will be set to
@@ -3671,10 +3662,10 @@ For platform-specific bugs, see the sections about compiling and porting.
* TODO MySQL 4.1:: Things That Should be in 4.1
* TODO future:: Things That Must be Done in the Near Future
* TODO sometime:: Things That Have to be Done Sometime
-* TODO unplanned:: Things We Have No Plans to do
+* TODO unplanned:: Things We Don't Plan To Do
@end menu
-This appendix lists the features that we plan to implement in MySQL Server.
+This section lists the features that we plan to implement in MySQL Server.
Everything in this list is approximately in the order it will be done. If you
want to affect the priority order, please register a license or support us and
@@ -3682,33 +3673,30 @@ tell us what you want to have done more quickly. @xref{Licensing and Support}.
The plan is that we in the future will support the full ANSI SQL99
standard, but with a lot of useful extensions. The challenge is to do
-this without sacrifying the speed or compromising the code.
+this without sacrificing the speed or compromising the code.
@node TODO MySQL 4.0, TODO MySQL 4.1, TODO, TODO
@subsection Things That Should be in 4.0
-We are now in the final stages of the development of the MySQL Server
-4.0. server. The target is to quickly implement the rest of the
-following features and then shift development to MySQL Server
-4.1. @xref{MySQL 4.0 In A Nutshell}.
+All done. We now only do bug fixes for MySQL 4.0. @xref{News-4.0.x}.
+Development has shifted to 4.1
-The news section for 4.0 includes a list of the features we have already
-implemented in the 4.0 tree. @xref{News-4.0.x}.
+@node TODO MySQL 4.1, TODO future, TODO MySQL 4.0, TODO
+@subsection Things That Should be in 4.1
-This section lists features not yet implemented in the current version
-of MySQL Server 4.0, which will, however, be implemented in later versions
-of MySQL 4.0. This being very volatile information, please consider this
-list valid only if you are reading it from the MySQL web site
-(@uref{http://www.mysql.com/}).
+The following features are planned for inclusion into MySQL 4.1.
+Note that because we have many developers that are working on different
+projects, there will also be many additional features. There is also a
+small chance that some of these features will be added to MySQL 4.0.
+Some of the work on MySQL 4.1 is already in progress.
@itemize @bullet
@item
-Allow users to change startup options without taking down the server.
-@item
-Better command-line argument handling.
-@item
-New key cache, which will give better performance when using many threads.
+Subqueries.
+@example
+SELECT id FROM t WHERE grp IN (SELECT grp FROM g WHERE u > 100);
+@end example
@item
New table definition file format (@file{.frm} files). This will enable us
to not run out of bits when adding more table options. One will still
@@ -3722,25 +3710,7 @@ for keys, and possibly to store and retrieve @code{FOREIGN KEY} definitions.
expansions of column names) should not open the table, only the
definition file. This will require less memory and be much faster.
@item
-@code{SET SQL_DEFAULT_TABLE_TYPE=[MyISAM | INNODB | BDB | HEAP]}.
-@end itemize
-
-
-@node TODO MySQL 4.1, TODO future, TODO MySQL 4.0, TODO
-@subsection Things That Should be in 4.1
-
-The following features are planned for inclusion into MySQL 4.1.
-Note that because we have many developers that are working on different
-projects, there will also be many additional features. There is also a
-small chance that some of these features will be added to MySQL 4.0.
-Some of the work on MySQL 4.1 is already in progress.
-
-@itemize @bullet
-@item
-Subqueries.
-@code{SELECT id FROM t WHERE grp IN (SELECT grp FROM g WHERE u > 100)}
-@item
-Foreign keys, including cascading delete.
+Foreign keys for @code{MyISAM} tables, including cascading delete.
@item
Fail-safe replication.
@item
@@ -3761,6 +3731,9 @@ SELECT a.col1, b.col2
This could be done by automatically creating temporary tables for the
derived tables for the duration of the query.
@item
+@code{ROLLUP} and @code{CUBE} OLAP (Online Analytical Processing) grouping
+options for data warehousing applications.
+@item
Allow @code{DELETE} on @code{MyISAM} tables to use the record cache.
To do this, we need to update the threads record cache when we update
the @file{.MYD} file.
@@ -3774,13 +3747,13 @@ able to choose the right index when there are many to choose from. We should
also extend the info interface to get the key distribution for each index,
if @code{analyze} is run on all subtables.
@item
-@code{RENAME TABLE} on a table used in an active @code{MERGE} table may
-corrupt the table.
+Resolving the issue of @code{RENAME TABLE} on a table used in an active
+@code{MERGE} table possibly corrupting the table.
@item
-A faster, smaller embedded MySQL library. (Compatible with the old one.)
+A faster, smaller embedded MySQL library (compatible with the old one).
@item
-Stable openssl support. (MySQL 4.0 supports rudimentary, not 100% tested,
-support for openssl).
+Stable OpenSSL support (MySQL 4.0 supports rudimentary, not 100% tested,
+support for OpenSSL).
@item
Add support for sorting on @code{UNICODE}.
@item
@@ -3832,12 +3805,15 @@ Faster row handling (less copying)
@node TODO future, TODO sometime, TODO MySQL 4.1, TODO
-@subsection Things That Must be Done in the Real Near Future
+@subsection Things That Must be Done in the Near Future
@itemize @bullet
@item
-Atomic multi-table updates@-e.g., @code{update items,month set
-items.price=month.price where items.id=month.id;};
+Atomic multi-table updates:
+@example
+UPDATE items,month SET items.price=month.price
+WHERE items.id=month.id;
+@end example
@item
Don't allow more than a defined number of threads to run MyISAM recover
at the same time.
@@ -3852,9 +3828,6 @@ Multiple result sets.
Make it possible to specify @code{long_query_time} with a granularity
in microseconds.
@item
-Add a configurable prompt to the @code{mysql} command-line client, with
-options like database in use, time and date...
-@item
Link the @code{myisampack} code into the server.
@item
Port of the MySQL code to QNX.
@@ -3954,10 +3927,6 @@ Automatic output from @code{mysql} to Netscape.
@item
@code{LOCK DATABASES} (with various options.)
@item
-@code{DECIMAL} and @code{NUMERIC} types can't read exponential numbers;
-@code{Field_decimal::store(const char *from,uint len)} must be recoded
-to fix this.
-@item
Functions:
ADD_TO_SET(value,set) and REMOVE_FROM_SET(value,set).
@item
@@ -4055,15 +4024,13 @@ Implement function: @code{get_changed_tables(timeout,table1,table2,...)}.
Change reading through tables to use memmap when possible. Now only
compressed tables use memmap.
@item
-Add a new privilege @code{Show_priv} for @code{SHOW} commands.
-@item
Make the automatic timestamp code nicer. Add timestamps to the update
log with @code{SET TIMESTAMP=#;}.
@item
Use read/write mutex in some places to get more speed.
@item
-Full foreign key support. One probably wants to implement a procedural
-language first.
+Full foreign key support in for @code{MyISAM} tables, probably after
+the implementation of stored procedures with triggers.
@item
Simple views (first on one table, later on any expression).
@item
@@ -4093,9 +4060,9 @@ Use of full calculation names in the order part (for ACCESS97).
@item
@code{SQL_OPTION MAX_SELECT_TIME=#} to put a time limit on a query.
@item
-Make the update log to a database.
+Make the update log write to a database.
@item
-Negative @code{LIMIT} to retrieve data from the end.
+Add to @code{LIMIT} to allow retrieval of data from the end of a result set.
@item
Alarm around client connect/read/write functions.
@item
@@ -4135,7 +4102,7 @@ Time is given according to amount of work, not real time.
@node TODO unplanned, , TODO sometime, TODO
-@subsection Things We Have No Plans to do
+@subsection Things We Don't Plan To Do
@itemize @bullet
@item
@@ -4630,7 +4597,7 @@ Use @code{CLIKE}.
@table @code
@item MySQL Server
Strips all spaces at the end of @code{CHAR} and @code{VARCHAR}
-columns. Use a @code{TEXT} column if this behavior is not desired.
+columns. Use a @code{TEXT} column if this behaviour is not desired.
@item mSQL
Retains trailing space.
@end table
@@ -4641,7 +4608,7 @@ Retains trailing space.
@table @code
@item MySQL Server
MySQL correctly prioritises everything (@code{AND} is evaluated
-before @code{OR}). To get @code{mSQL} behavior in MySQL Server, use
+before @code{OR}). To get @code{mSQL} behaviour in MySQL Server, use
parentheses (as shown in an example later in this section).
@item mSQL
Evaluates everything from left to right. This means that some logical
@@ -4751,7 +4718,7 @@ code, we are better able to coordinate new features and releases.
@cindex PostgreSQL vs. MySQL, features
-On the crash-me page
+On the @code{crash-me} page
(@uref{http://www.mysql.com/information/crash-me.php})
you can find a list of those database constructs and limits that
one can detect automatically with a program. Note, however, that a lot of
@@ -4813,7 +4780,7 @@ MySQL replication has been thoroughly tested, and is used by sites like:
@item
Included in the MySQL distribution are two different testing suites,
-@file{mysql-test-run} and crash-me
+@file{mysql-test-run} and @code{crash-me}
(@uref{http://www.mysql.com/information/crash-me.php}), as well
as a benchmark suite. The test system is actively updated with code to
test each new feature and almost all reproduceable bugs that have come to
@@ -4956,7 +4923,7 @@ don't know the PostgreSQL roadmap.
@multitable @columnfractions .30 .30
@item @strong{Feature} @tab @strong{MySQL version}
@item Subselects @tab 4.1
-@item Foreign keys @tab 4.1
+@item Foreign keys @tab 4.1 (3.23 with InnoDB)
@item Views @tab 5.0
@item Stored procedures @tab 5.0
@item Triggers @tab 5.0
@@ -5494,7 +5461,7 @@ Finish the install process.
@subsubsection Preparing the Windows MySQL Environment
Starting with MySQL 3.23.38, the Windows distribution includes
-both the normal and the @strong{MySQL-Max} server binaries.
+both the normal and the MySQL-Max server binaries.
Here is a list of the different MySQL servers you can use:
@multitable @columnfractions .20 .80
@@ -5624,7 +5591,7 @@ InnoDB: Doublewrite buffer created
InnoDB: creating foreign key constraint system tables
InnoDB: foreign key constraint system tables created
011024 10:58:25 InnoDB: Started
-@end example
+@end example
For further information about running MySQL on Windows,
see @ref{Windows}.
@@ -5662,26 +5629,12 @@ see @ref{Windows}.
Check the MySQL homepage (@uref{http://www.mysql.com/}) for
information about the current version and for downloading instructions.
-Our main download mirror is located at:
-
-@uref{http://mirrors.sunsite.dk/mysql/}
-
-If you are interested in becoming a MySQL mirror site, you may
-anonymously rsync with: @code{rsync://sunsite.dk/ftp/mirrors/mysql/}. Please
-send e-mail to @email{webmaster@@mysql.com} notifying us of your mirror to be
-added to the following list.
-
-If you have problems downloading from our main site, try using one of the
-following mirrors.
-
-Please report bad or out-of-date mirrors to @email{webmaster@@mysql.com}.
+Our main mirror is located at @uref{http://mirrors.sunsite.dk/mysql/}.
-@c START_OF_MIRROR_LISTING
-
-@c Mirrors list is created by PHP script (that really needs to be documented!) from database (tfr@mysql.com)
-@include mirrors.texi
-
-@c END_OF_MIRROR_LISTING
+For a complete upto-date list of MySQL web/download mirrors, see
+@uref{http://www.mysql.com/downloads/mirrors.html}.
+There you will also find information about becoming a MySQL mirror
+site and how to report a bad or out-of-date mirror.
@node Which OS, Which version, Getting MySQL, General Installation Issues
@@ -5709,17 +5662,18 @@ AIX 4.x with native threads. @xref{IBM-AIX}.
@item
Amiga.
@item
-BSDI 2.x with the included MIT-pthreads package. @xref{BSDI}.
+BSDI 2.x with the MIT-pthreads package. @xref{BSDI}.
@item
BSDI 3.0, 3.1 and 4.x with native threads. @xref{BSDI}.
@item
DEC Unix 4.x with native threads. @xref{Alpha-DEC-UNIX}.
@item
-FreeBSD 2.x with the included MIT-pthreads package. @xref{FreeBSD}.
+FreeBSD 2.x with the MIT-pthreads package. @xref{FreeBSD}.
@item
FreeBSD 3.x and 4.x with native threads. @xref{FreeBSD}.
@item
-HP-UX 10.20 with the included MIT-pthreads package. @xref{HP-UX 10.20}.
+HP-UX 10.20 with the DCE threads or the MIT-pthreads package.
+@xref{HP-UX 10.20}.
@item
HP-UX 11.x with the native threads. @xref{HP-UX 11.x}.
@item
@@ -5729,7 +5683,7 @@ Mac OS X Server. @xref{Mac OS X}.
@item
NetBSD 1.3/1.4 Intel and NetBSD 1.3 Alpha (Requires GNU make). @xref{NetBSD}.
@item
-OpenBSD > 2.5 with native threads. OpenBSD < 2.5 with the included
+OpenBSD > 2.5 with native threads. OpenBSD < 2.5 with the
MIT-pthreads package. @xref{OpenBSD}.
@item
OS/2 Warp 3, FixPack 29 and OS/2 Warp 4, FixPack 4. @xref{OS/2}.
@@ -5738,7 +5692,7 @@ SGI Irix 6.x with native threads. @xref{SGI-Irix}.
@item
Solaris 2.5 and above with native threads on SPARC and x86. @xref{Solaris}.
@item
-SunOS 4.x with the included MIT-pthreads package. @xref{Solaris}.
+SunOS 4.x with the MIT-pthreads package. @xref{Solaris}.
@item
Caldera (SCO) OpenServer with a recent port of the FSU Pthreads package.
@xref{Caldera}.
@@ -5879,8 +5833,8 @@ The extended MySQL binary distribution is marked with the
@code{-max} suffix and is configured with the same options as
@code{mysqld-max}. @xref{mysqld-max, , @code{mysqld-max}}.
-If you want to use the @code{MySQL-Max} RPM, you must first
-install the standard @code{MySQL} RPM.
+If you want to use the MySQL-Max RPM, you must first
+install the standard MySQL RPM.
@item
If you want to configure @code{mysqld} with some extra features that are
@@ -6293,7 +6247,7 @@ indicates the type of operating system for which the distribution is intended
(for example, @code{pc-linux-gnu-i586}).
@item
-If you see a binary distribution marked with the @code{-max} prefix, this
+If you see a binary distribution marked with the @code{-max} suffix, this
means that the binary has support for transaction-safe tables and other
features. @xref{mysqld-max, , @code{mysqld-max}}. Note that all binaries
are built from the same MySQL source distribution.
@@ -6912,7 +6866,7 @@ shell> CXXFLAGS=-DDONT_USE_DEFAULT_FIELDS ./configure
@cindex character sets
@findex configure option, --with-charset
-@findex configure option, --with-extra-charset
+@findex configure option, --with-extra-charsets
@item
By default, MySQL uses the ISO-8859-1 (Latin1) character set. To
change the default set, use the @code{--with-charset} option:
@@ -6928,8 +6882,8 @@ shell> ./configure --with-charset=CHARSET
@xref{Character sets}.
If you want to convert characters between the server and the client,
-you should take a look at the @code{SET OPTION CHARACTER SET} command.
-@xref{SET OPTION, , @code{SET OPTION}}.
+you should take a look at the @code{SET CHARACTER SET} command.
+@xref{SET OPTION, , @code{SET}}.
@cindex @code{myisamchk}
@strong{Warning}: If you change character sets after having created any
@@ -6938,7 +6892,7 @@ indexes may be sorted incorrectly otherwise. (This can happen if you
install MySQL, create some tables, then reconfigure
MySQL to use a different character set and reinstall it.)
-With the option @code{--with-extra-charset=LIST} you can define
+With the option @code{--with-extra-charsets=LIST} you can define
which additional character sets should be compiled into the server.
Here @code{LIST} is either a list of character
@@ -6975,7 +6929,7 @@ system-specific section of this manual.
@cindex development source tree
@cindex BitKeeper tree
-@cindex cvs tree
+@cindex CVS tree
@strong{Caution}: You should read this section only if you are interested
in helping us test our new code. If you just want to get MySQL up
@@ -7020,17 +6974,17 @@ You will need GNU @code{autoconf 2.52}, @code{automake 1.4},
@code{automake} (1.5) doesn't yet work.
-If you get some strange error during this stage, check that you really
-have @code{libtool} installed!
-
@example
-shell> cd mysql
-shell> bk -r edit
+shell> cd mysql-4.0
+shell> bk -r get -Sq
shell> aclocal; autoheader; autoconf; automake;
shell> ./configure # Add your favorite options here
shell> make
@end example
+If you get some strange error during this stage, check that you really
+have @code{libtool} installed!
+
A collection of our standard configure scripts is located in the
@file{BUILD/} subdirectory. If you are lazy, you can use
@file{BUILD/compile-pentium-debug}. To compile on a different architecture,
@@ -7066,7 +7020,7 @@ should run @code{bk pull} periodically to get the updates.
You can examine the change history for the tree with all the diffs by using
@code{bk sccstool}. If you see some funny diffs or code that you have a
question about, do not hesitate to send e-mail to
-@email{internals@@lists.mysql.com}. Also, if you think you have a better idea
+@email{internals@@lists.mysql.com}. Also, if you think you have a better idea
on how to do something, send an e-mail to the same address with a patch.
@code{bk diffs} will produce a patch for you after you have made changes
to the source. If you do not have the time to code your idea, just send
@@ -7076,6 +7030,15 @@ a description.
@code{BitKeeper} has a nice help utility that you can access via
@code{bk helptool}.
+@item
+Please note that any commits (@code{bk ci} or @code{bk citool}) will
+trigger the posting of a message with the changeset to our internals
+mailing list, as well as the usual openlogging.org submission with
+just the changeset comments.
+Generally, you wouldn't need to use commit (since the public tree will
+not allow @code{bk push}), but rather use the @code{bk diffs} method
+described previously.
+
@end enumerate
@@ -7166,7 +7129,7 @@ configurations, and the @code{--with-low-memory} option usually fixes it.
@item
By default, @code{configure} picks @code{c++} as the compiler name and
GNU @code{c++} links with @code{-lg++}. If you are using @code{gcc},
-that behavior can cause problems during configuration such as this:
+that behaviour can cause problems during configuration such as this:
@cindex C++ compiler cannot create executables
@example
@@ -7339,13 +7302,16 @@ during the part of the configuration process that deals with the server
code. If you have configured the distribution using @code{--without-server}
to build only the client code, clients will not know whether
MIT-pthreads is being used and will use Unix socket connections by default.
-Because Unix sockets do not work under MIT-pthreads, this means you will need
-to use @code{-h} or @code{--host} when you run client programs.
+Because Unix sockets do not work under MIT-pthreads on some platforms, this
+means you will need to use @code{-h} or @code{--host} when you run client
+programs.
@item
When MySQL is compiled using MIT-pthreads, system locking is
disabled by default for performance reasons. You can tell the server to use
-system locking with the @code{--use-locking} option.
+system locking with the @code{--external-locking} option. This is only
+needed if you want to be able to run two MySQL servers against the same
+data files (not recommended).
@item
Sometimes the pthread @code{bind()} command fails to bind to a socket without
@@ -8138,18 +8104,117 @@ dumping core after you upgrade MySQL.
@node Upgrading-from-3.23, Upgrading-from-3.22, Upgrade, Upgrade
@subsection Upgrading From Version 3.23 to Version 4.0
-You can use your old datafiles without any modification with Version 4.0.
-If you want to move your data from a MySQL 4.0 server to an older server,
-you have to use @code{mysqldump}.
+In general what you have to do when upgrading to 4.0 from an earlier
+MySQL version:
+
+@itemize
+@item
+Run the @code{mysql_fix_privilege_tables} to add new privileges and features
+to the MySQL privilege tables.
+@item
+Edit any MySQL startup scripts or configure files to not use any of the
+deprecated options listed below.
+@item
+Convert your old ISAM files to MyISAM files with the command:
+@code{mysql_convert_table_format database}. Note that this should only
+be run if all tables in the given database is ISAM or MyISAM tables. If
+this is not the case you should run @code{ALTER TABLE table_name TYPE=MyISAM}
+on all ISAM tables.
+@item
+Ensure that you don't have any MySQL clients that uses shared libraries
+(like the perl Msql-Mysql-modules). If you have, you should recompile
+them as structures used in libmysqlclient.so have changed.
+@end itemize
+
+MySQL 4.0 will work even if you don't do the above, but you will not be
+able to use the new security privileges that MySQL 4.0 and you may run
+into problems when upgrading later to MySQL 4.1 or newer. The ISAM file
+format still works in MySQL 4.0 but it's deprecated and will be disabled
+in MySQL 5.0.
Old clients should work with a Version 4.0 server without any problems.
-The following lists tell what you have to watch out for when upgrading to
-version 4.0;
+Even if you do the above, you can still downgrade to MySQL 3.23.52 or newer
+if you run into problems with the MySQL 4.0 series. In this case you have
+to do a mysqldump of any tables using a fulltext index and restore these
+in 3.23 (because 4.0 uses a new format for fulltext index).
+
+The following is a more complete lists tell what you have to watch out
+for when upgrading to version 4.0;
@itemize @bullet
@item
-@code{DOUBLE} and @code{FLOAT} columns are now honoring the
+MySQL 4.0 has a lot of new privileges in the @code{mysql.user} table.
+@xref{GRANT}.
+
+To get these new privileges to work, one must run the
+@code{mysql_fix_privilege_tables} script. Until this script is run all
+users have the @code{SHOW DATABASES}, @code{CREATE TEMPORARY TABLES},
+and @code{LOCK TABLES} privileges. @code{SUPER} and @code{EXECUTE}
+privileges take their value from @code{PROCESS}.
+@code{REPLICATION SLAVE} and @code{REPLICATION CLIENT} take their
+values from @code{FILE}.
+
+If you have any scripts that creates new users, you may want to change
+them to use the new privileges. If you are not using @code{GRANT}
+commands in the scripts, this is a good time to change your scripts.
+
+In version 4.0.2 the option @code{--safe-show-database} is deprecated
+(and no longer does anything). @xref{Privileges options}.
+
+If you get access denied errors for new users in version 4.0.2, you
+should check if you need some of the new grants that you didn't need
+before. In particular, you will need @code{REPLICATION SLAVE}
+(instead of @code{FILE}) for new slaves.
+@item
+The startup parameters @code{myisam_max_extra_sort_file_size} and
+@code{myisam_max_extra_sort_file_size} are now given in bytes
+(was megabytes before 4.0.3).
+External system locking of MyISAM/ISAM files is now turned off by default.
+One can turn this on by doing @code{--external-locking}. (For most users
+this is never needed).
+@item
+The following startup variables/options have been renamed:
+@multitable @columnfractions .50 .50
+@item @strong{From} @tab @strong{to}.
+@item @code{myisam_bulk_insert_tree_size} @tab @code{bulk_insert_buffer_size}
+@item @code{query_cache_startup_type} @tab @code{query_cache_type}
+@item @code{record_buffer} @tab @code{read_buffer_size}
+@item @code{record_rnd_buffer} @tab @code{read_rnd_buffer_size}
+@item @code{sort_buffer} @tab @code{sort_buffer_size}
+@item @code{warnings} @tab @code{log-warnings}
+@end multitable
+
+The startup options @code{record_buffer}, @code{sort_buffer} and
+@code{warnings} will still work in MySQL 4.0 but are deprecated.
+@item
+The following SQL variables have changed name.
+@c arjen note: New table, not yet measured for O'Reilly/DocBook.
+@multitable @columnfractions .50 .50
+@item @strong{From} @tab @strong{To}.
+@item @code{SQL_BIG_TABLES} @tab @code{BIG_TABLES}
+@item @code{SQL_LOW_PRIORITY_UPDATES} @tab @code{LOW_PRIORITY_UPDATES}
+@item @code{SQL_MAX_JOIN_SIZE} @tab @code{MAX_JOIN_SIZE}
+@item @code{SQL_QUERY_CACHE_TYPE} @tab @code{QUERY_CACHE_TYPE}
+@end multitable
+The old names still work in MySQL 4.0 but are deprecated.
+@item
+You have to use @code{SET GLOBAL SQL_SLAVE_SKIP_COUNTER=#} instead of
+@code{SET SQL_SLAVE_SKIP_COUNTER=#}.
+@item
+Renamed mysqld startup options @code{--skip-locking} to
+@code{--skip-external-locking} and @code{--enable-locking} to
+@code{--external-locking}.
+@item
+@code{SHOW MASTER STATUS} now returns an empty set if binary log is not
+enabled.
+@item
+@code{SHOW SLAVE STATUS} now returns an empty set if slave is not initialised.
+@item
+mysqld now has the option @code{--temp-pool} enabled by default as this
+gives better performance with some OS.
+@item
+@code{DOUBLE} and @code{FLOAT} columns now honour the
@code{UNSIGNED} flag on storage (before, @code{UNSIGNED} was ignored for
these columns).
@item
@@ -8180,10 +8245,10 @@ you need to rebuild them with @code{ALTER TABLE table_name TYPE=MyISAM},
@strong{even} if they are of @code{MyISAM} type.
@item
@code{LOCATE()} and @code{INSTR()} are case-sensitive if one of the
-arguments is a binary string.
+arguments is a binary string. Otherwise they are case-insensitive.
@item
@code{STRCMP()} now uses the current character set when doing comparisons,
-which means that the default comparison behavior now is case-insensitive.
+which means that the default comparison behaviour now is case-insensitive.
@item
@code{HEX(string)} now returns the characters in string converted to
hexadecimal. If you want to convert a number to hexadecimal, you should
@@ -8193,7 +8258,9 @@ In 3.23, @code{INSERT INTO ... SELECT} always had @code{IGNORE} enabled.
In 4.0.1, MySQL will stop (and possibly roll back) in case of an error if you
don't specify @code{IGNORE}.
@item
-@file{safe_mysqld} is renamed to @file{mysqld_safe}.
+@file{safe_mysqld} is renamed to @file{mysqld_safe}. For some time we
+will in our binary distributions include @code{safe_mysqld} as a symlink to
+@code{mysqld_safe}.
@item
The old C API functions @code{mysql_drop_db}, @code{mysql_create_db}, and
@code{mysql_connect} are not supported anymore, unless you compile
@@ -8311,7 +8378,7 @@ A @code{TIME} string must now be of one of the following formats:
@item
@code{LIKE} now compares strings using the same character comparison rules
-as @code{=}. If you require the old behavior, you can compile
+as @code{=}. If you require the old behaviour, you can compile
MySQL with the @code{CXXFLAGS=-DLIKE_CMP_TOUPPER} flag.
@item
@@ -8599,7 +8666,7 @@ what you should do, try our binary first to see if it meets your needs, and
worry about your own build only after you have discovered that our binary is
not good enough. In that case, we would appreciate a note about it, so we
can build a better binary next time. For a typical user, even for setups with
-a lot of concurrent connections and/or tables exceeding 2GB limit, our
+a lot of concurrent connections and/or tables exceeding the 2G limit, our
binary in most cases is the best choice.
MySQL uses LinuxThreads on Linux. If you are using an old
@@ -8669,17 +8736,17 @@ experimentally discovered, will successfully unmap an already mapped region
if you ask it to map out an address already in use, zeroing out the data
on the entire page, instead of returning an error. So, the safety of
@code{mysqld} or any other threaded application depends on the "gentleman"
-behavior of the code that creates threads. The user must take measures to
+behaviour of the code that creates threads. The user must take measures to
make sure the number of running threads at any time is sufficiently low for
thread stacks to stay away from the global heap. With @code{mysqld}, you
-should enforce this "gentleman" behavior by setting a reasonable value for
+should enforce this "gentleman" behaviour by setting a reasonable value for
the @code{max_connections} variable.
If you build MySQL yourself and do not want to mess with patching
LinuxThreads, you should set @code{max_connections} to a value no higher
than 500. It should be even less if you have a large key buffer, large
heap tables, or some other things that make @code{mysqld} allocate a lot
-of memory, or if you are running a 2.2 kernel with a 2GB patch. If you are
+of memory, or if you are running a 2.2 kernel with a 2G patch. If you are
using our binary or RPM version 3.23.25 or later, you can safely set
@code{max_connections} at 1500, assuming no large key buffer or heap tables
with lots of data. The more you reduce @code{STACK_SIZE} in LinuxThreads
@@ -8738,7 +8805,7 @@ hold the mutex for a short time. On an SMP system, ironic as it is, if
you link MySQL against unmodified @code{LinuxThreads},
removing processors from the machine improves MySQL performance
in many cases. We have made a patch available for @code{glibc 2.1.3}
-to correct this behavior
+to correct this behaviour
(@uref{http://www.mysql.com/Downloads/Linux/linuxthreads-2.1-patch}).
With @code{glibc-2.2.2}
@@ -8747,7 +8814,7 @@ better than even the patched one in @code{glibc-2.1.3}. Be warned, however,
that under some conditions, the current mutex code in @code{glibc-2.2.2}
overspins, which hurts MySQL performance. The chance of this
condition can be reduced by renicing @code{mysqld} process to the highest
-priority. We have also been able to correct the overspin behavior with
+priority. We have also been able to correct the overspin behaviour with
a patch, available at
@uref{http://www.mysql.com/Downloads/Linux/linuxthreads-2.2.2.patch}.
It combines the correction of overspin, maximum number of
@@ -8800,7 +8867,7 @@ To get a core dump on Linux if @code{mysqld} dies with a @code{SIGSEGV} signal,
you can start @code{mysqld} with the @code{--core-file} option. Note
that you also probably need to raise the @code{core file size} by adding
@code{ulimit -c 1000000} to @code{safe_mysqld} or starting
-@code{safe_mysqld} with @code{--core-file-sizes=1000000}.
+@code{safe_mysqld} with @code{--core-file-size=1000000}.
@xref{safe_mysqld, , @code{safe_mysqld}}.
If you are linking your own MySQL client and get the error:
@@ -9034,7 +9101,7 @@ kernel 2.2.13-SMP, Compaq C compiler (V6.2-504) and Compaq C++ compiler
You can find the above compilers at
@uref{http://www.support.compaq.com/alpha-tools/}). By using these compilers,
-instead of gcc, we get about 9-14 % better performance with MySQL.
+instead of gcc, we get about 9-14% better performance with MySQL.
Note that the configure line optimised the binary for the current CPU; this
means you can only use our binary if you have an Alpha EV6 processor. We also
@@ -9237,7 +9304,7 @@ installed, it can be immediately started from the @code{Services}
utility, or by using the command @code{NET START MySQL}.
Once running, @code{mysqld-max-nt} can be stopped using
-@code{mysqladmin}, from the Services utility or by using the
+@code{mysqladmin}, from the Services utility, or by using the
command @code{NET STOP MySQL}.
When running as a service, the operating system will automatically stop
@@ -9359,8 +9426,8 @@ the @code{mysql.user} table that has @code{Host='localhost'} and
@code{User=''}.
You should also add a password for the @code{root} user. The following
-example starts by removing the anonymous user that can be used by anyone
-to access the @code{test} database, then sets a @code{root} user password:
+example starts by removing the anonymous user that has all privileges,
+then sets a @code{root} user password:
@example
C:\> C:\mysql\bin\mysql mysql
@@ -9379,7 +9446,7 @@ C:\> mysqladmin --user=root --password=your_password shutdown
If you are using the old shareware version of MySQL Version
3.21 under Windows, the above command will fail with an error:
-@code{parse error near 'SET OPTION password'}. The solution for
+@code{parse error near 'SET password'}. The solution for
this is to download and upgrade to the latest MySQL version,
which is now freely available.
@@ -9601,7 +9668,7 @@ option to the new MySQL clients or create an option file
host = localhost
@end example
-Starting from 3.23.50, named pipes are only enabled if mysqld is started
+Starting from 3.23.50, named pipes are only enabled if @code{mysqld} is started
with @code{--enable-named-pipe}.
@item @code{Access denied for user} error
@@ -9659,7 +9726,7 @@ For the moment, the workaround is to list the parameters in the
@file{C:\my.cnf} file instead.
@item
-It would be real nice to be able to kill @code{mysqld} from the task manager.
+It would be really nice to be able to kill @code{mysqld} from the task manager.
For the moment, you must use @code{mysqladmin shutdown}.
@item
@@ -9743,7 +9810,7 @@ CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local/mysql --with-low-memory --enable-assembler
@end example
-If you have an UltraSPARC, you can get 4 % more performance by adding
+If you have an UltraSPARC, you can get 4% more performance by adding
"-mcpu=v8 -Wa,-xarch=v8plusa" to CFLAGS and CXXFLAGS.
If you have Sun Workshop (Fortre) 5.3 (or newer) compiler, you can
@@ -9755,7 +9822,7 @@ CXX=CC CXXFLAGS="-noex -xO4 -mt" \
./configure --prefix=/usr/local/mysql --enable-assembler
@end example
-In the MySQL benchmarks, we got a 6 % speedup on an UltraSPARC when
+In the MySQL benchmarks, we got a 6% speedup on an UltraSPARC when
using Sun Workshop 5.3 compared to using gcc with -mcpu flags.
If you get a problem with @code{fdatasync} or @code{sched_yield},
@@ -10022,7 +10089,7 @@ as well as specific versions within those.
FreeBSD 3.x is recommended for running MySQL since the thread package
is much more integrated.
-The easiest and therefor the preferred way to install is to use the
+The easiest and therefore the preferred way to install is to use the
mysql-server and mysql-client ports available on
@uref{http://www.freebsd.org/}.
@@ -10382,25 +10449,15 @@ compiler, because @code{gcc} produces better code!
We recommend using gcc 2.95 on HP-UX. Don't use high optimisation
flags (like -O6) as this may not be safe on HP-UX.
-Note that MIT-pthreads can't be compiled with the HP-UX compiler
-because it can't compile @code{.S} (assembler) files.
-
-The following configure line should work:
+The following configure line should work with gcc 2.95:
@example
-CFLAGS="-DHPUX -I/opt/dce/include -fpic" \
-CXXFLAGS="-DHPUX -I/opt/dce/include -felide-constructors -fno-exceptions \
+CFLAGS="-I/opt/dce/include -fpic" \
+CXXFLAGS="-I/opt/dce/include -felide-constructors -fno-exceptions \
-fno-rtti" CXX=gcc ./configure --with-pthread \
--with-named-thread-libs='-ldce' --prefix=/usr/local/mysql --disable-shared
@end example
-If you are compiling @code{gcc} 2.95 yourself, you should NOT link it with
-the DCE libraries (@code{libdce.a} or @code{libcma.a}) if you want to compile
-MySQL with MIT-pthreads. If you mix the DCE and MIT-pthreads
-packages you will get a @code{mysqld} to which you cannot connect. Remove
-the DCE libraries while you compile @code{gcc} 2.95!
-
-
@node HP-UX 11.x, IBM-AIX, HP-UX 10.20, Other Unix Notes
@subsubsection HP-UX Version 11.x Notes
@@ -10530,7 +10587,7 @@ MySQL (This example uses the IBM compiler):
export CC="xlc_r -ma -O3 -qstrict -qoptimize=3 -qmaxmem=8192 "
export CXX="xlC_r -ma -O3 -qstrict -qoptimize=3 -qmaxmem=8192"
export CFLAGS="-I /usr/local/include"
-export LDLFAGS="-L /usr/local/lib"
+export LDFLAGS="-L /usr/local/lib"
export CPPFLAGS=$CFLAGS
export CXXFLAGS=$CFLAGS
@@ -10760,7 +10817,7 @@ by downloading the latest DEC (Compaq) patch kit from:
@uref{http://ftp.support.compaq.com/public/unix/}.
On OSF/1 V4.0D and compiler "DEC C V5.6-071 on Digital Unix V4.0 (Rev. 878)"
-the compiler had some strange behavior (undefined @code{asm} symbols).
+the compiler had some strange behaviour (undefined @code{asm} symbols).
@code{/bin/ld} also appears to be broken (problems with @code{_exit
undefined} errors occuring while linking @code{mysqld}). On this system, we
have managed to compile MySQL with the following @code{configure}
@@ -11886,6 +11943,9 @@ The list of databases is probably different on your machine, but the
privileges. The @code{test} database is often provided as a workspace for
users to try things out.
+Note that you may not see all databases if you don't have the
+@code{SHOW DATABASES} privilege. @xref{GRANT}.
+
If the @code{test} database exists, try to access it:
@example
@@ -13335,7 +13395,7 @@ SELECT MAX(article) AS article FROM shop
``Find number, dealer, and price of the most expensive article.''
-In ANSI SQL this is easily done with a sub-query:
+In ANSI SQL this is easily done with a subquery:
@example
SELECT article, dealer, price
@@ -13343,7 +13403,7 @@ FROM shop
WHERE price=(SELECT MAX(price) FROM shop)
@end example
-In MySQL (which does not yet have sub-selects), just do it in
+In MySQL (which does not yet have subselects), just do it in
two steps:
@enumerate
@@ -13398,7 +13458,7 @@ GROUP BY article
``For each article, find the dealer(s) with the most expensive price.''
-In ANSI SQL, I'd do it with a sub-query like this:
+In ANSI SQL, I'd do it with a subquery like this:
@example
SELECT article, dealer, price
@@ -13516,7 +13576,7 @@ CREATE TABLE shirt (
id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
style ENUM('t-shirt', 'polo', 'dress') NOT NULL,
color ENUM('red', 'blue', 'orange', 'white', 'black') NOT NULL,
- owner SMALLINT UNSIGNED NOT NULL REFERENCES persons,
+ owner SMALLINT UNSIGNED NOT NULL REFERENCES person(id),
PRIMARY KEY (id)
);
@@ -13649,14 +13709,17 @@ year/month combination, with automatic removal of duplicate entries.
@subsection Using @code{AUTO_INCREMENT}
@cindex AUTO_INCREMENT
-The @code{AUTO_INCREMENT} attribute can be used to generate an unique
+The @code{AUTO_INCREMENT} attribute can be used to generate a unique
identity for new rows:
@example
-CREATE TABLE animals (id MEDIUMINT NOT NULL AUTO_INCREMENT,
-name CHAR(30) NOT NULL, PRIMARY KEY (id));
+CREATE TABLE animals (
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ name CHAR(30) NOT NULL,
+ PRIMARY KEY (id)
+ );
INSERT INTO animals (name) VALUES ("dog"),("cat"),("penguin"),
-("lax"),("whale");
+ ("lax"),("whale");
SELECT * FROM animals;
Which returns:
@@ -13672,6 +13735,14 @@ Which returns:
+----+---------+
@end example
+You can retrieve the used @code{AUTO_INCREMENT} key with the
+@code{LAST_INSERT_ID()} SQL function or the @code{mysql_insert_id()} API
+function.
+Note: for a multi-row insert,
+@code{LAST_INSERT_ID()}/@code{mysql_insert_id()} will actually return the
+@code{AUTO_INCREMENT} key from the @strong{first} inserted row. This allows
+multi-row inserts to be reproduced on other servers.
+
For MyISAM and BDB tables you can specify @code{AUTO_INCREMENT} on
secondary column in a multi-column key. In this case the generated
value for the autoincrement column is calculated as
@@ -13679,11 +13750,14 @@ value for the autoincrement column is calculated as
useful when you want to put data into ordered groups.
@example
-CREATE TABLE animals (grp ENUM('fish','mammal','bird') NOT NULL,
- id MEDIUMINT NOT NULL AUTO_INCREMENT
- PRIMARY KEY (grp,id));
+CREATE TABLE animals (
+ grp ENUM('fish','mammal','bird') NOT NULL,
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ name CHAR(30) NOT NULL,
+ PRIMARY KEY (grp,id)
+ );
INSERT INTO animals (grp,name) VALUES("mammal","dog"),("mammal","cat"),
- ("bird","penguin"),("fish","lax"),("mammal","whale");
+ ("bird","penguin"),("fish","lax"),("mammal","whale");
SELECT * FROM animals ORDER BY grp,id;
Which returns:
@@ -13702,9 +13776,6 @@ Which returns:
Note that in this case, the @code{AUTO_INCREMENT} value will be reused if you
delete the row with the biggest @code{AUTO_INCREMENT} value in any group.
-You can get the used @code{AUTO_INCREMENT} key with the
-@code{LAST_INSERT_ID()} SQL function or the @code{mysql_insert_id()} API
-function.
@node Batch mode, Twin, Examples, Tutorial
@section Using @code{mysql} in Batch Mode
@@ -14129,9 +14200,9 @@ IP address to bind to.
Directory where character sets are. @xref{Character sets}.
@item --chroot=path
-Chroot @code{mysqld} daemon during startup. Recommended security measure. It will
-somewhat limit @code{LOAD DATA INFILE} and @code{SELECT ... INTO OUTFILE}
-though.
+Put @code{mysqld} daemon in chroot environment at startup. Recommended
+security measure. It somewhat limits @code{LOAD DATA INFILE} and
+@code{SELECT ... INTO OUTFILE} though.
@item --core-file
Write a core file if @code{mysqld} dies. For some systems you must also
@@ -14154,7 +14225,10 @@ Set the default character set. @xref{Character sets}.
@item --default-table-type=type
Set the default table type for tables. @xref{Table types}.
-@item --delay-key-write-for-all-tables
+@item --delay-key-write[= OFF | ON | ALL]
+How MyISAM @code{DELAYED KEYS} should be used. @xref{Server parameters}.
+
+@item --delay-key-write-for-all-tables; In MySQL 4.0.3 you should use --delay-key-write=ALL instead.
Don't flush key buffers between writes for any @code{MyISAM} table.
@xref{Server parameters}.
@@ -14162,7 +14236,7 @@ Don't flush key buffers between writes for any @code{MyISAM} table.
Read the default keys used by @code{DES_ENCRYPT()} and @code{DES_DECRYPT()}
from this file.
-@item --enable-locking
+@item --enable-external-locking (was --enable-locking)
Enable system locking. Note that if you use this option on a system on
which @code{lockd} does not fully work (as on Linux), you will easily get
mysqld to deadlock.
@@ -14215,7 +14289,7 @@ Table-modifying operations (@code{INSERT}/@code{DELETE}/@code{UPDATE})
will have lower priority than selects. It can also be done via
@code{@{INSERT | REPLACE | UPDATE | DELETE@} LOW_PRIORITY ...} to lower
the priority of only one query, or by
-@code{SET OPTION SQL_LOW_PRIORITY_UPDATES=1} to change the priority in one
+@code{SET LOW_PRIORITY_UPDATES=1} to change the priority in one
thread. @xref{Table locking}.
@item --memlock
@@ -14231,7 +14305,7 @@ also set this explicitly to @code{""} if you want to disable this
option. If this option is used, @code{mysqld} will on open check if the
table is marked as crashed or if the table wasn't closed properly.
(The last option only works if you are running with
-@code{--skip-locking}.) If this is the case @code{mysqld} will run
+@code{--skip-external-locking}.) If this is the case @code{mysqld} will run
check on the table. If the table was corrupted, @code{mysqld} will
attempt to repair it.
@@ -14244,9 +14318,9 @@ The following options affects how the repair works.
@item BACKUP @tab If the data table was changed during recover, save a
backup of the @file{table_name.MYD} datafile as
@file{table_name-datetime.BAK}.
-@item FORCE @tab Run recover even if we will loose more than one row
+@item FORCE @tab Run recover even if we will lose more than one row
from the .MYD file.
-@item QUICK @tab Don't check the rows in the table if there isn't any
+@item QUICK @tab Don't check the rows in the table if there aren't any
delete blocks.
@end multitable
@@ -14276,24 +14350,44 @@ description for all variables in the @code{SHOW VARIABLES} section in this
manual. @xref{SHOW VARIABLES}. The tuning server parameters section includes
information of how to optimise these. @xref{Server parameters}.
+In MySQL 4.0.2 one can set a variable directly with
+@code{--variable-name=option} and @code{set-variable} is not anymore needed
+in option files.
+
+If you want to restrict the maximum value a startup option can be set to
+with @code{SET}, you can define this by using the
+@code{--maximum-variable-name} command line option. @xref{SET OPTION}.
+
+Note that when setting a variable to a value, MySQL may automatically
+correct it to stay within a given range and also adjusts the value a
+little to fix for the used algorithm.
+
@item --safe-mode
-Skip some optimise stages. Implies @code{--skip-delay-key-write}.
+Skip some optimise stages.
@item --safe-show-database
-Don't show databases for which the user doesn't have any privileges.
+With this option, the @code{SHOW DATABASES} command returns only those
+databases for which the user has some kind of privilege.
+From version 4.0.2 this option is deprecated and doesn't do anything
+(the option is enabled by default) as we now have the
+@code{SHOW DATABASES} privilege. @xref{GRANT}.
@item --safe-user-create
If this is enabled, a user can't create new users with the GRANT
-command, if the user doesn't have @strong{insert} privilege to the
+command, if the user doesn't have @code{INSERT} privilege to the
@code{mysql.user} table or any column in this table.
+@item --skip-bdb
+Disable usage of BDB tables. This will save memory and may speed up some
+things.
+
@item --skip-concurrent-insert
Turn off the ability to select and insert at the same time on @code{MyISAM}
tables. (This is only to be used if you think you have found a bug in this
feature.)
-@item --skip-delay-key-write
-Ignore the @code{delay_key_write} option for all tables.
+@item --skip-delay-key-write; In MySQL 4.0.3 you should use --delay-key-write=OFF instead.
+Ignore the @code{DELAY_KEY_WRITE} option for all tables.
@xref{Server parameters}.
@item --skip-grant-tables
@@ -14306,7 +14400,11 @@ flush-privileges} or @code{mysqladmin reload}.)
Never use host name cache for faster name-ip resolution, but query DNS server
on every connect instead. @xref{DNS}.
-@item --skip-locking
+@item --skip-innodb
+Disable usage of Innodb tables. This will save memory and disk space and
+speed up some things.
+
+@item --skip-external-locking (was --skip-locking)
Don't use system locking. To use @code{isamchk} or @code{myisamchk} you must
shut down the server. @xref{Stability}. Note that in MySQL Version
3.23 you can use @code{REPAIR} and @code{CHECK} to repair/check @code{MyISAM}
@@ -14322,8 +14420,7 @@ Don't listen for TCP/IP connections at all. All interaction with
recommended for systems where only local requests are allowed. @xref{DNS}.
@item --skip-new
-Don't use new, possible wrong routines. Implies @code{--skip-delay-key-write}.
-This will also set default table type to @code{ISAM}. @xref{ISAM}.
+Don't use new, possible wrong routines.
@item --skip-symlink
Don't delete or rename files that a symlinked file in the data directory
@@ -14336,8 +14433,10 @@ freeing. As this checking is very slow, you can avoid this, when you don't
need memory checking, by using this option.
@item --skip-show-database
-Don't allow 'SHOW DATABASE' commands, unless the user has @strong{process}
-privilege.
+Don't allow @code{SHOW DATABASES} command, unless the user has the
+@code{SHOW DATABASES} privilege. From version 4.0.2 you should no longer
+need this option, since access can now be granted specifically with the
+@code{SHOW DATABASES} privilege.
@item --skip-stack-trace
Don't write stack traces. This option is useful when you are running
@@ -14364,7 +14463,7 @@ With this option one can turn on only needed SQL modes. @xref{ANSI mode}.
Using this option will cause most temporary files created to use a small
set of names, rather than a unique name for each new file. This is to
work around a problem in the Linux kernel dealing with creating a bunch
-of new files with different names. With the old behavior, Linux seems to
+of new files with different names. With the old behaviour, Linux seems to
'leak' memory, as it's being allocated to the directory entry cache
instead of the disk cache.
@@ -14382,11 +14481,13 @@ This option is @strong{mandatory} when starting @code{mysqld} as root.
@item -V, --version
Output version information and exit.
-@item -W, --warnings
+@item -W, --log-warnings (Was --warnings)
Print out warnings like @code{Aborted connection...} to the @file{.err} file.
@xref{Communication errors}.
@end table
+One can change most values for a running server with the
+@code{SET} command. @xref{SET OPTION}.
@node Option files, Installing many servers, Command-line options, Configuring MySQL
@subsection @file{my.cnf} Option Files
@@ -14847,8 +14948,8 @@ command.
@item
Do not keep any plain-text passwords in your database. When your
computer becomes compromised, the intruder can take the full list of
-passwords and use them. Instead use @code{MD5()} or another one-way
-hashing function.
+passwords and use them. Instead use @code{MD5()}, @code{SHA1()} or
+another one-way hashing function.
@item
Do not choose passwords from dictionaries. There are special programs to
break them. Even passwords like ``xfish98'' are very bad. Much better is
@@ -15004,7 +15105,7 @@ to make things much harder. To make things even more secure you should use
@uref{http://www.ssh.com/}. With this, you can get an encrypted TCP/IP
connection between a MySQL server and a MySQL client.
-If you are using MySQL 4.0, you can also use internal openssl support.
+If you are using MySQL 4.0, you can also use internal OpenSSL support.
@xref{Secure connections}.
To make a MySQL system secure, you should strongly consider the
@@ -15014,7 +15115,7 @@ following suggestions:
@item
Use passwords for all MySQL users. Remember that anyone can log in
as any other person as simply as @code{mysql -u other_user db_name} if
-@code{other_user} has no password. It is common behavior with client/server
+@code{other_user} has no password. It is common behaviour with client/server
applications that the client may specify any user name. You can change the
password of all users by editing the @code{mysql_install_db} script before
you run it, or only the password for the MySQL @code{root} user like
@@ -15029,7 +15130,7 @@ mysql> FLUSH PRIVILEGES;
@item
Don't run the MySQL daemon as the Unix @code{root} user. This is
-very dangerous, because any user with the @strong{file} privilege will be able
+very dangerous, because any user with the @code{FILE} privilege will be able
to create files as @code{root} (for example, @code{~root/.bashrc}). To
prevent this, @code{mysqld} will refuse to run as @code{root} unless it
is specified directly using a @code{--user=root} option.
@@ -15065,25 +15166,25 @@ Check that the Unix user that @code{mysqld} runs as is the only user with
read/write privileges in the database directories.
@item
-Don't give the @strong{process} privilege to all users. The output of
+Don't give the @code{PROCESS} privilege to all users. The output of
@code{mysqladmin processlist} shows the text of the currently executing
queries, so any user who is allowed to execute that command might be able to
see if another user issues an @code{UPDATE user SET
password=PASSWORD('not_secure')} query.
@code{mysqld} reserves an extra connection for users who have the
-@strong{process} privilege, so that a MySQL @code{root} user can log
+@code{PROCESS} privilege, so that a MySQL @code{root} user can log
in and check things even if all normal connections are in use.
@item
-Don't give the @strong{file} privilege to all users. Any user that has this
+Don't give the @code{FILE} privilege to all users. Any user that has this
privilege can write a file anywhere in the filesystem with the privileges of
the @code{mysqld} daemon! To make this a bit safer, all files generated with
@code{SELECT ... INTO OUTFILE} are readable to everyone, and you cannot
overwrite existing files.
@tindex @file{/etc/passwd}
-The @strong{file} privilege may also be used to read any file accessible
+The @code{FILE} privilege may also be used to read any file accessible
to the Unix user that the server runs as. This could be abused, for example,
by using @code{LOAD DATA} to load @file{/etc/passwd} into a table, which
can then be read with @code{SELECT}.
@@ -15112,13 +15213,15 @@ If one uses @code{--local-infile=0} then one can't use @code{LOAD DATA LOCAL
INFILE}.
@item --safe-show-database
-With this option,
-@code{SHOW DATABASES} returns only those databases for which the user has
-some kind of privilege.
+With this option, the @code{SHOW DATABASES} command returns only those
+databases for which the user has some kind of privilege.
+From version 4.0.2 this option is deprecated and doesn't do anything
+(the option is enabled by default) as we now have the
+@code{SHOW DATABASES} privilege. @xref{GRANT}.
@item --safe-user-create
If this is enabled, an user can't create new users with the @code{GRANT}
-command, if the user doesn't have the @strong{insert} privilege for the
+command, if the user doesn't have the @code{INSERT} privilege for the
@code{mysql.user} table. If you want to give a user access to just create
new users with those privileges that the user has right to grant, you should
give the user the following privilege:
@@ -15142,13 +15245,16 @@ tables must be IP numbers or @code{localhost}.
@item --skip-networking
Don't allow TCP/IP connections over the network. All connections to
-@code{mysqld} must be made via Unix sockets. This option is unsuitable for
-systems that use MIT-pthreads, because the MIT-pthreads package doesn't
-support Unix sockets.
+@code{mysqld} must be made via Unix sockets.
+This option is unsuitable when using a MySQL version prior to 3.23.27 with
+the MIT-pthreads package, because Unix sockets were not supported by
+MIT-pthreads at that time.
@item --skip-show-database
-With this option, the
-@code{SHOW DATABASES} statement doesn't return anything.
+Don't allow @code{SHOW DATABASES} command, unless the user has the
+@code{SHOW DATABASES} privilege. From version 4.0.2 you should no longer
+need this option, since access can now be granted specifically with the
+@code{SHOW DATABASES} privilege.
@end table
@@ -15205,7 +15311,7 @@ The used command is not allowed with this MySQL version
The primary function of the MySQL privilege system is to
authenticate a user connecting from a given host, and to associate that user
with privileges on a database such as
-@strong{select}, @strong{insert}, @strong{update} and @strong{delete}.
+@code{SELECT}, @code{INSERT}, @code{UPDATE} and @code{DELETE}.
Additional functionality includes the ability to have an anonymous user and
to grant privileges for MySQL-specific functions such as @code{LOAD
@@ -15243,8 +15349,8 @@ Stage 1: The server checks whether you are even allowed to connect.
Stage 2: Assuming you can connect, the server checks each request you issue
to see whether you have sufficient privileges to perform it. For
example, if you try to select rows from a table in a database or drop a table
-from the database, the server makes sure you have the @strong{select}
-privilege for the table or the @strong{drop} privilege for the database.
+from the database, the server makes sure you have the @code{SELECT}
+privilege for the table or the @code{DROP} privilege for the database.
@end itemize
The server uses the @code{user}, @code{db}, and @code{host} tables in the
@@ -15309,7 +15415,7 @@ table entry with @code{Host}, @code{User}, and @code{Db} fields of
tables contain scope fields indicating tables or table/column combinations
to which each entry applies.
-@cindex case sensitivity, in access checking
+@cindex case-sensitivity, in access checking
For access-checking purposes, comparisons of @code{Host} values are
case-insensitive. @code{User}, @code{Password}, @code{Db}, and
@code{Table_name} values are case-sensitive.
@@ -15390,7 +15496,7 @@ the @code{db} table, but are more fine-grained: they apply at the
table and column levels rather than at the database level.
@end itemize
-Note that administrative privileges (@strong{reload}, @strong{shutdown},
+Note that administrative privileges (@code{RELOAD}, @code{SHUTDOWN},
etc.) are specified only in the @code{user} table. This is because
administrative operations are operations on the server itself and are not
database-specific, so there is no reason to list such privileges in the
@@ -15398,7 +15504,7 @@ other grant tables. In fact, only the @code{user} table need
be consulted to determine whether you can perform an administrative
operation.
-The @strong{file} privilege is specified only in the @code{user} table, too.
+The @code{FILE} privilege is specified only in the @code{user} table, too.
It is not an administrative privilege as such, but your ability to read or
write files on the server host is independent of the database you are
accessing.
@@ -15433,33 +15539,41 @@ MySQL server reads the contents of these tables when it starts up
and under the circumstances indicated in @ref{Privilege changes}.
The names used in this manual to refer to the privileges provided by
-MySQL are shown here, along with the table column name associated
-with each privilege in the grant tables and the context in which the
-privilege applies:
+MySQL version 4.0.2 are shown here, along with the table column name
+associated with each privilege in the grant tables and the context in
+which the privilege applies:
+@c FIX agl 2002-06-13 Long items added, will need to re-measure colwidths!
@multitable @columnfractions .15 .20 .35
@item @strong{Privilege} @tab @strong{Column} @tab @strong{Context}
-@item @strong{select} @tab @code{Select_priv} @tab tables
-@item @strong{insert} @tab @code{Insert_priv} @tab tables
-@item @strong{update} @tab @code{Update_priv} @tab tables
-@item @strong{delete} @tab @code{Delete_priv} @tab tables
-@item @strong{index} @tab @code{Index_priv} @tab tables
-@item @strong{alter} @tab @code{Alter_priv} @tab tables
-@item @strong{create} @tab @code{Create_priv} @tab databases, tables, or indexes
-@item @strong{drop} @tab @code{Drop_priv} @tab databases or tables
-@item @strong{grant} @tab @code{Grant_priv} @tab databases or tables
-@item @strong{references} @tab @code{References_priv} @tab databases or tables
-@item @strong{reload} @tab @code{Reload_priv} @tab server administration
-@item @strong{shutdown} @tab @code{Shutdown_priv} @tab server administration
-@item @strong{process} @tab @code{Process_priv} @tab server administration
-@item @strong{file} @tab @code{File_priv} @tab file access on server
+@item @code{ALTER} @tab @code{Alter_priv} @tab tables
+@item @code{DELETE} @tab @code{Delete_priv} @tab tables
+@item @code{INDEX} @tab @code{Index_priv} @tab tables
+@item @code{INSERT} @tab @code{Insert_priv} @tab tables
+@item @code{SELECT} @tab @code{Select_priv} @tab tables
+@item @code{UPDATE} @tab @code{Update_priv} @tab tables
+@item @code{CREATE} @tab @code{Create_priv} @tab databases, tables, or indexes
+@item @code{DROP} @tab @code{Drop_priv} @tab databases or tables
+@item @code{GRANT} @tab @code{Grant_priv} @tab databases or tables
+@item @code{REFERENCES} @tab @code{References_priv} @tab databases or tables
+@item @code{CREATE TEMPORARY TABLES} @tab @code{Create_tmp_table_priv} @tab server administration
+@item @code{EXECUTE} @tab @code{Execute_priv} @tab server administration
+@item @code{FILE} @tab @code{File_priv} @tab file access on server
+@item @code{LOCK TABLES} @tab @code{Lock_tables_priv} @tab server administration
+@item @code{PROCESS} @tab @code{Process_priv} @tab server administration
+@item @code{RELOAD} @tab @code{Reload_priv} @tab server administration
+@item @code{REPLICATION CLIENT} @tab @code{Repl_client_priv} @tab server administration
+@item @code{REPLICATION SLAVE} @tab @code{Repl_slave_priv} @tab server administration
+@item @code{SHOW DATABASES} @tab @code{Show_db_priv} @tab server administration
+@item @code{SHUTDOWN} @tab @code{Shutdown_priv} @tab server administration
+@item @code{SUPER} @tab @code{Super_priv} @tab server administration
@end multitable
-The @strong{select}, @strong{insert}, @strong{update}, and @strong{delete}
+The @code{SELECT}, @code{INSERT}, @code{UPDATE}, and @code{DELETE}
privileges allow you to perform operations on rows in existing tables in
a database.
-@code{SELECT} statements require the @strong{select} privilege only if they
+@code{SELECT} statements require the @code{SELECT} privilege only if they
actually retrieve rows from a table. You can execute certain @code{SELECT}
statements even without permission to access any of the databases on the
server. For example, you could use the @code{mysql} client as a simple
@@ -15470,21 +15584,21 @@ mysql> SELECT 1+1;
mysql> SELECT PI()*2;
@end example
-The @strong{index} privilege allows you to create or drop (remove) indexes.
+The @code{INDEX} privilege allows you to create or drop (remove) indexes.
-The @strong{alter} privilege allows you to use @code{ALTER TABLE}.
+The @code{ALTER} privilege allows you to use @code{ALTER TABLE}.
-The @strong{create} and @strong{drop} privileges allow you to create new
+The @code{CREATE} and @code{DROP} privileges allow you to create new
databases and tables, or to drop (remove) existing databases and tables.
-Note that if you grant the @strong{drop} privilege for the @code{mysql}
+Note that if you grant the @code{DROP} privilege for the @code{mysql}
database to a user, that user can drop the database in which the
MySQL access privileges are stored!
-The @strong{grant} privilege allows you to give to other users those
+The @code{GRANT} privilege allows you to give to other users those
privileges you yourself possess.
-The @strong{file} privilege gives you permission to read and write files on
+The @code{FILE} privilege gives you permission to read and write files on
the server using the @code{LOAD DATA INFILE} and @code{SELECT ... INTO
OUTFILE} statements. Any user to whom this privilege is granted can read or
write any file that the MySQL server can read or write.
@@ -15496,11 +15610,12 @@ execute:
@multitable @columnfractions .15 .75
@item @strong{Privilege} @tab @strong{Commands permitted to privilege holders}
-@item @strong{reload} @tab @code{reload}, @code{refresh},
+@item @code{RELOAD} @tab @code{reload}, @code{refresh},
@code{flush-privileges}, @code{flush-hosts}, @code{flush-logs}, and
@code{flush-tables}
-@item @strong{shutdown} @tab @code{shutdown}
-@item @strong{process} @tab @code{processlist}, @code{kill}
+@item @code{SHUTDOWN} @tab @code{shutdown}
+@item @code{PROCESS} @tab @code{processlist}
+@item @code{SUPER} @tab @code{kill}
@end multitable
The @code{reload} command tells the server to re-read the grant tables. The
@@ -15514,10 +15629,10 @@ than @code{refresh}.
The @code{shutdown} command shuts down the server.
The @code{processlist} command displays information about the threads
-executing within the server. The @code{kill} command kills server threads.
-You can always display or kill your own threads, but you need the
-@strong{process} privilege to display or kill threads initiated by other
-users. @xref{KILL}.
+executing within the server. The @code{kill} command kills server
+threads. You can always display or kill your own threads, but you need
+the @code{PROCESS} privilege to display and @code{SUPER} privilege to
+kill threads initiated by other users. @xref{KILL}.
It is a good idea in general to grant privileges only to those users who need
them, but you should exercise particular caution in granting certain
@@ -15525,26 +15640,26 @@ privileges:
@itemize @bullet
@item
-The @strong{grant} privilege allows users to give away their privileges to
-other users. Two users with different privileges and with the @strong{grant}
+The @code{GRANT} privilege allows users to give away their privileges to
+other users. Two users with different privileges and with the @code{GRANT}
privilege are able to combine privileges.
@item
-The @strong{alter} privilege may be used to subvert the privilege system
+The @code{ALTER} privilege may be used to subvert the privilege system
by renaming tables.
@item
-The @strong{file} privilege can be abused to read any world-readable file on
+The @code{FILE} privilege can be abused to read any world-readable file on
the server into a database table, the contents of which can then be
accessed using @code{SELECT}. This includes the contents of all databases
hosted by the server!
@item
-The @strong{shutdown} privilege can be abused to deny service to other
+The @code{SHUTDOWN} privilege can be abused to deny service to other
users entirely, by terminating the server.
@item
-The @strong{process} privilege can be used to view the plain text of
+The @code{PROCESS} privilege can be used to view the plain text of
currently executing queries, including queries that set or change passwords.
@item
@@ -15883,7 +15998,7 @@ tables.)
The @code{user} table grants privileges that are assigned to you on a global
basis and that apply no matter what the current database is. For example, if
-the @code{user} table grants you the @strong{delete} privilege, you can
+the @code{user} table grants you the @code{DELETE} privilege, you can
delete rows from any database on the server host! In other words,
@code{user} table privileges are superuser privileges. It is wise to grant
privileges in the @code{user} table only to superusers such as server or
@@ -15961,16 +16076,16 @@ here differs slightly from the algorithm used in the code. The description
is equivalent to what the code actually does; it differs only to make the
explanation simpler.)
-For administrative requests (@strong{shutdown}, @strong{reload}, etc.), the
+For administrative requests (@code{SHUTDOWN}, @code{RELOAD}, etc.), the
server checks only the @code{user} table entry, because that is the only table
that specifies administrative privileges. Access is granted if the entry
allows the requested operation and denied otherwise. For example, if you
want to execute @code{mysqladmin shutdown} but your @code{user} table entry
-doesn't grant the @strong{shutdown} privilege to you, access is denied
+doesn't grant the @code{SHUTDOWN} privilege to you, access is denied
without even checking the @code{db} or @code{host} tables. (They
contain no @code{Shutdown_priv} column, so there is no need to do so.)
-For database-related requests (@strong{insert}, @strong{update}, etc.), the
+For database-related requests (@code{INSERT}, @code{UPDATE}, etc.), the
server first checks the user's global (superuser) privileges by looking in
the @code{user} table entry. If the entry allows the requested operation,
access is granted. If the global privileges in the @code{user} table are
@@ -16026,7 +16141,7 @@ initially found to be insufficient for the requested operation, the server
adds those privileges to the database-, table-, and column-specific privileges
later. The reason is that a request might require more than one type of
privilege. For example, if you execute an @code{INSERT ... SELECT}
-statement, you need both @strong{insert} and @strong{select} privileges.
+statement, you need both @code{INSERT} and @code{SELECT} privileges.
Your privileges might be such that the @code{user} table entry grants one
privilege and the @code{db} table entry grants the other. In this case, you
have the necessary privileges to perform the request, but the server cannot
@@ -16127,8 +16242,8 @@ Access denied for user: 'root@@localhost' (Using password: YES)
It means that you are using a wrong password. @xref{Passwords}.
If you have forgot the root password, you can restart @code{mysqld} with
-@code{--skip-grant-tables} to change the password. You can find more
-about this option later on in this manual section.
+@code{--skip-grant-tables} to change the password.
+@xref{Resetting permissions}.
If you get the above error even if you haven't specified a password,
this means that you a wrong password in some @code{my.ini}
@@ -16165,9 +16280,10 @@ password} command.
@code{localhost} is a synonym for your local hostname, and is also the
default host to which clients try to connect if you specify no host
explicitly. However, connections to @code{localhost} do not work if you are
-running on a system that uses MIT-pthreads (@code{localhost} connections are
-made using Unix sockets, which are not supported by MIT-pthreads). To avoid
-this problem on such systems, you should use the @code{--host} option to name
+using a MySQL version prior to 3.23.27 that uses MIT-pthreads
+(@code{localhost} connections are made using Unix sockets, which were not
+supported by MIT-pthreads at that time). To avoid this problem on such
+systems, you should use the @code{--host} option to name
the server host explicitly. This will make a TCP/IP connection to the
@code{mysqld} server. In this case, you must have your real hostname in
@code{user} table entries on the server host. (This is true even if you are
@@ -16318,7 +16434,7 @@ applies to.
If you get the error when using the SQL commands @code{SELECT ...
INTO OUTFILE} or @code{LOAD DATA INFILE}, your entry in the @code{user} table
-probably doesn't have the @strong{file} privilege enabled.
+probably doesn't have the @code{FILE} privilege enabled.
@item
@cindex configuration files
@@ -16425,9 +16541,9 @@ GRANT priv_type [(column_list)] [, priv_type [(column_list)] ...]
[CIPHER cipher [AND]]
[ISSUER issuer [AND]]
[SUBJECT subject]]
- [WITH [GRANT OPTION | MAX_QUERIES_PER_HOUR=# |
- MAX_UPDATES_PER_HOUR=# |
- MAX_CONNECTIONS_PER_HOUR=#]]
+ [WITH [GRANT OPTION | MAX_QUERIES_PER_HOUR # |
+ MAX_UPDATES_PER_HOUR # |
+ MAX_CONNECTIONS_PER_HOUR #]]
REVOKE priv_type [(column_list)] [, priv_type [(column_list)] ...]
ON @{tbl_name | * | *.* | db_name.*@}
@@ -16465,19 +16581,44 @@ For examples of how @code{GRANT} works, see @ref{Adding users}.
For the @code{GRANT} and @code{REVOKE} statements, @code{priv_type} may be
specified as any of the following:
-@example
-ALL PRIVILEGES FILE RELOAD
-ALTER INDEX SELECT
-CREATE INSERT SHUTDOWN
-DELETE PROCESS UPDATE
-DROP REFERENCES USAGE
-@end example
+@c FIX agl 2002-06-13 New table, need to measure colwidths!
+@multitable @columnfractions .30 .70
+@item @code{ALL [PRIVILEGES]} @tab Sets all simple privileges except @code{WITH GRANT OPTION}
+@item @code{ALTER} @tab Allows usage of @code{ALTER TABLE}
+@item @code{CREATE} @tab Allows usage of @code{CREATE TABLE}
+@item @code{CREATE TEMPORARY TABLES} @tab Allows usage of @code{CREATE TEMPORARY TABLE}
+@item @code{DELETE} @tab Allows usage of @code{DELETE}
+@item @code{DROP} @tab Allows usage of @code{DROP TABLE}.
+@item @code{EXECUTE} @tab Allows the user to run stored procedures (for MySQL 5.0)
+@item @code{FILE} @tab Allows usage of @code{SELECT ... INTO OUTFILE} and @code{LOAD DATA INFILE}.
+@item @code{INDEX} @tab Allows usage of @code{CREATE INDEX} and @code{DROP INDEX}
+@item @code{INSERT} @tab Allows usage of @code{INSERT}
+@item @code{LOCK TABLES} @tab Allows usage of @code{LOCK TABLES} on tables for which on has the @code{SELECT} privilege.
+@item @code{PROCESS} @tab Allows usage of @code{SHOW FULL PROCESSLIST}
+@item @code{REFERENCES} @tab For the future
+@item @code{RELOAD} @tab Allows usage of @code{FLUSH}
+@item @code{REPLICATION CLIENT} @tab Gives the right to the user to ask where the slaves/masters are.
+@item @code{REPLICATION SLAVE} @tab Needed for the replication slaves (to read binlogs from master).
+@item @code{SELECT} @tab Allows usage of @code{SELECT}
+@item @code{SHOW DATABASES} @tab @code{SHOW DATABASES} shows all databases.
+@item @code{SHUTDOWN} @tab Allows usage of @code{mysqladmin shutdown}
+@item @code{SUPER} @tab Allows one connect (once) even if max_connections is reached and execute commands @code{CHANGE MASTER}, @code{KILL thread}, @code{mysqladmin debug}, @code{PURGE MASTER LOGS} and @code{SET GLOBAL}
+@item @code{UPDATE} @tab Allows usage of @code{UPDATE}
+@item @code{USAGE} @tab Synonym for ``no privileges.''
+@end multitable
+
+@code{USAGE} can be used when you want to create a user that has no privileges.
-@code{ALL} is a synonym for @code{ALL PRIVILEGES}. @code{REFERENCES} is not
-yet implemented. @code{USAGE} is currently a synonym for ``no privileges.''
-It can be used when you want to create a user that has no privileges.
+The privileges @code{CREATE TEMPORARY TABLES}, @code{EXECUTE},
+@code{LOCK TABLES}, @code{REPLICATION ...}, @code{SHOW DATABASES} and
+@code{SUPER} are new for in version 4.0.2. To use these new privileges
+after upgrading to 4.0.2, you have to run the
+@code{mysql_fix_privilege_tables} script.
-To revoke the @strong{grant} privilege from a user, use a @code{priv_type}
+In older MySQL versions, the @code{PROCESS} privilege gives the same
+rights as the new @code{SUPER} privilege.
+
+To revoke the @code{GRANT} privilege from a user, use a @code{priv_type}
value of @code{GRANT OPTION}:
@example
@@ -16536,7 +16677,7 @@ characters.
The privileges for a table or column are formed from the
logical OR of the privileges at each of the four privilege
levels. For example, if the @code{mysql.user} table specifies that a
-user has a global @strong{select} privilege, this can't be denied by an
+user has a global @code{SELECT} privilege, this can't be denied by an
entry at the database, table, or column level.
The privileges for a column can be calculated as follows:
@@ -16575,7 +16716,7 @@ function @code{PASSWORD()} or the C API function
@code{IDENTIFIED BY} clause, the user has no password. This is insecure.
Passwords can also be set with the @code{SET PASSWORD} command.
-@xref{SET OPTION, , @code{SET OPTION}}.
+@xref{SET OPTION, , @code{SET}}.
If you grant privileges for a database, an entry in the @code{mysql.db}
table is created if needed. When all privileges for the database have been
@@ -16587,30 +16728,30 @@ statement).
The @code{WITH GRANT OPTION} clause gives the user the ability to give
to other users any privileges the user has at the specified privilege level.
-You should be careful to whom you give the @strong{grant} privilege, as two
+You should be careful to whom you give the @code{GRANT} privilege, as two
users with different privileges may be able to join privileges!
-@code{MAX_QUERIES_PER_HOUR=#}, @code{MAX_UPDATES_PER_HOUR=#} and
-@code{MAX_CONNECTIONS_PER_HOUR=#} limit the number of
-queries/updates and logins the user can do during one hour.
-If @code{#} is 0 (default), then this means that there is no limitations
-for the user. @xref{User resources}.
+@code{MAX_QUERIES_PER_HOUR #}, @code{MAX_UPDATES_PER_HOUR #} and
+@code{MAX_CONNECTIONS_PER_HOUR #} are new in MySQL version 4.0.2.
+These options limit the number of queries/updates and logins the user can
+do during one hour. If @code{#} is 0 (default), then this means that there
+are no limitations for that user. @xref{User resources}.
You cannot grant another user a privilege you don't have yourself;
-the @strong{grant} privilege allows you to give away only those privileges
+the @code{GRANT} privilege allows you to give away only those privileges
you possess.
-Be aware that when you grant a user the @strong{grant} privilege at a
+Be aware that when you grant a user the @code{GRANT} privilege at a
particular privilege level, any privileges the user already possesses (or
is given in the future!) at that level are also grantable by that user.
-Suppose you grant a user the @strong{insert} privilege on a database. If
-you then grant the @strong{select} privilege on the database and specify
-@code{WITH GRANT OPTION}, the user can give away not only the @strong{select}
-privilege, but also @strong{insert}. If you then grant the @strong{update}
+Suppose you grant a user the @code{INSERT} privilege on a database. If
+you then grant the @code{SELECT} privilege on the database and specify
+@code{WITH GRANT OPTION}, the user can give away not only the @code{SELECT}
+privilege, but also @code{INSERT}. If you then grant the @code{UPDATE}
privilege to the user on the database, the user can give away the
-@strong{insert}, @strong{select} and @strong{update}.
+@code{INSERT}, @code{SELECT} and @code{UPDATE}.
-You should not grant @strong{alter} privileges to a normal user. If you
+You should not grant @code{ALTER} privileges to a normal user. If you
do that, the user can try to subvert the privilege system by renaming
tables!
@@ -16641,8 +16782,8 @@ and not only for an username.
@item
ANSI SQL doesn't have global or database-level privileges, and ANSI SQL
doesn't support all privilege types that MySQL supports.
-MySQL doesn't support the ANSI SQL @code{TRIGGER}, @code{EXECUTE} or
-@code{UNDER} privileges.
+MySQL doesn't support the ANSI SQL @code{TRIGGER} or @code{UNDER}
+privileges.
@item
ANSI SQL privileges are structured in a hierarchal manner. If you remove
@@ -16651,11 +16792,11 @@ MySQL the granted privileges are not automatically revoked, but
you have to revoke these yourself if needed.
@item
-In MySQL, if you have the @strong{insert} privilege on only some of the
+In MySQL, if you have the @code{INSERT} privilege on only some of the
columns in a table, you can execute @code{INSERT} statements on the
-table; the columns for which you don't have the @strong{insert} privilege
+table; the columns for which you don't have the @code{INSERT} privilege
will be set to their default values. ANSI SQL requires you to have the
-@strong{insert} privilege on all columns.
+@code{INSERT} privilege on all columns.
@item
When you drop a table in ANSI SQL, all privileges for the table are revoked.
@@ -16908,8 +17049,8 @@ users. These examples assume that privileges are set up according to the
defaults described in the previous section. This means that to make changes,
you must be on the same machine where @code{mysqld} is running, you must
connect as the MySQL @code{root} user, and the @code{root} user must
-have the @strong{insert} privilege for the @code{mysql} database and the
-@strong{reload} administrative privilege. Also, if you have changed the
+have the @code{INSERT} privilege for the @code{mysql} database and the
+@code{RELOAD} administrative privilege. Also, if you have changed the
@code{root} user password, you must specify it for the @code{mysql} commands here.
You can add new users by issuing @code{GRANT} statements:
@@ -16939,7 +17080,7 @@ earlier in the @code{user} table sort order.
@item admin
A user who can connect from @code{localhost} without a password and who is
-granted the @strong{reload} and @strong{process} administrative privileges.
+granted the @code{RELOAD} and @code{PROCESS} administrative privileges.
This allows the user to execute the @code{mysqladmin reload},
@code{mysqladmin refresh}, and @code{mysqladmin flush-*} commands, as well as
@code{mysqladmin processlist} . No database-related privileges are granted.
@@ -16947,7 +17088,7 @@ This allows the user to execute the @code{mysqladmin reload},
@item dummy
A user who can connect without a password, but only from the local host. The
-global privileges are all set to @code{'N'}@-the @strong{usage} privilege
+global privileges are all set to @code{'N'}@-the @code{USAGE} privilege
type allows you to create a user with no privileges. It is assumed that you
will grant database-specific privileges later.
@end table
@@ -17109,9 +17250,9 @@ unless the limits are granted to them. These limits can be granted
@strong{only} via global @code{GRANT (*.*)}, using this syntax:
@example
-GRANT ... WITH MAX_QUERIES_PER_HOUR = N1
- MAX_UPDATES_PER_HOUR = N2
- MAX_CONNECTIONS_PER_HOUR = N3;
+GRANT ... WITH MAX_QUERIES_PER_HOUR N1
+ MAX_UPDATES_PER_HOUR N2
+ MAX_CONNECTIONS_PER_HOUR N3;
@end example
One can specify any combination of the above resources.
@@ -17297,7 +17438,7 @@ file.
@node Secure connections, , Password security, User Account Management
@subsection Using Secure Connections
-@cindex openssl
+@cindex OpenSSL
@cindex SSL and X509 Basics
@menu
@@ -17309,51 +17450,52 @@ file.
@node Secure basics, Secure requirements, Secure connections, Secure connections
@subsubsection Basics
+Beginning with version 4.0.0,
MySQL has support for SSL encrypted connections. To understand how MySQL
-uses SSL, we need to explain some basics about SSL and X509. People who
-are already aware of it can skip this part.
+uses SSL, it's necessary to explain some basic SSL and X509 concepts. People
+who are already familiar with them can skip this part.
-By default, MySQL uses unencrypted connections between client and
+By default, MySQL uses unencrypted connections between the client and the
server. This means that someone could watch all your traffic and look at
-the data being sent/received. Actually, they could even change the data
+the data being sent or received. They could even change the data
while it is in transit between client and server. Sometimes you need to
-move really secret data over public networks and in such a case using an
-unencrypted connection is unacceptable.
+move information over public networks in a secure fashion; in such cases,
+using an unencrypted connection is unacceptable.
-SSL is a protocol which uses different encryption algorithms to ensure
-that data which comes from public network can be trusted. It has
+SSL is a protocol that uses different encryption algorithms to ensure
+that data received over a public network can be trusted. It has
mechanisms to detect any change, loss or replay of data. SSL also
-incorpores algorithms to recognise and provide identity verification
+incorporates algorithms to recognise and provide identity verification
using the X509 standard.
@cindex What is encryption
Encryption is the way to make any kind of data unreadable. In fact,
today's practice requires many additional security elements from
encryption algorithms. They should resist many kind of known attacks
-like just messing with order of encrypted messages or replaying data
+like just messing with the order of encrypted messages or replaying data
twice.
@cindex What is X509/Certificate?
-X509 is a standard that makes it possible to identify someone in the
+X509 is a standard that makes it possible to identify someone on the
Internet. It is most commonly used in e-commerce applications. In basic
-terms, there should be some company called "Certificate Authority" which
+terms, there should be some company (called a ``Certificate Authority'') that
assigns electronic certificates to anyone who needs them. Certificates
-rely on asymmetric encryption algorithms which have two encryption keys
-- public and secret. A certificate owner can prove his identity by
-showing his certificate to other party. A certificate consists of his
-owner's public key. Any data encrypted with this public key can only be
-decrypted using the corresponding secret key, which is held by the owner
+rely on asymmetric encryption algorithms that have two encryption keys
+(a public key and a secret key). A certificate owner can prove his identity by
+showing his certificate to other party. A certificate consists of its
+owner's public key. Any data encrypted with this public key can be
+decrypted only using the corresponding secret key, which is held by the owner
of the certificate.
-MySQL doesn't use encrypted on connections by default, because this
+MySQL doesn't use encrypted connections by default, because doing so
would make the client/server protocol much slower. Any kind of
-additional functionality requires computer to do additional work and
-encrypting data is CPU-intensive operation require time and can delay
+additional functionality requires the computer to do additional work and
+encrypting data is a CPU-intensive operation that requires time and can delay
MySQL main tasks. By default MySQL is tuned to be fast as possible.
-If you need more information about SSL/X509/encryption, you should use
-your favourite internet search engine and search for keywords you are
-interested in.
+If you need more information about SSL, X509, or encryption, you should use
+your favourite Internet search engine and search for keywords in which you are
+interested.
@node Secure requirements, Secure GRANT, Secure basics, Secure connections
@subsubsection Requirements
@@ -17362,16 +17504,18 @@ To get secure connections to work with MySQL you must do the following:
@enumerate
@item
-Install the openssl library. We have tested MySQL with openssl 0.9.6.
+Install the OpenSSL library. We have tested MySQL with OpenSSL 0.9.6.
@uref{http://www.openssl.org/}.
@item
Configure MySQL with @code{--with-vio --with-openssl}.
@item
If you are using an old MySQL installation, you have to update your
-@code{mysql.user} table with some new columns. You can do this by
+@code{mysql.user} table with some new SSL-related columns. You can do this by
running the @code{mysql_fix_privilege_tables.sh} script.
+This is necessary if your grant tables date from a version prior to MySQL
+4.0.0.
@item
-You can check if a running mysqld server supports @code{openssl} by
+You can check if a running @code{mysqld} server supports OpenSSL by
examining if @code{SHOW VARIABLES LIKE 'have_openssl'} returns @code{YES}.
@end enumerate
@@ -17391,8 +17535,8 @@ There are different possibilities to limit connections:
@itemize @bullet
@item
-Without any SSL/X509 options, all kind of encrypted/unencrypted
-connections are allowed if username and password are valid.
+Without any SSL or X509 options, all kind of encrypted/unencrypted
+connections are allowed if the username and password are valid.
@item
@code{REQUIRE SSL} option limits the server to allow only SSL
@@ -17405,7 +17549,7 @@ mysql> GRANT ALL PRIVILEGES ON test.* TO root@@localhost
@end example
@item
-@code{REQUIRE X509} means that client should have valid certificate
+@code{REQUIRE X509} means that the client should have a valid certificate
but we do not care about the exact certificate, issuer or subject.
The only restriction is that it should be possible to verify its
signature with one of the CA certificates.
@@ -17416,10 +17560,10 @@ mysql> GRANT ALL PRIVILEGES ON test.* TO root@@localhost
@end example
@item
-@code{REQUIRE ISSUER issuer} makes connection more restrictive: now
-client must present a valid X509 certificate issued by CA "issuer".
-Using X509 certificates always implies encryption, so the option "SSL"
-is not neccessary anymore.
+@code{REQUIRE ISSUER "issuer"} places a restriction on connection attempts:
+The client must present a valid X509 certificate issued by CA @code{"issuer"}.
+Using X509 certificates always implies encryption, so the @code{SSL} option
+is unneccessary.
@example
mysql> GRANT ALL PRIVILEGES ON test.* TO root@@localhost
@@ -17429,10 +17573,10 @@ mysql> GRANT ALL PRIVILEGES ON test.* TO root@@localhost
@end example
@item
-@code{REQUIRE SUBJECT subject} requires clients to have valid X509
-certificate with subject "subject" on it. If client have valid
-certificate but having different "subject" then the connection is
-still not allowed.
+@code{REQUIRE SUBJECT "subject"} requires clients to have valid X509
+certificate with subject @code{"subject"} on it. If the client presents a
+certificate that is valid but has a different @code{"subject"}, the connection
+is disallowed.
@example
mysql> GRANT ALL PRIVILEGES ON test.* TO root@@localhost
@@ -17443,7 +17587,7 @@ mysql> GRANT ALL PRIVILEGES ON test.* TO root@@localhost
@end example
@item
-@code{REQUIRE CIPHER cipher} is needed to assure enough strong ciphers
+@code{REQUIRE CIPHER "cipher"} is needed to assure enough strong ciphers
and keylengths will be used. SSL itself can be weak if old algorithms
with short encryption keys are used. Using this option, we can ask for
some exact cipher method to allow a connection.
@@ -17454,7 +17598,8 @@ mysql> GRANT ALL PRIVILEGES ON test.* TO root@@localhost
-> REQUIRE CIPHER "EDH-RSA-DES-CBC3-SHA";
@end example
-Also it is allowed to combine these options with each other like this:
+The @code{SUBJECT}, @code{ISSUER}, and @code{CIPHER} options can be
+combined in the @code{REQUIRE} clause like this:
@example
mysql> GRANT ALL PRIVILEGES ON test.* TO root@@localhost
@@ -17467,8 +17612,8 @@ mysql> GRANT ALL PRIVILEGES ON test.* TO root@@localhost
-> AND CIPHER "EDH-RSA-DES-CBC3-SHA";
@end example
-But it is not allowed to use any option twice. Only different
-options can be mixed.
+The order of the options does not matter, but no option can be specified
+twice.
@end itemize
@@ -17531,6 +17676,7 @@ The script @code{mysqlhotcopy} does use this method.
@item
@cindex log files, names
+@cindex @code{mysqlbinlog}
Stop @code{mysqld} if it's running, then start it with the
@code{--log-update[=file_name]} option. @xref{Update log}. The update
log file(s) provide you with the information you need to replicate
@@ -17606,14 +17752,15 @@ BACKUP TABLE tbl_name[,tbl_name...] TO '/path/to/backup/directory'
@end example
Copies to the backup directory the minimum number of table files needed
-to restore the table. Currently only works for @code{MyISAM} tables.
+to restore the table, after flushing any buffered changes to disk. Currently
+only works for @code{MyISAM} tables.
For @code{MyISAM} tables, copies @file{.frm} (definition) and
@file{.MYD} (data) files. The index file can be rebuilt from those two.
Before using this command, please see @ref{Backup}.
-During the backup, read lock will be held for each table, one at time,
-as they are being backed up. If you want to backup several tables as
+During the backup, a read lock will be held for each table, one at time,
+as they are being backed up. If you want to back up several tables as
a snapshot, you must first issue @code{LOCK TABLES} obtaining a read
lock for each table in the group.
@@ -17641,11 +17788,11 @@ RESTORE TABLE tbl_name[,tbl_name...] FROM '/path/to/backup/directory'
@end example
Restores the table(s) from the backup that was made with
-@code{BACKUP TABLE}. Existing tables will not be overwritten - if you
-try to restore over an existing table, you will get an error. Restore
-will take longer than BACKUP due to the need to rebuilt the index. The
-more keys you have, the longer it is going to take. Just as
-@code{BACKUP TABLE}, currently only works of @code{MyISAM} tables.
+@code{BACKUP TABLE}. Existing tables will not be overwritten; if you
+try to restore over an existing table, you will get an error. Restoring
+will take longer than backing up due to the need to rebuild the index. The
+more keys you have, the longer it will take. Just as @code{BACKUP TABLE},
+@code{RESTORE TABLE} currently works only for @code{MyISAM} tables.
The command returns a table with the following columns:
@@ -17677,7 +17824,7 @@ table_name} on the table.
If you don't specify any option @code{MEDIUM} is used.
Checks the table(s) for errors. For @code{MyISAM} tables the key statistics
-is updated. The command returns a table with the following columns:
+are updated. The command returns a table with the following columns:
@multitable @columnfractions .15 .40
@item @strong{Column} @tab @strong{Value}
@@ -17701,12 +17848,12 @@ The different check types stand for the following:
@item @code{QUICK} @tab Don't scan the rows to check for wrong links.
@item @code{FAST} @tab Only check tables which haven't been closed properly.
@item @code{CHANGED} @tab Only check tables which have been changed since last check or haven't been closed properly.
-@item @code{MEDIUM} @tab Scan rows to verify that deleted links are okay. This also calculates a key checksum for the rows and verifies this with a calcualted checksum for the keys.
-@item @code{EXTENDED} @tab Do a full key lookup for all keys for each row. This ensures that the table is 100 % consistent, but will take a long time!
+@item @code{MEDIUM} @tab Scan rows to verify that deleted links are okay. This also calculates a key checksum for the rows and verifies this with a calculated checksum for the keys.
+@item @code{EXTENDED} @tab Do a full key lookup for all keys for each row. This ensures that the table is 100% consistent, but will take a long time!
@end multitable
For dynamically sized @code{MyISAM} tables a started check will always
-do a @code{MEDIUM} check. For static size rows we skip the row scan
+do a @code{MEDIUM} check. For statically sized rows we skip the row scan
for @code{QUICK} and @code{FAST} as the rows are very seldom corrupted.
You can combine check options as in:
@@ -17736,7 +17883,7 @@ file. If this happens then the table will be marked as 'corrupted',
in which case the table can't be used until it's repaired.)
@code{FAST} and @code{CHANGED} are mostly intended to be used from a
-script (for example to be executed from cron) if you want to check your
+script (for example to be executed from @code{cron}) if you want to check your
table from time to time. In most cases you @code{FAST} is to be prefered
over @code{CHANGED}. (The only case when it isn't is when you suspect a
bug you have found a bug in the @code{MyISAM} code.)
@@ -18012,7 +18159,7 @@ Print the @code{myisamchk} version and exit.
@item -w or, --wait
Instead of giving an error if the table is locked, wait until the table
is unlocked before continuing. Note that if you are running @code{mysqld}
-on the table with @code{--skip-locking}, the table can only be locked
+on the table with @code{--skip-external-locking}, the table can only be locked
by another @code{myisamchk} command.
@end table
@@ -18053,11 +18200,11 @@ Should, however, be good enough for most cases.
Store in the @file{.MYI} file when the table was checked and if the table crashed. This should be used to get full benefit of the
@code{--check-only-changed} option, but you shouldn't use this
option if the @code{mysqld} server is using the table and you are
-running @code{mysqld} with @code{--skip-locking}.
+running @code{mysqld} with @code{--skip-external-locking}.
@item -T or --read-only
Don't mark table as checked. This is useful if you use @code{myisamchk}
to check a table that is in use by some other application that doesn't
-use locking (like @code{mysqld --skip-locking}).
+use locking (like @code{mysqld --skip-external-locking}).
@end table
@@ -18217,9 +18364,9 @@ If you have a problem with disk space during repair, you can try to use
@cindex crash, recovery
@cindex recovery, from crash
-If you run @code{mysqld} with @code{--skip-locking} (which is the default on
-some systems, like Linux), you can't reliably use @code{myisamchk} to
-check a table when @code{mysqld} is using the same table. If you
+If you run @code{mysqld} with @code{--skip-external-locking} (which is the
+default on some systems, like Linux), you can't reliably use @code{myisamchk}
+to check a table when @code{mysqld} is using the same table. If you
can be sure that no one is accessing the tables through @code{mysqld}
while you run @code{myisamchk}, you only have to do @code{mysqladmin
flush-tables} before you start checking the tables. If you can't
@@ -18228,14 +18375,14 @@ check the tables. If you run @code{myisamchk} while @code{mysqld} is updating
the tables, you may get a warning that a table is corrupt even if it
isn't.
-If you are not using @code{--skip-locking}, you can use @code{myisamchk}
-to check tables at any time. While you do this, all clients that try
-to update the table will wait until @code{myisamchk} is ready before
+If you are not using @code{--skip-external-locking}, you can use
+@code{myisamchk} to check tables at any time. While you do this, all clients
+that try to update the table will wait until @code{myisamchk} is ready before
continuing.
If you use @code{myisamchk} to repair or optimise tables, you
@strong{must} always ensure that the @code{mysqld} server is not using
-the table (this also applies if you are using @code{--skip-locking}).
+the table (this also applies if you are using @code{--skip-external-locking}).
If you don't take down @code{mysqld} you should at least do a
@code{mysqladmin flush-tables} before you run @code{myisamchk}.
Your tables @strong{may be corrupted} if the server and @code{myisamchk}
@@ -18616,8 +18763,8 @@ here. We explain some of the information in more detail later:
@item myisamchk -d tbl_name
Runs @code{myisamchk} in ``describe mode'' to produce a description of
your table. If you start the MySQL server using the
-@code{--skip-locking} option, @code{myisamchk} may report an error for a
-table that is updated while it runs. However, because @code{myisamchk}
+@code{--skip-external-locking} option, @code{myisamchk} may report an error
+for a table that is updated while it runs. However, because @code{myisamchk}
doesn't change the table in describe mode, there isn't any risk of
destroying data.
@@ -19059,7 +19206,7 @@ FLUSH flush_option [,flush_option] ...
You should use the @code{FLUSH} command if you want to clear some of the
internal caches MySQL uses. To execute @code{FLUSH}, you must have
-the @strong{reload} privilege.
+the @code{RELOAD} privilege.
@code{flush_option} can be any of the following:
@@ -19074,7 +19221,7 @@ connection to the MySQL server, MySQL assumes
something is wrong and blocks the host from further connection requests.
Flushing the host tables allows the host to attempt to connect
again. @xref{Blocked host}. You can start @code{mysqld} with
-@code{-O max_connection_errors=999999999} to avoid this error message.
+@code{-O max_connect_errors=999999999} to avoid this error message.
@item @code{DES_KEY_FILE} @tab Reloads the DES keys from the file that was
specified with the @code{--des-key-file} option at server startup time.
@@ -19098,7 +19245,7 @@ memory. This command will not remove any queries from the cache, unlike
@item @code{[TABLE | TABLES] tbl_name [,tbl_name...]} @tab Flushes only the given tables.
-@item @code{TABLES WITH READ LOCK} @tab Closes all open tables and locks all tables for all databases with a read until one executes @code{UNLOCK TABLES}. This is very convenient way to get backups if you have a filesystem, like Veritas,that can take snapshots in time.
+@item @code{TABLES WITH READ LOCK} @tab Closes all open tables and locks all tables for all databases with a read lock until you execute @code{UNLOCK TABLES}. This is very convenient way to get backups if you have a filesystem, like Veritas, that can take snapshots in time.
@item @code{STATUS} @tab Resets most status variables to zero. This is something one should only use when debugging a query.
@@ -19122,7 +19269,7 @@ RESET reset_option [,reset_option] ...
The @code{RESET} command is used to clear things. It also acts as an stronger
version of the @code{FLUSH} command. @xref{FLUSH, , @code{FLUSH}}.
-To execute @code{RESET}, you must have the @strong{reload} privilege.
+To execute @code{RESET}, you must have the @code{RELOAD} privilege.
@multitable @columnfractions .25 .75
@item @strong{Option} @tab @strong{Description}
@@ -19152,8 +19299,9 @@ Each connection to @code{mysqld} runs in a separate thread. You can see
which threads are running with the @code{SHOW PROCESSLIST} command and kill
a thread with the @code{KILL thread_id} command.
-If you have the @strong{process} privilege, you can see and kill all threads.
-Otherwise, you can see and kill only your own threads.
+If you have the @code{PROCESS} privilege, you can see all threads.
+If you have the @code{SUPER} privilege, you can kill all threads.
+Otherwise, you can only see and kill your own threads.
You can also use the @code{mysqladmin processlist} and @code{mysqladmin kill}
commands to examine and kill threads.
@@ -19260,8 +19408,11 @@ mysql> SHOW INDEX FROM mytable FROM mydb;
mysql> SHOW INDEX FROM mydb.mytable;
@end example
-@code{SHOW DATABASES} lists the databases on the MySQL server
-host. You can also get this list using the @code{mysqlshow} command.
+@code{SHOW DATABASES} lists the databases on the MySQL server host.
+You can also get this list using the @code{mysqlshow} command line tool.
+In version 4.0.2 you will only see those databases for which you have some
+kind of privilege, if you don't have the global @code{SHOW DATABASES}
+privilege.
@code{SHOW TABLES} lists the tables in a given database. You can also
get this list using the @code{mysqlshow db_name} command.
@@ -19539,7 +19690,7 @@ instead of disk based.
@subsubsection @code{SHOW VARIABLES}
@example
-SHOW VARIABLES [LIKE wild]
+SHOW [GLOBAL | SESSION] VARIABLES [LIKE wild]
@end example
@code{SHOW VARIABLES} shows the values of some MySQL system
@@ -19548,6 +19699,15 @@ variables} command. If the default values are unsuitable, you can set most
of these variables using command-line options when @code{mysqld} starts up.
@xref{Command-line options}.
+The options @code{GLOBAL} and @code{SESSION} are new in MySQL 4.0.3.
+With @code{GLOBAL} you will get the variables that will be used for new
+connections to MySQL. With @code{SESSION} you will get the values that
+are in effect for the current connection. If you are not using either
+option, @code{SESSION} is used.
+
+You can change most options with the @code{SET} command.
+@xref{SET OPTION, , @code{SET}}.
+
The output resembles that shown here, though the format and numbers may
differ somewhat:
@@ -19566,6 +19726,7 @@ differ somewhat:
| bdb_shared_data | OFF |
| bdb_tmpdir | /tmp/ |
| binlog_cache_size | 32768 |
+| bulk_insert_buffer_size | 8388608 |
| concurrent_insert | ON |
| connect_timeout | 5 |
| datadir | /my/monty/data/ |
@@ -19606,7 +19767,6 @@ differ somewhat:
| max_sort_length | 1024 |
| max_tmp_tables | 32 |
| max_write_lock_count | 4294967295 |
-| myisam_bulk_insert_tree_size | 8388608 |
| myisam_recover_options | DEFAULT |
| myisam_sort_buffer_size | 8388608 |
| net_buffer_length | 16384 |
@@ -19617,11 +19777,10 @@ differ somewhat:
| pid_file | /my/monty/data/donna.pid |
| port | 3306 |
| protocol_version | 10 |
-| record_buffer | 131072 |
-| query_buffer_size | 0 |
+| read_buffer_size | 131072 |
| query_cache_limit | 1048576 |
| query_cache_size | 16768060 |
-| query_cache_startup_type | 1 |
+| query_cache_type | 1 |
| safe_show_database | OFF |
| server_id | 0 |
| skip_locking | ON |
@@ -19713,6 +19872,15 @@ statements for the binary log during a transaction. If you often use
big, multi-statement transactions you can increase this to get more
performance. @xref{COMMIT}.
+@item @code{bulk_insert_buffer_size} (was @code{myisam_bulk_insert_tree_size})
+MyISAM uses special tree-like cache to make bulk inserts (that is,
+@code{INSERT ... SELECT}, @code{INSERT ... VALUES (...), (...), ...}, and
+@code{LOAD DATA INFILE}) faster. This variable limits
+the size of the cache tree in bytes per thread. Setting it to 0
+will disable this optimisation.
+@strong{Note}: this cache is only used when adding data to non-empty table.
+Default value is 8 MB.
+
@item @code{character_set}
The default character set.
@@ -19734,16 +19902,20 @@ packet before responding with @code{Bad handshake}.
The value of the @code{--datadir} option.
@item @code{delay_key_write}
-If enabled (is on by default), MySQL will honor the
-@code{DELAY_KEY_WRITE} option for @code{CREATE TABLE}. This means that the
-key buffer for tables with this option will not get flushed on every
-index update, but only when a table is closed. This will speed up
-writes on keys a lot, but you should add automatic checking of all tables
-with @code{myisamchk --fast --force} if you use this. Note that if you
-start @code{mysqld} with the @code{--delay-key-write-for-all-tables}
-option this means that all tables will be treated as if they were
-created with the @code{delay_key_write} option. You can clear this flag
-by starting @code{mysqld} with @code{--skip-new} or @code{--safe-mode}.
+Option for MyISAM tables. Can have one of the following values:
+
+@multitable @columnfractions .30 .70
+@item OFF @tab All CREATE TABLE ... DELAYED_KEY_WRITES are ignored.
+@item ON @tab (default) MySQL will honor the @code{DELAY_KEY_WRITE} option
+for @code{CREATE TABLE}.
+@item ALL @tab All new opened tables are treated as if they were created with the @code{DELAY_KEY_WRITE} option.
+@end multitable
+
+If @code{DELAY_KEY_WRITE} is enabled this means that the key buffer for
+tables with this option will not get flushed on every index update, but
+only when a table is closed. This will speed up writes on keys a lot,
+but you should add automatic checking of all tables with @code{myisamchk
+--fast --force} if you use this.
@item @code{delayed_insert_limit}
After inserting @code{delayed_insert_limit} rows, the @code{INSERT
@@ -19847,7 +20019,7 @@ status} and examine the variables @code{Key_read_requests},
The @code{Key_write/Key_write_requests} is usually near 1 if you are
using mostly updates/deletes but may be much smaller if you tend to
do updates that affect many at the same time or if you are
-using @code{delay_key_write}. @xref{SHOW, , @code{SHOW}}.
+using @code{DELAY_KEY_WRITE}. @xref{SHOW, , @code{SHOW}}.
To get even more speed when writing many rows at the same time, use
@code{LOCK TABLES}. @xref{LOCK TABLES, , @code{LOCK TABLES}}.
@@ -19876,11 +20048,15 @@ If the updates from the slave should be logged.
@item @code{long_query_time}
If a query takes longer than this (in seconds), the @code{Slow_queries} counter
will be incremented. If you are using @code{--log-slow-queries}, the query
-will be logged to the slow query logfile. @xref{Slow query log}.
+will be logged to the slow query logfile. This value is measured in real
+time, not CPU time, so a query that may be under the threshold on a lightly
+loaded system may be above the threshold on a heavily loaded one.
+@xref{Slow query log}.
@item @code{lower_case_table_names}
If set to 1 table names are stored in lowercase on disk and table
-names will be case-insensitive.
+name comparisons will be case-insensitive.
+From version 4.0.2, this option also applies to database names.
@xref{Name case sensitivity}.
@item @code{max_allowed_packet}
@@ -19942,15 +20118,6 @@ Maximum number of temporary tables a client can keep open at the same time.
@item @code{max_write_lock_count}
After this many write locks, allow some read locks to run in between.
-@item @code{myisam_bulk_insert_tree_size}
-MySQL uses special tree-like cache to make bulk inserts (that is,
-@code{INSERT ... SELECT}, @code{INSERT ... VALUES (...), (...), ...}, and
-@code{LOAD DATA INFILE}) faster. This variable limits
-the size of the cache tree in bytes per thread. Setting it to 0
-will disable this optimization.
-@strong{Note}: this cache is only used when adding data to non-empty table.
-Default value is 8 MB.
-
@item @code{myisam_recover_options}
The value of the @code{--myisam-recover} option.
@@ -19964,14 +20131,16 @@ If the temporary file used for fast index creation would be bigger than
using the key cache by the amount specified here, then prefer the key
cache method. This is mainly used to force long character keys in large
tables to use the slower key cache method to create the index.
-@strong{Note} that this parameter is given in megabytes!
+@strong{Note} that this parameter is given in megabytes before 4.0.3 and
+in bytes starting from this version.
@item @code{myisam_max_sort_file_size}
The maximum size of the temporary file MySQL is allowed to use
while recreating the index (during @code{REPAIR}, @code{ALTER TABLE}
or @code{LOAD DATA INFILE}. If the file-size would be bigger than this,
the index will be created through the key cache (which is slower).
-@strong{Note} that this parameter is given in megabytes!
+@strong{Note} that this parameter is given in megabytes before 4.0.3 and
+in bytes starting from this version.
@item @code{net_buffer_length}
The communication buffer is reset to this size between queries. This
@@ -20011,19 +20180,17 @@ The value of the @code{--port} option.
@item @code{protocol_version}
The protocol version used by the MySQL server.
-@item @code{record_buffer}
+@item @code{read_buffer_size} (was @code{record_buffer})
Each thread that does a sequential scan allocates a buffer of this
size for each table it scans. If you do many sequential scans, you may
want to increase this value.
-@item @code{record_rnd_buffer}
-When reading rows in sorted order after a sort, the rows are read through this
-buffer to avoid a disk seeks. If not set, then it's set to the value of
-@code{record_buffer}.
-
-@item @code{query_buffer_size}
-The initial allocation of the query buffer. If most of your queries are
-long (like when inserting blobs), you should increase this!
+@item @code{record_rnd_buffer_size}
+When reading rows in sorted order after a sort, the rows are read
+through this buffer to avoid a disk seeks. Can improve @code{ORDER BY}
+by a lot if set to a high value. As this is a thread specific variable,
+one should not set this big globally, but just change this when running
+some specific big queries.
@item @code{query_cache_limit}
Don't cache results that are bigger than this. (Default 1M).
@@ -20032,7 +20199,7 @@ Don't cache results that are bigger than this. (Default 1M).
The memory allocated to store results from old queries.
If this is 0, the query cache is disabled (default).
-@item @code{query_cache_startup_type}
+@item @code{query_cache_type}
This may be set (only numeric) to
@multitable @columnfractions .09 .14 .72
@item @strong{Value} @tab @strong{Alias} @tab @strong{Comment}
@@ -20058,7 +20225,7 @@ Is ON if we only allow local (socket) connections.
@item @code{skip_show_database}
This prevents people from doing @code{SHOW DATABASES} if they don't have
-the @strong{process} privilege. This can improve security if you're
+the @code{PROCESS} privilege. This can improve security if you're
concerned about people being able to see what databases other users
have. See also @code{safe_show_database}.
@@ -20102,8 +20269,9 @@ is a new thread created. This variable can be increased to improve
performance if you have a lot of new connections. (Normally this doesn't
give a notable performance improvement if you have a good
thread implementation.) By examing the difference between
-the @code{Connections} and @code{Threads_created} you can see how efficient
-the current thread cache is for you.
+the @code{Connections} and @code{Threads_created} status variables
+(See @ref{SHOW STATUS} for details) you can see how efficient
+thread cache is.
@item @code{thread_concurrency}
On Solaris, @code{mysqld} will call @code{thr_setconcurrency()} with
@@ -20166,16 +20334,17 @@ subsystem)
@cindex threads, display
@cindex processes, display
-@code{SHOW [FULL] PROCESSLIST} shows you which threads are running. You can
-also get this information using the @code{mysqladmin processlist}
-command. If you have the @strong{process} privilege, you can see all
-threads. Otherwise, you can see only your own threads. @xref{KILL, ,
-@code{KILL}}. If you don't use the @code{FULL} option, then only
-the first 100 characters of each query will be shown.
+@code{SHOW [FULL] PROCESSLIST} shows you which threads are running.
+You can also get this information using the @code{mysqladmin processlist}
+command. If you have the @code{SUPER} privilege, you can see all
+threads. Otherwise, you can see only your own threads.
+@xref{KILL, ,@code{KILL}}.
+If you don't use the @code{FULL} option, then only the first 100
+characters of each query will be shown.
This command is very useful if you get the 'too many connections' error
message and want to find out what's going on. MySQL reserves
-one extra connection for a client with the @strong{process} privilege
+one extra connection for a client with the @code{SUPER} privilege
to ensure that you should always be able to login and check the system
(assuming you are not giving this privilege to all your users).
@@ -20227,7 +20396,7 @@ example an @code{ALTER TABLE} or a @code{LOCK TABLE} can prevent opening
a table until the command is finished.
@item @code{Removing duplicates}
The query was using @code{SELECT DISTINCT} in such a way that MySQL
-couldn't optimize that distinct away at an early stage. Because of this
+couldn't optimise that distinct away at an early stage. Because of this
MySQL has to do an extra stage to remove all duplicated rows before
sending the result to the client.
@item @code{Reopen table}
@@ -20249,7 +20418,7 @@ The thread is wating for the client to send a new command to it.
The thread is waiting for getting to get a external system lock for the
table. If you are not using multiple mysqld servers that are accessing
the same tables, you can disable system locks with the
-@code{--skip-locking} option.
+@code{--skip-external-locking} option.
@item @code{Upgrading lock}
The @code{INSERT DELAYED} handler is trying to get a lock for the table
to insert rows.
@@ -20316,7 +20485,7 @@ Create Table: CREATE TABLE t (
@code{SHOW CREATE TABLE} will quote table and column names according to
@code{SQL_QUOTE_SHOW_CREATE} option.
-@ref{SET OPTION, , @code{SET OPTION SQL_QUOTE_SHOW_CREATE}}.
+@ref{SET OPTION, , @code{SET SQL_QUOTE_SHOW_CREATE}}.
@node Localisation, Server-Side Scripts, Database Administration, MySQL Database Administration
@@ -20495,7 +20664,7 @@ For a simple character set do the following:
@enumerate
@item
Add MYSET to the end of the @file{sql/share/charsets/Index} file
-Assign an unique number to it.
+Assign a unique number to it.
@item
Create the file @file{sql/share/charsets/MYSET.conf}.
@@ -20537,7 +20706,7 @@ distribution.
@item
Add MYSET to the end of the @file{sql/share/charsets/Index} file.
-Assign an unique number to it.
+Assign a unique number to it.
@item
Look at one of the existing @file{ctype-*.c} files to see what needs to
@@ -20724,7 +20893,7 @@ table with @code{myisamchk -dvv table_name}.
@menu
* Server-Side Overview:: Overview of the Server-Side Scripts and Utilities
* safe_mysqld:: @code{safe_mysqld}, The Wrapper Around @code{mysqld}
-* mysqld_multi:: @code{mysqld_multi}, Program for Managing Multiple MySQL Servers
+* mysqld_multi:: @code{mysqld_multi}, A Program for Managing Multiple MySQL Servers
* myisampack:: @code{myisampack}, The MySQL Compressed Read-only Table Generator
* mysqld-max:: @code{mysqld-max}, An Extended @code{mysqld} Server
@end menu
@@ -20736,50 +20905,15 @@ table with @code{myisamchk -dvv table_name}.
@cindex environment variables
@cindex programs, list of
-All MySQL clients that communicate with the server using the
-@code{mysqlclient} library use the following environment variables:
-
-@tindex @code{MYSQL_UNIX_PORT} environment variable
-@tindex environment variable, @code{MYSQL_UNIX_PORT}
-@tindex @code{MYSQL_TCP_PORT} environment variable
-@tindex environment variable, @code{MYSQL_TCP_PORT}
-@tindex @code{MYSQL_PWD} environment variable
-@tindex environment variable, @code{MYSQL_PWD}
-@tindex @code{MYSQL_DEBUG} environment variable
-@tindex environment variable, @code{MYSQL_DEBUG}
-@multitable @columnfractions .25 .60
-@item @strong{Name} @tab @strong{Description}
-@item @code{MYSQL_UNIX_PORT} @tab The default socket; used for connections to @code{localhost}
-@item @code{MYSQL_TCP_PORT} @tab The default TCP/IP port
-@item @code{MYSQL_PWD} @tab The default password
-@item @code{MYSQL_DEBUG} @tab Debug-trace options when debugging
-@item @code{TMPDIR} @tab The directory where temporary tables/files are created
-@end multitable
-
-Use of @code{MYSQL_PWD} is insecure.
-@xref{Connecting}.
-
-@tindex @code{MYSQL_HISTFILE} environment variable
-@tindex environment variable, @code{MYSQL_HISTFILE}
-@tindex @code{HOME} environment variable
-@tindex environment variable, @code{HOME}
-@cindex history file
-@cindex command-line history
-@tindex .mysql_history file
-The @file{mysql} client uses the file named in the @code{MYSQL_HISTFILE}
-environment variable to save the command-line history. The default value for
-the history file is @file{$HOME/.mysql_history}, where @code{$HOME} is the
-value of the @code{HOME} environment variable. @xref{Environment variables}.
-
All MySQL programs take many different options. However, every
MySQL program provides a @code{--help} option that you can use
to get a full description of the program's different options. For example, try
@code{mysql --help}.
-You can override default options for all standard client programs with an
+You can override default options for all standard programs with an
option file. @ref{Option files}.
-The following list briefly describes the MySQL programs:
+The following list briefly describes the server-side MySQL programs:
@table @code
@@ -20795,24 +20929,6 @@ Makes a binary release of a compiled MySQL. This could be sent
by FTP to @file{/pub/mysql/Incoming} on @code{support.mysql.com} for the
convenience of other MySQL users.
-@cindex @code{msql2mysql}
-@item msql2mysql
-A shell script that converts @code{mSQL} programs to MySQL. It doesn't
-handle all cases, but it gives a good start when converting.
-
-@cindex @code{mysqlaccess}
-@item mysqlaccess
-A script that checks the access privileges for a host, user, and database
-combination.
-
-@cindex @code{mysqladmin}
-@item mysqladmin
-Utility for performing administrative operations, such as creating or
-dropping databases, reloading the grant tables, flushing tables to disk, and
-reopening log files. @code{mysqladmin} can also be used to retrieve version,
-process, and status information from the server.
-@xref{mysqladmin, , @code{mysqladmin}}.
-
@cindex @code{mysqlbug}
@item mysqlbug
The MySQL bug report script. This script should always be used when
@@ -20822,38 +20938,12 @@ filing a bug report to the MySQL list.
@item mysqld
The SQL daemon. This should always be running.
-@cindex @code{mysqldump}
-@item mysqldump
-Dumps a MySQL database into a file as SQL statements or
-as tab-separated text files. Enhanced freeware originally by Igor Romanenko.
-@xref{mysqldump, , @code{mysqldump}}.
-
-@cindex @code{mysqlimport}
-@item mysqlimport
-Imports text files into their respective tables using @code{LOAD DATA
-INFILE}. @xref{mysqlimport, , @code{mysqlimport}}.
-
-@cindex @code{mysqlshow}
-@item mysqlshow
-Displays information about databases, tables, columns, and indexes.
-
@cindex @code{mysql_install_db}
@item mysql_install_db
Creates the MySQL grant tables with default privileges. This is
usually executed only once, when first installing MySQL
on a system.
-@cindex @code{replace}
-@item replace
-A utility program that is used by @code{msql2mysql}, but that has more
-general applicability as well. @code{replace} changes strings in place in
-files or on the standard input. Uses a finite state machine to match longer
-strings first. Can be used to swap strings. For example, this command
-swaps @code{a} and @code{b} in the given files:
-
-@example
-shell> replace a b b a -- file1 file2 ...
-@end example
@end table
@@ -20964,7 +21054,7 @@ edited version that you can reinstall.
@node mysqld_multi, myisampack, safe_mysqld, Server-Side Scripts
-@subsection @code{mysqld_multi}, Program for Managing Multiple MySQL Servers
+@subsection @code{mysqld_multi}, A Program for Managing Multiple MySQL Servers
@cindex tools, mysqld_multi
@cindex scripts
@@ -20972,30 +21062,43 @@ edited version that you can reinstall.
@cindex @code{mysqld_multi}
@code{mysqld_multi} is meant for managing several @code{mysqld}
-processes running in different Unix sockets and TCP/IP ports.
+processes that listen for connections on different Unix sockets and
+TCP/IP ports.
+
+The program will search for group(s) named @code{[mysqld#]} from
+@file{my.cnf} (or the file named by the @code{--config-file=...} option),
+where @code{#} can be any positive number starting from 1. This number
+is referred to in the following discussion as the option group number,
+or GNR. Group numbers distinquish option groups from one another and are
+used as arguments to @code{mysqld_multi} to specify which servers you want
+to start, stop, or obtain status for. Options listed in these groups
+should be the same as you would use in the the usual @code{[mysqld]}
+group used for starting @code{mysqld}. (See, for example, @ref{Automatic
+start}.) However, for @code{mysqld_multi}, be sure that each group
+includes options for values such as the port, socket, etc., to be used
+for each individual @code{mysqld} process.
-The program will search for group(s) named [mysqld#] from my.cnf (or the
-given --config-file=...), where # can be any positive number starting
-from 1. These groups should be the same as the usual @code{[mysqld]}
-group (e.g., options to @code{mysqld}, see the MySQL manual for detailed
-information about this group), but with those port, socket, etc. options
-that are wanted for each separate @code{mysqld} processes. The number in
-the group name has another function; it can be used for starting,
-stopping, or reporting some specific @code{mysqld} servers with this
-program. See the usage and options here for more information.
+@code{mysqld_multi} is invoked using the following syntax:
@example
Usage: mysqld_multi [OPTIONS] @{start|stop|report@} [GNR,GNR,GNR...]
or mysqld_multi [OPTIONS] @{start|stop|report@} [GNR-GNR,GNR,GNR-GNR,...]
@end example
-The GNR above means the group number. You can start, stop or report
-any GNR, or several of them at the same time. (See --example) The GNRs
-list can be comma separated or combined with a dash, of which the latter
-means that all the GNRs between GNR1-GNR2 will be affected. Without
-GNR argument all the found groups will be either started, stopped, or
-reported. Note that you must not have any white spaces in the GNR
-list. Anything after a white space is ignored.
+Each
+GNR represents an option group number. You can start, stop or report
+any GNR, or several of them at the same time. For an example of how you
+might set up an option file, use this command:
+
+@example
+shell> mysqld_multi --example
+@end example
+
+The GNR values in the list can be comma-separated or combined with a dash;
+in the latter case, all the GNRs between GNR1-GNR2 will be affected. With
+no GNR argument, all groups listed in the option file will be either
+started, stopped, or reported. Note that you must not have any white
+spaces in the GNR list. Anything after a white space is ignored.
@code{mysqld_multi} supports the following options:
@@ -21004,11 +21107,11 @@ list. Anything after a white space is ignored.
@item --config-file=...
Alternative config file. Note: This will not affect this program's own
options (group @code{[mysqld_multi]}), but only groups
-[mysqld#]. Without this option everything will be searched from the
-ordinary my.cnf file.
+@code{[mysqld#]}. Without this option, everything will be searched from the
+ordinary @file{my.cnf} file.
@cindex example option
@item --example
-Give an example of a config file.
+Display an example option file.
@cindex help option
@item --help
Print this help and exit.
@@ -21037,7 +21140,7 @@ Password for user for @code{mysqladmin}.
Connect to the MySQL server(s) via the TCP/IP port instead of
the Unix socket. This affects stopping and reporting. If a socket file
is missing, the server may still be running, but can be accessed only
-via the TCP/IP port. By default connecting is done via the Unix socket.
+via the TCP/IP port. By default, connections are made using the Unix socket.
@cindex user option
@item --user=...
MySQL user for @code{mysqladmin}.
@@ -21051,41 +21154,43 @@ Some notes about @code{mysqld_multi}:
@itemize @bullet
@item
Make sure that the MySQL user, who is stopping the
-@code{mysqld} services (e.g using the @code{mysqladmin}) have the same
+@code{mysqld} services (e.g using the @code{mysqladmin} program) have the same
password and username for all the data directories accessed (to the
-'mysql' database) And make sure that the user has the 'Shutdown_priv'
-privilege! If you have many data- directories and many different 'mysql'
-databases with different passwords for the MySQL 'root' user,
-you may want to create a common 'multi_admin' user for each using the
+@code{mysql} database) And make sure that the user has the @code{SHUTDOWN}
+privilege! If you have many data directories and many different @code{mysql}
+databases with different passwords for the MySQL @code{root} user,
+you may want to create a common @code{multi_admin} user for each using the
same password (see below). Example how to do it:
@example
shell> mysql -u root -S /tmp/mysql.sock -proot_password -e
"GRANT SHUTDOWN ON *.* TO multi_admin@@localhost IDENTIFIED BY 'multipass'"
-@xref{Privileges}.
@end example
+@xref{Privileges}.
You will have to do the above for each @code{mysqld} running in each
-data directory, that you have (just change the socket, -S=...).
+data directory, that you have (just change the socket, @code{-S=...}).
@item
@code{pid-file} is very important, if you are using @code{safe_mysqld}
-to start @code{mysqld} (e.g., @code{--mysqld=safe_mysqld}) Every @code{mysqld}
-should have its own @code{pid-file}. The advantage using
-@code{safe_mysqld} instead of @code{mysqld} directly here is, that
-@code{safe_mysqld} 'guards' every @code{mysqld} process and will restart
-it, if a @code{mysqld} process fails due to signal kill -9, or
-similar. (Like segmentation fault, which MySQL should never do,
-of course ;) Please note that @code{safe_mysqld} script may require that
-you start it from a certain place. This means that you may have to @code{cd} to
-a certain directory, before you start the @code{mysqld_multi}. If
-you have problems starting, please see the @code{safe_mysqld}
-script. Check especially the lines:
+to start @code{mysqld} (e.g., @code{--mysqld=safe_mysqld}) Every
+@code{mysqld} should have its own @code{pid-file}. The advantage
+using @code{safe_mysqld} instead of @code{mysqld} directly here is,
+that @code{safe_mysqld} ``guards'' every @code{mysqld} process and will
+restart it, if a @code{mysqld} process terminates due to a signal
+sent using @code{kill -9}, or for other reasons such as a segmentation
+fault (which MySQL should never do, of course ;). Please note that the
+@code{safe_mysqld} script may require that you start it from a certain
+place. This means that you may have to @code{cd} to a certain directory,
+before you start the @code{mysqld_multi}. If you have problems starting,
+please see the @code{safe_mysqld} script. Check especially the lines:
+
@example
--------------------------------------------------------------------------
MY_PWD=`pwd` Check if we are starting this relative (for the binary
release) if test -d /data/mysql -a -f ./share/mysql/english/errmsg.sys
-a -x ./bin/mysqld
--------------------------------------------------------------------------
-@xref{safe_mysqld, , @code{safe_mysqld}}.
@end example
+
+@xref{safe_mysqld, , @code{safe_mysqld}}.
The above test should be successful, or you may encounter problems.
@item
Beware of the dangers starting multiple @code{mysqld}s in the same data
@@ -21100,11 +21205,12 @@ more flexibility. The order in which the @code{mysqlds} are started or
stopped depends on the order in which they appear in the config file.
@item
When you want to refer to a certain group using GNR with this program,
-just use the number in the end of the group name ([mysqld# <== ).
+just use the number in the end of the group name.
+For example, the GNR for a group named @code{[mysqld17]} is 17.
@item
-You may want to use option '--user' for @code{mysqld}, but in order to
-do this you need to be root when you start the @code{mysqld_multi}
-script. Having the option in the config file doesn't matter; you will
+You may want to use option @code{--user} for @code{mysqld}, but in order to
+do this you need to run the @code{mysqld_multi} script as the Unix @code{root}
+user. Having the option in the config file doesn't matter; you will
just get a warning, if you are not the superuser and the @code{mysqlds}
are started under @strong{your} Unix account. @strong{Important}: Make
sure that the @code{pid-file} and the data directory are
@@ -21268,8 +21374,8 @@ Display version information and exit.
@item -w, --wait
Wait and retry if table is in use. If the @code{mysqld} server was
-invoked with the @code{--skip-locking} option, it is not a good idea to
-invoke @code{myisampack} if the table might be updated during the
+invoked with the @code{--skip-external-locking} option, it is not a good idea
+to invoke @code{myisampack} if the table might be updated during the
packing process.
@end table
@@ -21613,7 +21719,7 @@ To get better performance for BDB tables, you should add some configuration
options for these too. @xref{BDB start}.
@code{safe_mysqld} will automatically try to start any @code{mysqld} binary
-with the @code{-max} prefix. This makes it very easy to test out a
+with the @code{-max} suffix. This makes it very easy to test out a
another @code{mysqld} binary in an existing installation. Just
run @code{configure} with the options you want and then install the
new @code{mysqld} binary as @code{mysqld-max} in the same directory
@@ -21624,7 +21730,7 @@ feature. It just installs the @code{mysqld-max} executable and
@code{safe_mysqld} will automatically use this executable when
@code{safe_mysqld} is restarted.
-The following table shows which table types our standard @strong{MySQL-Max}
+The following table shows which table types our standard MySQL-Max
binaries includes:
@multitable @columnfractions .15 .10 .10
@@ -21708,22 +21814,10 @@ to get a full description of the program's different options. For example, try
You can override default options for all standard client programs with an
option file. @ref{Option files}.
-The following list briefly describes the MySQL programs:
+The following list briefly describes the client-side MySQL programs:
@table @code
-@cindex @code{myisamchk}
-@item myisamchk
-Utility to describe, check, optimise, and repair MySQL tables.
-Because @code{myisamchk} has many functions, it is described in its own
-chapter. @xref{MySQL Database Administration}.
-
-@cindex @code{make_binary_distribution}
-@item make_binary_distribution
-Makes a binary release of a compiled MySQL. This could be sent
-by FTP to @file{/pub/mysql/Incoming} on @code{support.mysql.com} for the
-convenience of other MySQL users.
-
@cindex @code{msql2mysql}
@item msql2mysql
A shell script that converts @code{mSQL} programs to MySQL. It doesn't
@@ -21742,15 +21836,6 @@ reopening log files. @code{mysqladmin} can also be used to retrieve version,
process, and status information from the server.
@xref{mysqladmin, , @code{mysqladmin}}.
-@cindex @code{mysqlbug}
-@item mysqlbug
-The MySQL bug report script. This script should always be used when
-filing a bug report to the MySQL list.
-
-@cindex @code{mysqld}
-@item mysqld
-The SQL daemon. This should always be running.
-
@cindex @code{mysqldump}
@item mysqldump
Dumps a MySQL database into a file as SQL statements or
@@ -21766,12 +21851,6 @@ INFILE}. @xref{mysqlimport, , @code{mysqlimport}}.
@item mysqlshow
Displays information about databases, tables, columns, and indexes.
-@cindex @code{mysql_install_db}
-@item mysql_install_db
-Creates the MySQL grant tables with default privileges. This is
-usually executed only once, when first installing MySQL
-on a system.
-
@cindex @code{replace}
@item replace
A utility program that is used by @code{msql2mysql}, but that has more
@@ -22091,7 +22170,7 @@ UPDATE table_name SET not_key_column=# WHERE not_key_column=# LIMIT 1;
@item
All big results are automatically limited to @code{#select_limit#} rows.
@item
-@code{SELECT}'s that will probably need to examine more than
+@code{SELECT}s that will probably need to examine more than
@code{#max_join_size} row combinations will be aborted.
@end itemize
@@ -22127,8 +22206,6 @@ Monty
1 row in set (0.09 sec)
@end example
-@itemize @bullet
-@item
For logging, you can use the @code{tee} option. The @code{tee} can be
started with option @code{--tee=...}, or from the command-line
interactively with command @code{tee}. All the data displayed on the
@@ -22140,7 +22217,6 @@ used. Note that @code{tee} will flush the results into the file after
each command, just before the command-line appears again waiting for the
next command.
-@item
Browsing, or searching the results in the interactive mode in Unix less,
more, or any other similar program, is now possible with option
@code{--pager[=...]}. Without argument, @code{mysql} client will look
@@ -22155,8 +22231,10 @@ the popen() function, which doesn't exist in Windows. In Windows, the
@code{tee} option can be used instead, although it may not be as handy
as @code{pager} can be in some situations.
+A few tips about @code{pager}:
+@itemize @bullet
@item
-A few tips about @code{pager}: You can use it to write to a file:
+You can use it to write to a file:
@example
mysql> pager cat > /tmp/log.txt
@end example
@@ -22165,6 +22243,8 @@ for the programs that you want to use with the @code{pager}:
@example
mysql> pager less -n -i -S
@end example
+
+@item
From the above do note the option '-S'. You may find it very useful when
browsing the results; try the option with horizontal output (end
commands with '\g', or ';') and with vertical output (end commands with
@@ -22176,8 +22256,7 @@ readable. You can swith the mode between on and off within the interactive
less with '-S'. See the 'h' for more help about less.
@item
-Last (unless you already understood this from the above examples ;) you
-can combine very complex ways to handle the results, for example the
+You can combine very complex ways to handle the results, for example the
following would send the results to two files in two different
directories, on two different hard-disks mounted on /dr1 and /dr2, yet
let the results still be seen on the screen via less:
@@ -22186,7 +22265,8 @@ mysql> pager cat | tee /dr1/tmp/res.txt | \
tee /dr2/tmp/res2.txt | less -n -i -S
@end example
-@item
+@end itemize
+
You can also combine the two functions above; have the @code{tee}
enabled, @code{pager} set to 'less' and you will be able to browse the
results in unix 'less' and still have everything appended into a file
@@ -22198,10 +22278,10 @@ on the screen, where the Unix @code{tee} used with @code{pager} doesn't
log quite that much. Last, but not least, the interactive @code{tee} is
more handy to switch on and off, when you want to log something into a
file, but want to be able to turn the feature off sometimes.
-@end itemize
@cindex @code{prompt} command
-You can change the prompt in the @code{mysql} command-line client.
+From MySQL version 4.0.2 it is possible to change the prompt in the
+@code{mysql} command-line client.
You can use the following prompt options:
@c FIX these columnfractions have NOT been measured!
@@ -22286,7 +22366,7 @@ mysql>
@cindex administration, server
@cindex server administration
-@cindex @code{mysladmn}
+@cindex @code{mysqladmin}
A utility for performing administrative operations. The syntax is:
@@ -22398,7 +22478,7 @@ The @code{mysqladmin status} command result has the following columns:
@item Max memory used @tab Maximum memory allocated directly by the @code{mysqld} code (only available when MySQL is compiled with --with-debug=full).
@end multitable
-If you do @code{myslqadmin shutdown} on a socket (in other words, on a
+If you do @code{mysqladmin shutdown} on a socket (in other words, on a
the computer where @code{mysqld} is running), @code{mysqladmin} will
wait until the MySQL @code{pid-file} is removed to ensure that
the @code{mysqld} server has stopped properly.
@@ -22430,7 +22510,7 @@ So it can be used in a similar way as @code{mysqldump} when it
comes to what databases and tables you want to choose.
@code{mysqlcheck} does have a special feature compared to the other
-clients; the default behavior, checking tables (-c), can be changed by
+clients; the default behaviour, checking tables (-c), can be changed by
renaming the binary. So if you want to have a tool that repairs tables
by default, you should just copy @code{mysqlcheck} to your harddrive
with a new name, @code{mysqlrepair}, or alternatively make a symbolic
@@ -22438,7 +22518,7 @@ link to @code{mysqlrepair} and name the symbolic link as
@code{mysqlrepair}. If you invoke @code{mysqlrepair} now, it will repair
tables by default.
-The names that you can use to change @code{mysqlcheck} default behavior
+The names that you can use to change @code{mysqlcheck} default behaviour
are here:
@example
@@ -22619,6 +22699,12 @@ is @code{localhost}.
Lock all tables before starting the dump. The tables are locked with
@code{READ LOCAL} to allow concurrent inserts in the case of @code{MyISAM}
tables.
+
+Please note that when dumping multiple databases, @code{--lock-tables}
+will lock tables for each database separately. So using this option will
+not guarantee your tables will be logically consistent between databases.
+Tables in different databases may be dumped in completely different
+states.
@item -K, --disable-keys
@code{/*!40000 ALTER TABLE tb_name DISABLE KEYS */;} and
@code{/*!40000 ALTER TABLE tb_name ENABLE KEYS */;}
@@ -22626,8 +22712,8 @@ will be put in the output. This will make loading the data into a MySQL
4.0 server faster as the indexes are created after all data are inserted.
@item -n, --no-create-db
@code{CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;} will not be put in the
-output. The above line will be added otherwise, if --databases or
---all-databases option was given.
+output. The above line will be added otherwise, if a @code{--databases} or
+@code{--all-databases} option was given.
@item -t, --no-create-info
Don't write table creation information (the @code{CREATE TABLE} statement).
@item -d, --no-data
@@ -22652,8 +22738,23 @@ to do this.
Quote table and column names within @samp{`} characters.
@item -r, --result-file=...
Direct output to a given file. This option should be used in MSDOS,
-because it prevents new line '\n' from being converted to '\n\r' (new
-line + carriage return).
+because it prevents new line @samp{\n} from being converted to @samp{\n\r}
+(new line + carriage return).
+@item --single-transaction
+This option issues a @code{BEGIN} SQL command before dumping data from
+server. It is mostly useful with @code{InnoDB} tables and
+@code{READ_COMMITTED} transaction isolation level, as in this mode it
+will dump the consistent state of the database at the time then
+@code{BEGIN} was issued without blocking any applications.
+
+When using this option you should keep in mind that only transactional
+tables will be dumped in a consistent state, e.g., any @code{MyISAM} or
+@code{HEAP} tables dumped while using this option may still change
+state.
+
+The @code{--single-transaction} option was added in version 4.0.2.
+This option is mutually exclusive with the @code{--lock-tables} option
+as @code{LOCK TABLES} cancels a previous transaction.
@item -S /path/to/socket, --socket=/path/to/socket
The socket file to use when connecting to @code{localhost} (which is the
default host).
@@ -22745,8 +22846,8 @@ mysqldump --all-databases > all_databases.sql
@code{mysqlhotcopy} is a Perl script that uses @code{LOCK TABLES},
@code{FLUSH TABLES} and @code{cp} or @code{scp} to quickly make a backup
-of a database. It's the fastest way to make a backup of the database,
-of single tables but it can only be run on the same machine where the
+of a database. It's the fastest way to make a backup of the database
+or single tables, but it can only be run on the same machine where the
database directories are.
@example
@@ -22797,15 +22898,15 @@ Flush logs once all tables are locked.
Temporary directory (instead of /tmp).
@end table
-You can use @code{perldoc mysqlhotcopy} to get a more complete
+You can use @code{perldoc mysqlhotcopy} to get more complete
documentation for @code{mysqlhotcopy}.
@code{mysqlhotcopy} reads the groups @code{[client]} and @code{[mysqlhotcopy]}
from the option files.
To be able to execute @code{mysqlhotcopy} you need write access to the
-backup directory, the @strong{select} privilege for the tables you are about to
-copy and the MySQL @strong{reload} privilege (to be able to
+backup directory, the @code{SELECT} privilege for the tables you are about to
+copy and the MySQL @code{RELOAD} privilege (to be able to
execute @code{FLUSH TABLES}).
@@ -23130,11 +23231,13 @@ to the log file (by default named @file{'hostname'.log}). This log can
be very useful when you suspect an error in a client and want to know
exactly what @code{mysqld} thought the client sent to it.
-By default, the @code{mysql.server} script starts the MySQL
-server with the @code{-l} option. If you need better performance when
-you start using MySQL in a production environment, you can
-remove the @code{-l} option from @code{mysql.server} or change it to
-@code{--log-bin}.
+@c Note: this instance of "safe_mysql" should not be changed to "mysqld_safe"
+@c because it's a 3.23.x-specific command
+Older versions of the @code{mysql.server} script (from MySQL 3.23.4 to 3.23.8)
+pass @code{safe_mysqld} a @code{--log} option (enable general query log).
+If you need better performance when you start using MySQL in a production
+environment, you can remove the @code{--log} option from @code{mysql.server}
+or change it to @code{--log-bin}. @xref{Binary log}.
The entries in this log are written as @code{mysqld} receives the queries.
This may be different from the order in which the statements are executed.
@@ -23213,7 +23316,9 @@ we recommend you to switch to this log format as soon as possible.
The binary log contains all information that is available in the update
log in a more efficient format. It also contains information about how long
-every query that updated the database took.
+each query took that updated the database. It doesn't contain queries that
+don't modify any data. If you want to log all queries (for example to
+find a problem query) you should use the general query log. @xref{Query log}.
The binary log is also used when you are replicating a slave from a master.
@xref{Replication}.
@@ -23258,12 +23363,13 @@ files until you are sure that no slave will ever need to use them.
One way to do this is to do @code{mysqladmin flush-logs} once a day and then
remove any logs that are more than 3 days old.
+@cindex @code{mysqlbinlog}
You can examine the binary log file with the @code{mysqlbinlog} command.
For example, you can update a MySQL server from the binary log
as follows:
@example
-mysqlbinlog log-file | mysql -h server_name
+shell> mysqlbinlog log-file | mysql -h server_name
@end example
You can also use the @code{mysqlbinlog} program to read the binary log
@@ -23288,10 +23394,10 @@ this, the thread will open a temporary file to handle the bigger cache.
The temporary file will be deleted when the thread ends.
The @code{max_binlog_cache_size} can be used to restrict the total size used
-to cache a multi-transaction query.
+to cache a multi-query transaction.
If you are using the update or binary log, concurrent inserts will
-not work together with @code{CREATE ... INSERT} and @code{INSERT ... SELECT}.
+not work together with @code{CREATE ... SELECT} and @code{INSERT ... SELECT}.
This is to ensure that you can recreate an exact copy of your tables by
applying the log on a backup.
@@ -23453,16 +23559,27 @@ logging on the master. If you start your slaves with data that doesn't
agree with what was on the master @strong{when the binary log was
started}, your slaves may fail.
-Starting in 4.0.0, one can use @code{LOAD DATA FROM MASTER} to set up
-a slave. Note that 4.0.0 slaves cannot communicate with 3.23 masters, but 4.0.1
-and later version slaves can. 3.23 slave cannot talk to 4.0 master.
+Please see the following table for an indication of master-slave
+compatibility between different versions. With regard to version 4.0,
+we recommend using same version on both sides.
+
+@c FIX arjen 2002-07-17 new table, not yet measured for XML/DocBook.
+@multitable @columnfractions .10 .15 .15 .10 .10 .10
+@item @tab @tab @strong{Master} @tab @strong{Master} @tab @strong{Master} @tab @strong{Master}
+@item @tab @tab @strong{3.23.33 and up} @tab @strong{4.0.0} @tab @strong{4.0.1} @tab @strong{4.0.2}
+@item @strong{Slave} @tab @strong{3.23.33 and up} @tab yes @tab no @tab no @tab no
+@item @strong{Slave} @tab @strong{4.0.0} @tab no @tab yes @tab no @tab no
+@item @strong{Slave} @tab @strong{4.0.1} @tab yes @tab no @tab yes @tab no
+@item @strong{Slave} @tab @strong{4.0.2} @tab yes @tab no @tab no @tab yes
+@end multitable
-You must also be aware that @code{LOAD DATA FROM MASTER} currently works only
-if all the tables on the master are @code{MyISAM} type, and will acuire a
+Starting from 4.0.0, one can use @code{LOAD DATA FROM MASTER} to set up
+a slave. Be aware that @code{LOAD DATA FROM MASTER} currently works only
+if all the tables on the master are @code{MyISAM} type, and will acquire a
global read lock, so no writes are possible while the tables are being
transferred from the master. This limitation is of a temporary nature, and is
due to the fact that we have not yet implemented hot lock-free table backup.
-It will be removed in the future 4.0 branch versions once we implemented hot
+It will be removed in the future 4.0 branch versions once we implement hot
backup enabling @code{LOAD DATA FROM MASTER} to work without blocking master
updates.
@@ -23524,9 +23641,10 @@ in the latest release.
@item
Set up special a replication user on the master with the @code{FILE}
-privilege and permission to connect from all the slaves. If the user is
-only doing replication (which is recommended), you don't need to grant any
-additional privileges.
+(in MySQL versions older than 4.0.2) or @code{REPLICATION SLAVE}
+privilege in newer MySQL versions. You must also have given permission
+to connect from all the slaves. If the user is only doing replication
+(which is recommended), you don't need to grant any additional privileges.
For example, to create a user named @code{repl} which can access your
master from any host, you might use this command:
@@ -23650,8 +23768,8 @@ argument to @code{RAND()}.
@item
You have to use the same character set (@code{--default-character-set})
on the master and the slave. If not, you may get duplicate key errors on
-the slave, because a key that is regarded as unique on the master may
-not be that in the other character set.
+the slave, because a key that is regarded as unique in the master character
+set may not be unique in the slave character set.
@item
In 3.23, @code{LOAD DATA INFILE} will be handled properly as long as the file
still resides on the master server at the time of update
@@ -23741,8 +23859,9 @@ a database that was excluded from replication.
@item
Starting in Version 3.23.16, @code{SET SQL_LOG_BIN = 0} will turn off
replication (binary) logging on the master, and @code{SET SQL_LOG_BIN =
-1} will turn it back on -- you must have the @strong{process} privilege to do
-this.
+1} will turn it back on -- you must have the @code{SUPER} (in MySQL
+4.0.2 and above) or @code{PROCESS} (in older MySQL versions) privilege
+to do this.
@item
Starting in Version 3.23.19, you can clean up stale replication leftovers when
something goes wrong and you want a clean start with @code{FLUSH MASTER}
@@ -23763,7 +23882,8 @@ the slave to apply updates from one database on the master to the one
with a different name on the slave.
@item
Starting in Version 3.23.28, you can use @code{PURGE MASTER LOGS TO 'log-name'}
-to get rid of old logs while the slave is running.
+to get rid of old logs while the slave is running. This will remove all old
+logs before, but not including @code{'log-name'}.
@item
Due to the non-transactional nature of MyISAM tables, it is possible to have
a query that will only partially update a table and return an error code. This
@@ -23796,7 +23916,6 @@ above bugs are conceptually very simple to fix, we have not yet found a way
to do this without a sigficant code change that would compromize the stability
status of 3.23 branch. There exists a workaround for both if in the rare case
it happens to affect your application -- use @code{slave-skip-errors}.
-
@end itemize
@@ -23818,7 +23937,7 @@ case there is a problem your mission critical applications will not be
disrupted.
On both master and slave you need to use the @code{server-id} option.
-This sets an unique replication id. You should pick a unique value in the
+This sets a unique replication id. You should pick a unique value in the
range between 1 to 2^32-1 for each master and slave.
Example: @code{server-id=3}
@@ -23883,7 +24002,7 @@ Example: @code{master-host=db-master.mycompany.com}
@item @code{master-user=username} @tab
The username the slave thread will use for authentication when connecting to
-the master. The user must have the @strong{file} privilege. If the master user
+the master. The user must have the @code{FILE} privilege. If the master user
is not set, user @code{test} is assumed. The value in @file{master.info} will
take precedence if it can be read.
@@ -23963,25 +24082,26 @@ contrast to @code{replicate-do-db}.
Example: @code{replicate-do-table=some_db.some_table}
@item @code{replicate-ignore-table=db_name.table_name} @tab
-Tells the slave thread to not replicate to the specified table. To
-specify more than one table to ignore, use the directive multiple times,
-once for each table. This will work for cross-datbase updates,
-in contrast to @code{replicate-ignore-db}.
+Tells the slave thread to not replicate any command that updates the
+specified table (even if any other tables may be update by the same
+command). To specify more than one table to ignore, use the directive
+multiple times, once for each table. This will work for cross-datbase
+updates, in contrast to @code{replicate-ignore-db}.
Example: @code{replicate-ignore-table=db_name.some_table}
@item @code{replicate-wild-do-table=db_name.table_name} @tab
-Tells the slave thread to restrict replication to the tables that match
-the specified wildcard pattern. To specify more than one table, use the
-directive multiple times, once for each table. This will work for
-cross-database updates.
+Tells the slave thread to restrict replication to queries where any of
+the updated tables match the specified wildcard pattern. To specify
+more than one table, use the directive multiple times, once for each
+table. This will work for cross-database updates.
-Example: @code{replicate-wild-do-table=foo%.bar%} will replicate only updates
-to tables in all databases that start with @code{foo} and whose table names
-start with @code{bar}.
+Example: @code{replicate-wild-do-table=foo%.bar%} will replicate only
+updates that uses a table in any databases that start with @code{foo}
+and whose table names start with @code{bar}.
@item @code{replicate-wild-ignore-table=db_name.table_name} @tab
-Tells the slave thread to not replicate to the tables that match the
+Tells the slave thread to not replicate a query whare any table matches the
given wildcard pattern. To specify more than one table to ignore, use
the directive multiple times, once for each table. This will work for
cross-database updates.
@@ -23991,21 +24111,32 @@ to tables in databases that start with @code{foo} and whose table names start
with @code{bar}.
@item @code{replicate-ignore-db=database_name} @tab
-Tells the slave thread to not replicate to the specified database. To
-specify more than one database to ignore, use the directive multiple
-times, once for each database. This option will not work if you use cross
-database updates. If you need cross database updates to work, make sure
-you have 3.23.28 or later, and use
-@code{replicate-wild-ignore-table=db_name.%}.
+
+Tells the slave thread to not replicate any command where the current
+database is @code{database_name}. To specify more than one database to
+ignore, use the directive multiple times, once for each database.
+You should not use this directive if you are using cross table updates
+and you don't want these update to be replicated.
+
+The main reason for this behavior is that it's hard from the command
+alone know if a query should be replicated or not; For example if you
+are using multi-table-delete or multi-table-update commands in MySQL 4.x
+that goes across multiple databases. It's also very fast to just check
+the current database, as this only has to be done once at connect time
+or when the database changes.
+
+If you need cross database updates to work, make sure you have 3.23.28
+or later, and use @code{replicate-wild-ignore-table=db_name.%}.
Example: @code{replicate-ignore-db=some_db}
@item @code{replicate-do-db=database_name} @tab
-Tells the slave thread to restrict replication to the specified
-database. To specify more than one database, use the directive multiple
-times, once for each database. Note that this will only work if you do
-not use cross-database queries such as @code{UPDATE some_db.some_table
+Tells the slave thread to restrict replication to commands where
+the current database is @code{database_name}.
+To specify more than one database, use the directive multiple
+times, once for each database. Note that this will not replicate
+cross-database queries such as @code{UPDATE some_db.some_table
SET foo='bar'} while having selected a different or no database. If you
need cross database updates to work, make sure you have 3.23.28 or
later, and use @code{replicate-wild-do-table=db_name.%}.
@@ -24054,6 +24185,10 @@ Example:
Tells the slave server not to start the slave on the startup. The user
can start it later with @code{SLAVE START}.
+@item @code{slave_compressed_protocol=#} @tab
+If 1, then use compression on the slave/client protocol if both
+slave and master support this.
+
@item @code{slave_net_timeout=#} @tab
Number of seconds to wait for more data from the master before aborting
the read.
@@ -24080,14 +24215,14 @@ summary of commands:
@tab Stops the slave thread. (Slave)
@item @code{SET SQL_LOG_BIN=0}
- @tab Disables update logging if the user has the @strong{process} privilege.
+@tab Disables update logging if the user has the @code{SUPER} privilege.
Ignored otherwise. (Master)
@item @code{SET SQL_LOG_BIN=1}
- @tab Re-enables update logging if the user has the @strong{process} privilege.
+ @tab Re-enables update logging if the user has the @code{SUPER} privilege.
Ignored otherwise. (Master)
-@item @code{SET SQL_SLAVE_SKIP_COUNTER=n}
+@item @code{GLOBAL SET SQL_SLAVE_SKIP_COUNTER=n}
@tab Skip the next @code{n} events from the master. Only valid when
the slave thread is not running, otherwise, gives an error. Useful for
recovering from replication glitches.
@@ -24392,7 +24527,7 @@ offset by network delays.
writes to it, and configure as many slaves as you have the money and
rackspace for, distributing the reads among the master and the slaves.
You can also start the slaves with @code{--skip-bdb},
-@code{--low-priority-updates} and @code{--delay-key-write-for-all-tables}
+@code{--low-priority-updates} and @code{--delay-key-write=ALL}
to get speed improvements for the slave. In this case the slave will
use non-transactional @code{MyISAM} tables instead of @code{BDB} tables
to get more speed.
@@ -24593,9 +24728,9 @@ be safe to make the update manually ( if needed) and then ignore the next
query from the master.
@item
If you have decided you can skip the next query, do
-@code{SET SQL_SLAVE_SKIP_COUNTER=1; SLAVE START;} to skip a query that
+@code{SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; SLAVE START;} to skip a query that
does not use @code{AUTO_INCREMENT} or @code{LAST_INSERT_ID()}, or
-@code{SET SQL_SLAVE_SKIP_COUNTER=2; SLAVE START;} otherwise. The reason
+@code{SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SLAVE START;} otherwise. The reason
queries that use @code{AUTO_INCREMENT} or @code{LAST_INSERT_ID()}
are different is that they take two events in the binary log of the master.
@@ -24806,7 +24941,7 @@ application that is fast with many databases it becomes even harder!
To make a complex application portable you need to choose a number of
SQL servers that it should work with.
-You can use the MySQL crash-me program/web-page
+You can use the MySQL @code{crash-me} program/web-page
@uref{http://www.mysql.com/information/crash-me.php} to find functions,
types, and limits you can use with a selection of database
servers. Crash-me now tests far from everything possible, but it
@@ -24815,7 +24950,7 @@ is still comprehensive with about 450 things tested.
For example, you shouldn't have column names longer than 18 characters
if you want to be able to use Informix or DB2.
-Both the MySQL benchmarks and crash-me programs are very
+Both the MySQL benchmarks and @code{crash-me} programs are very
database-independent. By taking a look at how we have handled this, you
can get a feeling for what you have to do to write your application
database-independent. The benchmarks themselves can be found in the
@@ -24828,7 +24963,7 @@ from this benchmark.
As you can see in these results, all databases have some weak points. That
is, they have different design compromises that lead to different
-behavior.
+behaviour.
If you strive for database independence, you need to get a good feeling
for each SQL server's bottlenecks. MySQL is very fast in
@@ -25016,7 +25151,7 @@ How big a query can be
How big a @code{VARCHAR} column can be
@end itemize
-We can find the result from crash-me on a lot of different databases at
+We can find the result from @code{crash-me} on a lot of different databases at
@uref{http://www.mysql.com/information/crash-me.php}.
@@ -25497,11 +25632,11 @@ where to place the new index and normally 2 seeks to update the index
and write the row.
Note that the above doesn't mean that your application will slowly
-degenerate by N log N! As long as everything is cached by the OS or SQL
+degenerate by log N! As long as everything is cached by the OS or SQL
server things will only go marginally slower while the table gets
bigger. After the data gets too big to be cached, things will start to
go much slower until your applications is only bound by disk-seeks
-(which increase by N log N). To avoid this, increase the index cache as
+(which increase by log N). To avoid this, increase the index cache as
the data grows. @xref{Server parameters}.
@@ -25861,7 +25996,7 @@ the sort-key) is written to a result file.
@item
Now the code in @file{sql/records.cc} will be used to read through them
in sorted order by using the row pointers in the result file. To
-optimize this, we read in a big block of row pointers, sort these and
+optimise this, we read in a big block of row pointers, sort these and
then we read the rows in the sorted order into a row buffer
(@code{record_rnd_buffer}) .
@end itemize
@@ -25910,7 +26045,7 @@ as soon as it finds @code{#} unique rows.
In some cases a @code{GROUP BY} can be resolved by reading the key in order
(or do a sort on the key) and then calculate summaries until the
key value changes. In this case @code{LIMIT #} will not calculate any
-unnecessary @code{GROUP BY}'s.
+unnecessary @code{GROUP BY}s.
@item
As soon as MySQL has sent the first @code{#} rows to the client, it
will abort the query (If you are not using @code{SQL_CALC_FOUND_ROWS}).
@@ -25952,7 +26087,7 @@ where the numbers are somewhat proportional to the overall time. This
does not take into consideration the initial overhead to open tables
(which is done once for each concurrently running query).
-The size of the table slows down the insertion of indexes by N log N
+The size of the table slows down the insertion of indexes by log N
(B-trees).
Some ways to speed up inserts:
@@ -25962,7 +26097,7 @@ Some ways to speed up inserts:
If you are inserting many rows from the same client at the same time, use
multiple value lists @code{INSERT} statements. This is much faster (many times
in some cases) than using separate @code{INSERT} statements. If you are adding
-data to non-empty table, you may tune up @code{myisam_bulk_insert_tree_size}
+data to non-empty table, you may tune up @code{bulk_insert_buffer_size}
variable to make it even faster. @xref{SHOW VARIABLES}.
@item
If you are inserting a lot of rows from different clients, you can get
@@ -26011,7 +26146,7 @@ Execute a @code{FLUSH TABLES} statement or the shell command @code{mysqladmin
flush-tables}.
@end enumerate
-Note that @code{LOAD DATA INFILE} also does the above optimization if
+Note that @code{LOAD DATA INFILE} also does the above optimisation if
you insert into an empty table; the main difference with the above
procedure is that you can let myisamchk allocate much more temporary
memory for the index creation that you may want MySQL to allocate for
@@ -26447,8 +26582,8 @@ Start @code{mysqld} with a low value for @strong{max_write_lock_count} to give
@item
You can specify that all updates from a specific thread should be done with
-low priority by using the SQL command: @code{SET SQL_LOW_PRIORITY_UPDATES=1}.
-@xref{SET OPTION, , @code{SET OPTION}}.
+low priority by using the SQL command: @code{SET LOW_PRIORITY_UPDATES=1}.
+@xref{SET OPTION, , @code{SET}}.
@item
You can specify that a specific @code{SELECT} is very important with the
@@ -26720,7 +26855,7 @@ In the first statement, the @code{LIKE} value begins with a wildcard
character. In the second statement, the @code{LIKE} value is not a
constant.
-MySQL 4.0 does another optimization on @code{LIKE}. If you use
+MySQL 4.0 does another optimisation on @code{LIKE}. If you use
@code{... LIKE "%string%"} and @code{string} is longer than 3 characters,
MySQL will use the @code{Turbo Boyer-Moore} algorithm to initialise the
pattern for the string and then use this pattern to perform the search
@@ -26764,7 +26899,7 @@ would be available. Some of the cases where this happens are:
@itemize @bullet
@item
If the use of the index would require MySQL to access more
-than 30 % of the rows in the table. (In this case a table scan is
+than 30% of the rows in the table. (In this case a table scan is
probably much faster, as this will require us to do much fewer seeks.)
Note that if such a query uses @code{LIMIT} to only retrieve
part of the rows, MySQL will use an index anyway, as it can
@@ -27056,25 +27191,25 @@ If you have enough RAM, you could remove all swap devices. Some
operating systems will use a swap device in some contexts even if you
have free memory.
@item
-Use the @code{--skip-locking} MySQL option to avoid external
+Use the @code{--skip-external-locking} MySQL option to avoid external
locking. Note that this will not impact MySQL's functionality as
long as you only run one server. Just remember to take down the server (or
lock relevant parts) before you run @code{myisamchk}. On some system
this switch is mandatory because the external locking does not work in any
case.
-The @code{--skip-locking} option is on by default when compiling with
+The @code{--skip-external-locking} option is on by default when compiling with
MIT-pthreads, because @code{flock()} isn't fully supported by
MIT-pthreads on all platforms. It's also on default for Linux
as Linux file locking are not yet safe.
-The only case when you can't use @code{--skip-locking} is if you run
+The only case when you can't use @code{--skip-external-locking} is if you run
multiple MySQL @emph{servers} (not clients) on the same data,
or run @code{myisamchk} on the table without first flushing and locking
the @code{mysqld} server tables first.
You can still use @code{LOCK TABLES}/@code{UNLOCK TABLES} even if you
-are using @code{--skip-locking}
+are using @code{--skip-external-locking}
@end itemize
@@ -27129,9 +27264,8 @@ net_buffer_length current value: 16384
net_retry_count current value: 10
net_read_timeout current value: 30
net_write_timeout current value: 60
-query_buffer_size current value: 0
-record_buffer current value: 131072
-record_rnd_buffer current value: 131072
+read_buffer_size current value: 131072
+record_rnd_buffer_size current value: 131072
slow_launch_time current value: 2
sort_buffer current value: 2097116
table_cache current value: 64
@@ -27168,7 +27302,7 @@ with a moderate number of clients, you should use something like this:
@example
shell> safe_mysqld -O key_buffer=64M -O table_cache=256 \
- -O sort_buffer=4M -O record_buffer=1M &
+ -O sort_buffer=4M -O read_buffer_size=1M &
@end example
If you have only 128M and only a few tables, but you still do a lot of
@@ -27182,14 +27316,14 @@ If you have little memory and lots of connections, use something like this:
@example
shell> safe_mysqld -O key_buffer=512k -O sort_buffer=100k \
- -O record_buffer=100k &
+ -O read_buffer_size=100k &
@end example
or even:
@example
shell> safe_mysqld -O key_buffer=512k -O sort_buffer=16k \
- -O table_cache=32 -O record_buffer=8k -O net_buffer=1K &
+ -O table_cache=32 -O read_buffer_size=8k -O net_buffer_length=1K &
@end example
If you are doing a @code{GROUP BY} or @code{ORDER BY} on files that are
@@ -27246,7 +27380,7 @@ use the compiler option that you want the resulting code to be working on
all x586 type processors (like AMD).
By just using a better compiler and/or better compiler options you can
-get a 10-30 % speed increase in your application. This is particularly
+get a 10-30% speed increase in your application. This is particularly
important if you compile the SQL server yourself!
We have tested both the Cygnus CodeFusion and Fujitsu compilers, but
@@ -27272,7 +27406,7 @@ performance.
@item
If you strip your @code{mysqld} binary with @code{strip libexec/mysqld},
-the resulting binary can be up to 4 % faster.
+the resulting binary can be up to 4% faster.
@item
If you connect using TCP/IP rather than Unix sockets, the result is 7.5%
@@ -27281,23 +27415,27 @@ MySQL will, by default, use sockets.)
@item
If you connect using TCP/IP from another computer over a 100M Ethernet,
-things will be 8-11 % slower.
+things will be 8-11% slower.
@item
-If you compile with @code{--with-debug=full}, then you will loose 20 %
+When running our benchmark tests using secure connections (all data
+encrypted with internal SSL support) things were 55% slower.
+
+@item
+If you compile with @code{--with-debug=full}, then you will lose 20%
for most queries, but some queries may take substantially longer (The
-MySQL benchmarks ran 35 % slower)
-If you use @code{--with-debug}, then you will only loose 15 %.
+MySQL benchmarks ran 35% slower)
+If you use @code{--with-debug}, then you will only lose 15%.
By starting a @code{mysqld} version compiled with @code{--with-debug=full}
with @code{--skip-safemalloc} the end result should be close to when
configuring with @code{--with-debug}.
@item
-On a Sun SPARCstation 20, SunPro C++ 4.2 is 5 % faster than @code{gcc} 2.95.2.
+On a Sun SPARCstation 20, SunPro C++ 4.2 is 5% faster than @code{gcc} 2.95.2.
@item
Compiling with @code{gcc} 2.95.2 for UltraSPARC with the option
-@code{-mcpu=v8 -Wa,-xarch=v8plusa} gives 4 % more performance.
+@code{-mcpu=v8 -Wa,-xarch=v8plusa} gives 4% more performance.
@item
On Solaris 2.5.1, MIT-pthreads is 8-12% slower than Solaris native
@@ -27305,7 +27443,7 @@ threads on a single processor. With more load/CPUs the difference should
get bigger.
@item
-Running with @code{--log-bin} makes @strong{[MySQL} 1 % slower.
+Running with @code{--log-bin} makes @strong{[MySQL} 1% slower.
@item
Compiling on Linux-x86 using gcc without frame pointers
@@ -27377,8 +27515,8 @@ automatically changing the in-memory (HEAP) table to a disk-based
(MyISAM) table as necessary. To work around this problem, you can
increase the temporary table size by setting the @code{tmp_table_size}
option to @code{mysqld}, or by setting the SQL option
-@code{SQL_BIG_TABLES} in the client program. @xref{SET OPTION, ,
-@code{SET OPTION}}. In MySQL Version 3.20, the maximum size of the
+@code{BIG_TABLES} in the client program. @xref{SET OPTION, ,
+@code{SET}}. In MySQL Version 3.20, the maximum size of the
temporary table was @code{record_buffer*16}, so if you are using this
version, you have to increase the value of @code{record_buffer}. You can
also start @code{mysqld} with the @code{--big-tables} option to always
@@ -27472,12 +27610,86 @@ by starting @code{mysqld} with @code{--skip-networking}.
@findex SET OPTION
@example
-SET [OPTION] SQL_VALUE_OPTION= value, ...
+SET [GLOBAL | SESSION] sql_variable=expression, [[GLOBAL | SESSION] sql_variable=expression...]
+@end example
+
+@code{SET} sets various options that affect the operation of the
+server or your client.
+
+The following examples shows the different syntaxes one can use to set
+variables:
+
+In old MySQL versions we allowed the use of the @code{SET OPTION} syntax,
+but this syntax is now deprecated.
+
+In MySQL 4.0.3 we added the @code{GLOBAL} and @code{SESSION} options
+and access to most important startup variables.
+
+@code{LOCAL} can be used as a synonym for @code{SESSION}.
+
+If you set several variables on the same command line, the last used
+@code{GLOBAL | SESSION} mode is used.
+
+@example
+SET sort_buffer_size=10000;
+SET @@@@local.sort_buffer_size=10000;
+SET GLOBAL sort_buffer_size=1000000, SESSION sort_buffer_size=1000000;
+SET @@@@sort_buffer_size=1000000;
+SET @@@@global.sort_buffer_size=1000000, @@@@local.sort_buffer_size=1000000;
+@end example
+
+The @code{@@@@variable_name} syntax is supported to make MySQL syntax
+compatible with some other databases.
+
+The different system variables one can set are described in the system
+variable section of this manual. @xref{System Variables}.
+
+If you are using @code{SESSION} (the default) the option you set remains
+in effect until the current session ends, or until you set the option to
+a different value. If you use @code{GLOBAL}, which require the
+@code{SUPER} privilege, the option is remembered and used for new
+connections until the server restarts. If you want to make an option
+permanent, you should set it in one of the MySQL option
+files. @xref{Option files}.
+
+To avoid wrong usage MySQL will give an error if you use @code{SET
+GLOBAL} with a variable that can only be used with @code{SET SESSION} or if
+you are not using @code{SET GLOBAL} with a global variable.
+
+If you want to set a @code{SESSION} variable to the @code{GLOBAL} value or a
+@code{GLOBAL} value to the MySQL default value, you can set it to
+@code{DEFAULT}.
+
+@example
+SET max_join_size=DEFAULT;
@end example
-@code{SET OPTION} sets various options that affect the operation of the
-server or your client. Any option you set remains in effect until the
-current session ends, or until you set the option to a different value.
+This is identical to:
+
+@example
+SET @@@@session.max_join_size=@@@@global.max_join_size;
+@end example
+
+If you want to restrict the maximum value a startup option can be set to
+with the @code{SET} command, you can specify this by using the
+@code{--maximum-variable-name} command line option. @xref{Command-line
+options}.
+
+You can get a list of most variables with @code{SHOW VARIABLES}.
+@xref{SHOW VARIABLES}. You can get the value for a specific value with
+the @code{@@@@[global.|local.]variable_name} syntax:
+@example
+SHOW VARIABLES like "max_join_size";
+SHOW GLOBAL VARIABLES like "max_join_size";
+SELECT @@@@max_join_size, @@@@global.max_join_size;
+@end example
+
+Here follows a description of the variables that uses a the variables
+that uses a non-standard @code{SET} syntax and some of the other
+variables. The other variable definitions can be found in the system
+variable section, among the startup options or in the description of
+@code{SHOW VARIABLES}. @xref{System Variables}. @xref{Command-line
+options}. @xref{SHOW VARIABLES}.
@table @code
@item CHARACTER SET character_set_name | DEFAULT
@@ -27529,13 +27741,14 @@ that when you change from not @code{AUTOCOMMIT} mode to
@code{AUTOCOMMIT} mode, MySQL will do an automatic
@code{COMMIT} on any open transactions.
-@item SQL_BIG_TABLES = 0 | 1
+@item BIG_TABLES = 0 | 1
@cindex table is full
If set to @code{1}, all temporary tables are stored on disk rather than in
memory. This will be a little slower, but you will not get the error
@code{The table tbl_name is full} for big @code{SELECT} operations that
require a large temporary table. The default value for a new connection is
@code{0} (that is, use in-memory temporary tables).
+This option was before named @code{SQL_BIG_TABLES}.
@item SQL_BIG_SELECTS = 0 | 1
If set to @code{0}, MySQL will abort if a @code{SELECT} is attempted
@@ -27546,17 +27759,18 @@ that probably will take a very long time. This is useful when an inadvisable
@code{1} (which will allow all @code{SELECT} statements).
@item SQL_BUFFER_RESULT = 0 | 1
-@code{SQL_BUFFER_RESULT} will force the result from @code{SELECT}'s
+@code{SQL_BUFFER_RESULT} will force the result from @code{SELECT}s
to be put into a temporary table. This will help MySQL free the
table locks early and will help in cases where it takes a long time to
send the result set to the client.
-@item SQL_LOW_PRIORITY_UPDATES = 0 | 1
+@item LOW_PRIORITY_UPDATES = 0 | 1
If set to @code{1}, all @code{INSERT}, @code{UPDATE}, @code{DELETE}, and
and @code{LOCK TABLE WRITE} statements wait until there is no pending
@code{SELECT} or @code{LOCK TABLE READ} on the affected table.
+This option was before named @code{SQL_LOW_PRIORITY_UPDATES}.
-@item SQL_MAX_JOIN_SIZE = value | DEFAULT
+@item MAX_JOIN_SIZE = value | DEFAULT
Don't allow @code{SELECT}s that will probably need to examine more than
@code{value} row combinations. By setting this value, you can catch
@code{SELECT}s where keys are not used properly and that would probably
@@ -27565,9 +27779,15 @@ the @code{SQL_BIG_SELECTS} flag. If you set the @code{SQL_BIG_SELECTS}
flag again, the @code{SQL_MAX_JOIN_SIZE} variable will be ignored.
You can set a default value for this variable by starting @code{mysqld} with
@code{-O max_join_size=#}.
+This option was before named @code{SQL_MAX_JOIN_SIZE}.
-@item SQL_QUERY_CACHE_TYPE = OFF | ON | DEMAND
-@item SQL_QUERY_CACHE_TYPE = 0 | 1 | 2
+Note that if the result of the query is already in the query cache, the
+above check will not be made. Instead, MySQL will send the result to the
+client. Since the query result is already computed and it will not burden
+the server to send the result to the client.
+
+@item QUERY_CACHE_TYPE = OFF | ON | DEMAND
+@item QUERY_CACHE_TYPE = 0 | 1 | 2
Set query cache setting for this thread.
@multitable @columnfractions .20 .70
@item @strong{Option} @tab @strong{Description}
@@ -27591,12 +27811,12 @@ can be restored by using a @code{SQL_SELECT_LIMIT} value of @code{DEFAULT}.
@item SQL_LOG_OFF = 0 | 1
If set to @code{1}, no logging will be done to the standard log for this
-client, if the client has the @strong{process} privilege. This does not
+client, if the client has the @code{SUPER} privilege. This does not
affect the update log!
@item SQL_LOG_UPDATE = 0 | 1
If set to @code{0}, no logging will be done to the update log for the client,
-if the client has the @strong{process} privilege. This does not affect the
+if the client has the @code{SUPER} privilege. This does not affect the
standard log!
@item SQL_QUOTE_SHOW_CREATE = 0 | 1
@@ -27621,8 +27841,6 @@ command when inserting an @code{AUTO_INCREMENT} value. This is mainly used
with the update log.
@end table
-@xref{SET TRANSACTION}.
-
@node Disk issues, , Optimising the Server, MySQL Optimisation
@section Disk Issues
@@ -27686,8 +27904,8 @@ option. That makes it skip the updating of the last access time in the
inode and by this will avoid some disk seeks.
@item
-On Linux, you can get much more performance (up to 100 % under load is
-not uncommon) by using hdpram to configure your disk's interface! The
+On Linux, you can get much more performance (up to 100% under load is
+not uncommon) by using hdparm to configure your disk's interface! The
following should be quite good hdparm options for MySQL (and
probably many other applications):
@@ -27710,7 +27928,7 @@ too much reliability. (This flag is on by default on Linux.)
@item
If you don't need to know when a file was last accessed (which is not
really useful on a database server), you can mount your filesystems
-with the noatime flag.
+with the @code{noatime} flag.
@end itemize
@menu
@@ -27733,7 +27951,6 @@ spreading your tables to different disk.
The recommended way to do this, is to just symlink databases to a
different disk and only symlink tables as a last resort.
-@cindex databases, symbolic links
@menu
* Symbolic links to databases:: Using Symbolic Links for Databases
* Symbolic links to tables:: Using Symbolic Links for Tables
@@ -27743,6 +27960,8 @@ different disk and only symlink tables as a last resort.
@node Symbolic links to databases, Symbolic links to tables, Symbolic links, Symbolic links
@subsubsection Using Symbolic Links for Databases
+@cindex databases, symbolic links
+
The way to symlink a database is to first create a directory on some
disk where you have free space and then create a symlink to it from
the MySQL database directory.
@@ -27788,7 +28007,7 @@ databases on different disks. @xref{Windows symbolic links}.
@node Symbolic links to tables, , Symbolic links to databases, Symbolic links
@subsubsection Using Symbolic Links for Tables
-@cindex databases, symbolic links
+@cindex tables, symbolic links
Before MySQL 4.0 you should not symlink tables, if you are not
very careful with them. The problem is that if you run @code{ALTER
@@ -27894,8 +28113,9 @@ may find it useful to refer to the various indexes.
@menu
* Literals:: Literals: How to Write Strings and Numbers
* Legal names:: Database, Table, Index, Column, and Alias Names
-* Name case sensitivity:: Case Sensitivity in Names
+* Name case sensitivity:: Case-Sensitivity in Names
* Variables:: User Variables
+* System Variables:: System Variables
* Comments:: Comment Syntax
* Reserved words:: Is MySQL Picky About Reserved Words?
@end menu
@@ -28184,7 +28404,7 @@ in ANSI mode. @xref{ANSI mode}.
@multitable @columnfractions .15 .15 .70
@item @strong{Identifier} @tab @strong{Max length} @tab @strong{Allowed characters}
-@item Database @tab 64 @tab Any character that is allowed in a directory name except @samp{/} or @samp{.}.
+@item Database @tab 64 @tab Any character that is allowed in a directory name except @samp{/}, @samp{\} or @samp{.}.
@item Table @tab 64 @tab Any character that is allowed in a file name, except @samp{/} or @samp{.}.
@item Column @tab 64 @tab All characters.
@item Alias @tab 255 @tab All characters.
@@ -28194,13 +28414,15 @@ Note that in addition to the above, you can't have ASCII(0) or ASCII(255) or
the quoting character in an identifier.
Note that if the identifier is a restricted word or contains special characters
-you must always quote it with @code{`} when you use it:
+you must always quote it with a @code{`} (backtick) when you use it:
@example
mysql> SELECT * FROM `select` WHERE `select`.id > 100;
@end example
-In previous versions of MySQL, the name rules are as follows:
+@xref{Reserved words}.
+
+In MySQL versions prior to 3.23.6, the name rules are as follows:
@itemize @bullet
@item
@@ -28262,14 +28484,14 @@ programs prefix table names with a @samp{.} character.
@cindex names, case-sensitivity
@cindex case-sensitivity, in names
-@cindex database names, case sensitivity
-@cindex table names, case sensitivity
-@cindex column names, case sensitivity
-@cindex alias names, case sensitivity
+@cindex database names, case-sensitivity
+@cindex table names, case-sensitivity
+@cindex column names, case-sensitivity
+@cindex alias names, case-sensitivity
In MySQL, databases and tables correspond to directories and files
-within those directories. Consequently, the case sensitivity of the
-underlying operating system determines the case sensitivity of database and
+within those directories. Consequently, the case-sensitivity of the
+underlying operating system determines the case-sensitivity of database and
table names. This means database and table names are case-insensitive in
Windows, and case-sensitive in most varieties of Unix (Mac OS X being an
exception).
@@ -28303,9 +28525,10 @@ lower_case_table_names=1}. By default this option is 1 on Windows and 0 on
Unix.
If @code{lower_case_table_names} is 1 MySQL will convert all
-table names to lower case on storage and lookup. Note that if you
-change this option, you need to first convert your old table names to
-lower case before starting @code{mysqld}.
+table names to lowercase on storage and lookup.
+(From version 4.0.2, this option also applies to database names.)
+Note that if you change this option, you need to first convert your old
+table names to lower case before starting @code{mysqld}.
If you move @code{MyISAM} files from a Windows to a *nix disk, you may
in some cases need to use the @file{mysql_fix_extensions} tool to fix-up
@@ -28314,14 +28537,14 @@ the case of the file extensions in each specified database directory
@file{mysql_fix_extensions} can be found in the @file{script} subdirectory.
-@node Variables, Comments, Name case sensitivity, Language Structure
+@node Variables, System Variables, Name case sensitivity, Language Structure
@subsection User Variables
@cindex variables, user
@cindex user variables
@cindex names, variables
-MySQL supports thread-specific variables with the
+MySQL supports connection-specific user variables with the
@code{@@variablename} syntax. A variable name may consist of
alphanumeric characters from the current character set and also
@samp{_}, @samp{$}, and @samp{.} . The default character set is
@@ -28372,7 +28595,189 @@ mysql> SELECT (@@aa:=id) AS a, (@@aa+3) AS b FROM table_name HAVING b=5;
The reason is that @code{@@aa} will not contain the value of the current
row, but the value of @code{id} for the previous accepted row.
-@node Comments, Reserved words, Variables, Language Structure
+@node System Variables, Comments, Variables, Language Structure
+@subsection System Variables
+
+@cindex variables, System
+@cindex system variables
+
+Starting from MySQL 4.0.3 we provide better access to a lot of system
+and connection variables. One can change most of them without having to take
+down the server.
+
+There are two kind of system variables: Thread (or connection) specific
+variables that are unique to the current connection and global variables
+that are either used to configure global events or used as initial
+variables for a new connection.
+
+When mysqld starts all global variables are initialised from command
+line arguments and option files. You can change the used value with the
+@code{SET GLOBAL} command. When a new thread is created the thread
+specific variables are initialised from the global variables and they
+will not change even if one issues a new @code{SET GLOBAL} command.
+
+To set the value for a @code{GLOBAL} variable, you should use one
+of the following syntaxes:
+(Here we use @code{sort_buffer_size} as an example variable)
+
+@example
+SET GLOBAL sort_buffer_size=value;
+SET @@@@global.sort_buffer_size=value;
+@end example
+
+To set the value for @code{SESSION} variable, you can use one of the
+following syntaxes:
+
+@example
+SET SESSION sort_buffer_size=value;
+SET @@@@session.sort_buffer_size=value;
+SET sort_buffer_size=value;
+@end example
+
+If you don't specify @code{GLOBAL} or @code{SESSION} then @code{SESSION}
+is used. @xref{SET OPTION}.
+
+@code{LOCAL} is a synonym for @code{SESSION}.
+
+To retrieve the value for a @code{GLOBAL} variable you can use one of the
+following commands:
+
+@example
+SELECT @@@@global.sort_buffer_size;
+SHOW GLOBAL VARIABLES like 'sort_buffer_size';
+@end example
+
+To retrieve the value for a @code{SESSION} variable you can use one of the
+following commands:
+
+@example
+SELECT @@@@session.sort_buffer_size;
+SHOW SESSION VARIABLES like 'sort_buffer_size';
+@end example
+
+When you @strong{retrieve} a variable value with the
+@code{@@@@variable_name} syntax and you don't specify @code{GLOBAL} or
+@code{SESSION} then MySQL will return the thread specific
+(@code{SESSION}) value if it exists. If not, MySQL will return the
+global value.
+
+The reason for requiring @code{GLOBAL} for setting @code{GLOBAL} only
+variables but not for retrieving them is to ensure that we don't later
+run into problems if we later would introduce a thread specific variable
+with the same name or remove a thread specific variable. In this case
+you could accidently change the state for the whole server and not
+just for your own connection.
+
+The following is a full list of all variables that you change and retrieve
+and if you can use @code{GLOBAL} or @code{SESSION} with them.
+
+@multitable @columnfractions .50 .25 .25
+@item @strong{Variable name} @tab @strong{Value type} @tab @strong{Type}
+@item autocommit @tab bool @tab SESSION
+@item big_tables @tab bool @tab SESSION
+@item binlog_cache_size @tab num @tab GLOBAL
+@item bulk_insert_buffer_size @tab num @tab GLOBAL | SESSION
+@item concurrent_insert @tab bool @tab GLOBAL
+@item connect_timeout @tab num @tab GLOBAL
+@item convert_character_set @tab string @tab SESSION
+@item delay_key_write @tab OFF | ON | ALL @tab GLOBAL
+@item delayed_insert_limit @tab num @tab GLOBAL
+@item delayed_insert_timeout @tab num @tab GLOBAL
+@item delayed_queue_size @tab num @tab GLOBAL
+@item flush @tab bool @tab GLOBAL
+@item flush_time @tab num @tab GLOBAL
+@item foreign_key_checks @tab bool @tab SESSION
+@item identity @tab num @tab SESSION
+@item insert_id @tab bool @tab SESSION
+@item interactive_timeout @tab num @tab GLOBAL | SESSION
+@item join_buffer_size @tab num @tab GLOBAL | SESSION
+@item key_buffer_size @tab num @tab GLOBAL
+@item last_insert_id @tab bool @tab SESSION
+@item local_infile @tab bool @tab GLOBAL
+@item log_warnings @tab bool @tab GLOBAL
+@item long_query_time @tab num @tab GLOBAL | SESSION
+@item low_priority_updates @tab bool @tab GLOBAL | SESSION
+@item max_allowed_packet @tab num @tab GLOBAL | SESSION
+@item max_binlog_cache_size @tab num @tab GLOBAL
+@item max_binlog_size @tab num @tab GLOBAL
+@item max_connect_errors @tab num @tab GLOBAL
+@item max_connections @tab num @tab GLOBAL
+@item max_delayed_threads @tab num @tab GLOBAL
+@item max_heap_table_size @tab num @tab GLOBAL | SESSION
+@item max_join_size @tab num @tab GLOBAL | SESSION
+@item max_sort_length @tab num @tab GLOBAL | SESSION
+@item max_tmp_tables @tab num @tab GLOBAL
+@item max_user_connections @tab num @tab GLOBAL
+@item max_write_lock_count @tab num @tab GLOBAL
+@item myisam_max_extra_sort_file_size @tab num @tab GLOBAL | SESSION
+@item myisam_max_sort_file_size @tab num @tab GLOBAL | SESSION
+@item myisam_sort_buffer_size @tab num @tab GLOBAL | SESSION
+@item net_buffer_length @tab num @tab GLOBAL | SESSION
+@item net_read_timeout @tab num @tab GLOBAL | SESSION
+@item net_retry_count @tab num @tab GLOBAL | SESSION
+@item net_write_timeout @tab num @tab GLOBAL | SESSION
+@item query_cache_limit @tab num @tab GLOBAL
+@item query_cache_size @tab num @tab GLOBAL
+@item query_cache_type @tab enum @tab GLOBAL
+@item read_buffer_size @tab num @tab GLOBAL | SESSION
+@item read_rnd_buffer_size num @tab GLOBAL | SESSION
+@item rpl_recovery_rank @tab num @tab GLOBAL
+@item safe_show_database @tab bool @tab GLOBAL
+@item server_id @tab num @tab GLOBAL
+@item slave_compressed_protocol @tab bool @tab GLOBAL
+@item slave_net_timeout @tab num @tab GLOBAL
+@item slow_launch_time @tab num @tab GLOBAL
+@item sort_buffer_size @tab num @tab GLOBAL | SESSION
+@item sql_auto_is_null @tab bool @tab SESSION
+@item sql_big_selects @tab bool @tab SESSION
+@item sql_big_tables @tab bool @tab SESSION
+@item sql_buffer_result @tab bool @tab SESSION
+@item sql_log_binlog @tab bool @tab SESSION
+@item sql_log_off @tab bool @tab SESSION
+@item sql_log_update @tab bool @tab SESSION
+@item sql_low_priority_updates @tab bool @tab GLOBAL | SESSION
+@item sql_max_join_size @tab num @tab GLOBAL | SESSION
+@item sql_quote_show_create @tab bool @tab SESSION
+@item sql_safe_updates @tab bool @tab SESSION
+@item sql_select_limit @tab bool @tab SESSION
+@item sql_slave_skip_counter @tab num @tab GLOBAL
+@item sql_warnings @tab bool @tab SESSION
+@item table_cache @tab num @tab GLOBAL
+@item table_type @tab enum @tab GLOBAL | SESSION
+@item thread_cache_size @tab num @tab GLOBAL
+@item timestamp @tab bool @tab SESSION
+@item tmp_table_size @tab enum @tab GLOBAL | SESSION
+@item tx_isolation @tab enum @tab GLOBAL | SESSION
+@item version @tab string @tab GLOBAL
+@item wait_timeout @tab num @tab GLOBAL | SESSION
+@item unique_checks @tab bool @tab SESSION
+@end multitable
+
+Variables that are marked with @code{num} can be given a numerical
+value. Variables that are marked with @code{bool} can be set to 0, 1,
+@code{ON} or @code{OFF}. Variables that are of type @code{enum} should
+normally be set to one of the available values for the variable, but can
+also be set to the number that correspond to the enum value. (The first
+enum value is 0).
+
+Here is a description of some of the variables:
+
+@multitable @columnfractions 0.30 0.70
+@item @strong{Variable} @tab @strong{Description}
+@item identity @tab Alias for last_insert_id (Sybase compatiblity)
+@item sql_low_priority_updates @tab Alias for low_priority_updates
+@item sql_max_join_size @tab Alias for max_join_size
+@item delay_key_write_for_all_tables @tab If this and delay_key_write is set then all new MyISAM tables that are opened will use delayed key writes.
+@item version @tab Alias for VERSION() (Sybase (?) compatability)
+@end multitable
+
+A description of the other variable definitions can be found in the
+startup options section, the description of @code{SHOW VARIABLES} and in
+the @code{SET} section. @xref{Command-line
+options}. @xref{SHOW VARIABLES}. @xref{SET OPTION}.
+
+
+@node Comments, Reserved words, System Variables, Language Structure
@subsection Comment Syntax
@findex Comment syntax
@@ -28445,7 +28850,7 @@ A few are reserved because MySQL needs them and is
@c START_OF_RESERVED_WORDS
-@c Reserved word list updated Fri May 3 08:41:00 2002 by arjen.
+@c Reserved word list updated Tue Jul 23 20:41:20 2002 by monty.
@c To regenerate, use Support/update-reserved-words.pl.
@multitable @columnfractions .33 .33 .34
@@ -28523,108 +28928,93 @@ A few are reserved because MySQL needs them and is
@tab @code{INNER}
@item @code{INNODB}
@tab @code{INSERT}
- @tab @code{INSERT_ID}
-@item @code{INT}
- @tab @code{INTEGER}
+ @tab @code{INT}
+@item @code{INTEGER}
@tab @code{INTERVAL}
-@item @code{INTO}
- @tab @code{IS}
+ @tab @code{INTO}
+@item @code{IS}
@tab @code{JOIN}
-@item @code{KEY}
- @tab @code{KEYS}
+ @tab @code{KEY}
+@item @code{KEYS}
@tab @code{KILL}
-@item @code{LAST_INSERT_ID}
@tab @code{LEADING}
- @tab @code{LEFT}
-@item @code{LIKE}
+@item @code{LEFT}
+ @tab @code{LIKE}
@tab @code{LIMIT}
- @tab @code{LINES}
-@item @code{LOAD}
+@item @code{LINES}
+ @tab @code{LOAD}
@tab @code{LOCK}
- @tab @code{LONG}
-@item @code{LONGBLOB}
+@item @code{LONG}
+ @tab @code{LONGBLOB}
@tab @code{LONGTEXT}
- @tab @code{LOW_PRIORITY}
-@item @code{MASTER_SERVER_ID}
+@item @code{LOW_PRIORITY}
+ @tab @code{MASTER_SERVER_ID}
@tab @code{MATCH}
- @tab @code{MEDIUMBLOB}
-@item @code{MEDIUMINT}
+@item @code{MEDIUMBLOB}
+ @tab @code{MEDIUMINT}
@tab @code{MEDIUMTEXT}
- @tab @code{MIDDLEINT}
-@item @code{MINUTE_SECOND}
+@item @code{MIDDLEINT}
+ @tab @code{MINUTE_SECOND}
@tab @code{MRG_MYISAM}
- @tab @code{NATURAL}
-@item @code{NOT}
+@item @code{NATURAL}
+ @tab @code{NOT}
@tab @code{NULL}
- @tab @code{NUMERIC}
-@item @code{ON}
+@item @code{NUMERIC}
+ @tab @code{ON}
@tab @code{OPTIMIZE}
- @tab @code{OPTION}
-@item @code{OPTIONALLY}
+@item @code{OPTION}
+ @tab @code{OPTIONALLY}
@tab @code{OR}
- @tab @code{ORDER}
-@item @code{OUTER}
+@item @code{ORDER}
+ @tab @code{OUTER}
@tab @code{OUTFILE}
- @tab @code{PARTIAL}
-@item @code{PRECISION}
+@item @code{PARTIAL}
+ @tab @code{PRECISION}
@tab @code{PRIMARY}
- @tab @code{PRIVILEGES}
-@item @code{PROCEDURE}
+@item @code{PRIVILEGES}
+ @tab @code{PROCEDURE}
@tab @code{PURGE}
- @tab @code{READ}
-@item @code{REAL}
+@item @code{READ}
+ @tab @code{REAL}
@tab @code{REFERENCES}
- @tab @code{REGEXP}
-@item @code{RENAME}
+@item @code{REGEXP}
+ @tab @code{RENAME}
@tab @code{REPLACE}
- @tab @code{REQUIRE}
-@item @code{RESTRICT}
+@item @code{REQUIRE}
+ @tab @code{RESTRICT}
@tab @code{RETURNS}
- @tab @code{REVOKE}
-@item @code{RIGHT}
+@item @code{REVOKE}
+ @tab @code{RIGHT}
@tab @code{RLIKE}
- @tab @code{SELECT}
-@item @code{SET}
+@item @code{SELECT}
+ @tab @code{SET}
@tab @code{SHOW}
- @tab @code{SMALLINT}
-@item @code{SONAME}
- @tab @code{SQL_AUTO_IS_NULL}
+@item @code{SMALLINT}
+ @tab @code{SONAME}
@tab @code{SQL_BIG_RESULT}
-@item @code{SQL_BIG_SELECTS}
- @tab @code{SQL_BIG_TABLES}
- @tab @code{SQL_BUFFER_RESULT}
@item @code{SQL_CALC_FOUND_ROWS}
- @tab @code{SQL_LOG_BIN}
- @tab @code{SQL_LOG_OFF}
-@item @code{SQL_LOG_UPDATE}
- @tab @code{SQL_LOW_PRIORITY_UPDATES}
- @tab @code{SQL_MAX_JOIN_SIZE}
-@item @code{SQL_QUOTE_SHOW_CREATE}
- @tab @code{SQL_SAFE_UPDATES}
- @tab @code{SQL_SELECT_LIMIT}
-@item @code{SQL_SLAVE_SKIP_COUNTER}
@tab @code{SQL_SMALL_RESULT}
- @tab @code{SQL_WARNINGS}
-@item @code{SSL}
- @tab @code{STARTING}
+ @tab @code{SSL}
+@item @code{STARTING}
@tab @code{STRAIGHT_JOIN}
-@item @code{STRIPED}
- @tab @code{TABLE}
+ @tab @code{STRIPED}
+@item @code{TABLE}
@tab @code{TABLES}
-@item @code{TERMINATED}
- @tab @code{THEN}
+ @tab @code{TERMINATED}
+@item @code{THEN}
@tab @code{TINYBLOB}
-@item @code{TINYINT}
- @tab @code{TINYTEXT}
+ @tab @code{TINYINT}
+@item @code{TINYTEXT}
@tab @code{TO}
-@item @code{TRAILING}
- @tab @code{UNION}
+ @tab @code{TRAILING}
+@item @code{UNION}
@tab @code{UNIQUE}
-@item @code{UNLOCK}
- @tab @code{UNSIGNED}
+ @tab @code{UNLOCK}
+@item @code{UNSIGNED}
@tab @code{UPDATE}
-@item @code{USAGE}
- @tab @code{USE}
+ @tab @code{USAGE}
+@item @code{USE}
+ @tab @code{USER_RESOURCES}
@tab @code{USING}
@item @code{VALUES}
@tab @code{VARBINARY}
@@ -28634,9 +29024,9 @@ A few are reserved because MySQL needs them and is
@tab @code{WHERE}
@item @code{WITH}
@tab @code{WRITE}
- @tab @code{YEAR_MONTH}
-@item @code{ZEROFILL}
- @tab
+ @tab @code{XOR}
+@item @code{YEAR_MONTH}
+ @tab @code{ZEROFILL}
@tab
@end multitable
@@ -29049,16 +29439,16 @@ types the precision and scale can be (and usually is) specified; for
example:
@example
- salary DECIMAL(9,2)
+ salary DECIMAL(5,2)
@end example
-In this example, @code{9} (@code{precision}) represents the number of
+In this example, @code{5} (@code{precision}) represents the number of
significant decimal digits that will be stored for values, and @code{2}
(@code{scale}) represents the number of digits that will be stored
following the decimal point. In this case, therefore, the range of
values that can be stored in the @code{salary} column is from
-@code{-9999999.99} to @code{9999999.99}.
-(MySQL can actually store numbers up to @code{9999999.99} in this column
+@code{-99.99} to @code{99.99}.
+(MySQL can actually store numbers up to @code{999.99} in this column
because it doesn't have to store the sign for positive numbers)
In ANSI/ISO SQL92, the syntax @code{DECIMAL(p)} is equivalent to
@@ -29165,6 +29555,17 @@ Conversions that occur due to clipping are reported as ``warnings'' for
@code{ALTER TABLE}, @code{LOAD DATA INFILE}, @code{UPDATE}, and
multi-row @code{INSERT} statements.
+@c FIX arjen 2002-08-07 New table, not yet measured for O'Reilly/DocBook
+@c FIX also need to shuffle into proper position and adjust text.
+@multitable @columnfractions .20 .20 .30 .30
+@item @strong{Type} @tab @strong{Bytes} @tab @strong{From} @tab @strong{To}
+@item @code{TINYINT} @tab 1 @tab -128 @tab 127
+@item @code{SMALLINT} @tab 2 @tab -32768 @tab 32767
+@item @code{MEDIUMINT} @tab 3 @tab -8388608 @tab 8388607
+@item @code{INT} @tab 4 @tab -2147483648 @tab 2147483647
+@item @code{BIGINT} @tab 8 @tab -9223372036854775808 @tab 9223372036854775807
+@end multitable
+
@node Date and time types, String types, Numeric types, Column types
@subsection Date and Time Types
@@ -29441,7 +29842,7 @@ For values specified as strings that include date part delimiters, it is not
necessary to specify two digits for month or day values that are less than
@code{10}. @code{'1979-6-9'} is the same as @code{'1979-06-09'}. Similarly,
for values specified as strings that include time part delimiters, it is not
-necessary to specify two digits for hour, month, or second values that are
+necessary to specify two digits for hour, minute, or second values that are
less than @code{10}. @code{'1979-10-30 1:2:3'} is the same as
@code{'1979-10-30 01:02:03'}.
@@ -29695,6 +30096,16 @@ The string types are @code{CHAR}, @code{VARCHAR}, @code{BLOB}, @code{TEXT},
@code{ENUM}, and @code{SET}. This section describes how these types work,
their storage requirements, and how to use them in your queries.
+@c FIX arjen 2002-08-07 New table, not yet measured for O'Reilly/DocBook
+@c FIX also need to shuffle into proper position and adjust text.
+@multitable @columnfractions .40 .30 .30
+@item @strong{Type} @tab @strong{Max.size} @tab @strong{Bytes}
+@item @code{TINYTEXT} or @code{TINYBLOB} @tab 2^8-1 @tab 255
+@item @code{TEXT} or @code{BLOB} @tab 2^16-1 (64K-1) @tab 65535
+@item @code{MEDIUMTEXT} or @code{MEDIUMBLOB} @tab 2^24-1 (16M-1) @tab 16777215
+@item @code{LONGBLOB} @tab 2^32-1 (4G-1) @tab 4294967295
+@end multitable
+
@node CHAR, BLOB, String types, String types
@subsubsection The @code{CHAR} and @code{VARCHAR} Types
@@ -30567,12 +30978,12 @@ mysql> SELECT INTERVAL(22, 23, 30, 44, 200);
@end example
@end table
-If you are comparing case-sensitive string with any of the standard
-operators (@code{=}, @code{<>}..., but not @code{LIKE}) end space will
-be ignored.
+If you are comparing case-insensitive strings with any of the standard
+operators (@code{=}, @code{<>}..., but not @code{LIKE}) trailing whitespace
+(spaces, tabs and newlines) will be ignored.
@example
-mysql> SELECT "a" ="A ";
+mysql> SELECT "a" ="A \n";
-> 1
@end example
@@ -30638,6 +31049,22 @@ mysql> SELECT 1 && 0;
mysql> SELECT 1 && NULL;
-> NULL
@end example
+
+@findex XOR, logical
+@item XOR
+Logical XOR. For non-@code{NULL} operands, evaluates to @code{1} if only one
+of the operators is non-zero.
+Produces @code{NULL} if either operand is @code{NULL}:
+@example
+mysql> SELECT 1 XOR 1;
+ -> 0
+mysql> SELECT 1 XOR 0;
+ -> 1
+mysql> SELECT 1 XOR NULL;
+ -> NULL
+@end example
+
+@code{a XOR b} is equal to @code{(a AND (NOT b)) OR ((NOT a) and b)}.
@end table
@@ -30695,6 +31122,10 @@ mysql> SELECT IF(STRCMP('test','test1'),'no','yes');
-> 'no'
@end example
+If @code{expr2} or @code{expr3} is explicitely @code{NULL} then the
+result type of the @code{IF()} function is the type of the not
+@code{NULL} column. (This behavior is new in MySQL 4.0.3).
+
@code{expr1} is evaluated as an integer value, which means that if you are
testing floating-point or string values, you should do so using a comparison
operation:
@@ -30951,7 +31382,7 @@ mysql> SELECT LOCATE('xbar', 'foobar');
@end example
This function is multi-byte safe. In MySQL 3.23 this function is case
-insensitive, while in 4.0 it's only case-insensitive if either argument is
+sensitive, while in 4.0 it's only case-sensitive if either argument is
a binary string.
@findex LOCATE()
@@ -30966,7 +31397,7 @@ mysql> SELECT LOCATE('bar', 'foobarbar',5);
@end example
This function is multi-byte safe. In MySQL 3.23 this function is case
-insensitive, while in 4.0 it's only case-insensitive if either argument is
+sensitive, while in 4.0 it's only case-sensitive if either argument is
a binary string.
@findex INSTR()
@@ -30983,7 +31414,7 @@ mysql> SELECT INSTR('xbar', 'foobar');
@end example
This function is multi-byte safe. In MySQL 3.23 this function is case
-insensitive, while in 4.0 it's only case-insensitive if either argument is
+sensitive, while in 4.0 it's only case-sensitive if either argument is
a binary string.
@findex LPAD()
@@ -31301,7 +31732,7 @@ This function is multi-byte safe.
@item LOAD_FILE(file_name)
Reads the file and returns the file contents as a string. The file
must be on the server, you must specify the full pathname to the
-file, and you must have the @strong{file} privilege. The file must
+file, and you must have the @code{FILE} privilege. The file must
be readable by all and be smaller than @code{max_allowed_packet}.
If the file doesn't exist or can't be read due to one of the above reasons,
@@ -31312,7 +31743,6 @@ mysql> UPDATE tbl_name
SET blob_column=LOAD_FILE("/tmp/picture")
WHERE id=1;
@end example
-@end table
If you are not using MySQL Version 3.23, you have to do the reading
of the file inside your application and create an @code{INSERT} statement
@@ -31320,6 +31750,24 @@ to update the database with the file information. One way to do this, if
you are using the MySQL++ library, can be found at
@uref{http://www.mysql.com/documentation/mysql++/mysql++-examples.html}.
+@findex QUOTE()
+@item QUOTE(str)
+Quotes a string to produce a result that can be used as a properly-escaped
+data value in a SQL statement. The string is returned surrounded by single
+quotes and with each instance of single quote (@samp{'}), backslash (@samp{\}),
+ASCII NUL, and Control-Z preceded by a backslash. If the argument is
+@code{NULL}, the return value is the word ``NULL'' without surrounding
+single quotes.
+
+@example
+mysql> SELECT QUOTE("Don't");
+ -> 'Don\'t!'
+mysql> SELECT QUOTE(NULL);
+ -> NULL
+@end example
+
+@end table
+
MySQL automatically converts numbers to strings as necessary, and
vice-versa:
@@ -31340,7 +31788,7 @@ a binary string. This only affects comparisons.
@menu
* String comparison functions:: String Comparison Functions
-* Case Sensitivity Operators:: Case Sensitivity
+* Case Sensitivity Operators:: Case-Sensitivity
@end menu
@node String comparison functions, Case Sensitivity Operators, String functions, String functions
@@ -31349,8 +31797,8 @@ a binary string. This only affects comparisons.
@findex string comparison functions
@findex functions, string comparison
-@cindex case sensitivity, in string comparisons
-@cindex string comparisons, case sensitivity
+@cindex case-sensitivity, in string comparisons
+@cindex string comparisons, case-sensitivity
Normally, if any expression in a string comparison is case-sensitive, the
comparison is performed in case-sensitive fashion.
@@ -31374,17 +31822,6 @@ mysql> SELECT 'David!' LIKE 'David_';
-> 1
mysql> SELECT 'David!' LIKE '%D%v%';
-> 1
-mysql> select TRUNCATE(-1,999,1);
- -> -1.9
-@end example
-
-Starting from MySQL 3.23.51 all numbers are rounded towards zero.
-
-If @code{D} is negative, then the whole part of the number is zeroed out:
-
-@example
-mysql> select truncate(122,-2);
- -> 100
@end example
To test for literal instances of a wildcard character, precede the character
@@ -31506,7 +31943,7 @@ positive floating-point number. Zero relevance means no similarity.
@end table
@node Case Sensitivity Operators, , String comparison functions, String functions
-@subsubsection Case Sensitivity
+@subsubsection Case-Sensitivity
@findex casts
@@ -31725,7 +32162,7 @@ mysql> SELECT ROUND(1.58);
-> 2
@end example
-Note that the behavior of @code{ROUND()} when the argument
+Note that the behaviour of @code{ROUND()} when the argument
is half way between two integers depends on the C library
implementation. Some round to the nearest even number,
always up, always down, or always toward zero. If you need
@@ -31755,17 +32192,58 @@ mysql> SELECT EXP(2);
mysql> SELECT EXP(-2);
-> 0.135335
@end example
+
+@findex LN()
+@item LN(X)
+Returns the natural logarithm of @code{X}:
+@example
+mysql> SELECT LN(2);
+ -> 0.693147
+mysql> SELECT LN(-2);
+ -> NULL
+@end example
+
+This function was added in MySQL version 4.0.3.
+It is synonymous with @code{LOG(X)} in MySQL.
+
@findex LOG()
@item LOG(X)
-Returns the natural logarithm of @code{X}:
+@itemx LOG(B,X)
+If called with one parameter, this function returns the natural logarithm
+of @code{X}:
@example
mysql> SELECT LOG(2);
-> 0.693147
mysql> SELECT LOG(-2);
-> NULL
@end example
-If you want the log of a number @code{X} to some arbitary base @code{B}, use
-the formula @code{LOG(X)/LOG(B)}.
+
+If called with two parameters, this function returns the logarithm of
+@code{X} for an arbitary base @code{B}:
+@example
+mysql> SELECT LOG(2,65536);
+ -> 16.000000
+mysql> SELECT LOG(1,100);
+ -> NULL
+@end example
+
+The arbitrary base option was added in MySQL version 4.0.3.
+@code{LOG(B,X)} is equivalent to @code{LOG(X)/LOG(B)}.
+
+@findex LOG2()
+@item LOG2(X)
+Returns the base-2 logarithm of @code{X}:
+@example
+mysql> SELECT LOG2(65536);
+ -> 16.000000
+mysql> SELECT LOG2(-100);
+ -> NULL
+@end example
+
+@code{LOG2()} is useful for finding out how many bits a number would
+require for storage.
+This function was added in MySQL version 4.0.3.
+In earlier versions, you can use @code{LOG(X)/LOG(2)} instead.
@findex LOG10()
@item LOG10(X)
@@ -32005,6 +32483,17 @@ mysql> SELECT TRUNCATE(1.999,1);
-> 1.9
mysql> SELECT TRUNCATE(1.999,0);
-> 1
+mysql> SELECT TRUNCATE(-1.999,1);
+ -> -1.9
+@end example
+
+Starting from MySQL 3.23.51 all numbers are rounded towards zero.
+
+If @code{D} is negative, then the whole part of the number is zeroed out:
+
+@example
+mysql> SELECT TRUNCATE(122,-2);
+ -> 100
@end example
Note that as decimal numbers are normally not stored as exact numbers in
@@ -32146,6 +32635,31 @@ mysql> SELECT WEEK('1998-12-31',1);
Note: in Version 4.0, @code{WEEK(#,0)} was changed to match the
calendar in the USA.
+Note that if a week is the last week of the previous year, MySQL will
+return 0:
+
+@example
+mysql> SELECT YEAR('2000-01-01'), WEEK('2000-01-01',0);
+ -> 2000, 0
+@end example
+
+One could argue that MySQL should return @code{52} for the @code{WEEK()}
+function as the given date is actually the 52 second week of 1999. We
+decided to return 0 instead as we want the function to return 'the week
+number in the given year'. This makes the usage of the @code{WEEK()}
+function reliable when combined with other functions that extracts a
+date part from a date.
+
+If you would prefer to know the correct year-week, then you should use
+the @code{YEARWEEK()} function instead:
+
+@example
+mysql> SELECT YEARWEEK('2000-01-01');
+ -> 199952
+mysql> SELECT MID(YEARWEEK('2000-01-01'),5,2);
+ -> 52
+@end example
+
@findex YEAR()
@item YEAR(date)
Returns the year for @code{date}, in the range @code{1000} to @code{9999}:
@@ -32167,6 +32681,10 @@ mysql> SELECT YEARWEEK('1987-01-01');
-> 198653
@end example
+Note that the week number is different from what the @code{WEEK()} function
+would return (@code{0}) as @code{WEEK()} returns the week in the
+context of the given year.
+
@findex HOUR()
@item HOUR(time)
Returns the hour for @code{time}, in the range @code{0} to @code{23}:
@@ -32494,6 +33012,10 @@ mysql> SELECT NOW() + 0;
-> 19971215235026
@end example
+Note that @code{NOW()} is only evaluated once per query, namely at the
+start of query execution. This means that multiple references to
+@code{NOW()} within a single query will always give the same time.
+
@findex UNIX_TIMESTAMP()
@item UNIX_TIMESTAMP()
@itemx UNIX_TIMESTAMP(date)
@@ -32705,7 +33227,7 @@ The result is an unsigned 64-bit integer.
@findex & (bitwise AND)
@findex AND, bitwise
@item &
-Bitwise AND:
+Bitwise AND
@example
mysql> SELECT 29 & 15;
-> 13
@@ -32713,6 +33235,21 @@ mysql> SELECT 29 & 15;
The result is an unsigned 64-bit integer.
+@findex ^ (bitwise XOR)
+@findex XOR, bitwise
+@item ^
+Bitwise XOR
+@example
+mysql> SELECT 1 ^ 1;
+ -> 0
+mysql> SELECT 1 ^ 0;
+ -> 1
+mysql> SELECT 11 ^ 3;
+ -> 8
+@end example
+
+The result is an unsigned 64-bit integer.
+
@findex << (left shift)
@item <<
Shifts a longlong (@code{BIGINT}) number to the left:
@@ -32828,7 +33365,7 @@ If @code{crypt()} is not available on your system, @code{ENCRYPT()} always
returns @code{NULL}.
@code{ENCRYPT()} ignores all but the first 8 characters of @code{str}, at
-least on some systems. This will be determined by the behavior of the
+least on some systems. This will be determined by the behaviour of the
underlying @code{crypt()} system call.
@findex ENCODE()
@@ -32847,21 +33384,79 @@ password. @code{crypt_str} should be a string returned from
@findex MD5()
@item MD5(string)
-Calculates a MD5 checksum for the string. Value is returned as a 32 long
-hex number that may, for example, be used as a hash key:
+Calculates an MD5 128 bit checksum for the string. The value is returned
+as a 32 digit hex number that may, for example, be used as a hash key:
@example
mysql> SELECT MD5("testing");
-> 'ae2b1fca515949e5d54fb22b8ed95575'
@end example
-This is an "RSA Data Security, Inc. MD5 Message-Digest Algorithm".
+This is the "RSA Data Security, Inc. MD5 Message-Digest Algorithm".
+
+@findex SHA1()
+@findex SHA()
+@item SHA1(string)
+@itemx SHA(string)
+Calculates an SHA1 160 bit checksum for the string, as described in
+RFC 3174 (Secure Hash Algorithm). The value is returned as a 40 digit
+hex number, or @code{NULL} in case the input argument was @code{NULL}.
+One of the possible uses for this function is as a hash key. You can
+also use it as cryptographically safe function for storing passwords.
+
+@example
+mysql> SELECT SHA1("abc");
+ -> 'a9993e364706816aba3e25717850c26c9cd0d89d'
+@end example
+
+@code{SHA1()} was added in version 4.0.2, and can be considered
+a cryptographically more secure equivalent of @code{MD5()}.
+@code{SHA()} is synonym for @code{SHA1()}.
+
+@findex AES_ENCRYPT()
+@findex AES_DECRYPT()
+@item AES_ENCRYPT(string,key_string)
+@itemx AES_DECRYPT(string,key_string)
+These functions allow encryption/decryption of data using the official
+AES (Advanced Encryption Standard) algorithm, previously known as Rijndael.
+Encoding with 128 bit key length is used, but you can extend it up to
+256 bit by patching the source. We chose 128 bits because it is much
+faster and it is usually secure enough.
+
+The input arguments may be any length. If either argument is @code{NULL},
+the result of this function is also @code{NULL}.
+
+As AES is a block level algorithm, padding is used to encode uneven length
+strings and so the result string length may be calculated as
+16*(trunc(string_length/16)+1).
+
+If @code{AES_DECRYPT()} detects invalid data or incorrect padding, it
+will return @code{NULL}. However, it is possible for @code{AES_DECRYPT()}
+to return a non-@code{NULL} value (possibly garbage) if the input data or
+the key was invalid.
+
+You can use the AES functions to store data in an encrypted form by
+modifying your queries:
+@example
+INSERT INTO t VALUES (1,AES_ENCRYPT("text","password"));
+@end example
+
+You can get even more security by avoiding transferring the key over the
+connection for each query, which can be accomplished by storing it in a
+server side variable at connection time:
+@example
+SELECT @@password:="my password";
+INSERT INTO t VALUES (1,AES_ENCRYPT("text",@@password));
+@end example
+
+@code{AES_ENCRYPT()} and @code{AES_DECRYPT()} were added in version 4.0.2,
+and can be considered the most cryptographically secure encryption
+functions currently available in MySQL.
@findex DES_ENCRYPT()
@item DES_ENCRYPT(string_to_encrypt [, (key_number | key_string) ] )
-Encrypts the string with the given key using the DES algorithm, which
-provides strong encryption.
+Encrypts the string with the given key using the DES algorithm.
Note that this function only works if you have configured MySQL with
SSL support. @xref{Secure connections}.
@@ -32927,7 +33522,7 @@ If no @code{key_string} argument is given, @code{DES_DECRYPT()} examines
the first byte of the encrypted string to determine the DES key number
that was used to encrypt the original string, then reads the key
from the @code{des-key-file} to decrypt the message. For this to work
-the user must have the @strong{process} privilege.
+the user must have the @code{SUPER} privilege.
If you pass this function a @code{key_string} argument, that string
is used as the key for decrypting the message.
@@ -32960,9 +33555,9 @@ the same @code{INSERT} statement against some other server.
@cindex sequence emulation
If @code{expr} is given as an argument to @code{LAST_INSERT_ID()}, then
-the value of the argument is returned by the function, is set as the
-next value to be returned by @code{LAST_INSERT_ID()} and used as the next
-@code{AUTO_INCREMENT} value. This can be used to simulate sequences:
+the value of the argument is returned by the function, and is set as the
+next value to be returned by @code{LAST_INSERT_ID()}. This can be used
+to simulate sequences:
First create the table:
@@ -32979,16 +33574,16 @@ mysql> UPDATE sequence SET id=LAST_INSERT_ID(id+1);
You can generate sequences without calling @code{LAST_INSERT_ID()}, but the
utility of using the function this way is that the ID value is maintained in
-the server as the last automatically generated value. You can retrieve the
-new ID as you would read any normal @code{AUTO_INCREMENT} value in
-MySQL. For example, @code{LAST_INSERT_ID()} (without an argument)
-will return the new ID. The C API function @code{mysql_insert_id()}
-can also be used to get the value.
+the server as the last automatically generated value (multi-user safe).
+You can retrieve the new ID as you would read any normal
+@code{AUTO_INCREMENT} value in MySQL. For example, @code{LAST_INSERT_ID()}
+(without an argument) will return the new ID. The C API function
+@code{mysql_insert_id()} can also be used to get the value.
-Note that as @code{mysql_insert_id()} is only updated after
-@code{INSERT} and @code{UPDATE} statements, you can't use this function
-to retrieve the value for @code{LAST_INSERT_ID(expr)} after executing
-other SQL statements like @code{SELECT} or @code{SET}.
+Note that as @code{mysql_insert_id()} is only updated after @code{INSERT}
+and @code{UPDATE} statements, so you can't use the C API function to
+retrieve the value for @code{LAST_INSERT_ID(expr)} after executing other
+SQL statements like @code{SELECT} or @code{SET}.
@findex FORMAT()
@@ -33045,6 +33640,8 @@ string to perform cooperative advisory locking:
@example
mysql> SELECT GET_LOCK("lock1",10);
-> 1
+mysql> SELECT IS_FREE_LOCK("lock2");
+ -> 1
mysql> SELECT GET_LOCK("lock2",10);
-> 1
mysql> SELECT RELEASE_LOCK("lock2");
@@ -33069,6 +33666,13 @@ been released.
The @code{DO} statement is convinient to use with @code{RELEASE_LOCK()}.
@xref{DO}.
+@findex IS_FREE_LOCK()
+@item IS_FREE_LOCK(str)
+Checks if the the lock named @code{str} is free to use (i.e., not locked).
+Returns @code{1} if the lock is free (no one is using the lock),
+@code{0} if the lock is in use, and
+@code{NULL} on errors (like incorrect arguments).
+
@findex BENCHMARK()
@item BENCHMARK(count,expr)
The @code{BENCHMARK()} function executes the expression @code{expr}
@@ -33147,6 +33751,8 @@ Note that if you are using @code{SELECT SQL_CALC_FOUND_ROWS ...} MySQL has
to calculate all rows in the result set. However, this is faster than
if you would not use @code{LIMIT}, as the result set need not be sent
to the client.
+
+@code{SQL_CALC_FOUND_ROWS} is available starting at MySQL version 4.0.0.
@end table
@@ -33198,7 +33804,7 @@ mysql> SELECT COUNT(DISTINCT results) FROM student;
In MySQL you can get the number of distinct expression
combinations that don't contain NULL by giving a list of expressions.
In ANSI SQL you would have to do a concatenation of all expressions
-inside @code{CODE(DISTINCT ...)}.
+inside @code{COUNT(DISTINCT ...)}.
@findex AVG()
@item AVG(expr)
@@ -33340,7 +33946,7 @@ SELECT [STRAIGHT_JOIN]
[INTO @{OUTFILE | DUMPFILE@} 'file_name' export_options]
[FROM table_references
[WHERE where_definition]
- [GROUP BY @{unsigned_integer | col_name | formula@} [ASC | DESC], ...]
+ [GROUP BY @{unsigned_integer | col_name | formula@} [ASC | DESC], ...
[HAVING where_definition]
[ORDER BY @{unsigned_integer | col_name | formula@} [ASC | DESC] ,...]
[LIMIT [offset,] rows]
@@ -33524,7 +34130,7 @@ FOUND_ROWS()}. @xref{Miscellaneous functions}.
@item
@code{SQL_CACHE} tells MySQL to store the query result in the query cache
-if you are using @code{SQL_QUERY_CACHE_TYPE=2} (@code{DEMAND}).
+if you are using @code{QUERY_CACHE_TYPE=2} (@code{DEMAND}).
@xref{Query Cache}.
@item
@@ -33569,6 +34175,13 @@ The offset of the initial row is 0 (not 1):
mysql> SELECT * FROM table LIMIT 5,10; # Retrieve rows 6-15
@end example
+To retrieve all rows from a certain offset upto the end of the result set,
+you can use -1 for the second parameter:
+
+@example
+mysql> SELECT * FROM table LIMIT 95,-1; # Retrieve rows 96-last.
+@end example
+
If one argument is given, it indicates the maximum number of rows to return:
@example
@@ -33583,7 +34196,7 @@ The @code{SELECT ... INTO OUTFILE 'file_name'} form of @code{SELECT} writes
the selected rows to a file. The file is created on the server host and
cannot already exist (among other things, this prevents database tables and
files such as @file{/etc/passwd} from being destroyed). You must have the
-@strong{file} privilege on the server host to use this form of @code{SELECT}.
+@code{FILE} privilege on the server host to use this form of @code{SELECT}.
@code{SELECT ... INTO OUTFILE} is mainly intended to let you very
quickly dump a table on the server machine. If you want to create the
@@ -33833,6 +34446,11 @@ SELECT ...
@code{UNION} is used to combine the result from many @code{SELECT}
statements into one result set.
+The columns listed in the select_expression portion of the @code{SELECT}
+should have the same type. The column names used in the first
+@code{SELECT} query will be used as the column names for the results
+returned.
+
The @code{SELECT} commands are normal select commands, but with the following
restrictions:
@@ -33872,8 +34490,7 @@ HANDLER tbl_name CLOSE
@end example
The @code{HANDLER} statement provides direct access to the @code{MyISAM} table
-handler interface, bypassing the SQL optimiser. Thus, it is faster than
-@code{SELECT}.
+handler interface.
The first form of @code{HANDLER} statement opens a table, making
it accessible via subsequent @code{HANDLER ... READ} statements.
@@ -33907,6 +34524,34 @@ means that after a @code{HANDLER ... OPEN} is issued, table data can be
modified (by this or any other thread) and these modifications may appear
only partially in @code{HANDLER ... NEXT} or @code{HANDLER ... PREV} scans.
+The reasons to use this interface instead of normal SQL are:
+
+@itemize @bullet
+@item
+It's faster than @code{SELECT} because:
+@itemize @bullet
+@item
+A designated table handler is allocated for the thread in @code{HANDLER open}.
+@item
+There is less parsing involved.
+@item
+No optimiser and no query checking overhead.
+@item
+The used table doesn't have to be locked between two handler requests.
+@item
+The handler interface doesn't have to provide a consistent look of the
+data (for example dirty-reads are allow), which allows the table handler
+to do optimisations that SQL doesn't normally allow.
+@end itemize
+@item
+It makes it much easier to port applications that uses an ISAM like
+interface to MySQL.
+@item
+It allows one to traverse a database in a manner that is not easy
+(in some case impossible) to do with SQL. The handler interface is
+more natural way to look at data when working with applications that
+provide an interactive user interfaces to the database.
+@end itemize
@node INSERT, INSERT DELAYED, HANDLER, Data Manipulation
@subsection @code{INSERT} Syntax
@@ -33916,13 +34561,13 @@ only partially in @code{HANDLER ... NEXT} or @code{HANDLER ... PREV} scans.
@example
INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
[INTO] tbl_name [(col_name,...)]
- VALUES (expression,...),(...),...
+ VALUES ((expression | DEFAULT),...),(...),...
or INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
[INTO] tbl_name [(col_name,...)]
SELECT ...
or INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
[INTO] tbl_name
- SET col_name=expression, col_name=expression, ...
+ SET col_name=(expression | DEFAULT), ...
@end example
@@ -33952,6 +34597,14 @@ example, if you specify a column list that doesn't name all the columns in
the table, unnamed columns are set to their default values. Default value
assignment is described in @ref{CREATE TABLE, , @code{CREATE TABLE}}.
+You can also use the keyword @code{DEFAULT} to set a column to its
+default value. (New in MySQL 4.0.3.) This makes it easier to write
+@code{INSERT} statements that assign values to all but a few columns,
+because it allows you to avoid writing an incomplete @code{VALUES()} list
+(a list that does not include a value for each column in the table).
+Otherwise, you would have to write out the list of column names
+corresponding to each value in the @code{VALUES()} list.
+
MySQL always has a default value for all fields. This is something
that is imposed on MySQL to be able to work with both transactional
and not transactional tables.
@@ -34074,7 +34727,7 @@ The target table of the @code{INSERT} statement cannot appear in the
forbidden in ANSI SQL to @code{SELECT} from the same table into which you are
inserting. (The problem is that the @code{SELECT} possibly would
find records that were inserted earlier during the same run. When using
-sub-select clauses, the situation could easily be very confusing!)
+subselect clauses, the situation could easily be very confusing!)
@item
@code{AUTO_INCREMENT} columns work as usual.
@@ -34435,9 +35088,10 @@ or REPLACE [LOW_PRIORITY | DELAYED]
@end example
@code{REPLACE} works exactly like @code{INSERT}, except that if an old
-record in the table has the same value as a new record on a unique index,
-the old record is deleted before the new record is inserted.
-@xref{INSERT, , @code{INSERT}}.
+record in the table has the same value as a new record on a @code{UNIQUE}
+index or @code{PRIMARY KEY}, the old record is deleted before the new
+record is inserted.
+@xref{INSERT, ,@code{INSERT}}.
In other words, you can't access the values of the old row from a
@code{REPLACE} statement. In some old MySQL versions it appeared that
@@ -34451,6 +35105,10 @@ This fact makes it easy to determine whether @code{REPLACE} added
or replaced a row: check whether the affected-rows value is 1 (added)
or 2 (replaced).
+Note that unless you use a @code{UNIQUE} index or @code{PRIMARY KEY},
+using a @code{REPLACE} command makes no sense, since it would just do
+an @code{INSERT}.
+
@node LOAD DATA, DO, REPLACE, Data Manipulation
@subsection @code{LOAD DATA INFILE} Syntax
@@ -34480,7 +35138,7 @@ MySQL Version 3.22.6 or later.)
For security reasons, when reading text files located on the server, the
files must either reside in the database directory or be readable by all.
Also, to use @code{LOAD DATA INFILE} on server files, you must have the
-@strong{file} privilege on the server host.
+@code{FILE} privilege on the server host.
@xref{Privileges provided}.
In MySQL 3.23.49 and MySQL 4.0.2 @code{LOCAL} will only work if you have
@@ -34500,7 +35158,7 @@ the table at the same time.
Using @code{LOCAL} will be a bit slower than letting the server access the
files directly, because the contents of the file must travel from the client
host to the server host. On the other hand, you do not need the
-@strong{file} privilege to load local files.
+@code{FILE} privilege to load local files.
@c old version
If you are using MySQL before Version 3.23.24 you can't read from a
@@ -34554,7 +35212,7 @@ file is ignored.
If you load data from a local file using the @code{LOCAL} keyword, the server
has no way to stop transmission of the file in the middle of the operation,
-so the default bahavior is the same as if @code{IGNORE} is specified.
+so the default behaviour is the same as if @code{IGNORE} is specified.
If you use @code{LOAD DATA INFILE} on an empty @code{MyISAM} table,
all non-unique indexes are created in a separate batch (like in @code{REPAIR}).
@@ -35011,6 +35669,8 @@ You can also create databases with @code{mysqladmin}.
@subsection @code{DROP DATABASE} Syntax
@findex DROP DATABASE
+@cindex deleting, database
+@cindex database, deleting
@example
DROP DATABASE [IF EXISTS] db_name
@@ -35148,7 +35808,9 @@ you create a table. A temporary table will automatically be deleted if a
connection dies and the name is per connection. This means that two different
connections can both use the same temporary table name without conflicting
with each other or with an existing table of the same name. (The existing table
-is hidden until the temporary table is deleted.)
+is hidden until the temporary table is deleted.). In MySQL 4.0.2 one must
+have the @code{CREATE TEMPORARY TABLES} privilege to be able to create
+temporary tables.
In MySQL Version 3.23 or later, you can use the keywords
@code{IF NOT EXISTS} so that an error does not occur if the table already
@@ -35228,6 +35890,9 @@ value.
@item
@cindex default values
+A @code{DEFAULT} value has to be a constant, it can not be a function or
+an expression.
+
If no @code{DEFAULT} value is specified for a column, MySQL
automatically assigns one.
@@ -35335,11 +36000,11 @@ Indexing always happens over the entire column, partial indexing is not
supported. See @ref{Fulltext Search} for details of operation.
@item
-The @code{FOREIGN KEY}, @code{CHECK}, and @code{REFERENCES} clauses don't
-actually do anything. The syntax for them is provided only for compatibility,
-to make it easier to port code from other SQL servers and to run applications
-that create tables with references.
-@xref{Differences from ANSI}.
+In MySQL Version 3.23.44 or later, @code{InnoDB} tables support checking of
+foreign key constraints. @xref{InnoDB}.
+For other table types, MySQL Server does parse the @code{FOREIGN KEY},
+@code{CHECK}, and @code{REFERENCES} syntax in @code{CREATE TABLE} commands,
+but without further action being taken. @xref{ANSI diff Foreign Keys}.
@item
Each @code{NULL} column takes one bit extra, rounded up to the nearest byte.
@@ -35362,7 +36027,7 @@ The different table types are:
@multitable @columnfractions .25 .70
@item @strong{Table type} @tab @strong{Description}
-@item BDB or Berkeley_db @tab Transaction-safe tables with page locking. @xref{BDB}.
+@item BDB or BerkeleyDB @tab Transaction-safe tables with page locking. @xref{BDB}.
@item HEAP @tab The data for this table is only stored in memory. @xref{HEAP}.
@item ISAM @tab The original table handler. @xref{ISAM}.
@item InnoDB @tab Transaction-safe tables with row locking. @xref{InnoDB}.
@@ -35378,7 +36043,7 @@ specified. For example, if @code{TYPE=BDB} is specified, and that distribution
of MySQL does not support @code{BDB} tables, the table will be created
as @code{MyISAM} instead.
-The other table options are used to optimise the behavior of the
+The other table options are used to optimise the behaviour of the
table. In most cases, you don't have to specify any of them.
The options work for all table types, if not otherwise indicated:
@@ -35514,8 +36179,8 @@ to the datafile, the @code{RAID} handler will map the first
tables as one. This only works with @code{MERGE} tables.
@xref{MERGE, , @code{MERGE}}.
-For the moment you need to have @strong{select}, @strong{update}, and
-@strong{delete} privileges on the tables you map to a @code{MERGE} table.
+For the moment you need to have @code{SELECT}, @code{UPDATE}, and
+@code{DELETE} privileges on the tables you map to a @code{MERGE} table.
All mapped tables must be in the same database as the @code{MERGE} table.
@item
@@ -35597,6 +36262,8 @@ using @code{myisampack}. @xref{Compressed format}.
@subsection @code{ALTER TABLE} Syntax
@findex ALTER TABLE
+@cindex changing, table
+@cindex table, changing
@example
ALTER [IGNORE] TABLE tbl_name alter_spec [, alter_spec ...]
@@ -35656,8 +36323,8 @@ slowest part of the recreation process) by setting the
@itemize @bullet
@item
-To use @code{ALTER TABLE}, you need @strong{alter}, @strong{insert},
-and @strong{create} privileges on the table.
+To use @code{ALTER TABLE}, you need @code{ALTER}, @code{INSERT},
+and @code{CREATE} privileges on the table.
@item
@code{IGNORE} is a MySQL extension to ANSI SQL92.
@@ -35732,10 +36399,16 @@ MySQL tries to convert data to the new type as well as possible.
@item
In MySQL Version 3.22 or later, you can use @code{FIRST} or
-@code{ADD ... AFTER col_name} to add a column at a specific position within
-a table row. The default is to add the column last.
+@code{ADD ... AFTER col_name} to add a column at a specific position
+within a table row. The default is to add the column last.
+From MySQL Version 4.0.1, you can also use the @code{FIRST} and
+@code{AFTER} keywords in @code{CHANGE} or @code{MODIFY}.
@findex ALTER COLUMN
+@cindex changing, column
+@cindex column, changing
+@cindex changing, field
+@cindex field, changing
@item
@code{ALTER COLUMN} specifies a new default value for a column
or removes the old default value.
@@ -35745,6 +36418,8 @@ assigns a default value, as described in
@ref{CREATE TABLE, , @code{CREATE TABLE}}.
@findex DROP INDEX
+@cindex deleting, index
+@cindex index, deleting
@item
@code{DROP INDEX} removes an index. This is a MySQL extension to
ANSI SQL92. @xref{DROP INDEX}.
@@ -35759,6 +36434,8 @@ If a table contains only one column, the column cannot be dropped.
If what you intend is to remove the table, use @code{DROP TABLE} instead.
@findex DROP PRIMARY KEY
+@cindex deleting, primary key
+@cindex primary key, deleting
@item
@code{DROP PRIMARY KEY} drops the primary index. If no such
index exists, it drops the first @code{UNIQUE} index in the table.
@@ -35783,6 +36460,8 @@ option after big changes to the table, you may be able to get higher
performance.
@findex ALTER TABLE
+@cindex changing, table
+@cindex table, changing
@item
If you use @code{ALTER TABLE} on a @code{MyISAM} table, all non-unique
indexes are created in a separate batch (like in @code{REPAIR}).
@@ -35913,8 +36592,8 @@ RENAME TABLE current_db.tbl_name TO other_db.tbl_name;
@end example
When you execute @code{RENAME}, you can't have any locked tables or
-active transactions. You must also have the @strong{alter} and @strong{drop}
-privileges on the original table, and the @strong{create} and @strong{insert}
+active transactions. You must also have the @code{ALTER} and @code{DROP}
+privileges on the original table, and the @code{CREATE} and @code{INSERT}
privileges on the new table.
If MySQL encounters any errors in a multiple-table rename, it
@@ -35927,6 +36606,8 @@ to the original state.
@subsection @code{DROP TABLE} Syntax
@findex DROP TABLE
+@cindex deleting, table
+@cindex table, deleting
@example
DROP TABLE [IF EXISTS] tbl_name [, tbl_name,...] [RESTRICT | CASCADE]
@@ -36008,6 +36689,8 @@ are available in MySQL Version 3.23.23 and later.
@subsection @code{DROP INDEX} Syntax
@findex DROP INDEX
+@cindex deleting, index
+@cindex index, deleting
@example
DROP INDEX index_name ON tbl_name
@@ -36185,6 +36868,12 @@ are locked by the current thread are automatically unlocked when the
thread issues another @code{LOCK TABLES}, or when the connection to the
server is closed.
+To use @code{LOCK TABLES} in MySQL 4.0.2 you need the global
+@code{LOCK TABLES} privilege and a @code{SELECT} privilege on the
+involved tables. In MySQL 3.23 you need to have @code{SELECT},
+@code{insert}, @code{DELETE} and @code{UPDATE} privileges for the
+tables.
+
The main reasons to use @code{LOCK TABLES} are for emulating transactions
or getting more speed when updating tables. This is explained in more
detail later.
@@ -36318,10 +37007,10 @@ SET [GLOBAL | SESSION] TRANSACTION ISOLATION LEVEL
Sets the transaction isolation level for the global, whole session or
the next transaction.
-The default behavior is to set the isolation level for the next (not
+The default behaviour is to set the isolation level for the next (not
started) transaction. If you use the @code{GLOBAL} keyword, the statement
sets the default transaction level globally for all new connections
-created from that point on. You will need the @strong{process}
+created from that point on. You will need the @code{SUPER}
privilege to do do this. Using the @code{SESSION} keyword sets the
default transaction level for all future transactions performed on the
current connection.
@@ -36467,7 +37156,7 @@ Empty set (0.00 sec)
The search for the word @code{MySQL} produces no results in the above
example, because that word is present in more than half the rows. As such,
it is effectively treated as a stopword (that is, a word with zero semantic
-value). This is the most desirable behavior -- a natural language query
+value). This is the most desirable behaviour -- a natural language query
should not return every second row from a 1GB table.
A word that matches half of rows in a table is less likely to locate relevant
@@ -36586,10 +37275,10 @@ The argument to @code{AGAINST()} must be a constant string.
Unfortunately, full-text search has few user-tunable parameters yet,
although adding some is very high on the TODO. If you have a
MySQL source distribution (@pxref{Installing source}), you can
-exert more control over full-text searching behavior.
+exert more control over full-text searching behaviour.
Note that full-text search was carefully tuned for the best searching
-effectiveness. Modifying the default behavior will, in most cases,
+effectiveness. Modifying the default behaviour will, in most cases,
only make the search results worse. Do not alter the MySQL sources
unless you know what you are doing!
@@ -36597,7 +37286,7 @@ unless you know what you are doing!
@item
The minimum length of words to be indexed is defined by the MySQL
-variable @code{ft_min_word_length}. @xref{SHOW VARIABLES}.
+variable @code{ft_min_word_len}. @xref{SHOW VARIABLES}.
Change it to the value you prefer, and rebuild your @code{FULLTEXT} indexes.
(This variable is only available from MySQL version 4.0.)
@@ -36659,28 +37348,26 @@ parameters to @code{FULLTEXT} in @code{CREATE/ALTER TABLE}).
From version 4.0.1, @code{MySQL server} features a @code{Query Cache}.
When in use, the query cache stores the text of a @code{SELECT} query
-together with the corresponding result that is sent to a client.
-If another identical query is received, the server can then retrieve
+together with the corresponding result that was sent to the client.
+If an identical query is later received, the server will retrieve
the results from the query cache rather than parsing and executing the
same query again.
+@strong{NOTE:} The query cache does not return stale data. When data
+is modified, any relevant entries in the query cache are flushed.
+
The query cache is extremely useful in an environment where (some)
tables don't change very often and you have a lot of identical queries.
This is a typical situation for many web servers that use a lot of
dynamic content.
-Following are some performance data for the query cache
-(We got these by running the MySQL benchmark suite on a Linux Alpha
-2x500 MHz with 2GB RAM and a 64MB query cache):
+Below is some performance data for the query cache. (These results were
+generated by running the MySQL benchmark suite on a Linux Alpha
+2 x 500 MHz with 2GB RAM and a 64MB query cache):
@itemize @bullet
@item
-If you want to disable the query cache code set @code{query_cache_size=0}.
-By disabling the query cache code there is no noticeable overhead.
-(query cache can be excluded from code with help of configure option
-@code{--without-query-cache})
-@item
-If all of the queries you're preforming are simple (such as selecting a
+If all of the queries you're performing are simple (such as selecting a
row from a table with one row); but still differ so that the queries can
not be cached, the overhead for having the query cache active is 13%.
This could be regarded as the worst case scenario. However, in real life,
@@ -36690,6 +37377,11 @@ is normally significantly lower.
Searches after one row in a one row table is 238% faster.
This can be regarded as close to the minimum speedup to be expected for
a query that is cached.
+@item
+If you want to disable the query cache code set @code{query_cache_size=0}.
+By disabling the query cache code there is no noticeable overhead.
+(query cache can be excluded from code with help of configure option
+@code{--without-query-cache})
@end itemize
@menu
@@ -36773,8 +37465,9 @@ of the form @code{SELECT * FROM AUTOINCREMENT_FIELD IS NULL}
However, @code{FOUND ROWS()} will return the correct value,
even if the preceding query was fetched from the cache.
-Queries that don't use any tables or if the user has a column privilege for
-any of the involved tables are not cached.
+In case a query does not use any tables, or uses temporary tables,
+or if the user has a column privilege for any of the involved tables,
+that query will not be cached.
Before a query is fetched from the query cache, MySQL will check that
the user has SELECT privilege to all the involved databases and
@@ -36795,7 +37488,7 @@ Don't cache results that are bigger than this. (Default 1M).
The memory allocated to store results from old queries.
If this is 0, the query cache is disabled (default).
-@item @code{query_cache_startup_type}
+@item @code{query_cache_type}
This may be set (only numeric) to
@multitable @columnfractions .10 .75
@item @strong{Option} @tab @strong{Description}
@@ -36805,12 +37498,11 @@ This may be set (only numeric) to
@end multitable
@end itemize
-
Inside a thread (connection), the behaviour of the query cache can be
changed from the default. The syntax is as follows:
-@code{SQL_QUERY_CACHE_TYPE = OFF | ON | DEMAND}
-@code{SQL_QUERY_CACHE_TYPE = 0 | 1 | 2}
+@code{QUERY_CACHE_TYPE = OFF | ON | DEMAND}
+@code{QUERY_CACHE_TYPE = 0 | 1 | 2}
@multitable @columnfractions .20 .70
@item @strong{Option} @tab @strong{Description}
@@ -36819,9 +37511,6 @@ changed from the default. The syntax is as follows:
@item 2 or DEMAND @tab Cache only @code{SELECT SQL_CACHE ...} queries.
@end multitable
-By default @code{SQL_QUERY_CACHE_TYPE} depends on the value of
-@code{query_cache_startup_type} when the thread was created.
-
@node Query Cache in SELECT, Query Cache Status and Maintenance, Query Cache Configuration, Query Cache
@subsection Query Cache Options in @code{SELECT}
@@ -36835,9 +37524,9 @@ specified in a @code{SELECT} query:
@multitable @columnfractions .20 .80
@item @strong{Option} @tab @strong{Description}
@item @code{SQL_CACHE}
- @tab If @code{SQL_QUERY_CACHE_TYPE} is @code{DEMAND}, allow the query to be cached.
- If @code{SQL_QUERY_CACHE_TYPE} is @code{ON}, this is the default.
- If @code{SQL_QUERY_CACHE_TYPE} is @code{OFF}, do nothing.
+ @tab If @code{QUERY_CACHE_TYPE} is @code{DEMAND}, allow the query to be cached.
+ If @code{QUERY_CACHE_TYPE} is @code{ON}, this is the default.
+ If @code{QUERY_CACHE_TYPE} is @code{OFF}, do nothing.
@item @code{SQL_NO_CACHE}
@tab Make this query non-cachable, don't allow this query to be stored in the cache.
@end multitable
@@ -36866,7 +37555,7 @@ You can monitor query cache performance in @code{SHOW STATUS}:
@tab Number of cache hits.
@item @code{Qcache_not_cached}
@tab Number of non-cached queries
- (not cachable, or due to @code{SQL_QUERY_CACHE_TYPE}).
+ (not cachable, or due to @code{QUERY_CACHE_TYPE}).
@item @code{Qcache_free_memory}
@tab Amount of free memory for query cache.
@item @code{Qcache_total_blocks}
@@ -36893,7 +37582,7 @@ only one block needs to be allocated.
@cindex table types, choosing
@cindex @code{BDB} table type
-@cindex @code{Berkeley_db} table type
+@cindex @code{BerkeleyDB} table type
@cindex @code{HEAP} table type
@cindex @code{ISAM} table type
@cindex @code{InnoDB} table type
@@ -36967,17 +37656,17 @@ You can combine TST and NTST tables in the same statements to get the best
of both worlds.
@menu
-* MyISAM:: MyISAM tables
-* MERGE:: MERGE tables
-* ISAM:: ISAM tables
-* HEAP:: HEAP tables
-* InnoDB:: InnoDB tables
-* BDB:: BDB or Berkeley_db tables
+* MyISAM:: @code{MyISAM} tables
+* MERGE:: @code{MERGE} tables
+* ISAM:: @code{ISAM} tables
+* HEAP:: @code{HEAP} tables
+* InnoDB:: @code{InnoDB} tables
+* BDB:: @code{BDB} or @code{BerkeleyDB} tables
@end menu
@node MyISAM, MERGE, Table types, Table types
-@section MyISAM Tables
+@section @code{MyISAM} Tables
@code{MyISAM} is the default table type in MySQL Version 3.23. It's
based on the @code{ISAM} code and has a lot of useful extensions.
@@ -37028,10 +37717,10 @@ compression.
Internal handling of one @code{AUTO_INCREMENT} column. @code{MyISAM}
will automatically update this on @code{INSERT/UPDATE}. The
@code{AUTO_INCREMENT} value can be reset with @code{myisamchk}. This
-will make @code{AUTO_INCREMENT} columns faster (at least 10 %) and old
+will make @code{AUTO_INCREMENT} columns faster (at least 10%) and old
numbers will not be reused as with the old @code{ISAM}. Note that when an
@code{AUTO_INCREMENT} is defined on the end of a multi-part-key the old
-behavior is still present.
+behaviour is still present.
@item
When inserted in sorted order (as when you are using an @code{AUTO_INCREMENT}
column) the key tree will be split so that the high node only contains one
@@ -37091,24 +37780,25 @@ Note that index files are usually much smaller with @code{MyISAM} than with
system resources than @code{ISAM}, but will need more CPU time when inserting
data into a compressed index.
-The following options to @code{mysqld} can be used to change the behavior of
+The following options to @code{mysqld} can be used to change the behaviour of
@code{MyISAM} tables. @xref{SHOW VARIABLES}.
@multitable @columnfractions .40 .60
@item @strong{Option} @tab @strong{Description}
@item @code{--myisam-recover=#} @tab Automatic recovery of crashed tables.
@item @code{-O myisam_sort_buffer_size=#} @tab Buffer used when recovering tables.
-@item @code{--delay-key-write-for-all-tables} @tab Don't flush key buffers between writes for any MyISAM table
-@item @code{-O myisam_max_extra_sort_file_size=#} @tab Used to help MySQL to decide when to use the slow but safe key cache index create method. @strong{Note} that this parameter is given in megabytes!
-@item @code{-O myisam_max_sort_file_size=#} @tab Don't use the fast sort index method to created index if the temporary file would get bigger than this. @strong{Note} that this paramter is given in megabytes!
-@item @code{-O myisam_bulk_insert_tree_size=#} @tab Size of tree cache used in bulk insert optimisation. @strong{Note} that this is a limit @strong{per thread}!
+@item @code{--delay-key-write=ALL} @tab Don't flush key buffers between writes for any MyISAM table
+@item @code{-O myisam_max_extra_sort_file_size=#} @tab Used to help MySQL to decide when to use the slow but safe key cache index create method. @strong{Note} that this parameter is given in megabytes before 4.0.3 and in bytes starting from this version.
+@item @code{-O myisam_max_sort_file_size=#} @tab Don't use the fast sort index method to created index if the temporary file would get bigger than this. @strong{Note} that this parameter is given in megabytes before 4.0.3 and in bytes starting from this version.
+@item @code{-O bulk_insert_buffer_size=#} @tab Size of tree cache used in bulk insert optimisation. @strong{Note} that this is a limit @strong{per thread}!
@end multitable
The automatic recovery is activated if you start @code{mysqld} with
@code{--myisam-recover=#}. @xref{Command-line options}.
On open, the table is checked if it's marked as crashed or if the open
count variable for the table is not 0 and you are running with
-@code{--skip-locking}. If either of the above is true the following happens.
+@code{--skip-external-locking}. If either of the above is true the following
+happens.
@itemize @bullet
@item
@@ -37142,7 +37832,7 @@ Warning: Found 344 of 354 rows when repairing ./test/g00pages
@end example
Note that if you run automatic recover with the @code{BACKUP} option,
-you should have a cron script that automatically moves file with names
+you should have a @code{cron} script that automatically moves file with names
like @file{tablename-datetime.BAK} from the database directories to a
backup media.
@@ -37150,8 +37840,8 @@ backup media.
@menu
* Key space:: Space needed for keys
-* MyISAM table formats:: MyISAM table formats
-* MyISAM table problems:: MyISAM table problems.
+* MyISAM table formats:: @code{MyISAM} Table Formats
+* MyISAM table problems:: @code{MyISAM} Table Problems
@end menu
@@ -37181,14 +37871,14 @@ high-byte first.
@node MyISAM table formats, MyISAM table problems, Key space, MyISAM
-@subsection MyISAM Table Formats
+@subsection @code{MyISAM} Table Formats
@code{MyISAM} supports 3 different table types. Two of them are chosen
automatically depending on the type of columns you are using. The third,
compressed tables, can only be created with the @code{myisampack} tool.
When you @code{CREATE} or @code{ALTER} a table you can for tables that
-doesn't have @code{BLOB}'s force the table format to @code{DYNAMIC} or
+doesn't have @code{BLOB}s force the table format to @code{DYNAMIC} or
@code{FIXED} with the @code{ROW_FORMAT=#} table option. In the future
you will be able to compress/decompress tables by specifying
@code{ROW_FORMAT=compressed | default} to @code{ALTER TABLE}.
@@ -37355,20 +38045,20 @@ Can be uncompressed with @code{myisamchk}.
@node MyISAM table problems, , MyISAM table formats, MyISAM
-@subsection MyISAM table problems.
+@subsection @code{MyISAM} Table Problems
The file format that MySQL uses to store data has been extensively
tested, but there are always circumstances that may cause database tables
to become corrupted.
@menu
-* Corrupted MyISAM tables:: Corrupted MyISAM tables.
+* Corrupted MyISAM tables:: Corrupted @code{MyISAM} Tables
* MyISAM table close:: Clients is using or hasn't closed the table properly
@end menu
@node Corrupted MyISAM tables, MyISAM table close, MyISAM table problems, MyISAM table problems
-@subsubsection Corrupted MyISAM tables.
+@subsubsection Corrupted @code{MyISAM} Tables
Even if the MyISAM table format is very reliable (all changes to a table
is written before the SQL statements returns) , you can still get
@@ -37475,7 +38165,7 @@ is not signaled to the other servers.
@node MERGE, ISAM, MyISAM, Table types
-@section MERGE Tables
+@section @code{MERGE} Tables
@cindex tables, merging
@cindex MERGE tables, defined
@@ -37505,8 +38195,8 @@ contains a list of the index files (@file{.MYI} files) that should
be used as one. All used tables must be in the same database as the
@code{MERGE} table itself.
-For the moment, you need to have @strong{select}, @strong{update}, and
-@strong{delete} privileges on the tables you map to a @code{MERGE} table.
+For the moment, you need to have @code{SELECT}, @code{UPDATE}, and
+@code{DELETE} privileges on the tables you map to a @code{MERGE} table.
@code{MERGE} tables can help you solve the following problems:
@@ -37528,7 +38218,7 @@ and use @code{MERGE} table for others. You can even have many
different @code{MERGE} tables active, with possible overlapping files.
@item
More efficient repairs. It's easier to repair the individual files that
-are mapped to a @code{MERGE} file than trying to repair a real big file.
+are mapped to a @code{MERGE} file than trying to repair a really big file.
@item
Instant mapping of many files as one. A @code{MERGE} table uses the
index of the individual tables. It doesn't need to maintain an index of
@@ -37553,8 +38243,8 @@ The disadvantages with @code{MERGE} tables are:
@itemize @bullet
@item
You can only use identical @code{MyISAM} tables for a @code{MERGE} table.
-@item
-@code{AUTO_INCREMENT} columns are not automatically updated on @code{INSERT}.
+@c @item
+@c @code{AUTO_INCREMENT} columns are not automatically updated on @code{INSERT}.
@item
@code{REPLACE} doesn't work.
@item
@@ -37594,13 +38284,13 @@ CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, message CHAR(20));
CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY, message CHAR(20));
INSERT INTO t1 (message) VALUES ("Testing"),("table"),("t1");
INSERT INTO t2 (message) VALUES ("Testing"),("table"),("t2");
-CREATE TABLE total (a INT NOT NULL, message CHAR(20), KEY(a))
+CREATE TABLE total (a INT AUTO_INCREMENT PRIMARY KEY, message CHAR(20))
TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;
@end example
-Note that we didn't create a @code{UNIQUE} or @code{PRIMARY KEY} in the
-@code{total} table as the key isn't going to be unique in the @code{total}
-table.
+@c Note that we didn't create a @code{UNIQUE} or @code{PRIMARY KEY} in the
+@c @code{total} table as the key isn't going to be unique in the @code{total}
+@c table.
Note that you can also manipulate the @file{.MRG} file directly from
the outside of the MySQL server:
@@ -37627,6 +38317,10 @@ mysql> SELECT * FROM total;
+---+---------+
@end example
+Note that the @code{a} column, though declared as @code{PRIMARY KEY},
+is not really unique, as @code{MERGE} table cannot enforce uniqueness
+over a set of underlying @code{MyISAM} tables.
+
To remap a @code{MERGE} table you can do one of the following:
@itemize @bullet
@@ -37641,20 +38335,21 @@ read the new definition file.
@end itemize
@menu
-* MERGE table problems:: MERGE table problems.
+* MERGE table problems:: MERGE Table Problems
@end menu
@node MERGE table problems, , MERGE, MERGE
-@subsection MERGE table problems.
+@subsection @code{MERGE} Table Problems
The following are the known problems with @code{MERGE} tables:
@itemize @bullet
@item
-@code{MERGE} table cannot maintain UNIQUE constraints over the whole
-table. When you do INSERT, the data goes into the first or last table
-(according to @code{INSERT_METHOD=xxx}) and this MyISAM table ensures
-that the data are unique, but it knows nothing about the first MyISAM table.
+A @code{MERGE} table cannot maintain @code{UNIQUE} constraints over the
+whole table. When you do @code{INSERT}, the data goes into the first or
+last table (according to @code{INSERT_METHOD=xxx}) and this @code{MyISAM}
+table ensures that the data are unique, but it knows nothing about
+others @code{MyISAM} tables.
@item
@code{DELETE FROM merge_table} used without a @code{WHERE}
will only clear the mapping for the table, not delete everything in the
@@ -37674,7 +38369,7 @@ different for the tables if there was an old non-unique key in the
table. This is because @code{ALTER TABLE} puts @code{UNIQUE} keys before
normal keys to be able to detect duplicate keys as early as possible.
@item
-The range optimizer can't yet use @code{MERGE} table efficiently and may
+The range optimiser can't yet use @code{MERGE} table efficiently and may
sometimes produce non-optimal joins. This will be fixed in MySQL 4.0.x.
@item
@code{DROP TABLE} on a table that is in use by a @code{MERGE} table will
@@ -37687,7 +38382,7 @@ dropping the table. We will fix this at the same time we introduce
@end itemize
@node ISAM, HEAP, MERGE, Table types
-@section ISAM Tables
+@section @code{ISAM} Tables
@cindex tables, ISAM
@@ -37733,7 +38428,7 @@ mysql> ALTER TABLE tbl_name TYPE = MYISAM;
The embedded MySQL versions doesn't support @code{ISAM} tables.
@node HEAP, InnoDB, ISAM, Table types
-@section HEAP Tables
+@section @code{HEAP} Tables
@cindex tables, @code{HEAP}
@@ -37813,7 +38508,7 @@ SUM_OVER_ALL_KEYS(max_length_of_key + sizeof(char*) * 2)
@node InnoDB, BDB, HEAP, Table types
-@section InnoDB Tables
+@section @code{InnoDB} Tables
@menu
* InnoDB overview:: InnoDB Tables Overview
@@ -37931,13 +38626,22 @@ in the @code{[mysqld]} section of
the configuration file @file{my.cnf}, or on Windows optionally in
@file{my.ini}.
-At the minimum, in 3.23 you must specify @code{innodb_data_file_path}.
+At the minimum, in 3.23 you must specify @code{innodb_data_file_path}
+where you specify the names and the sizes of datafiles. If you do
+not mention @code{innodb_data_home_dir} in @file{my.cnf} the default
+is to create these files to the @code{datadir} of MySQL.
+If you specify @code{innodb_data_home_dir} as an empty string,
+then you can give absolute paths to your data files in
+@code{innodb_data_file_path}.
In MySQL-4.0 you do not need to specify even
@code{innodb_data_file_path}: the default for it is to create
-an auto-extending 16 MB file @file{ibdata1} to the @code{datadir}
+an auto-extending 10 MB file @file{ibdata1} to the @code{datadir}
of MySQL. (In MySQL-4.0.0 and 4.0.1 the datafile is 64 MB and not
auto-extending.)
+If you don't want to use @code{InnoDB} tables, you can add the
+@code{skip-innodb} option to your MySQL option file.
+
But to get good performance you MUST explicitly set the InnoDB parameters
listed in the following examples.
@@ -37953,6 +38657,7 @@ If you specify the last datafile with the autoextend option, InnoDB
will extend the last datafile if it runs out of free space in the
tablespace. The increment is 8 MB at a time. An example:
@example
+innodb_data_home_dir =
innodb_data_file_path = /ibdata/ibdata1:100M:autoextend
@end example
instructs InnoDB to create just a single datafile whose initial size is
@@ -37965,79 +38670,72 @@ the rounded size of @file{ibdata1} explicitly in
@code{innodb_data_file_path}.
After that you can add another datafile:
@example
+innodb_data_home_dir =
innodb_data_file_path = /ibdata/ibdata1:988M;/disk2/ibdata2:50M:autoextend
@end example
Be cautious on filesystems where the maximum file-size is 2 GB!
InnoDB is not aware of the OS maximum file-size. On those filesystems
you might want to specify the max size for the datafile:
@example
+innodb_data_home_dir =
innodb_data_file_path = /ibdata/ibdata1:100M:autoextend:max:2000M
@end example
-Suppose you have a Windows NT computer with 128 MB RAM and a
-single 10 GB hard disk.
-Following is an example of possible configuration parameters in
-@file{my.cnf} or @file{my.ini} for InnoDB:
+@strong{A simple @file{my.cnf} example.} Suppose you have a computer
+with 128 MB RAM and one hard disk. Below is an example of
+possible configuration parameters in @file{my.cnf} or
+@file{my.ini} for InnoDB. We assume you are running
+MySQL-Max-3.23.50 or later, or MySQL-4.0.2 or later.
+This example suits most users, both on Unix and Windows,
+who do not want to distribute InnoDB datafiles and
+log files on several disks. This creates an
+auto-extending data file @file{ibdata1} and two InnoDB log files
+@file{ib_logfile0} and @file{ib_logfile1} to the
+@code{datadir} of MySQL (typically @file{/mysql/data}).
+Also the small archived InnoDB log file
+@file{ib_arch_log_0000000000} ends up in the @code{datadir}.
@example
[mysqld]
# You can write your other MySQL server options here
# ...
-#
-innodb_data_home_dir = c:\ibdata
-# Datafiles must be able to
-# hold your data and indexes
-innodb_data_file_path = ibdata1:2000M;ibdata2:2000M
-# Set buffer pool size to 50 - 80 %
-# of your computer's memory
+# Data file(s) must be able to
+# hold your data and indexes.
+# Make sure you have enough
+# free disk space.
+innodb_data_file_path = ibdata1:10M:autoextend
+# Set buffer pool size to
+# 50 - 80 % of your computer's
+# memory
set-variable = innodb_buffer_pool_size=70M
set-variable = innodb_additional_mem_pool_size=10M
-innodb_log_group_home_dir = c:\iblogs
-# .._log_arch_dir must be the same
-# as .._log_group_home_dir
-innodb_log_arch_dir = c:\iblogs
-innodb_log_archive=0
-set-variable = innodb_log_files_in_group=3
-# Set the log file-size to about
-# 15 % of the buffer pool size
-set-variable = innodb_log_file_size=10M
+# Set the log file size to about
+# 25 % of the buffer pool size
+set-variable = innodb_log_file_size=20M
set-variable = innodb_log_buffer_size=8M
-# Set ..flush_log_at_trx_commit to
-# 0 if you can afford losing
-# a few last transactions
+# Set ..flush_log_at_trx_commit
+# to 0 if you can afford losing
+# some last transactions
innodb_flush_log_at_trx_commit=1
-set-variable = innodb_file_io_threads=4
-set-variable = innodb_lock_wait_timeout=50
@end example
-Note that @code{InnoDB} @strong{does not create directories:
-you must create them yourself.}
-Use the Unix or MS-DOS @code{mkdir} command to create
-the data and log group home directories.
-Check also that the MySQL server
-has @strong{the rights to create files} in the directories you specify.
+@strong{Check that the MySQL server has the rights to create files} in
+@code{datadir}.
-Note that datafiles must be < 2G in
-some filesystems! The combined size of datafiles
-must be >= 10 MB.
-The combined size of the log files must be < 4G.
+Note that datafiles must be < 2G in some file systems!
+The combined size of the log files must be < 4G. The combined
+size of datafiles must be >= 10 MB.
-If you do not specify @code{innodb_data_home_dir}, then
-the default is that InnoDB creates its datafiles to the
-@code{datadir} of MySQL. Then you cannot use absolute
-file paths in @code{innodb_data_file_path}.
+When you for the first time create an InnoDB database, it is
+best that you start the MySQL server from the command prompt.
+Then InnoDB will print the information about the database
+creation to the screen, and you see what is happening.
+See below next section what the printout should look like.
+For example, in Windows you can start @file{mysqld-max.exe} with:
-When you the first time create an InnoDB database, it
-is best that you start the MySQL server from the command
-prompt. Then InnoDB will print the information about the
-database creation to the screen, and you see what is
-happening.
-For example, in Windows you can start @file{mysqld-max.exe} with:
@example
-your-path-to-mysqld>mysqld-max --standalone --console
+your-path-to-mysqld>mysqld-max --console
@end example
-For information about what the printout should look like,
-see @ref{InnoDB init}.
@strong{Where to put @file{my.cnf} or @file{my.ini} in Windows?}
The rules for Windows are the following:
@@ -38072,55 +38770,59 @@ or @file{my.ini}, you can give the path as the first command-line
option to the server:
@code{mysqld --defaults-file=your_path_to_my_cnf}.
-Suppose you have a Linux computer with 512 MB RAM and
-three 20 GB hard disks (at directory paths @file{`/'},
-@file{`/dr2'} and @file{`/dr3'}).
-Here is an example of possible configuration parameters
-in @file{my.cnf} for
-InnoDB:
+InnoDB forms the directory path to a datafile by textually catenating
+@code{innodb_data_home_dir} to a datafile name or path in
+@code{innodb_data_file_path}, adding a possible slash or
+backslash in between if needed. If the keyword
+@code{innodb_data_home_dir} is not mentioned in
+@file{my.cnf} at all, the default for it is the
+'dot' directory @file{./} which means the @code{datadir} of MySQL.
+
+@strong{An advanced @file{my.cnf} example.} Suppose you have a Linux computer
+with 2 GB RAM and three 60 GB hard disks
+(at directory paths @file{/}, @file{/dr2} and
+@file{/dr3}). Below is an example of possible
+configuration parameters in @file{my.cnf} for InnoDB.
+
+@strong{Note that InnoDB does not create directories: you
+have to create them yourself.} Use the Unix or MS-DOS
+@code{mkdir} command to create the data and log group home directories.
@example
[mysqld]
# You can write your other MySQL server options here
# ...
-#
-innodb_data_home_dir = /
-# Datafiles must be able to
+innodb_data_home_dir =
+# Data files must be able to
# hold your data and indexes
-innodb_data_file_path = ibdata/ibdata1:2000M;dr2/ibdata/ibdata2:2000M
-# Set buffer pool size to 50 - 80 %
-# of your computer's memory, but
-# make sure on Linux x86 total
-# memory usage is < 2 GB
-set-variable = innodb_buffer_pool_size=350M
+innodb_data_file_path = /ibdata/ibdata1:2000M;/dr2/ibdata/ibdata2:2000M:autoextend
+# Set buffer pool size to
+# 50 - 80 % of your computer's
+# memory, but make sure on Linux
+# x86 total memory usage is
+# < 2 GB
+set-variable = innodb_buffer_pool_size=1G
set-variable = innodb_additional_mem_pool_size=20M
innodb_log_group_home_dir = /dr3/iblogs
# .._log_arch_dir must be the same
# as .._log_group_home_dir
innodb_log_arch_dir = /dr3/iblogs
-innodb_log_archive=0
set-variable = innodb_log_files_in_group=3
-# Set the log file-size to about
+# Set the log file size to about
# 15 % of the buffer pool size
-set-variable = innodb_log_file_size=50M
+set-variable = innodb_log_file_size=150M
set-variable = innodb_log_buffer_size=8M
# Set ..flush_log_at_trx_commit to
# 0 if you can afford losing
-# a few last transactions
+# some last transactions
innodb_flush_log_at_trx_commit=1
-set-variable = innodb_file_io_threads=4
set-variable = innodb_lock_wait_timeout=50
#innodb_flush_method=fdatasync
-#innodb_fast_shutdown=1
#set-variable = innodb_thread_concurrency=5
@end example
Note that we have placed the two datafiles on different disks.
-The reason for the name @code{innodb_data_file_path} is that
-you can also specify paths to your datafiles, and
-@code{innodb_data_home_dir} is just textually catenated
-before your datafile paths, adding a possible slash or
-backslash in between. InnoDB will fill the tablespace
+InnoDB will fill the tablespace
formed by the datafiles from bottom up. In some cases it will
improve the performance of the database if all data is not placed
on the same physical disk. Putting log files on a different disk from
@@ -38135,24 +38837,25 @@ too high}. glibc will allow the process heap to grow over thread stacks,
which will crash your server. It is a risk if the value of
@example
innodb_buffer_pool_size + key_buffer +
-max_connections * (sort_buffer + record_buffer) + max_connections * 2 MB
+max_connections * (sort_buffer + read_buffer_size) + max_connections * 2 MB
@end example
is close to 2 GB or exceeds 2 GB. Each thread will use a stack
(often 2 MB, but in MySQL AB binaries only 256 kB) and in the worst case also
-@code{sort_buffer + record_buffer}
+@code{sort_buffer + read_buffer_size}
additional memory.
@strong{How to tune other @file{mysqld} server parameters?}
Typical values which suit most users are:
@example
+skip-locking
set-variable = max_connections=200
-set-variable = record_buffer=1M
+set-variable = read_buffer_size=1M
set-variable = sort_buffer=1M
-# Set key_buffer to 5 - 50 %
+# Set key_buffer to 5 - 50%
# of your RAM depending on how
# much you use MyISAM tables, but
# keep key_buffer + InnoDB
-# buffer pool size < 80 % of
+# buffer pool size < 80% of
# your RAM
set-variable = key_buffer=...
@end example
@@ -38169,7 +38872,10 @@ The meanings of the configuration parameters are the following:
@item @strong{Option} @tab @strong{Description}
@item @code{innodb_data_home_dir} @tab
The common part of the directory path for all InnoDB datafiles.
-The default for this parameter is the @code{datadir} of MySQL.
+If you do not mentioned this option in @file{my.cnf}
+the default is the @code{datadir} of MySQL.
+You can specify this also as an empty string, in which case you
+can use absolute file paths in @code{innodb_data_file_path}.
@item @code{innodb_data_file_path} @tab
Paths to individual datafiles and their sizes. The full directory path
to each datafile is acquired by concatenating innodb_data_home_dir to
@@ -38200,8 +38906,8 @@ slower in case of a crash. The combined size of log files must
be < 4 GB on 32-bit computers.
@item @code{innodb_log_buffer_size} @tab
The size of the buffer which InnoDB uses to write log to the log files
-on disk. Sensible values range from 1M to half the combined size of log
-files. A big log buffer allows large transactions to run without a need
+on disk. Sensible values range from 1M to 8M.
+A big log buffer allows large transactions to run without a need
to write the log to disk until the transaction commit. Thus, if you have
big transactions, making the log buffer big will save disk I/O.
@item @code{innodb_flush_log_at_trx_commit} @tab
@@ -38222,7 +38928,7 @@ archive InnoDB log files.
The size of the memory buffer InnoDB uses to cache data and indexes of
its tables. The bigger you set this the less disk I/O is needed to
access data in tables. On a dedicated database server you may set this
-parameter up to 80 % of the machine physical memory size. Do not set it
+parameter up to 80% of the machine physical memory size. Do not set it
too large, though, because competition of the physical memory may cause
paging in the operating system.
@item @code{innodb_additional_mem_pool_size} @tab
@@ -38402,7 +39108,7 @@ After all data has been inserted you can rename the tables.
During the conversion of big tables you should set the InnoDB
buffer pool size big
-to reduce disk I/O. Not bigger than 80 % of the physical memory, though.
+to reduce disk I/O. Not bigger than 80% of the physical memory, though.
You should set InnoDB log files big, and also the log buffer large.
Make sure you do not run out of tablespace: InnoDB tables take a lot
@@ -38441,7 +39147,7 @@ Corresponding columns in the foreign key
and the referenced key must have similar internal data types
inside InnoDB so that they can be compared without a type
conversion.
-The size and the signedness of integer types has to be the same.
+The @strong{size and the signedness of integer types has to be the same}.
The length of string types need not be the same.
Starting from version 3.23.50 you can also associate the
@@ -38460,9 +39166,11 @@ constraints on those foreign key or referenced key values
which contain a NULL column.
Starting from version 3.23.50 the InnoDB parser allows you to
-use backquotes (`) around table and column names in the above
-definition but the InnoDB parser is not yet aware of possible
-variable @code{lower_case_table_names} you give in @file{my.cnf}.
+use backquotes (`) around table and column names in the
+@code{FOREIGN KEY ... REFERENCES ...} clause
+but the InnoDB parser is not yet aware of the option
+@code{lower_case_table_names} you can specify in @file{my.cnf}.
+
An example:
@example
@@ -38538,17 +39246,14 @@ SHOW TABLE STATUS FROM yourdatabasename LIKE 'T'
The foreign key constraints are listed in the table comment of
the output.
-InnoDB does not yet support @code{ON DELETE CASCADE}
-or other special options on the constraints.
-
@node Adding and removing, Backing up, Using InnoDB tables, InnoDB
@subsection Adding and Removing InnoDB Data and Log Files
-You cannot increase the size of an InnoDB datafile. To add more into
-your tablespace you have to add a new datafile. To do this you have to
-shut down your MySQL database, edit the @file{my.cnf} file, adding a
-new file to @code{innodb_data_file_path}, and then start MySQL
-again.
+From version 3.23.50 and 4.0.2 you can specify the last InnoDB datafile
+to @code{autoextend}. Alternatively, you can increase to your tablespace
+by specifying an additional datafile. To do this you have to shut down
+the MySQL server, edit the @file{my.cnf} file adding a new datafile
+to @code{innodb_data_file_path}, and then start the MySQL server again.
Currently you cannot remove a datafile from InnoDB. To decrease the
size of your database you have to use @file{mysqldump} to dump
@@ -38596,9 +39301,6 @@ Copy all the @file{.frm} files for your InnoDB tables into a
safe place.
@end itemize
-There is currently no online or incremental backup tool available for
-InnoDB, though they are in the TODO list.
-
In addition to taking the binary backups described above,
you should also regularly take dumps of your tables with
@file{mysqldump}. The reason to this is that a binary file
@@ -39018,17 +39720,60 @@ use a locking read:
SELECT * FROM t LOCK IN SHARE MODE;
@end example
+@subsubsection How to cope with deadlocks?
+
+Deadlocks are a classic problem in transactional databases,
+but they are not dangerous unless they are so frequent
+that you cannot run certain transactions at all.
+Normally you have to write your applications so
+that they are always prepared to re-issue a
+transaction if it gets rolled back because of a deadlock.
+
+InnoDB uses automatic row level locking. You can get
+deadlocks even in the case of transactions which just
+insert or delete a single row. That is because
+these operations are not really 'atomic': they
+automatically set locks on the (possibly several) index
+records of the row inserted/deleted.
+
+You can cope with deadlocks and reduce the number of
+them with the following tricks:
+
+@itemize @bullet
+@item
+Always be prepared to re-issue a transaction if it fails
+in a deadlock. Deadlocks are not dangerous. Just try again.
+@item
+Commit your transactions often. Small transactions are less
+prone to collide.
+@item
+Access your tables and rows in a fixed order. Then
+transactions will form nice queues, and do not deadlock.
+@item
+Use less locking: if you can afford a @code{SELECT} to return
+data from an old snapshot, do not add the clause
+@code{FOR UPDATE} or @code{LOCK IN SHARE MODE} to it.
+@item
+If nothing helps, serialize your transactions with table level
+locks: @code{LOCK TABLES t1 WRITE, t2 READ, ... ;
+[do something with tables t1 and t2 here]; UNLOCK TABLES.}
+Table level locks make you transactions to queue nicely,
+and deadlocks are avoided. Note that @code{LOCK TABLES} implicitly
+starts a transaction, just like the command @code{BEGIN},
+and @code{UNLOCK TABLES} implicitly ends the transaction in a
+@code{COMMIT}.
+@end itemize
@subsection Performance Tuning Tips
@strong{1.}
If the Unix @file{top} or the Windows @file{Task Manager} shows that
-the CPU usage percentage with your workload is less than 70 %,
+the CPU usage percentage with your workload is less than 70%,
your workload is probably
disk-bound. Maybe you are making too many transaction commits, or the
buffer pool is too small.
Making the buffer pool bigger can help, but do not set
-it bigger than 80 % of physical memory.
+it bigger than 80% of physical memory.
@strong{2.}
Wrap several modifications into one transaction. InnoDB must
@@ -39485,7 +40230,7 @@ bypasses locking and transaction handling. Therefore you may also get
gaps in the number sequence if you roll back transactions which have
got numbers from the counter.
-The behavior of auto-increment is not defined if a user gives a negative
+The behaviour of auto-increment is not defined if a user gives a negative
value to the column or if the value becomes bigger than the maximum
integer that can be stored in the specified integer type.
@@ -39683,7 +40428,7 @@ on InnoDB tables, except for the physical size reserved by the table.
The row count is only a rough estimate used in SQL optimisation.
@item
-If you try to create an unique index on a prefix of a column you will get an
+If you try to create a unique index on a prefix of a column you will get an
error:
@example
@@ -39726,7 +40471,7 @@ separate pages, the remaining length of the row must be less
than half a database page. The maximun key length is 7000 bytes.
@item
On some operating systems datafiles must be < 2 GB. The combined
-size of log files must be < 4 GB on 32-bit computers.
+size of log files must be < 4 GB.
@item
The maximum tablespace size is 4 billion database pages. This is also
the maximum size for a table. The minimum tablespace size is 10 MB.
@@ -39752,7 +40497,7 @@ Finland
@node BDB, , InnoDB, Table types
-@section BDB or Berkeley_DB Tables
+@section @code{BDB} or @code{BerkeleyDB} Tables
@cindex tables, @code{BDB}
@cindex tables, @code{Berkeley DB}
@@ -39836,7 +40581,7 @@ the @code{BEGIN WORK} SQL command, after which your changes will not be
committed until you execute @code{COMMIT} (or decide to @code{ROLLBACK}
the changes).
-The following options to @code{mysqld} can be used to change the behavior of
+The following options to @code{mysqld} can be used to change the behaviour of
BDB tables:
@multitable @columnfractions .25 .55
@@ -39848,13 +40593,14 @@ BDB tables:
@item @code{--bdb-no-recover} @tab Don't start Berkeley DB in recover mode.
@item @code{--bdb-shared-data} @tab Start Berkeley DB in multi-process mode (Don't use @code{DB_PRIVATE} when initialising Berkeley DB)
@item @code{--bdb-tmpdir=directory} @tab Berkeley DB tempfile name.
-@item @code{--skip-bdb} @tab Don't use berkeley db.
+@item @code{--skip-bdb} @tab Disable usage of BDB tables.
@item @code{-O bdb_max_lock=1000} @tab Set the maximum number of locks possible. @xref{SHOW VARIABLES}.
@end multitable
If you use @code{--skip-bdb}, MySQL will not initialise the
Berkeley DB library and this will save a lot of memory. Of course,
-you cannot use @code{BDB} tables if you are using this option.
+you cannot use @code{BDB} tables if you are using this option. If you try
+to create an BDB table, MySQL will instead create a MyISAM table.
Normally you should start @code{mysqld} without @code{--bdb-no-recover} if you
intend to use BDB tables. This may, however, give you problems when you
@@ -39880,7 +40626,7 @@ You may also want to change @code{binlog_cache_size} and
@item
To be able to rollback transactions BDB maintain log files. For maximum
performance you should place these on another disk than your databases
-by using the @code{--bdb_log_dir} options.
+by using the @code{--bdb-logdir} option.
@item
MySQL performs a checkpoint each time a new BDB log
file is started, and removes any log files that are not needed for
@@ -39942,7 +40688,7 @@ maintaining this in a separate segment in each BDB table. If you don't
issue a lot of @code{DELETE} or @code{ROLLBACK} statements, this number
should be accurate enough for the MySQL optimiser, but as MySQL
only stores the number on close, it may be incorrect if MySQL dies
-unexpectedly. It should not be fatal even if this number is not 100 %
+unexpectedly. It should not be fatal even if this number is not 100%
correct. One can update the number of rows by executing @code{ANALYZE
TABLE} or @code{OPTIMIZE TABLE}. @xref{ANALYZE TABLE} . @xref{OPTIMIZE
TABLE}.
@@ -40029,7 +40775,7 @@ The effect of this is that BDB tables are not movable between directories!
When taking backups of BDB tables, you have to either use
@code{mysqldump} or take a backup of all @code{table_name.db} files and
the BDB log files. The BDB log files are the files in the base data
-directory named @code{log.XXXXXX} (6 digits);
+directory named @code{log.XXXXXXXXXX} (ten digits);
The BDB table handler stores unfinished transactions in the log files
and requires these to be present when @code{mysqld} starts.
@end itemize
@@ -40464,9 +41210,11 @@ $rv = $sth->rows;
@findex DBI->@{NULLABLE@}
@findex NULLABLE DBI method
@item NULLABLE
-Returns a reference to an array of boolean values; for each element of
-the array, a value of TRUE indicates that this
-column may contain @code{NULL} values.
+Returns a reference to an array of values that indicate whether columns may
+contain @code{NULL} values.
+The possible values for each array element are 0 or the empty string if the
+column cannot be @code{NULL}, 1 if it can, and 2 if the column's @code{NULL}
+status is unknown.
Example:
@example
$null_possible = $sth->@{NULLABLE@};
@@ -40679,10 +41427,7 @@ You can also use the @code{pod2man}, @code{pod2html}, etc., tools to
translate to other formats.
You can find the latest @code{DBI} information at
-the @code{DBI} web page:
-@example
-@uref{http://www.symbolstone.org/technology/perl/DBI/}
-@end example
+the @code{DBI} web page: @uref{http://dbi.perl.org/}.
@node ODBC, C, Perl, Clients
@@ -42271,8 +43016,8 @@ if(mysql_drop_db(&mysql, "my_database"))
@subsubheading Description
-Instructs the server to write some debug information to the log. The
-connected user must have the @strong{process} privilege for this to work.
+Instructs the server to write some debug information to the log. For
+this to work, the connected user must have the @code{SUPER} privilege.
@subsubheading Return Values
@@ -43300,7 +44045,7 @@ None.
@subsubheading Description
-Can be used to set extra connect options and affect behavior for a connection.
+Can be used to set extra connect options and affect behaviour for a connection.
This function may be called multiple times to set several options.
@code{mysql_options()} should be called after @code{mysql_init()} and before
@@ -43622,6 +44367,9 @@ into account the current character set of the connection. The result is placed
in @code{to} and a terminating null byte is appended. Characters
encoded are @code{NUL} (ASCII 0), @samp{\n}, @samp{\r}, @samp{\},
@samp{'}, @samp{"}, and Control-Z (@pxref{Literals}).
+(Strictly speaking, MySQL requires only that backslash and the quote
+character used to quote the string in the query be escaped. This function
+quotes the other characters to make them easier to read in log files.)
The string pointed to by @code{from} must be @code{length} bytes long. You
must allocate the @code{to} buffer to be at least @code{length*2+1} bytes
@@ -43718,7 +44466,7 @@ An unknown error occurred.
@subsubheading Description
Asks the MySQL server to reload the grant tables. The
-connected user must have the @strong{reload} privilege.
+connected user must have the @code{RELOAD} privilege.
This function is deprecated. It is preferable to use @code{mysql_query()}
to issue a SQL @code{FLUSH PRIVILEGES} statement instead.
@@ -43837,7 +44585,7 @@ An unknown error occurred.
@subsubheading Description
Asks the database server to shut down. The connected user must have
-@strong{shutdown} privileges.
+@code{SHUTDOWN} privileges.
@subsubheading Return Values
@@ -45280,6 +46028,8 @@ native functions such as @code{ABS()} or @code{SOUNDEX()}.
@findex CREATE FUNCTION
@findex DROP FUNCTION
+@cindex deleting, function
+@cindex function, deleting
@findex UDF functions
@findex User-defined functions
@findex Functions, user-defined
@@ -45301,7 +46051,7 @@ function that works like native (built in) MySQL functions such as
@code{CREATE FUNCTION} saves the function's name, type, and shared library
name in the @code{mysql.func} system table. You must have the
-@strong{insert} and @strong{delete} privileges for the @code{mysql} database
+@code{INSERT} and @code{DELETE} privileges for the @code{mysql} database
to create and drop functions.
All active functions are reloaded each time the server starts, unless
@@ -45535,7 +46285,7 @@ or deallocate the memory.
@end table
-@node UDF aggr. calling , UDF arguments, UDF calling, Adding UDF
+@node UDF aggr. calling, UDF arguments, UDF calling, Adding UDF
@subsubsection UDF Calling Sequences for aggregate functions
@cindex calling sequences for aggregate functions, UDF
@@ -45854,7 +46604,7 @@ mysql> DROP FUNCTION avgcost;
The @code{CREATE FUNCTION} and @code{DROP FUNCTION} statements update the
system table @code{func} in the @code{mysql} database. The function's name,
type and shared library name are saved in the table. You must have the
-@strong{insert} and @strong{delete} privileges for the @code{mysql} database
+@code{INSERT} and @code{DELETE} privileges for the @code{mysql} database
to create and drop functions.
You should not use @code{CREATE FUNCTION} to add a function that has already
@@ -46312,7 +47062,7 @@ error might occur:
You are running on a system that uses MIT-pthreads.
If you are running on a system that doesn't have native threads,
@code{mysqld} uses the MIT-pthreads package. @xref{Which OS}. However,
-all MIT-pthreads versions doesn't support Unix sockets. On a system
+not all MIT-pthreads versions support Unix sockets. On a system
without sockets support you must always specify the hostname explicitly
when connecting to the server. Try using this command to check the
connection to the server:
@@ -46411,7 +47161,7 @@ If you need more connections than the default (100), then you should restart
Note that @code{mysqld} actually allows (@code{max_connections}+1)
clients to connect. The last connection is reserved for a user with the
-@strong{process} privilege. By not giving this privilege to normal
+@code{SUPER} privilege. By not giving this privilege to normal
users (they shouldn't need this), an administrator with this privilege
can log in and use @code{SHOW PROCESSLIST} to find out what could be
wrong. @xref{SHOW}.
@@ -46596,19 +47346,51 @@ than you have alloacated for @code{mysqld}. @xref{Packet too large}.
@cindex table is full
-This error occurs in older MySQL versions when an in-memory temporary
-table becomes larger than @code{tmp_table_size} bytes. To avoid this
-problem, you can use the @code{-O tmp_table_size=#} option to
-@code{mysqld} to increase the temporary table size or use the SQL
-option @code{SQL_BIG_TABLES} before you issue the problematic
-query. @xref{SET OPTION, , @code{SET OPTION}}.
+There is a couple of different cases when you can get this error:
+
+@itemize @bullet
+@item
+You are using an older MySQL version (before 3.23.0) when an in-memory
+temporary table becomes larger than @code{tmp_table_size} bytes.
+To avoid this problem, you can use the @code{-O tmp_table_size=#} option
+to make @code{mysqld} increase the temporary table size or use the SQL
+option @code{BIG_TABLES} before you issue the problematic query.
+@xref{SET OPTION, ,@code{SET}}.
You can also start @code{mysqld} with the @code{--big-tables} option.
-This is exactly the same as using @code{SQL_BIG_TABLES} for all queries.
+This is exactly the same as using @code{BIG_TABLES} for all queries.
In MySQL Version 3.23, in-memory temporary tables will automatically be
converted to a disk-based @code{MyISAM} table after the table size gets
bigger than @code{tmp_table_size}.
+@item
+You are using @code{InnoDB} tables and run out of room in the
+@code{InnoDB} tablespace. In this case the solution is to extend the
+@code{InnoDB} tablespace.
+@item
+You are using @code{ISAM} or @code{MyISAM} tables on an OS that only
+supports files of 2G in size and you have hit this limit for the data
+or index file.
+@item
+You are using @code{MyISAM} tables and the needed data or index size is
+bigger than what MySQL has allocated pointers for. (If you don't specify
+@code{MAX_ROWS} to @code{CREATE TABLE} MySQL will only allocate pointers
+to hold 4G of data).
+
+You can check the maximum data/index sizes by doing
+@example
+SHOW TABLE STATUS FROM database LIKE 'table_name';
+@end example
+or using @code{myisamchk -dv database/table_name}.
+
+If this is the problem, you can fix it by doing something like:
+@example
+ALTER TABLE table_name MAX_ROWS=1000000000 AVG_ROW_LENGTH=nnn;
+@end example
+You only have to specify @code{AVG_ROW_LENGTH} for tables with BLOB/TEXT
+fields as in this case MySQL can't optimise the space required based
+only on the number of rows.
+@end itemize
@node Cannot create, Commands out of sync, Full table, Common errors
@@ -46869,7 +47651,7 @@ mf_format.o(.text+0x201): undefined reference to `__lxstat'
@end example
it usually means that your library is compiled on a system that is not
-100 % compatible with yours. In this case you should download the
+100% compatible with yours. In this case you should download the
latest MySQL source distribution and compile this yourself.
@xref{Installing source}.
@@ -46972,7 +47754,7 @@ Otherwise, any user with an account on that machine can run @code{mysql -u
root db_name} and do whatever he likes.
-@node File permissions , , Changing MySQL user, Installation Issues
+@node File permissions, , Changing MySQL user, Installation Issues
@appendixsubsec Problems with File Permissions
@cindex files, permissions
@@ -46990,7 +47772,7 @@ ERROR: Can't find file: 'path/with/filename.frm' (Errcode: 13)
@tindex Environment variable, UMASK
then the environment variable @code{UMASK} might be set incorrectly when
@code{mysqld} starts up. The default umask value is @code{0660}. You can
-change this behavior by starting @code{safe_mysqld} as follows:
+change this behaviour by starting @code{safe_mysqld} as follows:
@example
shell> UMASK=384 # = 600 in octal
@@ -47001,7 +47783,7 @@ shell> /path/to/safe_mysqld &
@tindex UMASK_DIR environment variable
@tindex Environment variable, UMASK_DIR
By default MySQL will create database and @code{RAID}
-directories with permission type 0700. You can modify this behavior by
+directories with permission type 0700. You can modify this behaviour by
setting the @code{UMASK_DIR} variable. If you set this, new
directories are created with the combined @code{UMASK} and
@code{UMASK_DIR}. For example, if you want to give group access to
@@ -47026,7 +47808,7 @@ with a zero.
@menu
* Crashing:: What To Do If MySQL Keeps Crashing
-* Resetting permissions:: How to Reset a Forgotten Password
+* Resetting permissions:: How to Reset a Forgotten Root Password
* Full disk:: How MySQL Handles a Full Disk
* Temporary files:: Where MySQL Stores Temporary Files
* Problems with mysql.sock:: How to Protect @file{/tmp/mysql.sock} from Being Deleted
@@ -47078,7 +47860,7 @@ without locking the table properly.
If you are running many @code{mysqld} servers on the same data on a
system that doesn't support good filesystem locks (normally handled by
the @code{lockd} daemon ) or if you are running
-multiple servers with @code{--skip-locking}
+multiple servers with @code{--skip-external-locking}
@item
You have a crashed index/datafile that contains very wrong data that
got @code{mysqld} confused.
@@ -47147,12 +47929,12 @@ what is happening.
Have you applied the latest patches for your operating system?
@item
-Use the @code{--skip-locking} option to @code{mysqld}. On some systems, the
-@code{lockd} lock manager does not work properly; the @code{--skip-locking}
-option tells @code{mysqld} not to use external locking. (This means that you
-cannot run 2 @code{mysqld} servers on the same data and that you must be
-careful if you use @code{myisamchk}, but it may be instructive to try the
-option as a test.)
+Use the @code{--skip-external-locking} option to @code{mysqld}. On some
+systems, the @code{lockd} lock manager does not work properly; the
+@code{--skip-external-locking} option tells @code{mysqld} not to use external
+locking. (This means that you cannot run 2 @code{mysqld} servers on the same
+data and that you must be careful if you use @code{myisamchk}, but it may be
+instructive to try the option as a test.)
@item
Have you tried @code{mysqladmin -u root processlist} when @code{mysqld}
@@ -47222,43 +48004,68 @@ it helps!
@node Resetting permissions, Full disk, Crashing, Administration Issues
-@appendixsubsec How to Reset a Forgotten Password
+@appendixsubsec How to Reset a Forgotten Root Password
@cindex passwords, forgotten
@cindex passwords, resetting
@cindex root user, password resetting
-If you have forgotten the @code{root} user password for MySQL, you
-can restore it with the following procedure:
+If you never set a @code{root} password for MySQL, then the server will
+not require a password at all for connecting as @code{root}. It is
+recommended to always set a password for each user. @xref{Security}.
+
+If you have set a @code{root} password, but forgot what it was, you can
+set a new password with the following procedure:
@enumerate
@item
Take down the @code{mysqld} server by sending a @code{kill} (not @code{kill
-9}) to the @code{mysqld} server. The pid is stored in a @file{.pid}
file, which is normally in the MySQL database directory:
-
@example
-kill `cat /mysql-data-directory/hostname.pid`
+shell> kill `cat /mysql-data-directory/hostname.pid`
@end example
-
-You must be either the Unix @code{root} user or the same user the server
+You must be either the Unix @code{root} user or the same user @code{mysqld}
runs as to do this.
-
@item
Restart @code{mysqld} with the @code{--skip-grant-tables} option.
@item
-Connect to the @code{mysqld} server with @code{mysql -h hostname mysql} and change
-the password with a @code{GRANT} command. @xref{GRANT,,@code{GRANT}}.
-You can also do this with
-@code{mysqladmin -h hostname -u user password 'new password'}
+Set a new password with the @code{mysqladmin password} command:
+@example
+shell> mysqladmin -u root password 'mynewpassword'
+@end example
@item
-Load the privilege tables with: @code{mysqladmin -h hostname
-flush-privileges} or with the SQL command @code{FLUSH PRIVILEGES}.
+Now you can either stop @code{mysqld} and restart it normally,
+or just load the privilege tables with:
+@example
+shell> mysqladmin -h hostname flush-privileges
+@end example
+@item
+After this, you should be able to connect using the new password.
@end enumerate
-Note that after you started @code{mysqld} with @code{--skip-grant-tables},
-any usage of @code{GRANT} commands will give you an @code{Unknown command}
-error until you have executed @code{FLUSH PRIVILEGES}.
+Alternatively, you can set the new password using the @code{mysql} client:
+@enumerate
+@item
+Take down and restart @code{mysqld} with the @code{--skip-grant-tables}
+option as described above.
+@item
+Connect to the @code{mysqld} server with:
+@example
+shell> mysql -u root mysql
+@end example
+@item
+Issue the following commands in the @code{mysql} client:
+@example
+mysql> UPDATE user SET Password=PASSWORD('mynewpassword')
+ -> WHERE User='root';
+mysql> FLUSH PRIVILEGES;
+@end example
+@item
+After this, you should be able to connect using the new password.
+@item
+You can now stop @code{mysqld} and restart it normally.
+@end enumerate
@node Full disk, Temporary files, Resetting permissions, Administration Issues
@@ -47422,7 +48229,7 @@ the server runs, for example, in @code{safe_mysqld} or @code{mysql.server}.
@menu
-* Case sensitivity:: Case Sensitivity in Searches
+* Case sensitivity:: Case-Sensitivity in Searches
* Using DATE:: Problems Using @code{DATE} Columns
* Problems with NULL:: Problems with @code{NULL} Values
* Problems with alias:: Problems with @code{alias}
@@ -47432,9 +48239,9 @@ the server runs, for example, in @code{safe_mysqld} or @code{mysql.server}.
@end menu
@node Case sensitivity, Using DATE, Query Issues, Query Issues
-@appendixsubsec Case Sensitivity in Searches
+@appendixsubsec Case-Sensitivity in Searches
-@cindex case sensitivity, in searches
+@cindex case-sensitivity, in searches
@cindex searching, and case-sensitivity
@cindex Chinese
@cindex Big5 Chinese character encoding
@@ -47525,13 +48332,33 @@ mysql> SELECT idate FROM tbl_name WHERE STRCMP(idate,'19970505')=0;
a string and performs a string comparison. It does not convert
@code{'19970505'} to a date and perform a date comparison.
-Note that MySQL does no checking whether the date is
+Note that MySQL does very limited checking whether the date is
correct. If you store an incorrect date, such as @code{'1998-2-31'}, the
-wrong date will be stored. If the date cannot be converted to any reasonable
-value, a @code{0} is stored in the @code{DATE} field. This is mainly a speed
-issue and we think it is up to the application to check the dates, and not
-the server.
+wrong date will be stored.
+
+Because MySQL packs dates for storage, it can't store any given date as
+it would not fit onto the result buffer. The rules for accepting a date
+are:
+@itemize @bullet
+@item
+If MySQL can store and retrieve a given date, the wrong date is accepted
+for @code{DATE} and @code{DATETIME} columns.
+@item
+All days values between 0-31 are accepted for any date. This makes it
+very convenient for web applications where you ask year, month and day
+in 3 different fields.
+@item
+The day or month field may be zero. This is convenient if you want
+to store a birthdate in a @code{DATE} column and you only know part
+of the date.
+@end itemize
+If the date cannot be converted to any reasonable value, a @code{0} is
+stored in the @code{DATE} field, which will be retrieved as
+@code{0000-00-00}. This is both a speed and convenience issue as we
+believe that the database's responsiblity is to retrieve the same date
+you stored (even if the data was not logically correct in all cases).
+We think it is up to the application to check the dates, and not the server.
@node Problems with NULL, Problems with alias, Using DATE, Query Issues
@appendixsubsec Problems with @code{NULL} Values
@@ -47650,7 +48477,7 @@ decide which rows from the result set should be used.
@cindex rows, deleting
@cindex tables, deleting rows
-As MySQL doesn't yet support sub-selects, nor the use of more than one
+As MySQL doesn't yet support subselects, nor the use of more than one
table in the @code{DELETE} statement (prior to Version 4.0), you should
use the following approach to delete rows from 2 related tables:
@@ -47865,6 +48692,8 @@ mysql> SELECT i, SUM(d1) AS a, SUM(d2) AS b FROM t1
@appendixsubsec Problems with @code{ALTER TABLE}.
@tindex ALTER TABLE
+@cindex changing, table
+@cindex table, changing
@code{ALTER TABLE} changes a table to the current character set.
If you during @code{ALTER TABLE} get a duplicate key error, then the cause
@@ -48156,7 +48985,7 @@ for more information.
@item @uref{http://www.mysql.com/Downloads/Contrib/mysqltcl-1.53.tar.gz}
Tcl interface for MySQL. Based on @file{msqltcl-1.50.tar.gz}.
-Updated by Tobias Ritzau, @email{tobri@@ida.liu.se}.
+For version 2.0 and more info, see @uref{http://www.xdobry.de/mysqltcl/}.
@item @uref{http://www.mysql.com/Downloads/Contrib/MyC-0.1.tar.gz}
A Visual Basic-like API, by Ed Carp.
@@ -48652,8 +49481,9 @@ By Steve Shreeve.
Perl program to convert Oracle databases to MySQL. Has same
output format as mysqldump. By Johan Andersson.
-@item @uref{http://www.mysql.com/Downloads/Contrib/excel2mysql.pl}
-Perl program to import Excel spreadsheets into a MySQL database. By Stephen Hurd @email{shurd@@sk.sympatico.ca}
+@item @uref{http://www.mysql.com/Downloads/Contrib/excel2mysql}
+Perl program to import Excel spreadsheets into a MySQL database.
+By Stephen Hurd @email{shurd@@sk.sympatico.ca}
@item @uref{http://www.mysql.com/Downloads/Contrib/T2S_100.ZIP}.
Windows program to convert text files to MySQL databases. By
@@ -48830,14 +49660,18 @@ These are the developers that are or have been employed by @code{MySQL AB}
to work on the @code{MySQL} database software, roughly in the order they
started to work with us. Following each developer is a small list of the
tasks that the developer is responsible for, or the accomplishments they
-have made.
+have made. All developers are involved in support.
+
+@c Updated by arjen 2002-08-06
+@c Note: this is a non-exhaustive list. It just documents some notable
+@c achievements, not each individual task. Nor is it a complete list
+@c of past/present job roles (see above). That said, updates welcome!
@table @asis
@item Michael (Monty) Widenius
-Has written the following parts of the MySQL database software:
@itemize @bullet
@item
-All the main code in @code{mysqld}.
+Lead developer and main author of the MySQL server (@code{mysqld}).
@item
New functions for the string library.
@item
@@ -48859,13 +49693,13 @@ also Unireg, a curses-based application tool with many utilities.
Porting of @code{mSQL} tools like @code{msqlperl}, @code{DBD}/@code{DBI}, and
@code{DB2mysql}.
@item
-Most of crash-me and the foundation for the MySQL benchmarks.
+Most of @code{crash-me} and the foundation for the MySQL benchmarks.
@end itemize
@item David Axmark
@itemize @bullet
@item
-Coordinator and initial main writer of the @strong{Reference Manual},
+Initial main writer of the @strong{Reference Manual},
including enhancements to @code{texi2html}.
@item
Automatic web site updating from the manual.
@@ -48888,6 +49722,8 @@ only some parts of @code{mysys} are left.
@item
Someone for Monty to call in the middle of the night when he just got
that new feature to work.
+@item
+Chief "Open Sourcerer" (MySQL community relations).
@end itemize
@item Jani Tolonen
@@ -48895,7 +49731,7 @@ that new feature to work.
@item
@code{mysqlimport}
@item
-A lot of extensions to the @code{mysql} client.
+A lot of extensions to the command-line clients.
@item
@code{PROCEDURE ANALYSE()}
@end itemize
@@ -48911,7 +49747,7 @@ Multi-row @code{INSERT}
@item
@code{mysqldump} -e option
@item
-@code{LOAD DATA INFILE LOCAL}
+@code{LOAD DATA LOCAL INFILE}
@item
@code{SQL_CALC_FOUND_ROWS} @code{SELECT} option
@item
@@ -48923,28 +49759,28 @@ Multi-row @code{INSERT}
@item
New client-server protocol for 4.0
@item
-@code{UNION}.
+@code{UNION} in 4.0
@item
Multi-table @code{DELETE}/@code{UPDATE}
@item
-The @code{MySQLGUI} client.
+Derived tables in 4.1
@item
-Maintainer of @code{MySQL++}.
+User resources management
+@item
+Initial developer of the @code{MySQL++} C++ API and the @code{MySQLGUI} client.
@end itemize
-@item Tonu Samuel
+@item Tonu Samuel (past developer)
@itemize @bullet
@item
-Our security expert.
-@item
-Vio interface (the foundation for the encrypted client/server protocol).
+VIO interface (the foundation for the encrypted client/server protocol).
@item
MySQL Filesystem (a way to use MySQL databases as files
and directories).
@item
-The CASE expression.
+The @code{CASE} expression.
@item
-The MD5() and COALESCE() functions.
+The @code{MD5()} and @code{COALESCE()} functions.
@item
@code{RAID} support for @code{MyISAM} tables.
@end itemize
@@ -48952,15 +49788,11 @@ The MD5() and COALESCE() functions.
@item Sasha Pachev
@itemize @bullet
@item
-Replication.
+Initial implementation of replication (upto version 4.0).
@item
@code{SHOW CREATE TABLE}.
@item
-mod_mysql_include
-@item
-cgi++
-@item
-mysql-bench
+@code{mysql-bench}
@end itemize
@item Matt Wagner
@@ -48968,23 +49800,29 @@ mysql-bench
@item
MySQL test suite.
@item
-Our webmaster.
+Webmaster (until 2002).
+@item
+Coordinator of development.
@end itemize
@item Miguel Solorzano
@itemize @bullet
@item
-Win32 development.
+Win32 development and release builds.
+@item
+Windows NT server code.
@item
-Winmysqladmin.
+WinMySQLAdmin
@end itemize
-@item Timothy Smith
+@item Timothy Smith (past developer)
@itemize @bullet
@item
-Dynamic character support.
+Dynamic character sets support.
@item
-Responsible for MySQL configure.
+configure, RPMs and other parts of the build system.
+@item
+Initial developer of @code{libmysqld}, the embedded server.
@end itemize
@item Sergei Golubchik
@@ -49010,7 +49848,9 @@ Proofreading and editing this fine manual.
@item Indrek Siitan
@itemize @bullet
@item
-Designer/programmer of our web interface.
+Designing/programming of our web interface.
+@item
+Author of our newsletter management system.
@end itemize
@item Jorge del Conde
@@ -49018,10 +49858,103 @@ Designer/programmer of our web interface.
@item
@code{MyCC} @code{MySQL Control Center}.
@item
-Web portals.
+Win32 development
+@item
+Initial implementation of the website portals.
+@end itemize
+
+@item Venu Anuganti
+@itemize @bullet
+@item
+MyODBC 3.51
+@item
+New client/server protocol for 4.1
+@end itemize
+
+@item Arjen Lentz
+@itemize @bullet
+@item
+Maintainer of the MySQL Reference Manual.
@item
-Win32 development.
+Preparing the O'Reilly printed edition of the manual.
@end itemize
+
+@item Alexander (Bar) Barkov, Alexey (Holyfoot) Botchkov, and Ramil Kallimullin
+@itemize @bullet
+@item
+Spatial data (GIS) and R-Trees implementation for 4.1
+@item
+Unicode and character sets for 4.1
+@end itemize
+
+@item Alexander (Sanja) Belkin
+@itemize @bullet
+@item
+Query cache in 4.0
+@item
+Implementation of subqueries (4.1).
+@end itemize
+
+@item Aleksey (Walrus) Kishkin and Alexey (Ranger) Stroganov
+@itemize @bullet
+@item
+Benchmarks design and analysis.
+@item
+Maintenance of the MySQL test suite.
+@end itemize
+
+@item Zak Greant
+@itemize @bullet
+@item
+Open Source advocate, MySQL community relations.
+@end itemize
+
+@item Carsten Pedersen
+@itemize @bullet
+@item
+The MySQL Certification program.
+@end itemize
+
+@item Lenz Grimmer
+@itemize @bullet
+@item
+Production (build and release) engineering.
+@end itemize
+
+@item Peter Zaitsev
+@itemize @bullet
+@item
+@code{SHA1()}, @code{AES_ENCRYPT()} and @code{AES_DECRYPT()} functions.
+@item
+Debugging, cleaning up various features.
+@end itemize
+
+@item Alexander (Salle) Keremidarski
+@itemize @bullet
+@item
+Documentation of existing MySQL code/algorithms.
+@item
+Debugging.
+@end itemize
+
+@item Per-Erik Martin
+@itemize @bullet
+@item
+Lead developer for stored procedures and triggers.
+@end itemize
+
+@item Jim Winstead
+@itemize @bullet
+@item
+Lead web developer.
+@end itemize
+
+@item Mark Matthews
+@itemize @bullet
+@item
+JDBC driver.
+@end itemize
+
@end table
@@ -49037,9 +49970,9 @@ Contributors are listed here, in somewhat random order:
@table @asis
@item Paul DuBois
-Help with making the Reference Manual correct and understandable. That
-includes rewriting Monty's and David's attempts at English into English
-as other people know it.
+Ongoing help with making this manual correct and understandable.
+That includes rewriting Monty's and David's attempts at English into
+English as other people know it.
@item Gianmassimo Vigazzola @email{qwerg@@mbox.vol.it} or @email{qwerg@@tin.it}
The initial port to Win32/NT.
@item Kim Aldale
@@ -49128,7 +50061,7 @@ answering on the MySQL mailing list.
@item Yves Carlier @email{Yves.Carlier@@rug.ac.be}
@code{mysqlaccess}, a program to show the access rights for a user.
@item Rhys Jones @email{rhys@@wales.com} (And GWE Technologies Limited)
-For the JDBC, a module to extract data from a MySQL Database with a Java client.
+For JDBC, a module to extract data from a MySQL Database with a Java client.
@item Dr Xiaokun Kelvin ZHU @email{X.Zhu@@brad.ac.uk}
Further development of the JDBC driver and other MySQL-related
Java tools.
@@ -49149,7 +50082,7 @@ For providing RPM versions for MySQL Version 3.21.
For maintaining the Perl @code{DBD::mysql} module.
@item Therrien Gilbert @email{gilbert@@ican.net}, Jean-Marc Pouyot @email{jmp@@scalaire.fr}
French error messages.
-@item Petr snajdr, @email{snajdr@@pvt.net}
+@item Petr Snajdr, @email{snajdr@@pvt.net}
Czech error messages.
@item Jaroslaw Lewandowski @email{jotel@@itnet.com.pl}
Polish error messages.
@@ -49172,7 +50105,10 @@ Hungarian error messages.
@item Roberto M. Serqueira
Portugise error messages.
@item Carsten H. Pedersen
-Danish error messages
+Danish error messages.
+@item Arjen G. Lentz
+Dutch error messages, completing earlier partial translation
+(also work on consistency and spelling).
@item David Sacerdote @email{davids@@secnet.com}
Ideas for secure checking of DNS hostnames.
@item Wei-Jou Chen @email{jou@@nematic.ieo.nctu.edu.tw}
@@ -49221,6 +50157,9 @@ Emulation of @code{pthread_mutex()} for OS/2.
@item Benjamin Pflugmann
Extended @code{MERGE} tables to handle @code{INSERTS}. Active member
on the MySQL mailing lists.
+@item Guilhem Bichot
+Fixed handling of exponents for @code{DECIMAL}.
+Author of @code{mysql_tableinfo}.
@end table
Other contributors, bugfinders, and testers: James H. Thompson, Maurizio
@@ -49299,8 +50238,6 @@ Development on the embedded @code{mysqld} version.
@end table
-
-
@node News, Porting, Credits, Top
@appendix MySQL Change History
@@ -49311,14 +50248,21 @@ Development on the embedded @code{mysqld} version.
This appendix lists the changes from version to version in the MySQL
source code.
+We are now working actively on MySQL 4.x and will only provide critical
+bug fixes for MySQL 3.23. We update this section as we add new
+features, so that everybody can follow the development.
+
+Our TODO section contains what further plans we have for 4.x. @xref{TODO}.
+
Note that we tend to update the manual at the same time we make changes to
MySQL. If you find a version listed here that you can't
-find on the MySQL download page
-(@uref{http://www.mysql.com/downloads/}),
+find on the MySQL download page (@uref{http://www.mysql.com/downloads/}),
this means that the version has not yet been released!
+@c Please don't add a new version here without also updating ../configure.in!
+
@menu
-* News-4.0.x:: Changes in release 4.0.x (Development; Alpha)
+* News-4.0.x:: Changes in release 4.0.x (Beta)
* News-3.23.x:: Changes in release 3.23.x (Stable)
* News-3.22.x:: Changes in release 3.22.x (Older; Still supported)
* News-3.21.x:: Changes in release 3.21.x
@@ -49328,27 +50272,266 @@ this means that the version has not yet been released!
@node News-4.0.x, News-3.23.x, News, News
-@appendixsec Changes in release 4.0.x (Development; Alpha)
+@appendixsec Changes in release 4.0.x (Beta)
-We are now working actively on MySQL 4.0 and will only provide critical
-bug fixes for MySQL 3.23. We will update this section as we add new
-features, so that others can follow our development.
+@cindex changes, version 4.0
-Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
+Version 4.0 of the MySQL server includes many enhancements and new features:
+
+@itemize @bullet
+@item
+The @code{InnoDB} table type is now included in the standard binaries,
+adding transactions, row-level locking, and foreign keys.
+@xref{InnoDB}.
+@item
+A query qache, offering vastly increased performance for many applications.
+By caching complete result sets, later identical queries can return
+instantly.
+@xref{Query Cache}.
+@item
+Improved full-text indexing with boolean mode, truncation, and phrase searching.
+@xref{Fulltext Search}.
+@item
+Enhanced @code{MERGE} tables, now supporting @code{INSERT}s and
+@code{AUTO_INCREMENT}.
+@xref{MERGE}.
+@item
+@code{UNION} syntax in @code{SELECT}.
+@xref{UNION}.
+@item
+Multi-table @code{DELETE} statements.
+@xref{DELETE}.
+@item
+@code{libmysqld}, the embedded server library.
+@xref{libmysqld}.
+@item
+Additional @code{GRANT} privilege options for even tighter control and
+security.
+@xref{GRANT}.
+@item
+Management of user resources in the @code{GRANT} system, particularly
+useful for ISPs and other hosting providers.
+@xref{User resources}.
+@item
+Dynamic server variables, allowing configuration changes without having
+to take down the server.
+@xref{SET OPTION}.
+@item
+Improved replication code and features.
+@xref{Replication}.
+@item
+Numerous new and functions and options.
+@item
+Changes to existing code for enhance performance and reliability.
+@end itemize
+
+For a full list of changes, please refer to the changelog sections for
+each individual 4.0.x release.
-@cindex changes, version 4.0
@menu
-* News-4.0.2:: Changes in release 4.0.2
+* News-4.0.3:: Changes in release 4.0.3 (Aug 2002: Beta)
+* News-4.0.2:: Changes in release 4.0.2 (01 Jul 2002)
* News-4.0.1:: Changes in release 4.0.1 (23 Dec 2001)
* News-4.0.0:: Changes in release 4.0.0 (Oct 2001: Alpha)
@end menu
-@node News-4.0.2, News-4.0.1, News-4.0.x, News-4.0.x
-@appendixsubsec Changes in release 4.0.2
+@node News-4.0.3, News-4.0.2, News-4.0.x, News-4.0.x
+@appendixsubsec Changes in release 4.0.3 (Aug 2002: Beta)
+
+@itemize @bullet
+@item
+Fixed problem with @code{configure ... --localstatedir=...}.
+@item
+Cleaned up @code{mysql.server} script.
+@item
+Fixed a bug in @code{mysqladmin shutdown} when pid file was modified
+while @code{mysqladmin} was still waiting for the previous one to
+disappear. This could happen during a very quick restart and caused
+@code{mysqladmin} to hang until @code{shutdown_timeout} seconds had
+passed.
+@item
+Don't increment warnings when setting @code{AUTO_INCREMENT} columns to
+@code{NULL} in @code{LOAD DATA INFILE}.
+@item
+Fixed all boolean type variables/options to work with the old syntax,
+e.g. all of these work: --lower-case-table-names, --lower-case-table-names=1,
+-O lower-case-table-names=1, --set-variable=lower-case-table-names=1
+@item
+Fixed shutdown problem (SIGTERM signal handling) on Solaris. (Bug from 4.0.2).
+@item
+@code{SHOW MASTER STATUS} now returns an empty set if binary log is not
+enabled.
+@item
+@code{SHOW SLAVE STATUS} now returns an empty set if slave is not initialised.
+@item
+Don't update MyISAM index file on update if not strictly necessary.
+@item
+Fixed bug in @code{SELECT DISTINCT ... FROM many_tables ORDER BY
+not-used-column}.
+@item
+Fixed a bug with @code{BIGINT}s and quoted strings.
+@item
+Added @code{QUOTE()} function that performs SQL quoting to produce values
+that can be used as data values in queries.
+@item
+Changed variable @code{DELAY_KEY_WRITE} to an enum to allow one set
+@code{DELAY_KEY_WRITE} for all tables without taking down the server.
+@item
+Changed behavior of @code{IF(condition,column,NULL)} so that it returns
+the value of the column type.
+@item
+Made @code{safe_mysqld} a symlink to @code{mysqld_safe} in binary distribution.
+@item
+Fixed security bug when having an empty database name in the @code{user.db}
+table.
+@item
+Fixed some problems with @code{CREATE TABLE ... SELECT function()}.
+@item
+@code{mysqld} now has the option @code{--temp-pool} enabled by default as this
+gives better performance with some operating systems.
+@item
+Fixed hang in @code{CHANGE MASTER TO} if the slave thread died very quickly.
+@item
+Big cleanup in replication code (less logging, better error messages, etc..)
+@item
+If the @code{--code-file} option is specified, the server calls
+@code{setrlimit()} to set the maximum allowed core file size to unlimited,
+so core files can be generated.
+@item
+Fixed bug in query cache after temporary table creation.
+@item
+Added @code{--count=N} (@code{-c}) option to @code{mysqladmin}, to make the
+program do only @code{N} iterations. To be used with @code{--sleep} (@code{-i}).
+Useful in scripts.
+@item
+Fixed bug in multi-table @code{UPDATE}: when updating a table,
+@code{do_select()} became confused about reading records from a cache.
+@item
+Fixed bug in multi-table @code{UPDATE} when several fields were referenced
+from a single table
+@item
+Fixed bug in truncating nonexisting table.
+@item
+Fixed bug in @code{REVOKE} that caused user resources to be randomly set.
+@item
+Fixed bug in @code{GRANT} for the new @code{CREATE TEMPORARY TABLE} privilege.
+@item
+Fixed bug in multi-table @code{DELETE} when tables are re-ordered in the
+table initialisation method and ref_lengths are of different sizes.
+@item
+Fixed two bugs in @code{SELECT DISTINCT} with large tables.
+@item
+Fixed bug in query cache initialisation with very small query cache size.
+@item
+Allow @code{DEFAULT} with @code{INSERT} statement.
+@item
+The startup parameters @code{myisam_max_sort_file_size} and
+@code{myisam_max_extra_sort_file_size} are now given in bytes, not megabytes.
+@item
+External system locking of @code{MyISAM}/@code{ISAM} files is now turned
+off by default. One can turn this on with @code{--external-locking}.
+(For most users this is never needed).
+@item
+Fixed core dump bug with @code{INSERT ... SET db_name.table_name.colname=''}.
+@item
+Fixed client hangup bug when using some SQL commands with wrong syntax.
+@item
+Fixed a timing bug in @code{DROP DATABASE}
+@item
+New @code{SET [GLOBAL | SESSION]} syntax to change thread specific and global
+server variables at runtime.
+@item
+Added variable @code{slave_compressed_protocol}.
+@item
+Renamed variable @code{query_cache_startup_type} to @code{query_cache_type},
+@code{myisam_bulk_insert_tree_size} to @code{bulk_insert_buffer_size},
+@code{record_buffer} to @code{read_buffer_size} and
+@code{record_rnd_buffer} to @code{record_rnd_buffer_size}.
+@item
+Renamed some SQL variables, but old names will still work until 5.0.
+@xref{Upgrading-from-3.23}.
+@item
+Renamed @code{--skip-locking} to @code{--skip-external-locking}.
+@item
+Removed unused variable @code{query_buffer_size}.
+@item
+Fixed a bug that made the pager option in the @code{mysql} client
+non-functional.
+@item
+Added full @code{AUTO_INCREMENT} support to @code{MERGE} tables.
+@item
+Extended @code{LOG()} function to accept an optional arbitrary base
+parameter.
+@xref{Mathematical functions}.
+@item
+Added @code{LOG2()} function (useful for finding out how many bits
+a number would require for storage).
+@item
+Added @code{LN()} natural logarithm function for compatibility with
+other databases. It is synonymous with @code{LOG(X)}.
+@end itemize
+
+
+@node News-4.0.2, News-4.0.1, News-4.0.3, News-4.0.x
+@appendixsubsec Changes in release 4.0.2 (01 Jul 2002)
@itemize @bullet
@item
+Changed @code{--chroot=path} option to execute @code{chroot()} immediately
+after all options have been parsed.
+@item
+Don't allow database names that contain @samp{\}.
+@item
+@code{lower_case_table_names} now also affects database names.
+@item
+Added @code{XOR} operator (logical and bitwise @code{XOR}) with @code{^}
+as a synonym for bitwise @code{XOR}.
+@item
+Added function @code{IS_FREE_LOCK("lock_name")}.
+Based on code contributed by Hartmut Holzgraefe @email{hartmut@@six.de}.
+@item
+Removed @code{mysql_ssl_clear()} from C API, as it was not needed.
+@item
+@code{DECIMAL} and @code{NUMERIC} types can now read exponential numbers.
+@item
+Added @code{SHA1()} function to calculate 160 bit hash value as described
+in RFC 3174 (Secure Hash Algorithm). This function can be considered a
+cryptographically more secure equivalent of @code{MD5()}.
+@xref{Miscellaneous functions}.
+@item
+Added @code{AES_ENCRYPT()} and @code{AES_DECRYPT()} functions to perform
+encryption according to AES standard (Rijndael).
+@xref{Miscellaneous functions}.
+@item
+Added @code{--single-transaction} option to @code{mysqldump}, allowing a
+consistent dump of @code{InnoDB} tables.
+@xref{mysqldump}.
+@item
+Fixed bug in @code{innodb_log_group_home_dir} in @code{SHOW VARIABLES}.
+@item
+Fixed a bug in optimiser with merge tables when non-unique values are
+used in summing up (causing crashes).
+@item
+Fixed a bug in optimiser when a range specified makes index grouping
+impossible (causing crashes).
+@item
+Fixed a rare bug when @code{FULLTEXT} index is present and no tables are used.
+@item
+Added privileges @code{CREATE TEMPORARY TABLES}, @code{EXECUTE},
+@code{LOCK TABLES}, @code{REPLICATION CLIENT}, @code{REPLICATION SLAVE},
+@code{SHOW DATABASES} and @code{SUPER}. To use these, you must have
+run the @code{mysql_fix_privilege_tables} script after upgrading.
+@item
+Fixed query cache align data bug.
+@item
+Fixed mutex bug in replication when reading from master fails.
+@item
+Added missing mutex in @code{TRUNCATE TABLE}; This fixes some core
+dump/hangup problems when using @code{TRUNCATE TABLE}.
+@item
+Fixed bug in multi-table @code{DELETE} when optimiser uses only indices.
+@item
Fixed that @code{ALTER TABLE table_name RENAME new_table_name} is as fast
as @code{RENAME TABLE}.
@item
@@ -49362,7 +50545,7 @@ Fixed bug in @code{DROP DATABASE} with symlink.
@item
Fixed crash in @code{REPAIR ... USE_FRM}.
@item
-Fixed bug in @code{EXPLAIN} with @code{LIMIT offset != 0}
+Fixed bug in @code{EXPLAIN} with @code{LIMIT offset != 0}.
@item
Fixed bug in phrase operator @code{"..."} in boolean full-text search.
@item
@@ -49370,7 +50553,7 @@ Fixed bug that caused duplicated rows when using truncation operator
@code{*} in boolean full-text search.
@item
Fixed bug in truncation operator of boolean full-text search (wrong results
-when there are only @code{+word*}'s in the query).
+when there are only @code{+word*}s in the query).
@item
Fixed bug in boolean full-text search that caused a crash when an identical
@code{MATCH} expression that did not use an index appeared twice.
@@ -49399,6 +50582,8 @@ if the first @code{SELECT} has this option and if there is global @code{LIMIT}
for the entire statement. For the moment, this requires using parentheses for
individual @code{SELECT} queries within the statement.
@item
+Fixed bug in @code{SQL_CALC_FOUND_ROWS} and @code{LIMIT}.
+@item
Don't give an error for @code{CREATE TABLE ...(... VARCHAR(0))}.
@item
Fixed @code{SIGINT} and @code{SIGQUIT} problems in @file{mysql.cc} on Linux
@@ -49479,8 +50664,6 @@ specified with the @code{--sql-mode} option for @code{mysqld}. It disables
unsigned arithmetic rules when it comes to subtraction. (This will make
MySQL 4.0 behave more closely to 3.23 with @code{UNSIGNED} columns).
@item
-Added @code{WITH MAX_QUERIES_PER_HOUR=#} to @code{GRANT} command.
-@item
The result returned for all bit functions (@code{|}, @code{<<}, ...) is now of
type @code{unsigned integer}.
@item
@@ -49541,13 +50724,17 @@ Added @code{--no-beep} and @code{--prompt} options to @code{mysql} command-line
@item
New feature: management of user resources.
@example
-GRANT ... WITH MAX_QUERIES_PER_HOUR = N1
- MAX_UPDATES_PER_HOUR = N2
- MAX_CONNECTIONS_PER_HOUR = N3;
+GRANT ... WITH MAX_QUERIES_PER_HOUR N1
+ MAX_UPDATES_PER_HOUR N2
+ MAX_CONNECTIONS_PER_HOUR N3;
@end example
@xref{User resources}.
+
+@item
+Added @code{mysql_secure_installation} to the @file{scripts/} directory.
@end itemize
+
@node News-4.0.1, News-4.0.0, News-4.0.2, News-4.0.x
@appendixsubsec Changes in release 4.0.1 (23 Dec 2001)
@@ -49573,7 +50760,7 @@ Added @code{--des-key-file} option to @code{mysqld}.
@code{HEX(string)} now returns the characters in @code{string} converted to
hexadecimal.
@item
-Fixed problem with @code{GRANT} when using @code{lower_case_table_names == 1}.
+Fixed problem with @code{GRANT} when using @code{lower_case_table_names=1}.
@item
Changed @code{SELECT ... IN SHARE MODE} to
@code{SELECT ... LOCK IN SHARE MODE} (as in MySQL 3.23).
@@ -49617,11 +50804,12 @@ Ignore @code{DATA DIRECTORY} and @code{INDEX DIRECTORY} directives on Windows.
Added boolean full-text search code. It should be considered early alpha.
@item
Extended @code{MODIFY} and @code{CHANGE} in @code{ALTER TABLE} to accept
-the @code{AFTER} keyword.
+the @code{FIRST} and @code{AFTER} keywords.
@item
Indexes are now used with @code{ORDER BY} on a whole @code{InnoDB} table.
@end itemize
+
@node News-4.0.0, , News-4.0.1, News-4.0.x
@appendixsubsec Changes in release 4.0.0 (Oct 2001: Alpha)
@@ -49653,7 +50841,7 @@ now handle signed and unsigned @code{BIGINT} numbers correctly.
New character set @code{latin_de} which provides correct German sorting.
@item
@code{STRCMP()} now uses the current character set when doing comparisons,
-which means that the default comparison behavior now is case-insensitive.
+which means that the default comparison behaviour now is case-insensitive.
@item
@code{TRUNCATE TABLE} and @code{DELETE FROM tbl_name} are now separate
functions. One bonus is that @code{DELETE FROM tbl_name} now returns
@@ -49664,7 +50852,7 @@ the database, which fixes a problem with @code{InnoDB} tables.
@item
Added support for @code{UNION}.
@item
-@code{DELETE} can now operate on multiple tables.
+Added support for multi-table @code{DELETE} operations.
@item
A new @code{HANDLER} interface to @code{MyISAM} tables.
@item
@@ -49739,7 +50927,7 @@ Added script @code{mysql_explain_log.sh} to distribution.
@node News-3.23.x, News-3.22.x, News-4.0.x, News
-@appendixsec Changes in release 3.23.x (Stable)
+@appendixsec Changes in release 3.23.x (Stable)
@cindex changes, version 3.23
@@ -49750,12 +50938,12 @@ table types:
@table @asis
@item @code{MyISAM}
A new ISAM library which is tuned for SQL and supports large files.
-@item @code{BerkeleyDB} or @code{BDB}
-Uses the Berkeley DB library from Sleepycat Software to implement
-transaction-safe tables.
@item @code{InnoDB}
A transaction-safe table handler that supports row level locking, and many
Oracle-like features.
+@item @code{BerkeleyDB} or @code{BDB}
+Uses the Berkeley DB library from Sleepycat Software to implement
+transaction-safe tables.
@end table
Note that only @code{MyISAM} is available in the standard binary distribution.
@@ -49763,7 +50951,7 @@ Note that only @code{MyISAM} is available in the standard binary distribution.
The 3.23 release also includes support for database replication between
a master and many slaves, full-text indexing, and much more.
-All new features are being developed in the 4.0 version. Only
+All new features are being developed in the 4.x version. Only
bug fixes and minor enhancements to existing features will be
added to 3.23.
@@ -49780,7 +50968,9 @@ users use this code as the rest of the code and because of this we are
not yet 100% confident in this code.
@menu
-* News-3.23.51:: Changes in release 3.23.51
+* News-3.23.53:: Changes in release 3.23.53
+* News-3.23.52:: Changes in release 3.23.52
+* News-3.23.51:: Changes in release 3.23.51 (31 May 2002)
* News-3.23.50:: Changes in release 3.23.50 (21 Apr 2002)
* News-3.23.49:: Changes in release 3.23.49
* News-3.23.48:: Changes in release 3.23.48 (07 Feb 2002)
@@ -49788,7 +50978,7 @@ not yet 100% confident in this code.
* News-3.23.46:: Changes in release 3.23.46 (29 Nov 2001)
* News-3.23.45:: Changes in release 3.23.45 (22 Nov 2001)
* News-3.23.44:: Changes in release 3.23.44 (31 Oct 2001)
-* News-3.23.43:: Changes in release 3.23.43
+* News-3.23.43:: Changes in release 3.23.43 (04 Oct 2001)
* News-3.23.42:: Changes in release 3.23.42 (08 Sep 2001)
* News-3.23.41:: Changes in release 3.23.41 (11 Aug 2001)
* News-3.23.40:: Changes in release 3.23.40
@@ -49806,10 +50996,10 @@ not yet 100% confident in this code.
* News-3.23.29:: Changes in release 3.23.29 (16 Dec 2000)
* News-3.23.28:: Changes in release 3.23.28 (22 Nov 2000: Gamma)
* News-3.23.27:: Changes in release 3.23.27 (24 Oct 2000)
-* News-3.23.26:: Changes in release 3.23.26
-* News-3.23.25:: Changes in release 3.23.25
+* News-3.23.26:: Changes in release 3.23.26 (18 Oct 2000)
+* News-3.23.25:: Changes in release 3.23.25 (29 Sep 2000)
* News-3.23.24:: Changes in release 3.23.24 (08 Sep 2000)
-* News-3.23.23:: Changes in release 3.23.23
+* News-3.23.23:: Changes in release 3.23.23 (01 Sep 2000)
* News-3.23.22:: Changes in release 3.23.22 (31 Jul 2000)
* News-3.23.21:: Changes in release 3.23.21
* News-3.23.20:: Changes in release 3.23.20
@@ -49820,66 +51010,131 @@ not yet 100% confident in this code.
* News-3.23.15:: Changes in release 3.23.15 (May 2000: Beta)
* News-3.23.14:: Changes in release 3.23.14
* News-3.23.13:: Changes in release 3.23.13
-* News-3.23.12:: Changes in release 3.23.12
+* News-3.23.12:: Changes in release 3.23.12 (07 Mar 2000)
* News-3.23.11:: Changes in release 3.23.11
* News-3.23.10:: Changes in release 3.23.10
* News-3.23.9:: Changes in release 3.23.9
-* News-3.23.8:: Changes in release 3.23.8
-* News-3.23.7:: Changes in release 3.23.7
+* News-3.23.8:: Changes in release 3.23.8 (02 Jan 2000)
+* News-3.23.7:: Changes in release 3.23.7 (10 Dec 1999)
* News-3.23.6:: Changes in release 3.23.6
-* News-3.23.5:: Changes in release 3.23.5
-* News-3.23.4:: Changes in release 3.23.4
+* News-3.23.5:: Changes in release 3.23.5 (20 Oct 1999)
+* News-3.23.4:: Changes in release 3.23.4 (28 Sep 1999)
* News-3.23.3:: Changes in release 3.23.3
-* News-3.23.2:: Changes in release 3.23.2
+* News-3.23.2:: Changes in release 3.23.2 (09 Aug 1999)
* News-3.23.1:: Changes in release 3.23.1
-* News-3.23.0:: Changes in release 3.23.0 (Sep 1999: Alpha)
+* News-3.23.0:: Changes in release 3.23.0 (05 Aug 1999: Alpha)
@end menu
-@node News-3.23.51, News-3.23.50, News-3.23.x, News-3.23.x
-@appendixsubsec Changes in release 3.23.51
+@node News-3.23.53, News-3.23.52, News-3.23.x, News-3.23.x
+@appendixsubsec Changes in release 3.23.53
+@itemize @bullet
+@item
+Fixed problem with @code{configure ... --localstatedir=...}.
+@item
+Fixed problem with @code{UNSIGNED BIGINT} on AIX (again).
+@item
+Fixed bug in pthread_mutex_trylock() on HPUX 11.0
+@item
+Multithreaded stress tests for InnoDB.
+@end itemize
+
+@node News-3.23.52, News-3.23.51, News-3.23.53, News-3.23.x
+@appendixsubsec Changes in release 3.23.52
+@itemize @bullet
+@item
+Fixed security bug when having an empty database name in the @code{user.db}
+table.
+@item
+Changed initialisation of @code{RND()} to make it less predicatable.
+@item
+Fixed problem with @code{GROUP BY} on result with expression that created a
+@code{BLOB} field.
+@item
+Fixed problem with privilege tables when downgrading from 4.0.2 to 3.23.
+@item
+Fixed thread bug in @code{SLAVE START}, @code{SLAVE STOP} and automatic repair
+of MyISAM tables that could cause table cache to be corrupted.
+@item
+Fixed possible thread related key-cache-corruption problem with
+@code{OPTIMIZE TABLE} and @code{REPAIR TABLE}.
+@item
+Added name of 'administrator command' logs.
+@item
+Fixed bug with creating an auto-increment value on second part of a
+@code{UNIQUE()} key where first part could contain NULL values.
+@item
+Don't write slave-timeout reconnects to the error log.
+@item
+Fixed bug with slave net read timeouting
+@item
+Fixed a core-dump bug with @code{MERGE} tables and @code{MAX()} function.
+@item
+Fixed bug in @code{ALTER TABLE} with BDB tables.
+@item
+Fixed bug when logging @code{LOAD DATA INFILE} to binary log with no
+active database.
+@item
+Fixed a bug in range optimiser (causing crashes).
+@item
+Fixed possible problem in replication when doing @code{DROP DATABASE} on a
+database with @code{InnoDB} tables.
+@item
+Fixed that @code{mysql_info()} returns 0 for 'Duplicates' when using
+@code{INSERT DELAYED IGNORE}.
+@item
+Added @code{-DHAVE_BROKEN_REALPATH} to the Mac OS X (darwin) compile
+options in @file{configure.in} to fix a failure under high load.
+@end itemize
+
+@node News-3.23.51, News-3.23.50, News-3.23.52, News-3.23.x
+@appendixsubsec Changes in release 3.23.51 (31 May 2002)
@itemize @bullet
@item
-Remove end space from @code{enum} values. (This fixed a problem with
-@code{SHOW CREATE TABLE}).
+Fix bug with closing tags missing slash for @code{mysqldump} XML output.
+@item
+Remove end space from @code{ENUM} values. (This fixed a problem with
+@code{SHOW CREATE TABLE}.)
@item
Fixed bug in @code{CONCAT_WS()} that cut the result.
@item
-Changed name of variables @code{Com_show_master_stat} to
+Changed name of server variables @code{Com_show_master_stat} to
@code{Com_show_master_status} and @code{Com_show_slave_stat} to
@code{Com_show_slave_status}.
@item
Changed handling of @code{gethostbyname()} to make the client library
-threadsafe even if @code{gethostbyname_r} doesn't exists.
+thread-safe even if @code{gethostbyname_r} doesn't exist.
@item
Fixed core-dump problem when giving a wrong password string to @code{GRANT}.
@item
Fixed bug in @code{DROP DATABASE} with symlinked directory.
@item
-Fixed optimization problem with @code{DATETIME} and value outside
+Fixed optimisation problem with @code{DATETIME} and value outside
@code{DATETIME} range.
@item
-Removed BDB documentation.
+Removed Sleepycat's BDB doc files from the source tree, as they're not
+needed (MySQL covers BDB in its own documentation).
@item
-Fixed mit-pthreads to compile with glibc 2.2 (needed for @code{make dist}).
+Fixed MIT-pthreads to compile with @code{glibc} 2.2 (needed for
+@code{make dist}).
@item
Fixed the @code{FLOAT(X+1,X)} is not converted to @code{FLOAT(X+2,X)}.
(This also affected @code{DECIMAL}, @code{DOUBLE} and @code{REAL} types)
@item
-Fixed the result from @code{IF()} is case in-sensitive if the 2 and
+Fixed the result from @code{IF()} is case in-sensitive if the second and
third arguments are case sensitive.
@item
-Fixed core dump problem on OSF in @code{gethostbyname_r}.
+Fixed core dump problem on OSF/1 in @code{gethostbyname_r}.
@item
-Fixed that underflowed decimal fields is not zero filled.
+Fixed that underflowed decimal fields are not zero filled.
@item
If we get an overflow when inserting @code{'+11111'} for
-@code{decimal(5,0) unsigned} columns, we will just drop the sign.
+@code{DECIMAL(5,0) UNSIGNED} columns, we will just drop the sign.
@item
-Fixed optimization bug with @code{ISNULL(expression_which_cannot_be_null)} and
+Fixed optimisation bug with @code{ISNULL(expression_which_cannot_be_null)} and
@code{ISNULL(constant_expression)}.
@item
-Fixed host lookup bug in the glibc library that we used with the 3.23.50
+Fixed host lookup bug in the @code{glibc} library that we used with the 3.23.50
Linux-x86 binaries.
@end itemize
@@ -49888,6 +51143,8 @@ Linux-x86 binaries.
@itemize @bullet
@item
+Add missing @code{<row>} tags for @code{mysqldump} XML output.
+@item
Fixed problem with @code{crash-me} and @code{gcc} 3.0.4.
@item
Fixed that @code{@@@@unknown_variable} doesn't hang server.
@@ -49896,7 +51153,7 @@ Added @code{@@@@VERSION} as a synonym for @code{VERSION()}.
@item
@code{SHOW VARIABLES LIKE 'xxx'} is now case-insensitive.
@item
-Fixed timeout for @code{GET_LOCK()} on HPUX with DCE threads.
+Fixed timeout for @code{GET_LOCK()} on HP-UX with DCE threads.
@item
Fixed memory allocation bug in the glibc library used to build Linux
binaries, which caused mysqld to die in 'free()'.
@@ -50155,7 +51412,7 @@ Fixed core dump when using @code{CREATE ... FULLTEXT} keys with other table
handlers than @code{MyISAM}.
@item
Don't use @code{signal()} on Windows because this appears to not be
-100 % reliable.
+100% reliable.
@item
Fixed bug when doing @code{WHERE col_name=NULL} on an indexed column
that had @code{NULL} values.
@@ -50223,7 +51480,7 @@ Fixed a bug in purge which could cause crashes.
@end itemize
@node News-3.23.43, News-3.23.42, News-3.23.44, News-3.23.x
-@appendixsubsec Changes in release 3.23.43
+@appendixsubsec Changes in release 3.23.43 (04 Oct 2001)
@itemize @bullet
@item
@@ -50371,7 +51628,7 @@ Fixed problem with @code{UPDATE} and @code{BDB} tables.
Fixed hard bug in @code{BDB} tables when using key parts.
@item
Fixed problem when using @code{GRANT FILE ON database.* ...}; previously
-we added the @strong{drop} privilege for the database.
+we added the @code{DROP} privilege for the database.
@item
Fixed @code{DELETE FROM tbl_name ... LIMIT 0} and
@code{UPDATE FROM tbl_name ... LIMIT 0}, which acted as though the
@@ -50605,7 +51862,7 @@ rows to be updated.
@item
Fixed a bug in @code{CONCAT_WS()} where it returned incorrect results.
@item
-Changed @code{CREATE ... INSERT} and @code{INSERT ... SELECT} to not
+Changed @code{CREATE ... SELECT} and @code{INSERT ... SELECT} to not
allow concurrent inserts as this could make the binary log hard to repeat.
(Concurrent inserts are enabled if you are not using the binary or update log.)
@item
@@ -50804,7 +52061,7 @@ Added @code{--temp-pool} option to @code{mysqld}. Using this option
will cause most temporary files created to use a small set of names,
rather than a unique name for each new file. This is to work around a
problem in the Linux kernel dealing with creating a bunch of new files
-with different names. With the old behavior, Linux seems to "leak"
+with different names. With the old behaviour, Linux seems to "leak"
memory, as it's being allocated to the directory entry cache instead of
the disk cache.
@end itemize
@@ -51020,7 +52277,7 @@ Added @code{ANALYZE} of @code{BDB} tables.
In @code{BDB} tables, we now store the number of rows; this helps to optimise
queries when we need an approximation of the number of rows.
@item
-If we get an error in a multi-row statement, we now only rollback the
+If we get an error in a multi-row statement, we now only roll back the
last statement, not the entire transaction.
@item
If you do a @code{ROLLBACK} when you have updated a non-transactional table
@@ -51244,7 +52501,7 @@ Small portability fixes.
@node News-3.23.26, News-3.23.25, News-3.23.27, News-3.23.x
-@appendixsubsec Changes in release 3.23.26
+@appendixsubsec Changes in release 3.23.26 (18 Oct 2000)
@itemize @bullet
@item
@@ -51323,7 +52580,7 @@ on a patch from John Jones.
@node News-3.23.25, News-3.23.24, News-3.23.26, News-3.23.x
-@appendixsubsec Changes in release 3.23.25
+@appendixsubsec Changes in release 3.23.25 (29 Sep 2000)
@itemize @bullet
@item
@@ -51335,7 +52592,7 @@ now can be specified in octal by beginning the value with a zero.
Added @code{RIGHT JOIN}. This makes @code{RIGHT} a reserved word.
@item
Added @code{@@@@IDENTITY} as a synonym for @code{LAST_INSERT_ID()}.
-(This is for Visual Basic compatibility.)
+(This is for MSSQL compatibility.)
@item
Fixed a bug in @code{myisamchk} and @code{REPAIR} when using @code{FULLTEXT}
index.
@@ -51439,7 +52696,7 @@ Restored the @code{win1251} character set (it's now only marked deprecated).
@node News-3.23.23, News-3.23.22, News-3.23.24, News-3.23.x
-@appendixsubsec Changes in release 3.23.23
+@appendixsubsec Changes in release 3.23.23 (01 Sep 2000)
@itemize @bullet
@item
@@ -51475,7 +52732,7 @@ usage of @code{MIN(key_part)} or @code{MAX(key_part)} returned an empty set.
Updated @code{mysqlhotcopy} to use the new @code{FLUSH TABLES table_list}
syntax. Only tables which are being backed up are flushed now.
@item
-Changed behavior of @code{--enable-thread-safe-client} so
+Changed behaviour of @code{--enable-thread-safe-client} so
that both non-threaded (@code{-lmysqlclient}) and threaded
(@code{-lmysqlclient_r}) libraries are built. Users who linked
against a threaded @code{-lmysqlclient} will need to link against
@@ -51962,7 +53219,7 @@ Added @code{print_defaults} program to the @file{.rpm} files. Removed
@node News-3.23.12, News-3.23.11, News-3.23.13, News-3.23.x
-@appendixsubsec Changes in release 3.23.12
+@appendixsubsec Changes in release 3.23.12 (07 Mar 2000)
@itemize @bullet
@item
@@ -52135,7 +53392,7 @@ Fixed problem with 8-bit characters as separators in @code{LOAD DATA INFILE}.
@node News-3.23.8, News-3.23.7, News-3.23.9, News-3.23.x
-@appendixsubsec Changes in release 3.23.8
+@appendixsubsec Changes in release 3.23.8 (02 Jan 2000)
@itemize @bullet
@item
@@ -52175,7 +53432,7 @@ was too big.
@node News-3.23.7, News-3.23.6, News-3.23.8, News-3.23.x
-@appendixsubsec Changes in release 3.23.7
+@appendixsubsec Changes in release 3.23.7 (10 Dec 1999)
@itemize @bullet
@item
@@ -52288,7 +53545,7 @@ Added function @code{ORD(string)}.
@node News-3.23.5, News-3.23.4, News-3.23.6, News-3.23.x
-@appendixsubsec Changes in release 3.23.5
+@appendixsubsec Changes in release 3.23.5 (20 Oct 1999)
@itemize @bullet
@item
@@ -52350,7 +53607,7 @@ Fixed problem with @code{UDF} functions.
@node News-3.23.4, News-3.23.3, News-3.23.5, News-3.23.x
-@appendixsubsec Changes in release 3.23.4
+@appendixsubsec Changes in release 3.23.4 (28 Sep 1999)
@itemize @bullet
@item
@@ -52368,7 +53625,7 @@ Fixed problem with @code{LIKE "%"} on an index that may have @code{NULL} values.
@item
Allow creation of temporary tables with same name as the original table.
@item
-When granting a user a @strong{grant} option for a database, he couldn't grant
+When granting a user a @code{GRANT} option for a database, he couldn't grant
privileges to other users.
@item
New command: @code{SHOW GRANTS FOR user} (by Sinisa).
@@ -52429,7 +53686,7 @@ New function @code{COALESCE()}.
@node News-3.23.2, News-3.23.1, News-3.23.3, News-3.23.x
-@appendixsubsec Changes in release 3.23.2
+@appendixsubsec Changes in release 3.23.2 (09 Aug 1999)
@itemize @bullet
@item
@@ -52505,7 +53762,7 @@ Fixed some compilation problems.
@node News-3.23.0, , News-3.23.1, News-3.23.x
-@appendixsubsec Changes in release 3.23.0 (Sep 1999: Alpha)
+@appendixsubsec Changes in release 3.23.0 (05 Aug 1999: Alpha)
@itemize @bullet
@item
@@ -52627,7 +53884,7 @@ All C client API macros are now functions to make shared libraries more
reliable. Because of this, you can no longer call @code{mysql_num_fields()} on
a @code{MYSQL} object, you must use @code{mysql_field_count()} instead.
@item
-Added use of @code{LIBEWRAP}; patch by Henning P. Schmiedehausen.
+Added use of @code{LIBWRAP}; patch by Henning P. Schmiedehausen.
@item
Don't allow @code{AUTO_INCREMENT} for other than numerical columns.
@item
@@ -52667,19 +53924,19 @@ be very easy and painless. @xref{Upgrading-from-3.21}.
* News-3.22.35:: Changes in release 3.22.35
* News-3.22.34:: Changes in release 3.22.34
* News-3.22.33:: Changes in release 3.22.33
-* News-3.22.32:: Changes in release 3.22.32
+* News-3.22.32:: Changes in release 3.22.32 (14 Feb 2000)
* News-3.22.31:: Changes in release 3.22.31
* News-3.22.30:: Changes in release 3.22.30
-* News-3.22.29:: Changes in release 3.22.29
-* News-3.22.28:: Changes in release 3.22.28
+* News-3.22.29:: Changes in release 3.22.29 (02 Jan 2000)
+* News-3.22.28:: Changes in release 3.22.28 (20 Oct 1999)
* News-3.22.27:: Changes in release 3.22.27
-* News-3.22.26:: Changes in release 3.22.26
+* News-3.22.26:: Changes in release 3.22.26 (16 Sep 1999)
* News-3.22.25:: Changes in release 3.22.25
-* News-3.22.24:: Changes in release 3.22.24
-* News-3.22.23:: Changes in release 3.22.23
-* News-3.22.22:: Changes in release 3.22.22
+* News-3.22.24:: Changes in release 3.22.24 (05 Jul 1999)
+* News-3.22.23:: Changes in release 3.22.23 (08 Jun 1999)
+* News-3.22.22:: Changes in release 3.22.22 (30 Apr 1999)
* News-3.22.21:: Changes in release 3.22.21
-* News-3.22.20:: Changes in release 3.22.20
+* News-3.22.20:: Changes in release 3.22.20 (18 Mar 1999)
* News-3.22.19:: Changes in release 3.22.19 (Mar 1999: Stable)
* News-3.22.18:: Changes in release 3.22.18
* News-3.22.17:: Changes in release 3.22.17
@@ -52744,7 +54001,7 @@ Quicker kill of @code{SELECT DISTINCT} queries.
@node News-3.22.32, News-3.22.31, News-3.22.33, News-3.22.x
-@appendixsubsec Changes in release 3.22.32
+@appendixsubsec Changes in release 3.22.32 (14 Feb 2000)
@itemize @bullet
@item
@@ -52794,7 +54051,7 @@ Fixed non-critical Y2K problem when writing short date to log files.
@node News-3.22.29, News-3.22.28, News-3.22.30, News-3.22.x
-@appendixsubsec Changes in release 3.22.29
+@appendixsubsec Changes in release 3.22.29 (02 Jan 2000)
@itemize @bullet
@item
@@ -52823,7 +54080,7 @@ Fixed that @code{INSERT DELAYED} doesn't update timestamps that are given.
@node News-3.22.28, News-3.22.27, News-3.22.29, News-3.22.x
-@appendixsubsec Changes in release 3.22.28
+@appendixsubsec Changes in release 3.22.28 (20 Oct 1999)
@itemize @bullet
@item
@@ -52852,7 +54109,7 @@ Fixed problem when sorting on big @code{BLOB} columns.
@node News-3.22.26, News-3.22.25, News-3.22.27, News-3.22.x
-@appendixsubsec Changes in release 3.22.26
+@appendixsubsec Changes in release 3.22.26 (16 Sep 1999)
@itemize @bullet
@item
@@ -52866,7 +54123,7 @@ construct returned the rightmost 'pos' characters.)
@item
Fixed problem with @code{LOCK TABLES} combined with @code{DELETE FROM table}
@item
-Fixed problem that @code{INSERT ... SELECT} didn't use @code{SQL_BIG_TABLES}.
+Fixed problem that @code{INSERT ... SELECT} didn't use @code{BIG_TABLES}.
@item
@code{SET SQL_LOW_PRIORITY_UPDATES=#} didn't work.
@item
@@ -52891,7 +54148,7 @@ Fixed some small problems with the installation.
@node News-3.22.24, News-3.22.23, News-3.22.25, News-3.22.x
-@appendixsubsec Changes in release 3.22.24
+@appendixsubsec Changes in release 3.22.24 (05 Jul 1999)
@itemize @bullet
@item
@@ -52911,7 +54168,7 @@ crashes some RedHat 6.0 systems
@node News-3.22.23, News-3.22.22, News-3.22.24, News-3.22.x
-@appendixsubsec Changes in release 3.22.23
+@appendixsubsec Changes in release 3.22.23 (08 Jun 1999)
@itemize @bullet
@item
@@ -52939,7 +54196,7 @@ Fixed bug in @code{NATURAL LEFT JOIN}.
@node News-3.22.22, News-3.22.21, News-3.22.23, News-3.22.x
-@appendixsubsec Changes in release 3.22.22
+@appendixsubsec Changes in release 3.22.22 (30 Apr 1999)
@itemize @bullet
@item
@@ -52990,7 +54247,7 @@ connections).
@node News-3.22.20, News-3.22.19, News-3.22.21, News-3.22.x
-@appendixsubsec Changes in release 3.22.20
+@appendixsubsec Changes in release 3.22.20 (18 Mar 1999)
@itemize @bullet
@item
@@ -53403,8 +54660,9 @@ Changed optimiser to make it better at deciding when to do a full join
and when using keys.
@item
You can now use @code{mysqladmin proc} to display information about your own
-threads. Only users with the @strong{process} privilege can get
+threads. Only users with the @code{PROCESS} privilege can get
information about all threads.
+(In 4.0.2 one needs the @code{SUPER} privilege for this.)
@item
Added handling of formats @code{YYMMDD}, @code{YYYYMMDD},
@code{YYMMDDHHMMSS} for numbers when using @code{DATETIME} and
@@ -53494,8 +54752,8 @@ assumes the value is given as: @code{[[[D ]HH:]MM:]SS} instead of
and hours up to 32767.
@item
Added new option
-@code{SET OPTION SQL_LOG_UPDATE=@{0|1@}} to allow users with
-the @strong{process} privilege to bypass the update log.
+@code{SET SQL_LOG_UPDATE=@{0|1@}} to allow users with
+the @code{PROCESS} privilege to bypass the update log.
(Modified patch from Sergey A Mukhin @email{violet@@rosnet.net}.)
@item
Fixed fatal bug in @code{LPAD()}.
@@ -53513,7 +54771,7 @@ Added @code{--low-priority-updates} option to @code{mysqld}, to give
table-modifying operations (@code{INSERT}, @code{REPLACE}, @code{UPDATE},
@code{DELETE}) lower priority than retrievals. You can now use
@code{@{INSERT | REPLACE | UPDATE | DELETE@} LOW_PRIORITY ...} You can
-also use @code{SET OPTION SQL_LOW_PRIORITY_UPDATES=@{0|1@}} to change
+also use @code{SET SQL_LOW_PRIORITY_UPDATES=@{0|1@}} to change
the priority for one thread. One side effect is that @code{LOW_PRIORITY}
is now a reserved word. :(
@item
@@ -53596,7 +54854,7 @@ Added optimisation to remove const reference tables from @code{ORDER BY} and
@item
@code{mysqld} now automatically disables system locking on Linux and Windows,
and for systems that use MIT-pthreads. You can force the use of locking
-with the @code{--enable-locking} option.
+with the @code{--enable-external-locking} option.
@item
Added @code{--console} option to @code{mysqld}, to force a console window
(for error messages) when using Windows.
@@ -53897,7 +55155,7 @@ index file and cause error 126 or 138.
@item
Fixed fatal bug in @code{refresh()} when running with the
-@code{--skip-locking} option. There was a ``very small'' time gap after
+@code{--skip-external-locking} option. There was a ``very small'' time gap after
a @code{mysqladmin refresh} when a table could be corrupted if one
thread updated a table while another thread did @code{mysqladmin
refresh} and another thread started a new update ont the same table
@@ -54197,7 +55455,7 @@ Removed that @code{NULL = NULL} is true. Now you must use @code{IS NULL}
or @code{IS NOT NULL} to test whether a value is @code{NULL}.
(This is according to ANSI SQL but may break
old applications that are ported from @code{mSQL}.)
-You can get the old behavior by compiling with @code{-DmSQL_COMPLIANT}.
+You can get the old behaviour by compiling with @code{-DmSQL_COMPLIANT}.
@item
Fixed bug that core dumped when using many @code{LEFT OUTER JOIN} clauses.
@item
@@ -54561,7 +55819,7 @@ Fixed better @code{FOREIGN KEY} syntax skipping. New reserved words:
@code{mysqld} now allows IP number and hostname for the @code{--bind-address}
option.
@item
-Added @code{SET OPTION CHARACTER SET cp1251_koi8} to enable conversions of
+Added @code{SET CHARACTER SET cp1251_koi8} to enable conversions of
data to and from the @code{cp1251_koi8} character set.
@item
Lots of changes for Windows 95 port. In theory, this version should now be
@@ -54580,7 +55838,7 @@ NULL}.
@item
Added @code{CHAR} and @code{BIT} as synonyms for @code{CHAR(1)}.
@item
-Fixed core dump when updating as a user who has only @strong{select} privilege.
+Fixed core dump when updating as a user who has only @code{SELECT} privilege.
@item
@code{INSERT ... SELECT ... GROUP BY} didn't work in some cases. An
@code{Invalid use of group function} error occurred.
@@ -54610,7 +55868,7 @@ Added compatibility functions @code{CHECK} and @code{REFERENCES}.
Added @code{ALL} option to @code{GRANT} for better compatibility. (@code{GRANT}
is still a dummy function.)
@item
-Added partly-translated dutch messages.
+Added partly-translated Dutch error messages.
@item
Fixed bug in @code{ORDER BY} and @code{GROUP BY} with @code{NULL} columns.
@item
@@ -54821,7 +56079,7 @@ Added @code{-O join_cache_size=#} option to @code{mysqld}.
@item
Added @code{-O max_join_size=#} option to @code{mysqld}, to be able to set a
limit how big queries (in this case big = slow) one should be able to handle
-without specifying @code{SET OPTION SQL_BIG_SELECTS=1}. A # = is about 10
+without specifying @code{SET SQL_BIG_SELECTS=1}. A # = is about 10
examined records. The default is ``unlimited''.
@item
When comparing a @code{TIME}, @code{DATE}, @code{DATETIME} or @code{TIMESTAMP}
@@ -55110,7 +56368,7 @@ Now @code{LIKE} is always case-insensitive.
@item
@file{mysql.cc}: Allow @code{'#'} anywhere on the line.
@item
-New command @code{SET OPTION SQL_SELECT_LIMIT=#}. See the FAQ for more details.
+New command @code{SET SQL_SELECT_LIMIT=#}. See the FAQ for more details.
@item
New version of the @code{mysqlaccess} script.
@item
@@ -55416,7 +56674,7 @@ Previously, this resulted in the error:
when encountering ASCII 0, tab, newline or @code{'\'} while writing
tab-separated output.
This is to allow printing of binary data in a portable format.
-To get the old behavior, use @code{-r} (or @code{--raw}).
+To get the old behaviour, use @code{-r} (or @code{--raw}).
@item
Added german error messages (60 of 80 error messages translated).
@item
@@ -56322,8 +57580,8 @@ UPDATE table_name SET column=value WHERE unique_key#
DELETE FROM table_name WHERE unique_key=#
@end example
@item
-@code{SELECT} combined with @code{INSERT} (and very few @code{UPDATE}'s
-and @code{DELETE}'s.
+@code{SELECT} combined with @code{INSERT} (and very few @code{UPDATE}s
+and @code{DELETE}s.
@item
Many scans / @code{GROUP BY} on the whole table without any writers.
@end itemize
@@ -56539,7 +57797,7 @@ values in configuration files take precedence over values in environment
variables.
In many cases it's preferable to use a configure file instead of environment
-variables to modify the behavior of MySQL. @xref{Option files}.
+variables to modify the behaviour of MySQL. @xref{Option files}.
@tindex CCX environment variable
@tindex Environment variable, CCX
@@ -56563,6 +57821,8 @@ variables to modify the behavior of MySQL. @xref{Option files}.
@tindex Environment variable, MYSQL_HISTFILE
@tindex MYSQL_HOST environment variable
@tindex Environment variable, MYSQL_HOST
+@tindex MYSQL_PS1 environment variable
+@tindex Environment variable, MYSQL_PS1
@tindex MYSQL_PWD environment variable
@tindex Environment variable, MYSQL_PWD
@tindex MYSQL_TCP_PORT environment variable
@@ -56594,7 +57854,8 @@ variables to modify the behavior of MySQL. @xref{Option files}.
@item @code{LD_RUN_PATH} @tab Used to specify where your @code{libmysqlclient.so} is.
@item @code{MYSQL_DEBUG} @tab Debug-trace options when debugging.
@item @code{MYSQL_HISTFILE} @tab The path to the @code{mysql} history file.
-@item @code{MYSQL_HOST} @tab Default host name used by the @code{mysql} command-line prompt.
+@item @code{MYSQL_HOST} @tab Default host name used by the @code{mysql} command-line client.
+@item @code{MYSQL_PS1} @tab Command prompt to use in the @code{mysql} command-line client. @xref{mysql}.
@item @code{MYSQL_PWD} @tab The default password when connecting to @code{mysqld}. Note that use of this is insecure!
@item @code{MYSQL_TCP_PORT} @tab The default TCP/IP port.
@item @code{MYSQL_UNIX_PORT} @tab The default socket; used for connections to @code{localhost}.
diff --git a/Docs/mirrors.texi b/Docs/mirrors.texi
index 1082f7d9f09..651963c57c3 100644
--- a/Docs/mirrors.texi
+++ b/Docs/mirrors.texi
@@ -41,6 +41,10 @@ WWW (@uref{http://www.mysql.cz/})
WWW (@uref{http://mysql.borsen.dk/})
@item
+@image{Flags/denmark} Denmark [Cybercity Internet] @@
+WWW (@uref{http://mysql.mirrors.cybercity.dk/})
+
+@item
@image{Flags/denmark} Denmark [SunSITE] @@
WWW (@uref{http://mirrors.sunsite.dk/mysql/})
FTP (@uref{ftp://sunsite.dk/mirrors/mysql/})
@@ -54,6 +58,10 @@ WWW (@uref{http://mysql.mirror.ok.ee/})
WWW (@uref{http://mysql.kpnqwest.fi/})
@item
+@image{Flags/finland} Finland [Mediatraffic] @@
+WWW (@uref{http://mysql.mediatraffic.fi/})
+
+@item
@image{Flags/finland} Finland [tonnikala.net] @@
WWW (@uref{http://mysql.tonnikala.org/})
@@ -222,6 +230,10 @@ FTP (@uref{ftp://sunsite.cnlab-switch.ch/mirror/mysql/})
WWW (@uref{http://mysql.progen.com.tr/})
@item
+@image{Flags/turkey} Turkey [Turkish National Academic Network & Information Center] @@
+WWW (@uref{http://mysql.ulak.net.tr/})
+
+@item
@image{Flags/great-britain} UK [PLiG/UK] @@
WWW (@uref{http://ftp.plig.org/pub/mysql/})
FTP (@uref{ftp://ftp.plig.org/pub/mysql/})
@@ -266,6 +278,10 @@ FTP (@uref{ftp://mysql.unam.mx/pub/mysql/})
WWW (@uref{http://mysql.adgrafix.com/})
@item
+@image{Flags/usa} USA [Argonne National Laboratory / Chicago, IL] @@
+FTP (@uref{ftp://mirror.mcs.anl.gov/pub/mysql/})
+
+@item
@image{Flags/usa} USA [Hurricane Electric / San Jose, CA] @@
WWW (@uref{http://mysql.he.net/})
@@ -386,6 +402,10 @@ WWW (@uref{http://mysql.holywar.net/})
WWW (@uref{http://mysql.webiiz.com/})
@item
+@image{Flags/taiwan} Taiwan [I-SHOU University] @@
+WWW (@uref{http://mysql.isu.edu.tw/})
+
+@item
@image{Flags/taiwan} Taiwan [nctu.edu/HsinChu] @@
WWW (@uref{http://mysql.nctu.edu.tw/})
@@ -400,6 +420,10 @@ WWW (@uref{http://mysql.ttn.net/})
@itemize @bullet
@item
+@image{Flags/australia} Australia [InterActive Consulting] @@
+WWW (@uref{http://mysql.oranged.to})
+
+@item
@image{Flags/australia} Australia [planetmirror.com] @@
WWW (@uref{http://mysql.planetmirror.com/})
FTP (@uref{ftp://planetmirror.com/pub/mysql/})
@@ -415,10 +439,6 @@ WWW (@uref{http://mysql.soa.co.nz/})
@itemize @bullet
@item
-@image{Flags/south-africa} South African Republic [Mweb] @@
-WWW (@uref{http://www.mysql.mweb.co.za/})
-
-@item
@image{Flags/south-africa} South African Republic [The Internet Solution/Johannesburg] @@
FTP (@uref{ftp://ftp.is.co.za/linux/mysql/})
diff --git a/Makefile.am b/Makefile.am
index f56e67f1e83..87d1c7b5b71 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,7 +20,7 @@ AUTOMAKE_OPTIONS = foreign
# These are built from source in the Docs directory
EXTRA_DIST = INSTALL-SOURCE README \
- COPYING COPYING.LIB MIRRORS
+ COPYING COPYING.LIB
SUBDIRS = include @docs_dirs@ @readline_dir@ \
@thread_dirs@ pstack @sql_client_dirs@ \
@sql_server_dirs@ @libmysqld_dirs@ scripts man \
diff --git a/VC++Files/bdb/bdb.dsp b/VC++Files/bdb/bdb.dsp
new file mode 100644
index 00000000000..bed306fc3d0
--- /dev/null
+++ b/VC++Files/bdb/bdb.dsp
@@ -0,0 +1,707 @@
+# Microsoft Developer Studio Project File - Name="bdb" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=bdb - Win32 Release
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "bdb.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "bdb.mak" CFG="bdb - Win32 Release"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "bdb - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "bdb - Win32 Max" (based on "Win32 (x86) Static Library")
+!MESSAGE "bdb - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "bdb - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../bdb/build_win32" /I "../bdb/include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\lib_debug\bdb.lib"
+
+!ELSEIF "$(CFG)" == "bdb - Win32 Max"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "bdb___Win32_Max"
+# PROP BASE Intermediate_Dir "bdb___Win32_Max"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "bdb___Win32_Max"
+# PROP Intermediate_Dir "bdb___Win32_Max"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../bdb/build_win32" /I "../bdb/include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
+# SUBTRACT BASE CPP /Fr
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../bdb/include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /Fo"mysys___Win32_Max/" /Fd"mysys___Win32_Max/" /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\lib_debug\bdb.lib"
+# ADD LIB32 /nologo /out:"..\lib_release\bdb.lib"
+
+!ELSEIF "$(CFG)" == "bdb - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "bdb___Win32_Release"
+# PROP BASE Intermediate_Dir "bdb___Win32_Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "bdb___Win32_Release"
+# PROP Intermediate_Dir "bdb___Win32_Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../bdb/include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /Fo"mysys___Win32_Max/" /Fd"mysys___Win32_Max/" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../bdb/include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /Fo"mysys___Win32_Max/" /Fd"mysys___Win32_Max/" /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\lib_release\bdb.lib"
+# ADD LIB32 /nologo /out:"..\lib_release\bdb.lib"
+
+!ENDIF
+
+# Begin Target
+
+# Name "bdb - Win32 Debug"
+# Name "bdb - Win32 Max"
+# Name "bdb - Win32 Release"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\btree\bt_compare.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_conv.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_curadj.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_cursor.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_delete.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_open.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_put.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_reclaim.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_recno.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_rsearch.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_search.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_split.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_upgrade.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\bt_verify.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree\btree_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\crdel_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\crdel_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\cxx\cxx_app.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\cxx\cxx_except.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\cxx\cxx_lock.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\cxx\cxx_log.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\cxx\cxx_mpool.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\cxx\cxx_table.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\cxx\cxx_txn.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_am.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\common\db_byteorder.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_cam.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_conv.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_dispatch.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_dup.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\common\db_err.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\common\db_getlong.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_iface.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_join.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\common\db_log2.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_meta.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_overflow.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_pr.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_reclaim.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_ret.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\env\db_salloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\env\db_shash.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_upg.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_upg_opd.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_vrfy.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\db\db_vrfyutil.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\dbm\dbm.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\env\env_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\env\env_open.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\env\env_recover.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\env\env_region.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hash\hash.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hash\hash_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hash\hash_conv.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hash\hash_dup.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hash\hash_func.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hash\hash_meta.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hash\hash_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hash\hash_page.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hash\hash_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hash\hash_reclaim.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hash\hash_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hash\hash_upgrade.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hash\hash_verify.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\hsearch\hsearch.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\lock\lock.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\lock\lock_conflict.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\lock\lock_deadlock.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\lock\lock_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\lock\lock_region.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\lock\lock_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\lock\lock_util.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\log\log.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\log\log_archive.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\log\log_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\log\log_compare.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\log\log_findckp.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\log\log_get.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\log\log_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\log\log_put.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\log\log_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\log\log_register.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp\mp_alloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp\mp_bh.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp\mp_fget.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp\mp_fopen.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp\mp_fput.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp\mp_fset.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp\mp_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp\mp_region.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp\mp_register.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp\mp_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp\mp_sync.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mp\mp_trickle.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mutex\mut_tas.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mutex\mutex.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os_win32\os_abs.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os\os_alloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os_win32\os_dir.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os_win32\os_errno.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os_win32\os_fid.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os_win32\os_finit.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os\os_fsync.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os\os_handle.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os_win32\os_map.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os\os_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os\os_oflags.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os_win32\os_open.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os\os_region.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os_win32\os_rename.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os\os_root.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os\os_rpath.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os\os_rw.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os_win32\os_seek.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os_win32\os_sleep.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os_win32\os_spin.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os\os_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os\os_tmpdir.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os_win32\os_type.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os\os_unlink.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\qam\qam.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\qam\qam_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\qam\qam_conv.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\qam\qam_files.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\qam\qam_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\qam\qam_open.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\qam\qam_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\qam\qam_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\qam\qam_upgrade.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\qam\qam_verify.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\clib\strcasecmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\txn\txn.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\txn\txn_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\txn\txn_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\txn\txn_region.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\common\util_log.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\common\util_sig.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\xa\xa.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\xa\xa_db.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\xa\xa_map.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/Berkeley_DB.dsw b/VC++Files/bdb/build_win32/Berkeley_DB.dsw
new file mode 100644
index 00000000000..482ac7537f0
--- /dev/null
+++ b/VC++Files/bdb/build_win32/Berkeley_DB.dsw
@@ -0,0 +1,569 @@
+Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "DB_DLL"=.\db_dll.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "DB_Static"=.\db_static.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "db_archive"=.\db_archive.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "db_buildall"=.\db_buildall.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name db_archive
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name db_checkpoint
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name db_deadlock
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name db_dump
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name db_load
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name db_printlog
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name db_recover
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name db_stat
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name db_upgrade
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name db_verify
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name ex_access
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name ex_btrec
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name ex_env
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name ex_lock
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name ex_mpool
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name ex_tpcb
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name excxx_access
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name excxx_btrec
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name excxx_env
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name excxx_lock
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name excxx_mpool
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name excxx_tpcb
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "db_checkpoint"=.\db_checkpoint.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "db_deadlock"=.\db_deadlock.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "db_dump"=.\db_dump.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "db_java"=.\db_java.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "db_load"=.\db_load.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "db_printlog"=.\db_printlog.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "db_recover"=.\db_recover.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "db_stat"=.\db_stat.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "db_tcl"=.\db_tcl.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "db_test"=.\db_test.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name db_buildall
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name db_tcl
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "db_upgrade"=.\db_upgrade.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "db_verify"=.\db_verify.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "ex_access"=.\ex_access.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "ex_btrec"=.\ex_btrec.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "ex_env"=.\ex_env.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "ex_lock"=.\ex_lock.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "ex_mpool"=.\ex_mpool.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "ex_tpcb"=.\ex_tpcb.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "excxx_access"=.\excxx_access.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "excxx_btrec"=.\excxx_btrec.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "excxx_env"=.\excxx_env.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "excxx_lock"=.\excxx_lock.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "excxx_mpool"=.\excxx_mpool.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "excxx_tpcb"=.\excxx_tpcb.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name DB_DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name DB_Static
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/VC++Files/bdb/build_win32/db_archive.dsp b/VC++Files/bdb/build_win32/db_archive.dsp
new file mode 100644
index 00000000000..4b8509950ef
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_archive.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="db_archive" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=db_archive - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_archive.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_archive.mak" CFG="db_archive - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_archive - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_archive - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_archive - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_archive - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "db_archive - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "db_archive - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "db_archive - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "db_archive - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_archive - Win32 Release"
+# Name "db_archive - Win32 Debug"
+# Name "db_archive - Win32 Release Static"
+# Name "db_archive - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\db_archive\db_archive.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/db_buildall.dsp b/VC++Files/bdb/build_win32/db_buildall.dsp
new file mode 100644
index 00000000000..58990dbb867
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_buildall.dsp
@@ -0,0 +1,128 @@
+# Microsoft Developer Studio Project File - Name="db_buildall" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) External Target" 0x0106
+
+CFG=db_buildall - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_buildall.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_buildall.mak" CFG="db_buildall - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_buildall - Win32 Release" (based on "Win32 (x86) External Target")
+!MESSAGE "db_buildall - Win32 Debug" (based on "Win32 (x86) External Target")
+!MESSAGE "db_buildall - Win32 Release Static" (based on\
+ "Win32 (x86) External Target")
+!MESSAGE "db_buildall - Win32 Debug Static" (based on\
+ "Win32 (x86) External Target")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+
+!IF "$(CFG)" == "db_buildall - Win32 Release"
+
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Cmd_Line "NMAKE /f db_buildall.mak"
+# PROP BASE Rebuild_Opt "/a"
+# PROP BASE Target_File "db_buildall.exe"
+# PROP BASE Bsc_Name "db_buildall.bsc"
+# PROP BASE Target_Dir ""
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Cmd_Line "echo DB release version built."
+# PROP Rebuild_Opt ""
+# PROP Target_File "db_buildall.exe"
+# PROP Bsc_Name "db_buildall.bsc"
+# PROP Target_Dir ""
+
+!ELSEIF "$(CFG)" == "db_buildall - Win32 Debug"
+
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Cmd_Line "NMAKE /f db_buildall.mak"
+# PROP BASE Rebuild_Opt "/a"
+# PROP BASE Target_File "db_buildall.exe"
+# PROP BASE Bsc_Name "db_buildall.bsc"
+# PROP BASE Target_Dir ""
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Cmd_Line "echo DB debug version built."
+# PROP Rebuild_Opt ""
+# PROP Target_File "db_buildall.exe"
+# PROP Bsc_Name "db_buildall.bsc"
+# PROP Target_Dir ""
+
+!ELSEIF "$(CFG)" == "db_buildall - Win32 Release Static"
+
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release_static"
+# PROP BASE Intermediate_Dir "Release_static"
+# PROP BASE Cmd_Line "echo DB release version built."
+# PROP BASE Rebuild_Opt ""
+# PROP BASE Target_File "db_buildall.exe"
+# PROP BASE Bsc_Name "db_buildall.bsc"
+# PROP BASE Target_Dir ""
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Cmd_Line "echo DB release version built."
+# PROP Rebuild_Opt ""
+# PROP Target_File "db_buildall.exe"
+# PROP Bsc_Name "db_buildall.bsc"
+# PROP Target_Dir ""
+
+!ELSEIF "$(CFG)" == "db_buildall - Win32 Debug Static"
+
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug_static"
+# PROP BASE Intermediate_Dir "Debug_static"
+# PROP BASE Cmd_Line "echo DB debug version built."
+# PROP BASE Rebuild_Opt ""
+# PROP BASE Target_File "db_buildall.exe"
+# PROP BASE Bsc_Name "db_buildall.bsc"
+# PROP BASE Target_Dir ""
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Cmd_Line "echo DB debug version built."
+# PROP Rebuild_Opt ""
+# PROP Target_File "db_buildall.exe"
+# PROP Bsc_Name "db_buildall.bsc"
+# PROP Target_Dir ""
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_buildall - Win32 Release"
+# Name "db_buildall - Win32 Debug"
+# Name "db_buildall - Win32 Release Static"
+# Name "db_buildall - Win32 Debug Static"
+
+!IF "$(CFG)" == "db_buildall - Win32 Release"
+
+!ELSEIF "$(CFG)" == "db_buildall - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "db_buildall - Win32 Release Static"
+
+!ELSEIF "$(CFG)" == "db_buildall - Win32 Debug Static"
+
+!ENDIF
+
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/db_checkpoint.dsp b/VC++Files/bdb/build_win32/db_checkpoint.dsp
new file mode 100644
index 00000000000..ac464a07ab8
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_checkpoint.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="db_checkpoint" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=db_checkpoint - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_checkpoint.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_checkpoint.mak" CFG="db_checkpoint - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_checkpoint - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_checkpoint - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_checkpoint - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_checkpoint - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "db_checkpoint - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "db_checkpoint - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "db_checkpoint - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "db_checkpoint - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_checkpoint - Win32 Release"
+# Name "db_checkpoint - Win32 Debug"
+# Name "db_checkpoint - Win32 Release Static"
+# Name "db_checkpoint - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\db_checkpoint\db_checkpoint.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/db_deadlock.dsp b/VC++Files/bdb/build_win32/db_deadlock.dsp
new file mode 100644
index 00000000000..429896ded04
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_deadlock.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="db_deadlock" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=db_deadlock - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_deadlock.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_deadlock.mak" CFG="db_deadlock - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_deadlock - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_deadlock - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_deadlock - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_deadlock - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "db_deadlock - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "db_deadlock - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "db_deadlock - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "db_deadlock - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_deadlock - Win32 Release"
+# Name "db_deadlock - Win32 Debug"
+# Name "db_deadlock - Win32 Release Static"
+# Name "db_deadlock - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\db_deadlock\db_deadlock.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/db_dll.dsp b/VC++Files/bdb/build_win32/db_dll.dsp
new file mode 100644
index 00000000000..d394e0313fd
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_dll.dsp
@@ -0,0 +1,753 @@
+# Microsoft Developer Studio Project File - Name="db_dll" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=db_dll - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_dll.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_dll.mak" CFG="db_dll - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "db_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "db_dll - Win32 Release Static" (based on\
+ "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "db_dll - Win32 Debug Static" (based on\
+ "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "db_dll - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I "../include" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release/libdb32.dll"
+
+!ELSEIF "$(CFG)" == "db_dll - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 2
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "DB_CREATE_DLL" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /YX"config.h" /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug/libdb32d.dll" /fixed:no
+
+!ELSEIF "$(CFG)" == "db_dll - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "DB_DLL__"
+# PROP BASE Intermediate_Dir "DB_DLL__"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I "../include" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I "../include" /D "DB_CREATE_DLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release/libdb32.dll"
+# ADD LINK32 /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release/libdb32.dll"
+
+!ELSEIF "$(CFG)" == "db_dll - Win32 Debug Static"
+
+# PROP BASE Use_MFC 2
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "DB_DLL_0"
+# PROP BASE Intermediate_Dir "DB_DLL_0"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 2
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "DB_CREATE_DLL" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /YX"config.h" /FD /c
+# SUBTRACT BASE CPP /Fr
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "DB_CREATE_DLL" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /YX"config.h" /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug/libdb32d.dll" /fixed:no
+# ADD LINK32 /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug/libdb32d.dll" /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_dll - Win32 Release"
+# Name "db_dll - Win32 Debug"
+# Name "db_dll - Win32 Release Static"
+# Name "db_dll - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\btree\bt_compare.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_conv.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_curadj.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_cursor.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_delete.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_open.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_put.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_reclaim.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_recno.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_rsearch.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_search.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_split.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_upgrade.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_verify.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\btree_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\dllmain.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libdb.def
+# End Source File
+# Begin Source File
+
+SOURCE=.\libdb.rc
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\strcasecmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\common\db_byteorder.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\common\db_err.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\common\db_getlong.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\common\db_log2.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\common\util_log.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\common\util_sig.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\cxx\cxx_app.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\cxx\cxx_except.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\cxx\cxx_lock.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\cxx\cxx_log.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\cxx\cxx_mpool.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\cxx\cxx_table.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\cxx\cxx_txn.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\crdel_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\crdel_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_am.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_cam.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_conv.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_dispatch.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_dup.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_iface.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_join.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_meta.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_overflow.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_pr.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_reclaim.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_ret.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_upg.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_upg_opd.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_vrfy.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_vrfyutil.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\dbm\dbm.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\env\db_salloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\env\db_shash.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\env\env_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\env\env_open.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\env\env_recover.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\env\env_region.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_conv.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_dup.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_func.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_meta.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_page.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_reclaim.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_upgrade.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_verify.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hsearch\hsearch.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lock\lock.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lock\lock_conflict.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lock\lock_deadlock.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lock\lock_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lock\lock_region.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lock\lock_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lock\lock_util.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_archive.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_compare.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_findckp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_get.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_put.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_register.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_alloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_bh.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_fget.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_fopen.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_fput.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_fset.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_region.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_register.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_sync.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_trickle.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mutex\mut_tas.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mutex\mutex.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_alloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_fsync.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_handle.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_oflags.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_region.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_root.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_rpath.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_rw.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_tmpdir.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_unlink.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_abs.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_dir.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_errno.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_fid.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_finit.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_map.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_open.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_rename.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_seek.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_sleep.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_spin.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_type.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_conv.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_files.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_open.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_upgrade.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_verify.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\txn\txn.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\txn\txn_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\txn\txn_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\txn\txn_region.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\xa\xa.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\xa\xa_db.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\xa\xa_map.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/db_dump.dsp b/VC++Files/bdb/build_win32/db_dump.dsp
new file mode 100644
index 00000000000..f4808b5138d
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_dump.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="db_dump" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=db_dump - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_dump.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_dump.mak" CFG="db_dump - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_dump - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_dump - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_dump - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_dump - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "db_dump - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "db_dump - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "db_dump - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "db_dump - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_dump - Win32 Release"
+# Name "db_dump - Win32 Debug"
+# Name "db_dump - Win32 Release Static"
+# Name "db_dump - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\db_dump\db_dump.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/db_java.dsp b/VC++Files/bdb/build_win32/db_java.dsp
new file mode 100644
index 00000000000..0a0d9dc0fcb
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_java.dsp
@@ -0,0 +1,174 @@
+# Microsoft Developer Studio Project File - Name="db_java" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=db_java - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_java.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_java.mak" CFG="db_java - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_java - Win32 Release" (based on\
+ "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "db_java - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "db_java - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "DB_CREATE_DLL" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release/libdb_java32.dll"
+# Begin Custom Build - Compiling java files using javac
+ProjDir=.
+InputPath=.\Release\libdb_java32.dll
+SOURCE=$(InputPath)
+
+"force_compilation.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ cd $(ProjDir)\..\java\src\com\sleepycat\db
+ mkdir ..\..\..\..\classes
+ echo compiling Berkeley DB classes
+ javac -d ../../../../classes -classpath "$(CLASSPATH);../../../../classes"\
+ *.java
+ echo compiling examples
+ cd ..\examples
+ javac -d ../../../../classes -classpath "$(CLASSPATH);../../../../classes"\
+ *.java
+ echo creating jar file
+ cd ..\..\..\..\classes
+ jar cf db.jar com\sleepycat\db\*.class
+ echo Java build finished
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "db_java - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 2
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DB_CREATE_DLL" /D "_WINDLL" /D "_AFXDLL" /YX"config.h" /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug/libdb_java32d.dll" /fixed:no
+# Begin Custom Build - Compiling java files using javac
+ProjDir=.
+InputPath=.\Debug\libdb_java32d.dll
+SOURCE=$(InputPath)
+
+"force_compilation.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ cd $(ProjDir)\..\java\src\com\sleepycat\db
+ mkdir ..\..\..\..\classes
+ echo compiling Berkeley DB classes
+ javac -g -d ../../../../classes -classpath "$(CLASSPATH);../../../../classes"\
+ *.java
+ echo compiling examples
+ javac -g -d ../../../../classes -classpath "$(CLASSPATH);../../../../classes"\
+ *.java
+ cd ..\examples
+ echo creating jar file
+ cd ..\..\..\..\classes
+ jar cf db.jar com\sleepycat\db\*.class
+ echo Java build finished
+
+# End Custom Build
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_java - Win32 Release"
+# Name "db_java - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\libdb_java\java_Db.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\libdb_java\java_DbEnv.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\libdb_java\java_DbLock.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\libdb_java\java_DbLsn.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\libdb_java\java_DbTxn.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\libdb_java\java_Dbc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\libdb_java\java_Dbt.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\libdb_java\java_info.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\libdb_java\java_locked.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\libdb_java\java_util.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/db_load.dsp b/VC++Files/bdb/build_win32/db_load.dsp
new file mode 100644
index 00000000000..adec8475a88
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_load.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="db_load" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=db_load - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_load.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_load.mak" CFG="db_load - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_load - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_load - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_load - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_load - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "db_load - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "db_load - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "db_load - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "db_load - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_load - Win32 Release"
+# Name "db_load - Win32 Debug"
+# Name "db_load - Win32 Release Static"
+# Name "db_load - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\db_load\db_load.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/db_printlog.dsp b/VC++Files/bdb/build_win32/db_printlog.dsp
new file mode 100644
index 00000000000..8b3fbd9fe31
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_printlog.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="db_printlog" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=db_printlog - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_printlog.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_printlog.mak" CFG="db_printlog - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_printlog - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_printlog - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_printlog - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_printlog - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "db_printlog - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "db_printlog - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "db_printlog - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "db_printlog - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_printlog - Win32 Release"
+# Name "db_printlog - Win32 Debug"
+# Name "db_printlog - Win32 Release Static"
+# Name "db_printlog - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\db_printlog\db_printlog.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/db_recover.dsp b/VC++Files/bdb/build_win32/db_recover.dsp
new file mode 100644
index 00000000000..bf07631f9b9
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_recover.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="db_recover" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=db_recover - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_recover.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_recover.mak" CFG="db_recover - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_recover - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_recover - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_recover - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_recover - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "db_recover - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "db_recover - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "db_recover - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "db_recover - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_recover - Win32 Release"
+# Name "db_recover - Win32 Debug"
+# Name "db_recover - Win32 Release Static"
+# Name "db_recover - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\db_recover\db_recover.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/db_stat.dsp b/VC++Files/bdb/build_win32/db_stat.dsp
new file mode 100644
index 00000000000..3e906897e68
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_stat.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="db_stat" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=db_stat - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_stat.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_stat.mak" CFG="db_stat - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_stat - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_stat - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_stat - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_stat - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "db_stat - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "db_stat - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "db_stat - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "db_stat - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_stat - Win32 Release"
+# Name "db_stat - Win32 Debug"
+# Name "db_stat - Win32 Release Static"
+# Name "db_stat - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\db_stat\db_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/db_static.dsp b/VC++Files/bdb/build_win32/db_static.dsp
new file mode 100644
index 00000000000..0c355241537
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_static.dsp
@@ -0,0 +1,714 @@
+# Microsoft Developer Studio Project File - Name="db_static" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=db_static - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_static.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_static.mak" CFG="db_static - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_static - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "db_static - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "db_static - Win32 Release Static" (based on\
+ "Win32 (x86) Static Library")
+!MESSAGE "db_static - Win32 Debug Static" (based on\
+ "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+
+!IF "$(CFG)" == "db_static - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "DB_Stati"
+# PROP BASE Intermediate_Dir "DB_Stati"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX"config.h" /FD /c
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"Release_static/libdb32s.lib"
+
+!ELSEIF "$(CFG)" == "db_static - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "DB_Stat0"
+# PROP BASE Intermediate_Dir "DB_Stat0"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX"config.h" /FD /c
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"Debug_static/libdb32sd.lib"
+
+!ELSEIF "$(CFG)" == "db_static - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "DB_Stati"
+# PROP BASE Intermediate_Dir "DB_Stati"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX"config.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX"config.h" /FD /c
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"Release/libdb32s.lib"
+# ADD LIB32 /nologo /out:"Release_static/libdb32s.lib"
+
+!ELSEIF "$(CFG)" == "db_static - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "DB_Stat0"
+# PROP BASE Intermediate_Dir "DB_Stat0"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX"config.h" /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX"config.h" /FD /c
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"Debug/libdb32sd.lib"
+# ADD LIB32 /nologo /out:"Debug_static/libdb32sd.lib"
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_static - Win32 Release"
+# Name "db_static - Win32 Debug"
+# Name "db_static - Win32 Release Static"
+# Name "db_static - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\btree\bt_compare.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_conv.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_curadj.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_cursor.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_delete.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_open.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_put.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_reclaim.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_recno.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_rsearch.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_search.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_split.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_upgrade.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\bt_verify.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\btree\btree_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\strcasecmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\common\db_byteorder.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\common\db_err.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\common\db_getlong.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\common\db_log2.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\common\util_log.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\common\util_sig.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\cxx\cxx_app.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\cxx\cxx_except.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\cxx\cxx_lock.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\cxx\cxx_log.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\cxx\cxx_mpool.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\cxx\cxx_table.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\cxx\cxx_txn.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\crdel_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\crdel_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_am.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_cam.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_conv.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_dispatch.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_dup.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_iface.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_join.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_meta.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_overflow.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_pr.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_reclaim.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_ret.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_upg.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_upg_opd.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_vrfy.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\db\db_vrfyutil.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\dbm\dbm.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\env\db_salloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\env\db_shash.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\env\env_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\env\env_open.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\env\env_recover.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\env\env_region.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_conv.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_dup.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_func.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_meta.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_page.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_reclaim.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_upgrade.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hash\hash_verify.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\hsearch\hsearch.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lock\lock.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lock\lock_conflict.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lock\lock_deadlock.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lock\lock_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lock\lock_region.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lock\lock_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\lock\lock_util.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_archive.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_compare.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_findckp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_get.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_put.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\log\log_register.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_alloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_bh.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_fget.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_fopen.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_fput.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_fset.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_region.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_register.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_sync.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mp\mp_trickle.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mutex\mut_tas.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mutex\mutex.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_alloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_fsync.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_handle.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_oflags.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_region.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_root.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_rpath.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_rw.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_tmpdir.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os\os_unlink.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_abs.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_dir.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_errno.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_fid.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_finit.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_map.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_open.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_rename.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_seek.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_sleep.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_spin.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\os_win32\os_type.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_conv.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_files.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_method.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_open.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_stat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_upgrade.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\qam\qam_verify.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\txn\txn.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\txn\txn_auto.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\txn\txn_rec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\txn\txn_region.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\xa\xa.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\xa\xa_db.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\xa\xa_map.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/db_tcl.dsp b/VC++Files/bdb/build_win32/db_tcl.dsp
new file mode 100644
index 00000000000..5a0712c3f82
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_tcl.dsp
@@ -0,0 +1,135 @@
+# Microsoft Developer Studio Project File - Name="db_tcl" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=db_tcl - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_tcl.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_tcl.mak" CFG="db_tcl - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_tcl - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "db_tcl - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "db_tcl - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /Ob2 /I "." /I "../include" /D "DB_TCL_SUPPORT" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "DB_CREATE_DLL" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 Release/libdb32.lib tcl83.lib /nologo /base:"0x13000000" /subsystem:windows /dll /machine:I386 /out:"Release/libdb_tcl32.dll"
+
+!ELSEIF "$(CFG)" == "db_tcl - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 2
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "DB_TCL_SUPPORT" /D "CONFIG_TEST" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DB_CREATE_DLL" /D "_WINDLL" /D "_AFXDLL" /YX"config.h" /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib tcl83d.lib /nologo /base:"0x13000000" /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"Debug/libdb_tcl32d.dll" /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_tcl - Win32 Release"
+# Name "db_tcl - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\libdb_tcl.def
+# End Source File
+# Begin Source File
+
+SOURCE=..\tcl\tcl_compat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\tcl\tcl_db.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\tcl\tcl_db_pkg.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\tcl\tcl_dbcursor.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\tcl\tcl_env.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\tcl\tcl_internal.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\tcl\tcl_lock.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\tcl\tcl_log.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\tcl\tcl_mp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\tcl\tcl_txn.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/db_test.dsp b/VC++Files/bdb/build_win32/db_test.dsp
new file mode 100644
index 00000000000..e1bb9056824
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_test.dsp
@@ -0,0 +1,99 @@
+# Microsoft Developer Studio Project File - Name="db_test" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=db_test - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_test.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_test.mak" CFG="db_test - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_test - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "db_test - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "db_test - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386
+# Begin Special Build Tool
+SOURCE=$(InputPath)
+PostBuild_Desc=Copy built executable files.
+PostBuild_Cmds=copy Release\*.exe .
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "db_test - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "db_recov"
+# PROP BASE Intermediate_Dir "db_recov"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"Debug/dbkill.exe" /fixed:no
+# Begin Special Build Tool
+SOURCE=$(InputPath)
+PostBuild_Desc=Copy built executable files.
+PostBuild_Cmds=copy Debug\*.exe .
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_test - Win32 Release"
+# Name "db_test - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\dbkill.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/db_upgrade.dsp b/VC++Files/bdb/build_win32/db_upgrade.dsp
new file mode 100644
index 00000000000..4bb821f57e2
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_upgrade.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="db_upgrade" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=db_upgrade - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_upgrade.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_upgrade.mak" CFG="db_upgrade - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_upgrade - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_upgrade - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_upgrade - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_upgrade - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "db_upgrade - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "db_upgrade - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "db_upgrade - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "db_upgrade - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_upgrade - Win32 Release"
+# Name "db_upgrade - Win32 Debug"
+# Name "db_upgrade - Win32 Release Static"
+# Name "db_upgrade - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\db_upgrade\db_upgrade.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/db_verify.dsp b/VC++Files/bdb/build_win32/db_verify.dsp
new file mode 100644
index 00000000000..a8112364a83
--- /dev/null
+++ b/VC++Files/bdb/build_win32/db_verify.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="db_verify" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=db_verify - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "db_verify.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "db_verify.mak" CFG="db_verify - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "db_verify - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_verify - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_verify - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "db_verify - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "db_verify - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "db_verify - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "db_verify - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "db_verify - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "db_verify - Win32 Release"
+# Name "db_verify - Win32 Debug"
+# Name "db_verify - Win32 Release Static"
+# Name "db_verify - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\db_verify\db_verify.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/ex_access.dsp b/VC++Files/bdb/build_win32/ex_access.dsp
new file mode 100644
index 00000000000..8c802b1d774
--- /dev/null
+++ b/VC++Files/bdb/build_win32/ex_access.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="ex_access" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=ex_access - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "ex_access.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "ex_access.mak" CFG="ex_access - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "ex_access - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_access - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_access - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_access - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "ex_access - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "ex_access - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "ex_access - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "ex_access - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "ex_access - Win32 Release"
+# Name "ex_access - Win32 Debug"
+# Name "ex_access - Win32 Release Static"
+# Name "ex_access - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\examples_c\ex_access.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/ex_btrec.dsp b/VC++Files/bdb/build_win32/ex_btrec.dsp
new file mode 100644
index 00000000000..08bc90752f5
--- /dev/null
+++ b/VC++Files/bdb/build_win32/ex_btrec.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="ex_btrec" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=ex_btrec - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "ex_btrec.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "ex_btrec.mak" CFG="ex_btrec - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "ex_btrec - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_btrec - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_btrec - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_btrec - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "ex_btrec - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "ex_btrec - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "ex_btrec - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "ex_btrec - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "ex_btrec - Win32 Release"
+# Name "ex_btrec - Win32 Debug"
+# Name "ex_btrec - Win32 Release Static"
+# Name "ex_btrec - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\examples_c\ex_btrec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/ex_env.dsp b/VC++Files/bdb/build_win32/ex_env.dsp
new file mode 100644
index 00000000000..a46e66dac27
--- /dev/null
+++ b/VC++Files/bdb/build_win32/ex_env.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="ex_env" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=ex_env - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "ex_env.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "ex_env.mak" CFG="ex_env - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "ex_env - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_env - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_env - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_env - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "ex_env - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "ex_env - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "ex_env - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "ex_env - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "ex_env - Win32 Release"
+# Name "ex_env - Win32 Debug"
+# Name "ex_env - Win32 Release Static"
+# Name "ex_env - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\examples_c\ex_env.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/ex_lock.dsp b/VC++Files/bdb/build_win32/ex_lock.dsp
new file mode 100644
index 00000000000..0fa57a960f8
--- /dev/null
+++ b/VC++Files/bdb/build_win32/ex_lock.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="ex_lock" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=ex_lock - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "ex_lock.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "ex_lock.mak" CFG="ex_lock - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "ex_lock - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_lock - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_lock - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_lock - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "ex_lock - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "ex_lock - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "ex_lock - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "ex_lock - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "ex_lock - Win32 Release"
+# Name "ex_lock - Win32 Debug"
+# Name "ex_lock - Win32 Release Static"
+# Name "ex_lock - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\examples_c\ex_lock.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/ex_mpool.dsp b/VC++Files/bdb/build_win32/ex_mpool.dsp
new file mode 100644
index 00000000000..3e2ee7205ce
--- /dev/null
+++ b/VC++Files/bdb/build_win32/ex_mpool.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="ex_mpool" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=ex_mpool - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "ex_mpool.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "ex_mpool.mak" CFG="ex_mpool - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "ex_mpool - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_mpool - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_mpool - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_mpool - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "ex_mpool - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "ex_mpool - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "ex_mpool - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "ex_mpool - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "ex_mpool - Win32 Release"
+# Name "ex_mpool - Win32 Debug"
+# Name "ex_mpool - Win32 Release Static"
+# Name "ex_mpool - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\examples_c\ex_mpool.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/ex_tpcb.dsp b/VC++Files/bdb/build_win32/ex_tpcb.dsp
new file mode 100644
index 00000000000..fbaa67de7ac
--- /dev/null
+++ b/VC++Files/bdb/build_win32/ex_tpcb.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="ex_tpcb" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=ex_tpcb - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "ex_tpcb.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "ex_tpcb.mak" CFG="ex_tpcb - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "ex_tpcb - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_tpcb - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_tpcb - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "ex_tpcb - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "ex_tpcb - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "ex_tpcb - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "ex_tpcb - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "ex_tpcb - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "ex_tpcb - Win32 Release"
+# Name "ex_tpcb - Win32 Debug"
+# Name "ex_tpcb - Win32 Release Static"
+# Name "ex_tpcb - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\examples_c\ex_tpcb.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/excxx_access.dsp b/VC++Files/bdb/build_win32/excxx_access.dsp
new file mode 100644
index 00000000000..d93894dc5b7
--- /dev/null
+++ b/VC++Files/bdb/build_win32/excxx_access.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="excxx_access" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=excxx_access - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "excxx_access.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "excxx_access.mak" CFG="excxx_access - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "excxx_access - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_access - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_access - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_access - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "excxx_access - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "excxx_access - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "excxx_access - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "excxx_access - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "excxx_access - Win32 Release"
+# Name "excxx_access - Win32 Debug"
+# Name "excxx_access - Win32 Release Static"
+# Name "excxx_access - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\examples_cxx\AccessExample.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/excxx_btrec.dsp b/VC++Files/bdb/build_win32/excxx_btrec.dsp
new file mode 100644
index 00000000000..403e438a6e1
--- /dev/null
+++ b/VC++Files/bdb/build_win32/excxx_btrec.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="excxx_btrec" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=excxx_btrec - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "excxx_btrec.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "excxx_btrec.mak" CFG="excxx_btrec - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "excxx_btrec - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_btrec - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_btrec - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_btrec - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "excxx_btrec - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "excxx_btrec - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "excxx_btrec - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "excxx_btrec - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "excxx_btrec - Win32 Release"
+# Name "excxx_btrec - Win32 Debug"
+# Name "excxx_btrec - Win32 Release Static"
+# Name "excxx_btrec - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\examples_cxx\BtRecExample.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/excxx_env.dsp b/VC++Files/bdb/build_win32/excxx_env.dsp
new file mode 100644
index 00000000000..792358ee3ac
--- /dev/null
+++ b/VC++Files/bdb/build_win32/excxx_env.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="excxx_env" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=excxx_env - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "excxx_env.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "excxx_env.mak" CFG="excxx_env - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "excxx_env - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_env - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_env - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_env - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "excxx_env - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "excxx_env - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "excxx_env - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "excxx_env - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "excxx_env - Win32 Release"
+# Name "excxx_env - Win32 Debug"
+# Name "excxx_env - Win32 Release Static"
+# Name "excxx_env - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\examples_cxx\EnvExample.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/excxx_lock.dsp b/VC++Files/bdb/build_win32/excxx_lock.dsp
new file mode 100644
index 00000000000..d35605cb412
--- /dev/null
+++ b/VC++Files/bdb/build_win32/excxx_lock.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="excxx_lock" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=excxx_lock - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "excxx_lock.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "excxx_lock.mak" CFG="excxx_lock - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "excxx_lock - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_lock - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_lock - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_lock - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "excxx_lock - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "excxx_lock - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "excxx_lock - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "excxx_lock - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "excxx_lock - Win32 Release"
+# Name "excxx_lock - Win32 Debug"
+# Name "excxx_lock - Win32 Release Static"
+# Name "excxx_lock - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\examples_cxx\LockExample.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/excxx_mpool.dsp b/VC++Files/bdb/build_win32/excxx_mpool.dsp
new file mode 100644
index 00000000000..2159e75bb9a
--- /dev/null
+++ b/VC++Files/bdb/build_win32/excxx_mpool.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="excxx_mpool" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=excxx_mpool - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "excxx_mpool.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "excxx_mpool.mak" CFG="excxx_mpool - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "excxx_mpool - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_mpool - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_mpool - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_mpool - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "excxx_mpool - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "excxx_mpool - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "excxx_mpool - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "excxx_mpool - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "excxx_mpool - Win32 Release"
+# Name "excxx_mpool - Win32 Debug"
+# Name "excxx_mpool - Win32 Release Static"
+# Name "excxx_mpool - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\examples_cxx\MpoolExample.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/bdb/build_win32/excxx_tpcb.dsp b/VC++Files/bdb/build_win32/excxx_tpcb.dsp
new file mode 100644
index 00000000000..9033daa6cfe
--- /dev/null
+++ b/VC++Files/bdb/build_win32/excxx_tpcb.dsp
@@ -0,0 +1,151 @@
+# Microsoft Developer Studio Project File - Name="excxx_tpcb" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=excxx_tpcb - Win32 Debug Static
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "excxx_tpcb.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "excxx_tpcb.mak" CFG="excxx_tpcb - Win32 Debug Static"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "excxx_tpcb - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_tpcb - Win32 Debug" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_tpcb - Win32 Release Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "excxx_tpcb - Win32 Debug Static" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "excxx_tpcb - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release/libdb32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"libcmt"
+
+!ELSEIF "$(CFG)" == "excxx_tpcb - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 Debug/libdb32d.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /nodefaultlib:"libcmtd" /fixed:no
+
+!ELSEIF "$(CFG)" == "excxx_tpcb - Win32 Release Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_static"
+# PROP Intermediate_Dir "Release_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Release_static/libdb32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Release_static/libdb32s.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "excxx_tpcb - Win32 Debug Static"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_static"
+# PROP Intermediate_Dir "Debug_static"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "." /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 Debug_static/libdb32d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+# ADD LINK32 Debug_static/libdb32sd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /fixed:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "excxx_tpcb - Win32 Release"
+# Name "excxx_tpcb - Win32 Debug"
+# Name "excxx_tpcb - Win32 Release Static"
+# Name "excxx_tpcb - Win32 Debug Static"
+# Begin Source File
+
+SOURCE=..\examples_cxx\TpcbExample.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\clib\getopt.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/client/mysql.dsp b/VC++Files/client/mysql.dsp
index 1cefdd2b67b..4c9819bacde 100644
--- a/VC++Files/client/mysql.dsp
+++ b/VC++Files/client/mysql.dsp
@@ -68,8 +68,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/client/mysqladmin.dsp b/VC++Files/client/mysqladmin.dsp
index 82794da57cb..278bcdae8b0 100644
--- a/VC++Files/client/mysqladmin.dsp
+++ b/VC++Files/client/mysqladmin.dsp
@@ -67,8 +67,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/client/mysqlcheck.dsp b/VC++Files/client/mysqlcheck.dsp
new file mode 100644
index 00000000000..b334c0a8f1c
--- /dev/null
+++ b/VC++Files/client/mysqlcheck.dsp
@@ -0,0 +1,71 @@
+# Microsoft Developer Studio Project File - Name="mysqlcheck" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=mysqlcheck - Win32 Release
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "mysqlcheck.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "mysqlcheck.mak" CFG="mysqlcheck - Win32 Release"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "mysqlcheck - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "mysqlcheck___Win32_Release"
+# PROP BASE Intermediate_Dir "mysqlcheck___Win32_Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "mysqlcheck___Win32_Release"
+# PROP Intermediate_Dir "mysqlcheck___Win32_Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /Fp"Release/mysqlcheck.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:"release/mysqlcheck.pdb" /machine:I386 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\"
+# SUBTRACT LINK32 /pdb:none
+# Begin Target
+
+# Name "mysqlcheck - Win32 Release"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\mysqlcheck.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/VC++Files/client/mysqlclient.dsp b/VC++Files/client/mysqlclient.dsp
index 376febc6d36..5e3fbcd060e 100644
--- a/VC++Files/client/mysqlclient.dsp
+++ b/VC++Files/client/mysqlclient.dsp
@@ -65,8 +65,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c
-# SUBTRACT CPP /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Zi /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
@@ -172,18 +171,6 @@ SOURCE=..\libmysql\get_password.c
# End Source File
# Begin Source File
-SOURCE=..\mysys\getopt.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\mysys\getopt1.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\mysys\getvar.c
-# End Source File
-# Begin Source File
-
SOURCE=..\strings\int2str.c
# End Source File
# Begin Source File
@@ -232,6 +219,19 @@ SOURCE=..\mysys\mf_iocache.c
# End Source File
# Begin Source File
+SOURCE=..\mysys\mf_iocache2.c
+
+!IF "$(CFG)" == "mysqlclient - Win32 Release"
+
+!ELSEIF "$(CFG)" == "mysqlclient - Win32 Debug"
+
+# ADD CPP /Od
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=..\mysys\mf_loadpath.c
# End Source File
# Begin Source File
@@ -292,6 +292,14 @@ SOURCE=..\mysys\my_fstream.c
# End Source File
# Begin Source File
+SOURCE=..\mysys\my_gethostbyname.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\mysys\my_getopt.c
+# End Source File
+# Begin Source File
+
SOURCE=..\mysys\my_getwd.c
# End Source File
# Begin Source File
@@ -368,6 +376,10 @@ SOURCE=..\mysys\my_thr_init.c
# End Source File
# Begin Source File
+SOURCE=..\mysys\my_vsnprintf.c
+# End Source File
+# Begin Source File
+
SOURCE=..\mysys\my_wincond.c
# End Source File
# Begin Source File
@@ -468,6 +480,10 @@ SOURCE=..\strings\strxmov.c
# End Source File
# Begin Source File
+SOURCE=..\strings\strxnmov.c
+# End Source File
+# Begin Source File
+
SOURCE=..\mysys\thr_mutex.c
# End Source File
# Begin Source File
diff --git a/VC++Files/client/mysqldump.dsp b/VC++Files/client/mysqldump.dsp
index dcf1c1435a6..448ba126153 100644
--- a/VC++Files/client/mysqldump.dsp
+++ b/VC++Files/client/mysqldump.dsp
@@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /GX- /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@@ -67,8 +67,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX- /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/client/mysqlimport.dsp b/VC++Files/client/mysqlimport.dsp
index f10c1f90f58..5de3b68dd4e 100644
--- a/VC++Files/client/mysqlimport.dsp
+++ b/VC++Files/client/mysqlimport.dsp
@@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /GX- /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@@ -68,8 +68,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX- /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/client/mysqlshow.dsp b/VC++Files/client/mysqlshow.dsp
index dd0fc09c70f..329f128d1b6 100644
--- a/VC++Files/client/mysqlshow.dsp
+++ b/VC++Files/client/mysqlshow.dsp
@@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /GX- /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@@ -67,8 +67,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX- /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/comp_err/comp_err.dsp b/VC++Files/comp_err/comp_err.dsp
new file mode 100644
index 00000000000..784266f4016
--- /dev/null
+++ b/VC++Files/comp_err/comp_err.dsp
@@ -0,0 +1,58 @@
+# Microsoft Developer Studio Project File - Name="comp_err" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=comp_err - Win32 Release
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "comp_err.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "comp_err.mak" CFG="comp_err - Win32 Release"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "comp_err - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCSN" /D "DBUG_OFF" /D "_WINDOWS" /D "__WIN__" /D "_MT" /FR /YX /FD /c
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib_release\mysys.lib wsock32.lib ..\lib_release\strings.lib ..\lib_release\dbug.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBC.lib" /out:"Release/comp-err.exe"
+# Begin Target
+
+# Name "comp_err - Win32 Release"
+# Begin Source File
+
+SOURCE=..\extra\comp_err.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/contrib/asm386/zlibvc.dsp b/VC++Files/contrib/asm386/zlibvc.dsp
new file mode 100644
index 00000000000..a70d4d4a6b0
--- /dev/null
+++ b/VC++Files/contrib/asm386/zlibvc.dsp
@@ -0,0 +1,651 @@
+# Microsoft Developer Studio Project File - Name="zlibvc" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+# TARGTYPE "Win32 (ALPHA) Dynamic-Link Library" 0x0602
+
+CFG=zlibvc - Win32 Release
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "zlibvc.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "zlibvc.mak" CFG="zlibvc - Win32 Release"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "zlibvc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 ReleaseAxp" (based on\
+ "Win32 (ALPHA) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 ReleaseWithoutAsm" (based on\
+ "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 ReleaseWithoutCrtdll" (based on\
+ "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir ".\Release"
+# PROP BASE Intermediate_Dir ".\Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ".\Release"
+# PROP Intermediate_Dir ".\Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir ".\Debug"
+# PROP BASE Intermediate_Dir ".\Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ".\Debug"
+# PROP Intermediate_Dir ".\Debug"
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:".\Debug\zlib.dll"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "zlibvc__"
+# PROP BASE Intermediate_Dir "zlibvc__"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "zlibvc__"
+# PROP Intermediate_Dir "zlibvc__"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c
+# ADD CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:"zlibvc__\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "zlibvc_0"
+# PROP BASE Intermediate_Dir "zlibvc_0"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "zlibvc_0"
+# PROP Intermediate_Dir "zlibvc_0"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_0\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "zlibvc_1"
+# PROP BASE Intermediate_Dir "zlibvc_1"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "zlibvc_1"
+# PROP Intermediate_Dir "zlibvc_1"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_1\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "zlibvc - Win32 Release"
+# Name "zlibvc - Win32 Debug"
+# Name "zlibvc - Win32 ReleaseAxp"
+# Name "zlibvc - Win32 ReleaseWithoutAsm"
+# Name "zlibvc - Win32 ReleaseWithoutCrtdll"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
+# Begin Source File
+
+SOURCE=.\adler32.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_ADLER=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\compress.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_COMPR=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\crc32.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_CRC32=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\deflate.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_DEFLA=\
+ ".\deflate.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\gvmat32c.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\gzio.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_GZIO_=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\infblock.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFBL=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\infcodes.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFCO=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inffast.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\inffast.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFFA=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inffast.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\inflate.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFLA=\
+ ".\infblock.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\inftrees.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFTR=\
+ ".\inftrees.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\infutil.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFUT=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\trees.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_TREES=\
+ ".\deflate.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\uncompr.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_UNCOM=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\unzip.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\zip.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\zlib.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\zlibvc.def
+# End Source File
+# Begin Source File
+
+SOURCE=.\zutil.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_ZUTIL=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
+# Begin Source File
+
+SOURCE=.\deflate.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\infblock.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\infcodes.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inffast.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inftrees.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\infutil.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\zconf.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\zlib.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\zutil.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/VC++Files/contrib/asm386/zlibvc.dsw b/VC++Files/contrib/asm386/zlibvc.dsw
new file mode 100644
index 00000000000..493cd870365
--- /dev/null
+++ b/VC++Files/contrib/asm386/zlibvc.dsw
@@ -0,0 +1,41 @@
+Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "zlibstat"=.\zlibstat.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "zlibvc"=.\zlibvc.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/VC++Files/contrib/minizip/zlibvc.dsp b/VC++Files/contrib/minizip/zlibvc.dsp
new file mode 100644
index 00000000000..a70d4d4a6b0
--- /dev/null
+++ b/VC++Files/contrib/minizip/zlibvc.dsp
@@ -0,0 +1,651 @@
+# Microsoft Developer Studio Project File - Name="zlibvc" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+# TARGTYPE "Win32 (ALPHA) Dynamic-Link Library" 0x0602
+
+CFG=zlibvc - Win32 Release
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "zlibvc.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "zlibvc.mak" CFG="zlibvc - Win32 Release"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "zlibvc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 ReleaseAxp" (based on\
+ "Win32 (ALPHA) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 ReleaseWithoutAsm" (based on\
+ "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "zlibvc - Win32 ReleaseWithoutCrtdll" (based on\
+ "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir ".\Release"
+# PROP BASE Intermediate_Dir ".\Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ".\Release"
+# PROP Intermediate_Dir ".\Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir ".\Debug"
+# PROP BASE Intermediate_Dir ".\Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ".\Debug"
+# PROP Intermediate_Dir ".\Debug"
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:".\Debug\zlib.dll"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "zlibvc__"
+# PROP BASE Intermediate_Dir "zlibvc__"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "zlibvc__"
+# PROP Intermediate_Dir "zlibvc__"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c
+# ADD CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:"zlibvc__\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "zlibvc_0"
+# PROP BASE Intermediate_Dir "zlibvc_0"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "zlibvc_0"
+# PROP Intermediate_Dir "zlibvc_0"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_0\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "zlibvc_1"
+# PROP BASE Intermediate_Dir "zlibvc_1"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "zlibvc_1"
+# PROP Intermediate_Dir "zlibvc_1"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+RSC=rc.exe
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll"
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_1\zlib.dll"
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "zlibvc - Win32 Release"
+# Name "zlibvc - Win32 Debug"
+# Name "zlibvc - Win32 ReleaseAxp"
+# Name "zlibvc - Win32 ReleaseWithoutAsm"
+# Name "zlibvc - Win32 ReleaseWithoutCrtdll"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
+# Begin Source File
+
+SOURCE=.\adler32.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_ADLER=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\compress.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_COMPR=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\crc32.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_CRC32=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\deflate.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_DEFLA=\
+ ".\deflate.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\gvmat32c.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\gzio.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_GZIO_=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\infblock.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFBL=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\infcodes.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFCO=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inffast.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\inffast.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFFA=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inffast.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\inflate.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFLA=\
+ ".\infblock.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\inftrees.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFTR=\
+ ".\inftrees.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\infutil.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_INFUT=\
+ ".\infblock.h"\
+ ".\infcodes.h"\
+ ".\inftrees.h"\
+ ".\infutil.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\trees.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_TREES=\
+ ".\deflate.h"\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\uncompr.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_UNCOM=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\unzip.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\zip.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\zlib.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\zlibvc.def
+# End Source File
+# Begin Source File
+
+SOURCE=.\zutil.c
+
+!IF "$(CFG)" == "zlibvc - Win32 Release"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseAxp"
+
+DEP_CPP_ZUTIL=\
+ ".\zconf.h"\
+ ".\zlib.h"\
+ ".\zutil.h"\
+
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm"
+
+!ELSEIF "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll"
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
+# Begin Source File
+
+SOURCE=.\deflate.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\infblock.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\infcodes.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inffast.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inftrees.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\infutil.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\zconf.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\zlib.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\zutil.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/VC++Files/contrib/minizip/zlibvc.dsw b/VC++Files/contrib/minizip/zlibvc.dsw
new file mode 100644
index 00000000000..493cd870365
--- /dev/null
+++ b/VC++Files/contrib/minizip/zlibvc.dsw
@@ -0,0 +1,41 @@
+Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "zlibstat"=.\zlibstat.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "zlibvc"=.\zlibvc.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/VC++Files/innobase/innobase.dsp b/VC++Files/innobase/innobase.dsp
index 5159d513e87..c3084bfa799 100644
--- a/VC++Files/innobase/innobase.dsp
+++ b/VC++Files/innobase/innobase.dsp
@@ -20,6 +20,7 @@ CFG=innobase - Win32 Max
!MESSAGE "innobase - Win32 Max" (based on "Win32 (x86) Static Library")
!MESSAGE "innobase - Win32 Max nt" (based on "Win32 (x86) Static Library")
!MESSAGE "innobase - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "innobase - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
@@ -98,6 +99,29 @@ LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\innobase-nt.lib"
# ADD LIB32 /nologo /out:"..\lib_debug\innodb.lib"
+!ELSEIF "$(CFG)" == "innobase - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "innobase___Win32_Release"
+# PROP BASE Intermediate_Dir "innobase___Win32_Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "innobase___Win32_Release"
+# PROP Intermediate_Dir "innobase___Win32_Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /YX /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /YX /FD /c
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\lib_release\innodb.lib"
+# ADD LIB32 /nologo /out:"..\lib_release\innodb.lib"
+
!ENDIF
# Begin Target
@@ -105,6 +129,7 @@ LIB32=link.exe -lib
# Name "innobase - Win32 Max"
# Name "innobase - Win32 Max nt"
# Name "innobase - Win32 Debug"
+# Name "innobase - Win32 Release"
# Begin Source File
SOURCE=.\btr\btr0btr.c
diff --git a/VC++Files/libmysql/libmySQL.dsp b/VC++Files/libmysql/libmySQL.dsp
index 9ea68943a97..14587260d60 100644
--- a/VC++Files/libmysql/libmySQL.dsp
+++ b/VC++Files/libmysql/libmySQL.dsp
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "." /I "..\include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "." /I "..\include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /D "USE_OLD_FUNCTIONS" /FD /c
# SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
@@ -76,8 +76,7 @@ PostBuild_Cmds=copy release\libmysql.lib ..\lib_release
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "." /I "..\include" /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /FD /c
-# SUBTRACT CPP /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "." /I "..\include" /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "USE_OLD_FUNCTIONS" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
@@ -92,7 +91,7 @@ LINK32=link.exe
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Desc=Move DLL export lib
-PostBuild_Cmds=copy ..\lib_debug\libmysql.dll C:\winnt\system32 copy debug\libmysql.lib ..\lib_debug
+PostBuild_Cmds=copy debug\libmysql.lib ..\lib_debug
# End Special Build Tool
!ENDIF
@@ -283,6 +282,10 @@ SOURCE=..\mysys\my_fstream.c
# End Source File
# Begin Source File
+SOURCE=..\mysys\my_gethostbyname.c
+# End Source File
+# Begin Source File
+
SOURCE=..\mysys\my_getwd.c
# End Source File
# Begin Source File
@@ -351,6 +354,10 @@ SOURCE=..\mysys\my_thr_init.c
# End Source File
# Begin Source File
+SOURCE=..\mysys\my_vsnprintf.c
+# End Source File
+# Begin Source File
+
SOURCE=..\mysys\my_wincond.c
# End Source File
# Begin Source File
@@ -439,6 +446,10 @@ SOURCE=..\strings\strxmov.c
# End Source File
# Begin Source File
+SOURCE=..\strings\strxnmov.c
+# End Source File
+# Begin Source File
+
SOURCE=..\mysys\thr_mutex.c
# End Source File
# Begin Source File
diff --git a/VC++Files/libmysqld/examples/test_libmysqld.dsp b/VC++Files/libmysqld/examples/test_libmysqld.dsp
new file mode 100644
index 00000000000..35d9689266d
--- /dev/null
+++ b/VC++Files/libmysqld/examples/test_libmysqld.dsp
@@ -0,0 +1,66 @@
+# Microsoft Developer Studio Project File - Name="test_libmysqld" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=test_libmysqld - Win32 Release
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "test_libmysqld.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "test_libmysqld.mak" CFG="test_libmysqld - Win32 Release"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "test_libmysqld - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\include" /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "DBUG_OFF" /FR /YX /FD /c
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBCMTD" /out:"Release/mysql-server.exe"
+# Begin Target
+
+# Name "test_libmysqld - Win32 Release"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\client\mysql.cpp
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=..\..\lib_release\libmysqld.lib
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp
new file mode 100644
index 00000000000..34574dd4f2f
--- /dev/null
+++ b/VC++Files/libmysqld/libmysqld.dsp
@@ -0,0 +1,405 @@
+# Microsoft Developer Studio Project File - Name="libmysqld" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=libmysqld - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "libmysqld.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "libmysqld.mak" CFG="libmysqld - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "libmysqld - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "libmysqld - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "libmysqld - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /FR /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_release/libmysqld.dll" /implib:"../lib_release/libmysqld.lib"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "libmysqld - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "libmysqld___Win32_Debug"
+# PROP BASE Intermediate_Dir "libmysqld___Win32_Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "debug"
+# PROP Intermediate_Dir "debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MT /W3 /Gm /Zi /Od /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\merge.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib ..\lib_debug\vio.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"LIBCMTD" /out:"../lib_debug/libmysqld.dll" /implib:"../lib_debug/libmysqld.lib" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "libmysqld - Win32 Release"
+# Name "libmysqld - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\sql\convert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\derror.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\libmysql\errmsg.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\field.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\field_conv.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\filesort.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\libmysql\get_password.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\ha_berkeley.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\ha_heap.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\ha_innodb.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\ha_isammrg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\ha_myisam.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\ha_myisammrg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\handler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\hash_filo.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\hostname.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\init.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_buff.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_cmpfunc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_create.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_func.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_strfunc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_sum.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_timefunc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_uniq.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\key.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\lib_load.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\lib_sql.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\libmysqld.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libmysqld.def
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\lock.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\log.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\log_event.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\mf_iocache.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\mini_client.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\net_pkg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\net_serv.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\opt_ft.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\opt_range.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\opt_sum.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\libmysql\password.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\procedure.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\records.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\repl_failsafe.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\slave.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_acl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_analyse.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_base.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_cache.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_class.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_crypt.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_db.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_delete.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_do.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_handler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_insert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_lex.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_list.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_manager.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_map.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_parse.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_rename.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_repl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_select.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_show.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_string.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_table.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_test.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_udf.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_union.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_update.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_yacc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\table.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\thr_malloc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\time.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\uniques.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\unireg.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/libmysqltest/myTest.dsp b/VC++Files/libmysqltest/myTest.dsp
index fec250e7a40..74f7b8ae48e 100644
--- a/VC++Files/libmysqltest/myTest.dsp
+++ b/VC++Files/libmysqltest/myTest.dsp
@@ -67,8 +67,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "..\include" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /Fr /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "..\include" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/libmysqltest/mytest.c b/VC++Files/libmysqltest/mytest.c
new file mode 100644
index 00000000000..9c6818ecf6c
--- /dev/null
+++ b/VC++Files/libmysqltest/mytest.c
@@ -0,0 +1,170 @@
+/*C4*/
+/****************************************************************/
+/* Author: Jethro Wright, III TS : 3/ 4/1998 9:15 */
+/* Date: 02/18/1998 */
+/* mytest.c : do some testing of the libmySQL.DLL.... */
+/* */
+/* History: */
+/* 02/18/1998 jw3 also sprach zarathustra.... */
+/****************************************************************/
+
+
+#include <windows.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <mysql.h>
+
+#define DEFALT_SQL_STMT "SELECT * FROM db"
+#ifndef offsetof
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
+
+/********************************************************
+**
+** main :-
+**
+********************************************************/
+
+int
+main( int argc, char * argv[] )
+{
+
+ char szSQL[ 200 ], aszFlds[ 25 ][ 25 ], szDB[ 50 ] ;
+ const char *pszT;
+ int i, j, k, l, x ;
+ MYSQL * myData ;
+ MYSQL_RES * res ;
+ MYSQL_FIELD * fd ;
+ MYSQL_ROW row ;
+
+ //....just curious....
+ printf( "sizeof( MYSQL ) == %d\n", sizeof( MYSQL ) ) ;
+ if ( argc == 2 )
+ {
+ strcpy( szDB, argv[ 1 ] ) ;
+ strcpy( szSQL, DEFALT_SQL_STMT ) ;
+ if (!strcmp(szDB,"--debug"))
+ {
+ strcpy( szDB, "mysql" ) ;
+ printf("Some mysql struct information (size and offset):\n");
+ printf("net:\t%3d %3d\n",sizeof(myData->net),offsetof(MYSQL,net));
+ printf("host:\t%3d %3d\n",sizeof(myData->host),offsetof(MYSQL,host));
+ printf("port:\t%3d %3d\n",sizeof(myData->port),offsetof(MYSQL,port));
+ printf("protocol_version:\t%3d %3d\n",sizeof(myData->protocol_version),
+ offsetof(MYSQL,protocol_version));
+ printf("thread_id:\t%3d %3d\n",sizeof(myData->thread_id),
+ offsetof(MYSQL,thread_id));
+ printf("affected_rows:\t%3d %3d\n",sizeof(myData->affected_rows),
+ offsetof(MYSQL,affected_rows));
+ printf("packet_length:\t%3d %3d\n",sizeof(myData->packet_length),
+ offsetof(MYSQL,packet_length));
+ printf("status:\t%3d %3d\n",sizeof(myData->status),
+ offsetof(MYSQL,status));
+ printf("fields:\t%3d %3d\n",sizeof(myData->fields),
+ offsetof(MYSQL,fields));
+ printf("field_alloc:\t%3d %3d\n",sizeof(myData->field_alloc),
+ offsetof(MYSQL,field_alloc));
+ printf("free_me:\t%3d %3d\n",sizeof(myData->free_me),
+ offsetof(MYSQL,free_me));
+ printf("options:\t%3d %3d\n",sizeof(myData->options),
+ offsetof(MYSQL,options));
+ puts("");
+ }
+ }
+ else if ( argc > 2 ) {
+ strcpy( szDB, argv[ 1 ] ) ;
+ strcpy( szSQL, argv[ 2 ] ) ;
+ }
+ else {
+ strcpy( szDB, "mysql" ) ;
+ strcpy( szSQL, DEFALT_SQL_STMT ) ;
+ }
+ //....
+
+ if ( (myData = mysql_init((MYSQL*) 0)) &&
+ mysql_real_connect( myData, NULL, NULL, NULL, NULL, MYSQL_PORT,
+ NULL, 0 ) )
+ {
+ if ( mysql_select_db( myData, szDB ) < 0 ) {
+ printf( "Can't select the %s database !\n", szDB ) ;
+ mysql_close( myData ) ;
+ return 2 ;
+ }
+ }
+ else {
+ printf( "Can't connect to the mysql server on port %d !\n",
+ MYSQL_PORT ) ;
+ mysql_close( myData ) ;
+ return 1 ;
+ }
+ //....
+ if ( ! mysql_query( myData, szSQL ) ) {
+ res = mysql_store_result( myData ) ;
+ i = (int) mysql_num_rows( res ) ; l = 1 ;
+ printf( "Query: %s\nNumber of records found: %ld\n", szSQL, i ) ;
+ //....we can get the field-specific characteristics here....
+ for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
+ strcpy( aszFlds[ x ], fd->name ) ;
+ //....
+ while ( row = mysql_fetch_row( res ) ) {
+ j = mysql_num_fields( res ) ;
+ printf( "Record #%ld:-\n", l++ ) ;
+ for ( k = 0 ; k < j ; k++ )
+ printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
+ (((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
+ puts( "==============================\n" ) ;
+ }
+ mysql_free_result( res ) ;
+ }
+ else printf( "Couldn't execute %s on the server !\n", szSQL ) ;
+ //....
+ puts( "==== Diagnostic info ====" ) ;
+ pszT = mysql_get_client_info() ;
+ printf( "Client info: %s\n", pszT ) ;
+ //....
+ pszT = mysql_get_host_info( myData ) ;
+ printf( "Host info: %s\n", pszT ) ;
+ //....
+ pszT = mysql_get_server_info( myData ) ;
+ printf( "Server info: %s\n", pszT ) ;
+ //....
+ res = mysql_list_processes( myData ) ; l = 1 ;
+ if (res)
+ {
+ for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
+ strcpy( aszFlds[ x ], fd->name ) ;
+ while ( row = mysql_fetch_row( res ) ) {
+ j = mysql_num_fields( res ) ;
+ printf( "Process #%ld:-\n", l++ ) ;
+ for ( k = 0 ; k < j ; k++ )
+ printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
+ (((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
+ puts( "==============================\n" ) ;
+ }
+ }
+ else
+ {
+ printf("Got error %s when retreiving processlist\n",mysql_error(myData));
+ }
+ //....
+ res = mysql_list_tables( myData, "%" ) ; l = 1 ;
+ for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
+ strcpy( aszFlds[ x ], fd->name ) ;
+ while ( row = mysql_fetch_row( res ) ) {
+ j = mysql_num_fields( res ) ;
+ printf( "Table #%ld:-\n", l++ ) ;
+ for ( k = 0 ; k < j ; k++ )
+ printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
+ (((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
+ puts( "==============================\n" ) ;
+ }
+ //....
+ pszT = mysql_stat( myData ) ;
+ puts( pszT ) ;
+ //....
+ mysql_close( myData ) ;
+ return 0 ;
+
+}
diff --git a/VC++Files/merge/merge.dsp b/VC++Files/merge/merge.dsp
index cb6042e6b68..70c0ce87d6b 100644
--- a/VC++Files/merge/merge.dsp
+++ b/VC++Files/merge/merge.dsp
@@ -92,10 +92,6 @@ SOURCE=.\mrg_create.c
# End Source File
# Begin Source File
-SOURCE=.\mrg_def.h
-# End Source File
-# Begin Source File
-
SOURCE=.\mrg_delete.c
# End Source File
# Begin Source File
@@ -134,9 +130,5 @@ SOURCE=.\mrg_static.c
SOURCE=.\mrg_update.c
# End Source File
-# Begin Source File
-
-SOURCE=.\mrgdef.h
-# End Source File
# End Target
# End Project
diff --git a/VC++Files/my_print_defaults/my_print_defaults.dsp b/VC++Files/my_print_defaults/my_print_defaults.dsp
new file mode 100644
index 00000000000..c7727b49851
--- /dev/null
+++ b/VC++Files/my_print_defaults/my_print_defaults.dsp
@@ -0,0 +1,101 @@
+# Microsoft Developer Studio Project File - Name="my_print_defaults" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=my_print_defaults - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "my_print_defaults.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "my_print_defaults.mak" CFG="my_print_defaults - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "my_print_defaults - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "my_print_defaults - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "my_print_defaults - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "my_print_defaults - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MT /W3 /Gm /GX /ZI /Od /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCMTD.lib" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "my_print_defaults - Win32 Release"
+# Name "my_print_defaults - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\extra\my_print_defaults.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/VC++Files/myisam/myisam.dsp b/VC++Files/myisam/myisam.dsp
index 5c13f5eb206..8346cddbc54 100644
--- a/VC++Files/myisam/myisam.dsp
+++ b/VC++Files/myisam/myisam.dsp
@@ -89,10 +89,6 @@ SOURCE=.\ft_boolean_search.c
# End Source File
# Begin Source File
-SOURCE=.\ft_eval.c
-# End Source File
-# Begin Source File
-
SOURCE=.\ft_nlq_search.c
# End Source File
# Begin Source File
@@ -101,10 +97,6 @@ SOURCE=.\ft_parser.c
# End Source File
# Begin Source File
-SOURCE=.\ft_search.c
-# End Source File
-# Begin Source File
-
SOURCE=.\ft_static.c
# End Source File
# Begin Source File
diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw
index 7713b28d978..6a7ec7a57dd 100644
--- a/VC++Files/mysql.dsw
+++ b/VC++Files/mysql.dsw
@@ -117,6 +117,54 @@ Package=<4>
###############################################################################
+Project: "libmysqld"=".\libmysqld\libmysqld.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name bdb
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name dbug
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name heap
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name innobase
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name myisam
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name myisammrg
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name mysys
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name regex
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name strings
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name vio
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name zlib
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name merge
+ End Project Dependency
+}}}
+
+###############################################################################
+
Project: "merge"=".\merge\merge.dsp" - Package Owner=<4>
Package=<5>
@@ -396,6 +444,18 @@ Package=<4>
###############################################################################
+Project: "mysqldemb"=".\mysqldemb\mysqldemb.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
Project: "mysqldump"=".\client\mysqldump.dsp" - Package Owner=<4>
Package=<5>
@@ -426,6 +486,54 @@ Package=<4>
###############################################################################
+Project: "mysqlserver"=".\mysqlserver\mysqlserver.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name zlib
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name bdb
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name dbug
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name heap
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name innobase
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name merge
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name myisam
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name myisammrg
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name mysqldemb
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name mysys
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name regex
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name strings
+ End Project Dependency
+}}}
+
+###############################################################################
+
Project: "mysqlshow"=".\client\mysqlshow.dsp" - Package Owner=<4>
Package=<5>
@@ -582,6 +690,24 @@ Package=<4>
###############################################################################
+Project: "test_libmysqld"=".\libmysqld\examples\test_libmysqld.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name libmysqld
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name mysqlclient
+ End Project Dependency
+}}}
+
+###############################################################################
+
Project: "thr_insert_test"=".\thr_insert_test\thr_insert_test.dsp" - Package Owner=<4>
Package=<5>
diff --git a/VC++Files/mysqlbinlog/mysqlbinlog.dsp b/VC++Files/mysqlbinlog/mysqlbinlog.dsp
index 4145585abc5..a62253b2a2c 100644
--- a/VC++Files/mysqlbinlog/mysqlbinlog.dsp
+++ b/VC++Files/mysqlbinlog/mysqlbinlog.dsp
@@ -67,7 +67,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /FD /c
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/mysqlcheck/mysqlcheck.dsp b/VC++Files/mysqlcheck/mysqlcheck.dsp
index 49c3fc2b702..d4b4f5652b7 100644
--- a/VC++Files/mysqlcheck/mysqlcheck.dsp
+++ b/VC++Files/mysqlcheck/mysqlcheck.dsp
@@ -49,7 +49,7 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\"
!ELSEIF "$(CFG)" == "mysqlcheck - Win32 Debug"
@@ -65,15 +65,15 @@ LINK32=link.exe
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /FD /c
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlcheck.exe" /pdbtype:sept /libpath:"..\lib_debug\\"
!ENDIF
diff --git a/VC++Files/mysqldemb/mysqldemb.dsp b/VC++Files/mysqldemb/mysqldemb.dsp
new file mode 100644
index 00000000000..a637c486574
--- /dev/null
+++ b/VC++Files/mysqldemb/mysqldemb.dsp
@@ -0,0 +1,392 @@
+# Microsoft Developer Studio Project File - Name="mysqldemb" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=mysqldemb - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "mysqldemb.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "mysqldemb.mak" CFG="mysqldemb - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "mysqldemb - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "mysqldemb - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "mysqldemb - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /YX /FD /c
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF "$(CFG)" == "mysqldemb - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /Zi /Od /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF
+
+# Begin Target
+
+# Name "mysqldemb - Win32 Release"
+# Name "mysqldemb - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\sql\convert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\derror.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\libmysql\errmsg.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\field.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\field_conv.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\filesort.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\libmysql\get_password.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\ha_berkeley.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\ha_heap.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\ha_innodb.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\ha_isammrg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\ha_myisam.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\ha_myisammrg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\handler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\hash_filo.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\hostname.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\init.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_buff.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_cmpfunc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_create.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_func.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_strfunc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_sum.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_timefunc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\item_uniq.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\key.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\libmysqld\lib_load.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\libmysqld\lib_sql.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\libmysqld\libmysqld.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\lock.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\log.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\log_event.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\mf_iocache.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\mini_client.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\net_pkg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\net_serv.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\opt_ft.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\opt_range.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\opt_sum.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\libmysql\password.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\procedure.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\records.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\repl_failsafe.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\slave.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_acl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_analyse.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_base.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_cache.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_class.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_crypt.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_db.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_delete.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_do.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_handler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_insert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_lex.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_list.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_manager.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_map.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_parse.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_rename.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_repl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_select.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_show.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_string.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_table.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_test.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_udf.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_union.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_update.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\sql_yacc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\table.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\thr_malloc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\time.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\uniques.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\sql\unireg.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/mysqlmanager/MySqlManager.dsp b/VC++Files/mysqlmanager/MySqlManager.dsp
index 60ee700b00c..56e1b4a5bf2 100644
--- a/VC++Files/mysqlmanager/MySqlManager.dsp
+++ b/VC++Files/mysqlmanager/MySqlManager.dsp
@@ -71,8 +71,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../include" /D "_DEBUG" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /Fr /YX /Yc /Yu
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /Zi /Od /I "../include" /D "_DEBUG" /D "_WINDOWS" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /o "NUL" /win32
# SUBTRACT MTL /mktyplib203
diff --git a/VC++Files/mysqlserver/mysqlserver.dsp b/VC++Files/mysqlserver/mysqlserver.dsp
new file mode 100644
index 00000000000..dda50cd5538
--- /dev/null
+++ b/VC++Files/mysqlserver/mysqlserver.dsp
@@ -0,0 +1,84 @@
+# Microsoft Developer Studio Project File - Name="mysqlserver" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=mysqlserver - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "mysqlserver.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "mysqlserver.mak" CFG="mysqlserver - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "mysqlserver - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "mysqlserver - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "mysqlserver - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /YX /FD /c
+# ADD BASE RSC /l 0x416 /d "NDEBUG"
+# ADD RSC /l 0x416 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF "$(CFG)" == "mysqlserver - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /Zi /Od /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x416 /d "_DEBUG"
+# ADD RSC /l 0x416 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF
+
+# Begin Target
+
+# Name "mysqlserver - Win32 Release"
+# Name "mysqlserver - Win32 Debug"
+# End Target
+# End Project
diff --git a/VC++Files/mysqlshutdown/mysqlshutdown.c b/VC++Files/mysqlshutdown/mysqlshutdown.c
new file mode 100644
index 00000000000..e770149604d
--- /dev/null
+++ b/VC++Files/mysqlshutdown/mysqlshutdown.c
@@ -0,0 +1,198 @@
+/****************************************************************************
+ MySqlShutdown - shutdown MySQL on system shutdown (Win95/98)
+ ----------------------------------------------------------------------------
+ Revision History :
+ Version Author Date Description
+ 001.00 Irena 21-12-99
+*****************************************************************************/
+#include <windows.h>
+
+//-----------------------------------------------------------------------
+// Local data
+//-----------------------------------------------------------------------
+static char szAppName[] = "MySqlShutdown";
+static HINSTANCE hInstance;
+
+#define MYWM_NOTIFYICON (WM_APP+100)
+
+//-----------------------------------------------------------------------
+// Exported functions
+//-----------------------------------------------------------------------
+LRESULT CALLBACK MainWindowProc (HWND, UINT, WPARAM, LPARAM);
+
+//-----------------------------------------------------------------------
+// Local functions
+//-----------------------------------------------------------------------
+static BOOL InitAppClass (HINSTANCE hInstance);
+
+BOOL TrayMessageAdd(HWND hWnd, DWORD dwMessage)
+{
+ BOOL res;
+ HICON hIcon =LoadIcon (hInstance, "MySql");
+ char *szTip="MySql Shutdown";
+ NOTIFYICONDATA tnd;
+
+ tnd.cbSize = sizeof(NOTIFYICONDATA);
+ tnd.hWnd = hWnd;
+ tnd.uID = 101;
+
+ tnd.uFlags = NIF_MESSAGE|NIF_ICON|NIF_TIP;
+ tnd.uCallbackMessage = MYWM_NOTIFYICON;
+ tnd.hIcon = hIcon;
+ strcpy(tnd.szTip, szTip);
+ res = Shell_NotifyIcon(dwMessage, &tnd);
+
+ if (hIcon) DestroyIcon(hIcon);
+
+ return res;
+}
+
+//-----------------------------------------------------------------------
+// Name: WinMain
+// Purpose: Main application entry point
+//-----------------------------------------------------------------------
+
+int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
+{ HWND hWnd;
+ MSG Msg;
+
+ hInstance=hInst;
+ // Register application class if needed
+ if (InitAppClass (hInstance) == FALSE) return (0);
+
+
+ hWnd = CreateWindow (szAppName, "MySql",
+ WS_OVERLAPPEDWINDOW|WS_MINIMIZE,
+ 0, 0,
+ GetSystemMetrics(SM_CXSCREEN)/4,
+ GetSystemMetrics(SM_CYSCREEN)/4,
+ 0, 0, hInstance, NULL);
+
+ if(!hWnd)
+ {
+ return (0);
+ }
+ ShowWindow (hWnd, SW_HIDE);
+ UpdateWindow (hWnd);
+ while (GetMessage (&Msg, 0, 0, 0))
+ { TranslateMessage (&Msg);
+ DispatchMessage (&Msg);
+ }
+ return ((int) (Msg.wParam));
+}
+
+//-----------------------------------------------------------------------
+// Name: InitAppClass
+// Purpose: Register the main application window class
+//-----------------------------------------------------------------------
+static BOOL InitAppClass (HINSTANCE hInstance)
+{
+ WNDCLASS cls;
+
+ if (GetClassInfo (hInstance, szAppName, &cls) == 0)
+ {
+ cls.style = CS_HREDRAW | CS_VREDRAW ;;
+ cls.lpfnWndProc = (WNDPROC) MainWindowProc;
+ cls.cbClsExtra = 0;
+ cls.cbWndExtra = sizeof(HWND);
+ cls.hInstance = hInstance;
+ cls.hIcon = LoadIcon (hInstance, "MySql");
+ cls.hCursor = LoadCursor (NULL, IDC_ARROW);
+ cls.hbrBackground = GetStockObject (WHITE_BRUSH) ;
+ cls.lpszMenuName = 0; //szAppName;
+ cls.lpszClassName = szAppName;
+ return RegisterClass (&cls);
+ }
+ return (TRUE);
+}
+//-----------------------------------------------------------------------
+// Name: MainWindowProc
+// Purpose: Window procedure for main application window.
+//-----------------------------------------------------------------------
+LRESULT CALLBACK MainWindowProc (HWND hWnd, UINT Msg,WPARAM wParam, LPARAM lParam)
+{
+ static RECT rect ;
+ HDC hdc ;
+ PAINTSTRUCT ps ;
+ static BOOL bShutdown=FALSE;
+
+ switch (Msg)
+ {
+ case WM_CREATE:
+ TrayMessageAdd(hWnd, NIM_ADD);
+ return TRUE;
+/***************
+ case WM_SYSCOMMAND:
+ if(wParam==SC_CLOSE)
+ { HANDLE hEventShutdown;
+
+ bShutdown=TRUE;
+ InvalidateRect(hWnd,NULL,TRUE);
+ ShowWindow (hWnd, SW_NORMAL);
+ UpdateWindow(hWnd);
+ hEventShutdown=OpenEvent(EVENT_MODIFY_STATE, 0, "MySqlShutdown");
+ if(hEventShutdown)
+ {
+ SetEvent(hEventShutdown);
+ CloseHandle(hEventShutdown);
+ Sleep(1000);
+ MessageBox(hWnd,"Shutdown", "MySql", MB_OK);
+ }
+ TrayMessageAdd(hWnd, NIM_DELETE);
+ }
+ break;
+**************/
+ case WM_DESTROY:
+ TrayMessageAdd(hWnd, NIM_DELETE);
+ PostQuitMessage (0);
+ return 0;
+ case WM_SIZE:
+ GetClientRect (hWnd, &rect) ;
+ return 0 ;
+
+ case WM_PAINT:
+ hdc = BeginPaint (hWnd, &ps) ;
+ if(bShutdown)
+ DrawText (hdc, "MySql shutdown in progress...",
+ -1, &rect, DT_WORDBREAK) ;
+ EndPaint (hWnd, &ps) ;
+ return 0 ;
+ case WM_QUERYENDSESSION: //Shutdown MySql
+ { HANDLE hEventShutdown;
+
+ bShutdown=TRUE;
+ InvalidateRect(hWnd,NULL,TRUE);
+ ShowWindow (hWnd, SW_NORMAL);
+ UpdateWindow(hWnd);
+ hEventShutdown=OpenEvent(EVENT_MODIFY_STATE, 0, "MySqlShutdown");
+ if(hEventShutdown)
+ {
+ SetEvent(hEventShutdown);
+ CloseHandle(hEventShutdown);
+ Sleep(1000);
+ MessageBox(hWnd,"Shutdown", "MySql", MB_OK);
+ }
+ }
+ return 1;
+
+ case MYWM_NOTIFYICON:
+ switch (lParam)
+ {
+ case WM_LBUTTONDOWN:
+ case WM_RBUTTONDOWN:
+ ShowWindow(hWnd, SW_SHOWNORMAL);
+ SetForegroundWindow(hWnd); // make us come to the front
+ break;
+ default:
+ break;
+ }
+ break;
+
+ }
+ return DefWindowProc (hWnd, Msg, wParam, lParam);
+}
+
+
+// ----------------------- The end ------------------------------------------
+
+
diff --git a/VC++Files/mysqlwatch/mysqlwatch.c b/VC++Files/mysqlwatch/mysqlwatch.c
new file mode 100644
index 00000000000..2aba6814869
--- /dev/null
+++ b/VC++Files/mysqlwatch/mysqlwatch.c
@@ -0,0 +1,745 @@
+/****************************************************************************
+ MySqlWatch - WinNT service program MySQL
+ - Re-start MySql server in case of failure
+*****************************************************************************/
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <process.h>
+#include <tchar.h>
+
+
+// name of the executable
+#define SZAPPNAME "mysqlwatch"
+// internal name of the service
+#define SZSERVICENAME "MySqlWatch"
+// displayed name of the service
+#define SZSERVICEDISPLAYNAME "MySqlWatch"
+// list of service dependencies - "dep1\0dep2\0\0"
+#define SZDEPENDENCIES ""
+
+
+
+VOID ServiceStart(DWORD dwArgc, LPTSTR *lpszArgv);
+VOID ServiceStop(void);
+BOOL ReportStatusToSCMgr(DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint);
+void AddToMessageLog(LPTSTR lpszMsg);
+
+// internal variables
+SERVICE_STATUS ssStatus; // current status of the service
+SERVICE_STATUS_HANDLE sshStatusHandle;
+DWORD dwErr = 0;
+BOOL bDebug = FALSE;
+TCHAR szErr[256];
+
+// internal function prototypes
+void WINAPI service_ctrl(DWORD dwCtrlCode);
+void WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv);
+void CmdInstallService(void);
+void CmdRemoveService(void);
+void CmdDebugService(int argc, char **argv);
+BOOL WINAPI ControlHandler ( DWORD dwCtrlType );
+LPTSTR GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize );
+
+//
+// FUNCTION: main
+//
+// PURPOSE: entrypoint for service
+//
+// PARAMETERS:
+// argc - number of command line arguments
+// argv - array of command line arguments
+//
+// RETURN VALUE:
+// none
+//
+// COMMENTS:
+// main() either performs the command line task, or
+// call StartServiceCtrlDispatcher to register the
+// main service thread. When the this call returns,
+// the service has stopped, so exit.
+//
+void main(int argc, char **argv)
+{
+ SERVICE_TABLE_ENTRY dispatchTable[] =
+ {
+ { TEXT(SZSERVICENAME), (LPSERVICE_MAIN_FUNCTION)service_main },
+ { NULL, NULL }
+ };
+
+ if ( (argc > 1) &&
+ ((*argv[1] == '-') || (*argv[1] == '/')) )
+ {
+ if ( stricmp( "install", argv[1]+1 ) == 0 )
+ {
+ CmdInstallService();
+ }
+ else if ( stricmp( "remove", argv[1]+1 ) == 0 )
+ {
+ CmdRemoveService();
+ }
+ else if ( stricmp( "debug", argv[1]+1 ) == 0 )
+ {
+ bDebug = TRUE;
+ CmdDebugService(argc, argv);
+ }
+ else
+ {
+ goto dispatch;
+ }
+ exit(0);
+ }
+
+ // if it doesn't match any of the above parameters
+ // the service control manager may be starting the service
+ // so we must call StartServiceCtrlDispatcher
+ dispatch:
+ // this is just to be friendly
+ printf( "%s -install to install the service\n", SZAPPNAME );
+ printf( "%s -remove to remove the service\n", SZAPPNAME );
+ printf( "%s -debug <params> to run as a console app for debugging\n", SZAPPNAME );
+ printf( "\nStartServiceCtrlDispatcher being called.\n" );
+ printf( "This may take several seconds. Please wait.\n" );
+
+ if (!StartServiceCtrlDispatcher(dispatchTable))
+ AddToMessageLog(TEXT("StartServiceCtrlDispatcher failed."));
+}
+
+
+
+//
+// FUNCTION: service_main
+//
+// PURPOSE: To perform actual initialization of the service
+//
+// PARAMETERS:
+// dwArgc - number of command line arguments
+// lpszArgv - array of command line arguments
+//
+// RETURN VALUE:
+// none
+//
+// COMMENTS:
+// This routine performs the service initialization and then calls
+// the user defined ServiceStart() routine to perform majority
+// of the work.
+//
+void WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv)
+{
+
+ // register our service control handler:
+ //
+ sshStatusHandle = RegisterServiceCtrlHandler( TEXT(SZSERVICENAME), service_ctrl);
+
+ if (!sshStatusHandle)
+ goto cleanup;
+
+ // SERVICE_STATUS members that don't change in example
+ //
+ ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
+ ssStatus.dwServiceSpecificExitCode = 0;
+
+
+ // report the status to the service control manager.
+ //
+ if (!ReportStatusToSCMgr(
+ SERVICE_START_PENDING, // service state
+ NO_ERROR, // exit code
+ 3000)) // wait hint
+ goto cleanup;
+
+
+ ServiceStart( dwArgc, lpszArgv );
+
+cleanup:
+
+ // try to report the stopped status to the service control manager.
+ //
+ if (sshStatusHandle)
+ ReportStatusToSCMgr(
+ SERVICE_STOPPED,
+ dwErr,
+ 0);
+
+ return;
+}
+
+
+
+//
+// FUNCTION: service_ctrl
+//
+// PURPOSE: This function is called by the SCM whenever
+// ControlService() is called on this service.
+//
+// PARAMETERS:
+// dwCtrlCode - type of control requested
+//
+// RETURN VALUE:
+// none
+//
+// COMMENTS:
+//
+void WINAPI service_ctrl(DWORD dwCtrlCode)
+{
+ // Handle the requested control code.
+ //
+ switch(dwCtrlCode)
+ {
+ // Stop the service.
+ //
+ case SERVICE_CONTROL_STOP:
+ ssStatus.dwCurrentState = SERVICE_STOP_PENDING;
+ ServiceStop();
+ break;
+
+ // Update the service status.
+ //
+ case SERVICE_CONTROL_INTERROGATE:
+ break;
+
+ // invalid control code
+ //
+ default:
+ break;
+
+ }
+
+ ReportStatusToSCMgr(ssStatus.dwCurrentState, NO_ERROR, 0);
+
+}
+
+
+
+//
+// FUNCTION: ReportStatusToSCMgr()
+//
+// PURPOSE: Sets the current status of the service and
+// reports it to the Service Control Manager
+//
+// PARAMETERS:
+// dwCurrentState - the state of the service
+// dwWin32ExitCode - error code to report
+// dwWaitHint - worst case estimate to next checkpoint
+//
+// RETURN VALUE:
+// TRUE - success
+// FALSE - failure
+//
+// COMMENTS:
+//
+BOOL ReportStatusToSCMgr(DWORD dwCurrentState,
+ DWORD dwWin32ExitCode,
+ DWORD dwWaitHint)
+{
+ static DWORD dwCheckPoint = 1;
+ BOOL fResult = TRUE;
+
+
+ if ( !bDebug ) // when debugging we don't report to the SCM
+ {
+ if (dwCurrentState == SERVICE_START_PENDING)
+ ssStatus.dwControlsAccepted = 0;
+ else
+ ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
+
+ ssStatus.dwCurrentState = dwCurrentState;
+ ssStatus.dwWin32ExitCode = dwWin32ExitCode;
+ ssStatus.dwWaitHint = dwWaitHint;
+
+ if ( ( dwCurrentState == SERVICE_RUNNING ) ||
+ ( dwCurrentState == SERVICE_STOPPED ) )
+ ssStatus.dwCheckPoint = 0;
+ else
+ ssStatus.dwCheckPoint = dwCheckPoint++;
+
+
+ // Report the status of the service to the service control manager.
+ //
+ if (!(fResult = SetServiceStatus( sshStatusHandle, &ssStatus))) {
+ AddToMessageLog(TEXT("SetServiceStatus"));
+ }
+ }
+ return fResult;
+}
+
+
+
+//
+// FUNCTION: AddToMessageLog(LPTSTR lpszMsg)
+//
+// PURPOSE: Allows any thread to log an error message
+//
+// PARAMETERS:
+// lpszMsg - text for message
+//
+// RETURN VALUE:
+// none
+//
+// COMMENTS:
+//
+void AddToMessageLog(LPTSTR lpszMsg)
+{
+ TCHAR szMsg[256];
+ HANDLE hEventSource;
+ LPTSTR lpszStrings[2];
+
+
+ if ( !bDebug )
+ {
+ dwErr = GetLastError();
+
+ // Use event logging to log the error.
+ //
+ hEventSource = RegisterEventSource(NULL, TEXT(SZSERVICENAME));
+
+ _stprintf(szMsg, TEXT("%s error: %d"), TEXT(SZSERVICENAME), dwErr);
+ lpszStrings[0] = szMsg;
+ lpszStrings[1] = lpszMsg;
+
+ if (hEventSource != NULL) {
+ ReportEvent(hEventSource, // handle of event source
+ EVENTLOG_ERROR_TYPE, // event type
+ 0, // event category
+ 0, // event ID
+ NULL, // current user's SID
+ 2, // strings in lpszStrings
+ 0, // no bytes of raw data
+ lpszStrings, // array of error strings
+ NULL); // no raw data
+
+ DeregisterEventSource(hEventSource);
+ }
+ }
+}
+
+
+
+
+///////////////////////////////////////////////////////////////////
+//
+// The following code handles service installation and removal
+//
+
+
+//
+// FUNCTION: CmdInstallService()
+//
+// PURPOSE: Installs the service
+//
+// PARAMETERS:
+// none
+//
+// RETURN VALUE:
+// none
+//
+// COMMENTS:
+//
+void CmdInstallService()
+{
+ SC_HANDLE schService;
+ SC_HANDLE schSCManager;
+
+ TCHAR szPath[512];
+
+ if ( GetModuleFileName( NULL, szPath, 512 ) == 0 )
+ {
+ _tprintf(TEXT("Unable to install %s - %s\n"), TEXT(SZSERVICEDISPLAYNAME), GetLastErrorText(szErr, 256));
+ return;
+ }
+
+ schSCManager = OpenSCManager(
+ NULL, // machine (NULL == local)
+ NULL, // database (NULL == default)
+ SC_MANAGER_ALL_ACCESS // access required
+ );
+ if ( schSCManager )
+ {
+ schService = CreateService(
+ schSCManager, // SCManager database
+ TEXT(SZSERVICENAME), // name of service
+ TEXT(SZSERVICEDISPLAYNAME), // name to display
+ SERVICE_ALL_ACCESS, // desired access
+ SERVICE_WIN32_OWN_PROCESS, // service type
+ SERVICE_DEMAND_START, // start type
+ SERVICE_ERROR_NORMAL, // error control type
+ szPath, // service's binary
+ NULL, // no load ordering group
+ NULL, // no tag identifier
+ TEXT(SZDEPENDENCIES), // dependencies
+ NULL, // LocalSystem account
+ NULL); // no password
+
+ if ( schService )
+ {
+ _tprintf(TEXT("%s installed.\n"), TEXT(SZSERVICEDISPLAYNAME) );
+ CloseServiceHandle(schService);
+ }
+ else
+ {
+ _tprintf(TEXT("CreateService failed - %s\n"), GetLastErrorText(szErr, 256));
+ }
+
+ CloseServiceHandle(schSCManager);
+ }
+ else
+ _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(szErr,256));
+}
+
+
+
+//
+// FUNCTION: CmdRemoveService()
+//
+// PURPOSE: Stops and removes the service
+//
+// PARAMETERS:
+// none
+//
+// RETURN VALUE:
+// none
+//
+// COMMENTS:
+//
+void CmdRemoveService()
+{
+ SC_HANDLE schService;
+ SC_HANDLE schSCManager;
+
+ schSCManager = OpenSCManager(
+ NULL, // machine (NULL == local)
+ NULL, // database (NULL == default)
+ SC_MANAGER_ALL_ACCESS // access required
+ );
+ if ( schSCManager )
+ {
+ schService = OpenService(schSCManager, TEXT(SZSERVICENAME), SERVICE_ALL_ACCESS);
+
+ if (schService)
+ {
+ // try to stop the service
+ if ( ControlService( schService, SERVICE_CONTROL_STOP, &ssStatus ) )
+ {
+ _tprintf(TEXT("Stopping %s."), TEXT(SZSERVICEDISPLAYNAME));
+ Sleep( 1000 );
+
+ while( QueryServiceStatus( schService, &ssStatus ) )
+ {
+ if ( ssStatus.dwCurrentState == SERVICE_STOP_PENDING )
+ {
+ _tprintf(TEXT("."));
+ Sleep( 1000 );
+ }
+ else
+ break;
+ }
+
+ if ( ssStatus.dwCurrentState == SERVICE_STOPPED )
+ _tprintf(TEXT("\n%s stopped.\n"), TEXT(SZSERVICEDISPLAYNAME) );
+ else
+ _tprintf(TEXT("\n%s failed to stop.\n"), TEXT(SZSERVICEDISPLAYNAME) );
+
+ }
+
+ // now remove the service
+ if( DeleteService(schService) )
+ _tprintf(TEXT("%s removed.\n"), TEXT(SZSERVICEDISPLAYNAME) );
+ else
+ _tprintf(TEXT("DeleteService failed - %s\n"), GetLastErrorText(szErr,256));
+
+
+ CloseServiceHandle(schService);
+ }
+ else
+ _tprintf(TEXT("OpenService failed - %s\n"), GetLastErrorText(szErr,256));
+
+ CloseServiceHandle(schSCManager);
+ }
+ else
+ _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(szErr,256));
+}
+
+
+
+
+
+//
+// FUNCTION: CmdRestartService()
+//
+// PURPOSE: Stops and removes the service
+//
+// PARAMETERS:
+// none
+//
+// RETURN VALUE:
+// none
+//
+// COMMENTS:
+//
+void CmdRestartService(char *szServiceName)
+{
+ SC_HANDLE schService;
+ SC_HANDLE schSCManager;
+
+ schSCManager = OpenSCManager(
+ NULL, // machine (NULL == local)
+ NULL, // database (NULL == default)
+ SC_MANAGER_ALL_ACCESS // access required
+ );
+ if ( schSCManager )
+ {
+ schService = OpenService(schSCManager, TEXT(szServiceName), SERVICE_ALL_ACCESS);
+ if (schService)
+ {
+ if(! ControlService( schService, SERVICE_CONTROL_INTERROGATE, &ssStatus ) )
+ //if(QueryServiceStatus( schService, &ssStatus )==0)
+ {
+ if(GetLastError()==ERROR_SERVICE_NOT_ACTIVE)
+ {
+
+ //AddToMessageLog(TEXT("Start service..."));
+ StartService( schService, 0,NULL);
+ }
+ else
+ { ;
+ //AddToMessageLog(TEXT("QueryService..."));
+ //AddToMessageLog(TEXT(GetLastErrorText(szErr,256)));
+ }
+ }
+ CloseServiceHandle(schService);
+ }
+ else
+ { _tprintf(TEXT("OpenService failed - %s\n"), GetLastErrorText(szErr,256));
+ AddToMessageLog(TEXT("OpenService..."));
+ AddToMessageLog(TEXT(GetLastErrorText(szErr,256)));
+
+ }
+ CloseServiceHandle(schSCManager);
+ }
+ else
+ { _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(szErr,256));
+ AddToMessageLog(TEXT("OpenSCMManager.."));
+
+ }
+}
+
+
+
+
+///////////////////////////////////////////////////////////////////
+//
+// The following code is for running the service as a console app
+//
+
+
+//
+// FUNCTION: CmdDebugService(int argc, char ** argv)
+//
+// PURPOSE: Runs the service as a console application
+//
+// PARAMETERS:
+// argc - number of command line arguments
+// argv - array of command line arguments
+//
+// RETURN VALUE:
+// none
+//
+// COMMENTS:
+//
+void CmdDebugService(int argc, char ** argv)
+{
+ DWORD dwArgc;
+ LPTSTR *lpszArgv;
+
+#ifdef UNICODE
+ lpszArgv = CommandLineToArgvW(GetCommandLineW(), &(dwArgc) );
+#else
+ dwArgc = (DWORD) argc;
+ lpszArgv = argv;
+#endif
+
+ _tprintf(TEXT("Debugging %s.\n"), TEXT(SZSERVICEDISPLAYNAME));
+
+ SetConsoleCtrlHandler( ControlHandler, TRUE );
+
+ ServiceStart( dwArgc, lpszArgv );
+}
+
+
+//
+// FUNCTION: ControlHandler ( DWORD dwCtrlType )
+//
+// PURPOSE: Handled console control events
+//
+// PARAMETERS:
+// dwCtrlType - type of control event
+//
+// RETURN VALUE:
+// True - handled
+// False - unhandled
+//
+// COMMENTS:
+//
+BOOL WINAPI ControlHandler ( DWORD dwCtrlType )
+{
+ switch( dwCtrlType )
+ {
+ case CTRL_BREAK_EVENT: // use Ctrl+C or Ctrl+Break to simulate
+ case CTRL_C_EVENT: // SERVICE_CONTROL_STOP in debug mode
+ _tprintf(TEXT("Stopping %s.\n"), TEXT(SZSERVICEDISPLAYNAME));
+ ServiceStop();
+ return TRUE;
+ break;
+
+ }
+ return FALSE;
+}
+
+//
+// FUNCTION: GetLastErrorText
+//
+// PURPOSE: copies error message text to string
+//
+// PARAMETERS:
+// lpszBuf - destination buffer
+// dwSize - size of buffer
+//
+// RETURN VALUE:
+// destination buffer
+//
+// COMMENTS:
+//
+LPTSTR GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize )
+{
+ DWORD dwRet;
+ LPTSTR lpszTemp = NULL;
+
+ dwRet = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_ARGUMENT_ARRAY,
+ NULL,
+ GetLastError(),
+ LANG_NEUTRAL,
+ (LPTSTR)&lpszTemp,
+ 0,
+ NULL );
+
+ // supplied buffer is not long enough
+ if ( !dwRet || ( (long)dwSize < (long)dwRet+14 ) )
+ lpszBuf[0] = TEXT('\0');
+ else
+ {
+ lpszTemp[lstrlen(lpszTemp)-2] = TEXT('\0'); //remove cr and newline character
+ _stprintf( lpszBuf, TEXT("%s (0x%x)"), lpszTemp, GetLastError() );
+ }
+
+ if ( lpszTemp )
+ LocalFree((HLOCAL) lpszTemp );
+
+ return lpszBuf;
+}
+
+//-------------------------------------------------
+// this event is signalled when the
+// service should end
+//-------------------------------------------------
+HANDLE hServerStopEvent = NULL;
+
+
+//-------------------------------------------------
+// FUNCTION: ServiceStart
+//
+// PURPOSE: Actual code of the service
+// that does the work.
+//-------------------------------------------------
+void ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv)
+{
+ DWORD dwWait,dwTimeout=1000*60*1;
+
+ if (!ReportStatusToSCMgr(
+ SERVICE_START_PENDING, // service state
+ NO_ERROR, // exit code
+ 3000)) // wait hint
+ goto cleanup;
+
+ // create the event object. The control handler function signals
+ // this event when it receives the "stop" control code.
+ //
+ hServerStopEvent = CreateEvent(
+ NULL, // no security attributes
+ TRUE, // manual reset event
+ FALSE, // not-signalled
+ NULL); // no name
+
+ if ( hServerStopEvent == NULL) goto cleanup;
+
+
+ // report the status to the service control manager.
+ //
+ if (!ReportStatusToSCMgr(
+ SERVICE_START_PENDING, // service state
+ NO_ERROR, // exit code
+ 3000)) // wait hint
+ goto cleanup;
+
+
+
+ // report the status to the service control manager.
+ //
+ if (!ReportStatusToSCMgr(
+ SERVICE_START_PENDING, // service state
+ NO_ERROR, // exit code
+ 3000)) // wait hint
+ goto cleanup;
+
+
+
+ // report the status to the service control manager.
+ //
+ if (!ReportStatusToSCMgr(
+ SERVICE_RUNNING, // service state
+ NO_ERROR, // exit code
+ 0)) // wait hint
+ goto cleanup;
+
+ //
+ // End of initialization
+ // Service is now running, perform work until shutdown
+ //
+
+ while ( 1 )
+ {
+
+ dwWait = WaitForSingleObject( hServerStopEvent, dwTimeout);
+ if(dwWait==WAIT_FAILED)
+ {
+ AddToMessageLog(TEXT("Error in WaitForSingleObject"));
+ break;
+ }
+ else if(dwWait==WAIT_TIMEOUT)
+ {
+ CmdRestartService("MySql");
+ }
+ else
+ { break; //shutdown
+ }
+
+ }
+
+ cleanup:
+
+ if (hServerStopEvent)
+ CloseHandle(hServerStopEvent);
+
+}
+
+
+//-------------------------------------------------
+// FUNCTION: ServiceStop
+//
+// PURPOSE: Stops the service
+//-------------------------------------------------
+void ServiceStop()
+{
+ if ( hServerStopEvent )
+ SetEvent(hServerStopEvent);
+}
+//-the end ----------------------------------------
diff --git a/VC++Files/mysys/mysys.dsp b/VC++Files/mysys/mysys.dsp
index eb467e55892..7a0087b68d6 100644
--- a/VC++Files/mysys/mysys.dsp
+++ b/VC++Files/mysys/mysys.dsp
@@ -66,8 +66,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /ZI /Od /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c
-# SUBTRACT CPP /Fr
+# ADD CPP /nologo /G6 /MTd /W3 /Zi /Od /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
@@ -142,23 +141,15 @@ SOURCE=.\errors.c
# End Source File
# Begin Source File
-SOURCE=.\getopt.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\getopt1.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\getvar.c
+SOURCE=.\hash.c
# End Source File
# Begin Source File
-SOURCE=.\hash.c
+SOURCE=.\list.c
# End Source File
# Begin Source File
-SOURCE=.\list.c
+SOURCE=.\md5.c
# End Source File
# Begin Source File
@@ -210,10 +201,6 @@ SOURCE=.\mf_pack.c
# End Source File
# Begin Source File
-SOURCE=.\mf_pack2.c
-# End Source File
-# Begin Source File
-
SOURCE=.\mf_path.c
# End Source File
# Begin Source File
@@ -242,7 +229,7 @@ SOURCE=.\mf_soundex.c
# End Source File
# Begin Source File
-SOURCE=.\mf_stripp.c
+SOURCE=.\mf_strip.c
# End Source File
# Begin Source File
@@ -262,6 +249,10 @@ SOURCE=.\mulalloc.c
# End Source File
# Begin Source File
+SOURCE=.\my_aes.c
+# End Source File
+# Begin Source File
+
SOURCE=.\my_alarm.c
# End Source File
# Begin Source File
@@ -322,6 +313,14 @@ SOURCE=.\my_fstream.c
# End Source File
# Begin Source File
+SOURCE=.\my_gethostbyname.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\my_getopt.c
+# End Source File
+# Begin Source File
+
SOURCE=.\my_getwd.c
# End Source File
# Begin Source File
@@ -438,6 +437,10 @@ SOURCE=.\my_wincond.c
# End Source File
# Begin Source File
+SOURCE=.\my_winsem.c
+# End Source File
+# Begin Source File
+
SOURCE=.\my_winthread.c
# End Source File
# Begin Source File
@@ -462,10 +465,18 @@ SOURCE=.\raid.cpp
# End Source File
# Begin Source File
+SOURCE=.\rijndael.c
+# End Source File
+# Begin Source File
+
SOURCE=.\safemalloc.c
# End Source File
# Begin Source File
+SOURCE=.\sha1.c
+# End Source File
+# Begin Source File
+
SOURCE=.\string.c
# End Source File
# Begin Source File
diff --git a/VC++Files/pack_isam/pack_isam.dsp b/VC++Files/pack_isam/pack_isam.dsp
index 20c832c96d0..036dcd9a2ca 100644
--- a/VC++Files/pack_isam/pack_isam.dsp
+++ b/VC++Files/pack_isam/pack_isam.dsp
@@ -66,8 +66,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../isam" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /Fr
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "../include" /I "../isam" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/perror/perror.dsp b/VC++Files/perror/perror.dsp
index 439fcef1547..2b720ace3e7 100644
--- a/VC++Files/perror/perror.dsp
+++ b/VC++Files/perror/perror.dsp
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /GX- /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
@@ -70,7 +70,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX- /ZI /Od /I "../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
diff --git a/VC++Files/replace/replace.dsp b/VC++Files/replace/replace.dsp
index 011b62d08ec..54584151418 100644
--- a/VC++Files/replace/replace.dsp
+++ b/VC++Files/replace/replace.dsp
@@ -67,8 +67,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "../include" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# ADD BASE RSC /l 0x40b /d "_DEBUG"
# ADD RSC /l 0x40b /d "_DEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp
index ec4722d7f27..a84af8adedc 100644
--- a/VC++Files/sql/mysqld.dsp
+++ b/VC++Files/sql/mysqld.dsp
@@ -71,8 +71,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../regex" /I "../bdb/build_win32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /FD /c
-# SUBTRACT CPP /Fr /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "../include" /I "../regex" /I "../bdb/build_win32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /FD /c
# ADD BASE RSC /l 0x410 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
@@ -286,7 +285,7 @@ SOURCE=.\ha_heap.cpp
# End Source File
# Begin Source File
-SOURCE=.\ha_innobase.cpp
+SOURCE=.\ha_innodb.cpp
# End Source File
# Begin Source File
@@ -615,10 +614,6 @@ SOURCE=.\log_event.cpp
# End Source File
# Begin Source File
-SOURCE=.\md5.c
-# End Source File
-# Begin Source File
-
SOURCE=.\mf_iocache.cpp
!IF "$(CFG)" == "mysqld - Win32 Release"
@@ -927,6 +922,10 @@ SOURCE=.\sql_delete.cpp
# End Source File
# Begin Source File
+SOURCE=.\sql_do.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\sql_handler.cpp
# End Source File
# Begin Source File
diff --git a/VC++Files/sql/mysqld.dsw b/VC++Files/sql/mysqld.dsw
new file mode 100644
index 00000000000..ed820ed7a90
--- /dev/null
+++ b/VC++Files/sql/mysqld.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "mysqld"=".\mysqld.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/VC++Files/strings/MASM6x/strings.dsp b/VC++Files/strings/MASM6x/strings.dsp
new file mode 100644
index 00000000000..0c1a3bdc0c2
--- /dev/null
+++ b/VC++Files/strings/MASM6x/strings.dsp
@@ -0,0 +1,244 @@
+# Microsoft Developer Studio Project File - Name="strings" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=strings - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "strings.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "strings.mak" CFG="strings - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "strings - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "strings - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "strings - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "release"
+# PROP Intermediate_Dir "release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\lib_release\strings.lib"
+
+!ELSEIF "$(CFG)" == "strings - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "debug"
+# PROP Intermediate_Dir "debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\lib_debug\strings.lib"
+
+!ENDIF
+
+# Begin Target
+
+# Name "strings - Win32 Release"
+# Name "strings - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\atof.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\bchange.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\bcmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\bfill.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\bmove512.c
+# End Source File
+# Begin Source File
+
+SOURCE=".\ctype-big5.c"
+# End Source File
+# Begin Source File
+
+SOURCE=".\ctype-czech.c"
+# End Source File
+# Begin Source File
+
+SOURCE=".\ctype-euc_kr.c"
+# End Source File
+# Begin Source File
+
+SOURCE=".\ctype-gb2312.c"
+# End Source File
+# Begin Source File
+
+SOURCE=".\ctype-gbk.c"
+# End Source File
+# Begin Source File
+
+SOURCE=".\ctype-sjis.c"
+# End Source File
+# Begin Source File
+
+SOURCE=".\ctype-tis620.c"
+# End Source File
+# Begin Source File
+
+SOURCE=".\ctype-ujis.c"
+# End Source File
+# Begin Source File
+
+SOURCE=.\ctype.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\int2str.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\llstr.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\longlong2str.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\r_strinstr.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\str2int.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\Strings.asm
+
+!IF "$(CFG)" == "strings - Win32 Release"
+
+# Begin Custom Build
+OutDir=.\release
+InputPath=.\Strings.asm
+InputName=Strings
+
+"$(OutDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ ml /Cx /nologo /DDOS386 /DM_I386 /Zm /coff /c /Fo $(Outdir)\$(InputName).obj $(InputPath)
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "strings - Win32 Debug"
+
+# Begin Custom Build
+OutDir=.\debug
+InputPath=.\Strings.asm
+InputName=Strings
+
+"$(OutDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ ml /Cx /nologo /DDOS386 /DM_I386 /Zm /coff /c /Fo $(Outdir)\$(InputName).obj $(InputPath)
+
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\strtol.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strtoll.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strtoul.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strtoull.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\Strxmov.asm
+
+!IF "$(CFG)" == "strings - Win32 Release"
+
+# Begin Custom Build
+OutDir=.\release
+InputPath=.\Strxmov.asm
+InputName=Strxmov
+
+"$(OutDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ ml /Cx /nologo /DDOS386 /DM_I386 /Zm /coff /c /Fo $(Outdir)\$(InputName).obj $(InputPath)
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "strings - Win32 Debug"
+
+# Begin Custom Build
+OutDir=.\debug
+InputPath=.\Strxmov.asm
+InputName=Strxmov
+
+"$(OutDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ ml /Cx /nologo /DDOS386 /DM_I386 /Zm /coff /c /Fo $(Outdir)\$(InputName).obj $(InputPath)
+
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\strxnmov.c
+# End Source File
+# End Target
+# End Project
diff --git a/VC++Files/strings/MASM6x/strings.dsw b/VC++Files/strings/MASM6x/strings.dsw
new file mode 100644
index 00000000000..e3777b8e7d5
--- /dev/null
+++ b/VC++Files/strings/MASM6x/strings.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "strings"=".\strings.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/VC++Files/strings/noMASM/strings.dsw b/VC++Files/strings/noMASM/strings.dsw
new file mode 100644
index 00000000000..e3777b8e7d5
--- /dev/null
+++ b/VC++Files/strings/noMASM/strings.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "strings"=".\strings.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/VC++Files/strings/strings.dsw b/VC++Files/strings/strings.dsw
new file mode 100644
index 00000000000..e3777b8e7d5
--- /dev/null
+++ b/VC++Files/strings/strings.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "strings"=".\strings.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/VC++Files/test1/test1.dsp b/VC++Files/test1/test1.dsp
index 50a165e3e4d..ffa5fd4d7ed 100644
--- a/VC++Files/test1/test1.dsp
+++ b/VC++Files/test1/test1.dsp
@@ -67,8 +67,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "../include" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/thr_insert_test/thr_insert_test.dsp b/VC++Files/thr_insert_test/thr_insert_test.dsp
index 770125ab65b..91274e6817a 100644
--- a/VC++Files/thr_insert_test/thr_insert_test.dsp
+++ b/VC++Files/thr_insert_test/thr_insert_test.dsp
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /GX- /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
@@ -70,7 +70,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX- /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
diff --git a/VC++Files/thr_test/thr_test.dsp b/VC++Files/thr_test/thr_test.dsp
index 7256f8da2fa..495d7280808 100644
--- a/VC++Files/thr_test/thr_test.dsp
+++ b/VC++Files/thr_test/thr_test.dsp
@@ -68,8 +68,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /Fr /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Zi /Od /I "../include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# ADD BASE RSC /l 0x40b /d "_DEBUG"
# ADD RSC /l 0x40b /d "_DEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/vio/vio.dsp b/VC++Files/vio/vio.dsp
index d4b77aad391..7c6ecb47e5d 100644
--- a/VC++Files/vio/vio.dsp
+++ b/VC++Files/vio/vio.dsp
@@ -64,7 +64,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /G6 /MTd /W3 /ZI /Od /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c
+# ADD CPP /nologo /G6 /MTd /W3 /Zi /Od /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/winmysqladmin/db.cpp b/VC++Files/winmysqladmin/db.cpp
new file mode 100644
index 00000000000..6e796856a7e
--- /dev/null
+++ b/VC++Files/winmysqladmin/db.cpp
@@ -0,0 +1,80 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "db.h"
+#include "main.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+Tdbfrm *dbfrm;
+//---------------------------------------------------------------------------
+__fastcall Tdbfrm::Tdbfrm(TComponent* Owner)
+ : TForm(Owner)
+{
+}
+//---------------------------------------------------------------------------
+void __fastcall Tdbfrm::SpeedButton2Click(TObject *Sender)
+{
+ Close();
+}
+//---------------------------------------------------------------------------
+void __fastcall Tdbfrm::SpeedButton1Click(TObject *Sender)
+{
+ if (VerDBName())
+ {
+ if (!Form1->CreatingDB())
+ {
+ Form1->OutRefresh();
+ Edit1->Text = "";
+ Application->MessageBox("The database was created", "WinMySQLadmin 1.0", MB_OK |MB_ICONINFORMATION);
+ }
+ }
+
+
+
+
+
+}
+//---------------------------------------------------------------------------
+bool __fastcall Tdbfrm::VerDBName()
+{
+ String temp = Edit1->Text;
+ if (Edit1->Text.IsEmpty())
+ {
+ Application->MessageBox("The name of the Database is Empty", "WinMySQLadmin 1.0", MB_OK |MB_ICONINFORMATION);
+ return false;
+ }
+
+ if (temp.Length() > 64)
+ {
+ Application->MessageBox("The name of the Database can't have more than 64 characters ", "WinMySQLadmin 1.0", MB_OK |MB_ICONINFORMATION);
+ return false;
+ }
+
+ for (int j = 1; j <= temp.Length(); j++)
+ {
+ if (temp[j] == ' ')
+ {
+ Application->MessageBox("The name of the Database can't have blank spaces ", "WinMySQLadmin 1.0", MB_OK |MB_ICONINFORMATION);
+ return false;
+ }
+ else if (temp[j] == '/')
+ {
+ Application->MessageBox("The name of the Database can't have frontslash (/)", "WinMySQLadmin 1.0", MB_OK |MB_ICONINFORMATION);
+ return false;
+ }
+ else if (temp[j] == '\\')
+ {
+ Application->MessageBox("The name of the Database can't have backslash (\\)", "WinMySQLadmin 1.0", MB_OK |MB_ICONINFORMATION);
+ return false;
+ }
+ else if (temp[j] == '.')
+ {
+ Application->MessageBox("The name of the Database can't have periods", "WinMySQLadmin 1.0", MB_OK |MB_ICONINFORMATION);
+ return false;
+ }
+ }
+ return true;
+}
+//---------------------------------------------------------------------------
diff --git a/VC++Files/winmysqladmin/db.h b/VC++Files/winmysqladmin/db.h
new file mode 100644
index 00000000000..f7ab87351ea
--- /dev/null
+++ b/VC++Files/winmysqladmin/db.h
@@ -0,0 +1,32 @@
+//---------------------------------------------------------------------------
+#ifndef dbH
+#define dbH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <ExtCtrls.hpp>
+#include <Graphics.hpp>
+#include <Buttons.hpp>
+//---------------------------------------------------------------------------
+class Tdbfrm : public TForm
+{
+__published: // IDE-managed Components
+ TImage *Image1;
+ TLabel *Label1;
+ TLabel *Label2;
+ TEdit *Edit1;
+ TSpeedButton *SpeedButton1;
+ TSpeedButton *SpeedButton2;
+ void __fastcall SpeedButton2Click(TObject *Sender);
+ void __fastcall SpeedButton1Click(TObject *Sender);
+private: // User declarations
+ bool __fastcall VerDBName();
+public: // User declarations
+ __fastcall Tdbfrm(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern PACKAGE Tdbfrm *dbfrm;
+//---------------------------------------------------------------------------
+#endif
diff --git a/VC++Files/winmysqladmin/images/Goahead.ico b/VC++Files/winmysqladmin/images/Goahead.ico
new file mode 100644
index 00000000000..8241c90e2a2
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/Goahead.ico
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/HELP.ICO b/VC++Files/winmysqladmin/images/HELP.ICO
new file mode 100644
index 00000000000..d0cd6d68cce
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/HELP.ICO
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/INFO.ICO b/VC++Files/winmysqladmin/images/INFO.ICO
new file mode 100644
index 00000000000..e3afa8cf52c
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/INFO.ICO
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/Info.bmp b/VC++Files/winmysqladmin/images/Info.bmp
new file mode 100644
index 00000000000..58f729fb1fd
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/Info.bmp
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/MYINI.ICO b/VC++Files/winmysqladmin/images/MYINI.ICO
new file mode 100644
index 00000000000..428ed8e92b0
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/MYINI.ICO
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/Myini.bmp b/VC++Files/winmysqladmin/images/Myini.bmp
new file mode 100644
index 00000000000..e743a1b9b32
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/Myini.bmp
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/Noentry.ico b/VC++Files/winmysqladmin/images/Noentry.ico
new file mode 100644
index 00000000000..27f2211f56c
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/Noentry.ico
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/SETUP.BMP b/VC++Files/winmysqladmin/images/SETUP.BMP
new file mode 100644
index 00000000000..c5794e5ac00
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/SETUP.BMP
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/Setup 16.bmp b/VC++Files/winmysqladmin/images/Setup 16.bmp
new file mode 100644
index 00000000000..e17b06155fb
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/Setup 16.bmp
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/Table.ico b/VC++Files/winmysqladmin/images/Table.ico
new file mode 100644
index 00000000000..4469a915b7f
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/Table.ico
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/Working.ico b/VC++Files/winmysqladmin/images/Working.ico
new file mode 100644
index 00000000000..72faedbbfc5
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/Working.ico
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/database.ico b/VC++Files/winmysqladmin/images/database.ico
new file mode 100644
index 00000000000..9689aa88361
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/database.ico
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/find.ico b/VC++Files/winmysqladmin/images/find.ico
new file mode 100644
index 00000000000..2e0f96c52f9
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/find.ico
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/green.ico b/VC++Files/winmysqladmin/images/green.ico
new file mode 100644
index 00000000000..ef53cd87994
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/green.ico
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/help.bmp b/VC++Files/winmysqladmin/images/help.bmp
new file mode 100644
index 00000000000..76c6a90d2d8
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/help.bmp
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/initsetup.cpp b/VC++Files/winmysqladmin/images/initsetup.cpp
new file mode 100644
index 00000000000..d0dd15b059c
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/initsetup.cpp
@@ -0,0 +1,42 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "initsetup.h"
+#include "main.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TForm2 *Form2;
+//---------------------------------------------------------------------------
+__fastcall TForm2::TForm2(TComponent* Owner)
+ : TForm(Owner)
+{
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm2::BitBtn1Click(TObject *Sender)
+{
+if ((Edit1->Text).IsEmpty() || (Edit2->Text).IsEmpty())
+ Application->MessageBox("Fill the User name and Password text boxs ", "Winmysqladmin 1.0", MB_OK |MB_ICONINFORMATION);
+ else
+ {
+ if(Form1->ForceConnection())
+ if(Form1->ForceMySQLInit())
+ {
+ Form1->CreateMyIniFile();
+ Form1->CreatingShortCut();
+ }
+ Close();
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm2::BitBtn2Click(TObject *Sender)
+{
+ Close();
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm2::SpeedButton1Click(TObject *Sender)
+{
+ Application->HelpCommand(HELP_FINDER,0);
+}
+//---------------------------------------------------------------------------
diff --git a/VC++Files/winmysqladmin/images/killdb.ico b/VC++Files/winmysqladmin/images/killdb.ico
new file mode 100644
index 00000000000..9689aa88361
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/killdb.ico
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/logo.ico b/VC++Files/winmysqladmin/images/logo.ico
new file mode 100644
index 00000000000..9409cad72b6
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/logo.ico
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/multitrg.ico b/VC++Files/winmysqladmin/images/multitrg.ico
new file mode 100644
index 00000000000..76ffbe29c77
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/multitrg.ico
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/mysql-07.bmp b/VC++Files/winmysqladmin/images/mysql-07.bmp
new file mode 100644
index 00000000000..dcae23b8813
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/mysql-07.bmp
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/mysql-17.bmp b/VC++Files/winmysqladmin/images/mysql-17.bmp
new file mode 100644
index 00000000000..0291c804006
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/mysql-17.bmp
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/mysql.BMP b/VC++Files/winmysqladmin/images/mysql.BMP
new file mode 100644
index 00000000000..ed5c7f9051f
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/mysql.BMP
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/red.ico b/VC++Files/winmysqladmin/images/red.ico
new file mode 100644
index 00000000000..b28288d576e
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/red.ico
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/red22.BMP b/VC++Files/winmysqladmin/images/red22.BMP
new file mode 100644
index 00000000000..a35052afa01
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/red22.BMP
Binary files differ
diff --git a/VC++Files/winmysqladmin/images/see.bmp b/VC++Files/winmysqladmin/images/see.bmp
new file mode 100644
index 00000000000..72fb2c50ec6
--- /dev/null
+++ b/VC++Files/winmysqladmin/images/see.bmp
Binary files differ
diff --git a/VC++Files/winmysqladmin/initsetup.cpp b/VC++Files/winmysqladmin/initsetup.cpp
new file mode 100644
index 00000000000..0a25b8cb79c
--- /dev/null
+++ b/VC++Files/winmysqladmin/initsetup.cpp
@@ -0,0 +1,40 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "initsetup.h"
+#include "main.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TForm2 *Form2;
+//---------------------------------------------------------------------------
+__fastcall TForm2::TForm2(TComponent* Owner)
+ : TForm(Owner)
+{
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm2::BitBtn1Click(TObject *Sender)
+{
+ if ((Edit1->Text).IsEmpty() || (Edit2->Text).IsEmpty())
+ Application->MessageBox("Fill the User name and Password text boxs ", "Winmysqladmin 1.0", MB_OK |MB_ICONINFORMATION);
+ else
+ {
+ Form1->GetServerFile();
+ Form1->CreateMyIniFile();
+ Form1->CreatingShortCut();
+
+ Close();
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm2::BitBtn2Click(TObject *Sender)
+{
+ Close();
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm2::SpeedButton1Click(TObject *Sender)
+{
+ Application->HelpCommand(HELP_FINDER,0);
+}
+//---------------------------------------------------------------------------
diff --git a/VC++Files/winmysqladmin/initsetup.h b/VC++Files/winmysqladmin/initsetup.h
new file mode 100644
index 00000000000..28f575198e3
--- /dev/null
+++ b/VC++Files/winmysqladmin/initsetup.h
@@ -0,0 +1,38 @@
+//---------------------------------------------------------------------------
+#ifndef initsetupH
+#define initsetupH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <Buttons.hpp>
+#include <ExtCtrls.hpp>
+#include <Graphics.hpp>
+//---------------------------------------------------------------------------
+class TForm2 : public TForm
+{
+__published: // IDE-managed Components
+ TImage *Image1;
+ TLabel *Label1;
+ TLabel *Label4;
+ TPanel *Panel1;
+ TLabel *Label5;
+ TLabel *Label6;
+ TLabel *Label2;
+ TEdit *Edit1;
+ TEdit *Edit2;
+ TBitBtn *BitBtn1;
+ TSpeedButton *SpeedButton1;
+ TBitBtn *BitBtn2;
+ void __fastcall BitBtn1Click(TObject *Sender);
+ void __fastcall BitBtn2Click(TObject *Sender);
+ void __fastcall SpeedButton1Click(TObject *Sender);
+private: // User declarations
+public: // User declarations
+ __fastcall TForm2(TComponent* Owner);
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TForm2 *Form2;
+//---------------------------------------------------------------------------
+#endif
diff --git a/VC++Files/winmysqladmin/main.cpp b/VC++Files/winmysqladmin/main.cpp
new file mode 100644
index 00000000000..6ca29659255
--- /dev/null
+++ b/VC++Files/winmysqladmin/main.cpp
@@ -0,0 +1,2529 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+
+#include "main.h"
+#include "initsetup.h"
+#include "db.h"
+
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+#include <shellapi.h>
+#include <registry.hpp>
+#include <winsvc.h>
+#include <winsock.h>
+#include <shlobj.h>
+#include <IniFiles.hpp>
+#include <dir.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <deque.h>
+#include <vector.h>
+#include <fstream.h>
+#include <iostream.h>
+#include <iterator.h>
+#include <sstream.h>
+#include "mysql.h"
+#include <Printers.hpp>
+
+TForm1 *Form1;
+bool i_start, NT;
+bool IsForce = false;
+bool IsVariables = false;
+bool IsProcess = false ;
+bool IsDatabases = false;
+bool new_line = 0;
+bool ya = true;
+bool yy = true;
+bool rinit = false;
+AnsiString vpath;
+AnsiString vip;
+MYSQL_RES *res_1;
+static unsigned long q = 0;
+bool preport = false;
+bool treport = false;
+bool ereport = false;
+AnsiString mainroot;
+bool IsMySQLNode = false;
+MYSQL *MySQL;
+//---------------------------------------------------------------------------
+__fastcall TForm1::TForm1(TComponent* Owner)
+ : TForm(Owner)
+{
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::FormCreate(TObject *Sender)
+{
+ i_start = true;
+ IsConnect = false;
+ if (ParamCount() > 0){
+ if (ParamStr(1) == "-h" || ParamStr(1) == "h" ) {
+ ShowHelp(); Application->Terminate(); }
+ else if (ParamStr(1) == "-w" || ParamStr(1) == "w") {
+ i_start = false; ContinueLoad(); }
+ }
+ else {
+ ContinueLoad(); Hide(); GetServerOptions(); }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::DrawItem(TMessage& Msg)
+{
+ IconDrawItem((LPDRAWITEMSTRUCT)Msg.LParam);
+ TForm::Dispatch(&Msg);
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::MyNotify(TMessage& Msg)
+{
+ POINT MousePos;
+
+ switch(Msg.LParam) {
+ case WM_RBUTTONUP:
+ if (GetCursorPos(&MousePos)){
+ PopupMenu1->PopupComponent = Form1; SetForegroundWindow(Handle);
+ PopupMenu1->Popup(MousePos.x, MousePos.y);}
+ else Show();
+ break;
+ case WM_LBUTTONUP:
+ if (GetCursorPos(&MousePos)){
+ PopupMenu1->PopupComponent = Form1; SetForegroundWindow(Handle);
+ PopupMenu1->Popup(MousePos.x, MousePos.y); }
+
+ ToggleState();
+ break;
+ default:
+ break; }
+
+ TForm::Dispatch(&Msg);
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::TrayMessage(DWORD dwMessage)
+{
+ NOTIFYICONDATA tnd;
+ PSTR pszTip;
+
+ pszTip = TipText();
+
+ tnd.cbSize = sizeof(NOTIFYICONDATA);
+ tnd.hWnd = Handle;
+ tnd.uID = IDC_MYICON;
+ tnd.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
+ tnd.uCallbackMessage = MYWM_NOTIFY;
+
+ if (dwMessage == NIM_MODIFY){
+ tnd.hIcon = IconHandle();
+ if (pszTip)lstrcpyn(tnd.szTip, pszTip, sizeof(tnd.szTip));
+ else tnd.szTip[0] = '\0'; }
+ else { tnd.hIcon = NULL; tnd.szTip[0] = '\0'; }
+
+ return (Shell_NotifyIcon(dwMessage, &tnd));
+}
+//---------------------------------------------------------------------------
+HANDLE __fastcall TForm1::IconHandle(void)
+{
+
+ if (!NT){
+ if (MySQLSignal()){Image3->Visible = false; Image2->Visible = true;
+ return (Image2->Picture->Icon->Handle); }
+ else {Image2->Visible = false; Image3->Visible = true;
+ return (Image3->Picture->Icon->Handle); }
+ }
+ else {
+ if (TheServiceStatus()){Image3->Visible = false; Image2->Visible = true;
+ return (Image2->Picture->Icon->Handle); }
+
+ else if (MySQLSignal()){Image3->Visible = false; Image2->Visible = true;
+ return (Image2->Picture->Icon->Handle); }
+ else {Image2->Visible = false; Image3->Visible = true;
+ return (Image3->Picture->Icon->Handle); }
+ }
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::ToggleState(void)
+{
+
+ TrayMessage(NIM_MODIFY);
+ if (!NT){
+ if (MySQLSignal()){SSW9->Caption = "ShutDown the Server";
+ Image3->Visible = false; Image2->Visible = true; }
+ else {SSW9->Caption = "Start the Server";
+ Image2->Visible = false; Image3->Visible = true; }
+ }
+ else {
+ if (TheServiceStart()) {
+ Standa->Enabled = false;
+ if (TheServiceStatus()) {RService->Enabled = false;
+ StopS->Enabled = true;
+ StopS->Caption = "Stop the Service";
+ Image3->Visible = false;
+ Image2->Visible = true; }
+ else {RService->Enabled = true;
+ StopS->Enabled = true;
+ RService->Caption = "Remove the Service";
+ StopS->Caption = "Start the Service";
+ Image2->Visible = false;
+ Image3->Visible = true; }
+ }
+ else {
+ Standa->Enabled = true;
+ StopS->Enabled = false;
+ if (MySQLSignal()) {
+ RService->Enabled = false;
+ Standa->Caption = "ShutDown the Server Standalone";
+ Image3->Visible = false;
+ Image2->Visible = true; }
+
+ else {
+ RService->Enabled = true;
+ RService->Caption = "Install the Service";
+ Standa->Caption = "Start the Server Standalone";
+ Image2->Visible = false;
+ Image3->Visible = true; }
+
+ }
+
+
+ }
+
+}
+//---------------------------------------------------------------------------
+PSTR __fastcall TForm1::TipText(void)
+{
+ char* status = StatusLine->SimpleText.c_str();
+ return status;
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::WMQueryEndSession(TWMQueryEndSession &msg)
+{
+
+
+ if (!NT) {
+
+ if (MySQLSignal()){
+ StatusLine->SimpleText = "Shutdown in progress.....";
+ Show(); Shutd(); msg.Result = 1; }
+ else {
+ StatusLine->SimpleText = "The Server already is down......";
+ Show(); msg.Result = 1; Close(); }
+ }
+ else {
+
+ Show();
+ if (!TheServiceStart()) { if (MySQLSignal()) Shutd(); }
+ msg.Result = 1;
+ }
+
+}
+
+//---------------------------------------------------------------------------
+LRESULT IconDrawItem(LPDRAWITEMSTRUCT lpdi)
+{
+ HICON hIcon;
+
+ hIcon = (HICON)LoadImage(g_hinst, MAKEINTRESOURCE(lpdi->CtlID), IMAGE_ICON,
+ 16, 16, 0);
+ if (!hIcon)
+ return(false);
+
+ DrawIconEx(lpdi->hDC, lpdi->rcItem.left, lpdi->rcItem.top, hIcon,
+ 16, 16, 0, NULL, DI_NORMAL);
+
+ return(true);
+}
+//---------------------------------------------------------------------------
+AnsiString __fastcall TForm1::TheComputer()
+{
+ AnsiString theword;
+ DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1;
+ char szBuf[MAX_COMPUTERNAME_LENGTH + 1];
+ szBuf[0] = '\0';
+
+ GetComputerName(szBuf, &dwSize);
+ theword = (AnsiString) szBuf;
+ delete [] szBuf;
+ return theword;
+
+}
+//---------------------------------------------------------------------------
+AnsiString __fastcall TForm1::TheOS()
+{
+ AnsiString theword;
+ OSVERSIONINFO info;
+ info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&info);
+
+ switch (info.dwPlatformId)
+ {
+ case VER_PLATFORM_WIN32s:
+ NT = false;
+ theword = "Win32s detected";
+ break;
+ case VER_PLATFORM_WIN32_WINDOWS:
+ NT = false;
+ theword = "Win 95 or Win 98 detected";
+ break;
+ case VER_PLATFORM_WIN32_NT:
+ NT = true;
+ theword = "Windows NT detected";
+ break;
+ }
+ return theword;
+}
+///---------------------------------------------------------------------------
+AnsiString __fastcall TForm1::TheUser()
+{
+ AnsiString theword;
+ DWORD dwSize = 0;
+
+ GetUserName(NULL, &dwSize);
+
+ char *szBuf = new char[dwSize];
+ szBuf[0] = '\0';
+
+ GetUserName(szBuf, &dwSize);
+ theword = (AnsiString) szBuf;
+ delete [] szBuf;
+ return theword;
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::TakeIP(void)
+{
+ WORD wVersionRequested;
+ WSADATA WSAData;
+ wVersionRequested = MAKEWORD(1,1);
+ WSAStartup(wVersionRequested,&WSAData);
+
+ hostent *P;
+ char s[128];
+ in_addr in;
+ char *P2;
+ gethostname(s, 128);
+ P = gethostbyname(s);
+
+ Memo2->Lines->Clear();
+ Memo2->Lines->Add((AnsiString)P->h_name);
+ mainroot = P->h_name;
+ in.S_un.S_un_b.s_b1 = P->h_addr_list[0][0];
+ in.S_un.S_un_b.s_b2 = P->h_addr_list[0][1];
+ in.S_un.S_un_b.s_b3 = P->h_addr_list[0][2];
+ in.S_un.S_un_b.s_b4 = P->h_addr_list[0][3];
+ P2 = inet_ntoa(in);
+ vip = P2;
+ mainroot += " ( " + (AnsiString)P2 + " )";
+ Memo2->Lines->Add(P2);
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::GetmemStatus(void)
+{
+ MEMORYSTATUS ms;
+ ms.dwLength = sizeof(MEMORYSTATUS);
+ GlobalMemoryStatus(&ms);
+
+ Edit2->Text = AnsiString((double)ms.dwTotalPhys / 1024000.0) + " MB RAM";
+}
+
+//---------------------------------------------------------------------------
+void __fastcall TForm1::ShowHelp(void)
+{
+ Application->MessageBox("Usage: WinMySQLadmin.EXE [OPTIONS]\n\n-w Run the tool without start the Server.\n-h Shows this message and exit ", "WinMySQLadmin 1.0", MB_OK |MB_ICONINFORMATION);
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::ContinueLoad(void)
+{
+ OS->Text = TheOS();
+ Localhost->Text = TheComputer();
+ Localuser->Text = TheUser();
+ GetmemStatus();
+ ClearBox();
+ TakeIP();
+ MyODBC();
+
+
+ IsMyIniUp();
+
+ if (!NT) { WinNT->Enabled = false; NtVer->Enabled = false; Win9->Enabled = true; }
+ else { WinNT->Enabled = true; Win9->Enabled = false; }
+
+ if (i_start)
+ {
+ // NT never is started from the prompt
+ if ((!NT) && (!MySQLSignal())) mysqldstart();
+ {
+ TrayMessage(NIM_MODIFY);
+ SeekErrFile();
+ }
+ }
+ Hide();
+
+}
+
+//---------------------------------------------------------------------------
+void __fastcall TForm1::MyODBC(void)
+{
+
+ TRegistry *Registry = new TRegistry();
+ Memo3->Lines->Clear();
+
+ try
+ {
+ Registry->RootKey = HKEY_LOCAL_MACHINE;
+ // the basic data of myodbc
+ if (Registry->OpenKey("Software\\ODBC\\ODBCINST.INI\\MySQL", false))
+ {
+ Memo3->Lines->Add("Driver Version\t" + Registry->ReadString("DriverODBCVer"));
+ Memo3->Lines->Add("Driver\t\t" + Registry->ReadString("Driver"));
+ Memo3->Lines->Add("API Level\t\t" + Registry->ReadString("APILevel"));
+ Memo3->Lines->Add("Setup\t\t" + Registry->ReadString("Setup"));
+ Memo3->Lines->Add("SQL Level\t" + Registry->ReadString("SQLLevel"));
+ }
+ else
+ Memo3->Lines->Add("Not Found");
+
+ }
+ catch (...)
+ {
+ delete Registry;
+ }
+ Memo3->Enabled = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::IsMyIniUp(void)
+{
+ // we see if the my.ini is Up
+ AnsiString asFileName = FileSearch("my.ini", TheWinDir());
+ if (asFileName.IsEmpty())
+ {
+ IsForce = true;
+ i_start = false;
+ QuickSearch();
+ }
+ else
+ {
+ Memo1->Enabled = true;
+ Memo1->Lines->Clear();
+ FillMyIni();
+ GetBaseDir();
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::QuickSearch(void)
+{
+ AnsiString asFileName = FileSearch("mysql.exe", "c:/mysql/bin");
+ if (!asFileName.IsEmpty())
+ BaseDir->Text = "c:/mysql";
+}
+//---------------------------------------------------------------------------
+AnsiString __fastcall TForm1::TheWinDir()
+{
+ AnsiString WinDir;
+ UINT BufferSize = GetWindowsDirectory(NULL,0);
+ WinDir.SetLength(BufferSize+1);
+ GetWindowsDirectory(WinDir.c_str(),BufferSize);
+ char* dirw = WinDir.c_str();
+ return dirw ;
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::FillMyIni(void)
+{
+ Memo1->Lines->LoadFromFile(TheWinDir() + "\\my.ini");
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::GetBaseDir(void)
+{
+
+ char drive[_MAX_DRIVE];
+ char dir[_MAX_DIR];
+ char file[_MAX_FNAME];
+ char ext[_MAX_EXT];
+
+
+ TIniFile *pIniFile = new
+ TIniFile(TheWinDir() + "\\my.ini");
+
+ BaseDir->Text = pIniFile->ReadString("mysqld","basedir","") ;
+ AnsiString lx = pIniFile->ReadString("WinMySQLadmin","Server","") ;
+ _splitpath((lx).c_str(),drive,dir,file,ext);
+ AnsiString lw = (AnsiString) file + ext;
+
+ if ( lw == "mysqld-shareware.exe") {ShareVer->Checked = true;}
+ if ( lw == "mysqld.exe") {MysqldVer->Checked = true;}
+ if ( lw == "mysqld-opt.exe") {OptVer->Checked = true;}
+ if ( lw == "mysqld-nt.exe") {NtVer->Checked = true;}
+
+ delete pIniFile;
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::Showme1Click(TObject *Sender)
+{
+ if(Showme1->Caption == "Show me") { TrayMessage(NIM_DELETE);
+ Showme1->Caption = "Hide me"; Show(); }
+ else { TrayMessage(NIM_ADD); TrayMessage(NIM_MODIFY);
+ Showme1->Caption = "Show me"; Hide(); }
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::MySQLSignal()
+{
+ HANDLE hEventShutdown;
+ hEventShutdown=OpenEvent(EVENT_MODIFY_STATE, 0, "MySqlShutdown");
+
+ if(hEventShutdown)
+ {
+ CloseHandle(hEventShutdown);
+ return true;
+ }
+ else
+ {
+ CloseHandle(hEventShutdown);
+ return false;
+ }
+
+}
+
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::mysqldstart()
+{
+ memset(&pi, 0, sizeof(pi));
+ memset(&si, 0, sizeof(si));
+ si.cb = sizeof(si);
+ si.dwFlags |= STARTF_USESHOWWINDOW;
+ si.wShowWindow |= SW_SHOWNORMAL;
+
+
+ TIniFile *pIniFile = new
+ TIniFile(TheWinDir() + "\\my.ini");
+
+ if (NT)
+ vpath = pIniFile->ReadString("WinMySQLadmin","Server","") + " --standalone\0" ;
+ else
+ vpath = pIniFile->ReadString("WinMySQLadmin","Server","") + "\0" ;
+
+ if ( ! CreateProcess(0,vpath.c_str(), 0, 0, 0, 0, 0, 0, &si,&pi))
+ {
+ TrayMessage(NIM_MODIFY);
+ return false;
+ }
+ else
+ {
+ TrayMessage(NIM_MODIFY);
+ return true;
+
+ }
+
+}
+
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::SeekErrFile()
+{
+ Memo4->Enabled = true;
+ Memo4->Lines->Clear();
+ AnsiString asFileName = FileSearch("mysql.err", BaseDir->Text + "/data");
+ if (!asFileName.IsEmpty())
+ {
+ FName = BaseDir->Text + "/data/mysql.err";
+ ifstream in((FName).c_str());
+ in.seekg(0, ios::end);
+ string s, line;
+ deque<string> v;
+ deque<string> lines;
+ streampos sp = in.tellg();
+ if (sp <= 1000)
+ in.seekg(0, ios::beg);
+ else
+ {
+ in.seekg(0, ios::beg);
+ in.seekg((sp - 1000));
+ }
+
+ do {
+ lines.push_back(line);
+ }while (getline(in, line));
+
+
+ if( lines.size() <= 15)
+ {
+ deque<string>::reverse_iterator r;
+ for(r = lines.rbegin(); r != lines.rend() ; r++)
+ {
+ if (ereport)
+ Memo5->Lines->Add((*r).c_str());
+ Memo4->Lines->Add((*r).c_str());
+
+ }
+ }
+ else
+ {
+ int k = 0;
+ deque<string>::reverse_iterator r;
+ for(r = lines.rbegin(); r != lines.rend(); r++)
+ {
+ if (ereport)
+ Memo5->Lines->Add((*r).c_str());
+ Memo4->Lines->Add((*r).c_str());
+ if (++k >= 15) { break;}
+ }
+ }
+ in.close();
+ return true;
+ }
+ else
+ return false;
+
+}
+
+//---------------------------------------------------------------------------
+void __fastcall TForm1::Timer1Timer(TObject *Sender)
+{
+ Showme1->Caption = "Show me";
+ TrayMessage(NIM_ADD);
+ TrayMessage(NIM_MODIFY);
+ Hide();
+ if (IsForce) {Form2->Show();}
+ Timer1->Enabled = false;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::GetServerFile()
+{
+
+ AnsiString FileName;
+
+ if(!NT) {
+ FileName = FileSearch("mysqld-opt.exe", ExtractFilePath(Application->ExeName));
+ if (FileName.IsEmpty()) FileName = FileSearch("mysqld.exe", ExtractFilePath(Application->ExeName));
+ if (FileName.IsEmpty()) FileName = FileSearch("mysqld-shareware.exe", ExtractFilePath(Application->ExeName));
+
+ if (!FileName.IsEmpty()){
+ if ( FileName == "mysqld-opt.exe") {OptVer->Checked = true;}
+ if ( FileName == "mysqld.exe") {MysqldVer->Checked= true;}
+ if ( FileName == "mysqld-shareware.exe") {ShareVer->Checked= true;} }
+
+ }
+ else {
+
+ FileName = FileSearch("mysqld-nt.exe", ExtractFilePath(Application->ExeName));
+ if (FileName.IsEmpty()) FileName = FileSearch("mysqld.exe", ExtractFilePath(Application->ExeName));
+ if (FileName.IsEmpty()) FileName = FileSearch("mysqld-shareware.exe", ExtractFilePath(Application->ExeName));
+
+ if (!FileName.IsEmpty()) {
+ if ( FileName == "mysqld-nt.exe") {NtVer->Checked = true;}
+ if ( FileName == "mysqld.exe") {MysqldVer->Checked= true;}
+ if ( FileName == "mysqld-shareware.exe") {ShareVer->Checked= true;} }
+
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::CreateMyIniFile(void)
+{
+ char szFileName[6];
+ int iFileHandle;
+ AnsiString jk;
+
+ Memo1->Enabled = true;
+ Memo1->Lines->Clear();
+ strcpy(szFileName,"\\my.ini");
+ iFileHandle = FileCreate(TheWinDir() + szFileName );
+
+ jk = "#This File was made using the WinMySQLadmin 1.0 Tool\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#" + Now() + "\n\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#Uncomment or Add only the keys that you know how works.\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#Read the MySQL Manual for instructions\n\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+
+ jk = "[mysqld]\n\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "basedir=" + TheDir() + "\n";
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#bind-address=" + vip + "\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#datadir=" + TheDir() + "/data\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#language=" + TheDir() + "/share/your language directory\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#delay-key-write-for-all-tables\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#log-long-format\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#slow query log=#\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#tmpdir=#\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#ansi\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#new\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#port=3306\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#safe\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#skip-name-resolve\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#skip-networking\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#skip-new\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#skip-host-cache\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#set-variable = key_buffer=16M\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#set-variable = max_allowed_packet=1M\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#set-variable = thread_stack=128K\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#set-variable = flush_time=1800\n\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "[mysqldump]\n\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#quick\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#set-variable = max_allowed_packet=16M\n\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "[mysql]\n\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#no-auto-rehash\n\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "[isamchk]\n\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "#set-variable= key=16M\n\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "[WinMySQLadmin]\n\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+
+ if (ShareVer->Checked) { jk = "Server=" + TheDir() + "/bin/mysqld-shareware.exe\n\n";}
+ if (MysqldVer->Checked) {jk = "Server=" + TheDir() + "/bin/mysqld.exe\n\n";}
+ if (OptVer->Checked) {jk = "Server=" + TheDir() + "/bin/mysqld-opt.exe\n\n";}
+ if (NtVer->Checked) {jk = "Server=" + TheDir() + "/bin/mysqld-nt.exe\n\n";}
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "user=" + Form2->Edit1->Text + "\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ jk = "password=" + Form2->Edit2->Text + "\n" ;
+ FileWrite(iFileHandle, (jk).c_str(), (jk).Length());
+
+ FileClose(iFileHandle);
+ FillMyIni();
+
+}
+
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::CreatingShortCut()
+{
+ // Where is The Start Menu in this Machine ?
+ LPITEMIDLIST pidl;
+ LPMALLOC pShellMalloc;
+ char szDir[MAX_PATH + 16];
+ AnsiString file;
+ AnsiString jk = "\\WinMySQLadmin.lnk" ;
+
+ if(SUCCEEDED(SHGetMalloc(&pShellMalloc)))
+ {
+ if(SUCCEEDED(SHGetSpecialFolderLocation(NULL,
+ CSIDL_STARTUP, &pidl)))
+ {
+ if(!SHGetPathFromIDList(pidl, szDir))
+ {
+ pShellMalloc->Release();
+ pShellMalloc->Free(pidl);
+ return false;
+ }
+
+ pShellMalloc->Free(pidl);
+ }
+
+ pShellMalloc->Release();
+ StrCat(szDir, jk.c_str());
+ }
+
+ // the create
+
+ IShellLink* pLink;
+ IPersistFile* pPersistFile;
+
+ if(SUCCEEDED(CoInitialize(NULL)))
+ {
+ if(SUCCEEDED(CoCreateInstance(CLSID_ShellLink, NULL,
+ CLSCTX_INPROC_SERVER,
+ IID_IShellLink, (void **) &pLink)))
+ {
+
+ pLink->SetPath((ExtractFilePath(Application->ExeName) + "WinMySQLadmin.exe").c_str());
+ pLink->SetDescription("WinMySQLadmin Tool");
+ pLink->SetShowCmd(SW_SHOW);
+
+ if(SUCCEEDED(pLink->QueryInterface(IID_IPersistFile,
+ (void **)&pPersistFile)))
+ {
+
+ WideString strShortCutLocation(szDir);
+ pPersistFile->Save(strShortCutLocation.c_bstr(), TRUE);
+ pPersistFile->Release();
+ }
+ pLink->Release();
+ }
+
+ CoUninitialize();
+ }
+
+
+ return true;
+}
+
+//---------------------------------------------------------------------------
+AnsiString __fastcall TForm1::TheDir()
+{
+ AnsiString buffer;
+ char s[_MAX_PATH + 1];
+
+ StrCopy(s, ( BaseDir->Text).c_str()) ;
+
+ for (int i = 0; s[i] != NULL; i++)
+ if (s[i] != '\\')
+ buffer += s[i];
+ else
+ buffer += "/";
+
+ return buffer;
+
+}
+
+//---------------------------------------------------------------------------
+void __fastcall TForm1::SpeedButton1Click(TObject *Sender)
+{
+ Application->HelpCommand(HELP_FINDER,0);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::Timer2Timer(TObject *Sender)
+{
+ ToggleState();
+
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::TheServiceStart()
+{
+ bool thatok;
+ char *SERVICE_NAME = "MySql";
+ SC_HANDLE myService, scm;
+ scm = OpenSCManager(0, 0, SC_MANAGER_ALL_ACCESS | GENERIC_WRITE);
+ if (scm)
+ {
+ myService = OpenService(scm, SERVICE_NAME, SERVICE_ALL_ACCESS);
+ if (myService)
+ thatok = true;
+ else
+ thatok = false;
+ }
+ CloseServiceHandle(myService);
+ CloseServiceHandle(scm);
+ return thatok;
+}
+
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::TheServicePause()
+{
+
+ bool thatok;
+ char *SERVICE_NAME = "MySql";
+ SC_HANDLE myService, scm;
+ scm = OpenSCManager(0, 0, SC_MANAGER_ALL_ACCESS);
+
+ if (scm)
+ {
+ myService = OpenService(scm, SERVICE_NAME, SERVICE_ALL_ACCESS);
+ if (myService)
+ {
+ // stop the service
+ if (IsConnect)
+ {
+ mysql_kill(MySQL,mysql_thread_id(MySQL));
+ StatusLine->SimpleText = "";
+ q = 0;
+ }
+
+
+ SERVICE_STATUS ss;
+ thatok = ControlService(myService,
+ SERVICE_CONTROL_STOP,
+ &ss);
+
+ }
+ else
+ thatok = false;
+ }
+ else
+ thatok = false;
+
+ CloseServiceHandle(myService);
+ CloseServiceHandle(scm);
+ return thatok;
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::TheServiceResume()
+{
+
+ bool thatok;
+ char *SERVICE_NAME = "MySql";
+ SC_HANDLE myService, scm;
+ scm = OpenSCManager(0, 0, SC_MANAGER_ALL_ACCESS);
+
+ if (scm)
+ {
+ myService = OpenService(scm, SERVICE_NAME, SERVICE_ALL_ACCESS);
+ if (myService)
+ {
+ // start the service
+
+ thatok = StartService(myService, 0, NULL);
+ }
+ else
+ thatok = false;
+ }
+ else
+ thatok = false;
+
+ CloseServiceHandle(myService);
+ CloseServiceHandle(scm);
+ return thatok;
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::TheServiceStatus()
+{
+ bool thatok;
+ bool k;
+ char *SERVICE_NAME = "MySql";
+ SC_HANDLE myService, scm;
+ SERVICE_STATUS ss;
+ DWORD dwState = 0xFFFFFFFF;
+ scm = OpenSCManager(0, 0, SC_MANAGER_ALL_ACCESS);
+
+ if (scm)
+ {
+ myService = OpenService(scm, SERVICE_NAME, SERVICE_ALL_ACCESS);
+ if (myService)
+ {
+ memset(&ss, 0, sizeof(ss));
+ k = QueryServiceStatus(myService,&ss);
+ if (k)
+ {
+ dwState = ss.dwCurrentState;
+ if (dwState == SERVICE_RUNNING)
+ thatok = true;
+ }
+ else
+ thatok = false;
+ }
+ else
+ thatok = false;
+ }
+ else
+ thatok = false;
+
+ CloseServiceHandle(myService);
+ CloseServiceHandle(scm);
+ return thatok;
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::TheServiceCreate()
+
+{
+ bool thatok;
+ char *SERVICE_NAME = "MySql";
+ char *szFullPath = vpath.c_str();
+ SC_HANDLE myService, scm;
+ scm = OpenSCManager(0, 0, SC_MANAGER_ALL_ACCESS);
+
+ if (scm)
+ { myService = CreateService(
+ scm,
+ SERVICE_NAME,
+ SERVICE_NAME,
+ SERVICE_ALL_ACCESS,
+ SERVICE_WIN32_OWN_PROCESS,
+ SERVICE_AUTO_START ,
+ SERVICE_ERROR_NORMAL,
+ szFullPath,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+
+ if (myService)
+ thatok = true;
+ else
+ thatok = false;
+
+ }
+
+ CloseServiceHandle(myService);
+ CloseServiceHandle(scm);
+ return thatok;
+
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::Swin9Click(TObject *Sender)
+{
+ if(Application->MessageBox("Shutdown this tool", "WinMySQLadmin 1.0", MB_YESNOCANCEL | MB_ICONQUESTION ) == IDYES)
+ Close();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::SSW9Click(TObject *Sender)
+{
+ if (MySQLSignal())
+ {
+ if(Application->MessageBox("Shutdown the MySQL Server ", "WinMySQLadmin 1.0", MB_YESNOCANCEL | MB_ICONQUESTION ) == IDYES)
+ {
+
+ if (Shutd())
+ {
+ IsConnect = false;
+ IsVariables = false;
+ IsProcess = false;
+ IsDatabases = false;
+ ya = false;
+ ClearBox();
+ Sleep(500);
+ TrayMessage(NIM_MODIFY);
+
+ }
+ else
+ Application->MessageBox("Fails to Shutdown the Server", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+ }
+ }
+ else
+ {
+ if(Application->MessageBox("Start the MySQL Server ", "WinMySQLadmin 1.0", MB_YESNOCANCEL | MB_ICONQUESTION ) == IDYES)
+ {
+ if (mysqldstart())
+ {
+ TrayMessage(NIM_MODIFY);
+ ya = true;
+ }
+ else
+ Application->MessageBox("Fails to Start the Server", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::ShutDownBoth1Click(TObject *Sender)
+{
+ if (MySQLSignal())
+ {
+ if(Application->MessageBox("Shutdown the MySQL Server and this tool ", "WinMySQLadmin 1.0", MB_YESNOCANCEL | MB_ICONQUESTION ) == IDYES)
+ {
+
+ if (Shutd())
+ Close();
+ else
+ {
+ Application->MessageBox("Fails to Shutdown the Server", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+
+ }
+ }
+ }
+ else
+ if(Application->MessageBox("Shutdown this tool ", "WinMySQLadmin 1.0", MB_YESNOCANCEL | MB_ICONQUESTION ) == IDYES)
+ Close();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::ShutDownthisTool1Click(TObject *Sender)
+{
+ if(Application->MessageBox("Shutdown this tool ", "WinMySQLadmin 1.0", MB_YESNOCANCEL | MB_ICONQUESTION ) == IDYES)
+ Close();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::StopSClick(TObject *Sender)
+{
+ AnsiString theWarning;
+ theWarning = "Are you sure to stop the Service ?\n\nAll the connections will be loss !" ;
+ if (TheServiceStatus())
+ {
+ if(Application->MessageBox(theWarning.c_str(), "WinMySQLadmin 1.0", MB_YESNOCANCEL | MB_ICONQUESTION ) == IDYES)
+ {
+ if (TheServicePause())
+ {
+ TrayMessage(NIM_MODIFY);
+ IsConnect = false;
+ IsVariables = false;
+ IsProcess = false;
+ IsDatabases = false;
+ ya = false;
+ ClearBox();
+
+ }
+ else
+ Application->MessageBox("Fails to stop the Service", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+
+ }
+ }
+ else
+ {
+ if(Application->MessageBox("Start the Service Manager for the MySQL Server ", "WinMySQLadmin 1.0", MB_YESNOCANCEL | MB_ICONQUESTION ) == IDYES)
+ {
+ if (TheServiceResume())
+ {
+ ya = true;
+ TrayMessage(NIM_MODIFY);
+ }
+ else
+ Application->MessageBox("Fails to start the Service", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::RServiceClick(TObject *Sender)
+{
+ if (TheServiceStart())
+ {
+ if(Application->MessageBox("Remove the MySQL Server service ", "WinMySQLadmin 1.0", MB_YESNOCANCEL | MB_ICONQUESTION ) == IDYES)
+ {
+ if (!TheServiceRemove())
+ Application->MessageBox("Fails to Remove The MySQL Server Service", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+ }
+ }
+ else
+ {
+ if(Application->MessageBox("Install the MySQL Server service ", "WinMySQLadmin 1.0", MB_YESNOCANCEL | MB_ICONQUESTION ) == IDYES)
+ {
+ if (!TheServerPath())
+ Application->MessageBox("Please create first the my.ini setup", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+ else
+ {
+ if (!TheServiceCreate())
+ Application->MessageBox("Fails to Install The MySQL Server Service", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+ }
+
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::StandaClick(TObject *Sender)
+{
+ if (MySQLSignal())
+ {
+ if(Application->MessageBox("Shutdown the MySQL Server ", "WinMySQLadmin 1.0", MB_YESNOCANCEL | MB_ICONQUESTION ) == IDYES)
+ {
+ if (Shutd())
+ {
+ IsConnect = false;
+ IsVariables = false;
+ IsProcess = false;
+ IsDatabases = false;
+ ya = false;
+ ClearBox();
+ Sleep(500);
+ TrayMessage(NIM_MODIFY);
+
+ }
+ else
+ Application->MessageBox("Fails to Shutdown the Server", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+ }
+ }
+ else
+ {
+ if(Application->MessageBox("Start the MySQL Server ", "WinMySQLadmin 1.0", MB_YESNOCANCEL | MB_ICONQUESTION ) == IDYES)
+ {
+ if (mysqldstart())
+ {
+ StatusLine->SimpleText = "";
+ TrayMessage(NIM_MODIFY);
+
+ }
+ else
+ Application->MessageBox("Fails to Start the Server", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+ }
+ }
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::Shutd()
+{
+ // from Irena
+ HANDLE hEventShutdown;
+ hEventShutdown=OpenEvent(EVENT_MODIFY_STATE, 0, "MySqlShutdown");
+
+ if (IsConnect)
+ {
+ mysql_kill(MySQL,mysql_thread_id(MySQL));
+ mysql_shutdown(MySQL);
+ StatusLine->SimpleText = "";
+
+ }
+
+ q = 0;
+
+
+ if(hEventShutdown)
+ {
+ SetEvent(hEventShutdown);
+ CloseHandle(hEventShutdown);
+ TrayMessage(NIM_MODIFY);
+ IsConnect = false;
+ return true;
+ }
+ else
+ {
+ TrayMessage(NIM_MODIFY);
+ return false;
+ }
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::ClearBox(void)
+{
+
+ st22->Text = "";
+ st23->Text = "";
+ st24->Text = "";
+ st25->Text = "";
+ st26->Text = "";
+ st27->Text = "";
+ st28->Text = "";
+ st29->Text = "";
+ Edit3->Text = "";
+ Edit4->Text = "";
+ Edit5->Text = "";
+ Edit6->Text = "";
+
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::TheServiceRemove()
+{
+ bool thatok;
+ char *SERVICE_NAME = "MySql";
+ SC_HANDLE myService, scm;
+ scm = OpenSCManager(0, 0, SC_MANAGER_ALL_ACCESS);
+ if (scm)
+ {
+ myService = OpenService(scm, SERVICE_NAME, SERVICE_ALL_ACCESS);
+ if (myService)
+ {
+ if(DeleteService(myService))
+ {
+ CloseServiceHandle(myService);
+ CloseServiceHandle(scm);
+ thatok = true;
+ }
+ else
+ {
+ CloseServiceHandle(myService);
+ CloseServiceHandle(scm);
+ thatok = false;
+ }
+
+ }
+ else
+ {
+ CloseServiceHandle(myService);
+ CloseServiceHandle(scm);
+ thatok = false;
+ }
+ }
+ else
+ {
+ thatok = false;
+ CloseServiceHandle(scm);
+ }
+
+ return thatok;
+
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::TheServerPath()
+{
+
+ TIniFile *pIniFile = new
+ TIniFile(TheWinDir() + "\\my.ini");
+
+ vpath = pIniFile->ReadString("WinMySQLadmin","Server","") ;
+ delete pIniFile;
+ if (vpath.IsEmpty())
+ return false;
+ else
+ return true;
+
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::Button5Click(TObject *Sender)
+{
+ if (!SeekErrFile())
+ Application->MessageBox("Fails to find mysql.err", "WinMySQLadmin 1.0", MB_OK |MB_ICONINFORMATION);
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::IsMySQLInit(void)
+{
+ AnsiString theCommand;
+ char *host = NULL,*password=0,*user=0 ;
+ TIniFile *pIniFile = new
+ TIniFile(TheWinDir() + "\\my.ini");
+
+ AnsiString MyUser = pIniFile->ReadString("WinMySQLadmin","user","") ;
+ AnsiString MyPass = pIniFile->ReadString("WinMySQLadmin","password","") ;
+
+ delete pIniFile;
+
+
+ if (!MyUser.IsEmpty() && MyUser.Length() && !MyPass.IsEmpty() && MyPass.Length())
+ {
+ if (!IsConnect)
+ {
+
+ MySQL = mysql_init(MySQL);
+ if (mysql_real_connect(MySQL, "localhost",(MyUser).c_str(), (MyPass).c_str() , 0, 0, NULL, 0))
+ IsConnect = true;
+ else
+ {
+ if(mysql_real_connect(MySQL,host,user,password , 0, 0, NULL, 0))
+ {
+ IsConnect = true;
+ theCommand = "GRANT ALL PRIVILEGES ON *.* TO ";
+ theCommand += "'" + MyUser + "' @localhost IDENTIFIED BY ";
+ theCommand += "'" + MyPass + "' with GRANT OPTION";
+ char* los = theCommand.c_str();
+ if(!mysql_query(MySQL, los ))
+ StatusLine->SimpleText = " ";
+ }
+
+ }
+
+ }
+
+ }
+ else
+ {
+ if (!IsConnect)
+ {
+ MySQL = mysql_init(MySQL);
+ if(mysql_real_connect(MySQL,host,user,password , 0, 0, NULL, 0))
+ IsConnect = true;
+ }
+ }
+}
+
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::Timer3Timer(TObject *Sender)
+{
+ if ((NT) && TheServiceStatus()) {IsMySQLInit(); }
+
+ if ((NT) && !TheServiceStatus() && MySQLSignal()) {IsMySQLInit(); }
+
+ if (!(NT) && MySQLSignal()) {IsMySQLInit(); }
+
+ if (IsConnect)
+ {
+ GetServerStatus();
+ if (!IsMySQLNode)
+ GetMainRoot();
+ Extended->Enabled = true;
+ if (!IsProcess && !GetProcess())
+ StatusLine->SimpleText = "";
+ if (!IsVariables && !GetVariables())
+ StatusLine->SimpleText = "";
+ Timer3->Interval = 10000;
+ }
+ else
+ Extended->Enabled = false;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::GetServerStatus(void)
+{
+
+ GetExtendedStatus();
+ Edit3->Text = mysql_get_server_info(MySQL);
+ Edit4->Text = mysql_get_host_info(MySQL);
+ Edit5->Text = mysql_get_client_info();
+ Edit6->Text = mysql_get_proto_info(MySQL);
+
+
+}
+
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::GetProcess()
+{
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+ unsigned int i;
+ int k = 0;
+ int therow = 1;
+ new_line=1;
+
+ StringGrid2->RowCount= 2;
+
+ if (!(res=mysql_list_processes(MySQL)))
+ {
+ return false;
+ }
+
+ while ((row=mysql_fetch_row(res)) != 0)
+ {
+ mysql_field_seek(res,0);
+ StringGrid2->Cells[0][0] = "PID";
+ StringGrid2->Cells[1][0] = "User";
+ StringGrid2->Cells[2][0] = "Host";
+ StringGrid2->Cells[3][0] = "DB";
+ StringGrid2->Cells[4][0] = "Command";
+ StringGrid2->Cells[5][0] = "Time";
+ StringGrid2->Cells[6][0] = "State";
+ StringGrid2->Cells[7][0] = "Info";
+ for (i=0 ; i < mysql_num_fields(res); i++)
+ {
+
+ if (k <= 6 )
+ {
+ StringGrid2->Cells[k][therow] = row[i];
+ k++;
+ }
+ else
+ {
+
+ StringGrid2->Cells[(k)][therow] = row[i];
+ k = 0;
+ therow++ ;
+ StringGrid2->RowCount++;
+
+ }
+
+ }
+
+ }
+
+ StringGrid2->RowCount--;
+ mysql_free_result(res);
+ StringGrid5->RowCount--;
+ IsProcess = true;
+ return true;
+
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::GetVariables()
+{
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+ unsigned int i;
+ int k = 1;
+ new_line=1;
+ bool left = true;
+ AnsiString report;
+ StringGrid1->RowCount = 2;
+ if (mysql_query(MySQL,"show variables") ||
+ !(res=mysql_store_result(MySQL)))
+ {
+ return false;
+ }
+
+ while ((row=mysql_fetch_row(res)) != 0)
+ {
+ mysql_field_seek(res,0);
+
+ StringGrid1->Cells[0][0] = "Variable Name";
+ StringGrid1->Cells[1][0] = "Value";
+
+
+ for (i=0 ; i < mysql_num_fields(res); i++)
+ {
+
+ if (left)
+ {
+ if (treport)
+ report = GetString(row[i]);
+ StringGrid1->Cells[0][k++] = row[i];
+ left = false;
+ }
+ else
+ {
+ if (treport)
+ Memo5->Lines->Add(report + row[i]);
+ StringGrid1->RowCount++;
+ StringGrid1->Cells[1][--k] = row[i];
+ k++;
+ left = true;
+ }
+
+ }
+
+ }
+
+ StringGrid1->RowCount--;
+ mysql_free_result(res);
+ IsVariables = true;
+ return true;
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::nice_time(AnsiString buff)
+{
+
+ unsigned long sec;
+ unsigned long tmp;
+ AnsiString mytime;
+
+ sec = StrToInt(buff);
+
+ if (sec >= 3600L*24)
+ {
+ tmp=sec/(3600L*24);
+ sec-=3600L*24*tmp;
+
+ mytime = IntToStr(tmp);
+ if (tmp > 1)
+ mytime+= " days ";
+ else
+ mytime+= " day ";
+
+ }
+
+ if (sec >= 3600L)
+ {
+ tmp=sec/3600L;
+ sec-=3600L*tmp;
+ mytime += IntToStr(tmp);
+ if (tmp > 1)
+ mytime+= " hours ";
+ else
+ mytime+= " hour ";
+ }
+ if (sec >= 60)
+ {
+ tmp=sec/60;
+ sec-=60*tmp;
+ mytime += IntToStr(tmp);
+ mytime+= " min ";
+
+ }
+ mytime += IntToStr(sec);
+ mytime+= " sec ";
+ st29->Text = mytime ;
+ return true;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::Button11Click(TObject *Sender)
+{
+ if (IsConnect)
+ {
+ if (GetVariables())
+ StatusLine->SimpleText = "";
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::Button10Click(TObject *Sender)
+{
+ if (IsConnect)
+ {
+ if (GetProcess())
+ StatusLine->SimpleText = "";
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::Button6Click(TObject *Sender)
+{
+ if (IsConnect)
+ {
+ if (mysql_refresh(MySQL,REFRESH_HOSTS))
+ StatusLine->SimpleText = "";
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::Button7Click(TObject *Sender)
+{
+ if (IsConnect)
+ {
+ if (mysql_refresh(MySQL,REFRESH_LOG))
+ StatusLine->SimpleText = "";
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::Button8Click(TObject *Sender)
+{
+ if (IsConnect)
+ {
+ if (mysql_refresh(MySQL,REFRESH_TABLES))
+ StatusLine->SimpleText = "";
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::Button2Click(TObject *Sender)
+{
+ Memo1->Enabled = true;
+ Memo1->Lines->Clear();
+ AnsiString asFileName = FileSearch("my.ini", TheWinDir());
+ if (asFileName.IsEmpty())
+ Application->MessageBox("Don't found my.ini file on the Win Directory", "WinMySQLadmin 1.0", MB_OK |MB_ICONINFORMATION);
+ else
+ FillMyIni();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::Button3Click(TObject *Sender)
+{
+ TIniFile *pIniFile = new
+ TIniFile(TheWinDir() + "\\my.ini");
+
+ if (!Memo1->GetTextLen())
+ Application->MessageBox("The Memo Box is Empty", "WinMySQLadmin 1.0", MB_OK |MB_ICONINFORMATION);
+ else
+ {
+ if(Application->MessageBox("Are you sure to write the modifications into My.ini file.", "WinMySQLadmin 1.0", MB_YESNOCANCEL | MB_ICONQUESTION ) == IDYES)
+ {
+ Memo1->Lines->SaveToFile(TheWinDir() + "\\my.ini");
+
+ Memo1->Lines->Clear();
+ Memo1->Enabled = true;
+ Memo1->Lines->Clear();
+ if (NtVer->Checked)
+ pIniFile->WriteString("WinMySQLadmin","Server",TheDir() + "/bin/mysqld-nt.exe");
+ if (MysqldVer->Checked == true)
+ pIniFile->WriteString("WinMySQLadmin","Server", TheDir() + "/bin/mysqld.exe");
+ if (ShareVer->Checked)
+ pIniFile->WriteString("WinMySQLadmin","Server",TheDir() + "/bin/mysqld-shareware.exe");
+ if (OptVer->Checked)
+ pIniFile->WriteString("WinMySQLadmin","Server", TheDir() + "/bin/mysqld-opt.exe");
+ FillMyIni();
+ Application->MessageBox("My.ini was modificated", "WinMySQLadmin 1.0", MB_OK |MB_ICONINFORMATION);
+ }
+
+ }
+ delete pIniFile;
+ Memo1->Lines->Clear();
+ FillMyIni();
+
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::Button1Click(TObject *Sender)
+{
+ if(CreatingShortCut())
+ Application->MessageBox("The ShortCut on Start Menu was created", "WinMySQLadmin 1.0", MB_OK |MB_ICONINFORMATION);
+ else
+ Application->MessageBox("Fails the Operation of Create the ShortCut", "WinMySQLadmin 1.0", MB_OK |MB_ICONINFORMATION);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::SpeedButton2Click(TObject *Sender)
+{
+ BROWSEINFO info;
+ char szDir[MAX_PATH];
+ char szDisplayName[MAX_PATH];
+ LPITEMIDLIST pidl;
+ LPMALLOC pShellMalloc;
+
+
+ if(SHGetMalloc(&pShellMalloc) == NO_ERROR)
+ {
+
+ memset(&info, 0x00,sizeof(info));
+ info.hwndOwner = Handle;
+ info.pidlRoot = 0;
+ info.pszDisplayName = szDisplayName;
+ info.lpszTitle = "Search MySQL Base Directory";
+ info.ulFlags = BIF_RETURNONLYFSDIRS;
+ info.lpfn = 0;
+
+ pidl = SHBrowseForFolder(&info);
+
+ if(pidl)
+ {
+
+ if(SHGetPathFromIDList(pidl, szDir)) {BaseDir->Text = szDir; }
+
+ pShellMalloc->Free(pidl);
+ }
+ pShellMalloc->Release();
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::Button4Click(TObject *Sender)
+{
+ if (IsConnect)
+ {
+ Memo3->Lines->Add(mysql_stat(MySQL));
+ }
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TForm1::SpeedButton3Click(TObject *Sender)
+{
+ if(Showme1->Caption == "Show me") { TrayMessage(NIM_DELETE);
+ Showme1->Caption = "Hide me"; Show(); }
+ else { TrayMessage(NIM_ADD); TrayMessage(NIM_MODIFY);
+ Showme1->Caption = "Show me"; Hide(); }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::ExtendedClick(TObject *Sender)
+{
+if (ya)
+ {
+ Extended->Caption = "Start Extended Server Status";
+ ya = false;
+ ClearBox();
+ }
+else
+ {
+ Extended->Caption = "Stop Extended Server Status";
+ ya = true;
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::GetServerOptions(void)
+{
+AnsiString FileName;
+FileName = FileSearch("mysqld-opt.exe", ExtractFilePath(Application->ExeName));
+if (FileName.IsEmpty()) {OptVer->Enabled = false; }
+
+FileName = FileSearch("mysqld-shareware.exe", ExtractFilePath(Application->ExeName));
+if (FileName.IsEmpty()) {ShareVer->Enabled = false; }
+
+FileName = FileSearch("mysqld.exe", ExtractFilePath(Application->ExeName));
+if (FileName.IsEmpty()) {MysqldVer->Enabled = false; }
+
+FileName = FileSearch("mysqld-nt.exe", ExtractFilePath(Application->ExeName));
+if (FileName.IsEmpty()) {NtVer->Enabled = false; }
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::GetReportServer(void)
+{
+
+ AnsiString strspace;
+ Memo5->Lines->Clear();
+ Memo5->Lines->Add("This Report was made using the WinMySQLadmin 1.0 Tool");
+ Memo5->Lines->Add("");
+ Memo5->Lines->Add(Now());
+ Memo5->Lines->Add("");
+
+ preport = true;
+ Memo5->Lines->Add("");
+ Memo5->Lines->Add("Server Status Values");
+ Memo5->Lines->Add("");
+ Memo5->Lines->Add(GetString("Server Info") + mysql_get_server_info(MySQL));
+ Memo5->Lines->Add(GetString("Host Info") + mysql_get_host_info(MySQL));
+ Memo5->Lines->Add(GetString("Client Info") + mysql_get_client_info());
+ Memo5->Lines->Add(GetString("Proto Info") + mysql_get_proto_info(MySQL));
+ GetExtendedStatus();
+ preport = false;
+ treport = true;
+ Memo5->Lines->Add("");
+ Memo5->Lines->Add("Variables Values");
+ Memo5->Lines->Add("");
+ GetVariables();
+ treport = false;
+ ereport = true;
+ Memo5->Lines->Add("");
+ Memo5->Lines->Add("Last Lines from Err File");
+ Memo5->Lines->Add("");
+ SeekErrFile();
+ ereport = false;
+
+}
+
+void __fastcall TForm1::SpeedButton4Click(TObject *Sender)
+{
+ if(IsConnect)
+ GetReportServer();
+ else
+ Application->MessageBox("The Server must be connected", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::SpeedButton5Click(TObject *Sender)
+{
+ AnsiString PathName;
+ SaveFileDialog->FileName = PathName;
+ if (SaveFileDialog->Execute() ){
+ PathName= SaveFileDialog->FileName;
+ Caption = ExtractFileName(PathName);
+ Memo5->Lines->SaveToFile(PathName);
+ Memo5->Modified = false;
+ }
+}
+//---------------------------------------------------------------------------
+String __fastcall TForm1::GetString(String k)
+{
+ int i = 35 - k.Length();
+ for (int y = 1 ; y <= i ;y++ )
+ k+= " ";
+ return k ;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::SpeedButton6Click(TObject *Sender)
+{
+ PrinterSetupDialog1->Execute();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::SpeedButton7Click(TObject *Sender)
+{
+ AnsiString PathName;
+ if (PrintDialog1->Execute()){
+ try {
+ Memo5->Print(PathName);
+ }
+ catch(...){
+ Printer()->EndDoc();
+ throw;
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::SpeedButton8Click(TObject *Sender)
+{
+ Memo5->CutToClipboard();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::SpeedButton9Click(TObject *Sender)
+{
+ Memo5->CopyToClipboard();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::SpeedButton10Click(TObject *Sender)
+{
+
+ Memo5->PasteFromClipboard();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::SpeedButton11Click(TObject *Sender)
+{
+ Memo5->ClearSelection();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::SpeedButton12Click(TObject *Sender)
+{
+ Memo5->SelectAll();
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::GetMainRoot()
+{
+
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+ unsigned int i;
+ AnsiString command;
+
+ CleanGrid();
+ CleanGridI();
+ TakeIP();
+
+ MySQLNode = DBView->Items->Add(NULL, mainroot.UpperCase());
+ MySQLNode->ImageIndex = 0;
+
+ if (!(res=mysql_list_dbs(MySQL,"%"))) { return false; }
+ while ((row=mysql_fetch_row(res)) != 0) {
+ mysql_field_seek(res,0);
+
+ for (i=0 ; i < mysql_num_fields(res); i++)
+ {
+ MySQLDbs = DBView->Items->AddChild(MySQLNode, row[i]);
+ MySQLDbs->ImageIndex = 1;
+ MySQLDbs->SelectedIndex = 1;
+
+
+ }
+
+ }
+
+ mysql_free_result(res);
+ MySQLNode->Expanded = true;
+
+
+
+
+ IsMySQLNode = true;
+ return true;
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::DeleteDatabaseSClick(TObject *Sender)
+{
+ AnsiString alert;
+ if (IsConnect)
+ {
+ if(DBView->Selected == MySQLNode )
+ Application->MessageBox("Invalid database row selected.", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+ else if ( DBView->Selected == NULL )
+ Application->MessageBox("Invalid database row selected.", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+ else
+ {
+ if (DBView->Selected->Text.UpperCase() == "MYSQL")
+ Application->MessageBox("You cann't use this tool to drop the MySQL Database.", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+ else {
+ alert = "Are you sure to drop the < ";
+ alert+= DBView->Selected->Text.c_str();
+ alert+= " > database.";
+ if(Application->MessageBox(alert.c_str(), "WinMySQLadmin 1.0", MB_YESNOCANCEL | MB_ICONQUESTION ) == IDYES)
+ {
+ char* lese = DBView->Selected->Text.c_str();
+ if (!mysql_drop_db(MySQL, lese ))
+ {
+ DBView->Items->Clear();
+ GetMainRoot();
+ }
+ else
+ Application->MessageBox("Fails to drop the Database.", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+ }
+ }
+ }
+ }
+ else
+ Application->MessageBox("The Server must be connected", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+}
+//---------------------------------------------------------------------------
+ bool __fastcall TForm1::IsDatabase(String Name)
+{
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+ unsigned int i;
+ AnsiString command;
+
+
+ CleanTree();
+ command = "use ";
+ command+= Name.c_str();
+ char* das = command.c_str();
+ char* lis = Name.c_str();
+ if (mysql_query(MySQL, das ) ||
+ !(res=mysql_list_tables(MySQL,"%")))
+ return false;
+
+ MySQLNodeT = TableView->Items->Add(NULL, lis);
+ MySQLNodeT->ImageIndex = 1;
+ MySQLNodeT->SelectedIndex = 1;
+ while ((row=mysql_fetch_row(res)) != 0) {
+ mysql_field_seek(res,0);
+
+ for (i=0 ; i < mysql_num_fields(res); i++)
+ {
+
+ MySQLTbs = TableView->Items->AddChild(MySQLNodeT, row[i]);
+ MySQLTbs->ImageIndex = 2;
+ MySQLTbs->SelectedIndex = 2;
+ }
+ MySQLNodeT->Expanded = true;
+ }
+ mysql_free_result(res);
+ return true;
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TForm1::DBViewClick(TObject *Sender)
+{
+
+ if (IsConnect)
+ {
+ if (DBView->Selected != MySQLNode && DBView->Selected != NULL )
+ {
+ IsDatabase(DBView->Selected->Text);
+
+ }
+ else
+ {
+ CleanTree();
+ }
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::TableViewClick(TObject *Sender)
+{
+ if (IsConnect)
+ {
+ if (DBView->Selected != MySQLNodeT )
+ {
+ IsTable(TableView->Selected->Text);
+ IsIndex(TableView->Selected->Text);
+
+ }
+ else
+ {
+ CleanGrid();
+ CleanGridI();
+
+ }
+ }
+}
+//---------------------------------------------------------------------------
+ bool __fastcall TForm1::IsTable(String Name)
+{
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+ unsigned int i;
+ int k = 0;
+ int therow = 1;
+ new_line=1;
+ AnsiString command;
+ AnsiString commandt;
+
+ CleanGrid();
+ CleanGridI();
+ command = "use ";
+ command+= DBView->Selected->Text.c_str();
+ char* las = command.c_str();
+
+ commandt = "desc ";
+ commandt+= Name.c_str();
+ char* les = commandt.c_str();
+
+ if (mysql_query(MySQL, las ))
+ return false;
+
+ if (mysql_query(MySQL, les ) ||
+ !(res=mysql_store_result(MySQL)))
+ return false ;
+
+ StringGrid4->Cells[0][0] = "Field";
+ StringGrid4->Cells[1][0] = "Type";
+ StringGrid4->Cells[2][0] = "Null";
+ StringGrid4->Cells[3][0] = "Key";
+ StringGrid4->Cells[4][0] = "Default";
+ StringGrid4->Cells[5][0] = "Extra";
+ StringGrid4->Cells[6][0] = "Previleges";
+
+
+ int thecounter;
+ String u = GetNumberServer();
+ if ( u == "3.22")
+ {
+ StringGrid3->ColCount = 7;
+ thecounter = 4;
+ }
+ else
+ thecounter = 5;
+
+ while ((row=mysql_fetch_row(res)) != 0)
+ {
+ mysql_field_seek(res,0);
+
+ for (i=0 ; i < mysql_num_fields(res); i++)
+ {
+ if (k <= thecounter )
+ {
+ StringGrid4->Cells[k][therow] = row[i];
+ k++;
+ }
+ else
+ {
+ StringGrid4->Cells[(k)][therow] = row[i];
+ k = 0;
+ therow++ ;
+ StringGrid4->RowCount++;
+ }
+ }
+
+ }
+ StringGrid4->RowCount--;
+ mysql_free_result(res);
+ return true;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::TableViewChange(TObject *Sender, TTreeNode *Node)
+{
+if (IsConnect)
+ {
+ if (DBView->Selected != MySQLNodeT )
+ {
+ IsTable(TableView->Selected->Text);
+ IsIndex(TableView->Selected->Text);
+
+ }
+ else
+ {
+ CleanGrid();
+ CleanGridI();
+
+ }
+ }
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::DBViewChange(TObject *Sender, TTreeNode *Node)
+{
+ if (IsConnect)
+ {
+ if (DBView->Selected != MySQLNode )
+ {
+ IsDatabase(DBView->Selected->Text);
+
+ }
+ else
+ {
+ CleanTree();
+ }
+ }
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::RefreshSClick(TObject *Sender)
+{
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+ unsigned int i;
+ AnsiString command;
+
+ if (IsConnect)
+ {
+ IsMySQLNode = false;
+ CleanTree();
+ DBView->Items->Clear();
+
+ TakeIP();
+
+ MySQLNode = DBView->Items->Add(NULL, mainroot.UpperCase());
+ MySQLNode->ImageIndex = 0;
+
+ if (!(res=mysql_list_dbs(MySQL,"%"))) { /*do nothing;*/ }
+ while ((row=mysql_fetch_row(res)) != 0) {
+ mysql_field_seek(res,0);
+
+ for (i=0 ; i < mysql_num_fields(res); i++)
+ {
+ MySQLDbs = DBView->Items->AddChild(MySQLNode, row[i]);
+ MySQLDbs->ImageIndex = 1;
+ MySQLDbs->SelectedIndex = 1;
+
+ }
+
+ }
+
+ mysql_free_result(res);
+
+ IsMySQLNode = true;
+
+ MySQLNode->Expanded = true;
+
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::CreateDatabaseSClick(TObject *Sender)
+{
+
+ if (IsConnect)
+ {
+ dbfrm->Show();
+
+ }
+ else
+ ShowMessage("Precisa estar conectado");
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::CleanTree(void)
+{
+ StringGrid4->RowCount= 2;
+ StringGrid4->Cells[0][1] = "";
+ StringGrid4->Cells[1][1] = "";
+ StringGrid4->Cells[2][1] = "";
+ StringGrid4->Cells[3][1] = "";
+ StringGrid4->Cells[4][1] = "";
+ StringGrid4->Cells[5][1] = "";
+ TableView->Items->Clear();
+
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::CleanGrid(void)
+{
+ StringGrid4->RowCount= 2;
+ StringGrid4->Cells[0][1] = "";
+ StringGrid4->Cells[1][1] = "";
+ StringGrid4->Cells[2][1] = "";
+ StringGrid4->Cells[3][1] = "";
+ StringGrid4->Cells[4][1] = "";
+ StringGrid4->Cells[5][1] = "";
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::CreatingDB()
+{
+
+ if (mysql_create_db(MySQL, dbfrm->Edit1->Text.c_str()))
+ return true;
+ else
+ return false;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::OutRefresh(void)
+{
+ RefreshSClick(dbfrm->SpeedButton1);
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::FlushHosts1Click(TObject *Sender)
+{
+ if (IsConnect)
+ {
+ if (mysql_refresh(MySQL,REFRESH_HOSTS))
+ StatusLine->SimpleText = "";
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::FlushLogs1Click(TObject *Sender)
+{
+ if (IsConnect)
+ {
+ if (mysql_refresh(MySQL,REFRESH_LOG))
+ StatusLine->SimpleText = "";
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TForm1::FlushTables1Click(TObject *Sender)
+{
+ if (IsConnect)
+ {
+ if (mysql_refresh(MySQL,REFRESH_TABLES))
+ StatusLine->SimpleText = "";
+ }
+}
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+ bool __fastcall TForm1::IsIndex(String Name)
+{
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+ unsigned int i;
+ int k = 0;
+ int therow = 1;
+ new_line=1;
+ AnsiString command;
+ AnsiString commandt;
+ i = 0;
+ CleanGridI();
+ command = "use ";
+ command+= DBView->Selected->Text.c_str();
+ char* las = command.c_str();
+
+ commandt = "show index from ";
+ commandt+= Name.c_str();
+ char* les = commandt.c_str();
+
+ if (mysql_query(MySQL, las ))
+ return false;
+
+ if (mysql_query(MySQL, les ) ||
+ !(res=mysql_store_result(MySQL)))
+ return false ;
+
+ StringGrid3->RowCount= 2;
+ StringGrid3->Cells[0][0] = "Table";
+ StringGrid3->Cells[1][0] = "Non_unique";
+ StringGrid3->Cells[2][0] = "Key_name";
+ StringGrid3->Cells[3][0] = "Seq_in_index";
+ StringGrid3->Cells[4][0] = "Col_name";
+ StringGrid3->Cells[5][0] = "Collation";
+ StringGrid3->Cells[6][0] = "Card.";
+ StringGrid3->Cells[7][0] = "Sub_part";
+ StringGrid3->Cells[8][0] = "Packed";
+ StringGrid3->Cells[9][0] = "Comment";
+
+ int thecounter;
+ String u = GetNumberServer();
+
+ if ( u == "3.22")
+ {
+ StringGrid3->ColCount = 8;
+ thecounter = 6;
+ }
+ else
+ thecounter = 8;
+ while ((row=mysql_fetch_row(res)) != 0)
+ {
+ mysql_field_seek(res,0);
+
+ for (i=0 ; i < mysql_num_fields(res); i++)
+ {
+ if (k <= thecounter )
+ {
+ StringGrid3->Cells[k][therow] = row[i];
+ k++;
+ }
+ else
+ {
+ StringGrid3->Cells[(k)][therow] = row[i];
+ k = 0;
+ therow++ ;
+ StringGrid3->RowCount++;
+ }
+ }
+
+ }
+ if (i)
+ StringGrid3->RowCount--;
+ mysql_free_result(res);
+ return true;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::CleanGridI(void)
+{
+ StringGrid3->RowCount= 2;
+ StringGrid3->Cells[0][1] = "";
+ StringGrid3->Cells[1][1] = "";
+ StringGrid3->Cells[2][1] = "";
+ StringGrid3->Cells[3][1] = "";
+ StringGrid3->Cells[4][1] = "";
+ StringGrid3->Cells[5][1] = "";
+ StringGrid3->Cells[6][1] = "";
+ StringGrid3->Cells[7][1] = "";
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::CreatingTable(String TheTable)
+{
+
+ if (!mysql_query(MySQL, TheTable.c_str()))
+ return true;
+ else
+ return false;
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::GetExtendedStatus()
+{
+ if (!ya && !preport)
+ return true;
+
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+ unsigned int i;
+ int k = 1;
+ new_line=1;
+ bool left = true;
+ bool open_tables = false;
+ bool open_files = false;
+ bool uptime = false;
+ bool running_threads = false;
+ bool open_streams = false;
+ bool slow_queries = false;
+ bool opened_tables = false;
+ bool questions = false;
+
+ AnsiString report;
+ if (yy)
+ StringGrid5->RowCount = 2;
+
+ if (mysql_query(MySQL,"show status") ||
+ !(res=mysql_store_result(MySQL)))
+ {
+ return false;
+ }
+
+ while ((row=mysql_fetch_row(res)) != 0)
+ {
+ mysql_field_seek(res,0);
+
+ StringGrid5->Cells[0][0] = "Variable Name";
+ StringGrid5->Cells[1][0] = "Value";
+
+
+ for (i=0 ; i < mysql_num_fields(res); i++)
+ {
+
+ if (left)
+ {
+ if (preport)
+ report = GetString(row[i]);
+ if ( (String) row[i] == "Open_tables")
+ open_tables = true;
+ else
+ open_tables = false;
+ if ( (String) row[i] == "Open_files")
+ open_files = true;
+ else
+ open_files = false;
+ if ((String) row[i] == "Uptime")
+ uptime = true;
+ else
+ uptime = false;
+
+ if ( (String) row[i] == "Opened_tables")
+ opened_tables = true;
+ else
+ opened_tables = false;
+
+ if ( (String) row[i] == "Threads_running" || (String) row[i] == "Running_threads")
+ running_threads = true;
+ else
+ running_threads = false;
+
+ if ( (String) row[i] == "Open_streams")
+ open_streams = true;
+ else
+ open_streams = false;
+
+ if ( (String) row[i] == "Slow_queries")
+ slow_queries = true;
+ else
+ slow_queries = false;
+
+ if ( (String) row[i] == "Questions")
+ questions = true;
+ else
+ questions = false;
+
+ if (yy)
+ StringGrid5->Cells[0][k++] = row[i];
+
+ left = false;
+ }
+ else
+ {
+ if (preport)
+ Memo5->Lines->Add(report + row[i]);
+ if (open_tables)
+ st22->Text = row[i];
+ if (open_files)
+ st23->Text = row[i];
+ if (uptime)
+ nice_time(row[i]);
+ if (running_threads)
+ st27->Text = row[i];
+ if (open_streams)
+ st24->Text = row[i];
+ if (slow_queries)
+ st28->Text = row[i];
+ if (opened_tables)
+ st25->Text = row[i];
+ if (questions){
+ q++;
+ st26->Text = StrToInt64(row[i]) - q; }
+
+ if (yy){
+ StringGrid5->RowCount++;
+ StringGrid5->Cells[1][--k] = row[i];
+ k++; }
+
+ left = true;
+ }
+
+ }
+
+ }
+
+
+ if (rinit)
+ StringGrid5->RowCount--;
+ mysql_free_result(res);
+ yy = false;
+ return true;
+}
+//---------------------------------------------------------------------------
+void __fastcall TForm1::SpeedButton13Click(TObject *Sender)
+{
+ yy = true;
+ // rinit = true;
+}
+//---------------------------------------------------------------------------
+String __fastcall TForm1::GetNumberServer()
+{
+ String TheVersion;
+
+ TheVersion = mysql_get_server_info(MySQL) ;
+ TheVersion.SetLength(4);
+ return TheVersion;
+
+
+}
+
+//---------------------------------------------------------------------------
+void __fastcall TForm1::KillProcess1Click(TObject *Sender)
+{
+
+ if (IsConnect)
+ KillPID();
+ else
+ Application->MessageBox("The Server must be connected", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+}
+//---------------------------------------------------------------------------
+bool __fastcall TForm1::KillPID()
+{
+ String s = "Are you sure to kill the process PID no. ";
+ s+= StringGrid2->Cells[0][StringGrid2->Row];
+ s+= " of the USER ";
+ s+= StringGrid2->Cells[1][StringGrid2->Row];
+ unsigned long xx = mysql_thread_id(MySQL);
+ unsigned long yy = StrToInt(StringGrid2->Cells[0][StringGrid2->Row]);
+ if ( xx != yy)
+ {
+ if(Application->MessageBox(s.c_str(), "WinMySQLadmin 1.0", MB_YESNOCANCEL | MB_ICONQUESTION ) == IDYES)
+ {
+ if (!mysql_kill(MySQL,yy))
+ {
+ GetProcess();
+ return true;
+ }
+ }
+ }
+ else
+ {
+ Application->MessageBox("From here you can't kill the PID of this tool", "WinMySQLadmin 1.0", MB_OK | MB_ICONEXCLAMATION);
+ return true;
+ }
+ return true;
+}
+void __fastcall TForm1::FlushThreads1Click(TObject *Sender)
+{
+ if (IsConnect)
+ {
+ if (mysql_refresh(MySQL,REFRESH_THREADS))
+ StatusLine->SimpleText = "";
+ }
+}
+//---------------------------------------------------------------------------
+
diff --git a/VC++Files/winmysqladmin/main.h b/VC++Files/winmysqladmin/main.h
new file mode 100644
index 00000000000..dcb8ad60d7b
--- /dev/null
+++ b/VC++Files/winmysqladmin/main.h
@@ -0,0 +1,314 @@
+//---------------------------------------------------------------------------
+#ifndef mainH
+#define mainH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <Buttons.hpp>
+#include <ComCtrls.hpp>
+#include <ExtCtrls.hpp>
+#include <Graphics.hpp>
+#include <Grids.hpp>
+#include <ImgList.hpp>
+#include <Menus.hpp>
+#include <Dialogs.hpp>
+#include <string.h>
+
+#define MYWM_NOTIFY (WM_APP+100)
+#define IDC_MYICON 1006
+extern HINSTANCE g_hinst;
+LRESULT IconDrawItem(LPDRAWITEMSTRUCT lpdi);
+//---------------------------------------------------------------------------
+class TForm1 : public TForm
+{
+__published: // IDE-managed Components
+ TStatusBar *StatusLine;
+ TPanel *Panel1;
+ TImage *Image1;
+ TLabel *Label1;
+ TLabel *Label2;
+ TLabel *Label3;
+ TLabel *Label8;
+ TImage *Image3;
+ TImage *Image2;
+ TPageControl *PageControl1;
+ TTabSheet *TabSheet1;
+ TSpeedButton *SpeedButton1;
+ TGroupBox *GroupBox1;
+ TLabel *Label4;
+ TLabel *Label5;
+ TLabel *Label6;
+ TLabel *Label14;
+ TLabel *Label17;
+ TEdit *Localhost;
+ TEdit *Localuser;
+ TEdit *OS;
+ TMemo *Memo2;
+ TEdit *Edit2;
+ TGroupBox *GroupBox2;
+ TMemo *Memo3;
+ TGroupBox *GroupBox3;
+ TLabel *Label13;
+ TLabel *Label15;
+ TLabel *Label16;
+ TLabel *Label7;
+ TLabel *Label47;
+ TLabel *Label44;
+ TLabel *Label42;
+ TLabel *Label45;
+ TEdit *Edit3;
+ TEdit *Edit4;
+ TEdit *Edit5;
+ TEdit *Edit6;
+ TEdit *st29;
+ TEdit *st27;
+ TEdit *st25;
+ TEdit *st28;
+ TTabSheet *TabSheet2;
+ TTabSheet *TabSheet3;
+ TLabel *Label18;
+ TSpeedButton *SpeedButton2;
+ TEdit *BaseDir;
+ TMemo *Memo1;
+ TRadioGroup *RadioGroup1;
+ TRadioButton *ShareVer;
+ TRadioButton *MysqldVer;
+ TRadioButton *OptVer;
+ TRadioButton *NtVer;
+ TButton *Button2;
+ TButton *Button3;
+ TButton *Button1;
+ TTabSheet *TabSheet4;
+ TMemo *Memo4;
+ TButton *Button5;
+ TTabSheet *TabSheet5;
+ TStringGrid *StringGrid1;
+ TButton *Button11;
+ TTabSheet *TabSheet6;
+ TStringGrid *StringGrid2;
+ TButton *Button10;
+ TPopupMenu *PopupMenu1;
+ TMenuItem *Showme1;
+ TMenuItem *N1;
+ TMenuItem *Win9;
+ TMenuItem *Swin9;
+ TMenuItem *N3;
+ TMenuItem *SSW9;
+ TMenuItem *N4;
+ TMenuItem *ShutDownBoth1;
+ TMenuItem *N2;
+ TMenuItem *WinNT;
+ TMenuItem *ShutDownthisTool1;
+ TMenuItem *N5;
+ TMenuItem *StopS;
+ TMenuItem *N6;
+ TMenuItem *RService;
+ TMenuItem *N7;
+ TMenuItem *Standa;
+ TImageList *ImageList1;
+ TTimer *Timer1;
+ TTimer *Timer2;
+ TTimer *Timer3;
+ TSpeedButton *SpeedButton3;
+ TSpeedButton *Extended;
+ TLabel *Label9;
+ TEdit *st26;
+ TLabel *Label43;
+ TEdit *st24;
+ TLabel *Label41;
+ TEdit *st23;
+ TLabel *Label40;
+ TEdit *st22;
+ TLabel *Label39;
+ TTabSheet *TabSheet8;
+ TSaveDialog *SaveFileDialog;
+ TPrinterSetupDialog *PrinterSetupDialog1;
+ TPrintDialog *PrintDialog1;
+ TRichEdit *Memo5;
+ TGroupBox *GroupBox5;
+ TSpeedButton *SpeedButton4;
+ TSpeedButton *SpeedButton5;
+ TSpeedButton *SpeedButton7;
+ TSpeedButton *SpeedButton6;
+ TGroupBox *GroupBox6;
+ TSpeedButton *SpeedButton8;
+ TSpeedButton *SpeedButton9;
+ TSpeedButton *SpeedButton10;
+ TSpeedButton *SpeedButton11;
+ TSpeedButton *SpeedButton12;
+ TTabSheet *TabSheet9;
+ TImageList *ImageList2;
+ TPopupMenu *PopupMenu2;
+ TMenuItem *CreateDatabaseS;
+ TMenuItem *DeleteDatabaseS;
+ TMenuItem *RefreshS;
+ TMenuItem *N8;
+ TMenuItem *N9;
+ TMenuItem *N10;
+ TGroupBox *GroupBox7;
+ TTreeView *DBView;
+ TGroupBox *GroupBox8;
+ TTreeView *TableView;
+ TGroupBox *GroupBox9;
+ TStringGrid *StringGrid4;
+ TMenuItem *FlushHosts1;
+ TMenuItem *N11;
+ TMenuItem *FlushLogs1;
+ TMenuItem *N12;
+ TMenuItem *FlushTables1;
+ TGroupBox *GroupBox10;
+ TStringGrid *StringGrid3;
+ TImage *Image5;
+ TStringGrid *StringGrid5;
+ TSpeedButton *SpeedButton13;
+ TPopupMenu *PopupMenu4;
+ TMenuItem *KillProcess1;
+ TMenuItem *N13;
+ TMenuItem *FlushThreads1;
+ void __fastcall FormCreate(TObject *Sender);
+ void __fastcall Showme1Click(TObject *Sender);
+ void __fastcall Timer1Timer(TObject *Sender);
+ void __fastcall SpeedButton1Click(TObject *Sender);
+ void __fastcall Timer2Timer(TObject *Sender);
+ void __fastcall Swin9Click(TObject *Sender);
+ void __fastcall SSW9Click(TObject *Sender);
+ void __fastcall ShutDownBoth1Click(TObject *Sender);
+ void __fastcall ShutDownthisTool1Click(TObject *Sender);
+ void __fastcall StopSClick(TObject *Sender);
+ void __fastcall RServiceClick(TObject *Sender);
+ void __fastcall StandaClick(TObject *Sender);
+ void __fastcall Button5Click(TObject *Sender);
+ void __fastcall Timer3Timer(TObject *Sender);
+ void __fastcall Button11Click(TObject *Sender);
+ void __fastcall Button10Click(TObject *Sender);
+ void __fastcall Button6Click(TObject *Sender);
+ void __fastcall Button7Click(TObject *Sender);
+ void __fastcall Button8Click(TObject *Sender);
+
+ void __fastcall Button2Click(TObject *Sender);
+ void __fastcall Button3Click(TObject *Sender);
+ void __fastcall Button1Click(TObject *Sender);
+ void __fastcall SpeedButton2Click(TObject *Sender);
+ void __fastcall Button4Click(TObject *Sender);
+ void __fastcall SpeedButton3Click(TObject *Sender);
+ void __fastcall ExtendedClick(TObject *Sender);
+ void __fastcall SpeedButton4Click(TObject *Sender);
+ void __fastcall SpeedButton5Click(TObject *Sender);
+ void __fastcall SpeedButton6Click(TObject *Sender);
+ void __fastcall SpeedButton7Click(TObject *Sender);
+ void __fastcall SpeedButton8Click(TObject *Sender);
+ void __fastcall SpeedButton9Click(TObject *Sender);
+ void __fastcall SpeedButton10Click(TObject *Sender);
+ void __fastcall SpeedButton11Click(TObject *Sender);
+ void __fastcall SpeedButton12Click(TObject *Sender);
+ void __fastcall DeleteDatabaseSClick(TObject *Sender);
+ void __fastcall DBViewClick(TObject *Sender);
+ void __fastcall TableViewClick(TObject *Sender);
+ void __fastcall TableViewChange(TObject *Sender, TTreeNode *Node);
+ void __fastcall DBViewChange(TObject *Sender, TTreeNode *Node);
+
+ void __fastcall RefreshSClick(TObject *Sender);
+ void __fastcall CreateDatabaseSClick(TObject *Sender);
+ void __fastcall FlushHosts1Click(TObject *Sender);
+ void __fastcall FlushLogs1Click(TObject *Sender);
+ void __fastcall FlushTables1Click(TObject *Sender);
+ void __fastcall SpeedButton13Click(TObject *Sender);
+ void __fastcall KillProcess1Click(TObject *Sender);
+ void __fastcall FlushThreads1Click(TObject *Sender);
+
+
+
+
+
+
+
+private: // User declarations
+ void __fastcall DrawItem(TMessage& Msg);
+ void __fastcall MyNotify(TMessage& Msg);
+ bool __fastcall TrayMessage(DWORD dwMessage);
+ HANDLE __fastcall IconHandle(void);
+ void __fastcall ToggleState(void);
+ PSTR __fastcall TipText(void);
+ void __fastcall WMQueryEndSession(TWMQueryEndSession &msg);
+ AnsiString __fastcall TheComputer();
+ AnsiString __fastcall TheUser();
+ AnsiString __fastcall TheOS();
+ void __fastcall TakeIP(void);
+ void __fastcall GetmemStatus(void);
+ void __fastcall ShowHelp(void);
+ void __fastcall ContinueLoad(void);
+ void __fastcall MyODBC(void);
+ void __fastcall IsMyIniUp(void);
+ void __fastcall QuickSearch(void);
+ AnsiString __fastcall TheWinDir();
+ void __fastcall FillMyIni(void);
+ void __fastcall GetBaseDir(void);
+ bool __fastcall MySQLSignal();
+ bool __fastcall mysqldstart();
+ bool __fastcall SeekErrFile();
+ AnsiString __fastcall TheDir();
+ bool __fastcall TheServiceStart();
+ bool __fastcall TheServicePause();
+ bool __fastcall TheServiceResume();
+ bool __fastcall TheServiceStatus();
+ bool __fastcall TheServiceCreate();
+ bool __fastcall TheServiceRemove();
+ bool __fastcall Shutd();
+ void __fastcall ClearBox(void);
+ bool __fastcall TheServerPath();
+ void __fastcall GetServerOptions(void);
+ void __fastcall GetReportServer(void);
+
+
+ TFileStream *MyFile;
+ String FName;
+
+ void __fastcall IsMySQLInit(void);
+ void __fastcall GetServerStatus(void);
+ bool __fastcall GetExtendedStatus();
+ bool __fastcall GetProcess();
+ bool __fastcall GetVariables();
+ bool __fastcall nice_time(AnsiString buff);
+ String __fastcall GetString(String k);
+ String __fastcall GetNumberServer();
+ // pointers for database screen
+ TTreeNode *MySQLNode, *MySQLDbs, *MySQLNodeT, *MySQLTbs;
+
+ bool __fastcall GetMainRoot();
+ bool __fastcall IsDatabase(String Name);
+ bool __fastcall IsTable(String Name);
+ void __fastcall CleanTree(void);
+ void __fastcall CleanGrid(void);
+ bool __fastcall IsIndex(String Name);
+ void __fastcall CleanGridI(void);
+ bool __fastcall KillPID();
+
+
+
+public: // User declarations
+ __fastcall TForm1(TComponent* Owner);
+ void __fastcall GetServerFile(void);
+ void __fastcall CreateMyIniFile(void);
+ bool __fastcall CreatingShortCut();
+ bool __fastcall CreatingDB();
+ void __fastcall OutRefresh(void);
+ bool __fastcall CreatingTable(String TheTable);
+
+ bool IsConnect ;
+
+
+
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ BEGIN_MESSAGE_MAP
+ MESSAGE_HANDLER(WM_DRAWITEM,TMessage,DrawItem)
+ MESSAGE_HANDLER(MYWM_NOTIFY,TMessage,MyNotify)
+ MESSAGE_HANDLER(WM_QUERYENDSESSION,TWMQueryEndSession,WMQueryEndSession)
+ END_MESSAGE_MAP(TForm)
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TForm1 *Form1;
+//---------------------------------------------------------------------------
+#endif
diff --git a/VC++Files/winmysqladmin/mysql.h b/VC++Files/winmysqladmin/mysql.h
new file mode 100644
index 00000000000..e83babb8fa8
--- /dev/null
+++ b/VC++Files/winmysqladmin/mysql.h
@@ -0,0 +1,293 @@
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ 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., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA */
+
+/* defines for the libmysql library */
+
+#ifndef _mysql_h
+#define _mysql_h
+
+#ifndef MYSQL_SERVER
+#ifdef __cplusplus
+extern "C" {
+#endif
+#endif
+
+#ifndef _global_h /* If not standard header */
+#include <sys/types.h>
+typedef char my_bool;
+#if (defined(_WIN32) || defined(_WIN64)) && !defined(__WIN__)
+#define __WIN__
+#endif
+#if !defined(__WIN__)
+#define STDCALL
+#else
+#define STDCALL __stdcall
+#endif
+typedef char * gptr;
+
+#ifndef ST_USED_MEM_DEFINED
+#define ST_USED_MEM_DEFINED
+typedef struct st_used_mem { /* struct for once_alloc */
+ struct st_used_mem *next; /* Next block in use */
+ unsigned int left; /* memory left in block */
+ unsigned int size; /* size of block */
+} USED_MEM;
+typedef struct st_mem_root {
+ USED_MEM *free;
+ USED_MEM *used;
+ unsigned int min_malloc;
+ unsigned int block_size;
+ void (*error_handler)(void);
+} MEM_ROOT;
+#endif
+
+#ifndef my_socket_defined
+#ifdef __WIN__
+#define my_socket SOCKET
+#else
+typedef int my_socket;
+#endif
+#endif
+#endif
+#include "mysql_com.h"
+#include "mysql_version.h"
+
+extern unsigned int mysql_port;
+extern char *mysql_unix_port;
+
+#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
+#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
+#define IS_BLOB(n) ((n) & BLOB_FLAG)
+#define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR)
+
+typedef struct st_mysql_field {
+ char *name; /* Name of column */
+ char *table; /* Table of column if column was a field */
+ char *def; /* Default value (set by mysql_list_fields) */
+ enum enum_field_types type; /* Type of field. Se mysql_com.h for types */
+ unsigned int length; /* Width of column */
+ unsigned int max_length; /* Max width of selected set */
+ unsigned int flags; /* Div flags */
+ unsigned int decimals; /* Number of decimals in field */
+} MYSQL_FIELD;
+
+typedef char **MYSQL_ROW; /* return data as array of strings */
+typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */
+
+#if defined(NO_CLIENT_LONG_LONG)
+typedef unsigned long my_ulonglong;
+#elif defined (__WIN__)
+typedef unsigned __int64 my_ulonglong;
+#else
+typedef unsigned long long my_ulonglong;
+#endif
+
+#define MYSQL_COUNT_ERROR (~(my_ulonglong) 0)
+
+typedef struct st_mysql_rows {
+ struct st_mysql_rows *next; /* list of rows */
+ MYSQL_ROW data;
+} MYSQL_ROWS;
+
+typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */
+
+typedef struct st_mysql_data {
+ my_ulonglong rows;
+ unsigned int fields;
+ MYSQL_ROWS *data;
+ MEM_ROOT alloc;
+} MYSQL_DATA;
+
+struct st_mysql_options {
+ unsigned int connect_timeout,client_flag;
+ my_bool compress,named_pipe;
+ unsigned int port;
+ char *host,*init_command,*user,*password,*unix_socket,*db;
+ char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name;
+ my_bool use_ssl; /* if to use SSL or not */
+ char *ssl_key; /* PEM key file */
+ char *ssl_cert; /* PEM cert file */
+ char *ssl_ca; /* PEM CA file */
+ char *ssl_capath; /* PEM directory of CA-s? */
+};
+
+enum mysql_option { MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS,
+ MYSQL_OPT_NAMED_PIPE, MYSQL_INIT_COMMAND,
+ MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
+ MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME};
+
+enum mysql_status { MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,
+ MYSQL_STATUS_USE_RESULT};
+
+typedef struct st_mysql {
+ NET net; /* Communication parameters */
+ gptr connector_fd; /* ConnectorFd for SSL */
+ char *host,*user,*passwd,*unix_socket,*server_version,*host_info,
+ *info,*db;
+ unsigned int port,client_flag,server_capabilities;
+ unsigned int protocol_version;
+ unsigned int field_count;
+ unsigned int server_status;
+ unsigned long thread_id; /* Id for connection in server */
+ my_ulonglong affected_rows;
+ my_ulonglong insert_id; /* id if insert on table with NEXTNR */
+ my_ulonglong extra_info; /* Used by mysqlshow */
+ unsigned long packet_length;
+ enum mysql_status status;
+ MYSQL_FIELD *fields;
+ MEM_ROOT field_alloc;
+ my_bool free_me; /* If free in mysql_close */
+ my_bool reconnect; /* set to 1 if automatic reconnect */
+ struct st_mysql_options options;
+ char scramble_buff[9];
+ struct charset_info_st *charset;
+ unsigned int server_language;
+} MYSQL;
+
+
+typedef struct st_mysql_res {
+ my_ulonglong row_count;
+ unsigned int field_count, current_field;
+ MYSQL_FIELD *fields;
+ MYSQL_DATA *data;
+ MYSQL_ROWS *data_cursor;
+ MEM_ROOT field_alloc;
+ MYSQL_ROW row; /* If unbuffered read */
+ MYSQL_ROW current_row; /* buffer to current row */
+ unsigned long *lengths; /* column lengths of current row */
+ MYSQL *handle; /* for unbuffered reads */
+ my_bool eof; /* Used my mysql_fetch_row */
+} MYSQL_RES;
+
+/* Functions to get information from the MYSQL and MYSQL_RES structures */
+/* Should definitely be used if one uses shared libraries */
+
+my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res);
+unsigned int STDCALL mysql_num_fields(MYSQL_RES *res);
+my_bool STDCALL mysql_eof(MYSQL_RES *res);
+MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res,
+ unsigned int fieldnr);
+MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res);
+MYSQL_ROWS * STDCALL mysql_row_tell(MYSQL_RES *res);
+unsigned int STDCALL mysql_field_tell(MYSQL_RES *res);
+
+unsigned int STDCALL mysql_field_count(MYSQL *mysql);
+my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql);
+my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql);
+unsigned int STDCALL mysql_errno(MYSQL *mysql);
+char * STDCALL mysql_error(MYSQL *mysql);
+char * STDCALL mysql_info(MYSQL *mysql);
+unsigned long STDCALL mysql_thread_id(MYSQL *mysql);
+const char * STDCALL mysql_character_set_name(MYSQL *mysql);
+
+MYSQL * STDCALL mysql_init(MYSQL *mysql);
+#ifdef HAVE_OPENSSL
+int STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
+ const char *cert, const char *ca,
+ const char *capath);
+char * STDCALL mysql_ssl_cipher(MYSQL *mysql);
+int STDCALL mysql_ssl_clear(MYSQL *mysql);
+#endif /* HAVE_OPENSSL */
+MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host,
+ const char *user, const char *passwd);
+my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
+ const char *passwd, const char *db);
+#if MYSQL_VERSION_ID >= 32200
+MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
+ const char *user,
+ const char *passwd,
+ const char *db,
+ unsigned int port,
+ const char *unix_socket,
+ unsigned int clientflag);
+#else
+MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
+ const char *user,
+ const char *passwd,
+ unsigned int port,
+ const char *unix_socket,
+ unsigned int clientflag);
+#endif
+void STDCALL mysql_close(MYSQL *sock);
+int STDCALL mysql_select_db(MYSQL *mysql, const char *db);
+int STDCALL mysql_query(MYSQL *mysql, const char *q);
+int STDCALL mysql_real_query(MYSQL *mysql, const char *q,
+ unsigned int length);
+int STDCALL mysql_create_db(MYSQL *mysql, const char *DB);
+int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
+int STDCALL mysql_shutdown(MYSQL *mysql);
+int STDCALL mysql_dump_debug_info(MYSQL *mysql);
+int STDCALL mysql_refresh(MYSQL *mysql,
+ unsigned int refresh_options);
+int STDCALL mysql_kill(MYSQL *mysql,unsigned long pid);
+int STDCALL mysql_ping(MYSQL *mysql);
+char * STDCALL mysql_stat(MYSQL *mysql);
+char * STDCALL mysql_get_server_info(MYSQL *mysql);
+char * STDCALL mysql_get_client_info(void);
+char * STDCALL mysql_get_host_info(MYSQL *mysql);
+unsigned int STDCALL mysql_get_proto_info(MYSQL *mysql);
+MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild);
+MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild);
+MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table,
+ const char *wild);
+MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql);
+MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql);
+MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql);
+int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option,
+ const char *arg);
+void STDCALL mysql_free_result(MYSQL_RES *result);
+void STDCALL mysql_data_seek(MYSQL_RES *result,
+ my_ulonglong offset);
+MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET);
+MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result,
+ MYSQL_FIELD_OFFSET offset);
+MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result);
+unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result);
+MYSQL_FIELD * STDCALL mysql_fetch_field(MYSQL_RES *result);
+unsigned long STDCALL mysql_escape_string(char *to,const char *from,
+ unsigned long from_length);
+unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql,
+ char *to,const char *from,
+ unsigned long length);
+void STDCALL mysql_debug(const char *debug);
+char * STDCALL mysql_odbc_escape_string(MYSQL *mysql,
+ char *to,
+ unsigned long to_length,
+ const char *from,
+ unsigned long from_length,
+ void *param,
+ char *
+ (*extend_buffer)
+ (void *, char *to,
+ unsigned long *length));
+void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
+unsigned int STDCALL mysql_thread_safe(void);
+
+
+#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
+
+/* new api functions */
+
+#define HAVE_MYSQL_REAL_CONNECT
+
+#ifndef MYSQL_SERVER
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+#endif
diff --git a/VC++Files/winmysqladmin/mysql_com.h b/VC++Files/winmysqladmin/mysql_com.h
new file mode 100644
index 00000000000..2a1471f735d
--- /dev/null
+++ b/VC++Files/winmysqladmin/mysql_com.h
@@ -0,0 +1,242 @@
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ 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., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA */
+
+/*
+** Common definition between mysql server & client
+*/
+
+#ifndef _mysql_com_h
+#define _mysql_com_h
+
+
+#define NAME_LEN 64 /* Field/table name length */
+#define HOSTNAME_LENGTH 60
+#define USERNAME_LENGTH 16
+
+#define LOCAL_HOST "localhost"
+#define LOCAL_HOST_NAMEDPIPE "."
+
+#if defined(__EMX__) || defined(__OS2__)
+#undef MYSQL_UNIX_ADDR
+#define MYSQL_OS2_ADDR "\\socket\\MySQL"
+#define MYSQL_UNIX_ADDR MYSQL_OS2_ADDR
+#endif
+#if defined(__WIN__) && !defined( _CUSTOMCONFIG_)
+#define MYSQL_NAMEDPIPE "MySQL"
+#define MYSQL_SERVICENAME "MySql"
+#endif /* __WIN__ */
+
+enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY,
+ COM_FIELD_LIST,COM_CREATE_DB,COM_DROP_DB,COM_REFRESH,
+ COM_SHUTDOWN,COM_STATISTICS,
+ COM_PROCESS_INFO,COM_CONNECT,COM_PROCESS_KILL,
+ COM_DEBUG,COM_PING,COM_TIME,COM_DELAYED_INSERT,
+ COM_CHANGE_USER, COM_BINLOG_DUMP,
+ COM_TABLE_DUMP};
+
+#define NOT_NULL_FLAG 1 /* Field can't be NULL */
+#define PRI_KEY_FLAG 2 /* Field is part of a primary key */
+#define UNIQUE_KEY_FLAG 4 /* Field is part of a unique key */
+#define MULTIPLE_KEY_FLAG 8 /* Field is part of a key */
+#define BLOB_FLAG 16 /* Field is a blob */
+#define UNSIGNED_FLAG 32 /* Field is unsigned */
+#define ZEROFILL_FLAG 64 /* Field is zerofill */
+#define BINARY_FLAG 128
+/* The following are only sent to new clients */
+#define ENUM_FLAG 256 /* field is an enum */
+#define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */
+#define TIMESTAMP_FLAG 1024 /* Field is a timestamp */
+#define SET_FLAG 2048 /* field is a set */
+#define PART_KEY_FLAG 16384 /* Intern; Part of some key */
+#define GROUP_FLAG 32768 /* Intern: Group field */
+#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */
+
+#define REFRESH_GRANT 1 /* Refresh grant tables */
+#define REFRESH_LOG 2 /* Start on new log file */
+#define REFRESH_TABLES 4 /* close all tables */
+#define REFRESH_HOSTS 8 /* Flush host cache */
+#define REFRESH_STATUS 16 /* Flush status variables */
+#define REFRESH_THREADS 32 /* Flush status variables */
+#define REFRESH_SLAVE 64 /* Reset master info and restart slave
+ thread */
+#define REFRESH_MASTER 128 /* Remove all bin logs in the index
+ and truncate the index */
+
+/* The following can't be set with mysql_refresh() */
+#define REFRESH_READ_LOCK 16384 /* Lock tables for read */
+#define REFRESH_FAST 32768 /* Intern flag */
+
+#define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */
+#define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */
+#define CLIENT_LONG_FLAG 4 /* Get all column flags */
+#define CLIENT_CONNECT_WITH_DB 8 /* One can specify db on connect */
+#define CLIENT_NO_SCHEMA 16 /* Don't allow database.table.column */
+#define CLIENT_COMPRESS 32 /* Can use compression protocol */
+#define CLIENT_ODBC 64 /* Odbc client */
+#define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */
+#define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */
+#define CLIENT_CHANGE_USER 512 /* Support the mysql_change_user() */
+#define CLIENT_INTERACTIVE 1024 /* This is an interactive client */
+#define CLIENT_SSL 2048 /* Switch to SSL after handshake */
+#define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */
+#define CLIENT_TRANSACTIONS 8196 /* Client knows about transactions */
+
+#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
+#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
+
+#define MYSQL_ERRMSG_SIZE 200
+#define NET_READ_TIMEOUT 30 /* Timeout on read */
+#define NET_WRITE_TIMEOUT 60 /* Timeout on write */
+#define NET_WAIT_TIMEOUT 8*60*60 /* Wait for new query */
+
+#ifndef Vio_defined
+#define Vio_defined
+#ifdef HAVE_VIO
+class Vio; /* Fill Vio class in C++ */
+#else
+struct st_vio; /* Only C */
+typedef struct st_vio Vio;
+#endif
+#endif
+
+typedef struct st_net {
+ Vio* vio;
+ my_socket fd; /* For Perl DBI/dbd */
+ int fcntl;
+ unsigned char *buff,*buff_end,*write_pos,*read_pos;
+ char last_error[MYSQL_ERRMSG_SIZE];
+ unsigned int last_errno,max_packet,timeout,pkt_nr;
+ unsigned char error;
+ my_bool return_errno,compress;
+ my_bool no_send_ok; /* needed if we are doing several
+ queries in one command ( as in LOAD TABLE ... FROM MASTER ),
+ and do not want to confuse the client with OK at the wrong time
+ */
+ unsigned long remain_in_buf,length, buf_length, where_b;
+ unsigned int *return_status;
+ unsigned char reading_or_writing;
+ char save_char;
+} NET;
+
+#define packet_error ((unsigned int) -1)
+
+enum enum_field_types { FIELD_TYPE_DECIMAL, FIELD_TYPE_TINY,
+ FIELD_TYPE_SHORT, FIELD_TYPE_LONG,
+ FIELD_TYPE_FLOAT, FIELD_TYPE_DOUBLE,
+ FIELD_TYPE_NULL, FIELD_TYPE_TIMESTAMP,
+ FIELD_TYPE_LONGLONG,FIELD_TYPE_INT24,
+ FIELD_TYPE_DATE, FIELD_TYPE_TIME,
+ FIELD_TYPE_DATETIME, FIELD_TYPE_YEAR,
+ FIELD_TYPE_NEWDATE,
+ FIELD_TYPE_ENUM=247,
+ FIELD_TYPE_SET=248,
+ FIELD_TYPE_TINY_BLOB=249,
+ FIELD_TYPE_MEDIUM_BLOB=250,
+ FIELD_TYPE_LONG_BLOB=251,
+ FIELD_TYPE_BLOB=252,
+ FIELD_TYPE_VAR_STRING=253,
+ FIELD_TYPE_STRING=254
+};
+
+#define FIELD_TYPE_CHAR FIELD_TYPE_TINY /* For compability */
+#define FIELD_TYPE_INTERVAL FIELD_TYPE_ENUM /* For compability */
+
+extern unsigned long max_allowed_packet;
+extern unsigned long net_buffer_length;
+
+#define net_new_transaction(net) ((net)->pkt_nr=0)
+
+int my_net_init(NET *net, Vio* vio);
+void net_end(NET *net);
+void net_clear(NET *net);
+int net_flush(NET *net);
+int my_net_write(NET *net,const char *packet,unsigned long len);
+int net_write_command(NET *net,unsigned char command,const char *packet,
+ unsigned long len);
+int net_real_write(NET *net,const char *packet,unsigned long len);
+unsigned int my_net_read(NET *net);
+
+struct rand_struct {
+ unsigned long seed1,seed2,max_value;
+ double max_value_dbl;
+};
+
+ /* The following is for user defined functions */
+
+enum Item_result {STRING_RESULT,REAL_RESULT,INT_RESULT};
+
+typedef struct st_udf_args
+{
+ unsigned int arg_count; /* Number of arguments */
+ enum Item_result *arg_type; /* Pointer to item_results */
+ char **args; /* Pointer to argument */
+ unsigned long *lengths; /* Length of string arguments */
+ char *maybe_null; /* Set to 1 for all maybe_null args */
+} UDF_ARGS;
+
+ /* This holds information about the result */
+
+typedef struct st_udf_init
+{
+ my_bool maybe_null; /* 1 if function can return NULL */
+ unsigned int decimals; /* for real functions */
+ unsigned int max_length; /* For string functions */
+ char *ptr; /* free pointer for function data */
+ my_bool const_item; /* 0 if result is independent of arguments */
+} UDF_INIT;
+
+ /* Constants when using compression */
+#define NET_HEADER_SIZE 4 /* standard header size */
+#define COMP_HEADER_SIZE 3 /* compression header extra size */
+
+ /* Prototypes to password functions */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void randominit(struct rand_struct *,unsigned long seed1,
+ unsigned long seed2);
+double rnd(struct rand_struct *);
+void make_scrambled_password(char *to,const char *password);
+void get_salt_from_password(unsigned long *res,const char *password);
+void make_password_from_salt(char *to, unsigned long *hash_res);
+char *scramble(char *to,const char *message,const char *password,
+ my_bool old_ver);
+my_bool check_scramble(const char *, const char *message,
+ unsigned long *salt,my_bool old_ver);
+char *get_tty_password(char *opt_message);
+void hash_password(unsigned long *result, const char *password);
+#ifdef __cplusplus
+}
+#endif
+
+/* Some other useful functions */
+
+void my_init(void);
+void load_defaults(const char *conf_file, const char **groups,
+ int *argc, char ***argv);
+
+#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */
+
+#ifdef __WIN__
+#define socket_errno WSAGetLastError()
+#else
+#define socket_errno errno
+#endif
+
+#endif
diff --git a/VC++Files/winmysqladmin/mysql_version.h b/VC++Files/winmysqladmin/mysql_version.h
new file mode 100644
index 00000000000..1f868704fe8
--- /dev/null
+++ b/VC++Files/winmysqladmin/mysql_version.h
@@ -0,0 +1,20 @@
+/* Copyright Abandoned 1996,1999 TCX DataKonsult AB & Monty Program KB & Detron HB
+ This file is public domain and comes with NO WARRANTY of any kind */
+
+/* Version numbers for protocol & mysqld */
+
+#ifdef _CUSTOMCONFIG_
+ #include <custom_conf.h>
+#else
+#define PROTOCOL_VERSION 10
+#define MYSQL_SERVER_VERSION "3.23.22-beta"
+#define FRM_VER 6
+#define MYSQL_VERSION_ID 32322
+#define MYSQL_PORT 3306
+#define MYSQL_UNIX_ADDR "/tmp/mysql.sock"
+
+/* mysqld compile time options */
+#ifndef MYSQL_CHARSET
+#define MYSQL_CHARSET "latin1"
+#endif
+#endif
diff --git a/VC++Files/winmysqladmin/winmysqladmin.cpp b/VC++Files/winmysqladmin/winmysqladmin.cpp
new file mode 100644
index 00000000000..591b7518fa3
--- /dev/null
+++ b/VC++Files/winmysqladmin/winmysqladmin.cpp
@@ -0,0 +1,38 @@
+//---------------------------------------------------------------------------
+#include <vcl.h>
+#pragma hdrstop
+HINSTANCE g_hinst;
+USERES("winmysqladmin.res");
+USEFORM("main.cpp", Form1);
+USEFORM("initsetup.cpp", Form2);
+USEFORM("db.cpp", dbfrm);
+USELIB("lib\mysqlclient.lib");
+USELIB("lib\myisammrg.lib");
+USELIB("lib\heap.lib");
+USELIB("lib\isam.lib");
+USELIB("lib\merge.lib");
+USELIB("lib\myisam.lib");
+USELIB("lib\mysys.lib");
+USELIB("lib\regex.lib");
+USELIB("lib\strings.lib");
+USELIB("lib\zlib.lib");
+//---------------------------------------------------------------------------
+WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
+{
+ try
+ {
+ Application->Initialize();
+ Application->HelpFile = "C:\\mysql\\bin\\WINMYSQLADMIN.HLP";
+ Application->Title = "WinMySQLadmin 1.0";
+ Application->CreateForm(__classid(TForm1), &Form1);
+ Application->CreateForm(__classid(TForm2), &Form2);
+ Application->CreateForm(__classid(Tdbfrm), &dbfrm);
+ Application->Run();
+ }
+ catch (Exception &exception)
+ {
+ Application->ShowException(&exception);
+ }
+ return 0;
+}
+//---------------------------------------------------------------------------
diff --git a/VC++Files/zlib/zlib.dsp b/VC++Files/zlib/zlib.dsp
index 5a596b41f32..b46afad005c 100644
--- a/VC++Files/zlib/zlib.dsp
+++ b/VC++Files/zlib/zlib.dsp
@@ -65,8 +65,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /ZI /Od /D "_DEBUG" /D "__WIN32__" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /YX
+# ADD CPP /nologo /G6 /MTd /W3 /Zi /Od /D "_DEBUG" /D "__WIN32__" /D "_WINDOWS" /FD /c
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
diff --git a/acinclude.m4 b/acinclude.m4
index 9c5fbfbbb78..2b6c8cbc390 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -771,7 +771,7 @@ AC_MSG_CHECKING(for OpenSSL)
AC_DEFUN(MYSQL_CHECK_MYSQLFS, [
AC_ARG_WITH([mysqlfs],
- [\
+ [
--with-mysqlfs Include the corba-based MySQL file system],
[mysqlfs="$withval"],
[mysqlfs=no])
@@ -821,7 +821,7 @@ AC_SUBST(orbit_idl)
])
AC_DEFUN([MYSQL_CHECK_ISAM], [
- AC_ARG_WITH([isam], [\
+ AC_ARG_WITH([isam], [
--without-isam Disable the ISAM table type],
[with_isam="$withval"],
[with_isam=yes])
@@ -1210,10 +1210,12 @@ AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
changequote(, )dnl
hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
changequote([, ])dnl
- if test "$GCC" = yes; then
- ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__
- fi
- ;;
+ if test "$GCC" = yes; then
+ if $CC -v 2>&1 | grep 'version 2.95' > /dev/null 2>&1; then
+ ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__
+ fi
+ fi
+ ;;
# IRIX 6.2 and later require cc -n32.
changequote(, )dnl
irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
diff --git a/bdb/dist/acconfig.h b/bdb/dist/acconfig.h
index e30d0e3d2c2..19f85a460d9 100644
--- a/bdb/dist/acconfig.h
+++ b/bdb/dist/acconfig.h
@@ -52,6 +52,7 @@
#undef HAVE_MUTEX_WIN16
#undef HAVE_MUTEX_WIN32
#undef HAVE_MUTEX_X86_GCC_ASSEMBLY
+#undef HAVE_MUTEX_X86_64_GCC_ASSEMBLY
/* Define if building on QNX. */
#undef HAVE_QNX
diff --git a/bdb/dist/aclocal/mutex.m4 b/bdb/dist/aclocal/mutex.m4
index 5f16ee0e114..a6b1fa1a053 100644
--- a/bdb/dist/aclocal/mutex.m4
+++ b/bdb/dist/aclocal/mutex.m4
@@ -314,6 +314,18 @@ AC_TRY_RUN([main(){
}], [db_cv_mutex="x86/gcc-assembly"])
fi
+dnl x86_64/gcc: FreeBSD, NetBSD, BSD/OS, Linux
+if test "$db_cv_mutex" = no; then
+AC_TRY_RUN([main(){
+#if defined(x86_64) || defined(__x86_64__)
+#if defined(__GNUC__)
+ exit(0);
+#endif
+#endif
+ exit(1);
+}], [db_cv_mutex="x86_64/gcc-assembly"])
+fi
+
dnl ia86/gcc: Linux
if test "$db_cv_mutex" = no; then
AC_TRY_RUN([main(){
diff --git a/bdb/include/mutex.h b/bdb/include/mutex.h
index a8a41451012..4c1b265355d 100644
--- a/bdb/include/mutex.h
+++ b/bdb/include/mutex.h
@@ -611,6 +611,28 @@ typedef unsigned char tsl_t;
#endif
#endif
+#ifdef HAVE_MUTEX_X86_64_GCC_ASSEMBLY
+typedef unsigned char tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/*
+ * For gcc/x86, 0 is clear, 1 is set.
+ */
+#define MUTEX_SET(tsl) ({ \
+ register tsl_t *__l = (tsl); \
+ int __r; \
+ asm volatile("mov $1,%%rax; lock; xchgb %1,%%al; xor $1,%%rax"\
+ : "=&a" (__r), "=m" (*__l) \
+ : "1" (*__l) \
+ ); \
+ __r & 1; \
+})
+
+#define MUTEX_UNSET(tsl) (*(tsl) = 0)
+#define MUTEX_INIT(tsl) MUTEX_UNSET(tsl)
+#endif
+#endif
+
/*
* Mutex alignment defaults to one byte.
*
diff --git a/client/client_priv.h b/client/client_priv.h
index ae5556cac35..acf9455bf9c 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -19,8 +19,8 @@
#include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
-#include <mysql_embed.h>
#include <mysql.h>
+#include <mysql_embed.h>
#include <errmsg.h>
#include <my_getopt.h>
@@ -37,4 +37,4 @@ enum options { OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET,
OPT_SELECT_LIMIT, OPT_MAX_JOIN_SIZE, OPT_SSL_SSL,
OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA, OPT_SSL_CAPATH,
OPT_SSL_CIPHER, OPT_SHUTDOWN_TIMEOUT, OPT_LOCAL_INFILE,
- OPT_PROMPT, OPT_IGN_LINES };
+ OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION };
diff --git a/client/mysql.cc b/client/mysql.cc
index 1f710580991..7fd221f479c 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -40,7 +40,7 @@
#include <signal.h>
#include <violite.h>
-const char *VER= "12.10";
+const char *VER= "12.12";
/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024
@@ -112,6 +112,7 @@ typedef struct st_status
static HashTable ht;
+static char **defaults_argv;
enum enum_info_type { INFO_INFO,INFO_ERROR,INFO_RESULT};
typedef enum enum_info_type INFO_TYPE;
@@ -186,7 +187,7 @@ static void safe_put_field(const char *pos,ulong length);
static void xmlencode_print(const char *src, uint length);
static void init_pager();
static void end_pager();
-static void init_tee();
+static int init_tee(char *);
static void end_tee();
static const char* construct_prompt();
static void init_username();
@@ -317,15 +318,19 @@ int main(int argc,char *argv[])
status.add_to_history=1;
status.exit_status=1;
load_defaults("my",load_default_groups,&argc,&argv);
+ defaults_argv=argv;
if (get_options(argc, (char **) argv))
{
+ free_defaults(defaults_argv);
my_end(0);
exit(1);
}
- free_defaults(argv);
if (status.batch && !status.line_buff &&
!(status.line_buff=batch_readline_init(max_allowed_packet+512,stdin)))
+ {
+ free_defaults(defaults_argv);
exit(1);
+ }
glob_buffer.realloc(512);
mysql_server_init(0, NULL, (char**) server_default_groups);
completion_hash_init(&ht, 128);
@@ -344,7 +349,7 @@ int main(int argc,char *argv[])
signal(SIGQUIT, mysql_end); // Catch SIGQUIT to clean up
/*
- ** Run in interactive mode like the ingres/postgres monitor
+ Run in interactive mode like the ingres/postgres monitor
*/
put_info("Welcome to the MySQL monitor. Commands end with ; or \\g.",
@@ -358,7 +363,7 @@ int main(int argc,char *argv[])
initialize_readline(my_progname);
if (!status.batch && !quick && !opt_html && !opt_xml)
{
- /*read-history from file, default ~/.mysql_history*/
+ /* read-history from file, default ~/.mysql_history*/
if (getenv("MYSQL_HISTFILE"))
histfile=my_strdup(getenv("MYSQL_HISTFILE"),MYF(MY_WME));
else if (getenv("HOME"))
@@ -392,13 +397,6 @@ int main(int argc,char *argv[])
sig_handler mysql_end(int sig)
{
mysql_close(&mysql);
-#ifdef HAVE_OPENSSL
- my_free(opt_ssl_key,MYF(MY_ALLOW_ZERO_PTR));
- my_free(opt_ssl_cert,MYF(MY_ALLOW_ZERO_PTR));
- my_free(opt_ssl_ca,MYF(MY_ALLOW_ZERO_PTR));
- my_free(opt_ssl_capath,MYF(MY_ALLOW_ZERO_PTR));
- my_free(opt_ssl_cipher,MYF(MY_ALLOW_ZERO_PTR));
-#endif
#ifdef HAVE_READLINE
if (!status.batch && !quick && !opt_html && !opt_xml)
{
@@ -428,6 +426,7 @@ sig_handler mysql_end(int sig)
my_free(default_prompt,MYF(MY_ALLOW_ZERO_PTR));
my_free(current_prompt,MYF(MY_ALLOW_ZERO_PTR));
mysql_server_end();
+ free_defaults(defaults_argv);
my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
exit(status.exit_status);
}
@@ -439,7 +438,7 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0},
{"auto-rehash", OPT_AUTO_REHASH,
"Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash.",
- (gptr*) &rehash, (gptr*) &rehash, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ (gptr*) &rehash, (gptr*) &rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"no-auto-rehash", 'A',
"No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect. WARNING: options deprecated; use --disable-auto-rehash instead.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -489,7 +488,7 @@ static struct my_option my_long_options[] =
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"line-numbers", OPT_LINE_NUMBERS, "Write line numbers for errors.",
(gptr*) &line_numbers, (gptr*) &line_numbers, 0, GET_BOOL,
- NO_ARG, 0, 0, 0, 0, 0, 0},
+ NO_ARG, 1, 0, 0, 0, 0, 0},
{"skip-line-numbers", 'L', "Don't write line number for errors. WARNING: -L is deprecated, use long version of this option instead.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#ifndef __WIN__
@@ -591,7 +590,7 @@ static void usage(int version)
if (version)
return;
printf("\
-Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB\n\
+Copyright (C) 2002 MySQL AB\n\
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
and you are welcome to modify and redistribute it under the GPL license\n");
printf("Usage: %s [OPTIONS] [database]\n", my_progname);
@@ -620,11 +619,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
end_tee();
}
else
- if (!opt_outfile)
- {
- strmov(outfile, argument);
- init_tee();
- }
+ opt_outfile= init_tee(argument);
break;
case OPT_NOTEE:
printf("WARNING: option deprecated; use --disable-tee instead.\n");
@@ -714,7 +709,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case '?':
usage(0);
exit(0);
-#include "sslopt-case.h"
}
return 0;
}
@@ -748,6 +742,7 @@ static int get_options(int argc, char **argv)
strmov(pager, "stdout");
opt_nopager= 1;
opt_outfile= 0;
+ connect_flag= 0; /* Not in interactive mode */
}
if (default_charset)
{
@@ -828,8 +823,10 @@ static int read_lines(bool execute_commands)
line[0] == 0))
continue; // Skip comment lines
- /* Check if line is a mysql command line */
- /* (We want to allow help, print and clear anywhere at line start */
+ /*
+ Check if line is a mysql command line
+ (We want to allow help, print and clear anywhere at line start
+ */
if (execute_commands && (named_cmds || glob_buffer.is_empty())
&& !in_string && (com=find_command(line,0)))
{
@@ -1014,20 +1011,20 @@ static bool add_line(String &buffer,char *line,char *in_string)
return 0;
}
-/* **************************************************************** */
-/* */
-/* Interface to Readline Completion */
-/* */
-/* **************************************************************** */
+/*****************************************************************
+ Interface to Readline Completion
+******************************************************************/
#ifdef HAVE_READLINE
static char *new_command_generator(char *text, int);
static char **new_mysql_completion (char *text, int start, int end);
-/* Tell the GNU Readline library how to complete. We want to try to complete
- on command names if this is the first word in the line, or on filenames
- if not. */
+/*
+ Tell the GNU Readline library how to complete. We want to try to complete
+ on command names if this is the first word in the line, or on filenames
+ if not.
+*/
char **no_completion (char *text __attribute__ ((unused)),
char *word __attribute__ ((unused)))
@@ -1046,11 +1043,12 @@ static void initialize_readline (char *name)
rl_completion_entry_function=(Function *) no_completion;
}
-/* Attempt to complete on the contents of TEXT. START and END show the
- region of TEXT that contains the word to complete. We can use the
- entire line in case we want to do some simple parsing. Return the
- array of matches, or NULL if there aren't any. */
-
+/*
+ Attempt to complete on the contents of TEXT. START and END show the
+ region of TEXT that contains the word to complete. We can use the
+ entire line in case we want to do some simple parsing. Return the
+ array of matches, or NULL if there aren't any.
+*/
static char **new_mysql_completion (char *text,
int start __attribute__((unused)),
@@ -1070,67 +1068,72 @@ static char *new_command_generator(char *text,int state)
static entry *e;
static uint i;
- if (!state) {
+ if (!state)
textlen=(uint) strlen(text);
- }
- if (textlen>0) { /* lookup in the hash */
- if (!state) {
+ if (textlen>0)
+ { /* lookup in the hash */
+ if (!state)
+ {
uint len;
b = find_all_matches(&ht,text,(uint) strlen(text),&len);
- if (!b) {
+ if (!b)
return NullS;
- }
e = b->pData;
}
- while (e) {
+ if (e)
+ {
ptr= strdup(e->str);
e = e->pNext;
return ptr;
}
- } else { /* traverse the entire hash, ugly but works */
+ }
+ else
+ { /* traverse the entire hash, ugly but works */
- if (!state) {
- i=0;
+ if (!state)
+ {
/* find the first used bucket */
- while (i<ht.nTableSize) {
- if (ht.arBuckets[i]) {
+ for (i=0 ; i < ht.nTableSize ; i++)
+ {
+ if (ht.arBuckets[i])
+ {
b = ht.arBuckets[i];
e = b->pData;
break;
}
- i++;
}
}
ptr= NullS;
- while (e && !ptr) { /* find valid entry in bucket */
- if ((uint) strlen(e->str)==b->nKeyLength) {
+ while (e && !ptr)
+ { /* find valid entry in bucket */
+ if ((uint) strlen(e->str) == b->nKeyLength)
ptr = strdup(e->str);
- }
/* find the next used entry */
e = e->pNext;
- if (!e) { /* find the next used bucket */
+ if (!e)
+ { /* find the next used bucket */
b = b->pNext;
- if (!b) {
- i++;
- while (i<ht.nTableSize) {
- if (ht.arBuckets[i]) {
+ if (!b)
+ {
+ for (i++ ; i<ht.nTableSize; i++)
+ {
+ if (ht.arBuckets[i])
+ {
b = ht.arBuckets[i];
e = b->pData;
break;
}
- i++;
}
- } else {
- e = b->pData;
}
+ else
+ e = b->pData;
}
}
- if (ptr) {
+ if (ptr)
return ptr;
- }
}
return NullS;
}
@@ -1265,16 +1268,13 @@ You can turn off this feature to get a quicker startup with -A\n\n");
DBUG_VOID_RETURN;
}
-
/* for gnu readline */
#ifndef HAVE_INDEX
-#ifdef __cplusplus
extern "C" {
-#endif
-extern char *index(const char *,pchar c),*rindex(const char *,pchar);
+extern char *index(const char *,int c),*rindex(const char *,int);
-char *index(const char *s,pchar c)
+char *index(const char *s,int c)
{
for (;;)
{
@@ -1283,7 +1283,7 @@ char *index(const char *s,pchar c)
}
}
-char *rindex(const char *s,pchar c)
+char *rindex(const char *s,int c)
{
reg3 char *t;
@@ -1291,19 +1291,19 @@ char *rindex(const char *s,pchar c)
do if (*s == (char) c) t = (char*) s; while (*s++);
return (char*) t;
}
-#ifdef __cplusplus
}
#endif
-#endif
#endif /* HAVE_READLINE */
+
static int reconnect(void)
{
if (!status.batch)
{
put_info("No connection. Trying to reconnect...",INFO_INFO);
(void) com_connect((String *) 0, 0);
- if(rehash) com_rehash(NULL, NULL);
+ if (rehash)
+ com_rehash(NULL, NULL);
}
if (!connected)
return put_info("Can't connect to the server\n",INFO_ERROR);
@@ -1321,7 +1321,9 @@ com_help (String *buffer __attribute__((unused)),
{
reg1 int i;
- put_info("\nMySQL commands:",INFO_INFO);
+ put_info("\nFull documentation of MySQL is available at\nhttp://www.mysql.com/documentation/mysql/bychapter/\n", INFO_INFO);
+ put_info("For technical support contracts, visit https://order.mysql.com/\n", INFO_INFO);
+ put_info("MySQL commands:",INFO_INFO);
if (!named_cmds)
put_info("Note that all text commands must be first on line and end with ';'",INFO_INFO);
for (i = 0; commands[i].name; i++)
@@ -1350,10 +1352,10 @@ com_clear(String *buffer,char *line __attribute__((unused)))
/*
-** Execute command
-** Returns: 0 if ok
-** -1 if not fatal error
-** 1 if fatal error
+ Execute command
+ Returns: 0 if ok
+ -1 if not fatal error
+ 1 if fatal error
*/
@@ -1371,7 +1373,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
old_buffer.copy();
}
- /* Remove garbage for nicer messages */
+ /* Remove garbage for nicer messages */
LINT_INIT(buff[0]);
remove_cntrl(*buffer);
@@ -1392,7 +1394,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
if (skip_updates &&
(buffer->length() < 4 || my_sortcmp(system_charset_info,buffer->ptr(),
- "SET ",4)))
+ "SET ",4)))
{
(void) put_info("Ignoring query to other database",INFO_INFO);
return 0;
@@ -1490,7 +1492,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
static void init_pager()
{
-#if !defined( __WIN__) && !defined( OS2)
+#if !defined( __WIN__) && !defined( OS2) && (!defined(HAVE_mit_thread) || !defined(THREAD))
if (!opt_nopager)
{
if (!(PAGER= popen(pager, "w")))
@@ -1506,26 +1508,27 @@ static void init_pager()
static void end_pager()
{
-#if !defined( __WIN__) && !defined( OS2)
+#if !defined( __WIN__) && !defined( OS2) && !(defined(HAVE_mit_thread) && defined(THREAD))
if (!opt_nopager)
pclose(PAGER);
#endif
}
-static void init_tee()
+
+static int init_tee(char* newfile)
{
+ FILE* new_outfile;
+ if (!(new_outfile= my_fopen(newfile, O_APPEND | O_WRONLY, MYF(MY_WME))))
+ return 0;
if (opt_outfile)
end_tee();
- if (!(OUTFILE= my_fopen(outfile, O_APPEND | O_WRONLY, MYF(MY_WME))))
- {
- opt_outfile= 0;
- init_pager();
- return;
- }
- opt_outfile= 1;
+ OUTFILE = new_outfile;
+ strmake(outfile,newfile,FN_REFLEN-1);
tee_fprintf(stdout, "Logging to file '%s'\n", outfile);
+ return 1;
}
+
static void end_tee()
{
my_fclose(OUTFILE, MYF(0));
@@ -1770,7 +1773,8 @@ safe_put_field(const char *pos,ulong length)
#ifdef USE_MB
int l;
if (use_mb(system_charset_info) &&
- (l = my_ismbchar(system_charset_info, pos, end))) {
+ (l = my_ismbchar(system_charset_info, pos, end)))
+ {
while (l--)
tee_putc(*pos++, PAGER);
pos--;
@@ -1837,30 +1841,40 @@ com_tee(String *buffer, char *line __attribute__((unused)))
if (!strlen(outfile))
{
printf("No previous outfile available, you must give a filename!\n");
- opt_outfile= 0;
return 0;
}
+ else if (opt_outfile)
+ {
+ tee_fprintf(stdout, "Currently logging to file '%s'\n", outfile);
+ return 0;
+ }
+ else
+ param = outfile; //resume using the old outfile
}
- else
- {
- while (my_isspace(system_charset_info,*param))
- param++;
- end= strmake(file_name, param, sizeof(file_name) - 1);
- while (end > file_name && (my_isspace(system_charset_info,end[-1]) ||
- my_iscntrl(system_charset_info,end[-1])))
- end--;
- end[0]= 0;
- strmov(outfile, file_name);
- }
- if (!strlen(outfile))
+
+ /* eliminate the spaces before the parameters */
+ while (my_isspace(system_charset_info,*param))
+ param++;
+ end= strmake(file_name, param, sizeof(file_name) - 1);
+ /* remove end space from command line */
+ while (end > file_name && (my_isspace(system_charset_info,end[-1]) ||
+ my_iscntrl(system_charset_info,end[-1])))
+ end--;
+ end[0]= 0;
+ if (end == file_name)
{
printf("No outfile specified!\n");
return 0;
}
- init_tee();
+ opt_outfile= init_tee(file_name);
+ if (opt_outfile)
+ tee_fprintf(stdout, "Logging to file '%s'\n", outfile);
+ else
+ tee_fprintf(stdout, "Error logging to file '%s'\n",file_name);
return 0;
}
+
static int
com_notee(String *buffer __attribute__((unused)),
char *line __attribute__((unused)))
@@ -1872,7 +1886,7 @@ com_notee(String *buffer __attribute__((unused)),
}
/*
-** Sorry, this command is not available in Windows.
+ Sorry, this command is not available in Windows.
*/
#ifndef __WIN__
@@ -1929,7 +1943,7 @@ com_nopager(String *buffer __attribute__((unused)),
/*
-** Sorry, you can't send the result to an editor in Win32
+ Sorry, you can't send the result to an editor in Win32
*/
#ifndef __WIN__
@@ -2005,9 +2019,11 @@ com_shell(String *buffer, char *line __attribute__((unused)))
put_info("Usage: \\! shell-command", INFO_ERROR);
return -1;
}
- /* The output of the shell command does not
- get directed to the pager or the outfile */
- if(system(shell_cmd) == -1)
+ /*
+ The output of the shell command does not
+ get directed to the pager or the outfile
+ */
+ if (system(shell_cmd) == -1)
{
put_info(strerror(errno), INFO_ERROR, errno);
return -1;
@@ -2199,6 +2215,9 @@ sql_real_connect(char *host,char *database,char *user,char *password,
if (using_opt_local_infile)
mysql_options(&mysql,MYSQL_OPT_LOCAL_INFILE, (char*) &opt_local_infile);
#ifdef HAVE_OPENSSL
+ if (opt_ssl_key || opt_ssl_cert || opt_ssl_ca || opt_ssl_capath ||
+ opt_ssl_cipher)
+ opt_use_ssl= 1;
if (opt_use_ssl)
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
@@ -2329,11 +2348,11 @@ com_status(String *buffer __attribute__((unused)),
if ((status=mysql_stat(&mysql)) && !mysql_error(&mysql)[0])
{
- char *pos,buff[40];
ulong sec;
- pos=strchr(status,' ');
- *pos++=0;
- tee_fprintf(stdout, "%s\t\t\t", status); /* print label */
+ char buff[40];
+ const char *pos= strchr(status,' ');
+ /* print label */
+ tee_fprintf(stdout, "%.*s\t\t\t", (int) (pos-status), status);
if ((status=str2int(pos,10,0,LONG_MAX,(long*) &sec)))
{
nice_time((double) sec,buff,0);
@@ -2404,7 +2423,7 @@ put_info(const char *str,INFO_TYPE info_type,uint error)
}
if (info_type == INFO_ERROR)
{
- if(!opt_nobeep)
+ if (!opt_nobeep)
putchar('\007'); /* This should make a bell */
vidattr(A_STANDOUT);
if (error)
@@ -2487,9 +2506,11 @@ void tee_putc(int c, FILE *file)
#include <time.h>
#else
#include <sys/times.h>
+#ifdef _SC_CLK_TCK // For mit-pthreads
#undef CLOCKS_PER_SEC
#define CLOCKS_PER_SEC (sysconf(_SC_CLK_TCK))
#endif
+#endif
static ulong start_timer(void)
{
@@ -2548,18 +2569,20 @@ static void mysql_end_timer(ulong start_time,char *buff)
strmov(strend(buff),")");
}
-static const char* construct_prompt() {
+static const char* construct_prompt()
+{
//erase the old prompt
processed_prompt.free();
//get the date struct
time_t lclock = time(NULL);
struct tm *t = localtime(&lclock);
//parse thru the settings for the prompt
- for (char *c = current_prompt;*c;*c++) {
- if (*c != PROMPT_CHAR) {
+ for (char *c = current_prompt; *c ; *c++)
+ {
+ if (*c != PROMPT_CHAR)
processed_prompt.append(*c);
- }
- else {
+ else
+ {
switch (*++c) {
case '\0':
//stop it from going beyond if ends with %
@@ -2681,13 +2704,16 @@ static const char* construct_prompt() {
return processed_prompt.ptr();
}
-static void add_int_to_prompt(int toadd) {
+
+static void add_int_to_prompt(int toadd)
+{
char buffer[16];
int10_to_str(toadd,buffer,10);
processed_prompt.append(buffer);
}
-static void init_username() {
+static void init_username()
+{
my_free(full_username,MYF(MY_ALLOW_ZERO_PTR));
my_free(part_username,MYF(MY_ALLOW_ZERO_PTR));
@@ -2695,22 +2721,21 @@ static void init_username() {
LINT_INIT(result);
if (!mysql_query(&mysql,"select USER()") &&
(result=mysql_use_result(&mysql)))
- {
- MYSQL_ROW cur=mysql_fetch_row(result);
- full_username=my_strdup(cur[0],MYF(MY_WME));
- part_username=my_strdup(strtok(cur[0],"@"),MYF(MY_WME));
- (void) mysql_fetch_row(result); // Read eof
- }
+ {
+ MYSQL_ROW cur=mysql_fetch_row(result);
+ full_username=my_strdup(cur[0],MYF(MY_WME));
+ part_username=my_strdup(strtok(cur[0],"@"),MYF(MY_WME));
+ (void) mysql_fetch_row(result); // Read eof
+ }
}
-static int
-com_prompt(String *buffer, char *line __attribute__((unused))) {
+static int com_prompt(String *buffer, char *line)
+{
+ char *ptr=strchr(line, ' ');
prompt_counter = 0;
my_free(current_prompt,MYF(MY_ALLOW_ZERO_PTR));
- current_prompt=my_strdup(strchr(line, ' ') ?
- strchr(line, ' ')+1 :
- default_prompt,MYF(MY_WME));
- if (!strchr(line, ' '))
+ current_prompt=my_strdup(ptr ? ptr+1 : default_prompt,MYF(MY_WME));
+ if (!ptr)
tee_fprintf(stdout, "Returning to default PROMPT of %s\n", default_prompt);
else
tee_fprintf(stdout, "PROMPT set to '%s'\n", current_prompt);
diff --git a/client/mysqladmin.c b/client/mysqladmin.c
index fd2a17eee31..cdca59574f7 100644
--- a/client/mysqladmin.c
+++ b/client/mysqladmin.c
@@ -22,9 +22,10 @@
#ifdef THREAD
#include <my_pthread.h> /* because of signal() */
#endif
+#include <sys/stat.h>
-#define ADMIN_VERSION "8.35"
-#define MAX_MYSQL_VAR 64
+#define ADMIN_VERSION "8.37"
+#define MAX_MYSQL_VAR 128
#define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */
#define MAX_TRUNC_LENGTH 3
@@ -36,13 +37,17 @@ static int interval=0;
static my_bool option_force=0,interrupted=0,new_line=0,
opt_compress=0, opt_relative=0, opt_verbose=0, opt_vertical=0,
tty_password=0;
-static uint tcp_port = 0, option_wait = 0, option_silent=0;
+static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations,
+ opt_count_iterations= 0;
static ulong opt_connect_timeout, opt_shutdown_timeout;
static my_string unix_port=0;
-/* When using extended-status relatively, ex_val_max_len is the estimated
- maximum length for any relative value printed by extended-status. The
- idea is to try to keep the length of output as short as possible. */
+/*
+ When using extended-status relatively, ex_val_max_len is the estimated
+ maximum length for any relative value printed by extended-status. The
+ idea is to try to keep the length of output as short as possible.
+*/
+
static uint ex_val_max_len[MAX_MYSQL_VAR];
static my_bool ex_status_printed = 0; /* First output is not relative. */
static uint ex_var_count, max_var_length, max_val_length;
@@ -65,7 +70,8 @@ static void print_relative_header();
static void print_relative_line();
static void truncate_names();
static my_bool get_pidfile(MYSQL *mysql, char *pidfile);
-static void wait_pidfile(char *pidfile);
+static void wait_pidfile(char *pidfile, time_t last_modified,
+ struct stat *pidfile_status);
static void store_values(MYSQL_RES *result);
/*
@@ -100,6 +106,10 @@ static TYPELIB command_typelib=
static struct my_option my_long_options[] =
{
+ {"count", 'c',
+ "Number of iterations to make. This works with -i (--sleep) only",
+ (gptr*) &nr_iterations, (gptr*) &nr_iterations, 0, GET_UINT,
+ REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"force", 'f',
@@ -174,6 +184,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
int error = 0;
switch(optid) {
+ case 'c':
+ opt_count_iterations= 1;
+ break;
case 'p':
if (argument)
{
@@ -211,7 +224,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
else
option_wait= ~0;
break;
-#include "sslopt-case.h"
case '?':
case 'I': /* Info */
error++;
@@ -235,19 +247,17 @@ int main(int argc,char *argv[])
{
int error, ho_error;
MYSQL mysql;
- char **commands;
- char** save_argv;
+ char **commands, **save_argv;
+
MY_INIT(argv[0]);
mysql_init(&mysql);
load_defaults("my",load_default_groups,&argc,&argv);
- save_argv = argv;
- /* Sasha: with the change to handle_options() we now need to do this fix
- with save_argv in all client utilities. The problem is that
- handle_options may modify argv, and that wreaks havoc with
- free_defaults()
- */
+ save_argv = argv; /* Save for free_defaults */
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
+ {
+ free_defaults(save_argv);
exit(ho_error);
+ }
if (argc == 0)
{
@@ -269,16 +279,19 @@ int main(int argc,char *argv[])
mysql_options(&mysql,MYSQL_OPT_CONNECT_TIMEOUT, (char*) &tmp);
}
#ifdef HAVE_OPENSSL
+ if (opt_ssl_key || opt_ssl_cert || opt_ssl_ca || opt_ssl_capath ||
+ opt_ssl_cipher)
+ opt_use_ssl= 1;
if (opt_use_ssl)
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
-#endif /* HAVE_OPENSSL */
+#endif
if (sql_connect(&mysql, option_wait))
error = 1;
else
{
error = 0;
- while (!interrupted)
+ while (!interrupted && (!opt_count_iterations || nr_iterations))
{
new_line = 0;
if ((error=execute_commands(&mysql,argc,commands)))
@@ -305,6 +318,8 @@ int main(int argc,char *argv[])
sleep(interval);
if (new_line)
puts("");
+ if (opt_count_iterations)
+ nr_iterations--;
}
else
break;
@@ -443,11 +458,18 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
case ADMIN_SHUTDOWN:
{
char pidfile[FN_REFLEN];
- my_bool got_pidfile=0;
- /* Only wait for pidfile on local connections */
- /* If pidfile doesn't exist, continue without pid file checking */
- if (mysql->unix_socket)
- got_pidfile= !get_pidfile(mysql, pidfile);
+ my_bool got_pidfile= 0;
+ time_t last_modified= 0;
+ struct stat pidfile_status;
+
+ /*
+ Only wait for pidfile on local connections
+ If pidfile doesn't exist, continue without pid file checking
+ */
+ if (mysql->unix_socket && (got_pidfile= !get_pidfile(mysql, pidfile)) &&
+ !stat(pidfile, &pidfile_status))
+ last_modified= pidfile_status.st_mtime;
+
if (mysql_shutdown(mysql))
{
my_printf_error(0,"shutdown failed; error: '%s'",MYF(ME_BELL),
@@ -459,7 +481,9 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
{
if (opt_verbose)
printf("Shutdown signal sent to server; Waiting for pid file to disappear\n");
- wait_pidfile(pidfile); /* Wait until pid file is gone */
+
+ /* Wait until pid file is gone */
+ wait_pidfile(pidfile, last_modified, &pidfile_status);
}
break;
}
@@ -588,7 +612,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
MYSQL_ROW row;
new_line=1;
- if (mysql_query(mysql,"show variables") ||
+ if (mysql_query(mysql,"show /*!40003 GLOBAL */ variables") ||
!(res=mysql_store_result(mysql)))
{
my_printf_error(0,"unable to show variables; error: '%s'",MYF(ME_BELL),
@@ -1089,19 +1113,28 @@ static my_bool get_pidfile(MYSQL *mysql, char *pidfile)
}
-static void wait_pidfile(char *pidfile)
+static void wait_pidfile(char *pidfile, time_t last_modified,
+ struct stat *pidfile_status)
{
char buff[FN_REFLEN];
- int fd;
+ int fd = -1;
uint count=0;
- system_filename(buff,pidfile);
- while ((fd = my_open(buff, O_RDONLY, MYF(0))) >= 0 &&
- count++ < opt_shutdown_timeout && !interrupted)
+ system_filename(buff, pidfile);
+ while (count++ <= opt_shutdown_timeout && !interrupted &&
+ (!last_modified || (last_modified == pidfile_status->st_mtime)) &&
+ (fd= my_open(buff, O_RDONLY, MYF(0))) >= 0)
{
- my_close(fd,MYF(0));
+ if (!my_close(fd,MYF(0)))
+ fd= -1;
sleep(1);
+ if (last_modified && stat(pidfile, pidfile_status))
+ last_modified= 0;
}
+ if (opt_verbose && last_modified &&
+ last_modified != pidfile_status->st_mtime)
+ printf("Warning; pid file '%s' changed while waiting for it to disappear!\n",
+ buff);
if (fd >= 0)
{
my_close(fd,MYF(0));
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 3020e105954..4109fbd76d4 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -20,7 +20,9 @@
#include <time.h>
#include "log_event.h"
-#define PROBE_HEADER_LEN (4+EVENT_LEN_OFFSET+4)
+#define BIN_LOG_HEADER_SIZE 4
+#define PROBE_HEADER_LEN (BIN_LOG_HEADER_SIZE+EVENT_LEN_OFFSET+4)
+
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES)
@@ -178,8 +180,7 @@ static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
- switch(optid)
- {
+ switch(optid) {
#ifndef DBUG_OFF
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
@@ -234,7 +235,7 @@ static MYSQL* safe_connect()
if(!local_mysql)
die("Failed on mysql_init");
- if(!mysql_real_connect(local_mysql, host, user, pass, 0, port, 0, 0))
+ if (!mysql_real_connect(local_mysql, host, user, pass, 0, port, 0, 0))
die("failed on connect: %s", mysql_error(local_mysql));
return local_mysql;
@@ -242,7 +243,7 @@ static MYSQL* safe_connect()
static void dump_log_entries(const char* logname)
{
- if(use_remote)
+ if (use_remote)
dump_remote_log_entries(logname);
else
dump_local_log_entries(logname);
@@ -254,7 +255,7 @@ static void dump_remote_table(NET* net, const char* db, const char* table)
char * p = buf;
uint table_len = (uint) strlen(table);
uint db_len = (uint) strlen(db);
- if(table_len + db_len > sizeof(buf) - 2)
+ if (table_len + db_len > sizeof(buf) - 2)
die("Buffer overrun");
*p++ = db_len;
@@ -263,14 +264,14 @@ static void dump_remote_table(NET* net, const char* db, const char* table)
*p++ = table_len;
memcpy(p, table, table_len);
- if(simple_command(mysql, COM_TABLE_DUMP, buf, p - buf + table_len, 1))
+ if (simple_command(mysql, COM_TABLE_DUMP, buf, p - buf + table_len, 1))
die("Error sending the table dump command");
- for(;;)
+ for (;;)
{
uint packet_len = my_net_read(net);
- if(packet_len == 0) break; // end of file
- if(packet_len == packet_error)
+ if (packet_len == 0) break; // end of file
+ if (packet_len == packet_error)
die("Error reading packet in table dump");
my_fwrite(result_file, (byte*)net->read_pos, packet_len, MYF(MY_WME));
fflush(result_file);
@@ -284,8 +285,8 @@ static int check_master_version(MYSQL* mysql)
const char* version;
int old_format = 0;
- if (mysql_query(mysql, "SELECT VERSION()")
- || !(res = mysql_store_result(mysql)))
+ if (mysql_query(mysql, "SELECT VERSION()") ||
+ !(res = mysql_store_result(mysql)))
{
mysql_close(mysql);
die("Error checking master version: %s",
@@ -305,12 +306,12 @@ static int check_master_version(MYSQL* mysql)
die("Master reported NULL for the version");
}
- switch (*version)
- {
+ switch (*version) {
case '3':
old_format = 1;
break;
case '4':
+ case '5':
old_format = 0;
break;
default:
@@ -324,6 +325,7 @@ static int check_master_version(MYSQL* mysql)
return old_format;
}
+
static void dump_remote_log_entries(const char* logname)
{
char buf[128];
@@ -333,38 +335,38 @@ static void dump_remote_log_entries(const char* logname)
int old_format;
old_format = check_master_version(mysql);
- if(!position) position = 4; // protect the innocent from spam
- if (position < 4)
+ if (!position)
+ position = BIN_LOG_HEADER_SIZE; // protect the innocent from spam
+ if (position < BIN_LOG_HEADER_SIZE)
{
- position = 4;
+ position = BIN_LOG_HEADER_SIZE;
// warn the guity
- sql_print_error("Warning: The position in the binary log can't be less than 4.\nStarting from position 4\n");
+ sql_print_error("Warning: The position in the binary log can't be less than %d.\nStarting from position %d\n", BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE);
}
int4store(buf, position);
- int2store(buf + 4, binlog_flags);
+ int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags);
len = (uint) strlen(logname);
int4store(buf + 6, 0);
memcpy(buf + 10, logname,len);
if (simple_command(mysql, COM_BINLOG_DUMP, buf, len + 10, 1))
die("Error sending the log dump command");
- for(;;)
+ for (;;)
{
const char *error;
len = net_safe_read(mysql);
if (len == packet_error)
die("Error reading packet from server: %s", mysql_error(mysql));
- if(len == 1 && net->read_pos[0] == 254)
+ if (len == 1 && net->read_pos[0] == 254)
break; // end of data
DBUG_PRINT("info",( "len= %u, net->read_pos[5] = %d\n",
len, net->read_pos[5]));
- Log_event * ev = Log_event::read_log_event(
- (const char*) net->read_pos + 1 ,
- len - 1, &error, old_format);
+ Log_event *ev = Log_event::read_log_event((const char*) net->read_pos + 1 ,
+ len - 1, &error, old_format);
if (ev)
{
ev->print(result_file, short_form, last_db);
- if(ev->get_type_code() == LOAD_EVENT)
+ if (ev->get_type_code() == LOAD_EVENT)
dump_remote_file(net, ((Load_log_event*)ev)->fname);
delete ev;
}
@@ -373,10 +375,11 @@ static void dump_remote_log_entries(const char* logname)
}
}
+
static int check_header(IO_CACHE* file)
{
byte buf[PROBE_HEADER_LEN];
- int old_format;
+ int old_format=0;
my_off_t pos = my_b_tell(file);
my_b_seek(file, (my_off_t)0);
@@ -388,8 +391,6 @@ static int check_header(IO_CACHE* file)
event_len = uint4korr(buf + EVENT_LEN_OFFSET + 4);
old_format = (event_len < LOG_EVENT_HEADER_LEN + START_HEADER_LEN);
}
- else
- old_format = 0;
my_b_seek(file, pos);
return old_format;
}
@@ -425,7 +426,7 @@ static void dump_local_log_entries(const char* logname)
for (length= (my_off_t) position ; length > 0 ; length-=tmp)
{
tmp=min(length,sizeof(buff));
- if (my_b_read(file,buff, (uint) tmp))
+ if (my_b_read(file, buff, (uint) tmp))
exit(1);
}
}
@@ -435,10 +436,10 @@ static void dump_local_log_entries(const char* logname)
if (!position)
{
- char magic[4];
+ char magic[BIN_LOG_HEADER_SIZE];
if (my_b_read(file, (byte*) magic, sizeof(magic)))
die("I/O error reading binlog magic number");
- if(memcmp(magic, BINLOG_MAGIC, 4))
+ if (memcmp(magic, BINLOG_MAGIC, 4))
die("Bad magic number; The file is probably not a MySQL binary log");
}
@@ -498,7 +499,7 @@ Could not read entry at offset %s : Error in log format or read error",
rec_count++;
delete ev;
}
- if(fd >= 0)
+ if (fd >= 0)
my_close(fd, MYF(MY_WME));
end_io_cache(file);
}
@@ -509,34 +510,30 @@ int main(int argc, char** argv)
MY_INIT(argv[0]);
parse_args(&argc, (char***)&argv);
- if(!argc && !table)
+ if (!argc && !table)
{
usage();
return -1;
}
- if(use_remote)
- {
+ if (use_remote)
mysql = safe_connect();
- }
if (table)
{
- if(!use_remote)
+ if (!use_remote)
die("You must specify connection parameter to get table dump");
- char* db = (char*)table;
+ char* db = (char*) table;
char* tbl = (char*) strchr(table, '.');
- if(!tbl)
+ if (!tbl)
die("You must use database.table syntax to specify the table");
*tbl++ = 0;
dump_remote_table(&mysql->net, db, tbl);
}
else
{
- while(--argc >= 0)
- {
+ while (--argc >= 0)
dump_log_entries(*(argv++));
- }
}
if (result_file != stdout)
my_fclose(result_file, MYF(0));
@@ -555,3 +552,5 @@ int main(int argc, char** argv)
#else
#include "log_event.cc"
#endif
+
+FIX_GCC_LINKING_PROBLEM
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 78cd277f9be..fdc7b5cf4d7 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -246,7 +246,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
verbose++;
break;
case 'V': print_version(); exit(0);
-#include "sslopt-case.h"
}
return 0;
}
@@ -463,10 +462,10 @@ static int handle_request_for_tables(char *tables, uint length)
if (!(query =(char *) my_malloc((sizeof(char)*(length+110)), MYF(MY_WME))))
return 1;
- sprintf(query, "%s TABLE %s %s", op, tables, options);
+ sprintf(query, "%s TABLE `%s` %s", op, tables, options);
if (mysql_query(sock, query))
{
- sprintf(message, "when executing '%s TABLE ... %s", op, options);
+ sprintf(message, "when executing '%s TABLE `%s` %s", op, tables,options);
DBerror(sock, message);
return 1;
}
@@ -530,6 +529,9 @@ static int dbConnect(char *host, char *user, char *passwd)
if (opt_compress)
mysql_options(&mysql_connection, MYSQL_OPT_COMPRESS, NullS);
#ifdef HAVE_OPENSSL
+ if (opt_ssl_key || opt_ssl_cert || opt_ssl_ca || opt_ssl_capath ||
+ opt_ssl_cipher)
+ opt_use_ssl= 1;
if (opt_use_ssl)
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 9c27029582c..fa456320028 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -33,6 +33,7 @@
** Tõnu Samuel <tonu@please.do.not.remove.this.spam.ee>
** XML by Gary Huntress <ghuntress@mediaone.net> 10/10/01, cleaned up
** and adapted to mysqldump 05/11/01 by Jani Tolonen
+** Added --single-transaction option 06/06/2002 by Peter Zaitsev
*/
#define DUMP_VERSION "9.06"
@@ -76,7 +77,7 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick=0, extended_insert = 0,
opt_delayed=0,create_options=0,opt_quoted=0,opt_databases=0,
opt_alldbs=0,opt_create_db=0,opt_first_slave=0,
opt_autocommit=0,opt_master_data,opt_disable_keys=0,opt_xml=0,
- tty_password=0;
+ tty_password=0,opt_single_transaction=0;
static MYSQL mysql_connection,*sock=0;
static char insert_pat[12 * 1024],*opt_password=0,*current_user=0,
*current_host=0,*path=0,*fields_terminated=0,
@@ -171,6 +172,10 @@ static struct my_option my_long_options[] =
"Wrap tables with autocommit/commit statements.",
(gptr*) &opt_autocommit, (gptr*) &opt_autocommit, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
+ {"single-transaction", OPT_TRANSACTION,
+ "Dump all tables in single transaction to get consistent snapshot. Mutually exclusive with --lock-tables.",
+ (gptr*) &opt_single_transaction, (gptr*) &opt_single_transaction, 0, GET_BOOL, NO_ARG,
+ 0, 0, 0, 0, 0, 0},
{"no-create-db", 'n',
"'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;' will not be put in the output. The above line will be added otherwise, if --databases or --all-databases option was given.}",
(gptr*) &opt_create_db, (gptr*) &opt_create_db, 0, GET_BOOL, NO_ARG, 0, 0,
@@ -201,7 +206,7 @@ static struct my_option my_long_options[] =
(gptr*) &opt_quoted, (gptr*) &opt_quoted, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"result-file", 'r',
- "Direct output to a given file. This option should be used in MSDOS, because it prevents new line '\\n' from being converted to '\\n\\r' (newline + carriage return).",
+ "Direct output to a given file. This option should be used in MSDOS, because it prevents new line '\\n' from being converted to '\\r\\n' (carriage return + line feed).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "Socket file to use for connection.",
(gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR,
@@ -340,13 +345,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
usage();
exit(0);
case (int) OPT_OPTIMIZE:
- extended_insert=opt_drop=opt_lock=lock_tables=quick=create_options=
- opt_disable_keys=1;
+ extended_insert=opt_drop=opt_lock=quick=create_options=opt_disable_keys=
+ lock_tables=1;
+ if (opt_single_transaction) lock_tables=0;
break;
case (int) OPT_TABLES:
opt_databases=0;
break;
-#include "sslopt-case.h"
}
return 0;
}
@@ -371,6 +376,12 @@ static int get_options(int *argc, char ***argv)
"%s: You must use option --tab with --fields-...\n", my_progname);
return(1);
}
+
+ if (opt_single_transaction && lock_tables)
+ {
+ fprintf(stderr, "%s: You can't use --lock-tables and --single-transaction at the same time.\n", my_progname);
+ return(1);
+ }
if (enclosed && opt_enclosed)
{
@@ -446,6 +457,9 @@ static int dbConnect(char *host, char *user,char *passwd)
if (opt_compress)
mysql_options(&mysql_connection,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL
+ if (opt_ssl_key || opt_ssl_cert || opt_ssl_ca || opt_ssl_capath ||
+ opt_ssl_cipher)
+ opt_use_ssl= 1;
if (opt_use_ssl)
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
@@ -1351,9 +1365,6 @@ int main(int argc, char **argv)
MYSQL_RES *master;
MY_INIT(argv[0]);
- /*
- ** Check out the args
- */
if (get_options(&argc, &argv))
{
my_end(0);
@@ -1375,14 +1386,29 @@ int main(int argc, char **argv)
return(first_error);
}
}
+ else if (opt_single_transaction)
+ {
+ /* There is no sense to start transaction if all tables are locked */
+ if (mysql_query(sock, "BEGIN"))
+ {
+ my_printf_error(0, "Error: Couldn't execute 'BEGIN': %s",
+ MYF(0), mysql_error(sock));
+ my_end(0);
+ return(first_error);
+ }
+ }
if (opt_alldbs)
dump_all_databases();
- /* Only one database and selected table(s) */
else if (argc > 1 && !opt_databases)
+ {
+ /* Only one database and selected table(s) */
dump_selected_tables(*argv, (argv + 1), (argc - 1));
- /* One or more databases, all tables */
+ }
else
+ {
+ /* One or more databases, all tables */
dump_databases(argv);
+ }
if (opt_first_slave)
{
@@ -1390,14 +1416,13 @@ int main(int argc, char **argv)
{
if (mysql_query(sock, "SHOW MASTER STATUS") ||
!(master = mysql_store_result(sock)))
- {
my_printf_error(0, "Error: Couldn't execute 'SHOW MASTER STATUS': %s",
MYF(0), mysql_error(sock));
- }
else
{
row = mysql_fetch_row(master);
- if(row[0] && row[1]) {
+ if (row[0] && row[1])
+ {
fprintf(md_result_file,
"\n--\n-- Position to start replication from\n--\n\n");
fprintf(md_result_file,
@@ -1409,15 +1434,25 @@ int main(int argc, char **argv)
}
}
if (mysql_query(sock, "FLUSH MASTER"))
- {
my_printf_error(0, "Error: Couldn't execute 'FLUSH MASTER': %s",
MYF(0), mysql_error(sock));
- }
if (mysql_query(sock, "UNLOCK TABLES"))
- {
my_printf_error(0, "Error: Couldn't execute 'UNLOCK TABLES': %s",
MYF(0), mysql_error(sock));
- }
+ }
+ else if (opt_single_transaction) /* Just to make it beautiful enough */
+ {
+ /*
+ In case we were locking all tables, we did not start transaction
+ so there is no need to commit it.
+ */
+
+ /* This should just free locks as we did not change anything */
+ if (mysql_query(sock, "COMMIT"))
+ {
+ my_printf_error(0, "Error: Couldn't execute 'COMMIT': %s",
+ MYF(0), mysql_error(sock));
+ }
}
dbDisconnect(current_host);
fputs("\n", md_result_file);
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 1933ea41bcf..603e9036106 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -193,7 +193,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case '?':
usage();
exit(0);
-#include "sslopt-case.h"
}
return 0;
}
@@ -348,6 +347,9 @@ static MYSQL *db_connect(char *host, char *database, char *user, char *passwd)
mysql_options(&mysql_connection,MYSQL_OPT_LOCAL_INFILE,
(char*) &opt_local_file);
#ifdef HAVE_OPENSSL
+ if (opt_ssl_key || opt_ssl_cert || opt_ssl_ca || opt_ssl_capath ||
+ opt_ssl_cipher)
+ opt_use_ssl= 1;
if (opt_use_ssl)
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
@@ -469,9 +471,15 @@ int main(int argc, char **argv)
/* argv is changed in the program */
argv_to_free= argv;
if (get_options(&argc, &argv))
+ {
+ free_defaults(argv_to_free);
return(1);
+ }
if (!(sock= db_connect(current_host,current_db,current_user,opt_password)))
+ {
+ free_defaults(argv_to_free);
return(1); /* purecov: deadcode */
+ }
if (lock_tables)
lock_table(sock, argc, argv);
for (; *argv != NULL; argv++)
diff --git a/client/mysqlmanager-pwgen.c b/client/mysqlmanager-pwgen.c
index 40126e279b5..57d91b52f49 100644
--- a/client/mysqlmanager-pwgen.c
+++ b/client/mysqlmanager-pwgen.c
@@ -105,8 +105,10 @@ void get_pass(char* pw, int len)
{
FILE* fp;
char* pw_end=pw+len;
-/* /dev/random is more secure than rand() because the seed is easy to
- predict, so we resort to rand() only if /dev/random is not available */
+ /*
+ /dev/random is more secure than rand() because the seed is easy to
+ predict, so we resort to rand() only if /dev/random is not available
+ */
if ((fp=fopen("/dev/random","r")))
{
fread(pw,len,1,fp);
@@ -129,6 +131,7 @@ void get_pass(char* pw, int len)
*pw_end=0;
}
+
int main(int argc, char** argv)
{
FILE* fp;
diff --git a/client/mysqlmanagerc.c b/client/mysqlmanagerc.c
index f200b993147..0001a0266e6 100644
--- a/client/mysqlmanagerc.c
+++ b/client/mysqlmanagerc.c
@@ -138,6 +138,8 @@ int parse_args(int argc, char **argv)
return 0;
}
+
+
int main(int argc, char** argv)
{
MY_INIT(argv[0]);
@@ -147,7 +149,7 @@ int main(int argc, char** argv)
if (!(manager=mysql_manager_init(0)))
die("Failed in mysql_manager_init()");
if (!mysql_manager_connect(manager,host,user,pass,port))
- die("Could not connect to MySQL manager: %s(%d)",manager->last_error,
+ die("Could not connect to MySQL manager: %s (%d)",manager->last_error,
manager->last_errno);
for (;!feof(fp);)
{
@@ -157,11 +159,11 @@ int main(int argc, char** argv)
if (!quiet)
fprintf(fp_out,"<<%s",buf);
if (mysql_manager_command(manager,buf,strlen(buf)))
- die("Error in command: %s(%d)",manager->last_error,manager->last_errno);
+ die("Error in command: %s (%d)",manager->last_error,manager->last_errno);
while (!manager->eof)
{
if (mysql_manager_fetch_line(manager,buf,sizeof(buf)))
- die("Error fetching result line: %s(%d)", manager->last_error,
+ die("Error fetching result line: %s (%d)", manager->last_error,
manager->last_errno);
if (!quiet)
fprintf(fp_out,">>%s\n",buf);
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 81b4d2ab4f7..718716b60be 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -85,6 +85,9 @@ int main(int argc, char **argv)
if (opt_compress)
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL
+ if (opt_ssl_key || opt_ssl_cert || opt_ssl_ca || opt_ssl_capath ||
+ opt_ssl_cipher)
+ opt_use_ssl= 1;
if (opt_use_ssl)
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
@@ -218,7 +221,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_mysql_unix_port=MYSQL_NAMEDPIPE;
#endif
break;
-#include "sslopt-case.h"
case '#':
DBUG_PUSH(argument ? argument : "d:t:o");
break;
diff --git a/client/mysqltest.c b/client/mysqltest.c
index e9307bcdf60..f469a33f063 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -42,7 +42,7 @@
**********************************************************************/
-#define MTEST_VERSION "1.24"
+#define MTEST_VERSION "1.25"
#include <my_global.h>
#include <mysql_embed.h>
@@ -85,7 +85,7 @@
time
*/
#define CON_RETRY_SLEEP 2
-#define MAX_CON_TRIES 5
+#define MAX_CON_TRIES 5
#ifndef OS2
#define SLAVE_POLL_INTERVAL 300000 /* 0.3 of a sec */
@@ -101,7 +101,7 @@ static char *db = 0, *pass=0;
const char* user = 0, *host = 0, *unix_sock = 0, *opt_basedir="./";
static int port = 0;
static my_bool opt_big_test= 0, opt_compress= 0, silent= 0, verbose = 0,
- tty_password= 0;
+ tty_password= 0;
static uint start_lineno, *lineno;
const char* manager_user="root",*manager_host=0;
char *manager_pass=0;
@@ -128,7 +128,7 @@ static uint global_expected_errno[MAX_EXPECTED_ERRORS], global_expected_errors;
DYNAMIC_ARRAY q_lines;
-typedef struct
+typedef struct
{
char file[FN_REFLEN];
ulong pos;
@@ -177,27 +177,27 @@ struct connection* cur_con, *next_con, *cons_end;
/* Add new commands before Q_UNKNOWN !*/
enum enum_commands {
-Q_CONNECTION=1, Q_QUERY,
-Q_CONNECT, Q_SLEEP,
-Q_INC, Q_DEC,
-Q_SOURCE, Q_DISCONNECT,
-Q_LET, Q_ECHO,
-Q_WHILE, Q_END_BLOCK,
-Q_SYSTEM, Q_RESULT,
-Q_REQUIRE, Q_SAVE_MASTER_POS,
-Q_SYNC_WITH_MASTER, Q_ERROR,
-Q_SEND, Q_REAP,
-Q_DIRTY_CLOSE, Q_REPLACE,
-Q_PING, Q_EVAL,
-Q_RPL_PROBE, Q_ENABLE_RPL_PARSE,
+Q_CONNECTION=1, Q_QUERY,
+Q_CONNECT, Q_SLEEP, Q_REAL_SLEEP,
+Q_INC, Q_DEC,
+Q_SOURCE, Q_DISCONNECT,
+Q_LET, Q_ECHO,
+Q_WHILE, Q_END_BLOCK,
+Q_SYSTEM, Q_RESULT,
+Q_REQUIRE, Q_SAVE_MASTER_POS,
+Q_SYNC_WITH_MASTER, Q_ERROR,
+Q_SEND, Q_REAP,
+Q_DIRTY_CLOSE, Q_REPLACE,
+Q_PING, Q_EVAL,
+Q_RPL_PROBE, Q_ENABLE_RPL_PARSE,
Q_DISABLE_RPL_PARSE, Q_EVAL_RESULT,
Q_ENABLE_QUERY_LOG, Q_DISABLE_QUERY_LOG,
Q_ENABLE_RESULT_LOG, Q_DISABLE_RESULT_LOG,
Q_SERVER_START, Q_SERVER_STOP,Q_REQUIRE_MANAGER,
Q_WAIT_FOR_SLAVE_TO_STOP,
Q_REQUIRE_VERSION,
-Q_UNKNOWN, /* Unknown command. */
-Q_COMMENT, /* Comments, ignored. */
+Q_UNKNOWN, /* Unknown command. */
+Q_COMMENT, /* Comments, ignored. */
Q_COMMENT_WITH_COMMAND
};
@@ -213,25 +213,45 @@ struct st_query
enum enum_commands type;
};
-const char *command_names[] = {
- "connection", "query",
- "connect", "sleep",
- "inc", "dec",
- "source", "disconnect",
- "let", "echo",
- "while", "end",
- "system", "result",
- "require", "save_master_pos",
- "sync_with_master", "error",
- "send", "reap",
- "dirty_close", "replace_result",
- "ping", "eval",
- "rpl_probe", "enable_rpl_parse",
- "disable_rpl_parse", "eval_result",
- "enable_query_log", "disable_query_log",
- "enable_result_log", "disable_result_log",
- "server_start", "server_stop",
- "require_manager", "wait_for_slave_to_stop",
+const char *command_names[]=
+{
+ "connection",
+ "query",
+ "connect",
+ "sleep",
+ "real_sleep",
+ "inc",
+ "dec",
+ "source",
+ "disconnect",
+ "let",
+ "echo",
+ "while",
+ "end",
+ "system",
+ "result",
+ "require",
+ "save_master_pos",
+ "sync_with_master",
+ "error",
+ "send",
+ "reap",
+ "dirty_close",
+ "replace_result",
+ "ping",
+ "eval",
+ "rpl_probe",
+ "enable_rpl_parse",
+ "disable_rpl_parse",
+ "eval_result",
+ "enable_query_log",
+ "disable_query_log",
+ "enable_result_log",
+ "disable_result_log",
+ "server_start",
+ "server_stop",
+ "require_manager",
+ "wait_for_slave_to_stop",
"require_version",
0
};
@@ -264,7 +284,7 @@ typedef struct st_pointer_array { /* when using array-strings */
TYPELIB typelib; /* Pointer to strings */
byte *str; /* Strings is here */
int7 *flag; /* Flag about each var. */
- uint array_allocs,max_count,length,max_length;
+ uint array_allocs,max_count,length,max_length;
} POINTER_ARRAY;
struct st_replace;
@@ -314,39 +334,39 @@ static void do_eval(DYNAMIC_STRING* query_eval, const char* query)
register int escaped = 0;
VAR* v;
- for(p = query; (c = *p); ++p)
- {
- switch(c)
- {
- case '$':
- if(escaped)
- {
- escaped = 0;
- dynstr_append_mem(query_eval, p, 1);
- }
- else
- {
- if(!(v = var_get(p, &p, 0, 0)))
- die("Bad variable in eval");
- dynstr_append_mem(query_eval, v->str_val, v->str_val_len);
- }
- break;
- case '\\':
- if(escaped)
- {
- escaped = 0;
- dynstr_append_mem(query_eval, p, 1);
- }
- else
- escaped = 1;
- break;
- default:
- dynstr_append_mem(query_eval, p, 1);
- break;
- }
+ for (p= query; (c = *p); ++p)
+ {
+ switch(c) {
+ case '$':
+ if (escaped)
+ {
+ escaped = 0;
+ dynstr_append_mem(query_eval, p, 1);
+ }
+ else
+ {
+ if (!(v = var_get(p, &p, 0, 0)))
+ die("Bad variable in eval");
+ dynstr_append_mem(query_eval, v->str_val, v->str_val_len);
+ }
+ break;
+ case '\\':
+ if (escaped)
+ {
+ escaped = 0;
+ dynstr_append_mem(query_eval, p, 1);
+ }
+ else
+ escaped = 1;
+ break;
+ default:
+ dynstr_append_mem(query_eval, p, 1);
+ break;
}
+ }
}
+
static void close_cons()
{
DBUG_ENTER("close_cons");
@@ -360,6 +380,7 @@ static void close_cons()
DBUG_VOID_RETURN;
}
+
static void close_files()
{
DBUG_ENTER("close_files");
@@ -371,14 +392,15 @@ static void close_files()
DBUG_VOID_RETURN;
}
+
static void free_used_memory()
{
uint i;
DBUG_ENTER("free_used_memory");
-#ifndef EMBEDDED_LIBRARY
+#ifndef EMBEDDED_LIBRARY
if (manager)
mysql_manager_close(manager);
-#endif
+#endif
close_cons();
close_files();
hash_free(&var_hash);
@@ -389,9 +411,9 @@ static void free_used_memory()
my_free((gptr) (*q)->query_buf,MYF(MY_ALLOW_ZERO_PTR));
my_free((gptr) (*q),MYF(0));
}
- for(i=0; i < 10; i++)
+ for (i=0; i < 10; i++)
{
- if(var_reg[i].alloced_len)
+ if (var_reg[i].alloced_len)
my_free(var_reg[i].str_val, MYF(MY_WME));
}
while (embedded_server_arg_count > 1)
@@ -503,7 +525,7 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char* fname)
{
do_eval(&res_ds, tmp);
res_ptr = res_ds.str;
- if((res_len = res_ds.length) != ds->length)
+ if ((res_len = res_ds.length) != ds->length)
{
res = 2;
goto err;
@@ -517,10 +539,10 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char* fname)
res = (memcmp(res_ptr, ds->str, res_len)) ? 1 : 0;
-err:
- if(res && eval_result)
- str_to_file(fn_format(eval_file, fname, "", ".eval",2), res_ptr,
- res_len);
+err:
+ if (res && eval_result)
+ str_to_file(fn_format(eval_file, fname, "", ".eval",2), res_ptr,
+ res_len);
my_free((gptr) tmp, MYF(0));
my_close(fd, MYF(MY_WME));
@@ -537,8 +559,7 @@ static int check_result(DYNAMIC_STRING* ds, const char* fname,
if (res && require_option)
abort_not_supported_test();
- switch (res)
- {
+ switch (res) {
case 0:
break; /* ok */
case 2:
@@ -592,7 +613,7 @@ VAR* var_get(const char* var_name, const char** var_name_end, my_bool raw,
}
--var_name; /* Point at last character */
}
- else
+ else
v = var_reg + digit;
if (!raw && v->int_dirty)
@@ -614,7 +635,7 @@ err:
static VAR* var_obtain(char* name, int len)
{
VAR* v;
- if((v = (VAR*)hash_search(&var_hash, name, len)))
+ if ((v = (VAR*)hash_search(&var_hash, name, len)))
return v;
v = var_init(0, name, len, "", 0);
hash_insert(&var_hash, (byte*)v);
@@ -637,7 +658,7 @@ int var_set(char* var_name, char* var_name_end, char* var_val,
{
v = var_obtain(var_name, var_name_end - var_name);
}
- else
+ else
v = var_reg + digit;
return eval_expr(v, var_val, (const char**)&var_val_end);
@@ -667,7 +688,7 @@ int open_file(const char* name)
int do_wait_for_slave_to_stop(struct st_query* q __attribute__((unused)))
{
MYSQL* mysql = &cur_con->mysql;
-#ifndef OS2
+#ifndef OS2
struct timeval t;
#endif
for (;;)
@@ -676,7 +697,7 @@ int do_wait_for_slave_to_stop(struct st_query* q __attribute__((unused)))
MYSQL_ROW row;
int done;
LINT_INIT(res);
-
+
if (mysql_query(mysql,"show status like 'Slave_running'")
|| !(res=mysql_store_result(mysql)))
die("Query failed while probing slave for stop: %s",
@@ -690,7 +711,7 @@ int do_wait_for_slave_to_stop(struct st_query* q __attribute__((unused)))
mysql_free_result(res);
if (done)
break;
-#ifndef OS2
+#ifndef OS2
t.tv_sec=0;
t.tv_usec=SLAVE_POLL_INTERVAL;
select(0,0,0,0,&t); /* sleep */
@@ -698,7 +719,7 @@ int do_wait_for_slave_to_stop(struct st_query* q __attribute__((unused)))
DosSleep(OS2_SLAVE_POLL_INTERVAL);
#endif
}
-
+
return 0;
}
@@ -761,7 +782,7 @@ int do_require_version(struct st_query* q)
char* p=q->first_argument, *ver_arg;
uint ver_arg_len,ver_len;
LINT_INIT(res);
-
+
if (!*p)
die("Missing version argument in require_version\n");
ver_arg = p;
@@ -769,7 +790,7 @@ int do_require_version(struct st_query* q)
p++;
*p = 0;
ver_arg_len = p - ver_arg;
-
+
if (mysql_query(mysql, "select version()") ||
!(res=mysql_store_result(mysql)))
die("Query failed while check server version: %s",
@@ -855,7 +876,7 @@ int eval_expr(VAR* v, const char* p, const char** p_end)
return 0;
}
}
- else if(*p == '`')
+ else if (*p == '`')
{
return var_query_set(v, p, p_end);
}
@@ -865,7 +886,7 @@ int eval_expr(VAR* v, const char* p, const char** p_end)
(int) (*p_end - p) : (int) strlen(p);
if (new_val_len + 1 >= v->alloced_len)
{
- v->alloced_len = (new_val_len < MIN_VAR_ALLOC - 1) ?
+ v->alloced_len = (new_val_len < MIN_VAR_ALLOC - 1) ?
MIN_VAR_ALLOC : new_val_len + 1;
if (!(v->str_val =
v->str_val ? my_realloc(v->str_val, v->alloced_len+1,
@@ -944,6 +965,7 @@ int do_echo(struct st_query* q)
return 0;
}
+
int do_sync_with_master(struct st_query* q)
{
MYSQL_RES* res;
@@ -954,31 +976,36 @@ int do_sync_with_master(struct st_query* q)
char* p = q->first_argument;
int rpl_parse;
+ if (!master_pos.file[0])
+ {
+ die("Line %u: Calling 'sync_with_master' without calling 'save_master_pos'", start_lineno);
+ }
rpl_parse = mysql_rpl_parse_enabled(mysql);
mysql_disable_rpl_parse(mysql);
- if(*p)
+ if (*p)
offset = atoi(p);
sprintf(query_buf, "select master_pos_wait('%s', %ld)", master_pos.file,
master_pos.pos + offset);
- if(mysql_query(mysql, query_buf))
- die("At line %u: failed in %s: %d: %s", start_lineno, query_buf,
+ if (mysql_query(mysql, query_buf))
+ die("line %u: failed in %s: %d: %s", start_lineno, query_buf,
mysql_errno(mysql), mysql_error(mysql));
- if(!(last_result = res = mysql_store_result(mysql)))
- die("line %u: mysql_store_result() retuned NULL", start_lineno);
- if(!(row = mysql_fetch_row(res)))
+ if (!(last_result = res = mysql_store_result(mysql)))
+ die("line %u: mysql_store_result() returned NULL", start_lineno);
+ if (!(row = mysql_fetch_row(res)))
die("line %u: empty result in %s", start_lineno, query_buf);
- if(!row[0])
+ if (!row[0])
die("Error on slave while syncing with master");
mysql_free_result(res); last_result=0;
- if(rpl_parse)
+ if (rpl_parse)
mysql_enable_rpl_parse(mysql);
return 0;
}
+
int do_save_master_pos()
{
MYSQL_RES* res;
@@ -989,19 +1016,19 @@ int do_save_master_pos()
rpl_parse = mysql_rpl_parse_enabled(mysql);
mysql_disable_rpl_parse(mysql);
- if(mysql_query(mysql, "show master status"))
+ if (mysql_query(mysql, "show master status"))
die("At line %u: failed in show master status: %d: %s", start_lineno,
mysql_errno(mysql), mysql_error(mysql));
- if(!(last_result =res = mysql_store_result(mysql)))
+ if (!(last_result =res = mysql_store_result(mysql)))
die("line %u: mysql_store_result() retuned NULL", start_lineno);
- if(!(row = mysql_fetch_row(res)))
+ if (!(row = mysql_fetch_row(res)))
die("line %u: empty result in show master status", start_lineno);
- strncpy(master_pos.file, row[0], sizeof(master_pos.file));
- master_pos.pos = strtoul(row[1], (char**) 0, 10);
+ strnmov(master_pos.file, row[0], sizeof(master_pos.file)-1);
+ master_pos.pos = strtoul(row[1], (char**) 0, 10);
mysql_free_result(res); last_result=0;
- if(rpl_parse)
+ if (rpl_parse)
mysql_enable_rpl_parse(mysql);
return 0;
@@ -1015,11 +1042,11 @@ int do_let(struct st_query* q)
if (!*p)
die("Missing variable name in let\n");
var_name = p;
- while(*p && (*p != '=' || my_isspace(system_charset_info,*p)))
+ while (*p && (*p != '=' || my_isspace(system_charset_info,*p)))
p++;
var_name_end = p;
if (*p == '=') p++;
- while(*p && my_isspace(system_charset_info,*p))
+ while (*p && my_isspace(system_charset_info,*p))
p++;
var_val_start = p;
return var_set(var_name, var_name_end, var_val_start, q->end);
@@ -1027,9 +1054,10 @@ int do_let(struct st_query* q)
int do_rpl_probe(struct st_query* q __attribute__((unused)))
{
- if(mysql_rpl_probe(&cur_con->mysql))
- die("Failed in mysql_rpl_probe(): %s", mysql_error(&cur_con->mysql));
- return 0;
+ DBUG_ENTER("do_rpl_probe");
+ if (mysql_rpl_probe(&cur_con->mysql))
+ die("Failed in mysql_rpl_probe(): '%s'", mysql_error(&cur_con->mysql));
+ DBUG_RETURN(0);
}
int do_enable_rpl_parse(struct st_query* q __attribute__((unused)))
@@ -1047,30 +1075,30 @@ int do_disable_rpl_parse(struct st_query* q __attribute__((unused)))
int do_sleep(struct st_query* q)
{
- char* p=q->first_argument;
+ char *p=q->first_argument;
struct timeval t;
int dec_mul = 1000000;
- while(*p && my_isspace(system_charset_info,*p)) p++;
+ while (*p && my_isspace(system_charset_info,*p))
+ p++;
if (!*p)
die("Missing argument in sleep\n");
t.tv_usec = 0;
#ifdef OS2
- if (opt_sleep)
+ if (opt_sleep && !real_sleep)
DosSleep( opt_sleep * 1000);
else
DosSleep( atof( p) * 1000);
-
return 0;
#else
- if (opt_sleep)
+ if (opt_sleep && !real_sleep)
t.tv_sec = opt_sleep;
else
{
t.tv_sec = atoi(p);
- while(*p && *p != '.' && !my_isspace(system_charset_info,*p))
+ while (*p && *p != '.' && !my_isspace(system_charset_info,*p))
p++;
if (*p == '.')
{
@@ -1079,7 +1107,7 @@ int do_sleep(struct st_query* q)
p++;
p_end = p + 6;
- for(;p <= p_end; ++p)
+ for (;p <= p_end; ++p)
{
c = (int) (*p - '0');
if (c < 10 && (int) c >= 0)
@@ -1247,7 +1275,7 @@ static void get_replace(struct st_query *q)
}
for (i=1,pos=word_end_chars ; i < 256 ; i++)
if (my_isspace(system_charset_info,i))
- *pos++=i;
+ *pos++= i;
*pos=0; /* End pointer */
if (!(glob_replace=init_replace((char**) from_array.typelib.type_names,
(char**) to_array.typelib.type_names,
@@ -1281,7 +1309,7 @@ int select_connection(struct st_query* q)
if (!*p)
die("Missing connection name in connect\n");
name = p;
- while(*p && !my_isspace(system_charset_info,*p))
+ while (*p && !my_isspace(system_charset_info,*p))
p++;
*p = 0;
@@ -1307,7 +1335,7 @@ int close_connection(struct st_query* q)
if (!*p)
die("Missing connection name in connect\n");
name = p;
- while(*p && !my_isspace(system_charset_info,*p))
+ while (*p && !my_isspace(system_charset_info,*p))
p++;
*p = 0;
@@ -1343,11 +1371,13 @@ int close_connection(struct st_query* q)
char* safe_get_param(char* str, char** arg, const char* msg)
{
DBUG_ENTER("safe_get_param");
- while (*str && my_isspace(system_charset_info,*str)) str++;
+ while (*str && my_isspace(system_charset_info,*str))
+ str++;
*arg = str;
for (; *str && *str != ',' && *str != ')' ; str++)
{
- if (my_isspace(system_charset_info,*str)) *str = 0;
+ if (my_isspace(system_charset_info,*str))
+ *str = 0;
}
if (!*str)
die(msg);
@@ -1425,7 +1455,7 @@ int do_connect(struct st_query* q)
con_port = var_port->int_val;
}
else
- con_port=atoi(con_port_str);
+ con_port=atoi(con_port_str);
p = safe_get_param(p, &con_sock, "missing connection socket");
if (*con_sock == '$')
{
@@ -1469,6 +1499,7 @@ int do_connect(struct st_query* q)
DBUG_RETURN(0);
}
+
int do_done(struct st_query* q)
{
q->type = Q_END_BLOCK;
@@ -1480,8 +1511,8 @@ int do_done(struct st_query* q)
}
else
{
- ++parser.current_line;
- --cur_block;
+ ++parser.current_line;
+ --cur_block;
}
return 0;
}
@@ -1492,14 +1523,14 @@ int do_while(struct st_query* q)
const char* expr_start, *expr_end;
VAR v;
if (cur_block == block_stack_end)
- die("Nesting too deeply");
+ die("Nesting too deeply");
if (!*block_ok)
- {
- ++false_block_depth;
- *++block_ok = 0;
- *cur_block++ = parser.current_line++;
- return 0;
- }
+ {
+ ++false_block_depth;
+ *++block_ok = 0;
+ *cur_block++ = parser.current_line++;
+ return 0;
+ }
expr_start = strchr(p, '(');
if (!expr_start)
@@ -1511,10 +1542,10 @@ int do_while(struct st_query* q)
eval_expr(&v, ++expr_start, &expr_end);
*cur_block++ = parser.current_line++;
if (!v.int_val)
- {
- *++block_ok = 0;
- false_block_depth++;
- }
+ {
+ *++block_ok = 0;
+ false_block_depth++;
+ }
else
*++block_ok = 1;
var_free(&v);
@@ -1530,45 +1561,42 @@ int safe_copy_unescape(char* dest, char* src, int size)
size--; /* just to make life easier */
- for(; p_dest - size < dest && p_src - size < src
- && (c = *p_src) != '\n' && c; ++p_src )
- {
- switch(state)
- {
- case ST_NORMAL:
- if (c == '\\')
- {
- state = ST_ESCAPED;
- }
- else
- *p_dest++ = c;
- break;
- case ST_ESCAPED:
- if ((val = hex_val(c)) > 0)
- {
- *p_dest = val;
- state = ST_HEX2;
- }
- else
- {
- state = ST_NORMAL;
- *p_dest++ = c;
- }
- break;
- case ST_HEX2:
- if ((val = hex_val(c)) > 0)
- {
- *p_dest = (*p_dest << 4) + val;
- p_dest++;
- }
- else
- *p_dest++ = c;
+ for (; p_dest - size < dest && p_src - size < src &&
+ (c = *p_src) != '\n' && c; ++p_src)
+ {
+ switch(state) {
+ case ST_NORMAL:
+ if (c == '\\')
+ state = ST_ESCAPED;
+ else
+ *p_dest++ = c;
+ break;
+ case ST_ESCAPED:
+ if ((val = hex_val(c)) > 0)
+ {
+ *p_dest = val;
+ state = ST_HEX2;
+ }
+ else
+ {
+ state = ST_NORMAL;
+ *p_dest++ = c;
+ }
+ break;
+ case ST_HEX2:
+ if ((val = hex_val(c)) > 0)
+ {
+ *p_dest = (*p_dest << 4) + val;
+ p_dest++;
+ }
+ else
+ *p_dest++ = c;
- state = ST_NORMAL;
- break;
+ state = ST_NORMAL;
+ break;
- }
}
+ }
*p_dest = 0;
return (p_dest - dest);
@@ -1765,7 +1793,8 @@ int read_query(struct st_query** q_ptr)
}
}
- while(*p && my_isspace(system_charset_info,*p)) p++ ;
+ while (*p && my_isspace(system_charset_info,*p))
+ p++ ;
if (*p == '@')
{
p++;
@@ -1776,14 +1805,16 @@ int read_query(struct st_query** q_ptr)
*p1 = 0;
}
}
- while (*p && my_isspace(system_charset_info,*p)) p++;
+ while (*p && my_isspace(system_charset_info,*p))
+ p++;
if (!(q->query_buf=q->query=my_strdup(p,MYF(MY_WME))))
die(NullS);
/* Calculate first word and first argument */
for (p=q->query; *p && !my_isspace(system_charset_info,*p) ; p++) ;
q->first_word_len = (uint) (p - q->query);
- while (*p && my_isspace(system_charset_info,*p)) p++;
+ while (*p && my_isspace(system_charset_info,*p))
+ p++;
q->first_argument=p;
q->end = strend(q->query);
parser.read_lines++;
@@ -1884,7 +1915,7 @@ static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
- switch(optid) {
+ switch(optid) {
case '#':
DBUG_PUSH(argument ? argument : "d:t:S:i:O,/tmp/mysqltest.trace");
break;
@@ -1977,7 +2008,7 @@ int parse_args(int argc, char **argv)
char* safe_str_append(char* buf, const char* str, int size)
{
int i,c ;
- for(i = 0; (c = *str++) && i < size - 1; i++)
+ for (i = 0; (c = *str++) && i < size - 1; i++)
*buf++ = c;
*buf = 0;
return buf;
@@ -2026,7 +2057,7 @@ static void replace_dynstr_append_mem(DYNAMIC_STRING *ds, const char *val,
/*
-* flags control the phased/stages of query execution to be performed
+* flags control the phased/stages of query execution to be performed
* if QUERY_SEND bit is on, the query will be sent. If QUERY_REAP is on
* the result will be read - for regular query, both bits must be on
*/
@@ -2125,7 +2156,7 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
dynstr_append_mem(ds,"\n",1);
verbose_msg("query '%s' failed: %d: %s", q->query, mysql_errno(mysql),
mysql_error(mysql));
- /*
+ /*
if we do not abort on error, failure to run the query does
not fail the whole test case
*/
@@ -2166,7 +2197,7 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
while ((row = mysql_fetch_row(res)))
{
lengths = mysql_fetch_lengths(res);
- for(i = 0; i < num_fields; i++)
+ for (i = 0; i < num_fields; i++)
{
val = (char*)row[i];
len = lengths[i];
@@ -2204,7 +2235,7 @@ end:
last_result=0;
if (ds == &ds_tmp)
dynstr_free(&ds_tmp);
- if(q->type == Q_EVAL)
+ if (q->type == Q_EVAL)
dynstr_free(&eval_query);
DBUG_RETURN(error);
}
@@ -2249,12 +2280,12 @@ static VAR* var_init(VAR* v, const char* name, int name_len, const char* val,
if (!val_len && val)
val_len = strlen(val) ;
val_alloc_len = val_len + 16; /* room to grow */
- if (!(tmp_var=v) && !(tmp_var = (VAR*)my_malloc(sizeof(*tmp_var)
+ if (!(tmp_var=v) && !(tmp_var = (VAR*)my_malloc(sizeof(*tmp_var)
+ name_len, MYF(MY_WME))))
die("Out of memory");
tmp_var->name = (name) ? (char*) tmp_var + sizeof(*tmp_var) : 0;
- tmp_var->alloced = (v == 0);
+ tmp_var->alloced = (v == 0);
if (!(tmp_var->str_val = my_malloc(val_alloc_len+1, MYF(MY_WME))))
die("Out of memory");
@@ -2288,7 +2319,7 @@ static void var_from_env(const char* name, const char* def_val)
if (!(tmp = getenv(name)))
tmp = def_val;
- v = var_init(0, name, 0, tmp, 0);
+ v = var_init(0, name, 0, tmp, 0);
hash_insert(&var_hash, (byte*)v);
}
@@ -2380,36 +2411,37 @@ int main(int argc, char** argv)
case Q_CONNECT: do_connect(q); break;
case Q_CONNECTION: select_connection(q); break;
case Q_DISCONNECT:
- case Q_DIRTY_CLOSE:
+ case Q_DIRTY_CLOSE:
close_connection(q); break;
case Q_RPL_PROBE: do_rpl_probe(q); break;
- case Q_ENABLE_RPL_PARSE: do_enable_rpl_parse(q); break;
+ case Q_ENABLE_RPL_PARSE: do_enable_rpl_parse(q); break;
case Q_DISABLE_RPL_PARSE: do_disable_rpl_parse(q); break;
- case Q_ENABLE_QUERY_LOG: disable_query_log=0; break;
+ case Q_ENABLE_QUERY_LOG: disable_query_log=0; break;
case Q_DISABLE_QUERY_LOG: disable_query_log=1; break;
case Q_ENABLE_RESULT_LOG: disable_result_log=0; break;
case Q_DISABLE_RESULT_LOG: disable_result_log=1; break;
case Q_SOURCE: do_source(q); break;
- case Q_SLEEP: do_sleep(q); break;
+ case Q_SLEEP: do_sleep(q, 0); break;
+ case Q_REAL_SLEEP: do_sleep(q, 1); break;
case Q_REQUIRE_VERSION: do_require_version(q); break;
case Q_WAIT_FOR_SLAVE_TO_STOP: do_wait_for_slave_to_stop(q); break;
case Q_REQUIRE_MANAGER: do_require_manager(q); break;
-#ifndef EMBEDDED_LIBRARY
+#ifndef EMBEDDED_LIBRARY
case Q_SERVER_START: do_server_start(q); break;
case Q_SERVER_STOP: do_server_stop(q); break;
-#endif
+#endif
case Q_INC: do_inc(q); break;
case Q_DEC: do_dec(q); break;
case Q_ECHO: do_echo(q); break;
case Q_SYSTEM: do_system(q); break;
case Q_LET: do_let(q); break;
- case Q_EVAL_RESULT: eval_result = 1; break;
+ case Q_EVAL_RESULT: eval_result = 1; break;
case Q_EVAL:
- if (q->query == q->query_buf)
+ if (q->query == q->query_buf)
q->query= q->first_argument;
- /* fall through */
+ /* fall through */
case Q_QUERY:
- case Q_REAP:
+ case Q_REAP:
{
/*
We read the result always regardless of the mode for both full
@@ -2464,10 +2496,10 @@ int main(int argc, char** argv)
case Q_REPLACE:
get_replace(q);
break;
- case Q_SAVE_MASTER_POS: do_save_master_pos(); break;
- case Q_SYNC_WITH_MASTER: do_sync_with_master(q); break;
+ case Q_SAVE_MASTER_POS: do_save_master_pos(); break;
+ case Q_SYNC_WITH_MASTER: do_sync_with_master(q); break;
case Q_COMMENT: /* Ignore row */
- case Q_COMMENT_WITH_COMMAND:
+ case Q_COMMENT_WITH_COMMAND:
case Q_PING:
(void) mysql_ping(&cur_con->mysql);
break;
@@ -2478,8 +2510,7 @@ int main(int argc, char** argv)
if (!processed)
{
current_line_inc = 0;
- switch(q->type)
- {
+ switch (q->type) {
case Q_WHILE: do_while(q); break;
case Q_END_BLOCK: do_done(q); break;
default: current_line_inc = 1; break;
@@ -2570,7 +2601,7 @@ static int read_server_arguments(const char* name)
#define LAST_CHAR_CODE 259
typedef struct st_replace {
- bool found;
+ bool found;
struct st_replace *next[256];
} REPLACE;
@@ -2676,12 +2707,12 @@ void free_pointer_array(POINTER_ARRAY *pa)
#define SET_MALLOC_HUNC 64
typedef struct st_rep_set {
- uint *bits; /* Pointer to used sets */
- short next[LAST_CHAR_CODE]; /* Pointer to next sets */
+ uint *bits; /* Pointer to used sets */
+ short next[LAST_CHAR_CODE]; /* Pointer to next sets */
uint found_len; /* Best match to date */
int found_offset;
- uint table_offset;
- uint size_of_bits; /* For convinience */
+ uint table_offset;
+ uint size_of_bits; /* For convinience */
} REP_SET;
typedef struct st_rep_sets {
@@ -3212,7 +3243,7 @@ static uint replace_len(my_string str)
/* Replace strings; Return length of result string */
-uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
+uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
const char *from)
{
reg1 REPLACE *rep_pos;
@@ -3221,7 +3252,7 @@ uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
end=(to= *start) + *max_length-1;
rep_pos=rep+1;
- for(;;)
+ for (;;)
{
while (!rep_pos->found)
{
diff --git a/configure.in b/configure.in
index c8b3c7af13f..5cd299a8ba0 100644
--- a/configure.in
+++ b/configure.in
@@ -172,6 +172,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
# Not critical since the generated file is distributed
AC_PROG_YACC
AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf)
+AC_CHECK_PROG(DVIS, tex, manual.dvi)
AC_MSG_CHECKING("return type of sprintf")
@@ -318,7 +319,7 @@ then
# mysqld doesn't use run-time-type-checking, so we disable it.
CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"
- # If you are using 'gcc' 3.0 (not g++) to compile C++ programs,
+ # If you are using 'gcc' 3.0 (not g++) to compile C++ programs on Linux,
# we will gets some problems when linking static programs.
# The following code is used to fix this problem.
@@ -326,8 +327,7 @@ then
then
if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1
then
- CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW"
- CXXLDFLAGS="$CXXLDFLAGS -Wl,--defsym -Wl,__cxa_pure_virtual=0"
+ CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW -DDEFINE_CXA_PURE_VIRTUAL"
fi
fi
fi
@@ -367,6 +367,7 @@ AC_PATH_PROG(HOSTNAME, hostname, hostname)
# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and
# fall back to 'tar' otherwise and hope that it's a GNU tar as well
AC_CHECK_PROGS(TAR, gnutar gtar tar)
+
dnl We use a path for perl so the script startup works
dnl We make sure to use perl, not perl5, in hopes that the RPMs will
dnl not depend on the perl5 binary being installed (probably a bug in RPM)
@@ -453,7 +454,11 @@ fi
NOINST_LDFLAGS=
AC_ARG_WITH(other-libc,
- [ --with-other-libc=/path/to/other/libc/dir Link against libc and other standard libraries installed in the specified non-standard location overriding default. Originally added to be able to link against glibc 2.2 without making the user upgrade the standard libc installation ],
+ [ --with-other-libc=DIR Link against libc and other standard libraries
+ installed in the specified non-standard location
+ overriding default. Originally added to be able to
+ link against glibc 2.2 without making the user
+ upgrade the standard libc installation.],
[
other_libc_include="$withval/include"
other_libc_lib="$withval/lib"
@@ -504,7 +509,6 @@ AC_SUBST(NOINST_LDFLAGS)
AC_ARG_WITH(server-suffix,
[ --with-server-suffix Append value to the version string.],
- # I heard that 'cut' isn't portable. Isn't there a better way?
[ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ],
[ MYSQL_SERVER_SUFFIX= ]
)
@@ -629,10 +633,9 @@ AC_ARG_WITH(mysqld-user,
)
AC_SUBST(MYSQLD_USER)
-# If we should allove LOAD DATA LOCAL
+# If we should allow LOAD DATA LOCAL
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
AC_ARG_ENABLE(local-infile,
- [ --enable-local-infile
Enable LOAD DATA LOCAL INFILE (default: disabled)],
[
ENABLED_LOCAL_INFILE=$enableval
@@ -701,7 +704,7 @@ MYSQL_CHECK_ZLIB_WITH_COMPRESS($with_named_zlib)
#--------------------------------------------------------------------
AC_ARG_WITH(libwrap,
-[ --with-libwrap[=DIR] Compile in libwrap (tcp_wrappers) support],[
+[ --with-libwrap[=DIR] Compile in libwrap (tcp_wrappers) support],[
case "$with_libwrap" in
no) : ;;
yes|*)
@@ -892,8 +895,8 @@ case $SYSTEM_TYPE in
;;
*hpux10.20*)
echo "Enabling workarounds for hpux 10.20"
- CFLAGS="$CFLAGS -DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
- CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
+ CFLAGS="$CFLAGS -DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX"
+ CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX"
if test "$with_named_thread" = "no"
then
echo "Using --with-named-thread=-lpthread"
@@ -925,7 +928,7 @@ case $SYSTEM_TYPE in
*darwin*)
if test "$ac_cv_prog_gcc" = "yes"
then
- CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ"
+ CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
CXXFLAGS="$CXXFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ"
MAX_C_OPTIMIZE="-O"
with_named_curses=""
@@ -1003,9 +1006,9 @@ then
if test "$IS_LINUX" = "true"
then
AC_MSG_ERROR([This is a linux system and Linuxthreads was not
-found. On linux Linuxthreads should be used. So install Linuxthreads
-(or a new glibc) and try again. See the Installation chapter in the
-Reference Manual.])
+found. On linux Linuxthreads should be used. Please install Linuxthreads
+(or a new glibc) and try again. See the Installation chapter in the
+Reference Manual for more information.])
else
AC_MSG_CHECKING("DEC threads")
if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a
@@ -1186,7 +1189,7 @@ then
else
# CC="$CC -Kthread -DOpenUNIX8";
# CXX="$CXX -Kthread -DOpenUNIX8";
- CC="$CC -Kthread -DUNIXWARE_7";
+ CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
CXX="$CXX -Kthread -DUNIXWARE_7";
fi
AC_MSG_RESULT("yes")
@@ -1315,11 +1318,11 @@ AC_CHECK_LIB(pthread,strtok_r)
LIBS="$my_save_LIBS"
if test "$ac_cv_lib_pthread_strtok_r" = "no"
then
- my_save_LIBS="$LIBS"
AC_CHECK_LIB(c_r,strtok_r)
case "$with_osf32_threads---$target_os" in
# Don't keep -lc_r in LIBS; -pthread handles it magically
- yes---* | *---freebsd* ) LIBS="$my_save_LIBS" ;;
+ yes---* | *---freebsd* | *---hpux*) LIBS="$my_save_LIBS" ;;
+
esac
AC_CHECK_FUNCS(strtok_r pthread_init)
else
@@ -1363,6 +1366,7 @@ else
DEBUG_OPTIMIZE_CXX=""
OPTIMIZE_CXXFLAGS="-O"
fi
+
AC_ARG_WITH(debug,
[ --without-debug Build a production version without debugging code],
[with_debug=$withval],
@@ -1462,6 +1466,7 @@ install the static libraries and try again. If this isn't the problem,
examine config.log for possible errors. If you want to report this, use
'scripts/mysqlbug' and include at least the last 20 rows from config.log!])
fi
+AC_CHECK_SIZEOF(char*, 4)
AC_CHECK_SIZEOF(int, 4)
if test "$ac_cv_sizeof_int" -eq 0
then
@@ -1529,7 +1534,7 @@ AC_SUBST(MAKE_SHELL)
AC_CHECK_HEADERS(varargs.h stdarg.h dirent.h locale.h ndir.h sys/dir.h \
sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
-paths.h)
+paths.h semaphore.h)
# Already-done: strcasecmp
AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
@@ -1554,6 +1559,17 @@ AC_SUBST(TERMCAP_LIB)
#########################################################################
dnl Checks for library functions.
+
+#
+# The following code disables intrinsic function support while we test for
+# library functions. This is to avoid configure problems with Intel ecc
+# compiler
+
+ORG_CFLAGS="$CFLAGS"
+if test "$GCC" != "yes"; then
+ AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[])
+fi
+
AC_FUNC_MMAP
AC_TYPE_SIGNAL
MYSQL_TYPE_QSORT
@@ -1576,6 +1592,8 @@ AC_CHECK_FUNCS(alarm bmove \
pthread_condattr_create rwlock_init pthread_rwlock_rdlock \
fchmod getpass getpassphrase initgroups mlockall)
+CFLAGS="$ORG_CFLAGS"
+
# Sanity check: We chould not have any fseeko symbol unless
# large_file_support=yes
AC_CHECK_FUNCS(fseeko,
@@ -1595,13 +1613,17 @@ ac_save_CXXFLAGS="$CXXFLAGS"
AC_CACHE_CHECK([style of gethost* routines], mysql_cv_gethost_style,
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
-# Do not treat warnings as errors if we are linking agaist other libc
+
+# Do not treat warnings as errors if we are linking against other libc
# this is to work around gcc not being permissive on non-system includes
# with respect to ANSI C++
-if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
+# We also remove the -fbranch-probabilities option as this will give warnings
+# about not profiled code, which confuses configure
+if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
then
- CXXFLAGS="$CXXFLAGS -Werror"
+ CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed 's/-fbranch-probabilities//'`
fi
+
AC_TRY_COMPILE(
[#undef inline
#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
@@ -1746,7 +1768,7 @@ then
AC_DEFINE(HAVE_READDIR_R)
fi
-# Check definition av posix sigwait()
+# Check definition of posix sigwait()
AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
AC_TRY_LINK(
[#if !defined(SCO) && !defined(__osf__)
@@ -1769,7 +1791,7 @@ fi
if test "$mysql_cv_sigwait" != "POSIX"
then
unset mysql_cv_sigwait
-# Check definition av posix sigwait()
+# Check definition of posix sigwait()
AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
AC_TRY_LINK(
[#if !defined(SCO) && !defined(__osf__)
@@ -1949,8 +1971,11 @@ CHARSETS_COMPLEX="big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ucs2 ujis u
DEFAULT_CHARSET=latin1
AC_DIVERT_POP
+dnl fix this later..
+dnl [ --with-charset=CHARSET Use CHARSET by default (one of: $CHARSETS_AVAILABLE; Default is $DEFAULT_CHARSET)],
+
AC_ARG_WITH(charset,
- [ --with-charset=CHARSET Use CHARSET by default (one of: $CHARSETS_AVAILABLE; Default is $DEFAULT_CHARSET)],
+ [ --with-charset=CHARSET Use CHARSET by default (Default is latin1)],
[default_charset="$withval"],
[default_charset="$DEFAULT_CHARSET"])
@@ -2316,6 +2341,7 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile \
strings/Makefile regex/Makefile heap/Makefile \
bdb/Makefile \
myisam/Makefile myisammrg/Makefile \
+ os2/Makefile os2/include/Makefile os2/include/sys/Makefile \
man/Makefile BUILD/Makefile readline/Makefile vio/Makefile \
libmysql_r/Makefile libmysqld/Makefile libmysqld/examples/Makefile \
libmysql/Makefile client/Makefile os2/Makefile \
diff --git a/dbug/dbug.c b/dbug/dbug.c
index 88d8043c0e5..3f6c9b2f980 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -706,10 +706,11 @@ char ***_sframep_ __attribute__((unused)))
if (!_no_db_)
{
int save_errno=errno;
- /* Sasha: the test below is so we could call functions with DBUG_ENTER
- before my_thread_init(). I needed this because I suspected corruption
- of a block allocated by my_thread_init() itself, so I wanted to use
- my_malloc()/my_free() in my_thread_init()/my_thread_end()
+ /*
+ Sasha: the test below is so we could call functions with DBUG_ENTER
+ before my_thread_init(). I needed this because I suspected corruption
+ of a block allocated by my_thread_init() itself, so I wanted to use
+ my_malloc()/my_free() in my_thread_init()/my_thread_end()
*/
if (!(state=code_state()))
return;
diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c
index e606f38d179..f19ef467b5c 100644
--- a/extra/resolve_stack_dump.c
+++ b/extra/resolve_stack_dump.c
@@ -77,7 +77,8 @@ static void usage()
printf("MySQL AB, by Sasha Pachev\n");
printf("This software comes with ABSOLUTELY NO WARRANTY\n\n");
printf("Resolve numeric stack strace dump into symbols.\n\n");
- printf("Usage: %s [OPTIONS] symbols-file [numeric-dump-file]\n", my_progname);
+ printf("Usage: %s [OPTIONS] symbols-file [numeric-dump-file]\n",
+ my_progname);
my_print_help(my_long_options);
my_print_variables(my_long_options);
printf("\n\
@@ -159,14 +160,14 @@ static void open_files()
fp_out = stdout;
fp_dump = stdin;
- if(dump_fname && !(fp_dump = my_fopen(dump_fname, O_RDONLY, MYF(MY_WME))))
+ if (dump_fname && !(fp_dump = my_fopen(dump_fname, O_RDONLY, MYF(MY_WME))))
die("Could not open %s", dump_fname);
/* if name not given, assume stdin*/
- if(!sym_fname)
+ if (!sym_fname)
die("Please run nm --numeric-sort on mysqld binary that produced stack \
trace dump and specify the path to it with -s or --symbols-file");
- if(!(fp_sym = my_fopen(sym_fname, O_RDONLY, MYF(MY_WME))))
+ if (!(fp_sym = my_fopen(sym_fname, O_RDONLY, MYF(MY_WME))))
die("Could not open %s", sym_fname);
}
@@ -174,10 +175,10 @@ trace dump and specify the path to it with -s or --symbols-file");
static uchar hex_val(char c)
{
uchar l;
- if(my_isdigit(system_charset_info,c))
+ if (my_isdigit(system_charset_info,c))
return c - '0';
l = my_tolower(system_charset_info,c);
- if(l < 'a' || l > 'f')
+ if (l < 'a' || l > 'f')
return HEX_INVALID;
return (uchar)10 + ((uchar)c - (uchar)'a');
}
@@ -200,25 +201,20 @@ static int init_sym_entry(SYM_ENTRY* se, char* buf)
char* p, *p_end;
se->addr = (uchar*)read_addr(&buf);
- if(!se->addr)
+ if (!se->addr)
return -1;
- while ( my_isspace(system_charset_info,*buf++))
+ while (my_isspace(system_charset_info,*buf++))
/* empty */;
while (my_isspace(system_charset_info,*buf++))
/* empty - skip more space */;
--buf;
/* now we are on the symbol */
- for(p = se->symbol, p_end = se->symbol + sizeof(se->symbol) - 1;
- *buf != '\n' && *buf; ++buf,++p )
- {
- if(p < p_end)
- *p = *buf;
- else
- break;
- }
+ for (p = se->symbol, p_end = se->symbol + sizeof(se->symbol) - 1;
+ *buf != '\n' && *buf && p < p_end; ++buf,++p)
+ *p = *buf;
*p = 0;
- if(!strcmp(se->symbol, "gcc2_compiled."))
+ if (!strcmp(se->symbol, "gcc2_compiled."))
return -1;
return 0;
}
@@ -226,18 +222,18 @@ static int init_sym_entry(SYM_ENTRY* se, char* buf)
static void init_sym_table()
{
char buf[512];
- if(my_init_dynamic_array(&sym_table, sizeof(SYM_ENTRY), INIT_SYM_TABLE,
- INC_SYM_TABLE))
+ if (my_init_dynamic_array(&sym_table, sizeof(SYM_ENTRY), INIT_SYM_TABLE,
+ INC_SYM_TABLE))
die("Failed in my_init_dynamic_array() -- looks like out of memory problem");
- while(fgets(buf, sizeof(buf), fp_sym))
- {
- SYM_ENTRY se;
- if(init_sym_entry(&se, buf))
- continue;
- if(insert_dynamic(&sym_table, (gptr)&se))
- die("insert_dynamic() failed - looks like we are out of memory");
- }
+ while (fgets(buf, sizeof(buf), fp_sym))
+ {
+ SYM_ENTRY se;
+ if (init_sym_entry(&se, buf))
+ continue;
+ if (insert_dynamic(&sym_table, (gptr)&se))
+ die("insert_dynamic() failed - looks like we are out of memory");
+ }
verify_sort();
}
@@ -252,66 +248,69 @@ static void verify_sort()
uint i;
uchar* last = 0;
- for(i = 0; i < sym_table.elements; i++)
- {
- SYM_ENTRY se;
- get_dynamic(&sym_table, (gptr)&se, i);
- if(se.addr < last)
- die("sym table does not appear to be sorted, did you forget \
+ for (i = 0; i < sym_table.elements; i++)
+ {
+ SYM_ENTRY se;
+ get_dynamic(&sym_table, (gptr)&se, i);
+ if (se.addr < last)
+ die("sym table does not appear to be sorted, did you forget \
--numeric-sort arg to nm? trouble addr = %p, last = %p", se.addr, last);
- last = se.addr;
- }
+ last = se.addr;
+ }
}
+
static SYM_ENTRY* resolve_addr(uchar* addr, SYM_ENTRY* se)
{
uint i;
get_dynamic(&sym_table, (gptr)se, 0);
- if(addr < se->addr)
+ if (addr < se->addr)
return 0;
- for(i = 1; i < sym_table.elements; i++)
+ for (i = 1; i < sym_table.elements; i++)
+ {
+ get_dynamic(&sym_table, (gptr)se, i);
+ if (addr < se->addr)
{
- get_dynamic(&sym_table, (gptr)se, i);
- if(addr < se->addr)
- {
- get_dynamic(&sym_table, (gptr)se, i - 1);
- return se;
- }
+ get_dynamic(&sym_table, (gptr)se, i - 1);
+ return se;
}
+ }
return se;
}
+
static void do_resolve()
{
char buf[1024], *p;
- while(fgets(buf, sizeof(buf), fp_dump))
+ while (fgets(buf, sizeof(buf), fp_dump))
+ {
+ p = buf;
+ /* skip space */
+ while (my_isspace(system_charset_info,*p))
+ ++p;
+
+ if (*p++ == '0' && *p++ == 'x')
{
- p = buf;
- while(my_isspace(system_charset_info,*p))
- ++p;
- /* skip space */;
-
- if(*p++ == '0' && *p++ == 'x')
- {
- SYM_ENTRY se ;
- uchar* addr = (uchar*)read_addr(&p);
- if(resolve_addr(addr, &se))
- fprintf(fp_out, "%p %s + %d\n", addr, se.symbol,
- (int) (addr - se.addr));
- else
- fprintf(fp_out, "%p (?)\n", addr);
-
- }
+ SYM_ENTRY se ;
+ uchar* addr = (uchar*)read_addr(&p);
+ if (resolve_addr(addr, &se))
+ fprintf(fp_out, "%p %s + %d\n", addr, se.symbol,
+ (int) (addr - se.addr));
else
- {
- fputs(buf, fp_out);
- continue;
- }
+ fprintf(fp_out, "%p (?)\n", addr);
+
+ }
+ else
+ {
+ fputs(buf, fp_out);
+ continue;
}
+ }
}
+
int main(int argc, char** argv)
{
MY_INIT(argv[0]);
diff --git a/include/Makefile.am b/include/Makefile.am
index 52a6d4fd758..a3aebfa70e0 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -18,18 +18,18 @@
BUILT_SOURCES = mysql_version.h m_ctype.h my_config.h
pkginclude_HEADERS = dbug.h m_string.h my_sys.h my_list.h \
mysql.h mysql_com.h mysqld_error.h mysql_embed.h \
- my_semaphore.h my_pthread.h my_no_pthread.h raid.h errmsg.h \
- my_global.h my_net.h my_alloc.h\
- sslopt-case.h sslopt-longopts.h sslopt-usage.h \
+ my_semaphore.h my_pthread.h my_no_pthread.h raid.h \
+ errmsg.h my_global.h my_net.h my_alloc.h\
+ sslopt-longopts.h sslopt-usage.h \
sslopt-vars.h $(BUILT_SOURCES)
-noinst_HEADERS = config-win.h \
+noinst_HEADERS = config-win.h config-os2.h \
nisam.h heap.h merge.h my_bitmap.h\
myisam.h myisampack.h myisammrg.h ft_global.h\
my_dir.h mysys_err.h my_base.h \
- my_nosys.h my_alarm.h queues.h \
- my_tree.h hash.h thr_alarm.h thr_lock.h \
- t_ctype.h violite.h md5.h mysql_version.h.in \
- my_handler.h my_getopt.h
+ my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
+ my_aes.h my_getopt.h my_tree.h hash.h thr_alarm.h \
+ thr_lock.h t_ctype.h violite.h md5.h \
+ mysql_version.h.in my_handler.h
# mysql_version.h are generated
SUPERCLEANFILES = mysql_version.h my_config.h
diff --git a/include/config-os2.h b/include/config-os2.h
index 9064cd5a5bb..7e9684ae3f5 100644
--- a/include/config-os2.h
+++ b/include/config-os2.h
@@ -26,6 +26,7 @@
#include <os2.h>
#include <math.h>
#include <io.h>
+#include <types.h>
/* Define to name of system eg solaris*/
#define SYSTEM_TYPE "IBM OS/2 Warp"
@@ -55,6 +56,8 @@
#define FILE_BINARY O_BINARY /* my_fopen in binary mode */
#define S_IROTH S_IREAD /* for my_lib */
+#define CANT_DELETE_OPEN_FILES /* saves open files in a list, for delayed delete */
+
#define O_NONBLOCK 0x10
#define NO_OPEN_3 /* For my_create() */
@@ -64,10 +67,10 @@
#define NO_FCNTL_NONBLOCK
#define EFBIG E2BIG
-//#define ENFILE EMFILE
-//#define ENAMETOOLONG (EOS2ERR+2)
-//#define ETIMEDOUT 145
-//#define EPIPE 146
+/*#define ENFILE EMFILE */
+/*#define ENAMETOOLONG (EOS2ERR+2) */
+/*#define ETIMEDOUT 145 */
+/*#define EPIPE 146 */
#define EROFS 147
#define sleep(A) DosSleep((A)*1000)
@@ -84,7 +87,7 @@
#define F_WRLCK 2 /* Write lock. */
#define F_UNLCK 0 /* Remove lock. */
-#define S_IFMT 0xF000 /* Mask for file type */
+#define S_IFMT 0x17000 /* Mask for file type */
#define F_TO_EOF 0L /* Param to lockf() to lock rest of file */
#define HUGE_PTR
@@ -129,7 +132,7 @@ typedef unsigned long long os_off_t;
#define HAVE_ALLOCA 1
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-//#define HAVE_ALLOCA_H 1
+/* #define HAVE_ALLOCA_H 1 */
/* Define if you don't have vprintf but do have _doprnt. */
/* #undef HAVE_DOPRNT */
@@ -145,7 +148,7 @@ typedef unsigned long long os_off_t;
#define HAVE_ST_RDEV 1
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
-//#define HAVE_SYS_WAIT_H 1
+/* #define HAVE_SYS_WAIT_H 1 */
/* Define if you don't have tm_zone but do have the external array
tzname. */
@@ -216,7 +219,7 @@ typedef unsigned long long os_off_t;
#define HAVE_BOOL 1
/* Have berkeley db installed */
-//#define HAVE_BERKELEY_DB 1
+/* #define HAVE_BERKELEY_DB 1 */
/* DSB style signals ? */
/* #undef HAVE_BSD_SIGNALS */
@@ -268,7 +271,7 @@ typedef unsigned long long os_off_t;
/* #undef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */
/* READLINE: */
-#define HAVE_POSIX_SIGNALS 1
+#define HAVE_POSIX_SIGNALS 0
/* sigwait with one argument */
/* #undef HAVE_NONPOSIX_SIGWAIT */
@@ -395,7 +398,7 @@ typedef unsigned long long os_off_t;
#define HAVE_CHSIZE 1
/* Define if you have the cuserid function. */
-//#define HAVE_CUSERID 1
+/* #define HAVE_CUSERID 1 */
/* Define if you have the dlerror function. */
#define HAVE_DLERROR 1
@@ -407,7 +410,7 @@ typedef unsigned long long os_off_t;
/* #undef HAVE_FCHMOD */
/* Define if you have the fcntl function. */
-//#define HAVE_FCNTL 1
+/* #define HAVE_FCNTL 1 */
/* Define if you have the fconvert function. */
/* #undef HAVE_FCONVERT */
@@ -425,7 +428,7 @@ typedef unsigned long long os_off_t;
/* #undef HAVE_FSEEKO */
/* Define if you have the ftruncate function. */
-//#define HAVE_FTRUNCATE 1
+/* #define HAVE_FTRUNCATE 1 */
/* Define if you have the getcwd function. */
#define HAVE_GETCWD 1
@@ -440,16 +443,16 @@ typedef unsigned long long os_off_t;
#define HAVE_GETPAGESIZE 1
/* Define if you have the getpass function. */
-//#define HAVE_GETPASS 1
+/*#define HAVE_GETPASS 1 */
/* Define if you have the getpassphrase function. */
/* #undef HAVE_GETPASSPHRASE */
/* Define if you have the getpwnam function. */
-//#define HAVE_GETPWNAM 1
+/* #define HAVE_GETPWNAM 1 */
/* Define if you have the getpwuid function. */
-//#define HAVE_GETPWUID 1
+/* #define HAVE_GETPWUID 1 */
/* Define if you have the getrlimit function. */
/* #undef HAVE_GETRLIMIT */
@@ -491,7 +494,7 @@ typedef unsigned long long os_off_t;
#define HAVE_MEMMOVE 1
/* Define if you have the mkstemp function. */
-//#define HAVE_MKSTEMP 1
+/* #define HAVE_MKSTEMP 1 */
/* Define if you have the mlockall function. */
/* #undef HAVE_MLOCKALL */
@@ -581,7 +584,7 @@ typedef unsigned long long os_off_t;
/* #undef HAVE_SIGTHREADMASK */
/* Define if you have the snprintf function. */
-//#define HAVE_SNPRINTF 1
+/* #define HAVE_SNPRINTF 1 */
/* Define if you have the socket function. */
#define HAVE_SOCKET 1
@@ -635,7 +638,7 @@ typedef unsigned long long os_off_t;
/* #undef HAVE_VIDATTR */
/* Define if you have the <alloca.h> header file. */
-//#define HAVE_ALLOCA_H 1
+/* #define HAVE_ALLOCA_H 1 */
/* Define if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
@@ -647,10 +650,10 @@ typedef unsigned long long os_off_t;
#define HAVE_CRYPT_H 1
/* Define if you have the <curses.h> header file. */
-//#define HAVE_CURSES_H 1
+/* #define HAVE_CURSES_H 1 */
/* Define if you have the <dirent.h> header file. */
-//#define HAVE_DIRENT_H 1
+/* #define HAVE_DIRENT_H 1 */
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
@@ -662,7 +665,7 @@ typedef unsigned long long os_off_t;
/* #undef HAVE_FLOATINGPOINT_H */
/* Define if you have the <grp.h> header file. */
-//#define HAVE_GRP_H 1
+/* #define HAVE_GRP_H 1 */
/* Define if you have the <ieeefp.h> header file. */
/* #undef HAVE_IEEEFP_H */
@@ -686,7 +689,7 @@ typedef unsigned long long os_off_t;
/* #undef HAVE_PATHS_H */
/* Define if you have the <pwd.h> header file. */
-//#define HAVE_PWD_H 1
+/* #define HAVE_PWD_H 1 */
/* Define if you have the <sched.h> header file. */
/* #undef HAVE_SCHED_H */
@@ -707,16 +710,16 @@ typedef unsigned long long os_off_t;
#define HAVE_STRING_H 1
/* Define if you have the <strings.h> header file. */
-//#define HAVE_STRINGS_H 1
+/* #define HAVE_STRINGS_H 1 */
/* Define if you have the <synch.h> header file. */
/* #undef HAVE_SYNCH_H */
/* Define if you have the <sys/dir.h> header file. */
-//#define HAVE_SYS_DIR_H 1
+/* #define HAVE_SYS_DIR_H 1 */
/* Define if you have the <sys/file.h> header file. */
-//#define HAVE_SYS_FILE_H 1
+/* #define HAVE_SYS_FILE_H 1 */
/* Define if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1
@@ -758,7 +761,7 @@ typedef unsigned long long os_off_t;
/* #undef HAVE_SYS_VADVISE_H */
/* Define if you have the <sys/wait.h> header file. */
-//#define HAVE_SYS_WAIT_H 1
+/* #define HAVE_SYS_WAIT_H 1 */
/* Define if you have the <term.h> header file. */
/* #undef HAVE_TERM_H */
@@ -767,13 +770,13 @@ typedef unsigned long long os_off_t;
/* #undef HAVE_TERMBITS_H */
/* Define if you have the <termcap.h> header file. */
-//#define HAVE_TERMCAP_H 1
+/* #define HAVE_TERMCAP_H 1 */
/* Define if you have the <termio.h> header file. */
-//#define HAVE_TERMIO_H 1
+/* /#define HAVE_TERMIO_H 1 */
/* Define if you have the <termios.h> header file. */
-//#define HAVE_TERMIOS_H 1
+/* #define HAVE_TERMIOS_H 1 */
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
@@ -826,4 +829,4 @@ typedef unsigned long long os_off_t;
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
-#endif // __CONFIG_OS2_H__
+#endif /* __CONFIG_OS2_H__ */
diff --git a/include/config-win.h b/include/config-win.h
index 12a89bec21b..c0d0dad894e 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -24,11 +24,11 @@
#include <malloc.h>
#if defined(__NT__)
-#define SYSTEM_TYPE "NT"
+#define SYSTEM_TYPE "NT"
#elif defined(__WIN2000__)
-#define SYSTEM_TYPE "WIN2000"
+#define SYSTEM_TYPE "WIN2000"
#else
-#define SYSTEM_TYPE "Win95/Win98"
+#define SYSTEM_TYPE "Win95/Win98"
#endif
#if defined(_WIN64) || defined(WIN64)
@@ -43,23 +43,23 @@
#endif
#endif /* _WIN64 */
#ifndef __WIN__
-#define __WIN__ /* To make it easier in VC++ */
+#define __WIN__ /* To make it easier in VC++ */
#endif
/* File and lock constants */
-#define O_SHARE 0x1000 /* Open file in sharing mode */
+#define O_SHARE 0x1000 /* Open file in sharing mode */
#ifdef __BORLANDC__
-#define F_RDLCK LK_NBLCK /* read lock */
-#define F_WRLCK LK_NBRLCK /* write lock */
-#define F_UNLCK LK_UNLCK /* remove lock(s) */
+#define F_RDLCK LK_NBLCK /* read lock */
+#define F_WRLCK LK_NBRLCK /* write lock */
+#define F_UNLCK LK_UNLCK /* remove lock(s) */
#else
-#define F_RDLCK _LK_NBLCK /* read lock */
-#define F_WRLCK _LK_NBRLCK /* write lock */
-#define F_UNLCK _LK_UNLCK /* remove lock(s) */
+#define F_RDLCK _LK_NBLCK /* read lock */
+#define F_WRLCK _LK_NBRLCK /* write lock */
+#define F_UNLCK _LK_UNLCK /* remove lock(s) */
#endif
-#define F_EXCLUSIVE 1 /* We have only exclusive locking */
-#define F_TO_EOF (INT_MAX32/2) /* size for lock of all file */
+#define F_EXCLUSIVE 1 /* We have only exclusive locking */
+#define F_TO_EOF (INT_MAX32/2) /* size for lock of all file */
#define F_OK 0 /* parameter to access() */
#define S_IROTH S_IREAD /* for my_lib */
@@ -70,15 +70,15 @@
#define O_SHORT_LIVED 0
#define SH_DENYNO _SH_DENYNO
#else
-#define O_BINARY _O_BINARY /* compability with MSDOS */
-#define FILE_BINARY _O_BINARY /* my_fopen in binary mode */
-#define O_TEMPORARY _O_TEMPORARY
-#define O_SHORT_LIVED _O_SHORT_LIVED
-#define SH_DENYNO _SH_DENYNO
+#define O_BINARY _O_BINARY /* compability with MSDOS */
+#define FILE_BINARY _O_BINARY /* my_fopen in binary mode */
+#define O_TEMPORARY _O_TEMPORARY
+#define O_SHORT_LIVED _O_SHORT_LIVED
+#define SH_DENYNO _SH_DENYNO
#endif
#define NO_OPEN_3 /* For my_create() */
-#define SIGQUIT SIGTERM /* No SIGQUIT */
+#define SIGQUIT SIGTERM /* No SIGQUIT */
#undef _REENTRANT /* Crashes something for win32 */
#undef SAFE_MUTEX /* Can't be used on windows */
@@ -89,15 +89,15 @@
/* Type information */
-typedef unsigned short ushort;
-typedef unsigned int uint;
+typedef unsigned short ushort;
+typedef unsigned int uint;
typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */
-typedef __int64 longlong;
+typedef __int64 longlong;
typedef int sigset_t;
#define longlong_defined
/* off_t should not be __int64 because of conflicts in header files;
Use my_off_t or os_off_t instead */
-typedef long off_t;
+typedef long off_t;
typedef __int64 os_off_t;
#ifdef _WIN64
typedef UINT_PTR rf_SetTimer;
@@ -109,7 +109,7 @@ typedef uint rf_SetTimer;
#define Socket_defined
#define my_socket SOCKET
#define bool BOOL
-#define SIGPIPE SIGINT
+#define SIGPIPE SIGINT
#define RETQSORTTYPE void
#define QSORT_TYPE_IS_VOID
#define RETSIGTYPE void
@@ -118,7 +118,9 @@ typedef uint rf_SetTimer;
#define bool_defined
#define byte_defined
#define HUGE_PTR
-#define STDCALL __stdcall /* Used by libmysql.dll */
+#define STDCALL __stdcall /* Used by libmysql.dll */
+#define isnan(X) _isnan(X)
+#define finite(X) _finite(X)
#ifndef UNDEF_THREAD_HACK
#define THREAD
@@ -201,7 +203,7 @@ inline double ulonglong2double(ulonglong value)
(((uint32) ((uchar) (A)[1])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16) +\
(((uint32) ((uchar) (A)[3])) << 24)) +\
- (((ulonglong) ((uchar) (A)[4])) << 32))
+ (((ulonglong) ((uchar) (A)[4])) << 32))
#define uint8korr(A) (*((ulonglong *) (A)))
#define sint8korr(A) (*((longlong *) (A)))
#define int2store(T,A) *((uint16*) (T))= (uint16) (A)
@@ -247,14 +249,15 @@ inline double ulonglong2double(ulonglong value)
#define HAVE_FLOAT_H
#define HAVE_LIMITS_H
#define HAVE_STDDEF_H
-#define HAVE_RINT /* defined in this file */
-#define NO_FCNTL_NONBLOCK /* No FCNTL */
+#define HAVE_RINT /* defined in this file */
+#define NO_FCNTL_NONBLOCK /* No FCNTL */
#define HAVE_ALLOCA
#define HAVE_STRPBRK
#define HAVE_STRSTR
#define HAVE_COMPRESS
#define HAVE_CREATESEMAPHORE
-
+#define HAVE_ISNAN
+#define HAVE_FINITE
#define HAVE_ISAM /* We want to have support for ISAM in 4.0 */
#ifdef NOT_USED
@@ -276,8 +279,8 @@ inline double ulonglong2double(ulonglong value)
#ifdef _CUSTOMCONFIG_
#include <custom_conf.h>
#else
-#define DEFAULT_MYSQL_HOME "c:\\mysql"
-#define PACKAGE "mysql"
+#define DEFAULT_MYSQL_HOME "c:\\mysql"
+#define PACKAGE "mysql"
#define DEFAULT_BASEDIR "C:\\"
#define SHAREDIR "share"
#define DEFAULT_CHARSET_HOME "C:/mysql/"
@@ -303,6 +306,6 @@ inline double ulonglong2double(ulonglong value)
pthread_mutex_lock((L)); (V)+=(C); pthread_mutex_unlock((L));
#define thread_safe_sub(V,C,L) \
pthread_mutex_lock((L)); (V)-=(C); pthread_mutex_unlock((L));
-#define statistic_add(V,C,L) (V)+=(C)
+#define statistic_add(V,C,L) (V)+=(C)
#endif
#define statistic_increment(V,L) thread_safe_increment((V),(L))
diff --git a/include/ft_global.h b/include/ft_global.h
index 4218eb75aa7..449cc57729f 100644
--- a/include/ft_global.h
+++ b/include/ft_global.h
@@ -30,7 +30,8 @@ extern "C" {
#define HA_FT_MAXLEN 254
typedef struct st_ft_info FT_INFO;
-struct _ft_vft {
+struct _ft_vft
+{
int (*read_next)(FT_INFO *, char *);
float (*find_relevance)(FT_INFO *, byte *, uint);
void (*close_search)(FT_INFO *);
@@ -39,7 +40,8 @@ struct _ft_vft {
};
#ifndef FT_CORE
-struct st_ft_info {
+struct st_ft_info
+{
struct _ft_vft *please; /* INTERCAL style :-) */
};
#endif
diff --git a/include/my_aes.h b/include/my_aes.h
new file mode 100644
index 00000000000..5852baa5892
--- /dev/null
+++ b/include/my_aes.h
@@ -0,0 +1,66 @@
+/* Copyright (C) 2002 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
+/* Header file for my_aes.c */
+/* Wrapper to give simple interface for MySQL to AES standard encryption */
+
+#include "rijndael.h"
+
+C_MODE_START
+
+#define AES_KEY_LENGTH 128 /* Must be 128 192 or 256 */
+
+/*
+ my_aes_encrypt - Crypt buffer with AES encryption algorithm.
+ source - Pointer to data for encryption
+ source_length - size of encryption data
+ dest - buffer to place encrypted data (must be large enough)
+ key - Key to be used for encryption
+ kel_length - Length of the key. Will handle keys of any length
+
+ returns - size of encrypted data, or negative in case of error.
+*/
+
+int my_aes_encrypt(const char *source, int source_length, char *dest,
+ const char *key, int key_length);
+
+/*
+ my_aes_decrypt - DeCrypt buffer with AES encryption algorithm.
+ source - Pointer to data for decryption
+ source_length - size of encrypted data
+ dest - buffer to place decrypted data (must be large enough)
+ key - Key to be used for decryption
+ kel_length - Length of the key. Will handle keys of any length
+
+ returns - size of original data, or negative in case of error.
+*/
+
+
+int my_aes_decrypt(const char *source, int source_length, char *dest,
+ const char *key, int key_length);
+
+/*
+ my_aes_get_size - get size of buffer which will be large enough for encrypted
+ data
+ source_length - length of data to be encrypted
+
+ returns - size of buffer required to store encrypted data
+*/
+
+int my_aes_get_size(int source_length);
+
+C_MODE_END
diff --git a/include/my_alloc.h b/include/my_alloc.h
index 0857c8886c5..31f1fb7165f 100644
--- a/include/my_alloc.h
+++ b/include/my_alloc.h
@@ -18,21 +18,33 @@
Data structures for mysys/my_alloc.c (root memory allocator)
*/
-#ifndef ST_USED_MEM_DEFINED
-#define ST_USED_MEM_DEFINED
-typedef struct st_used_mem { /* struct for once_alloc (block) */
+#ifndef _my_alloc_h
+#define _my_alloc_h
+
+#define MAX_BLOCK_USAGE_BEFORE_DROP 10
+
+typedef struct st_used_mem
+{ /* struct for once_alloc (block) */
struct st_used_mem *next; /* Next block in use */
unsigned int left; /* memory left in block */
unsigned int size; /* size of block */
} USED_MEM;
-typedef struct st_mem_root {
+
+
+typedef struct st_mem_root
+{
USED_MEM *free; /* blocks with free memory in it */
USED_MEM *used; /* blocks almost without free memory */
USED_MEM *pre_alloc; /* preallocated block */
- /* if block have less memory it will be put in 'used' list*/
- unsigned int min_malloc;
- unsigned int block_size; /* initial block size */
- unsigned int block_num; /* allocated blocks counter */
+ /* if block have less memory it will be put in 'used' list */
+ unsigned int min_malloc;
+ unsigned int block_size; /* initial block size */
+ unsigned int block_num; /* allocated blocks counter */
+ /*
+ first free block in queue test counter (if it exceed
+ MAX_BLOCK_USAGE_BEFORE_DROP block will be droped in 'used' list)
+ */
+ unsigned int first_block_usage;
void (*error_handler)(void);
} MEM_ROOT;
diff --git a/include/my_getopt.h b/include/my_getopt.h
index 3b50fbe2ded..3b4551b445e 100644
--- a/include/my_getopt.h
+++ b/include/my_getopt.h
@@ -49,4 +49,6 @@ extern int handle_options (int *argc, char ***argv,
extern void my_print_help(const struct my_option *options);
extern void my_print_variables(const struct my_option *options);
+ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp);
+my_bool getopt_compare_strings(const char *s, const char *t, uint length);
C_MODE_END
diff --git a/include/my_global.h b/include/my_global.h
index 01910eb1342..e65e803c335 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -14,8 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* This is the main include file that should included 'first' in every
- C file. */
+/* This is the include file that should be included 'first' in every C file. */
#ifndef _global_h
#define _global_h
@@ -51,16 +50,6 @@
#endif
#endif /* _WIN32... */
-/* sometimes we want to make sure that the variable is not put into
- a register in debugging mode so we can see its value in the core
-*/
-
-#ifndef DBUG_OFF
-#define dbug_volatile volatile
-#else
-#define dbug_volatile
-#endif
-
/*
The macros below are borrowed from include/linux/compiler.h in the
Linux kernel. Use them to indicate the likelyhood of the truthfulness
@@ -106,7 +95,7 @@
#ifndef _POSIX_PTHREAD_SEMANTICS
#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */
#endif
-/* was #if defined(HAVE_LINUXTHREADS) || defined(HAVE_DEC_THREADS) || defined(HPUX) */
+
#if !defined(SCO)
#define _REENTRANT 1 /* Some thread libraries require this */
#endif
@@ -132,14 +121,6 @@
/* #define _AIX32_CURSES */ /* XXX: this breaks AIX 4.3.3 (others?). */
#endif
-#ifdef __QNXNTO__
-#define HAVE_ERRNO_AS_DEFINE
-#define HAVE_FCNTL_LOCK
-#undef HAVE_SYS_UN_H
-#undef HAVE_FINITE
-#undef HAVE_RINT
-#endif
-
#ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */
#undef HAVE_SNPRINTF
#endif
@@ -161,6 +142,13 @@
#define __LONG_MAX__ 2147483647
#endif
+/* Fix problem when linking c++ programs with gcc 3.x */
+#ifdef DEFINE_CXA_PURE_VIRTUAL
+#define FIX_GCC_LINKING_PROBLEM extern "C" { int __cxa_pure_virtual() {return 0;} }
+#else
+#define FIX_GCC_LINKING_PROBLEM
+#endif
+
/* egcs 1.1.2 has a problem with memcpy on Alpha */
#if defined(__GNUC__) && defined(__alpha__) && ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
#define BAD_MEMCPY
@@ -257,6 +245,17 @@
#define setrlimit cma_setrlimit64
#endif
+#ifdef __QNXNTO__
+/* This has to be after include limits.h */
+#define HAVE_ERRNO_AS_DEFINE
+#define HAVE_FCNTL_LOCK
+#undef HAVE_SYS_UN_H
+#undef HAVE_FINITE
+#undef HAVE_RINT
+#undef LONGLONG_MIN /* These get wrongly defined in QNX 6.2 */
+#undef LONGLONG_MAX /* standard system library 'limits.h' */
+#endif
+
/* We can not live without the following defines */
#define USE_MYFUNC 1 /* Must use syscall indirection */
@@ -275,10 +274,6 @@
#define DONT_USE_MYSQL_PWD 1
#endif
-/* #define USE_some_charset 1 was deprecated by changes to configure */
-/* my_ctype my_to_upper, my_to_lower, my_sort_order gain theit right value */
-/* automagically during configuration */
-
/* Does the system remember a signal handler after a signal ? */
#ifndef HAVE_BSD_SIGNALS
#define DONT_REMEMBER_SIGNAL
@@ -328,7 +323,7 @@ typedef unsigned short ushort;
#define rint(A) floor((A)+0.5)
#endif
-/* Define som general constants */
+/* Define some general constants */
#ifndef TRUE
#define TRUE (1) /* Logical true */
#define FALSE (0) /* Logical false */
@@ -348,9 +343,11 @@ typedef unsigned short ushort;
/* From old s-system.h */
-/* Support macros for non ansi & other old compilers. Since such
- things are no longer supported we do nothing. We keep then since
- some of our code may still be needed to upgrade old customers. */
+/*
+ Support macros for non ansi & other old compilers. Since such
+ things are no longer supported we do nothing. We keep then since
+ some of our code may still be needed to upgrade old customers.
+*/
#define _VARARGS(X) X
#define _STATIC_VARARGS(X) X
#define _PC(X) X
@@ -468,12 +465,16 @@ typedef SOCKET_SIZE_TYPE size_socket;
/* #define FN_NO_CASE_SENCE */
/* #define FN_UPPER_CASE TRUE */
-/* Io buffer size; Must be a power of 2 and a multiple of 512. May be
- smaller what the disk page size. This influences the speed of the
- isam btree library. eg to big to slow. */
+/*
+ Io buffer size; Must be a power of 2 and a multiple of 512. May be
+ smaller what the disk page size. This influences the speed of the
+ isam btree library. eg to big to slow.
+*/
#define IO_SIZE 4096
-/* How much overhead does malloc have. The code often allocates
- something like 1024-MALLOC_OVERHEAD bytes */
+/*
+ How much overhead does malloc have. The code often allocates
+ something like 1024-MALLOC_OVERHEAD bytes
+*/
#ifdef SAFEMALLOC
#define MALLOC_OVERHEAD (8+24+4)
#else
@@ -488,7 +489,6 @@ typedef SOCKET_SIZE_TYPE size_socket;
/* Some things that this system doesn't have */
-#define ONLY_OWN_DATABASES /* We are using only databases by monty */
#define NO_HASH /* Not needed anymore */
#ifdef __WIN__
#define NO_DIR_LIBRARY /* Not standar dir-library */
@@ -534,11 +534,6 @@ extern double my_atof(const char*);
#define strtok_r(A,B,C) strtok((A),(B))
#endif
-#ifdef HAVE_LINUXTHREADS
-/* #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) */
-/* #define sigset(A,B) signal((A),(B)) */
-#endif
-
/* Remove some things that mit_thread break or doesn't support */
#if defined(HAVE_mit_thread) && defined(THREAD)
#undef HAVE_PREAD
@@ -589,8 +584,10 @@ extern double my_atof(const char*);
#define FLT_MAX ((float)3.40282346638528860e+38)
#endif
-/* Max size that must be added to a so that we know Size to make
- adressable obj. */
+/*
+ Max size that must be added to a so that we know Size to make
+ adressable obj.
+*/
typedef long my_ptrdiff_t;
#define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1))
#define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double))
@@ -648,21 +645,23 @@ error "Neither int or long is of 4 bytes width"
#endif
#if !defined(HAVE_ULONG) && !defined(HAVE_LINUXTHREADS) && !defined(__USE_MISC)
-typedef unsigned long ulong; /* Short for unsigned long */
+typedef unsigned long ulong; /* Short for unsigned long */
#endif
#ifndef longlong_defined
#if defined(HAVE_LONG_LONG) && SIZEOF_LONG != 8
typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
typedef long long int longlong;
#else
-typedef unsigned long ulonglong; /* ulong or unsigned long long */
+typedef unsigned long ulonglong; /* ulong or unsigned long long */
typedef long longlong;
#endif
#endif
#ifdef USE_RAID
-/* The following is done with a if to not get problems with pre-processors
- with late define evaluation */
+/*
+ The following is done with a if to not get problems with pre-processors
+ with late define evaluation
+*/
#if SIZEOF_OFF_T == 4
#define SYSTEM_SIZEOF_OFF_T 4
#else
@@ -727,8 +726,10 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#define INT32(v) (int32) (v)
#define MYF(v) (myf) (v)
-/* Defines to make it possible to prioritize register assignments. No
- longer needed with moder compilers */
+/*
+ Defines to make it possible to prioritize register assignments. No
+ longer that important with modern compilers.
+*/
#ifndef USING_X
#define reg1 register
#define reg2 register
@@ -748,6 +749,17 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#define reg16 register
#endif
+/*
+ Sometimes we want to make sure that the variable is not put into
+ a register in debugging mode so we can see its value in the core
+*/
+
+#ifndef DBUG_OFF
+#define dbug_volatile volatile
+#else
+#define dbug_volatile
+#endif
+
/* Defines for time function */
#define SCALE_SEC 100
#define SCALE_USEC 10000
@@ -769,8 +781,8 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#endif
/*
-** Define-funktions for reading and storing in machine independent format
-** (low byte first)
+ Define-funktions for reading and storing in machine independent format
+ (low byte first)
*/
/* Optimized store functions for Intel x86 */
@@ -943,9 +955,11 @@ typedef union {
#endif /* sint2korr */
-/* Define-funktions for reading and storing in machine format from/to
- short/long to/from some place in memory V should be a (not
- register) variable, M is a pointer to byte */
+/*
+ Define-funktions for reading and storing in machine format from/to
+ short/long to/from some place in memory V should be a (not
+ register) variable, M is a pointer to byte
+*/
#ifdef WORDS_BIGENDIAN
diff --git a/include/my_no_pthread.h b/include/my_no_pthread.h
index 81c0de580db..0a034f78192 100644
--- a/include/my_no_pthread.h
+++ b/include/my_no_pthread.h
@@ -20,7 +20,7 @@
environment, easier to use.
*/
-#if !defined(_my_no_pthread_h) && !defined(THREADS)
+#if !defined(_my_no_pthread_h) && !defined(THREAD)
#define _my_no_pthread_h
#define pthread_mutex_init(A,B)
diff --git a/include/my_pthread.h b/include/my_pthread.h
index fda31b9d4f2..9b7812b7cf2 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -429,10 +429,15 @@ struct tm *localtime_r(const time_t *clock, struct tm *res);
#endif /* defined(__WIN__) */
#if defined(HPUX) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
+#undef pthread_cond_timedwait
#define pthread_cond_timedwait(a,b,c) my_pthread_cond_timedwait((a),(b),(c))
-#define pthread_mutex_trylock(a) my_pthread_mutex_trylock((a))
int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
struct timespec *abstime);
+#endif
+
+#if defined(HAVE_POSIX1003_4a_MUTEX) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
+#undef pthread_mutex_trylock
+#define pthread_mutex_trylock(a) my_pthread_mutex_trylock((a))
int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
#endif
@@ -475,16 +480,27 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
#define pthread_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FILE__,__LINE__)
#define pthread_mutex_trylock(A) pthread_mutex_lock(A)
#define pthread_mutex_t safe_mutex_t
+#define safe_mutex_assert_owner(mp) DBUG_ASSERT((mp)->count > 0 && pthread_equal(pthread_self(),(mp)->thread))
+#else
+#define safe_mutex_assert_owner(mp)
#endif /* SAFE_MUTEX */
/* READ-WRITE thread locking */
+#ifdef HAVE_BROKEN_RWLOCK /* For OpenUnix */
+#undef HAVE_PTHREAD_RWLOCK_RDLOCK
+#undef HAVE_RWLOCK_INIT
+#undef HAVE_RWLOCK_T
+#endif
+
#if defined(USE_MUTEX_INSTEAD_OF_RW_LOCKS)
/* use these defs for simple mutex locking */
#define rw_lock_t pthread_mutex_t
#define my_rwlock_init(A,B) pthread_mutex_init((A),(B))
#define rw_rdlock(A) pthread_mutex_lock((A))
#define rw_wrlock(A) pthread_mutex_lock((A))
+#define rw_tryrdlock(A) pthread_mutex_trylock((A))
+#define rw_trywrlock(A) pthread_mutex_trylock((A))
#define rw_unlock(A) pthread_mutex_unlock((A))
#define rwlock_destroy(A) pthread_mutex_destroy((A))
#elif defined(HAVE_PTHREAD_RWLOCK_RDLOCK)
@@ -492,6 +508,8 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
#define my_rwlock_init(A,B) pthread_rwlock_init((A),(B))
#define rw_rdlock(A) pthread_rwlock_rdlock(A)
#define rw_wrlock(A) pthread_rwlock_wrlock(A)
+#define rw_tryrdlock(A) pthread_rwlock_tryrdlock((A))
+#define rw_trywrlock(A) pthread_rwlock_trywrlock((A))
#define rw_unlock(A) pthread_rwlock_unlock(A)
#define rwlock_destroy(A) pthread_rwlock_destroy(A)
#elif defined(HAVE_RWLOCK_INIT)
@@ -512,14 +530,18 @@ typedef struct _my_rw_lock_t {
#define rw_lock_t my_rw_lock_t
#define rw_rdlock(A) my_rw_rdlock((A))
#define rw_wrlock(A) my_rw_wrlock((A))
+#define rw_tryrdlock(A) my_rw_tryrdlock((A))
+#define rw_trywrlock(A) my_rw_trywrlock((A))
#define rw_unlock(A) my_rw_unlock((A))
#define rwlock_destroy(A) my_rwlock_destroy((A))
-extern int my_rwlock_init( my_rw_lock_t *, void * );
-extern int my_rwlock_destroy( my_rw_lock_t * );
-extern int my_rw_rdlock( my_rw_lock_t * );
-extern int my_rw_wrlock( my_rw_lock_t * );
-extern int my_rw_unlock( my_rw_lock_t * );
+extern int my_rwlock_init(my_rw_lock_t *, void *);
+extern int my_rwlock_destroy(my_rw_lock_t *);
+extern int my_rw_rdlock(my_rw_lock_t *);
+extern int my_rw_wrlock(my_rw_lock_t *);
+extern int my_rw_unlock(my_rw_lock_t *);
+extern int my_rw_tryrdlock(my_rw_lock_t *);
+extern int my_rw_trywrlock(my_rw_lock_t *);
#endif /* USE_MUTEX_INSTEAD_OF_RW_LOCKS */
#define GETHOSTBYADDR_BUFF_SIZE 2048
diff --git a/include/my_semaphore.h b/include/my_semaphore.h
index 484423150f7..3431212ec82 100644
--- a/include/my_semaphore.h
+++ b/include/my_semaphore.h
@@ -31,21 +31,29 @@
#ifndef _my_semaphore_h_
#define _my_semaphore_h_
-#ifndef __WIN__
+C_MODE_START
+#ifdef HAVE_SEMAPHORE_H
#include <semaphore.h>
+#elif !defined(__bsdi__)
+#ifdef __WIN__
+typedef HANDLE sem_t;
#else
+typedef struct {
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+ uint count;
+} sem_t;
+#endif /* __WIN__ */
-C_MODE_START
+int sem_init(sem_t * sem, int pshared, unsigned int value);
+int sem_destroy(sem_t * sem);
+int sem_trywait(sem_t * sem);
+int sem_wait(sem_t * sem);
+int sem_post(sem_t * sem);
+int sem_post_multiple(sem_t * sem, unsigned int count);
+int sem_getvalue(sem_t * sem, unsigned int * sval);
-typedef HANDLE sem_t;
-int sem_init (sem_t * sem, int pshared, unsigned int value);
-int sem_destroy (sem_t * sem);
-int sem_trywait (sem_t * sem);
-int sem_wait (sem_t * sem);
-int sem_post (sem_t * sem);
-int sem_post_multiple (sem_t * sem,int count);
-int sem_getvalue (sem_t * sem, int * sval);
+#endif /* !__bsdi__ */
C_MODE_END
-#endif /* __WIN__ */
#endif /* !_my_semaphore_h_ */
diff --git a/include/my_sys.h b/include/my_sys.h
index ab7159a334b..21688533412 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -36,7 +36,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#include <m_ctype.h> /* for CHARSET_INFO */
#endif
-#include <stdarg.h>
+#include <stdarg.h>
#define MYSYS_PROGRAM_USES_CURSES() { error_handler_hook = my_message_curses; mysys_uses_curses=1; }
#define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;}
@@ -151,13 +151,21 @@ extern my_string my_strdup(const char *from,myf MyFlags);
#define CALLER_INFO /* nothing */
#define ORIG_CALLER_INFO /* nothing */
#endif
+
#ifdef HAVE_ALLOCA
+#if defined(_AIX) && !defined(__GNUC__)
+#pragma alloca
+#endif /* _AIX */
+#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H)
+#define alloca __builtin_alloca
+#endif /* GNUC */
#define my_alloca(SZ) alloca((size_t) (SZ))
#define my_afree(PTR) {}
#else
#define my_alloca(SZ) my_malloc(SZ,MYF(0))
#define my_afree(PTR) my_free(PTR,MYF(MY_WME))
#endif /* HAVE_ALLOCA */
+
#ifdef MSDOS
#ifdef __ZTC__
void * __CDECL halloc(long count,size_t length);
@@ -238,16 +246,20 @@ typedef struct wild_file_pack /* Struct to hold info when selecting files */
typedef struct st_typelib { /* Different types saved here */
uint count; /* How many types */
- const char *name; /* Name of typelib */
+ const char *name; /* Name of typelib */
const char **type_names;
} TYPELIB;
-enum cache_type {READ_CACHE,WRITE_CACHE,
- SEQ_READ_APPEND /* sequential read or append */,
- READ_FIFO,
- READ_NET,WRITE_NET};
-enum flush_type { FLUSH_KEEP, FLUSH_RELEASE, FLUSH_IGNORE_CHANGED,
- FLUSH_FORCE_WRITE};
+enum cache_type
+{
+ READ_CACHE,WRITE_CACHE,
+ SEQ_READ_APPEND /* sequential read or append */,
+ READ_FIFO, READ_NET,WRITE_NET};
+
+enum flush_type
+{
+ FLUSH_KEEP, FLUSH_RELEASE, FLUSH_IGNORE_CHANGED, FLUSH_FORCE_WRITE
+};
typedef struct st_record_cache /* Used when cacheing records */
{
@@ -263,28 +275,32 @@ typedef struct st_record_cache /* Used when cacheing records */
enum cache_type type;
} RECORD_CACHE;
-enum file_type { UNOPEN = 0, FILE_BY_OPEN, FILE_BY_CREATE,
- STREAM_BY_FOPEN, STREAM_BY_FDOPEN, FILE_BY_MKSTEMP,
- FILE_BY_DUP };
+enum file_type
+{
+ UNOPEN = 0, FILE_BY_OPEN, FILE_BY_CREATE, STREAM_BY_FOPEN, STREAM_BY_FDOPEN,
+ FILE_BY_MKSTEMP, FILE_BY_DUP
+};
extern struct my_file_info
{
my_string name;
enum file_type type;
-#if defined(THREAD) && !defined(HAVE_PREAD)
+#if defined(THREAD) && !defined(HAVE_PREAD)
pthread_mutex_t mutex;
#endif
} my_file_info[MY_NFILE];
-typedef struct st_dynamic_array {
+typedef struct st_dynamic_array
+{
char *buffer;
uint elements,max_element;
uint alloc_increment;
uint size_of_element;
} DYNAMIC_ARRAY;
-typedef struct st_dynamic_string {
+typedef struct st_dynamic_string
+{
char *str;
uint length,max_length,alloc_increment;
} DYNAMIC_STRING;
@@ -292,107 +308,134 @@ typedef struct st_dynamic_string {
struct st_io_cache;
typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*);
+#ifdef THREAD
+typedef struct st_io_cache_share
+{
+ /* to sync on reads into buffer */
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+ int count;
+ /* actual IO_CACHE that filled the buffer */
+ struct st_io_cache *active;
+#ifdef NOT_YET_IMPLEMENTED
+ /* whether the structure should be free'd */
+ my_bool alloced;
+#endif
+} IO_CACHE_SHARE;
+#endif
typedef struct st_io_cache /* Used when cacheing files */
{
- /* pos_in_file is offset in file corresponding to the first byte of
- byte* buffer. end_of_file is the offset of end of file for READ_CACHE
- and WRITE_CACHE. For SEQ_READ_APPEND it the maximum of the actual
- end of file and the position represented by read_end.
- */
- my_off_t pos_in_file,end_of_file;
- /* read_pos points to current read position in the buffer
- read_end is the non-inclusive boundary in the buffer for the currently
- valid read area
- buffer is the read buffer
- not sure about request_pos except that it is used in async_io
+ /* Offset in file corresponding to the first byte of byte* buffer. */
+ my_off_t pos_in_file;
+ /*
+ The offset of end of file for READ_CACHE and WRITE_CACHE.
+ For SEQ_READ_APPEND it the maximum of the actual end of file and
+ the position represented by read_end.
*/
- byte *read_pos,*read_end,*buffer,*request_pos;
- /* write_buffer is used only in WRITE caches and in SEQ_READ_APPEND to
- buffer writes
- append_read_pos is only used in SEQ_READ_APPEND, and points to the
- current read position in the write buffer. Note that reads in
- SEQ_READ_APPEND caches can happen from both read buffer (byte* buffer),
- and write buffer (byte* write_buffer).
- write_pos points to current write position in the write buffer and
- write_end is the non-inclusive boundary of the valid write area
+ my_off_t end_of_file;
+ /* Points to current read position in the buffer */
+ byte *read_pos;
+ /* the non-inclusive boundary in the buffer for the currently valid read */
+ byte *read_end;
+ byte *buffer; /* The read buffer */
+ /* Used in ASYNC_IO */
+ byte *request_pos;
+
+ /* Only used in WRITE caches and in SEQ_READ_APPEND to buffer writes */
+ byte *write_buffer;
+ /*
+ Only used in SEQ_READ_APPEND, and points to the current read position
+ in the write buffer. Note that reads in SEQ_READ_APPEND caches can
+ happen from both read buffer (byte* buffer) and write buffer
+ (byte* write_buffer).
*/
- byte *write_buffer, *append_read_pos, *write_pos, *write_end;
- /* current_pos and current_end are convenience variables used by
- my_b_tell() and other routines that need to know the current offset
- current_pos points to &write_pos, and current_end to &write_end in a
- WRITE_CACHE, and &read_pos and &read_end respectively otherwise
+ byte *append_read_pos;
+ /* Points to current write position in the write buffer */
+ byte *write_pos;
+ /* The non-inclusive boundary of the valid write area */
+ byte *write_end;
+
+ /*
+ Current_pos and current_end are convenience variables used by
+ my_b_tell() and other routines that need to know the current offset
+ current_pos points to &write_pos, and current_end to &write_end in a
+ WRITE_CACHE, and &read_pos and &read_end respectively otherwise
*/
byte **current_pos, **current_end;
-/* The lock is for append buffer used in SEQ_READ_APPEND cache */
#ifdef THREAD
+ /*
+ The lock is for append buffer used in SEQ_READ_APPEND cache
+ need mutex copying from append buffer to read buffer.
+ */
pthread_mutex_t append_buffer_lock;
- /* need mutex copying from append buffer to read buffer */
+ /*
+ The following is used when several threads are reading the
+ same file in parallel. They are synchronized on disk
+ accesses reading the cached part of the file asynchronously.
+ It should be set to NULL to disable the feature. Only
+ READ_CACHE mode is supported.
+ */
+ IO_CACHE_SHARE *share;
#endif
- /* a caller will use my_b_read() macro to read from the cache
- if the data is already in cache, it will be simply copied with
- memcpy() and internal variables will be accordinging updated with
- no functions invoked. However, if the data is not fully in the cache,
- my_b_read() will call read_function to fetch the data. read_function
- must never be invoked directly
+ /*
+ A caller will use my_b_read() macro to read from the cache
+ if the data is already in cache, it will be simply copied with
+ memcpy() and internal variables will be accordinging updated with
+ no functions invoked. However, if the data is not fully in the cache,
+ my_b_read() will call read_function to fetch the data. read_function
+ must never be invoked directly.
*/
int (*read_function)(struct st_io_cache *,byte *,uint);
- /* same idea as in the case of read_function, except my_b_write() needs to
- be replaced with my_b_append() for a SEQ_READ_APPEND cache
+ /*
+ Same idea as in the case of read_function, except my_b_write() needs to
+ be replaced with my_b_append() for a SEQ_READ_APPEND cache
*/
int (*write_function)(struct st_io_cache *,const byte *,uint);
- /* specifies the type of the cache. Depending on the type of the cache
- certain operations might not be available and yield unpredicatable
- results. Details to be documented later
+ /*
+ Specifies the type of the cache. Depending on the type of the cache
+ certain operations might not be available and yield unpredicatable
+ results. Details to be documented later
*/
enum cache_type type;
- /* callbacks when the actual read I/O happens. These were added and
- are currently used for binary logging of LOAD DATA INFILE - when a
- block is read from the file, we create a block create/append event, and
- when IO_CACHE is closed, we create an end event. These functions could,
- of course be used for other things
+ /*
+ Callbacks when the actual read I/O happens. These were added and
+ are currently used for binary logging of LOAD DATA INFILE - when a
+ block is read from the file, we create a block create/append event, and
+ when IO_CACHE is closed, we create an end event. These functions could,
+ of course be used for other things
*/
IO_CACHE_CALLBACK pre_read;
IO_CACHE_CALLBACK post_read;
IO_CACHE_CALLBACK pre_close;
- void* arg; /* for use by pre/post_read */
+ void* arg; /* for use by pre/post_read */
char *file_name; /* if used with 'open_cached_file' */
char *dir,*prefix;
File file; /* file descriptor */
- /* seek_not_done is set by my_b_seek() to inform the upcoming read/write
- operation that a seek needs to be preformed prior to the actual I/O
- error is 0 if the cache operation was successful, -1 if there was a
- "hard" error, and the actual number of I/O-ed bytes if the read/write was
- partial
+ /*
+ seek_not_done is set by my_b_seek() to inform the upcoming read/write
+ operation that a seek needs to be preformed prior to the actual I/O
+ error is 0 if the cache operation was successful, -1 if there was a
+ "hard" error, and the actual number of I/O-ed bytes if the read/write was
+ partial.
*/
int seek_not_done,error;
- /* buffer_length is the size of memory allocated for buffer or write_buffer
- read_length is the same as buffer_length except when we use async io
- not sure why we need it
- */
- uint buffer_length,read_length;
+ /* buffer_length is memory size allocated for buffer or write_buffer */
+ uint buffer_length;
+ /* read_length is the same as buffer_length except when we use async io */
+ uint read_length;
myf myflags; /* Flags used to my_read/my_write */
- /*
- alloced_buffer is 1 if the buffer was allocated by init_io_cache() and
- 0 if it was supplied by the user
- Currently READ_NET is the only one that will use a buffer allocated
- somewhere else
- */
- my_bool alloced_buffer;
- /* init_count is incremented every time we call init_io_cache()
- It is not reset in end_io_cache(). This variable
- was introduced for slave relay logs - RELAY_LOG_INFO stores a pointer
- to IO_CACHE that could in some cases refer to the IO_CACHE of the
- currently active relay log. The IO_CACHE then could be closed,
- re-opened and start pointing to a different log file. In that case,
- we could not know reliably if this happened without init_count
- one must be careful with bzero() prior to the subsequent init_io_cache()
- call
+ /*
+ alloced_buffer is 1 if the buffer was allocated by init_io_cache() and
+ 0 if it was supplied by the user.
+ Currently READ_NET is the only one that will use a buffer allocated
+ somewhere else
*/
- int init_count;
+ my_bool alloced_buffer;
#ifdef HAVE_AIOWAIT
- /* as inidicated by ifdef, this is for async I/O, we will have
- Sinisa comment this some time
+ /*
+ As inidicated by ifdef, this is for async I/O, which is not currently
+ used (because it's not reliable on all systems)
*/
uint inited;
my_off_t aio_read_pos;
@@ -421,7 +464,6 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *);
((info)->write_pos+=(Count)),0) : \
(*(info)->write_function)((info),(Buffer),(Count)))
-
#define my_b_get(info) \
((info)->read_pos != (info)->read_end ?\
((info)->read_pos++, (int) (uchar) (info)->read_pos[-1]) :\
@@ -445,18 +487,6 @@ my_off_t my_b_append_tell(IO_CACHE* info);
#define my_b_bytes_in_cache(info) (uint) (*(info)->current_end - \
*(info)->current_pos)
-
-typedef struct st_changeable_var {
- const char *name; /* Name of variable */
- long *varptr; /* Pointer to variable */
- long def_value, /* Default value */
- min_value, /* Min allowed value */
- max_value, /* Max allowed value */
- sub_size, /* Subtract this from given value */
- block_size; /* Value should be a mult. of this */
-} CHANGEABLE_VAR;
-
-
#include <my_alloc.h>
/* Prototypes for mysys and my_func functions */
@@ -520,7 +550,7 @@ extern void init_glob_errs(void);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
extern int my_fclose(FILE *fd,myf MyFlags);
-extern int my_chsize(File fd,my_off_t newlength,myf MyFlags);
+extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
extern int my_error _VARARGS((int nr,myf MyFlags, ...));
extern int my_printf_error _VARARGS((uint my_err, const char *format,
myf MyFlags, ...)
@@ -590,7 +620,8 @@ extern int flush_write_cache(RECORD_CACHE *info);
extern long my_clock(void);
extern sig_handler sigtstp_handler(int signal_number);
extern void handle_recived_signals(void);
-extern int init_key_cache(ulong use_mem,ulong leave_this_much_mem);
+extern int init_key_cache(ulong use_mem);
+extern int resize_key_cache(ulong use_mem);
extern byte *key_cache_read(File file,my_off_t filepos,byte* buff,uint length,
uint block_length,int return_buffer);
extern int key_cache_write(File file,my_off_t filepos,byte* buff,uint length,
@@ -611,6 +642,12 @@ extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type,
my_off_t seek_offset,pbool use_async_io,
pbool clear_cache);
extern int _my_b_read(IO_CACHE *info,byte *Buffer,uint Count);
+#ifdef THREAD
+extern int _my_b_read_r(IO_CACHE *info,byte *Buffer,uint Count);
+extern void init_io_cache_share(IO_CACHE *info,
+ IO_CACHE_SHARE *s, uint num_threads);
+extern void remove_io_thread(IO_CACHE *info);
+#endif
extern int _my_b_seq_read(IO_CACHE *info,byte *Buffer,uint Count);
extern int _my_b_net_read(IO_CACHE *info,byte *Buffer,uint Count);
extern int _my_b_get(IO_CACHE *info);
@@ -627,6 +664,7 @@ extern int end_io_cache(IO_CACHE *info);
extern uint my_b_fill(IO_CACHE *info);
extern void my_b_seek(IO_CACHE *info,my_off_t pos);
extern uint my_b_gets(IO_CACHE *info, char *to, uint max_length);
+extern my_off_t my_b_filelength(IO_CACHE *info);
extern uint my_b_printf(IO_CACHE *info, const char* fmt, ...);
extern uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap);
extern my_bool open_cached_file(IO_CACHE *cache,const char *dir,
@@ -663,10 +701,6 @@ my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str);
extern my_bool dynstr_realloc(DYNAMIC_STRING *str, ulong additional_size);
extern void dynstr_free(DYNAMIC_STRING *str);
-void set_all_changeable_vars(CHANGEABLE_VAR *vars);
-my_bool set_changeable_var(my_string str,CHANGEABLE_VAR *vars);
-my_bool set_changeable_varval(const char *var, ulong val,
- CHANGEABLE_VAR *vars);
#ifdef HAVE_MLOCK
extern byte *my_malloc_lock(uint length,myf flags);
extern void my_free_lock(byte *ptr,myf flags);
@@ -692,13 +726,6 @@ byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen);
ulong checksum(const byte *mem, uint count);
uint my_bit_log2(ulong value);
-#if defined(SAFE_MUTEX) && !defined(DBUG_OFF)
-#define DBUG_ASSERT_LOCK(lock) DBUG_ASSERT((lock)->count == 1 && \
- (lock)->thread == pthread_self())
-#else
-#define DBUG_ASSERT_LOCK(lock)
-#endif
-
#if defined(_MSC_VER) && !defined(__WIN__)
extern void sleep(int sec);
#endif
diff --git a/include/myisam.h b/include/myisam.h
index 96cbeaf0cd4..eac517eb28a 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -159,9 +159,11 @@ typedef struct st_mi_decode_tree /* Decode huff-table */
struct st_mi_bit_buff;
-/* Note that null markers should always be first in a row !
- When creating a column, one should only specify:
- type, length, null_bit and null_pos */
+/*
+ Note that null markers should always be first in a row !
+ When creating a column, one should only specify:
+ type, length, null_bit and null_pos
+*/
typedef struct st_columndef /* column information */
{
@@ -224,7 +226,8 @@ extern int mi_create(const char *name,uint keys,MI_KEYDEF *keydef,
extern int mi_delete_table(const char *name);
extern int mi_rename(const char *from, const char *to);
extern int mi_extra(struct st_myisam_info *file,
- enum ha_extra_function function);
+ enum ha_extra_function function,
+ void *extra_arg);
extern ha_rows mi_records_in_range(struct st_myisam_info *info,int inx,
const byte *start_key,uint start_key_len,
enum ha_rkey_function start_search_flag,
@@ -238,55 +241,58 @@ extern uint mi_get_pointer_length(ulonglong file_length, uint def);
/* this is used to pass to mysql_myisamchk_table -- by Sasha Pachev */
-#define MYISAMCHK_REPAIR 1 /* equivalent to myisamchk -r*/
-#define MYISAMCHK_VERIFY 2 /* run equivalent of myisamchk -c,
- * if corruption is detected, do myisamchk -r*/
-
-/* definitions needed for myisamchk.c -- by Sasha Pachev */
-
-/* entries marked as "QQ to be removed" are NOT used to
- * pass check/repair options to mi_check.c. They are used
- * internally by myisamchk.c or/and ha_myisam.cc and should NOT
- * be stored together with other flags. They should be removed
- * from the following list to make adding of new flags possible.
- * -- Sergei */
-
-#define T_VERBOSE 1
-#define T_SILENT 2
-#define T_DESCRIPT 4
-#define T_EXTEND 8
-#define T_INFO 16
-#define T_REP 32
-#define T_FORCE_UNIQUENESS 64
-#define T_FORCE_CREATE 128
-#define T_WRITE_LOOP 256
-#define T_UNPACK 512
-#define T_STATISTICS (1L << 10)
-#define T_VERY_SILENT (1L << 11)
-#define T_SORT_RECORDS (1L << 12) /* QQ to be removed */
-#define T_SORT_INDEX (1L << 13) /* QQ to be removed */
-#define T_WAIT_FOREVER (1L << 14)
-#define T_REP_BY_SORT (1L << 15)
-#define T_FAST (1L << 16) /* QQ to be removed */
-#define T_READONLY (1L << 17) /* QQ to be removed */
-#define T_MEDIUM (1L << 18)
-#define T_AUTO_INC (1L << 19)
-#define T_CHECK (1L << 20) /* QQ to be removed */
-#define T_UPDATE_STATE (1L << 21)
-#define T_CHECK_ONLY_CHANGED (1L << 22) /* QQ to be removed */
-#define T_DONT_CHECK_CHECKSUM (1L << 23)
-#define T_TRUST_HEADER (1L << 24)
-#define T_CREATE_MISSING_KEYS (1L << 25)
-#define T_SAFE_REPAIR (1L << 26)
-#define T_AUTO_REPAIR (1L << 27) /* QQ to be removed */
-#define T_BACKUP_DATA (1L << 28)
-#define T_CALC_CHECKSUM (1L << 29)
-#define T_QUICK (1L << 30)
-#define T_RETRY_WITHOUT_QUICK (1L << 31)
-
-/* flags used by myisamchk.c or/and ha_myisam.cc that are NOT passed
- * to mi_check.c follows:
- * */
+#define MYISAMCHK_REPAIR 1 /* equivalent to myisamchk -r */
+#define MYISAMCHK_VERIFY 2 /* Verify, run repair if failure */
+
+/*
+ Definitions needed for myisamchk.c
+
+ Entries marked as "QQ to be removed" are NOT used to
+ pass check/repair options to mi_check.c. They are used
+ internally by myisamchk.c or/and ha_myisam.cc and should NOT
+ be stored together with other flags. They should be removed
+ from the following list to make addition of new flags possible.
+*/
+
+#define T_AUTO_INC 1
+#define T_AUTO_REPAIR 2 /* QQ to be removed */
+#define T_BACKUP_DATA 4
+#define T_CALC_CHECKSUM 8
+#define T_CHECK 16 /* QQ to be removed */
+#define T_CHECK_ONLY_CHANGED 32 /* QQ to be removed */
+#define T_CREATE_MISSING_KEYS 64
+#define T_DESCRIPT 128
+#define T_DONT_CHECK_CHECKSUM 256
+#define T_EXTEND 512
+#define T_FAST (1L << 10) /* QQ to be removed */
+#define T_FORCE_CREATE (1L << 11) /* QQ to be removed */
+#define T_FORCE_UNIQUENESS (1L << 12)
+#define T_INFO (1L << 13)
+#define T_MEDIUM (1L << 14)
+#define T_QUICK (1L << 15) /* QQ to be removed */
+#define T_READONLY (1L << 16) /* QQ to be removed */
+#define T_REP (1L << 17)
+#define T_REP_BY_SORT (1L << 18) /* QQ to be removed */
+#define T_REP_PARALLEL (1L << 19) /* QQ to be removed */
+#define T_RETRY_WITHOUT_QUICK (1L << 20)
+#define T_SAFE_REPAIR (1L << 21)
+#define T_SILENT (1L << 22)
+#define T_SORT_INDEX (1L << 23) /* QQ to be removed */
+#define T_SORT_RECORDS (1L << 24) /* QQ to be removed */
+#define T_STATISTICS (1L << 25)
+#define T_UNPACK (1L << 26)
+#define T_UPDATE_STATE (1L << 27)
+#define T_VERBOSE (1L << 28)
+#define T_VERY_SILENT (1L << 29)
+#define T_WAIT_FOREVER (1L << 30)
+#define T_WRITE_LOOP (1L << 31)
+
+#define T_REP_ANY (T_REP | T_REP_BY_SORT | T_REP_PARALLEL)
+
+/*
+ Flags used by myisamchk.c or/and ha_myisam.cc that are NOT passed
+ to mi_check.c follows:
+*/
#define TT_USEFRM 1
@@ -296,30 +302,14 @@ extern uint mi_get_pointer_length(ulonglong file_length, uint def);
/* these struct is used by my_check to tell it what to do */
-typedef struct st_sort_key_blocks { /* Used when sorting */
+typedef struct st_sort_key_blocks /* Used when sorting */
+{
uchar *buff,*end_pos;
uchar lastkey[MI_MAX_POSSIBLE_KEY_BUFF];
uint last_length;
int inited;
} SORT_KEY_BLOCKS;
-struct st_mi_check_param;
-
-typedef struct st_sort_info {
- MI_INFO *info;
- struct st_mi_check_param *param;
- enum data_file_type new_data_file_type;
- SORT_KEY_BLOCKS *key_block,*key_block_end;
- uint key,find_length,real_key_length;
- my_off_t pos,max_pos,filepos,start_recpos,filelength,dupp,buff_length;
- ha_rows max_records;
- ulonglong unique[MI_MAX_KEY_SEG+1];
- my_bool fix_datafile;
- char *record,*buff;
- void *wordlist, *wordptr;
- MI_KEYDEF *keyinfo;
- HA_KEYSEG *keyseg;
-} SORT_INFO;
typedef struct st_mi_check_param
{
@@ -343,7 +333,6 @@ typedef struct st_mi_check_param
int tmpfile_createflag;
myf myf_rw;
IO_CACHE read_cache;
- SORT_INFO sort_info;
ulonglong unique_count[MI_MAX_KEY_SEG+1];
ha_checksum key_crc[MI_MAX_POSSIBLE_KEY];
ulong rec_per_key_part[MI_MAX_KEY_SEG*MI_MAX_POSSIBLE_KEY];
@@ -353,18 +342,48 @@ typedef struct st_mi_check_param
} MI_CHECK;
-typedef struct st_mi_sortinfo {
+typedef struct st_sort_info
+{
+ my_off_t filelength,dupp,buff_length;
ha_rows max_records;
+ uint current_key, total_keys;
+ myf myf_rw;
+ enum data_file_type new_data_file_type;
+ MI_INFO *info;
+ MI_CHECK *param;
+ char *buff;
+ SORT_KEY_BLOCKS *key_block,*key_block_end;
+ /* sync things*/
+ uint got_error, threads_running;
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+} SORT_INFO;
+
+
+typedef struct st_mi_sort_param
+{
+ pthread_t thr;
+ IO_CACHE read_cache, tempfile, tempfile_for_exceptions;
+ DYNAMIC_ARRAY buffpek;
+ ulonglong unique[MI_MAX_KEY_SEG+1];
+ my_off_t pos,max_pos,filepos,start_recpos;
+ uint key, key_length,real_key_length,sortbuff_size;
+ uint maxbuffers, keys, find_length, sort_keys_length;
+ my_bool fix_datafile, master;
+ MI_KEYDEF *keyinfo;
SORT_INFO *sort_info;
+ uchar **sort_keys;
+ byte *rec_buff;
+ void *wordlist, *wordptr;
+ char *record;
char *tmpdir;
- int (*key_cmp)(SORT_INFO *info, const void *, const void *);
- int (*key_read)(SORT_INFO *info,void *buff);
- int (*key_write)(SORT_INFO *info, const void *buff);
- void (*lock_in_memory)(MI_CHECK *info);
- uint key_length;
- myf myf_rw;
+ int (*key_cmp)(struct st_mi_sort_param *, const void *, const void *);
+ int (*key_read)(struct st_mi_sort_param *,void *);
+ int (*key_write)(struct st_mi_sort_param *, const void *);
+ void (*lock_in_memory)(MI_CHECK *);
} MI_SORT_PARAM;
+
/* functions in mi_check */
void myisamchk_init(MI_CHECK *param);
int chk_status(MI_CHECK *param, MI_INFO *info);
@@ -377,6 +396,8 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name);
int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
const char * name, int rep_quick);
+int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
+ const char * name, int rep_quick);
int change_to_newfile(const char * filename, const char * old_ext,
const char * new_ext, uint raid_chunks,
myf myflags);
@@ -387,14 +408,15 @@ int flush_blocks(MI_CHECK *param, File file);
void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
my_bool repair);
int update_state_info(MI_CHECK *param, MI_INFO *info,uint update);
+void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part,
+ ulonglong *unique, ulonglong records);
int filecopy(MI_CHECK *param, File to,File from,my_off_t start,
my_off_t length, const char *type);
int movepoint(MI_INFO *info,byte *record,my_off_t oldpos,
my_off_t newpos, uint prot_key);
-int sort_write_record(SORT_INFO *sort_info);
- int write_data_suffix(MI_CHECK *param, MI_INFO *info);
-int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
- ulong);
+int sort_write_record(MI_SORT_PARAM *sort_param);
+int write_data_suffix(SORT_INFO *sort_info, my_bool fix_datafile);
+int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, ulong);
int test_if_almost_full(MI_INFO *info);
int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename);
void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows);
diff --git a/include/myisammrg.h b/include/myisammrg.h
index acf80ee2adf..c3b3b39424b 100644
--- a/include/myisammrg.h
+++ b/include/myisammrg.h
@@ -62,14 +62,15 @@ typedef struct st_myrg_table_info
typedef struct st_myrg_info
{
MYRG_TABLE *open_tables,*current_table,*end_table,*last_used_table;
- uint merge_insert_method;
ulonglong records; /* records in tables */
ulonglong del; /* Removed records */
ulonglong data_file_length;
+ ulong cache_size;
+ uint merge_insert_method;
uint tables,options,reclength,keys;
my_bool cache_in_use;
- LIST open_list;
- QUEUE by_key;
+ LIST open_list;
+ QUEUE by_key;
} MYRG_INFO;
@@ -93,7 +94,8 @@ extern int myrg_status(MYRG_INFO *file,MYMERGE_INFO *x,int flag);
extern int myrg_lock_database(MYRG_INFO *file,int lock_type);
extern int myrg_create(const char *name, const char **table_names,
uint insert_method, my_bool fix_names);
-extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function);
+extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function,
+ void *extra_arg);
extern void myrg_extrafunc(MYRG_INFO *info,invalidator_by_filename inv);
extern ha_rows myrg_records_in_range(MYRG_INFO *info,int inx,
const byte *start_key,uint start_key_len,
diff --git a/include/mysql.h b/include/mysql.h
index 23da848a8b5..50543c51f6b 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -69,7 +69,7 @@ extern char *mysql_unix_port;
typedef struct st_mysql_field {
char *name; /* Name of column */
- char *org_name; /* Original column name, if column was an alias */
+ char *org_name; /* Original column name, if an alias */
char *table; /* Table of column if column was a field */
char *org_table; /* Org table name, if table was an alias */
char *db; /* Database for table */
@@ -101,24 +101,7 @@ typedef struct st_mysql_rows {
typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */
-#include <my_alloc.h>
-#ifndef ST_USED_MEM_DEFINED
-#define ST_USED_MEM_DEFINED
-typedef struct st_used_mem { /* struct for once_alloc */
- struct st_used_mem *next; /* Next block in use */
- unsigned int left; /* memory left in block */
- unsigned int size; /* size of block */
-} USED_MEM;
-typedef struct st_mem_root {
- USED_MEM *free;
- USED_MEM *used;
- USED_MEM *pre_alloc;
- unsigned int min_malloc;
- unsigned int block_size;
-
- void (*error_handler)(void);
-} MEM_ROOT;
-#endif
+#include "my_alloc.h"
typedef struct st_mysql_data {
my_ulonglong rows;
@@ -140,17 +123,17 @@ struct st_mysql_options {
my_bool use_ssl; /* if to use SSL or not */
my_bool compress,named_pipe;
/*
- on connect, find out the replication role of the server, and
+ On connect, find out the replication role of the server, and
establish connections to all the peers
*/
my_bool rpl_probe;
- /*
- each call to mysql_real_query() will parse it to tell if it is a read
- or a write, and direct it to the slave or the master
+ /*
+ Each call to mysql_real_query() will parse it to tell if it is a read
+ or a write, and direct it to the slave or the master
*/
my_bool rpl_parse;
/*
- if set, never read from a master,only from slave, when doing
+ If set, never read from a master,only from slave, when doing
a read that is replication-aware
*/
my_bool no_master_reads;
@@ -203,8 +186,10 @@ typedef struct st_mysql {
added though mysql_rpl_probe() or mysql_set_master()/ mysql_add_slave()
*/
my_bool rpl_pivot;
- /* pointers to the master, and the next slave
- connections, points to itself if lone connection */
+ /*
+ Pointers to the master, and the next slave connections, points to
+ itself if lone connection.
+ */
struct st_mysql* master, *next_slave;
struct st_mysql* last_used_slave; /* needed for round-robin slave pick */
@@ -252,21 +237,27 @@ typedef struct st_mysql_manager
char last_error[MAX_MYSQL_MANAGER_ERR];
} MYSQL_MANAGER;
-/* Set up and bring down the server; to ensure that applications will
- * work when linked against either the standard client library or the
- * embedded server library, these functions should be called. */
+/*
+ Set up and bring down the server; to ensure that applications will
+ work when linked against either the standard client library or the
+ embedded server library, these functions should be called.
+*/
int STDCALL mysql_server_init(int argc, char **argv, char **groups);
void STDCALL mysql_server_end(void);
-/* Set up and bring down a thread; these function should be called
- * for each thread in an application which opens at least one MySQL
- * connection. All uses of the connection(s) should be between these
- * function calls. */
+/*
+ Set up and bring down a thread; these function should be called
+ for each thread in an application which opens at least one MySQL
+ connection. All uses of the connection(s) should be between these
+ function calls.
+*/
my_bool STDCALL mysql_thread_init(void);
void STDCALL mysql_thread_end(void);
-/* Functions to get information from the MYSQL and MYSQL_RES structures */
-/* Should definitely be used if one uses shared libraries */
+/*
+ Functions to get information from the MYSQL and MYSQL_RES structures
+ Should definitely be used if one uses shared libraries.
+*/
my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res);
unsigned int STDCALL mysql_num_fields(MYSQL_RES *res);
@@ -290,7 +281,6 @@ MYSQL * STDCALL mysql_init(MYSQL *mysql);
int STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
-int STDCALL mysql_ssl_clear(MYSQL *mysql);
my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
const char *passwd, const char *db);
MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
@@ -413,7 +403,7 @@ int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con,
/*
- The following definations are added for the enhanced
+ The following definitions are added for the enhanced
client-server protocol
*/
diff --git a/include/mysql_com.h b/include/mysql_com.h
index c259259c9e2..9743fc4c3f5 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -21,7 +21,6 @@
#ifndef _mysql_com_h
#define _mysql_com_h
-
#define NAME_LEN 64 /* Field/table name length */
#define HOSTNAME_LENGTH 60
#define USERNAME_LENGTH 16
@@ -117,9 +116,10 @@ typedef struct st_net {
Vio* vio;
unsigned char *buff,*buff_end,*write_pos,*read_pos;
my_socket fd; /* For Perl DBI/dbd */
- unsigned long max_packet;
+ unsigned long max_packet,max_packet_size;
+ unsigned int last_errno,pkt_nr,compress_pkt_nr;
+ unsigned int write_timeout, read_timeout, retry_count;
int fcntl;
- unsigned int last_errno,timeout,pkt_nr,compress_pkt_nr;
char last_error[MYSQL_ERRMSG_SIZE];
unsigned char error;
my_bool return_errno,compress;
@@ -203,10 +203,8 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
extern "C" {
#endif
-extern unsigned long max_allowed_packet;
-extern unsigned long net_buffer_length;
-
int my_net_init(NET *net, Vio* vio);
+void my_net_local_init(NET *net);
void net_end(NET *net);
void net_clear(NET *net);
int net_flush(NET *net);
@@ -264,6 +262,9 @@ typedef struct st_udf_init
extern "C" {
#endif
+extern unsigned long max_allowed_packet;
+extern unsigned long net_buffer_length;
+
void randominit(struct rand_struct *,unsigned long seed1,
unsigned long seed2);
double rnd(struct rand_struct *);
diff --git a/include/mysql_embed.h b/include/mysql_embed.h
index 58a743771fa..bc75c3fbcb8 100644
--- a/include/mysql_embed.h
+++ b/include/mysql_embed.h
@@ -27,4 +27,8 @@
#undef HAVE_ISAM
#define DONT_USE_RAID
+
+#undef MYSQL_SERVER_SUFFIX
+#define MYSQL_SERVER_SUFFIX "-embedded"
+
#endif /* EMBEDDED_LIBRARY */
diff --git a/include/mysql_version.h.in b/include/mysql_version.h.in
index 44fd00f806a..793bf36e9fe 100644
--- a/include/mysql_version.h.in
+++ b/include/mysql_version.h.in
@@ -3,19 +3,25 @@
/* Version numbers for protocol & mysqld */
+#ifndef _mysql_version_h
+#define _mysql_version_h
#ifdef _CUSTOMCONFIG_
#include <custom_conf.h>
#else
#define PROTOCOL_VERSION @PROTOCOL_VERSION@
#define MYSQL_SERVER_VERSION "@VERSION@"
+#ifndef MYSQL_SERVER_SUFFIX
#define MYSQL_SERVER_SUFFIX "@MYSQL_SERVER_SUFFIX@"
+#endif
#define FRM_VER @DOT_FRM_VERSION@
#define MYSQL_VERSION_ID @MYSQL_VERSION_ID@
#define MYSQL_PORT @MYSQL_TCP_PORT@
#define MYSQL_UNIX_ADDR "@MYSQL_UNIX_ADDR@"
+#define MYSQL_CONFIG_NAME "my"
/* mysqld compile time options */
#ifndef MYSQL_CHARSET
#define MYSQL_CHARSET "@default_charset@"
-#endif
-#endif
+#endif /* MYSQL_CHARSET */
+#endif /* _CUSTOMCONFIG_ */
+#endif /* _mysql_version_h */
diff --git a/include/mysqld_error.h b/include/mysqld_error.h
index 854005d17bc..635d8390c2c 100644
--- a/include/mysqld_error.h
+++ b/include/mysqld_error.h
@@ -243,8 +243,18 @@
#define ER_MIXING_NOT_ALLOWED 1224
#define ER_DUP_ARGUMENT 1225
#define ER_USER_LIMIT_REACHED 1226
-#define ER_WRONG_FK_DEF 1227
-#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1228
-#define ER_SUBSELECT_NO_1_COL 1229
-#define ER_SUBSELECT_NO_1_ROW 1230
-#define ER_ERROR_MESSAGES 231
+#define ER_SPECIFIC_ACCESS_DENIED_ERROR 1227
+#define ER_LOCAL_VARIABLE 1228
+#define ER_GLOBAL_VARIABLE 1229
+#define ER_NO_DEFAULT 1230
+#define ER_WRONG_VALUE_FOR_VAR 1231
+#define ER_WRONG_TYPE_FOR_VAR 1232
+#define ER_VAR_CANT_BE_READ 1233
+#define ER_CANT_USE_OPTION_HERE 1234
+#define ER_NOT_SUPPORTED_YET 1235
+#define ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
+#define ER_WRONG_FK_DEF 1237
+#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1238
+#define ER_SUBSELECT_NO_1_COL 1239
+#define ER_SUBSELECT_NO_1_ROW 1240
+#define ER_ERROR_MESSAGES 241
diff --git a/include/raid.h b/include/raid.h
index 4a988760157..b5a5e665824 100644
--- a/include/raid.h
+++ b/include/raid.h
@@ -27,7 +27,10 @@ C_MODE_START
extern const char *raid_type_string[];
C_MODE_END
-#if defined(USE_RAID) && !defined(DONT_USE_RAID)
+#ifdef DONT_USE_RAID
+#undef USE_RAID
+#endif
+#if defined(USE_RAID)
#ifdef __GNUC__
#pragma interface /* gcc class implementation */
@@ -41,7 +44,7 @@ C_MODE_END
#define my_write(A,B,C,D) my_raid_write(A,B,C,D)
#define my_pwrite(A,B,C,D,E) my_raid_pwrite(A,B,C,D,E)
#define my_pread(A,B,C,D,E) my_raid_pread(A,B,C,D,E)
-#define my_chsize(A,B,C) my_raid_chsize(A,B,C)
+#define my_chsize(A,B,C,D) my_raid_chsize(A,B,C,D)
#define my_close(A,B) my_raid_close(A,B)
#define my_tell(A,B) my_raid_tell(A,B)
#define my_seek(A,B,C,D) my_raid_seek(A,B,C,D)
@@ -82,7 +85,7 @@ extern "C" {
int my_raid_lock(File,int locktype, my_off_t start, my_off_t length,
myf MyFlags);
- int my_raid_chsize(File fd, my_off_t newlength, myf MyFlags);
+ int my_raid_chsize(File fd, my_off_t newlength, int filler, myf MyFlags);
int my_raid_close(File, myf MyFlags);
int my_raid_fstat(int Filedes, struct stat *buf, myf MyFlags);
@@ -113,7 +116,7 @@ class RaidFd {
int Write(const byte *Buffer, uint Count, myf MyFlags);
int Read(const byte *Buffer, uint Count, myf MyFlags);
int Lock(int locktype, my_off_t start, my_off_t length, myf MyFlags);
- int Chsize(File fd, my_off_t newlength, myf MyFlags);
+ int Chsize(File fd, my_off_t newlength, int filler, myf MyFlags);
int Fstat(int fd, MY_STAT *stat_area, myf MyFlags );
int Close(myf MyFlags);
static bool IsRaid(File fd);
diff --git a/include/rijndael.h b/include/rijndael.h
new file mode 100644
index 00000000000..e286c89cbdc
--- /dev/null
+++ b/include/rijndael.h
@@ -0,0 +1,42 @@
+/* Copyright (C) 2002 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
+/*
+ rijndael-alg-fst.h
+
+ @version 3.0 (December 2000)
+ Optimised ANSI C code for the Rijndael cipher (now AES)
+ @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
+ @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
+ @author Paulo Barreto <paulo.barreto@terra.com.br>
+
+ This code is hereby placed in the public domain.
+ Modified by Peter Zaitsev to fit MySQL coding style.
+ */
+
+#define AES_MAXKC (256/32)
+#define AES_MAXKB (256/8)
+#define AES_MAXNR 14
+
+int rijndaelKeySetupEnc(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[],
+ int keyBits);
+int rijndaelKeySetupDec(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[],
+ int keyBits);
+void rijndaelEncrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr,
+ const uint8 pt[16], uint8 ct[16]);
+void rijndaelDecrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr,
+ const uint8 ct[16], uint8 pt[16]);
diff --git a/include/sha1.h b/include/sha1.h
new file mode 100644
index 00000000000..1c345469d3c
--- /dev/null
+++ b/include/sha1.h
@@ -0,0 +1,67 @@
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
+ This is the header file for code which implements the Secure
+ Hashing Algorithm 1 as defined in FIPS PUB 180-1 published
+ April 17, 1995.
+
+ Many of the variable names in this code, especially the
+ single character names, were used because those were the names
+ used in the publication.
+
+ Please read the file sha1.c for more information.
+
+ Modified 2002 by Peter Zaitsev to better follow MySQL standards
+*/
+
+
+enum sha_result_codes
+{
+ SHA_SUCCESS = 0,
+ SHA_NULL, /* Null pointer parameter */
+ SHA_INPUT_TOO_LONG, /* input data too long */
+ SHA_STATE_ERROR /* called Input after Result */
+};
+
+#define SHA1_HASH_SIZE 20 /* Hash size in bytes */
+
+/*
+ This structure will hold context information for the SHA-1
+ hashing operation
+*/
+
+typedef struct SHA1_CONTEXT
+{
+ ulonglong Length; /* Message length in bits */
+ uint32 Intermediate_Hash[SHA1_HASH_SIZE/4]; /* Message Digest */
+ int Computed; /* Is the digest computed? */
+ int Corrupted; /* Is the message digest corrupted? */
+ int16 Message_Block_Index; /* Index into message block array */
+ uint8 Message_Block[64]; /* 512-bit message blocks */
+} SHA1_CONTEXT;
+
+/*
+ Function Prototypes
+*/
+
+C_MODE_START
+
+int sha1_reset( SHA1_CONTEXT* );
+int sha1_input( SHA1_CONTEXT*, const uint8 *, unsigned int );
+int sha1_result( SHA1_CONTEXT* , uint8 Message_Digest[SHA1_HASH_SIZE] );
+
+C_MODE_END
diff --git a/include/sslopt-case.h b/include/sslopt-case.h
deleted file mode 100644
index d2799118973..00000000000
--- a/include/sslopt-case.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 2000 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifdef HAVE_OPENSSL
- case OPT_SSL_SSL:
- opt_use_ssl = 1; /* true */
- break;
- case OPT_SSL_KEY:
- opt_use_ssl = 1; /* true */
-//QQ to be removed??? my_free(opt_ssl_key, MYF(MY_ALLOW_ZERO_PTR));
-//QQ to be removed??? opt_ssl_key = my_strdup(optarg, MYF(0));
- my_free(opt_ssl_key, MYF(MY_ALLOW_ZERO_PTR));
- opt_ssl_key = my_strdup(argument, MYF(0));
- break;
- case OPT_SSL_CERT:
- opt_use_ssl = 1; /* true */
- my_free(opt_ssl_cert, MYF(MY_ALLOW_ZERO_PTR));
- opt_ssl_cert = my_strdup(argument, MYF(0));
- break;
- case OPT_SSL_CA:
- opt_use_ssl = 1; /* true */
- my_free(opt_ssl_ca, MYF(MY_ALLOW_ZERO_PTR));
- opt_ssl_ca = my_strdup(argument, MYF(0));
- break;
- case OPT_SSL_CAPATH:
- opt_use_ssl = 1; /* true */
- my_free(opt_ssl_capath, MYF(MY_ALLOW_ZERO_PTR));
- opt_ssl_capath = my_strdup(argument, MYF(0));
- break;
- case OPT_SSL_CIPHER:
- opt_use_ssl = 1; /* true */
- my_free(opt_ssl_cipher, MYF(MY_ALLOW_ZERO_PTR));
- opt_ssl_cipher = my_strdup(argument, MYF(0));
- break;
-#endif
diff --git a/include/sslopt-longopts.h b/include/sslopt-longopts.h
index d82c833c439..811fbcbbdd6 100644
--- a/include/sslopt-longopts.h
+++ b/include/sslopt-longopts.h
@@ -34,7 +34,7 @@
"CA directory (check OpenSSL docs, implies --ssl)",
(gptr*) &opt_ssl_capath, (gptr*) &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
- {"ssl-cipher", OPT_SSL_CAPATH, "SSL cipher to use (implies --ssl)",
+ {"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl)",
(gptr*) &opt_ssl_cipher, (gptr*) &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
diff --git a/include/sslopt-usage.h b/include/sslopt-usage.h
index e5e374dea44..e3536edf804 100644
--- a/include/sslopt-usage.h
+++ b/include/sslopt-usage.h
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifdef OPEN_SSL
+#ifdef HAVE_OPENSSL
puts("\
--ssl Use SSL for connection (automatically set with other flags\n\
--ssl-key X509 key in PEM format (implies --ssl)\n\
diff --git a/include/thr_alarm.h b/include/thr_alarm.h
index 5caf552718c..30825d49158 100644
--- a/include/thr_alarm.h
+++ b/include/thr_alarm.h
@@ -38,6 +38,15 @@ extern "C" {
#define THR_SERVER_ALARM SIGALRM
#endif
+typedef struct st_alarm_info
+{
+ ulong next_alarm_time;
+ uint active_alarms;
+ uint max_used_alarms;
+} ALARM_INFO;
+
+void thr_alarm_info(ALARM_INFO *info);
+
#if defined(DONT_USE_THR_ALARM) || !defined(THREAD)
#define USE_ALARM_THREAD
diff --git a/include/violite.h b/include/violite.h
index 40da31ee1b6..6dd7b765071 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -60,7 +60,7 @@ int vio_write(Vio *vio, const gptr buf, int size);
/*
* Whenever the socket is set to blocking mode or not.
*/
-int vio_blocking(Vio *vio, my_bool onoff);
+int vio_blocking(Vio *vio, my_bool onoff, my_bool *old_mode);
my_bool vio_is_blocking(Vio *vio);
/*
* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible.
@@ -112,7 +112,8 @@ my_bool vio_poll_read(Vio *vio,uint timeout);
#define vio_errno(vio) (vio)->vioerrno(vio)
#define vio_read(vio, buf, size) (vio)->read(vio,buf,size)
#define vio_write(vio, buf, size) (vio)->write(vio, buf, size)
-#define vio_blocking(vio, set_blocking_mode) (vio)->vioblocking(vio, set_blocking_mode)
+#define vio_blocking(vio, set_blocking_mode, old_mode)\
+ (vio)->vioblocking(vio, set_blocking_mode, old_mode)
#define vio_is_blocking(vio) (vio)->is_blocking(vio)
#define vio_fastsend(vio) (vio)->fastsend(vio)
#define vio_keepalive(vio, set_keep_alive) (vio)->viokeepalive(vio, set_keep_alive)
@@ -136,8 +137,6 @@ void vio_ssl_delete(Vio* vio);
int vio_ssl_read(Vio* vio,gptr buf, int size);
int vio_ssl_write(Vio* vio,const gptr buf,int size);
-int vio_ssl_blocking(Vio* vio,my_bool onoff);
-my_bool vio_ssl_is_blocking(Vio* vio);
/* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible. */
int vio_ssl_fastsend(Vio* vio);
@@ -151,6 +150,7 @@ int vio_ssl_close(Vio* vio);
int vio_ssl_errno(Vio *vio);
my_bool vio_ssl_peer_addr(Vio* vio, char *buf);
void vio_ssl_in_addr(Vio *vio, struct in_addr *in);
+int vio_ssl_blocking(Vio * vio, my_bool set_blocking_mode, my_bool *old_mode);
/* Single copy for server */
enum vio_ssl_acceptorfd_state
@@ -213,7 +213,7 @@ struct st_vio
int (*vioerrno)(Vio*);
int (*read)(Vio*, gptr, int);
int (*write)(Vio*, gptr, int);
- int (*vioblocking)(Vio*, my_bool);
+ int (*vioblocking)(Vio*, my_bool, my_bool *);
my_bool (*is_blocking)(Vio*);
int (*viokeepalive)(Vio*, my_bool);
int (*fastsend)(Vio*);
diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c
index 0263996a429..38d97785832 100644
--- a/innobase/btr/btr0btr.c
+++ b/innobase/btr/btr0btr.c
@@ -572,6 +572,13 @@ btr_page_get_father_for_rec(
if (btr_node_ptr_get_child_page_no(node_ptr) !=
buf_frame_get_page_no(page)) {
+ fprintf(stderr,
+"InnoDB: Dump of the child page:\n");
+ buf_page_print(buf_frame_align(page));
+ fprintf(stderr,
+"InnoDB: Dump of the parent page:\n");
+ buf_page_print(buf_frame_align(node_ptr));
+
fprintf(stderr,
"InnoDB: Corruption of an index tree: table %s, index %s,\n"
"InnoDB: father ptr page no %lu, child page no %lu\n",
@@ -581,6 +588,12 @@ btr_page_get_father_for_rec(
buf_frame_get_page_no(page));
page_rec_print(page_rec_get_next(page_get_infimum_rec(page)));
page_rec_print(node_ptr);
+
+ fprintf(stderr,
+"InnoDB: You should dump + drop + reimport the table to fix the\n"
+"InnoDB: corruption. If the crash happens at the database startup, see\n"
+"InnoDB: section 6.1 of http://www.innodb.com/ibman.html about forcing\n"
+"InnoDB: recovery. Then dump + drop + reimport.\n");
}
ut_a(btr_node_ptr_get_child_page_no(node_ptr) ==
@@ -780,12 +793,14 @@ top_loop:
/*****************************************************************
Reorganizes an index page. */
-
+static
void
btr_page_reorganize_low(
/*====================*/
- ibool low, /* in: TRUE if locks should not be updated, i.e.,
- there cannot exist locks on the page */
+ ibool recovery,/* in: TRUE if called in recovery: locks should not
+ be updated, i.e., there cannot exist locks on the
+ page, and a hash index should not be dropped: it
+ cannot exist */
page_t* page, /* in: page to be reorganized */
mtr_t* mtr) /* in: mtr */
{
@@ -805,7 +820,9 @@ btr_page_reorganize_low(
/* Copy the old page to temporary space */
buf_frame_copy(new_page, page);
- btr_search_drop_page_hash_index(page);
+ if (!recovery) {
+ btr_search_drop_page_hash_index(page);
+ }
/* Recreate the page: note that global data on page (possible
segment headers, next page-field, etc.) is preserved intact */
@@ -820,7 +837,7 @@ btr_page_reorganize_low(
/* Copy max trx id to recreated page */
page_set_max_trx_id(page, page_get_max_trx_id(new_page));
- if (!low) {
+ if (!recovery) {
/* Update the record lock bitmaps */
lock_move_reorganize_page(page, new_page);
}
@@ -2059,8 +2076,7 @@ btr_discard_page(
btr_search_drop_page_hash_index(page);
- if ((left_page_no == FIL_NULL)
- && (btr_page_get_level(page, mtr) > 0)) {
+ if (left_page_no == FIL_NULL && btr_page_get_level(page, mtr) > 0) {
/* We have to mark the leftmost node pointer on the right
side page as the predefined minimum record */
diff --git a/innobase/btr/btr0cur.c b/innobase/btr/btr0cur.c
index 1274719cf7d..bab5c78b712 100644
--- a/innobase/btr/btr0cur.c
+++ b/innobase/btr/btr0cur.c
@@ -36,9 +36,16 @@ Created 10/16/1994 Heikki Tuuri
#include "ibuf0ibuf.h"
#include "lock0lock.h"
+/* If the following is set to TRUE, this module prints a lot of
+trace information of individual record operations */
+ibool btr_cur_print_record_ops = FALSE;
+
ulint btr_cur_rnd = 0;
ulint btr_cur_n_non_sea = 0;
+ulint btr_cur_n_sea = 0;
+ulint btr_cur_n_non_sea_old = 0;
+ulint btr_cur_n_sea_old = 0;
/* In the optimistic insert, if the insert does not fit, but this much space
can be released by page reorganize, then it is reorganized */
@@ -187,11 +194,7 @@ btr_cur_search_to_nth_level(
tuple must be set so that it cannot get
compared to the node ptr page number field! */
ulint mode, /* in: PAGE_CUR_L, ...;
- NOTE that if the search is made using a unique
- prefix of a record, mode should be
- PAGE_CUR_LE, not PAGE_CUR_GE, as the latter
- may end up on the previous page relative to the
- record! Inserts should always be made using
+ Inserts should always be made using
PAGE_CUR_LE to search the position! */
ulint latch_mode, /* in: BTR_SEARCH_LEAF, ..., ORed with
BTR_INSERT and BTR_ESTIMATE;
@@ -268,7 +271,7 @@ btr_cur_search_to_nth_level(
#ifdef UNIV_SEARCH_PERF_STAT
info->n_searches++;
#endif
- if (btr_search_latch.writer != RW_LOCK_NOT_LOCKED
+ if (btr_search_latch.writer == RW_LOCK_NOT_LOCKED
&& latch_mode <= BTR_MODIFY_LEAF && info->last_hash_succ
&& !estimate
&& btr_search_guess_on_hash(index, info, tuple, mode,
@@ -283,14 +286,14 @@ btr_cur_search_to_nth_level(
|| mode != PAGE_CUR_LE);
ut_ad(cursor->low_match != ULINT_UNDEFINED
|| mode != PAGE_CUR_LE);
+ btr_cur_n_sea++;
+
return;
}
#endif
#endif
-
-#ifdef UNIV_SEARCH_PERF_STAT
btr_cur_n_non_sea++;
-#endif
+
/* If the hash search did not succeed, do binary search down the
tree */
@@ -796,15 +799,28 @@ btr_cur_optimistic_insert(
ulint data_size;
ulint extra_size;
ulint type;
- ulint err;
-
- ut_ad(dtuple_check_typed(entry));
+ ulint err;
*big_rec = NULL;
page = btr_cur_get_page(cursor);
index = cursor->index;
+ if (!dtuple_check_typed_no_assert(entry)) {
+ fprintf(stderr,
+"InnoDB: Error in a tuple to insert into table %lu index %s\n",
+ index->table_name, index->name);
+ }
+
+ if (btr_cur_print_record_ops && thr) {
+ printf(
+ "Trx with id %lu %lu going to insert to table %s index %s\n",
+ ut_dulint_get_high(thr_get_trx(thr)->id),
+ ut_dulint_get_low(thr_get_trx(thr)->id),
+ index->table_name, index->name);
+ dtuple_print(entry);
+ }
+
ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
MTR_MEMO_PAGE_X_FIX));
max_size = page_get_max_insert_size_after_reorganize(page, 1);
@@ -928,7 +944,7 @@ calculate_sizes_again:
buf_frame_get_page_no(page), max_size,
rec_size + PAGE_DIR_SLOT_SIZE, type);
*/
- if (!(type & (DICT_CLUSTERED | DICT_UNIQUE))) {
+ if (!(type & DICT_CLUSTERED)) {
/* We have added a record to page: update its free bits */
ibuf_update_free_bits_if_full(cursor->index, page, max_size,
rec_size + PAGE_DIR_SLOT_SIZE);
@@ -1197,6 +1213,8 @@ btr_cur_parse_update_in_place(
rec_offset = mach_read_from_2(ptr);
ptr += 2;
+ ut_a(rec_offset <= UNIV_PAGE_SIZE);
+
heap = mem_heap_create(256);
ptr = row_upd_index_parse(ptr, end_ptr, heap, &update);
@@ -1258,6 +1276,15 @@ btr_cur_update_sec_rec_in_place(
rec = btr_cur_get_rec(cursor);
+ if (btr_cur_print_record_ops && thr) {
+ printf(
+ "Trx with id %lu %lu going to update table %s index %s\n",
+ ut_dulint_get_high(thr_get_trx(thr)->id),
+ ut_dulint_get_low(thr_get_trx(thr)->id),
+ index->table_name, index->name);
+ rec_print(rec);
+ }
+
err = lock_sec_rec_modify_check_and_lock(0, rec, index, thr);
if (err != DB_SUCCESS) {
@@ -1312,6 +1339,15 @@ btr_cur_update_in_place(
index = cursor->index;
trx = thr_get_trx(thr);
+ if (btr_cur_print_record_ops && thr) {
+ printf(
+ "Trx with id %lu %lu going to update table %s index %s\n",
+ ut_dulint_get_high(thr_get_trx(thr)->id),
+ ut_dulint_get_low(thr_get_trx(thr)->id),
+ index->table_name, index->name);
+ rec_print(rec);
+ }
+
/* Do lock checking and undo logging */
err = btr_cur_upd_lock_and_undo(flags, cursor, update, cmpl_info,
thr, &roll_ptr);
@@ -1323,6 +1359,12 @@ btr_cur_update_in_place(
block = buf_block_align(rec);
if (block->is_hashed) {
+ if (row_upd_changes_ord_field_binary(NULL, index, update)) {
+
+ /* Remove possible hash index pointer to this record */
+ btr_search_update_hash_on_delete(cursor);
+ }
+
rw_lock_x_lock(&btr_search_latch);
}
@@ -1398,6 +1440,15 @@ btr_cur_optimistic_update(
rec = btr_cur_get_rec(cursor);
index = cursor->index;
+ if (btr_cur_print_record_ops && thr) {
+ printf(
+ "Trx with id %lu %lu going to update table %s index %s\n",
+ ut_dulint_get_high(thr_get_trx(thr)->id),
+ ut_dulint_get_low(thr_get_trx(thr)->id),
+ index->table_name, index->name);
+ rec_print(rec);
+ }
+
ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
MTR_MEMO_PAGE_X_FIX));
if (!row_upd_changes_field_size(rec, index, update)) {
@@ -1928,6 +1979,8 @@ btr_cur_parse_del_mark_set_clust_rec(
offset = mach_read_from_2(ptr);
ptr += 2;
+ ut_a(offset <= UNIV_PAGE_SIZE);
+
if (page) {
rec = page + offset;
@@ -1973,6 +2026,15 @@ btr_cur_del_mark_set_clust_rec(
rec = btr_cur_get_rec(cursor);
index = cursor->index;
+ if (btr_cur_print_record_ops && thr) {
+ printf(
+ "Trx with id %lu %lu going to del mark table %s index %s\n",
+ ut_dulint_get_high(thr_get_trx(thr)->id),
+ ut_dulint_get_low(thr_get_trx(thr)->id),
+ index->table_name, index->name);
+ rec_print(rec);
+ }
+
ut_ad(index->type & DICT_CLUSTERED);
ut_ad(rec_get_deleted_flag(rec) == FALSE);
@@ -2069,6 +2131,8 @@ btr_cur_parse_del_mark_set_sec_rec(
offset = mach_read_from_2(ptr);
ptr += 2;
+ ut_a(offset <= UNIV_PAGE_SIZE);
+
if (page) {
rec = page + offset;
@@ -2102,6 +2166,15 @@ btr_cur_del_mark_set_sec_rec(
rec = btr_cur_get_rec(cursor);
+ if (btr_cur_print_record_ops && thr) {
+ printf(
+ "Trx with id %lu %lu going to del mark table %s index %s\n",
+ ut_dulint_get_high(thr_get_trx(thr)->id),
+ ut_dulint_get_low(thr_get_trx(thr)->id),
+ cursor->index->table_name, cursor->index->name);
+ rec_print(rec);
+ }
+
err = lock_sec_rec_modify_check_and_lock(flags, rec, cursor->index,
thr);
if (err != DB_SUCCESS) {
diff --git a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c
index 8a54d9de9c0..cef3a4e4b38 100644
--- a/innobase/btr/btr0sea.c
+++ b/innobase/btr/btr0sea.c
@@ -15,7 +15,9 @@ Created 2/17/1996 Heikki Tuuri
#include "page0page.h"
#include "page0cur.h"
#include "btr0cur.h"
+#include "btr0pcur.h"
#include "btr0btr.h"
+#include "ha0ha.h"
ulint btr_search_n_succ = 0;
ulint btr_search_n_hash_fail = 0;
@@ -145,6 +147,8 @@ btr_search_info_create(
info = mem_heap_alloc(heap, sizeof(btr_search_t));
+ info->magic_n = BTR_SEARCH_MAGIC_N;
+
info->last_search = NULL;
info->n_direction = 0;
info->root_guess = NULL;
@@ -159,6 +163,12 @@ btr_search_info_create(
info->n_patt_succ = 0;
info->n_searches = 0;
+ /* Set some sensible values */
+ info->n_fields = 1;
+ info->n_bytes = 0;
+
+ info->side = BTR_SEARCH_LEFT_SIDE;
+
return(info);
}
@@ -197,7 +207,7 @@ btr_search_info_update_hash(
/* Test if the search would have succeeded using the recommended
hash prefix */
- if ((info->n_fields >= n_unique) && (cursor->up_match >= n_unique)) {
+ if (info->n_fields >= n_unique && cursor->up_match >= n_unique) {
info->n_hash_potential++;
@@ -207,8 +217,8 @@ btr_search_info_update_hash(
cmp = ut_pair_cmp(info->n_fields, info->n_bytes,
cursor->low_match, cursor->low_bytes);
- if (((info->side == BTR_SEARCH_LEFT_SIDE) && (cmp <= 0))
- || ((info->side == BTR_SEARCH_RIGHT_SIDE) && (cmp > 0))) {
+ if ((info->side == BTR_SEARCH_LEFT_SIDE && cmp <= 0)
+ || (info->side == BTR_SEARCH_RIGHT_SIDE && cmp > 0)) {
goto set_new_recomm;
}
@@ -216,8 +226,8 @@ btr_search_info_update_hash(
cmp = ut_pair_cmp(info->n_fields, info->n_bytes,
cursor->up_match, cursor->up_bytes);
- if (((info->side == BTR_SEARCH_LEFT_SIDE) && (cmp > 0))
- || ((info->side == BTR_SEARCH_RIGHT_SIDE) && (cmp <= 0))) {
+ if ((info->side == BTR_SEARCH_LEFT_SIDE && cmp > 0)
+ || (info->side == BTR_SEARCH_RIGHT_SIDE && cmp <= 0)) {
goto set_new_recomm;
}
@@ -233,19 +243,18 @@ set_new_recomm:
info->hash_analysis = 0;
- if ((cursor->up_match >= n_unique)
- || (cursor->low_match >= n_unique)) {
- info->n_fields = n_unique;
- info->n_bytes = 0;
-
- info->side = BTR_SEARCH_LEFT_SIDE;
- }
-
cmp = ut_pair_cmp(cursor->up_match, cursor->up_bytes,
cursor->low_match, cursor->low_bytes);
if (cmp == 0) {
info->n_hash_potential = 0;
+ /* For extra safety, we set some sensible values here */
+
+ info->n_fields = 1;
+ info->n_bytes = 0;
+
+ info->side = BTR_SEARCH_LEFT_SIDE;
+
} else if (cmp > 0) {
info->n_hash_potential = 1;
@@ -305,6 +314,9 @@ btr_search_update_block_hash_info(
info->last_hash_succ = FALSE;
+ ut_a(block->magic_n == BUF_BLOCK_MAGIC_N);
+ ut_a(info->magic_n == BTR_SEARCH_MAGIC_N);
+
if ((block->n_hash_helps > 0)
&& (info->n_hash_potential > 0)
&& (block->n_fields == info->n_fields)
@@ -440,7 +452,9 @@ btr_search_info_update_slow(
rw_lock_x_unlock(&btr_search_latch);
}
- if (build_index) {
+ if (build_index) {
+ ut_a(block->n_fields + block->n_bytes > 0);
+
btr_search_build_page_hash_index(block->frame,
block->n_fields,
block->n_bytes,
@@ -622,6 +636,7 @@ btr_search_guess_on_hash(
dulint tree_id;
#ifdef notdefined
btr_cur_t cursor2;
+ btr_pcur_t pcur;
#endif
ut_ad(index && info && tuple && cursor && mtr);
ut_ad((latch_mode == BTR_SEARCH_LEAF)
@@ -664,6 +679,9 @@ btr_search_guess_on_hash(
rw_lock_s_lock(&btr_search_latch);
}
+ ut_a(btr_search_latch.writer != RW_LOCK_EX);
+ ut_a(btr_search_latch.reader_count > 0);
+
rec = ha_search_and_get_data(btr_search_sys->hash_index, fold);
if (!rec) {
@@ -754,7 +772,26 @@ btr_search_guess_on_hash(
btr_cur_search_to_nth_level(index, 0, tuple, mode, latch_mode,
&cursor2, 0, mtr);
- ut_a(btr_cur_get_rec(&cursor2) == btr_cur_get_rec(cursor));
+ if (mode == PAGE_CUR_GE
+ && btr_cur_get_rec(&cursor2) == page_get_supremum_rec(
+ buf_frame_align(btr_cur_get_rec(&cursor2)))) {
+
+ /* If mode is PAGE_CUR_GE, then the binary search
+ in the index tree may actually take us to the supremum
+ of the previous page */
+
+ info->last_hash_succ = FALSE;
+
+ btr_pcur_open_on_user_rec(index, tuple, mode, latch_mode,
+ &pcur, mtr);
+ ut_a(btr_pcur_get_rec(&pcur) == btr_cur_get_rec(cursor));
+ } else {
+ ut_a(btr_cur_get_rec(&cursor2) == btr_cur_get_rec(cursor));
+ }
+
+ /* NOTE that it is theoretically possible that the above assertions
+ fail if the page of the cursor gets removed from the buffer pool
+ meanwhile! Thus it might not be a bug. */
info->last_hash_succ = TRUE;
#endif
@@ -835,6 +872,8 @@ btr_search_drop_page_hash_index(
n_fields = block->curr_n_fields;
n_bytes = block->curr_n_bytes;
+ ut_a(n_fields + n_bytes > 0);
+
rw_lock_s_unlock(&btr_search_latch);
n_recs = page_get_n_recs(page);
@@ -851,6 +890,14 @@ btr_search_drop_page_hash_index(
rec = page_get_infimum_rec(page);
rec = page_rec_get_next(rec);
+ if (rec != sup) {
+ ut_a(n_fields <= rec_get_n_fields(rec));
+
+ if (n_bytes > 0) {
+ ut_a(n_fields < rec_get_n_fields(rec));
+ }
+ }
+
tree_id = btr_page_get_index_id(page);
prev_fold = 0;
@@ -861,7 +908,7 @@ btr_search_drop_page_hash_index(
fold = rec_fold(rec, n_fields, n_bytes, tree_id);
- if ((fold == prev_fold) && (prev_fold != 0)) {
+ if (fold == prev_fold && prev_fold != 0) {
goto next_rec;
}
@@ -873,6 +920,7 @@ btr_search_drop_page_hash_index(
n_cached++;
next_rec:
rec = page_rec_get_next(rec);
+ prev_fold = fold;
}
rw_lock_x_lock(&btr_search_latch);
@@ -913,7 +961,7 @@ btr_search_drop_page_hash_when_freed(
mtr_start(&mtr);
/* We assume that if the caller has a latch on the page,
- then the caller has already drooped the hash index for the page,
+ then the caller has already dropped the hash index for the page,
and we never get here. Therefore we can acquire the s-latch to
the page without fearing a deadlock. */
@@ -980,6 +1028,8 @@ btr_search_build_page_hash_index(
return;
}
+ ut_a(n_fields + n_bytes > 0);
+
/* Calculate and cache fold values and corresponding records into
an array for fast insertion to the hash index */
@@ -995,6 +1045,14 @@ btr_search_build_page_hash_index(
rec = page_get_infimum_rec(page);
rec = page_rec_get_next(rec);
+ if (rec != sup) {
+ ut_a(n_fields <= rec_get_n_fields(rec));
+
+ if (n_bytes > 0) {
+ ut_a(n_fields < rec_get_n_fields(rec));
+ }
+ }
+
/* FIXME: in a mixed tree, all records may not have enough ordering
fields: */
@@ -1126,6 +1184,8 @@ btr_search_move_or_delete_hash_entries(
rw_lock_s_unlock(&btr_search_latch);
+ ut_a(n_fields + n_bytes > 0);
+
btr_search_build_page_hash_index(new_page, n_fields, n_bytes,
side);
ut_a(n_fields == block->curr_n_fields);
@@ -1166,9 +1226,11 @@ btr_search_update_hash_on_delete(
return;
}
+ ut_a(block->curr_n_fields + block->curr_n_bytes > 0);
+
table = btr_search_sys->hash_index;
- tree_id = ((cursor->index)->tree)->id;
+ tree_id = cursor->index->tree->id;
fold = rec_fold(rec, block->curr_n_fields, block->curr_n_bytes,
tree_id);
@@ -1285,7 +1347,6 @@ btr_search_update_hash_on_insert(
if (rec != page_get_infimum_rec(page)) {
fold = rec_fold(rec, n_fields, n_bytes, tree_id);
-
} else {
if (side == BTR_SEARCH_LEFT_SIDE) {
@@ -1370,7 +1431,7 @@ btr_search_print_info(void)
rw_lock_x_lock(&btr_search_latch);
- ha_print_info(btr_search_sys->hash_index);
+/* ha_print_info(btr_search_sys->hash_index); */
rw_lock_x_unlock(&btr_search_latch);
}
@@ -1436,11 +1497,71 @@ btr_search_validate(void)
/*=====================*/
/* out: TRUE if ok */
{
+ buf_block_t* block;
+ page_t* page;
+ ha_node_t* node;
+ ulint n_page_dumps = 0;
+ ibool ok = TRUE;
+ ulint i;
+ char rec_str[500];
+
rw_lock_x_lock(&btr_search_latch);
+
+ for (i = 0; i < hash_get_n_cells(btr_search_sys->hash_index); i++) {
+ node = hash_get_nth_cell(btr_search_sys->hash_index, i)->node;
+
+ while (node != NULL) {
+ block = buf_block_align(node->data);
+ page = buf_frame_align(node->data);
+
+ if (!block->is_hashed
+ || node->fold != rec_fold((rec_t*)(node->data),
+ block->curr_n_fields,
+ block->curr_n_bytes,
+ btr_page_get_index_id(page))) {
+ ok = FALSE;
+ ut_print_timestamp(stderr);
+
+ fprintf(stderr,
+" InnoDB: Error in an adaptive hash index pointer to page %lu\n"
+"ptr mem address %lu index id %lu %lu, node fold %lu, rec fold %lu\n",
+ buf_frame_get_page_no(page),
+ (ulint)(node->data),
+ ut_dulint_get_high(btr_page_get_index_id(page)),
+ ut_dulint_get_low(btr_page_get_index_id(page)),
+ node->fold, rec_fold((rec_t*)(node->data),
+ block->curr_n_fields,
+ block->curr_n_bytes,
+ btr_page_get_index_id(page)));
+
+ rec_sprintf(rec_str, 450, (rec_t*)(node->data));
+
+ fprintf(stderr,
+ "InnoDB: Record %s\n"
+ "InnoDB: on that page.", rec_str);
+
+ fprintf(stderr,
+"Page mem address %lu, is hashed %lu, n fields %lu, n bytes %lu\n"
+"side %lu\n",
+ (ulint)page, block->is_hashed, block->curr_n_fields,
+ block->curr_n_bytes, block->curr_side);
+
+ if (n_page_dumps < 20) {
+ buf_page_print(page);
+ n_page_dumps++;
+ }
+ }
+
+ node = node->next;
+ }
+ }
- ut_a(ha_validate(btr_search_sys->hash_index));
+ if (!ha_validate(btr_search_sys->hash_index)) {
+
+ ok = FALSE;
+ }
rw_lock_x_unlock(&btr_search_latch);
- return(TRUE);
+ return(ok);
}
diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c
index e840e9f143d..ee8e8b91f8d 100644
--- a/innobase/buf/buf0buf.c
+++ b/innobase/buf/buf0buf.c
@@ -285,8 +285,8 @@ buf_page_print(
ut_print_timestamp(stderr);
fprintf(stderr,
- " InnoDB: Page dump in ascii and hex (%u bytes):\n%s",
- UNIV_PAGE_SIZE, buf);
+ " InnoDB: Page dump in ascii and hex (%lu bytes):\n%s",
+ (ulint)UNIV_PAGE_SIZE, buf);
fprintf(stderr, "InnoDB: End of page dump\n");
mem_free(buf);
@@ -1126,12 +1126,50 @@ buf_page_get_known_nowait(
}
/************************************************************************
+Inits a page to the buffer buf_pool, for use in ibbackup --restore. */
+
+void
+buf_page_init_for_backup_restore(
+/*=============================*/
+ ulint space, /* in: space id */
+ ulint offset, /* in: offset of the page within space
+ in units of a page */
+ buf_block_t* block) /* in: block to init */
+{
+ /* Set the state of the block */
+ block->magic_n = BUF_BLOCK_MAGIC_N;
+
+ block->state = BUF_BLOCK_FILE_PAGE;
+ block->space = space;
+ block->offset = offset;
+
+ block->lock_hash_val = 0;
+ block->lock_mutex = NULL;
+
+ block->freed_page_clock = 0;
+
+ block->newest_modification = ut_dulint_zero;
+ block->oldest_modification = ut_dulint_zero;
+
+ block->accessed = FALSE;
+ block->buf_fix_count = 0;
+ block->io_fix = 0;
+
+ block->n_hash_helps = 0;
+ block->is_hashed = FALSE;
+ block->n_fields = 1;
+ block->n_bytes = 0;
+ block->side = BTR_SEARCH_LEFT_SIDE;
+
+ block->file_page_was_freed = FALSE;
+}
+
+/************************************************************************
Inits a page to the buffer buf_pool. */
static
void
buf_page_init(
/*==========*/
- /* out: pointer to the block */
ulint space, /* in: space id */
ulint offset, /* in: offset of the page within space
in units of a page */
@@ -1141,6 +1179,8 @@ buf_page_init(
ut_ad(block->state == BUF_BLOCK_READY_FOR_USE);
/* Set the state of the block */
+ block->magic_n = BUF_BLOCK_MAGIC_N;
+
block->state = BUF_BLOCK_FILE_PAGE;
block->space = space;
block->offset = offset;
@@ -1667,10 +1707,11 @@ buf_print(void)
mutex_enter(&(buf_pool->mutex));
- printf("LRU len %lu \n", UT_LIST_GET_LEN(buf_pool->LRU));
- printf("free len %lu \n", UT_LIST_GET_LEN(buf_pool->free));
- printf("flush len %lu \n", UT_LIST_GET_LEN(buf_pool->flush_list));
printf("buf_pool size %lu \n", size);
+ printf("database pages %lu \n", UT_LIST_GET_LEN(buf_pool->LRU));
+ printf("free pages %lu \n", UT_LIST_GET_LEN(buf_pool->free));
+ printf("modified database pages %lu \n",
+ UT_LIST_GET_LEN(buf_pool->flush_list));
printf("n pending reads %lu \n", buf_pool->n_pend_reads);
@@ -1758,8 +1799,10 @@ buf_get_n_pending_ios(void)
Prints info of the buffer i/o. */
void
-buf_print_io(void)
-/*==============*/
+buf_print_io(
+/*=========*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end)/* in: buffer end */
{
time_t current_time;
double time_elapsed;
@@ -1767,32 +1810,48 @@ buf_print_io(void)
ut_ad(buf_pool);
+ if (buf_end - buf < 400) {
+
+ return;
+ }
+
size = buf_pool_get_curr_size() / UNIV_PAGE_SIZE;
mutex_enter(&(buf_pool->mutex));
- printf("Free list length %lu \n", UT_LIST_GET_LEN(buf_pool->free));
- printf("LRU list length %lu \n", UT_LIST_GET_LEN(buf_pool->LRU));
- printf("Flush list length %lu \n",
+ buf += sprintf(buf,
+ "Buffer pool size %lu\n", size);
+ buf += sprintf(buf,
+ "Free buffers %lu\n", UT_LIST_GET_LEN(buf_pool->free));
+ buf += sprintf(buf,
+ "Database pages %lu\n", UT_LIST_GET_LEN(buf_pool->LRU));
+/*
+ buf += sprintf(buf,
+ "Lock heap buffers %lu\n", buf_pool->n_lock_heap_pages);
+ buf += sprintf(buf,
+ "Hash index buffers %lu\n", buf_pool->n_adaptive_hash_pages);
+*/
+ buf += sprintf(buf,
+ "Modified db pages %lu\n",
UT_LIST_GET_LEN(buf_pool->flush_list));
- printf("Buffer pool size %lu\n", size);
- printf("Pending reads %lu \n", buf_pool->n_pend_reads);
+ buf += sprintf(buf, "Pending reads %lu \n", buf_pool->n_pend_reads);
- printf("Pending writes: LRU %lu, flush list %lu, single page %lu\n",
+ buf += sprintf(buf,
+ "Pending writes: LRU %lu, flush list %lu, single page %lu\n",
buf_pool->n_flush[BUF_FLUSH_LRU],
buf_pool->n_flush[BUF_FLUSH_LIST],
buf_pool->n_flush[BUF_FLUSH_SINGLE_PAGE]);
current_time = time(NULL);
- time_elapsed = difftime(current_time, buf_pool->last_printout_time);
-
+ time_elapsed = 0.001 + difftime(current_time,
+ buf_pool->last_printout_time);
buf_pool->last_printout_time = current_time;
- printf("Pages read %lu, created %lu, written %lu\n",
+ buf += sprintf(buf, "Pages read %lu, created %lu, written %lu\n",
buf_pool->n_pages_read, buf_pool->n_pages_created,
buf_pool->n_pages_written);
- printf("%.2f reads/s, %.2f creates/s, %.2f writes/s\n",
+ buf += sprintf(buf, "%.2f reads/s, %.2f creates/s, %.2f writes/s\n",
(buf_pool->n_pages_read - buf_pool->n_pages_read_old)
/ time_elapsed,
(buf_pool->n_pages_created - buf_pool->n_pages_created_old)
@@ -1801,13 +1860,14 @@ buf_print_io(void)
/ time_elapsed);
if (buf_pool->n_page_gets > buf_pool->n_page_gets_old) {
- printf("Buffer pool hit rate %lu / 1000\n",
+ buf += sprintf(buf, "Buffer pool hit rate %lu / 1000\n",
1000
- ((1000 *
(buf_pool->n_pages_read - buf_pool->n_pages_read_old))
/ (buf_pool->n_page_gets - buf_pool->n_page_gets_old)));
} else {
- printf("No buffer pool activity since the last printout\n");
+ buf += sprintf(buf,
+ "No buffer pool activity since the last printout\n");
}
buf_pool->n_page_gets_old = buf_pool->n_page_gets;
@@ -1818,6 +1878,20 @@ buf_print_io(void)
mutex_exit(&(buf_pool->mutex));
}
+/**************************************************************************
+Refreshes the statistics used to print per-second averages. */
+
+void
+buf_refresh_io_stats(void)
+/*======================*/
+{
+ buf_pool->last_printout_time = time(NULL);
+ buf_pool->n_page_gets_old = buf_pool->n_page_gets;
+ buf_pool->n_pages_read_old = buf_pool->n_pages_read;
+ buf_pool->n_pages_created_old = buf_pool->n_pages_created;
+ buf_pool->n_pages_written_old = buf_pool->n_pages_written;
+}
+
/*************************************************************************
Checks that all file pages in the buffer are in a replaceable state. */
diff --git a/innobase/buf/buf0lru.c b/innobase/buf/buf0lru.c
index 5ab045212c2..2ec1506c522 100644
--- a/innobase/buf/buf0lru.c
+++ b/innobase/buf/buf0lru.c
@@ -27,6 +27,7 @@ Created 11/5/1995 Heikki Tuuri
#include "buf0rea.h"
#include "btr0sea.h"
#include "os0file.h"
+#include "log0recv.h"
/* The number of blocks from the LRU_old pointer onward, including the block
pointed to, must be 3/8 of the whole LRU list length, except that the
@@ -205,6 +206,44 @@ buf_LRU_get_free_block(void)
loop:
mutex_enter(&(buf_pool->mutex));
+ if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free)
+ + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 10) {
+ ut_print_timestamp(stderr);
+
+ fprintf(stderr,
+" InnoDB: ERROR: over 9 / 10 of the buffer pool is occupied by\n"
+"InnoDB: lock heaps or the adaptive hash index!\n"
+"InnoDB: We intentionally generate a seg fault to print a stack trace\n"
+"InnoDB: on Linux!\n");
+
+ ut_a(0);
+
+ } else if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free)
+ + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 5) {
+
+ /* Over 80 % of the buffer pool is occupied by lock heaps
+ or the adaptive hash index. This may be a memory leak! */
+
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+" InnoDB: WARNING: over 4 / 5 of the buffer pool is occupied by\n"
+"InnoDB: lock heaps or the adaptive hash index! Check that your\n"
+"InnoDB: transactions do not set too many row locks. Starting InnoDB\n"
+"InnoDB: Monitor to print diagnostics, including lock heap and hash index\n"
+"InnoDB: sizes.\n");
+
+ srv_print_innodb_monitor = TRUE;
+
+ } else if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free)
+ + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 4) {
+
+ /* Switch off the InnoDB Monitor; this is a simple way
+ to stop the monitor if the situation becomes less urgent,
+ but may also surprise users! */
+
+ srv_print_innodb_monitor = FALSE;
+ }
+
if (buf_pool->LRU_flush_ended > 0) {
mutex_exit(&(buf_pool->mutex));
diff --git a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c
index db187cdd896..475a5bd9cbd 100644
--- a/innobase/buf/buf0rea.c
+++ b/innobase/buf/buf0rea.c
@@ -100,6 +100,11 @@ buf_read_page_low(
block = buf_page_init_for_read(mode, space, offset);
if (block != NULL) {
+ if (buf_debug_prints) {
+ printf("Posting read request for page %lu, sync %lu\n",
+ offset, sync);
+ }
+
fil_io(OS_FILE_READ | wake_later,
sync, space, offset, 0, UNIV_PAGE_SIZE,
(void*)block->frame, (void*)block);
@@ -467,6 +472,12 @@ buf_read_ahead_linear(
count = 0;
+ /* Since Windows XP seems to schedule the i/o handler thread
+ very eagerly, and consequently it does not wait for the
+ full read batch to be posted, we use special heuristics here */
+
+ os_aio_simulated_put_read_threads_to_sleep();
+
for (i = low; i < high; i++) {
/* It is only sensible to do read-ahead in the non-sync
aio mode: hence FALSE as the first parameter */
@@ -556,16 +567,34 @@ buf_read_recv_pages(
highest page number the last in the array */
ulint n_stored) /* in: number of page numbers in the array */
{
+ ulint count;
ulint i;
for (i = 0; i < n_stored; i++) {
+ count = 0;
+
+ os_aio_print_debug = FALSE;
+
while (buf_pool->n_pend_reads >= RECV_POOL_N_FREE_BLOCKS / 2) {
os_aio_simulated_wake_handler_threads();
os_thread_sleep(500000);
+
+ count++;
+
+ if (count > 100) {
+ fprintf(stderr,
+"InnoDB: Error: InnoDB has waited for 50 seconds for pending\n"
+"InnoDB: reads to the buffer pool to be finished.\n"
+"InnoDB: Number of pending reads %lu\n", buf_pool->n_pend_reads);
+
+ os_aio_print_debug = TRUE;
+ }
}
+ os_aio_print_debug = FALSE;
+
if ((i + 1 == n_stored) && sync) {
buf_read_page_low(TRUE, BUF_READ_ANY_PAGE, space,
page_nos[i]);
diff --git a/innobase/configure.in b/innobase/configure.in
index b606ecfffc0..237db834f7a 100644
--- a/innobase/configure.in
+++ b/innobase/configure.in
@@ -36,6 +36,7 @@ AC_PROG_RANLIB
AC_PROG_INSTALL
AC_CHECK_HEADERS(aio.h sched.h)
AC_CHECK_SIZEOF(int, 4)
+AC_CHECK_SIZEOF(long, 4)
AC_CHECK_FUNCS(sched_yield)
AC_CHECK_FUNCS(fdatasync)
#AC_CHECK_FUNCS(localtime_r) # Already checked by MySQL
@@ -85,8 +86,10 @@ else
fi
case "$target_os" in
+ hpux10*)
+ CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
hp*)
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
+ CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
irix*)
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
osf*)
@@ -94,6 +97,8 @@ case "$target_os" in
sysv5uw7*)
# Problem when linking on SCO
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
+ openbsd*)
+ CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
esac
case "$target" in
diff --git a/innobase/data/data0data.c b/innobase/data/data0data.c
index 03abcb9b6e0..8ab5acb4da7 100644
--- a/innobase/data/data0data.c
+++ b/innobase/data/data0data.c
@@ -64,6 +64,35 @@ dtuple_get_nth_field_noninline(
return(dtuple_get_nth_field(tuple, n));
}
+/*************************************************************************
+Tests if dfield data length and content is equal to the given. */
+
+ibool
+dfield_data_is_binary_equal(
+/*========================*/
+ /* out: TRUE if equal */
+ dfield_t* field, /* in: field */
+ ulint len, /* in: data length or UNIV_SQL_NULL */
+ byte* data) /* in: data */
+{
+ if (len != field->len) {
+
+ return(FALSE);
+ }
+
+ if (len == UNIV_SQL_NULL) {
+
+ return(TRUE);
+ }
+
+ if (0 != ut_memcmp(field->data, data, len)) {
+
+ return(FALSE);
+ }
+
+ return(TRUE);
+}
+
/****************************************************************
Returns TRUE if lengths of two dtuples are equal and respective data fields
in them are equal when compared with collation in char fields (not as binary
@@ -154,6 +183,69 @@ dtuple_set_n_fields(
}
/**************************************************************
+Checks that a data field is typed. */
+static
+ibool
+dfield_check_typed_no_assert(
+/*=========================*/
+ /* out: TRUE if ok */
+ dfield_t* field) /* in: data field */
+{
+ if (dfield_get_type(field)->mtype > DATA_MYSQL
+ || dfield_get_type(field)->mtype < DATA_VARCHAR) {
+
+ fprintf(stderr,
+"InnoDB: Error: data field type %lu, len %lu\n",
+ dfield_get_type(field)->mtype, dfield_get_len(field));
+ return(FALSE);
+ }
+
+ return(TRUE);
+}
+
+/**************************************************************
+Checks that a data tuple is typed. */
+
+ibool
+dtuple_check_typed_no_assert(
+/*=========================*/
+ /* out: TRUE if ok */
+ dtuple_t* tuple) /* in: tuple */
+{
+ dfield_t* field;
+ ulint i;
+ char err_buf[1000];
+
+ if (dtuple_get_n_fields(tuple) > REC_MAX_N_FIELDS) {
+ fprintf(stderr,
+"InnoDB: Error: index entry has %lu fields\n",
+ dtuple_get_n_fields(tuple));
+
+ dtuple_sprintf(err_buf, 900, tuple);
+ fprintf(stderr,
+"InnoDB: Tuple contents: %s\n", err_buf);
+
+ return(FALSE);
+ }
+
+ for (i = 0; i < dtuple_get_n_fields(tuple); i++) {
+
+ field = dtuple_get_nth_field(tuple, i);
+
+ if (!dfield_check_typed_no_assert(field)) {
+
+ dtuple_sprintf(err_buf, 900, tuple);
+ fprintf(stderr,
+"InnoDB: Tuple contents: %s\n", err_buf);
+
+ return(FALSE);
+ }
+ }
+
+ return(TRUE);
+}
+
+/**************************************************************
Checks that a data field is typed. Asserts an error if not. */
ibool
@@ -162,8 +254,15 @@ dfield_check_typed(
/* out: TRUE if ok */
dfield_t* field) /* in: data field */
{
- ut_a(dfield_get_type(field)->mtype <= DATA_MYSQL);
- ut_a(dfield_get_type(field)->mtype >= DATA_VARCHAR);
+ if (dfield_get_type(field)->mtype > DATA_MYSQL
+ || dfield_get_type(field)->mtype < DATA_VARCHAR) {
+
+ fprintf(stderr,
+"InnoDB: Error: data field type %lu, len %lu\n",
+ dfield_get_type(field)->mtype, dfield_get_len(field));
+
+ ut_a(0);
+ }
return(TRUE);
}
@@ -460,9 +559,21 @@ dtuple_convert_big_rec(
ibool is_externally_stored;
ulint i;
ulint j;
+ char err_buf[1000];
+ ut_a(dtuple_check_typed_no_assert(entry));
+
size = rec_get_converted_size(entry);
+ if (size > 1000000000) {
+ fprintf(stderr,
+"InnoDB: Warning: tuple size very big: %lu\n", size);
+
+ dtuple_sprintf(err_buf, 900, entry);
+ fprintf(stderr,
+"InnoDB: Tuple contents: %s\n", err_buf);
+ }
+
heap = mem_heap_create(size + dtuple_get_n_fields(entry)
* sizeof(big_rec_field_t) + 1000);
diff --git a/innobase/dict/dict0crea.c b/innobase/dict/dict0crea.c
index 0da59d39646..60beeacf435 100644
--- a/innobase/dict/dict0crea.c
+++ b/innobase/dict/dict0crea.c
@@ -153,6 +153,7 @@ dict_create_sys_tables_tuple(
if (table->type == DICT_TABLE_CLUSTER_MEMBER) {
dfield_set_data(dfield, table->cluster_name,
ut_strlen(table->cluster_name));
+ ut_a(0); /* Oracle-style clusters are not supported yet */
} else {
dfield_set_data(dfield, NULL, UNIV_SQL_NULL);
}
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index 5f6d947bb92..85199b90a5a 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -270,7 +270,7 @@ void
dict_table_autoinc_initialize(
/*==========================*/
dict_table_t* table, /* in: table */
- ib_longlong value) /* in: value which was assigned to a row */
+ ib_longlong value) /* in: next value to assign to a row */
{
mutex_enter(&(table->autoinc_mutex));
@@ -281,8 +281,8 @@ dict_table_autoinc_initialize(
}
/************************************************************************
-Gets the next autoinc value, 0 if not yet initialized. If initialized,
-increments the counter by 1. */
+Gets the next autoinc value (== autoinc counter value), 0 if not yet
+initialized. If initialized, increments the counter by 1. */
ib_longlong
dict_table_autoinc_get(
@@ -298,8 +298,8 @@ dict_table_autoinc_get(
value = 0;
} else {
- table->autoinc = table->autoinc + 1;
value = table->autoinc;
+ table->autoinc = table->autoinc + 1;
}
mutex_exit(&(table->autoinc_mutex));
@@ -334,20 +334,43 @@ dict_table_autoinc_read(
}
/************************************************************************
-Updates the autoinc counter if the value supplied is bigger than the
+Peeks the autoinc counter value, 0 if not yet initialized. Does not
+increment the counter. The read not protected by any mutex! */
+
+ib_longlong
+dict_table_autoinc_peek(
+/*====================*/
+ /* out: value of the counter */
+ dict_table_t* table) /* in: table */
+{
+ ib_longlong value;
+
+ if (!table->autoinc_inited) {
+
+ value = 0;
+ } else {
+ value = table->autoinc;
+ }
+
+ return(value);
+}
+
+/************************************************************************
+Updates the autoinc counter if the value supplied is equal or bigger than the
current value. If not inited, does nothing. */
void
dict_table_autoinc_update(
/*======================*/
+
dict_table_t* table, /* in: table */
ib_longlong value) /* in: value which was assigned to a row */
{
mutex_enter(&(table->autoinc_mutex));
if (table->autoinc_inited) {
- if (value > table->autoinc) {
- table->autoinc = value;
+ if (value >= table->autoinc) {
+ table->autoinc = value + 1;
}
}
@@ -1781,8 +1804,8 @@ char*
dict_scan_to(
/*=========*/
- char* ptr, /* in: scan from */
- char* string) /* in: look for this */
+ char* ptr, /* in: scan from */
+ const char *string) /* in: look for this */
{
ibool success;
ulint i;
@@ -1820,7 +1843,7 @@ dict_accept(
/* out: if string was accepted, the pointer
is moved after that, else ptr is returned */
char* ptr, /* in: scan from this */
- char* string, /* in: accept only this string as the next
+ const char* string, /* in: accept only this string as the next
non-whitespace string */
ibool* success)/* out: TRUE if accepted */
{
@@ -2810,6 +2833,12 @@ dict_update_statistics_low(
index = dict_table_get_first_index(table);
+ if (index == NULL) {
+ /* Table definition is corrupt */
+
+ return;
+ }
+
while (index) {
size = btr_get_size(index, BTR_TOTAL_SIZE);
@@ -3201,6 +3230,14 @@ dict_print_info_on_foreign_keys(
buf2 += sprintf(buf2, ")");
+ if (foreign->type == DICT_FOREIGN_ON_DELETE_CASCADE) {
+ buf2 += sprintf(buf2, " ON DELETE CASCADE");
+ }
+
+ if (foreign->type == DICT_FOREIGN_ON_DELETE_SET_NULL) {
+ buf2 += sprintf(buf2, " ON DELETE SET NULL");
+ }
+
foreign = UT_LIST_GET_NEXT(foreign_list, foreign);
}
diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c
index 221a6c7dabb..e9caa37fecc 100644
--- a/innobase/dict/dict0load.c
+++ b/innobase/dict/dict0load.c
@@ -21,33 +21,6 @@ Created 4/24/1996 Heikki Tuuri
#include "dict0boot.h"
/************************************************************************
-Loads definitions for table columns. */
-static
-void
-dict_load_columns(
-/*==============*/
- dict_table_t* table, /* in: table */
- mem_heap_t* heap); /* in: memory heap for temporary storage */
-/************************************************************************
-Loads definitions for table indexes. */
-static
-void
-dict_load_indexes(
-/*==============*/
- dict_table_t* table, /* in: table */
- mem_heap_t* heap); /* in: memory heap for temporary storage */
-/************************************************************************
-Loads definitions for index fields. */
-static
-void
-dict_load_fields(
-/*=============*/
- dict_table_t* table, /* in: table */
- dict_index_t* index, /* in: index whose fields to load */
- mem_heap_t* heap); /* in: memory heap for temporary storage */
-
-
-/************************************************************************
Finds the first table name in the given database. */
char*
@@ -194,7 +167,12 @@ loop:
fprintf(stderr, "InnoDB: Failed to load table %s\n",
table_name);
} else {
- dict_update_statistics_low(table, TRUE);
+ /* The table definition was corrupt if there
+ is no index */
+
+ if (dict_table_get_first_index(table)) {
+ dict_update_statistics_low(table, TRUE);
+ }
dict_table_print_low(table);
}
@@ -208,6 +186,361 @@ loop:
}
/************************************************************************
+Loads definitions for table columns. */
+static
+void
+dict_load_columns(
+/*==============*/
+ dict_table_t* table, /* in: table */
+ mem_heap_t* heap) /* in: memory heap for temporary storage */
+{
+ dict_table_t* sys_columns;
+ dict_index_t* sys_index;
+ btr_pcur_t pcur;
+ dtuple_t* tuple;
+ dfield_t* dfield;
+ rec_t* rec;
+ byte* field;
+ ulint len;
+ byte* buf;
+ char* name_buf;
+ char* name;
+ ulint mtype;
+ ulint prtype;
+ ulint col_len;
+ ulint prec;
+ ulint i;
+ mtr_t mtr;
+
+ ut_ad(mutex_own(&(dict_sys->mutex)));
+
+ mtr_start(&mtr);
+
+ sys_columns = dict_table_get_low((char*) "SYS_COLUMNS");
+ sys_index = UT_LIST_GET_FIRST(sys_columns->indexes);
+
+ tuple = dtuple_create(heap, 1);
+ dfield = dtuple_get_nth_field(tuple, 0);
+
+ buf = mem_heap_alloc(heap, 8);
+ mach_write_to_8(buf, table->id);
+
+ dfield_set_data(dfield, buf, 8);
+ dict_index_copy_types(tuple, sys_index, 1);
+
+ btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
+ BTR_SEARCH_LEAF, &pcur, &mtr);
+ for (i = 0; i < table->n_cols - DATA_N_SYS_COLS; i++) {
+
+ rec = btr_pcur_get_rec(&pcur);
+
+ ut_a(btr_pcur_is_on_user_rec(&pcur, &mtr));
+
+ ut_a(!rec_get_deleted_flag(rec));
+
+ field = rec_get_nth_field(rec, 0, &len);
+ ut_ad(len == 8);
+ ut_a(ut_dulint_cmp(table->id, mach_read_from_8(field)) == 0);
+
+ field = rec_get_nth_field(rec, 1, &len);
+ ut_ad(len == 4);
+ ut_a(i == mach_read_from_4(field));
+
+ ut_a(0 == ut_strcmp((char*) "NAME",
+ dict_field_get_col(
+ dict_index_get_nth_field(
+ dict_table_get_first_index(sys_columns), 4))->name));
+
+ field = rec_get_nth_field(rec, 4, &len);
+
+ name_buf = mem_heap_alloc(heap, len + 1);
+ ut_memcpy(name_buf, field, len);
+ name_buf[len] = '\0';
+
+ name = name_buf;
+
+ field = rec_get_nth_field(rec, 5, &len);
+ mtype = mach_read_from_4(field);
+
+ field = rec_get_nth_field(rec, 6, &len);
+ prtype = mach_read_from_4(field);
+
+ field = rec_get_nth_field(rec, 7, &len);
+ col_len = mach_read_from_4(field);
+
+ ut_a(0 == ut_strcmp((char*) "PREC",
+ dict_field_get_col(
+ dict_index_get_nth_field(
+ dict_table_get_first_index(sys_columns), 8))->name));
+
+ field = rec_get_nth_field(rec, 8, &len);
+ prec = mach_read_from_4(field);
+
+ dict_mem_table_add_col(table, name, mtype, prtype, col_len,
+ prec);
+ btr_pcur_move_to_next_user_rec(&pcur, &mtr);
+ }
+
+ btr_pcur_close(&pcur);
+ mtr_commit(&mtr);
+}
+
+/************************************************************************
+Loads definitions for index fields. */
+static
+void
+dict_load_fields(
+/*=============*/
+ dict_table_t* table, /* in: table */
+ dict_index_t* index, /* in: index whose fields to load */
+ mem_heap_t* heap) /* in: memory heap for temporary storage */
+{
+ dict_table_t* sys_fields;
+ dict_index_t* sys_index;
+ btr_pcur_t pcur;
+ dtuple_t* tuple;
+ dfield_t* dfield;
+ char* col_name;
+ rec_t* rec;
+ byte* field;
+ ulint len;
+ byte* buf;
+ ulint i;
+ mtr_t mtr;
+
+ ut_ad(mutex_own(&(dict_sys->mutex)));
+
+ UT_NOT_USED(table);
+
+ mtr_start(&mtr);
+
+ sys_fields = dict_table_get_low((char*) "SYS_FIELDS");
+ sys_index = UT_LIST_GET_FIRST(sys_fields->indexes);
+
+ tuple = dtuple_create(heap, 1);
+ dfield = dtuple_get_nth_field(tuple, 0);
+
+ buf = mem_heap_alloc(heap, 8);
+ mach_write_to_8(buf, index->id);
+
+ dfield_set_data(dfield, buf, 8);
+ dict_index_copy_types(tuple, sys_index, 1);
+
+ btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
+ BTR_SEARCH_LEAF, &pcur, &mtr);
+ for (i = 0; i < index->n_fields; i++) {
+
+ rec = btr_pcur_get_rec(&pcur);
+
+ ut_a(btr_pcur_is_on_user_rec(&pcur, &mtr));
+ if (rec_get_deleted_flag(rec)) {
+ fprintf(stderr,
+"InnoDB: Error: data dictionary entry for table %s is corrupt!\n",
+"InnoDB: An index field is delete marked.\n",
+ table->name);
+ }
+
+ field = rec_get_nth_field(rec, 0, &len);
+ ut_ad(len == 8);
+ ut_a(ut_memcmp(buf, field, len) == 0);
+
+ field = rec_get_nth_field(rec, 1, &len);
+ ut_ad(len == 4);
+ ut_a(i == mach_read_from_4(field));
+
+ ut_a(0 == ut_strcmp((char*) "COL_NAME",
+ dict_field_get_col(
+ dict_index_get_nth_field(
+ dict_table_get_first_index(sys_fields), 4))->name));
+
+ field = rec_get_nth_field(rec, 4, &len);
+
+ col_name = mem_heap_alloc(heap, len + 1);
+ ut_memcpy(col_name, field, len);
+ col_name[len] = '\0';
+
+ dict_mem_index_add_field(index, col_name, 0);
+
+ btr_pcur_move_to_next_user_rec(&pcur, &mtr);
+ }
+
+ btr_pcur_close(&pcur);
+ mtr_commit(&mtr);
+}
+
+/************************************************************************
+Loads definitions for table indexes. Adds them to the data dictionary
+cache. */
+static
+ibool
+dict_load_indexes(
+/*==============*/
+ /* out: TRUE if ok, FALSE if corruption
+ of dictionary table */
+ dict_table_t* table, /* in: table */
+ mem_heap_t* heap) /* in: memory heap for temporary storage */
+{
+ dict_table_t* sys_indexes;
+ dict_index_t* sys_index;
+ dict_index_t* index;
+ btr_pcur_t pcur;
+ dtuple_t* tuple;
+ dfield_t* dfield;
+ rec_t* rec;
+ byte* field;
+ ulint len;
+ ulint name_len;
+ char* name_buf;
+ ulint type;
+ ulint space;
+ ulint page_no;
+ ulint n_fields;
+ byte* buf;
+ ibool is_sys_table;
+ dulint id;
+ mtr_t mtr;
+
+ ut_ad(mutex_own(&(dict_sys->mutex)));
+
+ if ((ut_dulint_get_high(table->id) == 0)
+ && (ut_dulint_get_low(table->id) < DICT_HDR_FIRST_ID)) {
+ is_sys_table = TRUE;
+ } else {
+ is_sys_table = FALSE;
+ }
+
+ mtr_start(&mtr);
+
+ sys_indexes = dict_table_get_low((char*) "SYS_INDEXES");
+ sys_index = UT_LIST_GET_FIRST(sys_indexes->indexes);
+
+ tuple = dtuple_create(heap, 1);
+ dfield = dtuple_get_nth_field(tuple, 0);
+
+ buf = mem_heap_alloc(heap, 8);
+ mach_write_to_8(buf, table->id);
+
+ dfield_set_data(dfield, buf, 8);
+ dict_index_copy_types(tuple, sys_index, 1);
+
+ btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
+ BTR_SEARCH_LEAF, &pcur, &mtr);
+ for (;;) {
+ if (!btr_pcur_is_on_user_rec(&pcur, &mtr)) {
+
+ break;
+ }
+
+ rec = btr_pcur_get_rec(&pcur);
+
+ field = rec_get_nth_field(rec, 0, &len);
+ ut_ad(len == 8);
+
+ if (ut_memcmp(buf, field, len) != 0) {
+ break;
+ }
+
+ if (rec_get_deleted_flag(rec)) {
+ fprintf(stderr,
+"InnoDB: Error: data dictionary entry for table %s is corrupt!\n"
+"InnoDB: An index is delete marked.\n",
+ table->name);
+
+ btr_pcur_close(&pcur);
+ mtr_commit(&mtr);
+
+ return(FALSE);
+ }
+
+ field = rec_get_nth_field(rec, 1, &len);
+ ut_ad(len == 8);
+ id = mach_read_from_8(field);
+
+ ut_a(0 == ut_strcmp("NAME",
+ dict_field_get_col(
+ dict_index_get_nth_field(
+ dict_table_get_first_index(sys_indexes), 4))->name));
+
+ field = rec_get_nth_field(rec, 4, &name_len);
+
+ name_buf = mem_heap_alloc(heap, name_len + 1);
+ ut_memcpy(name_buf, field, name_len);
+ name_buf[name_len] = '\0';
+
+ field = rec_get_nth_field(rec, 5, &len);
+ n_fields = mach_read_from_4(field);
+
+ field = rec_get_nth_field(rec, 6, &len);
+ type = mach_read_from_4(field);
+
+ field = rec_get_nth_field(rec, 7, &len);
+ space = mach_read_from_4(field);
+
+ ut_a(0 == ut_strcmp((char*) "PAGE_NO",
+ dict_field_get_col(
+ dict_index_get_nth_field(
+ dict_table_get_first_index(sys_indexes), 8))->name));
+
+ field = rec_get_nth_field(rec, 8, &len);
+ page_no = mach_read_from_4(field);
+
+ if (page_no == FIL_NULL) {
+
+ fprintf(stderr,
+ "InnoDB: Error: trying to load index %s for table %s\n"
+ "InnoDB: but the index tree has been freed!\n",
+ name_buf, table->name);
+
+ btr_pcur_close(&pcur);
+ mtr_commit(&mtr);
+
+ return(FALSE);
+ }
+
+ if ((type & DICT_CLUSTERED) == 0
+ && NULL == dict_table_get_first_index(table)) {
+
+ fprintf(stderr,
+ "InnoDB: Error: trying to load index %s for table %s\n"
+ "InnoDB: but the first index was not clustered!\n",
+ name_buf, table->name);
+
+ btr_pcur_close(&pcur);
+ mtr_commit(&mtr);
+
+ return(FALSE);
+ }
+
+ if (is_sys_table
+ && ((type & DICT_CLUSTERED)
+ || ((table == dict_sys->sys_tables)
+ && (name_len == ut_strlen("ID_IND"))
+ && (0 == ut_memcmp(name_buf, "ID_IND",
+ name_len))))) {
+
+ /* The index was created in memory already in
+ booting */
+ } else {
+ index = dict_mem_index_create(table->name, name_buf,
+ space, type, n_fields);
+ index->page_no = page_no;
+ index->id = id;
+
+ dict_load_fields(table, index, heap);
+
+ dict_index_add_to_cache(table, index);
+ }
+
+ btr_pcur_move_to_next_user_rec(&pcur, &mtr);
+ }
+
+ btr_pcur_close(&pcur);
+ mtr_commit(&mtr);
+
+ return(TRUE);
+}
+
+/************************************************************************
Loads a table definition and also all its index definitions, and also
the cluster definition if the table is a member in a cluster. Also loads
all foreign key constraints where the foreign key is in the table or where
@@ -338,7 +671,7 @@ dict_load_table(
dict_load_columns(table, heap);
dict_table_add_to_cache(table);
-
+
dict_load_indexes(table, heap);
ut_a(DB_SUCCESS == dict_load_foreigns(table->name));
@@ -436,8 +769,6 @@ dict_load_table_on_id(
/* Load the table definition to memory */
table = dict_load_table(name);
-
- ut_a(table);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@@ -468,324 +799,6 @@ dict_load_sys_table(
}
/************************************************************************
-Loads definitions for table columns. */
-static
-void
-dict_load_columns(
-/*==============*/
- dict_table_t* table, /* in: table */
- mem_heap_t* heap) /* in: memory heap for temporary storage */
-{
- dict_table_t* sys_columns;
- dict_index_t* sys_index;
- btr_pcur_t pcur;
- dtuple_t* tuple;
- dfield_t* dfield;
- rec_t* rec;
- byte* field;
- ulint len;
- byte* buf;
- char* name_buf;
- char* name;
- ulint mtype;
- ulint prtype;
- ulint col_len;
- ulint prec;
- ulint i;
- mtr_t mtr;
-
- ut_ad(mutex_own(&(dict_sys->mutex)));
-
- mtr_start(&mtr);
-
- sys_columns = dict_table_get_low((char *) "SYS_COLUMNS");
- sys_index = UT_LIST_GET_FIRST(sys_columns->indexes);
-
- tuple = dtuple_create(heap, 1);
- dfield = dtuple_get_nth_field(tuple, 0);
-
- buf = mem_heap_alloc(heap, 8);
- mach_write_to_8(buf, table->id);
-
- dfield_set_data(dfield, buf, 8);
- dict_index_copy_types(tuple, sys_index, 1);
-
- btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
- BTR_SEARCH_LEAF, &pcur, &mtr);
- for (i = 0; i < table->n_cols - DATA_N_SYS_COLS; i++) {
-
- rec = btr_pcur_get_rec(&pcur);
-
- ut_a(btr_pcur_is_on_user_rec(&pcur, &mtr));
-
- ut_a(!rec_get_deleted_flag(rec));
-
- field = rec_get_nth_field(rec, 0, &len);
- ut_ad(len == 8);
- ut_a(ut_dulint_cmp(table->id, mach_read_from_8(field)) == 0);
-
- field = rec_get_nth_field(rec, 1, &len);
- ut_ad(len == 4);
- ut_a(i == mach_read_from_4(field));
-
- ut_a(0 == ut_strcmp((char *) "NAME",
- dict_field_get_col(
- dict_index_get_nth_field(
- dict_table_get_first_index(sys_columns), 4))->name));
-
- field = rec_get_nth_field(rec, 4, &len);
-
- name_buf = mem_heap_alloc(heap, len + 1);
- ut_memcpy(name_buf, field, len);
- name_buf[len] = '\0';
-
- name = name_buf;
-
- field = rec_get_nth_field(rec, 5, &len);
- mtype = mach_read_from_4(field);
-
- field = rec_get_nth_field(rec, 6, &len);
- prtype = mach_read_from_4(field);
-
- field = rec_get_nth_field(rec, 7, &len);
- col_len = mach_read_from_4(field);
-
- ut_a(0 == ut_strcmp((char *) "PREC",
- dict_field_get_col(
- dict_index_get_nth_field(
- dict_table_get_first_index(sys_columns), 8))->name));
-
- field = rec_get_nth_field(rec, 8, &len);
- prec = mach_read_from_4(field);
-
- dict_mem_table_add_col(table, name, mtype, prtype, col_len,
- prec);
- btr_pcur_move_to_next_user_rec(&pcur, &mtr);
- }
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-}
-
-/************************************************************************
-Loads definitions for table indexes. Adds them to the data dictionary cache.
-*/
-static
-void
-dict_load_indexes(
-/*==============*/
- dict_table_t* table, /* in: table */
- mem_heap_t* heap) /* in: memory heap for temporary storage */
-{
- dict_table_t* sys_indexes;
- dict_index_t* sys_index;
- dict_index_t* index;
- btr_pcur_t pcur;
- dtuple_t* tuple;
- dfield_t* dfield;
- rec_t* rec;
- byte* field;
- ulint len;
- ulint name_len;
- char* name_buf;
- ulint type;
- ulint space;
- ulint page_no;
- ulint n_fields;
- byte* buf;
- ibool is_sys_table;
- dulint id;
- mtr_t mtr;
-
- ut_ad(mutex_own(&(dict_sys->mutex)));
-
- if ((ut_dulint_get_high(table->id) == 0)
- && (ut_dulint_get_low(table->id) < DICT_HDR_FIRST_ID)) {
- is_sys_table = TRUE;
- } else {
- is_sys_table = FALSE;
- }
-
- mtr_start(&mtr);
-
- sys_indexes = dict_table_get_low((char *) "SYS_INDEXES");
- sys_index = UT_LIST_GET_FIRST(sys_indexes->indexes);
-
- tuple = dtuple_create(heap, 1);
- dfield = dtuple_get_nth_field(tuple, 0);
-
- buf = mem_heap_alloc(heap, 8);
- mach_write_to_8(buf, table->id);
-
- dfield_set_data(dfield, buf, 8);
- dict_index_copy_types(tuple, sys_index, 1);
-
- btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
- BTR_SEARCH_LEAF, &pcur, &mtr);
- for (;;) {
- if (!btr_pcur_is_on_user_rec(&pcur, &mtr)) {
-
- break;
- }
-
- rec = btr_pcur_get_rec(&pcur);
-
- field = rec_get_nth_field(rec, 0, &len);
- ut_ad(len == 8);
-
- if (ut_memcmp(buf, field, len) != 0) {
- break;
- }
-
- ut_a(!rec_get_deleted_flag(rec));
-
- field = rec_get_nth_field(rec, 1, &len);
- ut_ad(len == 8);
- id = mach_read_from_8(field);
-
- ut_a(0 == ut_strcmp((char *) "NAME",
- dict_field_get_col(
- dict_index_get_nth_field(
- dict_table_get_first_index(sys_indexes), 4))->name));
-
- field = rec_get_nth_field(rec, 4, &name_len);
-
- name_buf = mem_heap_alloc(heap, name_len + 1);
- ut_memcpy(name_buf, field, name_len);
- name_buf[name_len] = '\0';
-
- field = rec_get_nth_field(rec, 5, &len);
- n_fields = mach_read_from_4(field);
-
- field = rec_get_nth_field(rec, 6, &len);
- type = mach_read_from_4(field);
-
- field = rec_get_nth_field(rec, 7, &len);
- space = mach_read_from_4(field);
-
- ut_a(0 == ut_strcmp((char *) "PAGE_NO",
- dict_field_get_col(
- dict_index_get_nth_field(
- dict_table_get_first_index(sys_indexes), 8))->name));
-
- field = rec_get_nth_field(rec, 8, &len);
- page_no = mach_read_from_4(field);
-
- if (is_sys_table
- && ((type & DICT_CLUSTERED)
- || ((table == dict_sys->sys_tables)
- && (name_len == ut_strlen((char *) "ID_IND"))
- && (0 == ut_memcmp(name_buf, (char *) "ID_IND",
- name_len))))) {
-
- /* The index was created in memory already in
- booting */
- } else {
- index = dict_mem_index_create(table->name, name_buf,
- space, type, n_fields);
- index->page_no = page_no;
- index->id = id;
-
- dict_load_fields(table, index, heap);
-
- if (index->type & DICT_CLUSTERED == 0
- && NULL == dict_table_get_first_index(table)) {
-
- fprintf(stderr,
- "InnoDB: Error: trying to load index %s for table %s\n"
- "InnoDB: but the first index was not clustered\n",
- index->name, table->name);
- } else {
- dict_index_add_to_cache(table, index);
- }
- }
-
- btr_pcur_move_to_next_user_rec(&pcur, &mtr);
- }
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-}
-
-/************************************************************************
-Loads definitions for index fields. */
-static
-void
-dict_load_fields(
-/*=============*/
- dict_table_t* table, /* in: table */
- dict_index_t* index, /* in: index whose fields to load */
- mem_heap_t* heap) /* in: memory heap for temporary storage */
-{
- dict_table_t* sys_fields;
- dict_index_t* sys_index;
- btr_pcur_t pcur;
- dtuple_t* tuple;
- dfield_t* dfield;
- char* col_name;
- rec_t* rec;
- byte* field;
- ulint len;
- byte* buf;
- ulint i;
- mtr_t mtr;
-
- ut_ad(mutex_own(&(dict_sys->mutex)));
-
- UT_NOT_USED(table);
-
- mtr_start(&mtr);
-
- sys_fields = dict_table_get_low((char *) "SYS_FIELDS");
- sys_index = UT_LIST_GET_FIRST(sys_fields->indexes);
-
- tuple = dtuple_create(heap, 1);
- dfield = dtuple_get_nth_field(tuple, 0);
-
- buf = mem_heap_alloc(heap, 8);
- mach_write_to_8(buf, index->id);
-
- dfield_set_data(dfield, buf, 8);
- dict_index_copy_types(tuple, sys_index, 1);
-
- btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
- BTR_SEARCH_LEAF, &pcur, &mtr);
- for (i = 0; i < index->n_fields; i++) {
-
- rec = btr_pcur_get_rec(&pcur);
-
- ut_a(btr_pcur_is_on_user_rec(&pcur, &mtr));
- ut_a(!rec_get_deleted_flag(rec));
-
- field = rec_get_nth_field(rec, 0, &len);
- ut_ad(len == 8);
- ut_a(ut_memcmp(buf, field, len) == 0);
-
- field = rec_get_nth_field(rec, 1, &len);
- ut_ad(len == 4);
- ut_a(i == mach_read_from_4(field));
-
- ut_a(0 == ut_strcmp((char *) "COL_NAME",
- dict_field_get_col(
- dict_index_get_nth_field(
- dict_table_get_first_index(sys_fields), 4))->name));
-
- field = rec_get_nth_field(rec, 4, &len);
-
- col_name = mem_heap_alloc(heap, len + 1);
- ut_memcpy(col_name, field, len);
- col_name[len] = '\0';
-
- dict_mem_index_add_field(index, col_name, 0);
-
- btr_pcur_move_to_next_user_rec(&pcur, &mtr);
- }
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-}
-
-/************************************************************************
Loads foreign key constraint col names (also for the referenced table). */
static
void
diff --git a/innobase/dict/dict0mem.c b/innobase/dict/dict0mem.c
index 52f46062065..9a4c94de885 100644
--- a/innobase/dict/dict0mem.c
+++ b/innobase/dict/dict0mem.c
@@ -65,6 +65,9 @@ dict_mem_table_create(
table->cached = FALSE;
+ table->mix_id = ut_dulint_zero;
+ table->mix_len = 0;
+
table->cols = mem_heap_alloc(heap, (n_cols + DATA_N_SYS_COLS)
* sizeof(dict_col_t));
UT_LIST_INIT(table->indexes);
diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c
index 35f3792f041..3e0f21395ef 100644
--- a/innobase/fil/fil0fil.c
+++ b/innobase/fil/fil0fil.c
@@ -573,17 +573,20 @@ fil_read_flushed_lsn_and_arch_log_no(
ulint* max_arch_log_no) /* in/out: */
{
byte* buf;
+ byte* buf2;
dulint flushed_lsn;
ulint arch_log_no;
- buf = ut_malloc(UNIV_PAGE_SIZE);
-
+ buf2 = ut_malloc(2 * UNIV_PAGE_SIZE);
+ /* Align the memory for a possible read from a raw device */
+ buf = ut_align(buf2, UNIV_PAGE_SIZE);
+
os_file_read(data_file, buf, 0, 0, UNIV_PAGE_SIZE);
flushed_lsn = mach_read_from_8(buf + FIL_PAGE_FILE_FLUSH_LSN);
arch_log_no = mach_read_from_4(buf + FIL_PAGE_ARCH_LOG_NO);
- ut_free(buf);
+ ut_free(buf2);
if (!one_read_already) {
*min_flushed_lsn = flushed_lsn;
diff --git a/innobase/fsp/fsp0fsp.c b/innobase/fsp/fsp0fsp.c
index 08608731f2e..1abb043fdc2 100644
--- a/innobase/fsp/fsp0fsp.c
+++ b/innobase/fsp/fsp0fsp.c
@@ -933,6 +933,36 @@ fsp_header_get_free_limit(
return(limit);
}
+/**************************************************************************
+Gets the size of the tablespace from the tablespace header. If we do not
+have an auto-extending data file, this should be equal to the size of the
+data files. If there is an auto-extending data file, this can be smaller. */
+
+ulint
+fsp_header_get_tablespace_size(
+/*===========================*/
+ /* out: size in pages */
+ ulint space) /* in: space id */
+{
+ fsp_header_t* header;
+ ulint size;
+ mtr_t mtr;
+
+ ut_a(space == 0); /* We have only one log_fsp_current_... variable */
+
+ mtr_start(&mtr);
+
+ mtr_x_lock(fil_space_get_latch(space), &mtr);
+
+ header = fsp_get_space_header(space, &mtr);
+
+ size = mtr_read_ulint(header + FSP_SIZE, MLOG_4BYTES, &mtr);
+
+ mtr_commit(&mtr);
+
+ return(size);
+}
+
/***************************************************************************
Tries to extend the last data file file if it is defined as auto-extending. */
static
@@ -2608,6 +2638,7 @@ fseg_free_page_low(
ulint not_full_n_used;
ulint state;
ulint i;
+ char errbuf[200];
ut_ad(seg_inode && mtr);
ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N) ==
@@ -2621,8 +2652,25 @@ fseg_free_page_low(
descr = xdes_get_descriptor(space, page, mtr);
ut_a(descr);
- ut_a(xdes_get_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, mtr)
- == FALSE);
+ if (xdes_get_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, mtr)
+ != FALSE) {
+ ut_sprintf_buf(errbuf, descr, 40);
+ fprintf(stderr,
+"InnoDB: Dump of the tablespace extent descriptor: %s\n", errbuf);
+
+ fprintf(stderr,
+"InnoDB: Serious error! InnoDB is trying to free page %lu\n"
+"InnoDB: though it is already marked as free in the tablespace!\n"
+"InnoDB: The tablespace free space info is corrupt.\n"
+"InnoDB: You may need to dump your InnoDB tables and recreate the whole\n"
+"InnoDB: database!\n", page);
+
+ fprintf(stderr,
+"InnoDB: If the InnoDB recovery crashes here, see section 6.1\n"
+"InnoDB: of http://www.innodb.com/ibman.html about forcing recovery.\n");
+ ut_a(0);
+ }
+
state = xdes_get_state(descr, mtr);
if (state != XDES_FSEG) {
diff --git a/innobase/ha/ha0ha.c b/innobase/ha/ha0ha.c
index 3e4473126cf..4489b25ec2b 100644
--- a/innobase/ha/ha0ha.c
+++ b/innobase/ha/ha0ha.c
@@ -194,7 +194,7 @@ ha_delete(
node = ha_search_with_data(table, fold, data);
- ut_ad(node);
+ ut_a(node);
ha_delete_hash_node(table, node);
}
@@ -232,6 +232,16 @@ ha_remove_all_nodes_to_page(
node = ha_chain_get_next(table, node);
}
}
+
+ /* Check that all nodes really got deleted */
+
+ node = ha_chain_get_first(table, fold);
+
+ while (node) {
+ ut_a(buf_frame_align(ha_node_get_data(node)) != page);
+
+ node = ha_chain_get_next(table, node);
+ }
}
/*****************************************************************
@@ -245,6 +255,7 @@ ha_validate(
{
hash_cell_t* cell;
ha_node_t* node;
+ ibool ok = TRUE;
ulint i;
for (i = 0; i < hash_get_n_cells(table); i++) {
@@ -254,13 +265,21 @@ ha_validate(
node = cell->node;
while (node) {
- ut_a(hash_calc_hash(node->fold, table) == i);
+ if (hash_calc_hash(node->fold, table) != i) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+"InnoDB: Error: hash table node fold value %lu does not\n"
+"InnoDB: match with the cell number %lu.\n",
+ node->fold, i);
+
+ ok = FALSE;
+ }
node = node->next;
}
}
- return(TRUE);
+ return(ok);
}
/*****************************************************************
@@ -269,16 +288,23 @@ Prints info of a hash table. */
void
ha_print_info(
/*==========*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end,/* in: buffer end */
hash_table_t* table) /* in: hash table */
{
hash_cell_t* cell;
- ha_node_t* node;
+/* ha_node_t* node; */
ulint nodes = 0;
ulint cells = 0;
ulint len = 0;
ulint max_len = 0;
+ ulint n_bufs;
ulint i;
+ if (buf_end - buf < 200) {
+ return;
+ }
+
for (i = 0; i < hash_get_n_cells(table); i++) {
cell = hash_get_nth_cell(table, i);
@@ -286,7 +312,7 @@ ha_print_info(
if (cell->node) {
cells++;
-
+/*
len = 0;
node = cell->node;
@@ -306,12 +332,24 @@ ha_print_info(
if (len > max_len) {
max_len = len;
}
+*/
}
}
- printf("Hash table size %lu, used cells %lu, nodes %lu\n",
- hash_get_n_cells(table), cells, nodes);
- printf("max chain length %lu\n", max_len);
+ buf += sprintf(buf,
+"Hash table size %lu, used cells %lu", hash_get_n_cells(table), cells);
+
+ if (table->heaps == NULL && table->heap != NULL) {
- ut_a(ha_validate(table));
+ /* This calculation is intended for the adaptive hash
+ index: how many buffer frames we have reserved? */
+
+ n_bufs = UT_LIST_GET_LEN(table->heap->base) - 1;
+
+ if (table->heap->free_block) {
+ n_bufs++;
+ }
+
+ buf += sprintf(buf, ", node heap has %lu buffer(s)\n", n_bufs);
+ }
}
diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c
index a6355ce7ca5..b7d691485cc 100644
--- a/innobase/ibuf/ibuf0ibuf.c
+++ b/innobase/ibuf/ibuf0ibuf.c
@@ -687,21 +687,21 @@ ibuf_bitmap_get_map_page(
/****************************************************************************
Sets the free bits of the page in the ibuf bitmap. This is done in a separate
mini-transaction, hence this operation does not restrict further work to only
-ibuf bitmap operations, which would result if the latch to the bitmap pag
+ibuf bitmap operations, which would result if the latch to the bitmap page
were kept. */
UNIV_INLINE
void
ibuf_set_free_bits_low(
/*===================*/
ulint type, /* in: index type */
- page_t* page, /* in: index page; free bit is reset if the index is
- a non-clustered non-unique, and page level is 0 */
+ page_t* page, /* in: index page; free bit is set if the index is
+ non-clustered and page level is 0 */
ulint val, /* in: value to set: < 4 */
mtr_t* mtr) /* in: mtr */
{
page_t* bitmap_page;
- if (type & (DICT_CLUSTERED | DICT_UNIQUE)) {
+ if (type & DICT_CLUSTERED) {
return;
}
@@ -735,8 +735,8 @@ void
ibuf_set_free_bits(
/*===============*/
ulint type, /* in: index type */
- page_t* page, /* in: index page; free bit is reset if the index is
- a non-clustered non-unique, and page level is 0 */
+ page_t* page, /* in: index page; free bit is set if the index is
+ non-clustered and page level is 0 */
ulint val, /* in: value to set: < 4 */
ulint max_val)/* in: ULINT_UNDEFINED or a maximum value which
the bits must have before setting; this is for
@@ -745,7 +745,7 @@ ibuf_set_free_bits(
mtr_t mtr;
page_t* bitmap_page;
- if (type & (DICT_CLUSTERED | DICT_UNIQUE)) {
+ if (type & DICT_CLUSTERED) {
return;
}
@@ -2026,7 +2026,7 @@ ibuf_insert_low(
ulint n_stored;
ulint bits;
- ut_a(!(index->type & (DICT_UNIQUE | DICT_CLUSTERED)));
+ ut_a(!(index->type & DICT_CLUSTERED));
ut_ad(dtuple_check_typed(entry));
do_merge = FALSE;
@@ -2256,10 +2256,7 @@ ibuf_insert(
ut_ad(dtuple_check_typed(entry));
- if (index->type & DICT_CLUSTERED || index->type & DICT_UNIQUE) {
-
- return(FALSE);
- }
+ ut_a(!(index->type & DICT_CLUSTERED));
if (rec_get_converted_size(entry)
>= page_get_free_space_of_empty() / 2) {
@@ -2304,6 +2301,7 @@ ibuf_insert_to_index_page(
rec_t* rec;
page_t* bitmap_page;
ulint old_bits;
+ char errbuf[1000];
ut_ad(ibuf_inside());
ut_ad(dtuple_check_typed(entry));
@@ -2326,11 +2324,24 @@ ibuf_insert_to_index_page(
/* This time the record must fit */
if (!page_cur_tuple_insert(&page_cur, entry, mtr)) {
- printf(
- "Ibuf insert fails; page free %lu, dtuple size %lu\n",
+
+ ut_print_timestamp(stderr);
+
+ fprintf(stderr,
+"InnoDB: Error: Insert buffer insert fails; page free %lu, dtuple size %lu\n",
page_get_max_insert_size(page, 1),
rec_get_converted_size(entry));
+ dtuple_sprintf(errbuf, 900, entry);
+
+ fprintf(stderr,
+"InnoDB: Cannot insert index record %s\n", errbuf);
+
+ fprintf(stderr,
+"InnoDB: The table where where this index record belongs\n"
+"InnoDB: is now probably corrupt. Please run CHECK TABLE on\n"
+"InnoDB: that table.\n");
+
bitmap_page = ibuf_bitmap_get_map_page(
buf_frame_get_space_id(page),
buf_frame_get_page_no(page),
@@ -2341,9 +2352,11 @@ ibuf_insert_to_index_page(
buf_frame_get_page_no(page),
IBUF_BITMAP_FREE, mtr);
- printf("Bitmap bits %lu\n", old_bits);
-
- ut_error;
+ fprintf(stderr, "Bitmap bits %lu\n", old_bits);
+
+ fprintf(stderr,
+"InnoDB: Send a detailed bug report to mysql@lists.mysql.com!\n");
+
}
}
}
@@ -2692,22 +2705,30 @@ ibuf_validate_low(void)
Prints info of ibuf. */
void
-ibuf_print(void)
-/*============*/
+ibuf_print(
+/*=======*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end)/* in: buffer end */
{
ibuf_data_t* data;
#ifdef UNIV_IBUF_DEBUG
ulint i;
#endif
+ if (buf_end - buf < 500) {
+ return;
+ }
+
mutex_enter(&ibuf_mutex);
data = UT_LIST_GET_FIRST(ibuf->data_list);
while (data) {
- printf(
+ buf += sprintf(buf,
"Ibuf for space %lu: size %lu, free list len %lu, seg size %lu,\n",
data->space, data->size, data->free_list_len, data->seg_size);
- printf("%lu inserts, %lu merged recs, %lu merges\n",
+
+ buf += sprintf(buf,
+ "%lu inserts, %lu merged recs, %lu merges\n",
data->n_inserts, data->n_merged_recs, data->n_merges);
#ifdef UNIV_IBUF_DEBUG
for (i = 0; i < IBUF_COUNT_N_PAGES; i++) {
diff --git a/innobase/include/btr0btr.h b/innobase/include/btr0btr.h
index d22f9d79c1c..f66ad3639d4 100644
--- a/innobase/include/btr0btr.h
+++ b/innobase/include/btr0btr.h
@@ -204,16 +204,6 @@ btr_page_reorganize(
page_t* page, /* in: page to be reorganized */
mtr_t* mtr); /* in: mtr */
/*****************************************************************
-Reorganizes an index page. */
-
-void
-btr_page_reorganize_low(
-/*====================*/
- ibool low, /* in: TRUE if locks should not be updated, i.e.,
- there cannot exist locks on the page */
- page_t* page, /* in: page to be reorganized */
- mtr_t* mtr); /* in: mtr */
-/*****************************************************************
Decides if the page should be split at the convergence point of
inserts converging to left. */
@@ -323,14 +313,6 @@ btr_discard_page(
btr_cur_t* cursor, /* in: cursor on the page to discard: not on
the root page */
mtr_t* mtr); /* in: mtr */
-/************************************************************************
-Declares the latching order level for the page latch in the debug version. */
-UNIV_INLINE
-void
-btr_declare_page_latch(
-/*===================*/
- page_t* page, /* in: page */
- ibool leaf); /* in: TRUE if a leaf */
/********************************************************************
Parses the redo log record for setting an index record as the predefined
minimum record. */
diff --git a/innobase/include/btr0cur.h b/innobase/include/btr0cur.h
index bce1f0685cc..b01cbd9a875 100644
--- a/innobase/include/btr0cur.h
+++ b/innobase/include/btr0cur.h
@@ -709,6 +709,9 @@ allowed to free an inherited external field. */
#define BTR_EXTERN_INHERITED_FLAG 64
extern ulint btr_cur_n_non_sea;
+extern ulint btr_cur_n_sea;
+extern ulint btr_cur_n_non_sea_old;
+extern ulint btr_cur_n_sea_old;
#ifndef UNIV_NONINL
#include "btr0cur.ic"
diff --git a/innobase/include/btr0sea.h b/innobase/include/btr0sea.h
index fdf5cf375a3..14feca5d5c5 100644
--- a/innobase/include/btr0sea.h
+++ b/innobase/include/btr0sea.h
@@ -176,6 +176,7 @@ btr_search_validate(void);
/* The search info struct in an index */
struct btr_search_struct{
+ ulint magic_n; /* magic number */
/* The following 4 fields are currently not used: */
rec_t* last_search; /* pointer to the lower limit record of the
previous search; NULL if not known */
@@ -220,6 +221,8 @@ struct btr_search_struct{
ulint n_searches; /* number of searches */
};
+#define BTR_SEARCH_MAGIC_N 1112765
+
/* The hash index system */
typedef struct btr_search_sys_struct btr_search_sys_t;
diff --git a/innobase/include/buf0buf.h b/innobase/include/buf0buf.h
index 5ddbf39335a..591c0ec54ab 100644
--- a/innobase/include/buf0buf.h
+++ b/innobase/include/buf0buf.h
@@ -219,6 +219,16 @@ buf_page_create(
a page */
mtr_t* mtr); /* in: mini-transaction handle */
/************************************************************************
+Inits a page to the buffer buf_pool, for use in ibbackup --restore. */
+
+void
+buf_page_init_for_backup_restore(
+/*=============================*/
+ ulint space, /* in: space id */
+ ulint offset, /* in: offset of the page within space
+ in units of a page */
+ buf_block_t* block); /* in: block to init */
+/************************************************************************
Decrements the bufferfix count of a buffer control block and releases
a latch, if specified. */
UNIV_INLINE
@@ -438,7 +448,7 @@ Prints info of the buffer pool data structure. */
void
buf_print(void);
-/*===========*/
+/*============*/
/*************************************************************************
Returns the number of pending buf pool ios. */
@@ -449,8 +459,16 @@ buf_get_n_pending_ios(void);
Prints info of the buffer i/o. */
void
-buf_print_io(void);
-/*==============*/
+buf_print_io(
+/*=========*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end);/* in: buffer end */
+/**************************************************************************
+Refreshes the statistics used to print per-second averages. */
+
+void
+buf_refresh_io_stats(void);
+/*======================*/
/*************************************************************************
Checks that all file pages in the buffer are in a replaceable state. */
@@ -605,6 +623,7 @@ struct buf_block_struct{
/* 1. General fields */
+ ulint magic_n; /* magic number to check */
ulint state; /* state of the control block:
BUF_BLOCK_NOT_USED, ... */
byte* frame; /* pointer to buffer frame which
@@ -729,6 +748,8 @@ struct buf_block_struct{
frees a page in buffer pool */
};
+#define BUF_BLOCK_MAGIC_N 41526563
+
/* The buffer pool structure. NOTE! The definition appears here only for
other modules of this directory (buf) to see it. Do not use from outside! */
diff --git a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic
index 52bee0eb282..7227c79dc6a 100644
--- a/innobase/include/buf0buf.ic
+++ b/innobase/include/buf0buf.ic
@@ -209,10 +209,17 @@ buf_block_align(
ut_ad((ulint)ptr >= (ulint)frame_zero);
- block = buf_pool_get_nth_block(buf_pool, (ptr - frame_zero)
+ block = buf_pool_get_nth_block(buf_pool, ((ulint)(ptr - frame_zero))
>> UNIV_PAGE_SIZE_SHIFT);
- ut_a(block >= buf_pool->blocks);
- ut_a(block < buf_pool->blocks + buf_pool->max_size);
+ if (block < buf_pool->blocks
+ || block >= buf_pool->blocks + buf_pool->max_size) {
+
+ fprintf(stderr,
+"InnoDB: Error: trying to access a stray pointer %lx\n"
+"InnoDB: buf pool start is at %lx, number of pages %lu\n", (ulint)ptr,
+ (ulint)frame_zero, buf_pool->max_size);
+ ut_a(0);
+ }
return(block);
}
@@ -236,10 +243,17 @@ buf_block_align_low(
ut_ad((ulint)ptr >= (ulint)frame_zero);
- block = buf_pool_get_nth_block(buf_pool, (ptr - frame_zero)
+ block = buf_pool_get_nth_block(buf_pool, ((ulint)(ptr - frame_zero))
>> UNIV_PAGE_SIZE_SHIFT);
- ut_a(block >= buf_pool->blocks);
- ut_a(block < buf_pool->blocks + buf_pool->max_size);
+ if (block < buf_pool->blocks
+ || block >= buf_pool->blocks + buf_pool->max_size) {
+
+ fprintf(stderr,
+"InnoDB: Error: trying to access a stray pointer %lx\n"
+"InnoDB: buf pool start is at %lx, number of pages %lu\n", (ulint)ptr,
+ (ulint)frame_zero, buf_pool->max_size);
+ ut_a(0);
+ }
return(block);
}
@@ -259,10 +273,17 @@ buf_frame_align(
frame = ut_align_down(ptr, UNIV_PAGE_SIZE);
- ut_a((ulint)frame
- >= (ulint)(buf_pool_get_nth_block(buf_pool, 0)->frame));
- ut_a((ulint)frame <= (ulint)(buf_pool_get_nth_block(buf_pool,
- buf_pool->max_size - 1)->frame));
+ if (((ulint)frame
+ < (ulint)(buf_pool->frame_zero))
+ || ((ulint)frame > (ulint)(buf_pool_get_nth_block(buf_pool,
+ buf_pool->max_size - 1)->frame))) {
+ fprintf(stderr,
+"InnoDB: Error: trying to access a stray pointer %lx\n"
+"InnoDB: buf pool start is at %lx, number of pages %lu\n", (ulint)ptr,
+ (ulint)(buf_pool->frame_zero), buf_pool->max_size);
+ ut_a(0);
+ }
+
return(frame);
}
diff --git a/innobase/include/buf0rea.h b/innobase/include/buf0rea.h
index 1efe67369ab..aed965a6b21 100644
--- a/innobase/include/buf0rea.h
+++ b/innobase/include/buf0rea.h
@@ -89,7 +89,7 @@ buf_read_recv_pages(
/* The size in pages of the area which the read-ahead algorithms read if
invoked */
-#define BUF_READ_AHEAD_AREA ut_min(32, buf_pool->curr_size / 16)
+#define BUF_READ_AHEAD_AREA ut_min(64, ut_2_power_up(buf_pool->curr_size / 32))
/* Modes used in read-ahead */
#define BUF_READ_IBUF_PAGES_ONLY 131
diff --git a/innobase/include/data0data.h b/innobase/include/data0data.h
index c19d7ea5552..e0fb06e5018 100644
--- a/innobase/include/data0data.h
+++ b/innobase/include/data0data.h
@@ -123,7 +123,7 @@ dfield_datas_are_binary_equal(
dfield_t* field2);/* in: field */
/*************************************************************************
Tests if dfield data length and content is equal to the given. */
-UNIV_INLINE
+
ibool
dfield_data_is_binary_equal(
/*========================*/
@@ -279,6 +279,14 @@ dtuple_check_typed(
/* out: TRUE if ok */
dtuple_t* tuple); /* in: tuple */
/**************************************************************
+Checks that a data tuple is typed. */
+
+ibool
+dtuple_check_typed_no_assert(
+/*=========================*/
+ /* out: TRUE if ok */
+ dtuple_t* tuple); /* in: tuple */
+/**************************************************************
Validates the consistency of a tuple which must be complete, i.e,
all fields must have been set. */
diff --git a/innobase/include/data0data.ic b/innobase/include/data0data.ic
index 0750a3894d1..d356664df21 100644
--- a/innobase/include/data0data.ic
+++ b/innobase/include/data0data.ic
@@ -154,30 +154,6 @@ dfield_datas_are_binary_equal(
}
/*************************************************************************
-Tests if dfield data length and content is equal to the given. */
-UNIV_INLINE
-ibool
-dfield_data_is_binary_equal(
-/*========================*/
- /* out: TRUE if equal */
- dfield_t* field, /* in: field */
- ulint len, /* in: data length or UNIV_SQL_NULL */
- byte* data) /* in: data */
-{
- if (len != field->len) {
-
- return(FALSE);
- }
-
- if (len != UNIV_SQL_NULL && 0 != ut_memcmp(field->data, data, len)) {
-
- return(FALSE);
- }
-
- return(TRUE);
-}
-
-/*************************************************************************
Gets info bits in a data tuple. */
UNIV_INLINE
ulint
diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h
index fd79e17090a..832654d2666 100644
--- a/innobase/include/dict0dict.h
+++ b/innobase/include/dict0dict.h
@@ -96,17 +96,17 @@ dict_col_get_clust_pos(
/*===================*/
dict_col_t* col);
/************************************************************************
-Initializes the autoinc counter. It is not an error to initialize already
+Initializes the autoinc counter. It is not an error to initialize an already
initialized counter. */
void
dict_table_autoinc_initialize(
/*==========================*/
dict_table_t* table, /* in: table */
- ib_longlong value); /* in: value which was assigned to a row */
+ ib_longlong value); /* in: next value to assign to a row */
/************************************************************************
-Gets the next autoinc value, 0 if not yet initialized. If initialized,
-increments the counter by 1. */
+Gets the next autoinc value (== autoinc counter value), 0 if not yet
+initialized. If initialized, increments the counter by 1. */
ib_longlong
dict_table_autoinc_get(
@@ -123,12 +123,22 @@ dict_table_autoinc_read(
/* out: value of the counter */
dict_table_t* table); /* in: table */
/************************************************************************
-Updates the autoinc counter if the value supplied is bigger than the
+Peeks the autoinc counter value, 0 if not yet initialized. Does not
+increment the counter. The read not protected by any mutex! */
+
+ib_longlong
+dict_table_autoinc_peek(
+/*====================*/
+ /* out: value of the counter */
+ dict_table_t* table); /* in: table */
+/************************************************************************
+Updates the autoinc counter if the value supplied is equal or bigger than the
current value. If not inited, does nothing. */
void
dict_table_autoinc_update(
/*======================*/
+
dict_table_t* table, /* in: table */
ib_longlong value); /* in: value which was assigned to a row */
/**************************************************************************
diff --git a/innobase/include/dict0mem.h b/innobase/include/dict0mem.h
index ef15c99fdba..cc27f2bad12 100644
--- a/innobase/include/dict0mem.h
+++ b/innobase/include/dict0mem.h
@@ -388,8 +388,8 @@ struct dict_table_struct{
/* TRUE if the autoinc counter has been
inited; MySQL gets the init value by executing
SELECT MAX(auto inc column) */
- ib_longlong autoinc;/* autoinc counter value already given to
- a row */
+ ib_longlong autoinc;/* autoinc counter value to give to the
+ next inserted row */
ulint magic_n;/* magic number */
};
#define DICT_TABLE_MAGIC_N 76333786
diff --git a/innobase/include/dyn0dyn.h b/innobase/include/dyn0dyn.h
index 332622b6d4c..501fde05e90 100644
--- a/innobase/include/dyn0dyn.h
+++ b/innobase/include/dyn0dyn.h
@@ -17,13 +17,9 @@ typedef struct dyn_block_struct dyn_block_t;
typedef dyn_block_t dyn_array_t;
-/* Initial 'payload' size in bytes in a dynamic array block */
-#ifndef _AIX
-#define DYN_ARRAY_DATA_SIZE 1024
-#else
-/* AIX has a quite small stack / thread */
-#define DYN_ARRAY_DATA_SIZE 128
-#endif
+/* This is the initial 'payload' size of a dynamic array;
+this must be > MLOG_BUF_MARGIN + 30! */
+#define DYN_ARRAY_DATA_SIZE 512
/*************************************************************************
Initializes a dynamic array. */
@@ -128,14 +124,6 @@ dyn_block_get_data(
/*===============*/
/* out: pointer to data */
dyn_block_t* block); /* in: dyn array block */
-/************************************************************************
-Gets the next block in a dyn array. */
-UNIV_INLINE
-dyn_block_t*
-dyn_block_get_next(
-/*===============*/
- /* out: pointer to next, NULL if end of list */
- dyn_block_t* block); /* in: dyn array block */
/************************************************************
Pushes n bytes to a dyn array. */
UNIV_INLINE
diff --git a/innobase/include/dyn0dyn.ic b/innobase/include/dyn0dyn.ic
index dc004efbb8b..787615cae09 100644
--- a/innobase/include/dyn0dyn.ic
+++ b/innobase/include/dyn0dyn.ic
@@ -185,7 +185,8 @@ dyn_array_open(
/*===========*/
/* out: pointer to the buffer */
dyn_array_t* arr, /* in: dynamic array */
- ulint size) /* in: size in bytes of the buffer */
+ ulint size) /* in: size in bytes of the buffer; MUST be
+ smaller than DYN_ARRAY_DATA_SIZE! */
{
dyn_block_t* block;
ulint used;
@@ -207,6 +208,7 @@ dyn_array_open(
if (used + size > DYN_ARRAY_DATA_SIZE) {
block = dyn_array_add_block(arr);
used = block->used;
+ ut_a(size <= DYN_ARRAY_DATA_SIZE);
}
}
diff --git a/innobase/include/fsp0fsp.h b/innobase/include/fsp0fsp.h
index a0197ec2d97..3494f336b1e 100644
--- a/innobase/include/fsp0fsp.h
+++ b/innobase/include/fsp0fsp.h
@@ -57,6 +57,16 @@ fsp_header_get_free_limit(
/* out: free limit in megabytes */
ulint space); /* in: space id */
/**************************************************************************
+Gets the size of the tablespace from the tablespace header. If we do not
+have an auto-extending data file, this should be equal to the size of the
+data files. If there is an auto-extending data file, this can be smaller. */
+
+ulint
+fsp_header_get_tablespace_size(
+/*===========================*/
+ /* out: size in pages */
+ ulint space); /* in: space id */
+/**************************************************************************
Initializes the space header of a new created space. */
void
diff --git a/innobase/include/ha0ha.h b/innobase/include/ha0ha.h
index aeed7c32eff..0beac928b7e 100644
--- a/innobase/include/ha0ha.h
+++ b/innobase/include/ha0ha.h
@@ -127,8 +127,18 @@ Prints info of a hash table. */
void
ha_print_info(
/*==========*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end,/* in: buffer end */
hash_table_t* table); /* in: hash table */
+/* The hash table external chain node */
+
+typedef struct ha_node_struct ha_node_t;
+struct ha_node_struct {
+ ha_node_t* next; /* next chain node or NULL if none */
+ void* data; /* pointer to the data */
+ ulint fold; /* fold value for the data */
+};
#ifndef UNIV_NONINL
#include "ha0ha.ic"
diff --git a/innobase/include/ha0ha.ic b/innobase/include/ha0ha.ic
index 9d344bca04c..761bc3b20de 100644
--- a/innobase/include/ha0ha.ic
+++ b/innobase/include/ha0ha.ic
@@ -9,16 +9,6 @@ Created 8/18/1994 Heikki Tuuri
#include "ut0rnd.h"
#include "mem0mem.h"
-/* The hash table external chain node */
-
-typedef struct ha_node_struct ha_node_t;
-
-struct ha_node_struct {
- ha_node_t* next; /* next chain node or NULL if none */
- void* data; /* pointer to the data */
- ulint fold; /* fold value for the data */
-};
-
/***************************************************************
Deletes a hash node. */
diff --git a/innobase/include/ibuf0ibuf.h b/innobase/include/ibuf0ibuf.h
index fac28461be4..a290e90e4db 100644
--- a/innobase/include/ibuf0ibuf.h
+++ b/innobase/include/ibuf0ibuf.h
@@ -269,8 +269,10 @@ ibuf_count_get(
Prints info of ibuf. */
void
-ibuf_print(void);
-/*============*/
+ibuf_print(
+/*=======*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end);/* in: buffer end */
#define IBUF_HEADER_PAGE_NO FSP_IBUF_HEADER_PAGE_NO
#define IBUF_TREE_ROOT_PAGE_NO FSP_IBUF_TREE_ROOT_PAGE_NO
diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h
index 5a15b78b869..288356d3270 100644
--- a/innobase/include/lock0lock.h
+++ b/innobase/include/lock0lock.h
@@ -460,6 +460,8 @@ Prints info of a table lock. */
void
lock_table_print(
/*=============*/
+ char* buf, /* in/out: buffer where to print, must be at least
+ 500 bytes */
lock_t* lock); /* in: table type lock */
/*************************************************************************
Prints info of a record lock. */
@@ -467,13 +469,17 @@ Prints info of a record lock. */
void
lock_rec_print(
/*===========*/
+ char* buf, /* in/out: buffer where to print, must be at least
+ 500 bytes */
lock_t* lock); /* in: record type lock */
/*************************************************************************
Prints info of locks for all transactions. */
void
-lock_print_info(void);
-/*=================*/
+lock_print_info(
+/*============*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end);/* in: buffer end */
/*************************************************************************
Validates the lock queue on a table. */
@@ -531,7 +537,15 @@ extern lock_sys_t* lock_sys;
the bit is set; locks of this type are created
when records are removed from the index chain
of records */
-
+#define LOCK_INSERT_INTENTION 1024 /* this bit is set when we place a waiting
+ gap type record lock request in order to let
+ an insert of an index record to wait until
+ there are no conflicting locks by other
+ transactions on the gap; note that this flag
+ remains set when the waiting lock is granted,
+ or if the lock is inherited to a neighboring
+ record */
+
/* When lock bits are reset, the following flags are available: */
#define LOCK_RELEASE_WAIT 1
#define LOCK_NOT_RELEASE_WAIT 2
diff --git a/innobase/include/log0log.h b/innobase/include/log0log.h
index eeb4f2e45f1..f200371de9d 100644
--- a/innobase/include/log0log.h
+++ b/innobase/include/log0log.h
@@ -157,6 +157,14 @@ log_io_complete(
/*============*/
log_group_t* group); /* in: log group */
/**********************************************************
+Flushes the log files to the disk, using, for example, the Unix fsync.
+This function does the flush even if the user has set
+srv_flush_log_at_trx_commit = FALSE. */
+
+void
+log_flush_to_disk(void);
+/*===================*/
+/**********************************************************
This function is called, e.g., when a transaction wants to commit. It checks
that the log has been flushed to disk up to the last log entry written by the
transaction. If there is a flush running, it waits and checks if the flush
@@ -260,7 +268,9 @@ log_reset_first_header_and_checkpoint(
/*==================================*/
byte* hdr_buf,/* in: buffer which will be written to the start
of the first log file */
- dulint lsn); /* in: lsn of the start of the first log file */
+ dulint start); /* in: lsn of the start of the first log file;
+ we pretend that there is a checkpoint at
+ start + LOG_BLOCK_HDR_SIZE */
/************************************************************************
Starts an archiving operation. */
@@ -421,15 +431,30 @@ log_block_set_data_len(
byte* log_block, /* in: log block */
ulint len); /* in: data length */
/****************************************************************
-Gets a log block number stored in the trailer. */
+Calculates the checksum for a log block. */
UNIV_INLINE
ulint
-log_block_get_trl_no(
-/*=================*/
- /* out: log block number stored in the block
- trailer */
+log_block_calc_checksum(
+/*====================*/
+ /* out: checksum */
+ byte* block); /* in: log block */
+/****************************************************************
+Gets a log block checksum field value. */
+UNIV_INLINE
+ulint
+log_block_get_checksum(
+/*===================*/
+ /* out: checksum */
byte* log_block); /* in: log block */
/****************************************************************
+Sets a log block checksum field value. */
+UNIV_INLINE
+void
+log_block_set_checksum(
+/*===================*/
+ byte* log_block, /* in: log block */
+ ulint checksum); /* in: checksum */
+/****************************************************************
Gets a log block first mtr log record group offset. */
UNIV_INLINE
ulint
@@ -463,6 +488,15 @@ log_block_init(
byte* log_block, /* in: pointer to the log buffer */
dulint lsn); /* in: lsn within the log block */
/****************************************************************
+Initializes a log block in the log buffer in the old, < 3.23.52 format, where
+there was no checksum yet. */
+UNIV_INLINE
+void
+log_block_init_in_old_format(
+/*=========================*/
+ byte* log_block, /* in: pointer to the log buffer */
+ dulint lsn); /* in: lsn within the log block */
+/****************************************************************
Converts a lsn to a log block number. */
UNIV_INLINE
ulint
@@ -474,8 +508,16 @@ log_block_convert_lsn_to_no(
Prints info of the log. */
void
-log_print(void);
-/*===========*/
+log_print(
+/*======*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end);/* in: buffer end */
+/**************************************************************************
+Refreshes the statistics used to print per-second averages. */
+
+void
+log_refresh_stats(void);
+/*===================*/
extern log_t* log_sys;
@@ -523,7 +565,11 @@ extern log_t* log_sys;
bytes */
/* Offsets of a log block trailer from the end of the block */
-#define LOG_BLOCK_TRL_NO 4 /* log block number */
+#define LOG_BLOCK_CHECKSUM 4 /* 4 byte checksum of the log block
+ contents; in InnoDB versions
+ < 3.23.52 this did not contain the
+ checksum but the same value as
+ .._HDR_NO */
#define LOG_BLOCK_TRL_SIZE 4 /* trailer size in bytes */
/* Offsets for a checkpoint field */
@@ -558,11 +604,22 @@ extern log_t* log_sys;
#define LOG_GROUP_ID 0 /* log group number */
#define LOG_FILE_START_LSN 4 /* lsn of the start of data in this
log file */
-#define LOG_FILE_NO 12 /* 4-byte archived log file number */
+#define LOG_FILE_NO 12 /* 4-byte archived log file number;
+ this field is only defined in an
+ archived log file */
+#define LOG_FILE_WAS_CREATED_BY_HOT_BACKUP 16
+ /* a 32-byte field which contains
+ the string 'ibbackup' and the
+ creation time if the log file was
+ created by ibbackup --restore;
+ when mysqld is first time started
+ on the restored database, it can
+ print helpful info for the user */
#define LOG_FILE_ARCH_COMPLETED OS_FILE_LOG_BLOCK_SIZE
/* this 4-byte field is TRUE when
the writing of an archived log file
- has been completed */
+ has been completed; this field is
+ only defined in an archived log file */
#define LOG_FILE_END_LSN (OS_FILE_LOG_BLOCK_SIZE + 4)
/* lsn where the archived log file
at least extends: actually the
@@ -572,7 +629,14 @@ extern log_t* log_sys;
is defined only when an archived log
file has been completely written */
#define LOG_CHECKPOINT_1 OS_FILE_LOG_BLOCK_SIZE
+ /* first checkpoint field in the log
+ header; we write alternately to the
+ checkpoint fields when we make new
+ checkpoints; this field is only defined
+ in the first log file of a log group */
#define LOG_CHECKPOINT_2 (3 * OS_FILE_LOG_BLOCK_SIZE)
+ /* second checkpoint field in the log
+ header */
#define LOG_FILE_HDR_SIZE (4 * OS_FILE_LOG_BLOCK_SIZE)
#define LOG_GROUP_OK 301
@@ -678,7 +742,7 @@ struct log_struct{
write i/o has been completed for all
log groups */
dulint flush_lsn; /* end lsn for the current flush */
- ulint flush_end_offset;/* the data in buffer ha been flushed
+ ulint flush_end_offset;/* the data in buffer has been flushed
up to this offset when the current
flush ends: this field will then
be copied to buf_next_to_write */
diff --git a/innobase/include/log0log.ic b/innobase/include/log0log.ic
index e5c313d129b..8de239df0bd 100644
--- a/innobase/include/log0log.ic
+++ b/innobase/include/log0log.ic
@@ -170,33 +170,6 @@ log_block_set_checkpoint_no(
}
/****************************************************************
-Gets a log block number stored in the trailer. */
-UNIV_INLINE
-ulint
-log_block_get_trl_no(
-/*=================*/
- /* out: log block number stored in the block
- trailer */
- byte* log_block) /* in: log block */
-{
- return(mach_read_from_4(log_block + OS_FILE_LOG_BLOCK_SIZE
- - LOG_BLOCK_TRL_NO));
-}
-
-/****************************************************************
-Sets the log block number stored in the trailer. */
-UNIV_INLINE
-void
-log_block_set_trl_no(
-/*=================*/
- byte* log_block, /* in: log block */
- ulint n) /* in: log block number */
-{
- mach_write_to_4(log_block + OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_NO,
- n);
-}
-
-/****************************************************************
Converts a lsn to a log block number. */
UNIV_INLINE
ulint
@@ -217,6 +190,61 @@ log_block_convert_lsn_to_no(
}
/****************************************************************
+Calculates the checksum for a log block. */
+UNIV_INLINE
+ulint
+log_block_calc_checksum(
+/*====================*/
+ /* out: checksum */
+ byte* block) /* in: log block */
+{
+ ulint sum;
+ ulint sh;
+ ulint i;
+
+ sum = 1;
+ sh = 0;
+
+ for (i = 0; i < OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_SIZE; i++) {
+ sum = sum & 0x7FFFFFFF;
+ sum += (((ulint)(*(block + i))) << sh) + (ulint)(*(block + i));
+ sh++;
+ if (sh > 24) {
+ sh = 0;
+ }
+ }
+
+ return(sum);
+}
+
+/****************************************************************
+Gets a log block checksum field value. */
+UNIV_INLINE
+ulint
+log_block_get_checksum(
+/*===================*/
+ /* out: checksum */
+ byte* log_block) /* in: log block */
+{
+ return(mach_read_from_4(log_block + OS_FILE_LOG_BLOCK_SIZE
+ - LOG_BLOCK_CHECKSUM));
+}
+
+/****************************************************************
+Sets a log block checksum field value. */
+UNIV_INLINE
+void
+log_block_set_checksum(
+/*===================*/
+ byte* log_block, /* in: log block */
+ ulint checksum) /* in: checksum */
+{
+ mach_write_to_4(log_block + OS_FILE_LOG_BLOCK_SIZE
+ - LOG_BLOCK_CHECKSUM,
+ checksum);
+}
+
+/****************************************************************
Initializes a log block in the log buffer. */
UNIV_INLINE
void
@@ -232,11 +260,33 @@ log_block_init(
no = log_block_convert_lsn_to_no(lsn);
log_block_set_hdr_no(log_block, no);
- log_block_set_trl_no(log_block, no);
log_block_set_data_len(log_block, LOG_BLOCK_HDR_SIZE);
log_block_set_first_rec_group(log_block, 0);
}
+
+/****************************************************************
+Initializes a log block in the log buffer in the old format, where there
+was no checksum yet. */
+UNIV_INLINE
+void
+log_block_init_in_old_format(
+/*=========================*/
+ byte* log_block, /* in: pointer to the log buffer */
+ dulint lsn) /* in: lsn within the log block */
+{
+ ulint no;
+
+ ut_ad(mutex_own(&(log_sys->mutex)));
+
+ no = log_block_convert_lsn_to_no(lsn);
+
+ log_block_set_hdr_no(log_block, no);
+ mach_write_to_4(log_block + OS_FILE_LOG_BLOCK_SIZE
+ - LOG_BLOCK_CHECKSUM, no);
+ log_block_set_data_len(log_block, LOG_BLOCK_HDR_SIZE);
+ log_block_set_first_rec_group(log_block, 0);
+}
/****************************************************************
Writes to the log the string given. The log must be released with
diff --git a/innobase/include/log0recv.h b/innobase/include/log0recv.h
index 0825325965d..baa2ba50c7d 100644
--- a/innobase/include/log0recv.h
+++ b/innobase/include/log0recv.h
@@ -313,6 +313,11 @@ struct recv_sys_struct{
this lsn */
dulint limit_lsn;/* recovery should be made at most up to this
lsn */
+ ibool found_corrupt_log;
+ /* this is set to TRUE if we during log
+ scan find a corrupt log block, or a corrupt
+ log record, or there is a log parsing
+ buffer overflow */
log_group_t* archive_group;
/* in archive recovery: the log group whose
archive is read */
@@ -328,6 +333,8 @@ extern ibool recv_recovery_on;
extern ibool recv_no_ibuf_operations;
extern ibool recv_needed_recovery;
+extern ibool recv_is_making_a_backup;
+
/* Size of the parsing buffer; it must accommodate RECV_SCAN_SIZE many
times! */
#define RECV_PARSING_BUF_SIZE (2 * 1024 * 1024)
diff --git a/innobase/include/os0file.h b/innobase/include/os0file.h
index 01fa12955ff..d65c7fd47e3 100644
--- a/innobase/include/os0file.h
+++ b/innobase/include/os0file.h
@@ -16,6 +16,7 @@ Created 10/21/1995 Heikki Tuuri
os_file_write */
extern ibool os_do_not_call_flush_at_each_write;
extern ibool os_has_said_disk_full;
+extern ibool os_aio_print_debug;
#ifdef __WIN__
@@ -33,6 +34,8 @@ extern ibool os_has_said_disk_full;
typedef int os_file_t;
#endif
+extern ulint os_innodb_umask;
+
/* If this flag is TRUE, then we will use the native aio of the
OS (provided we compiled Innobase with it in), otherwise we will
use simulated aio we build below with threads */
@@ -309,6 +312,15 @@ Wakes up simulated aio i/o-handler threads if they have something to do. */
void
os_aio_simulated_wake_handler_threads(void);
/*=======================================*/
+/**************************************************************************
+This function can be called if one wants to post a batch of reads and
+prefers an i/o-handler thread to handle them all at once later. You must
+call os_aio_simulated_wake_handler_threads later to ensure the threads
+are not left sleeping! */
+
+void
+os_aio_simulated_put_read_threads_to_sleep(void);
+/*============================================*/
#ifdef WIN_ASYNC_IO
/**************************************************************************
@@ -391,8 +403,16 @@ os_aio_validate(void);
Prints info of the aio arrays. */
void
-os_aio_print(void);
-/*==============*/
+os_aio_print(
+/*=========*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end);/* in: buffer end */
+/**************************************************************************
+Refreshes the statistics used to print per-second averages. */
+
+void
+os_aio_refresh_stats(void);
+/*======================*/
/**************************************************************************
Checks that all slots in the system have been freed, that is, there are
no pending io operations. */
diff --git a/innobase/include/os0sync.ic b/innobase/include/os0sync.ic
index 6bff75d8ec6..10b85c435e3 100644
--- a/innobase/include/os0sync.ic
+++ b/innobase/include/os0sync.ic
@@ -27,7 +27,21 @@ os_fast_mutex_trylock(
return(0);
#else
+#if defined(UNIV_HOTBACKUP) && defined(UNIV_HPUX10)
+ /* Since the hot backup version is standalone, MySQL does not redefine
+ pthread_mutex_trylock for HP-UX-10.20, and consequently we must invert
+ the return value here */
+
+ return((ulint) (1 - pthread_mutex_trylock(fast_mutex)));
+#else
+ /* NOTE that the MySQL my_pthread.h redefines pthread_mutex_trylock
+ so that it returns 0 on success. In the operating system
+ libraries, HP-UX-10.20 follows the old Posix 1003.4a Draft 4 and
+ returns 1 on success (but MySQL remaps that to 0), while Linux,
+ FreeBSD, Solaris, AIX, Tru64 Unix, HP-UX-11.0 return 0 on success. */
+
return((ulint) pthread_mutex_trylock(fast_mutex));
#endif
+#endif
}
diff --git a/innobase/include/os0thread.h b/innobase/include/os0thread.h
index 2e4b6f0f6ee..9459750719f 100644
--- a/innobase/include/os0thread.h
+++ b/innobase/include/os0thread.h
@@ -12,8 +12,10 @@ Created 9/8/1995 Heikki Tuuri
#include "univ.i"
-/* Maximum number of threads which can be created in the program */
-#define OS_THREAD_MAX_N 1000
+/* Maximum number of threads which can be created in the program;
+this is also the size of the wait slot array for MySQL threads which
+can wait inside InnoDB */
+#define OS_THREAD_MAX_N 10000
/* Possible fixed priorities for threads */
#define OS_THREAD_PRIORITY_NONE 100
@@ -23,15 +25,37 @@ Created 9/8/1995 Heikki Tuuri
#ifdef __WIN__
typedef void* os_thread_t;
+typedef ulint os_thread_id_t; /* In Windows the thread id
+ is an unsigned long int */
#else
typedef pthread_t os_thread_t;
+typedef os_thread_t os_thread_id_t; /* In Unix we use the thread
+ handle itself as the id of
+ the thread */
#endif
-typedef unsigned long int os_thread_id_t;
+
/* Define a function pointer type to use in a typecast */
typedef void* (*os_posix_f_t) (void*);
+/*******************************************************************
+Compares two thread ids for equality. */
+
+ibool
+os_thread_eq(
+/*=========*/
+ /* out: TRUE if equal */
+ os_thread_id_t a, /* in: OS thread or thread id */
+ os_thread_id_t b); /* in: OS thread or thread id */
+/********************************************************************
+Converts an OS thread id to a ulint. It is NOT guaranteed that the ulint is
+unique for the thread though! */
+ulint
+os_thread_pf(
+/*=========*/
+ /* out: unsigned long int */
+ os_thread_id_t a); /* in: thread or thread id */
/********************************************************************
Creates a new thread of execution. The execution starts from
the function given. The start function takes a void* parameter
@@ -49,8 +73,8 @@ os_thread_create(
#endif
void* arg, /* in: argument to start
function */
- os_thread_id_t* thread_id); /* out: id of created
- thread */
+ os_thread_id_t* thread_id); /* out: id of the created
+ thread */
/*********************************************************************
A thread calling this function ends its execution. */
@@ -71,14 +95,6 @@ os_thread_t
os_thread_get_curr(void);
/*====================*/
/*********************************************************************
-Converts a thread id to a ulint. */
-
-ulint
-os_thread_conv_id_to_ulint(
-/*=======================*/
- /* out: converted to ulint */
- os_thread_id_t id); /* in: thread id */
-/*********************************************************************
Waits for a thread to terminate. */
void
diff --git a/innobase/include/page0page.h b/innobase/include/page0page.h
index 8e68381b868..2f77127466f 100644
--- a/innobase/include/page0page.h
+++ b/innobase/include/page0page.h
@@ -328,7 +328,7 @@ page_dir_calc_reserved_space(
ulint n_recs); /* in: number of records */
/*******************************************************************
Looks for the directory slot which owns the given record. */
-UNIV_INLINE
+
ulint
page_dir_find_owner_slot(
/*=====================*/
diff --git a/innobase/include/page0page.ic b/innobase/include/page0page.ic
index f84fe5a5606..e7c0f8ee07c 100644
--- a/innobase/include/page0page.ic
+++ b/innobase/include/page0page.ic
@@ -479,6 +479,8 @@ page_rec_get_next(
offs = rec_get_next_offs(rec);
+ ut_a(offs < UNIV_PAGE_SIZE);
+
if (offs == 0) {
return(NULL);
@@ -487,40 +489,6 @@ page_rec_get_next(
return(page + offs);
}
-/*******************************************************************
-Looks for the directory slot which owns the given record. */
-UNIV_INLINE
-ulint
-page_dir_find_owner_slot(
-/*=====================*/
- /* out: the directory slot number */
- rec_t* rec) /* in: the physical record */
-{
- ulint i;
- page_t* page;
- page_dir_slot_t* slot;
-
- ut_ad(page_rec_check(rec));
-
- while (rec_get_n_owned(rec) == 0) {
- rec = page_rec_get_next(rec);
- }
-
- page = buf_frame_align(rec);
-
- i = page_dir_get_n_slots(page) - 1;
- slot = page_dir_get_nth_slot(page, i);
-
- while (page_dir_slot_get_rec(slot) != rec) {
- ut_a(i > 0);
-
- i--;
- slot = page_dir_get_nth_slot(page, i);
- }
-
- return(i);
-}
-
/****************************************************************
Sets the pointer to the next record on the page. */
UNIV_INLINE
@@ -534,7 +502,7 @@ page_rec_set_next(
page_t* page;
ut_ad(page_rec_check(rec));
- ut_ad((next == NULL)
+ ut_a((next == NULL)
|| (buf_frame_align(rec) == buf_frame_align(next)));
page = buf_frame_align(rec);
@@ -573,7 +541,7 @@ page_rec_get_prev(
slot_no = page_dir_find_owner_slot(rec);
- ut_ad(slot_no != 0);
+ ut_a(slot_no != 0);
slot = page_dir_get_nth_slot(page, slot_no - 1);
@@ -584,7 +552,7 @@ page_rec_get_prev(
rec2 = page_rec_get_next(rec2);
}
- ut_ad(prev_rec);
+ ut_a(prev_rec);
return(prev_rec);
}
diff --git a/innobase/include/pars0grm.h b/innobase/include/pars0grm.h
index d0b4b4c2e42..b2790949057 100644
--- a/innobase/include/pars0grm.h
+++ b/innobase/include/pars0grm.h
@@ -1,90 +1,90 @@
#ifndef YYSTYPE
#define YYSTYPE int
#endif
-#define PARS_INT_LIT 258
-#define PARS_FLOAT_LIT 259
-#define PARS_STR_LIT 260
-#define PARS_NULL_LIT 261
-#define PARS_ID_TOKEN 262
-#define PARS_AND_TOKEN 263
-#define PARS_OR_TOKEN 264
-#define PARS_NOT_TOKEN 265
-#define PARS_GE_TOKEN 266
-#define PARS_LE_TOKEN 267
-#define PARS_NE_TOKEN 268
-#define PARS_PROCEDURE_TOKEN 269
-#define PARS_IN_TOKEN 270
-#define PARS_OUT_TOKEN 271
-#define PARS_INT_TOKEN 272
-#define PARS_INTEGER_TOKEN 273
-#define PARS_FLOAT_TOKEN 274
-#define PARS_CHAR_TOKEN 275
-#define PARS_IS_TOKEN 276
-#define PARS_BEGIN_TOKEN 277
-#define PARS_END_TOKEN 278
-#define PARS_IF_TOKEN 279
-#define PARS_THEN_TOKEN 280
-#define PARS_ELSE_TOKEN 281
-#define PARS_ELSIF_TOKEN 282
-#define PARS_LOOP_TOKEN 283
-#define PARS_WHILE_TOKEN 284
-#define PARS_RETURN_TOKEN 285
-#define PARS_SELECT_TOKEN 286
-#define PARS_SUM_TOKEN 287
-#define PARS_COUNT_TOKEN 288
-#define PARS_DISTINCT_TOKEN 289
-#define PARS_FROM_TOKEN 290
-#define PARS_WHERE_TOKEN 291
-#define PARS_FOR_TOKEN 292
-#define PARS_DDOT_TOKEN 293
-#define PARS_CONSISTENT_TOKEN 294
-#define PARS_READ_TOKEN 295
-#define PARS_ORDER_TOKEN 296
-#define PARS_BY_TOKEN 297
-#define PARS_ASC_TOKEN 298
-#define PARS_DESC_TOKEN 299
-#define PARS_INSERT_TOKEN 300
-#define PARS_INTO_TOKEN 301
-#define PARS_VALUES_TOKEN 302
-#define PARS_UPDATE_TOKEN 303
-#define PARS_SET_TOKEN 304
-#define PARS_DELETE_TOKEN 305
-#define PARS_CURRENT_TOKEN 306
-#define PARS_OF_TOKEN 307
-#define PARS_CREATE_TOKEN 308
-#define PARS_TABLE_TOKEN 309
-#define PARS_INDEX_TOKEN 310
-#define PARS_UNIQUE_TOKEN 311
-#define PARS_CLUSTERED_TOKEN 312
-#define PARS_DOES_NOT_FIT_IN_MEM_TOKEN 313
-#define PARS_ON_TOKEN 314
-#define PARS_ASSIGN_TOKEN 315
-#define PARS_DECLARE_TOKEN 316
-#define PARS_CURSOR_TOKEN 317
-#define PARS_SQL_TOKEN 318
-#define PARS_OPEN_TOKEN 319
-#define PARS_FETCH_TOKEN 320
-#define PARS_CLOSE_TOKEN 321
-#define PARS_NOTFOUND_TOKEN 322
-#define PARS_TO_CHAR_TOKEN 323
-#define PARS_TO_NUMBER_TOKEN 324
-#define PARS_TO_BINARY_TOKEN 325
-#define PARS_BINARY_TO_NUMBER_TOKEN 326
-#define PARS_SUBSTR_TOKEN 327
-#define PARS_REPLSTR_TOKEN 328
-#define PARS_CONCAT_TOKEN 329
-#define PARS_INSTR_TOKEN 330
-#define PARS_LENGTH_TOKEN 331
-#define PARS_SYSDATE_TOKEN 332
-#define PARS_PRINTF_TOKEN 333
-#define PARS_ASSERT_TOKEN 334
-#define PARS_RND_TOKEN 335
-#define PARS_RND_STR_TOKEN 336
-#define PARS_ROW_PRINTF_TOKEN 337
-#define PARS_COMMIT_TOKEN 338
-#define PARS_ROLLBACK_TOKEN 339
-#define PARS_WORK_TOKEN 340
-#define NEG 341
+#define PARS_INT_LIT 257
+#define PARS_FLOAT_LIT 258
+#define PARS_STR_LIT 259
+#define PARS_NULL_LIT 260
+#define PARS_ID_TOKEN 261
+#define PARS_AND_TOKEN 262
+#define PARS_OR_TOKEN 263
+#define PARS_NOT_TOKEN 264
+#define PARS_GE_TOKEN 265
+#define PARS_LE_TOKEN 266
+#define PARS_NE_TOKEN 267
+#define PARS_PROCEDURE_TOKEN 268
+#define PARS_IN_TOKEN 269
+#define PARS_OUT_TOKEN 270
+#define PARS_INT_TOKEN 271
+#define PARS_INTEGER_TOKEN 272
+#define PARS_FLOAT_TOKEN 273
+#define PARS_CHAR_TOKEN 274
+#define PARS_IS_TOKEN 275
+#define PARS_BEGIN_TOKEN 276
+#define PARS_END_TOKEN 277
+#define PARS_IF_TOKEN 278
+#define PARS_THEN_TOKEN 279
+#define PARS_ELSE_TOKEN 280
+#define PARS_ELSIF_TOKEN 281
+#define PARS_LOOP_TOKEN 282
+#define PARS_WHILE_TOKEN 283
+#define PARS_RETURN_TOKEN 284
+#define PARS_SELECT_TOKEN 285
+#define PARS_SUM_TOKEN 286
+#define PARS_COUNT_TOKEN 287
+#define PARS_DISTINCT_TOKEN 288
+#define PARS_FROM_TOKEN 289
+#define PARS_WHERE_TOKEN 290
+#define PARS_FOR_TOKEN 291
+#define PARS_DDOT_TOKEN 292
+#define PARS_CONSISTENT_TOKEN 293
+#define PARS_READ_TOKEN 294
+#define PARS_ORDER_TOKEN 295
+#define PARS_BY_TOKEN 296
+#define PARS_ASC_TOKEN 297
+#define PARS_DESC_TOKEN 298
+#define PARS_INSERT_TOKEN 299
+#define PARS_INTO_TOKEN 300
+#define PARS_VALUES_TOKEN 301
+#define PARS_UPDATE_TOKEN 302
+#define PARS_SET_TOKEN 303
+#define PARS_DELETE_TOKEN 304
+#define PARS_CURRENT_TOKEN 305
+#define PARS_OF_TOKEN 306
+#define PARS_CREATE_TOKEN 307
+#define PARS_TABLE_TOKEN 308
+#define PARS_INDEX_TOKEN 309
+#define PARS_UNIQUE_TOKEN 310
+#define PARS_CLUSTERED_TOKEN 311
+#define PARS_DOES_NOT_FIT_IN_MEM_TOKEN 312
+#define PARS_ON_TOKEN 313
+#define PARS_ASSIGN_TOKEN 314
+#define PARS_DECLARE_TOKEN 315
+#define PARS_CURSOR_TOKEN 316
+#define PARS_SQL_TOKEN 317
+#define PARS_OPEN_TOKEN 318
+#define PARS_FETCH_TOKEN 319
+#define PARS_CLOSE_TOKEN 320
+#define PARS_NOTFOUND_TOKEN 321
+#define PARS_TO_CHAR_TOKEN 322
+#define PARS_TO_NUMBER_TOKEN 323
+#define PARS_TO_BINARY_TOKEN 324
+#define PARS_BINARY_TO_NUMBER_TOKEN 325
+#define PARS_SUBSTR_TOKEN 326
+#define PARS_REPLSTR_TOKEN 327
+#define PARS_CONCAT_TOKEN 328
+#define PARS_INSTR_TOKEN 329
+#define PARS_LENGTH_TOKEN 330
+#define PARS_SYSDATE_TOKEN 331
+#define PARS_PRINTF_TOKEN 332
+#define PARS_ASSERT_TOKEN 333
+#define PARS_RND_TOKEN 334
+#define PARS_RND_STR_TOKEN 335
+#define PARS_ROW_PRINTF_TOKEN 336
+#define PARS_COMMIT_TOKEN 337
+#define PARS_ROLLBACK_TOKEN 338
+#define PARS_WORK_TOKEN 339
+#define NEG 340
extern YYSTYPE yylval;
diff --git a/innobase/include/rem0rec.ic b/innobase/include/rem0rec.ic
index 6b96e3056fa..aaa3c58a003 100644
--- a/innobase/include/rem0rec.ic
+++ b/innobase/include/rem0rec.ic
@@ -970,8 +970,6 @@ rec_fold(
ut_ad(n_fields <= rec_get_n_fields(rec));
ut_ad((n_fields < rec_get_n_fields(rec)) || (n_bytes == 0));
ut_ad(n_fields + n_bytes > 0);
- /* Only the page supremum and infimum records have 1 field: */
- ut_ad(rec_get_n_fields(rec) > 1);
n_fields_rec = rec_get_n_fields(rec);
diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h
index 13b3dffd874..8152c534f48 100644
--- a/innobase/include/row0mysql.h
+++ b/innobase/include/row0mysql.h
@@ -230,6 +230,19 @@ row_update_cascade_for_mysql(
or set null operation */
dict_table_t* table); /* in: table where we do the operation */
/*************************************************************************
+Locks the data dictionary exclusively for performing a table create
+operation. */
+
+void
+row_mysql_lock_data_dictionary(void);
+/*================================*/
+/*************************************************************************
+Unlocks the data dictionary exclusively lock. */
+
+void
+row_mysql_unlock_data_dictionary(void);
+/*==================================*/
+/*************************************************************************
Does a table creation operation for MySQL. If the name of the created
table ends to characters INNODB_MONITOR, then this also starts
printing of monitor output by the master thread. */
diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h
index 6777a24e7db..178c7b6971f 100644
--- a/innobase/include/srv0srv.h
+++ b/innobase/include/srv0srv.h
@@ -357,6 +357,14 @@ srv_error_monitor_thread(
/* out: a dummy parameter */
void* arg); /* in: a dummy parameter required by
os_thread_create */
+/**********************************************************************
+Sprintfs to a buffer the output of the InnoDB Monitor. */
+
+void
+srv_sprintf_innodb_monitor(
+/*=======================*/
+ char* buf, /* in/out: buffer which must be at least 4 kB */
+ ulint len); /* in: length of the buffer */
/* Types for the threads existing in the system. Threads of types 4 - 9
diff --git a/innobase/include/srv0start.h b/innobase/include/srv0start.h
index 01ac063e1c9..646d2c1bb06 100644
--- a/innobase/include/srv0start.h
+++ b/innobase/include/srv0start.h
@@ -85,7 +85,7 @@ extern ibool srv_is_being_shut_down;
/* At a shutdown the value first climbs from 0 to SRV_SHUTDOWN_CLEANUP
and then to SRV_SHUTDOWN_LAST_PHASE */
-extern ulint srv_shutdown_state;
+extern ulint srv_shutdown_state;
#define SRV_SHUTDOWN_CLEANUP 1
#define SRV_SHUTDOWN_LAST_PHASE 2
diff --git a/innobase/include/sync0arr.h b/innobase/include/sync0arr.h
index f0134894997..765ad33afea 100644
--- a/innobase/include/sync0arr.h
+++ b/innobase/include/sync0arr.h
@@ -114,6 +114,8 @@ Prints info of the wait array. */
void
sync_array_print_info(
/*==================*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end,/* in: buffer end */
sync_array_t* arr); /* in: wait array */
diff --git a/innobase/include/sync0rw.ic b/innobase/include/sync0rw.ic
index 43e9202360b..36ef0a985ed 100644
--- a/innobase/include/sync0rw.ic
+++ b/innobase/include/sync0rw.ic
@@ -312,7 +312,8 @@ rw_lock_x_lock_func_nowait(
&& ((rw_lock_get_writer(lock) == RW_LOCK_NOT_LOCKED)
|| ((rw_lock_get_writer(lock) == RW_LOCK_EX)
&& (lock->pass == 0)
- && (lock->writer_thread == os_thread_get_curr_id())))) {
+ && os_thread_eq(lock->writer_thread,
+ os_thread_get_curr_id())))) {
rw_lock_set_writer(lock, RW_LOCK_EX);
lock->writer_thread = os_thread_get_curr_id();
diff --git a/innobase/include/sync0sync.h b/innobase/include/sync0sync.h
index 4f55709a5d7..5bfa0bc2d48 100644
--- a/innobase/include/sync0sync.h
+++ b/innobase/include/sync0sync.h
@@ -117,14 +117,18 @@ FUNCTION PROTOTYPES FOR DEBUGGING */
Prints wait info of the sync system. */
void
-sync_print_wait_info(void);
-/*======================*/
+sync_print_wait_info(
+/*=================*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end); /* in: buffer end */
/***********************************************************************
Prints info of the sync system. */
void
-sync_print(void);
-/*============*/
+sync_print(
+/*=======*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end); /* in: buffer end */
/**********************************************************************
Checks that the mutex has been initialized. */
diff --git a/innobase/include/sync0sync.ic b/innobase/include/sync0sync.ic
index 9014eb5fb54..c11cc0d196e 100644
--- a/innobase/include/sync0sync.ic
+++ b/innobase/include/sync0sync.ic
@@ -104,6 +104,10 @@ mutex_test_and_set(
ret = os_fast_mutex_trylock(&(mutex->os_fast_mutex));
if (ret == 0) {
+ /* We check that os_fast_mutex_trylock does not leak
+ and allow race conditions */
+ ut_a(mutex->lock_word == 0);
+
mutex->lock_word = 1;
}
diff --git a/innobase/include/trx0roll.h b/innobase/include/trx0roll.h
index c456768e820..820af4cd014 100644
--- a/innobase/include/trx0roll.h
+++ b/innobase/include/trx0roll.h
@@ -102,11 +102,13 @@ trx_rollback(
calling function can start running
a new query thread */
/***********************************************************************
-Rollback uncommitted transactions which have no user session. */
+Rollback or clean up transactions which have no user session. If the
+transaction already was committed, then we clean up a possible insert
+undo log. If the transaction was not yet committed, then we roll it back. */
void
-trx_rollback_all_without_sess(void);
-/*===============================*/
+trx_rollback_or_clean_all_without_sess(void);
+/*========================================*/
/********************************************************************
Finishes a transaction rollback. */
diff --git a/innobase/include/trx0sys.h b/innobase/include/trx0sys.h
index 60d5adb72d1..a54a6424a4f 100644
--- a/innobase/include/trx0sys.h
+++ b/innobase/include/trx0sys.h
@@ -24,6 +24,14 @@ Created 3/26/1996 Heikki Tuuri
#include "fsp0fsp.h"
#include "read0types.h"
+/* In a MySQL replication slave, in crash recovery we store the master log
+file name and position here. We have successfully got the updates to InnoDB
+up to this position. If .._pos is -1, it means no crash recovery was needed,
+or there was no master log position info inside InnoDB. */
+
+extern char trx_sys_mysql_master_log_name[];
+extern ib_longlong trx_sys_mysql_master_log_pos;
+
/* The transaction system */
extern trx_sys_t* trx_sys;
@@ -229,13 +237,18 @@ trx_in_trx_list(
trx_t* in_trx);/* in: trx */
/*********************************************************************
Updates the offset information about the end of the MySQL binlog entry
-which corresponds to the transaction just being committed. */
+which corresponds to the transaction just being committed. In a MySQL
+replication slave updates the latest master binlog position up to which
+replication has proceeded. */
void
trx_sys_update_mysql_binlog_offset(
/*===============================*/
- trx_t* trx, /* in: transaction being committed */
- mtr_t* mtr); /* in: mtr */
+ char* file_name,/* in: MySQL log file name */
+ ib_longlong offset, /* in: position in that log file */
+ ulint field, /* in: offset of the MySQL log info field in
+ the trx sys header */
+ mtr_t* mtr); /* in: mtr */
/*********************************************************************
Prints to stderr the MySQL binlog offset info in the trx system header if
the magic number shows it valid. */
@@ -243,15 +256,26 @@ the magic number shows it valid. */
void
trx_sys_print_mysql_binlog_offset(void);
/*===================================*/
+/*********************************************************************
+Prints to stdout the MySQL binlog info in the system header if the
+magic number shows it valid. */
+
+void
+trx_sys_print_mysql_binlog_offset_from_page(
+/*========================================*/
+ byte* page); /* in: buffer containing the trx system header page,
+ i.e., page number TRX_SYS_PAGE_NO in the tablespace */
+/*********************************************************************
+Prints to stderr the MySQL master log offset info in the trx system header if
+the magic number shows it valid. */
+
+void
+trx_sys_print_mysql_master_log_pos(void);
+/*====================================*/
/* The automatically created system rollback segment has this id */
#define TRX_SYS_SYSTEM_RSEG_ID 0
-/* Max number of rollback segments: the number of segment specification slots
-in the transaction system array; rollback segment id must fit in one byte,
-therefore 256 */
-#define TRX_SYS_N_RSEGS 256
-
/* Space id and page no where the trx system file copy resides */
#define TRX_SYS_SPACE 0 /* the SYSTEM tablespace */
#define TRX_SYS_PAGE_NO FSP_TRX_SYS_PAGE_NO
@@ -277,22 +301,29 @@ therefore 256 */
segment specification slots */
/*-------------------------------------------------------------*/
-#define TRX_SYS_MYSQL_LOG_NAME_LEN 32
+/* Max number of rollback segments: the number of segment specification slots
+in the transaction system array; rollback segment id must fit in one byte,
+therefore 256; each slot is currently 8 bytes in size */
+#define TRX_SYS_N_RSEGS 256
+
+#define TRX_SYS_MYSQL_LOG_NAME_LEN 512
#define TRX_SYS_MYSQL_LOG_MAGIC_N 873422344
-/* The offset of the MySQL binlog offset info on the trx system header page */
-#define TRX_SYS_MYSQL_LOG_INFO (UNIV_PAGE_SIZE - 300)
+/* The offset of the MySQL replication info in the trx system header;
+this contains the same fields as TRX_SYS_MYSQL_LOG_INFO below */
+#define TRX_SYS_MYSQL_MASTER_LOG_INFO (UNIV_PAGE_SIZE - 2000)
+
+/* The offset of the MySQL binlog offset info in the trx system header */
+#define TRX_SYS_MYSQL_LOG_INFO (UNIV_PAGE_SIZE - 1000)
#define TRX_SYS_MYSQL_LOG_MAGIC_N_FLD 0 /* magic number which shows
if we have valid data in the
MySQL binlog info; the value
is ..._MAGIC_N if yes */
-#define TRX_SYS_MYSQL_LOG_NAME 4 /* MySQL log file name */
-#define TRX_SYS_MYSQL_LOG_OFFSET_HIGH (4 + TRX_SYS_MYSQL_LOG_NAME_LEN)
- /* high 4 bytes of the offset
+#define TRX_SYS_MYSQL_LOG_OFFSET_HIGH 4 /* high 4 bytes of the offset
within that file */
-#define TRX_SYS_MYSQL_LOG_OFFSET_LOW (8 + TRX_SYS_MYSQL_LOG_NAME_LEN)
- /* low 4 bytes of the offset
+#define TRX_SYS_MYSQL_LOG_OFFSET_LOW 8 /* low 4 bytes of the offset
within that file */
+#define TRX_SYS_MYSQL_LOG_NAME 12 /* MySQL log file name */
/* The offset of the doublewrite buffer header on the trx system header page */
#define TRX_SYS_DOUBLEWRITE (UNIV_PAGE_SIZE - 200)
diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h
index 261f33d3dc3..e1f65e9da0f 100644
--- a/innobase/include/trx0trx.h
+++ b/innobase/include/trx0trx.h
@@ -117,6 +117,13 @@ void
trx_start_if_not_started(
/*=====================*/
trx_t* trx); /* in: transaction */
+/*****************************************************************
+Starts the transaction if it is not yet started. */
+
+void
+trx_start_if_not_started_noninline(
+/*===============================*/
+ trx_t* trx); /* in: transaction */
/********************************************************************
Commits a transaction. */
@@ -124,6 +131,15 @@ void
trx_commit_off_kernel(
/*==================*/
trx_t* trx); /* in: transaction */
+/********************************************************************
+Cleans up a transaction at database startup. The cleanup is needed if
+the transaction already got to the middle of a commit when the database
+crashed, andf we cannot roll it back. */
+
+void
+trx_cleanup_at_db_startup(
+/*======================*/
+ trx_t* trx); /* in: transaction */
/**************************************************************************
Does the transaction commit for MySQL. */
@@ -252,7 +268,9 @@ own the kernel mutex. */
void
trx_print(
/*======*/
- trx_t* trx); /* in: transaction */
+ char* buf, /* in/out: buffer where to print, must be at least
+ 800 bytes */
+ trx_t* trx); /* in: transaction */
/* Signal to a transaction */
@@ -298,6 +316,9 @@ struct trx_struct{
of view of concurrency control:
TRX_ACTIVE, TRX_COMMITTED_IN_MEMORY,
... */
+ time_t start_time; /* time the trx object was created
+ or the state last time became
+ TRX_ACTIVE */
ibool check_foreigns; /* normally TRUE, but if the user
wants to suppress foreign key checks,
(in table imports, for example) we
@@ -322,13 +343,24 @@ struct trx_struct{
void* mysql_thd; /* MySQL thread handle corresponding
to this trx, or NULL */
char* mysql_log_file_name;
- /* If MySQL binlog is used, this field
+ /* if MySQL binlog is used, this field
contains a pointer to the latest file
name; this is NULL if binlog is not
used */
- ib_longlong mysql_log_offset;/* If MySQL binlog is used, this field
+ ib_longlong mysql_log_offset;/* if MySQL binlog is used, this field
contains the end offset of the binlog
entry */
+ char* mysql_master_log_file_name;
+ /* if the database server is a MySQL
+ replication slave, we have here the
+ master binlog name up to which
+ replication has processed; otherwise
+ this is a pointer to a null character */
+ ib_longlong mysql_master_log_pos;
+ /* if the database server is a MySQL
+ replication slave, this is the
+ position in the log file up to which
+ replication has processed */
os_thread_id_t mysql_thread_id;/* id of the MySQL thread associated
with this transaction object */
/*------------------------------*/
@@ -446,6 +478,7 @@ struct trx_struct{
TRX_QUE_LOCK_WAIT, this points to
the lock request, otherwise this is
NULL */
+ time_t wait_started; /* lock wait started at this time */
UT_LIST_BASE_NODE_T(que_thr_t)
wait_thrs; /* query threads belonging to this
trx that are in the QUE_THR_LOCK_WAIT
diff --git a/innobase/include/univ.i b/innobase/include/univ.i
index 160a435319a..f32161fed20 100644
--- a/innobase/include/univ.i
+++ b/innobase/include/univ.i
@@ -9,41 +9,26 @@ Created 1/20/1994 Heikki Tuuri
#ifndef univ_i
#define univ_i
-#if (defined(_WIN32) || defined(_WIN64)) && !defined(MYSQL_SERVER)
+#if (defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)) && !defined(MYSQL_SERVER)
#define __WIN__
#include <windows.h>
-/* When compiling for Itanium IA64, undefine the flag below to prevent use
-of 32-bit assembler */
-
-#ifndef WIN64
+#if !defined(WIN64) && !defined(_WIN64)
#define UNIV_CAN_USE_X86_ASSEMBLER
#endif
-/* If you want to check for errors with compiler level -W4,
-comment out the above include of windows.h and let the following defines
-be defined:
-#define HANDLE void*
-#define CRITICAL_SECTION ulint
-*/
-
#ifdef _NT_
#define __NT__
#endif
#else
-/* The Unix version */
-
-/* Most C compilers other than gcc do not know 'extern inline' */
-#if !defined(__GNUC__) && !defined(__WIN__)
-#undef UNIV_MUST_NOT_INLINE
-#define UNIV_MUST_NOT_INLINE
-#endif
+/* The defines used with MySQL */
/* Include two header files from MySQL to make the Unix flavor used
-in compiling more Posix-compatible. We assume that 'innobase' is a
-subdirectory of 'mysql'. */
+in compiling more Posix-compatible. These headers also define __WIN__
+if we are compiling on Windows. */
+
#include <my_global.h>
#include <my_pthread.h>
@@ -60,10 +45,30 @@ subdirectory of 'mysql'. */
#include <sched.h>
#endif
+/* When compiling for Itanium IA64, undefine the flag below to prevent use
+of the 32-bit x86 assembler in mutex operations. */
+
+#if defined(__WIN__) && !defined(WIN64) && !defined(_WIN64)
+#define UNIV_CAN_USE_X86_ASSEMBLER
+#endif
+
+/* We only try to do explicit inlining of functions with gcc and
+Microsoft Visual C++ */
+
+#if !defined(__GNUC__) && !defined(__WIN__)
+#define UNIV_MUST_NOT_INLINE
+#endif
+
#ifdef HAVE_PREAD
#define HAVE_PWRITE
#endif
+/* Apparently in some old SCO Unixes the return type of sprintf is not
+an integer as it should be according to the modern Posix standard. Because
+of that we define sprintf inside InnoDB code as our own function ut_sprintf */
+#undef sprintf
+#define sprintf ut_sprintf
+
#endif
/* DEBUG VERSION CONTROL
@@ -81,8 +86,8 @@ memory is read outside the allocated blocks. */
/*
#define UNIV_DEBUG
-#define UNIV_MEM_DEBUG
#define UNIV_SYNC_DEBUG
+#define UNIV_MEM_DEBUG
#define UNIV_IBUF_DEBUG
#define UNIV_SEARCH_DEBUG
@@ -117,7 +122,7 @@ memory is read outside the allocated blocks. */
#define UNIV_INLINE extern inline
#else
/* extern inline doesn't work with gcc 3.0.2 */
-#define UNIV_INLINE static inline
+#define UNIV_INLINE static inline
#endif
#endif
@@ -205,8 +210,12 @@ headers may define 'bool' differently. Do not assume that 'bool' is a ulint! */
#endif
/* The following number as the length of a logical field means that the field
-has the SQL NULL as its value. */
-#define UNIV_SQL_NULL ULINT_UNDEFINED
+has the SQL NULL as its value. NOTE that because we assume that the length
+of a field is a 32-bit integer when we store it, for example, to an undo log
+on disk, we must have also this number fit in 32 bits, also in 64-bit
+computers! */
+
+#define UNIV_SQL_NULL ULINT32_UNDEFINED
/* Lengths which are not UNIV_SQL_NULL, but bigger than the following
number indicate that a field contains a reference to an externally
diff --git a/innobase/include/ut0dbg.h b/innobase/include/ut0dbg.h
index fc5d493ca5e..3407483696c 100644
--- a/innobase/include/ut0dbg.h
+++ b/innobase/include/ut0dbg.h
@@ -26,9 +26,11 @@ extern ulint* ut_dbg_null_ptr;
ulint dbg_i;\
\
if (!((ulint)(EXPR) + ut_dbg_zero)) {\
+ ut_print_timestamp(stderr);\
fprintf(stderr,\
- "InnoDB: Assertion failure in thread %lu in file %s line %lu\n",\
- os_thread_get_curr_id(), IB__FILE__, (ulint)__LINE__);\
+ " InnoDB: Assertion failure in thread %lu in file %s line %lu\n",\
+ os_thread_pf(os_thread_get_curr_id()), IB__FILE__,\
+ (ulint)__LINE__);\
fprintf(stderr,\
"InnoDB: We intentionally generate a memory trap.\n");\
fprintf(stderr,\
@@ -42,16 +44,17 @@ extern ulint* ut_dbg_null_ptr;
if (ut_dbg_stop_threads) {\
fprintf(stderr,\
"InnoDB: Thread %lu stopped in file %s line %lu\n",\
- os_thread_get_curr_id(), IB__FILE__, (ulint)__LINE__);\
+ os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\
os_thread_sleep(1000000000);\
}\
}
#define ut_error {\
ulint dbg_i;\
+ ut_print_timestamp(stderr);\
fprintf(stderr,\
- "InnoDB: Assertion failure in thread %lu in file %s line %lu\n",\
- os_thread_get_curr_id(), IB__FILE__, (ulint)__LINE__);\
+ " InnoDB: Assertion failure in thread %lu in file %s line %lu\n",\
+ os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\
fprintf(stderr,\
"InnoDB: We intentionally generate a memory trap.\n");\
fprintf(stderr,\
diff --git a/innobase/include/ut0mem.h b/innobase/include/ut0mem.h
index 2d245e5f72f..09e0d800685 100644
--- a/innobase/include/ut0mem.h
+++ b/innobase/include/ut0mem.h
@@ -69,7 +69,7 @@ ut_strcpy(char* dest, char* sour);
UNIV_INLINE
ulint
-ut_strlen(char* str);
+ut_strlen(const char* str);
UNIV_INLINE
int
diff --git a/innobase/include/ut0mem.ic b/innobase/include/ut0mem.ic
index 7ae9bc8bd74..1049aee8ecc 100644
--- a/innobase/include/ut0mem.ic
+++ b/innobase/include/ut0mem.ic
@@ -36,7 +36,7 @@ ut_strcpy(char* dest, char* sour)
UNIV_INLINE
ulint
-ut_strlen(char* str)
+ut_strlen(const char* str)
{
return(strlen(str));
}
diff --git a/innobase/include/ut0ut.h b/innobase/include/ut0ut.h
index 338460d7de9..8ec23b23dcd 100644
--- a/innobase/include/ut0ut.h
+++ b/innobase/include/ut0ut.h
@@ -17,6 +17,18 @@ Created 1/20/1994 Heikki Tuuri
typedef time_t ib_time_t;
+
+/************************************************************
+Uses vsprintf to emulate sprintf so that the function always returns
+the printed length. Apparently in some old SCO Unixes sprintf did not
+return the printed length but a pointer to the end of the printed string. */
+
+ulint
+ut_sprintf(
+/*=======*/
+ char* buf, /* in/out: buffer where to print */
+ const char* format, /* in: format of prints */
+ ...); /* in: arguments to be printed */
/************************************************************
Gets the high 32 bits in a ulint. That is makes a shift >> 32,
but since there seem to be compiler bugs in both gcc and Visual C++,
@@ -114,7 +126,7 @@ ut_2_exp(
ulint n); /* in: number */
/*****************************************************************
Calculates fast the number rounded up to the nearest power of 2. */
-UNIV_INLINE
+
ulint
ut_2_power_up(
/*==========*/
@@ -155,6 +167,13 @@ ut_print_timestamp(
/*===============*/
FILE* file); /* in: file where to print */
/**************************************************************
+Sprintfs a timestamp to a buffer. */
+
+void
+ut_sprintf_timestamp(
+/*=================*/
+ char* buf); /* in: buffer where to sprintf */
+/**************************************************************
Returns current year, month, day. */
void
diff --git a/innobase/include/ut0ut.ic b/innobase/include/ut0ut.ic
index 90f25d2b382..9d7dd283f29 100644
--- a/innobase/include/ut0ut.ic
+++ b/innobase/include/ut0ut.ic
@@ -172,25 +172,3 @@ ut_2_exp(
{
return(1 << n);
}
-
-/*****************************************************************
-Calculates fast the number rounded up to the nearest power of 2. */
-UNIV_INLINE
-ulint
-ut_2_power_up(
-/*==========*/
- /* out: first power of 2 which is >= n */
- ulint n) /* in: number != 0 */
-{
- ulint res;
-
- res = 1;
-
- ut_ad(n > 0);
-
- while (res < n) {
- res = res * 2;
- }
-
- return(res);
-}
diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c
index b168ba41771..8c48180cf63 100644
--- a/innobase/lock/lock0lock.c
+++ b/innobase/lock/lock0lock.c
@@ -53,10 +53,9 @@ bump into an x-lock set there.
Different transaction can have conflicting locks set on the gap at the
same time. The locks on the gap are purely inhibitive: an insert cannot
-be made, or a select cursor may have to wait, if a different transaction
+be made, or a select cursor may have to wait if a different transaction
has a conflicting lock on the gap. An x-lock on the gap does not give
-the right to insert into the gap if there are conflicting locks granted
-on the gap at the same time.
+the right to insert into the gap.
An explicit lock can be placed on a user record or the supremum record of
a page. The locks on the supremum record are always thought to be of the gap
@@ -88,7 +87,7 @@ locks.
RULE 4: If a there is a waiting lock request in a queue, no lock request,
-------
gap or not, can be inserted ahead of it in the queue. In record deletes
-and page splits, new gap type locks can be created by the database manager
+and page splits new gap type locks can be created by the database manager
for a transaction, and without rule 4, the waits-for graph of transactions
might become cyclic without the database noticing it, as the deadlock check
is only performed when a transaction itself requests a lock!
@@ -96,7 +95,9 @@ is only performed when a transaction itself requests a lock!
An insert is allowed to a gap if there are no explicit lock requests by
other transactions on the next record. It does not matter if these lock
-requests are granted or waiting, gap bit set or not. On the other hand, an
+requests are granted or waiting, gap bit set or not, with the exception
+that a gap type request set by another transaction to wait for
+its turn to do an insert is ignored. On the other hand, an
implicit x-lock by another transaction does not prevent an insert, which
allows for more concurrency when using an Oracle-style sequence number
generator for the primary key with many transactions doing inserts
@@ -301,6 +302,11 @@ struct lock_struct{
} un_member;
};
+/* We store info on the latest deadlock error to this buffer. InnoDB
+Monitor will then fetch it and print */
+ibool lock_deadlock_found = FALSE;
+char* lock_latest_err_buf; /* We allocate 5000 bytes for this */
+
/************************************************************************
Checks if a lock request results in a deadlock. */
static
@@ -539,8 +545,7 @@ lock_sec_rec_cons_read_sees(
index record */
rec_t* rec, /* in: user record which should be read or
passed over by a read cursor */
- dict_index_t* index __attribute__((unused)),
- /* in: non-clustered index */
+ dict_index_t* index, /* in: non-clustered index */
read_view_t* view) /* in: consistent read view */
{
dulint max_trx_id;
@@ -576,6 +581,8 @@ lock_sys_create(
lock_sys->rec_hash = hash_create(n_cells);
/* hash_create_mutexes(lock_sys->rec_hash, 2, SYNC_REC_LOCK); */
+
+ lock_latest_err_buf = mem_alloc(5000);
}
/*************************************************************************
@@ -609,7 +616,7 @@ UNIV_INLINE
ulint
lock_get_type(
/*==========*/
- /* out: LOCK_TABLE or LOCK_RECa */
+ /* out: LOCK_TABLE or LOCK_REC */
lock_t* lock) /* in: lock */
{
ut_ad(lock);
@@ -711,6 +718,46 @@ lock_rec_set_gap(
}
/*************************************************************************
+Gets the waiting insert flag of a record lock. */
+UNIV_INLINE
+ibool
+lock_rec_get_insert_intention(
+/*==========================*/
+ /* out: TRUE if gap flag set */
+ lock_t* lock) /* in: record lock */
+{
+ ut_ad(lock);
+ ut_ad(lock_get_type(lock) == LOCK_REC);
+
+ if (lock->type_mode & LOCK_INSERT_INTENTION) {
+
+ return(TRUE);
+ }
+
+ return(FALSE);
+}
+
+/*************************************************************************
+Sets the waiting insert flag of a record lock. */
+UNIV_INLINE
+void
+lock_rec_set_insert_intention(
+/*==========================*/
+ lock_t* lock, /* in: record lock */
+ ibool val) /* in: value to set: TRUE or FALSE */
+{
+ ut_ad(lock);
+ ut_ad((val == TRUE) || (val == FALSE));
+ ut_ad(lock_get_type(lock) == LOCK_REC);
+
+ if (val) {
+ lock->type_mode = lock->type_mode | LOCK_INSERT_INTENTION;
+ } else {
+ lock->type_mode = lock->type_mode & ~LOCK_INSERT_INTENTION;
+ }
+}
+
+/*************************************************************************
Calculates if lock mode 1 is stronger or equal to lock mode 2. */
UNIV_INLINE
ibool
@@ -791,40 +838,93 @@ lock_mode_compatible(
}
/*************************************************************************
-Returns LOCK_X if mode is LOCK_S, and vice versa. */
+Checks if a lock request for a new lock has to wait for request lock2. */
UNIV_INLINE
-ulint
-lock_get_confl_mode(
-/*================*/
- /* out: conflicting basic lock mode */
- ulint mode) /* in: LOCK_S or LOCK_X */
+ibool
+lock_rec_has_to_wait(
+/*=================*/
+ /* out: TRUE if new lock has to wait for lock2 to be
+ removed */
+ trx_t* trx, /* in: trx of new lock */
+ ulint mode, /* in: LOCK_S or LOCK_X */
+ ulint gap, /* in: LOCK_GAP or 0 */
+ ulint insert_intention,
+ /* in: LOCK_INSERT_INTENTION or 0 */
+ lock_t* lock2) /* in: another record lock; NOTE that it is assumed
+ that this has a lock bit set on the same record as
+ in lock1 */
{
- ut_ad(mode == LOCK_X || mode == LOCK_S);
+ ut_ad(trx && lock2);
+ ut_ad(lock_get_type(lock2) == LOCK_REC);
+ ut_ad(mode == LOCK_S || mode == LOCK_X);
+ ut_ad(gap == LOCK_GAP || gap == 0);
+ ut_ad(insert_intention == LOCK_INSERT_INTENTION
+ || insert_intention == 0);
+
+ if (trx != lock2->trx && !lock_mode_compatible(mode,
+ lock_get_mode(lock2))) {
+
+ /* We have somewhat complex rules when gap type
+ record locks cause waits */
- if (mode == LOCK_S) {
+ if (!gap && lock_rec_get_insert_intention(lock2)) {
- return(LOCK_X);
+ /* Request of a full next-key record does not
+ need to wait for an insert intention lock to be
+ removed. This is ok since our rules allow conflicting
+ locks on gaps. This eliminates a spurious deadlock
+ caused by a next-key lock waiting for an insert
+ intention lock; when the insert intention lock was
+ granted, the insert deadlocked on the waiting
+ next-key lock. */
+
+ return(FALSE);
+ }
+
+ if (insert_intention && lock_rec_get_insert_intention(lock2)) {
+
+ /* An insert intention is not disturbed by another
+ insert intention; this removes a spurious deadlock
+ caused by inserts which had to wait for a next-key
+ lock to be removed */
+
+ return(FALSE);
+ }
+
+ return(TRUE);
}
- return(LOCK_S);
+ return(FALSE);
}
/*************************************************************************
-Checks if a lock request lock1 has to wait for request lock2. NOTE that we,
-for simplicity, ignore the gap bits in locks, and treat gap type lock
-requests like non-gap lock requests. */
-UNIV_INLINE
+Checks if a lock request lock1 has to wait for request lock2. */
+static
ibool
lock_has_to_wait(
/*=============*/
- /* out: TRUE if lock1 has to wait lock2 to be removed */
- lock_t* lock1, /* in: waiting record lock */
+ /* out: TRUE if lock1 has to wait for lock2 to be
+ removed */
+ lock_t* lock1, /* in: waiting lock */
lock_t* lock2) /* in: another lock; NOTE that it is assumed that this
- has a lock bit set on the same record as in lock1 */
+ has a lock bit set on the same record as in lock1 if
+ the locks are record locks */
{
+ ut_ad(lock1 && lock2);
+
if (lock1->trx != lock2->trx
&& !lock_mode_compatible(lock_get_mode(lock1),
lock_get_mode(lock2))) {
+ if (lock_get_type(lock1) == LOCK_REC) {
+ ut_ad(lock_get_type(lock2) == LOCK_REC);
+
+ return(lock_rec_has_to_wait(lock1->trx,
+ lock_get_mode(lock1),
+ lock_rec_get_gap(lock1),
+ lock_rec_get_insert_intention(lock1),
+ lock2));
+ }
+
return(TRUE);
}
@@ -973,6 +1073,7 @@ lock_rec_get_next_on_page(
ulint page_no;
ut_ad(mutex_own(&kernel_mutex));
+ ut_ad(lock_get_type(lock) == LOCK_REC);
space = lock->un_member.rec_lock.space;
page_no = lock->un_member.rec_lock.page_no;
@@ -1099,6 +1200,7 @@ lock_rec_get_next(
lock_t* lock) /* in: lock */
{
ut_ad(mutex_own(&kernel_mutex));
+ ut_ad(lock_get_type(lock) == LOCK_REC);
for (;;) {
lock = lock_rec_get_next_on_page(lock);
@@ -1156,6 +1258,8 @@ lock_rec_bitmap_reset(
ulint n_bytes;
ulint i;
+ ut_ad(lock_get_type(lock) == LOCK_REC);
+
/* Reset to zero the bitmap which resides immediately after the lock
struct */
@@ -1185,6 +1289,8 @@ lock_rec_copy(
lock_t* dupl_lock;
ulint size;
+ ut_ad(lock_get_type(lock) == LOCK_REC);
+
size = sizeof(lock_t) + lock_rec_get_n_bits(lock) / 8;
dupl_lock = mem_heap_alloc(heap, size);
@@ -1278,8 +1384,10 @@ lock_table_has(
/*============= FUNCTIONS FOR ANALYZING RECORD LOCK QUEUE ================*/
/*************************************************************************
-Checks if a transaction has a GRANTED explicit non-gap lock on rec, stronger
-or equal to mode. */
+Checks if a transaction has a GRANTED explicit lock on rec, where the gap
+flag or the insert intention flag is not set, stronger or equal to mode.
+Note that locks on the supremum of a page are a special case here, since
+they are always gap type locks, even if the gap flag is not set in them. */
UNIV_INLINE
lock_t*
lock_rec_has_expl(
@@ -1300,8 +1408,9 @@ lock_rec_has_expl(
if (lock->trx == trx
&& lock_mode_stronger_or_eq(lock_get_mode(lock), mode)
&& !lock_get_wait(lock)
- && !(lock_rec_get_gap(lock)
- || page_rec_is_supremum(rec))) {
+ && !lock_rec_get_insert_intention(lock)
+ && !lock_rec_get_gap(lock)) {
+
return(lock);
}
@@ -1312,9 +1421,8 @@ lock_rec_has_expl(
}
/*************************************************************************
-Checks if some other transaction has an explicit lock request stronger or
-equal to mode on rec or gap, waiting or granted, in the lock queue. */
-UNIV_INLINE
+Checks if some other transaction has a lock request in the queue. */
+static
lock_t*
lock_rec_other_has_expl_req(
/*========================*/
@@ -1325,13 +1433,15 @@ lock_rec_other_has_expl_req(
ulint wait, /* in: LOCK_WAIT if also waiting locks are
taken into account, or 0 if not */
rec_t* rec, /* in: record to look at */
- trx_t* trx) /* in: transaction, or NULL if requests
- by any transaction are wanted */
+ trx_t* trx) /* in: transaction, or NULL if requests by all
+ transactions are taken into account */
{
lock_t* lock;
ut_ad(mutex_own(&kernel_mutex));
- ut_ad((mode == LOCK_X) || (mode == LOCK_S));
+ ut_ad(mode == LOCK_X || mode == LOCK_S);
+ ut_ad(gap == 0 || gap == LOCK_GAP);
+ ut_ad(wait == 0 || wait == LOCK_WAIT);
lock = lock_rec_get_first(rec);
@@ -1352,6 +1462,44 @@ lock_rec_other_has_expl_req(
}
/*************************************************************************
+Checks if some other transaction has a conflicting explicit lock request
+in the queue, so that we have to wait. */
+static
+lock_t*
+lock_rec_other_has_conflicting(
+/*===========================*/
+ /* out: lock or NULL */
+ ulint mode, /* in: lock mode of the lock we are going to reserve */
+ ulint gap, /* in: LOCK_GAP if we are going to reserve a gap type
+ lock, else 0 */
+ ulint insert_intention,
+ /* in: LOCK_INSERT_INTENTION if we are going to
+ reserve an insert intention lock */
+ rec_t* rec, /* in: record to look at */
+ trx_t* trx) /* in: our transaction */
+{
+ lock_t* lock;
+
+ ut_ad(mutex_own(&kernel_mutex));
+ ut_ad(mode == LOCK_X || mode == LOCK_S);
+ ut_ad(gap == 0 || gap == LOCK_GAP);
+ ut_ad(insert_intention == LOCK_INSERT_INTENTION
+ || insert_intention == 0);
+ lock = lock_rec_get_first(rec);
+
+ while (lock) {
+ if (lock_rec_has_to_wait(trx, mode, gap, insert_intention,
+ lock)) {
+ return(lock);
+ }
+
+ lock = lock_rec_get_next(rec, lock);
+ }
+
+ return(NULL);
+}
+
+/*************************************************************************
Looks for a suitable type record lock struct by the same trx on the same page.
This can be used to save space when a new record lock should be set on a page:
no new struct is needed, if a suitable old is found. */
@@ -1519,7 +1667,10 @@ lock_rec_enqueue_waiting(
DB_QUE_THR_SUSPENDED */
ulint type_mode,/* in: lock mode this transaction is
requesting: LOCK_S or LOCK_X, ORed with
- LOCK_GAP if a gap lock is requested */
+ LOCK_GAP if a gap lock is requested, ORed
+ with LOCK_INSERT_INTENTION if this waiting
+ lock request is set when performing an
+ insert of an index record */
rec_t* rec, /* in: record */
dict_index_t* index, /* in: index of record */
que_thr_t* thr) /* in: query thread */
@@ -1542,6 +1693,15 @@ lock_rec_enqueue_waiting(
trx = thr_get_trx(thr);
+ if (trx->dict_operation) {
+ ut_print_timestamp(stderr);
+
+ fprintf(stderr,
+" InnoDB: Error: a record lock wait happens in a dictionary operation!\n"
+"InnoDB: Table name %s. Send a bug report to mysql@lists.mysql.com\n",
+index->table_name);
+ }
+
/* Enqueue the lock request that will wait to be granted */
lock = lock_rec_create(type_mode | LOCK_WAIT, rec, index, trx);
@@ -1557,6 +1717,7 @@ lock_rec_enqueue_waiting(
}
trx->que_state = TRX_QUE_LOCK_WAIT;
+ trx->wait_started = time(NULL);
ut_a(que_thr_stop(thr));
@@ -1596,11 +1757,12 @@ lock_rec_add_to_queue(
ut_ad(mutex_own(&kernel_mutex));
ut_ad((type_mode & (LOCK_WAIT | LOCK_GAP))
|| ((type_mode & LOCK_MODE_MASK) != LOCK_S)
- || !lock_rec_other_has_expl_req(LOCK_X, 0, LOCK_WAIT, rec, trx));
+ || !lock_rec_other_has_expl_req(LOCK_X, 0, LOCK_WAIT,
+ rec, trx));
ut_ad((type_mode & (LOCK_WAIT | LOCK_GAP))
|| ((type_mode & LOCK_MODE_MASK) != LOCK_X)
- || !lock_rec_other_has_expl_req(LOCK_S, 0, LOCK_WAIT, rec, trx));
-
+ || !lock_rec_other_has_expl_req(LOCK_S, 0, LOCK_WAIT,
+ rec, trx));
type_mode = type_mode | LOCK_REC;
page = buf_frame_align(rec);
@@ -1648,7 +1810,8 @@ This is a fast routine for locking a record in the most common cases:
there are no explicit locks on the page, or there is just one lock, owned
by this transaction, and of the right type_mode. This is a low-level function
which does NOT look at implicit locks! Checks lock compatibility within
-explicit locks. */
+explicit locks. This function sets a normal next-key lock, or in the case of
+a page supremum record, a gap type lock. */
UNIV_INLINE
ibool
lock_rec_lock_fast(
@@ -1701,7 +1864,8 @@ lock_rec_lock_fast(
/*************************************************************************
This is the general, and slower, routine for locking a record. This is a
low-level function which does NOT look at implicit locks! Checks lock
-compatibility within explicit locks. */
+compatibility within explicit locks. This function sets a normal next-key
+lock, or in the case of a page supremum record, a gap type lock. */
static
ulint
lock_rec_lock_slow(
@@ -1716,7 +1880,6 @@ lock_rec_lock_slow(
dict_index_t* index, /* in: index of record */
que_thr_t* thr) /* in: query thread */
{
- ulint confl_mode;
trx_t* trx;
ulint err;
@@ -1724,7 +1887,6 @@ lock_rec_lock_slow(
ut_ad((mode == LOCK_X) || (mode == LOCK_S));
trx = thr_get_trx(thr);
- confl_mode = lock_get_confl_mode(mode);
ut_ad((mode != LOCK_S) || lock_table_has(trx, index->table,
LOCK_IS));
@@ -1735,8 +1897,8 @@ lock_rec_lock_slow(
nothing */
err = DB_SUCCESS;
- } else if (lock_rec_other_has_expl_req(confl_mode, 0, LOCK_WAIT, rec,
- trx)) {
+ } else if (lock_rec_other_has_conflicting(mode, 0, 0, rec, trx)) {
+
/* If another transaction has a non-gap conflicting request in
the queue, as this transaction does not have a lock strong
enough already granted on the record, we have to wait. */
@@ -1760,7 +1922,8 @@ lock_rec_lock_slow(
Tries to lock the specified record in the mode requested. If not immediately
possible, enqueues a waiting lock request. This is a low-level function
which does NOT look at implicit locks! Checks lock compatibility within
-explicit locks. */
+explicit locks. This function sets a normal next-key lock, or in the case
+of a page supremum record, a gap type lock. */
ulint
lock_rec_lock(
@@ -1797,9 +1960,7 @@ lock_rec_lock(
}
/*************************************************************************
-Checks if a waiting record lock request still has to wait in a queue.
-NOTE that we, for simplicity, ignore the gap bits in locks, and treat
-gap type lock requests like non-gap lock requests. */
+Checks if a waiting record lock request still has to wait in a queue. */
static
ibool
lock_rec_has_to_wait_in_queue(
@@ -1814,6 +1975,7 @@ lock_rec_has_to_wait_in_queue(
ut_ad(mutex_own(&kernel_mutex));
ut_ad(lock_get_wait(wait_lock));
+ ut_ad(lock_get_type(wait_lock) == LOCK_REC);
space = wait_lock->un_member.rec_lock.space;
page_no = wait_lock->un_member.rec_lock.page_no;
@@ -1823,8 +1985,8 @@ lock_rec_has_to_wait_in_queue(
while (lock != wait_lock) {
- if (lock_has_to_wait(wait_lock, lock)
- && lock_rec_get_nth_bit(lock, heap_no)) {
+ if (lock_rec_get_nth_bit(lock, heap_no)
+ && lock_has_to_wait(wait_lock, lock)) {
return(TRUE);
}
@@ -1867,6 +2029,7 @@ lock_rec_cancel(
lock_t* lock) /* in: waiting record lock request */
{
ut_ad(mutex_own(&kernel_mutex));
+ ut_ad(lock_get_type(lock) == LOCK_REC);
/* Reset the bit (there can be only one set bit) in the lock bitmap */
lock_rec_reset_nth_bit(lock, lock_rec_find_set_bit(lock));
@@ -2039,7 +2202,8 @@ lock_rec_inherit_to_gap(
lock = lock_rec_get_first(rec);
while (lock != NULL) {
- lock_rec_add_to_queue((lock->type_mode | LOCK_GAP) & ~LOCK_WAIT,
+ lock_rec_add_to_queue(((lock->type_mode | LOCK_GAP)
+ & ~LOCK_WAIT),
heir, lock->index, lock->trx);
lock = lock_rec_get_next(rec, lock);
}
@@ -2295,7 +2459,7 @@ list start is moved to another page. */
void
lock_move_rec_list_start(
/*=====================*/
- page_t* new_page __attribute__((unused)),/*in: index page to move to */
+ page_t* new_page, /* in: index page to move to */
page_t* page, /* in: index page */
rec_t* rec, /* in: record on page: this is the
first record NOT copied */
@@ -2689,6 +2853,7 @@ lock_deadlock_occurs(
trx_t* mark_trx;
ibool ret;
ulint cost = 0;
+ char* err_buf;
ut_ad(trx && lock);
ut_ad(mutex_own(&kernel_mutex));
@@ -2714,6 +2879,31 @@ lock_deadlock_occurs(
index = lock->index;
table = index->table;
}
+
+ lock_deadlock_found = TRUE;
+
+ err_buf = lock_latest_err_buf + strlen(lock_latest_err_buf);
+
+ err_buf += sprintf(err_buf,
+ "*** (2) WAITING FOR THIS LOCK TO BE GRANTED:\n");
+
+ ut_a(err_buf <= lock_latest_err_buf + 4000);
+
+ if (lock_get_type(lock) == LOCK_REC) {
+ lock_rec_print(err_buf, lock);
+ err_buf += strlen(err_buf);
+ } else {
+ lock_table_print(err_buf, lock);
+ err_buf += strlen(err_buf);
+ }
+
+ ut_a(err_buf <= lock_latest_err_buf + 4000);
+
+ err_buf += sprintf(err_buf,
+ "*** WE ROLL BACK TRANSACTION (2)\n");
+
+ ut_a(strlen(lock_latest_err_buf) < 4100);
+
/*
sess_raise_error_low(trx, DB_DEADLOCK, lock->type_mode, table,
index, NULL, NULL, NULL);
@@ -2739,8 +2929,9 @@ lock_deadlock_recursive(
we return TRUE */
{
lock_t* lock;
- ulint bit_no = 0; /* remove warning */
+ ulint bit_no;
trx_t* lock_trx;
+ char* err_buf;
ut_a(trx && start && wait_lock);
ut_ad(mutex_own(&kernel_mutex));
@@ -2792,6 +2983,53 @@ lock_deadlock_recursive(
lock_trx = lock->trx;
if (lock_trx == start) {
+ err_buf = lock_latest_err_buf;
+
+ ut_sprintf_timestamp(err_buf);
+ err_buf += strlen(err_buf);
+
+ err_buf += sprintf(err_buf,
+ " LATEST DETECTED DEADLOCK:\n"
+ "*** (1) TRANSACTION:\n");
+
+ trx_print(err_buf, wait_lock->trx);
+ err_buf += strlen(err_buf);
+
+ err_buf += sprintf(err_buf,
+ "*** (1) WAITING FOR THIS LOCK TO BE GRANTED:\n");
+
+ ut_a(err_buf <= lock_latest_err_buf + 4000);
+
+ if (lock_get_type(wait_lock) == LOCK_REC) {
+ lock_rec_print(err_buf, wait_lock);
+ err_buf += strlen(err_buf);
+ } else {
+ lock_table_print(err_buf, wait_lock);
+ err_buf += strlen(err_buf);
+ }
+
+ ut_a(err_buf <= lock_latest_err_buf + 4000);
+ err_buf += sprintf(err_buf,
+ "*** (2) TRANSACTION:\n");
+
+ trx_print(err_buf, lock->trx);
+ err_buf += strlen(err_buf);
+
+ err_buf += sprintf(err_buf,
+ "*** (2) HOLDS THE LOCK(S):\n");
+
+ ut_a(err_buf <= lock_latest_err_buf + 4000);
+
+ if (lock_get_type(lock) == LOCK_REC) {
+ lock_rec_print(err_buf, lock);
+ err_buf += strlen(err_buf);
+ } else {
+ lock_table_print(err_buf, lock);
+ err_buf += strlen(err_buf);
+ }
+
+ ut_a(err_buf <= lock_latest_err_buf + 4000);
+
if (lock_print_waits) {
printf("Deadlock detected\n");
}
@@ -2915,7 +3153,7 @@ lock_table_enqueue_waiting(
trx_t* trx;
ut_ad(mutex_own(&kernel_mutex));
-
+
/* Test if there already is some other reason to suspend thread:
we do not enqueue a lock request if the query thread should be
stopped anyway */
@@ -2927,6 +3165,15 @@ lock_table_enqueue_waiting(
}
trx = thr_get_trx(thr);
+
+ if (trx->dict_operation) {
+ ut_print_timestamp(stderr);
+
+ fprintf(stderr,
+" InnoDB: Error: a table lock wait happens in a dictionary operation!\n"
+"InnoDB: Table name %s. Send a bug report to mysql@lists.mysql.com\n",
+table->name);
+ }
/* Enqueue the lock request that will wait to be granted */
@@ -2944,6 +3191,7 @@ lock_table_enqueue_waiting(
}
trx->que_state = TRX_QUE_LOCK_WAIT;
+ trx->wait_started = time(NULL);
ut_a(que_thr_stop(thr));
@@ -3309,34 +3557,37 @@ Prints info of a table lock. */
void
lock_table_print(
/*=============*/
+ char* buf, /* in/out: buffer where to print, must be at least
+ 500 bytes */
lock_t* lock) /* in: table type lock */
{
ut_ad(mutex_own(&kernel_mutex));
ut_a(lock_get_type(lock) == LOCK_TABLE);
- printf("TABLE LOCK table %s trx id %lu %lu",
+ buf += sprintf(buf, "TABLE LOCK table %s trx id %lu %lu",
lock->un_member.tab_lock.table->name,
(lock->trx)->id.high, (lock->trx)->id.low);
if (lock_get_mode(lock) == LOCK_S) {
- printf(" lock mode S");
+ buf += sprintf(buf, " lock mode S");
} else if (lock_get_mode(lock) == LOCK_X) {
- printf(" lock_mode X");
+ buf += sprintf(buf, " lock_mode X");
} else if (lock_get_mode(lock) == LOCK_IS) {
- printf(" lock_mode IS");
+ buf += sprintf(buf, " lock_mode IS");
} else if (lock_get_mode(lock) == LOCK_IX) {
- printf(" lock_mode IX");
+ buf += sprintf(buf, " lock_mode IX");
} else if (lock_get_mode(lock) == LOCK_AUTO_INC) {
- printf(" lock_mode AUTO-INC");
+ buf += sprintf(buf, " lock_mode AUTO-INC");
} else {
- printf(" unknown lock_mode %lu", lock_get_mode(lock));
+ buf += sprintf(buf,
+ " unknown lock_mode %lu", lock_get_mode(lock));
}
if (lock_get_wait(lock)) {
- printf(" waiting");
+ buf += sprintf(buf, " waiting");
}
- printf("\n");
+ buf += sprintf(buf, "\n");
}
/*************************************************************************
@@ -3345,6 +3596,8 @@ Prints info of a record lock. */
void
lock_rec_print(
/*===========*/
+ char* buf, /* in/out: buffer where to print, must be at least
+ 500 bytes */
lock_t* lock) /* in: record type lock */
{
page_t* page;
@@ -3352,8 +3605,7 @@ lock_rec_print(
ulint page_no;
ulint i;
ulint count = 0;
- ulint len;
- char buf[200];
+ char* buf_start = buf;
mtr_t mtr;
ut_ad(mutex_own(&kernel_mutex));
@@ -3362,32 +3614,36 @@ lock_rec_print(
space = lock->un_member.rec_lock.space;
page_no = lock->un_member.rec_lock.page_no;
- printf("RECORD LOCKS space id %lu page no %lu n bits %lu",
+ buf += sprintf(buf, "RECORD LOCKS space id %lu page no %lu n bits %lu",
space, page_no, lock_rec_get_n_bits(lock));
- printf(" table %s index %s trx id %lu %lu",
+ buf += sprintf(buf, " table %s index %s trx id %lu %lu",
lock->index->table->name, lock->index->name,
(lock->trx)->id.high, (lock->trx)->id.low);
if (lock_get_mode(lock) == LOCK_S) {
- printf(" lock mode S");
+ buf += sprintf(buf, " lock mode S");
} else if (lock_get_mode(lock) == LOCK_X) {
- printf(" lock_mode X");
+ buf += sprintf(buf, " lock_mode X");
} else {
ut_error;
}
if (lock_rec_get_gap(lock)) {
- printf(" gap type lock");
+ buf += sprintf(buf, " gap type lock");
+ }
+
+ if (lock_rec_get_insert_intention(lock)) {
+ buf += sprintf(buf, " insert intention");
}
if (lock_get_wait(lock)) {
- printf(" waiting");
+ buf += sprintf(buf, " waiting");
}
mtr_start(&mtr);
- printf("\n");
+ buf += sprintf(buf, "\n");
/* If the page is not in the buffer pool, we cannot load it
because we have the kernel mutex and ibuf operations would
@@ -3398,6 +3654,15 @@ lock_rec_print(
IB__FILE__, __LINE__, &mtr);
if (page) {
page = buf_page_get_nowait(space, page_no, RW_S_LATCH, &mtr);
+
+ if (!page) {
+ /* Let us try to get an X-latch. If the current thread
+ is holding an X-latch on the page, we cannot get an
+ S-latch. */
+
+ page = buf_page_get_nowait(space, page_no, RW_X_LATCH,
+ &mtr);
+ }
}
if (page) {
@@ -3406,28 +3671,31 @@ lock_rec_print(
for (i = 0; i < lock_rec_get_n_bits(lock); i++) {
+ if (buf - buf_start > 300) {
+
+ buf += sprintf(buf,
+ "Suppressing further record lock prints for this page\n");
+
+ mtr_commit(&mtr);
+
+ return;
+ }
+
if (lock_rec_get_nth_bit(lock, i)) {
- printf("Record lock, heap no %lu ", i);
+ buf += sprintf(buf, "Record lock, heap no %lu ", i);
if (page) {
- len = rec_sprintf(buf, 190,
+ buf += rec_sprintf(buf, 120,
page_find_rec_with_heap_no(page, i));
- buf[len] = '\0';
- printf("%s", buf);
+ *buf = '\0';
}
- printf("\n");
+ buf += sprintf(buf, "\n");
count++;
}
-
- if (count >= 3) {
- printf(
- "3 LOCKS PRINTED FOR THIS TRX AND PAGE: SUPPRESSING FURTHER PRINTS\n");
- goto end_prints;
- }
}
-end_prints:
+
mtr_commit(&mtr);
}
@@ -3462,8 +3730,10 @@ lock_get_n_rec_locks(void)
Prints info of locks for all transactions. */
void
-lock_print_info(void)
-/*=================*/
+lock_print_info(
+/*============*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end)/* in: buffer end */
{
lock_t* lock;
trx_t* trx;
@@ -3476,11 +3746,15 @@ lock_print_info(void)
ulint i;
mtr_t mtr;
- printf("Trx id counter %lu %lu\n",
+ if (buf_end - buf < 600) {
+ return;
+ }
+
+ buf += sprintf(buf, "Trx id counter %lu %lu\n",
ut_dulint_get_high(trx_sys->max_trx_id),
ut_dulint_get_low(trx_sys->max_trx_id));
- printf(
+ buf += sprintf(buf,
"Purge done for trx's n:o < %lu %lu undo n:o < %lu %lu\n",
ut_dulint_get_high(purge_sys->purge_trx_no),
ut_dulint_get_low(purge_sys->purge_trx_no),
@@ -3489,17 +3763,40 @@ lock_print_info(void)
lock_mutex_enter_kernel();
- printf("Total number of lock structs in row lock hash table %lu\n",
+ buf += sprintf(buf,
+ "Total number of lock structs in row lock hash table %lu\n",
lock_get_n_rec_locks());
+ if (lock_deadlock_found) {
+
+ if ((ulint)(buf_end - buf)
+ < 100 + strlen(lock_latest_err_buf)) {
+
+ return;
+ }
+
+ buf += sprintf(buf, "%s", lock_latest_err_buf);
+ }
+
+ if (buf_end - buf < 600) {
+ return;
+ }
+
+ buf += sprintf(buf, "LIST OF TRANSACTIONS FOR EACH SESSION:\n");
/* First print info on non-active transactions */
trx = UT_LIST_GET_FIRST(trx_sys->mysql_trx_list);
while (trx) {
+ if (buf_end - buf < 900) {
+ return;
+ }
+
if (trx->conc_state == TRX_NOT_STARTED) {
- printf("---");
- trx_print(trx);
+ buf += sprintf(buf, "---");
+ trx_print(buf, trx);
+
+ buf += strlen(buf);
}
trx = UT_LIST_GET_NEXT(mysql_trx_list, trx);
@@ -3528,12 +3825,22 @@ loop:
return;
}
+ if (buf_end - buf < 900) {
+ return;
+ }
+
if (nth_lock == 0) {
- printf("---");
- trx_print(trx);
+ buf += sprintf(buf, "---");
+ trx_print(buf, trx);
+ buf += strlen(buf);
+
+ if (buf_end - buf < 500) {
+ return;
+ }
+
if (trx->read_view) {
- printf(
+ buf += sprintf(buf,
"Trx read view will not see trx with id >= %lu %lu, sees < %lu %lu\n",
ut_dulint_get_high(trx->read_view->low_limit_id),
ut_dulint_get_low(trx->read_view->low_limit_id),
@@ -3542,16 +3849,18 @@ loop:
}
if (trx->que_state == TRX_QUE_LOCK_WAIT) {
- printf(
- "------------------TRX IS WAITING FOR THE LOCK:\n");
+ buf += sprintf(buf,
+ "------- TRX HAS BEEN WAITING %lu SEC FOR THIS LOCK TO BE GRANTED:\n",
+ (ulint)difftime(time(NULL), trx->wait_started));
if (lock_get_type(trx->wait_lock) == LOCK_REC) {
- lock_rec_print(trx->wait_lock);
+ lock_rec_print(buf, trx->wait_lock);
} else {
- lock_table_print(trx->wait_lock);
+ lock_table_print(buf, trx->wait_lock);
}
- printf(
+ buf += strlen(buf);
+ buf += sprintf(buf,
"------------------\n");
}
}
@@ -3580,6 +3889,10 @@ loop:
goto loop;
}
+ if (buf_end - buf < 500) {
+ return;
+ }
+
if (lock_get_type(lock) == LOCK_REC) {
space = lock->un_member.rec_lock.space;
page_no = lock->un_member.rec_lock.page_no;
@@ -3600,19 +3913,21 @@ loop:
goto loop;
}
- lock_rec_print(lock);
+ lock_rec_print(buf, lock);
} else {
ut_ad(lock_get_type(lock) == LOCK_TABLE);
- lock_table_print(lock);
+ lock_table_print(buf, lock);
}
+ buf += strlen(buf);
+
load_page_first = TRUE;
nth_lock++;
if (nth_lock >= 10) {
- printf(
+ buf += sprintf(buf,
"10 LOCKS PRINTED FOR THIS TRX: SUPPRESSING FURTHER PRINTS\n");
nth_trx++;
@@ -3714,7 +4029,7 @@ lock_rec_queue_validate(
impl_trx = lock_clust_rec_some_has_impl(rec, index);
if (impl_trx && lock_rec_other_has_expl_req(LOCK_S, 0,
- LOCK_WAIT, rec, impl_trx)) {
+ LOCK_WAIT, rec, impl_trx)) {
ut_a(lock_rec_has_expl(LOCK_X, rec, impl_trx));
}
@@ -3729,7 +4044,7 @@ lock_rec_queue_validate(
impl_trx = lock_sec_rec_some_has_impl_off_kernel(rec, index);
if (impl_trx && lock_rec_other_has_expl_req(LOCK_S, 0,
- LOCK_WAIT, rec, impl_trx)) {
+ LOCK_WAIT, rec, impl_trx)) {
ut_a(lock_rec_has_expl(LOCK_X, rec, impl_trx));
}
@@ -3754,12 +4069,10 @@ lock_rec_queue_validate(
if (lock_get_mode(lock) == LOCK_S) {
ut_a(!lock_rec_other_has_expl_req(LOCK_X,
- 0, 0, rec,
- lock->trx));
+ 0, 0, rec, lock->trx));
} else {
ut_a(!lock_rec_other_has_expl_req(LOCK_S,
- 0, 0, rec,
- lock->trx));
+ 0, 0, rec, lock->trx));
}
} else if (lock_get_wait(lock) && !lock_rec_get_gap(lock)) {
@@ -3998,12 +4311,20 @@ lock_rec_insert_check_and_lock(
*inherit = TRUE;
/* If another transaction has an explicit lock request, gap or not,
- waiting or granted, on the successor, the insert has to wait */
-
- if (lock_rec_other_has_expl_req(LOCK_S, LOCK_GAP, LOCK_WAIT, next_rec,
- trx)) {
- err = lock_rec_enqueue_waiting(LOCK_X | LOCK_GAP, next_rec,
- index, thr);
+ waiting or granted, on the successor, the insert has to wait.
+
+ An exception is the case where the lock by the another transaction
+ is a gap type lock which it placed to wait for its turn to insert. We
+ do not consider that kind of a lock conflicting with our insert. This
+ eliminates an unnecessary deadlock which resulted when 2 transactions
+ had to wait for their insert. Both had waiting gap type lock requests
+ on the successor, which produced an unnecessary deadlock. */
+
+ if (lock_rec_other_has_conflicting(LOCK_X, LOCK_GAP,
+ LOCK_INSERT_INTENTION, next_rec, trx)) {
+ err = lock_rec_enqueue_waiting(LOCK_X | LOCK_GAP
+ | LOCK_INSERT_INTENTION,
+ next_rec, index, thr);
} else {
err = DB_SUCCESS;
}
diff --git a/innobase/log/log0log.c b/innobase/log/log0log.c
index 5ec1274d117..c798a08e2de 100644
--- a/innobase/log/log0log.c
+++ b/innobase/log/log0log.c
@@ -162,6 +162,8 @@ log_reserve_and_open(
ulint archived_lsn_age;
ulint count = 0;
ulint dummy;
+
+ ut_a(len < log->buf_size / 2);
loop:
mutex_enter(&(log->mutex));
@@ -268,7 +270,7 @@ part_loop:
log->lsn = ut_dulint_add(log->lsn, len);
- /* Initialize the next block header and trailer */
+ /* Initialize the next block header */
log_block_init(log_block + OS_FILE_LOG_BLOCK_SIZE, log->lsn);
} else {
log->lsn = ut_dulint_add(log->lsn, len);
@@ -663,6 +665,8 @@ log_init(void)
log_sys->buf_next_to_write = 0;
+ log_sys->flush_lsn = ut_dulint_zero;
+
log_sys->written_to_some_lsn = log_sys->lsn;
log_sys->written_to_all_lsn = log_sys->lsn;
@@ -777,9 +781,15 @@ log_group_init(
*(group->file_header_bufs + i) = ut_align(
mem_alloc(LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE),
OS_FILE_LOG_BLOCK_SIZE);
+
+ memset(*(group->file_header_bufs + i), '\0',
+ LOG_FILE_HDR_SIZE);
+
*(group->archive_file_header_bufs + i) = ut_align(
mem_alloc(LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE),
OS_FILE_LOG_BLOCK_SIZE);
+ memset(*(group->archive_file_header_bufs + i), '\0',
+ LOG_FILE_HDR_SIZE);
}
group->archive_space_id = archive_space_id;
@@ -791,6 +801,8 @@ log_group_init(
mem_alloc(2 * OS_FILE_LOG_BLOCK_SIZE),
OS_FILE_LOG_BLOCK_SIZE);
+ memset(group->checkpoint_buf, '\0', OS_FILE_LOG_BLOCK_SIZE);
+
UT_LIST_ADD_LAST(log_groups, log_sys->log_groups, group);
ut_a(log_calc_max_ages());
@@ -839,7 +851,7 @@ log_group_check_flush_completion(
{
ut_ad(mutex_own(&(log_sys->mutex)));
- if (!log_sys->one_flushed && (group->n_pending_writes == 0)) {
+ if (!log_sys->one_flushed && group->n_pending_writes == 0) {
if (log_debug_writes) {
printf("Log flushed first to group %lu\n", group->id);
@@ -933,16 +945,20 @@ log_io_complete(
return;
}
+ ut_a(0); /* We currently use synchronous writing of the
+ logs and cannot end up here! */
+
if (srv_unix_file_flush_method != SRV_UNIX_O_DSYNC
- && srv_unix_file_flush_method != SRV_UNIX_NOSYNC) {
+ && srv_unix_file_flush_method != SRV_UNIX_NOSYNC
+ && srv_flush_log_at_trx_commit != 2) {
fil_flush(group->space_id);
}
mutex_enter(&(log_sys->mutex));
- ut_ad(group->n_pending_writes > 0);
- ut_ad(log_sys->n_pending_writes > 0);
+ ut_a(group->n_pending_writes > 0);
+ ut_a(log_sys->n_pending_writes > 0);
group->n_pending_writes--;
log_sys->n_pending_writes--;
@@ -956,6 +972,57 @@ log_io_complete(
}
/**********************************************************
+Flushes the log files to the disk, using, for example, the Unix fsync.
+This function does the flush even if the user has set
+srv_flush_log_at_trx_commit = FALSE. */
+
+void
+log_flush_to_disk(void)
+/*===================*/
+{
+ log_group_t* group;
+loop:
+ mutex_enter(&(log_sys->mutex));
+
+ if (log_sys->n_pending_writes > 0) {
+ /* A log file write is running */
+
+ mutex_exit(&(log_sys->mutex));
+
+ /* Wait for the log file write to complete and try again */
+
+ os_event_wait(log_sys->no_flush_event);
+
+ goto loop;
+ }
+
+ group = UT_LIST_GET_FIRST(log_sys->log_groups);
+
+ log_sys->n_pending_writes++;
+ group->n_pending_writes++;
+
+ os_event_reset(log_sys->no_flush_event);
+ os_event_reset(log_sys->one_flushed_event);
+
+ mutex_exit(&(log_sys->mutex));
+
+ fil_flush(group->space_id);
+
+ mutex_enter(&(log_sys->mutex));
+
+ ut_a(group->n_pending_writes == 1);
+ ut_a(log_sys->n_pending_writes == 1);
+
+ group->n_pending_writes--;
+ log_sys->n_pending_writes--;
+
+ os_event_set(log_sys->no_flush_event);
+ os_event_set(log_sys->one_flushed_event);
+
+ mutex_exit(&(log_sys->mutex));
+}
+
+/**********************************************************
Writes a log file header to a log file space. */
static
void
@@ -970,7 +1037,6 @@ log_group_file_header_flush(
{
byte* buf;
ulint dest_offset;
- ibool sync;
ut_ad(mutex_own(&(log_sys->mutex)));
@@ -981,15 +1047,11 @@ log_group_file_header_flush(
mach_write_to_4(buf + LOG_GROUP_ID, group->id);
mach_write_to_8(buf + LOG_FILE_START_LSN, start_lsn);
- dest_offset = nth_file * group->file_size;
-
- sync = FALSE;
+ /* Wipe over possible label of ibbackup --restore */
+ memcpy(buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP, " ", 4);
- if (type == LOG_RECOVER) {
+ dest_offset = nth_file * group->file_size;
- sync = TRUE;
- }
-
if (log_debug_writes) {
printf(
"Writing log file header to group %lu file %lu\n", group->id,
@@ -997,14 +1059,9 @@ log_group_file_header_flush(
}
if (log_do_write) {
- if (type == LOG_FLUSH) {
- log_sys->n_pending_writes++;
- group->n_pending_writes++;
- }
-
log_sys->n_log_ios++;
- fil_io(OS_FILE_WRITE | OS_FILE_LOG, sync, group->space_id,
+ fil_io(OS_FILE_WRITE | OS_FILE_LOG, TRUE, group->space_id,
dest_offset / UNIV_PAGE_SIZE,
dest_offset % UNIV_PAGE_SIZE,
OS_FILE_LOG_BLOCK_SIZE,
@@ -1013,6 +1070,19 @@ log_group_file_header_flush(
}
/**********************************************************
+Stores a 4-byte checksum to the trailer checksum field of a log block
+before writing it to a log file. This checksum is used in recovery to
+check the consistency of a log block. */
+static
+void
+log_block_store_checksum(
+/*=====================*/
+ byte* block) /* in/out: pointer to a log block */
+{
+ log_block_set_checksum(block, log_block_calc_checksum(block));
+}
+
+/**********************************************************
Writes a buffer to a log file group. */
void
@@ -1032,20 +1102,13 @@ log_group_write_buf(
header */
{
ulint write_len;
- ibool sync;
ibool write_header;
ulint next_offset;
+ ulint i;
ut_ad(mutex_own(&(log_sys->mutex)));
- ut_ad(len % OS_FILE_LOG_BLOCK_SIZE == 0);
- ut_ad(ut_dulint_get_low(start_lsn) % OS_FILE_LOG_BLOCK_SIZE == 0);
-
- sync = FALSE;
-
- if (type == LOG_RECOVER) {
-
- sync = TRUE;
- }
+ ut_a(len % OS_FILE_LOG_BLOCK_SIZE == 0);
+ ut_a(ut_dulint_get_low(start_lsn) % OS_FILE_LOG_BLOCK_SIZE == 0);
if (new_data_offset == 0) {
write_header = TRUE;
@@ -1076,7 +1139,6 @@ loop:
}
if (log_debug_writes) {
- ulint i;
printf(
"Writing log file segment to group %lu offset %lu len %lu\n"
@@ -1100,15 +1162,17 @@ loop:
}
}
- if (log_do_write) {
- if (type == LOG_FLUSH) {
- log_sys->n_pending_writes++;
- group->n_pending_writes++;
- }
+ /* Calculate the checksums for each log block and write them to
+ the trailer fields of the log blocks */
+
+ for (i = 0; i < write_len / OS_FILE_LOG_BLOCK_SIZE; i++) {
+ log_block_store_checksum(buf + i * OS_FILE_LOG_BLOCK_SIZE);
+ }
+ if (log_do_write) {
log_sys->n_log_ios++;
- fil_io(OS_FILE_WRITE | OS_FILE_LOG, sync, group->space_id,
+ fil_io(OS_FILE_WRITE | OS_FILE_LOG, TRUE, group->space_id,
next_offset / UNIV_PAGE_SIZE,
next_offset % UNIV_PAGE_SIZE, write_len, buf, group);
}
@@ -1126,15 +1190,15 @@ loop:
/**********************************************************
This function is called, e.g., when a transaction wants to commit. It checks
-that the log has been flushed to disk up to the last log entry written by the
-transaction. If there is a flush running, it waits and checks if the flush
-flushed enough. If not, starts a new flush. */
+that the log has been written to the log file up to the last log entry written
+by the transaction. If there is a flush running, it waits and checks if the
+flush flushed enough. If not, starts a new flush. */
void
log_flush_up_to(
/*============*/
dulint lsn, /* in: log sequence number up to which the log should
- be flushed, ut_dulint_max if not specified */
+ be written, ut_dulint_max if not specified */
ulint wait) /* in: LOG_NO_WAIT, LOG_WAIT_ONE_GROUP,
or LOG_WAIT_ALL_GROUPS */
{
@@ -1144,6 +1208,7 @@ log_flush_up_to(
ulint area_start;
ulint area_end;
ulint loop_count;
+ ulint unlock;
if (recv_no_ibuf_operations) {
/* Recovery is running and no operations on the log files are
@@ -1209,6 +1274,12 @@ loop:
ut_dulint_get_low(log_sys->lsn));
}
+ log_sys->n_pending_writes++;
+
+ group = UT_LIST_GET_FIRST(log_sys->log_groups);
+ group->n_pending_writes++; /* We assume here that we have only
+ one log group! */
+
os_event_reset(log_sys->no_flush_event);
os_event_reset(log_sys->one_flushed_event);
@@ -1254,6 +1325,36 @@ loop:
group = UT_LIST_GET_NEXT(log_groups, group);
}
+ mutex_exit(&(log_sys->mutex));
+
+ if (srv_unix_file_flush_method != SRV_UNIX_O_DSYNC
+ && srv_unix_file_flush_method != SRV_UNIX_NOSYNC
+ && srv_flush_log_at_trx_commit != 2) {
+
+ group = UT_LIST_GET_FIRST(log_sys->log_groups);
+
+ fil_flush(group->space_id);
+ }
+
+ mutex_enter(&(log_sys->mutex));
+
+ group = UT_LIST_GET_FIRST(log_sys->log_groups);
+
+ ut_a(group->n_pending_writes == 1);
+ ut_a(log_sys->n_pending_writes == 1);
+
+ group->n_pending_writes--;
+ log_sys->n_pending_writes--;
+
+ unlock = log_group_check_flush_completion(group);
+ unlock = unlock | log_sys_check_flush_completion();
+
+ log_flush_do_unlocks(unlock);
+
+ mutex_exit(&(log_sys->mutex));
+
+ return;
+
do_waits:
mutex_exit(&(log_sys->mutex));
@@ -1539,15 +1640,23 @@ log_reset_first_header_and_checkpoint(
/*==================================*/
byte* hdr_buf,/* in: buffer which will be written to the start
of the first log file */
- dulint lsn) /* in: lsn of the start of the first log file
- + LOG_BLOCK_HDR_SIZE */
+ dulint start) /* in: lsn of the start of the first log file;
+ we pretend that there is a checkpoint at
+ start + LOG_BLOCK_HDR_SIZE */
{
ulint fold;
byte* buf;
-
+ dulint lsn;
+
mach_write_to_4(hdr_buf + LOG_GROUP_ID, 0);
- mach_write_to_8(hdr_buf + LOG_FILE_START_LSN, lsn);
+ mach_write_to_8(hdr_buf + LOG_FILE_START_LSN, start);
+ lsn = ut_dulint_add(start, LOG_BLOCK_HDR_SIZE);
+
+ /* Write the label of ibbackup --restore */
+ sprintf(hdr_buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP, "ibbackup ");
+ ut_sprintf_timestamp(hdr_buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP
+ + strlen("ibbackup "));
buf = hdr_buf + LOG_CHECKPOINT_1;
mach_write_to_8(buf + LOG_CHECKPOINT_NO, ut_dulint_zero);
@@ -2965,15 +3074,22 @@ log_check_log_recs(
Prints info of the log. */
void
-log_print(void)
-/*===========*/
+log_print(
+/*======*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end)/* in: buffer end */
{
double time_elapsed;
time_t current_time;
+ if (buf_end - buf < 300) {
+
+ return;
+ }
+
mutex_enter(&(log_sys->mutex));
- printf("Log sequence number %lu %lu\n"
+ buf += sprintf(buf, "Log sequence number %lu %lu\n"
"Log flushed up to %lu %lu\n"
"Last checkpoint at %lu %lu\n",
ut_dulint_get_high(log_sys->lsn),
@@ -2985,9 +3101,9 @@ log_print(void)
current_time = time(NULL);
- time_elapsed = difftime(current_time, log_sys->last_printout_time);
-
- printf(
+ time_elapsed = 0.001 + difftime(current_time,
+ log_sys->last_printout_time);
+ buf += sprintf(buf,
"%lu pending log writes, %lu pending chkp writes\n"
"%lu log i/o's done, %.2f log i/o's/second\n",
log_sys->n_pending_writes,
@@ -3000,3 +3116,14 @@ log_print(void)
mutex_exit(&(log_sys->mutex));
}
+
+/**************************************************************************
+Refreshes the statistics used to print per-second averages. */
+
+void
+log_refresh_stats(void)
+/*===================*/
+{
+ log_sys->n_log_ios_old = log_sys->n_log_ios;
+ log_sys->last_printout_time = time(NULL);
+}
diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c
index c31719f7bb0..1223f9b6041 100644
--- a/innobase/log/log0recv.c
+++ b/innobase/log/log0recv.c
@@ -58,12 +58,16 @@ yet: the variable name is misleading */
ibool recv_no_ibuf_operations = FALSE;
-/* the following counter is used to decide when to print info on
+/* The following counter is used to decide when to print info on
log scan */
ulint recv_scan_print_counter = 0;
ibool recv_is_from_backup = FALSE;
+ibool recv_is_making_a_backup = FALSE;
+ulint recv_previous_parsed_rec_type = 999999;
+ulint recv_previous_parsed_rec_offset = 0;
+ulint recv_previous_parsed_rec_is_multi = 0;
/************************************************************
Creates the recovery system. */
@@ -124,6 +128,8 @@ recv_sys_init(
recv_sys->last_block = ut_align(recv_sys->last_block_buf_start,
OS_FILE_LOG_BLOCK_SIZE);
+ recv_sys->found_corrupt_log = FALSE;
+
mutex_exit(&(recv_sys->mutex));
}
@@ -568,6 +574,38 @@ recv_read_cp_info_for_backup(
return(TRUE);
}
+/**********************************************************
+Checks the 4-byte checksum to the trailer checksum field of a log block.
+We also accept a log block in the old format < InnoDB-3.23.52 where the
+checksum field contains the log block number. */
+static
+ibool
+log_block_checksum_is_ok_or_old_format(
+/*===================================*/
+ /* out: TRUE if ok, or if the log block may be in the
+ format of InnoDB version < 3.23.52 */
+ byte* block) /* in: pointer to a log block */
+{
+ if (log_block_calc_checksum(block) == log_block_get_checksum(block)) {
+
+ return(TRUE);
+ }
+
+ if (log_block_get_hdr_no(block) == log_block_get_checksum(block)) {
+
+ /* We assume the log block is in the format of
+ InnoDB version < 3.23.52 and the block is ok */
+/*
+ fprintf(stderr,
+"InnoDB: Scanned old format < InnoDB-3.23.52 log block number %lu\n",
+ log_block_get_hdr_no(block));
+*/
+ return(TRUE);
+ }
+
+ return(FALSE);
+}
+
/***********************************************************************
Scans the log segment and n_bytes_scanned is set to the length of valid
log scanned. */
@@ -598,24 +636,22 @@ recv_scan_log_seg_for_backup(
no = log_block_get_hdr_no(log_block);
- /* fprintf(stderr, "Log block header no %lu\n", no); */
-
- if (no != log_block_get_trl_no(log_block)
- || no != log_block_convert_lsn_to_no(*scanned_lsn)) {
+/* fprintf(stderr, "Log block header no %lu\n", no); */
-/* printf(
-"Log block n:o %lu, trailer n:o %lu, scanned lsn n:o %lu\n",
- no, log_block_get_trl_no(log_block),
- log_block_convert_lsn_to_no(*scanned_lsn));
+ if (no != log_block_convert_lsn_to_no(*scanned_lsn)
+ || !log_block_checksum_is_ok_or_old_format(log_block)) {
+/*
+ printf(
+"Log block n:o %lu, scanned lsn n:o %lu\n",
+ no, log_block_convert_lsn_to_no(*scanned_lsn));
*/
/* Garbage or an incompletely written log block */
log_block += OS_FILE_LOG_BLOCK_SIZE;
-
-/* printf(
-"Next log block n:o %lu, trailer n:o %lu\n",
- log_block_get_hdr_no(log_block),
- log_block_get_trl_no(log_block));
+/*
+ printf(
+"Next log block n:o %lu\n",
+ log_block_get_hdr_no(log_block));
*/
break;
}
@@ -629,11 +665,11 @@ recv_scan_log_seg_for_backup(
/* Garbage from a log buffer flush which was made
before the most recent database recovery */
-
+/*
printf("Scanned cp n:o %lu, block cp n:o %lu\n",
*scanned_checkpoint_no,
log_block_get_checkpoint_no(log_block));
-
+*/
break;
}
@@ -738,14 +774,8 @@ recv_parse_or_apply_log_rec_body(
new_ptr = mlog_parse_string(ptr, end_ptr, page);
} else {
new_ptr = NULL;
-
- fprintf(stderr,
- "InnoDB: WARNING: the log file may have been corrupt and it\n"
- "InnoDB: is possible that the log scan did not proceed\n"
- "InnoDB: far enough in recovery. Please run CHECK TABLE\n"
- "InnoDB: on your InnoDB tables to check that they are ok!\n"
- "InnoDB: Corrupt log record type %lu\n",
- (ulint)type);
+
+ recv_sys->found_corrupt_log = TRUE;
}
ut_ad(!page || new_ptr);
@@ -1011,7 +1041,7 @@ recv_recover_page(
page_lsn = page_newest_lsn;
}
} else {
- /* In recovery from a backup we do not use the buffer
+ /* In recovery from a backup we do not really use the buffer
pool */
page_newest_lsn = ut_dulint_zero;
@@ -1349,17 +1379,37 @@ recv_apply_log_recs_for_backup(
OS_FILE_OPEN,
OS_FILE_READ_WRITE,
&success);
- ut_a(success);
+ if (!success) {
+ printf(
+"InnoDB: Error: cannot open %lu'th data file %s\n", nth_file);
+
+ exit(1);
+ }
}
recv_addr = recv_get_fil_addr_struct(0, i);
if (recv_addr != NULL) {
- os_file_read(data_file, page,
+ success = os_file_read(data_file, page,
(nth_page_in_file << UNIV_PAGE_SIZE_SHIFT)
& 0xFFFFFFFF,
nth_page_in_file >> (32 - UNIV_PAGE_SIZE_SHIFT),
UNIV_PAGE_SIZE);
+ if (!success) {
+ printf(
+"InnoDB: Error: cannot read page no %lu from %lu'th data file %s\n",
+ nth_page_in_file, nth_file);
+
+ exit(1);
+ }
+
+ /* We simulate a page read made by the buffer pool,
+ to make sure recovery works ok. We must init the
+ block corresponding to buf_pool->frame_zero
+ (== page) */
+
+ buf_page_init_for_backup_restore(0, i,
+ buf_block_align(page));
recv_recover_page(TRUE, FALSE, page, 0, i);
@@ -1367,12 +1417,19 @@ recv_apply_log_recs_for_backup(
mach_read_from_8(page + FIL_PAGE_LSN),
0, i);
- os_file_write(data_files[nth_file],
+ success = os_file_write(data_files[nth_file],
data_file, page,
(nth_page_in_file << UNIV_PAGE_SIZE_SHIFT)
& 0xFFFFFFFF,
nth_page_in_file >> (32 - UNIV_PAGE_SIZE_SHIFT),
UNIV_PAGE_SIZE);
+ if (!success) {
+ printf(
+"InnoDB: Error: cannot write page no %lu to %lu'th data file %s\n",
+ nth_page_in_file, nth_file);
+
+ exit(1);
+ }
}
if ((100 * i) / n_pages_total
@@ -1621,29 +1678,16 @@ recv_parse_log_rec(
new_ptr = mlog_parse_initial_log_record(ptr, end_ptr, type, space,
page_no);
-
- /* If the operating system writes to the log complete 512-byte
- blocks, we should not get the warnings below in recovery.
- A warning means that the header and the trailer appeared ok
- in a 512-byte block, but in the middle there was something wrong.
- TODO: (1) add similar warnings in the case there is an incompletely
- written log record which does not extend to the boundary of a
- 512-byte block. (2) Add a checksum to a log block. */
-
if (!new_ptr) {
+
return(0);
}
/* Check that space id and page_no are sensible */
if (*space != 0 || *page_no > 0x8FFFFFFF) {
- fprintf(stderr,
- "InnoDB: WARNING: the log file may have been corrupt and it\n"
- "InnoDB: is possible that the log scan did not proceed\n"
- "InnoDB: far enough in recovery. Please run CHECK TABLE\n"
- "InnoDB: on your InnoDB tables to check that they are ok!\n"
- "InnoDB: Corrupt log record type %lu, space id %lu, page no %lu\n",
- (ulint)(*type), *space, *page_no);
+
+ recv_sys->found_corrupt_log = TRUE;
return(0);
}
@@ -1708,14 +1752,70 @@ recv_check_incomplete_log_recs(
}
/***********************************************************
+Prints diagnostic info of corrupt log. */
+static
+void
+recv_report_corrupt_log(
+/*====================*/
+ byte* ptr, /* in: pointer to corrupt log record */
+ byte type, /* in: type of the record */
+ ulint space, /* in: space id, this may also be garbage */
+ ulint page_no)/* in: page number, this may also be garbage */
+{
+ char* err_buf;
+
+ fprintf(stderr,
+"InnoDB: ############### CORRUPT LOG RECORD FOUND\n"
+"InnoDB: Log record type %lu, space id %lu, page number %lu\n"
+"InnoDB: Log parsing proceeded successfully up to %lu %lu\n",
+ (ulint)type, space, page_no,
+ ut_dulint_get_high(recv_sys->recovered_lsn),
+ ut_dulint_get_low(recv_sys->recovered_lsn));
+
+ err_buf = ut_malloc(1000000);
+
+ fprintf(stderr,
+"InnoDB: Previous log record type %lu, is multi %lu\n"
+"InnoDB: Recv offset %lu, prev %lu\n",
+ recv_previous_parsed_rec_type,
+ recv_previous_parsed_rec_is_multi,
+ ptr - recv_sys->buf,
+ recv_previous_parsed_rec_offset);
+
+ if ((ulint)(ptr - recv_sys->buf + 100)
+ > recv_previous_parsed_rec_offset
+ && (ulint)(ptr - recv_sys->buf + 100
+ - recv_previous_parsed_rec_offset)
+ < 200000) {
+
+ ut_sprintf_buf(err_buf,
+ recv_sys->buf + recv_previous_parsed_rec_offset - 100,
+ ptr - recv_sys->buf + 200 -
+ recv_previous_parsed_rec_offset);
+ fprintf(stderr,
+"InnoDB: Hex dump of corrupt log starting 100 bytes before the start\n"
+"InnoDB: of the previous log rec,\n"
+"InnoDB: and ending 100 bytes after the start of the corrupt rec:\n%s\n",
+ err_buf);
+ }
+
+ ut_free(err_buf);
+
+ fprintf(stderr,
+ "InnoDB: WARNING: the log file may have been corrupt and it\n"
+ "InnoDB: is possible that the log scan did not proceed\n"
+ "InnoDB: far enough in recovery! Please run CHECK TABLE\n"
+ "InnoDB: on your InnoDB tables to check that they are ok!\n");
+}
+
+/***********************************************************
Parses log records from a buffer and stores them to a hash table to wait
merging to file pages. */
static
ibool
recv_parse_log_recs(
/*================*/
- /* out: TRUE if the hash table of parsed log
- records became full */
+ /* out: currently always returns FALSE */
ibool store_to_hash) /* in: TRUE if the records should be stored
to the hash table; this is set to FALSE if just
debug checking is needed */
@@ -1754,8 +1854,13 @@ loop:
len = recv_parse_log_rec(ptr, end_ptr, &type, &space,
&page_no, &body);
- if (len == 0) {
+ if (len == 0 || recv_sys->found_corrupt_log) {
+ if (recv_sys->found_corrupt_log) {
+ recv_report_corrupt_log(ptr,
+ type, space, page_no);
+ }
+
return(FALSE);
}
@@ -1770,6 +1875,10 @@ loop:
return(FALSE);
}
+ recv_previous_parsed_rec_type = (ulint)type;
+ recv_previous_parsed_rec_offset = recv_sys->recovered_offset;
+ recv_previous_parsed_rec_is_multi = 0;
+
recv_sys->recovered_offset += len;
recv_sys->recovered_lsn = new_recovered_lsn;
@@ -1793,9 +1902,10 @@ loop:
#ifdef UNIV_LOG_DEBUG
recv_check_incomplete_log_recs(ptr, len);
#endif
- recv_update_replicate(type, space, page_no, body,
+/* recv_update_replicate(type, space, page_no, body,
ptr + len);
recv_compare_replicate(space, page_no);
+*/
}
} else {
/* Check that all the records associated with the single mtr
@@ -1807,19 +1917,32 @@ loop:
for (;;) {
len = recv_parse_log_rec(ptr, end_ptr, &type, &space,
&page_no, &body);
- if (len == 0) {
+ if (len == 0 || recv_sys->found_corrupt_log) {
- return(FALSE);
+ if (recv_sys->found_corrupt_log) {
+
+ recv_report_corrupt_log(ptr,
+ type, space, page_no);
+ }
+
+ return(FALSE);
}
+ recv_previous_parsed_rec_type = (ulint)type;
+ recv_previous_parsed_rec_offset
+ = recv_sys->recovered_offset + total_len;
+ recv_previous_parsed_rec_is_multi = 1;
+
if ((!store_to_hash) && (type != MLOG_MULTI_REC_END)) {
/* In debug checking, update a replicate page
according to the log record */
#ifdef UNIV_LOG_DEBUG
recv_check_incomplete_log_recs(ptr, len);
#endif
+/*
recv_update_replicate(type, space, page_no,
body, ptr + len);
+*/
}
if (log_debug_writes) {
@@ -1861,6 +1984,12 @@ loop:
old_lsn = recv_sys->recovered_lsn;
len = recv_parse_log_rec(ptr, end_ptr, &type, &space,
&page_no, &body);
+ if (recv_sys->found_corrupt_log) {
+
+ recv_report_corrupt_log(ptr,
+ type, space, page_no);
+ }
+
ut_a(len != 0);
ut_a(0 == ((ulint)*ptr & MLOG_SINGLE_REC_FLAG));
@@ -1883,7 +2012,7 @@ loop:
page has become identical with the original
page */
- recv_compare_replicate(space, page_no);
+/* recv_compare_replicate(space, page_no); */
}
ptr += len;
@@ -2037,8 +2166,20 @@ recv_scan_log_recs(
/* fprintf(stderr, "Log block header no %lu\n", no); */
- if (no != log_block_get_trl_no(log_block)
- || no != log_block_convert_lsn_to_no(scanned_lsn)) {
+ if (no != log_block_convert_lsn_to_no(scanned_lsn)
+ || !log_block_checksum_is_ok_or_old_format(log_block)) {
+
+ if (no == log_block_convert_lsn_to_no(scanned_lsn)
+ && !log_block_checksum_is_ok_or_old_format(
+ log_block)) {
+ fprintf(stderr,
+"InnoDB: Log block no %lu at lsn %lu %lu has\n"
+"InnoDB: ok header, but checksum field contains %lu, should be %lu\n",
+ no, ut_dulint_get_high(scanned_lsn),
+ ut_dulint_get_low(scanned_lsn),
+ log_block_get_checksum(log_block),
+ log_block_calc_checksum(log_block));
+ }
/* Garbage or an incompletely written log block */
@@ -2109,11 +2250,14 @@ recv_scan_log_recs(
>= RECV_PARSING_BUF_SIZE) {
fprintf(stderr,
"InnoDB: Error: log parsing buffer overflow. Recovery may have failed!\n");
- finished = TRUE;
+
+ recv_sys->found_corrupt_log = TRUE;
+
+ } else if (!recv_sys->found_corrupt_log) {
+ more_data = recv_sys_add_to_parsing_buf(
+ log_block, scanned_lsn);
}
- more_data = recv_sys_add_to_parsing_buf(log_block,
- scanned_lsn);
recv_sys->scanned_lsn = scanned_lsn;
recv_sys->scanned_checkpoint_no =
log_block_get_checkpoint_no(log_block);
@@ -2130,7 +2274,8 @@ recv_scan_log_recs(
*group_scanned_lsn = scanned_lsn;
- if (recv_needed_recovery || recv_is_from_backup) {
+ if (recv_needed_recovery
+ || (recv_is_from_backup && !recv_is_making_a_backup)) {
recv_scan_print_counter++;
if (finished || (recv_scan_print_counter % 80 == 0)) {
@@ -2142,7 +2287,7 @@ recv_scan_log_recs(
}
}
- if (more_data) {
+ if (more_data && !recv_sys->found_corrupt_log) {
/* Try to parse more log records */
recv_parse_log_recs(store_to_hash);
@@ -2241,6 +2386,7 @@ recv_recovery_from_checkpoint_start(
dulint archived_lsn;
ulint capacity;
byte* buf;
+ byte log_hdr_buf[LOG_FILE_HDR_SIZE];
ulint err;
ut_ad((type != LOG_CHECKPOINT)
@@ -2288,6 +2434,33 @@ recv_recovery_from_checkpoint_start(
checkpoint_no = mach_read_from_8(buf + LOG_CHECKPOINT_NO);
archived_lsn = mach_read_from_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN);
+ /* Read the first log file header to print a note if this is
+ a recovery from a restored InnoDB Hot Backup */
+
+ fil_io(OS_FILE_READ | OS_FILE_LOG, TRUE, max_cp_group->space_id,
+ 0, 0, LOG_FILE_HDR_SIZE,
+ log_hdr_buf, max_cp_group);
+
+ if (0 == ut_memcmp(log_hdr_buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP,
+ "ibbackup", ut_strlen("ibbackup"))) {
+ /* This log file was created by ibbackup --restore: print
+ a note to the user about it */
+
+ fprintf(stderr,
+ "InnoDB: The log file was created by ibbackup --restore at\n"
+ "InnoDB: %s\n", log_hdr_buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP);
+
+ /* Wipe over the label now */
+
+ ut_memcpy(log_hdr_buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP,
+ " ", 4);
+ /* Write to the log file to wipe over the label */
+ fil_io(OS_FILE_WRITE | OS_FILE_LOG, TRUE,
+ max_cp_group->space_id,
+ 0, 0, OS_FILE_LOG_BLOCK_SIZE,
+ log_hdr_buf, max_cp_group);
+ }
+
group = UT_LIST_GET_FIRST(log_sys->log_groups);
while (group) {
@@ -2471,7 +2644,7 @@ recv_recovery_from_checkpoint_finish(void)
/* Rollback the uncommitted transactions which have no user session */
if (srv_force_recovery < SRV_FORCE_NO_TRX_UNDO) {
- trx_rollback_all_without_sess();
+ trx_rollback_or_clean_all_without_sess();
}
/* Apply the hashed log records to the respective file pages */
@@ -2487,9 +2660,21 @@ recv_recovery_from_checkpoint_finish(void)
}
if (recv_needed_recovery) {
+ trx_sys_print_mysql_master_log_pos();
trx_sys_print_mysql_binlog_offset();
}
+ if (recv_sys->found_corrupt_log) {
+
+ fprintf(stderr,
+ "InnoDB: WARNING: the log file may have been corrupt and it\n"
+ "InnoDB: is possible that the log scan or parsing did not proceed\n"
+ "InnoDB: far enough in recovery. Please run CHECK TABLE\n"
+ "InnoDB: on your InnoDB tables to check that they are ok!\n"
+ "InnoDB: It may be safest to recover your InnoDB database from\n"
+ "InnoDB: a backup!\n");
+ }
+
/* Free the resources of the recovery system */
recv_recovery_on = FALSE;
@@ -2614,10 +2799,9 @@ recv_reset_log_files_for_backup(
/* We pretend there is a checkpoint at lsn + LOG_BLOCK_HDR_SIZE */
- log_reset_first_header_and_checkpoint(buf,
- ut_dulint_add(lsn, LOG_BLOCK_HDR_SIZE));
+ log_reset_first_header_and_checkpoint(buf, lsn);
- log_block_init(buf + LOG_FILE_HDR_SIZE, lsn);
+ log_block_init_in_old_format(buf + LOG_FILE_HDR_SIZE, lsn);
log_block_set_first_rec_group(buf + LOG_FILE_HDR_SIZE,
LOG_BLOCK_HDR_SIZE);
sprintf(name, "%sib_logfile%lu", log_dir, 0);
@@ -2754,7 +2938,7 @@ ask_again:
if (ut_dulint_cmp(recv_sys->parse_start_lsn, start_lsn) < 0) {
fprintf(stderr,
"InnoDB: Archive log file %s starts from too big a lsn\n",
- name);
+ name);
return(TRUE);
}
@@ -2765,7 +2949,7 @@ ask_again:
fprintf(stderr,
"InnoDB: Archive log file %s starts from a wrong lsn\n",
- name);
+ name);
return(TRUE);
}
diff --git a/innobase/mem/mem0dbg.c b/innobase/mem/mem0dbg.c
index f94119b7f38..23585e494b8 100644
--- a/innobase/mem/mem0dbg.c
+++ b/innobase/mem/mem0dbg.c
@@ -668,7 +668,7 @@ mem_print_info_low(
mem_pool_print_info(outfile, mem_comm_pool);
- mem_validate();
+/* mem_validate(); */
/* fclose(outfile); */
#endif
diff --git a/innobase/mem/mem0pool.c b/innobase/mem/mem0pool.c
index 3681c8ef779..61cf1e50ce9 100644
--- a/innobase/mem/mem0pool.c
+++ b/innobase/mem/mem0pool.c
@@ -251,6 +251,7 @@ mem_pool_fill_free_list(
mem_area_t* area;
mem_area_t* area2;
ibool ret;
+ char err_buf[500];
ut_ad(mutex_own(&(pool->mutex)));
@@ -279,15 +280,34 @@ mem_pool_fill_free_list(
area = UT_LIST_GET_FIRST(pool->free_list[i + 1]);
if (area == NULL) {
+ if (UT_LIST_GET_LEN(pool->free_list[i + 1]) > 0) {
+ ut_print_timestamp(stderr);
+
+ fprintf(stderr,
+" InnoDB: Error: mem pool free list %lu length is %lu\n"
+"InnoDB: though the list is empty!\n",
+ i + 1, UT_LIST_GET_LEN(pool->free_list[i + 1]));
+ }
+
ret = mem_pool_fill_free_list(i + 1, pool);
if (ret == FALSE) {
+
return(FALSE);
}
area = UT_LIST_GET_FIRST(pool->free_list[i + 1]);
}
-
+
+ if (UT_LIST_GET_LEN(pool->free_list[i + 1]) == 0) {
+ ut_sprintf_buf(err_buf, ((byte*)area) - 50, 100);
+ fprintf(stderr,
+"InnoDB: Error: Removing element from mem pool free list %lu\n"
+"InnoDB: though the list length is 0! Dump of 100 bytes around element:\n%s\n",
+ i + 1, err_buf);
+ ut_a(0);
+ }
+
UT_LIST_REMOVE(free_list, pool->free_list[i + 1], area);
area2 = (mem_area_t*)(((byte*)area) + ut_2_exp(i));
@@ -320,6 +340,7 @@ mem_area_alloc(
mem_area_t* area;
ulint n;
ibool ret;
+ char err_buf[500];
n = ut_2_log(ut_max(size + MEM_AREA_EXTRA_SIZE, MEM_AREA_MIN_SIZE));
@@ -342,7 +363,24 @@ mem_area_alloc(
area = UT_LIST_GET_FIRST(pool->free_list[n]);
}
- ut_a(mem_area_get_free(area));
+ if (!mem_area_get_free(area)) {
+ ut_sprintf_buf(err_buf, ((byte*)area) - 50, 100);
+ fprintf(stderr,
+"InnoDB: Error: Removing element from mem pool free list %lu though the\n"
+"InnoDB: element is not marked free! Dump of 100 bytes around element:\n%s\n",
+ n, err_buf);
+ ut_a(0);
+ }
+
+ if (UT_LIST_GET_LEN(pool->free_list[n]) == 0) {
+ ut_sprintf_buf(err_buf, ((byte*)area) - 50, 100);
+ fprintf(stderr,
+"InnoDB: Error: Removing element from mem pool free list %lu\n"
+"InnoDB: though the list length is 0! Dump of 100 bytes around element:\n%s\n",
+ n, err_buf);
+ ut_a(0);
+ }
+
ut_ad(mem_area_get_size(area) == ut_2_exp(n));
mem_area_set_free(area, FALSE);
@@ -413,6 +451,7 @@ mem_area_free(
void* new_ptr;
ulint size;
ulint n;
+ char err_buf[500];
if (mem_out_of_mem_err_msg_count > 0) {
/* It may be that the area was really allocated from the
@@ -429,10 +468,18 @@ mem_area_free(
area = (mem_area_t*) (((byte*)ptr) - MEM_AREA_EXTRA_SIZE);
+ if (mem_area_get_free(area)) {
+ ut_sprintf_buf(err_buf, ((byte*)area) - 50, 100);
+ fprintf(stderr,
+"InnoDB: Error: Freeing element to mem pool free list though the\n"
+"InnoDB: element is marked free! Dump of 100 bytes around element:\n%s\n",
+ err_buf);
+ ut_a(0);
+ }
+
size = mem_area_get_size(area);
ut_ad(size != 0);
- ut_a(!mem_area_get_free(area));
#ifdef UNIV_LIGHT_MEM_DEBUG
if (((byte*)area) + size < pool->buf + pool->size) {
diff --git a/innobase/mtr/mtr0log.c b/innobase/mtr/mtr0log.c
index 26f5a5d1cb7..2cfe81d3261 100644
--- a/innobase/mtr/mtr0log.c
+++ b/innobase/mtr/mtr0log.c
@@ -14,6 +14,7 @@ Created 12/7/1995 Heikki Tuuri
#include "buf0buf.h"
#include "dict0boot.h"
+#include "log0recv.h"
/************************************************************
Catenates n bytes to the mtr log. */
@@ -121,7 +122,7 @@ byte*
mlog_parse_nbytes(
/*==============*/
/* out: parsed record end, NULL if not a complete
- record */
+ record or a corrupt record */
ulint type, /* in: log record type: MLOG_1BYTE, ... */
byte* ptr, /* in: buffer */
byte* end_ptr,/* in: buffer end */
@@ -141,6 +142,12 @@ mlog_parse_nbytes(
offset = mach_read_from_2(ptr);
ptr += 2;
+ if (offset >= UNIV_PAGE_SIZE) {
+ recv_sys->found_corrupt_log = TRUE;
+
+ return(NULL);
+ }
+
if (type == MLOG_8BYTES) {
ptr = mach_dulint_parse_compressed(ptr, end_ptr, &dval);
@@ -163,13 +170,33 @@ mlog_parse_nbytes(
return(NULL);
}
+ if (type == MLOG_1BYTE) {
+ if (val > 0xFF) {
+ recv_sys->found_corrupt_log = TRUE;
+
+ return(NULL);
+ }
+ } else if (type == MLOG_2BYTES) {
+ if (val > 0xFFFF) {
+ recv_sys->found_corrupt_log = TRUE;
+
+ return(NULL);
+ }
+ } else {
+ if (type != MLOG_4BYTES) {
+ recv_sys->found_corrupt_log = TRUE;
+
+ return(NULL);
+ }
+ }
+
if (page) {
if (type == MLOG_1BYTE) {
mach_write_to_1(page + offset, val);
} else if (type == MLOG_2BYTES) {
mach_write_to_2(page + offset, val);
} else {
- ut_ad(type == MLOG_4BYTES);
+ ut_a(type == MLOG_4BYTES);
mach_write_to_4(page + offset, val);
}
}
@@ -290,7 +317,7 @@ mlog_write_string(
ut_a(0);
}
ut_ad(ptr && mtr);
- ut_ad(len < UNIV_PAGE_SIZE);
+ ut_a(len < UNIV_PAGE_SIZE);
ut_memcpy(ptr, str, len);
@@ -338,9 +365,17 @@ mlog_parse_string(
offset = mach_read_from_2(ptr);
ptr += 2;
+ if (offset >= UNIV_PAGE_SIZE) {
+ recv_sys->found_corrupt_log = TRUE;
+
+ return(NULL);
+ }
+
len = mach_read_from_2(ptr);
ptr += 2;
+ ut_a(len + offset < UNIV_PAGE_SIZE);
+
if (end_ptr < ptr + len) {
return(NULL);
diff --git a/innobase/mtr/mtr0mtr.c b/innobase/mtr/mtr0mtr.c
index 6aa1f3509d4..e9a6e39d98f 100644
--- a/innobase/mtr/mtr0mtr.c
+++ b/innobase/mtr/mtr0mtr.c
@@ -315,7 +315,7 @@ mtr_log_reserve_and_write(
}
data_size = dyn_array_get_data_size(mlog);
-
+
/* Open the database log for log_write_low */
mtr->start_lsn = log_reserve_and_open(data_size);
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index ee4045febde..3ca0fbd68a4 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -22,6 +22,16 @@ Created 10/21/1995 Heikki Tuuri
#endif
+/* This specifies the file permissions InnoDB uses when it creates files in
+Unix; the value of os_innodb_umask is initialized in ha_innodb.cc to
+my_umask */
+
+#ifndef __WIN__
+ulint os_innodb_umask = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
+#else
+ulint os_innodb_umask = 0;
+#endif
+
/* If the following is set to TRUE, we do not call os_file_flush in every
os_file_write. We can set this TRUE if the doublewrite buffer is used. */
ibool os_do_not_call_flush_at_each_write = FALSE;
@@ -32,7 +42,7 @@ OS does not provide an atomic pread or pwrite, or similar */
os_mutex_t os_file_seek_mutexes[OS_FILE_N_SEEK_MUTEXES];
/* In simulated aio, merge at most this many consecutive i/os */
-#define OS_AIO_MERGE_N_CONSECUTIVE 32
+#define OS_AIO_MERGE_N_CONSECUTIVE 64
/* If this flag is TRUE, then we will use the native aio of the
OS (provided we compiled Innobase with it in), otherwise we will
@@ -40,6 +50,8 @@ use simulated aio we build below with threads */
ibool os_aio_use_native_aio = FALSE;
+ibool os_aio_print_debug = FALSE;
+
/* The aio array slot structure */
typedef struct os_aio_slot_struct os_aio_slot_t;
@@ -115,7 +127,12 @@ os_aio_array_t* os_aio_sync_array = NULL;
ulint os_aio_n_segments = ULINT_UNDEFINED;
+/* If the following is TRUE, read i/o handler threads try to
+wait until a batch of new read requests have been posted */
+ibool os_aio_recommend_sleep_for_read_threads = FALSE;
+
ulint os_n_file_reads = 0;
+ulint os_bytes_read_since_printout = 0;
ulint os_n_file_writes = 0;
ulint os_n_fsyncs = 0;
ulint os_n_file_reads_old = 0;
@@ -412,8 +429,8 @@ try_again:
}
if (create_mode == OS_FILE_CREATE) {
- file = open(name, create_flag, S_IRUSR | S_IWUSR | S_IRGRP
- | S_IWGRP | S_IROTH | S_IWOTH);
+ file = open(name, create_flag, S_IRUSR | S_IWUSR
+ | S_IRGRP | S_IWGRP);
} else {
file = open(name, create_flag);
}
@@ -548,8 +565,7 @@ try_again:
}
#endif
if (create_mode == OS_FILE_CREATE) {
- file = open(name, create_flag, S_IRUSR | S_IWUSR | S_IRGRP
- | S_IWGRP | S_IROTH | S_IWOTH);
+ file = open(name, create_flag, os_innodb_umask);
} else {
file = open(name, create_flag);
}
@@ -673,6 +689,7 @@ os_file_set_size(
ulint n_bytes;
ibool ret;
byte* buf;
+ byte* buf2;
ulint i;
ut_a(size == (size & 0xFFFFFFFF));
@@ -680,7 +697,10 @@ os_file_set_size(
/* We use a very big 8 MB buffer in writing because Linux may be
extremely slow in fsync on 1 MB writes */
- buf = ut_malloc(UNIV_PAGE_SIZE * 512);
+ buf2 = ut_malloc(UNIV_PAGE_SIZE * 513);
+
+ /* Align the buffer for possible raw i/o */
+ buf = ut_align(buf2, UNIV_PAGE_SIZE);
/* Write buffer full of zeros */
for (i = 0; i < UNIV_PAGE_SIZE * 512; i++) {
@@ -702,13 +722,13 @@ os_file_set_size(
(ulint)(offset >> 32),
n_bytes);
if (!ret) {
- ut_free(buf);
+ ut_free(buf2);
goto error_handling;
}
offset += n_bytes;
}
- ut_free(buf);
+ ut_free(buf2);
ret = os_file_flush(file);
@@ -734,6 +754,8 @@ os_file_flush(
ut_a(file);
+ os_n_fsyncs++;
+
ret = FlushFileBuffers(file);
if (ret) {
@@ -742,6 +764,10 @@ os_file_flush(
os_file_handle_error(file, NULL);
+ /* It is a fatal error if a file flush does not succeed, because then
+ the database can get corrupt on disk */
+ ut_a(0);
+
return(FALSE);
#else
int ret;
@@ -764,11 +790,17 @@ os_file_flush(
return(TRUE);
}
+ ut_print_timestamp(stderr);
+
fprintf(stderr,
- "InnoDB: Error: the OS said file flush did not succeed\n");
+ " InnoDB: Error: the OS said file flush did not succeed\n");
os_file_handle_error(file, NULL);
+ /* It is a fatal error if a file flush does not succeed, because then
+ the database can get corrupt on disk */
+ ut_a(0);
+
return(FALSE);
#endif
}
@@ -954,6 +986,7 @@ os_file_read(
ut_a((offset & 0xFFFFFFFF) == offset);
os_n_file_reads++;
+ os_bytes_read_since_printout += n;
try_again:
ut_ad(file);
@@ -1062,7 +1095,9 @@ os_file_write(
fprintf(stderr,
" InnoDB: Error: File pointer positioning to file %s failed at\n"
-"InnoDB: offset %lu %lu. Operating system error number %lu.\n",
+"InnoDB: offset %lu %lu. Operating system error number %lu.\n"
+"InnoDB: Look from section 13.2 at http://www.innodb.com/ibman.html\n"
+"InnoDB: what the error number means.\n",
name, offset_high, offset,
(ulint)GetLastError());
@@ -1093,8 +1128,10 @@ os_file_write(
" InnoDB: Error: Write to file %s failed at offset %lu %lu.\n"
"InnoDB: %lu bytes should have been written, only %lu were written.\n"
"InnoDB: Operating system error number %lu.\n"
+"InnoDB: Look from section 13.2 at http://www.innodb.com/ibman.html\n"
+"InnoDB: what the error number means.\n"
"InnoDB: Check that your OS and file system support files of this size.\n"
-"InnoDB: Check also the disk is not full or a disk quota exceeded.\n",
+"InnoDB: Check also that the disk is not full or a disk quota exceeded.\n",
name, offset_high, offset, n, len,
(ulint)GetLastError());
@@ -1120,10 +1157,12 @@ os_file_write(
" InnoDB: Error: Write to file %s failed at offset %lu %lu.\n"
"InnoDB: %lu bytes should have been written, only %lu were written.\n"
"InnoDB: Operating system error number %lu.\n"
+"InnoDB: Look from section 13.2 at http://www.innodb.com/ibman.html\n"
+"InnoDB: what the error number means or use the perror program of MySQL.\n"
"InnoDB: Check that your OS and file system support files of this size.\n"
-"InnoDB: Check also the disk is not full or a disk quota exceeded.\n",
- name, offset_high, offset, n, ret, (ulint)errno);
-
+"InnoDB: Check also that the disk is not full or a disk quota exceeded.\n",
+ name, offset_high, offset, n, (ulint)ret,
+ (ulint)errno);
os_has_said_disk_full = TRUE;
}
@@ -1623,13 +1662,40 @@ os_aio_simulated_wake_handler_threads(void)
/* We do not use simulated aio: do nothing */
return;
- }
+ }
+
+ os_aio_recommend_sleep_for_read_threads = FALSE;
for (i = 0; i < os_aio_n_segments; i++) {
os_aio_simulated_wake_handler_thread(i);
}
}
+/**************************************************************************
+This function can be called if one wants to post a batch of reads and
+prefers an i/o-handler thread to handle them all at once later. You must
+call os_aio_simulated_wake_handler_threads later to ensure the threads
+are not left sleeping! */
+
+void
+os_aio_simulated_put_read_threads_to_sleep(void)
+/*============================================*/
+{
+ os_aio_array_t* array;
+ ulint g;
+
+ os_aio_recommend_sleep_for_read_threads = TRUE;
+
+ for (g = 0; g < os_aio_n_segments; g++) {
+ os_aio_get_array_and_local_segment(&array, g);
+
+ if (array == os_aio_read_array) {
+
+ os_event_reset(os_aio_segment_wait_events[g]);
+ }
+ }
+}
+
/***********************************************************************
Requests an asynchronous i/o operation. */
@@ -1685,7 +1751,6 @@ os_aio(
ut_ad(buf);
ut_ad(n > 0);
ut_ad(n % OS_FILE_LOG_BLOCK_SIZE == 0);
- ut_ad((ulint)buf % OS_FILE_LOG_BLOCK_SIZE == 0)
ut_ad(offset % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(os_aio_validate());
@@ -2036,18 +2101,14 @@ os_aio_simulated_handle(
ulint offs;
ulint lowest_offset;
byte* combined_buf;
+ byte* combined_buf2;
ibool ret;
ulint n;
ulint i;
-
+
segment = os_aio_get_array_and_local_segment(&array, global_segment);
restart:
- /* Give other threads chance to add several i/os to the array
- at once */
-
- os_thread_yield();
-
/* NOTE! We only access constant fields in os_aio_array. Therefore
we do not have to acquire the protecting mutex yet */
@@ -2058,6 +2119,15 @@ restart:
/* Look through n slots after the segment * n'th slot */
+ if (array == os_aio_read_array
+ && os_aio_recommend_sleep_for_read_threads) {
+
+ /* Give other threads chance to add several i/os to the array
+ at once. */
+
+ goto recommended_sleep;
+ }
+
os_mutex_enter(array->mutex);
/* Check if there is a slot for which the i/o has already been
@@ -2068,6 +2138,11 @@ restart:
if (slot->reserved && slot->io_already_done) {
+ if (os_aio_print_debug) {
+ fprintf(stderr,
+"InnoDB: i/o for slot %lu already done, returning\n", i);
+ }
+
ret = TRUE;
goto slot_io_done;
@@ -2149,9 +2224,11 @@ consecutive_loop:
/* We can use the buffer of the i/o request */
combined_buf = slot->buf;
} else {
- combined_buf = ut_malloc(total_len);
+ combined_buf2 = ut_malloc(total_len + UNIV_PAGE_SIZE);
+
+ ut_a(combined_buf2);
- ut_a(combined_buf);
+ combined_buf = ut_align(combined_buf2, UNIV_PAGE_SIZE);
}
/* We release the array mutex for the time of the i/o: NOTE that
@@ -2174,6 +2251,13 @@ consecutive_loop:
srv_io_thread_op_info[global_segment] = (char*) "doing file i/o";
+ if (os_aio_print_debug) {
+ fprintf(stderr,
+"InnoDB: doing i/o of type %lu at offset %lu %lu, length %lu\n",
+ slot->type, slot->offset_high, slot->offset,
+ total_len);
+ }
+
/* Do the i/o with ordinary, synchronous i/o functions: */
if (slot->type == OS_FILE_WRITE) {
ret = os_file_write(slot->name, slot->file, combined_buf,
@@ -2203,7 +2287,7 @@ consecutive_loop:
}
if (n_consecutive > 1) {
- ut_free(combined_buf);
+ ut_free(combined_buf2);
}
os_mutex_enter(array->mutex);
@@ -2241,10 +2325,18 @@ wait_for_io:
os_mutex_exit(array->mutex);
- srv_io_thread_op_info[global_segment] = (char*) "waiting for i/o request";
+recommended_sleep:
+ srv_io_thread_op_info[global_segment] =
+ (char*)"waiting for i/o request";
os_event_wait(os_aio_segment_wait_events[global_segment]);
+ if (os_aio_print_debug) {
+ fprintf(stderr,
+"InnoDB: i/o handler thread for i/o segment %lu wakes up\n",
+ global_segment);
+ }
+
goto restart;
}
@@ -2305,22 +2397,30 @@ os_aio_validate(void)
Prints info of the aio arrays. */
void
-os_aio_print(void)
-/*==============*/
+os_aio_print(
+/*=========*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end)/* in: buffer end */
{
os_aio_array_t* array;
os_aio_slot_t* slot;
ulint n_reserved;
time_t current_time;
double time_elapsed;
+ double avg_bytes_read;
ulint i;
+ if (buf_end - buf < 1000) {
+
+ return;
+ }
+
for (i = 0; i < srv_n_file_io_threads; i++) {
- printf("I/O thread %lu state: %s\n", i,
+ buf += sprintf(buf, "I/O thread %lu state: %s\n", i,
srv_io_thread_op_info[i]);
}
- printf("Pending normal aio reads:");
+ buf += sprintf(buf, "Pending normal aio reads:");
array = os_aio_read_array;
loop:
@@ -2347,12 +2447,12 @@ loop:
ut_a(array->n_reserved == n_reserved);
- printf(" %lu", n_reserved);
+ buf += sprintf(buf, " %lu", n_reserved);
os_mutex_exit(array->mutex);
if (array == os_aio_read_array) {
- printf(", aio writes:");
+ buf += sprintf(buf, ", aio writes:");
array = os_aio_write_array;
@@ -2360,38 +2460,50 @@ loop:
}
if (array == os_aio_write_array) {
- printf(",\n ibuf aio reads:");
+ buf += sprintf(buf, ",\n ibuf aio reads:");
array = os_aio_ibuf_array;
goto loop;
}
if (array == os_aio_ibuf_array) {
- printf(", log i/o's:");
+ buf += sprintf(buf, ", log i/o's:");
array = os_aio_log_array;
goto loop;
}
if (array == os_aio_log_array) {
- printf(", sync i/o's:");
+ buf += sprintf(buf, ", sync i/o's:");
array = os_aio_sync_array;
goto loop;
}
- printf("\n");
+ buf += sprintf(buf, "\n");
current_time = time(NULL);
- time_elapsed = difftime(current_time, os_last_printout);
+ time_elapsed = 0.001 + difftime(current_time, os_last_printout);
- printf("Pending flushes (fsync) log: %lu; buffer pool: %lu\n",
+ buf += sprintf(buf,
+ "Pending flushes (fsync) log: %lu; buffer pool: %lu\n",
fil_n_pending_log_flushes, fil_n_pending_tablespace_flushes);
- printf("%lu OS file reads, %lu OS file writes, %lu OS fsyncs\n",
+ buf += sprintf(buf,
+ "%lu OS file reads, %lu OS file writes, %lu OS fsyncs\n",
os_n_file_reads, os_n_file_writes, os_n_fsyncs);
- printf("%.2f reads/s, %.2f writes/s, %.2f fsyncs/s\n",
+
+ if (os_n_file_reads == os_n_file_reads_old) {
+ avg_bytes_read = 0.0;
+ } else {
+ avg_bytes_read = os_bytes_read_since_printout /
+ (os_n_file_reads - os_n_file_reads_old);
+ }
+
+ buf += sprintf(buf,
+"%.2f reads/s, %lu avg bytes/read, %.2f writes/s, %.2f fsyncs/s\n",
(os_n_file_reads - os_n_file_reads_old)
/ time_elapsed,
+ (ulint)avg_bytes_read,
(os_n_file_writes - os_n_file_writes_old)
/ time_elapsed,
(os_n_fsyncs - os_n_fsyncs_old)
@@ -2400,11 +2512,27 @@ loop:
os_n_file_reads_old = os_n_file_reads;
os_n_file_writes_old = os_n_file_writes;
os_n_fsyncs_old = os_n_fsyncs;
+ os_bytes_read_since_printout = 0;
os_last_printout = current_time;
}
/**************************************************************************
+Refreshes the statistics used to print per-second averages. */
+
+void
+os_aio_refresh_stats(void)
+/*======================*/
+{
+ os_n_file_reads_old = os_n_file_reads;
+ os_n_file_writes_old = os_n_file_writes;
+ os_n_fsyncs_old = os_n_fsyncs;
+ os_bytes_read_since_printout = 0;
+
+ os_last_printout = time(NULL);
+}
+
+/**************************************************************************
Checks that all slots in the system have been freed, that is, there are
no pending io operations. */
diff --git a/innobase/os/os0sync.c b/innobase/os/os0sync.c
index 2cf5160d055..c1345de0d55 100644
--- a/innobase/os/os0sync.c
+++ b/innobase/os/os0sync.c
@@ -435,7 +435,7 @@ os_fast_mutex_init(
InitializeCriticalSection((LPCRITICAL_SECTION) fast_mutex);
#else
- pthread_mutex_init(fast_mutex, NULL);
+ pthread_mutex_init(fast_mutex, MY_MUTEX_INIT_FAST);
#endif
}
diff --git a/innobase/os/os0thread.c b/innobase/os/os0thread.c
index 49d4c8518fb..13990b6743b 100644
--- a/innobase/os/os0thread.c
+++ b/innobase/os/os0thread.c
@@ -18,8 +18,54 @@ Created 9/8/1995 Heikki Tuuri
#include "srv0srv.h"
+/*******************************************************************
+Compares two thread ids for equality. */
+
+ibool
+os_thread_eq(
+/*=========*/
+ /* out: TRUE if equal */
+ os_thread_id_t a, /* in: OS thread or thread id */
+ os_thread_id_t b) /* in: OS thread or thread id */
+{
+#ifdef __WIN__
+ if (a == b) {
+ return(TRUE);
+ }
+
+ return(FALSE);
+#else
+ if (pthread_equal(a, b)) {
+ return(TRUE);
+ }
+
+ return(FALSE);
+#endif
+}
+
+/********************************************************************
+Converts an OS thread id to a ulint. It is NOT guaranteed that the ulint is
+unique for the thread though! */
+
+ulint
+os_thread_pf(
+/*=========*/
+ os_thread_id_t a)
+{
+#ifdef UNIV_HPUX
+ /* In HP-UX a pthread_t is a struct of 3 fields: field1, field2,
+ field3. We do not know if field1 determines the thread uniquely. */
+
+ return((ulint)(a.field1));
+#else
+ return((ulint)a);
+#endif
+}
+
/*********************************************************************
-Returns the thread identifier of current thread. */
+Returns the thread identifier of current thread. Currently the thread
+identifier in Unix is the thread handle itself. Note that in HP-UX
+pthread_t is a struct of 3 fields. */
os_thread_id_t
os_thread_get_curr_id(void)
@@ -28,16 +74,7 @@ os_thread_get_curr_id(void)
#ifdef __WIN__
return(GetCurrentThreadId());
#else
- pthread_t pthr;
-
- pthr = pthread_self();
-
- /* TODO: in the future we have to change os_thread_id
- to pthread_t; the following cast may work in a wrong way on some
- systems if pthread_t is a struct; this is just a quick fix
- for HP-UX to eliminate a compiler warning */
-
- return(*(os_thread_id_t*)((void*) (&pthr)));
+ return(pthread_self());
#endif
}
@@ -58,20 +95,19 @@ os_thread_create(
#endif
void* arg, /* in: argument to start
function */
- os_thread_id_t* thread_id __attribute__((unused)))
- /* out: id of created
- thread */
+ os_thread_id_t* thread_id) /* out: id of the created
+ thread */
{
#ifdef __WIN__
os_thread_t thread;
+ ulint win_thread_id;
thread = CreateThread(NULL, /* no security attributes */
0, /* default size stack */
(LPTHREAD_START_ROUTINE)start_f,
arg,
0, /* thread runs immediately */
- thread_id);
- ut_a(thread);
+ &win_thread_id);
if (srv_set_thread_priorities) {
@@ -82,6 +118,8 @@ os_thread_create(
ut_a(SetThreadPriority(thread, srv_query_thread_priority));
}
+ *thread_id = win_thread_id;
+
return(thread);
#else
int ret;
@@ -99,6 +137,8 @@ os_thread_create(
my_pthread_setprio(pthread, srv_query_thread_priority);
}
+ *thread_id = pthread;
+
return(pthread);
#endif
}
@@ -108,7 +148,7 @@ Returns handle to the current thread. */
os_thread_t
os_thread_get_curr(void)
-/*=======================*/
+/*====================*/
{
#ifdef __WIN__
return(GetCurrentThread());
@@ -116,18 +156,6 @@ os_thread_get_curr(void)
return(pthread_self());
#endif
}
-
-/*********************************************************************
-Converts a thread id to a ulint. */
-
-ulint
-os_thread_conv_id_to_ulint(
-/*=======================*/
- /* out: converted to ulint */
- os_thread_id_t id) /* in: thread id */
-{
- return((ulint)id);
-}
/*********************************************************************
Advises the os to give up remainder of the thread's time slice. */
diff --git a/innobase/page/page0cur.c b/innobase/page/page0cur.c
index 85beffbcc94..2909573b14b 100644
--- a/innobase/page/page0cur.c
+++ b/innobase/page/page0cur.c
@@ -13,6 +13,7 @@ Created 10/4/1994 Heikki Tuuri
#include "rem0cmp.h"
#include "mtr0log.h"
+#include "log0recv.h"
ulint page_cur_short_succ = 0;
@@ -403,6 +404,8 @@ page_cur_insert_rec_write_log(
byte* log_ptr;
ulint i;
+ ut_a(rec_size < UNIV_PAGE_SIZE);
+
log_ptr = mlog_open(mtr, 30 + MLOG_BUF_MARGIN);
if (log_ptr == NULL) {
@@ -479,6 +482,9 @@ page_cur_insert_rec_write_log(
/* Write the mismatch index */
log_ptr += mach_write_compressed(log_ptr, i);
+
+ ut_a(i < UNIV_PAGE_SIZE);
+ ut_a(extra_size < UNIV_PAGE_SIZE);
}
/* Write to the log the inserted index record end segment which
@@ -491,6 +497,8 @@ page_cur_insert_rec_write_log(
mlog_close(mtr, log_ptr);
+ ut_a(rec_size - i < UNIV_PAGE_SIZE);
+
if (rec_size - i >= MLOG_BUF_MARGIN) {
mlog_catenate_string(mtr, ins_ptr, rec_size - i);
}
@@ -529,6 +537,13 @@ page_cur_parse_insert_rec(
}
offset = mach_read_from_2(ptr);
+
+ if (offset >= UNIV_PAGE_SIZE) {
+
+ recv_sys->found_corrupt_log = TRUE;
+
+ return(NULL);
+ }
ptr += 2;
}
@@ -542,6 +557,12 @@ page_cur_parse_insert_rec(
extra_info_yes = end_seg_len & 0x1;
end_seg_len = end_seg_len / 2;
+
+ if (end_seg_len >= UNIV_PAGE_SIZE) {
+ recv_sys->found_corrupt_log = TRUE;
+
+ return(NULL);
+ }
if (extra_info_yes) {
/* Read the info bits */
@@ -561,12 +582,16 @@ page_cur_parse_insert_rec(
return(NULL);
}
+ ut_a(origin_offset < UNIV_PAGE_SIZE);
+
ptr = mach_parse_compressed(ptr, end_ptr, &mismatch_index);
if (ptr == NULL) {
return(NULL);
}
+
+ ut_a(mismatch_index < UNIV_PAGE_SIZE);
}
if (end_ptr < ptr + end_seg_len) {
@@ -602,6 +627,8 @@ page_cur_parse_insert_rec(
/* Build the inserted record to buf */
+ ut_a(mismatch_index < UNIV_PAGE_SIZE);
+
ut_memcpy(buf, rec_get_start(cursor_rec), mismatch_index);
ut_memcpy(buf + mismatch_index, ptr, end_seg_len);
@@ -938,6 +965,8 @@ page_copy_rec_list_end_to_created_page(
log_data_len = dyn_array_get_data_size(&(mtr->log)) - log_data_len;
+ ut_a(log_data_len < 100 * UNIV_PAGE_SIZE);
+
mach_write_to_4(log_ptr, log_data_len);
rec_set_next_offs(insert_rec, PAGE_SUPREMUM);
@@ -1001,6 +1030,8 @@ page_cur_parse_delete_rec(
offset = mach_read_from_2(ptr);
ptr += 2;
+ ut_a(offset <= UNIV_PAGE_SIZE);
+
if (page) {
page_cur_position(page + offset, &cursor);
diff --git a/innobase/page/page0page.c b/innobase/page/page0page.c
index bf8af45a00a..ed74736c8da 100644
--- a/innobase/page/page0page.c
+++ b/innobase/page/page0page.c
@@ -17,6 +17,7 @@ Created 2/2/1994 Heikki Tuuri
#include "lock0lock.h"
#include "fut0lst.h"
#include "btr0sea.h"
+#include "buf0buf.h"
/* A cached template page used in page_create */
page_t* page_template = NULL;
@@ -63,6 +64,65 @@ Assuming a page size of 8 kB, a typical index page of a secondary
index contains 300 index entries, and the size of the page directory
is 50 x 4 bytes = 200 bytes. */
+/*******************************************************************
+Looks for the directory slot which owns the given record. */
+
+ulint
+page_dir_find_owner_slot(
+/*=====================*/
+ /* out: the directory slot number */
+ rec_t* rec) /* in: the physical record */
+{
+ ulint i;
+ ulint steps = 0;
+ page_t* page;
+ page_dir_slot_t* slot;
+ rec_t* original_rec = rec;
+ char err_buf[1000];
+
+ ut_ad(page_rec_check(rec));
+
+ while (rec_get_n_owned(rec) == 0) {
+ steps++;
+ rec = page_rec_get_next(rec);
+ }
+
+ page = buf_frame_align(rec);
+
+ i = page_dir_get_n_slots(page) - 1;
+ slot = page_dir_get_nth_slot(page, i);
+
+ while (page_dir_slot_get_rec(slot) != rec) {
+
+ if (i == 0) {
+ fprintf(stderr,
+ "InnoDB: Probable data corruption on page %lu\n",
+ buf_frame_get_page_no(page));
+
+ rec_sprintf(err_buf, 900, original_rec);
+
+ fprintf(stderr,
+ "InnoDB: Original record %s\n"
+ "InnoDB: on that page. Steps %lu.\n", err_buf, steps);
+
+ rec_sprintf(err_buf, 900, rec);
+
+ fprintf(stderr,
+ "InnoDB: Cannot find the dir slot for record %s\n"
+ "InnoDB: on that page!\n", err_buf);
+
+ buf_page_print(page);
+
+ ut_a(0);
+ }
+
+ i--;
+ slot = page_dir_get_nth_slot(page, i);
+ }
+
+ return(i);
+}
+
/******************************************************************
Used to check the consistency of a directory slot. */
static
diff --git a/innobase/pars/lexyy.c b/innobase/pars/lexyy.c
index 10bdcdd0990..f7edc9d195f 100644
--- a/innobase/pars/lexyy.c
+++ b/innobase/pars/lexyy.c
@@ -1,10 +1,12 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /home/daffy/u0/vern/flex/flex-2.4.7/RCS/flex.skl,v 1.2 94/08/03 11:13:24 vern Exp $
+ * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
*/
#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
#include "univ.i"
#include <stdio.h>
@@ -31,7 +33,7 @@
#else /* ! __cplusplus */
-#ifdef __STDC__
+#if __STDC__
#define YY_USE_PROTOS
#define YY_USE_CONST
@@ -39,16 +41,19 @@
#endif /* __STDC__ */
#endif /* ! __cplusplus */
-
#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
#define YY_USE_CONST
+#define YY_USE_PROTOS
#endif
-
-#ifndef YY_USE_CONST
-#ifndef const
-#define const
-#endif
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
#endif
@@ -75,16 +80,16 @@
#define BEGIN yy_start = 1 + 2 *
/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
+ * compatibility.
*/
#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-/* Special action meaning "start processing a new file". Now included
- * only for backward compatibility with previous versions of flex.
- */
+/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE yyrestart( yyin )
#define YY_END_OF_BUFFER_CHAR 0
@@ -97,14 +102,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
extern int yyleng;
extern FILE *yyin, *yyout;
-#ifdef __cplusplus
-extern "C" {
-#endif
- extern int yywrap YY_PROTO(( void ));
-#ifdef __cplusplus
- }
-#endif
-
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
@@ -130,6 +127,7 @@ extern "C" {
{ \
/* Undo effects of setting up yytext. */ \
*yy_cp = yy_hold_char; \
+ YY_RESTORE_YY_MORE_OFFSET \
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
@@ -137,6 +135,12 @@ extern "C" {
#define unput(c) yyunput( c, yytext_ptr )
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+typedef unsigned int yy_size_t;
+
struct yy_buffer_state
{
@@ -148,13 +152,19 @@ struct yy_buffer_state
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
- int yy_buf_size;
+ yy_size_t yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
@@ -162,6 +172,12 @@ struct yy_buffer_state
*/
int yy_is_interactive;
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -210,5541 +226,66 @@ static int yy_start = 0; /* start state number */
*/
static int yy_did_buffer_switch_on_eof;
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
void yyrestart YY_PROTO(( FILE *input_file ));
+
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void yy_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-static void yy_push_state YY_PROTO(( int new_state ));
-static void yy_pop_state YY_PROTO(( void ));
-static int yy_top_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
-static void *yy_flex_alloc YY_PROTO(( unsigned int ));
-static void *yy_flex_realloc YY_PROTO(( void *, unsigned int ));
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
static void yy_flex_free YY_PROTO(( void * ));
#define yy_new_buffer yy_create_buffer
-#define INITIAL 0
-#define comment 1
-typedef char YY_CHAR;
-typedef int yy_state_type;
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-extern char *yytext;
-#define yytext_ptr yytext
-static const short yy_nxt[][128] =
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-
- 5, 6, 6, 6, 6, 6, 6, 6, 6, 7,
- 8, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 7, 6, 6, 6, 6, 9, 6, 10,
- 11, 12, 13, 14, 15, 16, 17, 18, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 20, 21,
- 22, 23, 24, 25, 6, 26, 27, 28, 29, 30,
- 31, 32, 32, 33, 32, 32, 34, 32, 35, 36,
- 37, 32, 38, 39, 40, 41, 42, 43, 32, 32,
- 32, 6, 6, 6, 6, 32, 6, 32, 32, 32,
-
- 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
- 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
- 32, 32, 32, 44, 6, 45, 6, 6,
-
- 5, 6, 6, 6, 6, 6, 6, 6, 6, 7,
- 8, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 7, 6, 6, 6, 6, 9, 6, 10,
- 11, 12, 13, 14, 15, 16, 17, 18, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 20, 21,
- 22, 23, 24, 25, 6, 26, 27, 28, 29, 30,
- 31, 32, 32, 33, 32, 32, 34, 32, 35, 36,
- 37, 32, 38, 39, 40, 41, 42, 43, 32, 32,
- 32, 6, 6, 6, 6, 32, 6, 32, 32, 32,
-
- 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
- 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
- 32, 32, 32, 44, 6, 45, 6, 6,
-
- 5, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 47, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 48, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46,
-
- 5, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 47, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 48, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
-
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
- 46, 46, 46, 46, 46, 46, 46, 46,
-
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
-
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
- -5, -5, -5, -5, -5, -5, -5, -5,
-
- 5, -6, -6, -6, -6, -6, -6, -6, -6, -6,
- -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
- -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
- -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
- -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
- -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
- -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
- -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
- -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
- -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
-
- -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
- -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
- -6, -6, -6, -6, -6, -6, -6, -6,
-
- 5, -7, -7, -7, -7, -7, -7, -7, -7, 49,
- 49, -7, -7, -7, -7, -7, -7, -7, -7, -7,
- -7, -7, -7, -7, -7, -7, -7, -7, -7, -7,
- -7, -7, 49, -7, -7, -7, -7, -7, -7, -7,
- -7, -7, -7, -7, -7, -7, -7, -7, -7, -7,
- -7, -7, -7, -7, -7, -7, -7, -7, -7, -7,
- -7, -7, -7, -7, -7, -7, -7, -7, -7, -7,
- -7, -7, -7, -7, -7, -7, -7, -7, -7, -7,
- -7, -7, -7, -7, -7, -7, -7, -7, -7, -7,
- -7, -7, -7, -7, -7, -7, -7, -7, -7, -7,
-
- -7, -7, -7, -7, -7, -7, -7, -7, -7, -7,
- -7, -7, -7, -7, -7, -7, -7, -7, -7, -7,
- -7, -7, -7, -7, -7, -7, -7, -7,
-
- 5, -8, -8, -8, -8, -8, -8, -8, -8, 49,
- 49, -8, -8, -8, -8, -8, -8, -8, -8, -8,
- -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
- -8, -8, 49, -8, -8, -8, -8, -8, -8, -8,
- -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
- -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
- -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
- -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
- -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
- -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
-
- -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
- -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
- -8, -8, -8, -8, -8, -8, -8, -8,
-
- 5, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
-
- -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
- -9, -9, -9, -9, -9, -9, -9, -9,
-
- 5, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 51,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
-
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50,
-
- 5, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
-
- -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11, -11, -11, -11, -11, -11, -11,
-
- 5, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
-
- -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
- -12, -12, -12, -12, -12, -12, -12, -12,
-
- 5, -13, -13, -13, -13, -13, -13, -13, -13, -13,
- -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
- -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
- -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
- -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
- -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
- -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
- -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
- -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
- -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
-
- -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
- -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
- -13, -13, -13, -13, -13, -13, -13, -13,
-
- 5, -14, -14, -14, -14, -14, -14, -14, -14, -14,
- -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
- -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
- -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
- -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
- -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
- -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
- -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
- -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
- -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
-
- -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
- -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
- -14, -14, -14, -14, -14, -14, -14, -14,
-
- 5, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
-
- -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, -15, -15, -15, -15, -15,
-
- 5, -16, -16, -16, -16, -16, -16, -16, -16, -16,
- -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
- -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
- -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
- -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
- -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
- -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
- -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
- -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
- -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
-
- -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
- -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
- -16, -16, -16, -16, -16, -16, -16, -16,
-
- 5, -17, -17, -17, -17, -17, -17, -17, -17, -17,
- -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
- -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
- -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
- -17, -17, -17, -17, -17, -17, 52, -17, -17, -17,
- -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
- -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
- -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
- -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
- -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
-
- -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
- -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
- -17, -17, -17, -17, -17, -17, -17, -17,
-
- 5, -18, -18, -18, -18, -18, -18, -18, -18, -18,
- -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
- -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
- -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
- -18, -18, 53, -18, -18, -18, -18, -18, -18, -18,
- -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
- -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
- -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
- -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
- -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
-
- -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
- -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
- -18, -18, -18, -18, -18, -18, -18, -18,
-
- 5, -19, -19, -19, -19, -19, -19, -19, -19, -19,
- -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
- -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
- -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
- -19, -19, -19, -19, -19, -19, 54, -19, 55, 55,
- 55, 55, 55, 55, 55, 55, 55, 55, -19, -19,
- -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
- -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
- -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
- -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
-
- -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
- -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
- -19, -19, -19, -19, -19, -19, -19, -19,
-
- 5, -20, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, 56, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
-
- -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
- -20, -20, -20, -20, -20, -20, -20, -20,
-
- 5, -21, -21, -21, -21, -21, -21, -21, -21, -21,
- -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
- -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
- -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
- -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
- -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
- -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
- -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
- -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
- -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
-
- -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
- -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
- -21, -21, -21, -21, -21, -21, -21, -21,
-
- 5, -22, -22, -22, -22, -22, -22, -22, -22, -22,
- -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
- -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
- -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
- -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
- -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
- -22, 57, 58, -22, -22, -22, -22, -22, -22, -22,
- -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
- -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
- -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
-
- -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
- -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
- -22, -22, -22, -22, -22, -22, -22, -22,
-
- 5, -23, -23, -23, -23, -23, -23, -23, -23, -23,
- -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
- -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
- -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
- -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
- -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
- -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
- -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
- -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
- -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
-
- -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
- -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
- -23, -23, -23, -23, -23, -23, -23, -23,
-
- 5, -24, -24, -24, -24, -24, -24, -24, -24, -24,
- -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
- -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
- -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
- -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
- -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
- -24, 59, -24, -24, -24, -24, -24, -24, -24, -24,
- -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
- -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
- -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
-
- -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
- -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
- -24, -24, -24, -24, -24, -24, -24, -24,
-
- 5, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
-
- -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, -25, -25, -25, -25, -25, -25, -25,
-
- 5, -26, -26, -26, -26, -26, -26, -26, -26, -26,
- -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
- -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
- -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
- -26, -26, -26, -26, -26, -26, -26, -26, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -26, -26,
- -26, -26, -26, -26, -26, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 61, 60,
- 60, 60, 60, 62, 60, 60, 60, 60, 60, 60,
- 60, -26, -26, -26, -26, 60, -26, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -26, -26, -26, -26, -26,
-
- 5, -27, -27, -27, -27, -27, -27, -27, -27, -27,
- -27, -27, -27, -27, -27, -27, -27, -27, -27, -27,
- -27, -27, -27, -27, -27, -27, -27, -27, -27, -27,
- -27, -27, -27, -27, -27, -27, -27, -27, -27, -27,
- -27, -27, -27, -27, -27, -27, -27, -27, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -27, -27,
- -27, -27, -27, -27, -27, 60, 60, 60, 60, 63,
- 60, 60, 60, 64, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 65,
- 60, -27, -27, -27, -27, 60, -27, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -27, -27, -27, -27, -27,
-
- 5, -28, -28, -28, -28, -28, -28, -28, -28, -28,
- -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
- -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
- -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
- -28, -28, -28, -28, -28, -28, -28, -28, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -28, -28,
- -28, -28, -28, -28, -28, 60, 60, 60, 60, 60,
- 60, 60, 66, 60, 60, 60, 67, 60, 60, 68,
- 60, 60, 69, 60, 60, 70, 60, 60, 60, 60,
- 60, -28, -28, -28, -28, 60, -28, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -28, -28, -28, -28, -28,
-
- 5, -29, -29, -29, -29, -29, -29, -29, -29, -29,
- -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
- -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
- -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
- -29, -29, -29, -29, -29, -29, -29, -29, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -29, -29,
- -29, -29, -29, -29, -29, 60, 60, 60, 60, 71,
- 60, 60, 60, 72, 60, 60, 60, 60, 60, 73,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -29, -29, -29, -29, 60, -29, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -29, -29, -29, -29, -29,
-
- 5, -30, -30, -30, -30, -30, -30, -30, -30, -30,
- -30, -30, -30, -30, -30, -30, -30, -30, -30, -30,
- -30, -30, -30, -30, -30, -30, -30, -30, -30, -30,
- -30, -30, -30, -30, -30, -30, -30, -30, -30, -30,
- -30, -30, -30, -30, -30, -30, -30, -30, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -30, -30,
- -30, -30, -30, -30, -30, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 74, 60, 75, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -30, -30, -30, -30, 60, -30, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -30, -30, -30, -30, -30,
-
- 5, -31, -31, -31, -31, -31, -31, -31, -31, -31,
- -31, -31, -31, -31, -31, -31, -31, -31, -31, -31,
- -31, -31, -31, -31, -31, -31, -31, -31, -31, -31,
- -31, -31, -31, -31, -31, -31, -31, -31, -31, -31,
- -31, -31, -31, -31, -31, -31, -31, -31, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -31, -31,
- -31, -31, -31, -31, -31, 60, 60, 60, 60, 76,
- 60, 60, 60, 60, 60, 60, 77, 60, 60, 78,
- 60, 60, 79, 60, 60, 60, 60, 60, 60, 60,
- 60, -31, -31, -31, -31, 60, -31, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -31, -31, -31, -31, -31,
-
- 5, -32, -32, -32, -32, -32, -32, -32, -32, -32,
- -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
- -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
- -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
- -32, -32, -32, -32, -32, -32, -32, -32, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -32, -32,
- -32, -32, -32, -32, -32, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -32, -32, -32, -32, 60, -32, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -32, -32, -32, -32, -32,
-
- 5, -33, -33, -33, -33, -33, -33, -33, -33, -33,
- -33, -33, -33, -33, -33, -33, -33, -33, -33, -33,
- -33, -33, -33, -33, -33, -33, -33, -33, -33, -33,
- -33, -33, -33, -33, -33, -33, -33, -33, -33, -33,
- -33, -33, -33, -33, -33, -33, -33, -33, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -33, -33,
- -33, -33, -33, -33, -33, 60, 60, 60, 60, 60,
- 80, 60, 60, 60, 60, 60, 60, 60, 81, 60,
- 60, 60, 60, 82, 60, 60, 60, 60, 60, 60,
- 60, -33, -33, -33, -33, 60, -33, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -33, -33, -33, -33, -33,
-
- 5, -34, -34, -34, -34, -34, -34, -34, -34, -34,
- -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,
- -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,
- -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,
- -34, -34, -34, -34, -34, -34, -34, -34, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -34, -34,
- -34, -34, -34, -34, -34, 60, 60, 60, 60, 83,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 84,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -34, -34, -34, -34, 60, -34, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -34, -34, -34, -34, -34,
-
- 5, -35, -35, -35, -35, -35, -35, -35, -35, -35,
- -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
- -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
- -35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
- -35, -35, -35, -35, -35, -35, -35, -35, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -35, -35,
- -35, -35, -35, -35, -35, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 85,
- 60, 60, 60, 60, 60, 86, 60, 60, 60, 60,
- 60, -35, -35, -35, -35, 60, -35, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -35, -35, -35, -35, -35,
-
- 5, -36, -36, -36, -36, -36, -36, -36, -36, -36,
- -36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
- -36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
- -36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
- -36, -36, -36, -36, -36, -36, -36, -36, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -36, -36,
- -36, -36, -36, -36, -36, 60, 60, 60, 60, 60,
- 87, 60, 60, 60, 60, 60, 60, 60, 88, 60,
- 89, 60, 90, 60, 60, 91, 60, 60, 60, 60,
- 60, -36, -36, -36, -36, 60, -36, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -36, -36, -36, -36, -36,
-
- 5, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -37, -37, -37, -37, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -37, -37,
- -37, -37, -37, -37, -37, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 92, 60, 60, 60, 60, 60, 60, 60,
- 60, -37, -37, -37, -37, 60, -37, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -37, -37, -37, -37, -37,
-
- 5, -38, -38, -38, -38, -38, -38, -38, -38, -38,
- -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
- -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
- -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
- -38, -38, -38, -38, -38, -38, -38, -38, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -38, -38,
- -38, -38, -38, -38, -38, 60, 60, 60, 60, 93,
- 60, 60, 60, 60, 60, 60, 60, 60, 94, 95,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -38, -38, -38, -38, 60, -38, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -38, -38, -38, -38, -38,
-
- 5, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -39, -39,
- -39, -39, -39, -39, -39, 60, 60, 60, 60, 96,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 97, 60, 60, 60, 98, 60, 60, 60, 99,
- 60, -39, -39, -39, -39, 60, -39, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -39, -39, -39, -39, -39,
-
- 5, -40, -40, -40, -40, -40, -40, -40, -40, -40,
- -40, -40, -40, -40, -40, -40, -40, -40, -40, -40,
- -40, -40, -40, -40, -40, -40, -40, -40, -40, -40,
- -40, -40, -40, -40, -40, -40, -40, -40, -40, -40,
- -40, -40, -40, -40, -40, -40, -40, -40, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -40, -40,
- -40, -40, -40, -40, -40, 100, 60, 60, 60, 60,
- 60, 60, 101, 60, 60, 60, 60, 60, 60, 102,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -40, -40, -40, -40, 60, -40, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -40, -40, -40, -40, -40,
-
- 5, -41, -41, -41, -41, -41, -41, -41, -41, -41,
- -41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
- -41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
- -41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
- -41, -41, -41, -41, -41, -41, -41, -41, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -41, -41,
- -41, -41, -41, -41, -41, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 103, 60,
- 104, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -41, -41, -41, -41, 60, -41, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -41, -41, -41, -41, -41,
-
- 5, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -42, -42,
- -42, -42, -42, -42, -42, 105, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -42, -42, -42, -42, 60, -42, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -42, -42, -42, -42, -42,
-
- 5, -43, -43, -43, -43, -43, -43, -43, -43, -43,
- -43, -43, -43, -43, -43, -43, -43, -43, -43, -43,
- -43, -43, -43, -43, -43, -43, -43, -43, -43, -43,
- -43, -43, -43, -43, -43, -43, -43, -43, -43, -43,
- -43, -43, -43, -43, -43, -43, -43, -43, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -43, -43,
- -43, -43, -43, -43, -43, 60, 60, 60, 60, 60,
- 60, 60, 106, 60, 60, 60, 60, 60, 60, 107,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -43, -43, -43, -43, 60, -43, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -43, -43, -43, -43, -43,
-
- 5, -44, -44, -44, -44, -44, -44, -44, -44, -44,
- -44, -44, -44, -44, -44, -44, -44, -44, -44, -44,
- -44, -44, -44, -44, -44, -44, -44, -44, -44, -44,
- -44, -44, -44, -44, -44, -44, -44, -44, -44, -44,
- -44, -44, -44, -44, -44, -44, -44, -44, -44, -44,
- -44, -44, -44, -44, -44, -44, -44, -44, -44, -44,
- -44, -44, -44, -44, -44, -44, -44, -44, -44, -44,
- -44, -44, -44, -44, -44, -44, -44, -44, -44, -44,
- -44, -44, -44, -44, -44, -44, -44, -44, -44, -44,
- -44, -44, -44, -44, -44, -44, -44, -44, -44, -44,
-
- -44, -44, -44, -44, -44, -44, -44, -44, -44, -44,
- -44, -44, -44, -44, -44, -44, -44, -44, -44, -44,
- -44, -44, -44, -44, -44, -44, -44, -44,
-
- 5, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
-
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
- -45, -45, -45, -45, -45, -45, -45, -45,
-
- 5, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 109, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, -46, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
-
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108,
-
- 5, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
-
- -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47, -47, -47, -47, -47, -47, -47, -47, -47,
- -47, -47, -47, -47, -47, -47, -47, -47,
-
- 5, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 111, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 112, 110, 110, 110, 110, 113, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
-
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110,
-
- 5, -49, -49, -49, -49, -49, -49, -49, -49, 49,
- 49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, 49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
-
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49,
-
- 5, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 51,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
-
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50,
-
- 5, -51, -51, -51, -51, -51, -51, -51, -51, -51,
- -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
- -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
- -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
- -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
- -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
- -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
- -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
- -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
- -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
-
- -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
- -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
- -51, -51, -51, -51, -51, -51, -51, -51,
-
- 5, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
-
- -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
- -52, -52, -52, -52, -52, -52, -52, -52,
-
- 5, -53, -53, -53, -53, -53, -53, -53, -53, -53,
- -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
- -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
- -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
- -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
- -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
- -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
- -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
- -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
- -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
-
- -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
- -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
- -53, -53, -53, -53, -53, -53, -53, -53,
-
- 5, -54, -54, -54, -54, -54, -54, -54, -54, -54,
- -54, -54, -54, -54, -54, -54, -54, -54, -54, -54,
- -54, -54, -54, -54, -54, -54, -54, -54, -54, -54,
- -54, -54, -54, -54, -54, -54, -54, -54, -54, -54,
- -54, -54, -54, -54, -54, -54, -54, -54, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114, -54, -54,
- -54, -54, -54, -54, -54, -54, -54, -54, -54, -54,
- -54, -54, -54, -54, -54, -54, -54, -54, -54, -54,
- -54, -54, -54, -54, -54, -54, -54, -54, -54, -54,
- -54, -54, -54, -54, -54, -54, -54, -54, -54, -54,
-
- -54, -54, -54, -54, -54, -54, -54, -54, -54, -54,
- -54, -54, -54, -54, -54, -54, -54, -54, -54, -54,
- -54, -54, -54, -54, -54, -54, -54, -54,
-
- 5, -55, -55, -55, -55, -55, -55, -55, -55, -55,
- -55, -55, -55, -55, -55, -55, -55, -55, -55, -55,
- -55, -55, -55, -55, -55, -55, -55, -55, -55, -55,
- -55, -55, -55, -55, -55, -55, -55, -55, -55, -55,
- -55, -55, -55, -55, -55, -55, 54, -55, 55, 55,
- 55, 55, 55, 55, 55, 55, 55, 55, -55, -55,
- -55, -55, -55, -55, -55, -55, -55, -55, -55, -55,
- -55, -55, -55, -55, -55, -55, -55, -55, -55, -55,
- -55, -55, -55, -55, -55, -55, -55, -55, -55, -55,
- -55, -55, -55, -55, -55, -55, -55, -55, -55, -55,
-
- -55, -55, -55, -55, -55, -55, -55, -55, -55, -55,
- -55, -55, -55, -55, -55, -55, -55, -55, -55, -55,
- -55, -55, -55, -55, -55, -55, -55, -55,
-
- 5, -56, -56, -56, -56, -56, -56, -56, -56, -56,
- -56, -56, -56, -56, -56, -56, -56, -56, -56, -56,
- -56, -56, -56, -56, -56, -56, -56, -56, -56, -56,
- -56, -56, -56, -56, -56, -56, -56, -56, -56, -56,
- -56, -56, -56, -56, -56, -56, -56, -56, -56, -56,
- -56, -56, -56, -56, -56, -56, -56, -56, -56, -56,
- -56, -56, -56, -56, -56, -56, -56, -56, -56, -56,
- -56, -56, -56, -56, -56, -56, -56, -56, -56, -56,
- -56, -56, -56, -56, -56, -56, -56, -56, -56, -56,
- -56, -56, -56, -56, -56, -56, -56, -56, -56, -56,
-
- -56, -56, -56, -56, -56, -56, -56, -56, -56, -56,
- -56, -56, -56, -56, -56, -56, -56, -56, -56, -56,
- -56, -56, -56, -56, -56, -56, -56, -56,
-
- 5, -57, -57, -57, -57, -57, -57, -57, -57, -57,
- -57, -57, -57, -57, -57, -57, -57, -57, -57, -57,
- -57, -57, -57, -57, -57, -57, -57, -57, -57, -57,
- -57, -57, -57, -57, -57, -57, -57, -57, -57, -57,
- -57, -57, -57, -57, -57, -57, -57, -57, -57, -57,
- -57, -57, -57, -57, -57, -57, -57, -57, -57, -57,
- -57, -57, -57, -57, -57, -57, -57, -57, -57, -57,
- -57, -57, -57, -57, -57, -57, -57, -57, -57, -57,
- -57, -57, -57, -57, -57, -57, -57, -57, -57, -57,
- -57, -57, -57, -57, -57, -57, -57, -57, -57, -57,
-
- -57, -57, -57, -57, -57, -57, -57, -57, -57, -57,
- -57, -57, -57, -57, -57, -57, -57, -57, -57, -57,
- -57, -57, -57, -57, -57, -57, -57, -57,
-
- 5, -58, -58, -58, -58, -58, -58, -58, -58, -58,
- -58, -58, -58, -58, -58, -58, -58, -58, -58, -58,
- -58, -58, -58, -58, -58, -58, -58, -58, -58, -58,
- -58, -58, -58, -58, -58, -58, -58, -58, -58, -58,
- -58, -58, -58, -58, -58, -58, -58, -58, -58, -58,
- -58, -58, -58, -58, -58, -58, -58, -58, -58, -58,
- -58, -58, -58, -58, -58, -58, -58, -58, -58, -58,
- -58, -58, -58, -58, -58, -58, -58, -58, -58, -58,
- -58, -58, -58, -58, -58, -58, -58, -58, -58, -58,
- -58, -58, -58, -58, -58, -58, -58, -58, -58, -58,
-
- -58, -58, -58, -58, -58, -58, -58, -58, -58, -58,
- -58, -58, -58, -58, -58, -58, -58, -58, -58, -58,
- -58, -58, -58, -58, -58, -58, -58, -58,
-
- 5, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
-
- -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
- -59, -59, -59, -59, -59, -59, -59, -59,
-
- 5, -60, -60, -60, -60, -60, -60, -60, -60, -60,
- -60, -60, -60, -60, -60, -60, -60, -60, -60, -60,
- -60, -60, -60, -60, -60, -60, -60, -60, -60, -60,
- -60, -60, -60, -60, -60, -60, -60, -60, -60, -60,
- -60, -60, -60, -60, -60, -60, -60, -60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -60, -60,
- -60, -60, -60, -60, -60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -60, -60, -60, -60, 60, -60, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -60, -60, -60, -60, -60,
-
- 5, -61, -61, -61, -61, -61, -61, -61, -61, -61,
- -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
- -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
- -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
- -61, -61, -61, -61, -61, -61, -61, -61, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -61, -61,
- -61, -61, -61, -61, -61, 60, 60, 60, 115, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -61, -61, -61, -61, 60, -61, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -61, -61, -61, -61, -61,
-
- 5, -62, -62, -62, -62, -62, -62, -62, -62, -62,
- -62, -62, -62, -62, -62, -62, -62, -62, -62, -62,
- -62, -62, -62, -62, -62, -62, -62, -62, -62, -62,
- -62, -62, -62, -62, -62, -62, -62, -62, -62, -62,
- -62, -62, -62, -62, -62, -62, -62, -62, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -62, -62,
- -62, -62, -62, -62, -62, 60, 60, 116, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 117, 60, 60, 60, 60, 60, 60,
- 60, -62, -62, -62, -62, 60, -62, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -62, -62, -62, -62, -62,
-
- 5, -63, -63, -63, -63, -63, -63, -63, -63, -63,
- -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
- -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
- -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
- -63, -63, -63, -63, -63, -63, -63, -63, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -63, -63,
- -63, -63, -63, -63, -63, 60, 60, 60, 60, 60,
- 60, 118, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -63, -63, -63, -63, 60, -63, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -63, -63, -63, -63, -63,
-
- 5, -64, -64, -64, -64, -64, -64, -64, -64, -64,
- -64, -64, -64, -64, -64, -64, -64, -64, -64, -64,
- -64, -64, -64, -64, -64, -64, -64, -64, -64, -64,
- -64, -64, -64, -64, -64, -64, -64, -64, -64, -64,
- -64, -64, -64, -64, -64, -64, -64, -64, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -64, -64,
- -64, -64, -64, -64, -64, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 119, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -64, -64, -64, -64, 60, -64, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -64, -64, -64, -64, -64,
-
- 5, -65, -65, -65, -65, -65, -65, -65, -65, -65,
- -65, -65, -65, -65, -65, -65, -65, -65, -65, -65,
- -65, -65, -65, -65, -65, -65, -65, -65, -65, -65,
- -65, -65, -65, -65, -65, -65, -65, -65, -65, -65,
- -65, -65, -65, -65, -65, -65, -65, -65, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -65, -65,
- -65, -65, -65, -65, -65, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -65, -65, -65, -65, 60, -65, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -65, -65, -65, -65, -65,
-
- 5, -66, -66, -66, -66, -66, -66, -66, -66, -66,
- -66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
- -66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
- -66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
- -66, -66, -66, -66, -66, -66, -66, -66, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -66, -66,
- -66, -66, -66, -66, -66, 120, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -66, -66, -66, -66, 60, -66, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -66, -66, -66, -66, -66,
-
- 5, -67, -67, -67, -67, -67, -67, -67, -67, -67,
- -67, -67, -67, -67, -67, -67, -67, -67, -67, -67,
- -67, -67, -67, -67, -67, -67, -67, -67, -67, -67,
- -67, -67, -67, -67, -67, -67, -67, -67, -67, -67,
- -67, -67, -67, -67, -67, -67, -67, -67, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -67, -67,
- -67, -67, -67, -67, -67, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 121,
- 60, 60, 60, 60, 60, 122, 60, 60, 60, 60,
- 60, -67, -67, -67, -67, 60, -67, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -67, -67, -67, -67, -67,
-
- 5, -68, -68, -68, -68, -68, -68, -68, -68, -68,
- -68, -68, -68, -68, -68, -68, -68, -68, -68, -68,
- -68, -68, -68, -68, -68, -68, -68, -68, -68, -68,
- -68, -68, -68, -68, -68, -68, -68, -68, -68, -68,
- -68, -68, -68, -68, -68, -68, -68, -68, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -68, -68,
- -68, -68, -68, -68, -68, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 123, 124, 60,
- 60, 60, 60, 60, 60, 125, 60, 60, 60, 60,
- 60, -68, -68, -68, -68, 60, -68, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -68, -68, -68, -68, -68,
-
- 5, -69, -69, -69, -69, -69, -69, -69, -69, -69,
- -69, -69, -69, -69, -69, -69, -69, -69, -69, -69,
- -69, -69, -69, -69, -69, -69, -69, -69, -69, -69,
- -69, -69, -69, -69, -69, -69, -69, -69, -69, -69,
- -69, -69, -69, -69, -69, -69, -69, -69, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -69, -69,
- -69, -69, -69, -69, -69, 60, 60, 60, 60, 126,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -69, -69, -69, -69, 60, -69, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -69, -69, -69, -69, -69,
-
- 5, -70, -70, -70, -70, -70, -70, -70, -70, -70,
- -70, -70, -70, -70, -70, -70, -70, -70, -70, -70,
- -70, -70, -70, -70, -70, -70, -70, -70, -70, -70,
- -70, -70, -70, -70, -70, -70, -70, -70, -70, -70,
- -70, -70, -70, -70, -70, -70, -70, -70, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -70, -70,
- -70, -70, -70, -70, -70, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 127, 60, 60, 60, 60, 60, 60, 60,
- 60, -70, -70, -70, -70, 60, -70, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -70, -70, -70, -70, -70,
-
- 5, -71, -71, -71, -71, -71, -71, -71, -71, -71,
- -71, -71, -71, -71, -71, -71, -71, -71, -71, -71,
- -71, -71, -71, -71, -71, -71, -71, -71, -71, -71,
- -71, -71, -71, -71, -71, -71, -71, -71, -71, -71,
- -71, -71, -71, -71, -71, -71, -71, -71, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -71, -71,
- -71, -71, -71, -71, -71, 60, 60, 128, 60, 60,
- 60, 60, 60, 60, 60, 60, 129, 60, 60, 60,
- 60, 60, 60, 130, 60, 60, 60, 60, 60, 60,
- 60, -71, -71, -71, -71, 60, -71, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -71, -71, -71, -71, -71,
-
- 5, -72, -72, -72, -72, -72, -72, -72, -72, -72,
- -72, -72, -72, -72, -72, -72, -72, -72, -72, -72,
- -72, -72, -72, -72, -72, -72, -72, -72, -72, -72,
- -72, -72, -72, -72, -72, -72, -72, -72, -72, -72,
- -72, -72, -72, -72, -72, -72, -72, -72, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -72, -72,
- -72, -72, -72, -72, -72, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 131, 60, 60, 60, 60, 60, 60,
- 60, -72, -72, -72, -72, 60, -72, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -72, -72, -72, -72, -72,
-
- 5, -73, -73, -73, -73, -73, -73, -73, -73, -73,
- -73, -73, -73, -73, -73, -73, -73, -73, -73, -73,
- -73, -73, -73, -73, -73, -73, -73, -73, -73, -73,
- -73, -73, -73, -73, -73, -73, -73, -73, -73, -73,
- -73, -73, -73, -73, -73, -73, -73, -73, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -73, -73,
- -73, -73, -73, -73, -73, 60, 60, 60, 60, 132,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -73, -73, -73, -73, 60, -73, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -73, -73, -73, -73, -73,
-
- 5, -74, -74, -74, -74, -74, -74, -74, -74, -74,
- -74, -74, -74, -74, -74, -74, -74, -74, -74, -74,
- -74, -74, -74, -74, -74, -74, -74, -74, -74, -74,
- -74, -74, -74, -74, -74, -74, -74, -74, -74, -74,
- -74, -74, -74, -74, -74, -74, -74, -74, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -74, -74,
- -74, -74, -74, -74, -74, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 133, 60, 60, 60, 60, 60, 60,
- 60, -74, -74, -74, -74, 60, -74, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -74, -74, -74, -74, -74,
-
- 5, -75, -75, -75, -75, -75, -75, -75, -75, -75,
- -75, -75, -75, -75, -75, -75, -75, -75, -75, -75,
- -75, -75, -75, -75, -75, -75, -75, -75, -75, -75,
- -75, -75, -75, -75, -75, -75, -75, -75, -75, -75,
- -75, -75, -75, -75, -75, -75, -75, -75, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -75, -75,
- -75, -75, -75, -75, -75, 60, 60, 60, 134, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -75, -75, -75, -75, 60, -75, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -75, -75, -75, -75, -75,
-
- 5, -76, -76, -76, -76, -76, -76, -76, -76, -76,
- -76, -76, -76, -76, -76, -76, -76, -76, -76, -76,
- -76, -76, -76, -76, -76, -76, -76, -76, -76, -76,
- -76, -76, -76, -76, -76, -76, -76, -76, -76, -76,
- -76, -76, -76, -76, -76, -76, -76, -76, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -76, -76,
- -76, -76, -76, -76, -76, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 135, 60, 60, 60, 60, 60,
- 60, -76, -76, -76, -76, 60, -76, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -76, -76, -76, -76, -76,
-
- 5, -77, -77, -77, -77, -77, -77, -77, -77, -77,
- -77, -77, -77, -77, -77, -77, -77, -77, -77, -77,
- -77, -77, -77, -77, -77, -77, -77, -77, -77, -77,
- -77, -77, -77, -77, -77, -77, -77, -77, -77, -77,
- -77, -77, -77, -77, -77, -77, -77, -77, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -77, -77,
- -77, -77, -77, -77, -77, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 136,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -77, -77, -77, -77, 60, -77, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -77, -77, -77, -77, -77,
-
- 5, -78, -78, -78, -78, -78, -78, -78, -78, -78,
- -78, -78, -78, -78, -78, -78, -78, -78, -78, -78,
- -78, -78, -78, -78, -78, -78, -78, -78, -78, -78,
- -78, -78, -78, -78, -78, -78, -78, -78, -78, -78,
- -78, -78, -78, -78, -78, -78, -78, -78, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -78, -78,
- -78, -78, -78, -78, -78, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 137, 60, 60, 60, 60, 60, 60, 60,
- 60, -78, -78, -78, -78, 60, -78, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -78, -78, -78, -78, -78,
-
- 5, -79, -79, -79, -79, -79, -79, -79, -79, -79,
- -79, -79, -79, -79, -79, -79, -79, -79, -79, -79,
- -79, -79, -79, -79, -79, -79, -79, -79, -79, -79,
- -79, -79, -79, -79, -79, -79, -79, -79, -79, -79,
- -79, -79, -79, -79, -79, -79, -79, -79, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -79, -79,
- -79, -79, -79, -79, -79, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 138,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -79, -79, -79, -79, 60, -79, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -79, -79, -79, -79, -79,
-
- 5, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
- -80, -80, -80, -80, -80, -80, -80, -80, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -80, -80,
- -80, -80, -80, -80, -80, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -80, -80, -80, -80, 60, -80, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -80, -80, -80, -80, -80,
-
- 5, -81, -81, -81, -81, -81, -81, -81, -81, -81,
- -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
- -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
- -81, -81, -81, -81, -81, -81, -81, -81, -81, -81,
- -81, -81, -81, -81, -81, -81, -81, -81, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -81, -81,
- -81, -81, -81, -81, -81, 60, 60, 60, 139, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 140, 141, 60, 60, 60, 60, 60,
- 60, -81, -81, -81, -81, 60, -81, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -81, -81, -81, -81, -81,
-
- 5, -82, -82, -82, -82, -82, -82, -82, -82, -82,
- -82, -82, -82, -82, -82, -82, -82, -82, -82, -82,
- -82, -82, -82, -82, -82, -82, -82, -82, -82, -82,
- -82, -82, -82, -82, -82, -82, -82, -82, -82, -82,
- -82, -82, -82, -82, -82, -82, -82, -82, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -82, -82,
- -82, -82, -82, -82, -82, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -82, -82, -82, -82, 60, -82, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -82, -82, -82, -82, -82,
-
- 5, -83, -83, -83, -83, -83, -83, -83, -83, -83,
- -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
- -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
- -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
- -83, -83, -83, -83, -83, -83, -83, -83, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -83, -83,
- -83, -83, -83, -83, -83, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 142, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -83, -83, -83, -83, 60, -83, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -83, -83, -83, -83, -83,
-
- 5, -84, -84, -84, -84, -84, -84, -84, -84, -84,
- -84, -84, -84, -84, -84, -84, -84, -84, -84, -84,
- -84, -84, -84, -84, -84, -84, -84, -84, -84, -84,
- -84, -84, -84, -84, -84, -84, -84, -84, -84, -84,
- -84, -84, -84, -84, -84, -84, -84, -84, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -84, -84,
- -84, -84, -84, -84, -84, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 143,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -84, -84, -84, -84, 60, -84, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -84, -84, -84, -84, -84,
-
- 5, -85, -85, -85, -85, -85, -85, -85, -85, -85,
- -85, -85, -85, -85, -85, -85, -85, -85, -85, -85,
- -85, -85, -85, -85, -85, -85, -85, -85, -85, -85,
- -85, -85, -85, -85, -85, -85, -85, -85, -85, -85,
- -85, -85, -85, -85, -85, -85, -85, -85, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -85, -85,
- -85, -85, -85, -85, -85, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 144, 60, 60, 60, 60, 60,
- 60, -85, -85, -85, -85, 60, -85, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -85, -85, -85, -85, -85,
-
- 5, -86, -86, -86, -86, -86, -86, -86, -86, -86,
- -86, -86, -86, -86, -86, -86, -86, -86, -86, -86,
- -86, -86, -86, -86, -86, -86, -86, -86, -86, -86,
- -86, -86, -86, -86, -86, -86, -86, -86, -86, -86,
- -86, -86, -86, -86, -86, -86, -86, -86, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -86, -86,
- -86, -86, -86, -86, -86, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 145, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -86, -86, -86, -86, 60, -86, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -86, -86, -86, -86, -86,
-
- 5, -87, -87, -87, -87, -87, -87, -87, -87, -87,
- -87, -87, -87, -87, -87, -87, -87, -87, -87, -87,
- -87, -87, -87, -87, -87, -87, -87, -87, -87, -87,
- -87, -87, -87, -87, -87, -87, -87, -87, -87, -87,
- -87, -87, -87, -87, -87, -87, -87, -87, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -87, -87,
- -87, -87, -87, -87, -87, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -87, -87, -87, -87, 60, -87, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -87, -87, -87, -87, -87,
-
- 5, -88, -88, -88, -88, -88, -88, -88, -88, -88,
- -88, -88, -88, -88, -88, -88, -88, -88, -88, -88,
- -88, -88, -88, -88, -88, -88, -88, -88, -88, -88,
- -88, -88, -88, -88, -88, -88, -88, -88, -88, -88,
- -88, -88, -88, -88, -88, -88, -88, -88, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -88, -88,
- -88, -88, -88, -88, -88, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -88, -88, -88, -88, 60, -88, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -88, -88, -88, -88, -88,
-
- 5, -89, -89, -89, -89, -89, -89, -89, -89, -89,
- -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
- -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
- -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
- -89, -89, -89, -89, -89, -89, -89, -89, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -89, -89,
- -89, -89, -89, -89, -89, 60, 60, 60, 60, 146,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -89, -89, -89, -89, 60, -89, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -89, -89, -89, -89, -89,
-
- 5, -90, -90, -90, -90, -90, -90, -90, -90, -90,
- -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
- -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
- -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
- -90, -90, -90, -90, -90, -90, -90, -90, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -90, -90,
- -90, -90, -90, -90, -90, 60, 60, 60, 147, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -90, -90, -90, -90, 60, -90, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -90, -90, -90, -90, -90,
-
- 5, -91, -91, -91, -91, -91, -91, -91, -91, -91,
- -91, -91, -91, -91, -91, -91, -91, -91, -91, -91,
- -91, -91, -91, -91, -91, -91, -91, -91, -91, -91,
- -91, -91, -91, -91, -91, -91, -91, -91, -91, -91,
- -91, -91, -91, -91, -91, -91, -91, -91, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -91, -91,
- -91, -91, -91, -91, -91, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 148, 60, 60, 60, 60, 60,
- 60, -91, -91, -91, -91, 60, -91, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -91, -91, -91, -91, -91,
-
- 5, -92, -92, -92, -92, -92, -92, -92, -92, -92,
- -92, -92, -92, -92, -92, -92, -92, -92, -92, -92,
- -92, -92, -92, -92, -92, -92, -92, -92, -92, -92,
- -92, -92, -92, -92, -92, -92, -92, -92, -92, -92,
- -92, -92, -92, -92, -92, -92, -92, -92, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -92, -92,
- -92, -92, -92, -92, -92, 60, 60, 60, 60, 60,
- 60, 60, 60, 149, 60, 60, 60, 60, 60, 150,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -92, -92, -92, -92, 60, -92, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -92, -92, -92, -92, -92,
-
- 5, -93, -93, -93, -93, -93, -93, -93, -93, -93,
- -93, -93, -93, -93, -93, -93, -93, -93, -93, -93,
- -93, -93, -93, -93, -93, -93, -93, -93, -93, -93,
- -93, -93, -93, -93, -93, -93, -93, -93, -93, -93,
- -93, -93, -93, -93, -93, -93, -93, -93, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -93, -93,
- -93, -93, -93, -93, -93, 151, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 152, 60, 60, 60, 153, 60, 60, 60, 60, 60,
- 60, -93, -93, -93, -93, 60, -93, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -93, -93, -93, -93, -93,
-
- 5, -94, -94, -94, -94, -94, -94, -94, -94, -94,
- -94, -94, -94, -94, -94, -94, -94, -94, -94, -94,
- -94, -94, -94, -94, -94, -94, -94, -94, -94, -94,
- -94, -94, -94, -94, -94, -94, -94, -94, -94, -94,
- -94, -94, -94, -94, -94, -94, -94, -94, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -94, -94,
- -94, -94, -94, -94, -94, 60, 60, 60, 154, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -94, -94, -94, -94, 60, -94, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -94, -94, -94, -94, -94,
-
- 5, -95, -95, -95, -95, -95, -95, -95, -95, -95,
- -95, -95, -95, -95, -95, -95, -95, -95, -95, -95,
- -95, -95, -95, -95, -95, -95, -95, -95, -95, -95,
- -95, -95, -95, -95, -95, -95, -95, -95, -95, -95,
- -95, -95, -95, -95, -95, -95, -95, -95, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -95, -95,
- -95, -95, -95, -95, -95, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 155, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 156, 60, 60,
- 60, -95, -95, -95, -95, 60, -95, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -95, -95, -95, -95, -95,
-
- 5, -96, -96, -96, -96, -96, -96, -96, -96, -96,
- -96, -96, -96, -96, -96, -96, -96, -96, -96, -96,
- -96, -96, -96, -96, -96, -96, -96, -96, -96, -96,
- -96, -96, -96, -96, -96, -96, -96, -96, -96, -96,
- -96, -96, -96, -96, -96, -96, -96, -96, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -96, -96,
- -96, -96, -96, -96, -96, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 157, 60, 60, 60,
- 60, 60, 60, 60, 158, 60, 60, 60, 60, 60,
- 60, -96, -96, -96, -96, 60, -96, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -96, -96, -96, -96, -96,
-
- 5, -97, -97, -97, -97, -97, -97, -97, -97, -97,
- -97, -97, -97, -97, -97, -97, -97, -97, -97, -97,
- -97, -97, -97, -97, -97, -97, -97, -97, -97, -97,
- -97, -97, -97, -97, -97, -97, -97, -97, -97, -97,
- -97, -97, -97, -97, -97, -97, -97, -97, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -97, -97,
- -97, -97, -97, -97, -97, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 159, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -97, -97, -97, -97, 60, -97, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -97, -97, -97, -97, -97,
-
- 5, -98, -98, -98, -98, -98, -98, -98, -98, -98,
- -98, -98, -98, -98, -98, -98, -98, -98, -98, -98,
- -98, -98, -98, -98, -98, -98, -98, -98, -98, -98,
- -98, -98, -98, -98, -98, -98, -98, -98, -98, -98,
- -98, -98, -98, -98, -98, -98, -98, -98, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -98, -98,
- -98, -98, -98, -98, -98, 60, 160, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 161, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -98, -98, -98, -98, 60, -98, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -98, -98, -98, -98, -98,
-
- 5, -99, -99, -99, -99, -99, -99, -99, -99, -99,
- -99, -99, -99, -99, -99, -99, -99, -99, -99, -99,
- -99, -99, -99, -99, -99, -99, -99, -99, -99, -99,
- -99, -99, -99, -99, -99, -99, -99, -99, -99, -99,
- -99, -99, -99, -99, -99, -99, -99, -99, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -99, -99,
- -99, -99, -99, -99, -99, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 162, 60, 60, 60, 60, 60, 60,
- 60, -99, -99, -99, -99, 60, -99, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -99, -99, -99, -99, -99,
-
- 5, -100, -100, -100, -100, -100, -100, -100, -100, -100,
- -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,
- -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,
- -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,
- -100, -100, -100, -100, -100, -100, -100, -100, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -100, -100,
- -100, -100, -100, -100, -100, 60, 163, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -100, -100, -100, -100, 60, -100, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -100, -100, -100, -100, -100,
-
- 5, -101, -101, -101, -101, -101, -101, -101, -101, -101,
- -101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
- -101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
- -101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
- -101, -101, -101, -101, -101, -101, -101, -101, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -101, -101,
- -101, -101, -101, -101, -101, 60, 60, 60, 60, 164,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -101, -101, -101, -101, 60, -101, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -101, -101, -101, -101, -101,
-
- 5, -102, -102, -102, -102, -102, -102, -102, -102, -102,
- -102, -102, -102, -102, -102, -102, -102, -102, -102, -102,
- -102, -102, -102, -102, -102, -102, -102, -102, -102, -102,
- -102, -102, -102, -102, -102, -102, -102, -102, -102, -102,
- -102, -102, -102, -102, -102, -102, -102, -102, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -102, -102,
- -102, -102, -102, -102, -102, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -102, -102, -102, -102, 165, -102, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -102, -102, -102, -102, -102,
-
- 5, -103, -103, -103, -103, -103, -103, -103, -103, -103,
- -103, -103, -103, -103, -103, -103, -103, -103, -103, -103,
- -103, -103, -103, -103, -103, -103, -103, -103, -103, -103,
- -103, -103, -103, -103, -103, -103, -103, -103, -103, -103,
- -103, -103, -103, -103, -103, -103, -103, -103, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -103, -103,
- -103, -103, -103, -103, -103, 60, 60, 60, 60, 60,
- 60, 60, 60, 166, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -103, -103, -103, -103, 60, -103, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -103, -103, -103, -103, -103,
-
- 5, -104, -104, -104, -104, -104, -104, -104, -104, -104,
- -104, -104, -104, -104, -104, -104, -104, -104, -104, -104,
- -104, -104, -104, -104, -104, -104, -104, -104, -104, -104,
- -104, -104, -104, -104, -104, -104, -104, -104, -104, -104,
- -104, -104, -104, -104, -104, -104, -104, -104, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -104, -104,
- -104, -104, -104, -104, -104, 60, 60, 60, 167, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -104, -104, -104, -104, 60, -104, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -104, -104, -104, -104, -104,
-
- 5, -105, -105, -105, -105, -105, -105, -105, -105, -105,
- -105, -105, -105, -105, -105, -105, -105, -105, -105, -105,
- -105, -105, -105, -105, -105, -105, -105, -105, -105, -105,
- -105, -105, -105, -105, -105, -105, -105, -105, -105, -105,
- -105, -105, -105, -105, -105, -105, -105, -105, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -105, -105,
- -105, -105, -105, -105, -105, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 168, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -105, -105, -105, -105, 60, -105, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -105, -105, -105, -105, -105,
-
- 5, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, -106, -106, -106, -106, -106, -106, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -106, -106,
- -106, -106, -106, -106, -106, 60, 60, 60, 60, 169,
- 60, 60, 60, 170, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -106, -106, -106, -106, 60, -106, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -106, -106, -106, -106, -106,
-
- 5, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,
- -107, -107, -107, -107, -107, -107, -107, -107, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -107, -107,
- -107, -107, -107, -107, -107, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 171, 60, 60, 60, 60, 60, 60, 60,
- 60, -107, -107, -107, -107, 60, -107, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -107, -107, -107, -107, -107,
-
- 5, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 109, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, -108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
-
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108,
-
- 5, -109, -109, -109, -109, -109, -109, -109, -109, -109,
- -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
- -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
- -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
- -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
- -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
- -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
- -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
- -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
- -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
-
- -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
- -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
- -109, -109, -109, -109, -109, -109, -109, -109,
-
- 5, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 111, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, -110, 110, 110, 110, 110, -110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
-
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110,
-
- 5, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
-
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111,
-
- 5, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 111, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 112, 110, 110, 110, 110, 113, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
-
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110,
-
- 5, -113, -113, -113, -113, -113, -113, -113, -113, -113,
- -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
- -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
- -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
- -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
- -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
- -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
- -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
- -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
- -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
-
- -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
- -113, -113, -113, -113, -113, -113, -113, -113, -113, -113,
- -113, -113, -113, -113, -113, -113, -113, -113,
-
- 5, -114, -114, -114, -114, -114, -114, -114, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, -114, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, -114, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, -114, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, -114, 114, 114,
- 114, 114, 114, 114, 114, 114, 114, 114, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, -114, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, -114, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, -114, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, -114, -114, -114,
-
- -114, -114, -114, -114, -114, -114, -114, -114, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, -114, -114, -114,
- -114, -114, -114, -114, -114, -114, -114, -114,
-
- 5, -115, -115, -115, -115, -115, -115, -115, -115, -115,
- -115, -115, -115, -115, -115, -115, -115, -115, -115, -115,
- -115, -115, -115, -115, -115, -115, -115, -115, -115, -115,
- -115, -115, -115, -115, -115, -115, -115, -115, -115, -115,
- -115, -115, -115, -115, -115, -115, -115, -115, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -115, -115,
- -115, -115, -115, -115, -115, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -115, -115, -115, -115, 60, -115, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -115, -115, -115, -115, -115,
-
- 5, -116, -116, -116, -116, -116, -116, -116, -116, -116,
- -116, -116, -116, -116, -116, -116, -116, -116, -116, -116,
- -116, -116, -116, -116, -116, -116, -116, -116, -116, -116,
- -116, -116, -116, -116, -116, -116, -116, -116, -116, -116,
- -116, -116, -116, -116, -116, -116, -116, -116, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -116, -116,
- -116, -116, -116, -116, -116, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -116, -116, -116, -116, 60, -116, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -116, -116, -116, -116, -116,
-
- 5, -117, -117, -117, -117, -117, -117, -117, -117, -117,
- -117, -117, -117, -117, -117, -117, -117, -117, -117, -117,
- -117, -117, -117, -117, -117, -117, -117, -117, -117, -117,
- -117, -117, -117, -117, -117, -117, -117, -117, -117, -117,
- -117, -117, -117, -117, -117, -117, -117, -117, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -117, -117,
- -117, -117, -117, -117, -117, 60, 60, 60, 60, 172,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -117, -117, -117, -117, 60, -117, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -117, -117, -117, -117, -117,
-
- 5, -118, -118, -118, -118, -118, -118, -118, -118, -118,
- -118, -118, -118, -118, -118, -118, -118, -118, -118, -118,
- -118, -118, -118, -118, -118, -118, -118, -118, -118, -118,
- -118, -118, -118, -118, -118, -118, -118, -118, -118, -118,
- -118, -118, -118, -118, -118, -118, -118, -118, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -118, -118,
- -118, -118, -118, -118, -118, 60, 60, 60, 60, 60,
- 60, 60, 60, 173, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -118, -118, -118, -118, 60, -118, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -118, -118, -118, -118, -118,
-
- 5, -119, -119, -119, -119, -119, -119, -119, -119, -119,
- -119, -119, -119, -119, -119, -119, -119, -119, -119, -119,
- -119, -119, -119, -119, -119, -119, -119, -119, -119, -119,
- -119, -119, -119, -119, -119, -119, -119, -119, -119, -119,
- -119, -119, -119, -119, -119, -119, -119, -119, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -119, -119,
- -119, -119, -119, -119, -119, 174, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -119, -119, -119, -119, 60, -119, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -119, -119, -119, -119, -119,
-
- 5, -120, -120, -120, -120, -120, -120, -120, -120, -120,
- -120, -120, -120, -120, -120, -120, -120, -120, -120, -120,
- -120, -120, -120, -120, -120, -120, -120, -120, -120, -120,
- -120, -120, -120, -120, -120, -120, -120, -120, -120, -120,
- -120, -120, -120, -120, -120, -120, -120, -120, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -120, -120,
- -120, -120, -120, -120, -120, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 175, 60, 60, 60, 60, 60, 60, 60,
- 60, -120, -120, -120, -120, 60, -120, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -120, -120, -120, -120, -120,
-
- 5, -121, -121, -121, -121, -121, -121, -121, -121, -121,
- -121, -121, -121, -121, -121, -121, -121, -121, -121, -121,
- -121, -121, -121, -121, -121, -121, -121, -121, -121, -121,
- -121, -121, -121, -121, -121, -121, -121, -121, -121, -121,
- -121, -121, -121, -121, -121, -121, -121, -121, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -121, -121,
- -121, -121, -121, -121, -121, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 176, 60, 60, 60, 60, 60, 60,
- 60, -121, -121, -121, -121, 60, -121, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -121, -121, -121, -121, -121,
-
- 5, -122, -122, -122, -122, -122, -122, -122, -122, -122,
- -122, -122, -122, -122, -122, -122, -122, -122, -122, -122,
- -122, -122, -122, -122, -122, -122, -122, -122, -122, -122,
- -122, -122, -122, -122, -122, -122, -122, -122, -122, -122,
- -122, -122, -122, -122, -122, -122, -122, -122, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -122, -122,
- -122, -122, -122, -122, -122, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 177, 60, 60, 60, 60, 60, 60,
- 60, -122, -122, -122, -122, 60, -122, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -122, -122, -122, -122, -122,
-
- 5, -123, -123, -123, -123, -123, -123, -123, -123, -123,
- -123, -123, -123, -123, -123, -123, -123, -123, -123, -123,
- -123, -123, -123, -123, -123, -123, -123, -123, -123, -123,
- -123, -123, -123, -123, -123, -123, -123, -123, -123, -123,
- -123, -123, -123, -123, -123, -123, -123, -123, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -123, -123,
- -123, -123, -123, -123, -123, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 178, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -123, -123, -123, -123, 60, -123, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -123, -123, -123, -123, -123,
-
- 5, -124, -124, -124, -124, -124, -124, -124, -124, -124,
- -124, -124, -124, -124, -124, -124, -124, -124, -124, -124,
- -124, -124, -124, -124, -124, -124, -124, -124, -124, -124,
- -124, -124, -124, -124, -124, -124, -124, -124, -124, -124,
- -124, -124, -124, -124, -124, -124, -124, -124, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -124, -124,
- -124, -124, -124, -124, -124, 60, 60, 179, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 180, 60, 60, 60, 60, 60, 60,
- 60, -124, -124, -124, -124, 60, -124, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -124, -124, -124, -124, -124,
-
- 5, -125, -125, -125, -125, -125, -125, -125, -125, -125,
- -125, -125, -125, -125, -125, -125, -125, -125, -125, -125,
- -125, -125, -125, -125, -125, -125, -125, -125, -125, -125,
- -125, -125, -125, -125, -125, -125, -125, -125, -125, -125,
- -125, -125, -125, -125, -125, -125, -125, -125, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -125, -125,
- -125, -125, -125, -125, -125, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 181, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -125, -125, -125, -125, 60, -125, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -125, -125, -125, -125, -125,
-
- 5, -126, -126, -126, -126, -126, -126, -126, -126, -126,
- -126, -126, -126, -126, -126, -126, -126, -126, -126, -126,
- -126, -126, -126, -126, -126, -126, -126, -126, -126, -126,
- -126, -126, -126, -126, -126, -126, -126, -126, -126, -126,
- -126, -126, -126, -126, -126, -126, -126, -126, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -126, -126,
- -126, -126, -126, -126, -126, 182, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -126, -126, -126, -126, 60, -126, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -126, -126, -126, -126, -126,
-
- 5, -127, -127, -127, -127, -127, -127, -127, -127, -127,
- -127, -127, -127, -127, -127, -127, -127, -127, -127, -127,
- -127, -127, -127, -127, -127, -127, -127, -127, -127, -127,
- -127, -127, -127, -127, -127, -127, -127, -127, -127, -127,
- -127, -127, -127, -127, -127, -127, -127, -127, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -127, -127,
- -127, -127, -127, -127, -127, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 183, 184, 60, 60, 60, 60, 60, 60,
- 60, -127, -127, -127, -127, 60, -127, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -127, -127, -127, -127, -127,
-
- 5, -128, -128, -128, -128, -128, -128, -128, -128, -128,
- -128, -128, -128, -128, -128, -128, -128, -128, -128, -128,
- -128, -128, -128, -128, -128, -128, -128, -128, -128, -128,
- -128, -128, -128, -128, -128, -128, -128, -128, -128, -128,
- -128, -128, -128, -128, -128, -128, -128, -128, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -128, -128,
- -128, -128, -128, -128, -128, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 185, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -128, -128, -128, -128, 60, -128, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -128, -128, -128, -128, -128,
-
- 5, -129, -129, -129, -129, -129, -129, -129, -129, -129,
- -129, -129, -129, -129, -129, -129, -129, -129, -129, -129,
- -129, -129, -129, -129, -129, -129, -129, -129, -129, -129,
- -129, -129, -129, -129, -129, -129, -129, -129, -129, -129,
- -129, -129, -129, -129, -129, -129, -129, -129, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -129, -129,
- -129, -129, -129, -129, -129, 60, 60, 60, 60, 186,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -129, -129, -129, -129, 60, -129, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -129, -129, -129, -129, -129,
-
- 5, -130, -130, -130, -130, -130, -130, -130, -130, -130,
- -130, -130, -130, -130, -130, -130, -130, -130, -130, -130,
- -130, -130, -130, -130, -130, -130, -130, -130, -130, -130,
- -130, -130, -130, -130, -130, -130, -130, -130, -130, -130,
- -130, -130, -130, -130, -130, -130, -130, -130, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -130, -130,
- -130, -130, -130, -130, -130, 60, 60, 187, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -130, -130, -130, -130, 60, -130, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -130, -130, -130, -130, -130,
-
- 5, -131, -131, -131, -131, -131, -131, -131, -131, -131,
- -131, -131, -131, -131, -131, -131, -131, -131, -131, -131,
- -131, -131, -131, -131, -131, -131, -131, -131, -131, -131,
- -131, -131, -131, -131, -131, -131, -131, -131, -131, -131,
- -131, -131, -131, -131, -131, -131, -131, -131, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -131, -131,
- -131, -131, -131, -131, -131, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 188, 60, 60, 60, 60, 60,
- 60, -131, -131, -131, -131, 60, -131, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -131, -131, -131, -131, -131,
-
- 5, -132, -132, -132, -132, -132, -132, -132, -132, -132,
- -132, -132, -132, -132, -132, -132, -132, -132, -132, -132,
- -132, -132, -132, -132, -132, -132, -132, -132, -132, -132,
- -132, -132, -132, -132, -132, -132, -132, -132, -132, -132,
- -132, -132, -132, -132, -132, -132, -132, -132, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -132, -132,
- -132, -132, -132, -132, -132, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 189, 60, 60, 60, 60, 60, 60,
- 60, -132, -132, -132, -132, 60, -132, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -132, -132, -132, -132, -132,
-
- 5, -133, -133, -133, -133, -133, -133, -133, -133, -133,
- -133, -133, -133, -133, -133, -133, -133, -133, -133, -133,
- -133, -133, -133, -133, -133, -133, -133, -133, -133, -133,
- -133, -133, -133, -133, -133, -133, -133, -133, -133, -133,
- -133, -133, -133, -133, -133, -133, -133, -133, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -133, -133,
- -133, -133, -133, -133, -133, 60, 60, 60, 60, 190,
- 60, 60, 60, 191, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -133, -133, -133, -133, 60, -133, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -133, -133, -133, -133, -133,
-
- 5, -134, -134, -134, -134, -134, -134, -134, -134, -134,
- -134, -134, -134, -134, -134, -134, -134, -134, -134, -134,
- -134, -134, -134, -134, -134, -134, -134, -134, -134, -134,
- -134, -134, -134, -134, -134, -134, -134, -134, -134, -134,
- -134, -134, -134, -134, -134, -134, -134, -134, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -134, -134,
- -134, -134, -134, -134, -134, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -134, -134, -134, -134, 60, -134, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -134, -134, -134, -134, -134,
-
- 5, -135, -135, -135, -135, -135, -135, -135, -135, -135,
- -135, -135, -135, -135, -135, -135, -135, -135, -135, -135,
- -135, -135, -135, -135, -135, -135, -135, -135, -135, -135,
- -135, -135, -135, -135, -135, -135, -135, -135, -135, -135,
- -135, -135, -135, -135, -135, -135, -135, -135, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -135, -135,
- -135, -135, -135, -135, -135, 60, 60, 192, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -135, -135, -135, -135, 60, -135, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -135, -135, -135, -135, -135,
-
- 5, -136, -136, -136, -136, -136, -136, -136, -136, -136,
- -136, -136, -136, -136, -136, -136, -136, -136, -136, -136,
- -136, -136, -136, -136, -136, -136, -136, -136, -136, -136,
- -136, -136, -136, -136, -136, -136, -136, -136, -136, -136,
- -136, -136, -136, -136, -136, -136, -136, -136, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -136, -136,
- -136, -136, -136, -136, -136, 193, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -136, -136, -136, -136, 60, -136, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -136, -136, -136, -136, -136,
-
- 5, -137, -137, -137, -137, -137, -137, -137, -137, -137,
- -137, -137, -137, -137, -137, -137, -137, -137, -137, -137,
- -137, -137, -137, -137, -137, -137, -137, -137, -137, -137,
- -137, -137, -137, -137, -137, -137, -137, -137, -137, -137,
- -137, -137, -137, -137, -137, -137, -137, -137, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -137, -137,
- -137, -137, -137, -137, -137, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -137, -137, -137, -137, 60, -137, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -137, -137, -137, -137, -137,
-
- 5, -138, -138, -138, -138, -138, -138, -138, -138, -138,
- -138, -138, -138, -138, -138, -138, -138, -138, -138, -138,
- -138, -138, -138, -138, -138, -138, -138, -138, -138, -138,
- -138, -138, -138, -138, -138, -138, -138, -138, -138, -138,
- -138, -138, -138, -138, -138, -138, -138, -138, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -138, -138,
- -138, -138, -138, -138, -138, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 194, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -138, -138, -138, -138, 60, -138, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -138, -138, -138, -138, -138,
-
- 5, -139, -139, -139, -139, -139, -139, -139, -139, -139,
- -139, -139, -139, -139, -139, -139, -139, -139, -139, -139,
- -139, -139, -139, -139, -139, -139, -139, -139, -139, -139,
- -139, -139, -139, -139, -139, -139, -139, -139, -139, -139,
- -139, -139, -139, -139, -139, -139, -139, -139, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -139, -139,
- -139, -139, -139, -139, -139, 60, 60, 60, 60, 195,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -139, -139, -139, -139, 60, -139, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -139, -139, -139, -139, -139,
-
- 5, -140, -140, -140, -140, -140, -140, -140, -140, -140,
- -140, -140, -140, -140, -140, -140, -140, -140, -140, -140,
- -140, -140, -140, -140, -140, -140, -140, -140, -140, -140,
- -140, -140, -140, -140, -140, -140, -140, -140, -140, -140,
- -140, -140, -140, -140, -140, -140, -140, -140, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -140, -140,
- -140, -140, -140, -140, -140, 60, 60, 60, 60, 196,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 197, 60, 60, 60, 60, 60,
- 60, -140, -140, -140, -140, 60, -140, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -140, -140, -140, -140, -140,
-
- 5, -141, -141, -141, -141, -141, -141, -141, -141, -141,
- -141, -141, -141, -141, -141, -141, -141, -141, -141, -141,
- -141, -141, -141, -141, -141, -141, -141, -141, -141, -141,
- -141, -141, -141, -141, -141, -141, -141, -141, -141, -141,
- -141, -141, -141, -141, -141, -141, -141, -141, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -141, -141,
- -141, -141, -141, -141, -141, 60, 60, 60, 60, 198,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 199,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -141, -141, -141, -141, 60, -141, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -141, -141, -141, -141, -141,
-
- 5, -142, -142, -142, -142, -142, -142, -142, -142, -142,
- -142, -142, -142, -142, -142, -142, -142, -142, -142, -142,
- -142, -142, -142, -142, -142, -142, -142, -142, -142, -142,
- -142, -142, -142, -142, -142, -142, -142, -142, -142, -142,
- -142, -142, -142, -142, -142, -142, -142, -142, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -142, -142,
- -142, -142, -142, -142, -142, 60, 60, 60, 60, 60,
- 60, 200, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -142, -142, -142, -142, 60, -142, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -142, -142, -142, -142, -142,
-
- 5, -143, -143, -143, -143, -143, -143, -143, -143, -143,
- -143, -143, -143, -143, -143, -143, -143, -143, -143, -143,
- -143, -143, -143, -143, -143, -143, -143, -143, -143, -143,
- -143, -143, -143, -143, -143, -143, -143, -143, -143, -143,
- -143, -143, -143, -143, -143, -143, -143, -143, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -143, -143,
- -143, -143, -143, -143, -143, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 201, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -143, -143, -143, -143, 60, -143, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -143, -143, -143, -143, -143,
-
- 5, -144, -144, -144, -144, -144, -144, -144, -144, -144,
- -144, -144, -144, -144, -144, -144, -144, -144, -144, -144,
- -144, -144, -144, -144, -144, -144, -144, -144, -144, -144,
- -144, -144, -144, -144, -144, -144, -144, -144, -144, -144,
- -144, -144, -144, -144, -144, -144, -144, -144, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -144, -144,
- -144, -144, -144, -144, -144, 60, 60, 60, 60, 60,
- 202, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -144, -144, -144, -144, 60, -144, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -144, -144, -144, -144, -144,
-
- 5, -145, -145, -145, -145, -145, -145, -145, -145, -145,
- -145, -145, -145, -145, -145, -145, -145, -145, -145, -145,
- -145, -145, -145, -145, -145, -145, -145, -145, -145, -145,
- -145, -145, -145, -145, -145, -145, -145, -145, -145, -145,
- -145, -145, -145, -145, -145, -145, -145, -145, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -145, -145,
- -145, -145, -145, -145, -145, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 203, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -145, -145, -145, -145, 60, -145, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -145, -145, -145, -145, -145,
-
- 5, -146, -146, -146, -146, -146, -146, -146, -146, -146,
- -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,
- -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,
- -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,
- -146, -146, -146, -146, -146, -146, -146, -146, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -146, -146,
- -146, -146, -146, -146, -146, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 204, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -146, -146, -146, -146, 60, -146, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -146, -146, -146, -146, -146,
-
- 5, -147, -147, -147, -147, -147, -147, -147, -147, -147,
- -147, -147, -147, -147, -147, -147, -147, -147, -147, -147,
- -147, -147, -147, -147, -147, -147, -147, -147, -147, -147,
- -147, -147, -147, -147, -147, -147, -147, -147, -147, -147,
- -147, -147, -147, -147, -147, -147, -147, -147, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -147, -147,
- -147, -147, -147, -147, -147, 60, 60, 60, 60, 205,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -147, -147, -147, -147, 60, -147, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -147, -147, -147, -147, -147,
-
- 5, -148, -148, -148, -148, -148, -148, -148, -148, -148,
- -148, -148, -148, -148, -148, -148, -148, -148, -148, -148,
- -148, -148, -148, -148, -148, -148, -148, -148, -148, -148,
- -148, -148, -148, -148, -148, -148, -148, -148, -148, -148,
- -148, -148, -148, -148, -148, -148, -148, -148, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -148, -148,
- -148, -148, -148, -148, -148, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -148, -148, -148, -148, 60, -148, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -148, -148, -148, -148, -148,
-
- 5, -149, -149, -149, -149, -149, -149, -149, -149, -149,
- -149, -149, -149, -149, -149, -149, -149, -149, -149, -149,
- -149, -149, -149, -149, -149, -149, -149, -149, -149, -149,
- -149, -149, -149, -149, -149, -149, -149, -149, -149, -149,
- -149, -149, -149, -149, -149, -149, -149, -149, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -149, -149,
- -149, -149, -149, -149, -149, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 206, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -149, -149, -149, -149, 60, -149, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -149, -149, -149, -149, -149,
-
- 5, -150, -150, -150, -150, -150, -150, -150, -150, -150,
- -150, -150, -150, -150, -150, -150, -150, -150, -150, -150,
- -150, -150, -150, -150, -150, -150, -150, -150, -150, -150,
- -150, -150, -150, -150, -150, -150, -150, -150, -150, -150,
- -150, -150, -150, -150, -150, -150, -150, -150, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -150, -150,
- -150, -150, -150, -150, -150, 60, 60, 207, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -150, -150, -150, -150, 60, -150, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -150, -150, -150, -150, -150,
-
- 5, -151, -151, -151, -151, -151, -151, -151, -151, -151,
- -151, -151, -151, -151, -151, -151, -151, -151, -151, -151,
- -151, -151, -151, -151, -151, -151, -151, -151, -151, -151,
- -151, -151, -151, -151, -151, -151, -151, -151, -151, -151,
- -151, -151, -151, -151, -151, -151, -151, -151, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -151, -151,
- -151, -151, -151, -151, -151, 60, 60, 60, 208, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -151, -151, -151, -151, 60, -151, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -151, -151, -151, -151, -151,
-
- 5, -152, -152, -152, -152, -152, -152, -152, -152, -152,
- -152, -152, -152, -152, -152, -152, -152, -152, -152, -152,
- -152, -152, -152, -152, -152, -152, -152, -152, -152, -152,
- -152, -152, -152, -152, -152, -152, -152, -152, -152, -152,
- -152, -152, -152, -152, -152, -152, -152, -152, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -152, -152,
- -152, -152, -152, -152, -152, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 209, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -152, -152, -152, -152, 60, -152, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -152, -152, -152, -152, -152,
-
- 5, -153, -153, -153, -153, -153, -153, -153, -153, -153,
- -153, -153, -153, -153, -153, -153, -153, -153, -153, -153,
- -153, -153, -153, -153, -153, -153, -153, -153, -153, -153,
- -153, -153, -153, -153, -153, -153, -153, -153, -153, -153,
- -153, -153, -153, -153, -153, -153, -153, -153, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -153, -153,
- -153, -153, -153, -153, -153, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 210, 60, 60, 60, 60,
- 60, -153, -153, -153, -153, 60, -153, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -153, -153, -153, -153, -153,
-
- 5, -154, -154, -154, -154, -154, -154, -154, -154, -154,
- -154, -154, -154, -154, -154, -154, -154, -154, -154, -154,
- -154, -154, -154, -154, -154, -154, -154, -154, -154, -154,
- -154, -154, -154, -154, -154, -154, -154, -154, -154, -154,
- -154, -154, -154, -154, -154, -154, -154, -154, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -154, -154,
- -154, -154, -154, -154, -154, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -154, -154, -154, -154, 211, -154, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -154, -154, -154, -154, -154,
-
- 5, -155, -155, -155, -155, -155, -155, -155, -155, -155,
- -155, -155, -155, -155, -155, -155, -155, -155, -155, -155,
- -155, -155, -155, -155, -155, -155, -155, -155, -155, -155,
- -155, -155, -155, -155, -155, -155, -155, -155, -155, -155,
- -155, -155, -155, -155, -155, -155, -155, -155, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -155, -155,
- -155, -155, -155, -155, -155, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 212, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -155, -155, -155, -155, 60, -155, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -155, -155, -155, -155, -155,
-
- 5, -156, -156, -156, -156, -156, -156, -156, -156, -156,
- -156, -156, -156, -156, -156, -156, -156, -156, -156, -156,
- -156, -156, -156, -156, -156, -156, -156, -156, -156, -156,
- -156, -156, -156, -156, -156, -156, -156, -156, -156, -156,
- -156, -156, -156, -156, -156, -156, -156, -156, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -156, -156,
- -156, -156, -156, -156, -156, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -156, -156, -156, -156, 213, -156, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -156, -156, -156, -156, -156,
-
- 5, -157, -157, -157, -157, -157, -157, -157, -157, -157,
- -157, -157, -157, -157, -157, -157, -157, -157, -157, -157,
- -157, -157, -157, -157, -157, -157, -157, -157, -157, -157,
- -157, -157, -157, -157, -157, -157, -157, -157, -157, -157,
- -157, -157, -157, -157, -157, -157, -157, -157, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -157, -157,
- -157, -157, -157, -157, -157, 60, 60, 60, 60, 214,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -157, -157, -157, -157, 60, -157, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -157, -157, -157, -157, -157,
-
- 5, -158, -158, -158, -158, -158, -158, -158, -158, -158,
- -158, -158, -158, -158, -158, -158, -158, -158, -158, -158,
- -158, -158, -158, -158, -158, -158, -158, -158, -158, -158,
- -158, -158, -158, -158, -158, -158, -158, -158, -158, -158,
- -158, -158, -158, -158, -158, -158, -158, -158, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -158, -158,
- -158, -158, -158, -158, -158, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -158, -158, -158, -158, 60, -158, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -158, -158, -158, -158, -158,
-
- 5, -159, -159, -159, -159, -159, -159, -159, -159, -159,
- -159, -159, -159, -159, -159, -159, -159, -159, -159, -159,
- -159, -159, -159, -159, -159, -159, -159, -159, -159, -159,
- -159, -159, -159, -159, -159, -159, -159, -159, -159, -159,
- -159, -159, -159, -159, -159, -159, -159, -159, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -159, -159,
- -159, -159, -159, -159, -159, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -159, -159, -159, -159, 60, -159, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -159, -159, -159, -159, -159,
-
- 5, -160, -160, -160, -160, -160, -160, -160, -160, -160,
- -160, -160, -160, -160, -160, -160, -160, -160, -160, -160,
- -160, -160, -160, -160, -160, -160, -160, -160, -160, -160,
- -160, -160, -160, -160, -160, -160, -160, -160, -160, -160,
- -160, -160, -160, -160, -160, -160, -160, -160, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -160, -160,
- -160, -160, -160, -160, -160, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 215, 60, 60, 60, 60, 60, 60,
- 60, -160, -160, -160, -160, 60, -160, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -160, -160, -160, -160, -160,
-
- 5, -161, -161, -161, -161, -161, -161, -161, -161, -161,
- -161, -161, -161, -161, -161, -161, -161, -161, -161, -161,
- -161, -161, -161, -161, -161, -161, -161, -161, -161, -161,
- -161, -161, -161, -161, -161, -161, -161, -161, -161, -161,
- -161, -161, -161, -161, -161, -161, -161, -161, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -161, -161,
- -161, -161, -161, -161, -161, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -161, -161, -161, -161, 60, -161, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -161, -161, -161, -161, -161,
-
- 5, -162, -162, -162, -162, -162, -162, -162, -162, -162,
- -162, -162, -162, -162, -162, -162, -162, -162, -162, -162,
- -162, -162, -162, -162, -162, -162, -162, -162, -162, -162,
- -162, -162, -162, -162, -162, -162, -162, -162, -162, -162,
- -162, -162, -162, -162, -162, -162, -162, -162, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -162, -162,
- -162, -162, -162, -162, -162, 60, 60, 60, 216, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -162, -162, -162, -162, 60, -162, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -162, -162, -162, -162, -162,
-
- 5, -163, -163, -163, -163, -163, -163, -163, -163, -163,
- -163, -163, -163, -163, -163, -163, -163, -163, -163, -163,
- -163, -163, -163, -163, -163, -163, -163, -163, -163, -163,
- -163, -163, -163, -163, -163, -163, -163, -163, -163, -163,
- -163, -163, -163, -163, -163, -163, -163, -163, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -163, -163,
- -163, -163, -163, -163, -163, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 217, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -163, -163, -163, -163, 60, -163, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -163, -163, -163, -163, -163,
-
- 5, -164, -164, -164, -164, -164, -164, -164, -164, -164,
- -164, -164, -164, -164, -164, -164, -164, -164, -164, -164,
- -164, -164, -164, -164, -164, -164, -164, -164, -164, -164,
- -164, -164, -164, -164, -164, -164, -164, -164, -164, -164,
- -164, -164, -164, -164, -164, -164, -164, -164, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -164, -164,
- -164, -164, -164, -164, -164, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 218, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -164, -164, -164, -164, 60, -164, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -164, -164, -164, -164, -164,
-
- 5, -165, -165, -165, -165, -165, -165, -165, -165, -165,
- -165, -165, -165, -165, -165, -165, -165, -165, -165, -165,
- -165, -165, -165, -165, -165, -165, -165, -165, -165, -165,
- -165, -165, -165, -165, -165, -165, -165, -165, -165, -165,
- -165, -165, -165, -165, -165, -165, -165, -165, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -165, -165,
- -165, -165, -165, -165, -165, 60, 219, 220, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 221, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -165, -165, -165, -165, 60, -165, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -165, -165, -165, -165, -165,
-
- 5, -166, -166, -166, -166, -166, -166, -166, -166, -166,
- -166, -166, -166, -166, -166, -166, -166, -166, -166, -166,
- -166, -166, -166, -166, -166, -166, -166, -166, -166, -166,
- -166, -166, -166, -166, -166, -166, -166, -166, -166, -166,
- -166, -166, -166, -166, -166, -166, -166, -166, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -166, -166,
- -166, -166, -166, -166, -166, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 222, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -166, -166, -166, -166, 60, -166, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -166, -166, -166, -166, -166,
-
- 5, -167, -167, -167, -167, -167, -167, -167, -167, -167,
- -167, -167, -167, -167, -167, -167, -167, -167, -167, -167,
- -167, -167, -167, -167, -167, -167, -167, -167, -167, -167,
- -167, -167, -167, -167, -167, -167, -167, -167, -167, -167,
- -167, -167, -167, -167, -167, -167, -167, -167, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -167, -167,
- -167, -167, -167, -167, -167, 223, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -167, -167, -167, -167, 60, -167, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -167, -167, -167, -167, -167,
-
- 5, -168, -168, -168, -168, -168, -168, -168, -168, -168,
- -168, -168, -168, -168, -168, -168, -168, -168, -168, -168,
- -168, -168, -168, -168, -168, -168, -168, -168, -168, -168,
- -168, -168, -168, -168, -168, -168, -168, -168, -168, -168,
- -168, -168, -168, -168, -168, -168, -168, -168, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -168, -168,
- -168, -168, -168, -168, -168, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 224, 60, 60, 60, 60,
- 60, -168, -168, -168, -168, 60, -168, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -168, -168, -168, -168, -168,
-
- 5, -169, -169, -169, -169, -169, -169, -169, -169, -169,
- -169, -169, -169, -169, -169, -169, -169, -169, -169, -169,
- -169, -169, -169, -169, -169, -169, -169, -169, -169, -169,
- -169, -169, -169, -169, -169, -169, -169, -169, -169, -169,
- -169, -169, -169, -169, -169, -169, -169, -169, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -169, -169,
- -169, -169, -169, -169, -169, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 225, 60, 60, 60, 60, 60, 60, 60,
- 60, -169, -169, -169, -169, 60, -169, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -169, -169, -169, -169, -169,
-
- 5, -170, -170, -170, -170, -170, -170, -170, -170, -170,
- -170, -170, -170, -170, -170, -170, -170, -170, -170, -170,
- -170, -170, -170, -170, -170, -170, -170, -170, -170, -170,
- -170, -170, -170, -170, -170, -170, -170, -170, -170, -170,
- -170, -170, -170, -170, -170, -170, -170, -170, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -170, -170,
- -170, -170, -170, -170, -170, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 226, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -170, -170, -170, -170, 60, -170, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -170, -170, -170, -170, -170,
-
- 5, -171, -171, -171, -171, -171, -171, -171, -171, -171,
- -171, -171, -171, -171, -171, -171, -171, -171, -171, -171,
- -171, -171, -171, -171, -171, -171, -171, -171, -171, -171,
- -171, -171, -171, -171, -171, -171, -171, -171, -171, -171,
- -171, -171, -171, -171, -171, -171, -171, -171, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -171, -171,
- -171, -171, -171, -171, -171, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 227, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -171, -171, -171, -171, 60, -171, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -171, -171, -171, -171, -171,
-
- 5, -172, -172, -172, -172, -172, -172, -172, -172, -172,
- -172, -172, -172, -172, -172, -172, -172, -172, -172, -172,
- -172, -172, -172, -172, -172, -172, -172, -172, -172, -172,
- -172, -172, -172, -172, -172, -172, -172, -172, -172, -172,
- -172, -172, -172, -172, -172, -172, -172, -172, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -172, -172,
- -172, -172, -172, -172, -172, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 228, 60, 60, 60, 60, 60, 60, 60,
- 60, -172, -172, -172, -172, 60, -172, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -172, -172, -172, -172, -172,
-
- 5, -173, -173, -173, -173, -173, -173, -173, -173, -173,
- -173, -173, -173, -173, -173, -173, -173, -173, -173, -173,
- -173, -173, -173, -173, -173, -173, -173, -173, -173, -173,
- -173, -173, -173, -173, -173, -173, -173, -173, -173, -173,
- -173, -173, -173, -173, -173, -173, -173, -173, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -173, -173,
- -173, -173, -173, -173, -173, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 229, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -173, -173, -173, -173, 60, -173, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -173, -173, -173, -173, -173,
-
- 5, -174, -174, -174, -174, -174, -174, -174, -174, -174,
- -174, -174, -174, -174, -174, -174, -174, -174, -174, -174,
- -174, -174, -174, -174, -174, -174, -174, -174, -174, -174,
- -174, -174, -174, -174, -174, -174, -174, -174, -174, -174,
- -174, -174, -174, -174, -174, -174, -174, -174, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -174, -174,
- -174, -174, -174, -174, -174, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 230, 60, 60, 60, 60, 60, 60, 60,
- 60, -174, -174, -174, -174, 60, -174, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -174, -174, -174, -174, -174,
-
- 5, -175, -175, -175, -175, -175, -175, -175, -175, -175,
- -175, -175, -175, -175, -175, -175, -175, -175, -175, -175,
- -175, -175, -175, -175, -175, -175, -175, -175, -175, -175,
- -175, -175, -175, -175, -175, -175, -175, -175, -175, -175,
- -175, -175, -175, -175, -175, -175, -175, -175, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -175, -175,
- -175, -175, -175, -175, -175, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -175, -175, -175, -175, 60, -175, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -175, -175, -175, -175, -175,
-
- 5, -176, -176, -176, -176, -176, -176, -176, -176, -176,
- -176, -176, -176, -176, -176, -176, -176, -176, -176, -176,
- -176, -176, -176, -176, -176, -176, -176, -176, -176, -176,
- -176, -176, -176, -176, -176, -176, -176, -176, -176, -176,
- -176, -176, -176, -176, -176, -176, -176, -176, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -176, -176,
- -176, -176, -176, -176, -176, 60, 60, 60, 60, 231,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -176, -176, -176, -176, 60, -176, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -176, -176, -176, -176, -176,
-
- 5, -177, -177, -177, -177, -177, -177, -177, -177, -177,
- -177, -177, -177, -177, -177, -177, -177, -177, -177, -177,
- -177, -177, -177, -177, -177, -177, -177, -177, -177, -177,
- -177, -177, -177, -177, -177, -177, -177, -177, -177, -177,
- -177, -177, -177, -177, -177, -177, -177, -177, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -177, -177,
- -177, -177, -177, -177, -177, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 232, 60, 60, 60, 60, 60,
- 60, -177, -177, -177, -177, 60, -177, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -177, -177, -177, -177, -177,
-
- 5, -178, -178, -178, -178, -178, -178, -178, -178, -178,
- -178, -178, -178, -178, -178, -178, -178, -178, -178, -178,
- -178, -178, -178, -178, -178, -178, -178, -178, -178, -178,
- -178, -178, -178, -178, -178, -178, -178, -178, -178, -178,
- -178, -178, -178, -178, -178, -178, -178, -178, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -178, -178,
- -178, -178, -178, -178, -178, 60, 60, 60, 60, 60,
- 60, 60, 60, 233, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -178, -178, -178, -178, 60, -178, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -178, -178, -178, -178, -178,
-
- 5, -179, -179, -179, -179, -179, -179, -179, -179, -179,
- -179, -179, -179, -179, -179, -179, -179, -179, -179, -179,
- -179, -179, -179, -179, -179, -179, -179, -179, -179, -179,
- -179, -179, -179, -179, -179, -179, -179, -179, -179, -179,
- -179, -179, -179, -179, -179, -179, -179, -179, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -179, -179,
- -179, -179, -179, -179, -179, 234, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -179, -179, -179, -179, 60, -179, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -179, -179, -179, -179, -179,
-
- 5, -180, -180, -180, -180, -180, -180, -180, -180, -180,
- -180, -180, -180, -180, -180, -180, -180, -180, -180, -180,
- -180, -180, -180, -180, -180, -180, -180, -180, -180, -180,
- -180, -180, -180, -180, -180, -180, -180, -180, -180, -180,
- -180, -180, -180, -180, -180, -180, -180, -180, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -180, -180,
- -180, -180, -180, -180, -180, 60, 60, 60, 60, 60,
- 60, 60, 60, 235, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -180, -180, -180, -180, 60, -180, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -180, -180, -180, -180, -180,
-
- 5, -181, -181, -181, -181, -181, -181, -181, -181, -181,
- -181, -181, -181, -181, -181, -181, -181, -181, -181, -181,
- -181, -181, -181, -181, -181, -181, -181, -181, -181, -181,
- -181, -181, -181, -181, -181, -181, -181, -181, -181, -181,
- -181, -181, -181, -181, -181, -181, -181, -181, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -181, -181,
- -181, -181, -181, -181, -181, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 236, 60, 60, 60, 60, 60,
- 60, -181, -181, -181, -181, 60, -181, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -181, -181, -181, -181, -181,
-
- 5, -182, -182, -182, -182, -182, -182, -182, -182, -182,
- -182, -182, -182, -182, -182, -182, -182, -182, -182, -182,
- -182, -182, -182, -182, -182, -182, -182, -182, -182, -182,
- -182, -182, -182, -182, -182, -182, -182, -182, -182, -182,
- -182, -182, -182, -182, -182, -182, -182, -182, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -182, -182,
- -182, -182, -182, -182, -182, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 237, 60, 60, 60, 60, 60,
- 60, -182, -182, -182, -182, 60, -182, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -182, -182, -182, -182, -182,
-
- 5, -183, -183, -183, -183, -183, -183, -183, -183, -183,
- -183, -183, -183, -183, -183, -183, -183, -183, -183, -183,
- -183, -183, -183, -183, -183, -183, -183, -183, -183, -183,
- -183, -183, -183, -183, -183, -183, -183, -183, -183, -183,
- -183, -183, -183, -183, -183, -183, -183, -183, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -183, -183,
- -183, -183, -183, -183, -183, 60, 60, 60, 60, 238,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -183, -183, -183, -183, 60, -183, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -183, -183, -183, -183, -183,
-
- 5, -184, -184, -184, -184, -184, -184, -184, -184, -184,
- -184, -184, -184, -184, -184, -184, -184, -184, -184, -184,
- -184, -184, -184, -184, -184, -184, -184, -184, -184, -184,
- -184, -184, -184, -184, -184, -184, -184, -184, -184, -184,
- -184, -184, -184, -184, -184, -184, -184, -184, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -184, -184,
- -184, -184, -184, -184, -184, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 239,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -184, -184, -184, -184, 60, -184, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -184, -184, -184, -184, -184,
-
- 5, -185, -185, -185, -185, -185, -185, -185, -185, -185,
- -185, -185, -185, -185, -185, -185, -185, -185, -185, -185,
- -185, -185, -185, -185, -185, -185, -185, -185, -185, -185,
- -185, -185, -185, -185, -185, -185, -185, -185, -185, -185,
- -185, -185, -185, -185, -185, -185, -185, -185, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -185, -185,
- -185, -185, -185, -185, -185, 240, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -185, -185, -185, -185, 60, -185, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -185, -185, -185, -185, -185,
-
- 5, -186, -186, -186, -186, -186, -186, -186, -186, -186,
- -186, -186, -186, -186, -186, -186, -186, -186, -186, -186,
- -186, -186, -186, -186, -186, -186, -186, -186, -186, -186,
- -186, -186, -186, -186, -186, -186, -186, -186, -186, -186,
- -186, -186, -186, -186, -186, -186, -186, -186, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -186, -186,
- -186, -186, -186, -186, -186, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 241, 60, 60, 60, 60, 60,
- 60, -186, -186, -186, -186, 60, -186, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -186, -186, -186, -186, -186,
-
- 5, -187, -187, -187, -187, -187, -187, -187, -187, -187,
- -187, -187, -187, -187, -187, -187, -187, -187, -187, -187,
- -187, -187, -187, -187, -187, -187, -187, -187, -187, -187,
- -187, -187, -187, -187, -187, -187, -187, -187, -187, -187,
- -187, -187, -187, -187, -187, -187, -187, -187, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -187, -187,
- -187, -187, -187, -187, -187, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -187, -187, -187, -187, 60, -187, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -187, -187, -187, -187, -187,
-
- 5, -188, -188, -188, -188, -188, -188, -188, -188, -188,
- -188, -188, -188, -188, -188, -188, -188, -188, -188, -188,
- -188, -188, -188, -188, -188, -188, -188, -188, -188, -188,
- -188, -188, -188, -188, -188, -188, -188, -188, -188, -188,
- -188, -188, -188, -188, -188, -188, -188, -188, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -188, -188,
- -188, -188, -188, -188, -188, 60, 60, 60, 60, 60,
- 60, 60, 60, 242, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -188, -188, -188, -188, 60, -188, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -188, -188, -188, -188, -188,
-
- 5, -189, -189, -189, -189, -189, -189, -189, -189, -189,
- -189, -189, -189, -189, -189, -189, -189, -189, -189, -189,
- -189, -189, -189, -189, -189, -189, -189, -189, -189, -189,
- -189, -189, -189, -189, -189, -189, -189, -189, -189, -189,
- -189, -189, -189, -189, -189, -189, -189, -189, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -189, -189,
- -189, -189, -189, -189, -189, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -189, -189, -189, -189, 243, -189, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -189, -189, -189, -189, -189,
-
- 5, -190, -190, -190, -190, -190, -190, -190, -190, -190,
- -190, -190, -190, -190, -190, -190, -190, -190, -190, -190,
- -190, -190, -190, -190, -190, -190, -190, -190, -190, -190,
- -190, -190, -190, -190, -190, -190, -190, -190, -190, -190,
- -190, -190, -190, -190, -190, -190, -190, -190, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -190, -190,
- -190, -190, -190, -190, -190, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -190, -190, -190, -190, 60, -190, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -190, -190, -190, -190, -190,
-
- 5, -191, -191, -191, -191, -191, -191, -191, -191, -191,
- -191, -191, -191, -191, -191, -191, -191, -191, -191, -191,
- -191, -191, -191, -191, -191, -191, -191, -191, -191, -191,
- -191, -191, -191, -191, -191, -191, -191, -191, -191, -191,
- -191, -191, -191, -191, -191, -191, -191, -191, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -191, -191,
- -191, -191, -191, -191, -191, 60, 60, 60, 60, 60,
- 244, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -191, -191, -191, -191, 60, -191, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -191, -191, -191, -191, -191,
-
- 5, -192, -192, -192, -192, -192, -192, -192, -192, -192,
- -192, -192, -192, -192, -192, -192, -192, -192, -192, -192,
- -192, -192, -192, -192, -192, -192, -192, -192, -192, -192,
- -192, -192, -192, -192, -192, -192, -192, -192, -192, -192,
- -192, -192, -192, -192, -192, -192, -192, -192, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -192, -192,
- -192, -192, -192, -192, -192, 60, 60, 60, 60, 60,
- 60, 60, 245, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -192, -192, -192, -192, 60, -192, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -192, -192, -192, -192, -192,
-
- 5, -193, -193, -193, -193, -193, -193, -193, -193, -193,
- -193, -193, -193, -193, -193, -193, -193, -193, -193, -193,
- -193, -193, -193, -193, -193, -193, -193, -193, -193, -193,
- -193, -193, -193, -193, -193, -193, -193, -193, -193, -193,
- -193, -193, -193, -193, -193, -193, -193, -193, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -193, -193,
- -193, -193, -193, -193, -193, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 246, 60, 60, 60, 60, 60,
- 60, -193, -193, -193, -193, 60, -193, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -193, -193, -193, -193, -193,
-
- 5, -194, -194, -194, -194, -194, -194, -194, -194, -194,
- -194, -194, -194, -194, -194, -194, -194, -194, -194, -194,
- -194, -194, -194, -194, -194, -194, -194, -194, -194, -194,
- -194, -194, -194, -194, -194, -194, -194, -194, -194, -194,
- -194, -194, -194, -194, -194, -194, -194, -194, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -194, -194,
- -194, -194, -194, -194, -194, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -194, -194, -194, -194, 60, -194, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -194, -194, -194, -194, -194,
-
- 5, -195, -195, -195, -195, -195, -195, -195, -195, -195,
- -195, -195, -195, -195, -195, -195, -195, -195, -195, -195,
- -195, -195, -195, -195, -195, -195, -195, -195, -195, -195,
- -195, -195, -195, -195, -195, -195, -195, -195, -195, -195,
- -195, -195, -195, -195, -195, -195, -195, -195, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -195, -195,
- -195, -195, -195, -195, -195, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 247, 60,
- 60, -195, -195, -195, -195, 60, -195, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -195, -195, -195, -195, -195,
-
- 5, -196, -196, -196, -196, -196, -196, -196, -196, -196,
- -196, -196, -196, -196, -196, -196, -196, -196, -196, -196,
- -196, -196, -196, -196, -196, -196, -196, -196, -196, -196,
- -196, -196, -196, -196, -196, -196, -196, -196, -196, -196,
- -196, -196, -196, -196, -196, -196, -196, -196, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -196, -196,
- -196, -196, -196, -196, -196, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 248, 60, 60, 60, 60, 60, 60, 60,
- 60, -196, -196, -196, -196, 60, -196, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -196, -196, -196, -196, -196,
-
- 5, -197, -197, -197, -197, -197, -197, -197, -197, -197,
- -197, -197, -197, -197, -197, -197, -197, -197, -197, -197,
- -197, -197, -197, -197, -197, -197, -197, -197, -197, -197,
- -197, -197, -197, -197, -197, -197, -197, -197, -197, -197,
- -197, -197, -197, -197, -197, -197, -197, -197, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -197, -197,
- -197, -197, -197, -197, -197, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 249, 60, 60, 60, 60, 60, 60, 60,
- 60, -197, -197, -197, -197, 60, -197, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -197, -197, -197, -197, -197,
-
- 5, -198, -198, -198, -198, -198, -198, -198, -198, -198,
- -198, -198, -198, -198, -198, -198, -198, -198, -198, -198,
- -198, -198, -198, -198, -198, -198, -198, -198, -198, -198,
- -198, -198, -198, -198, -198, -198, -198, -198, -198, -198,
- -198, -198, -198, -198, -198, -198, -198, -198, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -198, -198,
- -198, -198, -198, -198, -198, 60, 60, 60, 60, 60,
- 60, 250, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -198, -198, -198, -198, 60, -198, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -198, -198, -198, -198, -198,
-
- 5, -199, -199, -199, -199, -199, -199, -199, -199, -199,
- -199, -199, -199, -199, -199, -199, -199, -199, -199, -199,
- -199, -199, -199, -199, -199, -199, -199, -199, -199, -199,
- -199, -199, -199, -199, -199, -199, -199, -199, -199, -199,
- -199, -199, -199, -199, -199, -199, -199, -199, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -199, -199,
- -199, -199, -199, -199, -199, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -199, -199, -199, -199, 60, -199, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -199, -199, -199, -199, -199,
-
- 5, -200, -200, -200, -200, -200, -200, -200, -200, -200,
- -200, -200, -200, -200, -200, -200, -200, -200, -200, -200,
- -200, -200, -200, -200, -200, -200, -200, -200, -200, -200,
- -200, -200, -200, -200, -200, -200, -200, -200, -200, -200,
- -200, -200, -200, -200, -200, -200, -200, -200, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -200, -200,
- -200, -200, -200, -200, -200, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 251, 60, 60, 60, 60, 60,
- 60, -200, -200, -200, -200, 60, -200, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -200, -200, -200, -200, -200,
-
- 5, -201, -201, -201, -201, -201, -201, -201, -201, -201,
- -201, -201, -201, -201, -201, -201, -201, -201, -201, -201,
- -201, -201, -201, -201, -201, -201, -201, -201, -201, -201,
- -201, -201, -201, -201, -201, -201, -201, -201, -201, -201,
- -201, -201, -201, -201, -201, -201, -201, -201, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -201, -201,
- -201, -201, -201, -201, -201, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -201, -201, -201, -201, 60, -201, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -201, -201, -201, -201, -201,
-
- 5, -202, -202, -202, -202, -202, -202, -202, -202, -202,
- -202, -202, -202, -202, -202, -202, -202, -202, -202, -202,
- -202, -202, -202, -202, -202, -202, -202, -202, -202, -202,
- -202, -202, -202, -202, -202, -202, -202, -202, -202, -202,
- -202, -202, -202, -202, -202, -202, -202, -202, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -202, -202,
- -202, -202, -202, -202, -202, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 252,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -202, -202, -202, -202, 60, -202, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -202, -202, -202, -202, -202,
-
- 5, -203, -203, -203, -203, -203, -203, -203, -203, -203,
- -203, -203, -203, -203, -203, -203, -203, -203, -203, -203,
- -203, -203, -203, -203, -203, -203, -203, -203, -203, -203,
- -203, -203, -203, -203, -203, -203, -203, -203, -203, -203,
- -203, -203, -203, -203, -203, -203, -203, -203, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -203, -203,
- -203, -203, -203, -203, -203, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -203, -203, -203, -203, 60, -203, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -203, -203, -203, -203, -203,
-
- 5, -204, -204, -204, -204, -204, -204, -204, -204, -204,
- -204, -204, -204, -204, -204, -204, -204, -204, -204, -204,
- -204, -204, -204, -204, -204, -204, -204, -204, -204, -204,
- -204, -204, -204, -204, -204, -204, -204, -204, -204, -204,
- -204, -204, -204, -204, -204, -204, -204, -204, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -204, -204,
- -204, -204, -204, -204, -204, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -204, -204, -204, -204, 60, -204, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -204, -204, -204, -204, -204,
-
- 5, -205, -205, -205, -205, -205, -205, -205, -205, -205,
- -205, -205, -205, -205, -205, -205, -205, -205, -205, -205,
- -205, -205, -205, -205, -205, -205, -205, -205, -205, -205,
- -205, -205, -205, -205, -205, -205, -205, -205, -205, -205,
- -205, -205, -205, -205, -205, -205, -205, -205, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -205, -205,
- -205, -205, -205, -205, -205, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 253, 60, 60, 60, 60, 60, 60, 60,
- 60, -205, -205, -205, -205, 60, -205, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -205, -205, -205, -205, -205,
-
- 5, -206, -206, -206, -206, -206, -206, -206, -206, -206,
- -206, -206, -206, -206, -206, -206, -206, -206, -206, -206,
- -206, -206, -206, -206, -206, -206, -206, -206, -206, -206,
- -206, -206, -206, -206, -206, -206, -206, -206, -206, -206,
- -206, -206, -206, -206, -206, -206, -206, -206, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -206, -206,
- -206, -206, -206, -206, -206, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 254, 60, 60, 60, 60, 60,
- 60, -206, -206, -206, -206, 60, -206, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -206, -206, -206, -206, -206,
-
- 5, -207, -207, -207, -207, -207, -207, -207, -207, -207,
- -207, -207, -207, -207, -207, -207, -207, -207, -207, -207,
- -207, -207, -207, -207, -207, -207, -207, -207, -207, -207,
- -207, -207, -207, -207, -207, -207, -207, -207, -207, -207,
- -207, -207, -207, -207, -207, -207, -207, -207, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -207, -207,
- -207, -207, -207, -207, -207, 60, 60, 60, 60, 255,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -207, -207, -207, -207, 60, -207, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -207, -207, -207, -207, -207,
-
- 5, -208, -208, -208, -208, -208, -208, -208, -208, -208,
- -208, -208, -208, -208, -208, -208, -208, -208, -208, -208,
- -208, -208, -208, -208, -208, -208, -208, -208, -208, -208,
- -208, -208, -208, -208, -208, -208, -208, -208, -208, -208,
- -208, -208, -208, -208, -208, -208, -208, -208, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -208, -208,
- -208, -208, -208, -208, -208, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -208, -208, -208, -208, 60, -208, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -208, -208, -208, -208, -208,
-
- 5, -209, -209, -209, -209, -209, -209, -209, -209, -209,
- -209, -209, -209, -209, -209, -209, -209, -209, -209, -209,
- -209, -209, -209, -209, -209, -209, -209, -209, -209, -209,
- -209, -209, -209, -209, -209, -209, -209, -209, -209, -209,
- -209, -209, -209, -209, -209, -209, -209, -209, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -209, -209,
- -209, -209, -209, -209, -209, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 256, 60, 60, 60, 60, 60, 60,
- 60, -209, -209, -209, -209, 60, -209, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -209, -209, -209, -209, -209,
-
- 5, -210, -210, -210, -210, -210, -210, -210, -210, -210,
- -210, -210, -210, -210, -210, -210, -210, -210, -210, -210,
- -210, -210, -210, -210, -210, -210, -210, -210, -210, -210,
- -210, -210, -210, -210, -210, -210, -210, -210, -210, -210,
- -210, -210, -210, -210, -210, -210, -210, -210, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -210, -210,
- -210, -210, -210, -210, -210, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 257, 60, 60, 60, 60, 60, 60, 60,
- 60, -210, -210, -210, -210, 60, -210, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -210, -210, -210, -210, -210,
-
- 5, -211, -211, -211, -211, -211, -211, -211, -211, -211,
- -211, -211, -211, -211, -211, -211, -211, -211, -211, -211,
- -211, -211, -211, -211, -211, -211, -211, -211, -211, -211,
- -211, -211, -211, -211, -211, -211, -211, -211, -211, -211,
- -211, -211, -211, -211, -211, -211, -211, -211, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -211, -211,
- -211, -211, -211, -211, -211, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 258, 60, 60, 60, 60, 60, 60,
- 60, -211, -211, -211, -211, 60, -211, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -211, -211, -211, -211, -211,
-
- 5, -212, -212, -212, -212, -212, -212, -212, -212, -212,
- -212, -212, -212, -212, -212, -212, -212, -212, -212, -212,
- -212, -212, -212, -212, -212, -212, -212, -212, -212, -212,
- -212, -212, -212, -212, -212, -212, -212, -212, -212, -212,
- -212, -212, -212, -212, -212, -212, -212, -212, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -212, -212,
- -212, -212, -212, -212, -212, 60, 259, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -212, -212, -212, -212, 60, -212, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -212, -212, -212, -212, -212,
-
- 5, -213, -213, -213, -213, -213, -213, -213, -213, -213,
- -213, -213, -213, -213, -213, -213, -213, -213, -213, -213,
- -213, -213, -213, -213, -213, -213, -213, -213, -213, -213,
- -213, -213, -213, -213, -213, -213, -213, -213, -213, -213,
- -213, -213, -213, -213, -213, -213, -213, -213, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -213, -213,
- -213, -213, -213, -213, -213, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 260, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -213, -213, -213, -213, 60, -213, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -213, -213, -213, -213, -213,
-
- 5, -214, -214, -214, -214, -214, -214, -214, -214, -214,
- -214, -214, -214, -214, -214, -214, -214, -214, -214, -214,
- -214, -214, -214, -214, -214, -214, -214, -214, -214, -214,
- -214, -214, -214, -214, -214, -214, -214, -214, -214, -214,
- -214, -214, -214, -214, -214, -214, -214, -214, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -214, -214,
- -214, -214, -214, -214, -214, 60, 60, 261, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -214, -214, -214, -214, 60, -214, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -214, -214, -214, -214, -214,
-
- 5, -215, -215, -215, -215, -215, -215, -215, -215, -215,
- -215, -215, -215, -215, -215, -215, -215, -215, -215, -215,
- -215, -215, -215, -215, -215, -215, -215, -215, -215, -215,
- -215, -215, -215, -215, -215, -215, -215, -215, -215, -215,
- -215, -215, -215, -215, -215, -215, -215, -215, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -215, -215,
- -215, -215, -215, -215, -215, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 262, 60, 60, 60, 60, 60,
- 60, -215, -215, -215, -215, 60, -215, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -215, -215, -215, -215, -215,
-
- 5, -216, -216, -216, -216, -216, -216, -216, -216, -216,
- -216, -216, -216, -216, -216, -216, -216, -216, -216, -216,
- -216, -216, -216, -216, -216, -216, -216, -216, -216, -216,
- -216, -216, -216, -216, -216, -216, -216, -216, -216, -216,
- -216, -216, -216, -216, -216, -216, -216, -216, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -216, -216,
- -216, -216, -216, -216, -216, 263, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -216, -216, -216, -216, 60, -216, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -216, -216, -216, -216, -216,
-
- 5, -217, -217, -217, -217, -217, -217, -217, -217, -217,
- -217, -217, -217, -217, -217, -217, -217, -217, -217, -217,
- -217, -217, -217, -217, -217, -217, -217, -217, -217, -217,
- -217, -217, -217, -217, -217, -217, -217, -217, -217, -217,
- -217, -217, -217, -217, -217, -217, -217, -217, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -217, -217,
- -217, -217, -217, -217, -217, 60, 60, 60, 60, 264,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -217, -217, -217, -217, 60, -217, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -217, -217, -217, -217, -217,
-
- 5, -218, -218, -218, -218, -218, -218, -218, -218, -218,
- -218, -218, -218, -218, -218, -218, -218, -218, -218, -218,
- -218, -218, -218, -218, -218, -218, -218, -218, -218, -218,
- -218, -218, -218, -218, -218, -218, -218, -218, -218, -218,
- -218, -218, -218, -218, -218, -218, -218, -218, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -218, -218,
- -218, -218, -218, -218, -218, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -218, -218, -218, -218, 60, -218, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -218, -218, -218, -218, -218,
-
- 5, -219, -219, -219, -219, -219, -219, -219, -219, -219,
- -219, -219, -219, -219, -219, -219, -219, -219, -219, -219,
- -219, -219, -219, -219, -219, -219, -219, -219, -219, -219,
- -219, -219, -219, -219, -219, -219, -219, -219, -219, -219,
- -219, -219, -219, -219, -219, -219, -219, -219, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -219, -219,
- -219, -219, -219, -219, -219, 60, 60, 60, 60, 60,
- 60, 60, 60, 265, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -219, -219, -219, -219, 60, -219, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -219, -219, -219, -219, -219,
-
- 5, -220, -220, -220, -220, -220, -220, -220, -220, -220,
- -220, -220, -220, -220, -220, -220, -220, -220, -220, -220,
- -220, -220, -220, -220, -220, -220, -220, -220, -220, -220,
- -220, -220, -220, -220, -220, -220, -220, -220, -220, -220,
- -220, -220, -220, -220, -220, -220, -220, -220, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -220, -220,
- -220, -220, -220, -220, -220, 60, 60, 60, 60, 60,
- 60, 60, 266, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -220, -220, -220, -220, 60, -220, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -220, -220, -220, -220, -220,
-
- 5, -221, -221, -221, -221, -221, -221, -221, -221, -221,
- -221, -221, -221, -221, -221, -221, -221, -221, -221, -221,
- -221, -221, -221, -221, -221, -221, -221, -221, -221, -221,
- -221, -221, -221, -221, -221, -221, -221, -221, -221, -221,
- -221, -221, -221, -221, -221, -221, -221, -221, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -221, -221,
- -221, -221, -221, -221, -221, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 267, 60, 60, 60, 60,
- 60, -221, -221, -221, -221, 60, -221, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -221, -221, -221, -221, -221,
-
- 5, -222, -222, -222, -222, -222, -222, -222, -222, -222,
- -222, -222, -222, -222, -222, -222, -222, -222, -222, -222,
- -222, -222, -222, -222, -222, -222, -222, -222, -222, -222,
- -222, -222, -222, -222, -222, -222, -222, -222, -222, -222,
- -222, -222, -222, -222, -222, -222, -222, -222, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -222, -222,
- -222, -222, -222, -222, -222, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 268, 60, 60, 60, 60,
- 60, -222, -222, -222, -222, 60, -222, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -222, -222, -222, -222, -222,
-
- 5, -223, -223, -223, -223, -223, -223, -223, -223, -223,
- -223, -223, -223, -223, -223, -223, -223, -223, -223, -223,
- -223, -223, -223, -223, -223, -223, -223, -223, -223, -223,
- -223, -223, -223, -223, -223, -223, -223, -223, -223, -223,
- -223, -223, -223, -223, -223, -223, -223, -223, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -223, -223,
- -223, -223, -223, -223, -223, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 269, 60, 60, 60, 60, 60,
- 60, -223, -223, -223, -223, 60, -223, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -223, -223, -223, -223, -223,
-
- 5, -224, -224, -224, -224, -224, -224, -224, -224, -224,
- -224, -224, -224, -224, -224, -224, -224, -224, -224, -224,
- -224, -224, -224, -224, -224, -224, -224, -224, -224, -224,
- -224, -224, -224, -224, -224, -224, -224, -224, -224, -224,
- -224, -224, -224, -224, -224, -224, -224, -224, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -224, -224,
- -224, -224, -224, -224, -224, 60, 60, 60, 60, 270,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -224, -224, -224, -224, 60, -224, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -224, -224, -224, -224, -224,
-
- 5, -225, -225, -225, -225, -225, -225, -225, -225, -225,
- -225, -225, -225, -225, -225, -225, -225, -225, -225, -225,
- -225, -225, -225, -225, -225, -225, -225, -225, -225, -225,
- -225, -225, -225, -225, -225, -225, -225, -225, -225, -225,
- -225, -225, -225, -225, -225, -225, -225, -225, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -225, -225,
- -225, -225, -225, -225, -225, 60, 60, 60, 60, 271,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -225, -225, -225, -225, 60, -225, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -225, -225, -225, -225, -225,
-
- 5, -226, -226, -226, -226, -226, -226, -226, -226, -226,
- -226, -226, -226, -226, -226, -226, -226, -226, -226, -226,
- -226, -226, -226, -226, -226, -226, -226, -226, -226, -226,
- -226, -226, -226, -226, -226, -226, -226, -226, -226, -226,
- -226, -226, -226, -226, -226, -226, -226, -226, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -226, -226,
- -226, -226, -226, -226, -226, 60, 60, 60, 60, 272,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -226, -226, -226, -226, 60, -226, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -226, -226, -226, -226, -226,
-
- 5, -227, -227, -227, -227, -227, -227, -227, -227, -227,
- -227, -227, -227, -227, -227, -227, -227, -227, -227, -227,
- -227, -227, -227, -227, -227, -227, -227, -227, -227, -227,
- -227, -227, -227, -227, -227, -227, -227, -227, -227, -227,
- -227, -227, -227, -227, -227, -227, -227, -227, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -227, -227,
- -227, -227, -227, -227, -227, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -227, -227, -227, -227, 60, -227, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -227, -227, -227, -227, -227,
-
- 5, -228, -228, -228, -228, -228, -228, -228, -228, -228,
- -228, -228, -228, -228, -228, -228, -228, -228, -228, -228,
- -228, -228, -228, -228, -228, -228, -228, -228, -228, -228,
- -228, -228, -228, -228, -228, -228, -228, -228, -228, -228,
- -228, -228, -228, -228, -228, -228, -228, -228, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -228, -228,
- -228, -228, -228, -228, -228, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 273, 60, 60, 60, 60, 60,
- 60, -228, -228, -228, -228, 60, -228, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -228, -228, -228, -228, -228,
-
- 5, -229, -229, -229, -229, -229, -229, -229, -229, -229,
- -229, -229, -229, -229, -229, -229, -229, -229, -229, -229,
- -229, -229, -229, -229, -229, -229, -229, -229, -229, -229,
- -229, -229, -229, -229, -229, -229, -229, -229, -229, -229,
- -229, -229, -229, -229, -229, -229, -229, -229, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -229, -229,
- -229, -229, -229, -229, -229, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -229, -229, -229, -229, 60, -229, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -229, -229, -229, -229, -229,
-
- 5, -230, -230, -230, -230, -230, -230, -230, -230, -230,
- -230, -230, -230, -230, -230, -230, -230, -230, -230, -230,
- -230, -230, -230, -230, -230, -230, -230, -230, -230, -230,
- -230, -230, -230, -230, -230, -230, -230, -230, -230, -230,
- -230, -230, -230, -230, -230, -230, -230, -230, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -230, -230,
- -230, -230, -230, -230, -230, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 274,
- 60, -230, -230, -230, -230, 60, -230, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -230, -230, -230, -230, -230,
-
- 5, -231, -231, -231, -231, -231, -231, -231, -231, -231,
- -231, -231, -231, -231, -231, -231, -231, -231, -231, -231,
- -231, -231, -231, -231, -231, -231, -231, -231, -231, -231,
- -231, -231, -231, -231, -231, -231, -231, -231, -231, -231,
- -231, -231, -231, -231, -231, -231, -231, -231, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -231, -231,
- -231, -231, -231, -231, -231, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -231, -231, -231, -231, 60, -231, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -231, -231, -231, -231, -231,
-
- 5, -232, -232, -232, -232, -232, -232, -232, -232, -232,
- -232, -232, -232, -232, -232, -232, -232, -232, -232, -232,
- -232, -232, -232, -232, -232, -232, -232, -232, -232, -232,
- -232, -232, -232, -232, -232, -232, -232, -232, -232, -232,
- -232, -232, -232, -232, -232, -232, -232, -232, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -232, -232,
- -232, -232, -232, -232, -232, 60, 60, 60, 60, 275,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -232, -232, -232, -232, 60, -232, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -232, -232, -232, -232, -232,
-
- 5, -233, -233, -233, -233, -233, -233, -233, -233, -233,
- -233, -233, -233, -233, -233, -233, -233, -233, -233, -233,
- -233, -233, -233, -233, -233, -233, -233, -233, -233, -233,
- -233, -233, -233, -233, -233, -233, -233, -233, -233, -233,
- -233, -233, -233, -233, -233, -233, -233, -233, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -233, -233,
- -233, -233, -233, -233, -233, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 276, 60, 60, 60, 60, 60,
- 60, -233, -233, -233, -233, 60, -233, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -233, -233, -233, -233, -233,
-
- 5, -234, -234, -234, -234, -234, -234, -234, -234, -234,
- -234, -234, -234, -234, -234, -234, -234, -234, -234, -234,
- -234, -234, -234, -234, -234, -234, -234, -234, -234, -234,
- -234, -234, -234, -234, -234, -234, -234, -234, -234, -234,
- -234, -234, -234, -234, -234, -234, -234, -234, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -234, -234,
- -234, -234, -234, -234, -234, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 277, 60, 60, 60, 60, 60,
- 60, -234, -234, -234, -234, 60, -234, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -234, -234, -234, -234, -234,
-
- 5, -235, -235, -235, -235, -235, -235, -235, -235, -235,
- -235, -235, -235, -235, -235, -235, -235, -235, -235, -235,
- -235, -235, -235, -235, -235, -235, -235, -235, -235, -235,
- -235, -235, -235, -235, -235, -235, -235, -235, -235, -235,
- -235, -235, -235, -235, -235, -235, -235, -235, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -235, -235,
- -235, -235, -235, -235, -235, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 278, 60, 60, 60, 60, 60, 60,
- 60, -235, -235, -235, -235, 60, -235, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -235, -235, -235, -235, -235,
-
- 5, -236, -236, -236, -236, -236, -236, -236, -236, -236,
- -236, -236, -236, -236, -236, -236, -236, -236, -236, -236,
- -236, -236, -236, -236, -236, -236, -236, -236, -236, -236,
- -236, -236, -236, -236, -236, -236, -236, -236, -236, -236,
- -236, -236, -236, -236, -236, -236, -236, -236, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -236, -236,
- -236, -236, -236, -236, -236, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -236, -236, -236, -236, 60, -236, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -236, -236, -236, -236, -236,
-
- 5, -237, -237, -237, -237, -237, -237, -237, -237, -237,
- -237, -237, -237, -237, -237, -237, -237, -237, -237, -237,
- -237, -237, -237, -237, -237, -237, -237, -237, -237, -237,
- -237, -237, -237, -237, -237, -237, -237, -237, -237, -237,
- -237, -237, -237, -237, -237, -237, -237, -237, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -237, -237,
- -237, -237, -237, -237, -237, 60, 60, 60, 60, 279,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -237, -237, -237, -237, 60, -237, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -237, -237, -237, -237, -237,
-
- 5, -238, -238, -238, -238, -238, -238, -238, -238, -238,
- -238, -238, -238, -238, -238, -238, -238, -238, -238, -238,
- -238, -238, -238, -238, -238, -238, -238, -238, -238, -238,
- -238, -238, -238, -238, -238, -238, -238, -238, -238, -238,
- -238, -238, -238, -238, -238, -238, -238, -238, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -238, -238,
- -238, -238, -238, -238, -238, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 280, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -238, -238, -238, -238, 60, -238, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -238, -238, -238, -238, -238,
-
- 5, -239, -239, -239, -239, -239, -239, -239, -239, -239,
- -239, -239, -239, -239, -239, -239, -239, -239, -239, -239,
- -239, -239, -239, -239, -239, -239, -239, -239, -239, -239,
- -239, -239, -239, -239, -239, -239, -239, -239, -239, -239,
- -239, -239, -239, -239, -239, -239, -239, -239, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -239, -239,
- -239, -239, -239, -239, -239, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 281, 60, 60, 60, 60, 60, 60, 60,
- 60, -239, -239, -239, -239, 60, -239, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -239, -239, -239, -239, -239,
-
- 5, -240, -240, -240, -240, -240, -240, -240, -240, -240,
- -240, -240, -240, -240, -240, -240, -240, -240, -240, -240,
- -240, -240, -240, -240, -240, -240, -240, -240, -240, -240,
- -240, -240, -240, -240, -240, -240, -240, -240, -240, -240,
- -240, -240, -240, -240, -240, -240, -240, -240, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -240, -240,
- -240, -240, -240, -240, -240, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 282, 60, 60, 60, 60, 60, 60, 60,
- 60, -240, -240, -240, -240, 60, -240, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -240, -240, -240, -240, -240,
-
- 5, -241, -241, -241, -241, -241, -241, -241, -241, -241,
- -241, -241, -241, -241, -241, -241, -241, -241, -241, -241,
- -241, -241, -241, -241, -241, -241, -241, -241, -241, -241,
- -241, -241, -241, -241, -241, -241, -241, -241, -241, -241,
- -241, -241, -241, -241, -241, -241, -241, -241, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -241, -241,
- -241, -241, -241, -241, -241, 60, 60, 60, 60, 283,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -241, -241, -241, -241, 60, -241, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -241, -241, -241, -241, -241,
-
- 5, -242, -242, -242, -242, -242, -242, -242, -242, -242,
- -242, -242, -242, -242, -242, -242, -242, -242, -242, -242,
- -242, -242, -242, -242, -242, -242, -242, -242, -242, -242,
- -242, -242, -242, -242, -242, -242, -242, -242, -242, -242,
- -242, -242, -242, -242, -242, -242, -242, -242, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -242, -242,
- -242, -242, -242, -242, -242, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 284, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -242, -242, -242, -242, 60, -242, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -242, -242, -242, -242, -242,
-
- 5, -243, -243, -243, -243, -243, -243, -243, -243, -243,
- -243, -243, -243, -243, -243, -243, -243, -243, -243, -243,
- -243, -243, -243, -243, -243, -243, -243, -243, -243, -243,
- -243, -243, -243, -243, -243, -243, -243, -243, -243, -243,
- -243, -243, -243, -243, -243, -243, -243, -243, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -243, -243,
- -243, -243, -243, -243, -243, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 285, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -243, -243, -243, -243, 60, -243, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -243, -243, -243, -243, -243,
-
- 5, -244, -244, -244, -244, -244, -244, -244, -244, -244,
- -244, -244, -244, -244, -244, -244, -244, -244, -244, -244,
- -244, -244, -244, -244, -244, -244, -244, -244, -244, -244,
- -244, -244, -244, -244, -244, -244, -244, -244, -244, -244,
- -244, -244, -244, -244, -244, -244, -244, -244, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -244, -244,
- -244, -244, -244, -244, -244, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -244, -244, -244, -244, 60, -244, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -244, -244, -244, -244, -244,
-
- 5, -245, -245, -245, -245, -245, -245, -245, -245, -245,
- -245, -245, -245, -245, -245, -245, -245, -245, -245, -245,
- -245, -245, -245, -245, -245, -245, -245, -245, -245, -245,
- -245, -245, -245, -245, -245, -245, -245, -245, -245, -245,
- -245, -245, -245, -245, -245, -245, -245, -245, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -245, -245,
- -245, -245, -245, -245, -245, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -245, -245, -245, -245, 60, -245, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -245, -245, -245, -245, -245,
-
- 5, -246, -246, -246, -246, -246, -246, -246, -246, -246,
- -246, -246, -246, -246, -246, -246, -246, -246, -246, -246,
- -246, -246, -246, -246, -246, -246, -246, -246, -246, -246,
- -246, -246, -246, -246, -246, -246, -246, -246, -246, -246,
- -246, -246, -246, -246, -246, -246, -246, -246, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -246, -246,
- -246, -246, -246, -246, -246, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -246, -246, -246, -246, 60, -246, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -246, -246, -246, -246, -246,
-
- 5, -247, -247, -247, -247, -247, -247, -247, -247, -247,
- -247, -247, -247, -247, -247, -247, -247, -247, -247, -247,
- -247, -247, -247, -247, -247, -247, -247, -247, -247, -247,
- -247, -247, -247, -247, -247, -247, -247, -247, -247, -247,
- -247, -247, -247, -247, -247, -247, -247, -247, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -247, -247,
- -247, -247, -247, -247, -247, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -247, -247, -247, -247, 60, -247, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -247, -247, -247, -247, -247,
-
- 5, -248, -248, -248, -248, -248, -248, -248, -248, -248,
- -248, -248, -248, -248, -248, -248, -248, -248, -248, -248,
- -248, -248, -248, -248, -248, -248, -248, -248, -248, -248,
- -248, -248, -248, -248, -248, -248, -248, -248, -248, -248,
- -248, -248, -248, -248, -248, -248, -248, -248, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -248, -248,
- -248, -248, -248, -248, -248, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 286, 60, 60, 60, 60, 60,
- 60, -248, -248, -248, -248, 60, -248, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -248, -248, -248, -248, -248,
-
- 5, -249, -249, -249, -249, -249, -249, -249, -249, -249,
- -249, -249, -249, -249, -249, -249, -249, -249, -249, -249,
- -249, -249, -249, -249, -249, -249, -249, -249, -249, -249,
- -249, -249, -249, -249, -249, -249, -249, -249, -249, -249,
- -249, -249, -249, -249, -249, -249, -249, -249, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -249, -249,
- -249, -249, -249, -249, -249, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -249, -249, -249, -249, 60, -249, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -249, -249, -249, -249, -249,
-
- 5, -250, -250, -250, -250, -250, -250, -250, -250, -250,
- -250, -250, -250, -250, -250, -250, -250, -250, -250, -250,
- -250, -250, -250, -250, -250, -250, -250, -250, -250, -250,
- -250, -250, -250, -250, -250, -250, -250, -250, -250, -250,
- -250, -250, -250, -250, -250, -250, -250, -250, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -250, -250,
- -250, -250, -250, -250, -250, 60, 60, 60, 60, 287,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -250, -250, -250, -250, 60, -250, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -250, -250, -250, -250, -250,
-
- 5, -251, -251, -251, -251, -251, -251, -251, -251, -251,
- -251, -251, -251, -251, -251, -251, -251, -251, -251, -251,
- -251, -251, -251, -251, -251, -251, -251, -251, -251, -251,
- -251, -251, -251, -251, -251, -251, -251, -251, -251, -251,
- -251, -251, -251, -251, -251, -251, -251, -251, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -251, -251,
- -251, -251, -251, -251, -251, 60, 60, 60, 60, 60,
- 60, 60, 288, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -251, -251, -251, -251, 60, -251, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -251, -251, -251, -251, -251,
-
- 5, -252, -252, -252, -252, -252, -252, -252, -252, -252,
- -252, -252, -252, -252, -252, -252, -252, -252, -252, -252,
- -252, -252, -252, -252, -252, -252, -252, -252, -252, -252,
- -252, -252, -252, -252, -252, -252, -252, -252, -252, -252,
- -252, -252, -252, -252, -252, -252, -252, -252, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -252, -252,
- -252, -252, -252, -252, -252, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 289, 60, 60, 60, 60,
- 60, -252, -252, -252, -252, 60, -252, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -252, -252, -252, -252, -252,
-
- 5, -253, -253, -253, -253, -253, -253, -253, -253, -253,
- -253, -253, -253, -253, -253, -253, -253, -253, -253, -253,
- -253, -253, -253, -253, -253, -253, -253, -253, -253, -253,
- -253, -253, -253, -253, -253, -253, -253, -253, -253, -253,
- -253, -253, -253, -253, -253, -253, -253, -253, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -253, -253,
- -253, -253, -253, -253, -253, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -253, -253, -253, -253, 60, -253, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -253, -253, -253, -253, -253,
-
- 5, -254, -254, -254, -254, -254, -254, -254, -254, -254,
- -254, -254, -254, -254, -254, -254, -254, -254, -254, -254,
- -254, -254, -254, -254, -254, -254, -254, -254, -254, -254,
- -254, -254, -254, -254, -254, -254, -254, -254, -254, -254,
- -254, -254, -254, -254, -254, -254, -254, -254, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -254, -254,
- -254, -254, -254, -254, -254, 60, 60, 60, 60, 60,
- 290, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -254, -254, -254, -254, 60, -254, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -254, -254, -254, -254, -254,
-
- 5, -255, -255, -255, -255, -255, -255, -255, -255, -255,
- -255, -255, -255, -255, -255, -255, -255, -255, -255, -255,
- -255, -255, -255, -255, -255, -255, -255, -255, -255, -255,
- -255, -255, -255, -255, -255, -255, -255, -255, -255, -255,
- -255, -255, -255, -255, -255, -255, -255, -255, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -255, -255,
- -255, -255, -255, -255, -255, 60, 60, 60, 291, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -255, -255, -255, -255, 60, -255, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -255, -255, -255, -255, -255,
-
- 5, -256, -256, -256, -256, -256, -256, -256, -256, -256,
- -256, -256, -256, -256, -256, -256, -256, -256, -256, -256,
- -256, -256, -256, -256, -256, -256, -256, -256, -256, -256,
- -256, -256, -256, -256, -256, -256, -256, -256, -256, -256,
- -256, -256, -256, -256, -256, -256, -256, -256, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -256, -256,
- -256, -256, -256, -256, -256, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 292, 60, 60, 60, 60, 60,
- 60, -256, -256, -256, -256, 60, -256, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -256, -256, -256, -256, -256,
-
- 5, -257, -257, -257, -257, -257, -257, -257, -257, -257,
- -257, -257, -257, -257, -257, -257, -257, -257, -257, -257,
- -257, -257, -257, -257, -257, -257, -257, -257, -257, -257,
- -257, -257, -257, -257, -257, -257, -257, -257, -257, -257,
- -257, -257, -257, -257, -257, -257, -257, -257, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -257, -257,
- -257, -257, -257, -257, -257, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 293, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -257, -257, -257, -257, 60, -257, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -257, -257, -257, -257, -257,
-
- 5, -258, -258, -258, -258, -258, -258, -258, -258, -258,
- -258, -258, -258, -258, -258, -258, -258, -258, -258, -258,
- -258, -258, -258, -258, -258, -258, -258, -258, -258, -258,
- -258, -258, -258, -258, -258, -258, -258, -258, -258, -258,
- -258, -258, -258, -258, -258, -258, -258, -258, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -258, -258,
- -258, -258, -258, -258, -258, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 294, 60, 60, 60, 60, 60,
- 60, -258, -258, -258, -258, 60, -258, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -258, -258, -258, -258, -258,
-
- 5, -259, -259, -259, -259, -259, -259, -259, -259, -259,
- -259, -259, -259, -259, -259, -259, -259, -259, -259, -259,
- -259, -259, -259, -259, -259, -259, -259, -259, -259, -259,
- -259, -259, -259, -259, -259, -259, -259, -259, -259, -259,
- -259, -259, -259, -259, -259, -259, -259, -259, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -259, -259,
- -259, -259, -259, -259, -259, 295, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -259, -259, -259, -259, 60, -259, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -259, -259, -259, -259, -259,
-
- 5, -260, -260, -260, -260, -260, -260, -260, -260, -260,
- -260, -260, -260, -260, -260, -260, -260, -260, -260, -260,
- -260, -260, -260, -260, -260, -260, -260, -260, -260, -260,
- -260, -260, -260, -260, -260, -260, -260, -260, -260, -260,
- -260, -260, -260, -260, -260, -260, -260, -260, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -260, -260,
- -260, -260, -260, -260, -260, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 296, 60, 60, 60, 60, 60, 60, 60,
- 60, -260, -260, -260, -260, 60, -260, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -260, -260, -260, -260, -260,
-
- 5, -261, -261, -261, -261, -261, -261, -261, -261, -261,
- -261, -261, -261, -261, -261, -261, -261, -261, -261, -261,
- -261, -261, -261, -261, -261, -261, -261, -261, -261, -261,
- -261, -261, -261, -261, -261, -261, -261, -261, -261, -261,
- -261, -261, -261, -261, -261, -261, -261, -261, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -261, -261,
- -261, -261, -261, -261, -261, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 297, 60, 60, 60, 60, 60,
- 60, -261, -261, -261, -261, 60, -261, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -261, -261, -261, -261, -261,
-
- 5, -262, -262, -262, -262, -262, -262, -262, -262, -262,
- -262, -262, -262, -262, -262, -262, -262, -262, -262, -262,
- -262, -262, -262, -262, -262, -262, -262, -262, -262, -262,
- -262, -262, -262, -262, -262, -262, -262, -262, -262, -262,
- -262, -262, -262, -262, -262, -262, -262, -262, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -262, -262,
- -262, -262, -262, -262, -262, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 298, 60, 60, 60, 60, 60, 60, 60,
- 60, -262, -262, -262, -262, 60, -262, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -262, -262, -262, -262, -262,
-
- 5, -263, -263, -263, -263, -263, -263, -263, -263, -263,
- -263, -263, -263, -263, -263, -263, -263, -263, -263, -263,
- -263, -263, -263, -263, -263, -263, -263, -263, -263, -263,
- -263, -263, -263, -263, -263, -263, -263, -263, -263, -263,
- -263, -263, -263, -263, -263, -263, -263, -263, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -263, -263,
- -263, -263, -263, -263, -263, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 299, 60, 60, 60, 60, 60,
- 60, -263, -263, -263, -263, 60, -263, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -263, -263, -263, -263, -263,
-
- 5, -264, -264, -264, -264, -264, -264, -264, -264, -264,
- -264, -264, -264, -264, -264, -264, -264, -264, -264, -264,
- -264, -264, -264, -264, -264, -264, -264, -264, -264, -264,
- -264, -264, -264, -264, -264, -264, -264, -264, -264, -264,
- -264, -264, -264, -264, -264, -264, -264, -264, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -264, -264,
- -264, -264, -264, -264, -264, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -264, -264, -264, -264, 60, -264, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -264, -264, -264, -264, -264,
-
- 5, -265, -265, -265, -265, -265, -265, -265, -265, -265,
- -265, -265, -265, -265, -265, -265, -265, -265, -265, -265,
- -265, -265, -265, -265, -265, -265, -265, -265, -265, -265,
- -265, -265, -265, -265, -265, -265, -265, -265, -265, -265,
- -265, -265, -265, -265, -265, -265, -265, -265, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -265, -265,
- -265, -265, -265, -265, -265, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 300, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -265, -265, -265, -265, 60, -265, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -265, -265, -265, -265, -265,
-
- 5, -266, -266, -266, -266, -266, -266, -266, -266, -266,
- -266, -266, -266, -266, -266, -266, -266, -266, -266, -266,
- -266, -266, -266, -266, -266, -266, -266, -266, -266, -266,
- -266, -266, -266, -266, -266, -266, -266, -266, -266, -266,
- -266, -266, -266, -266, -266, -266, -266, -266, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -266, -266,
- -266, -266, -266, -266, -266, 301, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -266, -266, -266, -266, 60, -266, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -266, -266, -266, -266, -266,
-
- 5, -267, -267, -267, -267, -267, -267, -267, -267, -267,
- -267, -267, -267, -267, -267, -267, -267, -267, -267, -267,
- -267, -267, -267, -267, -267, -267, -267, -267, -267, -267,
- -267, -267, -267, -267, -267, -267, -267, -267, -267, -267,
- -267, -267, -267, -267, -267, -267, -267, -267, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -267, -267,
- -267, -267, -267, -267, -267, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 302, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -267, -267, -267, -267, 60, -267, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -267, -267, -267, -267, -267,
-
- 5, -268, -268, -268, -268, -268, -268, -268, -268, -268,
- -268, -268, -268, -268, -268, -268, -268, -268, -268, -268,
- -268, -268, -268, -268, -268, -268, -268, -268, -268, -268,
- -268, -268, -268, -268, -268, -268, -268, -268, -268, -268,
- -268, -268, -268, -268, -268, -268, -268, -268, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -268, -268,
- -268, -268, -268, -268, -268, 60, 60, 60, 60, 303,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -268, -268, -268, -268, 60, -268, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -268, -268, -268, -268, -268,
-
- 5, -269, -269, -269, -269, -269, -269, -269, -269, -269,
- -269, -269, -269, -269, -269, -269, -269, -269, -269, -269,
- -269, -269, -269, -269, -269, -269, -269, -269, -269, -269,
- -269, -269, -269, -269, -269, -269, -269, -269, -269, -269,
- -269, -269, -269, -269, -269, -269, -269, -269, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -269, -269,
- -269, -269, -269, -269, -269, 60, 60, 60, 60, 304,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -269, -269, -269, -269, 60, -269, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -269, -269, -269, -269, -269,
-
- 5, -270, -270, -270, -270, -270, -270, -270, -270, -270,
- -270, -270, -270, -270, -270, -270, -270, -270, -270, -270,
- -270, -270, -270, -270, -270, -270, -270, -270, -270, -270,
- -270, -270, -270, -270, -270, -270, -270, -270, -270, -270,
- -270, -270, -270, -270, -270, -270, -270, -270, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -270, -270,
- -270, -270, -270, -270, -270, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 305, 60, 60, 60, 60, 60, 60,
- 60, -270, -270, -270, -270, 60, -270, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -270, -270, -270, -270, -270,
-
- 5, -271, -271, -271, -271, -271, -271, -271, -271, -271,
- -271, -271, -271, -271, -271, -271, -271, -271, -271, -271,
- -271, -271, -271, -271, -271, -271, -271, -271, -271, -271,
- -271, -271, -271, -271, -271, -271, -271, -271, -271, -271,
- -271, -271, -271, -271, -271, -271, -271, -271, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -271, -271,
- -271, -271, -271, -271, -271, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -271, -271, -271, -271, 60, -271, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -271, -271, -271, -271, -271,
-
- 5, -272, -272, -272, -272, -272, -272, -272, -272, -272,
- -272, -272, -272, -272, -272, -272, -272, -272, -272, -272,
- -272, -272, -272, -272, -272, -272, -272, -272, -272, -272,
- -272, -272, -272, -272, -272, -272, -272, -272, -272, -272,
- -272, -272, -272, -272, -272, -272, -272, -272, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -272, -272,
- -272, -272, -272, -272, -272, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -272, -272, -272, -272, 60, -272, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -272, -272, -272, -272, -272,
-
- 5, -273, -273, -273, -273, -273, -273, -273, -273, -273,
- -273, -273, -273, -273, -273, -273, -273, -273, -273, -273,
- -273, -273, -273, -273, -273, -273, -273, -273, -273, -273,
- -273, -273, -273, -273, -273, -273, -273, -273, -273, -273,
- -273, -273, -273, -273, -273, -273, -273, -273, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -273, -273,
- -273, -273, -273, -273, -273, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -273, -273, -273, -273, 60, -273, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -273, -273, -273, -273, -273,
-
- 5, -274, -274, -274, -274, -274, -274, -274, -274, -274,
- -274, -274, -274, -274, -274, -274, -274, -274, -274, -274,
- -274, -274, -274, -274, -274, -274, -274, -274, -274, -274,
- -274, -274, -274, -274, -274, -274, -274, -274, -274, -274,
- -274, -274, -274, -274, -274, -274, -274, -274, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -274, -274,
- -274, -274, -274, -274, -274, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -274, -274, -274, -274, 306, -274, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -274, -274, -274, -274, -274,
-
- 5, -275, -275, -275, -275, -275, -275, -275, -275, -275,
- -275, -275, -275, -275, -275, -275, -275, -275, -275, -275,
- -275, -275, -275, -275, -275, -275, -275, -275, -275, -275,
- -275, -275, -275, -275, -275, -275, -275, -275, -275, -275,
- -275, -275, -275, -275, -275, -275, -275, -275, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -275, -275,
- -275, -275, -275, -275, -275, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 307, 60, 60, 60, 60, 60, 60, 60,
- 60, -275, -275, -275, -275, 60, -275, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -275, -275, -275, -275, -275,
-
- 5, -276, -276, -276, -276, -276, -276, -276, -276, -276,
- -276, -276, -276, -276, -276, -276, -276, -276, -276, -276,
- -276, -276, -276, -276, -276, -276, -276, -276, -276, -276,
- -276, -276, -276, -276, -276, -276, -276, -276, -276, -276,
- -276, -276, -276, -276, -276, -276, -276, -276, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -276, -276,
- -276, -276, -276, -276, -276, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -276, -276, -276, -276, 60, -276, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -276, -276, -276, -276, -276,
-
- 5, -277, -277, -277, -277, -277, -277, -277, -277, -277,
- -277, -277, -277, -277, -277, -277, -277, -277, -277, -277,
- -277, -277, -277, -277, -277, -277, -277, -277, -277, -277,
- -277, -277, -277, -277, -277, -277, -277, -277, -277, -277,
- -277, -277, -277, -277, -277, -277, -277, -277, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -277, -277,
- -277, -277, -277, -277, -277, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -277, -277, -277, -277, 60, -277, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -277, -277, -277, -277, -277,
-
- 5, -278, -278, -278, -278, -278, -278, -278, -278, -278,
- -278, -278, -278, -278, -278, -278, -278, -278, -278, -278,
- -278, -278, -278, -278, -278, -278, -278, -278, -278, -278,
- -278, -278, -278, -278, -278, -278, -278, -278, -278, -278,
- -278, -278, -278, -278, -278, -278, -278, -278, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -278, -278,
- -278, -278, -278, -278, -278, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 308, 60, 60, 60, 60, 60,
- 60, -278, -278, -278, -278, 60, -278, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -278, -278, -278, -278, -278,
-
- 5, -279, -279, -279, -279, -279, -279, -279, -279, -279,
- -279, -279, -279, -279, -279, -279, -279, -279, -279, -279,
- -279, -279, -279, -279, -279, -279, -279, -279, -279, -279,
- -279, -279, -279, -279, -279, -279, -279, -279, -279, -279,
- -279, -279, -279, -279, -279, -279, -279, -279, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -279, -279,
- -279, -279, -279, -279, -279, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -279, -279, -279, -279, 60, -279, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -279, -279, -279, -279, -279,
-
- 5, -280, -280, -280, -280, -280, -280, -280, -280, -280,
- -280, -280, -280, -280, -280, -280, -280, -280, -280, -280,
- -280, -280, -280, -280, -280, -280, -280, -280, -280, -280,
- -280, -280, -280, -280, -280, -280, -280, -280, -280, -280,
- -280, -280, -280, -280, -280, -280, -280, -280, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -280, -280,
- -280, -280, -280, -280, -280, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 309, 60, 60, 60, 60, 60,
- 60, -280, -280, -280, -280, 60, -280, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -280, -280, -280, -280, -280,
-
- 5, -281, -281, -281, -281, -281, -281, -281, -281, -281,
- -281, -281, -281, -281, -281, -281, -281, -281, -281, -281,
- -281, -281, -281, -281, -281, -281, -281, -281, -281, -281,
- -281, -281, -281, -281, -281, -281, -281, -281, -281, -281,
- -281, -281, -281, -281, -281, -281, -281, -281, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -281, -281,
- -281, -281, -281, -281, -281, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -281, -281, -281, -281, 60, -281, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -281, -281, -281, -281, -281,
-
- 5, -282, -282, -282, -282, -282, -282, -282, -282, -282,
- -282, -282, -282, -282, -282, -282, -282, -282, -282, -282,
- -282, -282, -282, -282, -282, -282, -282, -282, -282, -282,
- -282, -282, -282, -282, -282, -282, -282, -282, -282, -282,
- -282, -282, -282, -282, -282, -282, -282, -282, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -282, -282,
- -282, -282, -282, -282, -282, 60, 60, 60, 60, 310,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -282, -282, -282, -282, 60, -282, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -282, -282, -282, -282, -282,
-
- 5, -283, -283, -283, -283, -283, -283, -283, -283, -283,
- -283, -283, -283, -283, -283, -283, -283, -283, -283, -283,
- -283, -283, -283, -283, -283, -283, -283, -283, -283, -283,
- -283, -283, -283, -283, -283, -283, -283, -283, -283, -283,
- -283, -283, -283, -283, -283, -283, -283, -283, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -283, -283,
- -283, -283, -283, -283, -283, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -283, -283, -283, -283, 60, -283, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -283, -283, -283, -283, -283,
-
- 5, -284, -284, -284, -284, -284, -284, -284, -284, -284,
- -284, -284, -284, -284, -284, -284, -284, -284, -284, -284,
- -284, -284, -284, -284, -284, -284, -284, -284, -284, -284,
- -284, -284, -284, -284, -284, -284, -284, -284, -284, -284,
- -284, -284, -284, -284, -284, -284, -284, -284, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -284, -284,
- -284, -284, -284, -284, -284, 60, 60, 311, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -284, -284, -284, -284, 60, -284, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -284, -284, -284, -284, -284,
-
- 5, -285, -285, -285, -285, -285, -285, -285, -285, -285,
- -285, -285, -285, -285, -285, -285, -285, -285, -285, -285,
- -285, -285, -285, -285, -285, -285, -285, -285, -285, -285,
- -285, -285, -285, -285, -285, -285, -285, -285, -285, -285,
- -285, -285, -285, -285, -285, -285, -285, -285, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -285, -285,
- -285, -285, -285, -285, -285, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 312,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -285, -285, -285, -285, 60, -285, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -285, -285, -285, -285, -285,
-
- 5, -286, -286, -286, -286, -286, -286, -286, -286, -286,
- -286, -286, -286, -286, -286, -286, -286, -286, -286, -286,
- -286, -286, -286, -286, -286, -286, -286, -286, -286, -286,
- -286, -286, -286, -286, -286, -286, -286, -286, -286, -286,
- -286, -286, -286, -286, -286, -286, -286, -286, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -286, -286,
- -286, -286, -286, -286, -286, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -286, -286, -286, -286, 60, -286, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -286, -286, -286, -286, -286,
-
- 5, -287, -287, -287, -287, -287, -287, -287, -287, -287,
- -287, -287, -287, -287, -287, -287, -287, -287, -287, -287,
- -287, -287, -287, -287, -287, -287, -287, -287, -287, -287,
- -287, -287, -287, -287, -287, -287, -287, -287, -287, -287,
- -287, -287, -287, -287, -287, -287, -287, -287, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -287, -287,
- -287, -287, -287, -287, -287, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 313, 60, 60, 60, 60, 60, 60, 60,
- 60, -287, -287, -287, -287, 60, -287, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -287, -287, -287, -287, -287,
-
- 5, -288, -288, -288, -288, -288, -288, -288, -288, -288,
- -288, -288, -288, -288, -288, -288, -288, -288, -288, -288,
- -288, -288, -288, -288, -288, -288, -288, -288, -288, -288,
- -288, -288, -288, -288, -288, -288, -288, -288, -288, -288,
- -288, -288, -288, -288, -288, -288, -288, -288, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -288, -288,
- -288, -288, -288, -288, -288, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -288, -288, -288, -288, 60, -288, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -288, -288, -288, -288, -288,
-
- 5, -289, -289, -289, -289, -289, -289, -289, -289, -289,
- -289, -289, -289, -289, -289, -289, -289, -289, -289, -289,
- -289, -289, -289, -289, -289, -289, -289, -289, -289, -289,
- -289, -289, -289, -289, -289, -289, -289, -289, -289, -289,
- -289, -289, -289, -289, -289, -289, -289, -289, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -289, -289,
- -289, -289, -289, -289, -289, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 314, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -289, -289, -289, -289, 60, -289, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -289, -289, -289, -289, -289,
-
- 5, -290, -290, -290, -290, -290, -290, -290, -290, -290,
- -290, -290, -290, -290, -290, -290, -290, -290, -290, -290,
- -290, -290, -290, -290, -290, -290, -290, -290, -290, -290,
- -290, -290, -290, -290, -290, -290, -290, -290, -290, -290,
- -290, -290, -290, -290, -290, -290, -290, -290, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -290, -290,
- -290, -290, -290, -290, -290, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -290, -290, -290, -290, 60, -290, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -290, -290, -290, -290, -290,
-
- 5, -291, -291, -291, -291, -291, -291, -291, -291, -291,
- -291, -291, -291, -291, -291, -291, -291, -291, -291, -291,
- -291, -291, -291, -291, -291, -291, -291, -291, -291, -291,
- -291, -291, -291, -291, -291, -291, -291, -291, -291, -291,
- -291, -291, -291, -291, -291, -291, -291, -291, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -291, -291,
- -291, -291, -291, -291, -291, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 315, 60, 60, 60, 60,
- 60, -291, -291, -291, -291, 60, -291, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -291, -291, -291, -291, -291,
-
- 5, -292, -292, -292, -292, -292, -292, -292, -292, -292,
- -292, -292, -292, -292, -292, -292, -292, -292, -292, -292,
- -292, -292, -292, -292, -292, -292, -292, -292, -292, -292,
- -292, -292, -292, -292, -292, -292, -292, -292, -292, -292,
- -292, -292, -292, -292, -292, -292, -292, -292, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -292, -292,
- -292, -292, -292, -292, -292, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 316, 60, 60, 60, 60, 60, 60, 60,
- 60, -292, -292, -292, -292, 60, -292, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -292, -292, -292, -292, -292,
-
- 5, -293, -293, -293, -293, -293, -293, -293, -293, -293,
- -293, -293, -293, -293, -293, -293, -293, -293, -293, -293,
- -293, -293, -293, -293, -293, -293, -293, -293, -293, -293,
- -293, -293, -293, -293, -293, -293, -293, -293, -293, -293,
- -293, -293, -293, -293, -293, -293, -293, -293, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -293, -293,
- -293, -293, -293, -293, -293, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -293, -293, -293, -293, 60, -293, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -293, -293, -293, -293, -293,
-
- 5, -294, -294, -294, -294, -294, -294, -294, -294, -294,
- -294, -294, -294, -294, -294, -294, -294, -294, -294, -294,
- -294, -294, -294, -294, -294, -294, -294, -294, -294, -294,
- -294, -294, -294, -294, -294, -294, -294, -294, -294, -294,
- -294, -294, -294, -294, -294, -294, -294, -294, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -294, -294,
- -294, -294, -294, -294, -294, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 317, 60, 60, 60, 60, 60, 60, 60,
- 60, -294, -294, -294, -294, 60, -294, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -294, -294, -294, -294, -294,
-
- 5, -295, -295, -295, -295, -295, -295, -295, -295, -295,
- -295, -295, -295, -295, -295, -295, -295, -295, -295, -295,
- -295, -295, -295, -295, -295, -295, -295, -295, -295, -295,
- -295, -295, -295, -295, -295, -295, -295, -295, -295, -295,
- -295, -295, -295, -295, -295, -295, -295, -295, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -295, -295,
- -295, -295, -295, -295, -295, 60, 60, 318, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -295, -295, -295, -295, 60, -295, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -295, -295, -295, -295, -295,
-
- 5, -296, -296, -296, -296, -296, -296, -296, -296, -296,
- -296, -296, -296, -296, -296, -296, -296, -296, -296, -296,
- -296, -296, -296, -296, -296, -296, -296, -296, -296, -296,
- -296, -296, -296, -296, -296, -296, -296, -296, -296, -296,
- -296, -296, -296, -296, -296, -296, -296, -296, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -296, -296,
- -296, -296, -296, -296, -296, 60, 60, 60, 60, 60,
- 60, 60, 60, 319, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -296, -296, -296, -296, 60, -296, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -296, -296, -296, -296, -296,
-
- 5, -297, -297, -297, -297, -297, -297, -297, -297, -297,
- -297, -297, -297, -297, -297, -297, -297, -297, -297, -297,
- -297, -297, -297, -297, -297, -297, -297, -297, -297, -297,
- -297, -297, -297, -297, -297, -297, -297, -297, -297, -297,
- -297, -297, -297, -297, -297, -297, -297, -297, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -297, -297,
- -297, -297, -297, -297, -297, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -297, -297, -297, -297, 60, -297, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -297, -297, -297, -297, -297,
-
- 5, -298, -298, -298, -298, -298, -298, -298, -298, -298,
- -298, -298, -298, -298, -298, -298, -298, -298, -298, -298,
- -298, -298, -298, -298, -298, -298, -298, -298, -298, -298,
- -298, -298, -298, -298, -298, -298, -298, -298, -298, -298,
- -298, -298, -298, -298, -298, -298, -298, -298, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -298, -298,
- -298, -298, -298, -298, -298, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -298, -298, -298, -298, 60, -298, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -298, -298, -298, -298, -298,
-
- 5, -299, -299, -299, -299, -299, -299, -299, -299, -299,
- -299, -299, -299, -299, -299, -299, -299, -299, -299, -299,
- -299, -299, -299, -299, -299, -299, -299, -299, -299, -299,
- -299, -299, -299, -299, -299, -299, -299, -299, -299, -299,
- -299, -299, -299, -299, -299, -299, -299, -299, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -299, -299,
- -299, -299, -299, -299, -299, 60, 60, 60, 60, 320,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -299, -299, -299, -299, 60, -299, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -299, -299, -299, -299, -299,
-
- 5, -300, -300, -300, -300, -300, -300, -300, -300, -300,
- -300, -300, -300, -300, -300, -300, -300, -300, -300, -300,
- -300, -300, -300, -300, -300, -300, -300, -300, -300, -300,
- -300, -300, -300, -300, -300, -300, -300, -300, -300, -300,
- -300, -300, -300, -300, -300, -300, -300, -300, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -300, -300,
- -300, -300, -300, -300, -300, 321, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -300, -300, -300, -300, 60, -300, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -300, -300, -300, -300, -300,
-
- 5, -301, -301, -301, -301, -301, -301, -301, -301, -301,
- -301, -301, -301, -301, -301, -301, -301, -301, -301, -301,
- -301, -301, -301, -301, -301, -301, -301, -301, -301, -301,
- -301, -301, -301, -301, -301, -301, -301, -301, -301, -301,
- -301, -301, -301, -301, -301, -301, -301, -301, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -301, -301,
- -301, -301, -301, -301, -301, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 322, 60, 60, 60, 60, 60, 60, 60,
- 60, -301, -301, -301, -301, 60, -301, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -301, -301, -301, -301, -301,
-
- 5, -302, -302, -302, -302, -302, -302, -302, -302, -302,
- -302, -302, -302, -302, -302, -302, -302, -302, -302, -302,
- -302, -302, -302, -302, -302, -302, -302, -302, -302, -302,
- -302, -302, -302, -302, -302, -302, -302, -302, -302, -302,
- -302, -302, -302, -302, -302, -302, -302, -302, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -302, -302,
- -302, -302, -302, -302, -302, 60, 323, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -302, -302, -302, -302, 60, -302, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -302, -302, -302, -302, -302,
-
- 5, -303, -303, -303, -303, -303, -303, -303, -303, -303,
- -303, -303, -303, -303, -303, -303, -303, -303, -303, -303,
- -303, -303, -303, -303, -303, -303, -303, -303, -303, -303,
- -303, -303, -303, -303, -303, -303, -303, -303, -303, -303,
- -303, -303, -303, -303, -303, -303, -303, -303, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -303, -303,
- -303, -303, -303, -303, -303, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -303, -303, -303, -303, 60, -303, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -303, -303, -303, -303, -303,
-
- 5, -304, -304, -304, -304, -304, -304, -304, -304, -304,
- -304, -304, -304, -304, -304, -304, -304, -304, -304, -304,
- -304, -304, -304, -304, -304, -304, -304, -304, -304, -304,
- -304, -304, -304, -304, -304, -304, -304, -304, -304, -304,
- -304, -304, -304, -304, -304, -304, -304, -304, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -304, -304,
- -304, -304, -304, -304, -304, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -304, -304, -304, -304, 60, -304, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -304, -304, -304, -304, -304,
-
- 5, -305, -305, -305, -305, -305, -305, -305, -305, -305,
- -305, -305, -305, -305, -305, -305, -305, -305, -305, -305,
- -305, -305, -305, -305, -305, -305, -305, -305, -305, -305,
- -305, -305, -305, -305, -305, -305, -305, -305, -305, -305,
- -305, -305, -305, -305, -305, -305, -305, -305, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -305, -305,
- -305, -305, -305, -305, -305, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -305, -305, -305, -305, 60, -305, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -305, -305, -305, -305, -305,
-
- 5, -306, -306, -306, -306, -306, -306, -306, -306, -306,
- -306, -306, -306, -306, -306, -306, -306, -306, -306, -306,
- -306, -306, -306, -306, -306, -306, -306, -306, -306, -306,
- -306, -306, -306, -306, -306, -306, -306, -306, -306, -306,
- -306, -306, -306, -306, -306, -306, -306, -306, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -306, -306,
- -306, -306, -306, -306, -306, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 324, 60, 60, 60, 60, 60,
- 60, -306, -306, -306, -306, 60, -306, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -306, -306, -306, -306, -306,
-
- 5, -307, -307, -307, -307, -307, -307, -307, -307, -307,
- -307, -307, -307, -307, -307, -307, -307, -307, -307, -307,
- -307, -307, -307, -307, -307, -307, -307, -307, -307, -307,
- -307, -307, -307, -307, -307, -307, -307, -307, -307, -307,
- -307, -307, -307, -307, -307, -307, -307, -307, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -307, -307,
- -307, -307, -307, -307, -307, 60, 60, 60, 60, 325,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -307, -307, -307, -307, 60, -307, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -307, -307, -307, -307, -307,
-
- 5, -308, -308, -308, -308, -308, -308, -308, -308, -308,
- -308, -308, -308, -308, -308, -308, -308, -308, -308, -308,
- -308, -308, -308, -308, -308, -308, -308, -308, -308, -308,
- -308, -308, -308, -308, -308, -308, -308, -308, -308, -308,
- -308, -308, -308, -308, -308, -308, -308, -308, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -308, -308,
- -308, -308, -308, -308, -308, 60, 60, 60, 60, 326,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -308, -308, -308, -308, 60, -308, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -308, -308, -308, -308, -308,
-
- 5, -309, -309, -309, -309, -309, -309, -309, -309, -309,
- -309, -309, -309, -309, -309, -309, -309, -309, -309, -309,
- -309, -309, -309, -309, -309, -309, -309, -309, -309, -309,
- -309, -309, -309, -309, -309, -309, -309, -309, -309, -309,
- -309, -309, -309, -309, -309, -309, -309, -309, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -309, -309,
- -309, -309, -309, -309, -309, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -309, -309, -309, -309, 60, -309, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -309, -309, -309, -309, -309,
-
- 5, -310, -310, -310, -310, -310, -310, -310, -310, -310,
- -310, -310, -310, -310, -310, -310, -310, -310, -310, -310,
- -310, -310, -310, -310, -310, -310, -310, -310, -310, -310,
- -310, -310, -310, -310, -310, -310, -310, -310, -310, -310,
- -310, -310, -310, -310, -310, -310, -310, -310, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -310, -310,
- -310, -310, -310, -310, -310, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -310, -310, -310, -310, 60, -310, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -310, -310, -310, -310, -310,
-
- 5, -311, -311, -311, -311, -311, -311, -311, -311, -311,
- -311, -311, -311, -311, -311, -311, -311, -311, -311, -311,
- -311, -311, -311, -311, -311, -311, -311, -311, -311, -311,
- -311, -311, -311, -311, -311, -311, -311, -311, -311, -311,
- -311, -311, -311, -311, -311, -311, -311, -311, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -311, -311,
- -311, -311, -311, -311, -311, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 327, 60, 60, 60, 60, 60,
- 60, -311, -311, -311, -311, 60, -311, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -311, -311, -311, -311, -311,
-
- 5, -312, -312, -312, -312, -312, -312, -312, -312, -312,
- -312, -312, -312, -312, -312, -312, -312, -312, -312, -312,
- -312, -312, -312, -312, -312, -312, -312, -312, -312, -312,
- -312, -312, -312, -312, -312, -312, -312, -312, -312, -312,
- -312, -312, -312, -312, -312, -312, -312, -312, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -312, -312,
- -312, -312, -312, -312, -312, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 328, 60, 60, 60, 60, 60,
- 60, -312, -312, -312, -312, 60, -312, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -312, -312, -312, -312, -312,
-
- 5, -313, -313, -313, -313, -313, -313, -313, -313, -313,
- -313, -313, -313, -313, -313, -313, -313, -313, -313, -313,
- -313, -313, -313, -313, -313, -313, -313, -313, -313, -313,
- -313, -313, -313, -313, -313, -313, -313, -313, -313, -313,
- -313, -313, -313, -313, -313, -313, -313, -313, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -313, -313,
- -313, -313, -313, -313, -313, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -313, -313, -313, -313, 60, -313, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -313, -313, -313, -313, -313,
-
- 5, -314, -314, -314, -314, -314, -314, -314, -314, -314,
- -314, -314, -314, -314, -314, -314, -314, -314, -314, -314,
- -314, -314, -314, -314, -314, -314, -314, -314, -314, -314,
- -314, -314, -314, -314, -314, -314, -314, -314, -314, -314,
- -314, -314, -314, -314, -314, -314, -314, -314, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -314, -314,
- -314, -314, -314, -314, -314, 60, 60, 60, 329, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -314, -314, -314, -314, 60, -314, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -314, -314, -314, -314, -314,
-
- 5, -315, -315, -315, -315, -315, -315, -315, -315, -315,
- -315, -315, -315, -315, -315, -315, -315, -315, -315, -315,
- -315, -315, -315, -315, -315, -315, -315, -315, -315, -315,
- -315, -315, -315, -315, -315, -315, -315, -315, -315, -315,
- -315, -315, -315, -315, -315, -315, -315, -315, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -315, -315,
- -315, -315, -315, -315, -315, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 330, 60, 60, 60, 60, 60, 60, 60,
- 60, -315, -315, -315, -315, 60, -315, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -315, -315, -315, -315, -315,
-
- 5, -316, -316, -316, -316, -316, -316, -316, -316, -316,
- -316, -316, -316, -316, -316, -316, -316, -316, -316, -316,
- -316, -316, -316, -316, -316, -316, -316, -316, -316, -316,
- -316, -316, -316, -316, -316, -316, -316, -316, -316, -316,
- -316, -316, -316, -316, -316, -316, -316, -316, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -316, -316,
- -316, -316, -316, -316, -316, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -316, -316, -316, -316, 60, -316, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -316, -316, -316, -316, -316,
-
- 5, -317, -317, -317, -317, -317, -317, -317, -317, -317,
- -317, -317, -317, -317, -317, -317, -317, -317, -317, -317,
- -317, -317, -317, -317, -317, -317, -317, -317, -317, -317,
- -317, -317, -317, -317, -317, -317, -317, -317, -317, -317,
- -317, -317, -317, -317, -317, -317, -317, -317, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -317, -317,
- -317, -317, -317, -317, -317, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -317, -317, -317, -317, 60, -317, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -317, -317, -317, -317, -317,
-
- 5, -318, -318, -318, -318, -318, -318, -318, -318, -318,
- -318, -318, -318, -318, -318, -318, -318, -318, -318, -318,
- -318, -318, -318, -318, -318, -318, -318, -318, -318, -318,
- -318, -318, -318, -318, -318, -318, -318, -318, -318, -318,
- -318, -318, -318, -318, -318, -318, -318, -318, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -318, -318,
- -318, -318, -318, -318, -318, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 331, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -318, -318, -318, -318, 60, -318, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -318, -318, -318, -318, -318,
-
- 5, -319, -319, -319, -319, -319, -319, -319, -319, -319,
- -319, -319, -319, -319, -319, -319, -319, -319, -319, -319,
- -319, -319, -319, -319, -319, -319, -319, -319, -319, -319,
- -319, -319, -319, -319, -319, -319, -319, -319, -319, -319,
- -319, -319, -319, -319, -319, -319, -319, -319, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -319, -319,
- -319, -319, -319, -319, -319, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 332, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -319, -319, -319, -319, 60, -319, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -319, -319, -319, -319, -319,
-
- 5, -320, -320, -320, -320, -320, -320, -320, -320, -320,
- -320, -320, -320, -320, -320, -320, -320, -320, -320, -320,
- -320, -320, -320, -320, -320, -320, -320, -320, -320, -320,
- -320, -320, -320, -320, -320, -320, -320, -320, -320, -320,
- -320, -320, -320, -320, -320, -320, -320, -320, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -320, -320,
- -320, -320, -320, -320, -320, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -320, -320, -320, -320, 60, -320, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -320, -320, -320, -320, -320,
-
- 5, -321, -321, -321, -321, -321, -321, -321, -321, -321,
- -321, -321, -321, -321, -321, -321, -321, -321, -321, -321,
- -321, -321, -321, -321, -321, -321, -321, -321, -321, -321,
- -321, -321, -321, -321, -321, -321, -321, -321, -321, -321,
- -321, -321, -321, -321, -321, -321, -321, -321, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -321, -321,
- -321, -321, -321, -321, -321, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 333, 60, 60, 60, 60, 60, 60, 60,
- 60, -321, -321, -321, -321, 60, -321, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -321, -321, -321, -321, -321,
-
- 5, -322, -322, -322, -322, -322, -322, -322, -322, -322,
- -322, -322, -322, -322, -322, -322, -322, -322, -322, -322,
- -322, -322, -322, -322, -322, -322, -322, -322, -322, -322,
- -322, -322, -322, -322, -322, -322, -322, -322, -322, -322,
- -322, -322, -322, -322, -322, -322, -322, -322, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -322, -322,
- -322, -322, -322, -322, -322, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -322, -322, -322, -322, 60, -322, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -322, -322, -322, -322, -322,
-
- 5, -323, -323, -323, -323, -323, -323, -323, -323, -323,
- -323, -323, -323, -323, -323, -323, -323, -323, -323, -323,
- -323, -323, -323, -323, -323, -323, -323, -323, -323, -323,
- -323, -323, -323, -323, -323, -323, -323, -323, -323, -323,
- -323, -323, -323, -323, -323, -323, -323, -323, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -323, -323,
- -323, -323, -323, -323, -323, 60, 60, 60, 60, 334,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -323, -323, -323, -323, 60, -323, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -323, -323, -323, -323, -323,
-
- 5, -324, -324, -324, -324, -324, -324, -324, -324, -324,
- -324, -324, -324, -324, -324, -324, -324, -324, -324, -324,
- -324, -324, -324, -324, -324, -324, -324, -324, -324, -324,
- -324, -324, -324, -324, -324, -324, -324, -324, -324, -324,
- -324, -324, -324, -324, -324, -324, -324, -324, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -324, -324,
- -324, -324, -324, -324, -324, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 335,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -324, -324, -324, -324, 60, -324, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -324, -324, -324, -324, -324,
-
- 5, -325, -325, -325, -325, -325, -325, -325, -325, -325,
- -325, -325, -325, -325, -325, -325, -325, -325, -325, -325,
- -325, -325, -325, -325, -325, -325, -325, -325, -325, -325,
- -325, -325, -325, -325, -325, -325, -325, -325, -325, -325,
- -325, -325, -325, -325, -325, -325, -325, -325, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -325, -325,
- -325, -325, -325, -325, -325, 60, 60, 60, 336, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -325, -325, -325, -325, 60, -325, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -325, -325, -325, -325, -325,
-
- 5, -326, -326, -326, -326, -326, -326, -326, -326, -326,
- -326, -326, -326, -326, -326, -326, -326, -326, -326, -326,
- -326, -326, -326, -326, -326, -326, -326, -326, -326, -326,
- -326, -326, -326, -326, -326, -326, -326, -326, -326, -326,
- -326, -326, -326, -326, -326, -326, -326, -326, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -326, -326,
- -326, -326, -326, -326, -326, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 337, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -326, -326, -326, -326, 60, -326, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -326, -326, -326, -326, -326,
-
- 5, -327, -327, -327, -327, -327, -327, -327, -327, -327,
- -327, -327, -327, -327, -327, -327, -327, -327, -327, -327,
- -327, -327, -327, -327, -327, -327, -327, -327, -327, -327,
- -327, -327, -327, -327, -327, -327, -327, -327, -327, -327,
- -327, -327, -327, -327, -327, -327, -327, -327, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -327, -327,
- -327, -327, -327, -327, -327, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -327, -327, -327, -327, 60, -327, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -327, -327, -327, -327, -327,
-
- 5, -328, -328, -328, -328, -328, -328, -328, -328, -328,
- -328, -328, -328, -328, -328, -328, -328, -328, -328, -328,
- -328, -328, -328, -328, -328, -328, -328, -328, -328, -328,
- -328, -328, -328, -328, -328, -328, -328, -328, -328, -328,
- -328, -328, -328, -328, -328, -328, -328, -328, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -328, -328,
- -328, -328, -328, -328, -328, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -328, -328, -328, -328, 338, -328, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -328, -328, -328, -328, -328,
-
- 5, -329, -329, -329, -329, -329, -329, -329, -329, -329,
- -329, -329, -329, -329, -329, -329, -329, -329, -329, -329,
- -329, -329, -329, -329, -329, -329, -329, -329, -329, -329,
- -329, -329, -329, -329, -329, -329, -329, -329, -329, -329,
- -329, -329, -329, -329, -329, -329, -329, -329, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -329, -329,
- -329, -329, -329, -329, -329, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -329, -329, -329, -329, 60, -329, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -329, -329, -329, -329, -329,
-
- 5, -330, -330, -330, -330, -330, -330, -330, -330, -330,
- -330, -330, -330, -330, -330, -330, -330, -330, -330, -330,
- -330, -330, -330, -330, -330, -330, -330, -330, -330, -330,
- -330, -330, -330, -330, -330, -330, -330, -330, -330, -330,
- -330, -330, -330, -330, -330, -330, -330, -330, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -330, -330,
- -330, -330, -330, -330, -330, 60, 60, 60, 60, 339,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -330, -330, -330, -330, 60, -330, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -330, -330, -330, -330, -330,
-
- 5, -331, -331, -331, -331, -331, -331, -331, -331, -331,
- -331, -331, -331, -331, -331, -331, -331, -331, -331, -331,
- -331, -331, -331, -331, -331, -331, -331, -331, -331, -331,
- -331, -331, -331, -331, -331, -331, -331, -331, -331, -331,
- -331, -331, -331, -331, -331, -331, -331, -331, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -331, -331,
- -331, -331, -331, -331, -331, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -331, -331, -331, -331, 60, -331, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -331, -331, -331, -331, -331,
-
- 5, -332, -332, -332, -332, -332, -332, -332, -332, -332,
- -332, -332, -332, -332, -332, -332, -332, -332, -332, -332,
- -332, -332, -332, -332, -332, -332, -332, -332, -332, -332,
- -332, -332, -332, -332, -332, -332, -332, -332, -332, -332,
- -332, -332, -332, -332, -332, -332, -332, -332, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -332, -332,
- -332, -332, -332, -332, -332, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 340, 60, 60, 60, 60, 60,
- 60, -332, -332, -332, -332, 60, -332, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -332, -332, -332, -332, -332,
-
- 5, -333, -333, -333, -333, -333, -333, -333, -333, -333,
- -333, -333, -333, -333, -333, -333, -333, -333, -333, -333,
- -333, -333, -333, -333, -333, -333, -333, -333, -333, -333,
- -333, -333, -333, -333, -333, -333, -333, -333, -333, -333,
- -333, -333, -333, -333, -333, -333, -333, -333, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -333, -333,
- -333, -333, -333, -333, -333, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 341,
- 60, -333, -333, -333, -333, 60, -333, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -333, -333, -333, -333, -333,
-
- 5, -334, -334, -334, -334, -334, -334, -334, -334, -334,
- -334, -334, -334, -334, -334, -334, -334, -334, -334, -334,
- -334, -334, -334, -334, -334, -334, -334, -334, -334, -334,
- -334, -334, -334, -334, -334, -334, -334, -334, -334, -334,
- -334, -334, -334, -334, -334, -334, -334, -334, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -334, -334,
- -334, -334, -334, -334, -334, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 342, 60, 60, 60, 60, 60, 60, 60,
- 60, -334, -334, -334, -334, 60, -334, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -334, -334, -334, -334, -334,
-
- 5, -335, -335, -335, -335, -335, -335, -335, -335, -335,
- -335, -335, -335, -335, -335, -335, -335, -335, -335, -335,
- -335, -335, -335, -335, -335, -335, -335, -335, -335, -335,
- -335, -335, -335, -335, -335, -335, -335, -335, -335, -335,
- -335, -335, -335, -335, -335, -335, -335, -335, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -335, -335,
- -335, -335, -335, -335, -335, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -335, -335, -335, -335, 343, -335, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -335, -335, -335, -335, -335,
-
- 5, -336, -336, -336, -336, -336, -336, -336, -336, -336,
- -336, -336, -336, -336, -336, -336, -336, -336, -336, -336,
- -336, -336, -336, -336, -336, -336, -336, -336, -336, -336,
- -336, -336, -336, -336, -336, -336, -336, -336, -336, -336,
- -336, -336, -336, -336, -336, -336, -336, -336, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -336, -336,
- -336, -336, -336, -336, -336, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -336, -336, -336, -336, 60, -336, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -336, -336, -336, -336, -336,
-
- 5, -337, -337, -337, -337, -337, -337, -337, -337, -337,
- -337, -337, -337, -337, -337, -337, -337, -337, -337, -337,
- -337, -337, -337, -337, -337, -337, -337, -337, -337, -337,
- -337, -337, -337, -337, -337, -337, -337, -337, -337, -337,
- -337, -337, -337, -337, -337, -337, -337, -337, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -337, -337,
- -337, -337, -337, -337, -337, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 344, 60, 60, 60, 60, 60,
- 60, -337, -337, -337, -337, 60, -337, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -337, -337, -337, -337, -337,
-
- 5, -338, -338, -338, -338, -338, -338, -338, -338, -338,
- -338, -338, -338, -338, -338, -338, -338, -338, -338, -338,
- -338, -338, -338, -338, -338, -338, -338, -338, -338, -338,
- -338, -338, -338, -338, -338, -338, -338, -338, -338, -338,
- -338, -338, -338, -338, -338, -338, -338, -338, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -338, -338,
- -338, -338, -338, -338, -338, 60, 60, 60, 60, 60,
- 345, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -338, -338, -338, -338, 60, -338, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -338, -338, -338, -338, -338,
-
- 5, -339, -339, -339, -339, -339, -339, -339, -339, -339,
- -339, -339, -339, -339, -339, -339, -339, -339, -339, -339,
- -339, -339, -339, -339, -339, -339, -339, -339, -339, -339,
- -339, -339, -339, -339, -339, -339, -339, -339, -339, -339,
- -339, -339, -339, -339, -339, -339, -339, -339, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -339, -339,
- -339, -339, -339, -339, -339, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -339, -339, -339, -339, 60, -339, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -339, -339, -339, -339, -339,
-
- 5, -340, -340, -340, -340, -340, -340, -340, -340, -340,
- -340, -340, -340, -340, -340, -340, -340, -340, -340, -340,
- -340, -340, -340, -340, -340, -340, -340, -340, -340, -340,
- -340, -340, -340, -340, -340, -340, -340, -340, -340, -340,
- -340, -340, -340, -340, -340, -340, -340, -340, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -340, -340,
- -340, -340, -340, -340, -340, 60, 60, 60, 60, 60,
- 346, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -340, -340, -340, -340, 60, -340, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -340, -340, -340, -340, -340,
-
- 5, -341, -341, -341, -341, -341, -341, -341, -341, -341,
- -341, -341, -341, -341, -341, -341, -341, -341, -341, -341,
- -341, -341, -341, -341, -341, -341, -341, -341, -341, -341,
- -341, -341, -341, -341, -341, -341, -341, -341, -341, -341,
- -341, -341, -341, -341, -341, -341, -341, -341, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -341, -341,
- -341, -341, -341, -341, -341, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -341, -341, -341, -341, 60, -341, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -341, -341, -341, -341, -341,
-
- 5, -342, -342, -342, -342, -342, -342, -342, -342, -342,
- -342, -342, -342, -342, -342, -342, -342, -342, -342, -342,
- -342, -342, -342, -342, -342, -342, -342, -342, -342, -342,
- -342, -342, -342, -342, -342, -342, -342, -342, -342, -342,
- -342, -342, -342, -342, -342, -342, -342, -342, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -342, -342,
- -342, -342, -342, -342, -342, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -342, -342, -342, -342, 60, -342, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -342, -342, -342, -342, -342,
-
- 5, -343, -343, -343, -343, -343, -343, -343, -343, -343,
- -343, -343, -343, -343, -343, -343, -343, -343, -343, -343,
- -343, -343, -343, -343, -343, -343, -343, -343, -343, -343,
- -343, -343, -343, -343, -343, -343, -343, -343, -343, -343,
- -343, -343, -343, -343, -343, -343, -343, -343, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -343, -343,
- -343, -343, -343, -343, -343, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 347, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -343, -343, -343, -343, 60, -343, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -343, -343, -343, -343, -343,
-
- 5, -344, -344, -344, -344, -344, -344, -344, -344, -344,
- -344, -344, -344, -344, -344, -344, -344, -344, -344, -344,
- -344, -344, -344, -344, -344, -344, -344, -344, -344, -344,
- -344, -344, -344, -344, -344, -344, -344, -344, -344, -344,
- -344, -344, -344, -344, -344, -344, -344, -344, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -344, -344,
- -344, -344, -344, -344, -344, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -344, -344, -344, -344, 60, -344, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -344, -344, -344, -344, -344,
-
- 5, -345, -345, -345, -345, -345, -345, -345, -345, -345,
- -345, -345, -345, -345, -345, -345, -345, -345, -345, -345,
- -345, -345, -345, -345, -345, -345, -345, -345, -345, -345,
- -345, -345, -345, -345, -345, -345, -345, -345, -345, -345,
- -345, -345, -345, -345, -345, -345, -345, -345, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -345, -345,
- -345, -345, -345, -345, -345, 60, 60, 60, 60, 60,
- 60, 60, 60, 348, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -345, -345, -345, -345, 60, -345, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -345, -345, -345, -345, -345,
-
- 5, -346, -346, -346, -346, -346, -346, -346, -346, -346,
- -346, -346, -346, -346, -346, -346, -346, -346, -346, -346,
- -346, -346, -346, -346, -346, -346, -346, -346, -346, -346,
- -346, -346, -346, -346, -346, -346, -346, -346, -346, -346,
- -346, -346, -346, -346, -346, -346, -346, -346, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -346, -346,
- -346, -346, -346, -346, -346, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -346, -346, -346, -346, 60, -346, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -346, -346, -346, -346, -346,
-
- 5, -347, -347, -347, -347, -347, -347, -347, -347, -347,
- -347, -347, -347, -347, -347, -347, -347, -347, -347, -347,
- -347, -347, -347, -347, -347, -347, -347, -347, -347, -347,
- -347, -347, -347, -347, -347, -347, -347, -347, -347, -347,
- -347, -347, -347, -347, -347, -347, -347, -347, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -347, -347,
- -347, -347, -347, -347, -347, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 349, 60, 60, 60, 60,
- 60, -347, -347, -347, -347, 60, -347, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -347, -347, -347, -347, -347,
-
- 5, -348, -348, -348, -348, -348, -348, -348, -348, -348,
- -348, -348, -348, -348, -348, -348, -348, -348, -348, -348,
- -348, -348, -348, -348, -348, -348, -348, -348, -348, -348,
- -348, -348, -348, -348, -348, -348, -348, -348, -348, -348,
- -348, -348, -348, -348, -348, -348, -348, -348, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -348, -348,
- -348, -348, -348, -348, -348, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 350, 60, 60, 60, 60, 60,
- 60, -348, -348, -348, -348, 60, -348, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -348, -348, -348, -348, -348,
-
- 5, -349, -349, -349, -349, -349, -349, -349, -349, -349,
- -349, -349, -349, -349, -349, -349, -349, -349, -349, -349,
- -349, -349, -349, -349, -349, -349, -349, -349, -349, -349,
- -349, -349, -349, -349, -349, -349, -349, -349, -349, -349,
- -349, -349, -349, -349, -349, -349, -349, -349, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -349, -349,
- -349, -349, -349, -349, -349, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 351, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -349, -349, -349, -349, 60, -349, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -349, -349, -349, -349, -349,
-
- 5, -350, -350, -350, -350, -350, -350, -350, -350, -350,
- -350, -350, -350, -350, -350, -350, -350, -350, -350, -350,
- -350, -350, -350, -350, -350, -350, -350, -350, -350, -350,
- -350, -350, -350, -350, -350, -350, -350, -350, -350, -350,
- -350, -350, -350, -350, -350, -350, -350, -350, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -350, -350,
- -350, -350, -350, -350, -350, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -350, -350, -350, -350, 352, -350, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -350, -350, -350, -350, -350,
-
- 5, -351, -351, -351, -351, -351, -351, -351, -351, -351,
- -351, -351, -351, -351, -351, -351, -351, -351, -351, -351,
- -351, -351, -351, -351, -351, -351, -351, -351, -351, -351,
- -351, -351, -351, -351, -351, -351, -351, -351, -351, -351,
- -351, -351, -351, -351, -351, -351, -351, -351, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -351, -351,
- -351, -351, -351, -351, -351, 60, 353, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -351, -351, -351, -351, 60, -351, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -351, -351, -351, -351, -351,
-
- 5, -352, -352, -352, -352, -352, -352, -352, -352, -352,
- -352, -352, -352, -352, -352, -352, -352, -352, -352, -352,
- -352, -352, -352, -352, -352, -352, -352, -352, -352, -352,
- -352, -352, -352, -352, -352, -352, -352, -352, -352, -352,
- -352, -352, -352, -352, -352, -352, -352, -352, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -352, -352,
- -352, -352, -352, -352, -352, 60, 60, 60, 60, 60,
- 60, 60, 60, 354, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -352, -352, -352, -352, 60, -352, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -352, -352, -352, -352, -352,
-
- 5, -353, -353, -353, -353, -353, -353, -353, -353, -353,
- -353, -353, -353, -353, -353, -353, -353, -353, -353, -353,
- -353, -353, -353, -353, -353, -353, -353, -353, -353, -353,
- -353, -353, -353, -353, -353, -353, -353, -353, -353, -353,
- -353, -353, -353, -353, -353, -353, -353, -353, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -353, -353,
- -353, -353, -353, -353, -353, 60, 60, 60, 60, 355,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -353, -353, -353, -353, 60, -353, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -353, -353, -353, -353, -353,
-
- 5, -354, -354, -354, -354, -354, -354, -354, -354, -354,
- -354, -354, -354, -354, -354, -354, -354, -354, -354, -354,
- -354, -354, -354, -354, -354, -354, -354, -354, -354, -354,
- -354, -354, -354, -354, -354, -354, -354, -354, -354, -354,
- -354, -354, -354, -354, -354, -354, -354, -354, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -354, -354,
- -354, -354, -354, -354, -354, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 356, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -354, -354, -354, -354, 60, -354, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -354, -354, -354, -354, -354,
-
- 5, -355, -355, -355, -355, -355, -355, -355, -355, -355,
- -355, -355, -355, -355, -355, -355, -355, -355, -355, -355,
- -355, -355, -355, -355, -355, -355, -355, -355, -355, -355,
- -355, -355, -355, -355, -355, -355, -355, -355, -355, -355,
- -355, -355, -355, -355, -355, -355, -355, -355, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -355, -355,
- -355, -355, -355, -355, -355, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 357, 60, 60, 60, 60, 60, 60, 60,
- 60, -355, -355, -355, -355, 60, -355, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -355, -355, -355, -355, -355,
-
- 5, -356, -356, -356, -356, -356, -356, -356, -356, -356,
- -356, -356, -356, -356, -356, -356, -356, -356, -356, -356,
- -356, -356, -356, -356, -356, -356, -356, -356, -356, -356,
- -356, -356, -356, -356, -356, -356, -356, -356, -356, -356,
- -356, -356, -356, -356, -356, -356, -356, -356, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -356, -356,
- -356, -356, -356, -356, -356, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -356, -356, -356, -356, 358, -356, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -356, -356, -356, -356, -356,
-
- 5, -357, -357, -357, -357, -357, -357, -357, -357, -357,
- -357, -357, -357, -357, -357, -357, -357, -357, -357, -357,
- -357, -357, -357, -357, -357, -357, -357, -357, -357, -357,
- -357, -357, -357, -357, -357, -357, -357, -357, -357, -357,
- -357, -357, -357, -357, -357, -357, -357, -357, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -357, -357,
- -357, -357, -357, -357, -357, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -357, -357, -357, -357, 60, -357, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -357, -357, -357, -357, -357,
-
- 5, -358, -358, -358, -358, -358, -358, -358, -358, -358,
- -358, -358, -358, -358, -358, -358, -358, -358, -358, -358,
- -358, -358, -358, -358, -358, -358, -358, -358, -358, -358,
- -358, -358, -358, -358, -358, -358, -358, -358, -358, -358,
- -358, -358, -358, -358, -358, -358, -358, -358, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -358, -358,
- -358, -358, -358, -358, -358, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 359, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -358, -358, -358, -358, 60, -358, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -358, -358, -358, -358, -358,
-
- 5, -359, -359, -359, -359, -359, -359, -359, -359, -359,
- -359, -359, -359, -359, -359, -359, -359, -359, -359, -359,
- -359, -359, -359, -359, -359, -359, -359, -359, -359, -359,
- -359, -359, -359, -359, -359, -359, -359, -359, -359, -359,
- -359, -359, -359, -359, -359, -359, -359, -359, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -359, -359,
- -359, -359, -359, -359, -359, 60, 60, 60, 60, 360,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -359, -359, -359, -359, 60, -359, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -359, -359, -359, -359, -359,
-
- 5, -360, -360, -360, -360, -360, -360, -360, -360, -360,
- -360, -360, -360, -360, -360, -360, -360, -360, -360, -360,
- -360, -360, -360, -360, -360, -360, -360, -360, -360, -360,
- -360, -360, -360, -360, -360, -360, -360, -360, -360, -360,
- -360, -360, -360, -360, -360, -360, -360, -360, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -360, -360,
- -360, -360, -360, -360, -360, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 361, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -360, -360, -360, -360, 60, -360, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -360, -360, -360, -360, -360,
-
- 5, -361, -361, -361, -361, -361, -361, -361, -361, -361,
- -361, -361, -361, -361, -361, -361, -361, -361, -361, -361,
- -361, -361, -361, -361, -361, -361, -361, -361, -361, -361,
- -361, -361, -361, -361, -361, -361, -361, -361, -361, -361,
- -361, -361, -361, -361, -361, -361, -361, -361, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -361, -361,
- -361, -361, -361, -361, -361, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 362,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -361, -361, -361, -361, 60, -361, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -361, -361, -361, -361, -361,
-
- 5, -362, -362, -362, -362, -362, -362, -362, -362, -362,
- -362, -362, -362, -362, -362, -362, -362, -362, -362, -362,
- -362, -362, -362, -362, -362, -362, -362, -362, -362, -362,
- -362, -362, -362, -362, -362, -362, -362, -362, -362, -362,
- -362, -362, -362, -362, -362, -362, -362, -362, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -362, -362,
- -362, -362, -362, -362, -362, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 363, 60, 60, 60, 60, 60, 60, 60,
- 60, -362, -362, -362, -362, 60, -362, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -362, -362, -362, -362, -362,
-
- 5, -363, -363, -363, -363, -363, -363, -363, -363, -363,
- -363, -363, -363, -363, -363, -363, -363, -363, -363, -363,
- -363, -363, -363, -363, -363, -363, -363, -363, -363, -363,
- -363, -363, -363, -363, -363, -363, -363, -363, -363, -363,
- -363, -363, -363, -363, -363, -363, -363, -363, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -363, -363,
- -363, -363, -363, -363, -363, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 364,
- 60, -363, -363, -363, -363, 60, -363, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -363, -363, -363, -363, -363,
-
- 5, -364, -364, -364, -364, -364, -364, -364, -364, -364,
- -364, -364, -364, -364, -364, -364, -364, -364, -364, -364,
- -364, -364, -364, -364, -364, -364, -364, -364, -364, -364,
- -364, -364, -364, -364, -364, -364, -364, -364, -364, -364,
- -364, -364, -364, -364, -364, -364, -364, -364, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, -364, -364,
- -364, -364, -364, -364, -364, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, -364, -364, -364, -364, 60, -364, 60, 60, 60,
-
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, -364, -364, -364, -364, -364
-
- } ;
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_is_interactive = is_interactive; \
+ }
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_at_bol = at_bol; \
+ }
-#ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, const char *, int ));
-#endif
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
+typedef unsigned char YY_CHAR;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+typedef int yy_state_type;
+extern char *yytext;
+#define yytext_ptr yytext
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( const char msg[] ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
yytext_ptr = yy_bp; \
- yyleng = yy_cp - yy_bp; \
+ yyleng = (int) (yy_cp - yy_bp); \
yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yy_c_buf_p = yy_cp;
+#define YY_NUM_RULES 107
#define YY_END_OF_BUFFER 108
-static const short int yy_accept[365] =
+static yyconst short int yy_accept[366] =
{ 0,
0, 0, 100, 100, 108, 106, 105, 105, 95, 106,
84, 90, 93, 91, 88, 92, 106, 94, 1, 106,
@@ -5785,72 +326,294 @@ static const short int yy_accept[365] =
76, 78, 78, 78, 78, 51, 78, 78, 9, 78,
62, 61, 78, 33, 78, 74, 78, 78, 78, 78,
78, 78, 78, 78, 78, 78, 63, 78, 78, 78,
- 78, 78, 78, 52
+ 78, 78, 78, 52, 0
} ;
-static yy_state_type yy_last_accepting_state;
-static char *yy_last_accepting_cpos;
+static yyconst int yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 1, 1, 1, 1, 4, 1, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 15, 16, 17,
+ 18, 19, 20, 1, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40, 41, 42, 43, 44, 45, 30,
+ 1, 1, 1, 1, 46, 1, 30, 30, 30, 30,
+
+ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 47, 1, 48, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+static yyconst int yy_meta[49] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 2, 1, 1,
+ 1, 1, 1, 3, 1, 1, 1, 1, 1, 1,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 1, 1
+ } ;
+
+static yyconst short int yy_base[371] =
+ { 0,
+ 0, 0, 46, 47, 393, 394, 49, 54, 394, 387,
+ 394, 394, 394, 394, 394, 394, 379, 382, 46, 371,
+ 394, 43, 394, 370, 394, 25, 38, 37, 41, 39,
+ 49, 0, 51, 54, 45, 62, 349, 57, 68, 73,
+ 61, 365, 71, 394, 394, 382, 394, 99, 108, 379,
+ 394, 394, 394, 369, 102, 394, 394, 394, 394, 0,
+ 358, 81, 354, 346, 0, 358, 80, 84, 353, 339,
+ 96, 337, 350, 335, 349, 332, 336, 332, 334, 0,
+ 98, 0, 334, 332, 326, 333, 0, 0, 339, 339,
+ 322, 94, 103, 337, 98, 94, 328, 109, 320, 336,
+
+ 332, 310, 326, 330, 321, 107, 314, 348, 394, 137,
+ 394, 141, 394, 336, 0, 0, 324, 319, 326, 308,
+ 306, 305, 310, 123, 308, 320, 109, 308, 314, 315,
+ 297, 297, 126, 0, 312, 313, 0, 300, 307, 28,
+ 128, 304, 294, 303, 296, 293, 301, 0, 291, 301,
+ 299, 290, 280, 274, 287, 272, 292, 0, 0, 277,
+ 0, 291, 282, 279, 134, 275, 290, 269, 271, 276,
+ 276, 268, 271, 266, 0, 278, 262, 272, 279, 270,
+ 258, 257, 271, 260, 273, 253, 0, 263, 245, 0,
+ 264, 261, 248, 0, 243, 248, 247, 257, 0, 243,
+
+ 0, 247, 0, 0, 243, 240, 254, 0, 239, 239,
+ 237, 253, 238, 250, 232, 250, 245, 0, 240, 240,
+ 226, 225, 225, 239, 238, 237, 0, 221, 0, 215,
+ 0, 234, 218, 217, 217, 0, 230, 220, 215, 214,
+ 226, 216, 215, 0, 0, 0, 0, 208, 0, 222,
+ 218, 204, 0, 218, 219, 202, 207, 200, 218, 200,
+ 197, 198, 195, 0, 200, 212, 199, 206, 205, 190,
+ 0, 0, 0, 182, 189, 0, 0, 186, 0, 185,
+ 0, 199, 0, 200, 187, 0, 183, 0, 186, 0,
+ 178, 180, 0, 179, 193, 186, 0, 0, 189, 192,
+
+ 174, 189, 0, 0, 0, 170, 184, 183, 0, 0,
+ 167, 166, 0, 181, 166, 0, 0, 172, 168, 0,
+ 163, 0, 175, 164, 174, 163, 0, 150, 0, 170,
+ 0, 154, 148, 154, 145, 0, 150, 163, 0, 162,
+ 0, 0, 153, 0, 157, 0, 144, 144, 150, 136,
+ 159, 147, 142, 132, 127, 118, 0, 128, 135, 126,
+ 123, 114, 88, 0, 394, 168, 171, 124, 174, 177
+ } ;
+
+static yyconst short int yy_def[371] =
+ { 0,
+ 365, 1, 366, 366, 365, 365, 365, 365, 365, 367,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 365, 365, 369, 365, 370, 365, 367,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+
+ 368, 368, 368, 368, 368, 368, 368, 369, 365, 370,
+ 365, 370, 365, 365, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
+ 368, 368, 368, 368, 0, 365, 365, 365, 365, 365
+ } ;
-static const yy_state_type yy_NUL_trans[365] =
+static yyconst short int yy_nxt[443] =
{ 0,
- 6, 6, 46, 46, 0, 0, 0, 0, 0, 50,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 108, 0, 110, 0, 50,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 108, 0, 110,
- 0, 110, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0
+ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, 32, 33, 32,
+ 32, 34, 32, 35, 36, 37, 32, 38, 39, 40,
+ 41, 42, 43, 32, 32, 32, 44, 45, 47, 47,
+ 49, 49, 196, 48, 48, 49, 49, 54, 61, 55,
+ 57, 58, 63, 62, 66, 71, 64, 197, 67, 72,
+ 74, 68, 75, 76, 69, 73, 80, 70, 83, 85,
+ 77, 93, 65, 78, 81, 86, 79, 87, 84, 82,
+ 94, 95, 96, 100, 103, 88, 104, 89, 106, 90,
+
+ 101, 111, 91, 116, 97, 107, 112, 102, 98, 49,
+ 49, 113, 99, 54, 121, 55, 123, 124, 128, 117,
+ 122, 139, 149, 151, 125, 157, 60, 129, 150, 155,
+ 160, 169, 364, 158, 130, 170, 140, 141, 152, 111,
+ 156, 161, 153, 111, 365, 179, 183, 184, 112, 365,
+ 190, 363, 198, 113, 191, 219, 220, 362, 361, 360,
+ 359, 180, 199, 358, 357, 356, 355, 221, 46, 46,
+ 46, 50, 50, 50, 108, 354, 108, 110, 110, 110,
+ 353, 352, 351, 350, 349, 348, 347, 346, 345, 344,
+ 343, 342, 341, 340, 339, 338, 337, 336, 335, 334,
+
+ 333, 332, 331, 330, 329, 328, 327, 326, 325, 324,
+ 323, 322, 321, 320, 319, 318, 317, 316, 315, 314,
+ 313, 312, 311, 310, 309, 308, 307, 306, 305, 304,
+ 303, 302, 301, 300, 299, 298, 297, 296, 295, 294,
+ 293, 292, 291, 290, 289, 288, 287, 286, 285, 284,
+ 283, 282, 281, 280, 279, 278, 277, 276, 275, 274,
+ 273, 272, 271, 270, 269, 268, 267, 266, 265, 264,
+ 263, 262, 261, 260, 259, 258, 257, 256, 255, 254,
+ 253, 252, 251, 250, 249, 248, 247, 246, 245, 244,
+ 243, 242, 241, 240, 239, 238, 237, 236, 235, 234,
+
+ 233, 232, 231, 230, 229, 228, 227, 226, 225, 224,
+ 223, 222, 218, 217, 216, 215, 214, 213, 212, 211,
+ 210, 209, 208, 207, 206, 205, 204, 203, 202, 201,
+ 200, 195, 194, 193, 192, 189, 188, 187, 186, 185,
+ 182, 181, 178, 177, 176, 175, 174, 173, 172, 114,
+ 109, 171, 168, 167, 166, 165, 164, 163, 162, 159,
+ 154, 148, 147, 146, 145, 144, 143, 142, 138, 137,
+ 136, 135, 134, 133, 132, 131, 127, 126, 120, 119,
+ 118, 115, 114, 51, 109, 105, 92, 59, 56, 53,
+ 52, 51, 365, 5, 365, 365, 365, 365, 365, 365,
+
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365
} ;
+static yyconst short int yy_chk[443] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 3, 4,
+ 7, 7, 140, 3, 4, 8, 8, 19, 26, 19,
+ 22, 22, 27, 26, 28, 29, 27, 140, 28, 29,
+ 30, 28, 30, 31, 28, 29, 33, 28, 34, 35,
+ 31, 38, 27, 31, 33, 35, 31, 36, 34, 33,
+ 38, 38, 39, 40, 41, 36, 41, 36, 43, 36,
+
+ 40, 48, 36, 62, 39, 43, 48, 40, 39, 49,
+ 49, 48, 39, 55, 67, 55, 68, 68, 71, 62,
+ 67, 81, 92, 93, 68, 96, 368, 71, 92, 95,
+ 98, 106, 363, 96, 71, 106, 81, 81, 93, 110,
+ 95, 98, 93, 112, 110, 124, 127, 127, 112, 110,
+ 133, 362, 141, 112, 133, 165, 165, 361, 360, 359,
+ 358, 124, 141, 356, 355, 354, 353, 165, 366, 366,
+ 366, 367, 367, 367, 369, 352, 369, 370, 370, 370,
+ 351, 350, 349, 348, 347, 345, 343, 340, 338, 337,
+ 335, 334, 333, 332, 330, 328, 326, 325, 324, 323,
+
+ 321, 319, 318, 315, 314, 312, 311, 308, 307, 306,
+ 302, 301, 300, 299, 296, 295, 294, 292, 291, 289,
+ 287, 285, 284, 282, 280, 278, 275, 274, 270, 269,
+ 268, 267, 266, 265, 263, 262, 261, 260, 259, 258,
+ 257, 256, 255, 254, 252, 251, 250, 248, 243, 242,
+ 241, 240, 239, 238, 237, 235, 234, 233, 232, 230,
+ 228, 226, 225, 224, 223, 222, 221, 220, 219, 217,
+ 216, 215, 214, 213, 212, 211, 210, 209, 207, 206,
+ 205, 202, 200, 198, 197, 196, 195, 193, 192, 191,
+ 189, 188, 186, 185, 184, 183, 182, 181, 180, 179,
+
+ 178, 177, 176, 174, 173, 172, 171, 170, 169, 168,
+ 167, 166, 164, 163, 162, 160, 157, 156, 155, 154,
+ 153, 152, 151, 150, 149, 147, 146, 145, 144, 143,
+ 142, 139, 138, 136, 135, 132, 131, 130, 129, 128,
+ 126, 125, 123, 122, 121, 120, 119, 118, 117, 114,
+ 108, 107, 105, 104, 103, 102, 101, 100, 99, 97,
+ 94, 91, 90, 89, 86, 85, 84, 83, 79, 78,
+ 77, 76, 75, 74, 73, 72, 70, 69, 66, 64,
+ 63, 61, 54, 50, 46, 42, 37, 24, 20, 18,
+ 17, 10, 5, 365, 365, 365, 365, 365, 365, 365,
+
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,
+ 365, 365
+ } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
*/
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
+#line 1 "pars0lex.l"
+#define INITIAL 0
/******************************************************
SQL parser lexical analyzer: input file for the GNU Flex lexer generator
(c) 1997 Innobase Oy
Created 12/14/1997 Heikki Tuuri
+Published under the GPL version 2
+
+The InnoDB parser is frozen because MySQL takes care of SQL parsing.
+Therefore we normally keep the InnoDB parser C files as they are, and do
+not automatically generate them from pars0grm.y and pars0lex.l.
+
+How to make the InnoDB parser and lexer C files:
+
+1. First do
+ bison -d pars0grm.y
+ That generates pars0grm.tab.c and pars0grm.tab.h.
+
+2. Rename pars0grm.tab.c to pars0grm.c and pars0grm.tab.h to pars0grm.h.
+
+3. Copy pars0grm.h also to /innobase/include
+
+4. Do
+ flex pars0lex.l
+ That generates lex.yy.c.
+
+5. Rename lex.yy.c to lexyy.c.
+
+6. Remove the #include of unistd.h from about line 2500 of lexyy.c
+
+These instructions seem to work at least with bison-1.28 and flex-2.5.4 on
+Linux.
*******************************************************/
+#line 36 "pars0lex.l"
#define YYSTYPE que_node_t*
+#include "univ.i"
#include "pars0pars.h"
#include "pars0grm.h"
#include "pars0sym.h"
@@ -5860,16 +623,66 @@ Created 12/14/1997 Heikki Tuuri
#define isatty(A) 0
#define malloc(A) mem_alloc(A)
#define free(A) mem_free(A)
-#define realloc(P, A) mem_realloc(P, A)
+#define realloc(P, A) mem_realloc(P, A, __FILE__, __LINE__)
#define exit(A) ut_a(0)
-#define YY_INPUT(buf, result, max_size) pars_get_lex_chars(buf, &result,\
- max_size)
+#define YY_INPUT(buf, result, max_size) pars_get_lex_chars(buf, &result, max_size)
+#define comment 1
+
+#line 632 "lex.yy.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
#ifdef YY_MALLOC_DECL
YY_MALLOC_DECL
#else
@@ -5904,7 +717,20 @@ YY_MALLOC_DECL
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
- if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
+ if ( yy_current_buffer->yy_is_interactive ) \
+ { \
+ int c = '*', n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
+ && ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" );
#endif
@@ -5945,17 +771,24 @@ YY_MALLOC_DECL
#define YY_BREAK break;
#endif
+#define YY_RULE_SETUP \
+ YY_USER_ACTION
+
YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
+#line 57 "pars0lex.l"
+#line 786 "lex.yy.c"
if ( yy_init )
{
+ yy_init = 0;
+
#ifdef YY_USER_INIT
YY_USER_INIT;
#endif
@@ -5969,15 +802,11 @@ YY_DECL
if ( ! yyout )
yyout = stdout;
- if ( yy_current_buffer )
- yy_init_buffer( yy_current_buffer, yyin );
- else
+ if ( ! yy_current_buffer )
yy_current_buffer =
yy_create_buffer( yyin, YY_BUF_SIZE );
yy_load_buffer_state();
-
- yy_init = 0;
}
while ( 1 ) /* loops until end-of-file is reached */
@@ -5994,21 +823,33 @@ YY_DECL
yy_current_state = yy_start;
yy_match:
- while ( (yy_current_state = yy_nxt[yy_current_state][YY_SC_TO_UI(*yy_cp)]) > 0 )
+ do
{
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
-
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 366 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
-
- yy_current_state = -yy_current_state;
+ while ( yy_base[yy_current_state] != 394 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
+ yy_act = yy_accept[yy_current_state];
+ }
YY_DO_BEFORE_ACTION;
@@ -6021,12 +862,13 @@ do_action: /* This label is used only to access EOF actions. */
case 0: /* must back up */
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = yy_hold_char;
- yy_cp = yy_last_accepting_cpos + 1;
+ yy_cp = yy_last_accepting_cpos;
yy_current_state = yy_last_accepting_state;
goto yy_find_action;
case 1:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 59 "pars0lex.l"
{
yylval = sym_tab_add_int_lit(pars_sym_tab_global,
atoi(yytext));
@@ -6034,7 +876,8 @@ YY_USER_ACTION
}
YY_BREAK
case 2:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 65 "pars0lex.l"
{
ut_error; /* not implemented */
@@ -6042,7 +885,8 @@ YY_USER_ACTION
}
YY_BREAK
case 3:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 71 "pars0lex.l"
{
/* Remove the single quotes around the string */
@@ -6053,7 +897,8 @@ YY_USER_ACTION
}
YY_BREAK
case 4:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 80 "pars0lex.l"
{
yylval = sym_tab_add_null_lit(pars_sym_tab_global);
@@ -6061,7 +906,8 @@ YY_USER_ACTION
}
YY_BREAK
case 5:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 86 "pars0lex.l"
{
/* Implicit cursor name */
yylval = sym_tab_add_str_lit(pars_sym_tab_global,
@@ -6070,439 +916,512 @@ YY_USER_ACTION
}
YY_BREAK
case 6:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 93 "pars0lex.l"
{
return(PARS_AND_TOKEN);
}
YY_BREAK
case 7:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 97 "pars0lex.l"
{
return(PARS_OR_TOKEN);
}
YY_BREAK
case 8:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 101 "pars0lex.l"
{
return(PARS_NOT_TOKEN);
}
YY_BREAK
case 9:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 105 "pars0lex.l"
{
return(PARS_PROCEDURE_TOKEN);
}
YY_BREAK
case 10:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 109 "pars0lex.l"
{
return(PARS_IN_TOKEN);
}
YY_BREAK
case 11:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 113 "pars0lex.l"
{
return(PARS_OUT_TOKEN);
}
YY_BREAK
case 12:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 117 "pars0lex.l"
{
return(PARS_INT_TOKEN);
}
YY_BREAK
case 13:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 121 "pars0lex.l"
{
return(PARS_INT_TOKEN);
}
YY_BREAK
case 14:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 125 "pars0lex.l"
{
return(PARS_FLOAT_TOKEN);
}
YY_BREAK
case 15:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 129 "pars0lex.l"
{
return(PARS_CHAR_TOKEN);
}
YY_BREAK
case 16:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 133 "pars0lex.l"
{
return(PARS_IS_TOKEN);
}
YY_BREAK
case 17:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 137 "pars0lex.l"
{
return(PARS_BEGIN_TOKEN);
}
YY_BREAK
case 18:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 141 "pars0lex.l"
{
return(PARS_END_TOKEN);
}
YY_BREAK
case 19:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 145 "pars0lex.l"
{
return(PARS_IF_TOKEN);
}
YY_BREAK
case 20:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 149 "pars0lex.l"
{
return(PARS_THEN_TOKEN);
}
YY_BREAK
case 21:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 153 "pars0lex.l"
{
return(PARS_ELSE_TOKEN);
}
YY_BREAK
case 22:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 157 "pars0lex.l"
{
return(PARS_ELSIF_TOKEN);
}
YY_BREAK
case 23:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 161 "pars0lex.l"
{
return(PARS_LOOP_TOKEN);
}
YY_BREAK
case 24:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 165 "pars0lex.l"
{
return(PARS_WHILE_TOKEN);
}
YY_BREAK
case 25:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 169 "pars0lex.l"
{
return(PARS_RETURN_TOKEN);
}
YY_BREAK
case 26:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 173 "pars0lex.l"
{
return(PARS_SELECT_TOKEN);
}
YY_BREAK
case 27:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 177 "pars0lex.l"
{
return(PARS_SUM_TOKEN);
}
YY_BREAK
case 28:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 181 "pars0lex.l"
{
return(PARS_COUNT_TOKEN);
}
YY_BREAK
case 29:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 185 "pars0lex.l"
{
return(PARS_DISTINCT_TOKEN);
}
YY_BREAK
case 30:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 189 "pars0lex.l"
{
return(PARS_FROM_TOKEN);
}
YY_BREAK
case 31:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 193 "pars0lex.l"
{
return(PARS_WHERE_TOKEN);
}
YY_BREAK
case 32:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 197 "pars0lex.l"
{
return(PARS_FOR_TOKEN);
}
YY_BREAK
case 33:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 201 "pars0lex.l"
{
return(PARS_CONSISTENT_TOKEN);
}
YY_BREAK
case 34:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 205 "pars0lex.l"
{
return(PARS_READ_TOKEN);
}
YY_BREAK
case 35:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 209 "pars0lex.l"
{
return(PARS_ORDER_TOKEN);
}
YY_BREAK
case 36:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 213 "pars0lex.l"
{
return(PARS_BY_TOKEN);
}
YY_BREAK
case 37:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 217 "pars0lex.l"
{
return(PARS_ASC_TOKEN);
}
YY_BREAK
case 38:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 221 "pars0lex.l"
{
return(PARS_DESC_TOKEN);
}
YY_BREAK
case 39:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 225 "pars0lex.l"
{
return(PARS_INSERT_TOKEN);
}
YY_BREAK
case 40:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 229 "pars0lex.l"
{
return(PARS_INTO_TOKEN);
}
YY_BREAK
case 41:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 233 "pars0lex.l"
{
return(PARS_VALUES_TOKEN);
}
YY_BREAK
case 42:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 237 "pars0lex.l"
{
return(PARS_UPDATE_TOKEN);
}
YY_BREAK
case 43:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 241 "pars0lex.l"
{
return(PARS_SET_TOKEN);
}
YY_BREAK
case 44:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 245 "pars0lex.l"
{
return(PARS_DELETE_TOKEN);
}
YY_BREAK
case 45:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 249 "pars0lex.l"
{
return(PARS_CURRENT_TOKEN);
}
YY_BREAK
case 46:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 253 "pars0lex.l"
{
return(PARS_OF_TOKEN);
}
YY_BREAK
case 47:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 257 "pars0lex.l"
{
return(PARS_CREATE_TOKEN);
}
YY_BREAK
case 48:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 261 "pars0lex.l"
{
return(PARS_TABLE_TOKEN);
}
YY_BREAK
case 49:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 265 "pars0lex.l"
{
return(PARS_INDEX_TOKEN);
}
YY_BREAK
case 50:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 269 "pars0lex.l"
{
return(PARS_UNIQUE_TOKEN);
}
YY_BREAK
case 51:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 273 "pars0lex.l"
{
return(PARS_CLUSTERED_TOKEN);
}
YY_BREAK
case 52:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 277 "pars0lex.l"
{
return(PARS_DOES_NOT_FIT_IN_MEM_TOKEN);
}
YY_BREAK
case 53:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 281 "pars0lex.l"
{
return(PARS_ON_TOKEN);
}
YY_BREAK
case 54:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 285 "pars0lex.l"
{
return(PARS_DECLARE_TOKEN);
}
YY_BREAK
case 55:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 289 "pars0lex.l"
{
return(PARS_CURSOR_TOKEN);
}
YY_BREAK
case 56:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 293 "pars0lex.l"
{
return(PARS_OPEN_TOKEN);
}
YY_BREAK
case 57:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 297 "pars0lex.l"
{
return(PARS_FETCH_TOKEN);
}
YY_BREAK
case 58:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 301 "pars0lex.l"
{
return(PARS_CLOSE_TOKEN);
}
YY_BREAK
case 59:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 305 "pars0lex.l"
{
return(PARS_NOTFOUND_TOKEN);
}
YY_BREAK
case 60:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 309 "pars0lex.l"
{
return(PARS_TO_CHAR_TOKEN);
}
YY_BREAK
case 61:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 313 "pars0lex.l"
{
return(PARS_TO_NUMBER_TOKEN);
}
YY_BREAK
case 62:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 317 "pars0lex.l"
{
return(PARS_TO_BINARY_TOKEN);
}
YY_BREAK
case 63:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 321 "pars0lex.l"
{
return(PARS_BINARY_TO_NUMBER_TOKEN);
}
YY_BREAK
case 64:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 325 "pars0lex.l"
{
return(PARS_SUBSTR_TOKEN);
}
YY_BREAK
case 65:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 329 "pars0lex.l"
{
return(PARS_REPLSTR_TOKEN);
}
YY_BREAK
case 66:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 333 "pars0lex.l"
{
return(PARS_CONCAT_TOKEN);
}
YY_BREAK
case 67:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 337 "pars0lex.l"
{
return(PARS_INSTR_TOKEN);
}
YY_BREAK
case 68:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 341 "pars0lex.l"
{
return(PARS_LENGTH_TOKEN);
}
YY_BREAK
case 69:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 345 "pars0lex.l"
{
return(PARS_SYSDATE_TOKEN);
}
YY_BREAK
case 70:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 349 "pars0lex.l"
{
return(PARS_PRINTF_TOKEN);
}
YY_BREAK
case 71:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 353 "pars0lex.l"
{
return(PARS_ASSERT_TOKEN);
}
YY_BREAK
case 72:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 357 "pars0lex.l"
{
return(PARS_RND_TOKEN);
}
YY_BREAK
case 73:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 361 "pars0lex.l"
{
return(PARS_RND_STR_TOKEN);
}
YY_BREAK
case 74:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 365 "pars0lex.l"
{
return(PARS_ROW_PRINTF_TOKEN);
}
YY_BREAK
case 75:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 369 "pars0lex.l"
{
return(PARS_COMMIT_TOKEN);
}
YY_BREAK
case 76:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 373 "pars0lex.l"
{
return(PARS_ROLLBACK_TOKEN);
}
YY_BREAK
case 77:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 377 "pars0lex.l"
{
return(PARS_WORK_TOKEN);
}
YY_BREAK
case 78:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 381 "pars0lex.l"
{
yylval = sym_tab_add_id(pars_sym_tab_global,
(byte*)yytext,
@@ -6511,170 +1430,198 @@ YY_USER_ACTION
}
YY_BREAK
case 79:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 388 "pars0lex.l"
{
return(PARS_DDOT_TOKEN);
}
YY_BREAK
case 80:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 392 "pars0lex.l"
{
return(PARS_ASSIGN_TOKEN);
}
YY_BREAK
case 81:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 396 "pars0lex.l"
{
return(PARS_LE_TOKEN);
}
YY_BREAK
case 82:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 400 "pars0lex.l"
{
return(PARS_GE_TOKEN);
}
YY_BREAK
case 83:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 404 "pars0lex.l"
{
return(PARS_NE_TOKEN);
}
YY_BREAK
case 84:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 408 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 85:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 413 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 86:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 418 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 87:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 423 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 88:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 428 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 89:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 433 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 90:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 438 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 91:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 443 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 92:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 448 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 93:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 453 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 94:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 458 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 95:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 463 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 96:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 468 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 97:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 473 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 98:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 478 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 99:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 483 "pars0lex.l"
BEGIN(comment); /* eat up comment */
YY_BREAK
case 100:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 485 "pars0lex.l"
YY_BREAK
case 101:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 486 "pars0lex.l"
YY_BREAK
case 102:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 487 "pars0lex.l"
YY_BREAK
case 103:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 488 "pars0lex.l"
YY_BREAK
case 104:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 489 "pars0lex.l"
BEGIN(INITIAL);
YY_BREAK
case 105:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 491 "pars0lex.l"
/* eat up whitespace */
YY_BREAK
case 106:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 494 "pars0lex.l"
{
printf("Unrecognized character: %s\n", yytext);
@@ -6684,9 +1631,11 @@ YY_USER_ACTION
}
YY_BREAK
case 107:
-YY_USER_ACTION
+YY_RULE_SETUP
+#line 502 "pars0lex.l"
ECHO;
YY_BREAK
+#line 1638 "lex.yy.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(comment):
yyterminate();
@@ -6694,10 +1643,11 @@ case YY_STATE_EOF(comment):
case YY_END_OF_BUFFER:
{
/* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = yy_cp - yytext_ptr - 1;
+ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
/* Undo the effects of YY_DO_BEFORE_ACTION. */
*yy_cp = yy_hold_char;
+ YY_RESTORE_YY_MORE_OFFSET
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
{
@@ -6753,7 +1703,7 @@ case YY_STATE_EOF(comment):
else
{
- yy_cp = yy_c_buf_p;
+ yy_cp = yy_c_buf_p;
goto yy_find_action;
}
}
@@ -6831,7 +1781,7 @@ case YY_STATE_EOF(comment):
static int yy_get_next_buffer()
{
register char *dest = yy_current_buffer->yy_ch_buf;
- register char *source = yytext_ptr - 1; /* copy prev. char, too */
+ register char *source = yytext_ptr;
register int number_to_move, i;
int ret_val;
@@ -6843,7 +1793,7 @@ static int yy_get_next_buffer()
{ /* Don't try to fill the buffer, so this is an EOF. */
if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
{
- /* We matched a singled characater, the EOB, so
+ /* We matched a single character, the EOB, so
* treat this as a final EOF.
*/
return EOB_ACT_END_OF_FILE;
@@ -6861,7 +1811,7 @@ static int yy_get_next_buffer()
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = yy_c_buf_p - yytext_ptr;
+ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
@@ -6870,7 +1820,7 @@ static int yy_get_next_buffer()
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
- yy_n_chars = 0;
+ yy_current_buffer->yy_n_chars = yy_n_chars = 0;
else
{
@@ -6887,12 +1837,26 @@ static int yy_get_next_buffer()
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = yy_current_buffer;
- int yy_c_buf_p_offset = yy_c_buf_p - b->yy_ch_buf;
+ int yy_c_buf_p_offset =
+ (int) (yy_c_buf_p - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
- b->yy_buf_size *= 2;
- b->yy_ch_buf = (char *)
- yy_flex_realloc( (void *) b->yy_ch_buf,
- b->yy_buf_size );
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yy_flex_realloc( (void *) b->yy_ch_buf,
+ b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
@@ -6911,11 +1875,13 @@ static int yy_get_next_buffer()
/* Read in more data. */
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
yy_n_chars, num_to_read );
+
+ yy_current_buffer->yy_n_chars = yy_n_chars;
}
if ( yy_n_chars == 0 )
{
- if ( number_to_move - YY_MORE_ADJ == 1 )
+ if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
yyrestart( yyin );
@@ -6936,13 +1902,7 @@ static int yy_get_next_buffer()
yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
- /* yytext begins at the second character in yy_ch_buf; the first
- * character is the one which preceded it before reading in the latest
- * buffer; it needs to be kept around in case it's a newline, so
- * yy_get_previous_state() will have with '^' rules active.
- */
-
- yytext_ptr = &yy_current_buffer->yy_ch_buf[1];
+ yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
return ret_val;
}
@@ -6959,17 +1919,19 @@ static yy_state_type yy_get_previous_state()
for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
{
- if ( *yy_cp )
- {
- yy_current_state = yy_nxt[yy_current_state][YY_SC_TO_UI(*yy_cp)];
- }
- else
- yy_current_state = yy_NUL_trans[yy_current_state];
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] )
{
yy_last_accepting_state = yy_current_state;
yy_last_accepting_cpos = yy_cp;
}
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 366 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
}
return yy_current_state;
@@ -6992,22 +1954,26 @@ yy_state_type yy_current_state;
register int yy_is_jam;
register char *yy_cp = yy_c_buf_p;
- yy_current_state = yy_NUL_trans[yy_current_state];
- yy_is_jam = (yy_current_state == 0);
-
- if ( ! yy_is_jam )
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
{
- if ( yy_accept[yy_current_state] )
- {
- yy_last_accepting_state = yy_current_state;
- yy_last_accepting_cpos = yy_cp;
- }
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 366 )
+ yy_c = yy_meta[(unsigned int) yy_c];
}
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 365);
return yy_is_jam ? 0 : yy_current_state;
}
+#ifndef YY_NO_UNPUT
#ifdef YY_USE_PROTOS
static void yyunput( int c, register char *yy_bp )
#else
@@ -7033,25 +1999,23 @@ register char *yy_bp;
while ( source > yy_current_buffer->yy_ch_buf )
*--dest = *--source;
- yy_cp += dest - source;
- yy_bp += dest - source;
- yy_n_chars = yy_current_buffer->yy_buf_size;
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ yy_current_buffer->yy_n_chars =
+ yy_n_chars = yy_current_buffer->yy_buf_size;
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}
- if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
- yy_cp[-2] = '\n';
-
*--yy_cp = (char) c;
- /* Note: the formal parameter *must* be called "yy_bp" for this
- * macro to now work correctly.
- */
- YY_DO_BEFORE_ACTION; /* set up yytext again */
+ yytext_ptr = yy_bp;
+ yy_hold_char = *yy_cp;
+ yy_c_buf_p = yy_cp;
}
+#endif /* ifndef YY_NO_UNPUT */
#ifdef __cplusplus
@@ -7076,21 +2040,34 @@ static int input()
else
{ /* need more input */
- yytext_ptr = yy_c_buf_p;
+ int offset = yy_c_buf_p - yytext_ptr;
++yy_c_buf_p;
switch ( yy_get_next_buffer() )
{
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ yyrestart( yyin );
+
+ /* fall through */
+
case EOB_ACT_END_OF_FILE:
{
if ( yywrap() )
- {
- yy_c_buf_p =
- yytext_ptr + YY_MORE_ADJ;
return EOF;
- }
- YY_NEW_FILE;
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
#ifdef __cplusplus
return yyinput();
#else
@@ -7099,17 +2076,8 @@ static int input()
}
case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+ yy_c_buf_p = yytext_ptr + offset;
break;
-
- case EOB_ACT_LAST_MATCH:
-#ifdef __cplusplus
- YY_FATAL_ERROR(
- "unexpected last match in yyinput()" );
-#else
- YY_FATAL_ERROR(
- "unexpected last match in input()" );
-#endif
}
}
}
@@ -7118,6 +2086,7 @@ static int input()
*yy_c_buf_p = '\0'; /* preserve yytext */
yy_hold_char = *++yy_c_buf_p;
+
return c;
}
@@ -7191,7 +2160,6 @@ int size;
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
-
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
@@ -7201,10 +2169,11 @@ int size;
* we need to put in 2 end-of-buffer characters.
*/
b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
-
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+ b->yy_is_our_buffer = 1;
+
yy_init_buffer( b, file );
return b;
@@ -7218,14 +2187,25 @@ void yy_delete_buffer( b )
YY_BUFFER_STATE b;
#endif
{
+ if ( ! b )
+ return;
+
if ( b == yy_current_buffer )
yy_current_buffer = (YY_BUFFER_STATE) 0;
- yy_flex_free( (void *) b->yy_ch_buf );
+ if ( b->yy_is_our_buffer )
+ yy_flex_free( (void *) b->yy_ch_buf );
+
yy_flex_free( (void *) b );
}
+#ifndef YY_ALWAYS_INTERACTIVE
+#ifndef YY_NEVER_INTERACTIVE
+
+#endif
+#endif
+
#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
#else
@@ -7233,33 +2213,151 @@ void yy_init_buffer( b, file )
YY_BUFFER_STATE b;
FILE *file;
#endif
+
+
{
+ yy_flush_buffer( b );
+
b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
- /* We put in the '\n' and start reading from [1] so that an
- * initial match-at-newline will be true.
- */
+#if YY_ALWAYS_INTERACTIVE
+ b->yy_is_interactive = 1;
+#else
+#if YY_NEVER_INTERACTIVE
+ b->yy_is_interactive = 0;
+#else
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif
+#endif
+ }
- b->yy_ch_buf[0] = '\n';
- b->yy_n_chars = 1;
+
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+ {
+ if ( ! b )
+ return;
+
+ b->yy_n_chars = 0;
/* We always need two end-of-buffer characters. The first causes
* a transition to the end-of-buffer state. The second causes
* a jam in that state.
*/
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
- b->yy_buf_pos = &b->yy_ch_buf[1];
+ b->yy_buf_pos = &b->yy_ch_buf[0];
- b->yy_is_interactive = file ? isatty( fileno(file) ) : 0;
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
- b->yy_fill_buffer = 1;
+ if ( b == yy_current_buffer )
+ yy_load_buffer_state();
+ }
+
+#ifndef YY_NO_SCAN_BUFFER
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+char *base;
+yy_size_t size;
+#endif
+ {
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
+
+ yy_switch_to_buffer( b );
+
+ return b;
+ }
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+#else
+YY_BUFFER_STATE yy_scan_string( yy_str )
+yyconst char *yy_str;
+#endif
+ {
+ int len;
+ for ( len = 0; yy_str[len]; ++len )
+ ;
+
+ return yy_scan_bytes( yy_str, len );
}
+#endif
+#ifndef YY_NO_SCAN_BYTES
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+#else
+YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+yyconst char *bytes;
+int len;
+#endif
+ {
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = len + 2;
+ buf = (char *) yy_flex_alloc( n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+ for ( i = 0; i < len; ++i )
+ buf[i] = bytes[i];
+
+ buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = yy_scan_buffer( buf, n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+ }
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
#ifdef YY_USE_PROTOS
static void yy_push_state( int new_state )
#else
@@ -7269,7 +2367,7 @@ int new_state;
{
if ( yy_start_stack_ptr >= yy_start_stack_depth )
{
- int new_size;
+ yy_size_t new_size;
yy_start_stack_depth += YY_START_STACK_INCR;
new_size = yy_start_stack_depth * sizeof( int );
@@ -7290,8 +2388,10 @@ int new_state;
BEGIN(new_state);
}
+#endif
+#ifndef YY_NO_POP_STATE
static void yy_pop_state()
{
if ( --yy_start_stack_ptr < 0 )
@@ -7299,23 +2399,29 @@ static void yy_pop_state()
BEGIN(yy_start_stack[yy_start_stack_ptr]);
}
+#endif
+#ifndef YY_NO_TOP_STATE
static int yy_top_state()
{
return yy_start_stack[yy_start_stack_ptr - 1];
}
+#endif
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
#ifdef YY_USE_PROTOS
-static void yy_fatal_error( const char msg[] )
+static void yy_fatal_error( yyconst char msg[] )
#else
static void yy_fatal_error( msg )
char msg[];
#endif
{
(void) fprintf( stderr, "%s\n", msg );
- exit( 1 );
+ exit( YY_EXIT_FAILURE );
}
@@ -7328,7 +2434,7 @@ char msg[];
{ \
/* Undo effects of setting up yytext. */ \
yytext[yyleng] = yy_hold_char; \
- yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
+ yy_c_buf_p = yytext + n; \
yy_hold_char = *yy_c_buf_p; \
*yy_c_buf_p = '\0'; \
yyleng = n; \
@@ -7340,11 +2446,11 @@ char msg[];
#ifndef yytext_ptr
#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, const char *s2, int n )
+static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
#else
static void yy_flex_strncpy( s1, s2, n )
char *s1;
-const char *s2;
+yyconst char *s2;
int n;
#endif
{
@@ -7354,26 +2460,49 @@ int n;
}
#endif
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static int yy_flex_strlen( yyconst char *s )
+#else
+static int yy_flex_strlen( s )
+yyconst char *s;
+#endif
+ {
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+ }
+#endif
+
#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( unsigned int size )
+static void *yy_flex_alloc( yy_size_t size )
#else
static void *yy_flex_alloc( size )
-unsigned int size;
+yy_size_t size;
#endif
{
- return (void *) mem_alloc( size );
+ return (void *) malloc( size );
}
#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, unsigned int size )
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
#else
static void *yy_flex_realloc( ptr, size )
void *ptr;
-unsigned int size;
+yy_size_t size;
#endif
{
- return (void *) mem_realloc( ptr, size, __FILE__, __LINE__ );
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
}
#ifdef YY_USE_PROTOS
@@ -7383,6 +2512,15 @@ static void yy_flex_free( ptr )
void *ptr;
#endif
{
- mem_free( ptr );
+ free( ptr );
}
+#if YY_MAIN
+int main()
+ {
+ yylex();
+ return 0;
+ }
+#endif
+#line 502 "pars0lex.l"
+
diff --git a/innobase/pars/pars0grm.c b/innobase/pars/pars0grm.c
index 1f631c69f41..05b75398084 100644
--- a/innobase/pars/pars0grm.c
+++ b/innobase/pars/pars0grm.c
@@ -1,108 +1,109 @@
/* A Bison parser, made from pars0grm.y
- by GNU Bison version 1.25
- */
+ by GNU Bison version 1.28 */
#define YYBISON 1 /* Identify Bison output. */
-#define PARS_INT_LIT 258
-#define PARS_FLOAT_LIT 259
-#define PARS_STR_LIT 260
-#define PARS_NULL_LIT 261
-#define PARS_ID_TOKEN 262
-#define PARS_AND_TOKEN 263
-#define PARS_OR_TOKEN 264
-#define PARS_NOT_TOKEN 265
-#define PARS_GE_TOKEN 266
-#define PARS_LE_TOKEN 267
-#define PARS_NE_TOKEN 268
-#define PARS_PROCEDURE_TOKEN 269
-#define PARS_IN_TOKEN 270
-#define PARS_OUT_TOKEN 271
-#define PARS_INT_TOKEN 272
-#define PARS_INTEGER_TOKEN 273
-#define PARS_FLOAT_TOKEN 274
-#define PARS_CHAR_TOKEN 275
-#define PARS_IS_TOKEN 276
-#define PARS_BEGIN_TOKEN 277
-#define PARS_END_TOKEN 278
-#define PARS_IF_TOKEN 279
-#define PARS_THEN_TOKEN 280
-#define PARS_ELSE_TOKEN 281
-#define PARS_ELSIF_TOKEN 282
-#define PARS_LOOP_TOKEN 283
-#define PARS_WHILE_TOKEN 284
-#define PARS_RETURN_TOKEN 285
-#define PARS_SELECT_TOKEN 286
-#define PARS_SUM_TOKEN 287
-#define PARS_COUNT_TOKEN 288
-#define PARS_DISTINCT_TOKEN 289
-#define PARS_FROM_TOKEN 290
-#define PARS_WHERE_TOKEN 291
-#define PARS_FOR_TOKEN 292
-#define PARS_DDOT_TOKEN 293
-#define PARS_CONSISTENT_TOKEN 294
-#define PARS_READ_TOKEN 295
-#define PARS_ORDER_TOKEN 296
-#define PARS_BY_TOKEN 297
-#define PARS_ASC_TOKEN 298
-#define PARS_DESC_TOKEN 299
-#define PARS_INSERT_TOKEN 300
-#define PARS_INTO_TOKEN 301
-#define PARS_VALUES_TOKEN 302
-#define PARS_UPDATE_TOKEN 303
-#define PARS_SET_TOKEN 304
-#define PARS_DELETE_TOKEN 305
-#define PARS_CURRENT_TOKEN 306
-#define PARS_OF_TOKEN 307
-#define PARS_CREATE_TOKEN 308
-#define PARS_TABLE_TOKEN 309
-#define PARS_INDEX_TOKEN 310
-#define PARS_UNIQUE_TOKEN 311
-#define PARS_CLUSTERED_TOKEN 312
-#define PARS_DOES_NOT_FIT_IN_MEM_TOKEN 313
-#define PARS_ON_TOKEN 314
-#define PARS_ASSIGN_TOKEN 315
-#define PARS_DECLARE_TOKEN 316
-#define PARS_CURSOR_TOKEN 317
-#define PARS_SQL_TOKEN 318
-#define PARS_OPEN_TOKEN 319
-#define PARS_FETCH_TOKEN 320
-#define PARS_CLOSE_TOKEN 321
-#define PARS_NOTFOUND_TOKEN 322
-#define PARS_TO_CHAR_TOKEN 323
-#define PARS_TO_NUMBER_TOKEN 324
-#define PARS_TO_BINARY_TOKEN 325
-#define PARS_BINARY_TO_NUMBER_TOKEN 326
-#define PARS_SUBSTR_TOKEN 327
-#define PARS_REPLSTR_TOKEN 328
-#define PARS_CONCAT_TOKEN 329
-#define PARS_INSTR_TOKEN 330
-#define PARS_LENGTH_TOKEN 331
-#define PARS_SYSDATE_TOKEN 332
-#define PARS_PRINTF_TOKEN 333
-#define PARS_ASSERT_TOKEN 334
-#define PARS_RND_TOKEN 335
-#define PARS_RND_STR_TOKEN 336
-#define PARS_ROW_PRINTF_TOKEN 337
-#define PARS_COMMIT_TOKEN 338
-#define PARS_ROLLBACK_TOKEN 339
-#define PARS_WORK_TOKEN 340
-#define NEG 341
-
-#line 9 "pars0grm.y"
+#define PARS_INT_LIT 257
+#define PARS_FLOAT_LIT 258
+#define PARS_STR_LIT 259
+#define PARS_NULL_LIT 260
+#define PARS_ID_TOKEN 261
+#define PARS_AND_TOKEN 262
+#define PARS_OR_TOKEN 263
+#define PARS_NOT_TOKEN 264
+#define PARS_GE_TOKEN 265
+#define PARS_LE_TOKEN 266
+#define PARS_NE_TOKEN 267
+#define PARS_PROCEDURE_TOKEN 268
+#define PARS_IN_TOKEN 269
+#define PARS_OUT_TOKEN 270
+#define PARS_INT_TOKEN 271
+#define PARS_INTEGER_TOKEN 272
+#define PARS_FLOAT_TOKEN 273
+#define PARS_CHAR_TOKEN 274
+#define PARS_IS_TOKEN 275
+#define PARS_BEGIN_TOKEN 276
+#define PARS_END_TOKEN 277
+#define PARS_IF_TOKEN 278
+#define PARS_THEN_TOKEN 279
+#define PARS_ELSE_TOKEN 280
+#define PARS_ELSIF_TOKEN 281
+#define PARS_LOOP_TOKEN 282
+#define PARS_WHILE_TOKEN 283
+#define PARS_RETURN_TOKEN 284
+#define PARS_SELECT_TOKEN 285
+#define PARS_SUM_TOKEN 286
+#define PARS_COUNT_TOKEN 287
+#define PARS_DISTINCT_TOKEN 288
+#define PARS_FROM_TOKEN 289
+#define PARS_WHERE_TOKEN 290
+#define PARS_FOR_TOKEN 291
+#define PARS_DDOT_TOKEN 292
+#define PARS_CONSISTENT_TOKEN 293
+#define PARS_READ_TOKEN 294
+#define PARS_ORDER_TOKEN 295
+#define PARS_BY_TOKEN 296
+#define PARS_ASC_TOKEN 297
+#define PARS_DESC_TOKEN 298
+#define PARS_INSERT_TOKEN 299
+#define PARS_INTO_TOKEN 300
+#define PARS_VALUES_TOKEN 301
+#define PARS_UPDATE_TOKEN 302
+#define PARS_SET_TOKEN 303
+#define PARS_DELETE_TOKEN 304
+#define PARS_CURRENT_TOKEN 305
+#define PARS_OF_TOKEN 306
+#define PARS_CREATE_TOKEN 307
+#define PARS_TABLE_TOKEN 308
+#define PARS_INDEX_TOKEN 309
+#define PARS_UNIQUE_TOKEN 310
+#define PARS_CLUSTERED_TOKEN 311
+#define PARS_DOES_NOT_FIT_IN_MEM_TOKEN 312
+#define PARS_ON_TOKEN 313
+#define PARS_ASSIGN_TOKEN 314
+#define PARS_DECLARE_TOKEN 315
+#define PARS_CURSOR_TOKEN 316
+#define PARS_SQL_TOKEN 317
+#define PARS_OPEN_TOKEN 318
+#define PARS_FETCH_TOKEN 319
+#define PARS_CLOSE_TOKEN 320
+#define PARS_NOTFOUND_TOKEN 321
+#define PARS_TO_CHAR_TOKEN 322
+#define PARS_TO_NUMBER_TOKEN 323
+#define PARS_TO_BINARY_TOKEN 324
+#define PARS_BINARY_TO_NUMBER_TOKEN 325
+#define PARS_SUBSTR_TOKEN 326
+#define PARS_REPLSTR_TOKEN 327
+#define PARS_CONCAT_TOKEN 328
+#define PARS_INSTR_TOKEN 329
+#define PARS_LENGTH_TOKEN 330
+#define PARS_SYSDATE_TOKEN 331
+#define PARS_PRINTF_TOKEN 332
+#define PARS_ASSERT_TOKEN 333
+#define PARS_RND_TOKEN 334
+#define PARS_RND_STR_TOKEN 335
+#define PARS_ROW_PRINTF_TOKEN 336
+#define PARS_COMMIT_TOKEN 337
+#define PARS_ROLLBACK_TOKEN 338
+#define PARS_WORK_TOKEN 339
+#define NEG 340
+
+#line 13 "pars0grm.y"
/* The value of the semantic attribute is a pointer to a query tree node
que_node_t */
-#define YYSTYPE que_node_t*
#include "univ.i"
-#include <math.h>
+#include <math.h> /* Can't be before univ.i */
#include "pars0pars.h"
+#include "mem0mem.h"
#include "que0types.h"
#include "que0que.h"
#include "row0sel.h"
+#define YYSTYPE que_node_t*
+
/* #define __STDC__ */
int
@@ -124,7 +125,7 @@ yylex(void);
#define YYFLAG -32768
#define YYNTBASE 102
-#define YYTRANSLATE(x) ((unsigned)(x) <= 341 ? yytranslate[x] : 163)
+#define YYTRANSLATE(x) ((unsigned)(x) <= 340 ? yytranslate[x] : 163)
static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -152,16 +153,15 @@ static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
- 93
+ 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, 82, 83, 84, 85, 93
};
#if YYDEBUG != 0
@@ -241,22 +241,22 @@ static const short yyrhs[] = { 162,
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 125, 127, 128, 129, 130, 131, 132, 133, 134, 135,
- 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
- 146, 147, 150, 152, 156, 158, 160, 161, 162, 163,
- 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
- 174, 175, 176, 177, 178, 179, 180, 182, 186, 188,
- 189, 190, 192, 193, 194, 195, 196, 197, 198, 201,
- 203, 204, 207, 212, 217, 219, 220, 223, 225, 229,
- 231, 232, 236, 238, 239, 242, 244, 249, 255, 261,
- 263, 264, 268, 271, 273, 276, 278, 281, 283, 287,
- 289, 293, 295, 296, 299, 301, 305, 315, 320, 323,
- 327, 331, 333, 337, 343, 350, 355, 360, 366, 371,
- 376, 381, 386, 392, 394, 398, 400, 402, 405, 412,
- 418, 426, 430, 436, 442, 447, 451, 453, 457, 459,
- 464, 470, 472, 476, 478, 481, 483, 486, 494, 499,
- 504, 506, 509, 513, 518, 520, 521, 525, 530, 532,
- 533, 536, 542, 544, 545, 548
+ 129, 131, 132, 133, 134, 135, 136, 137, 138, 139,
+ 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
+ 150, 151, 154, 156, 160, 162, 164, 165, 166, 167,
+ 168, 169, 170, 171, 172, 173, 174, 175, 176, 177,
+ 178, 179, 180, 181, 182, 183, 184, 186, 190, 192,
+ 193, 194, 196, 197, 198, 199, 200, 201, 202, 205,
+ 207, 208, 211, 216, 221, 223, 224, 227, 229, 233,
+ 235, 236, 240, 242, 243, 246, 248, 253, 259, 265,
+ 267, 268, 272, 275, 277, 280, 282, 285, 287, 291,
+ 293, 297, 299, 300, 303, 305, 309, 319, 324, 327,
+ 331, 335, 337, 341, 347, 354, 359, 364, 370, 375,
+ 380, 385, 390, 396, 398, 402, 404, 406, 409, 416,
+ 422, 430, 434, 440, 446, 451, 455, 457, 461, 463,
+ 468, 474, 476, 480, 482, 485, 487, 490, 498, 503,
+ 508, 510, 513, 517, 522, 524, 525, 529, 534, 536,
+ 537, 540, 546, 548, 549, 552
};
#endif
@@ -567,7 +567,8 @@ static const short yycheck[] = { 0,
91, 92, -1, 86, 87, 88, 89, 90, 91, 92
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "bison.simple"
+#line 3 "/usr/share/bison.simple"
+/* This file comes from bison-1.28. */
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -584,46 +585,71 @@ static const short yycheck[] = { 0,
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
-#ifndef alloca
+/* This is the parser code that is written into each bison parser
+ when the %semantic_parser declaration is not specified in the grammar.
+ It was written by Richard Stallman by simplifying the hairy parser
+ used when %semantic_parser is specified. */
+
+#ifndef YYPARSE_RETURN_TYPE
+#define YYPARSE_RETURN_TYPE int
+#endif
+
+
+#ifndef YYSTACK_USE_ALLOCA
+#ifdef alloca
+#define YYSTACK_USE_ALLOCA
+#else /* alloca not defined */
#ifdef __GNUC__
+#define YYSTACK_USE_ALLOCA
#define alloca __builtin_alloca
#else /* not GNU C. */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
+#define YYSTACK_USE_ALLOCA
#include <alloca.h>
#else /* not sparc */
-#if defined (MSDOS) && !defined (__TURBOC__)
+/* We think this test detects Watcom and Microsoft C. */
+/* This used to test MSDOS, but that is a bad idea
+ since that symbol is in the user namespace. */
+#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
+#if 0 /* No need for malloc.h, which pollutes the namespace;
+ instead, just don't use alloca. */
#include <malloc.h>
+#endif
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
-#include <malloc.h>
+/* I don't know what this was needed for, but it pollutes the namespace.
+ So I turned it off. rms, 2 May 1997. */
+/* #include <malloc.h> */
#pragma alloca
-#else /* not MSDOS, __TURBOC__, or _AIX */
-#ifdef __hpux
-#ifdef __cplusplus
-extern "C" {
-void *alloca (unsigned int);
-};
-#else /* not __cplusplus */
-void *alloca ();
-#endif /* not __cplusplus */
+#define YYSTACK_USE_ALLOCA
+#else /* not MSDOS, or __TURBOC__, or _AIX */
+#if 0
+#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
+ and on HPUX 10. Eventually we can turn this on. */
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
#endif /* __hpux */
+#endif
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc. */
-#endif /* not GNU C. */
-#endif /* alloca not defined. */
+#endif /* not sparc */
+#endif /* not GNU C */
+#endif /* alloca not defined */
+#endif /* YYSTACK_USE_ALLOCA not defined */
-/* This is the parser code that is written into each bison parser
- when the %semantic_parser declaration is not specified in the grammar.
- It was written by Richard Stallman by simplifying the hairy parser
- used when %semantic_parser is specified. */
+#ifdef YYSTACK_USE_ALLOCA
+#define YYSTACK_ALLOC alloca
+#else
+#define YYSTACK_ALLOC malloc
+#endif
/* Note: there must be only one dollar sign in this file.
It is replaced by the list of actions, each action
@@ -633,8 +659,8 @@ void *alloca ();
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
-#define YYACCEPT return(0)
-#define YYABORT return(1)
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
#define YYERROR goto yyerrlab1
/* Like YYERROR except do call yyerror.
This remains here temporarily to ease the
@@ -702,7 +728,7 @@ int yydebug; /* nonzero means print parse trace */
/* YYINITDEPTH indicates the initial size of the parser's stacks */
#ifndef YYINITDEPTH
-#define YYINITDEPTH 1000
+#define YYINITDEPTH 200
#endif
/* YYMAXDEPTH is the maximum size the stacks can grow to
@@ -715,12 +741,12 @@ int yydebug; /* nonzero means print parse trace */
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif
-
-/* Prevent warning if -Wstrict-prototypes. */
-#ifdef __GNUC__
-int yyparse (void);
-#endif
+/* Define __yy_memcpy. Note that the size argument
+ should be passed with type unsigned int, because that is what the non-GCC
+ definitions require. With GCC, __builtin_memcpy takes an arg
+ of type size_t, but it can handle unsigned int. */
+
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
#else /* not GNU C or C++ */
@@ -732,7 +758,7 @@ static void
__yy_memcpy (to, from, count)
char *to;
char *from;
- int count;
+ unsigned int count;
{
register char *f = from;
register char *t = to;
@@ -747,10 +773,10 @@ __yy_memcpy (to, from, count)
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
-__yy_memcpy (char *to, char *from, int count)
+__yy_memcpy (char *to, char *from, unsigned int count)
{
- register char *f = from;
register char *t = to;
+ register char *f = from;
register int i = count;
while (i-- > 0)
@@ -760,7 +786,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif
#endif
-#line 196 "bison.simple"
+#line 222 "/usr/share/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
@@ -781,7 +807,18 @@ __yy_memcpy (char *to, char *from, int count)
#define YYPARSE_PARAM_DECL
#endif /* not YYPARSE_PARAM */
-int
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+#ifdef YYPARSE_PARAM
+YYPARSE_RETURN_TYPE
+yyparse (void *);
+#else
+YYPARSE_RETURN_TYPE
+yyparse (void);
+#endif
+#endif
+
+YYPARSE_RETURN_TYPE
yyparse(YYPARSE_PARAM_ARG)
YYPARSE_PARAM_DECL
{
@@ -809,6 +846,9 @@ yyparse(YYPARSE_PARAM_ARG)
#endif
int yystacksize = YYINITDEPTH;
+#ifndef YYSTACK_USE_ALLOCA
+ int yyfree_stacks = 0;
+#endif
#ifdef YYPURE
int yychar;
@@ -893,23 +933,34 @@ yynewstate:
if (yystacksize >= YYMAXDEPTH)
{
yyerror("parser stack overflow");
- ut_a(0);
+#ifndef YYSTACK_USE_ALLOCA
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+#endif
return 2;
}
yystacksize *= 2;
if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
-
- ut_a(0); /* Prevent possible memory leaks through the following
- mem_alloc's */
-
- yyss = (short *) mem_alloc (yystacksize * sizeof (*yyssp));
- __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
- yyvs = (YYSTYPE *) mem_alloc (yystacksize * sizeof (*yyvsp));
- __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
+#ifndef YYSTACK_USE_ALLOCA
+ yyfree_stacks = 1;
+#endif
+ yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
+ __yy_memcpy ((char *)yyss, (char *)yyss1,
+ size * (unsigned int) sizeof (*yyssp));
+ yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
+ __yy_memcpy ((char *)yyvs, (char *)yyvs1,
+ size * (unsigned int) sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
- yyls = (YYLTYPE *) mem_alloc (yystacksize * sizeof (*yylsp));
- __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
+ yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
+ __yy_memcpy ((char *)yyls, (char *)yyls1,
+ size * (unsigned int) sizeof (*yylsp));
#endif
#endif /* no yyoverflow */
@@ -1070,218 +1121,218 @@ yyreduce:
switch (yyn) {
case 23:
-#line 151 "pars0grm.y"
+#line 155 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;
break;}
case 24:
-#line 153 "pars0grm.y"
+#line 157 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-1], yyvsp[0]); ;
break;}
case 25:
-#line 157 "pars0grm.y"
+#line 161 "pars0grm.y"
{ yyval = yyvsp[0];;
break;}
case 26:
-#line 159 "pars0grm.y"
+#line 163 "pars0grm.y"
{ yyval = pars_func(yyvsp[-3], yyvsp[-1]); ;
break;}
case 27:
-#line 160 "pars0grm.y"
+#line 164 "pars0grm.y"
{ yyval = yyvsp[0];;
break;}
case 28:
-#line 161 "pars0grm.y"
+#line 165 "pars0grm.y"
{ yyval = yyvsp[0];;
break;}
case 29:
-#line 162 "pars0grm.y"
+#line 166 "pars0grm.y"
{ yyval = yyvsp[0];;
break;}
case 30:
-#line 163 "pars0grm.y"
+#line 167 "pars0grm.y"
{ yyval = yyvsp[0];;
break;}
case 31:
-#line 164 "pars0grm.y"
+#line 168 "pars0grm.y"
{ yyval = yyvsp[0];;
break;}
case 32:
-#line 165 "pars0grm.y"
+#line 169 "pars0grm.y"
{ yyval = pars_op('+', yyvsp[-2], yyvsp[0]); ;
break;}
case 33:
-#line 166 "pars0grm.y"
+#line 170 "pars0grm.y"
{ yyval = pars_op('-', yyvsp[-2], yyvsp[0]); ;
break;}
case 34:
-#line 167 "pars0grm.y"
+#line 171 "pars0grm.y"
{ yyval = pars_op('*', yyvsp[-2], yyvsp[0]); ;
break;}
case 35:
-#line 168 "pars0grm.y"
+#line 172 "pars0grm.y"
{ yyval = pars_op('/', yyvsp[-2], yyvsp[0]); ;
break;}
case 36:
-#line 169 "pars0grm.y"
+#line 173 "pars0grm.y"
{ yyval = pars_op('-', yyvsp[0], NULL); ;
break;}
case 37:
-#line 170 "pars0grm.y"
+#line 174 "pars0grm.y"
{ yyval = yyvsp[-1]; ;
break;}
case 38:
-#line 171 "pars0grm.y"
+#line 175 "pars0grm.y"
{ yyval = pars_op('=', yyvsp[-2], yyvsp[0]); ;
break;}
case 39:
-#line 172 "pars0grm.y"
+#line 176 "pars0grm.y"
{ yyval = pars_op('<', yyvsp[-2], yyvsp[0]); ;
break;}
case 40:
-#line 173 "pars0grm.y"
+#line 177 "pars0grm.y"
{ yyval = pars_op('>', yyvsp[-2], yyvsp[0]); ;
break;}
case 41:
-#line 174 "pars0grm.y"
+#line 178 "pars0grm.y"
{ yyval = pars_op(PARS_GE_TOKEN, yyvsp[-2], yyvsp[0]); ;
break;}
case 42:
-#line 175 "pars0grm.y"
+#line 179 "pars0grm.y"
{ yyval = pars_op(PARS_LE_TOKEN, yyvsp[-2], yyvsp[0]); ;
break;}
case 43:
-#line 176 "pars0grm.y"
+#line 180 "pars0grm.y"
{ yyval = pars_op(PARS_NE_TOKEN, yyvsp[-2], yyvsp[0]); ;
break;}
case 44:
-#line 177 "pars0grm.y"
+#line 181 "pars0grm.y"
{ yyval = pars_op(PARS_AND_TOKEN, yyvsp[-2], yyvsp[0]); ;
break;}
case 45:
-#line 178 "pars0grm.y"
+#line 182 "pars0grm.y"
{ yyval = pars_op(PARS_OR_TOKEN, yyvsp[-2], yyvsp[0]); ;
break;}
case 46:
-#line 179 "pars0grm.y"
+#line 183 "pars0grm.y"
{ yyval = pars_op(PARS_NOT_TOKEN, yyvsp[0], NULL); ;
break;}
case 47:
-#line 181 "pars0grm.y"
+#line 185 "pars0grm.y"
{ yyval = pars_op(PARS_NOTFOUND_TOKEN, yyvsp[-2], NULL); ;
break;}
case 48:
-#line 183 "pars0grm.y"
+#line 187 "pars0grm.y"
{ yyval = pars_op(PARS_NOTFOUND_TOKEN, yyvsp[-2], NULL); ;
break;}
case 49:
-#line 187 "pars0grm.y"
+#line 191 "pars0grm.y"
{ yyval = &pars_to_char_token; ;
break;}
case 50:
-#line 188 "pars0grm.y"
+#line 192 "pars0grm.y"
{ yyval = &pars_to_number_token; ;
break;}
case 51:
-#line 189 "pars0grm.y"
+#line 193 "pars0grm.y"
{ yyval = &pars_to_binary_token; ;
break;}
case 52:
-#line 191 "pars0grm.y"
+#line 195 "pars0grm.y"
{ yyval = &pars_binary_to_number_token; ;
break;}
case 53:
-#line 192 "pars0grm.y"
+#line 196 "pars0grm.y"
{ yyval = &pars_substr_token; ;
break;}
case 54:
-#line 193 "pars0grm.y"
+#line 197 "pars0grm.y"
{ yyval = &pars_concat_token; ;
break;}
case 55:
-#line 194 "pars0grm.y"
+#line 198 "pars0grm.y"
{ yyval = &pars_instr_token; ;
break;}
case 56:
-#line 195 "pars0grm.y"
+#line 199 "pars0grm.y"
{ yyval = &pars_length_token; ;
break;}
case 57:
-#line 196 "pars0grm.y"
+#line 200 "pars0grm.y"
{ yyval = &pars_sysdate_token; ;
break;}
case 58:
-#line 197 "pars0grm.y"
+#line 201 "pars0grm.y"
{ yyval = &pars_rnd_token; ;
break;}
case 59:
-#line 198 "pars0grm.y"
+#line 202 "pars0grm.y"
{ yyval = &pars_rnd_str_token; ;
break;}
case 63:
-#line 209 "pars0grm.y"
+#line 213 "pars0grm.y"
{ yyval = pars_stored_procedure_call(yyvsp[-4]); ;
break;}
case 64:
-#line 214 "pars0grm.y"
+#line 218 "pars0grm.y"
{ yyval = pars_procedure_call(yyvsp[-3], yyvsp[-1]); ;
break;}
case 65:
-#line 218 "pars0grm.y"
+#line 222 "pars0grm.y"
{ yyval = &pars_replstr_token; ;
break;}
case 66:
-#line 219 "pars0grm.y"
+#line 223 "pars0grm.y"
{ yyval = &pars_printf_token; ;
break;}
case 67:
-#line 220 "pars0grm.y"
+#line 224 "pars0grm.y"
{ yyval = &pars_assert_token; ;
break;}
case 68:
-#line 224 "pars0grm.y"
+#line 228 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;
break;}
case 69:
-#line 226 "pars0grm.y"
+#line 230 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;
break;}
case 70:
-#line 230 "pars0grm.y"
+#line 234 "pars0grm.y"
{ yyval = NULL; ;
break;}
case 71:
-#line 231 "pars0grm.y"
+#line 235 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;
break;}
case 72:
-#line 233 "pars0grm.y"
+#line 237 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;
break;}
case 73:
-#line 237 "pars0grm.y"
+#line 241 "pars0grm.y"
{ yyval = NULL; ;
break;}
case 74:
-#line 238 "pars0grm.y"
+#line 242 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]);;
break;}
case 75:
-#line 239 "pars0grm.y"
+#line 243 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;
break;}
case 76:
-#line 243 "pars0grm.y"
+#line 247 "pars0grm.y"
{ yyval = yyvsp[0]; ;
break;}
case 77:
-#line 245 "pars0grm.y"
+#line 249 "pars0grm.y"
{ yyval = pars_func(&pars_count_token,
que_node_list_add_last(NULL,
sym_tab_add_int_lit(
pars_sym_tab_global, 1))); ;
break;}
case 78:
-#line 250 "pars0grm.y"
+#line 254 "pars0grm.y"
{ yyval = pars_func(&pars_count_token,
que_node_list_add_last(NULL,
pars_func(&pars_distinct_token,
@@ -1289,308 +1340,308 @@ case 78:
NULL, yyvsp[-1])))); ;
break;}
case 79:
-#line 256 "pars0grm.y"
+#line 260 "pars0grm.y"
{ yyval = pars_func(&pars_sum_token,
que_node_list_add_last(NULL,
yyvsp[-1])); ;
break;}
case 80:
-#line 262 "pars0grm.y"
+#line 266 "pars0grm.y"
{ yyval = NULL; ;
break;}
case 81:
-#line 263 "pars0grm.y"
+#line 267 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;
break;}
case 82:
-#line 265 "pars0grm.y"
+#line 269 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;
break;}
case 83:
-#line 269 "pars0grm.y"
+#line 273 "pars0grm.y"
{ yyval = pars_select_list(&pars_star_denoter,
NULL); ;
break;}
case 84:
-#line 272 "pars0grm.y"
+#line 276 "pars0grm.y"
{ yyval = pars_select_list(yyvsp[-2], yyvsp[0]); ;
break;}
case 85:
-#line 273 "pars0grm.y"
+#line 277 "pars0grm.y"
{ yyval = pars_select_list(yyvsp[0], NULL); ;
break;}
case 86:
-#line 277 "pars0grm.y"
+#line 281 "pars0grm.y"
{ yyval = NULL; ;
break;}
case 87:
-#line 278 "pars0grm.y"
+#line 282 "pars0grm.y"
{ yyval = yyvsp[0]; ;
break;}
case 88:
-#line 282 "pars0grm.y"
+#line 286 "pars0grm.y"
{ yyval = NULL; ;
break;}
case 89:
-#line 284 "pars0grm.y"
+#line 288 "pars0grm.y"
{ yyval = &pars_update_token; ;
break;}
case 90:
-#line 288 "pars0grm.y"
+#line 292 "pars0grm.y"
{ yyval = NULL; ;
break;}
case 91:
-#line 290 "pars0grm.y"
+#line 294 "pars0grm.y"
{ yyval = &pars_consistent_token; ;
break;}
case 92:
-#line 294 "pars0grm.y"
+#line 298 "pars0grm.y"
{ yyval = &pars_asc_token; ;
break;}
case 93:
-#line 295 "pars0grm.y"
+#line 299 "pars0grm.y"
{ yyval = &pars_asc_token; ;
break;}
case 94:
-#line 296 "pars0grm.y"
+#line 300 "pars0grm.y"
{ yyval = &pars_desc_token; ;
break;}
case 95:
-#line 300 "pars0grm.y"
+#line 304 "pars0grm.y"
{ yyval = NULL; ;
break;}
case 96:
-#line 302 "pars0grm.y"
+#line 306 "pars0grm.y"
{ yyval = pars_order_by(yyvsp[-1], yyvsp[0]); ;
break;}
case 97:
-#line 311 "pars0grm.y"
+#line 315 "pars0grm.y"
{ yyval = pars_select_statement(yyvsp[-6], yyvsp[-4], yyvsp[-3],
yyvsp[-2], yyvsp[-1], yyvsp[0]); ;
break;}
case 98:
-#line 317 "pars0grm.y"
+#line 321 "pars0grm.y"
{ yyval = yyvsp[0]; ;
break;}
case 99:
-#line 322 "pars0grm.y"
+#line 326 "pars0grm.y"
{ yyval = pars_insert_statement(yyvsp[-4], yyvsp[-1], NULL); ;
break;}
case 100:
-#line 324 "pars0grm.y"
+#line 328 "pars0grm.y"
{ yyval = pars_insert_statement(yyvsp[-1], NULL, yyvsp[0]); ;
break;}
case 101:
-#line 328 "pars0grm.y"
+#line 332 "pars0grm.y"
{ yyval = pars_column_assignment(yyvsp[-2], yyvsp[0]); ;
break;}
case 102:
-#line 332 "pars0grm.y"
+#line 336 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;
break;}
case 103:
-#line 334 "pars0grm.y"
+#line 338 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;
break;}
case 104:
-#line 340 "pars0grm.y"
+#line 344 "pars0grm.y"
{ yyval = yyvsp[0]; ;
break;}
case 105:
-#line 346 "pars0grm.y"
+#line 350 "pars0grm.y"
{ yyval = pars_update_statement_start(FALSE,
yyvsp[-2], yyvsp[0]); ;
break;}
case 106:
-#line 352 "pars0grm.y"
+#line 356 "pars0grm.y"
{ yyval = pars_update_statement(yyvsp[-1], NULL, yyvsp[0]); ;
break;}
case 107:
-#line 357 "pars0grm.y"
+#line 361 "pars0grm.y"
{ yyval = pars_update_statement(yyvsp[-1], yyvsp[0], NULL); ;
break;}
case 108:
-#line 362 "pars0grm.y"
+#line 366 "pars0grm.y"
{ yyval = pars_update_statement_start(TRUE,
yyvsp[0], NULL); ;
break;}
case 109:
-#line 368 "pars0grm.y"
+#line 372 "pars0grm.y"
{ yyval = pars_update_statement(yyvsp[-1], NULL, yyvsp[0]); ;
break;}
case 110:
-#line 373 "pars0grm.y"
+#line 377 "pars0grm.y"
{ yyval = pars_update_statement(yyvsp[-1], yyvsp[0], NULL); ;
break;}
case 111:
-#line 378 "pars0grm.y"
+#line 382 "pars0grm.y"
{ yyval = pars_row_printf_statement(yyvsp[0]); ;
break;}
case 112:
-#line 383 "pars0grm.y"
+#line 387 "pars0grm.y"
{ yyval = pars_assignment_statement(yyvsp[-2], yyvsp[0]); ;
break;}
case 113:
-#line 389 "pars0grm.y"
+#line 393 "pars0grm.y"
{ yyval = pars_elsif_element(yyvsp[-2], yyvsp[0]); ;
break;}
case 114:
-#line 393 "pars0grm.y"
+#line 397 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;
break;}
case 115:
-#line 395 "pars0grm.y"
+#line 399 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-1], yyvsp[0]); ;
break;}
case 116:
-#line 399 "pars0grm.y"
+#line 403 "pars0grm.y"
{ yyval = NULL; ;
break;}
case 117:
-#line 401 "pars0grm.y"
+#line 405 "pars0grm.y"
{ yyval = yyvsp[0]; ;
break;}
case 118:
-#line 402 "pars0grm.y"
+#line 406 "pars0grm.y"
{ yyval = yyvsp[0]; ;
break;}
case 119:
-#line 409 "pars0grm.y"
+#line 413 "pars0grm.y"
{ yyval = pars_if_statement(yyvsp[-5], yyvsp[-3], yyvsp[-2]); ;
break;}
case 120:
-#line 415 "pars0grm.y"
+#line 419 "pars0grm.y"
{ yyval = pars_while_statement(yyvsp[-4], yyvsp[-2]); ;
break;}
case 121:
-#line 423 "pars0grm.y"
+#line 427 "pars0grm.y"
{ yyval = pars_for_statement(yyvsp[-8], yyvsp[-6], yyvsp[-4], yyvsp[-2]); ;
break;}
case 122:
-#line 427 "pars0grm.y"
+#line 431 "pars0grm.y"
{ yyval = pars_return_statement(); ;
break;}
case 123:
-#line 432 "pars0grm.y"
+#line 436 "pars0grm.y"
{ yyval = pars_open_statement(
ROW_SEL_OPEN_CURSOR, yyvsp[0]); ;
break;}
case 124:
-#line 438 "pars0grm.y"
+#line 442 "pars0grm.y"
{ yyval = pars_open_statement(
ROW_SEL_CLOSE_CURSOR, yyvsp[0]); ;
break;}
case 125:
-#line 444 "pars0grm.y"
+#line 448 "pars0grm.y"
{ yyval = pars_fetch_statement(yyvsp[-2], yyvsp[0]); ;
break;}
case 126:
-#line 448 "pars0grm.y"
+#line 452 "pars0grm.y"
{ yyval = pars_column_def(yyvsp[-1], yyvsp[0]); ;
break;}
case 127:
-#line 452 "pars0grm.y"
+#line 456 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;
break;}
case 128:
-#line 454 "pars0grm.y"
+#line 458 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;
break;}
case 129:
-#line 458 "pars0grm.y"
+#line 462 "pars0grm.y"
{ yyval = NULL; ;
break;}
case 130:
-#line 460 "pars0grm.y"
+#line 464 "pars0grm.y"
{ yyval = &pars_int_token;
/* pass any non-NULL pointer */ ;
break;}
case 131:
-#line 467 "pars0grm.y"
+#line 471 "pars0grm.y"
{ yyval = pars_create_table(yyvsp[-4], yyvsp[-2], yyvsp[0]); ;
break;}
case 132:
-#line 471 "pars0grm.y"
+#line 475 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;
break;}
case 133:
-#line 473 "pars0grm.y"
+#line 477 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;
break;}
case 134:
-#line 477 "pars0grm.y"
+#line 481 "pars0grm.y"
{ yyval = NULL; ;
break;}
case 135:
-#line 478 "pars0grm.y"
+#line 482 "pars0grm.y"
{ yyval = &pars_unique_token; ;
break;}
case 136:
-#line 482 "pars0grm.y"
+#line 486 "pars0grm.y"
{ yyval = NULL; ;
break;}
case 137:
-#line 483 "pars0grm.y"
+#line 487 "pars0grm.y"
{ yyval = &pars_clustered_token; ;
break;}
case 138:
-#line 491 "pars0grm.y"
+#line 495 "pars0grm.y"
{ yyval = pars_create_index(yyvsp[-8], yyvsp[-7], yyvsp[-5], yyvsp[-3], yyvsp[-1]); ;
break;}
case 139:
-#line 496 "pars0grm.y"
+#line 500 "pars0grm.y"
{ yyval = pars_commit_statement(); ;
break;}
case 140:
-#line 501 "pars0grm.y"
+#line 505 "pars0grm.y"
{ yyval = pars_rollback_statement(); ;
break;}
case 141:
-#line 505 "pars0grm.y"
+#line 509 "pars0grm.y"
{ yyval = &pars_int_token; ;
break;}
case 142:
-#line 506 "pars0grm.y"
+#line 510 "pars0grm.y"
{ yyval = &pars_char_token; ;
break;}
case 143:
-#line 511 "pars0grm.y"
+#line 515 "pars0grm.y"
{ yyval = pars_parameter_declaration(yyvsp[-2],
PARS_INPUT, yyvsp[0]); ;
break;}
case 144:
-#line 514 "pars0grm.y"
+#line 518 "pars0grm.y"
{ yyval = pars_parameter_declaration(yyvsp[-2],
PARS_OUTPUT, yyvsp[0]); ;
break;}
case 145:
-#line 519 "pars0grm.y"
+#line 523 "pars0grm.y"
{ yyval = NULL; ;
break;}
case 146:
-#line 520 "pars0grm.y"
+#line 524 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;
break;}
case 147:
-#line 522 "pars0grm.y"
+#line 526 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;
break;}
case 148:
-#line 527 "pars0grm.y"
+#line 531 "pars0grm.y"
{ yyval = pars_variable_declaration(yyvsp[-2], yyvsp[-1]); ;
break;}
case 152:
-#line 539 "pars0grm.y"
+#line 543 "pars0grm.y"
{ yyval = pars_cursor_declaration(yyvsp[-3], yyvsp[-1]); ;
break;}
case 156:
-#line 555 "pars0grm.y"
+#line 559 "pars0grm.y"
{ yyval = pars_procedure_definition(yyvsp[-9], yyvsp[-7],
yyvsp[-1]); ;
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 498 "bison.simple"
+#line 554 "/usr/share/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
@@ -1665,7 +1716,7 @@ yyerrlab: /* here on detecting error */
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
- msg = (char *) mem_alloc(size + 15);
+ msg = (char *) malloc(size + 15);
if (msg != 0)
{
strcpy(msg, "parse error");
@@ -1684,7 +1735,7 @@ yyerrlab: /* here on detecting error */
}
}
yyerror(msg);
- mem_free(msg);
+ free(msg);
}
else
yyerror ("parse error; also virtual memory exceeded");
@@ -1785,6 +1836,34 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
+
+ yyacceptlab:
+ /* YYACCEPT comes here. */
+#ifndef YYSTACK_USE_ALLOCA
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+#endif
+ return 0;
+
+ yyabortlab:
+ /* YYABORT comes here. */
+#ifndef YYSTACK_USE_ALLOCA
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+#endif
+ return 1;
}
-#line 559 "pars0grm.y"
+#line 563 "pars0grm.y"
diff --git a/innobase/pars/pars0grm.h b/innobase/pars/pars0grm.h
index d0b4b4c2e42..b2790949057 100644
--- a/innobase/pars/pars0grm.h
+++ b/innobase/pars/pars0grm.h
@@ -1,90 +1,90 @@
#ifndef YYSTYPE
#define YYSTYPE int
#endif
-#define PARS_INT_LIT 258
-#define PARS_FLOAT_LIT 259
-#define PARS_STR_LIT 260
-#define PARS_NULL_LIT 261
-#define PARS_ID_TOKEN 262
-#define PARS_AND_TOKEN 263
-#define PARS_OR_TOKEN 264
-#define PARS_NOT_TOKEN 265
-#define PARS_GE_TOKEN 266
-#define PARS_LE_TOKEN 267
-#define PARS_NE_TOKEN 268
-#define PARS_PROCEDURE_TOKEN 269
-#define PARS_IN_TOKEN 270
-#define PARS_OUT_TOKEN 271
-#define PARS_INT_TOKEN 272
-#define PARS_INTEGER_TOKEN 273
-#define PARS_FLOAT_TOKEN 274
-#define PARS_CHAR_TOKEN 275
-#define PARS_IS_TOKEN 276
-#define PARS_BEGIN_TOKEN 277
-#define PARS_END_TOKEN 278
-#define PARS_IF_TOKEN 279
-#define PARS_THEN_TOKEN 280
-#define PARS_ELSE_TOKEN 281
-#define PARS_ELSIF_TOKEN 282
-#define PARS_LOOP_TOKEN 283
-#define PARS_WHILE_TOKEN 284
-#define PARS_RETURN_TOKEN 285
-#define PARS_SELECT_TOKEN 286
-#define PARS_SUM_TOKEN 287
-#define PARS_COUNT_TOKEN 288
-#define PARS_DISTINCT_TOKEN 289
-#define PARS_FROM_TOKEN 290
-#define PARS_WHERE_TOKEN 291
-#define PARS_FOR_TOKEN 292
-#define PARS_DDOT_TOKEN 293
-#define PARS_CONSISTENT_TOKEN 294
-#define PARS_READ_TOKEN 295
-#define PARS_ORDER_TOKEN 296
-#define PARS_BY_TOKEN 297
-#define PARS_ASC_TOKEN 298
-#define PARS_DESC_TOKEN 299
-#define PARS_INSERT_TOKEN 300
-#define PARS_INTO_TOKEN 301
-#define PARS_VALUES_TOKEN 302
-#define PARS_UPDATE_TOKEN 303
-#define PARS_SET_TOKEN 304
-#define PARS_DELETE_TOKEN 305
-#define PARS_CURRENT_TOKEN 306
-#define PARS_OF_TOKEN 307
-#define PARS_CREATE_TOKEN 308
-#define PARS_TABLE_TOKEN 309
-#define PARS_INDEX_TOKEN 310
-#define PARS_UNIQUE_TOKEN 311
-#define PARS_CLUSTERED_TOKEN 312
-#define PARS_DOES_NOT_FIT_IN_MEM_TOKEN 313
-#define PARS_ON_TOKEN 314
-#define PARS_ASSIGN_TOKEN 315
-#define PARS_DECLARE_TOKEN 316
-#define PARS_CURSOR_TOKEN 317
-#define PARS_SQL_TOKEN 318
-#define PARS_OPEN_TOKEN 319
-#define PARS_FETCH_TOKEN 320
-#define PARS_CLOSE_TOKEN 321
-#define PARS_NOTFOUND_TOKEN 322
-#define PARS_TO_CHAR_TOKEN 323
-#define PARS_TO_NUMBER_TOKEN 324
-#define PARS_TO_BINARY_TOKEN 325
-#define PARS_BINARY_TO_NUMBER_TOKEN 326
-#define PARS_SUBSTR_TOKEN 327
-#define PARS_REPLSTR_TOKEN 328
-#define PARS_CONCAT_TOKEN 329
-#define PARS_INSTR_TOKEN 330
-#define PARS_LENGTH_TOKEN 331
-#define PARS_SYSDATE_TOKEN 332
-#define PARS_PRINTF_TOKEN 333
-#define PARS_ASSERT_TOKEN 334
-#define PARS_RND_TOKEN 335
-#define PARS_RND_STR_TOKEN 336
-#define PARS_ROW_PRINTF_TOKEN 337
-#define PARS_COMMIT_TOKEN 338
-#define PARS_ROLLBACK_TOKEN 339
-#define PARS_WORK_TOKEN 340
-#define NEG 341
+#define PARS_INT_LIT 257
+#define PARS_FLOAT_LIT 258
+#define PARS_STR_LIT 259
+#define PARS_NULL_LIT 260
+#define PARS_ID_TOKEN 261
+#define PARS_AND_TOKEN 262
+#define PARS_OR_TOKEN 263
+#define PARS_NOT_TOKEN 264
+#define PARS_GE_TOKEN 265
+#define PARS_LE_TOKEN 266
+#define PARS_NE_TOKEN 267
+#define PARS_PROCEDURE_TOKEN 268
+#define PARS_IN_TOKEN 269
+#define PARS_OUT_TOKEN 270
+#define PARS_INT_TOKEN 271
+#define PARS_INTEGER_TOKEN 272
+#define PARS_FLOAT_TOKEN 273
+#define PARS_CHAR_TOKEN 274
+#define PARS_IS_TOKEN 275
+#define PARS_BEGIN_TOKEN 276
+#define PARS_END_TOKEN 277
+#define PARS_IF_TOKEN 278
+#define PARS_THEN_TOKEN 279
+#define PARS_ELSE_TOKEN 280
+#define PARS_ELSIF_TOKEN 281
+#define PARS_LOOP_TOKEN 282
+#define PARS_WHILE_TOKEN 283
+#define PARS_RETURN_TOKEN 284
+#define PARS_SELECT_TOKEN 285
+#define PARS_SUM_TOKEN 286
+#define PARS_COUNT_TOKEN 287
+#define PARS_DISTINCT_TOKEN 288
+#define PARS_FROM_TOKEN 289
+#define PARS_WHERE_TOKEN 290
+#define PARS_FOR_TOKEN 291
+#define PARS_DDOT_TOKEN 292
+#define PARS_CONSISTENT_TOKEN 293
+#define PARS_READ_TOKEN 294
+#define PARS_ORDER_TOKEN 295
+#define PARS_BY_TOKEN 296
+#define PARS_ASC_TOKEN 297
+#define PARS_DESC_TOKEN 298
+#define PARS_INSERT_TOKEN 299
+#define PARS_INTO_TOKEN 300
+#define PARS_VALUES_TOKEN 301
+#define PARS_UPDATE_TOKEN 302
+#define PARS_SET_TOKEN 303
+#define PARS_DELETE_TOKEN 304
+#define PARS_CURRENT_TOKEN 305
+#define PARS_OF_TOKEN 306
+#define PARS_CREATE_TOKEN 307
+#define PARS_TABLE_TOKEN 308
+#define PARS_INDEX_TOKEN 309
+#define PARS_UNIQUE_TOKEN 310
+#define PARS_CLUSTERED_TOKEN 311
+#define PARS_DOES_NOT_FIT_IN_MEM_TOKEN 312
+#define PARS_ON_TOKEN 313
+#define PARS_ASSIGN_TOKEN 314
+#define PARS_DECLARE_TOKEN 315
+#define PARS_CURSOR_TOKEN 316
+#define PARS_SQL_TOKEN 317
+#define PARS_OPEN_TOKEN 318
+#define PARS_FETCH_TOKEN 319
+#define PARS_CLOSE_TOKEN 320
+#define PARS_NOTFOUND_TOKEN 321
+#define PARS_TO_CHAR_TOKEN 322
+#define PARS_TO_NUMBER_TOKEN 323
+#define PARS_TO_BINARY_TOKEN 324
+#define PARS_BINARY_TO_NUMBER_TOKEN 325
+#define PARS_SUBSTR_TOKEN 326
+#define PARS_REPLSTR_TOKEN 327
+#define PARS_CONCAT_TOKEN 328
+#define PARS_INSTR_TOKEN 329
+#define PARS_LENGTH_TOKEN 330
+#define PARS_SYSDATE_TOKEN 331
+#define PARS_PRINTF_TOKEN 332
+#define PARS_ASSERT_TOKEN 333
+#define PARS_RND_TOKEN 334
+#define PARS_RND_STR_TOKEN 335
+#define PARS_ROW_PRINTF_TOKEN 336
+#define PARS_COMMIT_TOKEN 337
+#define PARS_ROLLBACK_TOKEN 338
+#define PARS_WORK_TOKEN 339
+#define NEG 340
extern YYSTYPE yylval;
diff --git a/innobase/pars/pars0grm.y b/innobase/pars/pars0grm.y
index ae8c5ab91ec..a142d04301e 100644
--- a/innobase/pars/pars0grm.y
+++ b/innobase/pars/pars0grm.y
@@ -4,23 +4,26 @@ SQL parser: input file for the GNU Bison parser generator
(c) 1997 Innobase Oy
Created 12/14/1997 Heikki Tuuri
+Published under the GPL version 2
+
+Look from pars0lex.l for instructions how to generate the C files for
+the InnoDB parser.
*******************************************************/
%{
/* The value of the semantic attribute is a pointer to a query tree node
que_node_t */
-#define YYSTYPE que_node_t*
#include "univ.i"
-#undef alloca
-#define alloca mem_alloc
-#include <math.h>
+#include <math.h> /* Can't be before univ.i */
#include "pars0pars.h"
#include "mem0mem.h"
#include "que0types.h"
#include "que0que.h"
#include "row0sel.h"
+#define YYSTYPE que_node_t*
+
/* #define __STDC__ */
int
diff --git a/innobase/pars/pars0lex.l b/innobase/pars/pars0lex.l
index 718dfc86646..97875ffcc45 100644
--- a/innobase/pars/pars0lex.l
+++ b/innobase/pars/pars0lex.l
@@ -4,6 +4,35 @@ SQL parser lexical analyzer: input file for the GNU Flex lexer generator
(c) 1997 Innobase Oy
Created 12/14/1997 Heikki Tuuri
+Published under the GPL version 2
+
+The InnoDB parser is frozen because MySQL takes care of SQL parsing.
+Therefore we normally keep the InnoDB parser C files as they are, and do
+not automatically generate them from pars0grm.y and pars0lex.l.
+
+How to make the InnoDB parser and lexer C files:
+
+1. First do
+ bison -d pars0grm.y
+ That generates pars0grm.tab.c and pars0grm.tab.h.
+
+2. Rename pars0grm.tab.c to pars0grm.c and pars0grm.tab.h to pars0grm.h.
+
+3. Copy pars0grm.h also to /innobase/include
+
+4. Do
+ flex pars0lex.l
+ That generates lex.yy.c.
+
+5. Rename lex.yy.c to lexyy.c.
+
+6. Remove the #include of unistd.h from about line 2500 of lexyy.c
+
+7. Add '#include "univ.i"' before #include <stdio.h> in lexyy.c
+ (Needed for AIX)
+
+These instructions seem to work at least with bison-1.28 and flex-2.5.4 on
+Linux.
*******************************************************/
%{
@@ -19,11 +48,10 @@ Created 12/14/1997 Heikki Tuuri
#define isatty(A) 0
#define malloc(A) mem_alloc(A)
#define free(A) mem_free(A)
-#define realloc(P, A) mem_realloc(P, A)
+#define realloc(P, A) mem_realloc(P, A, __FILE__, __LINE__)
#define exit(A) ut_a(0)
-#define YY_INPUT(buf, result, max_size) pars_get_lex_chars(buf, &result,\
- max_size)
+#define YY_INPUT(buf, result, max_size) pars_get_lex_chars(buf, &result, max_size)
%}
DIGIT [0-9]
diff --git a/innobase/pars/pars0opt.c b/innobase/pars/pars0opt.c
index dd0718ce946..91083e6fa16 100644
--- a/innobase/pars/pars0opt.c
+++ b/innobase/pars/pars0opt.c
@@ -373,7 +373,8 @@ opt_calc_index_goodness(
}
}
- if (index->type & DICT_CLUSTERED) {
+ /* We have to test for goodness here, as last_op may note be set */
+ if (goodness && index->type & DICT_CLUSTERED) {
goodness++;
}
diff --git a/innobase/rem/rem0cmp.c b/innobase/rem/rem0cmp.c
index c27af604d04..c50516dfc8b 100644
--- a/innobase/rem/rem0cmp.c
+++ b/innobase/rem/rem0cmp.c
@@ -104,7 +104,9 @@ cmp_types_are_equal(
if ((type1->mtype == DATA_VARCHAR && type2->mtype == DATA_CHAR)
|| (type1->mtype == DATA_CHAR && type2->mtype == DATA_VARCHAR)
|| (type1->mtype == DATA_FIXBINARY && type2->mtype == DATA_BINARY)
- || (type1->mtype == DATA_BINARY && type2->mtype == DATA_FIXBINARY)) {
+ || (type1->mtype == DATA_BINARY && type2->mtype == DATA_FIXBINARY)
+ || (type1->mtype == DATA_MYSQL && type2->mtype == DATA_VARMYSQL)
+ || (type1->mtype == DATA_VARMYSQL && type2->mtype == DATA_MYSQL)) {
return(TRUE);
}
@@ -124,14 +126,9 @@ cmp_types_are_equal(
return(FALSE);
}
- if (type1->mtype == DATA_MYSQL
- || type1->mtype == DATA_VARMYSQL) {
+ if (type1->mtype == DATA_INT && type1->len != type2->len) {
- if ((type1->prtype & ~DATA_NOT_NULL)
- != (type2->prtype & ~DATA_NOT_NULL)) {
-
- return(FALSE);
- }
+ return(FALSE);
}
return(TRUE);
diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c
index ed4df08fcf3..2e6dde6db65 100644
--- a/innobase/row/row0ins.c
+++ b/innobase/row/row0ins.c
@@ -392,6 +392,19 @@ row_ins_foreign_delete_or_set_null(
node = thr->run_node;
+ ut_a(que_node_get_type(node) == QUE_NODE_UPDATE);
+
+ if (!node->is_delete) {
+ /* According to SQL-92 an UPDATE with respect to FOREIGN
+ KEY constraints is not semantically equivalent to a
+ DELETE + INSERT. Therefore we do not perform any action
+ here and consequently the child rows would be left
+ orphaned if we would let the UPDATE happen. Thus we return
+ an error. */
+
+ return(DB_ROW_IS_REFERENCED);
+ }
+
if (node->cascade_node == NULL) {
/* Extend our query graph by creating a child to current
update node. The child is used in the cascade or set null
@@ -609,7 +622,7 @@ the caller must have a shared latch on dict_foreign_key_check_lock. */
ulint
row_ins_check_foreign_constraint(
/*=============================*/
- /* out: DB_SUCCESS, DB_LOCK_WAIT,
+ /* out: DB_SUCCESS,
DB_NO_REFERENCED_ROW,
or DB_ROW_IS_REFERENCED */
ibool check_ref,/* in: TRUE if we want to check that
@@ -627,6 +640,7 @@ row_ins_check_foreign_constraint(
dict_table_t* check_table;
dict_index_t* check_index;
ulint n_fields_cmp;
+ ibool timeout_expired;
rec_t* rec;
btr_pcur_t pcur;
ibool moved;
@@ -635,6 +649,7 @@ row_ins_check_foreign_constraint(
ulint i;
mtr_t mtr;
+run_again:
ut_ad(rw_lock_own(&dict_foreign_key_check_lock, RW_LOCK_SHARED));
if (thr_get_trx(thr)->check_foreigns == FALSE) {
@@ -682,7 +697,7 @@ row_ins_check_foreign_constraint(
if (err != DB_SUCCESS) {
- return(err);
+ goto do_possible_lock_wait;
}
}
@@ -727,6 +742,11 @@ row_ins_check_foreign_constraint(
if (!rec_get_deleted_flag(rec)) {
/* Found a matching record */
+/* printf(
+"FOREIGN: Found matching record from %s %s\n",
+ check_index->table_name, check_index->name);
+ rec_print(rec);
+*/
if (check_ref) {
err = DB_SUCCESS;
@@ -779,6 +799,22 @@ next_rec:
/* Restore old value */
dtuple_set_n_fields_cmp(entry, n_fields_cmp);
+do_possible_lock_wait:
+ if (err == DB_LOCK_WAIT) {
+ thr_get_trx(thr)->error_state = err;
+
+ que_thr_stop_for_mysql(thr);
+
+ timeout_expired = srv_suspend_mysql_thread(thr);
+
+ if (!timeout_expired) {
+
+ goto run_again;
+ }
+
+ err = DB_LOCK_WAIT_TIMEOUT;
+ }
+
return(err);
}
@@ -792,8 +828,7 @@ static
ulint
row_ins_check_foreign_constraints(
/*==============================*/
- /* out: DB_SUCCESS, DB_LOCK_WAIT, or error
- code */
+ /* out: DB_SUCCESS or error code */
dict_table_t* table, /* in: table */
dict_index_t* index, /* in: index */
dtuple_t* entry, /* in: index entry for index */
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index d6c8d7ab412..3ee458f43bf 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -595,6 +595,11 @@ row_lock_table_autoinc_for_mysql(
ut_ad(trx);
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
+ if (trx->auto_inc_lock) {
+
+ return(DB_SUCCESS);
+ }
+
trx->op_info = (char *) "setting auto-inc lock";
if (node == NULL) {
@@ -934,6 +939,7 @@ row_update_for_mysql(
ut_ad(!prebuilt->sql_stat_start);
que_thr_move_to_run_state_for_mysql(thr, trx);
+
run_again:
thr->run_node = node;
thr->prev_node = node;
@@ -998,7 +1004,6 @@ row_update_cascade_for_mysql(
trx_t* trx;
trx = thr_get_trx(thr);
-
run_again:
thr->run_node = node;
thr->prev_node = node;
@@ -1131,6 +1136,35 @@ row_mysql_recover_tmp_table(
}
/*************************************************************************
+Locks the data dictionary exclusively for performing a table create
+operation. */
+
+void
+row_mysql_lock_data_dictionary(void)
+/*================================*/
+{
+ /* Serialize data dictionary operations with dictionary mutex:
+ no deadlocks or lock waits can occur then in these operations */
+
+ rw_lock_x_lock(&(dict_foreign_key_check_lock));
+ mutex_enter(&(dict_sys->mutex));
+}
+
+/*************************************************************************
+Unlocks the data dictionary exclusively lock. */
+
+void
+row_mysql_unlock_data_dictionary(void)
+/*==================================*/
+{
+ /* Serialize data dictionary operations with dictionary mutex:
+ no deadlocks can occur then in these operations */
+
+ mutex_exit(&(dict_sys->mutex));
+ rw_lock_x_unlock(&(dict_foreign_key_check_lock));
+}
+
+/*************************************************************************
Does a table creation operation for MySQL. If the name of the created
table ends to characters INNODB_MONITOR, then this also starts
printing of monitor output by the master thread. */
@@ -1150,6 +1184,7 @@ row_create_table_for_mysql(
ulint err;
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
+ ut_ad(mutex_own(&(dict_sys->mutex)));
if (srv_created_new_raw || srv_force_recovery) {
fprintf(stderr,
@@ -1265,19 +1300,13 @@ row_create_table_for_mysql(
"to use this feature you must compile InnoDB with\n"
"UNIV_MEM_DEBUG defined in univ.i and the server must be\n"
"quiet because allocation from a mem heap is not protected\n"
- "by any semaphore.\n");
+ "by any semaphore.\n");
ut_a(mem_validate());
printf("Memory validated\n");
}
- /* Serialize data dictionary operations with dictionary mutex:
- no deadlocks can occur then in these operations */
-
- rw_lock_x_lock(&(dict_foreign_key_check_lock));
- mutex_enter(&(dict_sys->mutex));
-
heap = mem_heap_create(512);
trx->dict_operation = TRUE;
@@ -1327,9 +1356,6 @@ row_create_table_for_mysql(
trx->error_state = DB_SUCCESS;
}
- mutex_exit(&(dict_sys->mutex));
- rw_lock_x_unlock(&(dict_foreign_key_check_lock));
-
que_graph_free((que_t*) que_node_get_parent(thr));
trx->op_info = (char *) "";
@@ -1356,6 +1382,7 @@ row_create_index_for_mysql(
ulint keywordlen;
ulint err;
+ ut_ad(mutex_own(&(dict_sys->mutex)));
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
trx->op_info = (char *) "creating index";
@@ -1374,12 +1401,6 @@ row_create_index_for_mysql(
return(DB_SUCCESS);
}
- /* Serialize data dictionary operations with dictionary mutex:
- no deadlocks can occur then in these operations */
-
- rw_lock_x_lock(&(dict_foreign_key_check_lock));
- mutex_enter(&(dict_sys->mutex));
-
heap = mem_heap_create(512);
trx->dict_operation = TRUE;
@@ -1407,9 +1428,6 @@ row_create_index_for_mysql(
trx->error_state = DB_SUCCESS;
}
- mutex_exit(&(dict_sys->mutex));
- rw_lock_x_unlock(&(dict_foreign_key_check_lock));
-
que_graph_free((que_t*) que_node_get_parent(thr));
trx->op_info = (char *) "";
@@ -1443,6 +1461,7 @@ row_table_add_foreign_constraints(
ulint keywordlen;
ulint err;
+ ut_ad(mutex_own(&(dict_sys->mutex)));
ut_a(sql_string);
trx->op_info = (char *) "adding foreign keys";
@@ -1461,12 +1480,6 @@ row_table_add_foreign_constraints(
return(DB_SUCCESS);
}
- /* Serialize data dictionary operations with dictionary mutex:
- no deadlocks can occur then in these operations */
-
- rw_lock_x_lock(&(dict_foreign_key_check_lock));
- mutex_enter(&(dict_sys->mutex));
-
trx->dict_operation = TRUE;
err = dict_create_foreign_constraints(trx, sql_string, name);
@@ -1488,9 +1501,6 @@ row_table_add_foreign_constraints(
trx->error_state = DB_SUCCESS;
}
- mutex_exit(&(dict_sys->mutex));
- rw_lock_x_unlock(&(dict_foreign_key_check_lock));
-
return((int) err);
}
@@ -1922,6 +1932,13 @@ row_drop_table_for_mysql(
ut_a(0);
} else {
dict_table_remove_from_cache(table);
+
+ if (dict_load_table(name) != NULL) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+" InnoDB: Error: dropping of table %s failed!\n", name);
+
+ }
}
funct_exit:
rw_lock_s_unlock(&(purge_sys->purge_is_running));
@@ -1979,6 +1996,7 @@ loop:
if (table->n_mysql_handles_opened > 0) {
mutex_exit(&(dict_sys->mutex));
+ rw_lock_x_unlock(&(dict_foreign_key_check_lock));
ut_print_timestamp(stderr);
fprintf(stderr,
@@ -2409,6 +2427,14 @@ row_check_table_for_mysql(
index = dict_table_get_next_index(index);
}
+ /* We validate also the whole adaptive hash index for all tables
+ at every CHECK TABLE */
+
+ if (!btr_search_validate()) {
+
+ ret = DB_ERROR;
+ }
+
prebuilt->trx->op_info = (char *) "";
return(ret);
diff --git a/innobase/row/row0purge.c b/innobase/row/row0purge.c
index 1dca017c349..60e057b816e 100644
--- a/innobase/row/row0purge.c
+++ b/innobase/row/row0purge.c
@@ -511,6 +511,14 @@ row_purge_parse_undo_rec(
clust_index = dict_table_get_first_index(node->table);
+ if (clust_index == NULL) {
+ /* The table was corrupt in the data dictionary */
+
+ rw_lock_x_unlock(&(purge_sys->purge_is_running));
+
+ return(FALSE);
+ }
+
ptr = trx_undo_rec_get_row_ref(ptr, clust_index, &(node->ref),
node->heap);
diff --git a/innobase/row/row0umod.c b/innobase/row/row0umod.c
index 631f238a72d..b84e55ca643 100644
--- a/innobase/row/row0umod.c
+++ b/innobase/row/row0umod.c
@@ -437,11 +437,12 @@ row_undo_mod_del_unmark_sec(
rec_sprintf(err_buf, 900, btr_pcur_get_rec(&pcur));
fprintf(stderr, "InnoDB: record %s\n", err_buf);
+ trx_print(err_buf, thr_get_trx(thr));
fprintf(stderr,
- "InnoDB: Make a detailed bug report and send it\n");
+ "%s\nInnoDB: Make a detailed bug report and send it\n",
+ err_buf);
fprintf(stderr, "InnoDB: to mysql@lists.mysql.com\n");
- trx_print(thr_get_trx(thr));
} else {
btr_cur = btr_pcur_get_btr_cur(&pcur);
diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c
index 1d5319a182b..25c82f39da9 100644
--- a/innobase/row/row0upd.c
+++ b/innobase/row/row0upd.c
@@ -129,8 +129,7 @@ static
ulint
row_upd_check_references_constraints(
/*=================================*/
- /* out: DB_SUCCESS, DB_LOCK_WAIT, or an error
- code */
+ /* out: DB_SUCCESS or an error code */
btr_pcur_t* pcur, /* in: cursor positioned on a record; NOTE: the
cursor position is lost in this function! */
dict_table_t* table, /* in: table in question */
@@ -626,7 +625,7 @@ row_upd_index_parse(
/*******************************************************************
Returns TRUE if ext_vec contains i. */
-UNIV_INLINE
+static
ibool
upd_ext_vec_contains(
/*=================*/
@@ -738,6 +737,7 @@ row_upd_build_difference_binary(
ulint n_diff;
ulint roll_ptr_pos;
ulint trx_id_pos;
+ ibool extern_bit;
ulint i;
/* This function is used only for a clustered index */
@@ -763,9 +763,10 @@ row_upd_build_difference_binary(
goto skip_compare;
}
+
+ extern_bit = rec_get_nth_field_extern_bit(rec, i);
- if (rec_get_nth_field_extern_bit(rec, i)
- != upd_ext_vec_contains(ext_vec, n_ext_vec, i)
+ if (extern_bit != upd_ext_vec_contains(ext_vec, n_ext_vec, i)
|| !dfield_data_is_binary_equal(dfield, len, data)) {
upd_field = upd_get_nth_field(update, n_diff);
@@ -1094,11 +1095,12 @@ row_upd_sec_index_entry(
rec_sprintf(err_buf, 900, rec);
fprintf(stderr, "InnoDB: record %s\n", err_buf);
+ trx_print(err_buf, thr_get_trx(thr));
+
fprintf(stderr,
- "InnoDB: Make a detailed bug report and send it\n");
+ "%s\nInnoDB: Make a detailed bug report and send it\n",
+ err_buf);
fprintf(stderr, "InnoDB: to mysql@lists.mysql.com\n");
-
- trx_print(thr_get_trx(thr));
} else {
/* Delete mark the old index record; it can already be
delete marked if we return after a lock wait in
@@ -1362,7 +1364,7 @@ ulint
row_upd_del_mark_clust_rec(
/*=======================*/
/* out: DB_SUCCESS if operation successfully
- completed, else error code or DB_LOCK_WAIT */
+ completed, else error code */
upd_node_t* node, /* in: row update node */
dict_index_t* index, /* in: clustered index */
que_thr_t* thr, /* in: query thread */
@@ -1381,8 +1383,6 @@ row_upd_del_mark_clust_rec(
pcur = node->pcur;
btr_cur = btr_pcur_get_btr_cur(pcur);
- ut_ad(FALSE == rec_get_deleted_flag(btr_pcur_get_rec(pcur)));
-
/* Store row because we have to build also the secondary index
entries */
@@ -1391,11 +1391,11 @@ row_upd_del_mark_clust_rec(
/* Mark the clustered index record deleted; we do not have to check
locks, because we assume that we have an x-lock on the record */
- err = btr_cur_del_mark_set_clust_rec(BTR_NO_LOCKING_FLAG, btr_cur,
- TRUE, thr, mtr);
+ err = btr_cur_del_mark_set_clust_rec(BTR_NO_LOCKING_FLAG,
+ btr_cur, TRUE, thr, mtr);
if (err == DB_SUCCESS && check_ref) {
- /* NOTE that the following call loses
- the position of pcur ! */
+ /* NOTE that the following call loses the position of pcur ! */
+
err = row_upd_check_references_constraints(pcur, index->table,
index, thr, mtr);
if (err != DB_SUCCESS) {
diff --git a/innobase/row/row0vers.c b/innobase/row/row0vers.c
index 9508e73f45d..cd8b18e5e12 100644
--- a/innobase/row/row0vers.c
+++ b/innobase/row/row0vers.c
@@ -58,6 +58,7 @@ row_vers_impl_x_locked_off_kernel(
ibool rec_del;
ulint err;
mtr_t mtr;
+ char err_buf[1000];
ut_ad(mutex_own(&kernel_mutex));
ut_ad(!rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
@@ -74,7 +75,26 @@ row_vers_impl_x_locked_off_kernel(
clust_rec = row_get_clust_rec(BTR_SEARCH_LEAF, rec, index,
&clust_index, &mtr);
- ut_a(clust_rec);
+ if (!clust_rec) {
+ rec_sprintf(err_buf, 900, rec);
+
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+" InnoDB: Error: cannot find the clustered index record\n"
+"InnoDB: for a secondary index record in table %s index %s.\n"
+"InnoDB: Secondary index record %s.\n"
+"InnoDB: The table is probably corrupt. Please run CHECK TABLE on it.\n"
+"InnoDB: You can try to repair the table by dump + drop + reimport.\n"
+"InnoDB: Send a detailed bug report to mysql@lists.mysql.com.\n",
+ index->table_name, index->name, err_buf);
+ mutex_enter(&kernel_mutex);
+ mtr_commit(&mtr);
+
+ /* We assume there is no lock on the record, though this
+ is not certain because the table is apparently corrupt */
+
+ return(NULL);
+ }
trx_id = row_get_rec_trx_id(clust_rec, clust_index);
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index f366ce0d160..d0ac011e60f 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -61,7 +61,7 @@ ulint srv_activity_count = 0;
ibool srv_lock_timeout_and_monitor_active = FALSE;
ibool srv_error_monitor_active = FALSE;
-char* srv_main_thread_op_info = (char *) "";
+char* srv_main_thread_op_info = (char*) "";
/* Server parameters which are read from the initfile */
@@ -238,15 +238,14 @@ ulint srv_n_rows_updated_old = 0;
ulint srv_n_rows_deleted_old = 0;
ulint srv_n_rows_read_old = 0;
-ibool srv_print_innodb_monitor = FALSE;
-ibool srv_print_innodb_lock_monitor = FALSE;
-ibool srv_print_innodb_tablespace_monitor = FALSE;
-
/*
Set the following to 0 if you want InnoDB to write messages on
stderr on startup/shutdown
*/
ibool srv_print_verbose_log = TRUE;
+ibool srv_print_innodb_monitor = FALSE;
+ibool srv_print_innodb_lock_monitor = FALSE;
+ibool srv_print_innodb_tablespace_monitor = FALSE;
ibool srv_print_innodb_table_monitor = FALSE;
/* The parameters below are obsolete: */
@@ -278,6 +277,10 @@ i/o handler thread */
char* srv_io_thread_op_info[SRV_MAX_N_IO_THREADS];
+time_t srv_last_monitor_time;
+
+mutex_t srv_innodb_monitor_mutex;
+
/*
IMPLEMENTATION OF THE SERVER MAIN PROGRAM
=========================================
@@ -645,7 +648,7 @@ srv_release_threads(
slot = srv_table_get_nth_slot(i);
- if ((slot->type == type) && slot->suspended) {
+ if (slot->in_use && slot->type == type && slot->suspended) {
slot->suspended = FALSE;
@@ -987,7 +990,6 @@ srv_communication_init(
/*************************************************************************
Implements the recovery utility. */
-#ifdef NOT_USED
static
ulint
srv_recovery_thread(
@@ -1025,7 +1027,7 @@ srv_recovery_thread(
return(0);
}
-#endif
+
/*************************************************************************
Implements the purge utility. */
@@ -1077,7 +1079,6 @@ srv_create_utility_threads(void)
/*************************************************************************
Implements the communication threads. */
-#ifdef NOT_USED
static
ulint
srv_com_thread(
@@ -1125,7 +1126,7 @@ srv_com_thread(
return(0);
}
-#endif
+
/*************************************************************************
Creates the communication threads. */
@@ -1147,7 +1148,6 @@ srv_create_com_threads(void)
/*************************************************************************
Implements the worker threads. */
-#ifdef NOT_USED
static
ulint
srv_worker_thread(
@@ -1190,7 +1190,7 @@ srv_worker_thread(
return(0);
}
-#endif
+
/*************************************************************************
Creates the worker threads. */
@@ -1625,12 +1625,16 @@ srv_init(void)
kernel_mutex_temp = mem_alloc(sizeof(mutex_t));
mutex_create(&kernel_mutex);
mutex_set_level(&kernel_mutex, SYNC_KERNEL);
+
+ mutex_create(&srv_innodb_monitor_mutex);
+ mutex_set_level(&srv_innodb_monitor_mutex, SYNC_NO_ORDER_CHECK);
srv_sys->threads = mem_alloc(OS_THREAD_MAX_N * sizeof(srv_slot_t));
for (i = 0; i < OS_THREAD_MAX_N; i++) {
slot = srv_table_get_nth_slot(i);
slot->in_use = FALSE;
+ slot->type=0; /* Avoid purify errors */
slot->event = os_event_create(NULL);
ut_a(slot->event);
}
@@ -1640,6 +1644,7 @@ srv_init(void)
for (i = 0; i < OS_THREAD_MAX_N; i++) {
slot = srv_mysql_table + i;
slot->in_use = FALSE;
+ slot->type = 0;
slot->event = os_event_create(NULL);
ut_a(slot->event);
}
@@ -1899,8 +1904,6 @@ srv_conc_exit_innodb(
trx_t* trx) /* in: transaction object associated with the
thread */
{
- srv_conc_slot_t* slot = NULL;
-
if (srv_thread_concurrency >= 500) {
return;
@@ -2004,7 +2007,31 @@ srv_table_reserve_slot_for_mysql(void)
while (slot->in_use) {
i++;
- ut_a(i < OS_THREAD_MAX_N);
+
+ if (i >= OS_THREAD_MAX_N) {
+
+ ut_print_timestamp(stderr);
+
+ fprintf(stderr,
+" InnoDB: There appear to be %lu MySQL threads currently waiting\n"
+"InnoDB: inside InnoDB, which is the upper limit. Cannot continue operation.\n"
+"InnoDB: We intentionally generate a seg fault to print a stack trace\n"
+"InnoDB: on Linux. But first we print a list of waiting threads.\n", i);
+
+ for (i = 0; i < OS_THREAD_MAX_N; i++) {
+
+ slot = srv_mysql_table + i;
+
+ fprintf(stderr,
+"Slot %lu: thread id %lu, type %lu, in use %lu, susp %lu, time %lu\n",
+ i, os_thread_pf(slot->id),
+ slot->type, slot->in_use,
+ slot->suspended,
+ (ulint)difftime(ut_time(), slot->suspend_time));
+ }
+
+ ut_a(0);
+ }
slot = srv_mysql_table + i;
}
@@ -2141,104 +2168,148 @@ srv_release_mysql_thread_if_suspended(
/* not found */
}
-/*************************************************************************
-A thread which wakes up threads whose lock wait may have lasted too long.
-This also prints the info output by various InnoDB monitors. */
-
-#ifndef __WIN__
-void*
-#else
-ulint
-#endif
-srv_lock_timeout_and_monitor_thread(
-/*================================*/
- /* out: a dummy parameter */
- void* arg) /* in: a dummy parameter required by
- os_thread_create */
+/**********************************************************************
+Refreshes the values used to calculate per-second averages. */
+static
+void
+srv_refresh_innodb_monitor_stats(void)
+/*==================================*/
{
- srv_slot_t* slot;
- double time_elapsed;
- time_t current_time;
- time_t last_monitor_time;
- time_t last_table_monitor_time;
- ibool some_waits;
- double wait_time;
- ulint i;
+ mutex_enter(&srv_innodb_monitor_mutex);
- UT_NOT_USED(arg);
- last_monitor_time = time(NULL);
- last_table_monitor_time = time(NULL);
-loop:
- srv_lock_timeout_and_monitor_active = TRUE;
+ srv_last_monitor_time = time(NULL);
- /* When someone is waiting for a lock, we wake up every second
- and check if a timeout has passed for a lock wait */
+ os_aio_refresh_stats();
- os_thread_sleep(1000000);
+ btr_cur_n_sea_old = btr_cur_n_sea;
+ btr_cur_n_non_sea_old = btr_cur_n_non_sea;
- /* In case mutex_exit is not a memory barrier, it is
- theoretically possible some threads are left waiting though
- the semaphore is already released. Wake up those threads: */
+ log_refresh_stats();
- sync_arr_wake_threads_if_sema_free();
+ buf_refresh_io_stats();
+
+ srv_n_rows_inserted_old = srv_n_rows_inserted;
+ srv_n_rows_updated_old = srv_n_rows_updated;
+ srv_n_rows_deleted_old = srv_n_rows_deleted;
+ srv_n_rows_read_old = srv_n_rows_read;
+
+ mutex_exit(&srv_innodb_monitor_mutex);
+}
+
+/**********************************************************************
+Sprintfs to a buffer the output of the InnoDB Monitor. */
+
+void
+srv_sprintf_innodb_monitor(
+/*=======================*/
+ char* buf, /* in/out: buffer which must be at least 4 kB */
+ ulint len) /* in: length of the buffer */
+{
+ char* buf_end = buf + len - 2000;
+ double time_elapsed;
+ time_t current_time;
+
+ mutex_enter(&srv_innodb_monitor_mutex);
current_time = time(NULL);
- time_elapsed = difftime(current_time, last_monitor_time);
+ /* We add 0.001 seconds to time_elapsed to prevent division
+ by zero if two users happen to call SHOW INNODB STATUS at the same
+ time */
- if (time_elapsed > 15) {
+ time_elapsed = difftime(current_time, srv_last_monitor_time)
+ + 0.001;
- if (srv_print_innodb_monitor) {
+ srv_last_monitor_time = time(NULL);
- last_monitor_time = time(NULL);
-
- printf("=====================================\n");
- ut_print_timestamp(stdout);
+ ut_a(len >= 4096);
+
+ buf += sprintf(buf, "\n=====================================\n");
+
+ ut_sprintf_timestamp(buf);
+ buf = buf + strlen(buf);
+ ut_a(buf < buf_end + 1500);
- printf(" INNODB MONITOR OUTPUT\n"
+ buf += sprintf(buf, " INNODB MONITOR OUTPUT\n"
"=====================================\n");
- printf("----------\n"
+
+ buf += sprintf(buf,
+"Per second averages calculated from the last %lu seconds\n",
+ (ulint)time_elapsed);
+
+ buf += sprintf(buf, "----------\n"
"SEMAPHORES\n"
"----------\n");
- sync_print();
- printf("------------\n"
+ sync_print(buf, buf_end);
+
+ buf = buf + strlen(buf);
+ ut_a(buf < buf_end + 1500);
+
+ buf += sprintf(buf, "------------\n"
"TRANSACTIONS\n"
"------------\n");
- lock_print_info();
- printf("--------\n"
+ lock_print_info(buf, buf_end);
+ buf = buf + strlen(buf);
+
+ buf += sprintf(buf, "--------\n"
"FILE I/O\n"
"--------\n");
- os_aio_print();
- printf("-------------\n"
- "INSERT BUFFER\n"
- "-------------\n");
- ibuf_print();
- printf("---\n"
+ os_aio_print(buf, buf_end);
+ buf = buf + strlen(buf);
+ ut_a(buf < buf_end + 1500);
+
+ buf += sprintf(buf, "-------------------------------------\n"
+ "INSERT BUFFER AND ADAPTIVE HASH INDEX\n"
+ "-------------------------------------\n");
+ ibuf_print(buf, buf_end);
+ buf = buf + strlen(buf);
+ ut_a(buf < buf_end + 1500);
+
+ ha_print_info(buf, buf_end, btr_search_sys->hash_index);
+ buf = buf + strlen(buf);
+ ut_a(buf < buf_end + 1500);
+
+ buf += sprintf(buf,
+ "%.2f hash searches/s, %.2f non-hash searches/s\n",
+ (btr_cur_n_sea - btr_cur_n_sea_old)
+ / time_elapsed,
+ (btr_cur_n_non_sea - btr_cur_n_non_sea_old)
+ / time_elapsed);
+ btr_cur_n_sea_old = btr_cur_n_sea;
+ btr_cur_n_non_sea_old = btr_cur_n_non_sea;
+
+ buf += sprintf(buf,"---\n"
"LOG\n"
"---\n");
- log_print();
- printf("----------------------\n"
+ log_print(buf, buf_end);
+ buf = buf + strlen(buf);
+ ut_a(buf < buf_end + 1500);
+
+ buf += sprintf(buf, "----------------------\n"
"BUFFER POOL AND MEMORY\n"
"----------------------\n");
- printf(
+ buf += sprintf(buf,
"Total memory allocated %lu; in additional pool allocated %lu\n",
ut_total_allocated_memory,
mem_pool_get_reserved(mem_comm_pool));
- buf_print_io();
- printf("--------------\n"
+ buf_print_io(buf, buf_end);
+ buf = buf + strlen(buf);
+ ut_a(buf < buf_end + 1500);
+
+ buf += sprintf(buf, "--------------\n"
"ROW OPERATIONS\n"
"--------------\n");
- printf(
+ buf += sprintf(buf,
"%ld queries inside InnoDB, %ld queries in queue; main thread: %s\n",
srv_conc_n_threads, srv_conc_n_waiting_threads,
srv_main_thread_op_info);
- printf(
+ buf += sprintf(buf,
"Number of rows inserted %lu, updated %lu, deleted %lu, read %lu\n",
srv_n_rows_inserted,
srv_n_rows_updated,
srv_n_rows_deleted,
srv_n_rows_read);
- printf(
+ buf += sprintf(buf,
"%.2f inserts/s, %.2f updates/s, %.2f deletes/s, %.2f reads/s\n",
(srv_n_rows_inserted - srv_n_rows_inserted_old)
/ time_elapsed,
@@ -2249,14 +2320,80 @@ loop:
(srv_n_rows_read - srv_n_rows_read_old)
/ time_elapsed);
- srv_n_rows_inserted_old = srv_n_rows_inserted;
- srv_n_rows_updated_old = srv_n_rows_updated;
- srv_n_rows_deleted_old = srv_n_rows_deleted;
- srv_n_rows_read_old = srv_n_rows_read;
+ srv_n_rows_inserted_old = srv_n_rows_inserted;
+ srv_n_rows_updated_old = srv_n_rows_updated;
+ srv_n_rows_deleted_old = srv_n_rows_deleted;
+ srv_n_rows_read_old = srv_n_rows_read;
- printf("----------------------------\n"
+ buf += sprintf(buf, "----------------------------\n"
"END OF INNODB MONITOR OUTPUT\n"
"============================\n");
+ ut_a(buf < buf_end + 1900);
+
+ mutex_exit(&srv_innodb_monitor_mutex);
+}
+
+/*************************************************************************
+A thread which wakes up threads whose lock wait may have lasted too long.
+This also prints the info output by various InnoDB monitors. */
+
+#ifndef __WIN__
+void*
+#else
+ulint
+#endif
+srv_lock_timeout_and_monitor_thread(
+/*================================*/
+ /* out: a dummy parameter */
+ void* arg) /* in: a dummy parameter required by
+ os_thread_create */
+{
+ srv_slot_t* slot;
+ double time_elapsed;
+ time_t current_time;
+ time_t last_table_monitor_time;
+ time_t last_monitor_time;
+ ibool some_waits;
+ double wait_time;
+ char* buf;
+ ulint i;
+
+ UT_NOT_USED(arg);
+ srv_last_monitor_time = time(NULL);
+ last_table_monitor_time = time(NULL);
+ last_monitor_time = time(NULL);
+loop:
+ srv_lock_timeout_and_monitor_active = TRUE;
+
+ /* When someone is waiting for a lock, we wake up every second
+ and check if a timeout has passed for a lock wait */
+
+ os_thread_sleep(1000000);
+
+ /* In case mutex_exit is not a memory barrier, it is
+ theoretically possible some threads are left waiting though
+ the semaphore is already released. Wake up those threads: */
+
+ sync_arr_wake_threads_if_sema_free();
+
+ current_time = time(NULL);
+
+ time_elapsed = difftime(current_time, last_monitor_time);
+
+ if (time_elapsed > 15) {
+ last_monitor_time = time(NULL);
+
+ if (srv_print_innodb_monitor) {
+
+ buf = mem_alloc(100000);
+
+ srv_sprintf_innodb_monitor(buf, 90000);
+
+ ut_a(strlen(buf) < 99000);
+
+ printf("%s", buf);
+
+ mem_free(buf);
}
if (srv_print_innodb_tablespace_monitor
@@ -2383,12 +2520,30 @@ srv_error_monitor_thread(
void* arg) /* in: a dummy parameter required by
os_thread_create */
{
+ ulint cnt = 0;
+
UT_NOT_USED(arg);
loop:
srv_error_monitor_active = TRUE;
- os_thread_sleep(10000000);
+ cnt++;
+
+ os_thread_sleep(2000000);
+
+ if (difftime(time(NULL), srv_last_monitor_time) > 60) {
+ /* We referesh InnoDB Monitor values so that averages are
+ printed from at most 60 last seconds */
+ srv_refresh_innodb_monitor_stats();
+ }
+
+/* mem_print_new_info();
+
+ if (cnt % 10 == 0) {
+
+ mem_print_info();
+ }
+*/
sync_array_print_long_waits();
/* Flush stdout and stderr so that a database user gets their output
@@ -2491,7 +2646,7 @@ srv_master_thread(
os_event_set(srv_sys->operational);
loop:
- srv_main_thread_op_info = (char *) "reserving kernel mutex";
+ srv_main_thread_op_info = (char*) "reserving kernel mutex";
n_ios_very_old = log_sys->n_log_ios + buf_pool->n_pages_read
+ buf_pool->n_pages_written;
@@ -2507,18 +2662,19 @@ loop:
for (i = 0; i < 10; i++) {
n_ios_old = log_sys->n_log_ios + buf_pool->n_pages_read
+ buf_pool->n_pages_written;
- srv_main_thread_op_info = (char *) "sleeping";
+ srv_main_thread_op_info = (char*)"sleeping";
os_thread_sleep(1000000);
/* ALTER TABLE in MySQL requires on Unix that the table handler
can drop tables lazily after there no longer are SELECT
queries to them. */
- srv_main_thread_op_info = "doing background drop tables";
+ srv_main_thread_op_info =
+ (char*)"doing background drop tables";
row_drop_tables_for_mysql_in_background();
- srv_main_thread_op_info = "";
+ srv_main_thread_op_info = (char*)"";
if (srv_force_recovery >= SRV_FORCE_NO_BACKGROUND) {
@@ -2529,8 +2685,9 @@ loop:
is issued or the we have specified in my.cnf no flush
at transaction commit */
- srv_main_thread_op_info = (char *) "flushing log";
+ srv_main_thread_op_info = (char*)"flushing log";
log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP);
+ log_flush_to_disk();
/* If there were less than 10 i/os during the
one second sleep, we assume that there is free
@@ -2543,11 +2700,13 @@ loop:
+ buf_pool->n_pages_written;
if (n_pend_ios < 3 && (n_ios - n_ios_old < 10)) {
srv_main_thread_op_info =
- (char *) "doing insert buffer merge";
+ (char*)"doing insert buffer merge";
ibuf_contract_for_n_pages(TRUE, 5);
- srv_main_thread_op_info = (char *) "flushing log";
+ srv_main_thread_op_info =
+ (char*)"flushing log";
log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP);
+ log_flush_to_disk();
}
if (srv_fast_shutdown && srv_shutdown_state > 0) {
@@ -2583,21 +2742,23 @@ loop:
+ buf_pool->n_pages_written;
if (n_pend_ios < 3 && (n_ios - n_ios_very_old < 200)) {
- srv_main_thread_op_info =(char *) "flushing buffer pool pages";
+ srv_main_thread_op_info = (char*) "flushing buffer pool pages";
buf_flush_batch(BUF_FLUSH_LIST, 50, ut_dulint_max);
- srv_main_thread_op_info = (char *) "flushing log";
+ srv_main_thread_op_info = (char*) "flushing log";
log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP);
+ log_flush_to_disk();
}
/* We run a batch of insert buffer merge every 10 seconds,
even if the server were active */
- srv_main_thread_op_info = (char *) "doing insert buffer merge";
+ srv_main_thread_op_info = (char*)"doing insert buffer merge";
ibuf_contract_for_n_pages(TRUE, 5);
- srv_main_thread_op_info = (char *) "flushing log";
+ srv_main_thread_op_info = (char*)"flushing log";
log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP);
+ log_flush_to_disk();
/* We run a full purge every 10 seconds, even if the server
were active */
@@ -2613,15 +2774,16 @@ loop:
goto background_loop;
}
- srv_main_thread_op_info = (char *) "purging";
+ srv_main_thread_op_info = (char*)"purging";
n_pages_purged = trx_purge();
current_time = time(NULL);
if (difftime(current_time, last_flush_time) > 1) {
- srv_main_thread_op_info = (char *) "flushing log";
+ srv_main_thread_op_info = (char*) "flushing log";
log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP);
+ log_flush_to_disk();
last_flush_time = current_time;
}
}
@@ -2630,25 +2792,25 @@ background_loop:
/* In this loop we run background operations when the server
is quiet and we also come here about once in 10 seconds */
- srv_main_thread_op_info = "doing background drop tables";
+ srv_main_thread_op_info = (char*)"doing background drop tables";
n_tables_to_drop = row_drop_tables_for_mysql_in_background();
- srv_main_thread_op_info = "";
+ srv_main_thread_op_info = (char*)"";
- srv_main_thread_op_info = "flushing buffer pool pages";
+ srv_main_thread_op_info = (char*)"flushing buffer pool pages";
/* Flush a few oldest pages to make the checkpoint younger */
n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 10, ut_dulint_max);
- srv_main_thread_op_info = "making checkpoint";
+ srv_main_thread_op_info = (char*)"making checkpoint";
/* Make a new checkpoint about once in 10 seconds */
log_checkpoint(TRUE, FALSE);
- srv_main_thread_op_info = (char *) "reserving kernel mutex";
+ srv_main_thread_op_info = (char*)"reserving kernel mutex";
mutex_enter(&kernel_mutex);
if (srv_activity_count != old_activity_count) {
@@ -2661,11 +2823,11 @@ background_loop:
/* The server has been quiet for a while: start running background
operations */
- srv_main_thread_op_info = (char *) "purging";
+ srv_main_thread_op_info = (char*)"purging";
n_pages_purged = trx_purge();
- srv_main_thread_op_info = (char *) "reserving kernel mutex";
+ srv_main_thread_op_info = (char*)"reserving kernel mutex";
mutex_enter(&kernel_mutex);
if (srv_activity_count != old_activity_count) {
@@ -2674,10 +2836,10 @@ background_loop:
}
mutex_exit(&kernel_mutex);
- srv_main_thread_op_info = (char *) "doing insert buffer merge";
+ srv_main_thread_op_info = (char*)"doing insert buffer merge";
n_bytes_merged = ibuf_contract_for_n_pages(TRUE, 20);
- srv_main_thread_op_info = (char *) "reserving kernel mutex";
+ srv_main_thread_op_info = (char*)"reserving kernel mutex";
mutex_enter(&kernel_mutex);
if (srv_activity_count != old_activity_count) {
@@ -2686,10 +2848,10 @@ background_loop:
}
mutex_exit(&kernel_mutex);
- srv_main_thread_op_info = (char *) "flushing buffer pool pages";
+ srv_main_thread_op_info = (char*)"flushing buffer pool pages";
n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 100, ut_dulint_max);
- srv_main_thread_op_info = (char *) "reserving kernel mutex";
+ srv_main_thread_op_info = (char*)"reserving kernel mutex";
mutex_enter(&kernel_mutex);
if (srv_activity_count != old_activity_count) {
@@ -2698,15 +2860,14 @@ background_loop:
}
mutex_exit(&kernel_mutex);
- srv_main_thread_op_info =
- (char *) "waiting for buffer pool flush to end";
+ srv_main_thread_op_info = (char*) "waiting for buffer pool flush to end";
buf_flush_wait_batch_end(BUF_FLUSH_LIST);
- srv_main_thread_op_info = (char *) "making checkpoint";
+ srv_main_thread_op_info = (char*)"making checkpoint";
log_checkpoint(TRUE, FALSE);
- srv_main_thread_op_info = (char *) "reserving kernel mutex";
+ srv_main_thread_op_info = (char*)"reserving kernel mutex";
mutex_enter(&kernel_mutex);
if (srv_activity_count != old_activity_count) {
@@ -2716,7 +2877,7 @@ background_loop:
mutex_exit(&kernel_mutex);
srv_main_thread_op_info =
- (char *) "archiving log (if log archive is on)";
+ (char*)"archiving log (if log archive is on)";
log_archive_do(FALSE, &n_bytes_archived);
@@ -2742,7 +2903,7 @@ background_loop:
master thread to wait for more server activity */
suspend_thread:
- srv_main_thread_op_info = (char *) "suspending";
+ srv_main_thread_op_info = (char*)"suspending";
mutex_enter(&kernel_mutex);
@@ -2756,7 +2917,7 @@ suspend_thread:
mutex_exit(&kernel_mutex);
- srv_main_thread_op_info = (char *) "waiting for server activity";
+ srv_main_thread_op_info = (char*)"waiting for server activity";
os_event_wait(event);
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index fa4f4bc9419..dfa122b2ece 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -74,6 +74,12 @@ ulint ios;
ulint n[SRV_MAX_N_IO_THREADS + 5];
os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 5];
+/* We use this mutex to test the return value of pthread_mutex_trylock
+ on successful locking. HP-UX does NOT return 0, though Linux et al do. */
+os_fast_mutex_t srv_os_test_mutex;
+
+ibool srv_os_test_mutex_is_locked = FALSE;
+
#define SRV_N_PENDING_IOS_PER_THREAD OS_AIO_N_PENDING_IOS_PER_THREAD
#define SRV_MAX_N_PENDING_SYNC_IOS 100
@@ -433,8 +439,7 @@ Normalizes a directory path for Windows: converts slashes to backslashes. */
void
srv_normalize_path_for_win(
/*=======================*/
- char* str __attribute__((unused)))
- /* in/out: null-terminated character string */
+ char* str __attribute__((unused))) /* in/out: null-terminated character string */
{
#ifdef __WIN__
ulint i;
@@ -619,8 +624,7 @@ open_or_create_log_file(
if (k == 0 && i == 0) {
arch_space_id = 2 * k + 1 + SRV_LOG_SPACE_FIRST_ID;
- fil_space_create((char *) "arch_log_space", arch_space_id,
- FIL_LOG);
+ fil_space_create((char*) "arch_log_space", arch_space_id, FIL_LOG);
} else {
arch_space_id = ULINT_UNDEFINED;
}
@@ -839,7 +843,6 @@ open_or_create_data_files(
/*********************************************************************
This thread is used to measure contention of latches. */
-#ifdef NOT_USED
static
ulint
test_measure_cont(
@@ -899,7 +902,7 @@ test_measure_cont(
"Mutex res. l %lu, p %lu, k %lu s x %lu s s %lu s mut %lu of %lu\n",
lcount, pcount, kcount, s_xcount, s_scount, s_mcount, j);
- sync_print_wait_info();
+/* sync_print_wait_info(); */
fprintf(stderr,
"log i/o %lu n non sea %lu n succ %lu n h fail %lu\n",
@@ -909,7 +912,7 @@ test_measure_cont(
return(0);
}
-#endif
+
/********************************************************************
Starts InnoDB and creates a new database if database files
are not found and the user wants. Server parameters are
@@ -930,32 +933,51 @@ innobase_start_or_create_for_mysql(void)
ulint max_arch_log_no;
ibool start_archive;
ulint sum_of_new_sizes;
+ ulint sum_of_data_file_sizes;
+ ulint tablespace_size_in_header;
ulint err;
ulint i;
ulint k;
mtr_t mtr;
+#ifdef UNIV_DEBUG
+ fprintf(stderr,
+"InnoDB: !!!!!!!!!!!!!! UNIV_DEBUG switched on !!!!!!!!!!!!!!!\n");
+#endif
+
+#ifdef UNIV_SYNC_DEBUG
+ fprintf(stderr,
+"InnoDB: !!!!!!!!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!!!!!!!\n");
+#endif
+
+#ifdef UNIV_SEARCH_DEBUG
+ fprintf(stderr,
+"InnoDB: !!!!!!!!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!!!!!!!\n");
+#endif
+
+#ifdef UNIV_MEM_DEBUG
+ fprintf(stderr,
+"InnoDB: !!!!!!!!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!!!!!!!\n");
+#endif
+
log_do_write = TRUE;
/* yydebug = TRUE; */
srv_is_being_started = TRUE;
srv_startup_is_before_trx_rollback_phase = TRUE;
- if (0 == ut_strcmp(srv_unix_file_flush_method_str,
- (char *) "fdatasync")) {
- srv_unix_file_flush_method = SRV_UNIX_FDATASYNC;
+ if (0 == ut_strcmp(srv_unix_file_flush_method_str, "fdatasync")) {
+ srv_unix_file_flush_method = SRV_UNIX_FDATASYNC;
- } else if (0 == ut_strcmp(srv_unix_file_flush_method_str,
- (char *) "O_DSYNC")) {
- srv_unix_file_flush_method = SRV_UNIX_O_DSYNC;
+ } else if (0 == ut_strcmp(srv_unix_file_flush_method_str, "O_DSYNC")) {
+ srv_unix_file_flush_method = SRV_UNIX_O_DSYNC;
} else if (0 == ut_strcmp(srv_unix_file_flush_method_str,
- (char *) "littlesync")) {
- srv_unix_file_flush_method = SRV_UNIX_LITTLESYNC;
+ "littlesync")) {
+ srv_unix_file_flush_method = SRV_UNIX_LITTLESYNC;
- } else if (0 == ut_strcmp(srv_unix_file_flush_method_str,
- (char *) "nosync")) {
- srv_unix_file_flush_method = SRV_UNIX_NOSYNC;
+ } else if (0 == ut_strcmp(srv_unix_file_flush_method_str, "nosync")) {
+ srv_unix_file_flush_method = SRV_UNIX_NOSYNC;
} else {
fprintf(stderr,
"InnoDB: Unrecognized value %s for innodb_flush_method\n",
@@ -1005,7 +1027,7 @@ innobase_start_or_create_for_mysql(void)
os_aio_use_native_aio = FALSE;
if (!os_aio_use_native_aio) {
- os_aio_init(4 * SRV_N_PENDING_IOS_PER_THREAD
+ os_aio_init(8 * SRV_N_PENDING_IOS_PER_THREAD
* srv_n_file_io_threads,
srv_n_file_io_threads,
SRV_MAX_N_PENDING_SYNC_IOS);
@@ -1310,7 +1332,49 @@ innobase_start_or_create_for_mysql(void)
os_thread_create(&srv_master_thread, NULL, thread_ids + 1 +
SRV_MAX_N_IO_THREADS);
/* buf_debug_prints = TRUE; */
+
+ sum_of_data_file_sizes = 0;
+ for (i = 0; i < srv_n_data_files; i++) {
+ sum_of_data_file_sizes += srv_data_file_sizes[i];
+ }
+
+ tablespace_size_in_header = fsp_header_get_tablespace_size(0);
+
+ if (!srv_auto_extend_last_data_file
+ && sum_of_data_file_sizes != tablespace_size_in_header) {
+
+ fprintf(stderr,
+"InnoDB: Error: tablespace size stored in header is %lu pages, but\n"
+"InnoDB: the sum of data file sizes is %lu pages\n",
+ tablespace_size_in_header, sum_of_data_file_sizes);
+ }
+
+ if (srv_auto_extend_last_data_file
+ && sum_of_data_file_sizes < tablespace_size_in_header) {
+
+ fprintf(stderr,
+"InnoDB: Error: tablespace size stored in header is %lu pages, but\n"
+"InnoDB: the sum of data file sizes is only %lu pages\n",
+ tablespace_size_in_header, sum_of_data_file_sizes);
+ }
+
+ /* Check that os_fast_mutexes work as exptected */
+ os_fast_mutex_init(&srv_os_test_mutex);
+
+ if (0 != os_fast_mutex_trylock(&srv_os_test_mutex)) {
+ fprintf(stderr,
+"InnoDB: Error: pthread_mutex_trylock returns an unexpected value on\n"
+ "InnoDB: success! Cannot continue.\n");
+ exit(1);
+ }
+
+ os_fast_mutex_unlock(&srv_os_test_mutex);
+
+ os_fast_mutex_lock(&srv_os_test_mutex);
+
+ os_fast_mutex_unlock(&srv_os_test_mutex);
+
if (srv_print_verbose_log)
{
ut_print_timestamp(stderr);
@@ -1350,8 +1414,15 @@ innobase_shutdown_for_mysql(void)
"InnoDB: inside InnoDB at shutdown\n",
srv_conc_n_threads);
}
-
- ut_free_all_mem();
-
+
+ /*
+ TODO: We should exit the i/o-handler and other utility threads
+ before freeing all memory. Now this can potentially cause a seg
+ fault!
+ */
+#ifdef NOT_WORKING_YET
+ ut_free_all_mem();
+#endif
+
return((int) DB_SUCCESS);
}
diff --git a/innobase/sync/sync0arr.c b/innobase/sync/sync0arr.c
index 4487fa72995..4d14c32b1ae 100644
--- a/innobase/sync/sync0arr.c
+++ b/innobase/sync/sync0arr.c
@@ -441,7 +441,8 @@ static
void
sync_array_cell_print(
/*==================*/
- FILE* file, /* in: file where to print */
+ char* buf, /* in: buffer where to print, must be
+ at least 400 characters */
sync_cell_t* cell) /* in: sync cell */
{
mutex_t* mutex;
@@ -451,9 +452,9 @@ sync_array_cell_print(
type = cell->request_type;
- fprintf(file,
+ buf += sprintf(buf,
"--Thread %lu has waited at %s line %lu for %.2f seconds the semaphore:\n",
- (ulint)cell->thread, cell->file, cell->line,
+ os_thread_pf(cell->thread), cell->file, cell->line,
difftime(time(NULL), cell->reservation_time));
if (type == SYNC_MUTEX) {
@@ -461,54 +462,58 @@ sync_array_cell_print(
been freed meanwhile */
mutex = cell->old_wait_mutex;
- fprintf(file,
+ buf += sprintf(buf,
"Mutex at %lx created file %s line %lu, lock var %lu\n",
(ulint)mutex, mutex->cfile_name, mutex->cline,
mutex->lock_word);
- fprintf(file,
+ buf += sprintf(buf,
"Last time reserved in file %s line %lu, waiters flag %lu\n",
mutex->file_name, mutex->line, mutex->waiters);
} else if (type == RW_LOCK_EX || type == RW_LOCK_SHARED) {
if (type == RW_LOCK_EX) {
- fprintf(file, "X-lock on");
+ buf += sprintf(buf, "X-lock on");
} else {
- fprintf(file, "S-lock on");
+ buf += sprintf(buf, "S-lock on");
}
rwlock = cell->old_wait_rw_lock;
- fprintf(file, " RW-latch at %lx created in file %s line %lu\n",
+ buf += sprintf(buf,
+ " RW-latch at %lx created in file %s line %lu\n",
(ulint)rwlock, rwlock->cfile_name, rwlock->cline);
if (rwlock->writer != RW_LOCK_NOT_LOCKED) {
- fprintf(file,
+ buf += sprintf(buf,
"a writer (thread id %lu) has reserved it in mode",
- (ulint)rwlock->writer_thread);
+ os_thread_pf(rwlock->writer_thread));
if (rwlock->writer == RW_LOCK_EX) {
- fprintf(file, " exclusive\n");
+ buf += sprintf(buf, " exclusive\n");
} else {
- fprintf(file, " wait exclusive\n");
+ buf += sprintf(buf, " wait exclusive\n");
}
}
- fprintf(file, "number of readers %lu, waiters flag %lu\n",
+ buf += sprintf(buf,
+ "number of readers %lu, waiters flag %lu\n",
rwlock->reader_count, rwlock->waiters);
- fprintf(file, "Last time read locked in file %s line %lu\n",
+ buf += sprintf(buf,
+ "Last time read locked in file %s line %lu\n",
rwlock->last_s_file_name, rwlock->last_s_line);
- fprintf(file, "Last time write locked in file %s line %lu\n",
+ buf += sprintf(buf,
+ "Last time write locked in file %s line %lu\n",
rwlock->last_x_file_name, rwlock->last_x_line);
} else {
ut_error;
}
if (!cell->waiting) {
- fprintf(file, "wait has ended\n");
+ buf += sprintf(buf, "wait has ended\n");
}
if (cell->event_set) {
- fprintf(file, "wait is ending\n");
+ buf += sprintf(buf, "wait is ending\n");
}
}
@@ -530,8 +535,8 @@ sync_array_find_thread(
cell = sync_array_get_nth_cell(arr, i);
- if ((cell->wait_object != NULL)
- && (cell->thread == thread)) {
+ if (cell->wait_object != NULL
+ && os_thread_eq(cell->thread, thread)) {
return(cell); /* Found */
}
@@ -610,6 +615,7 @@ sync_array_detect_deadlock(
os_thread_id_t thread;
ibool ret;
rw_lock_debug_t* debug;
+ char buf[500];
ut_a(arr && start && cell);
ut_ad(cell->wait_object);
@@ -642,11 +648,12 @@ sync_array_detect_deadlock(
ret = sync_array_deadlock_step(arr, start, thread, 0,
depth);
if (ret) {
+ sync_array_cell_print(buf, cell);
printf(
- "Mutex %lx owned by thread %lu file %s line %lu\n",
- (ulint)mutex, mutex->thread_id,
- mutex->file_name, mutex->line);
- sync_array_cell_print(stdout, cell);
+ "Mutex %lx owned by thread %lu file %s line %lu\n%s",
+ (ulint)mutex, os_thread_pf(mutex->thread_id),
+ mutex->file_name, mutex->line, buf);
+
return(TRUE);
}
}
@@ -664,9 +671,9 @@ sync_array_detect_deadlock(
thread = debug->thread_id;
if (((debug->lock_type == RW_LOCK_EX)
- && (thread != cell->thread))
+ && !os_thread_eq(thread, cell->thread))
|| ((debug->lock_type == RW_LOCK_WAIT_EX)
- && (thread != cell->thread))
+ && !os_thread_eq(thread, cell->thread))
|| (debug->lock_type == RW_LOCK_SHARED)) {
/* The (wait) x-lock request can block infinitely
@@ -678,9 +685,9 @@ sync_array_detect_deadlock(
debug->pass,
depth);
if (ret) {
- printf("rw-lock %lx ", (ulint) lock);
+ sync_array_cell_print(buf, cell);
+ printf("rw-lock %lx %s ", (ulint) lock, buf);
rw_lock_debug_print(debug);
- sync_array_cell_print(stdout, cell);
return(TRUE);
}
@@ -711,9 +718,9 @@ sync_array_detect_deadlock(
debug->pass,
depth);
if (ret) {
- printf("rw-lock %lx ", (ulint) lock);
+ sync_array_cell_print(buf, cell);
+ printf("rw-lock %lx %s ", (ulint) lock, buf);
rw_lock_debug_print(debug);
- sync_array_cell_print(stdout, cell);
return(TRUE);
}
@@ -764,7 +771,7 @@ sync_arr_cell_can_wake_up(
if (rw_lock_get_reader_count(lock) == 0
&& rw_lock_get_writer(lock) == RW_LOCK_WAIT_EX
- && lock->writer_thread == cell->thread) {
+ && os_thread_eq(lock->writer_thread, cell->thread)) {
return(TRUE);
}
@@ -898,6 +905,7 @@ sync_array_print_long_waits(void)
sync_cell_t* cell;
ibool old_val;
ibool noticed = FALSE;
+ char buf[500];
ulint i;
for (i = 0; i < sync_primary_wait_array->n_cells; i++) {
@@ -907,9 +915,10 @@ sync_array_print_long_waits(void)
if (cell->wait_object != NULL
&& difftime(time(NULL), cell->reservation_time) > 240) {
+ sync_array_cell_print(buf, cell);
+
fprintf(stderr,
- "InnoDB: Warning: a long semaphore wait:\n");
- sync_array_cell_print(stderr, cell);
+ "InnoDB: Warning: a long semaphore wait:\n%s", buf);
noticed = TRUE;
}
@@ -918,7 +927,7 @@ sync_array_print_long_waits(void)
&& difftime(time(NULL), cell->reservation_time) > 420) {
fprintf(stderr,
-"InnoDB: Error: semaphore wait has lasted > 420 seconds\n"
+"InnoDB: Error: semaphore wait has lasted > 600 seconds\n"
"InnoDB: We intentionally crash the server, because it appears to be hung.\n"
);
@@ -948,6 +957,8 @@ static
void
sync_array_output_info(
/*===================*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end,/* in: buffer end */
sync_array_t* arr) /* in: wait array; NOTE! caller must own the
mutex */
{
@@ -955,18 +966,29 @@ sync_array_output_info(
ulint count;
ulint i;
- printf("OS WAIT ARRAY INFO: reservation count %ld, signal count %ld\n",
+ if (buf_end - buf < 500) {
+ return;
+ }
+
+ buf += sprintf(buf,
+ "OS WAIT ARRAY INFO: reservation count %ld, signal count %ld\n",
arr->res_count, arr->sg_count);
i = 0;
count = 0;
while (count < arr->n_reserved) {
+ if (buf_end - buf < 500) {
+ return;
+ }
+
cell = sync_array_get_nth_cell(arr, i);
if (cell->wait_object != NULL) {
count++;
- sync_array_cell_print(stdout, cell);
+ sync_array_cell_print(buf, cell);
+
+ buf = buf + strlen(buf);
}
i++;
@@ -979,11 +1001,14 @@ Prints info of the wait array. */
void
sync_array_print_info(
/*==================*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end,/* in: buffer end */
sync_array_t* arr) /* in: wait array */
{
sync_array_enter(arr);
- sync_array_output_info(arr);
+ sync_array_output_info(buf, buf_end, arr);
sync_array_exit(arr);
}
+
diff --git a/innobase/sync/sync0rw.c b/innobase/sync/sync0rw.c
index 86ffed7ca95..fe837b119f3 100644
--- a/innobase/sync/sync0rw.c
+++ b/innobase/sync/sync0rw.c
@@ -223,7 +223,7 @@ lock_loop:
if (srv_print_latch_waits) {
printf(
"Thread %lu spin wait rw-s-lock at %lx cfile %s cline %lu rnds %lu\n",
- os_thread_get_curr_id(), (ulint)lock,
+ os_thread_pf(os_thread_get_curr_id()), (ulint)lock,
lock->cfile_name, lock->cline, i);
}
@@ -253,7 +253,7 @@ lock_loop:
if (srv_print_latch_waits) {
printf(
"Thread %lu OS wait rw-s-lock at %lx cfile %s cline %lu\n",
- os_thread_get_curr_id(), (ulint)lock,
+ os_thread_pf(os_thread_get_curr_id()), (ulint)lock,
lock->cfile_name, lock->cline);
}
@@ -343,7 +343,8 @@ rw_lock_x_lock_low(
}
} else if ((rw_lock_get_writer(lock) == RW_LOCK_WAIT_EX)
- && (lock->writer_thread == os_thread_get_curr_id())) {
+ && os_thread_eq(lock->writer_thread,
+ os_thread_get_curr_id())) {
if (rw_lock_get_reader_count(lock) == 0) {
@@ -368,7 +369,8 @@ rw_lock_x_lock_low(
return(RW_LOCK_WAIT_EX);
} else if ((rw_lock_get_writer(lock) == RW_LOCK_EX)
- && (lock->writer_thread == os_thread_get_curr_id())
+ && os_thread_eq(lock->writer_thread,
+ os_thread_get_curr_id())
&& (lock->pass == 0)
&& (pass == 0)) {
@@ -469,7 +471,7 @@ lock_loop:
if (srv_print_latch_waits) {
printf(
"Thread %lu spin wait rw-x-lock at %lx cfile %s cline %lu rnds %lu\n",
- os_thread_get_curr_id(), (ulint)lock,
+ os_thread_pf(os_thread_get_curr_id()), (ulint)lock,
lock->cfile_name, lock->cline, i);
}
@@ -502,8 +504,8 @@ lock_loop:
if (srv_print_latch_waits) {
printf(
"Thread %lu OS wait for rw-x-lock at %lx cfile %s cline %lu\n",
- os_thread_get_curr_id(), (ulint)lock, lock->cfile_name,
- lock->cline);
+ os_thread_pf(os_thread_get_curr_id()), (ulint)lock,
+ lock->cfile_name, lock->cline);
}
rw_x_system_call_count++;
@@ -621,7 +623,8 @@ rw_lock_remove_debug_info(
while (info != NULL) {
if ((pass == info->pass)
&& ((pass != 0)
- || (info->thread_id == os_thread_get_curr_id()))
+ || os_thread_eq(info->thread_id,
+ os_thread_get_curr_id()))
&& (info->lock_type == lock_type)) {
/* Found! */
@@ -676,7 +679,7 @@ rw_lock_own(
while (info != NULL) {
- if ((info->thread_id == os_thread_get_curr_id())
+ if (os_thread_eq(info->thread_id, os_thread_get_curr_id())
&& (info->pass == 0)
&& (info->lock_type == lock_type)) {
@@ -834,7 +837,7 @@ rw_lock_debug_print(
rwt = info->lock_type;
printf("Locked: thread %ld file %s line %ld ",
- info->thread_id, info->file_name, info->line);
+ os_thread_pf(info->thread_id), info->file_name, info->line);
if (rwt == RW_LOCK_SHARED) {
printf("S-LOCK");
} else if (rwt == RW_LOCK_EX) {
diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c
index 144ed263db9..3ea996afd6b 100644
--- a/innobase/sync/sync0sync.c
+++ b/innobase/sync/sync0sync.c
@@ -230,7 +230,6 @@ mutex_create_func(
mutex->magic_n = MUTEX_MAGIC_N;
mutex->line = 0;
mutex->file_name = (char *) "not yet reserved";
- mutex->thread_id = ULINT_UNDEFINED;
mutex->level = SYNC_LEVEL_NONE;
mutex->cfile_name = cfile_name;
mutex->cline = cline;
@@ -392,8 +391,8 @@ spin_loop:
if (srv_print_latch_waits) {
printf(
"Thread %lu spin wait mutex at %lx cfile %s cline %lu rnds %lu\n",
- os_thread_get_curr_id(), (ulint)mutex, mutex->cfile_name,
- mutex->cline, i);
+ os_thread_pf(os_thread_get_curr_id()), (ulint)mutex,
+ mutex->cfile_name, mutex->cline, i);
}
mutex_spin_round_count += i;
@@ -458,7 +457,7 @@ spin_loop:
if (srv_print_latch_waits) {
printf(
"Thread %lu spin wait succeeds at 2: mutex at %lx\n",
- os_thread_get_curr_id(), (ulint)mutex);
+ os_thread_pf(os_thread_get_curr_id()), (ulint)mutex);
}
return;
@@ -476,8 +475,8 @@ spin_loop:
if (srv_print_latch_waits) {
printf(
"Thread %lu OS wait mutex at %lx cfile %s cline %lu rnds %lu\n",
- os_thread_get_curr_id(), (ulint)mutex, mutex->cfile_name,
- mutex->cline, i);
+ os_thread_pf(os_thread_get_curr_id()), (ulint)mutex,
+ mutex->cfile_name, mutex->cline, i);
}
mutex_system_call_count++;
@@ -572,7 +571,7 @@ mutex_own(
return(FALSE);
}
- if (mutex->thread_id != os_thread_get_curr_id()) {
+ if (!os_thread_eq(mutex->thread_id, os_thread_get_curr_id())) {
return(FALSE);
}
@@ -611,7 +610,8 @@ mutex_list_print_info(void)
&thread_id);
printf(
"Locked mutex: addr %lx thread %ld file %s line %ld\n",
- (ulint)mutex, thread_id, file_name, line);
+ (ulint)mutex, os_thread_pf(thread_id),
+ file_name, line);
}
mutex = UT_LIST_GET_NEXT(list, mutex);
@@ -716,7 +716,7 @@ sync_thread_level_arrays_find_slot(void)
slot = sync_thread_level_arrays_get_nth(i);
- if (slot->levels && (slot->id == id)) {
+ if (slot->levels && os_thread_eq(slot->id, id)) {
return(slot);
}
@@ -780,7 +780,7 @@ sync_thread_levels_g(
{
char* file_name;
ulint line;
- ulint thread_id;
+ os_thread_id_t thread_id;
sync_level_t* slot;
rw_lock_t* lock;
mutex_t* mutex;
@@ -810,7 +810,7 @@ sync_thread_levels_g(
&file_name, &line, &thread_id);
printf("InnoDB: Locked mutex: addr %lx thread %ld file %s line %ld\n",
- (ulint)mutex, thread_id,
+ (ulint)mutex, os_thread_pf(thread_id),
file_name, line);
} else {
printf("Not locked\n");
@@ -874,6 +874,7 @@ sync_thread_levels_empty_gen(
sync_level_t* slot;
rw_lock_t* lock;
mutex_t* mutex;
+ char* buf;
ulint i;
if (!sync_order_checks_on) {
@@ -907,7 +908,9 @@ sync_thread_levels_empty_gen(
mutex = slot->latch;
mutex_exit(&sync_thread_mutex);
- sync_print();
+ buf = mem_alloc(20000);
+
+ sync_print(buf, buf + 18000);
ut_error;
return(FALSE);
@@ -1243,14 +1246,21 @@ sync_close(void)
Prints wait info of the sync system. */
void
-sync_print_wait_info(void)
-/*======================*/
+sync_print_wait_info(
+/*=================*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end) /* in: buffer end */
{
#ifdef UNIV_SYNC_DEBUG
printf("Mutex exits %lu, rws exits %lu, rwx exits %lu\n",
mutex_exit_count, rw_s_exit_count, rw_x_exit_count);
#endif
- printf(
+ if (buf_end - buf < 500) {
+
+ return;
+ }
+
+ sprintf(buf,
"Mutex spin waits %lu, rounds %lu, OS waits %lu\n"
"RW-shared spins %lu, OS waits %lu; RW-excl spins %lu, OS waits %lu\n",
mutex_spin_wait_count, mutex_spin_round_count,
@@ -1263,11 +1273,18 @@ sync_print_wait_info(void)
Prints info of the sync system. */
void
-sync_print(void)
-/*============*/
+sync_print(
+/*=======*/
+ char* buf, /* in/out: buffer where to print */
+ char* buf_end) /* in: buffer end */
{
mutex_list_print_info();
+
rw_lock_list_print_info();
- sync_array_print_info(sync_primary_wait_array);
- sync_print_wait_info();
+
+ sync_array_print_info(buf, buf_end, sync_primary_wait_array);
+
+ buf = buf + strlen(buf);
+
+ sync_print_wait_info(buf, buf_end);
}
diff --git a/innobase/thr/thr0loc.c b/innobase/thr/thr0loc.c
index d3d7a58d313..fbf3e3a1dad 100644
--- a/innobase/thr/thr0loc.c
+++ b/innobase/thr/thr0loc.c
@@ -69,8 +69,8 @@ try_again:
local = NULL;
- HASH_SEARCH(hash, thr_local_hash, os_thread_conv_id_to_ulint(id),
- local, local->id == id);
+ HASH_SEARCH(hash, thr_local_hash, os_thread_pf(id),
+ local, os_thread_eq(local->id, id));
if (local == NULL) {
mutex_exit(&thr_local_mutex);
@@ -173,7 +173,7 @@ thr_local_create(void)
mutex_enter(&thr_local_mutex);
HASH_INSERT(thr_local_t, hash, thr_local_hash,
- os_thread_conv_id_to_ulint(os_thread_get_curr_id()),
+ os_thread_pf(os_thread_get_curr_id()),
local);
mutex_exit(&thr_local_mutex);
@@ -193,8 +193,8 @@ thr_local_free(
/* Look for the local struct in the hash table */
- HASH_SEARCH(hash, thr_local_hash, os_thread_conv_id_to_ulint(id),
- local, local->id == id);
+ HASH_SEARCH(hash, thr_local_hash, os_thread_pf(id),
+ local, os_thread_eq(local->id, id));
if (local == NULL) {
mutex_exit(&thr_local_mutex);
@@ -202,7 +202,7 @@ thr_local_free(
}
HASH_DELETE(thr_local_t, hash, thr_local_hash,
- os_thread_conv_id_to_ulint(id), local);
+ os_thread_pf(id), local);
mutex_exit(&thr_local_mutex);
diff --git a/innobase/trx/trx0roll.c b/innobase/trx/trx0roll.c
index 97cc2dbff1a..4c2ee5dc9be 100644
--- a/innobase/trx/trx0roll.c
+++ b/innobase/trx/trx0roll.c
@@ -160,11 +160,13 @@ trx_rollback_last_sql_stat_for_mysql(
}
/***********************************************************************
-Rollback uncommitted transactions which have no user session. */
+Rollback or clean up transactions which have no user session. If the
+transaction already was committed, then we clean up a possible insert
+undo log. If the transaction was not yet committed, then we roll it back. */
void
-trx_rollback_all_without_sess(void)
-/*===============================*/
+trx_rollback_or_clean_all_without_sess(void)
+/*========================================*/
{
mem_heap_t* heap;
que_fork_t* fork;
@@ -217,6 +219,19 @@ loop:
trx->sess = trx_dummy_sess;
+ if (trx->conc_state == TRX_COMMITTED_IN_MEMORY) {
+
+ fprintf(stderr, "InnoDB: Cleaning up trx with id %lu %lu\n",
+ ut_dulint_get_high(trx->id),
+ ut_dulint_get_low(trx->id));
+
+ trx_cleanup_at_db_startup(trx);
+
+ mem_heap_free(heap);
+
+ goto loop;
+ }
+
fork = que_fork_create(NULL, NULL, QUE_FORK_RECOVERY, heap);
fork->trx = trx;
@@ -264,9 +279,17 @@ loop:
/* If the transaction was for a dictionary operation, we
drop the relevant table, if it still exists */
+ fprintf(stderr,
+"InnoDB: Dropping table with id %lu %lu in recovery if it exists\n",
+ ut_dulint_get_high(trx->table_id),
+ ut_dulint_get_low(trx->table_id));
+
table = dict_table_get_on_id_low(trx->table_id, trx);
if (table) {
+ fprintf(stderr,
+"InnoDB: Table found: dropping table %s in recovery\n", table->name);
+
err = row_drop_table_for_mysql(table->name, trx,
TRUE);
ut_a(err == (int) DB_SUCCESS);
diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c
index 32a1db48488..33c962772e8 100644
--- a/innobase/trx/trx0sys.c
+++ b/innobase/trx/trx0sys.c
@@ -26,6 +26,14 @@ Created 3/26/1996 Heikki Tuuri
trx_sys_t* trx_sys = NULL;
trx_doublewrite_t* trx_doublewrite = NULL;
+/* In a MySQL replication slave, in crash recovery we store the master log
+file name and position here. We have successfully got the updates to InnoDB
+up to this position. If .._pos is -1, it means no crash recovery was needed,
+or there was no master log position info inside InnoDB. */
+
+char trx_sys_mysql_master_log_name[TRX_SYS_MYSQL_LOG_NAME_LEN];
+ib_longlong trx_sys_mysql_master_log_pos = -1;
+
/********************************************************************
Determines if a page number is located inside the doublewrite buffer. */
@@ -427,75 +435,90 @@ trx_sys_flush_max_trx_id(void)
/*********************************************************************
Updates the offset information about the end of the MySQL binlog entry
-which corresponds to the transaction just being committed. */
+which corresponds to the transaction just being committed. In a MySQL
+replication slave updates the latest master binlog position up to which
+replication has proceeded. */
void
trx_sys_update_mysql_binlog_offset(
/*===============================*/
- trx_t* trx, /* in: transaction being committed */
- mtr_t* mtr) /* in: mtr */
+ char* file_name,/* in: MySQL log file name */
+ ib_longlong offset, /* in: position in that log file */
+ ulint field, /* in: offset of the MySQL log info field in
+ the trx sys header */
+ mtr_t* mtr) /* in: mtr */
{
trx_sysf_t* sys_header;
- char namebuf[TRX_SYS_MYSQL_LOG_NAME_LEN];
-
- ut_ad(trx->mysql_log_file_name);
- memset(namebuf, ' ', TRX_SYS_MYSQL_LOG_NAME_LEN - 1);
- namebuf[TRX_SYS_MYSQL_LOG_NAME_LEN - 1] = '\0';
+ if (ut_strlen(file_name) >= TRX_SYS_MYSQL_LOG_NAME_LEN) {
- /* Copy the whole MySQL log file name to the buffer, or only the
- last characters, if it does not fit */
+ /* We cannot fit the name to the 512 bytes we have reserved */
- if (ut_strlen(trx->mysql_log_file_name)
- > TRX_SYS_MYSQL_LOG_NAME_LEN - 1) {
- ut_memcpy(namebuf, trx->mysql_log_file_name
- + ut_strlen(trx->mysql_log_file_name)
- - (TRX_SYS_MYSQL_LOG_NAME_LEN - 1),
- TRX_SYS_MYSQL_LOG_NAME_LEN - 1);
- } else {
- ut_memcpy(namebuf, trx->mysql_log_file_name,
- 1 + ut_strlen(trx->mysql_log_file_name));
+ return;
}
- namebuf[TRX_SYS_MYSQL_LOG_NAME_LEN - 1] = '\0';
-
sys_header = trx_sysf_get(mtr);
- if (mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO
+ if (mach_read_from_4(sys_header + field
+ TRX_SYS_MYSQL_LOG_MAGIC_N_FLD)
!= TRX_SYS_MYSQL_LOG_MAGIC_N) {
- mlog_write_ulint(sys_header + TRX_SYS_MYSQL_LOG_INFO
+ mlog_write_ulint(sys_header + field
+ TRX_SYS_MYSQL_LOG_MAGIC_N_FLD,
TRX_SYS_MYSQL_LOG_MAGIC_N,
MLOG_4BYTES, mtr);
}
- if (0 != ut_memcmp(sys_header + TRX_SYS_MYSQL_LOG_INFO
- + TRX_SYS_MYSQL_LOG_NAME,
- namebuf, TRX_SYS_MYSQL_LOG_NAME_LEN)) {
+ if (0 != ut_memcmp(sys_header + field + TRX_SYS_MYSQL_LOG_NAME,
+ file_name, 1 + ut_strlen(file_name))) {
- mlog_write_string(sys_header + TRX_SYS_MYSQL_LOG_INFO
+ mlog_write_string(sys_header + field
+ TRX_SYS_MYSQL_LOG_NAME,
- namebuf, TRX_SYS_MYSQL_LOG_NAME_LEN, mtr);
+ file_name, 1 + ut_strlen(file_name), mtr);
}
- if (mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO
+ if (mach_read_from_4(sys_header + field
+ TRX_SYS_MYSQL_LOG_OFFSET_HIGH) > 0
- || (trx->mysql_log_offset >> 32) > 0) {
+ || (offset >> 32) > 0) {
- mlog_write_ulint(sys_header + TRX_SYS_MYSQL_LOG_INFO
+ mlog_write_ulint(sys_header + field
+ TRX_SYS_MYSQL_LOG_OFFSET_HIGH,
- (ulint)(trx->mysql_log_offset >> 32),
+ (ulint)(offset >> 32),
MLOG_4BYTES, mtr);
}
- mlog_write_ulint(sys_header + TRX_SYS_MYSQL_LOG_INFO
+ mlog_write_ulint(sys_header + field
+ TRX_SYS_MYSQL_LOG_OFFSET_LOW,
- (ulint)(trx->mysql_log_offset & 0xFFFFFFFF),
+ (ulint)(offset & 0xFFFFFFFF),
MLOG_4BYTES, mtr);
+}
- trx->mysql_log_file_name = NULL;
+/*********************************************************************
+Prints to stdout the MySQL binlog info in the system header if the
+magic number shows it valid. */
+
+void
+trx_sys_print_mysql_binlog_offset_from_page(
+/*========================================*/
+ byte* page) /* in: buffer containing the trx system header page,
+ i.e., page number TRX_SYS_PAGE_NO in the tablespace */
+{
+ trx_sysf_t* sys_header;
+
+ sys_header = page + TRX_SYS;
+
+ if (mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO
+ + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD)
+ == TRX_SYS_MYSQL_LOG_MAGIC_N) {
+
+ printf(
+ "ibbackup: Last MySQL binlog file position %lu %lu, file name %s\n",
+ mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO
+ + TRX_SYS_MYSQL_LOG_OFFSET_HIGH),
+ mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO
+ + TRX_SYS_MYSQL_LOG_OFFSET_LOW),
+ sys_header + TRX_SYS_MYSQL_LOG_INFO + TRX_SYS_MYSQL_LOG_NAME);
+ }
}
/*********************************************************************
@@ -533,6 +556,58 @@ trx_sys_print_mysql_binlog_offset(void)
mtr_commit(&mtr);
}
+/*********************************************************************
+Prints to stderr the MySQL master log offset info in the trx system header if
+the magic number shows it valid. */
+
+void
+trx_sys_print_mysql_master_log_pos(void)
+/*====================================*/
+{
+ trx_sysf_t* sys_header;
+ mtr_t mtr;
+
+ mtr_start(&mtr);
+
+ sys_header = trx_sysf_get(&mtr);
+
+ if (mach_read_from_4(sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
+ + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD)
+ != TRX_SYS_MYSQL_LOG_MAGIC_N) {
+
+ mtr_commit(&mtr);
+
+ return;
+ }
+
+ fprintf(stderr,
+"InnoDB: In a MySQL replication slave the last master binlog file\n"
+"InnoDB: position %lu %lu, file name %s\n",
+ mach_read_from_4(sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
+ + TRX_SYS_MYSQL_LOG_OFFSET_HIGH),
+ mach_read_from_4(sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
+ + TRX_SYS_MYSQL_LOG_OFFSET_LOW),
+ sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
+ + TRX_SYS_MYSQL_LOG_NAME);
+ /* Copy the master log position info to global variables we can
+ use in ha_innobase.cc to initialize glob_mi to right values */
+
+ ut_memcpy(trx_sys_mysql_master_log_name,
+ sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
+ + TRX_SYS_MYSQL_LOG_NAME,
+ TRX_SYS_MYSQL_LOG_NAME_LEN);
+
+ trx_sys_mysql_master_log_pos =
+ (((ib_longlong)mach_read_from_4(
+ sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
+ + TRX_SYS_MYSQL_LOG_OFFSET_HIGH))
+ << 32)
+ + (ib_longlong)
+ mach_read_from_4(sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
+ + TRX_SYS_MYSQL_LOG_OFFSET_LOW);
+ mtr_commit(&mtr);
+}
+
/********************************************************************
Looks for a free slot for a rollback segment in the trx system file copy. */
@@ -660,7 +735,7 @@ trx_sys_init_at_db_start(void)
if (UT_LIST_GET_LEN(trx_sys->trx_list) > 0) {
fprintf(stderr,
- "InnoDB: %lu uncommitted transaction(s) which must be rolled back\n",
+ "InnoDB: %lu transaction(s) which must be rolled back or cleaned up\n",
UT_LIST_GET_LEN(trx_sys->trx_list));
fprintf(stderr, "InnoDB: Trx id counter is %lu %lu\n",
diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c
index 87b82cbee3a..994a6777924 100644
--- a/innobase/trx/trx0trx.c
+++ b/innobase/trx/trx0trx.c
@@ -26,9 +26,11 @@ Created 3/26/1996 Heikki Tuuri
/* Copy of the prototype for innobase_mysql_print_thd: this
-copy must be equal to the one in mysql/sql/ha_innobase.cc ! */
+copy MUST be equal to the one in mysql/sql/ha_innobase.cc ! */
-void innobase_mysql_print_thd(void* thd);
+void innobase_mysql_print_thd(
+ char* buf,
+ void* thd);
/* Dummy session used currently in MySQL interface */
sess_t* trx_dummy_sess = NULL;
@@ -37,6 +39,17 @@ sess_t* trx_dummy_sess = NULL;
the kernel mutex */
ulint trx_n_mysql_transactions = 0;
+/*****************************************************************
+Starts the transaction if it is not yet started. */
+
+void
+trx_start_if_not_started_noninline(
+/*===============================*/
+ trx_t* trx) /* in: transaction */
+{
+ trx_start_if_not_started(trx);
+}
+
/********************************************************************
Retrieves the error_info field from a trx. */
@@ -70,6 +83,7 @@ trx_create(
trx->type = TRX_USER;
trx->conc_state = TRX_NOT_STARTED;
+ trx->start_time = time(NULL);
trx->check_foreigns = TRUE;
trx->check_unique_secondary = TRUE;
@@ -83,6 +97,8 @@ trx_create(
trx->mysql_log_file_name = NULL;
trx->mysql_log_offset = 0;
+ trx->mysql_master_log_file_name = "";
+ trx->mysql_master_log_pos = 0;
trx->ignore_duplicates_in_insert = FALSE;
@@ -363,16 +379,31 @@ trx_lists_init_at_db_start(void)
trx = trx_create(NULL);
+ trx->id = undo->trx_id;
+
+ trx->insert_undo = undo;
+ trx->rseg = rseg;
+
if (undo->state != TRX_UNDO_ACTIVE) {
trx->conc_state = TRX_COMMITTED_IN_MEMORY;
+
+ /* We give a dummy value for the trx no;
+ this should have no relevance since purge
+ is not interested in committed transaction
+ numbers, unless they are in the history
+ list, in which case it looks the number
+ from the disk based undo log structure */
+
+ trx->no = trx->id;
} else {
trx->conc_state = TRX_ACTIVE;
- }
- trx->id = undo->trx_id;
- trx->insert_undo = undo;
- trx->rseg = rseg;
+ /* A running transaction always has the number
+ field inited to ut_dulint_max */
+
+ trx->no = ut_dulint_max;
+ }
if (undo->dict_operation) {
trx->dict_operation = undo->dict_operation;
@@ -397,14 +428,25 @@ trx_lists_init_at_db_start(void)
if (NULL == trx) {
trx = trx_create(NULL);
+ trx->id = undo->trx_id;
+
if (undo->state != TRX_UNDO_ACTIVE) {
trx->conc_state =
TRX_COMMITTED_IN_MEMORY;
+ /* We give a dummy value for the trx
+ number */
+
+ trx->no = trx->id;
} else {
trx->conc_state = TRX_ACTIVE;
+
+ /* A running transaction always has
+ the number field inited to
+ ut_dulint_max */
+
+ trx->no = ut_dulint_max;
}
- trx->id = undo->trx_id;
trx->rseg = rseg;
trx_list_insert_ordered(trx);
@@ -486,6 +528,7 @@ trx_start_low(
if (trx->type == TRX_PURGE) {
trx->id = ut_dulint_zero;
trx->conc_state = TRX_ACTIVE;
+ trx->start_time = time(NULL);
return(TRUE);
}
@@ -509,6 +552,7 @@ trx_start_low(
trx->rseg = rseg;
trx->conc_state = TRX_ACTIVE;
+ trx->start_time = time(NULL);
UT_LIST_ADD_FIRST(trx_list, trx_sys->trx_list, trx);
@@ -583,7 +627,7 @@ trx_commit_off_kernel(
if (undo) {
mutex_enter(&kernel_mutex);
#ifdef notdefined
- /* ########## There is a bug here: purge and rollback
+ /* !!!!!!!!! There is a bug here: purge and rollback
need the whole stack of old record versions even if no
consistent read would need them!! This is because they
decide on the basis of the old versions when we can
@@ -627,12 +671,25 @@ trx_commit_off_kernel(
mutex_exit(&(rseg->mutex));
/* Update the latest MySQL binlog name and offset info
- in trx sys header if MySQL binlogging is on */
+ in trx sys header if MySQL binlogging is on or the database
+ server is a MySQL replication slave */
if (trx->mysql_log_file_name) {
- trx_sys_update_mysql_binlog_offset(trx, &mtr);
+ trx_sys_update_mysql_binlog_offset(
+ trx->mysql_log_file_name,
+ trx->mysql_log_offset,
+ TRX_SYS_MYSQL_LOG_INFO, &mtr);
+ trx->mysql_log_file_name = NULL;
}
-
+
+ if (trx->mysql_master_log_file_name[0] != '\0') {
+ /* This database server is a MySQL replication slave */
+ trx_sys_update_mysql_binlog_offset(
+ trx->mysql_master_log_file_name,
+ trx->mysql_master_log_pos,
+ TRX_SYS_MYSQL_MASTER_LOG_INFO, &mtr);
+ }
+
/* If we did not take the shortcut, the following call
commits the mini-transaction, making the whole transaction
committed in the file-based world at this log sequence number;
@@ -707,12 +764,12 @@ trx_commit_off_kernel(
/*-------------------------------------*/
- /* Most MySQL users run with srv_flush.. set to FALSE: */
+ /* Most MySQL users run with srv_flush_.. set to FALSE: */
if (srv_flush_log_at_trx_commit) {
log_flush_up_to(lsn, LOG_WAIT_ONE_GROUP);
- }
+ }
/*-------------------------------------*/
@@ -730,6 +787,29 @@ trx_commit_off_kernel(
UT_LIST_REMOVE(trx_list, trx_sys->trx_list, trx);
}
+/********************************************************************
+Cleans up a transaction at database startup. The cleanup is needed if
+the transaction already got to the middle of a commit when the database
+crashed, andf we cannot roll it back. */
+
+void
+trx_cleanup_at_db_startup(
+/*======================*/
+ trx_t* trx) /* in: transaction */
+{
+ if (trx->insert_undo != NULL) {
+
+ trx_undo_insert_cleanup(trx);
+ }
+
+ trx->conc_state = TRX_NOT_STARTED;
+ trx->rseg = NULL;
+ trx->undo_no = ut_dulint_zero;
+ trx->last_sql_stat_start.least_undo_no = ut_dulint_zero;
+
+ UT_LIST_REMOVE(trx_list, trx_sys->trx_list, trx);
+}
+
/************************************************************************
Assigns a read view for a consistent read query. All the consistent reads
within the same transaction will get the same read view, which is created
@@ -1395,54 +1475,78 @@ own the kernel mutex. */
void
trx_print(
/*======*/
+ char* buf, /* in/out: buffer where to print, must be at least
+ 800 bytes */
trx_t* trx) /* in: transaction */
{
- printf("TRANSACTION %lu %lu, OS thread id %lu",
+ char* start_of_line;
+
+ buf += sprintf(buf, "TRANSACTION %lu %lu",
ut_dulint_get_high(trx->id),
- ut_dulint_get_low(trx->id),
- (ulint)trx->mysql_thread_id);
+ ut_dulint_get_low(trx->id));
+
+ switch (trx->conc_state) {
+ case TRX_NOT_STARTED: buf += sprintf(buf,
+ ", not started"); break;
+ case TRX_ACTIVE: buf += sprintf(buf,
+ ", ACTIVE %lu sec",
+ (ulint)difftime(time(NULL), trx->start_time)); break;
+ case TRX_COMMITTED_IN_MEMORY: buf += sprintf(buf,
+ ", COMMITTED IN MEMORY");
+ break;
+ default: buf += sprintf(buf, " state %lu", trx->conc_state);
+ }
+
+ buf += sprintf(buf, ", OS thread id %lu",
+ os_thread_pf(trx->mysql_thread_id));
if (ut_strlen(trx->op_info) > 0) {
- printf(" %s", trx->op_info);
+ buf += sprintf(buf, " %s", trx->op_info);
}
if (trx->type != TRX_USER) {
- printf(" purge trx");
+ buf += sprintf(buf, " purge trx");
}
+
+ buf += sprintf(buf, "\n");
- switch (trx->conc_state) {
- case TRX_NOT_STARTED: printf(", not started"); break;
- case TRX_ACTIVE: printf(", active"); break;
- case TRX_COMMITTED_IN_MEMORY: printf(", committed in memory");
- break;
- default: printf(" state %lu", trx->conc_state);
- }
+ start_of_line = buf;
switch (trx->que_state) {
- case TRX_QUE_RUNNING: printf(", runs or sleeps"); break;
- case TRX_QUE_LOCK_WAIT: printf(", lock wait"); break;
- case TRX_QUE_ROLLING_BACK: printf(", rolling back"); break;
- case TRX_QUE_COMMITTING: printf(", committing"); break;
- default: printf(" que state %lu", trx->que_state);
+ case TRX_QUE_RUNNING: break;
+ case TRX_QUE_LOCK_WAIT: buf += sprintf(buf,
+ "LOCK WAIT "); break;
+ case TRX_QUE_ROLLING_BACK: buf += sprintf(buf,
+ "ROLLING BACK "); break;
+ case TRX_QUE_COMMITTING: buf += sprintf(buf,
+ "COMMITTING "); break;
+ default: buf += sprintf(buf, "que state %lu", trx->que_state);
}
- if (0 < UT_LIST_GET_LEN(trx->trx_locks)) {
- printf(", has %lu lock struct(s)",
- UT_LIST_GET_LEN(trx->trx_locks));
+ if (0 < UT_LIST_GET_LEN(trx->trx_locks) ||
+ mem_heap_get_size(trx->lock_heap) > 400) {
+
+ buf += sprintf(buf,
+"%lu lock struct(s), heap size %lu",
+ UT_LIST_GET_LEN(trx->trx_locks),
+ mem_heap_get_size(trx->lock_heap));
}
if (trx->has_search_latch) {
- printf(", holds adaptive hash latch");
+ buf += sprintf(buf, ", holds adaptive hash latch");
}
if (ut_dulint_cmp(trx->undo_no, ut_dulint_zero) != 0) {
- printf(", undo log entries %lu",
+ buf += sprintf(buf, ", undo log entries %lu",
ut_dulint_get_low(trx->undo_no));
}
- printf("\n");
+ if (buf != start_of_line) {
+
+ buf += sprintf(buf, "\n");
+ }
if (trx->mysql_thd != NULL) {
- innobase_mysql_print_thd(trx->mysql_thd);
+ innobase_mysql_print_thd(buf, trx->mysql_thd);
}
}
diff --git a/innobase/trx/trx0undo.c b/innobase/trx/trx0undo.c
index aae31f3726b..6303c5bbcdd 100644
--- a/innobase/trx/trx0undo.c
+++ b/innobase/trx/trx0undo.c
@@ -1147,7 +1147,7 @@ trx_undo_mem_create_at_db_start(
/* If the log segment is being freed, the page list is inconsistent! */
if (state == TRX_UNDO_TO_FREE) {
- return(undo);
+ goto add_to_list;
}
last_addr = flst_get_last(seg_header + TRX_UNDO_PAGE_LIST, mtr);
@@ -1166,7 +1166,7 @@ trx_undo_mem_create_at_db_start(
undo->top_offset = rec - last_page;
undo->top_undo_no = trx_undo_rec_get_undo_no(rec);
}
-
+add_to_list:
if (type == TRX_UNDO_INSERT) {
if (state != TRX_UNDO_CACHED) {
UT_LIST_ADD_LAST(undo_list, rseg->insert_undo_list,
diff --git a/innobase/ut/ut0mem.c b/innobase/ut/ut0mem.c
index a1320e8b5bc..2a7643551ad 100644
--- a/innobase/ut/ut0mem.c
+++ b/innobase/ut/ut0mem.c
@@ -38,6 +38,8 @@ os_fast_mutex_t ut_list_mutex; /* this protects the list */
ibool ut_mem_block_list_inited = FALSE;
+ulint* ut_mem_null_ptr = NULL;
+
/**************************************************************************
Initializes the mem block list at database startup. */
static
@@ -83,12 +85,16 @@ ut_malloc_low(
"InnoDB: Check if you should increase the swap file or\n"
"InnoDB: ulimits of your operating system.\n"
"InnoDB: On FreeBSD check you have compiled the OS with\n"
- "InnoDB: a big enough maximum process size.\n",
+ "InnoDB: a big enough maximum process size.\n"
+ "InnoDB: We now intentionally generate a seg fault so that\n"
+ "InnoDB: on Linux we get a stack trace.\n",
n, ut_total_allocated_memory, errno);
os_fast_mutex_unlock(&ut_list_mutex);
- exit(1);
+ /* Make an intentional seg fault so that we get a stack
+ trace */
+ printf("%lu\n", *ut_mem_null_ptr);
}
if (set_to_zero) {
diff --git a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c
index 7ee32b9a8e2..c77cbe9cdcf 100644
--- a/innobase/ut/ut0ut.c
+++ b/innobase/ut/ut0ut.c
@@ -12,11 +12,36 @@ Created 5/11/1994 Heikki Tuuri
#include "ut0ut.ic"
#endif
+#include <stdarg.h>
+
#include "ut0sort.h"
ibool ut_always_false = FALSE;
/************************************************************
+Uses vsprintf to emulate sprintf so that the function always returns
+the printed length. Apparently in some old SCO Unixes sprintf did not
+return the printed length but a pointer to the end of the printed string. */
+
+ulint
+ut_sprintf(
+/*=======*/
+ char* buf, /* in/out: buffer where to print */
+ const char* format, /* in: format of prints */
+ ...) /* in: arguments to be printed */
+{
+ va_list args;
+
+ va_start(args, format);
+
+ vsprintf(buf, format, args);
+
+ va_end(args);
+
+ return((ulint)strlen(buf));
+}
+
+/************************************************************
Gets the high 32 bits in a ulint. That is makes a shift >> 32,
but since there seem to be compiler bugs in both gcc and Visual C++,
we do this by a special conversion. */
@@ -27,11 +52,11 @@ ut_get_high32(
/* out: a >> 32 */
ulint a) /* in: ulint */
{
- if (sizeof(ulint) == 4) {
- return(0);
- }
-
+#if SIZEOF_LONG == 4
+ return 0;
+#else
return(a >> 32);
+#endif
}
/************************************************************
@@ -111,6 +136,49 @@ ut_print_timestamp(
}
/**************************************************************
+Sprintfs a timestamp to a buffer. */
+
+void
+ut_sprintf_timestamp(
+/*=================*/
+ char* buf) /* in: buffer where to sprintf */
+{
+#ifdef __WIN__
+ SYSTEMTIME cal_tm;
+
+ GetLocalTime(&cal_tm);
+
+ sprintf(buf, "%02d%02d%02d %2d:%02d:%02d",
+ (int)cal_tm.wYear % 100,
+ (int)cal_tm.wMonth,
+ (int)cal_tm.wDay,
+ (int)cal_tm.wHour,
+ (int)cal_tm.wMinute,
+ (int)cal_tm.wSecond);
+#else
+ struct tm cal_tm;
+ struct tm* cal_tm_ptr;
+ time_t tm;
+
+ time(&tm);
+
+#ifdef HAVE_LOCALTIME_R
+ localtime_r(&tm, &cal_tm);
+ cal_tm_ptr = &cal_tm;
+#else
+ cal_tm_ptr = localtime(&tm);
+#endif
+ sprintf(buf, "%02d%02d%02d %2d:%02d:%02d",
+ cal_tm_ptr->tm_year % 100,
+ cal_tm_ptr->tm_mon + 1,
+ cal_tm_ptr->tm_mday,
+ cal_tm_ptr->tm_hour,
+ cal_tm_ptr->tm_min,
+ cal_tm_ptr->tm_sec);
+#endif
+}
+
+/**************************************************************
Returns current year, month, day. */
void
@@ -258,3 +326,26 @@ ut_ulint_sort(ulint* arr, ulint* aux_arr, ulint low, ulint high)
UT_SORT_FUNCTION_BODY(ut_ulint_sort, arr, aux_arr, low, high,
ut_ulint_cmp);
}
+
+/*****************************************************************
+Calculates fast the number rounded up to the nearest power of 2. */
+
+ulint
+ut_2_power_up(
+/*==========*/
+ /* out: first power of 2 which is >= n */
+ ulint n) /* in: number != 0 */
+{
+ ulint res;
+
+ res = 1;
+
+ ut_ad(n > 0);
+
+ while (res < n) {
+ res = res * 2;
+ }
+
+ return(res);
+}
+
diff --git a/isam/create.c b/isam/create.c
index 1fc2f3b97be..4c23f3edd11 100644
--- a/isam/create.c
+++ b/isam/create.c
@@ -294,13 +294,13 @@ int nisam_create(const char *name,uint keys,N_KEYDEF *keyinfo,
goto err;
/* Enlarge files */
- if (my_chsize(file,(ulong) share.base.keystart,MYF(0)))
+ if (my_chsize(file, (ulong) share.base.keystart, 0, MYF(0)))
goto err;
if (! (flags & HA_DONT_TOUCH_DATA))
{
#ifdef USE_RELOC
- if (my_chsize(dfile,share.base.min_pack_length*reloc,MYF(0)))
+ if (my_chsize(dfile, share.base.min_pack_length*reloc, 0, MYF(0)))
goto err;
#endif
errpos=1;
diff --git a/isam/isamchk.c b/isam/isamchk.c
index 23bded29f79..35b4e881962 100644
--- a/isam/isamchk.c
+++ b/isam/isamchk.c
@@ -516,7 +516,7 @@ static int nisamchk(my_string filename)
if (!rep_quick)
{
if (testflag & T_EXTEND)
- VOID(init_key_cache(use_buffers,(uint) NEED_MEM));
+ VOID(init_key_cache(use_buffers));
VOID(init_io_cache(&read_cache,datafile,(uint) read_buffer_length,
READ_CACHE,share->pack.header_length,1,
MYF(MY_WME)));
@@ -1459,7 +1459,7 @@ my_string name;
printf("Data records: %lu\n",(ulong) share->state.records);
}
- VOID(init_key_cache(use_buffers,NEED_MEM));
+ VOID(init_key_cache(use_buffers));
if (init_io_cache(&read_cache,info->dfile,(uint) read_buffer_length,
READ_CACHE,share->pack.header_length,1,MYF(MY_WME)))
goto err;
@@ -1552,7 +1552,7 @@ my_string name;
{
VOID(fputs(" \r",stdout)); VOID(fflush(stdout));
}
- if (my_chsize(share->kfile,share->state.key_file_length,MYF(0)))
+ if (my_chsize(share->kfile, share->state.key_file_length, 0, MYF(0)))
{
print_warning("Can't change size of indexfile, error: %d",my_errno);
goto err;
@@ -1936,7 +1936,7 @@ int write_info;
if (share->state.key_root[sort_key] == NI_POS_ERROR)
DBUG_RETURN(0); /* Nothing to do */
- init_key_cache(use_buffers,NEED_MEM);
+ init_key_cache(use_buffers);
if (init_io_cache(&info->rec_cache,-1,(uint) write_buffer_length,
WRITE_CACHE,share->pack.header_length,1,
MYF(MY_WME | MY_WAIT_IF_FULL)))
@@ -2514,10 +2514,10 @@ my_string name;
skr=share->base.reloc*share->base.min_pack_length;
#endif
if (skr != sort_info.filelength)
- if (my_chsize(info->dfile,skr,MYF(0)))
+ if (my_chsize(info->dfile, skr, 0, MYF(0)))
print_warning("Can't change size of datafile, error: %d",my_errno);
}
- if (my_chsize(share->kfile,share->state.key_file_length,MYF(0)))
+ if (my_chsize(share->kfile, share->state.key_file_length, 0, MYF(0)))
print_warning("Can't change size of indexfile, error: %d",my_errno);
if (!(testflag & T_SILENT))
diff --git a/isam/isamlog.c b/isam/isamlog.c
index 3c38caaf141..ff3bca39e40 100644
--- a/isam/isamlog.c
+++ b/isam/isamlog.c
@@ -329,7 +329,7 @@ static int examine_log(my_string file_name, char **table_names)
bzero((gptr) com_count,sizeof(com_count));
init_tree(&tree,0,0,sizeof(file_info),(qsort_cmp2) file_info_compare,1,
(tree_element_free) file_info_free, NULL);
- VOID(init_key_cache(KEY_CACHE_SIZE,(uint) (10*4*(IO_SIZE+MALLOC_OVERHEAD))));
+ VOID(init_key_cache(KEY_CACHE_SIZE));
files_open=0; access_time=0;
while (access_time++ != number_of_commands &&
diff --git a/isam/pack_isam.c b/isam/pack_isam.c
index 0f36c3cb2aa..8a00b4c962a 100644
--- a/isam/pack_isam.c
+++ b/isam/pack_isam.c
@@ -284,9 +284,10 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts("Copyright (C) 1994-2000 TcX AB & Monty Program KB & Detron HB.");
- puts("This is not free software. You must have a licence to use this program");
- puts("This software comes with ABSOLUTELY NO WARRANTY\n");
+ puts("Copyright (C) 2002 MySQL AB");
+ puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
+ puts("and you are welcome to modify and redistribute it under the GPL license\n");
+
puts("Pack a ISAM-table to take much smaller space");
puts("Keys are not updated, so you must run isamchk -rq on any table");
puts("that has keys after you have compressed it");
@@ -1960,7 +1961,7 @@ static void save_state(N_INFO *isam_file,MRG_INFO *mrg,my_off_t new_length,
isam_file->update|=(HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
isam_file->this_uniq=crc; /* Save crc here */
share->changed=1; /* Force write of header */
- VOID(my_chsize(share->kfile,share->state.key_file_length,
+ VOID(my_chsize(share->kfile, share->state.key_file_length, 0,
MYF(0)));
if (share->state.keys != share->base.keys)
isamchk_neaded=1;
diff --git a/isam/test2.c b/isam/test2.c
index 176346e74fa..c8f97ccdefa 100644
--- a/isam/test2.c
+++ b/isam/test2.c
@@ -156,7 +156,7 @@ int main(int argc, char *argv[])
goto err;
printf("- Writing key:s\n");
if (key_cacheing)
- init_key_cache(IO_SIZE*16,(uint) IO_SIZE*4*10); /* Use a small cache */
+ init_key_cache(IO_SIZE*16); /* Use a small cache */
if (locking)
nisam_lock_database(file,F_WRLCK);
if (write_cacheing)
diff --git a/isam/test3.c b/isam/test3.c
index 6c3390a2720..7027c56d0f6 100644
--- a/isam/test3.c
+++ b/isam/test3.c
@@ -171,7 +171,7 @@ void start_test(int id)
exit(1);
}
if (key_cacheing && rnd(2) == 0)
- init_key_cache(65536L,(uint) IO_SIZE*4*10);
+ init_key_cache(65536L);
printf("Process %d, pid: %d\n",id,(int) getpid()); fflush(stdout);
for (error=i=0 ; i < tests && !error; i++)
diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am
index 2eaf9709a36..fac544ba44d 100644
--- a/libmysql/Makefile.am
+++ b/libmysql/Makefile.am
@@ -17,9 +17,9 @@
# This file is public domain and comes with NO WARRANTY of any kind
-target = libmysqlclient.la
-target_defs = -DUNDEF_THREADS_HACK -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@ -DMYSQL_CLIENT
-LIBS = @CLIENT_LIBS@
+target = libmysqlclient.la
+target_defs = -DUNDEF_THREADS_HACK -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@ -DMYSQL_CLIENT
+LIBS = @CLIENT_LIBS@
INCLUDES = -I$(srcdir)/../include -I../include \
-I$(srcdir)/.. -I$(top_srcdir) -I.. $(openssl_includes)
@@ -49,6 +49,10 @@ link_sources:
rm -f $(srcdir)/$$f; \
@LN_CP_F@ $(srcdir)/../strings/$$f $(srcdir)/$$f; \
done; \
+ for f in $(mystringsgen); do \
+ rm -f $(srcdir)/$$f; \
+ @LN_CP_F@ ../strings/$$f $(srcdir)/$$f; \
+ done; \
for f in $$qs; do \
rm -f $(srcdir)/$$f; \
@LN_CP_F@ $(srcdir)/../sql/$$f $(srcdir)/$$f; \
@@ -60,7 +64,9 @@ link_sources:
for f in $$ms $(mysysheaders); do \
rm -f $(srcdir)/$$f; \
@LN_CP_F@ $(srcdir)/../mysys/$$f $(srcdir)/$$f; \
- done;
+ done; \
+ rm -f $(srcdir)/net.c; \
+ @LN_CP_F@ $(srcdir)/../sql/net_serv.cc $(srcdir)/net.c
# This part requires GNUmake
#
@@ -77,7 +83,7 @@ nh = my_global.h config-win32.h dbug.h errmsg.h \
mysql.h mysql_com.h mysql_version.h mysqld_error.h \
mysys_err.h my_pthread.h thr_alarm.h violite.h hash.h
# Get a list of the needed objects
-lobjs = $(mysysobjects1) $(dbugobjects) $(mystringsobjects)
+lobjs = $(mysysobjects1) $(dbugobjects) $(mystringsobjects) $(sqlobjects)
do-lib-dist:
dir=libmysql-$(MYSQL_NO_DASH_VERSION); \
diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared
index c227165d2a5..a1020709d22 100644
--- a/libmysql/Makefile.shared
+++ b/libmysql/Makefile.shared
@@ -28,8 +28,8 @@ pkglib_LTLIBRARIES = $(target)
noinst_PROGRAMS = conf_to_src
-target_sources = libmysql.c net.c password.c manager.c \
- get_password.c errmsg.c
+target_sources = libmysql.c password.c manager.c \
+ get_password.c errmsg.c
mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
strmake.lo strend.lo \
@@ -60,13 +60,14 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
charset.lo hash.lo mf_iocache.lo \
mf_iocache2.lo my_seek.lo \
my_pread.lo mf_cache.lo my_vsnprintf.lo md5.lo \
- my_getopt.lo my_gethostbyname.lo
+ my_getopt.lo my_gethostbyname.lo my_port.lo
+sqlobjects = net.lo
# Not needed in the minimum library
-mysysobjects2 = getvar.lo my_lib.lo
+mysysobjects2 = my_lib.lo
mysysobjects = $(mysysobjects1) $(mysysobjects2)
-target_libadd = $(mysysobjects) $(mystringsobjects) $(dbugobjects) \
- $(vio_objects)
+target_libadd = $(mysysobjects) $(mystringsobjects) $(dbugobjects) \
+ $(vio_objects) $(sqlobjects)
target_ldflags = -version-info @SHARED_LIB_VERSION@
vio_objects= vio.lo viosocket.lo viossl.lo viosslfactories.lo
CLEANFILES = $(target_libadd) $(SHLIBOBJS) \
@@ -82,9 +83,8 @@ clean-local:
rm -f `echo $(mystringsobjects) | sed "s;\.lo;.c;g"` \
`echo $(dbugobjects) | sed "s;\.lo;.c;g"` \
`echo $(mysysobjects) | sed "s;\.lo;.c;g"` \
- `echo $(vio_objects) | sed "s;\.lo;.c;g"` \
$(mystringsextra) $(mysysheaders) \
- ../linked_client_sources
+ ../linked_client_sources net.c
conf_to_src_SOURCES = conf_to_src.c
conf_to_src_LDADD=
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 0451e3a89c0..052907d8c28 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -61,6 +61,10 @@
static my_bool mysql_client_init=0;
uint mysql_port=0;
my_string mysql_unix_port=0;
+ulong net_buffer_length=8192;
+ulong max_allowed_packet=16*1024*1024L;
+ulong net_read_timeout= NET_READ_TIMEOUT;
+ulong net_write_timeout= NET_WRITE_TIMEOUT;
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG\
| CLIENT_LOCAL_FILES | CLIENT_TRANSACTIONS\
@@ -156,12 +160,12 @@ static MYSQL* spawn_init(MYSQL* parent, const char* host,
/****************************************************************************
-* A modified version of connect(). connect2() allows you to specify
-* a timeout value, in seconds, that we should wait until we
-* derermine we can't connect to a particular host. If timeout is 0,
-* my_connect() will behave exactly like connect().
-*
-* Base version coded by Steve Bernacki, Jr. <steve@navinet.net>
+ A modified version of connect(). connect2() allows you to specify
+ a timeout value, in seconds, that we should wait until we
+ derermine we can't connect to a particular host. If timeout is 0,
+ my_connect() will behave exactly like connect().
+
+ Base version coded by Steve Bernacki, Jr. <steve@navinet.net>
*****************************************************************************/
int my_connect(my_socket s, const struct sockaddr *name, uint namelen,
@@ -261,7 +265,7 @@ int my_connect(my_socket s, const struct sockaddr *name, uint namelen,
}
/*
-** Create a named pipe connection
+ Create a named pipe connection
*/
#ifdef __WIN__
@@ -334,8 +338,8 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
/*****************************************************************************
-** read a packet from server. Give error message if socket was down
-** or packet is an error message
+ read a packet from server. Give error message if socket was down
+ or packet is an error message
*****************************************************************************/
ulong
@@ -473,11 +477,7 @@ simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
if (mysql->net.vio == 0)
{ /* Do reconnect if possible */
if (mysql_reconnect(mysql))
- {
- net->last_errno=CR_SERVER_GONE_ERROR;
- strmov(net->last_error,ER(net->last_errno));
goto end;
- }
}
if (mysql->status != MYSQL_STATUS_READY)
{
@@ -498,8 +498,9 @@ simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
{
DBUG_PRINT("error",("Can't send command to server. Error: %d",socket_errno));
end_server(mysql);
- if (mysql_reconnect(mysql) ||
- net_write_command(net,(uchar) command,arg,
+ if (mysql_reconnect(mysql))
+ goto end;
+ if (net_write_command(net,(uchar) command,arg,
length ? length : (ulong) strlen(arg)))
{
net->last_errno=CR_SERVER_GONE_ERROR;
@@ -581,7 +582,7 @@ static my_bool is_NT(void)
#endif
/*
-** Expand wildcard to a sql string
+ Expand wildcard to a sql string
*/
static void
@@ -607,7 +608,7 @@ append_wild(char *to, char *end, const char *wild)
/**************************************************************************
-** Init debugging if MYSQL_DEBUG environment variable is found
+ Init debugging if MYSQL_DEBUG environment variable is found
**************************************************************************/
void STDCALL
@@ -644,7 +645,7 @@ mysql_debug(const char *debug __attribute__((unused)))
/**************************************************************************
-** Close the server connection if we get a SIGPIPE
+ Close the server connection if we get a SIGPIPE
ARGSUSED
**************************************************************************/
@@ -659,7 +660,7 @@ pipe_sig_handler(int sig __attribute__((unused)))
/**************************************************************************
-** Shut down connection
+ Shut down connection
**************************************************************************/
static void
@@ -713,7 +714,7 @@ mysql_free_result(MYSQL_RES *result)
/****************************************************************************
-** Get options from my.cnf
+ Get options from my.cnf
****************************************************************************/
static const char *default_options[]=
@@ -891,7 +892,7 @@ static void mysql_read_default_options(struct st_mysql_options *options,
/***************************************************************************
-** Change field rows to field structs
+ Change field rows to field structs
***************************************************************************/
static MYSQL_FIELD *
@@ -1045,8 +1046,8 @@ static MYSQL_DATA *read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
/*
-** Read one row. Uses packet buffer as storage for fields.
-** When next packet is read, the previous field values are destroyed
+ Read one row. Uses packet buffer as storage for fields.
+ When next packet is read, the previous field values are destroyed
*/
@@ -1173,62 +1174,73 @@ int STDCALL mysql_reads_from_master_enabled(MYSQL* mysql)
return !(mysql->options.no_master_reads);
}
-/* We may get an error while doing replication internals.
- In this case, we add a special explanation to the original
- error
+
+/*
+ We may get an error while doing replication internals.
+ In this case, we add a special explanation to the original
+ error
*/
-static inline void expand_error(MYSQL* mysql, int error)
+
+static void expand_error(MYSQL* mysql, int error)
{
char tmp[MYSQL_ERRMSG_SIZE];
- char* p, *tmp_end;
- tmp_end = strnmov(tmp, mysql->net.last_error, MYSQL_ERRMSG_SIZE);
- p = strnmov(mysql->net.last_error, ER(error), MYSQL_ERRMSG_SIZE);
- memcpy(p, tmp, tmp_end - tmp);
+ char *p;
+ uint err_length;
+ strmake(tmp, mysql->net.last_error, MYSQL_ERRMSG_SIZE-1);
+ p = strmake(mysql->net.last_error, ER(error), MYSQL_ERRMSG_SIZE-1);
+ err_length= (uint) (p - mysql->net.last_error);
+ strmake(p, tmp, MYSQL_ERRMSG_SIZE-1 - err_length);
mysql->net.last_errno = error;
}
-/* This function assumes we have just called SHOW SLAVE STATUS and have
- read the given result and row
+/*
+ This function assumes we have just called SHOW SLAVE STATUS and have
+ read the given result and row
*/
-static inline int get_master(MYSQL* mysql, MYSQL_RES* res, MYSQL_ROW row)
+
+static int get_master(MYSQL* mysql, MYSQL_RES* res, MYSQL_ROW row)
{
MYSQL* master;
+ DBUG_ENTER("get_master");
if (mysql_num_fields(res) < 3)
- return 1; /* safety */
+ DBUG_RETURN(1); /* safety */
/* use the same username and password as the original connection */
if (!(master = spawn_init(mysql, row[0], atoi(row[2]), 0, 0)))
- return 1;
+ DBUG_RETURN(1);
mysql->master = master;
- return 0;
+ DBUG_RETURN(0);
}
-/* assuming we already know that mysql points to a master connection,
- retrieve all the slaves
+
+/*
+ Assuming we already know that mysql points to a master connection,
+ retrieve all the slaves
*/
-static inline int get_slaves_from_master(MYSQL* mysql)
+
+static int get_slaves_from_master(MYSQL* mysql)
{
MYSQL_RES* res = 0;
MYSQL_ROW row;
int error = 1;
int has_auth_info;
int port_ind;
+ DBUG_ENTER("get_slaves_from_master");
if (!mysql->net.vio && !mysql_real_connect(mysql,0,0,0,0,0,0,0))
{
expand_error(mysql, CR_PROBE_MASTER_CONNECT);
- return 1;
+ DBUG_RETURN(1);
}
if (mysql_query(mysql, "SHOW SLAVE HOSTS") ||
- !(res = mysql_store_result(mysql)))
+ !(res = mysql_store_result(mysql)))
{
expand_error(mysql, CR_PROBE_SLAVE_HOSTS);
- return 1;
+ DBUG_RETURN(1);
}
- switch (mysql_num_fields(res))
- {
+ switch (mysql_num_fields(res)) {
case 5:
has_auth_info = 0;
port_ind=2;
@@ -1269,33 +1281,38 @@ static inline int get_slaves_from_master(MYSQL* mysql)
err:
if (res)
mysql_free_result(res);
- return error;
+ DBUG_RETURN(error);
}
+
int STDCALL mysql_rpl_probe(MYSQL* mysql)
{
- MYSQL_RES* res = 0;
+ MYSQL_RES *res= 0;
MYSQL_ROW row;
int error = 1;
- /* first determine the replication role of the server we connected to
- the most reliable way to do this is to run SHOW SLAVE STATUS and see
- if we have a non-empty master host. This is still not fool-proof -
- it is not a sin to have a master that has a dormant slave thread with
- a non-empty master host. However, it is more reliable to check
- for empty master than whether the slave thread is actually running
+ DBUG_ENTER("mysql_rpl_probe");
+
+ /*
+ First determine the replication role of the server we connected to
+ the most reliable way to do this is to run SHOW SLAVE STATUS and see
+ if we have a non-empty master host. This is still not fool-proof -
+ it is not a sin to have a master that has a dormant slave thread with
+ a non-empty master host. However, it is more reliable to check
+ for empty master than whether the slave thread is actually running
*/
if (mysql_query(mysql, "SHOW SLAVE STATUS") ||
- !(res = mysql_store_result(mysql)))
+ !(res = mysql_store_result(mysql)))
{
expand_error(mysql, CR_PROBE_SLAVE_STATUS);
- return 1;
+ DBUG_RETURN(1);
}
- if (!(row = mysql_fetch_row(res)))
- goto err;
-
- /* check master host for emptiness/NULL */
- if (row[0] && *(row[0]))
+ row= mysql_fetch_row(res);
+ /*
+ Check master host for emptiness/NULL
+ For MySQL 4.0 it's enough to check for row[0]
+ */
+ if (row && row[0] && *(row[0]))
{
/* this is a slave, ask it for the master */
if (get_master(mysql, res, row) || get_slaves_from_master(mysql))
@@ -1312,57 +1329,60 @@ int STDCALL mysql_rpl_probe(MYSQL* mysql)
err:
if (res)
mysql_free_result(res);
- return error;
+ DBUG_RETURN(error);
}
-/* make a not so fool-proof decision on where the query should go, to
- the master or the slave. Ideally the user should always make this
- decision himself with mysql_master_query() or mysql_slave_query().
- However, to be able to more easily port the old code, we support the
- option of an educated guess - this should work for most applications,
- however, it may make the wrong decision in some particular cases. If
- that happens, the user would have to change the code to call
- mysql_master_query() or mysql_slave_query() explicitly in the place
- where we have made the wrong decision
+/*
+ Make a not so fool-proof decision on where the query should go, to
+ the master or the slave. Ideally the user should always make this
+ decision himself with mysql_master_query() or mysql_slave_query().
+ However, to be able to more easily port the old code, we support the
+ option of an educated guess - this should work for most applications,
+ however, it may make the wrong decision in some particular cases. If
+ that happens, the user would have to change the code to call
+ mysql_master_query() or mysql_slave_query() explicitly in the place
+ where we have made the wrong decision
*/
+
enum mysql_rpl_type
STDCALL mysql_rpl_query_type(const char* q, int len)
{
const char* q_end;
q_end = (len) ? q + len : strend(q);
- for(; q < q_end; ++q)
+ for (; q < q_end; ++q)
{
char c;
- if (my_isalpha(system_charset_info,c=*q))
- switch(my_tolower(system_charset_info,c))
- {
- case 'i': /* insert */
- case 'u': /* update or unlock tables */
- case 'l': /* lock tables or load data infile */
- case 'd': /* drop or delete */
- case 'a': /* alter */
- return MYSQL_RPL_MASTER;
- case 'c': /* create or check */
- return my_tolower(system_charset_info,q[1]) == 'h' ? MYSQL_RPL_ADMIN :
- MYSQL_RPL_MASTER;
- case 's': /* select or show */
- return my_tolower(system_charset_info,q[1]) == 'h' ? MYSQL_RPL_ADMIN :
- MYSQL_RPL_SLAVE;
- case 'f': /* flush */
- case 'r': /* repair */
- case 'g': /* grant */
- return MYSQL_RPL_ADMIN;
- default:
- return MYSQL_RPL_SLAVE;
- }
+ if (my_isalpha(system_charset_info, (c= *q)))
+ {
+ switch (my_tolower(system_charset_info,c)) {
+ case 'i': /* insert */
+ case 'u': /* update or unlock tables */
+ case 'l': /* lock tables or load data infile */
+ case 'd': /* drop or delete */
+ case 'a': /* alter */
+ return MYSQL_RPL_MASTER;
+ case 'c': /* create or check */
+ return my_tolower(system_charset_info,q[1]) == 'h' ? MYSQL_RPL_ADMIN :
+ MYSQL_RPL_MASTER;
+ case 's': /* select or show */
+ return my_tolower(system_charset_info,q[1]) == 'h' ? MYSQL_RPL_ADMIN :
+ MYSQL_RPL_SLAVE;
+ case 'f': /* flush */
+ case 'r': /* repair */
+ case 'g': /* grant */
+ return MYSQL_RPL_ADMIN;
+ default:
+ return MYSQL_RPL_SLAVE;
+ }
+ }
}
return MYSQL_RPL_MASTER; /* By default, send to master */
}
/****************************************************************************
-** Init MySQL structure or allocate one
+ Init MySQL structure or allocate one
****************************************************************************/
MYSQL * STDCALL
@@ -1381,8 +1401,9 @@ mysql_init(MYSQL *mysql)
mysql->options.connect_timeout=CONNECT_TIMEOUT;
mysql->last_used_con = mysql->next_slave = mysql->master = mysql;
mysql->last_used_slave = 0;
- /* By default, we are a replication pivot. The caller must reset it
- after we return if this is not the case.
+ /*
+ By default, we are a replication pivot. The caller must reset it
+ after we return if this is not the case.
*/
mysql->rpl_pivot = 1;
#if defined(SIGPIPE) && defined(THREAD) && !defined(__WIN__)
@@ -1446,39 +1467,38 @@ static void mysql_once_init()
}
/**************************************************************************
-** Fill in SSL part of MYSQL structure and set 'use_ssl' flag.
-** NB! Errors are not reported until you do mysql_real_connect.
+ Fill in SSL part of MYSQL structure and set 'use_ssl' flag.
+ NB! Errors are not reported until you do mysql_real_connect.
**************************************************************************/
+#define strdup_if_not_null(A) (A) == 0 ? 0 : my_strdup((A),MYF(MY_WME))
+
int STDCALL
mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
- const char *key __attribute__((unused)),
- const char *cert __attribute__((unused)),
- const char *ca __attribute__((unused)),
- const char *capath __attribute__((unused)),
- const char *cipher __attribute__((unused)))
+ const char *key __attribute__((unused)),
+ const char *cert __attribute__((unused)),
+ const char *ca __attribute__((unused)),
+ const char *capath __attribute__((unused)),
+ const char *cipher __attribute__((unused)))
{
#ifdef HAVE_OPENSSL
- mysql->options.ssl_key = key==0 ? 0 : my_strdup(key,MYF(0));
- mysql->options.ssl_cert = cert==0 ? 0 : my_strdup(cert,MYF(0));
- mysql->options.ssl_ca = ca==0 ? 0 : my_strdup(ca,MYF(0));
- mysql->options.ssl_capath = capath==0 ? 0 : my_strdup(capath,MYF(0));
- mysql->options.ssl_cipher = cipher==0 ? 0 : my_strdup(cipher,MYF(0));
- mysql->options.use_ssl = TRUE;
- mysql->connector_fd = (gptr)new_VioSSLConnectorFd(key, cert, ca, capath, cipher);
- DBUG_PRINT("info",("mysql_ssl_set, context: %p",((struct st_VioSSLConnectorFd *)(mysql->connector_fd))->ssl_context_));
+ mysql->options.ssl_key= strdup_if_not_null(key);
+ mysql->options.ssl_cert= strdup_if_not_null(cert);
+ mysql->options.ssl_ca= strdup_if_not_null(ca);
+ mysql->options.ssl_capath= strdup_if_not_null(capath);
+ mysql->options.ssl_cipher= strdup_if_not_null(cipher);
#endif
return 0;
}
-/*
-***************************************************************************
-** Free strings in the SSL structure and clear 'use_ssl' flag.
-** NB! Errors are not reported until you do mysql_real_connect.
-**************************************************************************
-*/
-int STDCALL
-mysql_ssl_clear(MYSQL *mysql __attribute__((unused)))
+
+/**************************************************************************
+ Free strings in the SSL structure and clear 'use_ssl' flag.
+ NB! Errors are not reported until you do mysql_real_connect.
+**************************************************************************/
+
+static int
+mysql_ssl_free(MYSQL *mysql __attribute__((unused)))
{
#ifdef HAVE_OPENSSL
my_free(mysql->options.ssl_key, MYF(MY_ALLOW_ZERO_PTR));
@@ -1486,21 +1506,21 @@ mysql_ssl_clear(MYSQL *mysql __attribute__((unused)))
my_free(mysql->options.ssl_ca, MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->options.ssl_capath, MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->options.ssl_cipher, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(mysql->connector_fd,MYF(MY_ALLOW_ZERO_PTR));
mysql->options.ssl_key = 0;
mysql->options.ssl_cert = 0;
mysql->options.ssl_ca = 0;
mysql->options.ssl_capath = 0;
mysql->options.ssl_cipher= 0;
mysql->options.use_ssl = FALSE;
- my_free(mysql->connector_fd,MYF(MY_ALLOW_ZERO_PTR));
mysql->connector_fd = 0;
#endif /* HAVE_OPENSSL */
return 0;
}
/**************************************************************************
-** Connect to sql server
-** If host == 0 then use localhost
+ Connect to sql server
+ If host == 0 then use localhost
**************************************************************************/
#ifdef USE_OLD_FUNCTIONS
@@ -1524,8 +1544,8 @@ mysql_connect(MYSQL *mysql,const char *host,
/*
-** Note that the mysql argument must be initialized with mysql_init()
-** before calling mysql_real_connect !
+ Note that the mysql argument must be initialized with mysql_init()
+ before calling mysql_real_connect !
*/
MYSQL * STDCALL
@@ -1645,7 +1665,11 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
if (mysql->options.named_pipe ||
(host && !strcmp(host,LOCAL_HOST_NAMEDPIPE)) ||
(unix_socket && !strcmp(unix_socket,MYSQL_NAMEDPIPE)))
+ {
+ net->last_errno= CR_SERVER_LOST;
+ strmov(net->last_error,ER(net->last_errno));
goto error; /* User only requested named pipes */
+ }
/* Try also with TCP/IP */
}
else
@@ -1694,9 +1718,9 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
&tmp_errno);
if (!hp)
{
+ my_gethostbyname_r_free();
net->last_errno=CR_UNKNOWN_HOST;
sprintf(net->last_error, ER(CR_UNKNOWN_HOST), host, tmp_errno);
- my_gethostbyname_r_free();
goto error;
}
memcpy(&sock_addr.sin_addr,hp->h_addr, (size_t) hp->h_length);
@@ -1833,6 +1857,10 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
client_flag|=CLIENT_CAPABILITIES;
#ifdef HAVE_OPENSSL
+ if (mysql->options.ssl_key || mysql->options.ssl_cert ||
+ mysql->options.ssl_ca || mysql->options.ssl_capath ||
+ mysql->options.ssl_cipher)
+ mysql->options.use_ssl= 1;
if (mysql->options.use_ssl)
client_flag|=CLIENT_SSL;
#endif /* HAVE_OPENSSL */
@@ -1867,16 +1895,36 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
mysql->client_flag=client_flag;
#ifdef HAVE_OPENSSL
- /* Oops.. are we careful enough to not send ANY information */
- /* without encryption? */
+ /*
+ Oops.. are we careful enough to not send ANY information without
+ encryption?
+ */
if (client_flag & CLIENT_SSL)
{
+ struct st_mysql_options *options= &mysql->options;
if (my_net_write(net,buff,(uint) (2)) || net_flush(net))
+ {
+ net->last_errno= CR_SERVER_LOST;
+ strmov(net->last_error,ER(net->last_errno));
goto error;
+ }
/* Do the SSL layering. */
+ if (!(mysql->connector_fd=
+ (gptr) new_VioSSLConnectorFd(options->ssl_key,
+ options->ssl_cert,
+ options->ssl_ca,
+ options->ssl_capath,
+ options->ssl_cipher)))
+ {
+ /* TODO: Change to SSL error */
+ net->last_errno= CR_SERVER_LOST;
+ strmov(net->last_error,ER(net->last_errno));
+ goto error;
+ }
DBUG_PRINT("info", ("IO layer change in progress..."));
- DBUG_PRINT("info", ("IO context %p",((struct st_VioSSLConnectorFd*)mysql->connector_fd)->ssl_context_));
- sslconnect((struct st_VioSSLConnectorFd*)(mysql->connector_fd),mysql->net.vio, (long)(mysql->options.connect_timeout));
+ /* TODO: Add proper error checking here, with return error message */
+ sslconnect((struct st_VioSSLConnectorFd*)(mysql->connector_fd),
+ mysql->net.vio, (long) (mysql->options.connect_timeout));
DBUG_PRINT("info", ("IO layer change done!"));
}
#endif /* HAVE_OPENSSL */
@@ -1902,8 +1950,13 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
mysql->db=my_strdup(db,MYF(MY_WME));
db=0;
}
- if (my_net_write(net,buff,(ulong) (end-buff)) || net_flush(net) ||
- net_safe_read(mysql) == packet_error)
+ if (my_net_write(net,buff,(ulong) (end-buff)) || net_flush(net))
+ {
+ net->last_errno= CR_SERVER_LOST;
+ strmov(net->last_error,ER(net->last_errno));
+ goto error;
+ }
+ if (net_safe_read(mysql) == packet_error)
goto error;
if (client_flag & CLIENT_COMPRESS) /* We will use compression */
net->compress=1;
@@ -1940,7 +1993,9 @@ error:
DBUG_RETURN(0);
}
+
/* needed when we move MYSQL structure to a different address */
+
static void mysql_fix_pointers(MYSQL* mysql, MYSQL* old_mysql)
{
MYSQL *tmp, *tmp_prev;
@@ -1958,6 +2013,7 @@ static void mysql_fix_pointers(MYSQL* mysql, MYSQL* old_mysql)
tmp_prev->next_slave = mysql;
}
+
static my_bool mysql_reconnect(MYSQL *mysql)
{
MYSQL tmp_mysql;
@@ -1968,6 +2024,8 @@ static my_bool mysql_reconnect(MYSQL *mysql)
{
/* Allow reconnect next time */
mysql->server_status&= ~SERVER_STATUS_IN_TRANS;
+ mysql->net.last_errno=CR_SERVER_GONE_ERROR;
+ strmov(mysql->net.last_error,ER(mysql->net.last_errno));
DBUG_RETURN(1);
}
mysql_init(&tmp_mysql);
@@ -1977,7 +2035,11 @@ static my_bool mysql_reconnect(MYSQL *mysql)
if (!mysql_real_connect(&tmp_mysql,mysql->host,mysql->user,mysql->passwd,
mysql->db, mysql->port, mysql->unix_socket,
mysql->client_flag))
+ {
+ mysql->net.last_errno= tmp_mysql.net.last_errno;
+ strmov(mysql->net.last_error, tmp_mysql.net.last_error);
DBUG_RETURN(1);
+ }
tmp_mysql.free_me=mysql->free_me;
mysql->free_me=0;
mysql_close(mysql);
@@ -1990,7 +2052,7 @@ static my_bool mysql_reconnect(MYSQL *mysql)
/**************************************************************************
-** Change user and database
+ Change user and database
**************************************************************************/
my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
@@ -2023,7 +2085,7 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
/**************************************************************************
-** Set current database
+ Set current database
**************************************************************************/
int STDCALL
@@ -2042,8 +2104,8 @@ mysql_select_db(MYSQL *mysql, const char *db)
/*************************************************************************
-** Send a QUIT to the server and close the connection
-** If handle is alloced by mysql connect free it.
+ Send a QUIT to the server and close the connection
+ If handle is alloced by mysql connect free it.
*************************************************************************/
void STDCALL
@@ -2058,7 +2120,7 @@ mysql_close(MYSQL *mysql)
mysql->status=MYSQL_STATUS_READY; /* Force command */
mysql->reconnect=0;
simple_command(mysql,COM_QUIT,NullS,0,1);
- end_server(mysql);
+ end_server(mysql); /* Sets mysql->net.vio= 0 */
}
my_free((gptr) mysql->host_info,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->user,MYF(MY_ALLOW_ZERO_PTR));
@@ -2075,12 +2137,11 @@ mysql_close(MYSQL *mysql)
my_free(mysql->options.charset_dir,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->options.charset_name,MYF(MY_ALLOW_ZERO_PTR));
#ifdef HAVE_OPENSSL
- mysql_ssl_clear(mysql);
+ mysql_ssl_free(mysql);
#endif /* HAVE_OPENSSL */
/* Clear pointers for better safety */
mysql->host_info=mysql->user=mysql->passwd=mysql->db=0;
bzero((char*) &mysql->options,sizeof(mysql->options));
- mysql->net.vio = 0;
/* free/close slave list */
if (mysql->rpl_pivot)
@@ -2105,8 +2166,8 @@ mysql_close(MYSQL *mysql)
/**************************************************************************
-** Do a query. If query returned rows, free old rows.
-** Read data by mysql_store_result or by repeat call of mysql_fetch_row
+ Do a query. If query returned rows, free old rows.
+ Read data by mysql_store_result or by repeat call of mysql_fetch_row
**************************************************************************/
int STDCALL
@@ -2330,8 +2391,8 @@ err:
/**************************************************************************
-** Alloc result struct for buffered results. All rows are read to buffer.
-** mysql_data_seek may be used.
+ Alloc result struct for buffered results. All rows are read to buffer.
+ mysql_data_seek may be used.
**************************************************************************/
MYSQL_RES * STDCALL
@@ -2381,13 +2442,13 @@ mysql_store_result(MYSQL *mysql)
/**************************************************************************
-** Alloc struct for use with unbuffered reads. Data is fetched by domand
-** when calling to mysql_fetch_row.
-** mysql_data_seek is a noop.
-**
-** No other queries may be specified with the same MYSQL handle.
-** There shouldn't be much processing per row because mysql server shouldn't
-** have to wait for the client (and will not wait more than 30 sec/packet).
+ Alloc struct for use with unbuffered reads. Data is fetched by domand
+ when calling to mysql_fetch_row.
+ mysql_data_seek is a noop.
+
+ No other queries may be specified with the same MYSQL handle.
+ There shouldn't be much processing per row because mysql server shouldn't
+ have to wait for the client (and will not wait more than 30 sec/packet).
**************************************************************************/
MYSQL_RES * STDCALL
@@ -2431,7 +2492,7 @@ mysql_use_result(MYSQL *mysql)
/**************************************************************************
-** Return next field of the query results
+ Return next field of the query results
**************************************************************************/
MYSQL_FIELD * STDCALL
@@ -2444,7 +2505,7 @@ mysql_fetch_field(MYSQL_RES *result)
/**************************************************************************
-** Return next row of the query results
+ Return next row of the query results
**************************************************************************/
MYSQL_ROW STDCALL
@@ -2485,9 +2546,9 @@ mysql_fetch_row(MYSQL_RES *res)
}
/**************************************************************************
-** Get column lengths of the current row
-** If one uses mysql_use_result, res->lengths contains the length information,
-** else the lengths are calculated from the offset between pointers.
+ Get column lengths of the current row
+ If one uses mysql_use_result, res->lengths contains the length information,
+ else the lengths are calculated from the offset between pointers.
**************************************************************************/
ulong * STDCALL
@@ -2521,7 +2582,7 @@ mysql_fetch_lengths(MYSQL_RES *res)
}
/**************************************************************************
-** Move to a specific row and column
+ Move to a specific row and column
**************************************************************************/
void STDCALL
@@ -2536,9 +2597,9 @@ mysql_data_seek(MYSQL_RES *result, my_ulonglong row)
}
/*************************************************************************
-** put the row or field cursor one a position one got from mysql_row_tell()
-** This doesn't restore any data. The next mysql_fetch_row or
-** mysql_fetch_field will return the next row or field after the last used
+ put the row or field cursor one a position one got from mysql_row_tell()
+ This doesn't restore any data. The next mysql_fetch_row or
+ mysql_fetch_field will return the next row or field after the last used
*************************************************************************/
MYSQL_ROW_OFFSET STDCALL
@@ -2560,7 +2621,7 @@ mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET field_offset)
}
/*****************************************************************************
-** List all databases
+ List all databases
*****************************************************************************/
MYSQL_RES * STDCALL
@@ -2577,8 +2638,8 @@ mysql_list_dbs(MYSQL *mysql, const char *wild)
/*****************************************************************************
-** List all tables in a database
-** If wild is given then only the tables matching wild is returned
+ List all tables in a database
+ If wild is given then only the tables matching wild is returned
*****************************************************************************/
MYSQL_RES * STDCALL
@@ -2595,10 +2656,10 @@ mysql_list_tables(MYSQL *mysql, const char *wild)
/**************************************************************************
-** List all fields in a table
-** If wild is given then only the fields matching wild is returned
-** Instead of this use query:
-** show fields in 'table' like "wild"
+ List all fields in a table
+ If wild is given then only the fields matching wild is returned
+ Instead of this use query:
+ show fields in 'table' like "wild"
**************************************************************************/
MYSQL_RES * STDCALL
@@ -2814,8 +2875,8 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const char *arg)
}
/****************************************************************************
-** Functions to get information from the MySQL structure
-** These are functions to make shared libraries more usable.
+ Functions to get information from the MySQL structure
+ These are functions to make shared libraries more usable.
****************************************************************************/
/* MYSQL_RES */
@@ -2907,13 +2968,26 @@ uint STDCALL mysql_thread_safe(void)
}
/****************************************************************************
-** Some support functions
+ Some support functions
****************************************************************************/
/*
-** Add escape characters to a string (blob?) to make it suitable for a insert
-** to should at least have place for length*2+1 chars
-** Returns the length of the to string
+ Functions called my my_net_init() to set some application specific variables
+*/
+
+void my_net_local_init(NET *net)
+{
+ net->max_packet= (uint) net_buffer_length;
+ net->read_timeout= (uint) net_read_timeout;
+ net->write_timeout=(uint) net_write_timeout;
+ net->retry_count= 1;
+ net->max_packet_size= max(net_buffer_length, max_allowed_packet);
+}
+
+/*
+ Add escape characters to a string (blob?) to make it suitable for a insert
+ to should at least have place for length*2+1 chars
+ Returns the length of the to string
*/
ulong STDCALL
diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def
index 9405ecd58ff..46ca5acafcc 100644
--- a/libmysql/libmysql.def
+++ b/libmysql/libmysql.def
@@ -89,8 +89,7 @@ EXPORTS
mysql_read_query_result
mysql_real_escape_string
mysql_ssl_set
- mysql_ssl_clear
- mysql_real_connect
+ mysql_real_connect
mysql_master_query
mysql_master_send_query
mysql_slave_query
diff --git a/libmysql/manager.c b/libmysql/manager.c
index 330c070777c..22b109caea8 100644
--- a/libmysql/manager.c
+++ b/libmysql/manager.c
@@ -54,9 +54,6 @@
#endif
#define RES_BUF_SHIFT 5
-#ifndef __WIN__
-#define SOCKET_ERROR -1
-#endif
#define NET_BUF_SIZE 2048
MYSQL_MANAGER* STDCALL mysql_manager_init(MYSQL_MANAGER* con)
@@ -93,6 +90,7 @@ MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
char msg_buf[MAX_MYSQL_MANAGER_MSG];
int msg_len;
Vio* vio;
+ my_bool not_used;
if (!host)
host="localhost";
@@ -101,7 +99,7 @@ MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
if (!passwd)
passwd="";
- if ((sock=(my_socket)socket(AF_INET,SOCK_STREAM,0)) == SOCKET_ERROR)
+ if ((sock=(my_socket)socket(AF_INET,SOCK_STREAM,0)) == INVALID_SOCKET)
{
con->last_errno=errno;
strmov(con->last_error,"Cannot create socket");
@@ -113,7 +111,7 @@ MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
strmov(con->last_error,"Cannot create network I/O object");
goto err;
}
- vio_blocking(vio,TRUE);
+ vio_blocking(vio, TRUE, &not_used);
my_net_init(&con->net,vio);
bzero((char*) &sock_addr,sizeof(sock_addr));
sock_addr.sin_family = AF_INET;
@@ -185,6 +183,7 @@ MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
strmov(con->user,user);
strmov(con->passwd,passwd);
return con;
+
err:
{
my_bool free_me=con->free_me;
@@ -195,18 +194,20 @@ err:
return 0;
}
-void STDCALL mysql_manager_close(MYSQL_MANAGER* con)
+void STDCALL mysql_manager_close(MYSQL_MANAGER* con)
{
- my_free((gptr)con->host,MYF(MY_ALLOW_ZERO_PTR));
- /* no need to free con->user and con->passwd, because they were
- allocated in my_multimalloc() along with con->host, freeing
- con->hosts frees the whole block
+ /*
+ No need to free con->user and con->passwd, because they were
+ allocated in my_multimalloc() along with con->host, freeing
+ con->hosts frees the whole block
*/
+ my_free((gptr)con->host,MYF(MY_ALLOW_ZERO_PTR));
net_end(&con->net);
if (con->free_me)
my_free((gptr)con,MYF(0));
}
+
int STDCALL mysql_manager_command(MYSQL_MANAGER* con,const char* cmd,
int cmd_len)
{
@@ -222,8 +223,9 @@ int STDCALL mysql_manager_command(MYSQL_MANAGER* con,const char* cmd,
return 0;
}
-int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con, char* res_buf,
- int res_buf_size)
+
+int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con, char* res_buf,
+ int res_buf_size)
{
char* res_buf_end=res_buf+res_buf_size;
char* net_buf=(char*) con->net.read_pos, *net_buf_end;
@@ -252,7 +254,7 @@ int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con, char* res_buf,
res_buf_end[-1]=0;
for (;net_buf<net_buf_end && res_buf < res_buf_end;res_buf++,net_buf++)
{
- if((*res_buf=*net_buf) == '\r')
+ if ((*res_buf=*net_buf) == '\r')
{
*res_buf=0;
break;
diff --git a/libmysql/net.c b/libmysql/net.c
deleted file mode 100644
index 0d6e548a873..00000000000
--- a/libmysql/net.c
+++ /dev/null
@@ -1,826 +0,0 @@
-/* Copyright (C) 2000 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* Write and read of logical packets to/from socket
-** Writes are cached into net_buffer_length big packets.
-** Read packets are reallocated dynamicly when reading big packets.
-** Each logical packet has the following pre-info:
-** 3 byte length & 1 byte package-number.
-*/
-
-#ifdef EMBEDDED_LIBRARY
-#define net_read_timeout net_read_timeout1
-#define net_write_timeout net_write_timeout1
-#endif
-
-#ifdef __WIN__
-#include <winsock.h>
-#endif
-#include <my_global.h>
-#include <mysql.h>
-#include <mysql_embed.h>
-#include <mysql_com.h>
-#include <mysqld_error.h>
-#include <my_sys.h>
-#include <m_string.h>
-#include <my_net.h>
-#include <violite.h>
-#include <signal.h>
-#include <errno.h>
-
-/*
- The following handles the differences when this is linked between the
- client and the server.
-
- This gives an error if a too big packet is found
- The server can change this with the -O switch, but because the client
- can't normally do this the client should have a bigger max_allowed_packet.
-*/
-
-#ifdef MYSQL_SERVER
-ulong max_allowed_packet=65536;
-extern ulong net_read_timeout,net_write_timeout;
-extern uint test_flags;
-#define USE_QUERY_CACHE
-extern void query_cache_insert(NET *net, const char *packet, ulong length);
-#else
-ulong max_allowed_packet=16*1024*1024L;
-ulong net_read_timeout= NET_READ_TIMEOUT;
-ulong net_write_timeout= NET_WRITE_TIMEOUT;
-#endif
-
-#if defined(__WIN__) || !defined(MYSQL_SERVER)
- /* The following is because alarms doesn't work on windows. */
-#define NO_ALARM
-#endif
-
-#ifndef NO_ALARM
-#include "my_pthread.h"
-void sql_print_error(const char *format,...);
-#define RETRY_COUNT mysqld_net_retry_count
-extern ulong mysqld_net_retry_count;
-extern ulong bytes_sent, bytes_received;
-extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received;
-#else
-#undef statistic_add
-#define statistic_add(A,B,C)
-#define DONT_USE_THR_ALARM
-#define RETRY_COUNT 1
-#endif /* NO_ALARM */
-
-#include "thr_alarm.h"
-
-#define TEST_BLOCKING 8
-#define MAX_THREE_BYTES 255L*255L*255L
-
-ulong net_buffer_length=8192; /* Default length. Enlarged if necessary */
-
-static int net_write_buff(NET *net,const char *packet,ulong len);
-
-
- /* Init with packet info */
-
-int my_net_init(NET *net, Vio* vio)
-{
- if (!(net->buff=(uchar*) my_malloc((uint32) net_buffer_length+
- NET_HEADER_SIZE + COMP_HEADER_SIZE,
- MYF(MY_WME))))
- return 1;
- if (net_buffer_length > max_allowed_packet)
- max_allowed_packet=net_buffer_length;
- net->buff_end=net->buff+(net->max_packet=net_buffer_length);
- net->vio = vio;
- net->no_send_ok = 0;
- net->error=0; net->return_errno=0; net->return_status=0;
- net->timeout=(uint) net_read_timeout; /* Timeout for read */
- net->pkt_nr=net->compress_pkt_nr=0;
- net->write_pos=net->read_pos = net->buff;
- net->last_error[0]=0;
- net->compress=0; net->reading_or_writing=0;
- net->where_b = net->remain_in_buf=0;
- net->last_errno=0;
- net->query_cache_query=0;
-
- if (vio != 0) /* If real connection */
- {
- net->fd = vio_fd(vio); /* For perl DBI/DBD */
-#if defined(MYSQL_SERVER) && !defined(___WIN__) && !defined(__EMX__) && !defined(OS2)
- if (!(test_flags & TEST_BLOCKING))
- vio_blocking(vio, FALSE);
-#endif
- vio_fastsend(vio);
- }
- return 0;
-}
-
-void net_end(NET *net)
-{
- my_free((gptr) net->buff,MYF(MY_ALLOW_ZERO_PTR));
- net->buff=0;
-}
-
-/* Realloc the packet buffer */
-
-static my_bool net_realloc(NET *net, ulong length)
-{
- uchar *buff;
- ulong pkt_length;
- if (length >= max_allowed_packet)
- {
- DBUG_PRINT("error",("Packet too large (%lu)", length));
- net->error=1;
- net->last_errno=ER_NET_PACKET_TOO_LARGE;
- return 1;
- }
- pkt_length = (length+IO_SIZE-1) & ~(IO_SIZE-1);
- /* We must allocate some extra bytes for the end 0 and to be able to
- read big compressed blocks */
- if (!(buff=(uchar*) my_realloc((char*) net->buff, (uint32) pkt_length +
- NET_HEADER_SIZE + COMP_HEADER_SIZE,
- MYF(MY_WME))))
- {
- net->error=1;
-#ifdef MYSQL_SERVER
- net->last_errno=ER_OUT_OF_RESOURCES;
-#endif
- return 1;
- }
- net->buff=net->write_pos=buff;
- net->buff_end=buff+(net->max_packet=pkt_length);
- return 0;
-}
-
- /* Remove unwanted characters from connection */
-
-void net_clear(NET *net)
-{
-#if !defined(EXTRA_DEBUG) && !defined(EMBEDDED_LIBRARY)
- int count; /* One may get 'unused' warn */
- bool is_blocking=vio_is_blocking(net->vio);
- if (is_blocking)
- vio_blocking(net->vio, FALSE);
- if (!vio_is_blocking(net->vio)) /* Safety if SSL */
- {
- while ( (count = vio_read(net->vio, (char*) (net->buff),
- (uint32) net->max_packet)) > 0)
- DBUG_PRINT("info",("skipped %d bytes from file: %s",
- count,vio_description(net->vio)));
- if (is_blocking)
- vio_blocking(net->vio, TRUE);
- }
-#endif /* EXTRA_DEBUG */
- net->pkt_nr=net->compress_pkt_nr=0; /* Ready for new command */
- net->write_pos=net->buff;
-}
-
- /* Flush write_buffer if not empty. */
-
-int net_flush(NET *net)
-{
- int error=0;
- DBUG_ENTER("net_flush");
- if (net->buff != net->write_pos)
- {
- error=net_real_write(net,(char*) net->buff,
- (ulong) (net->write_pos - net->buff));
- net->write_pos=net->buff;
- }
- /* Sync packet number if using compression */
- if (net->compress)
- net->pkt_nr=net->compress_pkt_nr;
- DBUG_RETURN(error);
-}
-
-
-/*****************************************************************************
-** Write something to server/client buffer
-*****************************************************************************/
-
-/*
-** Write a logical packet with packet header
-** Format: Packet length (3 bytes), packet number(1 byte)
-** When compression is used a 3 byte compression length is added
-** NOTE: If compression is used the original package is modified!
-*/
-
-int
-my_net_write(NET *net,const char *packet,ulong len)
-{
- uchar buff[NET_HEADER_SIZE];
- /*
- Big packets are handled by splitting them in packets of MAX_THREE_BYTES
- length. The last packet is always a packet that is < MAX_THREE_BYTES.
- (The last packet may even have a lengt of 0)
- */
- while (len >= MAX_THREE_BYTES)
- {
- const ulong z_size = MAX_THREE_BYTES;
- int3store(buff, z_size);
- buff[3]= (uchar) net->pkt_nr++;
- if (net_write_buff(net, (char*) buff, NET_HEADER_SIZE) ||
- net_write_buff(net, packet, z_size))
- return 1;
- packet += z_size;
- len-= z_size;
- }
- /* Write last packet */
- int3store(buff,len);
- buff[3]= (uchar) net->pkt_nr++;
- if (net_write_buff(net,(char*) buff,NET_HEADER_SIZE))
- return 1;
- return net_write_buff(net,packet,len);
-}
-
-/*
- Send a command to the server.
- As the command is part of the first data packet, we have to do some data
- juggling to put the command in there, without having to create a new
- packet.
- This function will split big packets into sub-packets if needed.
- (Each sub packet can only be 2^24 bytes)
-*/
-
-int
-net_write_command(NET *net,uchar command,const char *packet,ulong len)
-{
- ulong length=len+1; /* 1 extra byte for command */
- uchar buff[NET_HEADER_SIZE+1];
- uint header_size=NET_HEADER_SIZE+1;
- buff[4]=command; /* For first packet */
-
- if (length >= MAX_THREE_BYTES)
- {
- /* Take into account that we have the command in the first header */
- len= MAX_THREE_BYTES -1;
- do
- {
- int3store(buff, MAX_THREE_BYTES);
- buff[3]= (uchar) net->pkt_nr++;
- if (net_write_buff(net,(char*) buff, header_size) ||
- net_write_buff(net,packet,len))
- return 1;
- packet+= len;
- length-= MAX_THREE_BYTES;
- len=MAX_THREE_BYTES;
- header_size=NET_HEADER_SIZE;
- } while (length >= MAX_THREE_BYTES);
- len=length; /* Data left to be written */
- }
- int3store(buff,length);
- buff[3]= (uchar) net->pkt_nr++;
- return test(net_write_buff(net,(char*) buff,header_size) ||
- net_write_buff(net,packet,len) || net_flush(net));
-}
-
-/*
- Caching the data in a local buffer before sending it.
- One can force the buffer to be flushed with 'net_flush'.
-*/
-
-static int
-net_write_buff(NET *net,const char *packet,ulong len)
-{
- ulong left_length=(ulong) (net->buff_end - net->write_pos);
-
- while (len > left_length)
- {
- memcpy((char*) net->write_pos,packet,left_length);
- if (net_real_write(net,(char*) net->buff,net->max_packet))
- return 1;
- net->write_pos=net->buff;
- packet+=left_length;
- len-=left_length;
- left_length=net->max_packet;
- }
- memcpy((char*) net->write_pos,packet,len);
- net->write_pos+=len;
- return 0;
-}
-
-
-/*
- Read and write one packet using timeouts.
- If needed, the packet is compressed before sending.
-*/
-
-int
-net_real_write(NET *net,const char *packet,ulong len)
-{
- long int length;
- char *pos,*end;
- thr_alarm_t alarmed;
-#ifndef NO_ALARM
- ALARM alarm_buff;
-#endif
- uint retry_count=0;
- my_bool net_blocking = vio_is_blocking(net->vio);
- DBUG_ENTER("net_real_write");
-
-#if defined(MYSQL_SERVER) && defined(HAVE_QUERY_CACHE)
- if (net->query_cache_query != 0)
- query_cache_insert(net, packet, len);
-#endif
-
- if (net->error == 2)
- DBUG_RETURN(-1); /* socket can't be used */
-
- net->reading_or_writing=2;
-#ifdef HAVE_COMPRESS
- if (net->compress)
- {
- ulong complen;
- uchar *b;
- uint header_length=NET_HEADER_SIZE+COMP_HEADER_SIZE;
- if (!(b=(uchar*) my_malloc((uint32) len + NET_HEADER_SIZE +
- COMP_HEADER_SIZE, MYF(MY_WME))))
- {
-#ifdef MYSQL_SERVER
- net->last_errno=ER_OUT_OF_RESOURCES;
- net->error=2;
-#endif
- net->reading_or_writing=0;
- DBUG_RETURN(1);
- }
- memcpy(b+header_length,packet,len);
-
- if (my_compress((byte*) b+header_length,&len,&complen))
- {
- DBUG_PRINT("warning",
- ("Compression error; Continuing without compression"));
- complen=0;
- }
- int3store(&b[NET_HEADER_SIZE],complen);
- int3store(b,len);
- b[3]=(uchar) (net->compress_pkt_nr++);
- len+= header_length;
- packet= (char*) b;
- }
-#endif /* HAVE_COMPRESS */
-
- /* DBUG_DUMP("net",packet,len); */
-#ifndef NO_ALARM
- thr_alarm_init(&alarmed);
- if (net_blocking)
- thr_alarm(&alarmed,(uint) net_write_timeout,&alarm_buff);
-#else
- alarmed=0;
-#endif /* NO_ALARM */
-
- pos=(char*) packet; end=pos+len;
- while (pos != end)
- {
- if ((long) (length=vio_write(net->vio,pos,(uint32) (end-pos))) <= 0)
- {
- my_bool interrupted = vio_should_retry(net->vio);
-#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2))
- if ((interrupted || length==0) && !thr_alarm_in_use(&alarmed))
- {
- if (!thr_alarm(&alarmed,(uint) net_write_timeout,&alarm_buff))
- { /* Always true for client */
- if (!vio_is_blocking(net->vio))
- {
- while (vio_blocking(net->vio, TRUE) < 0)
- {
- if (vio_should_retry(net->vio) && retry_count++ < RETRY_COUNT)
- continue;
-#ifdef EXTRA_DEBUG
- fprintf(stderr,
- "%s: my_net_write: fcntl returned error %d, aborting thread\n",
- my_progname,vio_errno(net->vio));
-#endif /* EXTRA_DEBUG */
- net->error=2; /* Close socket */
- goto end;
- }
- }
- retry_count=0;
- continue;
- }
- }
- else
-#endif /* (!defined(__WIN__) && !defined(__EMX__)) */
- if (thr_alarm_in_use(&alarmed) && !thr_got_alarm(&alarmed) &&
- interrupted)
- {
- if (retry_count++ < RETRY_COUNT)
- continue;
-#ifdef EXTRA_DEBUG
- fprintf(stderr, "%s: write looped, aborting thread\n",
- my_progname);
-#endif /* EXTRA_DEBUG */
- }
-#if defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER)
- if (vio_errno(net->vio) == SOCKET_EINTR)
- {
- DBUG_PRINT("warning",("Interrupted write. Retrying..."));
- continue;
- }
-#endif /* defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER) */
- net->error=2; /* Close socket */
-#ifdef MYSQL_SERVER
- net->last_errno= (interrupted ? ER_NET_WRITE_INTERRUPTED :
- ER_NET_ERROR_ON_WRITE);
-#endif /* MYSQL_SERVER */
- break;
- }
- pos+=length;
- statistic_add(bytes_sent,length,&LOCK_bytes_sent);
- }
-#ifndef __WIN__
- end:
-#endif
-#ifdef HAVE_COMPRESS
- if (net->compress)
- my_free((char*) packet,MYF(0));
-#endif
- if (thr_alarm_in_use(&alarmed))
- {
- thr_end_alarm(&alarmed);
- vio_blocking(net->vio, net_blocking);
- }
- net->reading_or_writing=0;
- DBUG_RETURN(((int) (pos != end)));
-}
-
-
-/*****************************************************************************
-** Read something from server/clinet
-*****************************************************************************/
-
-#ifndef NO_ALARM
-/*
- Help function to clear the commuication buffer when we get a too
- big packet
-*/
-
-static void my_net_skip_rest(NET *net, uint32 remain, thr_alarm_t *alarmed)
-{
- ALARM alarm_buff;
- uint retry_count=0;
- if (!thr_alarm_in_use(&alarmed))
- {
- if (!thr_alarm(alarmed,net->timeout,&alarm_buff) ||
- (!vio_is_blocking(net->vio) && vio_blocking(net->vio,TRUE) < 0))
- return; /* Can't setup, abort */
- }
- while (remain > 0)
- {
- ulong length;
- if ((int) (length=vio_read(net->vio,(char*) net->buff,remain)) <= 0L)
- {
- my_bool interrupted = vio_should_retry(net->vio);
- if (!thr_got_alarm(&alarmed) && interrupted)
- { /* Probably in MIT threads */
- if (retry_count++ < RETRY_COUNT)
- continue;
- }
- return;
- }
- remain -= (uint32) length;
- statistic_add(bytes_received,length,&LOCK_bytes_received);
- }
-}
-#endif /* NO_ALARM */
-
-
-/*
- Reads one packet to net->buff + net->where_b
- Returns length of packet. Long packets are handled by my_net_read().
- This function reallocates the net->buff buffer if necessary.
-*/
-
-static ulong
-my_real_read(NET *net, ulong *complen)
-{
- uchar *pos;
- long length;
- uint i,retry_count=0;
- ulong len=packet_error;
- thr_alarm_t alarmed;
-#ifndef NO_ALARM
- ALARM alarm_buff;
-#endif
- my_bool net_blocking=vio_is_blocking(net->vio);
- uint32 remain= (net->compress ? NET_HEADER_SIZE+COMP_HEADER_SIZE :
- NET_HEADER_SIZE);
- *complen = 0;
-
- net->reading_or_writing=1;
- thr_alarm_init(&alarmed);
-#ifndef NO_ALARM
- if (net_blocking)
- thr_alarm(&alarmed,net->timeout,&alarm_buff);
-#endif /* NO_ALARM */
-
- pos = net->buff + net->where_b; /* net->packet -4 */
- for (i=0 ; i < 2 ; i++)
- {
- while (remain > 0)
- {
- /* First read is done with non blocking mode */
- if ((int) (length=vio_read(net->vio,(char*) pos,remain)) <= 0L)
- {
- my_bool interrupted = vio_should_retry(net->vio);
-
- DBUG_PRINT("info",("vio_read returned %d, errno: %d",
- length, vio_errno(net->vio)));
-#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2)) || defined(MYSQL_SERVER)
- /*
- We got an error that there was no data on the socket. We now set up
- an alarm to not 'read forever', change the socket to non blocking
- mode and try again
- */
- if ((interrupted || length == 0) && !thr_alarm_in_use(&alarmed))
- {
- if (!thr_alarm(&alarmed,net->timeout,&alarm_buff)) /* Don't wait too long */
- {
- if (!vio_is_blocking(net->vio))
- {
- while (vio_blocking(net->vio,TRUE) < 0)
- {
- if (vio_should_retry(net->vio) &&
- retry_count++ < RETRY_COUNT)
- continue;
- DBUG_PRINT("error",
- ("fcntl returned error %d, aborting thread",
- vio_errno(net->vio)));
-#ifdef EXTRA_DEBUG
- fprintf(stderr,
- "%s: read: fcntl returned error %d, aborting thread\n",
- my_progname,vio_errno(net->vio));
-#endif /* EXTRA_DEBUG */
- len= packet_error;
- net->error=2; /* Close socket */
-#ifdef MYSQL_SERVER
- net->last_errno=ER_NET_FCNTL_ERROR;
-#endif
- goto end;
- }
- }
- retry_count=0;
- continue;
- }
- }
-#endif /* (!defined(__WIN__) && !defined(__EMX__)) || defined(MYSQL_SERVER) */
- if (thr_alarm_in_use(&alarmed) && !thr_got_alarm(&alarmed) &&
- interrupted)
- { /* Probably in MIT threads */
- if (retry_count++ < RETRY_COUNT)
- continue;
-#ifdef EXTRA_DEBUG
- fprintf(stderr, "%s: read looped with error %d, aborting thread\n",
- my_progname,vio_errno(net->vio));
-#endif /* EXTRA_DEBUG */
- }
-#if defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER)
- if (vio_should_retry(net->vio))
- {
- DBUG_PRINT("warning",("Interrupted read. Retrying..."));
- continue;
- }
-#endif
- DBUG_PRINT("error",("Couldn't read packet: remain: %lu errno: %d length: %ld alarmed: %d", remain,vio_errno(net->vio),length,alarmed));
- len= packet_error;
- net->error=2; /* Close socket */
-#ifdef MYSQL_SERVER
- net->last_errno= (interrupted ? ER_NET_READ_INTERRUPTED :
- ER_NET_READ_ERROR);
-#endif
- goto end;
- }
- remain -= (uint32) length;
- pos+= (ulong) length;
- statistic_add(bytes_received,(ulong) length,&LOCK_bytes_received);
- }
- if (i == 0)
- { /* First parts is packet length */
- ulong helping;
- if (net->buff[net->where_b + 3] != (uchar) net->pkt_nr)
- {
- if (net->buff[net->where_b] != (uchar) 255)
- {
- DBUG_PRINT("error",
- ("Packets out of order (Found: %d, expected %u)",
- (int) net->buff[net->where_b + 3],
- net->pkt_nr));
-#ifdef EXTRA_DEBUG
- fprintf(stderr,"Packets out of order (Found: %d, expected %d)\n",
- (int) net->buff[net->where_b + 3],
- (uint) (uchar) net->pkt_nr);
-#endif
- }
- len= packet_error;
-#ifdef MYSQL_SERVER
- net->last_errno=ER_NET_PACKETS_OUT_OF_ORDER;
-#endif
- goto end;
- }
- net->compress_pkt_nr= ++net->pkt_nr;
-#ifdef HAVE_COMPRESS
- if (net->compress)
- {
- /* complen is > 0 if package is really compressed */
- *complen=uint3korr(&(net->buff[net->where_b + NET_HEADER_SIZE]));
- }
-#endif
-
- len=uint3korr(net->buff+net->where_b);
- if (!len) /* End of big multi-packet */
- goto end;
- helping = max(len,*complen) + net->where_b;
- /* The necessary size of net->buff */
- if (helping >= net->max_packet)
- {
- if (net_realloc(net,helping))
- {
-#ifndef NO_ALARM
- if (i == 1)
- my_net_skip_rest(net, (uint32) len, &alarmed);
-#endif
- len= packet_error; /* Return error */
- goto end;
- }
- }
- pos=net->buff + net->where_b;
- remain = (uint32) len;
- }
- }
-
-end:
- if (thr_alarm_in_use(&alarmed))
- {
- thr_end_alarm(&alarmed);
- vio_blocking(net->vio, net_blocking);
- }
- net->reading_or_writing=0;
- return(len);
-}
-
-
-/*
- Read a packet from the client/server and return it without the internal
- package header.
- If the packet is the first packet of a multi-packet packet
- (which is indicated by the length of the packet = 0xffffff) then
- all sub packets are read and concatenated.
- If the packet was compressed, its uncompressed and the length of the
- uncompressed packet is returned.
-
- The function returns the length of the found packet or packet_error.
- net->read_pos points to the read data.
-*/
-
-ulong
-my_net_read(NET *net)
-{
- ulong len,complen;
-
-#ifdef HAVE_COMPRESS
- if (!net->compress)
- {
-#endif
- len = my_real_read(net,&complen);
- if (len == MAX_THREE_BYTES)
- {
- /* First packet of a multi-packet. Concatenate the packets */
- ulong save_pos = net->where_b;
- ulong total_length=0;
- do
- {
- net->where_b += len;
- total_length += len;
- len = my_real_read (net,&complen);
- } while (len == MAX_THREE_BYTES);
- if (len != packet_error)
- len+= total_length;
- net->where_b = save_pos;
- }
- net->read_pos = net->buff + net->where_b;
- if (len != packet_error)
- net->read_pos[len]=0; /* Safeguard for mysql_use_result */
- return len;
-#ifdef HAVE_COMPRESS
- }
- else
- {
- /* We are using the compressed protocol */
-
- ulong buf_length= net->buf_length;
- ulong start_of_packet= net->buf_length - net->remain_in_buf;
- ulong first_packet_offset=start_of_packet;
- uint read_length, multi_byte_packet=0;
-
- if (net->remain_in_buf)
- {
- /* Restore the character that was overwritten by the end 0 */
- net->buff[start_of_packet]=net->save_char;
- }
- else
- {
- /* reuse buffer, as there is noting in it that we need */
- buf_length=start_of_packet=first_packet_offset=0;
- }
- for (;;)
- {
- ulong packet_len;
-
- if (buf_length - start_of_packet >= NET_HEADER_SIZE)
- {
- read_length = uint3korr(net->buff+start_of_packet);
- if (!read_length)
- {
- /* End of multi-byte packet */
- start_of_packet += NET_HEADER_SIZE;
- break;
- }
- if (read_length + NET_HEADER_SIZE <= buf_length - start_of_packet)
- {
- if (multi_byte_packet)
- {
- /* Remove packet header for second packet */
- memmove(net->buff + first_packet_offset + start_of_packet,
- net->buff + first_packet_offset + start_of_packet +
- NET_HEADER_SIZE,
- buf_length - start_of_packet);
- start_of_packet += read_length;
- buf_length -= NET_HEADER_SIZE;
- }
- else
- start_of_packet+= read_length + NET_HEADER_SIZE;
-
- if (read_length != MAX_THREE_BYTES) /* last package */
- {
- multi_byte_packet= 0; /* No last zero len packet */
- break;
- }
- multi_byte_packet= NET_HEADER_SIZE;
- /* Move data down to read next data packet after current one */
- if (first_packet_offset)
- {
- memmove(net->buff,net->buff+first_packet_offset,
- buf_length-first_packet_offset);
- buf_length-=first_packet_offset;
- start_of_packet -= first_packet_offset;
- first_packet_offset=0;
- }
- continue;
- }
- }
- /* Move data down to read next data packet after current one */
- if (first_packet_offset)
- {
- memmove(net->buff,net->buff+first_packet_offset,
- buf_length-first_packet_offset);
- buf_length-=first_packet_offset;
- start_of_packet -= first_packet_offset;
- first_packet_offset=0;
- }
-
- net->where_b=buf_length;
- if ((packet_len = my_real_read(net,&complen)) == packet_error)
- return packet_error;
- if (my_uncompress((byte*) net->buff + net->where_b, &packet_len,
- &complen))
- {
- net->error=2; /* caller will close socket */
-#ifdef MYSQL_SERVER
- net->last_errno=ER_NET_UNCOMPRESS_ERROR;
-#endif
- return packet_error;
- }
- buf_length+=packet_len;
- }
-
- net->read_pos= net->buff+ first_packet_offset + NET_HEADER_SIZE;
- net->buf_length= buf_length;
- net->remain_in_buf= (ulong) (buf_length - start_of_packet);
- len = ((ulong) (start_of_packet - first_packet_offset) - NET_HEADER_SIZE -
- multi_byte_packet);
- net->save_char= net->read_pos[len]; /* Must be saved */
- net->read_pos[len]=0; /* Safeguard for mysql_use_result */
- }
-#endif /* HAVE_COMPRESS */
- return len;
-}
-
-int net_request_file(NET* net, const char* fname)
-{
- char tmp [FN_REFLEN+1],*end;
- DBUG_ENTER("net_request_file");
- tmp[0] = (char) 251; /* NULL_LENGTH */
- end=strnmov(tmp+1,fname,sizeof(tmp)-2);
- DBUG_RETURN(my_net_write(net,tmp,(uint) (end-tmp)) ||
- net_flush(net));
-}
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index 4c90c6e3e74..a8a46e939b0 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -32,7 +32,7 @@ INCLUDES= @MT_INCLUDES@ @bdb_includes@ -I$(srcdir)/../include \
noinst_LIBRARIES = libmysqld_int.a
pkglib_LIBRARIES = libmysqld.a
SUBDIRS = . examples
-libmysqld_sources= libmysqld.c lib_sql.cc lib_load.cc
+libmysqld_sources= libmysqld.c lib_sql.cc
libmysqlsources = errmsg.c get_password.c password.c
noinst_HEADERS = embedded_priv.h
@@ -47,12 +47,12 @@ sqlsources = convert.cc derror.cc field.cc field_conv.cc filesort.cc \
key.cc lock.cc log.cc log_event.cc mf_iocache.cc\
mini_client.cc net_pkg.cc net_serv.cc opt_ft.cc opt_range.cc \
opt_sum.cc procedure.cc records.cc sql_acl.cc \
- repl_failsafe.cc slave.cc \
+ repl_failsafe.cc slave.cc sql_load.cc sql_olap.cc \
sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \
sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \
sql_lex.cc sql_list.cc sql_manager.cc sql_map.cc sql_parse.cc \
sql_prepare.cc sql_derived.cc sql_rename.cc sql_repl.cc \
- sql_select.cc sql_do.cc sql_show.cc \
+ sql_select.cc sql_do.cc sql_show.cc set_var.cc \
sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \
sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \
unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \
diff --git a/libmysqld/embedded_priv.h b/libmysqld/embedded_priv.h
index 96d2c96ed0b..e17b72e84d8 100644
--- a/libmysqld/embedded_priv.h
+++ b/libmysqld/embedded_priv.h
@@ -17,9 +17,8 @@
/* Prototypes for the embedded version of MySQL */
#include <my_global.h>
-#include <mysql_embed.h>
#include <mysql.h>
-#include <mysql_version.h>
+#include <mysql_embed.h>
#include <mysqld_error.h>
#include <my_pthread.h>
diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am
index ecfcbccd322..98d38531f64 100644
--- a/libmysqld/examples/Makefile.am
+++ b/libmysqld/examples/Makefile.am
@@ -8,7 +8,7 @@ link_sources:
done;
DEFS = -DEMBEDDED_LIBRARY
-INCLUDES = -I$(top_srcdir)/include $(openssl_includes) \
+INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include $(openssl_includes) \
-I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/client
LIBS = @LIBS@
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @innodb_system_libs@ @LIBDL@ $(CXXLDFLAGS)
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 3616f1a44ca..f5934fc93fa 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -11,11 +11,9 @@
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*
- */
-#include "embedded_priv.h"
-#include "sys/types.h"
-#include "../regex/regex.h"
-#include "my_sys.h"
+
+ This code was modified by the MySQL team
+*/
/*
The following is needed to not cause conflicts when we include mysqld.cc
@@ -24,28 +22,6 @@
#define main main1
#define mysql_unix_port mysql_inix_port1
#define mysql_port mysql_port1
-#if !defined(__WIN__)
-#define net_read_timeout net_read_timeout1
-#define net_write_timeout net_write_timeout1
-#endif
-#define changeable_vars changeable_vars1
-
-extern "C"
-{
-#include "mysql_com.h"
-#include "lib_vio.c"
-}
-
-
-class THD;
-
-static int check_connections1(THD * thd);
-static int check_connections2(THD * thd);
-static bool check_user(THD *thd, enum_server_command command,
- const char *user, const char *passwd, const char *db,
- bool check_count);
-void free_defaults_internal(char ** argv) {if (argv) free_defaults(argv);}
-#define free_defaults free_defaults_internal
#if defined (__WIN__)
#include "../sql/mysqld.cpp"
@@ -55,11 +31,16 @@ void free_defaults_internal(char ** argv) {if (argv) free_defaults(argv);}
#define SCRAMBLE_LENGTH 8
C_MODE_START
+#include "lib_vio.c"
+static int check_connections1(THD * thd);
+static int check_connections2(THD * thd);
+static bool check_user(THD *thd, enum_server_command command,
+ const char *user, const char *passwd, const char *db,
+ bool check_count);
char * get_mysql_home(){ return mysql_home;};
char * get_mysql_real_data_home(){ return mysql_real_data_home;};
-
bool lib_dispatch_command(enum enum_server_command command, NET *net,
const char *arg, ulong length)
{
@@ -119,7 +100,7 @@ void start_embedded_conn1(NET * net)
thd->dbug_thread_id=my_thread_id();
thd->thread_stack= (char*) &thd;
- if (thd->max_join_size == HA_POS_ERROR)
+ if (thd->variables.max_join_size == (ulong) HA_POS_ERROR)
thd->options |= OPTION_BIG_SELECTS;
thd->proc_info=0; // Remove 'login'
@@ -208,12 +189,12 @@ check_connections2(THD * thd)
#endif
if (connect_errors)
reset_host_errors(&thd->remote.sin_addr);
- if (thd->packet.alloc(net_buffer_length))
+ if (thd->packet.alloc(thd->variables.net_buffer_length))
return(ER_OUT_OF_RESOURCES);
thd->client_capabilities=uint2korr(net->read_pos);
- thd->max_packet_length=uint3korr(net->read_pos+2);
+ thd->max_client_packet_length=uint3korr(net->read_pos+2);
char *user= (char*) net->read_pos+5;
char *passwd= strend(user)+1;
char *db=0;
@@ -221,11 +202,9 @@ check_connections2(THD * thd)
return ER_HANDSHAKE_ERROR;
if (thd->client_capabilities & CLIENT_CONNECT_WITH_DB)
db=strend(passwd)+1;
- if (thd->client_capabilities & CLIENT_INTERACTIVE)
- thd->inactive_timeout=net_interactive_timeout;
if (thd->client_capabilities & CLIENT_TRANSACTIONS)
thd->net.return_status= &thd->server_status;
- net->timeout=net_read_timeout;
+ net->read_timeout=thd->variables.net_read_timeout;
if (check_user(thd,COM_CONNECT, user, passwd, db, 1))
return (-1);
thd->password=test(passwd[0]);
@@ -251,7 +230,7 @@ static bool check_user(THD *thd,enum_server_command command, const char *user,
CLIENT_LONG_PASSWORD),&ur);
DBUG_PRINT("info",
("Capabilities: %d packet_length: %d Host: '%s' User: '%s' Using password: %s Access: %u db: '%s'",
- thd->client_capabilities, thd->max_packet_length,
+ thd->client_capabilities, thd->max_client_packet_length,
thd->host_or_ip, thd->priv_user,
passwd[0] ? "yes": "no",
thd->master_access, thd->db ? thd->db : "*none*"));
@@ -299,6 +278,7 @@ extern "C"
{
static my_bool inited, org_my_init_done;
+ulong max_allowed_packet, net_buffer_length;
int STDCALL mysql_server_init(int argc, char **argv, char **groups)
{
@@ -360,20 +340,24 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
if (gethostname(glob_hostname,sizeof(glob_hostname)-4) < 0)
strmov(glob_hostname,"mysql");
#ifndef DBUG_OFF
- strcat(server_version,"-debug");
+ strxmov(strend(server_version),MYSQL_SERVER_SUFFIX,"-debug",NullS);
+#else
+ strmov(strend(server_version),MYSQL_SERVER_SUFFIX);
#endif
- strcat(server_version,"-embedded");
load_defaults("my", (const char **) groups, argcp, argvp);
defaults_argv=*argvp;
- mysql_tmpdir=getenv("TMPDIR"); /* Use this if possible */
+
+ /* Get default temporary directory */
+ opt_mysql_tmpdir=getenv("TMPDIR"); /* Use this if possible */
#if defined( __WIN__) || defined(OS2)
- if (!mysql_tmpdir)
- mysql_tmpdir=getenv("TEMP");
- if (!mysql_tmpdir)
- mysql_tmpdir=getenv("TMP");
+ if (!opt_mysql_tmpdir)
+ opt_mysql_tmpdir=getenv("TEMP");
+ if (!opt_mysql_tmpdir)
+ opt_mysql_tmpdir=getenv("TMP");
#endif
- if (!mysql_tmpdir || !mysql_tmpdir[0])
- mysql_tmpdir=(char*) P_tmpdir; /* purecov: inspected */
+ if (!opt_mysql_tmpdir || !opt_mysql_tmpdir[0])
+ opt_mysql_tmpdir=(char*) P_tmpdir; /* purecov: inspected */
+
set_options();
get_options(*argcp, *argvp);
@@ -401,14 +385,17 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
(void) pthread_mutex_init(&LOCK_bytes_received,MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_timezone,MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_user_conn, MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_rpl_status, MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_active_mi, MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_global_system_variables, MY_MUTEX_INIT_FAST);
(void) pthread_cond_init(&COND_thread_count,NULL);
(void) pthread_cond_init(&COND_refresh,NULL);
(void) pthread_cond_init(&COND_thread_cache,NULL);
(void) pthread_cond_init(&COND_flush_thread_cache,NULL);
(void) pthread_cond_init(&COND_manager,NULL);
- (void) pthread_cond_init(&COND_binlog_update, NULL);
+ (void) pthread_cond_init(&COND_rpl_status, NULL);
- if (set_default_charset_by_name(default_charset, MYF(MY_WME)))
+ if (set_default_charset_by_name(sys_charset.value, MYF(MY_WME)))
{
mysql_server_end();
return 1;
@@ -422,13 +409,15 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
pthread_attr_setstacksize(&connection_attrib,thread_stack);
pthread_attr_setscope(&connection_attrib, PTHREAD_SCOPE_SYSTEM);
-#if defined( SET_RLIMIT_NOFILE) || defined( OS2)
- /* connections and databases neads lots of files */
+#if defined( SET_RLIMIT_NOFILE) || defined( OS2)
+ /* connections and databases needs lots of files */
{
uint wanted_files=10+(uint) max(max_connections*5,
max_connections+table_cache_size*2);
+ set_if_bigger(wanted_files, open_files_limit);
+ // Note that some system returns 0 if we succeed here:
uint files=set_maximum_open_files(wanted_files);
- if (files && files < wanted_files) // Some systems return 0
+ if (files && files < wanted_files && ! open_files_limit)
{
max_connections= (ulong) min((files-10),max_connections);
table_cache_size= (ulong) max((files-10-max_connections)/2,64);
@@ -443,6 +432,7 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
init_errmessage(); /* Read error messages from file */
lex_init();
item_init();
+ set_var_init();
mysys_uses_curses=0;
#ifdef USE_REGEX
regex_init();
@@ -454,12 +444,13 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
}
/*
- ** We have enough space for fiddling with the argv, continue
+ We have enough space for fiddling with the argv, continue
*/
umask(((~my_umask) & 0666));
table_cache_init();
hostname_cache_init();
- /*sql_cache_init();*/
+ query_cache_result_size_limit(query_cache_limit);
+ query_cache_resize(query_cache_size);
randominit(&sql_rand,(ulong) start_time,(ulong) start_time/2);
reset_floating_point_exceptions();
init_thr_lock();
@@ -467,41 +458,27 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
/* Setup log files */
if (opt_log)
- open_log(&mysql_log, glob_hostname, opt_logname, ".log", LOG_NORMAL);
+ open_log(&mysql_log, glob_hostname, opt_logname, ".log", NullS,
+ LOG_NORMAL);
if (opt_update_log)
{
open_log(&mysql_update_log, glob_hostname, opt_update_logname, "",
- LOG_NEW);
- using_update_log=1;
- }
- if (opt_bin_log)
- {
- if (!opt_bin_logname)
- {
- char tmp[FN_REFLEN];
- strmake(tmp,glob_hostname,FN_REFLEN-5);
- strmov(strcend(tmp,'.'),"-bin");
- opt_bin_logname=my_strdup(tmp,MYF(MY_WME));
- }
- mysql_bin_log.set_index_file_name(opt_binlog_index_name);
- open_log(&mysql_bin_log, glob_hostname, opt_bin_logname, "-bin",
- LOG_BIN);
+ NullS, LOG_NEW);
using_update_log=1;
}
if (opt_slow_log)
open_log(&mysql_slow_log, glob_hostname, opt_slow_logname, "-slow.log",
- LOG_NORMAL);
+ NullS, LOG_NORMAL);
if (ha_init())
{
sql_print_error("Can't init databases");
exit(1);
}
ha_key_cache();
-#ifdef HAVE_MLOCKALL
+#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT)
if (locked_in_memory && !geteuid())
{
- ha_key_cache();
if (mlockall(MCL_CURRENT))
{
sql_print_error("Warning: Failed to lock memory. Errno: %d\n",errno);
@@ -515,7 +492,7 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
if (opt_myisam_log)
(void) mi_log( 1 );
- ft_init_stopwords(ft_precompiled_stopwords); /* SerG */
+ ft_init_stopwords(ft_precompiled_stopwords);
/*
init signals & alarm
@@ -534,12 +511,32 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
mysql_server_end();
return 1;
}
+ if (!opt_noacl)
+ (void) grant_init();
+ init_max_user_conn();
#ifdef HAVE_DLOPEN
if (!opt_noacl)
udf_init();
#endif
+ if (opt_bin_log)
+ {
+ if (!opt_bin_logname)
+ {
+ char tmp[FN_REFLEN];
+ /* TODO: The following should be using fn_format(); We just need to
+ first change fn_format() to cut the file name if it's too long.
+ */
+ strmake(tmp,glob_hostname,FN_REFLEN-5);
+ strmov(strcend(tmp,'.'),"-bin");
+ opt_bin_logname=my_strdup(tmp,MYF(MY_WME));
+ }
+ open_log(&mysql_bin_log, glob_hostname, opt_bin_logname, "-bin",
+ opt_binlog_index_name, LOG_BIN);
+ using_update_log=1;
+ }
+
(void) thr_setconcurrency(concurrency); // 10 by default
if (
@@ -550,12 +547,17 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
{
pthread_t hThread;
if (pthread_create(&hThread,&connection_attrib,handle_manager,0))
- {
sql_print_error("Warning: Can't create thread to manage maintenance");
- mysql_server_end();
- return 1;
- }
}
+
+ /*
+ Update mysqld variables from client variables if set
+ The client variables are set also by get_one_option() in mysqld.cc
+ */
+ if (max_allowed_packet)
+ global_system_variables.max_allowed_packet= max_allowed_packet;
+ if (net_buffer_length)
+ global_system_variables.net_buffer_length= net_buffer_length;
return 0;
}
diff --git a/libmysqld/lib_vio.c b/libmysqld/lib_vio.c
index 5460c546faa..29a70b7acbb 100644
--- a/libmysqld/lib_vio.c
+++ b/libmysqld/lib_vio.c
@@ -151,7 +151,7 @@ int vio_write(Vio * vio, const gptr buf, int size)
DBUG_RETURN(size);
}
-int vio_blocking(Vio * vio, my_bool set_blocking_mode)
+int vio_blocking(Vio * vio, my_bool set_blocking_mode, my_bool *old_mode)
{
return (0);
}
diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c
index 59e6239c1e7..3fba238a8bf 100644
--- a/libmysqld/libmysqld.c
+++ b/libmysqld/libmysqld.c
@@ -794,6 +794,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
{
char buff[100],charset_name_buff[16],*end,*host_info, *charset_name;
uint pkt_length;
+ ulong max_allowed_packet;
NET *net= &mysql->net;
DBUG_ENTER("mysql_real_connect");
DBUG_PRINT("enter",("host: %s db: %s user: %s",
@@ -949,7 +950,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
int2store(buff,client_flag);
mysql->client_flag=client_flag;
-
+ max_allowed_packet=net->max_packet_size;
int3store(buff+2,max_allowed_packet);
if (user && user[0])
strmake(buff+5,user,32);
diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def
index 0e126aa9ceb..c6615ee971c 100644
--- a/libmysqld/libmysqld.def
+++ b/libmysqld/libmysqld.def
@@ -63,10 +63,3 @@ EXPORTS
mysql_refresh
mysql_odbc_escape_string
myodbc_remove_escape
-
-
-
-
-
-
-
diff --git a/ltconfig b/ltconfig
index b9df847729d..18af7c4dce8 100755
--- a/ltconfig
+++ b/ltconfig
@@ -1308,9 +1308,7 @@ else
hardcode_direct=yes
fi
allow_undefined_flag=' ${wl}-berok'
- # -qmkshrobj used to be -bexpall, but MySQL uses symbols which start with
- # an underscore (e.g., _my_b_write), so -bexpall doesn't work.
- archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-qmkshrobj ${wl}-bnoentry${allow_undefined_flag}'
+ archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
case "$host_os" in aix4.[01]|aix4.[01].*)
# According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
diff --git a/mit-pthreads/.cvsignore b/mit-pthreads/.cvsignore
deleted file mode 100644
index 6b051949557..00000000000
--- a/mit-pthreads/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-Makefile
-config.cache
-config.h
-config.log
-config.status
-obj
diff --git a/mit-pthreads/COPYRIGHT b/mit-pthreads/COPYRIGHT
deleted file mode 100644
index 1b727cd8dac..00000000000
--- a/mit-pthreads/COPYRIGHT
+++ /dev/null
@@ -1,31 +0,0 @@
-Copyright (c) 1993, 1994, 1995, 1996 by Chris Provenzano and contributors,
-proven@mit.edu All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-3. All advertising materials mentioning features or use of this software
- must display the following acknowledgement:
- This product includes software developed by Chris Provenzano,
- the University of California, Berkeley, and contributors.
-4. Neither the name of Chris Provenzano, the University, nor the names of
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO, THE REGENTS OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
diff --git a/mit-pthreads/Changes-mysql b/mit-pthreads/Changes-mysql
deleted file mode 100644
index da30f66fdec..00000000000
--- a/mit-pthreads/Changes-mysql
+++ /dev/null
@@ -1,237 +0,0 @@
-Changes done to this distrubtion (pthreads-1_60_beta6) by Monty (monty@mysql.com)
-
-02.05.07
-- Hacked some files to get it to compile (not work) with glibc 2.2
- This is needed so that we can do 'make dist' in the MySQL distribution
-
-02.04.26
-- removed the following files because of copyright problems
-
-machdep/i386-sco-3.2v5/__signal.h
-machdep/i386-sco-3.2v5/__stdio.h
-machdep/i386-sco-3.2v5/__stdlib.h
-machdep/i386-sco-3.2v5/__string.h
-machdep/i386-sco-3.2v5/__time.h
-machdep/i386-sco-3.2v5/__unistd.h
-machdep/i386-sco-3.2v5/compat.h
-machdep/i386-sco-3.2v5/dirent.h
-machdep/i386-sco-3.2v5/posix/__signal.h
-machdep/i386-sco-3.2v5/socket.h
-machdep/i386-sco-3.2v5/syscall.h
-machdep/i386-sco-3.2v5/timers.h
-machdep/i386-sco-3.2v5/trash.can
-machdep/sco-3.2v5/__math.h
-machdep/sco-3.2v5/__signal.h
-machdep/sco-3.2v5/__stdio.h
-machdep/sco-3.2v5/__stdlib.h
-machdep/sco-3.2v5/__string.h
-machdep/sco-3.2v5/__time.h
-machdep/sco-3.2v5/__unistd.h
-machdep/sco-3.2v5/compat.h
-machdep/sco-3.2v5/dirent.h
-machdep/sco-3.2v5/posix/__signal.h
-machdep/sco-3.2v5/socket.h
-machdep/sco-3.2v5/syscall.h
-machdep/sco-3.2v5/timers.h
-machdep/sco-3.2v5/trash.can
-
-93.04.01
-- socket() didn't return NOTOK (-1) on error.
-- bind() didn't set error code on failure
-
-93.03.27
-- Added patch by D. Richard Hipp <drh@vnet.net> to make strtod and
- printf (of floats/doubles) thread safe. Patch provided by mevans@cti-ltd.com
-- Added patch I got from lucid@secret.org to fix lock in fork().
-
-93.03.26
-- Fixed some include files for BSD 2.0.
-- Changed the prototype of ioctl() for BSD.
-- Fixed new bug in fd_kernel.c; _fd_kern_read returned sometimes wrong errno.
-
-93.03.22
-- Change sys/cdefs.h to get it through Sun cc.
-- Added patches by Mark Evans
- 1. Crashes and hangs.
- 2. Missing functionality (namely flock())
- 3. Use of POSIX reentrant safe routines.
-
-93.03.21
-- Add patches by Larry V. Streepy to fix pthread_cancel.
- Fixed bug in Streepy's patch that checked return values of read,write..
- in fd.c (Already done in fd_sys.c)
-
-1. Added a declaration of &#34;signal&#34; to include/signal.h
-2. Modified PANIC macro to operate like assert and call a new function
- panic_kernel. Added new file pthreads/panic.c.
-3. Added support for fstatfs syscall for linux (mod to
- syscall-i386-linux-1.0.S).
-4. Added missing function declarations to machdep/linux-1.0/socket.h:
- getsockopt
- setsockopt
- getsockname
- getpeername
- send
- recv
- sendto
- recvfrom
- sendmsg
- recvmsg
- shutdown
-5. Added ifdef to avoid type conflict in machdep/linux-1.0/timers.h
-6. Fix bug in getprotoent (bogus semi-colon after if stmt).
-7. Change function name in proto_internal.c from _proto_init to
- _proto_buf.
-8. Fix bug in res_internal.c where buffer pointer was improperly
- maintained.
-9. Fix return value handling for POSIX function implementations.
-10. Fix bug in select handling where a thread could be incorrectly
- resumed with no sockets ready. Also added proper handling of
- selecting for exceptions (this was not implemented at all).
-11. Added deadlock detection to pthread_join (it can now return an
- EDEADLK error).
-12. Added support for pthread_cancel, changes to lots of files for this.
-13. Add new function __pthread_is_valid that searches the pthread list
- for a specified pthread_t value.
-
-93.03.22
-- Fixed some if the tests according to the below changes.
-
-93.03.21 by "Mati Sauks" <mati@psti.com>
-- Fixed bug if priority queue was empty or (*current)->next is empty.
-
-96.03.20 by Josip Gracin
-- Fixed gethostbyname to handle alias
-
-97.02.07
-- Removed CVS directories.
-- Commented make install in GNUmakefile.in.
-
-97.01.26 by David (david@detron.se)
-- Fixed a dist target in the GNUmakefile
-- Added #undef PTHREAD_STACK_MIN to avoid warning on solaris 2.5
-
-97.01.21 by Monty (monty@tcx.se)
-
-- Added file mysql-TODO and the patches directory.
-- Added patch p153 and p155 by Tim Hinderliter and Chris Colohan
- check the patches directory for more info.
-- Changed pthread_cond_timedwait to return ETIME instead of ETIMEDOUT
- (Required by Posix)
-- Changed the include file pthread.h to add prototypes for the following
- functions: pthread_sigmask, sigwait and sigsetwait
-- Added shutdown() and getpeername() prototypes to 'machdep/sunos-5.3/socket.h'
-- Changed __FD_NONBLOCK to (O_NONBLOCK | O_NDELAY) in
- ./machdep/engine-sparc-sunos-5.3.h
-- Added rint() prototype to math.h
-- Added new slot sighandled to 'struct pthread' for easy check if somebody
- interrupts a system call.
-- pthread_kill can now interrupt the following system calls:
- select(), read(), write(), send(), sendto(), sendmsg(), recv_timedwait(),
- recvfrom_timedwait(), readev(), writeev() and some socket functions.
-- Fixed bug in pthread_kill() which count up 'sigcount' wrongly.
- Two pthread_kill() in a row bugged the thread.
-- Merged fd_kern_wait and fd_kern_poll to 1 function and removed a
- a bug when polling select.
-- Implemented getpeername().
-- Some small optimizations.
-- Some re-indentation to make the code readable by me (Sorry about that).
-
-97.08.15 by Monty (monty@tcx.se)
-
-- Added patch by "Chris G. Demetriou" <cgd@pa.dec.com> for NetBSD/alpha.
-
-97.08.18 by Monty (monty@tcx.se)
-
-- Added new machdep definitions for HPUX-10.20,
- by JOERG_HENNE@Non-HP-Germany-om88.om.hp.com
-
-97.09.25 by Monty (monty@tcx.se)
-
-- Added some definitions for i386-SCO from the site:
- http://www.sco.com/skunkware/osr5/libraries/
-
-97.10.12 by Monty (monty@tcx.se)
-
-- Changed prototype macro __P to __P_ to avoid warnings on Solaris.
-- Fixed interruption of select() with pthread_kill() when signal handler
- used read or write.
-
-97.10.16 by Monty (monty@tcx.se)
-
-- Fixed that blocked signals doesn't interrupt threads.
-
-97.10.20 by Monty (monty@tcx.se)
-
-- Fixed broken ftruncate system call for FreeBSD 2.0
- The old one destroyed the orignal file by truncation too much.
-- Fixed prototypes for des_setkey,encrypt and setkey (according to Solaris 2.5)
-
-97.11.26 by Monty (monty@tcx.se)
-
-- Small patch to avoid compile errors on alpha-OSF1 3.2
-
-97.12.18 by Monty (monty@tcx.se)
-
-- Added fix for Irix 5.3 in __unistd.h
-
-98.01.13 by Monty (monty@tcx.se)
-- Added fd_check_entry to dup2 and table sizecheck to fd_check_entry()
- patch by Martin Fuchs <Martin@igdv.fh-darmstadt.de>
-
-98.01.18 by Monty (monty@tcx.se)
-- Added prototype for gettimeofday() for Solars 2.3
-- Added some small fixes for configure and Solaris 2.6
-
-98.01.23 by Monty (monty@tcx.se)
-- Ported to openbsd.
-- Renamed nanosleep() to pthread_nanosleep() to avoid name conflict on
- openbsd.
-- Fixed link problem with variable __sglue for Irix 5.3
- by Vladislav Malyshkin <malyshki@cs.wmich.edu>.
-
-98.03.02 by Monty (monty@tcx.se)
-- Applied patches from Curt Sampson <cjs@portal.ca>; NetBSD 1.3/i386 port.
-
-98.03.09 by Monty (monty@tcx.se)
-- Applied patches from Curt Sampson <cjs@portal.ca>; NetBSD 1.3/Alpha port.
-
-98.05.12
-- Added unixware to config.guess
-
-98.06.07
-- Added patch by Scott Dybiec <sdybiec@humanfactor.com>:
- Fixed select() returning incorrect number of active file descriptors.
-
-99.06.07 by Monty (monty@mysql.com)
-- Added patches from the NETBSD site. Should fix the following platforms:
- alpha-netbsd-1.3, sparc-netbsd-1.3, i386-netbsd, arm32-netbsd
-
-99.09.09 by Monty (monty@mysql.com)
-- Added patches from Christoph Badura <bad@oreilly.de> for NetBSD
-
-99.09.13 by Monty (monty@mysql.com)
-- Added patches from Dirk Froemberg <dirk@FreeBSD.org> for FreeBSD
-
-99.10.18 by Monty (monty@mysql.com)
-- Added patch for machdep_sys_lseek() for netbsd.
-
-99.12.30 by Monty (monty@mysql.com)
-- Added patch by Christoph Badura <bad@oreilly.de> to update mit-pthreads
- to the same version as in the NetBSD pkgsrc.
-
-00.02.24 by Monty (monty@mysql.com)
-- Added configure files to make mit-pthreads to compile and link during
- newer linux systems (needed because of the MySQL configure system).
- The resulting library has however not been verified under Linux.
-
-00.03.30 by Monty (monty@mysql.com)
-- Added chroot() and gethostname().
-
-00.10.18 by Monty (monty@mysql.com)
-- Added patch by Dave Huang <khym@bga.com> to fix problem with date/time
- on NETBSD/Alpha.
-
-01.01.11 by Monty (monty@mysql.com)
-- Added patch by Allen Briggs <briggs@ninthwonder.com> for
- Apple PowerMac 8500 w/ G3 upgrade running NetBSD/macppc
diff --git a/mit-pthreads/FAQ b/mit-pthreads/FAQ
deleted file mode 100644
index e4fd3cfc6d8..00000000000
--- a/mit-pthreads/FAQ
+++ /dev/null
@@ -1,122 +0,0 @@
-
- Answers to frequently asked questions
- for my implementation of POSIX threads
-
--------------------------------------------------------------------------------
-1. Pthreads
-
-(1.0) What is Pthreads?
-(1.1) Where can I get info on Pthreads?
-
-2. Getting, Building, Installing and Using proven's Pthreads
-
-(2.0) Where can I get the latest version of proven's Pthreads?
-(2.1) What platforms does proven's Pthreads run on?
-(2.2) What do I need to build proven's Pthreads?
-(2.3) How do I install proven's Pthreads?
-
-3. Known Problems
-
-(3.0) Tests
-(3.1) Installation
-(3.2) Missing functionality
-(3.3) Signals
-
--------------------------------------------------------------------------------
-1. Pthreads
-
-(1.0) What is Pthreads?
-
-Pthreads stands for POSIX threads and is based on the POSIX 1003.1c 1995
-thread standard. This standard passed international Standards Organization
-(ISO) Committee Document (CD) balloting in February 1995 and got the
-IEEE Standards Board approval in June 1995.
-
-
-(1.1) Where can I get info on Pthreads?
-
-You can call IEEE (908) 562-3800 which is the organization which POSIX
-belongs, and ask for POSIX 1003.1c (not 1003.4a) draft 10 (the standard
-won't be out until sometime in 1996). The draft costs $30.00 plus shipping
-which for me was $4.00. The IEEE doesn't make any of the standards available
-online.
-
-I have made documentation for some of the functions available online.
-To reference these use http://www.mit.edu:8001/people/proven/pthreads.html
-
--------------------------------------------------------------------------------
-2. Getting, Building, Installing and Using proven's Pthreads
-
-(2.0) Where can I get the latest version of proven's Pthreads?
-
-The latest version is pthreads-1_60_beta6 was release on November 16, 1996
-and is available from sipb.mit.edu:/pub/pthreads.
-
-
-(2.1) What platforms does proven's Pthreads run on?
-
-Lot's! It should run on the following platforms; the i386 processor
-running NetBSD-1.x, FreeBSD-2.x, BSDOS-2.0, Linux-1.2 and Linux-1.3;
-the r2000 (DECstation) running Ultrix-4.2; the Sparc running NetBSD-1.x,
-SunOS-4.1.3, Solaris-2.3, and Solaris-2.4; the alpha running OSF-2.3 and
-OSF-3.x; the SGI running IRIX-5.2; and the HPPA running HP/UX-9.x.
-
-Because it runs on so many platforms I don't get to compile and test every
-platform for every release. If you have a problem send mail to
-pthreads-bugs@mit.edu with the processor, OS, and version number along with
-a description of the bug.
-
-
-(2.2) What do I need to build proven's Pthreads?
-
-You will need gcc and gmake to build for all but NetBSD, FreeBSD and BSDOS.
-For those you may use either gmake or pmake (the native make).
-
-
-(2.3) How do I install proven's Pthreads?
-
-Installing pthreads is real easy. At the top level of pthreads do
-
-configure
-make
-make install
-
-It will be installed into the directory /usr/local/pthreads. If you don't
-like the location add a --prefix=<dir> option to configure. That's it.
-
-
--------------------------------------------------------------------------------
-3. Known problems.
-
-(3.0) Tests
-
-Under SunOS-4.1.x there is a bug in the kernel that prevents test_sock_1
-from passing. This bug has to do with a process tring to connect to itself.
-In respose I wrote test_sock_2 to test the socket code for SunOS which
-does work. You should have no problems using the socket code in SunOS
-so long as you don't write a program that need to connect to itself.
-
-
-(3.1) Installation
-
-The only know problem is on the SGI. You will need to use GNU tar instead
-of the native supplied one or edit the config.flags file and remove the -h
-option to tar. Aparently the -h option on IRIX 5.3 version of tar does the
-exact opposite of all the other versions of tar I've used and instead of
-following symbolic links and getting the file it archives the link.
-
-
-(3.2) Missing functionality
-
-The current release is missing cancelation, priority mutexes and others.
-I'm continuing to develope pthreads and I plan to put cancelation and
-priority mutexes and as much other stuff as I can into the 1_70 release
-
-
-(3.3) Signals
-
-Currently to intermix signals with pthreads you need to rename all calls
-to signal() and sigaction() to pthread_signal() and pthread_sigaction().
-I plan to write real wrapper routines for signal() and sigaction() for
-the 1_70 release.
-
diff --git a/mit-pthreads/GNUmakefile b/mit-pthreads/GNUmakefile
deleted file mode 100644
index e3fd53b48e5..00000000000
--- a/mit-pthreads/GNUmakefile
+++ /dev/null
@@ -1,129 +0,0 @@
-# === GNUmakefile =============================================================
-# Copyright (c) 1991, 1992, 1993 Chris Provenzano, proven@athena.mit.edu
-#
-# Description: This file is for creating libpthread.a
-#
-# 1.00 93/11/17 proven
-# -Put all the .o files into one file libpthread.a
-# -Initial cut for pthreads.
-#
-
-INSTALL_PATH = $(exec_prefix)
-
- BINDIR = $(INSTALL_PATH)/bin
- LIBDIR = $(INSTALL_PATH)/lib
- MANDIR = $(INSTALL_PATH)/man
- INCDIR = $(INSTALL_PATH)/include
- SUBINCDIR = $(INCDIR)/pthread
-
- AR = ar
- AS = gas
- CFLAGS = -I. -Iinclude -I$(srcdir)/include -DPTHREAD_KERNEL \
- -O3 -DDBUG_OFF -Werror
- CXXFLAGS = -I. -Iinclude -I$(srcdir)/include -DPTHREAD_KERNEL \
- -g -O2
- LD = gld
-
- CSRC =
-
- PTHREAD_DIR = pthreads stdlib stdio gen
- DIRS = $(PTHREAD_DIR)
-
- HEADERS =
-
- LIBRARIES = libpthread.a
-
- .CURDIR = .
-
-# force correct default target
-all:
-
-###############################################################################
-#
-# Read in any special flags that config knows about
-include config.flags
-
-# What the heck. Convert srcdir to absolute form so it looks prettier.
-srcdir := $(shell cd $(srcfoo) && pwd)
-
-################################################################################
-#
-# Here starts the nitty grity part of the Makefile.
-
-all-lib : libpthread.a
-
-include ${srcdir}/pthreads/GNUmakefile.inc
-include ${srcdir}/stdlib/GNUmakefile.inc
-include ${srcdir}/stdio/GNUmakefile.inc
-include ${srcdir}/string/GNUmakefile.inc
-include ${srcdir}/gen/GNUmakefile.inc
-include ${srcdir}/net/GNUmakefile.inc
-include ${srcdir}/scripts/GNUmakefile.inc
-
-REGULAR_OBJS= $(subst .cc,.o,$(SRCS))
-REGULAR_OBJS:= $(subst .c,.o,$(REGULAR_OBJS))
-REGULAR_OBJS:= $(subst .S,.o,$(REGULAR_OBJS))
-OBJS= $(REGULAR_OBJS) $(EXTRA_OBJS)
-REALOBJS = $(addprefix obj/, $(OBJS))
-
-$(REALOBJS) : $(config) $(types) $(paths)
-
-# Since we do not have a list of the relevant files we do a make clean
-# before copying everyting to the distribution directory.
-distdir:
- $(MAKE) clean
- cp -a . $(distdir)
- # Remove symlinks that the distribution should not have.
- rm -f $(distdir)/config.cache \
- $(distdir)/include/pthread/machdep.h \
- $(distdir)/include/pthread/posix.h \
- $(distdir)/include/sys \
- $(distdir)/machdep.c \
- $(distdir)/syscall.S \
- $(distdir)/syscall-template.S
-
-clean:
- rm -f a.out core maketmp makeout $(LIBRARIES) $(BINARIES) libpthread.*
- rm -rf obj
- cd tests && $(MAKE) clean && cd ..
-
-install-lib: $(LIBRARIES) install-dirs
- for x in $(LIBRARIES); \
- do install $$x $(DESTDIR)$(LIBDIR); \
- done
-
-# Removed make install since mysql uses this in place.
-# install-lib install-include install-bin
-install:
-
-libpthread.a: obj/libpthread.a
- rm -f libpthread.a
- ln -s obj/libpthread.a .
-
-obj/libpthread.a: ${REALOBJS}
- rm -f libpthread.a obj/new.a obj/libpthread.a
- cd obj && \
- ar r new.a ${OBJS} && \
- $(RANLIB) new.a && \
- mv -f new.a libpthread.a && \
- cd ..
-
-# For examining a combined symbol table, sizes, &c.
-libpthread.o: ${REALOBJS}
- cd obj && ld -r -o ../libpthread.o ${OBJS} && cd ..
-
-obj/x:
- if [ -d obj ]; then true; else mkdir obj; fi
- cp /dev/null obj/x
-
-GNUmakefile: config.status ${srcdir}/config/GNUmakefile.in
- $(SHELL) config.status
-
-obj/%.o: %.c obj/x
- $(CC) $(CFLAGS) -c $< -o $@
-
-obj/%.o: %.cc obj/x
- $(CXX) $(CXXFLAGS) $(CFLAGS) -c $< -o $@
-
-obj/%.o: %.S obj/x
- $(CC) $(CFLAGS) -c $< -o $@
diff --git a/mit-pthreads/NOTES b/mit-pthreads/NOTES
deleted file mode 100644
index cebdc6a396c..00000000000
--- a/mit-pthreads/NOTES
+++ /dev/null
@@ -1,59 +0,0 @@
-
-Here are some notes on the internals of the implementation.
-
-LIBC routines.
-
- Unfortuanately many of the libc routine return a pointer to static data.
-There are two methods to deal with this. One write a new routine where the
-arguments are different, and have one argument be a pointer to some space
-to store the data, or two use thread specific data and warn the user that
-data isn't valid if the calling thread is terminated.
-
-INTERNAL LOCKING
-To prevent deadlocks the following rules were used for locks.
-
-1. Local locks for mutex queues and other like things are only locked
- by running threads, at NO time will a local lock be held by
- a thread in a non running state.
-2. Only threads that are in a run state can attempt to lock another thread,
- this way, we can assume that the lock will be released shortly, and don't
- have to unlock the local lock.
-3. The only time a thread will have a pthread->lock and is not in a run
- state is when it is in the reschedule routine.
-4. The reschedule routine assumes all local locks have been released,
- there is a lock on the currently running thread (pthread_run),
- and that this thread is being rescheduled to a non running state.
- It is safe to unlock the currently running threads lock after it
- has been rescheduled.
-5. The reschedule routine locks the kernel, sets the state of the currently
- running thread, unlocks the currently running thread, calls the
- context switch routines.
-6 the kernel lock is used only ...
-
-
-7. The order of locking is ...
-
-1 local locks
-2 pthread->lock /* Assumes it will get it soon */
-3 pthread_run->lock /* Assumes it will get it soon, but must release 2 */
-4 kernel lock /* Currently assumes it will ALWAYS get it. */
-
-8. The kernel lock will be changed to a spin lock for systems that
-already support kernel threads, this way we can mutiplex threads onto
-kernel threads.
-9. There are points where the kernel is locked and it needs to get
-either a local lock or a pthread lock, if at these points the code
-fails to get the lock the kernel gives up and sets a flag which will
-be checked at a later point.
-10. Interrupts are dissabled while the kernel is locked, the interrupt
-mask must be checked afterwards or cleared in some way, after interrputs
-have been reenabled, this allows back to back interrupts, but should always
-avoid missing one.
-
-------------------------------------------------------------------------------
-Copyright (c) 1994 Chris Provenzano. All rights reserved.
-This product includes software developed by the Univeristy of California,
-Berkeley and its contributors.
-
-For further licencing and distribution restrictions see the file COPYRIGHT
-included in this directory.
diff --git a/mit-pthreads/NOTES_OSR5_BUILD_SKUNKWARE97 b/mit-pthreads/NOTES_OSR5_BUILD_SKUNKWARE97
deleted file mode 100644
index fd2e00c9860..00000000000
--- a/mit-pthreads/NOTES_OSR5_BUILD_SKUNKWARE97
+++ /dev/null
@@ -1,45 +0,0 @@
-This port to Osr5 was donated by
- ARTURO MONTES mitosys@colomsat.net.co
-Its a snapshot of the 1.60 Beta 5 version
-
-It passes all the tests except test_fork (this seems to be a problem
-with the MIT source)
-and I suspect there may also to be problems with
-the floating point initialisation and perhaps the netdb access as well
-
-
-Regarding the networking API's mind the following (ARTURO):
-
-- Always we are searching host address in /etc/hosts by default, if you
-want other behaviour let me to know.
-
-- If you haven't an entry in /etc/hosts, please create it and after test
-with DNS service.
-
-regarding floating point initialisation (ARTURO)
-
-...mit-pthreads/pthreads/tests> ./test_preemption_float
-test_preemption_float INDETERMINATE
-
-I inhibit the pthread float code, but they are a minor changes in machdep.c.
-
-> What did you do/needs to be done here ??
-
-Look into machdep.c machdep_save_float_state() and
-machdep_restore_float_state() routine. I think the initialization float
-code can have problems with pthread initialization code.
-
-----------------
-
-
-If you wish to rebuild from source you'll need the gnus devsys
-(gmake and gcc) and don't use configure to reconfigure the makefiles, etc
- ( I don't know why this is but it doesn't work)
-
-If Arturo keeps me updated with buildable snapshots I'll endeavour to keep
-the skunkware Website updated with them.
-
-
-Best of luck
-
-hops 01-Aug-97
diff --git a/mit-pthreads/README b/mit-pthreads/README
deleted file mode 100644
index 0a55bcd94bb..00000000000
--- a/mit-pthreads/README
+++ /dev/null
@@ -1,40 +0,0 @@
-This pthread package is/will be based on the POSIX1003.1c Draft 10 pthread
-standard, and Frank Muellers paper on signal handeling presented at the
-Winter 93 USENIX conference.
-
-It is currently being designed and written by me, Chris Provenzano.
-All bug, comments, and questions can be sent me at proven@mit.edu,
-or pthreads@mit.edu.
-
-PLEASE, don't send questions, bugs or patches to any of the *BSD*, Linux
-or GNU mailing lists.
-
-Thanks goes to Ken Raeburn for his help on the Sparc port, the configurator,
-and his many suggestions, Greg Hudson for the thread safe net routines and
-all the testing he's done.
-
-More thanks to Mark Eichin and all the others for the testing they have done.
-
-PORTING
-One of the goals of this user space implementation of pthreads is that it
-be portable. I have minimized the ammount of assembler code necessary,
-but some is.
-
-If you want to port it to another platform here are a few basic hints.
-
-You will need to create a machdep.h, machdep.c and syscall.S for the
-new architecture. The first two are necessary to get the context switch
-section of the pthread package running, the third is for all the syscalls.
-
-INCLUDE FILES AND PORTING
-In addition to the above three files you need to create a slew of .h files.
-Take a look at an existing port to determine what is in each, and then
-take a look at your system header files to determine what to put in them.
-
-------------------------------------------------------------------------------
-Copyright (c) 1993, 1994, 1995, 1996 Chris Provenzano. All rights reserved.
-This product includes software developed by the Univeristy of California,
-Berkeley and its contributors.
-
-For further licencing and distribution restrictions see the file COPYRIGHT
-included in this directory.
diff --git a/mit-pthreads/TODO-mysql b/mit-pthreads/TODO-mysql
deleted file mode 100644
index a19b1bd51d6..00000000000
--- a/mit-pthreads/TODO-mysql
+++ /dev/null
@@ -1,4 +0,0 @@
-This what should be done to get more functionally for mysqld.
-
-- open should be interruptable.
-- fcntl lock should be interruptable.
diff --git a/mit-pthreads/Whats_New b/mit-pthreads/Whats_New
deleted file mode 100644
index 556d9f63268..00000000000
--- a/mit-pthreads/Whats_New
+++ /dev/null
@@ -1,198 +0,0 @@
-For patches made to this release, check the file Changes-mysql
-
-For the 96/11/11 release version 1_60_beta6
-
- Ports
- Alpha running NetBSD-1.1 by Chris G Demetriou <cgd+@cs.cmu.edu>
- i386 running BSDi-2.1 by David J MacKenzie <djm@va.pubnix.com>
-
- Bug Fixes
- Test for struct timespec under linux and DTRT.
- include/unistd.h : #define SEEK_SET, SEEK_CUR, and SEEK_END.
- Bug reported by Stephen Tether <tether@MITLNS.MIT.EDU>
- stdlib/system.c : Uses the POSIX signal systemcalls.
- Bug reported by Matthew Newhook <matthew@thor.udc.neweast.ca>.
- net/gethostbyname.c: #include <string.h> and fix dereference problem.
- Bug reported by Chris G Demetriou <cgd+@cs.cmu.edu>
- pthreads/fd.c: Fix bug in close() reported by
- Bug reported by "William S. Lear" <rael@dejanews.com>
- tests/p_bench_pthread_create.c : Only try and create 10000 threads.
- include/pthread/sleep.h : No need to prototype machdep_gettimeofday()
- since it is declared here.
- Bug reported by Stewart Gebbie <stewart@global.co.za>
- stdio/fwrite.c: Fixed bug where if total bytes written = 0 then a divid
- by 0 occurs. Thanks to CTLarsen@lbl.gov for finding is and to
- Jin Guojun <jin@george.lbl.gov> for submitting a patch for it.
- stdio/refill.c (__swalk_lflush()): Second pass of flush should call
- flockfile() not ftrylockfile(). Just like in __swalk_sflush()
- net/res_internal.c (_res_parse_answer()): It looks like if
- iquery is true and type == T_PTR then the result->h_name
- will be over written because the bp isn't incrementd
- appropriately. Thanks to David Halls <David.Halls@cl.cam.ac.uk>
- for finding it.
- net/serv_internal.c (_serv_buf()) : Allocate more than four bytes
- of buffer space. Reported by drh@@tobit.vnet.net.
- pthreads/fd_kern.c: Make sure exception fds are included in
- machdep_sys_select() for support of select(). Thanks to
- Larry V. Streepy, Jr. <streepy@healthcare.com> for the patches.
- pthreads/fd_kern.c: Fix more I/O routines to report NOTOK on error
- instead of the old -error number. Hopefully this is the last of
- them. Thanks to Larry V. Streepy, Jr. <streepy@healthcare.com> for
- the patches.
- machdep/engine-i386-linux-1.0.c: Remove unneeded machdep_sys_readv()
- and machdep_sys_writev() routines. Reported by
- pthreads/process.c : Fix execl() and execle() to work on sparc systems.
- pthreads/fd_sysv.c : Fix accept() to work under Solaris 2.4
-
-
-For the 96/03/09 release version 1_60_beta5
-
- Ports
- Sparc running NetBSD-1.1
-
- Additions
- New reentrant netdb similar to Solaris API (ghudson)
-
- Bug Fixes
- Make default signal handlers work.
- Deadlock scheduling bug reported by Cathy Abbott <cabbot@cs.utk.edu>
- See pthreads-bugs transaction 31
- pthread/queue.c (pthread_queue_remove()): Don't set thread->queue and
- thread->next to NULL unless the thread is removed from the queue.
- pthreads/fd.c (setsockopt(), getsockopt(), getsockname(),
- getpeername()) : Call fd_lock() with appropriate paramaters.
- pthreads/fd_kern.c (sendmsg_timedwait()): Call fd_unlock() with
- FD_WRITE instead of FD_READ paramater.
- machdep/*/timers.h net/res_send.c, pthreads/cond.c, pthreads/select.c
- pthreads/sleep.c, tests/test_pthread_cond_timedwait.c:
- Change timespec to be POSIX compliant.
- include/unistd.h : Change u_int to unsigned [int] in prototypes.
- pthreads/fd.c : Use FD_SETSIZE instead of 1024 for a limit on fds.
-
-
-For the 95/09/xx release version 1_60_beta4
-
- Ports
- SGI running IRIX-5.3
-
- Additions
- Added pthread_sigprocmask().
- Added CV attributes
-
- strtok() and strtok_r() (Greg Hudson)
- getsockname() (Sean Levy)
-
- Bug Fixes
- stdio/fwalk.c, stdio/refill.c : Use flockfile() instead of
- ftrylockfile()/pthread_yield(), for traversing FILE list.
- pthreads/sig.c : Remove enum pthread_sig_flags and just use the vector.
- Added pthread_sigprocmask().
- pthreads/signal.c : Protect calls to pthread_sig_process().
- configure : Create the obj directory.
- tests/test_preemption_float.c : Rewritten to actually work.
- machdep/engine-i386-linux-1.0.c : Added __strtol_internal()
- tests/test_stdio_1.c : Don't use base_name or dir_name as variables.
- gen/getcwd.c : fstat => machdep_sys_fstat, since kernel fd's are
- used in the DIR data structure
- gen/isatty.c : Fixed call to fd_lock() to pass the right # args.
- pthreads/pthread_init.c : Fixed uninitialized members of
- pthread_initial.
-
-
-
-For the 95/06/xx release version 1_60_beta3
-
- Additions
- Add exec variants execl, execlp, execv, execvp (Ken Raeburn)
- pthreads/fd_sysv.c : Added routines setsockopt() and getsockname().
- Added include/endian.h : For machine dependent endian junk. (YUCK)
- Added socketpair()
- Added ttyname_r()
-
- Bug Fixes
- config/Makefile.in : Need $$ to reference shell variables in make.
- config/configure, config/configure.in : Redo freebsd2.* machine.
- machdep/sunos-4.1.3/__stdlib.h : typedef pthread_size_t size_t
- pthreads/fd.c : Fix bug with fd_free(), dup(), dup2(), and close()
- where a fd gets lost after a dup() then close().
- pthreads/fd_kern.c : The fd_table[fd]->flags of the fd that accept()
- returns should be the same as those of the fd passed to accept().
- stdio/fclose.c : Don't call funlockfile(fp) after fp->_file has been
- closed.
- pthreads/select.c : Move pthread_sched_prevent() inside the statement.
- if (machdep_sys_select(...) == OK)
- pthreads/machdep/linux-1.0/cdefs.h : moved the include_next outside
- of the ifdef so that it would eventually find the system cdefs.h
- pthreads/signal.c : Check sig_to_process before and after fd_kern_wait()
- . It is possible for sig_handler_fake() to registered one.
- pthreads/signal.c : Unset pthread_run temporarily around the call to
- sig_handler(0). places where this causes core dumps should check
- pthread_run.
- include/stdlib.h : Fix prototype for bsearch().
- machdep/syscall-i386-freebsd-2.0.S syscall-template-i386-freebsd2.0.S:
- Fix macro expansion problems for FreeBSD-2.0
- machdep/engine-sparc-sunos-5.3.c : Fix machdep_sys_select() to return
- machdep_sys_poll() errors and not the number of entries found.
- gen/getcwd.c : Use strlen(dp->d_name) not dp->d_namlen because there
- may be extra data associated with dp->d_namelen.
- machdep/freebsd-2.0/__unistd.h: Change #define _POSIX_VDISABLE to 0xff
- include/pthread.h : Added prototypes pthread_kill(), pthread_signal()
- machdep/linux-1.0/__signal.h : Added #define __sigmask() and
- #define sigmask, and fixed other SIG macros to use __sigmask.
- machdep/linux-1.0/dirent.h : #include <sys/types.h>
- machdep/linux-1.0/wait.h : Fix #define WIFSTOPPED(x) to use __WSTATUS(x)
- machdep/syscall-i386-linux-1.0.S : Added elf support. (NOT TESTED)
- pthreads/stat.c : Added to separate linux stat calls.
- (SGI will need this too)
- pthreads/signal.c : Whereever #ifdef (SA_RESETHAND) is used then
- #ifdef (SA_RESTART) also
- gen/isatty.c : isatty_basic() is called with the KFD not UFD.
- machdep/sunos-4.1.3/__stdlib.h : #include <sys/stdtypes.h>
- config/sun4os4.mk : Added pipe to SYSCALL_EXCEPTIONS
- machdep/syscall-sparc-sunos-4.1.3.S : Add machdep_sys_pipe().
- include/stdio.h : Remove __getc() and __putc(), because they really
- shouldn't be inlined.
- machdep/sunos-4.1.3/stat.h : Added __BEGIN_DECLS and __END_DECLS.
- machdep/alpha-osf1/cdefs.h, machdep/hpux-9.03/cdefs.h
- machdep/linux-1.0/cdefs.h, machdep/sunos-4.1.3/cdefs.h
- machdep/sunos-5.3/cdefs.h, machdep/ultrix-4.2/cdefs.h :
- #define __INLINE static inline and don't #define
- __CAN_DO_EXTERN_INLINE if __cplusplus and __GCC__ is defined.
- pthreads/fd_sysv.c : Fix so that only systems without socket systemcalls
- compile this file.
- machdep/engine-i386-linux-1.0.c : Fix linux machdep_sys_getdirentries()
- pthreads/gen : Nuke the signal-blocking code in pclose(). It doesn't do
- any good in a threaded program; some other thread would just get
- the signal.
-
-
-For the 94/11/xx release version 1_60
-
- Additions
- Added recvfrom_timedwait(), and similar calls
- Added thread safe time routines: ctime(), localtime(), ...
- Added thread safe rand routines: rand(), random(), ...
- Added priorities and releated routines: pthread_attr_getschedparam(),
- Added signals and releated routines:pthread_kill(), sigwait(), ...
- Added mutex attribues and releated routines: pthread_mutexattr_init(), .
- Added abort
-
- Added counting (recursive) mutexes.
- Added debugging mutexes.
- Added some more tests
-
- Redid entire thread kernel because of priorities, and signals.
- Test and set instructions no longer necessary for versions
- that don't support kernel threads.
-
- More debugging by Greg Hudson along with the network lookup routines
- An Alpha port from Ken Raeburn and Sean Levy
- A solaris port from me.
- select() implementations from Sean Levy and Peter Hofmann
- configure from Ken Raeburn
- pthread_init() no longer necessary for systems with G++ from Ken Raeburn
- net code from Greg Hudson including: gethostbyname(), ...
-
- Bug fixes:
- honor _POSIX_THREAD_DESTRUCTOR_ITERATIONS
- pthread_key_destroy() is really pthread_key_delete()
diff --git a/mit-pthreads/bin/.cvsignore b/mit-pthreads/bin/.cvsignore
deleted file mode 100644
index f3c7a7c5da6..00000000000
--- a/mit-pthreads/bin/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-Makefile
diff --git a/mit-pthreads/bin/Makefile.in b/mit-pthreads/bin/Makefile.in
deleted file mode 100644
index 979ad2db2ea..00000000000
--- a/mit-pthreads/bin/Makefile.in
+++ /dev/null
@@ -1,48 +0,0 @@
-# === GNUmakefile ============================================================
-# Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
-#
-# Description: This file is for creating the test programs for libpthread.a
-#
-# 1.00 93/08/03 proven
-# -Initial cut for pthreads.
-#
-
-CC = ../pgcc -notinstalled
-srctop = @srctop@
-srcdir = @srctop@/lib
-VPATH = @srctop@/lib
-CDEBUGFLAGS = @CFLAGS@
-
-CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(ADDL_CFLAGS) -DSRCDIR=\"$(srcdir)\"
-
-#
-DIRS = finger
-
-################################################################################
-#
-all:
- (for i in $(DIRS); do cd $$i; $(MAKE) all; cd ..; done)
-
-clean:
- (for i in $(DIRS); do cd $$i; $(MAKE) clean; cd ..; done)
- rm -f *.o $(TESTS) $(BENCHMARKS) a.out core maketmp makeout
-
-depend:
- (for i in $(DIRS); do cd $$i; $(MAKE) depend; cd ..; done)
- sed '/\#\#\# Dependencies/q' < Makefile > maketmp
- (for i in $(CSRC);do $(CPP) -M $$i;done) >> maketmp
- cp maketmp Makefile
-
-install:
- (for i in $(DIRS); do cd $$i; $(MAKE) install; cd ..; done)
-
-realclean: clean
- (for i in $(DIRS); do cd $$i; $(MAKE) realclean; cd ..; done)
- rm -f Makefile
-
-Makefile: Makefile.in
- (cd .. ; sh config.status)
-
-################################################################################
-### Do not remove the following line. It is for depend #########################
-### Dependencies:
diff --git a/mit-pthreads/bin/finger/.cvsignore b/mit-pthreads/bin/finger/.cvsignore
deleted file mode 100644
index f3c7a7c5da6..00000000000
--- a/mit-pthreads/bin/finger/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-Makefile
diff --git a/mit-pthreads/bin/finger/Makefile.in b/mit-pthreads/bin/finger/Makefile.in
deleted file mode 100755
index ee20f47443d..00000000000
--- a/mit-pthreads/bin/finger/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-# === makefile ============================================================
-# Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
-#
-# Description: This file is for creating the test programs for libpthread.a
-#
-# 1.00 93/08/03 proven
-# -Initial cut for pthreads.
-#
-
-srctop = @srctop@
-srcdir = @srctop@/bin/finger
-VPATH = @srctop@/bin/finger
-prefix= @prefix@
-exec_prefix= @exec_prefix@
-
-INSTALL_PATH = @exec_prefix@
- BINDIR = $(INSTALL_PATH)/bin
- LIBDIR = $(INSTALL_PATH)/lib
- MANDIR = $(INSTALL_PATH)/man
- INCDIR = $(INSTALL_PATH)/include
-
- CC = ../../pgcc -notinstalled
- CDEBUGFLAGS = @CFLAGS@
- INCLUDES = -I@srctop@/lib/libpthreadutil/ -L../../lib/libpthreadutil/
- CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(ADDL_CFLAGS) -DSRCDIR=\"$(srcdir)\"
- RANLIB = @RANLIB@
-
- OBJS = finger.o net.o
- BINARY = finger
-
-################################################################################
-#
-all : $(BINARY)
-
-clean:
- rm -f *.o $(TESTS) $(BENCHMARKS) a.out core maketmp makeout
-
-depend:
- sed '/\#\#\# Dependencies/q' < Makefile > maketmp
- (for i in $(CSRC);do $(CPP) -M $$i;done) >> maketmp
- cp maketmp Makefile
-
-install: $(BINARY)
- install $(BINARY) $(BINDIR)
-
-realclean: clean
- rm -f Makefile
-
-Makefile: Makefile.in
- (cd ../.. ; sh config.status)
-
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
-$(BINARY) : ${OBJS}
- $(CC) $(CFLAGS) -o $(BINARY) ${OBJS} -lpthreadutil
-
-################################################################################
-### Do not remove the following line. It is for depend #########################
-### Dependencies:
diff --git a/mit-pthreads/bin/finger/finger.c b/mit-pthreads/bin/finger/finger.c
deleted file mode 100755
index 33b3011e8bb..00000000000
--- a/mit-pthreads/bin/finger/finger.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/* ==== finger.c ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Tony Nardo of the Johns Hopkins University/Applied Physics Lab.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano,
- * the University of California, Berkeley and its contributors.
- * 4. Neither the name of Chris Provenzano, the University nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO, THE REGENTS AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * 1.00 93/08/26 proven
- * -Pthread redesign of this file.
- *
- * 1.10 95/02/11 proven
- * -Now that gethostbyname works ....
- */
-
-#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1989 The Regents of the University of California.\n\
- @(#) Copyright (c) 1993, 1995 Chris Provenzano.\n\
- @(#) Copyright (c) 1995 Greg Stark.\n\
- All rights reserved.\n";
-#endif /* not lint */
-
-#include <pthreadutil.h>
-#include <sys/param.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-void *netfinger();
-
-void usage(int eval)
-{
- fprintf(stderr,
- "usage: finger [-lps] [-c <net_count>] [-t|T <timeout>] [-f <filename>] [login ...]\n");
- exit(eval);
-}
-
-/*
- * These globals are set initialy and then are only read.
- * They do not need mutexes.
- */
-int thread_time = 0, program_timeout = 0, lflag = 0;
-pthread_tad_t parse_file_tad;
-pthread_tad_t netfinger_tad;
-
-void * timeout_thread(void * arg)
-{
- sleep(program_timeout);
- exit(0);
-}
-
-void * signal_thread(void * arg)
-{
- int sig;
- sigset_t program_signals;
- sigemptyset(&program_signals);
- sigaddset(&program_signals, SIGINT);
- sigwait(&program_signals, &sig);
- exit(0);
-}
-
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 64
-#endif
-
-void * parse_file(void * arg)
-{
- char hostname[MAXHOSTNAMELEN];
- char * filename = arg;
- pthread_atexit_t atexit_id;
- pthread_attr_t attr;
- pthread_t thread_id;
- char * thread_arg;
- FILE * fp;
- int len;
-
- netsetupwait();
-
- /* Parse the file and create a thread per connection */
- if ((fp = fopen(filename, "r")) == NULL) {
- fprintf(stderr, "Can't open file %s\n", filename);
- pthread_exit(NULL);
- }
- pthread_atexit_add(&atexit_id, fclose_nrv, fp);
-
- if (pthread_attr_init(&attr)) {
- fprintf(stderr, "Error: Can't initialize thread attributes\n");
- exit(2);
- }
- pthread_atexit_add(&atexit_id, pthread_attr_destroy_nrv, &attr);
-
- while (fgets(hostname, MAXHOSTNAMELEN, fp)) {
- if ((thread_arg = (char *)malloc(len = strlen(hostname))) == NULL) {
- fprintf(stderr, "Error: out of memory\n");
- exit(2);
- }
-
- hostname[len - 1] = '\0';
- strcpy(thread_arg, hostname);
- pthread_attr_setcleanup(&attr, free, thread_arg);
- if (pthread_tad_create(&netfinger_tad, &thread_id, NULL,
- netfinger, thread_arg)) {
- fprintf(stderr, "Error: pthread_tad_create() netfinger_tad.\n");
- exit(2);
- }
- }
- pthread_exit(NULL);
-}
-
-main(int argc, char **argv)
-{
- pthread_atexit_t atexit_id;
- pthread_t thread_id;
- int max_count = 0;
- char ch;
-
- /* getopt variables */
- extern char *optarg;
- extern int optind;
-
- /* Setup tad for parse_file() threads */
- if (pthread_tad_init(&parse_file_tad, max_count)) {
- fprintf(stderr,"Error: couldn't create parse_file() TAD.\n");
- exit(1);
- }
-
- while ((ch = getopt(argc, argv, "c:f:t:T:ls")) != (char)EOF)
- switch(ch) {
- case 't': /* Time to let each thread run */
- if ((thread_time = atoi(optarg)) <= 0) {
- usage(1);
- }
- break;
- case 'T': /* Time to let entire program run */
- if ((program_timeout = atoi(optarg)) <= 0) {
- usage(1);
- }
- break;
- case 'f': /* Parse file for list of places to finger */
- if (pthread_tad_create(&parse_file_tad, &thread_id, NULL,
- parse_file, optarg)) {
- fprintf(stderr,"Error: pthread_tad_create() parse_file_tad.\n");
- exit(1);
- }
- break;
- case 'c':
- max_count = atoi(optarg);
- break;
- case 'l': /* long format */
- lflag = 1;
- break;
- case 's': /* short format */
- lflag = 0;
- break;
- case '?':
- usage(0);
- default:
- usage(1);
- }
-
- /* The rest of the argumants are hosts */
- argc -= optind;
- argv += optind;
-
- /* Setup timeout thread, if there is one */
- if (program_timeout) {
- if (pthread_create(&thread_id, NULL, timeout_thread, NULL)) {
- fprintf(stderr,"Error: couldn't create program_timeout() thread\n");
- exit(1);
- }
- }
-
- /* Setup cleanup thread for signals */
- if (pthread_create(&thread_id, NULL, signal_thread, NULL)) {
- fprintf(stderr,"Error: couldn't create signal_timeout() thread\n");
- exit(1);
- }
-
- /* Setup tad for netfinger() threads */
- if (pthread_tad_init(&netfinger_tad, max_count)) {
- fprintf(stderr,"Error: couldn't create netfinger() TAD.\n");
- exit(1);
- }
-
- /* Setup the net and let everyone run */
- netsetup();
-
- while (*argv) {
- if (pthread_tad_create(&netfinger_tad, &thread_id, NULL,
- netfinger, *argv)) {
- fprintf(stderr, "Error: pthread_tad_create() netfinger_tad.\n");
- exit(2);
- }
- argv++;
- }
- pthread_tad_wait(&parse_file_tad, 0);
- pthread_tad_wait(&netfinger_tad, 0);
- exit(0);
-}
-
diff --git a/mit-pthreads/bin/finger/net.c b/mit-pthreads/bin/finger/net.c
deleted file mode 100755
index 77ccd92ee8c..00000000000
--- a/mit-pthreads/bin/finger/net.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/* ==== net.c ============================================================
- * Copyright (c) 1993, 1995 by Chris Provenzano, proven@athena.mit.edu
- *
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Tony Nardo of the Johns Hopkins University/Applied Physics Lab.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * 1.00 93/08/26 proven
- * -Pthread redesign of this file.
- */
-
-#include <pthreadutil.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <stdlib.h>
-#include <string.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <ctype.h>
-
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 64
-#endif
-/*
- * These globals are set initialy and then are only read.
- * They do not need mutexes.
- */
-extern int lflag;
-char myhostname[MAXHOSTNAMELEN];
-
-/*
- * These globals change and therefor do need mutexes
- */
-pthread_mutex_t spmutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_cond_t spcond = PTHREAD_COND_INITIALIZER;
-struct servent *sp = NULL;
-
-void netsetup(void)
-{
- pthread_mutex_lock(&spmutex);
- if (sp) {
- fprintf(stderr, "finger: service pointer already initialized.\n");
- exit(2);
- }
- if ((sp = (struct servent *)malloc(sizeof(struct servent) + 4096)) == NULL){
- fprintf(stderr, "finger: Couldn't allocate service pointer.\n");
- exit(2);
- }
- if (getservbyname_r("finger", "tcp", sp, (char *)sp + sizeof(struct servent), 4096) == NULL) {
- fprintf(stderr, "finger: tcp/finger: unknown service\n");
- exit(2);
- }
- if (gethostname(myhostname, MAXHOSTNAMELEN)) {
- fprintf(stderr, "finger: couldn't get my hostname.\n");
- exit(2);
- }
- pthread_cond_broadcast(&spcond);
- pthread_mutex_unlock(&spmutex);
-}
-
-void netsetupwait(void)
-{
- pthread_mutex_lock(&spmutex);
- while(sp == NULL) {
- pthread_cond_wait(&spcond, &spmutex);
- }
- pthread_mutex_unlock(&spmutex);
-}
-
-void *netfinger(char *name)
-{
- pthread_atexit_t atexit_id;
- register int c, lastc;
- struct in_addr defaddr;
- struct hostent *hp;
- struct sockaddr_in sin;
- int s, i, readbuflen;
- char readbuf[1024];
- char *host;
-
- netsetupwait();
- pthread_atexit_add(&atexit_id, fflush_nrv, NULL);
-
- if (!(host = strrchr(name, '@'))) {
- host = myhostname;
- } else {
- *host++ = '\0';
- }
- if (!(hp = gethostbyname(host))) {
- if ((defaddr.s_addr = inet_addr(host)) < 0) {
- fprintf(stderr, "[%s] gethostbyname: Unknown host\n", host);
- return;
- }
- }
- sin.sin_family = hp->h_addrtype;
- memcpy((char *)&sin.sin_addr, hp->h_addr, hp->h_length);
- sin.sin_port = sp->s_port;
-
- if ((s = socket(sin.sin_family, SOCK_STREAM, 0)) < 0) {
- sprintf(readbuf, "[%s]: socket", hp->h_name);
- perror(readbuf);
- return;
- }
-
- /* have network connection; identify the host connected with */
- if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
- sprintf(readbuf, "[%s]: connect", hp->h_name);
- perror(readbuf);
- close(s);
- return;
- }
-
- /* -l flag for remote fingerd */
- if (lflag)
- write(s, "/W ", 3);
- /* send the name followed by <CR><LF> */
- write(s, name, strlen(name));
- write(s, "\r\n", 2);
-
- /*
- * Read from the remote system; once we're connected, we assume some
- * data. If none arrives, we hang until the user interrupts, or
- * until the thread timeout expires.
- *
- * If we see a <CR> or a <CR> with the high bit set, treat it as
- * a newline; if followed by a newline character, only output one
- * newline.
- *
- * Otherwise, all high bits are stripped; if it isn't printable and
- * it isn't a space, we can simply set the 7th bit. Every ASCII
- * character with bit 7 set is printable.
- */
- for (readbuflen = read(s, readbuf, 1024), flockfile(stdout), lastc = '\n',
- printf("[%s]\n", hp->h_name); readbuflen > 0;
- readbuflen = read(s, readbuf, 1024)) {
- for (i = 0; i < readbuflen; i++) {
- c = readbuf[i] & 0x7f;
- if (c == 0x0d) {
- c = '\n';
- lastc = '\r';
- } else {
- if (!isprint(c) && !isspace(c))
- c |= 0x40;
- if (lastc != '\r' || c != '\n')
- lastc = c;
- else {
- lastc = '\n';
- continue;
- }
- }
- putchar_unlocked(c);
- }
- }
- if (lastc != '\n')
- putchar_unlocked('\n');
- funlockfile(stdout);
-}
diff --git a/mit-pthreads/config/COPYING.GNU b/mit-pthreads/config/COPYING.GNU
deleted file mode 100755
index a43ea2126fb..00000000000
--- a/mit-pthreads/config/COPYING.GNU
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- Appendix: How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/mit-pthreads/config/COPYRIGHT b/mit-pthreads/config/COPYRIGHT
deleted file mode 100755
index ba3ac43c589..00000000000
--- a/mit-pthreads/config/COPYRIGHT
+++ /dev/null
@@ -1,4 +0,0 @@
-The files config.guess and config.sub in this directory come from the GNU
-autoconf distribution, and are covered by the GNU Public License, which may
-be found in the file COPYING.GNU. They are the only files covered by the
-GPL.
diff --git a/mit-pthreads/config/GNUmakefile.in b/mit-pthreads/config/GNUmakefile.in
deleted file mode 100755
index 7c06ee367e6..00000000000
--- a/mit-pthreads/config/GNUmakefile.in
+++ /dev/null
@@ -1,129 +0,0 @@
-# === GNUmakefile =============================================================
-# Copyright (c) 1991, 1992, 1993 Chris Provenzano, proven@athena.mit.edu
-#
-# Description: This file is for creating libpthread.a
-#
-# 1.00 93/11/17 proven
-# -Put all the .o files into one file libpthread.a
-# -Initial cut for pthreads.
-#
-
-INSTALL_PATH = $(exec_prefix)
-
- BINDIR = $(INSTALL_PATH)/bin
- LIBDIR = $(INSTALL_PATH)/lib
- MANDIR = $(INSTALL_PATH)/man
- INCDIR = $(INSTALL_PATH)/include
- SUBINCDIR = $(INCDIR)/pthread
-
- AR = ar
- AS = gas
- CFLAGS = -I. -Iinclude -I$(srcdir)/include -DPTHREAD_KERNEL \
- @CFLAGS@
- CXXFLAGS = -I. -Iinclude -I$(srcdir)/include -DPTHREAD_KERNEL \
- @CXXFLAGS@
- LD = gld
-
- CSRC =
-
- PTHREAD_DIR = pthreads stdlib stdio gen
- DIRS = $(PTHREAD_DIR)
-
- HEADERS =
-
- LIBRARIES = libpthread.a
-
- .CURDIR = .
-
-# force correct default target
-all:
-
-###############################################################################
-#
-# Read in any special flags that config knows about
-include config.flags
-
-# What the heck. Convert srcdir to absolute form so it looks prettier.
-srcdir := $(shell cd $(srcfoo) && pwd)
-
-################################################################################
-#
-# Here starts the nitty grity part of the Makefile.
-
-all-lib : libpthread.a
-
-include ${srcdir}/pthreads/GNUmakefile.inc
-include ${srcdir}/stdlib/GNUmakefile.inc
-include ${srcdir}/stdio/GNUmakefile.inc
-include ${srcdir}/string/GNUmakefile.inc
-include ${srcdir}/gen/GNUmakefile.inc
-include ${srcdir}/net/GNUmakefile.inc
-include ${srcdir}/scripts/GNUmakefile.inc
-
-REGULAR_OBJS= $(subst .cc,.o,$(SRCS))
-REGULAR_OBJS:= $(subst .c,.o,$(REGULAR_OBJS))
-REGULAR_OBJS:= $(subst .S,.o,$(REGULAR_OBJS))
-OBJS= $(REGULAR_OBJS) $(EXTRA_OBJS)
-REALOBJS = $(addprefix obj/, $(OBJS))
-
-$(REALOBJS) : $(config) $(types) $(paths)
-
-# Since we do not have a list of the relevant files we do a make clean
-# before copying everyting to the distribution directory.
-distdir:
- $(MAKE) clean
- cp -a . $(distdir)
- # Remove symlinks that the distribution should not have.
- rm -f $(distdir)/config.cache \
- $(distdir)/include/pthread/machdep.h \
- $(distdir)/include/pthread/posix.h \
- $(distdir)/include/sys \
- $(distdir)/machdep.c \
- $(distdir)/syscall.S \
- $(distdir)/syscall-template.S
-
-clean:
- rm -f a.out core maketmp makeout $(LIBRARIES) $(BINARIES) libpthread.*
- rm -rf obj
- cd tests && $(MAKE) clean && cd ..
-
-install-lib: $(LIBRARIES) install-dirs
- for x in $(LIBRARIES); \
- do install $$x $(DESTDIR)$(LIBDIR); \
- done
-
-# Removed make install since mysql uses this in place.
-# install-lib install-include install-bin
-install:
-
-libpthread.a: obj/libpthread.a
- rm -f libpthread.a
- ln -s obj/libpthread.a .
-
-obj/libpthread.a: ${REALOBJS}
- rm -f libpthread.a obj/new.a obj/libpthread.a
- cd obj && \
- ar r new.a ${OBJS} && \
- $(RANLIB) new.a && \
- mv -f new.a libpthread.a && \
- cd ..
-
-# For examining a combined symbol table, sizes, &c.
-libpthread.o: ${REALOBJS}
- cd obj && ld -r -o ../libpthread.o ${OBJS} && cd ..
-
-obj/x:
- if [ -d obj ]; then true; else mkdir obj; fi
- cp /dev/null obj/x
-
-GNUmakefile: config.status ${srcdir}/config/GNUmakefile.in
- $(SHELL) config.status
-
-obj/%.o: %.c obj/x
- $(CC) $(CFLAGS) -c $< -o $@
-
-obj/%.o: %.cc obj/x
- $(CXX) $(CXXFLAGS) $(CFLAGS) -c $< -o $@
-
-obj/%.o: %.S obj/x
- $(CC) $(CFLAGS) -c $< -o $@
diff --git a/mit-pthreads/config/Makefile.in b/mit-pthreads/config/Makefile.in
deleted file mode 100644
index 3fa388d740b..00000000000
--- a/mit-pthreads/config/Makefile.in
+++ /dev/null
@@ -1,56 +0,0 @@
-# @(#)Makefile 5.2 (Berkeley) 3/5/91
-#
-
-LIB=pthread
-NOPIC=1
-NOPROFILE=1
-NOLINT=1
-MKPIC=no
-MKPROFILE=no
-MKLINT=no
-CPPFLAGS+= -I${.CURDIR} -I${.CURDIR}/include -I${srcdir}/include -DPTHREAD_KERNEL
-CDEBUGFLAGS= @CFLAGS@
-CFLAGS+= ${CDEBUGFLAGS}
-# CFLAGS+= ${CPPFLAGS} <- done by bsd.lib.mk
-CFLAGS+= ${CPPFLAGS}
-LIBDIR= $(exec_prefix)/lib
-BINDIR= $(exec_prefix)/bin
-INCDIR= $(exec_prefix)/include
-MANDIR= $(exec_prefix)/man
-
-.OBJDIR != if test -d ${.CURDIR}/obj ; then true ; else mkdir ${.CURDIR}/obj || exit 1 ; fi ; echo ${.CURDIR}/obj
-
-# Standard bsd install rules look for the "install" program, rather than
-# using some variable. So, hack things so that that install rule works.
-BINGRP != echo " " `groups` " " | sed 's/ [0-9][0-9]* / /g' | awk '{print $$1}'
-BINOWN != echo $${USER}
-LIBMODE = 644 # so ranlib can run!
-
-.include "config.flags"
-
-# %!$@ pmake seems to automagically cd into the obj directory, so relative
-# srcdir references are completely botched. Try to figure out an absolute
-# pathname for srcdir here, and live with it.
-srcdir = $(srctop)
-
-beforeinstall: install-dirs
-
-.include "${srcdir}/pthreads/Makefile.inc"
-.include "${srcdir}/stdlib/Makefile.inc"
-.include "${srcdir}/stdio/Makefile.inc"
-.include "${srcdir}/string/Makefile.inc"
-.include "${srcdir}/gen/Makefile.inc"
-.include "${srcdir}/net/Makefile.inc"
-.include "${srcdir}/scripts/Makefile.inc"
-
-$(OBJS) : $(config) $(types) $(paths)
-
-Makefile: ${srcdir}/config/Makefile.in
- cd ${.CURDIR} && sh config.status
-
-all-lib : libpthread.a
-# Removed make install since mysql uses this in place.
-#install : install-bin install-include
-install:
-
-.include <bsd.lib.mk>
diff --git a/mit-pthreads/config/acconfig.h b/mit-pthreads/config/acconfig.h
deleted file mode 100644
index 14552b0d851..00000000000
--- a/mit-pthreads/config/acconfig.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Does the OS already support struct timespec */
-#undef _OS_HAS_TIMESPEC
-
-/* For networking code: an integral type the size of an IP address (4
- octets). Determined by examining return values from certain
- functions. */
-#undef pthread_ipaddr_type
-
-/* For networking code: an integral type the size of an IP port number
- (2 octets). Determined by examining return values from certain
- functions. */
-#undef pthread_ipport_type
-
-/* type of clock_t, from system header files */
-#undef pthread_clock_t
-
-/* Specially named so grep processing will find it and put it into the
- generated ac-types.h. */
-#undef pthread_have_va_list_h
-
-/* type of size_t, from system header files */
-#undef pthread_size_t
-
-/* type of ssize_t, from system header files */
-#undef pthread_ssize_t
-
-/* type of time_t, from system header files */
-#undef pthread_time_t
-
-/* type of fpos_t, from system header files */
-#undef pthread_fpos_t
-
-/* type of off_t, from system header files */
-#undef pthread_off_t
-
-/* type of va_list, from system header files */
-#undef pthread_va_list
-
-/* type of sigset_t, from system header files */
-#undef pthread_sigset_t
-
-/* I don't know why the native compiler definitions aren't sufficient
- for this. */
-#undef sunos4
-
-/* define if the linker hauls in certain static data from libc even when
- you don't want it to. yes, this description is bogus, but chris added
- the need for this, without describing the problem. */
-#undef LD_LINKS_STATIC_DATA
-
-/* define if the system reissues the SIGCHLD if the handler reinstalls
- * itself before calling wait()
- */
-#undef BROKEN_SIGNALS
-
-/* where are terminal devices to be found? */
-#undef _PATH_PTY
-
-/* what directory holds the time zone info on this system? */
-#undef _PATH_TZDIR
-
-/* what file indicates the local time zone? */
-#undef _PATH_TZFILE
-
-/* Paths for various networking support files. */
-#undef _PATH_RESCONF
-#undef _PATH_HOSTS
-#undef _PATH_NETWORKS
-#undef _PATH_PROTOCOLS
-#undef _PATH_SERVICES
-
-/* Path for Bourne shell. */
-#undef _PATH_BSHELL
diff --git a/mit-pthreads/config/aclocal.m4 b/mit-pthreads/config/aclocal.m4
deleted file mode 100755
index 2a5cd3e9cbf..00000000000
--- a/mit-pthreads/config/aclocal.m4
+++ /dev/null
@@ -1,94 +0,0 @@
-dnl Autoconf extensions for pthreads package.
-dnl
-ifelse(regexp(AC_DEFINE(xxxxx),.*@@@.*),-1,,[define(IS_AUTOHEADER)])])dnl
-dnl
-dnl Now, the real stuff needed by the pthreads package.
-dnl
-AC_DEFUN([PTHREADS_CHECK_ONE_SYSCALL],
-[AC_MSG_CHECKING(for syscall $1)
-AC_CACHE_VAL(pthreads_cv_syscall_$1,
-AC_TRY_LINK([
-/* FIXME: This list should be generated from info in configure.in. */
-#ifdef HAVE_SYSCALL_H
-#include <syscall.h>
-#else
-#ifdef HAVE_SYS_SYSCALL_H
-#include <sys/syscall.h>
-#else
-where is your syscall header file??
-#endif
-#endif
-],[
-int x;
-x = SYS_$1 ;
-],
-eval pthreads_cv_syscall_$1=yes,
-eval pthreads_cv_syscall_$1=no))
-if eval test \$pthreads_cv_syscall_$1 = yes ; then
- pthreads_syscall_present=yes
- available_syscalls="$available_syscalls $1"
-dnl Can't just do the obvious substitution here or autoheader gets
-dnl sorta confused. (Sigh.) Getting the requoting of the brackets right
-dnl would be a pain too.
- macroname=HAVE_SYSCALL_`echo $1 | tr '[[[a-z]]]' '[[[A-Z]]]'`
- AC_DEFINE_UNQUOTED($macroname)
-else
- pthreads_syscall_present=no
- missing_syscalls="$missing_syscalls $1"
-fi
-AC_MSG_RESULT($pthreads_syscall_present)
-])dnl
-dnl
-AC_DEFUN(PTHREADS_CHECK_SYSCALLS,dnl
-ifdef([IS_AUTOHEADER],[#
-dnl Need to fake out autoheader, since there's no way to add a new class
-dnl of features to generate config.h.in entries for.
-@@@syscalls="$1"@@@
-@@@funcs="$funcs syscall_`echo $syscalls | sed 's/ / syscall_/g'`"@@@
-],
-[pthreads_syscall_list="$1"
-for pthreads_syscallname in $pthreads_syscall_list ; do
- PTHREADS_CHECK_ONE_SYSCALL([$]pthreads_syscallname)
-done
-]))dnl
-dnl
-dnl Requote each argument.
-define([requote], [ifelse($#, 0, , $#, 1, "$1",
- "$1" [requote(builtin(shift,$@))])])dnl
-dnl
-dnl Determine proper typedef value for a typedef name, and define a
-dnl C macro to expand to that type. (A shell variable with that value
-dnl is also created.) If none of the specified types to try match, the
-dnl macro is left undefined, and the shell variable empty. If the
-dnl typedef name cannot be found in the specified header files, this
-dnl test errors out; perhaps it should be changed to simply leave the
-dnl macro undefined...
-dnl
-dnl PTHREADS_FIND_TYPE(typedefname,varname,includes,possible values...)
-dnl
-AC_DEFUN(PTHREADS_FIND_TYPE,
-ifdef([IS_AUTOHEADER],[#
-@@@syms="$syms $2"@@@
-],[dnl
-AC_MSG_CHECKING(type of $1)
-AC_CACHE_VAL(pthreads_cv_type_$1,
-[AC_TRY_COMPILE([$3],[ extern $1 foo; ],
-[ for try_type in [requote(builtin(shift,builtin(shift,builtin(shift,$@))))] ; do
- AC_TRY_COMPILE([$3],[ extern $1 foo; extern $try_type foo; ],
- [ pthreads_cv_type_$1="$try_type" ; break ])
- done],
- AC_MSG_ERROR(Can't find system typedef for $1.))])
-if test -n "$pthreads_cv_type_$1" ; then
- AC_DEFINE_UNQUOTED($2,$pthreads_cv_type_$1)
-fi
-$2=$pthreads_cv_type_$1
-AC_MSG_RESULT($pthreads_cv_type_$1)]))dnl
-dnl
-dnl
-dnl Like above, but the list of types to try is pre-specified.
-dnl
-AC_DEFUN(PTHREADS_FIND_INTEGRAL_TYPE,[
-PTHREADS_FIND_TYPE([$1], [$2], [$3],
- int, unsigned int, long, unsigned long,
- short, unsigned short, char, unsigned char,
- long long, unsigned long long)])dnl
diff --git a/mit-pthreads/config/config.flags.in b/mit-pthreads/config/config.flags.in
deleted file mode 100755
index 3d16423a045..00000000000
--- a/mit-pthreads/config/config.flags.in
+++ /dev/null
@@ -1,80 +0,0 @@
-# Since the real configure script runs from the config subdirectory,
-# compensate here...
-srctop= @srctop@
-srcfoo= $(srctop)
-
-prefix= @prefix@
-exec_prefix= @exec_prefix@
-
-cpu = @target_cpu@
-os = @target_os@
-
-MISSING_SYSCALLS = @missing_syscalls@
-AVAILABLE_SYSCALLS = @available_syscalls@
-SYSCALL_EXCEPTIONS = @SYSCALL_EXCEPTIONS@
-HAVE_SYSCALL_TEMPLATE = @HAVE_SYSCALL_TEMPLATE@
-
-CC = @CC@
-CXX = @CXX@
-CPP = @CPP@
-SHELL = /bin/sh
-RANLIB = @RANLIB@
-# Should use autoconf to find these. Currently our makefiles are inconsistent.
-#AR = ar
-#AS = gas
-#LD = gld
-
-install-dirs:
- for d in $(INSTALL_PATH) $(BINDIR) $(LIBDIR) $(INCDIR) ; do \
- test -d $(DESTDIR)$$d || mkdir $(DESTDIR)$$d || exit 1 ; \
- done
-
-config.status: @srcdir@/configure
- cd ${.CURDIR} && $(SHELL) config.status --recheck
-config.flags: config.status @srcdir@/config.flags.in
- cd ${.CURDIR} && $(SHELL) config.status
-
-realclean: clean
- cd tests && $(MAKE) realclean && cd ..
- rm -f $(LINKS) config.status config.flags config.cache \
- Makefile GNUmakefile
-
-types=$(.CURDIR)/include/pthread/ac-types.h
-$(types) : config.h
- echo '#ifndef pthread_size_t' > $(types).new
- egrep '^#define pthread_' $(.CURDIR)/config.h >> $(types).new
- echo '#endif' >> $(types).new
- mv -f $(types).new $(types)
-
-config=$(.CURDIR)/include/pthread/config.h
-$(config) : config.h
- echo '#ifndef _SYS___CONFIG_H_' > $(config).new
- echo '#define _SYS___CONFIG_H_' >> $(config).new
- -egrep '^#define _OS_HAS' $(.CURDIR)/config.h >> $(config).new
- echo '#endif' >> $(config).new
- mv -f $(config).new $(config)
-
-paths=$(.CURDIR)/include/pthread/paths.h
-$(paths) : config.h
- echo '#ifndef _SYS___PATHS_H_' > $(paths).new
- echo '#define _SYS___PATHS_H_' >> $(paths).new
- egrep '^#define _PATH' $(.CURDIR)/config.h >> $(paths).new
- echo '#endif' >> $(paths).new
- mv -f $(paths).new $(paths)
-
-all-tests: all-lib
- cd ${.CURDIR}/tests && $(MAKE) all
-check: all-lib
- cd ${.CURDIR}/tests && $(MAKE) check
-all : all-lib all-bin
-
-install-bin: all-bin install-dirs
- for x in $(SCRIPTS) ; do \
- install $$x $(DESTDIR)$(BINDIR); \
- done
-
-install-include: install-dirs
- (cd ${srcdir}/include && tar chf - .)|(cd $(DESTDIR)$(INCDIR) && tar xf -)
- if [ -d config ]; then true; else \
- (cd ${.CURDIR}/include && tar chf - .)|(cd $(DESTDIR)$(INCDIR) && tar xf -); fi
- (cd $(DESTDIR)$(INCDIR) && find . \( -name CVS -o -name \*~ \) -print | xargs rm -rf)
diff --git a/mit-pthreads/config/config.guess b/mit-pthreads/config/config.guess
deleted file mode 100755
index 287ddc13c34..00000000000
--- a/mit-pthreads/config/config.guess
+++ /dev/null
@@ -1,505 +0,0 @@
-#!/bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-#
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program 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
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Written by Per Bothner <bothner@cygnus.com>.
-# The master version of this file is at the FSF in /home/gd/gnu/lib.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit system type (host/target name).
-#
-# Only a few systems have been added to this list; please add others
-# (but try to keep the structure clean).
-#
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 8/24/94.)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- alpha:OSF1:V*:*)
- # After 1.2, OSF1 uses "V1.3" for uname -r.
- echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'`
- exit 0 ;;
- alpha:OSF1:*:*)
- # 1.2 uses "1.2" for uname -r.
- echo alpha-dec-osf${UNAME_RELEASE}
- exit 0 ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
- Pyramid*:OSx*:*:*)
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit 0 ;;
- sun4*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:*:*)
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- mips:*:5*:RISCos)
- echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit 0 ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit 0 ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit 0 ;;
- AViiON:dgux:*:*)
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
- -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- exit 0 ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit 0 ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit 0 ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit 0 ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit 0 ;;
- *:IRIX:*:*)
- echo mips-sgi-irix${UNAME_RELEASE}
- exit 0 ;;
- i[34]86:AIX:*:*)
- echo i386-ibm-aix
- exit 0 ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- sed 's/^ //' << EOF >dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- echo rs6000-ibm-aix3.2.5
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit 0 ;;
- *:AIX:*:4)
- if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if grep bos410 /usr/include/stdio.h >/dev/null 2>&1; then
- IBM_REV=4.1
- elif grep bos411 /usr/include/stdio.h >/dev/null 2>&1; then
- IBM_REV=4.1.1
- else
- IBM_REV=4.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit 0 ;;
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit 0 ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit 0 ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit 0 ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit 0 ;;
- 9000/[3478]??:HP-UX:*:*)
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/7?? | 9000/8?7 ) HP_ARCH=hppa1.1 ;;
- 9000/8?? ) HP_ARCH=hppa1.0 ;;
- esac
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
- 3050*:HI-UX:*:*)
- sed 's/^ //' << EOF >dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- echo unknown-hitachi-hiuxwe2
- exit 0 ;;
- 9000/7??:4.3bsd:*:* | 9000/8?7:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit 0 ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit 0 ;;
- hp7??:OSF1:*:* | hp8?7:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit 0 ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit 0 ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit 0 ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit 0 ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit 0 ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit 0 ;;
- CRAY*X-MP:UNICOS:*:*)
- echo xmp-cray-unicos
- exit 0 ;;
- CRAY*Y-MP:UNICOS:*:*)
- echo ymp-cray-unicos
- exit 0 ;;
- CRAY-2:UNICOS:*:*)
- echo cray2-cray-unicos
- exit 0 ;;
- amiga:NetBSD:*:*)
- echo m68k-amiga-netbsd${UNAME_RELEASE}
- exit 0 ;;
- atari:NetBSD:*:*)
- echo m68k-atari-netbsd${UNAME_RELEASE}
- exit 0 ;;
- hp3[0-9][05]:NetBSD:*:*)
- echo m68k-hp-netbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:NetBSD:*:*)
- echo m68k-apple-netbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68:NetBSD:*:*)
- echo m68k-motorola-netbsd${UNAME_RELEASE}
- exit 0 ;;
- next68k:NetBSD:*:*)
- echo m68k-next-netbsd${UNAME_RELEASE}
- exit 0 ;;
- news68k:NetBSD:*:*)
- echo m68k-sony-netbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3:NetBSD:*:*)
- echo m68k-sun-netbsd${UNAME_RELEASE}
- exit 0 ;;
- x68k:NetBSD:*:*)
- echo m68k-sharp-netbsd${UNAME_RELEASE}
- exit 0 ;;
- i[34]86:BSD/386:*:* | *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:FreeBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
- *:NetBSD:*:*)
- UNAME_PROCESSOR=`uname -p 2>/dev/null` || UNAME_PROCESSOR=$UNAME_MACHINE
- echo ${UNAME_PROCESSOR}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- exit 0 ;;
- *:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
- *:GNU:*:*)
- echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
- *:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux
- exit 0 ;;
-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
-# are messed up and put the nodename in both sysname and nodename.
- i[34]86:DYNIX/ptx:4*:*)
- echo i386-sequent-sysv4
- exit 0 ;;
- i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*)
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
- else
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
- fi
- exit 0 ;;
- i[34]86:*:3.2:*)
- if /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
- echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
- elif test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL
- else
- echo ${UNAME_MACHINE}-unknown-sysv32
- fi
- exit 0 ;;
- i?86:*:5:7)
- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
- exit 0 ;;
- Intel:Mach:3*:*)
- echo i386-unknown-mach3
- exit 0 ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit 0 ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit 0 ;;
- M680[234]0:*:R3V[567]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0)
- uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3 && exit 0 ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
- m680[234]0:LynxOS:2.2*:*)
- echo m68k-lynx-lynxos${UNAME_RELEASE}
- exit 0 ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit 0 ;;
- i[34]86:LynxOS:2.2*:*)
- echo i386-lynx-lynxos${UNAME_RELEASE}
- exit 0 ;;
- TSUNAMI:LynxOS:2.2*:*)
- echo sparc-lynx-lynxos${UNAME_RELEASE}
- exit 0 ;;
- rs6000:LynxOS:2.2*:*)
- echo rs6000-lynx-lynxos${UNAME_RELEASE}
- exit 0 ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit 0 ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-cat >dummy.c <<EOF
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
- printf ("m68k-sony-newsos\n"); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- printf ("%s-next-nextstep%s\n", __ARCHITECTURE__, version==2 ? "2" : "3");
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-unknown-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- printf ("i386-sequent-ptx\n"); exit (0);
-#endif
-
-#if defined (vax)
-#if !defined (ultrix)
- printf ("vax-dec-bsd\n"); exit (0);
-#else
- printf ("vax-dec-ultrix\n"); exit (0);
-#endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
-rm -f dummy.c dummy
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit 0 ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- c34*)
- echo c34-convex-bsd
- exit 0 ;;
- c38*)
- echo c38-convex-bsd
- exit 0 ;;
- c4*)
- echo c4-convex-bsd
- exit 0 ;;
- esac
-fi
-
-#echo '(Unable to guess system type)' 1>&2
-
-exit 1
diff --git a/mit-pthreads/config/config.h.in b/mit-pthreads/config/config.h.in
deleted file mode 100755
index b5e25404a67..00000000000
--- a/mit-pthreads/config/config.h.in
+++ /dev/null
@@ -1,324 +0,0 @@
-/* config.h.in. Generated automatically from configure.in by autoheader. */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-#undef off_t
-
-/* Define as the return type of signal handlers (int or void). */
-#undef RETSIGTYPE
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Does the OS already support struct timespec */
-#undef _OS_HAS_TIMESPEC
-
-/* Does the OS need socklen_t for the socket syscalls? */
-#undef _OS_HAS_SOCKLEN_T
-
-/* For networking code: an integral type the size of an IP address (4
- octets). Determined by examining return values from certain
- functions. */
-#undef pthread_ipaddr_type
-
-/* For networking code: an integral type the size of an IP port number
- (2 octets). Determined by examining return values from certain
- functions. */
-#undef pthread_ipport_type
-
-/* type of clock_t, from system header files */
-#undef pthread_clock_t
-
-/* Specially named so grep processing will find it and put it into the
- generated ac-types.h. */
-#undef pthread_have_va_list_h
-
-/* type of size_t, from system header files */
-#undef pthread_size_t
-
-/* type of ssize_t, from system header files */
-#undef pthread_ssize_t
-
-/* type of time_t, from system header files */
-#undef pthread_time_t
-
-/* type of fpos_t, from system header files */
-#undef pthread_fpos_t
-
-/* type of off_t, from system header files */
-#undef pthread_off_t
-
-/* type of va_list, from system header files */
-#undef pthread_va_list
-
-/* I don't know why the native compiler definitions aren't sufficient
- for this. */
-#undef sunos4
-
-/* define if the linker hauls in certain static data from libc even when
- you don't want it to. yes, this description is bogus, but chris added
- the need for this, without describing the problem. */
-#undef LD_LINKS_STATIC_DATA
-
-/* define if the system reissues the SIGCHLD if the handler reinstalls
- * itself before calling wait()
- */
-#undef BROKEN_SIGNALS
-
-/* where are terminal devices to be found? */
-#undef _PATH_PTY
-
-/* what directory holds the time zone info on this system? */
-#undef _PATH_TZDIR
-
-/* what file indicates the local time zone? */
-#undef _PATH_TZFILE
-
-/* Paths for various networking support files. */
-#undef _PATH_RESCONF
-#undef _PATH_HOSTS
-#undef _PATH_NETWORKS
-#undef _PATH_PROTOCOLS
-#undef _PATH_SERVICES
-
-/* Path for Bourne shell. */
-#undef _PATH_BSHELL
-
-/* Define if you have the syscall_accept function. */
-#undef HAVE_SYSCALL_ACCEPT
-
-/* Define if you have the syscall_bind function. */
-#undef HAVE_SYSCALL_BIND
-
-/* Define if you have the syscall_chdir function. */
-#undef HAVE_SYSCALL_CHDIR
-
-/* Define if you have the syscall_chmod function. */
-#undef HAVE_SYSCALL_CHMOD
-
-/* Define if you have the syscall_chown function. */
-#undef HAVE_SYSCALL_CHOWN
-
-/* Define if you have the syscall_chroot function. */
-#undef HAVE_SYSCALL_CHROOT
-
-/* Define if you have the syscall_close function. */
-#undef HAVE_SYSCALL_CLOSE
-
-/* Define if you have the syscall_connect function. */
-#undef HAVE_SYSCALL_CONNECT
-
-/* Define if you have the syscall_creat function. */
-#undef HAVE_SYSCALL_CREAT
-
-/* Define if you have the syscall_dup function. */
-#undef HAVE_SYSCALL_DUP
-
-/* Define if you have the syscall_dup2 function. */
-#undef HAVE_SYSCALL_DUP2
-
-/* Define if you have the syscall_execve function. */
-#undef HAVE_SYSCALL_EXECVE
-
-/* Define if you have the syscall_exit function. */
-#undef HAVE_SYSCALL_EXIT
-
-/* Define if you have the syscall_fchmod function. */
-#undef HAVE_SYSCALL_FCHMOD
-
-/* Define if you have the syscall_fchown function. */
-#undef HAVE_SYSCALL_FCHOWN
-
-/* Define if you have the syscall_fcntl function. */
-#undef HAVE_SYSCALL_FCNTL
-
-/* Define if you have the syscall_flock function. */
-#undef HAVE_SYSCALL_FLOCK
-
-/* Define if you have the syscall_fork function. */
-#undef HAVE_SYSCALL_FORK
-
-/* Define if you have the syscall_fstat function. */
-#undef HAVE_SYSCALL_FSTAT
-
-/* Define if you have the syscall_fstatfs function. */
-#undef HAVE_SYSCALL_FSTATFS
-
-/* Define if you have the syscall_ftruncate function. */
-#undef HAVE_SYSCALL_FTRUNCATE
-
-/* Define if you have the syscall_getdents function. */
-#undef HAVE_SYSCALL_GETDENTS
-
-/* Define if you have the syscall_getdirentries function. */
-#undef HAVE_SYSCALL_GETDIRENTRIES
-
-/* Define if you have the syscall_getdtablesize function. */
-#undef HAVE_SYSCALL_GETDTABLESIZE
-
-/* Define if you have the syscall_getmsg function. */
-#undef HAVE_SYSCALL_GETMSG
-
-/* Define if you have the syscall_getpeername function. */
-#undef HAVE_SYSCALL_GETPEERNAME
-
-/* Define if you have the syscall_getpgrp function. */
-#undef HAVE_SYSCALL_GETPGRP
-
-/* Define if you have the syscall_getsockname function. */
-#undef HAVE_SYSCALL_GETSOCKNAME
-
-/* Define if you have the syscall_getsockopt function. */
-#undef HAVE_SYSCALL_GETSOCKOPT
-
-/* Define if you have the syscall_ioctl function. */
-#undef HAVE_SYSCALL_IOCTL
-
-/* Define if you have the syscall_ksigaction function. */
-#undef HAVE_SYSCALL_KSIGACTION
-
-/* Define if you have the syscall_link function. */
-#undef HAVE_SYSCALL_LINK
-
-/* Define if you have the syscall_listen function. */
-#undef HAVE_SYSCALL_LISTEN
-
-/* Define if you have the syscall_lseek function. */
-#undef HAVE_SYSCALL_LSEEK
-
-/* Define if you have the syscall_lstat function. */
-#undef HAVE_SYSCALL_LSTAT
-
-/* Define if you have the syscall_open function. */
-#undef HAVE_SYSCALL_OPEN
-
-/* Define if you have the syscall_pgrpsys function. */
-#undef HAVE_SYSCALL_PGRPSYS
-
-/* Define if you have the syscall_pipe function. */
-#undef HAVE_SYSCALL_PIPE
-
-/* Define if you have the syscall_poll function. */
-#undef HAVE_SYSCALL_POLL
-
-/* Define if you have the syscall_putmsg function. */
-#undef HAVE_SYSCALL_PUTMSG
-
-/* Define if you have the syscall_read function. */
-#undef HAVE_SYSCALL_READ
-
-/* Define if you have the syscall_readdir function. */
-#undef HAVE_SYSCALL_READDIR
-
-/* Define if you have the syscall_readv function. */
-#undef HAVE_SYSCALL_READV
-
-/* Define if you have the syscall_recv function. */
-#undef HAVE_SYSCALL_RECV
-
-/* Define if you have the syscall_recvfrom function. */
-#undef HAVE_SYSCALL_RECVFROM
-
-/* Define if you have the syscall_recvmsg function. */
-#undef HAVE_SYSCALL_RECVMSG
-
-/* Define if you have the syscall_rename function. */
-#undef HAVE_SYSCALL_RENAME
-
-/* Define if you have the syscall_select function. */
-#undef HAVE_SYSCALL_SELECT
-
-/* Define if you have the syscall_send function. */
-#undef HAVE_SYSCALL_SEND
-
-/* Define if you have the syscall_sendmsg function. */
-#undef HAVE_SYSCALL_SENDMSG
-
-/* Define if you have the syscall_sendto function. */
-#undef HAVE_SYSCALL_SENDTO
-
-/* Define if you have the syscall_setsockopt function. */
-#undef HAVE_SYSCALL_SETSOCKOPT
-
-/* Define if you have the syscall_shutdown function. */
-#undef HAVE_SYSCALL_SHUTDOWN
-
-/* Define if you have the syscall_sigaction function. */
-#undef HAVE_SYSCALL_SIGACTION
-
-/* Define if you have the syscall_sigpause function. */
-#undef HAVE_SYSCALL_SIGPAUSE
-
-/* Define if you have the syscall_sigprocmask function. */
-#undef HAVE_SYSCALL_SIGPROCMASK
-
-/* Define if you have the syscall_sigsuspend function. */
-#undef HAVE_SYSCALL_SIGSUSPEND
-
-/* Define if you have the syscall_socket function. */
-#undef HAVE_SYSCALL_SOCKET
-
-/* Define if you have the syscall_socketcall function. */
-#undef HAVE_SYSCALL_SOCKETCALL
-
-/* Define if you have the syscall_socketpair function. */
-#undef HAVE_SYSCALL_SOCKETPAIR
-
-/* Define if you have the syscall_stat function. */
-#undef HAVE_SYSCALL_STAT
-
-/* Define if you have the syscall_uname function. */
-#undef HAVE_SYSCALL_UNAME
-
-/* Define if you have the syscall_unlink function. */
-#undef HAVE_SYSCALL_UNLINK
-
-/* Define if you have the syscall_wait3 function. */
-#undef HAVE_SYSCALL_WAIT3
-
-/* Define if you have the syscall_wait4 function. */
-#undef HAVE_SYSCALL_WAIT4
-
-/* Define if you have the syscall_waitpid function. */
-#undef HAVE_SYSCALL_WAITPID
-
-/* Define if you have the syscall_waitsys function. */
-#undef HAVE_SYSCALL_WAITSYS
-
-/* Define if you have the syscall_write function. */
-#undef HAVE_SYSCALL_WRITE
-
-/* Define if you have the syscall_writev function. */
-#undef HAVE_SYSCALL_WRITEV
-
-/* Define if you have the vfork function. */
-#undef HAVE_VFORK
-
-/* Define if you have the <alloc.h> header file. */
-#undef HAVE_ALLOC_H
-
-/* Define if you have the <sys/filio.h> header file. */
-#undef HAVE_SYS_FILIO_H
-
-/* Define if you have the <sys/syscall.h> header file. */
-#undef HAVE_SYS_SYSCALL_H
-
-/* Define if you have the <sys/termio.h> header file. */
-#undef HAVE_SYS_TERMIO_H
-
-/* Define if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
-/* Define if you have the <syscall.h> header file. */
-#undef HAVE_SYSCALL_H
-
-/* Define if you have the <termio.h> header file. */
-#undef HAVE_TERMIO_H
-
-/* Define if you have the <termios.h> header file. */
-#undef HAVE_TERMIOS_H
diff --git a/mit-pthreads/config/config.sub b/mit-pthreads/config/config.sub
deleted file mode 100755
index 7a0c7855a2a..00000000000
--- a/mit-pthreads/config/config.sub
+++ /dev/null
@@ -1,794 +0,0 @@
-#!/bin/sh
-# Configuration validation subroutine script, version 1.1.
-# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-# First pass through any local machine types.
-case $1 in
- *local*)
- echo $1
- exit 0
- ;;
- *)
- ;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS (if any).
-basic_machine=`echo $1 | sed 's/-[^-]*$//'`
-if [ $basic_machine != $1 ]
-then os=`echo $1 | sed 's/.*-/-/'`
-else os=; fi
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp )
- os=
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
- ;;
- -lynx)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- tahoe | i[3456]86 | i860 | m68k | m68000 | m88k | ns32k | arm | arm32 | pyramid \
- | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \
- | alpha | we32k | ns16k | clipper | sparclite | i370 | sh \
- | powerpc | sparc64 | 1750a | dsp16xx | mips64 | mipsel \
- | pdp11 | mips64el | mips64orion | mips64orionel )
- basic_machine=$basic_machine-unknown
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \
- | sparc-* | ns32k-* | fx80-* | arm-* | arm32-* | c[123]* \
- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
- | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
- | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
- | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
- | pdp11-* | sh-* | powerpc-* | sparc64-* | mips64-* | mipsel-* \
- | mips64el-* | mips64orion-* | mips64orionel-* )
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-cbm
- ;;
- amigados)
- basic_machine=m68k-cbm
- os=-amigados
- ;;
- amigaunix | amix)
- basic_machine=m68k-cbm
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- cray2)
- basic_machine=cray2-cray
- os=-unicos
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- os=-mvs
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i[3456]86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
- os=-sysv32
- ;;
- i[3456]86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
- os=-sysv4
- ;;
- i[3456]86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
- os=-sysv
- ;;
- i[3456]86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
- os=-solaris2
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pentium-*)
- # We will change tis to say i586 once there has been
- # time for various packages to start to recognize that.
- basic_machine=i486-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- xmp)
- basic_machine=xmp-cray
- os=-unicos
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- mips)
- basic_machine=mips-mips
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sparc)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative must end in a *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[3456]* \
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigados* | -msdos* | -newsos* | -unicos* | -aos* \
- | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
- | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -netbsd* | -freebsd* | -openbsd* \
- |-riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
- | -ptx* | -coff* | -winnt*)
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -xenix)
- os=-xenix
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- *-acorn)
- os=-riscix1.2
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-ibm)
- os=-aix
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigados
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-masscomp)
- os=-rtu
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -lynxos*)
- vendor=lynx
- ;;
- -aix*)
- vendor=ibm
- ;;
- -hpux*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
diff --git a/mit-pthreads/config/configure b/mit-pthreads/config/configure
deleted file mode 100755
index 4d99ac5c07e..00000000000
--- a/mit-pthreads/config/configure
+++ /dev/null
@@ -1,3336 +0,0 @@
-#! /bin/sh
-
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-
-# Defaults:
-ac_help=
-ac_default_prefix=/usr/local
-# Any additions from configure.in:
-ac_help="$ac_help
---enable-dce-compat DCE compatibility"
-ac_default_prefix=/usr/local/pthreads
-
-# Initialize some variables set by options.
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
-exec_prefix=NONE
-host=NONE
-no_create=
-nonopt=NONE
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-target=NONE
-verbose=
-x_includes=NONE
-x_libraries=NONE
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
-ac_prev=
-for ac_option
-do
-
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case "$ac_option" in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir="$ac_optarg" ;;
-
- -disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.13"
- exit 0 ;;
-
- -with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "with_${ac_package}='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
-
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
- ;;
-
- *)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
-
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
-do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
- esac
-done
-
-# NLS nuisances.
-# Only set these to C if already set. These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
-
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=config.flags.in
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
- else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
- fi
-fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
-else
- echo "creating cache $cache_file"
- > $cache_file
-fi
-
-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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
-
-
-# Check whether --enable-dce-compat or --disable-dce-compat was given.
-if test "${enable_dce_compat+set}" = set; then
- enableval="$enable_dce_compat"
- { echo "configure: error: Actually, DCE compatibility doesn't work yet..." 1>&2; exit 1; }
-
-else
- true
-
-fi
-
-
-# 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:542: 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
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; 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
-
-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:572: 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
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_prog_rejected=no
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- 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"
-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"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- if test -z "$CC"; then
- case "`uname -s`" in
- *win32* | *WIN32*)
- # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:623: 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
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="cl"
- 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
- ;;
- esac
- 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:655: 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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-cat > conftest.$ac_ext << EOF
-
-#line 666 "configure"
-#include "confdefs.h"
-
-main(){return(0);}
-EOF
-if { (eval echo configure:671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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*
-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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-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:697: 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:702: 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:711: \"$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
-else
- GCC=
-fi
-
-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:730: 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
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-
-for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:766: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CXX="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CXX="$ac_cv_prog_CXX"
-if test -n "$CXX"; then
- echo "$ac_t""$CXX" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-test -n "$CXX" && break
-done
-test -n "$CXX" || CXX="gcc"
-
-
-echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:798: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
-
-ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
-
-cat > conftest.$ac_ext << EOF
-
-#line 809 "configure"
-#include "confdefs.h"
-
-int main(){return(0);}
-EOF
-if { (eval echo configure:814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- ac_cv_prog_cxx_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_cxx_cross=no
- else
- ac_cv_prog_cxx_cross=yes
- fi
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_prog_cxx_works=no
-fi
-rm -fr conftest*
-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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
-if test $ac_cv_prog_cxx_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 ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:840: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
-cross_compiling=$ac_cv_prog_cxx_cross
-
-echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:845: checking whether we are using GNU C++" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.C <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gxx=yes
-else
- ac_cv_prog_gxx=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gxx" 1>&6
-
-if test $ac_cv_prog_gxx = yes; then
- GXX=yes
-else
- GXX=
-fi
-
-ac_test_CXXFLAGS="${CXXFLAGS+set}"
-ac_save_CXXFLAGS="$CXXFLAGS"
-CXXFLAGS=
-echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:873: checking whether ${CXX-g++} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.cc
-if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
- ac_cv_prog_cxx_g=yes
-else
- ac_cv_prog_cxx_g=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
-if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS="$ac_save_CXXFLAGS"
-elif test $ac_cv_prog_cxx_g = yes; then
- if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-g"
- fi
-else
- if test "$GXX" = yes; then
- CXXFLAGS="-O2"
- else
- CXXFLAGS=
- fi
-fi
-
-echo $ac_n "checking compiler availability and simple error detection""... $ac_c" 1>&6
-echo "configure:905: checking compiler availability and simple error detection" >&5
-cat > conftest.$ac_ext <<EOF
-#line 907 "configure"
-#include "confdefs.h"
-
-int main() {
- exit(0);
-; return 0; }
-EOF
-if { (eval echo configure:914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
-
- cat > conftest.$ac_ext <<EOF
-#line 918 "configure"
-#include "confdefs.h"
-
-int main() {
- syntax errors galore!
-; return 0; }
-EOF
-if { (eval echo configure:925: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- { echo "configure: error: Can't detect syntax errors! Is CC set right?" 1>&2; exit 1; }
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- true
-fi
-rm -f conftest*
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- { echo "configure: error: Can't compile test program! Is CC set right?" 1>&2; exit 1; }
-fi
-rm -f conftest*
-
-cat > conftest.$ac_ext <<EOF
-#line 944 "configure"
-#include "confdefs.h"
-
-int main() {
-
- typedef int Integer;
- extern int i;
- extern Integer i;
-
-; return 0; }
-EOF
-if { (eval echo configure:955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- :
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- { echo "configure: error: Can't redeclare variables with this compiler??" 1>&2; exit 1; }
-fi
-rm -f conftest*
-cat > conftest.$ac_ext <<EOF
-#line 965 "configure"
-#include "confdefs.h"
-
-int main() {
-
- typedef long Long;
- extern int i;
- extern Long i;
-
-; return 0; }
-EOF
-if { (eval echo configure:976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- { echo "configure: error: Compiler doesn't detect conflicting declarations." 1>&2; exit 1; }
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-echo "$ac_t""ok" 1>&6
-
-if test $ac_cv_prog_gcc = yes ; then
- CFLAGS="$CFLAGS -Werror"
-fi
-
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:991: checking how to run the C preprocessor" >&5
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 1006 "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:1012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 1023 "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:1029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -nologo -E"
- cat > conftest.$ac_ext <<EOF
-#line 1040 "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:1046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
-fi
-rm -f conftest*
-fi
-rm -f conftest*
-fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
-fi
- CPP="$ac_cv_prog_CPP"
-else
- ac_cv_prog_CPP="$CPP"
-fi
-echo "$ac_t""$CPP" 1>&6
-
-
-# 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:1074: 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
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
-fi
-fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
-
-# Do some error checking and defaulting for the host and target type.
-# The inputs are:
-# configure --host=HOST --target=TARGET --build=BUILD NONOPT
-#
-# The rules are:
-# 1. You are not allowed to specify --host, --target, and nonopt at the
-# same time.
-# 2. Host defaults to nonopt.
-# 3. If nonopt is not specified, then host defaults to the current host,
-# as determined by config.guess.
-# 4. Target and build default to nonopt.
-# 5. If nonopt is not specified, then target and build default to host.
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-case $host---$target---$nonopt in
-NONE---*---* | *---NONE---* | *---*---NONE) ;;
-*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
-esac
-
-
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1151: checking host system type" >&5
-
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
- NONE)
- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
- fi ;;
- *) host_alias=$nonopt ;;
- esac ;;
-esac
-
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
-
-echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:1172: checking target system type" >&5
-
-target_alias=$target
-case "$target_alias" in
-NONE)
- case $nonopt in
- NONE) target_alias=$host_alias ;;
- *) target_alias=$nonopt ;;
- esac ;;
-esac
-
-target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
-target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$target" 1>&6
-
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1190: 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=`${CONFIG_SHELL-/bin/sh} $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
-
-test "$host_alias" != "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
-
-
-syscall=NONE
-sysincludes=NONE
-extraincludes=NONE
-
-# Treat all x86 machines the same.
-# (Yet below, we pretend we can distinguish between the MIPS r2000 and r4000?)
-# (What about 680x0 machines?)
-case $host in
- i[456]86-*)
- host=`echo $host | sed 's/^i[456]86/i386/'`
- host_cpu=i386
- ;;
-esac
-
-# Here, you should set the following variables:
-# name
-# The "name" of this configuration. Used for "engine-*.c" file name,
-# default for syscall file names. Chris seems to have a thing for
-# putting "-" between OS and version number, but the configure script
-# will already have $host_cpu and $host_os available for you to use
-# in constructing a name.
-# sysincludes
-# Name of machdep directory with "sys" include file
-# replacements, if any. This directory is optional;
-# if you don't provide it, don't set this variable.
-# except
-# Names of any syscalls that shouldn't be generated
-# from the template, if any.
-# syscall
-# Base name of the syscall template files, if not the
-# same as <name>. If they're the same, omit this.
-#
-# Also, you may define random symbols and update CFLAGS if
-# necessary. However, for ease of porting to new machines,
-# it's best if you can create portable autoconf tests for
-# whatever you're trying to do, rather than hard-coding it
-# here based on the OS name. So please, try to keep this
-# section as minimal as possible.
-
-except=""
-name=$host_cpu-$host_os
-
-case $host in
- alpha-*-netbsd1.3[H-Z]|alpha-*-netbsd1.[45]*)
- name=alpha-netbsd-1.3
- sysincludes=netbsd-1.1
- except="fork lseek pipe fstat"
- available_syscalls="sigsuspend sigprocmask"
- ;;
- alpha-*-netbsd1.3*)
- name=alpha-netbsd-1.3
- sysincludes=netbsd-1.1
- except="fork lseek pipe sigsuspend sigprocmask fstat"
- ;;
- alpha-*-netbsd1.1* | alpha-*-netbsd1.2*)
- name=alpha-netbsd-1.1
- sysincludes=netbsd-1.1
- except="fork lseek pipe sigsuspend sigprocmask"
- ;;
- alpha-*-osf*)
- name=alpha-osf1
- sysincludes=alpha-osf1
- except="fork sigsuspend"
- if test $ac_cv_prog_gcc = no ; then
- CFLAGS="$CFLAGS -std"
- fi
- ;;
- arm32-*-netbsd1.3[H-Z]|arm32-*-netbsd1.[45]*)
- name=arm32-netbsd-1.3
- sysincludes=netbsd-1.1
- except="fork pipe lseek ftruncate fstat"
- available_syscalls="sigsuspend sigprocmask"
- ;;
- arm32-*-netbsd1.3*)
- name=arm32-netbsd-1.3
- sysincludes=netbsd-1.1
- except="fork pipe lseek ftruncate sigsuspend sigprocmask fstat"
- ;;
- hppa1.0-*-hpux10.20 | hppa1.1-*-hpux10.20)
- name=hppa-hpux-10.20
- sysincludes=hpux-10.20
- except="fork"
- ;;
- hppa1.1-*-hpux*9.*)
- name=hppa-hpux-9.03
- sysincludes=hpux-9.03
- # hpux-9.03.mk seems to be missing; what should this be?
- except="fork"
- ;;
- powerpc-*-netbsd1.*)
- name=powerpc-netbsd
- sysincludes=netbsd-1.1
- except="fork lseek ftruncate pipe fstat"
- available_syscalls="sigprocmask sigaction sigsuspend"
- ;;
- sparc-*-sunos4.1.3* | sparc-*-sunos4.1.4*)
- name=sparc-sunos-4.1.3
- sysincludes=sunos-4.1.3
- syscall=sparc-sunos4
- except="fork pipe getpgrp getdirentries"
- cat >> confdefs.h <<\EOF
-#define sunos4 1
-EOF
- # is this really needed??
- ;;
- sparc-*-solaris2.3* | sparc-*-solaris2.4*)
- name=sparc-sunos-5.3
- sysincludes=sunos-5.3
- except="fork sigaction"
- # Should really come up with a test for this...
- cat >> confdefs.h <<\EOF
-#define LD_LINKS_STATIC_DATA 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define BROKEN_SIGNALS 1
-EOF
-
- ;;
- sparc-*-solaris2*)
- name=sparc-sunos-5.3
- sysincludes=sunos-5.5
- except="fork sigaction"
- # Should really come up with a test for this...
- cat >> confdefs.h <<\EOF
-#define LD_LINKS_STATIC_DATA 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define BROKEN_SIGNALS 1
-EOF
-
- ;;
- sparc-*-netbsd1.3[H-Z]|sparc-*-netbsd1.[45]*)
- name=sparc-netbsd-1.3
- sysincludes=netbsd-1.1
- except="pipe fork lseek ftruncate fstat"
- available_syscalls="sigprocmask sigsuspend"
- ;;
- sparc-*-netbsd1.3*)
- name=sparc-netbsd-1.3
- sysincludes=netbsd-1.1
- except="pipe fork lseek ftruncate sigprocmask sigsuspend fstat"
- ;;
- sparc-*-netbsd1.0A | sparc-*-netbsd1.1* | sparc-*-netbsd1.2*)
- name=sparc-sunos-4.1.3
- sysincludes=netbsd-1.0
- syscall=sparc-netbsd-1.1
- except="pipe fork sigprocmask sigsuspend"
- ;;
- i386-*-openbsd2.*)
- name=i386-openbsd-2.0
- sysincludes=openbsd-2.0
- except="fork lseek ftruncate sigsuspend sigprocmask"
- ;;
- i386-*-linux*)
- #name=i386-linux-1.0
- #sysincludes=linux-1.0
- name=i386-linux-2.0
- sysincludes=linux-2.0
- extraincludes="bits"
- ;;
- i386-*-bsdi1.1)
- name=i386-bsdi-1.1
- sysincludes=bsdi-1.1
- ;;
- i386-*-bsdi2.0* | i386-*-bsdi2.1*)
- name=i386-bsdi-2.0
- sysincludes=bsdi-2.0
- syscall=i386-bsdi-2.0
- except="fork lseek ftruncate sigsuspend"
- ;;
- i386-*-netbsd1.3[H-Z]|i386-*-netbsd1.[45]*)
- name=i386-netbsd-1.3
- sysincludes=netbsd-1.1
- except="fork lseek ftruncate pipe fstat"
- available_syscalls="sigsuspend sigprocmask"
- ;;
- i386-*-netbsd1.3*)
- name=i386-netbsd-1.3
- sysincludes=netbsd-1.1
- except="fork lseek ftruncate pipe sigsuspend sigprocmask fstat"
- ;;
- i386-*-netbsd1.1* | i386-*-netbsd1.2*)
- name=i386-netbsd-1.0
- sysincludes=netbsd-1.1
- syscall=i386-netbsd-1.1
- except="fork lseek ftruncate pipe sigsuspend sigprocmask"
- ;;
- i386-*-netbsd1.0*)
- name=i386-netbsd-1.0
- sysincludes=netbsd-1.0
- except="fork lseek ftruncate sigsuspend"
- ;;
- i386-*-netbsd0.9*)
- name=i386-netbsd-0.9
- sysincludes=netbsd-0.9
- ;;
- m68*-*-netbsd*)
- name=m68000-netbsd
- sysincludes=netbsd-1.1
- except="lseek ftruncate pipe fstat"
- available_syscalls="sigsuspend sigprocmask"
- ;;
- i386-*-freebsd*)
- name=i386-freebsd-2.0
- sysincludes=freebsd-2.0
- except="fork lseek ftruncate sigsuspend sigprocmask"
- ;;
- romp-*-bsd*)
- name=romp-bsd
- ;;
- mips-dec-ultrix*)
- name=r2000-ultrix-4.2
- sysincludes=ultrix-4.2
- except="fork pipe"
- ;;
- mips-sgi-irix*)
- name=ip22-irix-5.2
- sysincludes=irix-5.2
- except="fstat stat"
- cat >> confdefs.h <<\EOF
-#define BROKEN_SIGNALS 1
-EOF
-
- ;;
- i386-*-sco3.2v5*)
- name=i386-sco3.2.5
- sysincludes=i386-sco3.2.5
- syscall=i386-sco3.2.5
- except="select socketcall accept bind connect getpeername getsockname getsockopt setsockopt listen recv recvfrom recvmsg send sendmsg sendto shutdown socket socketpair fork fcntl dup2 fstat fchmod fchown ftruncate pipe getdirentries sigaction sigpause wait3 waitpid getdtablesize"
- ;;
- *)
- { echo "configure: error: System type $host not recognized or not supported.
-See $srcdir/configure.in for supported systems." 1>&2; exit 1; }
- exit 1
- ;;
-esac
-
-SYSCALL_EXCEPTIONS=$except
-
-
-for ac_hdr in sys/termio.h termios.h termio.h alloc.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1453: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1458 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1463: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-
-ac_safe=`echo "va_list.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for va_list.h""... $ac_c" 1>&6
-echo "configure:1492: checking for va_list.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1497 "configure"
-#include "confdefs.h"
-#include <va_list.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define pthread_have_va_list_h 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-for ac_hdr in syscall.h sys/syscall.h sys/filio.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1531: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1536 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-
-pthreads_syscall_list="open write read creat close fcntl lseek dup2 dup pipe
- fchmod fchown execve fstat lstat link unlink chdir chown chmod stat
- rename select getdtablesize ioctl ftruncate flock fstatfs chroot uname
- sigsuspend sigaction sigpause sigprocmask ksigaction
- getdents readdir getdirentries
- wait4 wait3 waitpid waitsys
- socket bind connect accept listen getsockopt setsockopt socketpair
- poll putmsg getmsg
- socketcall
-
- pgrpsys
-
- exit
- readv writev send sendto sendmsg recv recvfrom recvmsg
- getpeername getsockname
- shutdown
- getpgrp fork"
-for pthreads_syscallname in $pthreads_syscall_list ; do
- echo $ac_n "checking for syscall $pthreads_syscallname""... $ac_c" 1>&6
-echo "configure:1587: checking for syscall $pthreads_syscallname" >&5
-if eval "test \"`echo '$''{'pthreads_cv_syscall_$pthreads_syscallname'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1592 "configure"
-#include "confdefs.h"
-
-/* FIXME: This list should be generated from info in configure.in. */
-#ifdef HAVE_SYSCALL_H
-#include <syscall.h>
-#else
-#ifdef HAVE_SYS_SYSCALL_H
-#include <sys/syscall.h>
-#else
-where is your syscall header file??
-#endif
-#endif
-
-int main() {
-
-int x;
-x = SYS_$pthreads_syscallname ;
-
-; return 0; }
-EOF
-if { (eval echo configure:1613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval pthreads_cv_syscall_$pthreads_syscallname=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval pthreads_cv_syscall_$pthreads_syscallname=no
-fi
-rm -f conftest*
-fi
-
-if eval test \$pthreads_cv_syscall_$pthreads_syscallname = yes ; then
- pthreads_syscall_present=yes
- available_syscalls="$available_syscalls $pthreads_syscallname"
- macroname=HAVE_SYSCALL_`echo $pthreads_syscallname | tr '[a-z]' '[A-Z]'`
- cat >> confdefs.h <<EOF
-#define $macroname 1
-EOF
-
-else
- pthreads_syscall_present=no
- missing_syscalls="$missing_syscalls $pthreads_syscallname"
-fi
-echo "$ac_t""$pthreads_syscall_present" 1>&6
-
-done
-
-
-
-
-
-
-## Determine some typedef values from the system header files.
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1648: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1653 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- ac_cv_header_stdc=yes
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1678 "configure"
-#include "confdefs.h"
-#include <string.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1696 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
- :
-else
- cat > conftest.$ac_ext <<EOF
-#line 1717 "configure"
-#include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
-
-EOF
-if { (eval echo configure:1728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- :
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
-fi
-rm -fr conftest*
-fi
-
-fi
-fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
-EOF
-
-fi
-
-echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1752: checking for off_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1757 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_off_t=yes
-else
- rm -rf conftest*
- ac_cv_type_off_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_off_t" 1>&6
-if test $ac_cv_type_off_t = no; then
- cat >> confdefs.h <<\EOF
-#define off_t long
-EOF
-
-fi
-
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1785: checking for size_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1790 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_size_t=yes
-else
- rm -rf conftest*
- ac_cv_type_size_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&6
-if test $ac_cv_type_size_t = no; then
- cat >> confdefs.h <<\EOF
-#define size_t unsigned
-EOF
-
-fi
-
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1818: checking return type of signal handlers" >&5
-if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1823 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-#undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
-
-int main() {
-int i;
-; return 0; }
-EOF
-if { (eval echo configure:1840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_type_signal=void
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_type_signal=int
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
-#define RETSIGTYPE $ac_cv_type_signal
-EOF
-
-
-echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:1859: checking for ssize_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1864 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_ssize_t=yes
-else
- rm -rf conftest*
- ac_cv_type_ssize_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
-if test $ac_cv_type_ssize_t = no; then
- cat >> confdefs.h <<\EOF
-#define ssize_t int
-EOF
-
-fi
-
-echo $ac_n "checking for time_t""... $ac_c" 1>&6
-echo "configure:1892: checking for time_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_time_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1897 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])time_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_time_t=yes
-else
- rm -rf conftest*
- ac_cv_type_time_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_time_t" 1>&6
-if test $ac_cv_type_time_t = no; then
- cat >> confdefs.h <<\EOF
-#define time_t long
-EOF
-
-fi
-
-for ac_hdr in sys/time.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1928: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1933 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1938: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1965: checking whether time.h and sys/time.h may both be included" >&5
-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1970 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-int main() {
-struct tm *tp;
-; return 0; }
-EOF
-if { (eval echo configure:1979: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_header_time=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_time=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_header_time" 1>&6
-if test $ac_cv_header_time = yes; then
- cat >> confdefs.h <<\EOF
-#define TIME_WITH_SYS_TIME 1
-EOF
-
-fi
-
-
-echo $ac_n "checking for struct timespec in sys/time.h""... $ac_c" 1>&6
-echo "configure:2001: checking for struct timespec in sys/time.h" >&5
-if eval "test \"`echo '$''{'pthreads_cv_timespec_in_time'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2006 "configure"
-#include "confdefs.h"
-#include <sys/time.h>
-int main() {
-struct timespec foo;
-; return 0; }
-EOF
-if { (eval echo configure:2013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_timespec_in_time=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- pthreads_cv_timespec_in_time=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$pthreads_cv_timespec_in_time" 1>&6
-if test $pthreads_cv_timespec_in_time = yes ; then
- cat >> confdefs.h <<\EOF
-#define _OS_HAS_TIMESPEC 1
-EOF
-
-fi
-
-if eval "test \"`echo '$''{'pthreads_cv_socklen_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2037 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-int main() {
-socklen_t foo;
-; return 0; }
-EOF
-if { (eval echo configure:2045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_socklen_t=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- pthreads_cv_socklen_t=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$pthreads_cv_socklen_t" 1>&6
-if test $pthreads_cv_socklen_t = yes ; then
- cat >> confdefs.h <<\EOF
-#define _OS_HAS_SOCKLEN_T 1
-EOF
-
-fi
-
-
-
-echo $ac_n "checking type of size_t""... $ac_c" 1>&6
-echo "configure:2068: checking type of size_t" >&5
-if eval "test \"`echo '$''{'pthreads_cv_type_size_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2073 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#include <sys/types.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-
-int main() {
- extern size_t foo;
-; return 0; }
-EOF
-if { (eval echo configure:2086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- for try_type in "int" "unsigned int" "long" "unsigned long" "short" "unsigned short" "char" "unsigned char" "long long" "unsigned long long" ; do
- cat > conftest.$ac_ext <<EOF
-#line 2090 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#include <sys/types.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-
-int main() {
- extern size_t foo; extern $try_type foo;
-; return 0; }
-EOF
-if { (eval echo configure:2103: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_type_size_t="$try_type" ; break
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
- done
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- { echo "configure: error: Can't find system typedef for size_t." 1>&2; exit 1; }
-fi
-rm -f conftest*
-fi
-
-if test -n "$pthreads_cv_type_size_t" ; then
- cat >> confdefs.h <<EOF
-#define pthread_size_t $pthreads_cv_type_size_t
-EOF
-
-fi
-pthread_size_t=$pthreads_cv_type_size_t
-echo "$ac_t""$pthreads_cv_type_size_t" 1>&6
-
-echo $ac_n "checking type of ssize_t""... $ac_c" 1>&6
-echo "configure:2131: checking type of ssize_t" >&5
-if eval "test \"`echo '$''{'pthreads_cv_type_ssize_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2136 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-int main() {
- extern ssize_t foo;
-; return 0; }
-EOF
-if { (eval echo configure:2147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- for try_type in "int" "unsigned int" "long" "unsigned long" "short" "unsigned short" "char" "unsigned char" "long long" "unsigned long long" ; do
- cat > conftest.$ac_ext <<EOF
-#line 2151 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-int main() {
- extern ssize_t foo; extern $try_type foo;
-; return 0; }
-EOF
-if { (eval echo configure:2162: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_type_ssize_t="$try_type" ; break
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
- done
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- { echo "configure: error: Can't find system typedef for ssize_t." 1>&2; exit 1; }
-fi
-rm -f conftest*
-fi
-
-if test -n "$pthreads_cv_type_ssize_t" ; then
- cat >> confdefs.h <<EOF
-#define pthread_ssize_t $pthreads_cv_type_ssize_t
-EOF
-
-fi
-pthread_ssize_t=$pthreads_cv_type_ssize_t
-echo "$ac_t""$pthreads_cv_type_ssize_t" 1>&6
-
-echo $ac_n "checking type of clock_t""... $ac_c" 1>&6
-echo "configure:2190: checking type of clock_t" >&5
-if eval "test \"`echo '$''{'pthreads_cv_type_clock_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2195 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#if TIME_WITH_SYS_TIME
-# include <time.h>
-# include <sys/time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-int main() {
- extern clock_t foo;
-; return 0; }
-EOF
-if { (eval echo configure:2214: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- for try_type in "int" "unsigned int" "long" "unsigned long" "short" "unsigned short" "char" "unsigned char" "long long" "unsigned long long" ; do
- cat > conftest.$ac_ext <<EOF
-#line 2218 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#if TIME_WITH_SYS_TIME
-# include <time.h>
-# include <sys/time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-int main() {
- extern clock_t foo; extern $try_type foo;
-; return 0; }
-EOF
-if { (eval echo configure:2237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_type_clock_t="$try_type" ; break
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
- done
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- { echo "configure: error: Can't find system typedef for clock_t." 1>&2; exit 1; }
-fi
-rm -f conftest*
-fi
-
-if test -n "$pthreads_cv_type_clock_t" ; then
- cat >> confdefs.h <<EOF
-#define pthread_clock_t $pthreads_cv_type_clock_t
-EOF
-
-fi
-pthread_clock_t=$pthreads_cv_type_clock_t
-echo "$ac_t""$pthreads_cv_type_clock_t" 1>&6
-
-echo $ac_n "checking type of time_t""... $ac_c" 1>&6
-echo "configure:2265: checking type of time_t" >&5
-if eval "test \"`echo '$''{'pthreads_cv_type_time_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2270 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#if TIME_WITH_SYS_TIME
-# include <time.h>
-# include <sys/time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-int main() {
- extern time_t foo;
-; return 0; }
-EOF
-if { (eval echo configure:2289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- for try_type in "int" "unsigned int" "long" "unsigned long" "short" "unsigned short" "char" "unsigned char" "long long" "unsigned long long" ; do
- cat > conftest.$ac_ext <<EOF
-#line 2293 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#if TIME_WITH_SYS_TIME
-# include <time.h>
-# include <sys/time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-int main() {
- extern time_t foo; extern $try_type foo;
-; return 0; }
-EOF
-if { (eval echo configure:2312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_type_time_t="$try_type" ; break
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
- done
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- { echo "configure: error: Can't find system typedef for time_t." 1>&2; exit 1; }
-fi
-rm -f conftest*
-fi
-
-if test -n "$pthreads_cv_type_time_t" ; then
- cat >> confdefs.h <<EOF
-#define pthread_time_t $pthreads_cv_type_time_t
-EOF
-
-fi
-pthread_time_t=$pthreads_cv_type_time_t
-echo "$ac_t""$pthreads_cv_type_time_t" 1>&6
-echo $ac_n "checking for fpos_t in stdio.h""... $ac_c" 1>&6
-echo "configure:2339: checking for fpos_t in stdio.h" >&5
-if eval "test \"`echo '$''{'pthreads_cv_fpos_t_in_stdio'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2344 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-int main() {
-fpos_t position;
-; return 0; }
-EOF
-if { (eval echo configure:2351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_fpos_t_in_stdio=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- pthreads_cv_fpos_t_in_stdio=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$pthreads_cv_fpos_t_in_stdio" 1>&6
-if test $pthreads_cv_fpos_t_in_stdio = yes ; then
-
-echo $ac_n "checking type of fpos_t""... $ac_c" 1>&6
-echo "configure:2367: checking type of fpos_t" >&5
-if eval "test \"`echo '$''{'pthreads_cv_type_fpos_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2372 "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-
-int main() {
- extern fpos_t foo;
-; return 0; }
-EOF
-if { (eval echo configure:2385: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- for try_type in "int" "unsigned int" "long" "unsigned long" "short" "unsigned short" "char" "unsigned char" "long long" "unsigned long long" ; do
- cat > conftest.$ac_ext <<EOF
-#line 2389 "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-
-int main() {
- extern fpos_t foo; extern $try_type foo;
-; return 0; }
-EOF
-if { (eval echo configure:2402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_type_fpos_t="$try_type" ; break
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
- done
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- { echo "configure: error: Can't find system typedef for fpos_t." 1>&2; exit 1; }
-fi
-rm -f conftest*
-fi
-
-if test -n "$pthreads_cv_type_fpos_t" ; then
- cat >> confdefs.h <<EOF
-#define pthread_fpos_t $pthreads_cv_type_fpos_t
-EOF
-
-fi
-pthread_fpos_t=$pthreads_cv_type_fpos_t
-echo "$ac_t""$pthreads_cv_type_fpos_t" 1>&6
-else
- cat >> confdefs.h <<\EOF
-#define fpos_t off_t
-EOF
-
- cat >> confdefs.h <<\EOF
-#define pthread_fpos_t pthread_off_t
-EOF
-
-fi
-
-echo $ac_n "checking type of off_t""... $ac_c" 1>&6
-echo "configure:2440: checking type of off_t" >&5
-if eval "test \"`echo '$''{'pthreads_cv_type_off_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2445 "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-
-int main() {
- extern off_t foo;
-; return 0; }
-EOF
-if { (eval echo configure:2458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- for try_type in "int" "unsigned int" "long" "unsigned long" "short" "unsigned short" "char" "unsigned char" "long long" "unsigned long long" ; do
- cat > conftest.$ac_ext <<EOF
-#line 2462 "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-
-int main() {
- extern off_t foo; extern $try_type foo;
-; return 0; }
-EOF
-if { (eval echo configure:2475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_type_off_t="$try_type" ; break
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
- done
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- { echo "configure: error: Can't find system typedef for off_t." 1>&2; exit 1; }
-fi
-rm -f conftest*
-fi
-
-if test -n "$pthreads_cv_type_off_t" ; then
- cat >> confdefs.h <<EOF
-#define pthread_off_t $pthreads_cv_type_off_t
-EOF
-
-fi
-pthread_off_t=$pthreads_cv_type_off_t
-echo "$ac_t""$pthreads_cv_type_off_t" 1>&6
-echo $ac_n "checking type of va_list""... $ac_c" 1>&6
-echo "configure:2502: checking type of va_list" >&5
-if eval "test \"`echo '$''{'pthreads_cv_type_va_list'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2507 "configure"
-#include "confdefs.h"
-#include <stdarg.h>
-int main() {
- extern va_list foo;
-; return 0; }
-EOF
-if { (eval echo configure:2514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- for try_type in "char *" "char **" "void *" "void **" "int *" "long *" ; do
- cat > conftest.$ac_ext <<EOF
-#line 2518 "configure"
-#include "confdefs.h"
-#include <stdarg.h>
-int main() {
- extern va_list foo; extern $try_type foo;
-; return 0; }
-EOF
-if { (eval echo configure:2525: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_type_va_list="$try_type" ; break
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
- done
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- { echo "configure: error: Can't find system typedef for va_list." 1>&2; exit 1; }
-fi
-rm -f conftest*
-fi
-
-if test -n "$pthreads_cv_type_va_list" ; then
- cat >> confdefs.h <<EOF
-#define pthread_va_list $pthreads_cv_type_va_list
-EOF
-
-fi
-pthread_va_list=$pthreads_cv_type_va_list
-echo "$ac_t""$pthreads_cv_type_va_list" 1>&6
-
-arpa_headers="#include <sys/types.h>
-#include <arpa/nameser.h>"
-
-echo $ac_n "checking IP address type""... $ac_c" 1>&6
-echo "configure:2556: checking IP address type" >&5
-if eval "test \"`echo '$''{'pthread_cv_type_ipaddr'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2561 "configure"
-#include "confdefs.h"
-$arpa_headers
-int main() {
- &_getlong;
-; return 0; }
-EOF
-if { (eval echo configure:2568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
-
- for type in "unsigned long" "unsigned int" ; do
- cat > conftest.$ac_ext <<EOF
-#line 2573 "configure"
-#include "confdefs.h"
-$arpa_headers
-int main() {
-extern $type _getlong ();
-; return 0; }
-EOF
-if { (eval echo configure:2580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
-
- pthread_cv_type_ipaddr="$type"
- break
-
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
- done
-
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- echo "configure: warning: Can't compile _getlong reference." 1>&2
-fi
-rm -f conftest*
- if test "$pthread_cv_type_ipaddr" = "" ; then
- echo "configure: warning: Can't determine _getlong return type." 1>&2
- echo "configure: warning: Defaulting to unsigned long." 1>&2
- pthread_cv_type_ipaddr="unsigned long"
- fi
-
-fi
-
-echo "$ac_t""$pthread_cv_type_ipaddr" 1>&6
-cat >> confdefs.h <<EOF
-#define pthread_ipaddr_type $pthread_cv_type_ipaddr
-EOF
-
-
-echo $ac_n "checking IP port type""... $ac_c" 1>&6
-echo "configure:2615: checking IP port type" >&5
-if eval "test \"`echo '$''{'pthread_cv_type_ipport'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2620 "configure"
-#include "confdefs.h"
-$arpa_headers
-int main() {
- &_getshort;
-; return 0; }
-EOF
-if { (eval echo configure:2627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
-
- for type in "unsigned short" "unsigned int" ; do
- cat > conftest.$ac_ext <<EOF
-#line 2632 "configure"
-#include "confdefs.h"
-$arpa_headers
-int main() {
-extern $type _getshort ();
-; return 0; }
-EOF
-if { (eval echo configure:2639: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
-
- pthread_cv_type_ipport="$type"
- break
-
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
- done
-
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- echo "configure: warning: Can't compile _getshort reference." 1>&2
-fi
-rm -f conftest*
- if test "$pthread_cv_type_ipport" = "" ; then
- echo "configure: warning: Can't determine _getshort return type." 1>&2
- echo "configure: warning: Defaulting to unsigned short." 1>&2
- pthread_cv_type_ipport="unsigned short"
- fi
-
-fi
-
-echo "$ac_t""$pthread_cv_type_ipport" 1>&6
-cat >> confdefs.h <<EOF
-#define pthread_ipport_type $pthread_cv_type_ipport
-EOF
-
-
-echo $ac_n "checking pathname for terminal devices directory""... $ac_c" 1>&6
-echo "configure:2674: checking pathname for terminal devices directory" >&5
-if eval "test \"`echo '$''{'pthread_cv_pty_path'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -d /devices/pseudo ; then
- pty_path=/devices/pseudo/
- else
- pty_path=/dev/
- fi
- pthread_cv_pty_path=$pty_path
-
-fi
-
-cat >> confdefs.h <<EOF
-#define _PATH_PTY "$pthread_cv_pty_path"
-EOF
-
-echo "$ac_t""$pthread_cv_pty_path" 1>&6
-
-echo $ac_n "checking directory name for time zone info""... $ac_c" 1>&6
-echo "configure:2694: checking directory name for time zone info" >&5
-tzdir=NONE
-for f in /usr/lib/zoneinfo /usr/share/zoneinfo /usr/share/lib/zoneinfo /etc/zoneinfo /usr/local/lib/zoneinfo
-do
- if test -d $f ; then
- tzdir=$f
- break
- fi
-done
-case $tzdir in
-NONE)
- echo "configure: warning: Can't find zoneinfo directory." 1>&2
- echo "configure: warning: Defaulting zoneinfo directory to NULL." 1>&2
- tzdir=NULL
- ;;
-esac
-cat >> confdefs.h <<EOF
-#define _PATH_TZDIR "$tzdir"
-EOF
-
-echo "$ac_t""$tzdir" 1>&6
-
-echo $ac_n "checking filename for local time zone""... $ac_c" 1>&6
-echo "configure:2717: checking filename for local time zone" >&5
-tzfile=NONE
-for f in $tzdir/localtime /etc/localtime
-do
- if test -f $f ; then
- tzfile=$f
- break
- fi
-done
-case $tzfile in
-NONE) # Should this default to tzdir/localtime?
- echo "configure: warning: Can't find local time zone file." 1>&2
- if test tzdir = NULL ; then
- echo "configure: warning: Defaulting local time zone file to NULL" 1>&2
- tzfile=NULL
- else
- echo "configure: warning: Defaulting local time zone file to $tzdir/localtime." 1>&2
- tzfile=$tzdir/localtime
- fi
- ;;
-esac
-cat >> confdefs.h <<EOF
-#define _PATH_TZFILE "$tzfile"
-EOF
-
-echo "$ac_t""$tzfile" 1>&6
-
-cat >> confdefs.h <<\EOF
-#define _PATH_RESCONF "/etc/resolv.conf"
-EOF
-
-cat >> confdefs.h <<\EOF
-#define _PATH_HOSTS "/etc/hosts"
-EOF
-
-cat >> confdefs.h <<\EOF
-#define _PATH_NETWORKS "/etc/networks"
-EOF
-
-cat >> confdefs.h <<\EOF
-#define _PATH_PROTOCOLS "/etc/protocols"
-EOF
-
-cat >> confdefs.h <<\EOF
-#define _PATH_SERVICES "/etc/services"
-EOF
-
-
-cat >> confdefs.h <<\EOF
-#define _PATH_BSHELL "/bin/sh"
-EOF
-
-
-for ac_func in vfork
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2773: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2778 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:2801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-
-srctop=`cd ${srcdir}/..;pwd`
-
-
-# Now we deal with symlinks &c.
-
-test -d include || mkdir include || \
- { echo "configure: error: Can't create include directory." 1>&2; exit 1; }
-
-test -d include/pthread || mkdir include/pthread || \
- { echo "configure: error: Can't create include/pthread directory." 1>&2; exit 1; }
-
-test -d lib || mkdir lib || \
- { echo "configure: error: Can't create lib directory." 1>&2; exit 1; }
-
-test -d lib/libpthreadutil || mkdir lib/libpthreadutil || \
- { echo "configure: error: Can't create lib/libpthreadutil directory." 1>&2; exit 1; }
-
-test -d bin || mkdir bin || \
- { echo "configure: error: Can't create bin directory." 1>&2; exit 1; }
-
-test -d bin/finger || mkdir bin/finger || \
- { echo "configure: error: Can't create bin directory." 1>&2; exit 1; }
-
-test -d tests || mkdir tests || \
- { echo "configure: error: Can't create tests directory." 1>&2; exit 1; }
-
-if test x$syscall = xNONE ; then
- syscall=$name
-fi
-
-links="include/pthread/machdep.h include/pthread/posix.h \
- machdep.c syscall.S"
-targets="../machdep/engine-$name.h ../machdep/posix-$sysincludes.h \
- ../machdep/engine-$name.c ../machdep/syscall-$syscall.S"
-
-# Both these targets are optional. (Autoconf-generated configure scripts
-# will require the existence of link targets, so check before adding them
-# to the list.)
-if test x$sysincludes != xNONE ; then
- links="$links include/sys"
- targets="$targets ../machdep/$sysincludes"
-fi
-
-if test x$extraincludes != xNONE ; then
- for tmp in $extraincludes
- do
- links="$links include/$tmp"
- targets="$targets ../machdep/$sysincludes/extra/$tmp"
- done
-fi
-
-syscall_file=../machdep/syscall-template-$syscall.S
-if test -r $srcdir/$syscall_file ; then
- links="$links syscall-template.S"
- targets="$targets $syscall_file"
- HAVE_SYSCALL_TEMPLATE=yes
-else
- # This really isn't a fatal problem. In fact, it's expected, initially,
- # for some targets. This is just to persuade people to fix the targets
- # they deal with to provide some sort of template.
- #
- # Eventually this file probably will be required...
- echo "configure: warning: No syscall template file syscall-template-$syscall.S found." 1>&2
- HAVE_SYSCALL_TEMPLATE=no
-fi
-
-
-
-
-if test x$makefile_frag != x ; then
- makefile_frag=${srcdir}/$makefile_frag
-else
- makefile_frag=/dev/null
-fi
-
-
-
-
-
-trap '' 1 2 15
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
- if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
-fi
-
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
-DEFS=-DHAVE_CONFIG_H
-
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
-
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
-
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
-do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.13"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
-done
-
-ac_given_srcdir=$srcdir
-
-trap 'rm -fr `echo "config.flags GNUmakefile Makefile \
- lib/Makefile:../lib/Makefile.in \
- lib/libpthreadutil/Makefile:../lib/libpthreadutil/Makefile.in \
- bin/Makefile:../bin/Makefile.in \
- bin/finger/Makefile:../bin/finger/Makefile.in \
- tests/Makefile:../tests/Makefile.in config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@CC@%$CC%g
-s%@CXX@%$CXX%g
-s%@CPP@%$CPP%g
-s%@RANLIB@%$RANLIB%g
-s%@host@%$host%g
-s%@host_alias@%$host_alias%g
-s%@host_cpu@%$host_cpu%g
-s%@host_vendor@%$host_vendor%g
-s%@host_os@%$host_os%g
-s%@target@%$target%g
-s%@target_alias@%$target_alias%g
-s%@target_cpu@%$target_cpu%g
-s%@target_vendor@%$target_vendor%g
-s%@target_os@%$target_os%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%@SYSCALL_EXCEPTIONS@%$SYSCALL_EXCEPTIONS%g
-s%@available_syscalls@%$available_syscalls%g
-s%@missing_syscalls@%$missing_syscalls%g
-s%@srctop@%$srctop%g
-s%@HAVE_SYSCALL_TEMPLATE@%$HAVE_SYSCALL_TEMPLATE%g
-/@makefile_frag@/r $makefile_frag
-s%@makefile_frag@%%g
-
-CEOF
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
- else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
- fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
- else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
- fi
-done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
-fi
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"config.flags GNUmakefile Makefile \
- lib/Makefile:../lib/Makefile.in \
- lib/libpthreadutil/Makefile:../lib/libpthreadutil/Makefile.in \
- bin/Makefile:../bin/Makefile.in \
- bin/finger/Makefile:../bin/finger/Makefile.in \
- tests/Makefile:../tests/Makefile.in"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
- fi
-
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
-
-
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
- esac
-
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='\([ ]\)%\1#\2define\3'
-ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
-
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-cat >> $CONFIG_STATUS <<EOF
- CONFIG_HEADERS="config.h"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-fi
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- echo creating $ac_file
-
- rm -f conftest.frag conftest.in conftest.out
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- cat $ac_file_inputs > conftest.in
-
-EOF
-
-# Transform confdefs.h into a sed script conftest.vals that substitutes
-# the proper values into config.h.in to produce config.h. And first:
-# Protect against being on the right side of a sed subst in config.status.
-# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
-cat > conftest.hdr <<\EOF
-s/[\\&%]/\\&/g
-s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-s%ac_d%ac_u%gp
-s%ac_u%ac_e%gp
-EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
-
-# This sed command replaces #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-EOF
-
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
-
-rm -f conftest.tail
-while :
-do
- ac_lines=`grep -c . conftest.vals`
- # grep -c gives empty output for an empty file on some AIX systems.
- if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
- echo 'CEOF
- sed -f conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-' >> $CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
- rm -f conftest.vals
- mv conftest.tail conftest.vals
-done
-rm -f conftest.vals
-
-cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
- echo "$ac_file is unchanged"
- rm -f conftest.h
- else
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- fi
- rm -f $ac_file
- mv conftest.h $ac_file
- fi
-fi; done
-
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-ac_sources="$targets"
-ac_dests="$links"
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-srcdir=$ac_given_srcdir
-while test -n "$ac_sources"; do
- set $ac_dests; ac_dest=$1; shift; ac_dests=$*
- set $ac_sources; ac_source=$1; shift; ac_sources=$*
-
- echo "linking $srcdir/$ac_source to $ac_dest"
-
- if test ! -r $srcdir/$ac_source; then
- { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
- fi
- rm -f $ac_dest
-
- # Make relative symlinks.
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
- # The dest file is in a subdirectory.
- test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
- ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dest_dir_suffix.
- ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dest_dir_suffix= ac_dots=
- fi
-
- case "$srcdir" in
- [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
- *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
- esac
-
- # Make a symlink if possible; otherwise try a hard link.
- if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
- ln $srcdir/$ac_source $ac_dest; then :
- else
- { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
- fi
-done
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-
diff --git a/mit-pthreads/config/configure.in b/mit-pthreads/config/configure.in
deleted file mode 100755
index 45cf0c74809..00000000000
--- a/mit-pthreads/config/configure.in
+++ /dev/null
@@ -1,745 +0,0 @@
-dnl Some reminders:
-dnl "dnl" is a "delete to newline" command for m4 - the remainder of the
-dnl line it's on, including the newline, will be discarded
-dnl "#" comments will usually be copied through
-dnl "[]" are quoting characters; use changequote around code that really
-dnl needs to use them, but try not to invoke autoconf macros
-dnl within such code
-dnl
-dnl When you change this file, re-run "autoreconf" -- that'll automatically
-dnl re-run both autoconf and autoheader.
-dnl
-dnl
-dnl To do:
-dnl CLOCKS_PER_SEC (default 100, Ultrix differs)
-dnl CLK_TCK (default 100, Ultrix differs)
-dnl clockid_t (not on all systems)
-dnl timer_t (not on all systems)
-dnl
-dnl
-dnl Now, the real stuff.
-dnl
-dnl This must be first.
-AC_INIT(config.flags.in)
-dnl
-dnl This file does require autoconf 2.0 or better...
-dnl
-AC_PREREQ(2.0)dnl
-dnl
-dnl Hook for the "--enable-dce-compat" option, when Chris actually
-dnl implements it.
-dnl
-AC_ARG_ENABLE(dce-compat,
- --enable-dce-compat DCE compatibility,
-[dnl "true" action
- AC_MSG_ERROR([Actually, DCE compatibility doesn't work yet...])
-],
-[dnl "false" action
- true
-])
-
-dnl What C compiler?
-AC_PROG_CC
-AC_PROG_CXX
-dnl Apparently autoconf doesn't test to see if the C compiler it locates
-dnl actually works... oops!
-AC_MSG_CHECKING(compiler availability and simple error detection)
-AC_TRY_COMPILE(,[ exit(0); ],[
- dnl true
- AC_TRY_COMPILE(,[ syntax errors galore! ],
- dnl true
- AC_MSG_ERROR(Can't detect syntax errors! Is CC set right?),
- dnl false
- true)],
- dnl false
- AC_MSG_ERROR(Can't compile test program! Is CC set right?))
-
-AC_TRY_COMPILE(,[
- typedef int Integer;
- extern int i;
- extern Integer i;
-], , AC_MSG_ERROR(Can't redeclare variables with this compiler??))
-AC_TRY_COMPILE(,[
- typedef long Long;
- extern int i;
- extern Long i;
-], AC_MSG_ERROR(Compiler doesn't detect conflicting declarations.))
-AC_MSG_RESULT(ok)
-
-if test $ac_cv_prog_gcc = yes ; then
- CFLAGS="$CFLAGS -Werror"
-fi
-
-AC_PROG_CPP
-
-AC_PROG_RANLIB
-
-dnl Default value of prefix should be /usr/local/pthreads, not /usr/local.
-AC_PREFIX_DEFAULT(/usr/local/pthreads)
-
-dnl Determine $host, by guessing if necessary.
-AC_CANONICAL_SYSTEM
-
-syscall=NONE
-sysincludes=NONE
-extraincludes=NONE
-
-# Treat all x86 machines the same.
-# (Yet below, we pretend we can distinguish between the MIPS r2000 and r4000?)
-# (What about 680x0 machines?)
-changequote(,)dnl
-case $host in
- i[456]86-*)
- host=`echo $host | sed 's/^i[456]86/i386/'`
- host_cpu=i386
- ;;
-esac
-changequote([,])dnl
-
-# Here, you should set the following variables:
-# name
-# The "name" of this configuration. Used for "engine-*.c" file name,
-# default for syscall file names. Chris seems to have a thing for
-# putting "-" between OS and version number, but the configure script
-# will already have $host_cpu and $host_os available for you to use
-# in constructing a name.
-# sysincludes
-# Name of machdep directory with "sys" include file
-# replacements, if any. This directory is optional;
-# if you don't provide it, don't set this variable.
-# except
-# Names of any syscalls that shouldn't be generated
-# from the template, if any.
-# syscall
-# Base name of the syscall template files, if not the
-# same as <name>. If they're the same, omit this.
-#
-# Also, you may define random symbols and update CFLAGS if
-# necessary. However, for ease of porting to new machines,
-# it's best if you can create portable autoconf tests for
-# whatever you're trying to do, rather than hard-coding it
-# here based on the OS name. So please, try to keep this
-# section as minimal as possible.
-
-except=""
-name=$host_cpu-$host_os
-
-case $host in
-changequote(,)dnl
- alpha-*-netbsd1.3[H-Z]|alpha-*-netbsd1.[45]*)
- name=alpha-netbsd-1.3
- sysincludes=netbsd-1.1
- except="fork lseek pipe fstat"
- available_syscalls="sigsuspend sigprocmask"
- ;;
-changequote([,])dnl
- alpha-*-netbsd1.3*)
- name=alpha-netbsd-1.3
- sysincludes=netbsd-1.1
- except="fork lseek pipe sigsuspend sigprocmask fstat"
- ;;
- alpha-*-netbsd1.1* | alpha-*-netbsd1.2*)
- name=alpha-netbsd-1.1
- sysincludes=netbsd-1.1
- except="fork lseek pipe sigsuspend sigprocmask"
- ;;
- alpha-*-osf*)
- name=alpha-osf1
- sysincludes=alpha-osf1
- except="fork sigsuspend"
- if test $ac_cv_prog_gcc = no ; then
- CFLAGS="$CFLAGS -std"
- fi
- ;;
-changequote(,)dnl
- arm32-*-netbsd1.3[H-Z]|arm32-*-netbsd1.[45]*)
- name=arm32-netbsd-1.3
- sysincludes=netbsd-1.1
- except="fork pipe lseek ftruncate fstat"
- available_syscalls="sigsuspend sigprocmask"
- ;;
-changequote([,])dnl
- arm32-*-netbsd1.3*)
- name=arm32-netbsd-1.3
- sysincludes=netbsd-1.1
- except="fork pipe lseek ftruncate sigsuspend sigprocmask fstat"
- ;;
- hppa1.0-*-hpux10.20 | hppa1.1-*-hpux10.20)
- name=hppa-hpux-10.20
- sysincludes=hpux-10.20
- except="fork"
- ;;
- hppa1.1-*-hpux*9.*)
- name=hppa-hpux-9.03
- sysincludes=hpux-9.03
- # hpux-9.03.mk seems to be missing; what should this be?
- except="fork"
- ;;
- powerpc-*-netbsd1.*)
- name=powerpc-netbsd
- sysincludes=netbsd-1.1
- except="fork lseek ftruncate pipe fstat"
- available_syscalls="sigprocmask sigaction sigsuspend"
- ;;
- sparc-*-sunos4.1.3* | sparc-*-sunos4.1.4*)
- name=sparc-sunos-4.1.3
- sysincludes=sunos-4.1.3
- syscall=sparc-sunos4
- except="fork pipe getpgrp getdirentries"
- AC_DEFINE(sunos4) # is this really needed??
- ;;
- sparc-*-solaris2.3* | sparc-*-solaris2.4*)
- name=sparc-sunos-5.3
- sysincludes=sunos-5.3
- except="fork sigaction"
- # Should really come up with a test for this...
- AC_DEFINE(LD_LINKS_STATIC_DATA)
- AC_DEFINE(BROKEN_SIGNALS)
- ;;
- sparc-*-solaris2*)
- name=sparc-sunos-5.3
- sysincludes=sunos-5.5
- except="fork sigaction"
- # Should really come up with a test for this...
- AC_DEFINE(LD_LINKS_STATIC_DATA)
- AC_DEFINE(BROKEN_SIGNALS)
- ;;
-changequote(,)dnl
- sparc-*-netbsd1.3[H-Z]|sparc-*-netbsd1.[45]*)
- name=sparc-netbsd-1.3
- sysincludes=netbsd-1.1
- except="pipe fork lseek ftruncate fstat"
- available_syscalls="sigprocmask sigsuspend"
- ;;
-changequote([,])dnl
- sparc-*-netbsd1.3*)
- name=sparc-netbsd-1.3
- sysincludes=netbsd-1.1
- except="pipe fork lseek ftruncate sigprocmask sigsuspend fstat"
- ;;
- sparc-*-netbsd1.0A | sparc-*-netbsd1.1* | sparc-*-netbsd1.2*)
- name=sparc-sunos-4.1.3
- sysincludes=netbsd-1.0
- syscall=sparc-netbsd-1.1
- except="pipe fork sigprocmask sigsuspend"
- ;;
- i386-*-openbsd2.*)
- name=i386-openbsd-2.0
- sysincludes=openbsd-2.0
- except="fork lseek ftruncate sigsuspend sigprocmask"
- ;;
- i386-*-linux*)
- #name=i386-linux-1.0
- #sysincludes=linux-1.0
- name=i386-linux-2.0
- sysincludes=linux-2.0
- extraincludes="bits"
- ;;
- i386-*-bsdi1.1)
- name=i386-bsdi-1.1
- sysincludes=bsdi-1.1
- ;;
- i386-*-bsdi2.0* | i386-*-bsdi2.1*)
- name=i386-bsdi-2.0
- sysincludes=bsdi-2.0
- syscall=i386-bsdi-2.0
- except="fork lseek ftruncate sigsuspend"
- ;;
-changequote(,)dnl
- i386-*-netbsd1.3[H-Z]|i386-*-netbsd1.[45]*)
- name=i386-netbsd-1.3
- sysincludes=netbsd-1.1
- except="fork lseek ftruncate pipe fstat"
- available_syscalls="sigsuspend sigprocmask"
- ;;
-changequote([,])dnl
- i386-*-netbsd1.3*)
- name=i386-netbsd-1.3
- sysincludes=netbsd-1.1
- except="fork lseek ftruncate pipe sigsuspend sigprocmask fstat"
- ;;
- i386-*-netbsd1.1* | i386-*-netbsd1.2*)
- name=i386-netbsd-1.0
- sysincludes=netbsd-1.1
- syscall=i386-netbsd-1.1
- except="fork lseek ftruncate pipe sigsuspend sigprocmask"
- ;;
- i386-*-netbsd1.0*)
- name=i386-netbsd-1.0
- sysincludes=netbsd-1.0
- except="fork lseek ftruncate sigsuspend"
- ;;
- i386-*-netbsd0.9*)
- name=i386-netbsd-0.9
- sysincludes=netbsd-0.9
- ;;
- m68*-*-netbsd*)
- name=m68000-netbsd
- sysincludes=netbsd-1.1
- except="lseek ftruncate pipe fstat"
- available_syscalls="sigsuspend sigprocmask"
- ;;
- i386-*-freebsd*)
- name=i386-freebsd-2.0
- sysincludes=freebsd-2.0
- except="fork lseek ftruncate sigsuspend sigprocmask"
- ;;
- romp-*-bsd*)
- name=romp-bsd
- ;;
- mips-dec-ultrix*)
- name=r2000-ultrix-4.2
- sysincludes=ultrix-4.2
- except="fork pipe"
- ;;
- mips-sgi-irix*)
- name=ip22-irix-5.2
- sysincludes=irix-5.2
- except="fstat stat"
- AC_DEFINE(BROKEN_SIGNALS)
- ;;
- i386-*-sco3.2v5*)
- name=i386-sco3.2.5
- sysincludes=i386-sco3.2.5
- syscall=i386-sco3.2.5
- except="select socketcall accept bind connect getpeername getsockname getsockopt setsockopt listen recv recvfrom recvmsg send sendmsg sendto shutdown socket socketpair fork fcntl dup2 fstat fchmod fchown ftruncate pipe getdirentries sigaction sigpause wait3 waitpid getdtablesize"
- ;;
- *)
- AC_MSG_ERROR(System type $host not recognized or not supported.
-See $srcdir/configure.in for supported systems.)
- exit 1
- ;;
-esac
-
-SYSCALL_EXCEPTIONS=$except
-AC_SUBST(SYSCALL_EXCEPTIONS)
-
-AC_CHECK_HEADERS(sys/termio.h termios.h termio.h alloc.h)
-
-dnl Don't use AC_CHECK_HEADERS for this one, we want to define a special
-dnl symbol name starting with pthread_ if it's found.
-AC_CHECK_HEADER(va_list.h, AC_DEFINE(pthread_have_va_list_h))
-
-dnl Generate a list of system calls that we could generate. We later use
-dnl a syscall template .S file to produce a .o file for each syscall. This
-dnl is a bit better for porting and development purposes than having every
-dnl syscall listed for every target system; this way we only need the
-dnl template, and special hanlding for only those syscalls that can't be
-dnl handled by the templates.
-AC_CHECK_HEADERS(syscall.h sys/syscall.h sys/filio.h)
-
-PTHREADS_CHECK_SYSCALLS(open write read creat close fcntl lseek dup2 dup pipe
- fchmod fchown execve fstat lstat link unlink chdir chown chmod stat
- rename select getdtablesize ioctl ftruncate flock fstatfs chroot uname
- dnl - signals
- sigsuspend sigaction sigpause sigprocmask ksigaction
- dnl - directory reading
- getdents readdir getdirentries
- dnl - variants of `wait' syscalls
- wait4 wait3 waitpid waitsys
- dnl - BSD socket calls
- socket bind connect accept listen getsockopt setsockopt socketpair
- dnl - SYSV stream calls
- poll putmsg getmsg
- dnl - Linux version uses one syscall
- socketcall
-
- dnl - Process info
- pgrpsys
-
- exit
- readv writev send sendto sendmsg recv recvfrom recvmsg
- getpeername getsockname
- shutdown
- getpgrp fork)
-
-AC_SUBST(available_syscalls)
-AC_SUBST(missing_syscalls)
-
-dnl Disabled for now -- generates warnings from autoconf.
-dnl ## Check some type sizes.
-dnl AC_CHECK_SIZEOF(int)
-dnl AC_CHECK_SIZEOF(long)
-dnl AC_CHECK_SIZEOF(char *)
-
-## Determine some typedef values from the system header files.
-dnl
-dnl Autoconf provides these automatically. They provide reasonable
-dnl fallbacks if the standard header files don't define the typedef names.
-dnl
-dnl AC_TYPE_MODE_T
-AC_TYPE_OFF_T
-dnl AC_TYPE_PID_T
-AC_TYPE_SIZE_T
-dnl AC_TYPE_UID_T
-AC_TYPE_SIGNAL
-dnl
-dnl Default these types if their definitions can't be found.
-dnl
-AC_CHECK_TYPE(ssize_t,int)
-AC_CHECK_TYPE(time_t,long)
-dnl
-AC_CHECK_HEADERS(sys/time.h)
-AC_HEADER_TIME
-
-dnl
-dnl Check for the existence of these types
-dnl
-dnl struct timespec
-dnl
-AC_MSG_CHECKING(for struct timespec in sys/time.h)
-AC_CACHE_VAL(pthreads_cv_timespec_in_time,
- AC_TRY_COMPILE([#include <sys/time.h>], [struct timespec foo;],
- pthreads_cv_timespec_in_time=yes, pthreads_cv_timespec_in_time=no))
-AC_MSG_RESULT($pthreads_cv_timespec_in_time)
-if test $pthreads_cv_timespec_in_time = yes ; then
- AC_DEFINE(_OS_HAS_TIMESPEC)
-fi
-
-dnl socklen_t
-AC_CACHE_VAL(pthreads_cv_socklen_t,
- AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>], [socklen_t foo;],
- pthreads_cv_socklen_t=yes, pthreads_cv_socklen_t=no))
-AC_MSG_RESULT($pthreads_cv_socklen_t)
-if test $pthreads_cv_socklen_t = yes ; then
- AC_DEFINE(_OS_HAS_SOCKLEN_T)
-fi
-
-
-dnl
-dnl Usage: PTHREADS_FIND_TYPE(system-typedef-name, new-macro-name,
-dnl list-of-includes-in-square-brackets,
-dnl comma-separated-list-of-types-to-try)
-dnl
-dnl PTHREADS_FIND_INTEGRAL_TYPE automatically provides a set of integral
-dnl types, and does not permit specification of additional types.
-dnl
-dnl The specified types must all be able to work as prefixes -- i.e., no
-dnl direct specification of array or function types. If you need such
-dnl types, add typedefs for them to include/pthread/xtypes.h, and include
-dnl that in the set of header files. For simple struct types, you can
-dnl try including the definition directly here, but it had better not
-dnl contain any commas or square brackets.
-dnl
-dnl If necessary, you can include other preprocessing commands and such
-dnl in the `includes' portion.
-dnl
-dnl Note: For now, each of these needs a corresponding entry
-dnl in acconfig.h.
-dnl
-dnl size_t
-dnl
-PTHREADS_FIND_INTEGRAL_TYPE(size_t, pthread_size_t, [
-#include <stddef.h>
-#include <sys/types.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-])
-dnl
-dnl ssize_t
-dnl
-PTHREADS_FIND_INTEGRAL_TYPE(ssize_t, pthread_ssize_t, [
-#include <stddef.h>
-#include <stdlib.h>
-#include <unistd.h>
-])
-dnl
-dnl clock_t ---FIXME I don't know if this is the right set of header files. KR
-dnl
-PTHREADS_FIND_INTEGRAL_TYPE(clock_t, pthread_clock_t, [
-#include <stddef.h>
-#if TIME_WITH_SYS_TIME
-# include <time.h>
-# include <sys/time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-])
-dnl
-dnl time_t
-dnl
-PTHREADS_FIND_INTEGRAL_TYPE(time_t, pthread_time_t, [
-#include <stddef.h>
-#if TIME_WITH_SYS_TIME
-# include <time.h>
-# include <sys/time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-])
-dnl
-dnl fpos_t
-dnl
-dnl If fpos_t isn't defined in stdio.h, define it to be off_t. It
-dnl looks like AC_CHECK_TYPE won't work for this, because it doesn't
-dnl include stdio.h.
-dnl
-AC_MSG_CHECKING(for fpos_t in stdio.h)
-AC_CACHE_VAL(pthreads_cv_fpos_t_in_stdio,
- AC_TRY_COMPILE([#include <stdio.h>], [fpos_t position;],
- pthreads_cv_fpos_t_in_stdio=yes, pthreads_cv_fpos_t_in_stdio=no))
-AC_MSG_RESULT($pthreads_cv_fpos_t_in_stdio)
-if test $pthreads_cv_fpos_t_in_stdio = yes ; then
- PTHREADS_FIND_INTEGRAL_TYPE(fpos_t, pthread_fpos_t, [
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-])
-else
- AC_DEFINE(fpos_t,off_t)
- AC_DEFINE(pthread_fpos_t,pthread_off_t)
-fi
-dnl
-dnl off_t
-dnl
-PTHREADS_FIND_INTEGRAL_TYPE(off_t, pthread_off_t, [
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-])
-dnl
-dnl va_list -- This one could be tricky. Fortunately, on some systems,
-dnl we can just include the gcc stdarg.h header file if we can't determine
-dnl the type here. Won't work for non-gcc configurations though.
-dnl
-PTHREADS_FIND_TYPE(va_list, pthread_va_list, [#include <stdarg.h>],
- char *, char **, void *, void **, int *, long *)
-dnl
-dnl
-
-arpa_headers="#include <sys/types.h>
-#include <arpa/nameser.h>"
-
-dnl
-dnl Type for network (IP) addresses, 32 bits.
-dnl For now, I'm assuming that the return type from _getlong is it.
-dnl
-AC_MSG_CHECKING(IP address type)
-AC_CACHE_VAL(pthread_cv_type_ipaddr,
- AC_TRY_COMPILE($arpa_headers,[ &_getlong; ],[
- for type in "unsigned long" "unsigned int" ; do
- AC_TRY_COMPILE($arpa_headers, extern $type _getlong ();,[
- pthread_cv_type_ipaddr="$type"
- break
- ])
- done
- ],[ AC_MSG_WARN(Can't compile _getlong reference.) ])
- if test "$pthread_cv_type_ipaddr" = "" ; then
- AC_MSG_WARN(Can't determine _getlong return type.)
- AC_MSG_WARN(Defaulting to unsigned long.)
- pthread_cv_type_ipaddr="unsigned long"
- fi
-)
-AC_MSG_RESULT($pthread_cv_type_ipaddr)
-AC_DEFINE_UNQUOTED(pthread_ipaddr_type,$pthread_cv_type_ipaddr)
-
-dnl
-dnl Type for network (IP) ports, 16 bits.
-dnl For now, I'm assuming that the return type from _getshort is it.
-dnl
-AC_MSG_CHECKING(IP port type)
-AC_CACHE_VAL(pthread_cv_type_ipport,
- AC_TRY_COMPILE($arpa_headers,[ &_getshort; ],[
- for type in "unsigned short" "unsigned int" ; do
- AC_TRY_COMPILE($arpa_headers, extern $type _getshort ();,[
- pthread_cv_type_ipport="$type"
- break
- ])
- done
- ],[ AC_MSG_WARN(Can't compile _getshort reference.) ])
- if test "$pthread_cv_type_ipport" = "" ; then
- AC_MSG_WARN(Can't determine _getshort return type.)
- AC_MSG_WARN(Defaulting to unsigned short.)
- pthread_cv_type_ipport="unsigned short"
- fi
-)
-AC_MSG_RESULT($pthread_cv_type_ipport)
-AC_DEFINE_UNQUOTED(pthread_ipport_type,$pthread_cv_type_ipport)
-
-dnl
-dnl Guess where terminal devices are stored. This is for use in the
-dnl ttyname() implementation provided here.
-dnl
-AC_MSG_CHECKING(pathname for terminal devices directory)
-AC_CACHE_VAL(pthread_cv_pty_path,
- if test -d /devices/pseudo ; then
- pty_path=/devices/pseudo/
- else
- pty_path=/dev/
- fi
- pthread_cv_pty_path=$pty_path
-)
-AC_DEFINE_UNQUOTED(_PATH_PTY,"$pthread_cv_pty_path")
-AC_MSG_RESULT($pthread_cv_pty_path)
-
-dnl
-dnl Look for timezone info, for use in ctime.
-dnl
-AC_MSG_CHECKING(directory name for time zone info)
-tzdir=NONE
-for f in /usr/lib/zoneinfo /usr/share/zoneinfo /usr/share/lib/zoneinfo /etc/zoneinfo /usr/local/lib/zoneinfo
-do
- if test -d $f ; then
- tzdir=$f
- break
- fi
-done
-case $tzdir in
-NONE)
- AC_MSG_WARN(Can't find zoneinfo directory.)
- AC_MSG_WARN(Defaulting zoneinfo directory to NULL.)
- tzdir=NULL
- ;;
-esac
-AC_DEFINE_UNQUOTED(_PATH_TZDIR,"$tzdir")
-AC_MSG_RESULT($tzdir)
-
-AC_MSG_CHECKING(filename for local time zone)
-tzfile=NONE
-for f in $tzdir/localtime /etc/localtime
-do
- if test -f $f ; then
- tzfile=$f
- break
- fi
-done
-case $tzfile in
-NONE) # Should this default to tzdir/localtime?
- AC_MSG_WARN(Can't find local time zone file.)
- if test tzdir = NULL ; then
- AC_MSG_WARN(Defaulting local time zone file to NULL)
- tzfile=NULL
- else
- AC_MSG_WARN(Defaulting local time zone file to $tzdir/localtime.)
- tzfile=$tzdir/localtime
- fi
- ;;
-esac
-AC_DEFINE_UNQUOTED(_PATH_TZFILE,"$tzfile")
-AC_MSG_RESULT($tzfile)
-
-dnl
-dnl Network stuff. At the moment, I don't think there are any other
-dnl values we should expect. If we find a system that does store these
-dnl files elsewhere -- or doesn't have them all -- then run some tests.
-dnl
-AC_DEFINE(_PATH_RESCONF, "/etc/resolv.conf")
-AC_DEFINE(_PATH_HOSTS, "/etc/hosts")
-AC_DEFINE(_PATH_NETWORKS, "/etc/networks")
-AC_DEFINE(_PATH_PROTOCOLS, "/etc/protocols")
-AC_DEFINE(_PATH_SERVICES, "/etc/services")
-
-dnl
-dnl Other stuff
-dnl
-AC_DEFINE(_PATH_BSHELL, "/bin/sh")
-
-dnl If the system provides vfork, autoconf scripts will detect it.
-dnl So we should hide it.
-AC_CHECK_FUNCS(vfork)
-
-srctop=`cd ${srcdir}/..;pwd`
-AC_SUBST(srctop)
-
-# Now we deal with symlinks &c.
-
-test -d include || mkdir include || \
- AC_MSG_ERROR(Can't create include directory.)
-
-test -d include/pthread || mkdir include/pthread || \
- AC_MSG_ERROR(Can't create include/pthread directory.)
-
-test -d lib || mkdir lib || \
- AC_MSG_ERROR(Can't create lib directory.)
-
-test -d lib/libpthreadutil || mkdir lib/libpthreadutil || \
- AC_MSG_ERROR(Can't create lib/libpthreadutil directory.)
-
-test -d bin || mkdir bin || \
- AC_MSG_ERROR(Can't create bin directory.)
-
-test -d bin/finger || mkdir bin/finger || \
- AC_MSG_ERROR(Can't create bin directory.)
-
-test -d tests || mkdir tests || \
- AC_MSG_ERROR(Can't create tests directory.)
-
-if test x$syscall = xNONE ; then
- syscall=$name
-fi
-
-links="include/pthread/machdep.h include/pthread/posix.h \
- machdep.c syscall.S"
-targets="../machdep/engine-$name.h ../machdep/posix-$sysincludes.h \
- ../machdep/engine-$name.c ../machdep/syscall-$syscall.S"
-
-# Both these targets are optional. (Autoconf-generated configure scripts
-# will require the existence of link targets, so check before adding them
-# to the list.)
-if test x$sysincludes != xNONE ; then
- links="$links include/sys"
- targets="$targets ../machdep/$sysincludes"
-fi
-
-if test x$extraincludes != xNONE ; then
- for tmp in $extraincludes
- do
- links="$links include/$tmp"
- targets="$targets ../machdep/$sysincludes/extra/$tmp"
- done
-fi
-
-syscall_file=../machdep/syscall-template-$syscall.S
-if test -r $srcdir/$syscall_file ; then
- links="$links syscall-template.S"
- targets="$targets $syscall_file"
- HAVE_SYSCALL_TEMPLATE=yes
-else
- # This really isn't a fatal problem. In fact, it's expected, initially,
- # for some targets. This is just to persuade people to fix the targets
- # they deal with to provide some sort of template.
- #
- # Eventually this file probably will be required...
- AC_MSG_WARN(No syscall template file syscall-template-$syscall.S found.)
- HAVE_SYSCALL_TEMPLATE=no
-fi
-AC_SUBST(HAVE_SYSCALL_TEMPLATE)
-
-dnl Now tell it to make the links.
-dnl (The links are actually made by config.status.)
-AC_LINK_FILES($targets, $links)
-
-if test x$makefile_frag != x ; then
- makefile_frag=${srcdir}/$makefile_frag
-else
- makefile_frag=/dev/null
-fi
-dnl Drop in file indicated by $makefile_frag on *the line after* the
-dnl magic @makefile_frag@ sequence.
-AC_SUBST_FILE(makefile_frag)
-
-
-dnl Generate output files...
-AC_CONFIG_HEADER(config.h)
-
-dnl This must be last.
-AC_OUTPUT(config.flags GNUmakefile Makefile \
- lib/Makefile:../lib/Makefile.in \
- lib/libpthreadutil/Makefile:../lib/libpthreadutil/Makefile.in \
- bin/Makefile:../bin/Makefile.in \
- bin/finger/Makefile:../bin/finger/Makefile.in \
- tests/Makefile:../tests/Makefile.in)
diff --git a/mit-pthreads/config/configure.org b/mit-pthreads/config/configure.org
deleted file mode 100755
index f8526844a24..00000000000
--- a/mit-pthreads/config/configure.org
+++ /dev/null
@@ -1,2874 +0,0 @@
-#! /bin/sh
-
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.10
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-
-# Defaults:
-ac_help=
-ac_default_prefix=/usr/local
-# Any additions from configure.in:
-ac_help="$ac_help
---enable-dce-compat DCE compatibility"
-ac_default_prefix=/usr/local/pthreads
-
-# Initialize some variables set by options.
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
-exec_prefix=NONE
-host=NONE
-no_create=
-nonopt=NONE
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-target=NONE
-verbose=
-x_includes=NONE
-x_libraries=NONE
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-
-ac_prev=
-for ac_option
-do
-
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case "$ac_option" in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir="$ac_optarg" ;;
-
- -disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.10"
- exit 0 ;;
-
- -with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "with_${ac_package}='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
-
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
- ;;
-
- *)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
-
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
-do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
- esac
-done
-
-# NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
-
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=config.flags.in
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
- else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
- fi
-fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
-else
- echo "creating cache $cache_file"
- > $cache_file
-fi
-
-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'
-
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
-
-
-# Check whether --enable-dce-compat or --disable-dce-compat was given.
-if test "${enable_dce_compat+set}" = set; then
- enableval="$enable_dce_compat"
- { echo "configure: error: Actually, DCE compatibility doesn't work yet..." 1>&2; exit 1; }
-
-else
- true
-
-fi
-
-
-# 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
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- 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
-
-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
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- 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}:"
- ac_prog_rejected=no
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- 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"
-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"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- 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 we are using GNU C""... $ac_c" 1>&6
-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:616: \"$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
- if test "${CFLAGS+set}" != set; then
- echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_prog_gcc_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_gcc_g=yes
-else
- ac_cv_prog_gcc_g=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
- if test $ac_cv_prog_gcc_g = yes; then
- CFLAGS="-g -O"
- else
- CFLAGS="-O"
- fi
- fi
-else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-
-for ac_prog in $CCC c++ g++ gcc CC cxx
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # 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_CXX="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CXX="$ac_cv_prog_CXX"
-if test -n "$CXX"; then
- echo "$ac_t""$CXX" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-test -n "$CXX" && break
-done
-test -n "$CXX" || CXX="gcc"
-
-
-echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.C <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gxx=yes
-else
- ac_cv_prog_gxx=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gxx" 1>&6
-if test $ac_cv_prog_gxx = yes; then
- GXX=yes
- if test "${CXXFLAGS+set}" != set; then
- echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_prog_gxx_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.cc
-if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
- ac_cv_prog_gxx_g=yes
-else
- ac_cv_prog_gxx_g=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_gxx_g" 1>&6
- if test $ac_cv_prog_gxx_g = yes; then
- CXXFLAGS="-g -O"
- else
- CXXFLAGS="-O"
- fi
- fi
-else
- GXX=
- test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
-fi
-
-echo $ac_n "checking compiler availability and simple error detection""... $ac_c" 1>&6
-cat > conftest.$ac_ext <<EOF
-#line 735 "configure"
-#include "confdefs.h"
-
-int main() { return 0; }
-int t() {
- exit(0);
-; return 0; }
-EOF
-if { (eval echo configure:743: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
-
- cat > conftest.$ac_ext <<EOF
-#line 747 "configure"
-#include "confdefs.h"
-
-int main() { return 0; }
-int t() {
- syntax errors galore!
-; return 0; }
-EOF
-if { (eval echo configure:755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- { echo "configure: error: Can't detect syntax errors! Is CC set right?" 1>&2; exit 1; }
-else
- rm -rf conftest*
- true
-fi
-rm -f conftest*
-
-else
- rm -rf conftest*
- { echo "configure: error: Can't compile test program! Is CC set right?" 1>&2; exit 1; }
-fi
-rm -f conftest*
-
-
-cat > conftest.$ac_ext <<EOF
-#line 772 "configure"
-#include "confdefs.h"
-
-int main() { return 0; }
-int t() {
-
- typedef int Integer;
- extern int i;
- extern Integer i;
-
-; return 0; }
-EOF
-if { (eval echo configure:784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- :
-else
- rm -rf conftest*
- { echo "configure: error: Can't redeclare variables with this compiler??" 1>&2; exit 1; }
-fi
-rm -f conftest*
-
-cat > conftest.$ac_ext <<EOF
-#line 793 "configure"
-#include "confdefs.h"
-
-int main() { return 0; }
-int t() {
-
- typedef long Long;
- extern int i;
- extern Long i;
-
-; return 0; }
-EOF
-if { (eval echo configure:805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- { echo "configure: error: Compiler doesn't detect conflicting declarations." 1>&2; exit 1; }
-fi
-rm -f conftest*
-
-echo "$ac_t""ok" 1>&6
-
-if test $ac_cv_prog_gcc = yes ; then
- CFLAGS="$CFLAGS -Werror"
-fi
-
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 832 "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:838: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 847 "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:853: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- rm -rf conftest*
- CPP=/lib/cpp
-fi
-rm -f conftest*
-fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
-fi
- CPP="$ac_cv_prog_CPP"
-else
- ac_cv_prog_CPP="$CPP"
-fi
-echo "$ac_t""$CPP" 1>&6
-
-
-# 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
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
-fi
-fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-
-
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
-
-# Do some error checking and defaulting for the host and target type.
-# The inputs are:
-# configure --host=HOST --target=TARGET --build=BUILD NONOPT
-#
-# The rules are:
-# 1. You are not allowed to specify --host, --target, and nonopt at the
-# same time.
-# 2. Host defaults to nonopt.
-# 3. If nonopt is not specified, then host defaults to the current host,
-# as determined by config.guess.
-# 4. Target and build default to nonopt.
-# 5. If nonopt is not specified, then target and build default to host.
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-case $host---$target---$nonopt in
-NONE---*---* | *---NONE---* | *---*---NONE) ;;
-*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
-esac
-
-
-# Make sure we can run config.sub.
-if $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
- NONE)
- if host_alias=`$ac_config_guess`; then :
- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
- fi ;;
- *) host_alias=$nonopt ;;
- esac ;;
-esac
-
-host=`$ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
-
-echo $ac_n "checking target system type""... $ac_c" 1>&6
-
-target_alias=$target
-case "$target_alias" in
-NONE)
- case $nonopt in
- NONE) target_alias=$host_alias ;;
- *) target_alias=$nonopt ;;
- esac ;;
-esac
-
-target=`$ac_config_sub $target_alias`
-target_cpu=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
-target_vendor=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
-target_os=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
-echo "$ac_t""$target" 1>&6
-
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-
-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
-
-test "$host_alias" != "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
-
-
-syscall=NONE
-sysincludes=NONE
-
-# Treat all x86 machines the same.
-# (Yet below, we pretend we can distinguish between the MIPS r2000 and r4000?)
-# (What about 680x0 machines?)
-case $host in
- i[456]86-*)
- host=`echo $host | sed 's/^i[456]86/i386/'`
- host_cpu=i386
- ;;
-esac
-
-# Here, you should set the following variables:
-# name
-# The "name" of this configuration. Used for "engine-*.c" file name,
-# default for syscall file names. Chris seems to have a thing for
-# putting "-" between OS and version number, but the configure script
-# will already have $host_cpu and $host_os available for you to use
-# in constructing a name.
-# sysincludes
-# Name of machdep directory with "sys" include file
-# replacements, if any. This directory is optional;
-# if you don't provide it, don't set this variable.
-# except
-# Names of any syscalls that shouldn't be generated
-# from the template, if any.
-# syscall
-# Base name of the syscall template files, if not the
-# same as <name>. If they're the same, omit this.
-#
-# Also, you may define random symbols and update CFLAGS if
-# necessary. However, for ease of porting to new machines,
-# it's best if you can create portable autoconf tests for
-# whatever you're trying to do, rather than hard-coding it
-# here based on the OS name. So please, try to keep this
-# section as minimal as possible.
-
-except=""
-name=$host_cpu-$host_os
-
-case $host in
- alpha-*-netbsd1.1* | alpha-*-netbsd1.2*)
- name=alpha-netbsd-1.1
- sysincludes=netbsd-1.1
- except="fork lseek pipe sigsuspend sigprocmask"
- ;;
- alpha-*-osf*)
- name=alpha-osf1
- sysincludes=alpha-osf1
- except="fork sigsuspend"
- if test $ac_cv_prog_gcc = no ; then
- CFLAGS="$CFLAGS -std"
- fi
- ;;
- hppa1.1-*-hpux*)
- name=hppa-hpux-9.03
- sysincludes=hpux-9.03
- # hpux-9.03.mk seems to be missing; what should this be?
- except="fork"
- ;;
- sparc-*-sunos4.1.3* | sparc-*-sunos4.1.4*)
- name=sparc-sunos-4.1.3
- sysincludes=sunos-4.1.3
- syscall=sparc-sunos4
- except="fork pipe getpgrp getdirentries"
- cat >> confdefs.h <<\EOF
-#define sunos4 1
-EOF
- # is this really needed??
- ;;
- sparc-*-solaris2*)
- name=sparc-sunos-5.3
- sysincludes=sunos-5.3
- except="fork sigaction"
- # Should really come up with a test for this...
- cat >> confdefs.h <<\EOF
-#define LD_LINKS_STATIC_DATA 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define BROKEN_SIGNALS 1
-EOF
-
- ;;
- sparc-*-netbsd1.0A | sparc-*-netbsd1.1* | sparc-*-netbsd1.2*)
- name=sparc-sunos-4.1.3
- sysincludes=netbsd-1.0
- syscall=sparc-netbsd-1.1
- except="pipe fork sigprocmask sigsuspend"
- ;;
- i386-*-linux*)
- name=i386-linux-1.0
- sysincludes=linux-1.0
- ;;
- i386-*-bsdi1.1)
- name=i386-bsdi-1.1
- sysincludes=bsdi-1.1
- ;;
- i386-*-bsdi2.0* | i386-*-bsdi2.1*)
- name=i386-bsdi-2.0
- sysincludes=bsdi-2.0
- syscall=i386-bsdi-2.0
- except="fork lseek sigsuspend"
- ;;
- i386-*-netbsd1.1* | i386-*-netbsd1.2*)
- name=i386-netbsd-1.0
- sysincludes=netbsd-1.1
- syscall=i386-netbsd-1.1
- except="fork lseek pipe sigsuspend sigprocmask"
- ;;
- i386-*-netbsd1.0*)
- name=i386-netbsd-1.0
- sysincludes=netbsd-1.0
- except="fork lseek sigsuspend"
- ;;
- i386-*-netbsd0.9*)
- name=i386-netbsd-0.9
- sysincludes=netbsd-0.9
- ;;
- m68*-*-netbsd*)
- name=m68000-netbsd
- ;;
- i386-*-freebsd2.*)
- name=i386-freebsd-2.0
- sysincludes=freebsd-2.0
- except="fork lseek sigsuspend sigprocmask"
- ;;
- romp-*-bsd*)
- name=romp-bsd
- ;;
- mips-dec-ultrix*)
- name=r2000-ultrix-4.2
- sysincludes=ultrix-4.2
- except="fork pipe"
- ;;
- mips-sgi-irix*)
- name=ip22-irix-5.2
- sysincludes=irix-5.2
- except="fstat stat"
- cat >> confdefs.h <<\EOF
-#define BROKEN_SIGNALS 1
-EOF
-
- ;;
- *)
- { echo "configure: error: System type $host not recognized or not supported.
-See $srcdir/configure.in for supported systems." 1>&2; exit 1; }
- exit 1
- ;;
-esac
-
-SYSCALL_EXCEPTIONS=$except
-
-
-for ac_hdr in sys/termio.h termios.h termio.h
-do
-ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1174 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1179: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-
-ac_safe=`echo "va_list.h" | tr './\055' '___'`
-echo $ac_n "checking for va_list.h""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1210 "configure"
-#include "confdefs.h"
-#include <va_list.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define pthread_have_va_list_h 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-for ac_hdr in syscall.h sys/syscall.h
-do
-ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1246 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-
-pthreads_syscall_list="open write read creat close fcntl lseek dup2 dup pipe
- fchmod fchown execve fstat lstat link unlink chdir chown chmod stat
- rename select getdtablesize ioctl ftruncate
- sigsuspend sigaction sigpause sigprocmask ksigaction
- getdents readdir getdirentries
- wait4 wait3 waitpid waitsys
- socket bind connect accept listen getsockopt setsockopt socketpair
- poll putmsg getmsg
- socketcall
-
- pgrpsys
-
- exit
- readv writev send sendto sendmsg recv recvfrom recvmsg
- getpeername getsockname
- shutdown
- getpgrp fork"
-for pthreads_syscallname in $pthreads_syscall_list ; do
- echo $ac_n "checking for syscall $pthreads_syscallname""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'pthreads_cv_syscall_$pthreads_syscallname'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1299 "configure"
-#include "confdefs.h"
-
-/* FIXME: This list should be generated from info in configure.in. */
-#ifdef HAVE_SYSCALL_H
-#include <syscall.h>
-#else
-#ifdef HAVE_SYS_SYSCALL_H
-#include <sys/syscall.h>
-#else
-where is your syscall header file??
-#endif
-#endif
-
-int main() { return 0; }
-int t() {
-
-int x;
-x = SYS_$pthreads_syscallname ;
-
-; return 0; }
-EOF
-if { (eval echo configure:1321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
- rm -rf conftest*
- eval pthreads_cv_syscall_$pthreads_syscallname=yes
-else
- rm -rf conftest*
- eval pthreads_cv_syscall_$pthreads_syscallname=no
-fi
-rm -f conftest*
-
-fi
-
-if eval test \$pthreads_cv_syscall_$pthreads_syscallname = yes ; then
- pthreads_syscall_present=yes
- available_syscalls="$available_syscalls $pthreads_syscallname"
- macroname=HAVE_SYSCALL_`echo $pthreads_syscallname | tr '[a-z]' '[A-Z]'`
- cat >> confdefs.h <<EOF
-#define $macroname 1
-EOF
-
-else
- pthreads_syscall_present=no
- missing_syscalls="$missing_syscalls $pthreads_syscallname"
-fi
-echo "$ac_t""$pthreads_syscall_present" 1>&6
-
-done
-
-
-
-
-
-
-## Determine some typedef values from the system header files.
-# If we cannot run a trivial program, we must be cross compiling.
-echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_c_cross=yes
-else
-cat > conftest.$ac_ext <<EOF
-#line 1363 "configure"
-#include "confdefs.h"
-main(){return(0);}
-EOF
-{ (eval echo configure:1367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
-if test -s conftest && (./conftest; exit) 2>/dev/null; then
- ac_cv_c_cross=no
-else
- ac_cv_c_cross=yes
-fi
-fi
-rm -fr conftest*
-fi
-
-echo "$ac_t""$ac_cv_c_cross" 1>&6
-cross_compiling=$ac_cv_c_cross
-
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1385 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1393: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- rm -rf conftest*
- ac_cv_header_stdc=yes
-else
- echo "$ac_err" >&5
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1408 "configure"
-#include "confdefs.h"
-#include <string.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1426 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
- :
-else
-cat > conftest.$ac_ext <<EOF
-#line 1447 "configure"
-#include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
-
-EOF
-{ (eval echo configure:1458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
-if test -s conftest && (./conftest; exit) 2>/dev/null; then
- :
-else
- ac_cv_header_stdc=no
-fi
-fi
-rm -fr conftest*
-fi
-fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
-EOF
-
-fi
-
-echo $ac_n "checking for off_t""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1482 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "off_t" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_off_t=yes
-else
- rm -rf conftest*
- ac_cv_type_off_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_off_t" 1>&6
-if test $ac_cv_type_off_t = no; then
- cat >> confdefs.h <<\EOF
-#define off_t long
-EOF
-
-fi
-
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1513 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "size_t" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_size_t=yes
-else
- rm -rf conftest*
- ac_cv_type_size_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&6
-if test $ac_cv_type_size_t = no; then
- cat >> confdefs.h <<\EOF
-#define size_t unsigned
-EOF
-
-fi
-
-echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1544 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "ssize_t" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_ssize_t=yes
-else
- rm -rf conftest*
- ac_cv_type_ssize_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
-if test $ac_cv_type_ssize_t = no; then
- cat >> confdefs.h <<\EOF
-#define ssize_t int
-EOF
-
-fi
-
-echo $ac_n "checking for time_t""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_type_time_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1575 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "time_t" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_time_t=yes
-else
- rm -rf conftest*
- ac_cv_type_time_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_time_t" 1>&6
-if test $ac_cv_type_time_t = no; then
- cat >> confdefs.h <<\EOF
-#define time_t long
-EOF
-
-fi
-
-for ac_hdr in sys/time.h
-do
-ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1609 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1643 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-int main() { return 0; }
-int t() {
-struct tm *tp;
-; return 0; }
-EOF
-if { (eval echo configure:1653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_header_time=yes
-else
- rm -rf conftest*
- ac_cv_header_time=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_header_time" 1>&6
-if test $ac_cv_header_time = yes; then
- cat >> confdefs.h <<\EOF
-#define TIME_WITH_SYS_TIME 1
-EOF
-
-fi
-
-
-echo $ac_n "checking for struct timespec in sys/time.h""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'pthreads_cv_timespec_in_time'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1678 "configure"
-#include "confdefs.h"
-#include <sys/time.h>
-int main() { return 0; }
-int t() {
-struct timespec foo;
-; return 0; }
-EOF
-if { (eval echo configure:1686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_timespec_in_time=yes
-else
- rm -rf conftest*
- pthreads_cv_timespec_in_time=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$pthreads_cv_timespec_in_time" 1>&6
-if test $pthreads_cv_timespec_in_time = yes ; then
- cat >> confdefs.h <<\EOF
-#define _OS_HAS_TIMESPEC 1
-EOF
-
-fi
-
-
-
-echo $ac_n "checking type of size_t""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'pthreads_cv_type_size_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1712 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#include <sys/types.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-
-int main() { return 0; }
-int t() {
- extern size_t foo;
-; return 0; }
-EOF
-if { (eval echo configure:1726: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- for try_type in "int" "unsigned int" "long" "unsigned long" "short" "unsigned short" "char" "unsigned char" "long long" "unsigned long long" ; do
- cat > conftest.$ac_ext <<EOF
-#line 1730 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#include <sys/types.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-
-int main() { return 0; }
-int t() {
- extern size_t foo; extern $try_type foo;
-; return 0; }
-EOF
-if { (eval echo configure:1744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_type_size_t="$try_type" ; break
-fi
-rm -f conftest*
-
- done
-else
- rm -rf conftest*
- { echo "configure: error: Can't find system typedef for size_t." 1>&2; exit 1; }
-fi
-rm -f conftest*
-
-fi
-
-if test -n "$pthreads_cv_type_size_t" ; then
- cat >> confdefs.h <<EOF
-#define pthread_size_t $pthreads_cv_type_size_t
-EOF
-
-fi
-pthread_size_t=$pthreads_cv_type_size_t
-echo "$ac_t""$pthreads_cv_type_size_t" 1>&6
-
-echo $ac_n "checking type of ssize_t""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'pthreads_cv_type_ssize_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1773 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-int main() { return 0; }
-int t() {
- extern ssize_t foo;
-; return 0; }
-EOF
-if { (eval echo configure:1785: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- for try_type in "int" "unsigned int" "long" "unsigned long" "short" "unsigned short" "char" "unsigned char" "long long" "unsigned long long" ; do
- cat > conftest.$ac_ext <<EOF
-#line 1789 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-int main() { return 0; }
-int t() {
- extern ssize_t foo; extern $try_type foo;
-; return 0; }
-EOF
-if { (eval echo configure:1801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_type_ssize_t="$try_type" ; break
-fi
-rm -f conftest*
-
- done
-else
- rm -rf conftest*
- { echo "configure: error: Can't find system typedef for ssize_t." 1>&2; exit 1; }
-fi
-rm -f conftest*
-
-fi
-
-if test -n "$pthreads_cv_type_ssize_t" ; then
- cat >> confdefs.h <<EOF
-#define pthread_ssize_t $pthreads_cv_type_ssize_t
-EOF
-
-fi
-pthread_ssize_t=$pthreads_cv_type_ssize_t
-echo "$ac_t""$pthreads_cv_type_ssize_t" 1>&6
-
-echo $ac_n "checking type of clock_t""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'pthreads_cv_type_clock_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1830 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#if TIME_WITH_SYS_TIME
-# include <time.h>
-# include <sys/time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-int main() { return 0; }
-int t() {
- extern clock_t foo;
-; return 0; }
-EOF
-if { (eval echo configure:1850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- for try_type in "int" "unsigned int" "long" "unsigned long" "short" "unsigned short" "char" "unsigned char" "long long" "unsigned long long" ; do
- cat > conftest.$ac_ext <<EOF
-#line 1854 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#if TIME_WITH_SYS_TIME
-# include <time.h>
-# include <sys/time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-int main() { return 0; }
-int t() {
- extern clock_t foo; extern $try_type foo;
-; return 0; }
-EOF
-if { (eval echo configure:1874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_type_clock_t="$try_type" ; break
-fi
-rm -f conftest*
-
- done
-else
- rm -rf conftest*
- { echo "configure: error: Can't find system typedef for clock_t." 1>&2; exit 1; }
-fi
-rm -f conftest*
-
-fi
-
-if test -n "$pthreads_cv_type_clock_t" ; then
- cat >> confdefs.h <<EOF
-#define pthread_clock_t $pthreads_cv_type_clock_t
-EOF
-
-fi
-pthread_clock_t=$pthreads_cv_type_clock_t
-echo "$ac_t""$pthreads_cv_type_clock_t" 1>&6
-
-echo $ac_n "checking type of time_t""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'pthreads_cv_type_time_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1903 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#if TIME_WITH_SYS_TIME
-# include <time.h>
-# include <sys/time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-int main() { return 0; }
-int t() {
- extern time_t foo;
-; return 0; }
-EOF
-if { (eval echo configure:1923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- for try_type in "int" "unsigned int" "long" "unsigned long" "short" "unsigned short" "char" "unsigned char" "long long" "unsigned long long" ; do
- cat > conftest.$ac_ext <<EOF
-#line 1927 "configure"
-#include "confdefs.h"
-
-#include <stddef.h>
-#if TIME_WITH_SYS_TIME
-# include <time.h>
-# include <sys/time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-int main() { return 0; }
-int t() {
- extern time_t foo; extern $try_type foo;
-; return 0; }
-EOF
-if { (eval echo configure:1947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_type_time_t="$try_type" ; break
-fi
-rm -f conftest*
-
- done
-else
- rm -rf conftest*
- { echo "configure: error: Can't find system typedef for time_t." 1>&2; exit 1; }
-fi
-rm -f conftest*
-
-fi
-
-if test -n "$pthreads_cv_type_time_t" ; then
- cat >> confdefs.h <<EOF
-#define pthread_time_t $pthreads_cv_type_time_t
-EOF
-
-fi
-pthread_time_t=$pthreads_cv_type_time_t
-echo "$ac_t""$pthreads_cv_type_time_t" 1>&6
-echo $ac_n "checking for fpos_t in stdio.h""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'pthreads_cv_fpos_t_in_stdio'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1975 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-int main() { return 0; }
-int t() {
-fpos_t position;
-; return 0; }
-EOF
-if { (eval echo configure:1983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_fpos_t_in_stdio=yes
-else
- rm -rf conftest*
- pthreads_cv_fpos_t_in_stdio=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$pthreads_cv_fpos_t_in_stdio" 1>&6
-if test $pthreads_cv_fpos_t_in_stdio = yes ; then
-
-echo $ac_n "checking type of fpos_t""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'pthreads_cv_type_fpos_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2002 "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-
-int main() { return 0; }
-int t() {
- extern fpos_t foo;
-; return 0; }
-EOF
-if { (eval echo configure:2016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- for try_type in "int" "unsigned int" "long" "unsigned long" "short" "unsigned short" "char" "unsigned char" "long long" "unsigned long long" ; do
- cat > conftest.$ac_ext <<EOF
-#line 2020 "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-
-int main() { return 0; }
-int t() {
- extern fpos_t foo; extern $try_type foo;
-; return 0; }
-EOF
-if { (eval echo configure:2034: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_type_fpos_t="$try_type" ; break
-fi
-rm -f conftest*
-
- done
-else
- rm -rf conftest*
- { echo "configure: error: Can't find system typedef for fpos_t." 1>&2; exit 1; }
-fi
-rm -f conftest*
-
-fi
-
-if test -n "$pthreads_cv_type_fpos_t" ; then
- cat >> confdefs.h <<EOF
-#define pthread_fpos_t $pthreads_cv_type_fpos_t
-EOF
-
-fi
-pthread_fpos_t=$pthreads_cv_type_fpos_t
-echo "$ac_t""$pthreads_cv_type_fpos_t" 1>&6
-else
- cat >> confdefs.h <<\EOF
-#define fpos_t off_t
-EOF
-
- cat >> confdefs.h <<\EOF
-#define pthread_fpos_t pthread_off_t
-EOF
-
-fi
-
-echo $ac_n "checking type of off_t""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'pthreads_cv_type_off_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2073 "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-
-int main() { return 0; }
-int t() {
- extern off_t foo;
-; return 0; }
-EOF
-if { (eval echo configure:2087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- for try_type in "int" "unsigned int" "long" "unsigned long" "short" "unsigned short" "char" "unsigned char" "long long" "unsigned long long" ; do
- cat > conftest.$ac_ext <<EOF
-#line 2091 "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-
-int main() { return 0; }
-int t() {
- extern off_t foo; extern $try_type foo;
-; return 0; }
-EOF
-if { (eval echo configure:2105: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_type_off_t="$try_type" ; break
-fi
-rm -f conftest*
-
- done
-else
- rm -rf conftest*
- { echo "configure: error: Can't find system typedef for off_t." 1>&2; exit 1; }
-fi
-rm -f conftest*
-
-fi
-
-if test -n "$pthreads_cv_type_off_t" ; then
- cat >> confdefs.h <<EOF
-#define pthread_off_t $pthreads_cv_type_off_t
-EOF
-
-fi
-pthread_off_t=$pthreads_cv_type_off_t
-echo "$ac_t""$pthreads_cv_type_off_t" 1>&6
-echo $ac_n "checking type of va_list""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'pthreads_cv_type_va_list'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2133 "configure"
-#include "confdefs.h"
-#include <stdarg.h>
-int main() { return 0; }
-int t() {
- extern va_list foo;
-; return 0; }
-EOF
-if { (eval echo configure:2141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- for try_type in "char *" "char **" "void *" "void **" "int *" "long *" ; do
- cat > conftest.$ac_ext <<EOF
-#line 2145 "configure"
-#include "confdefs.h"
-#include <stdarg.h>
-int main() { return 0; }
-int t() {
- extern va_list foo; extern $try_type foo;
-; return 0; }
-EOF
-if { (eval echo configure:2153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- pthreads_cv_type_va_list="$try_type" ; break
-fi
-rm -f conftest*
-
- done
-else
- rm -rf conftest*
- { echo "configure: error: Can't find system typedef for va_list." 1>&2; exit 1; }
-fi
-rm -f conftest*
-
-fi
-
-if test -n "$pthreads_cv_type_va_list" ; then
- cat >> confdefs.h <<EOF
-#define pthread_va_list $pthreads_cv_type_va_list
-EOF
-
-fi
-pthread_va_list=$pthreads_cv_type_va_list
-echo "$ac_t""$pthreads_cv_type_va_list" 1>&6
-
-arpa_headers="#include <sys/types.h>
-#include <arpa/nameser.h>"
-
-echo $ac_n "checking IP address type""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'pthread_cv_type_ipaddr'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2185 "configure"
-#include "confdefs.h"
-$arpa_headers
-int main() { return 0; }
-int t() {
- &_getlong;
-; return 0; }
-EOF
-if { (eval echo configure:2193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
-
- for type in "unsigned long" "unsigned int" ; do
- cat > conftest.$ac_ext <<EOF
-#line 2198 "configure"
-#include "confdefs.h"
-$arpa_headers
-int main() { return 0; }
-int t() {
-extern $type _getlong ();
-; return 0; }
-EOF
-if { (eval echo configure:2206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
-
- pthread_cv_type_ipaddr="$type"
- break
-
-fi
-rm -f conftest*
-
- done
-
-else
- rm -rf conftest*
- echo "configure: warning: Can't compile _getlong reference." 1>&2
-fi
-rm -f conftest*
-
- if test "$pthread_cv_type_ipaddr" = "" ; then
- echo "configure: warning: Can't determine _getlong return type." 1>&2
- echo "configure: warning: Defaulting to unsigned long." 1>&2
- pthread_cv_type_ipaddr="unsigned long"
- fi
-
-fi
-
-echo "$ac_t""$pthread_cv_type_ipaddr" 1>&6
-cat >> confdefs.h <<EOF
-#define pthread_ipaddr_type $pthread_cv_type_ipaddr
-EOF
-
-
-echo $ac_n "checking IP port type""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'pthread_cv_type_ipport'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2242 "configure"
-#include "confdefs.h"
-$arpa_headers
-int main() { return 0; }
-int t() {
- &_getshort;
-; return 0; }
-EOF
-if { (eval echo configure:2250: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
-
- for type in "unsigned short" "unsigned int" ; do
- cat > conftest.$ac_ext <<EOF
-#line 2255 "configure"
-#include "confdefs.h"
-$arpa_headers
-int main() { return 0; }
-int t() {
-extern $type _getshort ();
-; return 0; }
-EOF
-if { (eval echo configure:2263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
-
- pthread_cv_type_ipport="$type"
- break
-
-fi
-rm -f conftest*
-
- done
-
-else
- rm -rf conftest*
- echo "configure: warning: Can't compile _getshort reference." 1>&2
-fi
-rm -f conftest*
-
- if test "$pthread_cv_type_ipport" = "" ; then
- echo "configure: warning: Can't determine _getshort return type." 1>&2
- echo "configure: warning: Defaulting to unsigned short." 1>&2
- pthread_cv_type_ipport="unsigned short"
- fi
-
-fi
-
-echo "$ac_t""$pthread_cv_type_ipport" 1>&6
-cat >> confdefs.h <<EOF
-#define pthread_ipport_type $pthread_cv_type_ipport
-EOF
-
-
-echo $ac_n "checking pathname for terminal devices directory""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'pthread_cv_pty_path'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -d /devices/pseudo ; then
- pty_path=/devices/pseudo/
- else
- pty_path=/dev/
- fi
- pthread_cv_pty_path=$pty_path
-
-fi
-
-cat >> confdefs.h <<EOF
-#define _PATH_PTY "$pthread_cv_pty_path"
-EOF
-
-echo "$ac_t""$pthread_cv_pty_path" 1>&6
-
-echo $ac_n "checking directory name for time zone info""... $ac_c" 1>&6
-tzdir=NONE
-for f in /usr/lib/zoneinfo /usr/share/zoneinfo /usr/share/lib/zoneinfo /etc/zoneinfo /usr/local/lib/zoneinfo
-do
- if test -d $f ; then
- tzdir=$f
- break
- fi
-done
-case $tzdir in
-NONE)
- echo "configure: warning: Can't find zoneinfo directory." 1>&2
- echo "configure: warning: Defaulting zoneinfo directory to NULL." 1>&2
- tzdir=NULL
- ;;
-esac
-cat >> confdefs.h <<EOF
-#define _PATH_TZDIR "$tzdir"
-EOF
-
-echo "$ac_t""$tzdir" 1>&6
-
-echo $ac_n "checking filename for local time zone""... $ac_c" 1>&6
-tzfile=NONE
-for f in $tzdir/localtime /etc/localtime
-do
- if test -f $f ; then
- tzfile=$f
- break
- fi
-done
-case $tzfile in
-NONE) # Should this default to tzdir/localtime?
- echo "configure: warning: Can't find local time zone file." 1>&2
- if test tzdir = NULL ; then
- echo "configure: warning: Defaulting local time zone file to NULL" 1>&2
- tzfile=NULL
- else
- echo "configure: warning: Defaulting local time zone file to $tzdir/localtime." 1>&2
- tzfile=$tzdir/localtime
- fi
- ;;
-esac
-cat >> confdefs.h <<EOF
-#define _PATH_TZFILE "$tzfile"
-EOF
-
-echo "$ac_t""$tzfile" 1>&6
-
-cat >> confdefs.h <<\EOF
-#define _PATH_RESCONF "/etc/resolv.conf"
-EOF
-
-cat >> confdefs.h <<\EOF
-#define _PATH_HOSTS "/etc/hosts"
-EOF
-
-cat >> confdefs.h <<\EOF
-#define _PATH_NETWORKS "/etc/networks"
-EOF
-
-cat >> confdefs.h <<\EOF
-#define _PATH_PROTOCOLS "/etc/protocols"
-EOF
-
-cat >> confdefs.h <<\EOF
-#define _PATH_SERVICES "/etc/services"
-EOF
-
-
-cat >> confdefs.h <<\EOF
-#define _PATH_BSHELL "/bin/sh"
-EOF
-
-
-for ac_func in vfork
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2395 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() { return 0; }
-int t() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:2419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-
-fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-
-srctop=`cd ${srcdir}/..;pwd`
-
-
-# Now we deal with symlinks &c.
-
-test -d include || mkdir include || \
- { echo "configure: error: Can't create include directory." 1>&2; exit 1; }
-
-test -d include/pthread || mkdir include/pthread || \
- { echo "configure: error: Can't create include/pthread directory." 1>&2; exit 1; }
-
-test -d lib || mkdir lib || \
- { echo "configure: error: Can't create lib directory." 1>&2; exit 1; }
-
-test -d lib/libpthreadutil || mkdir lib/libpthreadutil || \
- { echo "configure: error: Can't create lib/libpthreadutil directory." 1>&2; exit 1; }
-
-test -d bin || mkdir bin || \
- { echo "configure: error: Can't create bin directory." 1>&2; exit 1; }
-
-test -d bin/finger || mkdir bin/finger || \
- { echo "configure: error: Can't create bin directory." 1>&2; exit 1; }
-
-test -d tests || mkdir tests || \
- { echo "configure: error: Can't create tests directory." 1>&2; exit 1; }
-
-if test x$syscall = xNONE ; then
- syscall=$name
-fi
-
-links="include/pthread/machdep.h include/pthread/posix.h \
- machdep.c syscall.S"
-targets="../machdep/engine-$name.h ../machdep/posix-$sysincludes.h \
- ../machdep/engine-$name.c ../machdep/syscall-$syscall.S"
-
-# Both these targets are optional. (Autoconf-generated configure scripts
-# will require the existence of link targets, so check before adding them
-# to the list.)
-if test x$sysincludes != xNONE ; then
- links="$links include/sys"
- targets="$targets ../machdep/$sysincludes"
-fi
-
-syscall_file=../machdep/syscall-template-$syscall.S
-if test -r $srcdir/$syscall_file ; then
- links="$links syscall-template.S"
- targets="$targets $syscall_file"
- HAVE_SYSCALL_TEMPLATE=yes
-else
- # This really isn't a fatal problem. In fact, it's expected, initially,
- # for some targets. This is just to persuade people to fix the targets
- # they deal with to provide some sort of template.
- #
- # Eventually this file probably will be required...
- echo "configure: warning: No syscall template file syscall-template-$syscall.S found." 1>&2
- HAVE_SYSCALL_TEMPLATE=no
-fi
-
-
-
-
-if test x$makefile_frag != x ; then
- makefile_frag=${srcdir}/$makefile_frag
-else
- makefile_frag=/dev/null
-fi
-
-
-
-
-
-trap '' 1 2 15
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
- >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
- if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
-fi
-
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
-DEFS=-DHAVE_CONFIG_H
-
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
-
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
-
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
-do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.10"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
-done
-
-ac_given_srcdir=$srcdir
-
-trap 'rm -fr `echo "config.flags GNUmakefile Makefile \
- lib/Makefile:../lib/Makefile.in \
- lib/libpthreadutil/Makefile:../lib/libpthreadutil/Makefile.in \
- bin/Makefile:../bin/Makefile.in \
- bin/finger/Makefile:../bin/finger/Makefile.in \
- tests/Makefile:../tests/Makefile.in config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@CC@%$CC%g
-s%@CXX@%$CXX%g
-s%@CPP@%$CPP%g
-s%@RANLIB@%$RANLIB%g
-s%@host@%$host%g
-s%@host_alias@%$host_alias%g
-s%@host_cpu@%$host_cpu%g
-s%@host_vendor@%$host_vendor%g
-s%@host_os@%$host_os%g
-s%@target@%$target%g
-s%@target_alias@%$target_alias%g
-s%@target_cpu@%$target_cpu%g
-s%@target_vendor@%$target_vendor%g
-s%@target_os@%$target_os%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%@SYSCALL_EXCEPTIONS@%$SYSCALL_EXCEPTIONS%g
-s%@available_syscalls@%$available_syscalls%g
-s%@missing_syscalls@%$missing_syscalls%g
-s%@srctop@%$srctop%g
-s%@HAVE_SYSCALL_TEMPLATE@%$HAVE_SYSCALL_TEMPLATE%g
-/@makefile_frag@/r $makefile_frag
-s%@makefile_frag@%%g
-
-CEOF
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"config.flags GNUmakefile Makefile \
- lib/Makefile:../lib/Makefile.in \
- lib/libpthreadutil/Makefile:../lib/libpthreadutil/Makefile.in \
- bin/Makefile:../bin/Makefile.in \
- bin/finger/Makefile:../bin/finger/Makefile.in \
- tests/Makefile:../tests/Makefile.in"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- # Adjust relative srcdir, etc. for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
- fi
-
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
-
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
- esac
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
-fi; done
-rm -f conftest.subs
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='\([ ]\)%\1#\2define\3'
-ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
-
-CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"}
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- echo creating $ac_file
-
- rm -f conftest.frag conftest.in conftest.out
- cp $ac_given_srcdir/$ac_file_in conftest.in
-
-EOF
-
-# Transform confdefs.h into a sed script conftest.vals that substitutes
-# the proper values into config.h.in to produce config.h. And first:
-# Protect against being on the right side of a sed subst in config.status.
-# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
-cat > conftest.hdr <<\EOF
-s/[\\&%]/\\&/g
-s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-s%ac_d%ac_u%gp
-s%ac_u%ac_e%gp
-EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
-
-# This sed command replaces #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-EOF
-
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
-# Maximum number of lines to put in a single here document.
-ac_max_here_lines=12
-
-rm -f conftest.tail
-while :
-do
- ac_lines=`grep -c . conftest.vals`
- # grep -c gives empty output for an empty file on some AIX systems.
- if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
- echo 'CEOF
- sed -f conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-' >> $CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
- rm -f conftest.vals
- mv conftest.tail conftest.vals
-done
-rm -f conftest.vals
-
-cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
- echo "$ac_file is unchanged"
- rm -f conftest.h
- else
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- fi
- rm -f $ac_file
- mv conftest.h $ac_file
- fi
-fi; done
-
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-ac_sources="$targets"
-ac_dests="$links"
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-srcdir=$ac_given_srcdir
-while test -n "$ac_sources"; do
- set $ac_dests; ac_dest=$1; shift; ac_dests=$*
- set $ac_sources; ac_source=$1; shift; ac_sources=$*
-
- echo "linking $srcdir/$ac_source to $ac_dest"
-
- if test ! -r $srcdir/$ac_source; then
- { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
- fi
- rm -f $ac_dest
-
- # Make relative symlinks.
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
- # The dest file is in a subdirectory.
- test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
- ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dest_dir_suffix.
- ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dest_dir_suffix= ac_dots=
- fi
-
- case "$srcdir" in
- [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
- *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
- esac
-
- # Make a symlink if possible; otherwise try a hard link.
- if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
- ln $srcdir/$ac_source $ac_dest; then :
- else
- { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
- fi
-done
-
-
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-
diff --git a/mit-pthreads/config/install-sh b/mit-pthreads/config/install-sh
deleted file mode 100755
index ab74c882e92..00000000000
--- a/mit-pthreads/config/install-sh
+++ /dev/null
@@ -1,238 +0,0 @@
-#!/bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-#
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-tranformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd="$stripprog"
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
-
-if [ x"$src" = x ]
-then
- echo "install: no input file specified"
- exit 1
-else
- true
-fi
-
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d $dst ]; then
- instcmd=:
- else
- instcmd=mkdir
- fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
- if [ -f $src -o -d $src ]
- then
- true
- else
- echo "install: $src does not exist"
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "install: no destination specified"
- exit 1
- else
- true
- fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
- if [ -d $dst ]
- then
- dst="$dst"/`basename $src`
- else
- true
- fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
- shift
-
- if [ ! -d "${pathcomp}" ] ;
- then
- $mkdirprog "${pathcomp}"
- else
- true
- fi
-
- pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd $dst &&
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename $dst`
- else
- dstfile=`basename $dst $transformbasename |
- sed $transformarg`$transformbasename
- fi
-
-# don't allow the sed command to completely eliminate the filename
-
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename $dst`
- else
- true
- fi
-
-# Make a temp file name in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd $src $dsttmp &&
-
- trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing. If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
-
-fi &&
-
-
-exit 0
diff --git a/mit-pthreads/configure b/mit-pthreads/configure
deleted file mode 100755
index ffad2bca3cd..00000000000
--- a/mit-pthreads/configure
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-# This silliness is because Chris wants the autoconf-related files
-# and makefiles not to appear in the top-level directory. Fine by
-# me, I don't much care. This script just needs to invoke the real
-# configure script...
-
-config=`echo $0 | sed -e 's,configure$,config/configure,'`
-
-if test ! -d obj ; then
- mkdir obj
-fi
-
-if test -n "$1" ; then
- sh $config "$@"
-else
- sh $config
-fi
diff --git a/mit-pthreads/gen/GNUmakefile.inc b/mit-pthreads/gen/GNUmakefile.inc
deleted file mode 100755
index a5025860b85..00000000000
--- a/mit-pthreads/gen/GNUmakefile.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-# from: @(#)Makefile.inc 5.21 (Berkeley) 5/24/91
-# $Id$
-
-# gen sources
-VPATH:= ${VPATH}:${srcdir}/gen
-
-SRCS:= ttyname.c directory.c popen.c time.c ctime.c difftime.c syslog.c \
- eprintf.c getpwent.c getpwnamuid.c pwd_internal.c \
- getcwd.c getwd.c isatty.c $(SRCS)
diff --git a/mit-pthreads/gen/Makefile.inc b/mit-pthreads/gen/Makefile.inc
deleted file mode 100644
index 6e2c3d44f43..00000000000
--- a/mit-pthreads/gen/Makefile.inc
+++ /dev/null
@@ -1,24 +0,0 @@
-# from: @(#)Makefile.inc 5.21 (Berkeley) 5/24/91
-# $Id$
-
-# gen sources
-.PATH: ${srcdir}/gen
-
-SRCS+= ttyname.c isatty.c directory.c popen.c time.c ctime.c difftime.c \
- syslog.c eprintf.c getpwent.c getpwnamuid.c pwd_internal.c
-
-#SRCS+= alarm.c assert.c clock.c crypt.c ctermid.c ctype_.c \
-# disklabel.c err.c errlst.c exec.c fnmatch.c frexp.c \
-# fstab.c fts.c getcap.c getcwd.c getgrent.c getlogin.c getmntinfo.c \
-# getpass.c getpwent.c getsubopt.c getttyent.c getusershell.c glob.c \
-# infinity.c initgroups.c isatty.c isctype.c isinf.c mktemp.c nice.c \
-# nlist.c pause.c psignal.c raise.c \
-# scandir.c setjmperr.c \
-# setmode.c setrgid.c setruid.c siginterrupt.c \
-# siglist.c signal.c sigsetops.c syslog.c \
-# termios.c time.c times.c timezone.c ttyslot.c \
-# ualarm.c unvis.c utime.c valloc.c vis.c
-#
-# gen/regexp sources
-#SRCS+= regerror.c regexp.c regsub.c
-
diff --git a/mit-pthreads/gen/ctime.c b/mit-pthreads/gen/ctime.c
deleted file mode 100644
index 9b38d41e495..00000000000
--- a/mit-pthreads/gen/ctime.c
+++ /dev/null
@@ -1,1315 +0,0 @@
-/*
- * Copyright (c) 1987, 1989 Regents of the University of California.
- * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Arthur David Olson of the National Cancer Institute.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)ctime.c 5.26 (Berkeley) 2/23/91";
-#endif /* LIBC_SCCS and not lint */
-
-/*
-** Leap second handling from Bradley White (bww@k.gp.cs.cmu.edu).
-** POSIX-style TZ environment variable handling from Guy Harris
-** (guy@auspex.com).
-*/
-
-/*LINTLIBRARY*/
-#include "config.h"
-#include <pthread.h>
-#include <sys/param.h>
-#include <fcntl.h>
-#include <time.h>
-#include <tzfile.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-#ifndef WILDABBR
-/*
-** Someone might make incorrect use of a time zone abbreviation:
-** 1. They might reference tzname[0] before calling tzset (explicitly
-** or implicitly).
-** 2. They might reference tzname[1] before calling tzset (explicitly
-** or implicitly).
-** 3. They might reference tzname[1] after setting to a time zone
-** in which Daylight Saving Time is never observed.
-** 4. They might reference tzname[0] after setting to a time zone
-** in which Standard Time is never observed.
-** 5. They might reference tm.TM_ZONE after calling offtime.
-** What's best to do in the above cases is open to debate;
-** for now, we just set things up so that in any of the five cases
-** WILDABBR is used. Another possibility: initialize tzname[0] to the
-** string "tzname[0] used before set", and similarly for the other cases.
-** And another: initialize tzname[0] to "ERA", with an explanation in the
-** manual page of what this "time zone abbreviation" means (doing this so
-** that tzname[0] has the "normal" length of three characters).
-*/
-#define WILDABBR " "
-#endif /* !defined WILDABBR */
-
-#ifndef TRUE
-#define TRUE 1
-#define FALSE 0
-#endif /* !defined TRUE */
-
-static const char GMT[] = "GMT";
-
-struct ttinfo { /* time type information */
- long tt_gmtoff; /* GMT offset in seconds */
- int tt_isdst; /* used to set tm_isdst */
- int tt_abbrind; /* abbreviation list index */
- int tt_ttisstd; /* TRUE if transition is std time */
-};
-
-struct lsinfo { /* leap second information */
- time_t ls_trans; /* transition time */
- long ls_corr; /* correction to apply */
-};
-
-struct state {
- int leapcnt;
- int timecnt;
- int typecnt;
- int charcnt;
- time_t ats[TZ_MAX_TIMES];
- unsigned char types[TZ_MAX_TIMES];
- struct ttinfo ttis[TZ_MAX_TYPES];
- char chars[(TZ_MAX_CHARS + 1 > sizeof GMT) ?
- TZ_MAX_CHARS + 1 : sizeof GMT];
- struct lsinfo lsis[TZ_MAX_LEAPS];
-};
-
-struct rule {
- int r_type; /* type of rule--see below */
- int r_day; /* day number of rule */
- int r_week; /* week number of rule */
- int r_mon; /* month number of rule */
- long r_time; /* transition time of rule */
-};
-
-#define JULIAN_DAY 0 /* Jn - Julian day */
-#define DAY_OF_YEAR 1 /* n - day of year */
-#define MONTH_NTH_DAY_OF_WEEK 2 /* Mm.n.d - month, week, day of week */
-
-/*
-** Prototypes for static functions.
-*/
-
-static int detzcode __P_((const char *));
-static const char * getnum __P_((const char *, int *, int, int));
-static const char * getsecs __P_((const char *, long *));
-static const char * getoffset __P_((const char *, long *));
-static const char * getrule __P_((const char *, struct rule *));
-static const char * getzname __P_((const char *));
-static void gmtload __P_((struct state *));
-static void gmtsub __P_((const time_t *, long, struct tm *));
-static void localsub __P_((const time_t *, long, struct tm *));
-static void normalize __P_((int *, int *, int));
-static void settzname __P_((struct state *));
-static time_t time1 __P_((struct tm *, long));
-static time_t time2 __P_((struct tm *, long, int *));
-static void timesub __P_((const time_t *, long, const struct state *,
- struct tm *));
-static int tmcomp __P_((const struct tm *, const struct tm *));
-static time_t transtime __P_((time_t, int, const struct rule *, long));
-static int tzload __P_((const char *, struct state *));
-static int tzparse __P_((const char *, struct state *, int));
-static void tzset_basic __P_((void));
-static void tzsetwall_basic __P_((void));
-
-static pthread_mutex_t lcl_mutex = PTHREAD_MUTEX_INITIALIZER;
-static pthread_mutex_t gmt_mutex = PTHREAD_MUTEX_INITIALIZER;
-static int lcl_is_set = FALSE;
-static int gmt_is_set = FALSE;
-static struct state lclmem;
-static struct state gmtmem;
-
-#define lclptr (&lclmem)
-#define gmtptr (&gmtmem)
-
-char * tzname[2] = {
- WILDABBR,
- WILDABBR
-};
-
-#ifdef USG_COMPAT
-time_t timezone = 0;
-int daylight = 0;
-#endif /* defined USG_COMPAT */
-
-#ifdef ALTZONE
-time_t altzone = 0;
-#endif /* defined ALTZONE */
-
-static int detzcode(const char * codep)
-{
- int result;
- int i;
-
- result = 0;
- for (i = 0; i < 4; ++i)
- result = (result << 8) | (codep[i] & 0xff);
- return result;
-}
-
-static void settzname(struct state * sp)
-{
- register int i;
-
- tzname[0] = WILDABBR;
- tzname[1] = WILDABBR;
-#ifdef USG_COMPAT
- daylight = 0;
- timezone = 0;
-#endif /* defined USG_COMPAT */
-#ifdef ALTZONE
- altzone = 0;
-#endif /* defined ALTZONE */
- for (i = 0; i < sp->typecnt; ++i) {
- register const struct ttinfo * const ttisp = &sp->ttis[i];
-
- tzname[ttisp->tt_isdst] =
- (char *) &sp->chars[ttisp->tt_abbrind];
-#ifdef USG_COMPAT
- if (ttisp->tt_isdst)
- daylight = 1;
- if (i == 0 || !ttisp->tt_isdst)
- timezone = -(ttisp->tt_gmtoff);
-#endif /* defined USG_COMPAT */
-#ifdef ALTZONE
- if (i == 0 || ttisp->tt_isdst)
- altzone = -(ttisp->tt_gmtoff);
-#endif /* defined ALTZONE */
- }
- /*
- ** And to get the latest zone names into tzname. . .
- */
- for (i = 0; i < sp->timecnt; ++i) {
- register const struct ttinfo * const ttisp =
- &sp->ttis[sp->types[i]];
-
- tzname[ttisp->tt_isdst] =
- (char *) &sp->chars[ttisp->tt_abbrind];
- }
-}
-
-static int tzload(const char * name, struct state * sp)
-{
- register const char * p;
- register int i;
- register int fid;
-
- if (name == NULL && (name = TZDEFAULT) == NULL)
- return -1;
- {
- char fullname[FILENAME_MAX + 1];
-
- if (name[0] == ':')
- ++name;
- if (name[0] != '/') {
- if ((p = TZDIR) == NULL)
- return -1;
- if ((strlen(p) + strlen(name) + 1) >= sizeof fullname)
- return -1;
- (void) strcpy(fullname, p);
- (void) strcat(fullname, "/");
- (void) strcat(fullname, name);
- name = fullname;
- }
- if ((fid = open(name, O_RDONLY)) == -1)
- return -1;
- }
- {
- register const struct tzhead * tzhp;
- char buf[sizeof *sp + sizeof *tzhp];
- int ttisstdcnt;
-
- i = read(fid, buf, sizeof buf);
- if (close(fid) != 0 || i < sizeof *tzhp)
- return -1;
- tzhp = (struct tzhead *) buf;
- ttisstdcnt = (int) detzcode(tzhp->tzh_ttisstdcnt);
- sp->leapcnt = (int) detzcode(tzhp->tzh_leapcnt);
- sp->timecnt = (int) detzcode(tzhp->tzh_timecnt);
- sp->typecnt = (int) detzcode(tzhp->tzh_typecnt);
- sp->charcnt = (int) detzcode(tzhp->tzh_charcnt);
- if (sp->leapcnt < 0 || sp->leapcnt > TZ_MAX_LEAPS ||
- sp->typecnt <= 0 || sp->typecnt > TZ_MAX_TYPES ||
- sp->timecnt < 0 || sp->timecnt > TZ_MAX_TIMES ||
- sp->charcnt < 0 || sp->charcnt > TZ_MAX_CHARS ||
- (ttisstdcnt != sp->typecnt && ttisstdcnt != 0))
- return -1;
- if (i < sizeof *tzhp +
- sp->timecnt * (4 + sizeof (char)) +
- sp->typecnt * (4 + 2 * sizeof (char)) +
- sp->charcnt * sizeof (char) +
- sp->leapcnt * 2 * 4 +
- ttisstdcnt * sizeof (char))
- return -1;
- p = buf + sizeof *tzhp;
- for (i = 0; i < sp->timecnt; ++i) {
- sp->ats[i] = detzcode(p);
- p += 4;
- }
- for (i = 0; i < sp->timecnt; ++i) {
- sp->types[i] = (unsigned char) *p++;
- if (sp->types[i] >= sp->typecnt)
- return -1;
- }
- for (i = 0; i < sp->typecnt; ++i) {
- register struct ttinfo * ttisp;
-
- ttisp = &sp->ttis[i];
- ttisp->tt_gmtoff = detzcode(p);
- p += 4;
- ttisp->tt_isdst = (unsigned char) *p++;
- if (ttisp->tt_isdst != 0 && ttisp->tt_isdst != 1)
- return -1;
- ttisp->tt_abbrind = (unsigned char) *p++;
- if (ttisp->tt_abbrind < 0 ||
- ttisp->tt_abbrind > sp->charcnt)
- return -1;
- }
- for (i = 0; i < sp->charcnt; ++i)
- sp->chars[i] = *p++;
- sp->chars[i] = '\0'; /* ensure '\0' at end */
- for (i = 0; i < sp->leapcnt; ++i) {
- register struct lsinfo * lsisp;
-
- lsisp = &sp->lsis[i];
- lsisp->ls_trans = detzcode(p);
- p += 4;
- lsisp->ls_corr = detzcode(p);
- p += 4;
- }
- for (i = 0; i < sp->typecnt; ++i) {
- register struct ttinfo * ttisp;
-
- ttisp = &sp->ttis[i];
- if (ttisstdcnt == 0)
- ttisp->tt_ttisstd = FALSE;
- else {
- ttisp->tt_ttisstd = *p++;
- if (ttisp->tt_ttisstd != TRUE &&
- ttisp->tt_ttisstd != FALSE)
- return -1;
- }
- }
- }
- return 0;
-}
-
-static const int mon_lengths[2][MONSPERYEAR] = {
- 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
- 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
-};
-
-static const int year_lengths[2] = {
- DAYSPERNYEAR, DAYSPERLYEAR
-};
-
-/*
-** Given a pointer into a time zone string, scan until a character that is not
-** a valid character in a zone name is found. Return a pointer to that
-** character.
-*/
-static const char * getzname(const char * strp)
-{
- register char c;
-
- while ((c = *strp) != '\0' && !isdigit(c) && c != ',' && c != '-' &&
- c != '+')
- ++strp;
- return strp;
-}
-
-/*
-** Given a pointer into a time zone string, extract a number from that string.
-** Check that the number is within a specified range; if it is not, return
-** NULL.
-** Otherwise, return a pointer to the first character not part of the number.
-*/
-
-static const char *getnum(const char * strp, int * nump, int min, int max)
-{
- char c;
- int num;
-
- if (strp == NULL || !isdigit(*strp))
- return NULL;
- num = 0;
- while ((c = *strp) != '\0' && isdigit(c)) {
- num = num * 10 + (c - '0');
- if (num > max)
- return NULL; /* illegal value */
- ++strp;
- }
- if (num < min)
- return NULL; /* illegal value */
- *nump = num;
- return strp;
-}
-
-/*
-** Given a pointer into a time zone string, extract a number of seconds,
-** in hh[:mm[:ss]] form, from the string.
-** If any error occurs, return NULL.
-** Otherwise, return a pointer to the first character not part of the number
-** of seconds.
-*/
-static const char * getsecs(const char * strp, long * secsp)
-{
- int num;
-
- strp = getnum(strp, &num, 0, HOURSPERDAY);
- if (strp == NULL)
- return NULL;
- *secsp = num * SECSPERHOUR;
- if (*strp == ':') {
- ++strp;
- strp = getnum(strp, &num, 0, MINSPERHOUR - 1);
- if (strp == NULL)
- return NULL;
- *secsp += num * SECSPERMIN;
- if (*strp == ':') {
- ++strp;
- strp = getnum(strp, &num, 0, SECSPERMIN - 1);
- if (strp == NULL)
- return NULL;
- *secsp += num;
- }
- }
- return strp;
-}
-
-/*
-** Given a pointer into a time zone string, extract an offset, in
-** [+-]hh[:mm[:ss]] form, from the string.
-** If any error occurs, return NULL.
-** Otherwise, return a pointer to the first character not part of the time.
-*/
-static const char * getoffset(const char * strp, long * offsetp)
-{
- int neg;
-
- if (*strp == '-') {
- neg = 1;
- ++strp;
- } else if (isdigit(*strp) || *strp++ == '+')
- neg = 0;
- else return NULL; /* illegal offset */
- strp = getsecs(strp, offsetp);
- if (strp == NULL)
- return NULL; /* illegal time */
- if (neg)
- *offsetp = -*offsetp;
- return strp;
-}
-
-/*
-** Given a pointer into a time zone string, extract a rule in the form
-** date[/time]. See POSIX section 8 for the format of "date" and "time".
-** If a valid rule is not found, return NULL.
-** Otherwise, return a pointer to the first character not part of the rule.
-*/
-static const char * getrule(const char * strp, struct rule * rulep)
-{
- if (*strp == 'J') {
- /*
- ** Julian day.
- */
- rulep->r_type = JULIAN_DAY;
- ++strp;
- strp = getnum(strp, &rulep->r_day, 1, DAYSPERNYEAR);
- } else if (*strp == 'M') {
- /*
- ** Month, week, day.
- */
- rulep->r_type = MONTH_NTH_DAY_OF_WEEK;
- ++strp;
- strp = getnum(strp, &rulep->r_mon, 1, MONSPERYEAR);
- if (strp == NULL)
- return NULL;
- if (*strp++ != '.')
- return NULL;
- strp = getnum(strp, &rulep->r_week, 1, 5);
- if (strp == NULL)
- return NULL;
- if (*strp++ != '.')
- return NULL;
- strp = getnum(strp, &rulep->r_day, 0, DAYSPERWEEK - 1);
- } else if (isdigit(*strp)) {
- /*
- ** Day of year.
- */
- rulep->r_type = DAY_OF_YEAR;
- strp = getnum(strp, &rulep->r_day, 0, DAYSPERLYEAR - 1);
- } else return NULL; /* invalid format */
- if (strp == NULL)
- return NULL;
- if (*strp == '/') {
- /*
- ** Time specified.
- */
- ++strp;
- strp = getsecs(strp, &rulep->r_time);
- } else rulep->r_time = 2 * SECSPERHOUR; /* default = 2:00:00 */
- return strp;
-}
-
-/*
-** Given the Epoch-relative time of January 1, 00:00:00 GMT, in a year, the
-** year, a rule, and the offset from GMT at the time that rule takes effect,
-** calculate the Epoch-relative time that rule takes effect.
-*/
-static time_t transtime(time_t janfirst, int year,
- const struct rule * rulep, long offset)
-{
- register int leapyear;
- register time_t value;
- register int i;
- int d, m1, yy0, yy1, yy2, dow;
-
- leapyear = isleap(year);
- switch (rulep->r_type) {
-
- case JULIAN_DAY:
- /*
- ** Jn - Julian day, 1 == January 1, 60 == March 1 even in leap
- ** years.
- ** In non-leap years, or if the day number is 59 or less, just
- ** add SECSPERDAY times the day number-1 to the time of
- ** January 1, midnight, to get the day.
- */
- value = janfirst + (rulep->r_day - 1) * SECSPERDAY;
- if (leapyear && rulep->r_day >= 60)
- value += SECSPERDAY;
- break;
-
- case DAY_OF_YEAR:
- /*
- ** n - day of year.
- ** Just add SECSPERDAY times the day number to the time of
- ** January 1, midnight, to get the day.
- */
- value = janfirst + rulep->r_day * SECSPERDAY;
- break;
-
- case MONTH_NTH_DAY_OF_WEEK:
- /*
- ** Mm.n.d - nth "dth day" of month m.
- */
- value = janfirst;
- for (i = 0; i < rulep->r_mon - 1; ++i)
- value += mon_lengths[leapyear][i] * SECSPERDAY;
-
- /*
- ** Use Zeller's Congruence to get day-of-week of first day of
- ** month.
- */
- m1 = (rulep->r_mon + 9) % 12 + 1;
- yy0 = (rulep->r_mon <= 2) ? (year - 1) : year;
- yy1 = yy0 / 100;
- yy2 = yy0 % 100;
- dow = ((26 * m1 - 2) / 10 +
- 1 + yy2 + yy2 / 4 + yy1 / 4 - 2 * yy1) % 7;
- if (dow < 0)
- dow += DAYSPERWEEK;
-
- /*
- ** "dow" is the day-of-week of the first day of the month. Get
- ** the day-of-month (zero-origin) of the first "dow" day of the
- ** month.
- */
- d = rulep->r_day - dow;
- if (d < 0)
- d += DAYSPERWEEK;
- for (i = 1; i < rulep->r_week; ++i) {
- if (d + DAYSPERWEEK >=
- mon_lengths[leapyear][rulep->r_mon - 1])
- break;
- d += DAYSPERWEEK;
- }
-
- /*
- ** "d" is the day-of-month (zero-origin) of the day we want.
- */
- value += d * SECSPERDAY;
- break;
- }
-
- /*
- ** "value" is the Epoch-relative time of 00:00:00 GMT on the day in
- ** question. To get the Epoch-relative time of the specified local
- ** time on that day, add the transition time and the current offset
- ** from GMT.
- */
- return value + rulep->r_time + offset;
-}
-
-/*
-** Given a POSIX section 8-style TZ string, fill in the rule tables as
-** appropriate.
-*/
-static int tzparse(const char * name, struct state * sp, int lastditch)
-{
- const char * stdname;
- const char * dstname;
- int stdlen;
- int dstlen;
- long stdoffset;
- long dstoffset;
- register time_t * atp;
- register unsigned char * typep;
- register char * cp;
- register int load_result;
-
- stdname = name;
- if (lastditch) {
- stdlen = strlen(name); /* length of standard zone name */
- name += stdlen;
- if (stdlen >= sizeof sp->chars)
- stdlen = (sizeof sp->chars) - 1;
- } else {
- name = getzname(name);
- stdlen = name - stdname;
- if (stdlen < 3)
- return -1;
- }
- if (*name == '\0')
- return -1;
- else {
- name = getoffset(name, &stdoffset);
- if (name == NULL)
- return -1;
- }
- load_result = tzload(TZDEFRULES, sp);
- if (load_result != 0)
- sp->leapcnt = 0; /* so, we're off a little */
- if (*name != '\0') {
- dstname = name;
- name = getzname(name);
- dstlen = name - dstname; /* length of DST zone name */
- if (dstlen < 3)
- return -1;
- if (*name != '\0' && *name != ',' && *name != ';') {
- name = getoffset(name, &dstoffset);
- if (name == NULL)
- return -1;
- } else dstoffset = stdoffset - SECSPERHOUR;
- if (*name == ',' || *name == ';') {
- struct rule start;
- struct rule end;
- register int year;
- register time_t janfirst;
- time_t starttime;
- time_t endtime;
-
- ++name;
- if ((name = getrule(name, &start)) == NULL)
- return -1;
- if (*name++ != ',')
- return -1;
- if ((name = getrule(name, &end)) == NULL)
- return -1;
- if (*name != '\0')
- return -1;
- sp->typecnt = 2; /* standard time and DST */
- /*
- ** Two transitions per year, from EPOCH_YEAR to 2037.
- */
- sp->timecnt = 2 * (2037 - EPOCH_YEAR + 1);
- if (sp->timecnt > TZ_MAX_TIMES)
- return -1;
- sp->ttis[0].tt_gmtoff = -dstoffset;
- sp->ttis[0].tt_isdst = 1;
- sp->ttis[0].tt_abbrind = stdlen + 1;
- sp->ttis[1].tt_gmtoff = -stdoffset;
- sp->ttis[1].tt_isdst = 0;
- sp->ttis[1].tt_abbrind = 0;
- atp = sp->ats;
- typep = sp->types;
- janfirst = 0;
- for (year = EPOCH_YEAR; year <= 2037; ++year) {
- starttime = transtime(janfirst, year, &start,
- stdoffset);
- endtime = transtime(janfirst, year, &end,
- dstoffset);
- if (starttime > endtime) {
- *atp++ = endtime;
- *typep++ = 1; /* DST ends */
- *atp++ = starttime;
- *typep++ = 0; /* DST begins */
- } else {
- *atp++ = starttime;
- *typep++ = 0; /* DST begins */
- *atp++ = endtime;
- *typep++ = 1; /* DST ends */
- }
- janfirst +=
- year_lengths[isleap(year)] * SECSPERDAY;
- }
- } else {
- int sawstd;
- int sawdst;
- long stdfix;
- long dstfix;
- long oldfix;
- int isdst;
- register int i;
-
- if (*name != '\0')
- return -1;
- if (load_result != 0)
- return -1;
- /*
- ** Compute the difference between the real and
- ** prototype standard and summer time offsets
- ** from GMT, and put the real standard and summer
- ** time offsets into the rules in place of the
- ** prototype offsets.
- */
- sawstd = FALSE;
- sawdst = FALSE;
- stdfix = 0;
- dstfix = 0;
- for (i = 0; i < sp->typecnt; ++i) {
- if (sp->ttis[i].tt_isdst) {
- oldfix = dstfix;
- dstfix =
- sp->ttis[i].tt_gmtoff + dstoffset;
- if (sawdst && (oldfix != dstfix))
- return -1;
- sp->ttis[i].tt_gmtoff = -dstoffset;
- sp->ttis[i].tt_abbrind = stdlen + 1;
- sawdst = TRUE;
- } else {
- oldfix = stdfix;
- stdfix =
- sp->ttis[i].tt_gmtoff + stdoffset;
- if (sawstd && (oldfix != stdfix))
- return -1;
- sp->ttis[i].tt_gmtoff = -stdoffset;
- sp->ttis[i].tt_abbrind = 0;
- sawstd = TRUE;
- }
- }
- /*
- ** Make sure we have both standard and summer time.
- */
- if (!sawdst || !sawstd)
- return -1;
- /*
- ** Now correct the transition times by shifting
- ** them by the difference between the real and
- ** prototype offsets. Note that this difference
- ** can be different in standard and summer time;
- ** the prototype probably has a 1-hour difference
- ** between standard and summer time, but a different
- ** difference can be specified in TZ.
- */
- isdst = FALSE; /* we start in standard time */
- for (i = 0; i < sp->timecnt; ++i) {
- register const struct ttinfo * ttisp;
-
- /*
- ** If summer time is in effect, and the
- ** transition time was not specified as
- ** standard time, add the summer time
- ** offset to the transition time;
- ** otherwise, add the standard time offset
- ** to the transition time.
- */
- ttisp = &sp->ttis[sp->types[i]];
- sp->ats[i] +=
- (isdst && !ttisp->tt_ttisstd) ?
- dstfix : stdfix;
- isdst = ttisp->tt_isdst;
- }
- }
- } else {
- dstlen = 0;
- sp->typecnt = 1; /* only standard time */
- sp->timecnt = 0;
- sp->ttis[0].tt_gmtoff = -stdoffset;
- sp->ttis[0].tt_isdst = 0;
- sp->ttis[0].tt_abbrind = 0;
- }
- sp->charcnt = stdlen + 1;
- if (dstlen != 0)
- sp->charcnt += dstlen + 1;
- if (sp->charcnt > sizeof sp->chars)
- return -1;
- cp = sp->chars;
- (void) strncpy(cp, stdname, stdlen);
- cp += stdlen;
- *cp++ = '\0';
- if (dstlen != 0) {
- (void) strncpy(cp, dstname, dstlen);
- *(cp + dstlen) = '\0';
- }
- return 0;
-}
-
-static void gmtload(struct state * sp)
-{
- if (tzload(GMT, sp) != 0)
- (void) tzparse(GMT, sp, TRUE);
-}
-
-static void tzset_basic()
-{
- const char * name;
- if ((name = getenv("TZ")) == NULL) {
- tzsetwall_basic();
- return;
- }
-
- if (*name == '\0') {
- /*
- ** User wants it fast rather than right.
- */
- lclptr->leapcnt = 0; /* so, we're off a little */
- lclptr->timecnt = 0;
- lclptr->ttis[0].tt_gmtoff = 0;
- lclptr->ttis[0].tt_abbrind = 0;
- (void) strcpy(lclptr->chars, GMT);
- } else {
- if (tzload(name, lclptr) != 0)
- if (name[0] == ':' || tzparse(name, lclptr, FALSE) != 0)
- (void) gmtload(lclptr);
- }
- lcl_is_set = TRUE;
- settzname(lclptr);
-}
-
-void tzset()
-{
- pthread_mutex_lock(&lcl_mutex);
- tzset_basic();
- pthread_mutex_unlock(&lcl_mutex);
-}
-
-static void tzsetwall_basic()
-{
- if (tzload((char *) NULL, lclptr) != 0)
- gmtload(lclptr);
- settzname(lclptr);
- lcl_is_set = TRUE;
-}
-
-void tzsetwall()
-{
- pthread_mutex_lock(&lcl_mutex);
- tzsetwall_basic();
- pthread_mutex_unlock(&lcl_mutex);
-}
-
-/*
-** The easy way to behave "as if no library function calls" localtime
-** is to not call it--so we drop its guts into "localsub", which can be
-** freely called. (And no, the PANS doesn't require the above behavior--
-** but it *is* desirable.)
-**
-** The unused offset argument is for the benefit of mktime variants.
-*/
-
-static void localsub(const time_t * timep, long offset, struct tm * tmp)
-{
- const struct ttinfo * ttisp;
- const time_t t = *timep;
- struct state * sp;
- int i;
-
- if (!lcl_is_set)
- tzset_basic();
- sp = lclptr;
- if (sp->timecnt == 0 || t < sp->ats[0]) {
- i = 0;
- while (sp->ttis[i].tt_isdst)
- if (++i >= sp->typecnt) {
- i = 0;
- break;
- }
- } else {
- for (i = 1; i < sp->timecnt; ++i)
- if (t < sp->ats[i])
- break;
- i = sp->types[i - 1];
- }
- ttisp = &sp->ttis[i];
- /*
- ** To get (wrong) behavior that's compatible with System V Release 2.0
- ** you'd replace the statement below with
- ** t += ttisp->tt_gmtoff;
- ** timesub(&t, 0L, sp, tmp);
- */
- timesub(&t, ttisp->tt_gmtoff, sp, tmp);
- tzname[tmp->tm_isdst] = (char *) &sp->chars[ttisp->tt_abbrind];
-#ifdef BSD_TM
- tmp->tm_zone = &sp->chars[ttisp->tt_abbrind];
-#endif
- tmp->tm_isdst = ttisp->tt_isdst;
-
- pthread_mutex_unlock(&lcl_mutex);
-}
-
-struct tm * localtime_r(const time_t * timep, struct tm * tm)
-{
- pthread_mutex_lock(&lcl_mutex);
- localsub(timep, 0L, tm);
- pthread_mutex_unlock(&lcl_mutex);
- return(tm);
-}
-
-struct tm * localtime(const time_t * timep)
-{
- static pthread_mutex_t localtime_mutex = PTHREAD_MUTEX_INITIALIZER;
- static pthread_key_t localtime_key = -1;
- struct tm * tm;
-
- pthread_mutex_lock(&localtime_mutex);
- if (localtime_key < 0) {
- if (pthread_key_create(&localtime_key, free) < 0) {
- pthread_mutex_unlock(&localtime_mutex);
- return(NULL);
- }
- }
- pthread_mutex_unlock(&localtime_mutex);
- if ((tm = pthread_getspecific(localtime_key)) == NULL) {
- if ((tm = (struct tm *)malloc(sizeof(struct tm))) == NULL) {
- return(NULL);
- }
- pthread_setspecific(localtime_key, tm);
- }
-
- pthread_mutex_lock(&lcl_mutex);
- localsub(timep, 0L, tm);
- pthread_mutex_unlock(&lcl_mutex);
- return tm;
-}
-
-
-/*
- * gmtsub is to gmtime as localsub is to localtime.
- *
- * Once set there is no need to lock the gmt_mutex to view gmtptr
- */
-static void gmtsub(const time_t * timep, long offset, struct tm * tmp)
-{
- pthread_mutex_lock(&gmt_mutex);
- if (gmt_is_set == FALSE) {
- gmt_is_set = TRUE;
- gmtload(gmtptr);
- }
- pthread_mutex_unlock(&gmt_mutex);
-
- timesub(timep, offset, gmtptr, tmp);
- /*
- ** Could get fancy here and deliver something such as
- ** "GMT+xxxx" or "GMT-xxxx" if offset is non-zero,
- ** but this is no time for a treasure hunt.
- */
-#ifdef BSD_TM
- if (offset != 0) {
- tmp->tm_zone = WILDABBR;
- } else {
- tmp->tm_zone = gmtptr->chars;
- }
-#endif
-}
-
-struct tm * gmtime_r(const time_t * timep, struct tm * tm)
-{
- gmtsub(timep, 0L, tm);
- return(tm);
-}
-
-struct tm * gmtime(const time_t * timep)
-{
- static pthread_mutex_t gmtime_mutex = PTHREAD_MUTEX_INITIALIZER;
- static pthread_key_t gmtime_key = -1;
- struct tm * tm;
-
- pthread_mutex_lock(&gmtime_mutex);
- if (gmtime_key < 0) {
- if (pthread_key_create(&gmtime_key, free) < 0) {
- pthread_mutex_unlock(&gmtime_mutex);
- return(NULL);
- }
- }
- pthread_mutex_unlock(&gmtime_mutex);
- if ((tm = pthread_getspecific(gmtime_key)) == NULL) {
- if ((tm = (struct tm *)malloc(sizeof(struct tm))) == NULL) {
- return(NULL);
- }
- pthread_setspecific(gmtime_key, tm);
- }
-
- gmtsub(timep, 0L, tm);
- return(tm);
-}
-
-static void timesub(const time_t * timep, long offset,
- const struct state * sp, struct tm * tmp)
-{
- register const struct lsinfo * lp;
- register long days;
- register long rem;
- register int y;
- register int yleap;
- register const int * ip;
- register long corr;
- register int hit;
- register int i;
-
- corr = 0;
- hit = FALSE;
- i = sp->leapcnt;
- while (--i >= 0) {
- lp = &sp->lsis[i];
- if (*timep >= lp->ls_trans) {
- if (*timep == lp->ls_trans)
- hit = ((i == 0 && lp->ls_corr > 0) ||
- lp->ls_corr > sp->lsis[i - 1].ls_corr);
- corr = lp->ls_corr;
- break;
- }
- }
- days = *timep / SECSPERDAY;
- rem = *timep % SECSPERDAY;
-#ifdef mc68k
- if (*timep == 0x80000000) {
- /*
- ** A 3B1 muffs the division on the most negative number.
- */
- days = -24855;
- rem = -11648;
- }
-#endif /* mc68k */
- rem += (offset - corr);
- while (rem < 0) {
- rem += SECSPERDAY;
- --days;
- }
- while (rem >= SECSPERDAY) {
- rem -= SECSPERDAY;
- ++days;
- }
- tmp->tm_hour = (int) (rem / SECSPERHOUR);
- rem = rem % SECSPERHOUR;
- tmp->tm_min = (int) (rem / SECSPERMIN);
- tmp->tm_sec = (int) (rem % SECSPERMIN);
- if (hit)
- /*
- ** A positive leap second requires a special
- ** representation. This uses "... ??:59:60".
- */
- ++(tmp->tm_sec);
- tmp->tm_wday = (int) ((EPOCH_WDAY + days) % DAYSPERWEEK);
- if (tmp->tm_wday < 0)
- tmp->tm_wday += DAYSPERWEEK;
- y = EPOCH_YEAR;
- if (days >= 0)
- for ( ; ; ) {
- yleap = isleap(y);
- if (days < (long) year_lengths[yleap])
- break;
- ++y;
- days = days - (long) year_lengths[yleap];
- }
- else do {
- --y;
- yleap = isleap(y);
- days = days + (long) year_lengths[yleap];
- } while (days < 0);
- tmp->tm_year = y - TM_YEAR_BASE;
- tmp->tm_yday = (int) days;
- ip = mon_lengths[yleap];
- for (tmp->tm_mon = 0; days >= (long) ip[tmp->tm_mon]; ++(tmp->tm_mon))
- days = days - (long) ip[tmp->tm_mon];
- tmp->tm_mday = (int) (days + 1);
- tmp->tm_isdst = 0;
-#ifdef BSD_TM
- tmp->tm_gmtoff = offset;
-#endif
-}
-
-/*
- * A la X3J11
- *
- * Made thread safe by using thread specific data
- */
-char * asctime_r(const struct tm * timeptr, char * result)
-{
- static const char wday_name[DAYSPERWEEK][3] = {
- "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
- };
- static const char mon_name[MONSPERYEAR][3] = {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
- };
- (void) sprintf(result, "%.3s %.3s%3d %02.2d:%02.2d:%02.2d %d\n",
- wday_name[timeptr->tm_wday],
- mon_name[timeptr->tm_mon],
- timeptr->tm_mday, timeptr->tm_hour,
- timeptr->tm_min, timeptr->tm_sec,
- TM_YEAR_BASE + timeptr->tm_year);
- return(result);
-}
-
-char * asctime(const struct tm * timeptr)
-{
- static pthread_mutex_t asctime_mutex = PTHREAD_MUTEX_INITIALIZER;
- static pthread_key_t asctime_key = -1;
- char * result;
-
- pthread_mutex_lock(&asctime_mutex);
- if (asctime_key < 0) {
- if (pthread_key_create(&asctime_key, free) < 0) {
- pthread_mutex_unlock(&asctime_mutex);
- return(NULL);
- }
- }
- pthread_mutex_unlock(&asctime_mutex);
- if ((result = pthread_getspecific(asctime_key)) == NULL) {
- if ((result = malloc(26)) == NULL) {
- return(NULL);
- }
- pthread_setspecific(asctime_key, result);
- }
-
- return(asctime_r(timeptr, result));
-}
-
-char * ctime_r(const time_t * timep, char * buf)
-{
- struct tm tm;
- return asctime_r(localtime_r(timep, &tm), buf);
-}
-
-char * ctime(const time_t * timep)
-{
- struct tm tm;
- return asctime(localtime_r(timep, &tm));
-}
-
-/*
-** Adapted from code provided by Robert Elz, who writes:
-** The "best" way to do mktime I think is based on an idea of Bob
-** Kridle's (so its said...) from a long time ago. (mtxinu!kridle now).
-** It does a binary search of the time_t space. Since time_t's are
-** just 32 bits, its a max of 32 iterations (even at 64 bits it
-** would still be very reasonable).
-*/
-static void normalize(int * tensptr,int * unitsptr, int base)
-{
- if (*unitsptr >= base) {
- *tensptr += *unitsptr / base;
- *unitsptr %= base;
- } else if (*unitsptr < 0) {
- --*tensptr;
- *unitsptr += base;
- if (*unitsptr < 0) {
- *tensptr -= 1 + (-*unitsptr) / base;
- *unitsptr = base - (-*unitsptr) % base;
- }
- }
-}
-
-static int tmcomp(const struct tm * atmp, const struct tm * btmp)
-{
- register int result;
-
- if ((result = (atmp->tm_year - btmp->tm_year)) == 0 &&
- (result = (atmp->tm_mon - btmp->tm_mon)) == 0 &&
- (result = (atmp->tm_mday - btmp->tm_mday)) == 0 &&
- (result = (atmp->tm_hour - btmp->tm_hour)) == 0 &&
- (result = (atmp->tm_min - btmp->tm_min)) == 0)
- result = atmp->tm_sec - btmp->tm_sec;
- return result;
-}
-
-static time_t time2(struct tm * tmp, long offset, int * okayp)
-{
- register const struct state * sp;
- register int dir;
- register int bits;
- register int i, j ;
- register int saved_seconds;
- time_t newt;
- time_t t;
- struct tm yourtm, mytm;
-
- *okayp = FALSE;
- yourtm = *tmp;
- if (yourtm.tm_sec >= SECSPERMIN + 2 || yourtm.tm_sec < 0)
- normalize(&yourtm.tm_min, &yourtm.tm_sec, SECSPERMIN);
- normalize(&yourtm.tm_hour, &yourtm.tm_min, MINSPERHOUR);
- normalize(&yourtm.tm_mday, &yourtm.tm_hour, HOURSPERDAY);
- normalize(&yourtm.tm_year, &yourtm.tm_mon, MONSPERYEAR);
- while (yourtm.tm_mday <= 0) {
- --yourtm.tm_year;
- yourtm.tm_mday +=
- year_lengths[isleap(yourtm.tm_year + TM_YEAR_BASE)];
- }
- for ( ; ; ) {
- i = mon_lengths[isleap(yourtm.tm_year +
- TM_YEAR_BASE)][yourtm.tm_mon];
- if (yourtm.tm_mday <= i)
- break;
- yourtm.tm_mday -= i;
- if (++yourtm.tm_mon >= MONSPERYEAR) {
- yourtm.tm_mon = 0;
- ++yourtm.tm_year;
- }
- }
- saved_seconds = yourtm.tm_sec;
- yourtm.tm_sec = 0;
- /*
- ** Calculate the number of magnitude bits in a time_t
- ** (this works regardless of whether time_t is
- ** signed or unsigned, though lint complains if unsigned).
- */
- for (bits = 0, t = 1; t > 0; ++bits, t <<= 1)
- ;
- /*
- ** If time_t is signed, then 0 is the median value,
- ** if time_t is unsigned, then 1 << bits is median.
- */
- t = (t < 0) ? 0 : ((time_t) 1 << bits);
- for ( ; ; ) {
- localsub(&t, offset, &mytm);
- dir = tmcomp(&mytm, &yourtm);
- if (dir != 0) {
- if (bits-- < 0)
- return NOTOK;
- if (bits < 0)
- --t;
- else if (dir > 0)
- t -= (time_t) 1 << bits;
- else t += (time_t) 1 << bits;
- continue;
- }
- if (yourtm.tm_isdst < 0 || mytm.tm_isdst == yourtm.tm_isdst)
- break;
- /*
- ** Right time, wrong type.
- ** Hunt for right time, right type.
- ** It's okay to guess wrong since the guess
- ** gets checked.
- */
- sp = lclptr;
- for (i = 0; i < sp->typecnt; ++i) {
- if (sp->ttis[i].tt_isdst != yourtm.tm_isdst)
- continue;
- for (j = 0; j < sp->typecnt; ++j) {
- if (sp->ttis[j].tt_isdst == yourtm.tm_isdst)
- continue;
- newt = t + sp->ttis[j].tt_gmtoff -
- sp->ttis[i].tt_gmtoff;
- localsub(&newt, offset, &mytm);
- if (tmcomp(&mytm, &yourtm) != 0)
- continue;
- if (mytm.tm_isdst != yourtm.tm_isdst)
- continue;
- /*
- ** We have a match.
- */
- t = newt;
- goto label;
- }
- }
- return NOTOK;
- }
-label:
- t += saved_seconds;
- localsub(&t, offset, tmp);
- *okayp = TRUE;
- return t;
-}
-
-static time_t time1(struct tm * tmp, long offset)
-{
- const struct state * sp;
- int samei, otheri, okay;
- time_t t;
-
- if (tmp->tm_isdst > 1)
- tmp->tm_isdst = 1;
- t = time2(tmp, offset, &okay);
- if (okay || tmp->tm_isdst < 0)
- return t;
- /*
- ** We're supposed to assume that somebody took a time of one type
- ** and did some math on it that yielded a "struct tm" that's bad.
- ** We try to divine the type they started from and adjust to the
- ** type they need.
- */
- sp = lclptr;
- for (samei = 0; samei < sp->typecnt; ++samei) {
- if (sp->ttis[samei].tt_isdst != tmp->tm_isdst)
- continue;
- for (otheri = 0; otheri < sp->typecnt; ++otheri) {
- if (sp->ttis[otheri].tt_isdst == tmp->tm_isdst)
- continue;
- tmp->tm_sec += sp->ttis[otheri].tt_gmtoff -
- sp->ttis[samei].tt_gmtoff;
- tmp->tm_isdst = !tmp->tm_isdst;
- t = time2(tmp, offset, &okay);
- if (okay)
- return t;
- tmp->tm_sec -= sp->ttis[otheri].tt_gmtoff -
- sp->ttis[samei].tt_gmtoff;
- tmp->tm_isdst = !tmp->tm_isdst;
- }
- }
- return NOTOK;
-}
-
-time_t mktime(struct tm * tmp)
-{
- time_t mktime_return_value;
-
- pthread_mutex_lock(&lcl_mutex);
- if (lcl_is_set == FALSE) {
- tzset_basic();
- }
- mktime_return_value = time1(tmp, 0L);
- pthread_mutex_unlock(&lcl_mutex);
- return(mktime_return_value);
-}
diff --git a/mit-pthreads/gen/difftime.c b/mit-pthreads/gen/difftime.c
deleted file mode 100644
index cddd896e04a..00000000000
--- a/mit-pthreads/gen/difftime.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)difftime.c 5.2 (Berkeley) 6/1/90";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/types.h>
-
-double
-difftime(time1, time0)
- time_t time1, time0;
-{
- return(time1 - time0);
-}
diff --git a/mit-pthreads/gen/directory.c b/mit-pthreads/gen/directory.c
deleted file mode 100644
index d189280fc1f..00000000000
--- a/mit-pthreads/gen/directory.c
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)closedir.c 5.9 (Berkeley) 2/23/91";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * One of these structures is malloced to describe the current directory
- * position each time telldir is called. It records the current magic
- * cookie returned by getdirentries and the offset within the buffer
- * associated with that return value.
- */
-struct ddloc {
- struct ddloc *loc_next;/* next structure in list */
- long loc_index; /* key associated with structure */
- long loc_seek; /* magic cookie returned by getdirentries */
- long loc_loc; /* offset of entry in buffer */
-};
-
-static long dd_loccnt = 0; /* Index of entry for sequential telldir's */
-
-#include <errno.h>
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
-
-
-/*
- * close a directory.
- */
-int closedir(DIR * dirp)
-{
- void *ptr, *nextptr;
- int fd;
-
- pthread_mutex_lock (dirp->dd_lock);
- fd = dirp->dd_fd;
- dirp->dd_fd = -1;
- dirp->dd_loc = 0;
- for (ptr = (void *)dirp->dd_ddloc; ptr; ptr = nextptr) {
- nextptr = (void *)(((struct ddloc *)ptr)->loc_next);
- free(ptr);
- }
- for (ptr = (void *)dirp->dd_dp; ptr; ptr = nextptr) {
- nextptr = (void *)(((struct __dirent *)ptr)->next);
- free(ptr);
- }
- free((void *)dirp->dd_buf);
- free (dirp->dd_lock);
- free((void *)dirp);
- return(machdep_sys_close(fd));
-}
-
-/*
- * open a directory.
- */
-DIR * opendir(const char * name)
-{
- DIR *dirp;
- int fd;
-
- if ((fd = machdep_sys_open(name, 0)) < 0)
- return NULL;
- if (machdep_sys_fcntl(fd, F_SETFD, 1) < 0 ||
- (dirp = (DIR *)malloc(sizeof(DIR))) == NULL) {
- machdep_sys_close (fd);
- return NULL;
- }
- dirp->dd_lock = (pthread_mutex_t*) malloc (sizeof (pthread_mutex_t));
- pthread_mutex_init (dirp->dd_lock, 0);
- /*
- * If CLSIZE is an exact multiple of DIRBLKSIZ, use a CLSIZE
- * buffer that it cluster boundary aligned.
- * Hopefully this can be a big win someday by allowing page trades
- * to user space to be done by getdirentries()
- */
-#ifndef CLSIZE
-#define CLSIZE 1
-#endif
- if ((CLSIZE % DIRBLKSIZ) == 0) {
- dirp->dd_buf = malloc(CLSIZE);
- dirp->dd_len = CLSIZE;
- } else {
- dirp->dd_buf = malloc(DIRBLKSIZ);
- dirp->dd_len = DIRBLKSIZ;
- }
- if (dirp->dd_buf == NULL) {
- machdep_sys_close (fd);
- free((void *)dirp);
- return NULL;
- }
-
- dirp->dd_ddloc = NULL;
- dirp->dd_dp = NULL;
- dirp->dd_seek = 0;
- dirp->dd_loc = 0;
- dirp->dd_fd = fd;
- return(dirp);
-}
-
-/*
- * The real work in gettint the next entry in a directory.
- * Return
- * NULL on End of directory
- * &ERR on Error
- * dp on valid directory;
- */
-static struct dirent ERR;
-static struct dirent * readdir_basic(DIR * dirp)
-{
- register struct dirent *dp;
-
- for (;;) {
- if (dirp->dd_loc == 0) {
- dirp->dd_size = machdep_sys_getdirentries(dirp->dd_fd,
- dirp->dd_buf, dirp->dd_len, &dirp->dd_seek);
- if (dirp->dd_size < 0)
- return(&ERR);
- if (dirp->dd_size == 0)
- return(NULL);
- }
- if (dirp->dd_loc >= dirp->dd_size) {
- dirp->dd_loc = 0;
- continue;
- }
- dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc);
- if ((long)dp & 03) /* bogus pointer check */
- return(&ERR);
- if (dp->d_reclen <= 0 ||
- dp->d_reclen > dirp->dd_len + 1 - dirp->dd_loc)
- return(&ERR);
- dirp->dd_loc += dp->d_reclen;
- if (dp->d_ino == 0)
- continue;
- return(dp);
- }
-}
-
-/*
- * POSIX.1 version of getting the next entry in a directory.
- */
-struct dirent * readdir(DIR * dirp)
-{
- register struct dirent * rp;
- struct __dirent * my__dp;
- pthread_t self;
-
- pthread_mutex_lock (dirp->dd_lock);
-
- self = pthread_self();
- /* Allocate space and return */
- for (my__dp = dirp->dd_dp; my__dp; my__dp = my__dp->next) {
- if (pthread_equal(my__dp->owner, self)) {
- break;
- }
- }
- if (my__dp == NULL) {
- if (my__dp = (struct __dirent *)(malloc(sizeof(struct __dirent)))) {
- my__dp->next = dirp->dd_dp;
- dirp->dd_dp = my__dp;
- my__dp->owner = self;
- } else {
- pthread_mutex_unlock (dirp->dd_lock);
- return(NULL);
- }
- }
- if (rp = readdir_basic(dirp)) {
- if (rp != &ERR) {
- memcpy(& (my__dp->data), rp, sizeof(struct dirent));
- rp = & (my__dp->data);
- } else {
- rp = NULL;
- }
- }
- pthread_mutex_unlock (dirp->dd_lock);
- return(rp);
-}
-
-/*
- * POSIX.4a version of getting the next entry in a directory.
- */
-int readdir_r(DIR * dirp, struct dirent * entry, struct dirent ** result)
-{
- register struct dirent * rp;
- int ret;
-
- pthread_mutex_lock (dirp->dd_lock);
- rp = readdir_basic(dirp);
- if (rp != &ERR) {
- if (rp) {
- memcpy(entry, rp, sizeof(struct dirent));
- *result = entry;
- ret = 0;
- } else {
- *result = NULL;
- ret = 0;
- }
- } else {
- /* Should get it from errno */
- ret = EBADF;
- }
- pthread_mutex_unlock (dirp->dd_lock);
- return(ret);
-}
-
-void rewinddir(DIR * dirp)
-{
- pthread_mutex_lock (dirp->dd_lock);
- (void)machdep_sys_lseek(dirp->dd_fd, 0, 0);
- dirp->dd_seek = 0;
- dirp->dd_loc = 0;
- pthread_mutex_unlock (dirp->dd_lock);
-}
-
-/*
- * Seek to an entry in a directory.
- * _seekdir is in telldir.c so that it can share opaque data structures.
- *
- * Use the POSIX reentrant safe readdir_r to simplify varifying POSIX
- * thread-safe compliance.
- */
-void seekdir(DIR * dirp, long loc)
-{
- register struct ddloc ** prevlp;
- register struct ddloc * lp;
- struct dirent * dp;
- struct dirent de;
-
- pthread_mutex_lock (dirp->dd_lock);
- prevlp = (struct ddloc **)&(dirp->dd_ddloc);
- lp = *prevlp;
- while (lp != NULL) {
- if (lp->loc_index == loc)
- break;
- prevlp = &lp->loc_next;
- lp = lp->loc_next;
- }
- if (lp) {
- if (lp->loc_seek != dirp->dd_seek) {
- if (machdep_sys_lseek(dirp->dd_fd, lp->loc_seek, 0) < 0) {
- *prevlp = lp->loc_next;
- pthread_mutex_unlock (dirp->dd_lock);
- return;
- }
- dirp->dd_seek = lp->loc_seek;
- dirp->dd_loc = 0;
- while (dirp->dd_loc < lp->loc_loc) {
- if (readdir_r(dirp, &de, &dp)) {
- *prevlp = lp->loc_next;
- break;
- }
- }
- }
- }
- pthread_mutex_unlock (dirp->dd_lock);
-}
-
-/*
- * return a pointer into a directory
- */
-long telldir(DIR *dirp)
-{
- struct ddloc *lp, **fakeout;
- int ret;
-
- pthread_mutex_lock (dirp->dd_lock);
- if (lp = (struct ddloc *)malloc(sizeof(struct ddloc))) {
- lp->loc_index = dd_loccnt++;
- lp->loc_seek = dirp->dd_seek;
- lp->loc_loc = dirp->dd_loc;
- lp->loc_next = dirp->dd_ddloc;
-
- /* Compiler won't let us change anything pointed to by db directly */
- /* So we fake to the left and do it anyway */
- /* Wonder if the compile optomizes it to the correct solution */
- fakeout = (struct ddloc **)&(dirp->dd_ddloc);
- *fakeout = lp;
-
- ret = lp->loc_index;
- } else {
- ret = -1;
- }
- pthread_mutex_unlock (dirp->dd_lock);
- return(ret);
-}
-
diff --git a/mit-pthreads/gen/eprintf.c b/mit-pthreads/gen/eprintf.c
deleted file mode 100644
index bcc65757bd4..00000000000
--- a/mit-pthreads/gen/eprintf.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* This function is a replacement for the version in libgcc.a. This
- is needed because typically libgcc.a won't have been compiled
- against the threads library, so its references to "stderr" will
- come out wrong. */
-
-#include <stdio.h>
-
-void __eprintf (const char *fmt, const char *expr, int line, const char *file)
-{
- /* Considering the very special circumstances where this function
- would be called, perhaps we might want to disable the thread
- scheduler and break any existing locks on stderr? Well, maybe if
- we could be sure that stderr was in a useable state... */
- fprintf (stderr, fmt, expr, line, file);
- fflush (stderr);
-
- abort ();
-}
diff --git a/mit-pthreads/gen/getcwd.c b/mit-pthreads/gen/getcwd.c
deleted file mode 100644
index 9c1b089f26e..00000000000
--- a/mit-pthreads/gen/getcwd.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright (c) 1989, 1991 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getcwd.c 5.11 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <dirent.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define ISDOT(dp) \
- (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \
- dp->d_name[1] == '.' && dp->d_name[2] == '\0'))
-
-
-/* Only use reentrant safe routines to simplify varifying POSIX thread-safe
- * compliance. (mevans).
- */
-
-char *
-getcwd(pt, size)
- char *pt;
- size_t size;
-{
- register DIR *dir;
- register dev_t dev;
- register ino_t ino;
- register int first;
- register char *bpt, *bup;
- struct stat s;
- struct dirent *dp;
- struct dirent de;
- dev_t root_dev;
- ino_t root_ino;
- size_t ptsize, upsize;
- int save_errno;
- char *ept, *eup, *up;
- int namelen;
-
- /*
- * If no buffer specified by the user, allocate one as necessary.
- * If a buffer is specified, the size has to be non-zero. The path
- * is built from the end of the buffer backwards.
- */
- if (pt) {
- ptsize = 0;
- if (!size) {
- errno = EINVAL;
- return((char *)NULL);
- }
- ept = pt + size;
- } else {
- if (!(pt = (char *)malloc(ptsize = 1024 - 4)))
- return((char *)NULL);
- ept = pt + ptsize;
- }
- bpt = ept - 1;
- *bpt = '\0';
-
- /*
- * Allocate bytes (1024 - malloc space) for the string of "../"'s.
- * Should always be enough (it's 340 levels). If it's not, allocate
- * as necessary. Special * case the first stat, it's ".", not "..".
- */
- if (!(up = (char *)malloc(upsize = 1024 - 4)))
- goto err;
- eup = up + MAXPATHLEN;
- bup = up;
- up[0] = '.';
- up[1] = '\0';
-
- /* Save root values, so know when to stop. */
- if (stat("/", &s))
- goto err;
- root_dev = s.st_dev;
- root_ino = s.st_ino;
-
- SET_ERRNO(0);
-
- for (first = 1;; first = 0) {
- /* Stat the current level. */
- if (lstat(up, &s))
- goto err;
-
- /* Save current node values. */
- ino = s.st_ino;
- dev = s.st_dev;
-
- /* Check for reaching root. */
- if (root_dev == dev && root_ino == ino) {
- *--bpt = '/';
- /*
- * It's unclear that it's a requirement to copy the
- * path to the beginning of the buffer, but it's always
- * been that way and stuff would probably break.
- */
- /* XXX was bcopy */
- (void)memcpy(pt, bpt, ept - bpt);
- free(up);
- return(pt);
- }
-
- /*
- * Build pointer to the parent directory, allocating memory
- * as necessary. Max length is 3 for "../", the largest
- * possible component name, plus a trailing NULL.
- */
- if (bup + 3 + MAXNAMLEN + 1 >= eup) {
- if (!(up = (char *)realloc(up, upsize *= 2)))
- goto err;
- eup = up + upsize;
- }
- *bup++ = '.';
- *bup++ = '.';
- *bup = '\0';
-
- /* Open and stat parent directory. */
- /* XXX opendir() returns kernel fd's instead of
- pthread fd's for some odd reason, so we must
- break the abstraction boundry here as well or
- fix everything in opendir et al. SNL */
- if (!(dir = opendir(up)) ||
- machdep_sys_fstat(dirfd(dir), &s))
- goto err;
-
- /* Add trailing slash for next directory. */
- *bup++ = '/';
-
- /*
- * If it's a mount point, have to stat each element because
- * the inode number in the directory is for the entry in the
- * parent directory, not the inode number of the mounted file.
- */
- save_errno = 0;
- if (s.st_dev == dev) {
- for (;;) {
- if (readdir_r(dir, &de, &dp))
- goto notfound;
- if (dp->d_fileno == ino)
- break;
- }
- } else
- for (;;) {
- if (readdir_r(dir, &de, &dp))
- goto notfound;
- if (ISDOT(dp))
- continue;
- memcpy(bup, dp->d_name, strlen(dp->d_name) + 1);
-
- /* Save the first error for later. */
- if (lstat(up, &s)) {
- if (!save_errno)
- save_errno = errno;
- SET_ERRNO(0);
- continue;
- }
- if (s.st_dev == dev && s.st_ino == ino)
- break;
- }
-
- /*
- * Check for length of the current name, preceding slash,
- * leading slash.
- */
- namelen = strlen(dp->d_name);
- if (bpt - pt <= namelen + (first ? 1 : 2)) {
- size_t len, off;
-
- if (!ptsize) {
- SET_ERRNO(ERANGE);
- goto err;
- }
- off = bpt - pt;
- len = ept - bpt;
- if (!(pt = (char *)realloc(pt, ptsize *= 2)))
- goto err;
- bpt = pt + off;
- ept = pt + ptsize;
- /* XXX was bcopy */
- (void)memcpy(ept - len, bpt, len);
- bpt = ept - len;
- }
- if (!first)
- *--bpt = '/';
- bpt -= namelen;
- memcpy(bpt, dp->d_name, namelen);
- (void)closedir(dir);
-
- /* Truncate any file name. */
- *bup = '\0';
- }
-
-notfound:
- /*
- * If readdir set errno, use it, not any saved error; otherwise,
- * didn't find the current directory in its parent directory, set
- * errno to ENOENT.
- */
- if (!errno) {
- if (!save_errno)
- save_errno = ENOENT;
- SET_ERRNO(save_errno);
- }
- /* FALLTHROUGH */
-err:
- if (ptsize)
- free(pt);
- free(up);
- return((char *)NULL);
-}
diff --git a/mit-pthreads/gen/getpwent.c b/mit-pthreads/gen/getpwent.c
deleted file mode 100644
index 7bcb2cbd610..00000000000
--- a/mit-pthreads/gen/getpwent.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 1984 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getpwent.c 5.2 (Berkeley) 3/9/86";
-#endif
-
-#include <pthread.h>
-#include <stdio.h>
-#include <pwd.h>
-#include "pwd_internal.h"
-
-void
-setpwent()
-{
- pwf_context_t *_data;
-
- _data = _pw_get_data();
-
- if (_data) {
- if (_data->pwf == NULL)
- _data->pwf = fopen(_data->pw_file, "r");
- else
- rewind(_data->pwf);
- }
-}
-
-void
-endpwent()
-{
- pwf_context_t *_data;
-
- _data = _pw_get_data();
-
- if (_data) {
- if (_data->pwf != NULL) {
- fclose(_data->pwf);
- _data->pwf = NULL;
- }
-#ifdef DBM_PWD_SUPPORT
- if (_data->pw_db != (DBM *)0) {
- dbm_close(_data->pw_db);
- _data->pw_db = (DBM *)0;
- _data->pw_stayopen = 0;
- }
-#endif /* DBM_PWD_SUPPORT */
- }
-}
-
-static char *
-pwskip(p)
- char *p;
-{
- while (*p && *p != ':' && *p != '\n')
- ++p;
- if (*p)
- *p++ = 0;
- return(p);
-}
-
-struct passwd *
-getpwent()
-{
- pwf_context_t *_data;
- char *p;
-
- _data = _pw_get_data();
- if (!_data)
- return 0;
-
- if (_data->pwf == NULL) {
- if ((_data->pwf = fopen(_data->pw_file, "r" )) == NULL)
- return(0);
- }
- p = fgets(_data->line, BUFSIZ, _data->pwf);
- if (p == NULL)
- return(0);
- _data->passwd.pw_name = p;
- p = pwskip(p);
- _data->passwd.pw_passwd = p;
- p = pwskip(p);
- _data->passwd.pw_uid = atoi(p);
- p = pwskip(p);
- _data->passwd.pw_gid = atoi(p);
- p = pwskip(p);
- _data->passwd.pw_gecos = p;
- p = pwskip(p);
- _data->passwd.pw_dir = p;
- p = pwskip(p);
- _data->passwd.pw_shell = p;
- while (*p && *p != '\n')
- p++;
- *p = '\0';
- return(&_data->passwd);
-}
-
-void
-setpwfile(file)
- char *file;
-{
- pwf_context_t *_data;
-
- _data = _pw_get_data();
- if (_data)
- _data->pw_file = file;
-}
diff --git a/mit-pthreads/gen/getpwnamuid.c b/mit-pthreads/gen/getpwnamuid.c
deleted file mode 100644
index 0e87081b7a9..00000000000
--- a/mit-pthreads/gen/getpwnamuid.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getpwnamuid.c 5.3 (Berkeley) 12/21/87";
-#endif
-
-#include <stdio.h>
-#include <pwd.h>
-#include <sys/file.h>
-#include "pwd_internal.h"
-
-/*
- * The following are shared with getpwent.c
- */
-
-#ifdef DBM_PWD_SUPPORT
-static struct passwd *
-fetchpw(key)
- datum key;
-{
- char *cp, *tp;
- pwf_context_t *_data;
-
- _data = _pw_get_data();
- if (!_data)
- return 0;
- if (key.dptr == 0)
- return ((struct passwd *)NULL);
- key = dbm_fetch(_data->pw_db, key);
- if (key.dptr == 0)
- return ((struct passwd *)NULL);
- cp = key.dptr;
- tp = _data->line;
-
-#define EXPAND(e) _data->passwd.e = tp; while (*tp++ = *cp++);
- EXPAND(pw_name);
- EXPAND(pw_passwd);
- memcpy((char *)&_data->passwd.pw_uid, cp, sizeof (int));
- cp += sizeof (int);
- memcpy((char *)&_data->passwd.pw_gid, cp, sizeof (int));
- cp += sizeof (int);
- EXPAND(pw_gecos);
- EXPAND(pw_dir);
- EXPAND(pw_shell);
- return (&_data->passwd);
-}
-#endif /* DBM_PWD_SUPPORT */
-
-struct passwd *
-getpwnam(nam)
- const char *nam;
-{
-#ifdef DBM_PWD_SUPPORT
- datum key;
-#endif
- struct passwd *pw, *getpwent();
- pwf_context_t *_data;
-
- _data = _pw_get_data();
- if (!_data)
- return 0;
-
-#ifdef DBM_PWD_SUPPORT
- if (_data->pw_db == (DBM *)0 &&
- (_data->pw_db = dbm_open(_data->pw_file, O_RDONLY)) == (DBM *)0) {
- oldcode:
-#endif
- setpwent();
- while ((pw = getpwent()) && strcmp(nam, pw->pw_name))
- ;
- if (!_data->pw_stayopen)
- endpwent();
- return (pw);
-#ifdef DBM_PWD_SUPPORT
- }
- if (flock(dbm_dirfno(_data->pw_db), LOCK_SH) < 0) {
- dbm_close(_data->pw_db);
- _data->pw_db = (DBM *)0;
- goto oldcode;
- }
- key.dptr = nam;
- key.dsize = strlen(nam);
- pw = fetchpw(key);
- (void) flock(dbm_dirfno(_data->pw_db), LOCK_UN);
- if (!_data->pw_stayopen) {
- dbm_close(_data->pw_db);
- _data->pw_db = (DBM *)0;
- }
- return (pw);
-#endif
-}
-
-struct passwd *
-getpwuid(uid)
- uid_t uid;
-{
-#ifdef DBM_PWD_SUPPORT
- datum key;
-#endif
- struct passwd *pw, *getpwent();
- pwf_context_t *_data;
-
- _data = _pw_get_data();
- if (!_data)
- return 0;
-#ifdef DBM_PWD_SUPPORT
- if (_data->pw_db == (DBM *)0 &&
- (_data->pw_db = dbm_open(_data->pw_file, O_RDONLY)) == (DBM *)0) {
- oldcode:
-#endif
- setpwent();
- while ((pw = getpwent()) && pw->pw_uid != uid)
- ;
- if (!_data->pw_stayopen)
- endpwent();
- return (pw);
-#ifdef DBM_PWD_SUPPORT
- }
- if (flock(dbm_dirfno(_data->pw_db), LOCK_SH) < 0) {
- dbm_close(_data->pw_db);
- _data->pw_db = (DBM *)0;
- goto oldcode;
- }
- key.dptr = (char *) &uid;
- key.dsize = sizeof uid;
- pw = fetchpw(key);
- (void) flock(dbm_dirfno(_data->pw_db), LOCK_UN);
- if (!_data->pw_stayopen) {
- dbm_close(_data->pw_db);
- _data->pw_db = (DBM *)0;
- }
- return (pw);
-#endif
-}
diff --git a/mit-pthreads/gen/getwd.c b/mit-pthreads/gen/getwd.c
deleted file mode 100644
index 7fdceda0f45..00000000000
--- a/mit-pthreads/gen/getwd.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getwd.c 5.1 (Berkeley) 2/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/param.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-char *
-getwd(buf)
- char *buf;
-{
- char *p;
- char *strerror();
-
- if (p = getcwd(buf, MAXPATHLEN))
- return(p);
- (void)strcpy(buf, strerror(errno));
- return((char *)NULL);
-}
diff --git a/mit-pthreads/gen/isatty.c b/mit-pthreads/gen/isatty.c
deleted file mode 100644
index a22f13015d9..00000000000
--- a/mit-pthreads/gen/isatty.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 1988 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)isatty.c 5.6 (Berkeley) 2/23/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#ifdef sunos4
-#include <sys/termio.h>
-#else
-#include <termios.h>
-#endif
-#include <unistd.h>
-
-/*
- * If TIOCGETA is not defined try TCGETATTR
- * If TCGETATTR is not defined try TCGETA
- * If that doesn't work try getting it from termio.h
- */
-#ifndef TIOCGETA
-#ifdef TCGETATTR
-#define TIOCGETA TCGETATTR
-#else
-#ifndef TCGETA
-#include <termio.h>
-#endif
-#ifndef TIOCGETA
-#define TIOCGETA TCGETA
-#endif
-#endif
-#endif
-
-/* fd is the real fd to pass to the kernel */
-int isatty_basic(int fd)
-{
-#ifdef sunos4
- struct termio t;
-#else /* !sunos4 */
- struct termios t;
-#endif /* sunos4 */
- return (machdep_sys_ioctl(fd,
-#ifdef sunos4
- TCGETA,
-#else /* !sunos4 */
- TIOCGETA,
-#endif /* sunos4 */
- &t) ? 0 : 1);
-}
-
-int isatty(int fd)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
- ret = isatty_basic(fd_table[fd]->fd.i);
- fd_unlock(fd, FD_READ);
- } else {
- /* Return 0 or 1 */
- ret = 0;
- }
- return(ret);
-}
-
diff --git a/mit-pthreads/gen/popen.c b/mit-pthreads/gen/popen.c
deleted file mode 100644
index c15fbdce1fe..00000000000
--- a/mit-pthreads/gen/popen.c
+++ /dev/null
@@ -1,117 +0,0 @@
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-static pid_t *pids = NULL;
-static int pids_size = 0;
-static int pids_top = 0;
-static pthread_mutex_t pids_lock = PTHREAD_MUTEX_INITIALIZER;
-
-FILE *popen(const char *cmd, const char *mode)
-{
- int fds[2], parent_fd, child_fd, child_target, new_size, i;
- pid_t pid, *new_pids;
-
- /* Verify the mode. */
- if ((*mode != 'r' && *mode != 'w') || mode[1] != 0)
- return NULL;
-
- /* Generate fds, and choose the parent and child fds. */
- if (pipe(fds) < 0)
- return NULL;
- parent_fd = (*mode == 'r') ? fds[0] : fds[1];
- child_fd = (*mode == 'r') ? fds[1] : fds[0];
-
- /* Ensure that there is space in the pid table. */
- pthread_mutex_lock(&pids_lock);
- if (pids_size <= parent_fd) {
- new_size = parent_fd + 1;
- if ((new_pids = malloc(new_size * sizeof(pid_t))) == NULL) {
- pthread_mutex_unlock(&pids_lock);
- close(parent_fd);
- close(child_fd);
- return NULL;
- }
- if (pids) {
- memcpy(new_pids, pids, pids_size * sizeof(pid_t));
- free(pids);
- }
- while (pids_size < new_size)
- new_pids[pids_size++] = -1;
- pids = new_pids;
- }
- pthread_mutex_unlock(&pids_lock);
-
- /* Fork off a child process. */
- switch (pid = fork()) {
- case -1: /* Failed to fork. */
- close(parent_fd);
- close(child_fd);
- return NULL;
- break;
- case 0: /* Child */
- /*
- * Set the child fd to stdout or stdin as appropriate,
- * and close the parent fd.
- */
- child_target = (*mode == 'r') ? STDOUT_FILENO : STDIN_FILENO;
- if (child_fd != child_target) {
- dup2(child_fd, child_target);
- close(child_fd);
- }
- close(parent_fd);
-
- /* Close all parent fds from previous popens(). */
- for (i = 0; i < pids_top; i++) {
- if (pids[i] != -1)
- close(i);
- }
-
- execl("/bin/sh", "sh", "-c", cmd, NULL);
- exit(1);
- default:
- break;
- }
-
- /* Record the parent fd in the pids table. */
- pthread_mutex_lock(&pids_lock);
- pids[parent_fd] = pid;
- if (pids_top < parent_fd + 1)
- pids_top = parent_fd + 1;
- pthread_mutex_unlock(&pids_lock);
-
- /* Close the child fd and return a stdio buffer for the parent fd. */
- close(child_fd);
- return fdopen(parent_fd, mode);
-}
-
-int pclose(fp)
- FILE *fp;
-{
- pid_t pid, result;
- int fd, pstat;
-
- fd = fileno(fp);
- pthread_mutex_lock(&pids_lock);
- /* Make sure this is a popened file. */
- if ((pids_top <= fd) || ((pid = pids[fd]) == -1)) {
- pthread_mutex_unlock(&pids_lock);
- return -1;
- }
- pids[fd] = -1;
- while (pids_top > 0 && pids[pids_top - 1] == -1)
- pids_top--;
- pthread_mutex_unlock(&pids_lock);
-
- fclose(fp);
-
- /* Wait for the subprocess to quit. */
- return (((result = waitpid(pid, &pstat, 0)) == -1) ? -1 : pstat);
-}
-
diff --git a/mit-pthreads/gen/pwd_internal.c b/mit-pthreads/gen/pwd_internal.c
deleted file mode 100644
index b0ebc27b5c6..00000000000
--- a/mit-pthreads/gen/pwd_internal.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ==== pwd_internal.c ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Thread-safe password hacking functions.
- *
- * 1.00 95/02/08 snl
- * -Started coding this file.
- */
-
-#include <pthread.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <pwd.h>
-#include <unistd.h>
-#include "pwd_internal.h"
-
-static pthread_once_t __pw_init = PTHREAD_ONCE_INIT;
-static pthread_key_t __pw_key;
-
-void
-_pw_null_cleanup(void *junkola)
-{
- pwf_context_t *x = (pwf_context_t *)junkola;
-
- if (x) {
- if (x->pwf) {
- fclose(x->pwf);
- x->pwf = 0;
- }
-#ifdef DBM_PWD_SUPPORT
- if (x->pw_db) {
- dbm_close(x->pw_db);
- x->pw_db = 0;
- }
-#endif /* DBM_PWD_SUPPORT */
- free((void *)x);
- }
-}
-
-void
-_pw_create_key()
-{
- if (pthread_key_create(&__pw_key, _pw_null_cleanup)) {
- PANIC();
- }
-}
-
-pwf_context_t *
-_pw_get_data()
-{
- pwf_context_t *_data;
-
- pthread_once(&__pw_init, _pw_create_key);
- _data = (pwf_context_t *)pthread_getspecific(__pw_key);
- if (!_data) {
- _data = (pwf_context_t *)malloc(sizeof(pwf_context_t));
- if (_data) {
- _data->pwf = 0;
- _data->line[0] = '\0';
- _data->pw_stayopen = 0;
- _data->pw_file = "/etc/passwd";
-#ifdef DBM_PWD_SUPPORT
- _data->pw_db = 0;
-#endif /* DBM_PWD_SUPPORT */
- pthread_setspecific(__pw_key, (void *)_data);
- }
- }
- return _data;
-}
diff --git a/mit-pthreads/gen/pwd_internal.h b/mit-pthreads/gen/pwd_internal.h
deleted file mode 100644
index 10fdab6cc4e..00000000000
--- a/mit-pthreads/gen/pwd_internal.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef _PWD_INTERNAL_H_
-#define _PWD_INTERNAL_H_
-
-#if 0 /* Turn this off for now until we suck in ndbm or use gdbm -- SNL */
-#ifndef DBM_PWD_SUPPORT
-#if !defined(__alpha) && !defined(linux) && !defined(hpux)
-#define DBM_PWD_SUPPORT 1
-#endif /* !alpha && !linux && !hpux */
-#endif /* !DBM_PWD_SUPPORT */
-#endif
-
-#ifdef DBM_PWD_SUPPORT
-#include <ndbm.h>
-#endif /* DBM_PWD_SUPPORT */
-
-typedef struct pwf_context {
- FILE *pwf;
- char line[BUFSIZ+1];
- struct passwd passwd;
- int pw_stayopen;
- char *pw_file;
-#ifdef DBM_PWD_SUPPORT
- DBM *pw_db;
-#endif /* DBM_PWD_SUPPORT */
-} pwf_context_t;
-
-pwf_context_t *_pw_get_data __P_((void));
-
-#endif /* _PWD_INTERNAL_H_ */
diff --git a/mit-pthreads/gen/syslog.c b/mit-pthreads/gen/syslog.c
deleted file mode 100644
index e49795ecb69..00000000000
--- a/mit-pthreads/gen/syslog.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (c) 1983, 1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that this notice is preserved and that due credit is given
- * to the University of California at Berkeley. The name of the University
- * may not be used to endorse or promote products derived from this
- * software without specific prior written permission. This software
- * is provided ``as is'' without express or implied warranty.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)syslog.c 5.14 (Berkeley) 5/20/88";
-#endif /* LIBC_SCCS and not lint */
-
-
-/*
- * SYSLOG -- print message on log file
- *
- * This routine looks a lot like printf, except that it
- * outputs to the log file instead of the standard output.
- * Also:
- * adds a timestamp,
- * prints the module name in front of the message,
- * has some other formatting types (or will sometime),
- * adds a newline on the end of the message.
- *
- * The output of this routine is intended to be read by /etc/syslogd.
- *
- * Author: Eric Allman
- * Modified to use UNIX domain IPC by Ralph Campbell
- * Modified for pthreads and made more POSIX-compliant by Greg Hudson
- */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <unistd.h>
-#include <errno.h>
-#include <syslog.h>
-
-int socket();
-char *strerror(int); /* For systems that don't prototype it */
-
-#define MAXLINE 1024 /* max message size */
-
-#define PRIFAC(p) (((p) & LOG_FACMASK) >> 3)
- /* XXX should be in <syslog.h> */
-#define IMPORTANT LOG_ERR
-
-static void basic_init(void);
-
-static char _log_name[] = "/dev/log";
-static char ctty[] = "/dev/console";
-
-static int LogFile = -1; /* fd for log */
-static int LogStat = 0; /* status bits, set by openlog() */
-static char *LogTag = "syslog"; /* string to tag the entry with */
-static int LogMask = 0xff; /* mask of priorities to be logged */
-static int LogFacility = LOG_USER; /* default facility code */
-
-static pthread_mutex_t basic_init_lock = PTHREAD_MUTEX_INITIALIZER;
-
-static struct sockaddr SyslogAddr; /* AF_UNIX address of local logger */
-
-static void basic_init()
-{
- pthread_mutex_lock(&basic_init_lock);
- if (LogFile < 0)
- openlog(LogTag, LogStat | LOG_NDELAY, 0);
- pthread_mutex_unlock(&basic_init_lock);
-}
-
-void syslog(int pri, char *fmt, ...)
-{
- va_list args;
-
- va_start(args, fmt);
- vsyslog(pri, fmt, args);
- va_end(args);
-}
-
-void vsyslog(int pri, char *fmt, va_list args)
-{
- char buf[MAXLINE + 1], outline[MAXLINE + 1];
- register char *b, *f, *o;
- register int c;
- time_t now;
- int olderrno = errno, fd;
-
- /* Do a basic initialization if user didn't call openlog(). */
- if (LogFile < 0)
- basic_init();
-
- /* see if we should just throw out this message */
- if ((unsigned) PRIFAC(pri) >= LOG_NFACILITIES ||
- (LOG_MASK(pri & LOG_PRIMASK) & LogMask) == 0 ||
- (pri &~ (LOG_PRIMASK|LOG_FACMASK)) != 0)
- return;
-
- /* set default facility if none specified */
- if ((pri & LOG_FACMASK) == 0)
- pri |= LogFacility;
-
- /* build the message */
- o = outline;
- (void)sprintf(o, "<%d>", pri);
- o += strlen(o);
- time(&now);
- (void)sprintf(o, "%.15s ", ctime(&now) + 4);
- o += strlen(o);
- if (LogTag) {
- strcpy(o, LogTag);
- o += strlen(o);
- }
- if (LogStat & LOG_PID) {
- (void)sprintf(o, "[%d]", getpid());
- o += strlen(o);
- }
- if (LogTag) {
- strcpy(o, ": ");
- o += 2;
- }
-
- b = buf;
- f = fmt;
- while ((c = *f++) != '\0' && c != '\n' && b < &buf[MAXLINE]) {
- char *strerror();
-
- if (c != '%') {
- *b++ = c;
- continue;
- }
- if ((c = *f++) != 'm') {
- *b++ = '%';
- *b++ = c;
- continue;
- }
- strcpy(b, strerror(olderrno));
- b += strlen(b);
- }
- *b++ = '\n';
- *b = '\0';
- vsprintf(o, buf, args);
- c = strlen(outline);
- if (c > MAXLINE)
- c = MAXLINE;
-
- /* output the message to the local logger */
- if (sendto(LogFile, outline, c, 0, &SyslogAddr, sizeof SyslogAddr) >= 0)
- return;
- if (!(LogStat & LOG_CONS))
- return;
-
- /* output the message to the console */
- fd = open(ctty, O_WRONLY);
- alarm(0);
- strcat(o, "\r");
- o = strchr(outline, '>') + 1;
- write(fd, o, c + 1 - (o - outline));
- close(fd);
-}
-
-/*
- * OPENLOG -- open system log
- */
-
-void openlog(char *ident, int logstat, int logfac)
-{
- int flags;
-
- if (ident != NULL)
- LogTag = ident;
- LogStat = logstat;
- if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0)
- LogFacility = logfac;
- if (LogFile >= 0)
- return;
- SyslogAddr.sa_family = AF_UNIX;
- strncpy(SyslogAddr.sa_data, _log_name, sizeof SyslogAddr.sa_data);
- if (LogStat & LOG_NDELAY) {
- LogFile = socket(AF_UNIX, SOCK_DGRAM, 0);
- flags = fcntl(LogFile, F_GETFD);
- fcntl(LogFile, F_SETFD, flags & O_NONBLOCK);
- }
-}
-
-/*
- * CLOSELOG -- close the system log
- */
-
-void closelog()
-{
- (void) close(LogFile);
- LogFile = -1;
-}
-
-/*
- * SETLOGMASK -- set the log mask level
- */
-int setlogmask(int pmask)
-{
- int omask;
-
- omask = LogMask;
- if (pmask != 0)
- LogMask = pmask;
- return (omask);
-}
diff --git a/mit-pthreads/gen/time.c b/mit-pthreads/gen/time.c
deleted file mode 100644
index 82eec7edc1e..00000000000
--- a/mit-pthreads/gen/time.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)time.c 5.6 (Berkeley) 6/1/90";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/time.h>
-
-time_t time(time_t * t)
-{
- struct timeval tt;
-
- if (gettimeofday(&tt, (struct timezone *)0) < 0)
- return(-1);
- if (t)
- *t = tt.tv_sec;
- return(tt.tv_sec);
-}
diff --git a/mit-pthreads/gen/ttyname.c b/mit-pthreads/gen/ttyname.c
deleted file mode 100644
index b7a04485f79..00000000000
--- a/mit-pthreads/gen/ttyname.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 1988 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)ttyname.c 5.10 (Berkeley) 5/6/91";
-#endif /* LIBC_SCCS and not lint */
-
-#include "config.h"
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-
-static pthread_mutex_t ttyname_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_key_t ttyname_key;
-static int ttyname_init = 0;
-extern void free();
-
-char * __ttyname_r_basic(int fd, char * buf, size_t len)
-{
- register struct dirent *dirp;
- register DIR *dp;
- struct stat dsb;
- struct stat sb;
- char * rval;
- int minlen;
-
- rval = NULL;
-
- /* Must be a terminal. */
- if (! isatty_basic(fd))
- return(rval);
- /* Must be a character device. */
- if (machdep_sys_fstat(fd, &sb) || !S_ISCHR(sb.st_mode))
- return(rval);
- /* Must have enough room */
- if (len <= sizeof(_PATH_PTY))
- return(rval);
-
- if ((dp = opendir(_PATH_PTY)) != NULL) {
- memcpy(buf, _PATH_PTY, sizeof(_PATH_PTY));
- for (rval = NULL; dirp = readdir(dp);) {
- if (dirp->d_fileno != sb.st_ino)
- continue;
- minlen = (len - (sizeof(_PATH_PTY) - 1)) < (dirp->d_namlen + 1) ?
- (len - (sizeof(_PATH_PTY) - 1)) : (dirp->d_namlen + 1);
- memcpy (buf + sizeof(_PATH_PTY) - 1, dirp->d_name, minlen);
- if (stat(buf, &dsb) || sb.st_dev != dsb.st_dev ||
- sb.st_ino != dsb.st_ino)
- continue;
- rval = buf;
- break;
- }
- (void)closedir(dp);
- }
- return(rval);
-}
-
-char * __ttyname_basic(int fd)
-{
- char *buf;
-
- pthread_mutex_lock (&ttyname_lock);
- if (ttyname_init == 0) {
- if (pthread_key_create(&ttyname_key, free)) {
- pthread_mutex_unlock (&ttyname_lock);
- return(NULL);
- }
- ttyname_init = 1;
- }
- pthread_mutex_unlock (&ttyname_lock);
-
- /* Must have thread specific data field to put data */
- if ((buf = pthread_getspecific(ttyname_key)) == NULL) {
- if (buf = malloc(sizeof(_PATH_PTY) + MAXNAMLEN)) {
- if (pthread_setspecific(ttyname_key, buf) != OK) {
- free(buf);
- return(NULL);
- }
- } else {
- return(NULL);
- }
- }
- return(__ttyname_r_basic(fd, buf, sizeof(_PATH_PTY) + MAXNAMLEN));
-}
-
-char * ttyname_r(int fd, char * buf, size_t len)
-{
- char * ret;
-
- if (fd_lock(fd, FD_READ) == OK) {
- ret = __ttyname_r_basic(fd_table[fd]->fd.i, buf, len);
- fd_unlock(fd, FD_READ);
- } else {
- ret = NULL;
- }
- return(ret);
-}
-
-char * ttyname(int fd)
-{
- char * ret;
-
- if (fd_lock(fd, FD_READ) == OK) {
- ret = __ttyname_basic(fd_table[fd]->fd.i);
- fd_unlock(fd, FD_READ);
- } else {
- ret = NULL;
- }
- return(ret);
-}
-
-
diff --git a/mit-pthreads/include/Makefile.inc b/mit-pthreads/include/Makefile.inc
deleted file mode 100644
index b7fe59d5f0d..00000000000
--- a/mit-pthreads/include/Makefile.inc
+++ /dev/null
@@ -1,30 +0,0 @@
-# from: @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91
-
-# Doing a make install builds /usr/include/pthread
-#
-# The ``rm -rf''s used below are safe because rm doesn't follow symbolic
-# links.
-
-
-FILES= cond.h copyright.h fd.h fd_pipe.h kernel.h mutex.h posix.h \
- pthread.h pthread_attr.h queue.h util.h
-
-# Machine dependent header file
-MFILE= ${.CURDIR}/arch/${MACHINE}/machdep.h
-
-realinstall:
- if [ ! -d ${DESTDIR}/usr/include/pthread ]; then \
- mkdir ${DESTDIR}/usr/include/pthread; \
- fi
- @echo installing ${FILES}
- @-for i in ${FILES}; do \
- cmp -s $$i ${DESTDIR}/usr/include/pthread/$$i || \
- install -c -m 644 $$i ${DESTDIR}/usr/include/$$i; \
- done
- cmp -s ${MFILE} ${DESTDIR}/usr/include/pthread/machdep.h || \
- install -c -m 644 ${MFILE} ${DESTDIR}/usr/include/pthread/machdep.h
- rm -rf ${DESTDIR}/usr/include/pthread.h
- ln -s /usr/include/pthread/pthread.h ${DESTDIR}/usr/include/pthread.h
- @chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include/pthread
- @chmod -R a-w ${DESTDIR}/usr/include/pthread
-
diff --git a/mit-pthreads/include/arpa/inet.h b/mit-pthreads/include/arpa/inet.h
deleted file mode 100755
index d6ad76f4eb5..00000000000
--- a/mit-pthreads/include/arpa/inet.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 1983, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)inet.h 5.7 (Berkeley) 4/3/91
- * $Id$
- */
-
-#ifndef _INET_H_
-#define _INET_H_
-
-/* External definitions for functions in inet(3) */
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <pthread/types.h>
-
-__BEGIN_DECLS
-
-pthread_ipaddr_type inet_addr __P_((const char *));
-int inet_aton __P_((const char *, struct in_addr *));
-pthread_ipaddr_type inet_lnaof __P_((struct in_addr));
-struct in_addr inet_makeaddr __P_((pthread_ipaddr_type,
- pthread_ipaddr_type));
-pthread_ipaddr_type inet_netof __P_((struct in_addr));
-pthread_ipaddr_type inet_network __P_((const char *));
-char * inet_ntoa __P_((struct in_addr));
-char * inet_ntoa_r __P_((struct in_addr in, char *buf,
- int bufsize));
-
-__END_DECLS
-
-#endif /* !_INET_H_ */
diff --git a/mit-pthreads/include/arpa/nameser.h b/mit-pthreads/include/arpa/nameser.h
deleted file mode 100755
index 350d67538bd..00000000000
--- a/mit-pthreads/include/arpa/nameser.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Copyright (c) 1983, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)nameser.h 8.2 (Berkeley) 2/16/94
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#ifndef _NAMESER_H_
-#define _NAMESER_H_
-
-#include <endian.h>
-#include <sys/types.h>
-#include <pthread/types.h>
-
-/*
- * Define constants based on rfc883
- */
-#define PACKETSZ 512 /* maximum packet size */
-#define MAXDNAME 256 /* maximum domain name */
-#define MAXCDNAME 255 /* maximum compressed domain name */
-#define MAXLABEL 63 /* maximum length of domain label */
- /* Number of bytes of fixed size data in query structure */
-#define QFIXEDSZ 4
- /* number of bytes of fixed size data in resource record */
-#define RRFIXEDSZ 10
-
-/*
- * Internet nameserver port number
- */
-#define NAMESERVER_PORT 53
-
-/*
- * Currently defined opcodes
- */
-#define QUERY 0x0 /* standard query */
-#define IQUERY 0x1 /* inverse query */
-#define STATUS 0x2 /* nameserver status query */
-/*#define xxx 0x3*/ /* 0x3 reserved */
- /* non standard - supports ALLOW_UPDATES stuff from Mike Schwartz */
-#define UPDATEA 0x9 /* add resource record */
-#define UPDATED 0xa /* delete a specific resource record */
-#define UPDATEDA 0xb /* delete all named resource record */
-#define UPDATEM 0xc /* modify a specific resource record */
-#define UPDATEMA 0xd /* modify all named resource record */
-
-#define ZONEINIT 0xe /* initial zone transfer */
-#define ZONEREF 0xf /* incremental zone referesh */
-
-/*
- * Currently defined response codes
- */
-#define NOERROR 0 /* no error */
-#define FORMERR 1 /* format error */
-#define SERVFAIL 2 /* server failure */
-#define NXDOMAIN 3 /* non existent domain */
-#define NOTIMP 4 /* not implemented */
-#define REFUSED 5 /* query refused */
- /* non standard */
-#define NOCHANGE 0xf /* update failed to change db */
-
-/*
- * Type values for resources and queries
- */
-#define T_A 1 /* host address */
-#define T_NS 2 /* authoritative server */
-#define T_MD 3 /* mail destination */
-#define T_MF 4 /* mail forwarder */
-#define T_CNAME 5 /* connonical name */
-#define T_SOA 6 /* start of authority zone */
-#define T_MB 7 /* mailbox domain name */
-#define T_MG 8 /* mail group member */
-#define T_MR 9 /* mail rename name */
-#define T_NULL 10 /* null resource record */
-#define T_WKS 11 /* well known service */
-#define T_PTR 12 /* domain name pointer */
-#define T_HINFO 13 /* host information */
-#define T_MINFO 14 /* mailbox information */
-#define T_MX 15 /* mail routing information */
-#define T_TXT 16 /* text strings */
-#define T_RP 17 /* responsible person */
-#define T_AFSDB 18 /* AFS cell database */
-#define T_NSAP 22 /* NSAP address */
-#define T_NSAP_PTR 23 /* reverse lookup for NSAP */
- /* non standard */
-#define T_UINFO 100 /* user (finger) information */
-#define T_UID 101 /* user ID */
-#define T_GID 102 /* group ID */
-#define T_UNSPEC 103 /* Unspecified format (binary data) */
- /* Query type values which do not appear in resource records */
-#define T_AXFR 252 /* transfer zone of authority */
-#define T_MAILB 253 /* transfer mailbox records */
-#define T_MAILA 254 /* transfer mail agent records */
-#define T_ANY 255 /* wildcard match */
-
-/*
- * Values for class field
- */
-
-#define C_IN 1 /* the arpa internet */
-#define C_CHAOS 3 /* for chaos net (MIT) */
-#define C_HS 4 /* for Hesiod name server (MIT) (XXX) */
- /* Query class values which do not appear in resource records */
-#define C_ANY 255 /* wildcard match */
-
-/*
- * Status return codes for T_UNSPEC conversion routines
- */
-#define CONV_SUCCESS 0
-#define CONV_OVERFLOW -1
-#define CONV_BADFMT -2
-#define CONV_BADCKSUM -3
-#define CONV_BADBUFLEN -4
-
-#if !defined(BYTE_ORDER) || (BYTE_ORDER != BIG_ENDIAN \
- && BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != PDP_ENDIAN)
- /* you must determine what the correct bit order is for
- * your compiler - the next line is an intentional error
- * which will force your compiles to bomb until you fix
- * the above macros.
- */
- #error "Undefined or invalid BYTE_ORDER";
-#endif
-
-/*
- * Structure for query header. The order of the fields is machine- and
- * compiler-dependent, depending on the byte/bit order and the layout
- * of bit fields. We use bit fields only in int variables, as this
- * is all ANSI requires. This requires a somewhat confusing rearrangement.
- */
-
-typedef struct {
- pthread_ipport_type id; /* query identification number */
-#if BYTE_ORDER == BIG_ENDIAN
- /* fields in third byte */
- u_int qr:1; /* response flag */
- u_int opcode:4; /* purpose of message */
- u_int aa:1; /* authoritive answer */
- u_int tc:1; /* truncated message */
- u_int rd:1; /* recursion desired */
- /* fields in fourth byte */
- u_int ra:1; /* recursion available */
- u_int pr:1; /* primary server required (non standard) */
- u_int unused:2; /* unused bits */
- u_int rcode:4; /* response code */
-#endif
-#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
- /* fields in third byte */
- u_int rd:1; /* recursion desired */
- u_int tc:1; /* truncated message */
- u_int aa:1; /* authoritive answer */
- u_int opcode:4; /* purpose of message */
- u_int qr:1; /* response flag */
- /* fields in fourth byte */
- u_int rcode:4; /* response code */
- u_int unused:2; /* unused bits */
- u_int pr:1; /* primary server required (non standard) */
- u_int ra:1; /* recursion available */
-#endif
- /* remaining bytes */
- pthread_ipport_type qdcount; /* number of question entries */
- pthread_ipport_type ancount; /* number of answer entries */
- pthread_ipport_type nscount; /* number of authority entries */
- pthread_ipport_type arcount; /* number of resource entries */
-} HEADER;
-
-/*
- * Defines for handling compressed domain names
- */
-#define INDIR_MASK 0xc0
-
-/*
- * Structure for passing resource records around.
- */
-struct rrec {
- pthread_ipport_type r_zone; /* zone number */
- pthread_ipport_type r_class; /* class number */
- pthread_ipport_type r_type; /* type number */
- pthread_ipaddr_type r_ttl; /* time to live */
- int r_size; /* size of data area */
- char * r_data; /* pointer to data */
-};
-
-extern pthread_ipport_type _getshort();
-extern pthread_ipaddr_type _getlong();
-
-/*
- * Inline versions of get/put short/long. Pointer is advanced.
- * We also assume that a "pthread_ipport_type" holds 2 "chars"
- * and that a "pthread_ipaddr_type" holds 4 "chars".
- *
- * These macros demonstrate the property of C whereby it can be
- * portable or it can be elegant but never both.
- */
-#define GETSHORT(s, cp) { \
- register u_char *t_cp = (u_char *)(cp); \
- (s) = ((pthread_ipport_type)t_cp[0] << 8) | (pthread_ipport_type)t_cp[1]; \
- (cp) += 2; \
-}
-
-#define GETLONG(l, cp) { \
- register u_char *t_cp = (u_char *)(cp); \
- (l) = (((pthread_ipaddr_type)t_cp[0]) << 24) \
- | (((pthread_ipaddr_type)t_cp[1]) << 16) \
- | (((pthread_ipaddr_type)t_cp[2]) << 8) \
- | (((pthread_ipaddr_type)t_cp[3])); \
- (cp) += 4; \
-}
-
-#define PUTSHORT(s, cp) { \
- register pthread_ipport_type t_s = (pthread_ipport_type)(s); \
- register u_char *t_cp = (u_char *)(cp); \
- *t_cp++ = t_s >> 8; \
- *t_cp = t_s; \
- (cp) += 2; \
-}
-
-/*
- * Warning: PUTLONG --no-longer-- destroys its first argument. if you
- * were depending on this "feature", you will lose.
- */
-#define PUTLONG(l, cp) { \
- register pthread_ipaddr_type t_l = (pthread_ipaddr_type)(l); \
- register u_char *t_cp = (u_char *)(cp); \
- *t_cp++ = t_l >> 24; \
- *t_cp++ = t_l >> 16; \
- *t_cp++ = t_l >> 8; \
- *t_cp = t_l; \
- (cp) += 4; \
-}
-
-#endif /* !_NAMESER_H_ */
diff --git a/mit-pthreads/include/dirent.h b/mit-pthreads/include/dirent.h
deleted file mode 100644
index c3e86cb9da1..00000000000
--- a/mit-pthreads/include/dirent.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 5.18 (Berkeley) 2/23/91
- */
-
-#ifndef _DIRENT_H_
-#define _DIRENT_H_
-
-#include <sys/dirent.h>
-#include <pthread.h>
-
-struct __dirent {
- struct __dirent * next;
- struct dirent data;
- pthread_t owner;
-};
-
-/* definitions for library routines operating on directories. */
-#define DIRBLKSIZ 1024
-
-/* structure describing an open directory. */
-typedef struct _dirdesc {
- struct __dirent * dd_dp; /* Linked list of struct __dirent pointer */
- int dd_fd; /* file descriptor associated with directory */
- long dd_loc; /* offset in current buffer */
- long dd_size; /* amount of data returned by getdirentries */
- char * dd_buf; /* data buffer */
- int dd_len; /* size of data buffer */
- long dd_seek; /* magic cookie returned by getdirentries */
- void * dd_ddloc; /* Linked list of ddloc structs for telldir/seekdir */
- pthread_mutex_t *dd_lock; /* Lock for open directory structure */
-} DIR;
-
-#define dirfd(dirp) ((dirp)->dd_fd)
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-DIR * opendir __P_((const char *));
-struct dirent * readdir __P_((DIR *));
-int readdir_r __P_((DIR *, struct dirent *, struct dirent **));
-void rewinddir __P_((DIR *));
-int closedir __P_((DIR *));
-#ifndef _POSIX_SOURCE
-long telldir __P_((DIR *));
-void seekdir __P_((DIR *, long));
-
-/*
-int scandir __P_((const char *, struct dirent ***,
- int (*)(struct dirent *),
- int (*)(const void *, const void *)));
-int alphasort __P_((const void *, const void *));
-int getdirentries __P_((int, char *, int, long *));
-*/
-#endif /* not POSIX */
-
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif /* !_DIRENT_H_ */
diff --git a/mit-pthreads/include/endian.h b/mit-pthreads/include/endian.h
deleted file mode 100644
index 8fb947dbd33..00000000000
--- a/mit-pthreads/include/endian.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 1983, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)nameser.h 8.2 (Berkeley) 2/16/94
- * -
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- * -
- * --Copyright--
- */
-
-#ifndef _ENDIAN_H_
-#define _ENDIAN_H_
-
-#ifndef BYTE_ORDER
-#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax, pc) */
-#define __LITTLE_ENDIAN 1234
-#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */
-#define __BIG_ENDIAN 4321
-#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp)*/
-#define __PDP_ENDIAN 3412
-
-#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \
- defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \
- defined(__alpha__) || defined(__alpha)
-#define BYTE_ORDER LITTLE_ENDIAN
-#define __BYTE_ORDER LITTLE_ENDIAN
-#endif
-
-#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \
- defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \
- defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || \
- defined(apollo) || defined(hp9000) || defined(hp9000s300) || \
- defined(hp9000s800) || \
- defined (BIT_ZERO_ON_LEFT)
-#define BYTE_ORDER BIG_ENDIAN
-#define __BYTE_ORDER BIG_ENDIAN
-#endif
-#endif /* BYTE_ORDER */
-
-#if !defined(BYTE_ORDER) || (BYTE_ORDER != BIG_ENDIAN \
- && BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != PDP_ENDIAN)
- /* you must determine what the correct bit order is for
- * your compiler - the next line is an intentional error
- * which will force your compiles to bomb until you fix
- * the above macros.
- */
- #error "Undefined or invalid BYTE_ORDER";
-#endif
-
-#endif /* !_ENDIAN_H */
diff --git a/mit-pthreads/include/errno.h b/mit-pthreads/include/errno.h
deleted file mode 100644
index 24b005e9369..00000000000
--- a/mit-pthreads/include/errno.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)errno.h 7.13 (Berkeley) 2/19/91
- * errno.h,v 1.3 1993/05/20 16:22:09 cgd Exp
- */
-
-#ifndef _ERRNO_H_
-#define _ERRNO_H_
-
-#include <sys/cdefs.h>
-#include <sys/errno.h>
-
-__BEGIN_DECLS
-
-extern int * __error();
-
-__END_DECLS
-
-#define errno (* __error())
-#define pthread_errno(x) pthread_run->error_p = x
-
-#endif /* _ERRNO_H_ */
diff --git a/mit-pthreads/include/math.h b/mit-pthreads/include/math.h
deleted file mode 100644
index d5963ce6023..00000000000
--- a/mit-pthreads/include/math.h
+++ /dev/null
@@ -1,85 +0,0 @@
-#ifndef _MATH_H_
-#define _MATH_H_
-
-/* Needed for HUGE_VAL */
-#include <sys/__math.h>
-
-/* XOPEN/SVID */
-
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-#define M_E 2.7182818284590452354 /* e */
-#define M_LOG2E 1.4426950408889634074 /* log 2e */
-#define M_LOG10E 0.43429448190325182765 /* log 10e */
-#define M_LN2 0.69314718055994530942 /* log e2 */
-#define M_LN10 2.30258509299404568402 /* log e10 */
-#define M_PI 3.14159265358979323846 /* pi */
-#define M_PI_2 1.57079632679489661923 /* pi/2 */
-#define M_PI_4 0.78539816339744830962 /* pi/4 */
-#define M_1_PI 0.31830988618379067154 /* 1/pi */
-#define M_2_PI 0.63661977236758134308 /* 2/pi */
-#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
-#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
-#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
-
-#define MAXFLOAT ((float)3.40282346638528860e+38)
-
-#if !defined(_XOPEN_SOURCE)
-
-struct exception {
- int type;
- char *name;
- double arg1;
- double arg2;
- double retval;
-};
-
-#define HUGE MAXFLOAT
-
-#define DOMAIN 1
-#define SING 2
-#define OVERFLOW 3
-#define UNDERFLOW 4
-#define TLOSS 5
-#define PLOSS 6
-
-#endif /* !_XOPEN_SOURCE */
-#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
-
-#include <sys/cdefs.h>
-
-/* ANSI/POSIX */
-
-__BEGIN_DECLS
-
-double hypot __P_((double, double));
-double acos __P_((double));
-double asin __P_((double));
-double atan __P_((double));
-double atan2 __P_((double, double));
-double cos __P_((double));
-double sin __P_((double));
-double tan __P_((double));
-
-double cosh __P_((double));
-double sinh __P_((double));
-double tanh __P_((double));
-
-double exp __P_((double));
-double frexp __P_((double, int *));
-double ldexp __P_((double, int));
-double log __P_((double));
-double log10 __P_((double));
-double modf __P_((double, double *));
-
-double pow __P_((double, double));
-double sqrt __P_((double));
-
-double ceil __P_((double));
-double fabs __P_((double));
-double floor __P_((double));
-double fmod __P_((double, double));
-double rint __P_((double)); /* XOPEN; Added by Monty */
-int finite __P_((double dsrc)); /* math.h; added by Monty */
-__END_DECLS
-
-#endif /* _MATH_H_ */
diff --git a/mit-pthreads/include/netdb.h b/mit-pthreads/include/netdb.h
deleted file mode 100644
index 54d85e5a3ed..00000000000
--- a/mit-pthreads/include/netdb.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*-
- * Copyright (c) 1980, 1983, 1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)netdb.h 5.15 (Berkeley) 4/3/91
- * $Id$
- */
-
-#ifndef _NETDB_H_
-#define _NETDB_H_
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-
-#define _PATH_HEQUIV "/etc/hosts.equiv"
-#define _PATH_HOSTS "/etc/hosts"
-#define _PATH_NETWORKS "/etc/networks"
-#define _PATH_PROTOCOLS "/etc/protocols"
-#define _PATH_SERVICES "/etc/services"
-#define __NETDB_MAXALIASES 35
-#define __NETDB_MAXADDRS 35
-
-/*
- * Structures returned by network data base library. All addresses are
- * supplied in host order, and returned in network order (suitable for
- * use in system calls).
- */
-struct hostent {
- char *h_name; /* official name of host */
- char **h_aliases; /* alias list */
- int h_addrtype; /* host address type */
- int h_length; /* length of address */
- char **h_addr_list; /* list of addresses from name server */
-#define h_addr h_addr_list[0] /* address, for backward compatiblity */
-};
-
-/*
- * Assumption here is that a network number
- * fits in 32 bits -- probably a poor one.
- */
-struct netent {
- char *n_name; /* official name of net */
- char **n_aliases; /* alias list */
- int n_addrtype; /* net address type */
- unsigned long n_net; /* network # */
-};
-
-struct servent {
- char *s_name; /* official service name */
- char **s_aliases; /* alias list */
- int s_port; /* port # */
- char *s_proto; /* protocol to use */
-};
-
-struct protoent {
- char *p_name; /* official protocol name */
- char **p_aliases; /* alias list */
- int p_proto; /* protocol # */
-};
-
-/*
- * Error return codes from gethostbyname() and gethostbyaddr()
- * (left in extern int h_errno).
- */
-
-#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
-#define TRY_AGAIN 2 /* Non-Authoritive Host not found, or SERVERFAIL */
-#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
-#define NO_DATA 4 /* Valid name, no data record of requested type */
-#define NO_ADDRESS NO_DATA /* no address, look for MX record */
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-void endhostent __P_((void));
-void endnetent __P_((void));
-void endprotoent __P_((void));
-void endservent __P_((void));
-struct hostent *gethostbyaddr __P_((const char *, int, int));
-struct hostent *gethostbyname __P_((const char *));
-struct hostent *gethostent __P_((void));
-struct netent *getnetbyaddr __P_((long, int)); /* u_long? */
-struct netent *getnetbyname __P_((const char *));
-struct netent *getnetent __P_((void));
-struct protoent *getprotobyname __P_((const char *));
-struct protoent *getprotobynumber __P_((int));
-struct protoent *getprotoent __P_((void));
-struct servent *getservbyname __P_((const char *, const char *));
-struct servent *getservbyport __P_((int, const char *));
-struct servent *getservent __P_((void));
-void herror __P_((const char *));
-char *hstrerror __P_((int));
-void sethostent __P_((int));
-void setnetent __P_((int));
-void setprotoent __P_((int));
-void setservent __P_((int));
-struct hostent *gethostbyaddr_r __P_((const char *, int, int,
- struct hostent *, char *, int, int *));
-struct hostent *gethostbyname_r __P_((const char *, struct hostent *, char *,
- int, int *));
-struct hostent *gethostent_r __P_((struct hostent *, char *, int, int *));
-struct netent *getnetbyaddr_r __P_((long, int, struct netent *, char *, int));
-struct netent *getnetbyname_r __P_((const char *, struct netent *, char *,
- int));
-struct netent *getnetent_r __P_((struct netent *, char *, int));
-struct protoent *getprotobyname_r __P_((const char *, struct protoent *, char *,
- int));
-struct protoent *getprotobynumber_r __P_((int, struct protoent *, char *, int));
-struct protoent *getprotoent_r __P_((struct protoent *, char *, int));
-struct servent *getservbyname_r __P_((const char *, const char *,
- struct servent *, char *, int));
-struct servent *getservbyport_r __P_((int, const char *, struct servent *,
- char *, int));
-struct servent *getservent_r __P_((struct servent *, char *, int));
-__END_DECLS
-
-#endif /* !_NETDB_H_ */
diff --git a/mit-pthreads/include/pthread.h b/mit-pthreads/include/pthread.h
deleted file mode 100644
index e8a44050215..00000000000
--- a/mit-pthreads/include/pthread.h
+++ /dev/null
@@ -1,371 +0,0 @@
-/* ==== pthread.h ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic pthread header.
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- *
- * 93/9/28 streepy - Added support for pthread cancel
- *
- */
-
-#ifndef _PTHREAD_H_
-#define _PTHREAD_H_
-
-#include <pthread/types.h>
-
-#include <pthread/version.h>
-#include <pthread/machdep.h>
-#include <pthread/cleanup.h>
-#include <pthread/kernel.h>
-#include <pthread/prio_queue.h>
-#include <pthread/queue.h>
-#include <pthread/sleep.h>
-#include <pthread/mutex.h>
-#include <pthread/cond.h>
-#include <pthread/fd.h>
-#include <pthread/debug_out.h>
-
-/* Requires mutex.h */
-#include <pthread/specific.h>
-
-#include <pthread/util.h>
-
-/* More includes */
-#include <pthread/pthread_once.h>
-
-/* More includes, that need size_t */
-#include <pthread/pthread_attr.h>
-
-#include <signal.h> /* for sigset_t */ /* Moved by monty */
-
-/* Constants for use with pthread_setcancelstate and pthread_setcanceltype */
-#define PTHREAD_CANCEL_DISABLE 0
-#define PTHREAD_CANCEL_ENABLE 1
-#define PTHREAD_CANCEL_DEFERRED 0
-#define PTHREAD_CANCEL_ASYNCHRONOUS 1
-
-#define PTHREAD_CANCELLED (void *)1 /* Exit status of a cancelled thread */
-
-
-#ifdef PTHREAD_KERNEL
-
-enum pthread_state {
-#define __pthread_defstate(S,NAME) S,
-#include "pthread/state.def"
-#undef __pthread_defstate
-
- /* enum lists aren't supposed to end with a comma, sigh */
- PS_STATE_MAX
-};
-
-/* Put PANIC inside an expression that evaluates to non-void type, to
- make it easier to combine it in expressions. */
-#define DO_PANIC() (PANIC (), 0)
-#define PANICIF(x) ((x) ? DO_PANIC () : 0)
-
-/* In the thread flag field, we use a series of bit flags. Flags can
- * organized into "groups" of mutually exclusive flags. Other flags
- * are unrelated and can be set and cleared with a single bit operation.
- */
-
-#define PF_WAIT_EVENT 0x01
-#define PF_DONE_EVENT 0x02
-#define PF_EVENT_GROUP 0x03 /* All event bits */
-
-#define PF_CANCEL_STATE 0x04 /* cancellability state */
-#define PF_CANCEL_TYPE 0x08 /* cancellability type */
-#define PF_THREAD_CANCELLED 0x10 /* thread has been cancelled */
-#define PF_RUNNING_TO_CANCEL 0x20 /* Thread is running so it can cancel*/
-#define PF_AT_CANCEL_POINT 0x40 /* Thread is at a cancel point */
-
-/* Flag operations */
-
-#define SET_PF_FLAG(x,f) ( (x)->flags |= (f) )
-#define TEST_PF_FLAG(x,f) ( (x)->flags & (f) )
-#define CLEAR_PF_FLAG(x,f) ( (x)->flags &= ~(f) )
-#define CLEAR_PF_GROUP(x,g) ( (x)->flags &= ~(g) )
-#define SET_PF_FLAG_IN_GROUP(x,g,f) ( CLEAR_PF_GROUP(x,g),SET_PF_FLAG(x,f))
-#define TEST_PF_GROUP(x,g) ( (x)->flags & (g) )
-
-#define SET_PF_DONE_EVENT(x) \
-( !TEST_PF_FLAG(x,PF_DONE_EVENT) \
- ? ( TEST_PF_FLAG(x,PF_WAIT_EVENT) \
- ? (SET_PF_FLAG_IN_GROUP(x,PF_EVENT_GROUP,PF_DONE_EVENT), OK) \
- : DO_PANIC ()) \
- : NOTOK )
-
-#define SET_PF_WAIT_EVENT(x) \
-( PANICIF (TEST_PF_GROUP(x,PF_EVENT_GROUP) ), \
- SET_PF_FLAG_IN_GROUP(x,PF_EVENT_GROUP,PF_WAIT_EVENT), 0)
-
-#define CLEAR_PF_DONE_EVENT(x) \
-( PANICIF (!TEST_PF_FLAG(x,PF_DONE_EVENT)), \
- CLEAR_PF_GROUP(x,PF_EVENT_GROUP) )
-
-#define SET_PF_CANCELLED(x) ( SET_PF_FLAG(x,PF_THREAD_CANCELLED) )
-#define TEST_PF_CANCELLED(x) ( TEST_PF_FLAG(x,PF_THREAD_CANCELLED) )
-
-#define SET_PF_RUNNING_TO_CANCEL(x) ( SET_PF_FLAG(x,PF_RUNNING_TO_CANCEL) )
-#define CLEAR_PF_RUNNING_TO_CANCEL(x)( CLEAR_PF_FLAG(x,PF_RUNNING_TO_CANCEL) )
-#define TEST_PF_RUNNING_TO_CANCEL(x)( TEST_PF_FLAG(x,PF_RUNNING_TO_CANCEL) )
-
-#define SET_PF_AT_CANCEL_POINT(x) ( SET_PF_FLAG(x,PF_AT_CANCEL_POINT) )
-#define CLEAR_PF_AT_CANCEL_POINT(x) ( CLEAR_PF_FLAG(x,PF_AT_CANCEL_POINT) )
-#define TEST_PF_AT_CANCEL_POINT(x) ( TEST_PF_FLAG(x,PF_AT_CANCEL_POINT) )
-
-#define SET_PF_CANCEL_STATE(x,f) \
- ( (f) ? SET_PF_FLAG(x,PF_CANCEL_STATE) : CLEAR_PF_FLAG(x,PF_CANCEL_STATE) )
-#define TEST_PF_CANCEL_STATE(x) \
- ( (TEST_PF_FLAG(x,PF_CANCEL_STATE)) ? PTHREAD_CANCEL_ENABLE \
- : PTHREAD_CANCEL_DISABLE )
-
-#define SET_PF_CANCEL_TYPE(x,f) \
- ( (f) ? SET_PF_FLAG(x,PF_CANCEL_TYPE) : CLEAR_PF_FLAG(x,PF_CANCEL_TYPE) )
-#define TEST_PF_CANCEL_TYPE(x) \
- ( (TEST_PF_FLAG(x,PF_CANCEL_TYPE)) ? PTHREAD_CANCEL_ASYNCHRONOUS \
- : PTHREAD_CANCEL_DEFERRED )
-
-/* See if a thread is in a state that it can be cancelled */
-#define TEST_PTHREAD_IS_CANCELLABLE(x) \
-( (TEST_PF_CANCEL_STATE(x) == PTHREAD_CANCEL_ENABLE && TEST_PF_CANCELLED(x)) \
- ? ((TEST_PF_CANCEL_TYPE(x) == PTHREAD_CANCEL_ASYNCHRONOUS) \
- ? 1 \
- : TEST_PF_AT_CANCEL_POINT(x)) \
- : 0 )
-
-
-struct pthread_select_data {
- int nfds;
- fd_set readfds;
- fd_set writefds;
- fd_set exceptfds;
-};
-
-union pthread_wait_data {
- pthread_mutex_t * mutex;
- pthread_cond_t * cond;
- const sigset_t * sigwait; /* Waiting on a signal in sigwait */
- struct {
- short fd; /* Used when thread waiting on fd */
- short branch; /* line number, for debugging */
- } fd;
- struct pthread_select_data * select_data;
-};
-
-#define PTT_USER_THREAD 0x0001
-
-struct pthread {
- int thread_type;
- struct machdep_pthread machdep_data;
- pthread_attr_t attr;
-
- /* Signal interface */
- sigset_t sigmask;
- sigset_t sigpending;
- int sigcount; /* Number of signals pending */
- int sighandled; /* Set when signal has been handled */
- /* Timeout time */
- struct timespec wakeup_time;
-
- /* Join queue for waiting threads */
- struct pthread_queue join_queue;
-
- /*
- * Thread implementations are just multiple queue type implemenations,
- * Below are the various link lists currently necessary
- * It is possible for a thread to be on multiple, or even all the
- * queues at once, much care must be taken during queue manipulation.
- *
- * The pthread structure must be locked before you can even look at
- * the link lists.
- */
-
- /*
- * ALL threads, in any state.
- * Must lock kernel lock before manipulating.
- */
- struct pthread * pll;
-
- /*
- * Standard link list for running threads, mutexes, etc ...
- * It can't be on both a running link list and a wait queue.
- * Must lock kernel lock before manipulating.
- */
- struct pthread * next;
- union pthread_wait_data data;
-
- /*
- * Actual queue state and priority of thread.
- * (Note: "priority" is a reserved word in Concurrent C, please
- * don't use it. --KR)
- */
- struct pthread_queue * queue;
- enum pthread_state state;
- enum pthread_state old_state; /* Used when cancelled */
- char flags;
- char pthread_priority;
-
- /*
- * Sleep queue, this is different from the standard link list
- * because it is possible to be on both (pthread_cond_timedwait();
- * Must lock sleep mutex before manipulating
- */
- struct pthread *sll; /* For sleeping threads */
-
- /*
- * Data that doesn't need to be locked
- * Mostly because only the thread owning the data can manipulate it
- */
- void * ret;
- int error;
- int * error_p;
- const void ** specific_data;
- int specific_data_count;
-
- /* Cleanup handlers Link List */
- struct pthread_cleanup *cleanup;
-};
-
-#else /* not PTHREAD_KERNEL */
-
-struct pthread;
-
-#endif
-
-typedef struct pthread *pthread_t;
-
-/*
- * Globals
- */
-#ifdef PTHREAD_KERNEL
-
-extern struct pthread * pthread_run;
-extern struct pthread * pthread_initial;
-extern struct pthread * pthread_link_list;
-extern struct pthread_queue pthread_dead_queue;
-extern struct pthread_queue pthread_alloc_queue;
-
-extern pthread_attr_t pthread_attr_default;
-extern volatile int fork_lock;
-extern pthread_size_t pthread_pagesize;
-
-extern sigset_t * uthread_sigmask;
-
-/* Kernel global functions */
-extern void pthread_sched_prevent(void);
-extern void pthread_sched_resume(void);
-extern int __pthread_is_valid( pthread_t );
-extern void pthread_cancel_internal( int freelocks );
-
-#endif
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(DCE_COMPAT)
-
-typedef void * (*pthread_startroutine_t)(void *);
-typedef void * pthread_addr_t;
-
-int pthread_create __P_((pthread_t *, pthread_attr_t,
- pthread_startroutine_t,
- pthread_addr_t));
-void pthread_exit __P_((pthread_addr_t));
-int pthread_join __P_((pthread_t, pthread_addr_t *));
-
-#else
-
-void pthread_init __P_((void));
-int pthread_create __P_((pthread_t *,
- const pthread_attr_t *,
- void * (*start_routine)(void *),
- void *));
-void pthread_exit __P_((void *));
-pthread_t pthread_self __P_((void));
-int pthread_equal __P_((pthread_t, pthread_t));
-int pthread_join __P_((pthread_t, void **));
-int pthread_detach __P_((pthread_t));
-void pthread_yield __P_((void));
-int pthread_setschedparam __P_((pthread_t pthread, int policy,
- struct sched_param * param));
-int pthread_getschedparam __P_((pthread_t pthread, int * policy,
- struct sched_param * param));
-int pthread_kill __P_((struct pthread *, int));
-void (*pthread_signal __P_((int, void (*)(int))))();
-int pthread_cancel __P_(( pthread_t pthread ));
-int pthread_setcancelstate __P_(( int state, int *oldstate ));
-int pthread_setcanceltype __P_(( int type, int *oldtype ));
-void pthread_testcancel __P_(( void ));
-
-int pthread_sigmask __P_((int how, const sigset_t *set,
- sigset_t * oset)); /* added by Monty */
-int sigwait __P_((const sigset_t * set, int * sig));
-int sigsetwait __P_((const sigset_t * set, int * sig));
-#endif
-
-#if defined(PTHREAD_KERNEL)
-
-/* Not valid, but I can't spell so this will be caught at compile time */
-#define pthread_yeild(notvalid)
-
-#endif
-
-__END_DECLS
-
-/*
- * Static constructors
- */
-#ifdef __cplusplus
-
-extern struct pthread * pthread_initial;
-
-class __pthread_init_t {
-/* struct __pthread_init_t { */
- public:
- __pthread_init_t() {
- if (pthread_initial == NULL) {
- pthread_init();
- }
- }
-};
-
-static __pthread_init_t __pthread_init_this_file;
-
-#endif /* __cplusplus */
-
-#endif
diff --git a/mit-pthreads/include/pthread/ac-types.h b/mit-pthreads/include/pthread/ac-types.h
deleted file mode 100644
index 7fa4568817f..00000000000
--- a/mit-pthreads/include/pthread/ac-types.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef pthread_size_t
-#define pthread_ipaddr_type unsigned long
-#define pthread_ipport_type unsigned short
-#define pthread_clock_t long
-#define pthread_size_t unsigned int
-#define pthread_ssize_t int
-#define pthread_time_t long
-#define pthread_off_t long
-#define pthread_va_list void *
-#endif
diff --git a/mit-pthreads/include/pthread/cleanup.h b/mit-pthreads/include/pthread/cleanup.h
deleted file mode 100755
index cd995ceddcf..00000000000
--- a/mit-pthreads/include/pthread/cleanup.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ==== cleanup.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : cleanup header.
- *
- * 1.20 94/02/13 proven
- * -Started coding this file.
- */
-
-/*
- * New cleanup structures
- */
-struct pthread_cleanup {
- struct pthread_cleanup *next;
- void (*routine)();
- void *routine_arg;
-};
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-int pthread_cleanup_push __P_((void (*routine)(void *), void *routine_arg));
-void pthread_cleanup_pop __P_((int execute));
-
-__END_DECLS
-
diff --git a/mit-pthreads/include/pthread/cond.h b/mit-pthreads/include/pthread/cond.h
deleted file mode 100755
index ec9f7cf0016..00000000000
--- a/mit-pthreads/include/pthread/cond.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* ==== cond.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Condition variable header.
- *
- * 1.00 93/10/30 proven
- * -Started coding this file.
- */
-
-#include <timers.h>
-
-/*
- * New cond structures
- */
-enum pthread_condtype {
- COND_TYPE_FAST,
- COND_TYPE_STATIC_FAST,
- COND_TYPE_COUNTING_FAST, /* Used with MUTEX_TYPE_COUNTING_FAST */
- COND_TYPE_METERED,
- COND_TYPE_DEBUG, /* Debug conds will have lots of options */
- COND_TYPE_MAX
-};
-
-#define PTHREAD_CONDTYPE_FAST 1
-#define PTHREAD_CONDTYPE_DEBUG 4
-#define PTHREAD_CONDTYPE_RECURSIVE 2
-
-typedef struct pthread_cond {
- enum pthread_condtype c_type;
- struct pthread_queue c_queue;
- semaphore c_lock;
- void * c_data;
- long c_flags;
-} pthread_cond_t;
-
-typedef struct pthread_condattr {
- enum pthread_condtype c_type;
- long c_flags;
-} pthread_condattr_t;
-
-/*
- * Flags for conds.
- */
-#define COND_FLAGS_PRIVATE 0x01
-#define COND_FLAGS_INITED 0x02
-#define COND_FLAGS_BUSY 0x04
-
-/*
- * Static cond initialization values.
- */
-#define PTHREAD_COND_INITIALIZER \
-{ COND_TYPE_STATIC_FAST, PTHREAD_QUEUE_INITIALIZER, \
- SEMAPHORE_CLEAR, NULL, COND_FLAGS_INITED }
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-struct timespec;
-
-int pthread_cond_init __P_((pthread_cond_t *, const pthread_condattr_t *));
-int pthread_cond_timedwait __P_((pthread_cond_t *, pthread_mutex_t *,
- const struct timespec * abstime));
-int pthread_cond_wait __P_((pthread_cond_t *, pthread_mutex_t *));
-int pthread_cond_signal __P_((pthread_cond_t *));
-int pthread_cond_broadcast __P_((pthread_cond_t *));
-int pthread_cond_destroy __P_((pthread_cond_t *));
-
-__END_DECLS
-
diff --git a/mit-pthreads/include/pthread/config.h b/mit-pthreads/include/pthread/config.h
deleted file mode 100644
index 251948c3874..00000000000
--- a/mit-pthreads/include/pthread/config.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifndef _SYS___CONFIG_H_
-#define _SYS___CONFIG_H_
-#define _OS_HAS_TIMESPEC 1
-#define _OS_HAS_SOCKLEN_T 1
-#endif
diff --git a/mit-pthreads/include/pthread/debug_out.h b/mit-pthreads/include/pthread/debug_out.h
deleted file mode 100755
index 6968c5ea90e..00000000000
--- a/mit-pthreads/include/pthread/debug_out.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* debug_out.h - macros to use for debugging prints in places where calls
- to printf() and gang are ill-advised. */
-
-#ifdef PTHREAD_DEBUGGING
-#define PTHREAD_DEBUG_WriteStr(S) (void)machdep_sys_write(2,S,strlen(S))
-#define PTHREAD_DEBUG_WriteInt32Hex(X) \
- { char _xbuf[8]; int _temp = (int)(X), _temp2; \
- _temp2 = ((_temp>>28)&0xf); \
- _xbuf[0] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \
- _temp2 = ((_temp>>24)&0xf); \
- _xbuf[1] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \
- _temp2 = ((_temp>>20)&0xf); \
- _xbuf[2] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \
- _temp2 = ((_temp>>16)&0xf); \
- _xbuf[3] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \
- _temp2 = ((_temp>>12)&0xf); \
- _xbuf[4] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \
- _temp2 = ((_temp>>8)&0xf); \
- _xbuf[5] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \
- _temp2 = ((_temp>>4)&0xf); \
- _xbuf[6] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \
- _temp2 = (_temp&0xf); \
- _xbuf[7] = (_temp2<10)? (_temp2+'0'): ((_temp2-10)+'a'); \
- (void)machdep_sys_write(2,_xbuf,8); \
- }
-#ifdef __alpha
-#define PTHREAD_DEBUG_WriteInt64Hex(X) \
- { long _tempX = (long)(X),_tempY; \
- _tempY=((_tempX>>32)&0xffffffff); \
- PTHREAD_DEBUG_WriteInt32Hex(_tempY); \
- _tempY=(_tempX&0xffffffff); \
- PTHREAD_DEBUG_WriteInt32Hex(_tempY); \
- }
-#define PTHREAD_DEBUG_WritePointer(X) PTHREAD_DEBUG_WriteInt64Hex(X)
-#else
-#define PTHREAD_DEBUG_WriteInt64Hex(X) PTHREAD_DEBUG_WriteInt32Hex(X)
-#define PTHREAD_DEBUG_WritePointer(X) PTHREAD_DEBUG_WriteInt32Hex(X)
-#endif /* __alpha */
-#else /* ! PTHREAD_DEBUGGING */
-#define PTHREAD_DEBUG_WriteStr(S)
-#define PTHREAD_DEBUG_WriteInt32Hex(X)
-#define PTHREAD_DEBUG_WriteInt64HeX(X)
-#define PTHREAD_DEBUG_WritePointer(X)
-#endif /* PTHREAD_DEBUGGING */
diff --git a/mit-pthreads/include/pthread/fd.h b/mit-pthreads/include/pthread/fd.h
deleted file mode 100755
index d27a5066936..00000000000
--- a/mit-pthreads/include/pthread/fd.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* ==== fd.h ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic fd header.
- *
- * 1.00 93/08/14 proven
- * -Started coding this file.
- *
- * 1.01 93/11/13 proven
- * -The functions readv() and writev() added
- */
-
-/*
- * New pthread types.
- */
-enum fd_type {
- FD_NT, /* Not tested */
- FD_NIU, /* Known to be not in use */
- FD_HALF_DUPLEX, /* Files, and seeking devices */
- FD_FULL_DUPLEX, /* pipes, sockets, drivers, ... */
- FD_TEST_HALF_DUPLEX, /* Redo machdep_sys_fcntl */
- FD_TEST_FULL_DUPLEX /* Redo machdep_sys_fcntl */
-};
-
-
-#define FD_READ 0x1
-#define FD_WRITE 0x2
-#define FD_RDWR (FD_READ | FD_WRITE)
-
-union fd_data {
- void *ptr;
- int i;
-};
-
-struct timespec;
-struct iovec;
-struct fd_ops {
- pthread_ssize_t (*write) __P_((union fd_data, int, const void *,
- size_t, struct timespec *));
- pthread_ssize_t (*read) __P_((union fd_data, int, void *, size_t,
- struct timespec *));
- int (*close)();
- int (*fcntl)();
- int (*writev) __P_((union fd_data, int,
- const struct iovec *,
- int, struct timespec *));
- int (*readv) __P_((union fd_data, int,
- const struct iovec *,
- int, struct timespec *));
- off_t (*seek)();
- int use_kfds;
-};
-
-struct fd_table_entry {
- struct pthread_queue r_queue;
- struct pthread_queue w_queue;
- struct pthread *r_owner;
- struct pthread *w_owner;
- pthread_mutex_t mutex;
- struct fd_table_entry *next;
- struct fd_ops *ops;
- enum fd_type type;
- int r_lockcount; /* Count for FILE read locks */
- int w_lockcount; /* Count for FILE write locks */
- int count;
-
- /* data that needs to be passed to the type dependent fd */
- int flags;
- union fd_data fd;
-};
-
-/*
- * Globals
- */
-#if defined(PTHREAD_KERNEL)
-
-extern struct fd_table_entry **fd_table;
-extern int dtablesize;
-
-#endif
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/include/pthread/fd_pipe.h b/mit-pthreads/include/pthread/fd_pipe.h
deleted file mode 100755
index cc5670dbb7d..00000000000
--- a/mit-pthreads/include/pthread/fd_pipe.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ==== fd_pipe.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : The new fast ITC pipe header.
- *
- * 1.00 93/08/14 proven
- * -Started coding this file.
- */
-
-struct __pipe {
- semaphore lock;
- char * buf;
- int size;
- int flags;
- int count;
- int offset;
- struct pthread * wait;
- char * wait_buf;
- size_t wait_size;
-};
-
-#define RD_CLOSED 0x01
-#define WR_CLOSED 0x02
-
diff --git a/mit-pthreads/include/pthread/kernel.h b/mit-pthreads/include/pthread/kernel.h
deleted file mode 100755
index c474d789681..00000000000
--- a/mit-pthreads/include/pthread/kernel.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* ==== kernel.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : mutex header.
- *
- * 1.00 93/07/22 proven
- * -Started coding this file.
- */
-
-/*
- * Defines only for the pthread user kernel.
- */
-#if defined(PTHREAD_KERNEL)
-
-#ifdef __GNUC__
-#include <assert.h>
-#endif
-#ifdef __ASSERT_FUNCTION
-#define PANIC() panic_kernel( __FILE__, __LINE__, __ASSERT_FUNCTION )
-#else
-#define PANIC() panic_kernel( __FILE__, __LINE__, (const char *)0 )
-#endif
-
-
-/* Time each rr thread gets */
-#define PTHREAD_RR_TIMEOUT 100000000
-
-/* Set the errno value */
-#define SET_ERRNO(x) \
-{ \
- if (!pthread_run->error_p) { \
- pthread_run->error_p = &pthread_run->error; \
- } \
- (*(pthread_run->error_p)) = x; \
-}
-
-/* Globals only the internals should see */
-extern struct pthread_prio_queue * pthread_current_prio_queue;
-extern volatile int pthread_kernel_lock;
-
-#endif
diff --git a/mit-pthreads/include/pthread/kthread.h b/mit-pthreads/include/pthread/kthread.h
deleted file mode 100755
index a2e73361d8c..00000000000
--- a/mit-pthreads/include/pthread/kthread.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* ==== kthread.h ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic pthread header.
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- *
- * 1.32 94/05/25 proven
- * -Started adding kernel thread support
- */
-
-#ifndef _KTHREAD_H_
-#define _KTHREAD_H_
-
-enum kthread_state {
- KS_RUNNING,
- KS_DEAD,
-};
-
-struct kthread {
- enum kthread_state state;
-
- struct pthread_queue pthread_current_queue;
- struct pthread * pthread_link_list;
- struct pthread * pthread_run;
-
- semaphore lock;
-
-};
-
-/*
- * Globals
- */
-extern struct kthread * kthread_link_list;
-
-#endif
diff --git a/mit-pthreads/include/pthread/mutex.h b/mit-pthreads/include/pthread/mutex.h
deleted file mode 100755
index e6f1fe58c0f..00000000000
--- a/mit-pthreads/include/pthread/mutex.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* ==== mutex.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : mutex header.
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-/*
- * New mutex structures
- */
-enum pthread_mutextype {
- MUTEX_TYPE_STATIC_FAST = 0,
- MUTEX_TYPE_FAST = 1,
- MUTEX_TYPE_COUNTING_FAST = 2, /* Recursive */
- MUTEX_TYPE_METERED = 3,
- MUTEX_TYPE_DEBUG = 4, /* This will have lots of options */
- MUTEX_TYPE_MAX
-};
-
-#define PTHREAD_MUTEXTYPE_FAST 1
-#define PTHREAD_MUTEXTYPE_DEBUG 4
-#define PTHREAD_MUTEXTYPE_RECURSIVE 2
-
-union pthread_mutex_data {
- void * m_ptr;
- int m_count;
-};
-
-typedef struct pthread_mutex {
- enum pthread_mutextype m_type;
- struct pthread_queue m_queue;
- struct pthread * m_owner;
- semaphore m_lock;
- union pthread_mutex_data m_data;
- long m_flags;
-} pthread_mutex_t;
-
-typedef struct pthread_mutexattr {
- enum pthread_mutextype m_type;
- long m_flags;
-} pthread_mutexattr_t;
-
-/*
- * Flags for mutexes.
- */
-#define MUTEX_FLAGS_PRIVATE 0x01
-#define MUTEX_FLAGS_INITED 0x02
-#define MUTEX_FLAGS_BUSY 0x04
-
-/*
- * Static mutex initialization values.
- */
-#define PTHREAD_MUTEX_INITIALIZER \
-{ MUTEX_TYPE_STATIC_FAST, PTHREAD_QUEUE_INITIALIZER, \
- NULL, SEMAPHORE_CLEAR, { NULL }, MUTEX_FLAGS_INITED }
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-int pthread_mutex_init __P_((pthread_mutex_t *, const pthread_mutexattr_t *));
-int pthread_mutex_lock __P_((pthread_mutex_t *));
-int pthread_mutex_unlock __P_((pthread_mutex_t *));
-int pthread_mutex_trylock __P_((pthread_mutex_t *));
-int pthread_mutex_destroy __P_((pthread_mutex_t *));
-
-__END_DECLS
-
diff --git a/mit-pthreads/include/pthread/paths.h b/mit-pthreads/include/pthread/paths.h
deleted file mode 100644
index bf2bf9d01a2..00000000000
--- a/mit-pthreads/include/pthread/paths.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _SYS___PATHS_H_
-#define _SYS___PATHS_H_
-#define _PATH_PTY "/dev/"
-#define _PATH_TZDIR "/usr/lib/zoneinfo"
-#define _PATH_TZFILE "/usr/lib/zoneinfo/localtime"
-#define _PATH_RESCONF "/etc/resolv.conf"
-#define _PATH_HOSTS "/etc/hosts"
-#define _PATH_NETWORKS "/etc/networks"
-#define _PATH_PROTOCOLS "/etc/protocols"
-#define _PATH_SERVICES "/etc/services"
-#define _PATH_BSHELL "/bin/sh"
-#endif
diff --git a/mit-pthreads/include/pthread/prio_queue.h b/mit-pthreads/include/pthread/prio_queue.h
deleted file mode 100755
index e29a0170548..00000000000
--- a/mit-pthreads/include/pthread/prio_queue.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* ==== priority.h ==========================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Priority functions.
- *
- * 1.00 94/09/19 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_PRIO_QUEUE_H_
-#define _PTHREAD_PRIO_QUEUE_H_
-
-/*
- * Static queue initialization values.
- */
-#define PTHREAD_DEFAULT_PRIORITY 64
-#define PTHREAD_MAX_PRIORITY 126
-#define PTHREAD_MIN_PRIORITY 0
-
-/*
- * New prio_queue structures
- */
-struct pthread_prio_level {
- struct pthread * first;
- struct pthread * last;
-};
-
-struct pthread_prio_queue {
- void * data;
- struct pthread * next;
- struct pthread_prio_level level[PTHREAD_MAX_PRIORITY + 1];
-};
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-void pthread_prio_queue_init __P_((struct pthread_prio_queue *));
-void pthread_prio_queue_enq __P_((struct pthread_prio_queue *,
- struct pthread *));
-struct pthread *pthread_prio_queue_deq
- __P_((struct pthread_prio_queue *));
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/include/pthread/pthread_attr.h b/mit-pthreads/include/pthread/pthread_attr.h
deleted file mode 100755
index 8cad262bad2..00000000000
--- a/mit-pthreads/include/pthread/pthread_attr.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* ==== pthread_attr.h ========================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic pthread attributes header.
- *
- * 1.00 93/11/03 proven
- * -Started coding this file.
- */
-
-#define _POSIX_THREAD_ATTR_STACKSIZE
-
-#define PTHREAD_STACK_DEFAULT 65536
-
-/* flags */
-#define PTHREAD_DETACHED 0x1
-#define PTHREAD_SCOPE_SYSTEM 0x2
-#define PTHREAD_INHERIT_SCHED 0x4
-#define PTHREAD_NOFLOAT 0x8
-
-#define PTHREAD_CREATE_DETACHED PTHREAD_DETACHED
-#define PTHREAD_CREATE_JOINABLE 0
-#define PTHREAD_SCOPE_PROCESS 0
-#define PTHREAD_EXPLICIT_SCHED 0
-
-/*
- * New pthread attribute types.
- */
-enum schedparam_policy {
- SCHED_RR,
- SCHED_IO,
- SCHED_FIFO,
- SCHED_OTHER
-};
-
-struct pthread_attr {
- enum schedparam_policy schedparam_policy;
- int sched_priority;
-
- int flags;
- void * arg_attr;
- void (*cleanup_attr)();
- void * stackaddr_attr;
- size_t stacksize_attr;
-};
-
-struct sched_param {
- int sched_priority;
- void * no_data;
-};
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(DCE_COMPAT)
-
-typedef struct pthread_attr * pthread_attr_t;
-
-int pthread_attr_create __P_((pthread_attr_t *));
-int pthread_attr_delete __P_((pthread_attr_t *));
-
-#else
-
-typedef struct pthread_attr pthread_attr_t;
-
-int pthread_attr_init __P_((pthread_attr_t *));
-int pthread_attr_destroy __P_((pthread_attr_t *));
-int pthread_attr_setstacksize __P_((pthread_attr_t *, size_t));
-int pthread_attr_getstacksize __P_((pthread_attr_t *, size_t *));
-int pthread_attr_setstackaddr __P_((pthread_attr_t *, void *));
-int pthread_attr_getstackaddr __P_((pthread_attr_t *, void **));
-int pthread_attr_setdetachstate __P_((pthread_attr_t *, int ));
-int pthread_attr_getdetachstate __P_((pthread_attr_t *, int *));
-int pthread_attr_setscope __P_((pthread_attr_t *, int ));
-int pthread_attr_getscope __P_((pthread_attr_t *, int *));
-int pthread_attr_setinheritsched __P_((pthread_attr_t *, int ));
-int pthread_attr_getinheritsched __P_((pthread_attr_t *, int *));
-int pthread_attr_setschedpolicy __P_((pthread_attr_t *, int ));
-int pthread_attr_getschedpolicy __P_((pthread_attr_t *, int *));
-int pthread_attr_setschedparam __P_((pthread_attr_t *, struct sched_param *));
-int pthread_attr_getschedparam __P_((pthread_attr_t *, struct sched_param *));
-
-int pthread_attr_setfloatstate __P_((pthread_attr_t *, int ));
-int pthread_attr_getfloatstate __P_((pthread_attr_t *, int *));
-int pthread_attr_setcleanup __P_((pthread_attr_t *, void (*routine)(void *),
- void *));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/include/pthread/pthread_once.h b/mit-pthreads/include/pthread/pthread_once.h
deleted file mode 100755
index ac53d5f9b2c..00000000000
--- a/mit-pthreads/include/pthread/pthread_once.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* ==== pthread_once.h ========================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : mutex header.
- *
- * 1.00 93/12/12 proven
- * -Started coding this file.
- */
-
-/* New pthread_once structures */
-typedef struct pthread_once {
- int state;
- pthread_mutex_t mutex;
-} pthread_once_t;
-
-/* Static pthread_once_t initialization value. */
-#define PTHREAD_NEEDS_INIT 0
-#define PTHREAD_DONE_INIT 1
-#define PTHREAD_ONCE_INIT { PTHREAD_NEEDS_INIT, PTHREAD_MUTEX_INITIALIZER }
-
-/* New functions */
-
-__BEGIN_DECLS
-
-int pthread_once __P_((pthread_once_t *, void (*init_routine)(void)));
-
-__END_DECLS
-
diff --git a/mit-pthreads/include/pthread/queue.h b/mit-pthreads/include/pthread/queue.h
deleted file mode 100755
index eca7699e95a..00000000000
--- a/mit-pthreads/include/pthread/queue.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* ==== queue.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : mutex header.
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-/*
- * New queue structures
- */
-struct pthread_queue {
- struct pthread *q_next;
- struct pthread *q_last;
- void *q_data;
-};
-
-/*
- * Static queue initialization values.
- */
-#define PTHREAD_QUEUE_INITIALIZER { NULL, NULL, NULL }
-
-/*
- * New functions
- * Should make pthread_queue_get a macro
- */
-
-__BEGIN_DECLS
-
-void pthread_queue_init __P_((struct pthread_queue *));
-void pthread_queue_enq __P_((struct pthread_queue *, struct pthread *));
-int pthread_queue_remove __P_((struct pthread_queue *, struct pthread *));
-struct pthread *pthread_queue_get __P_((struct pthread_queue *));
-struct pthread *pthread_queue_deq __P_((struct pthread_queue *));
-
-__END_DECLS
diff --git a/mit-pthreads/include/pthread/sleep.h b/mit-pthreads/include/pthread/sleep.h
deleted file mode 100755
index 8bf471a24aa..00000000000
--- a/mit-pthreads/include/pthread/sleep.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* ==== sleep.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : sleep header.
- *
- * 1.00 94/06/04 proven
- * -Started coding this file.
- */
-
-#if defined(PTHREAD_KERNEL)
-
-#include <timers.h>
-
-/*
- * New functions
- */
-static inline int machdep_gettimeofday(struct timespec * current_time)
-{
- struct timeval current_real_time;
- int ret;
-
- ret = gettimeofday(&current_real_time, NULL);
- TIMEVAL_TO_TIMESPEC((&current_real_time), current_time);
- return(ret);
-}
-
-__BEGIN_DECLS
-
-void sleep_schedule __P_((struct timespec *, struct timespec *));
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/include/pthread/specific.h b/mit-pthreads/include/pthread/specific.h
deleted file mode 100755
index 9c66a695556..00000000000
--- a/mit-pthreads/include/pthread/specific.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* ==== specific.h ========================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Thread specific data management header.
- *
- * 1.20 94/03/30 proven
- * -Started coding this file.
- */
-
-#define PTHREAD_DATAKEYS_MAX 256
-#define _POSIX_THREAD_DESTRUTOR_ITERATIONS 4
-
-/*
- * New thread specific key type.
- */
-struct pthread_key {
- pthread_mutex_t mutex;
- long count;
- void (*destructor)();
-};
-
-typedef int pthread_key_t;
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-int pthread_key_create __P_((pthread_key_t *, void (*routine)(void *)));
-int pthread_setspecific __P_((pthread_key_t, const void *));
-void *pthread_getspecific __P_((pthread_key_t));
-int pthread_key_delete __P_((pthread_key_t));
-
-__END_DECLS
-
diff --git a/mit-pthreads/include/pthread/state.def b/mit-pthreads/include/pthread/state.def
deleted file mode 100755
index c62d102a9f0..00000000000
--- a/mit-pthreads/include/pthread/state.def
+++ /dev/null
@@ -1,64 +0,0 @@
-/* This file defines the states that a given thread can be in.
-
- The funky macro use here is so that this one header file can also
- define the corresponding state names, so that the two lists can't
- get inconsistent within a given source tree. */
-
-/* The thread is runnable. */
-__pthread_defstate (PS_RUNNING, "running")
-
-/*
- * The rest of the states are where the thread is waiting on some event.
- * Someday maybe the "data" field will point to the object being waited for.
- */
-
-/* Waiting for a mutex (pthread_mutex_lock()). */
-__pthread_defstate (PS_MUTEX_WAIT, "mutex")
-
-/* Waiting on a condition variable
- (pthread_cond_wait(), or pthread_cond_timedwait()). */
-__pthread_defstate (PS_COND_WAIT, "cond")
-
-/*
- * File descriptor stuff.
- *
- * File descriptors have a special lock. If it is a FULL_DUPLEX fd such as
- * a socket or fifo then it has two mutexes, one for reads and one for writes.
- * Some routines will even try to get both. It will always try to get the
- * read lock first before tring to get the write. All other fds only have
- * one mutex which all calls will get. It is displayed as if it is a read lock.
- */
-/* Waiting on a fd read lock (fd_lock()) */
-__pthread_defstate (PS_FDLR_WAIT, "fdlr")
-
-/* Waiting on a fd write lock (fd_lock()) */
-__pthread_defstate (PS_FDLW_WAIT, "fdlw")
-
-/* Waiting for the kernel fd to have data to read,
- (read(), readv(), recv(), recvfrom(), and recvmsg()). */
-__pthread_defstate (PS_FDR_WAIT, "fdr") /* Waiting on a kernel read */
-
-/* Waiting for the kernel fd to allow a write
- (write(), writev(), send(), sendto(), sendmsg()) */
-__pthread_defstate (PS_FDW_WAIT, "fdw")
-
-/* Waiting for several fds in a select() */
-__pthread_defstate (PS_SELECT_WAIT, "select")
-
-/* Waiting on a sleep (sleep(), usleep() or nanosleep()). */
-__pthread_defstate (PS_SLEEP_WAIT, "sleep")
-
-/* Waiting for a child to die (wait(), waitpid(), wait3(), or wait4()). */
-__pthread_defstate (PS_WAIT_WAIT, "wait")
-
-/* Waiting on some set of signals (sigwait()) */
-__pthread_defstate (PS_SIGWAIT, "sig")
-
-/* Waiting for a thread to die (pthread_join()) */
-__pthread_defstate (PS_JOIN, "join")
-
-/* Waiting for some thread to join with me or detach me */
-__pthread_defstate (PS_DEAD, "dead")
-
-/* Waiting for some thread to create me */
-__pthread_defstate (PS_UNALLOCED, "unallocated")
diff --git a/mit-pthreads/include/pthread/types.h b/mit-pthreads/include/pthread/types.h
deleted file mode 100755
index 7fdf001a0bc..00000000000
--- a/mit-pthreads/include/pthread/types.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef pthread_types_h
-#define pthread_types_h
-
-#include <pthread/xtypes.h>
-#include <pthread/ac-types.h>
-
-#if !defined (pthread_va_list) && defined (__NetBSD__)
-#include <stdarg.h>
-#define pthread_va_list _BSD_VA_LIST_
-#endif
-
-#if !defined (pthread_va_list) && defined (__GNUC__)
-#define __need_va_list
-#include <stdarg.h>
-#define pthread_va_list __gnuc_va_list
-#endif /* pthread_va_list, __GNUC__ */
-
-/* OSF/1 does it this way. */
-#if !defined (pthread_va_list) && defined (pthread_have_va_list_h)
-#ifndef _VA_LIST
-#define _HIDDEN_VA_LIST
-#include <va_list.h>
-#define pthread_va_list __va_list
-#else
-/* va_list has already been defined */
-#define pthread_va_list va_list
-#endif
-#endif
-
-/* If all else fails... */
-#ifndef pthread_va_list
-#include <stdarg.h>
-#define pthread_va_list va_list
-#endif
-
-#if defined(__STDC__) || defined(__GNUC__)
-#ifndef __P_
-#define __P_(protos) protos
-#endif
-#else
-#ifndef __P_
-#define __P_(protos)
-#endif
-#endif
-
-#endif /* pthread_types_h */
diff --git a/mit-pthreads/include/pthread/unistd.h b/mit-pthreads/include/pthread/unistd.h
deleted file mode 100755
index 3cb07533114..00000000000
--- a/mit-pthreads/include/pthread/unistd.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)unistd.h 5.13 (Berkeley) 6/17/91
- */
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-void _exit __P_((int));
-int access __P_((const char *, int));
-int chdir __P_((const char *));
-int chown __P_((const char *, uid_t, gid_t));
-int close __P_((int));
-int dup __P_((int));
-int dup2 __P_((int, int));
-int execve __P_((const char *, char * const *, char * const *));
-pid_t fork __P_((void));
-int isatty __P_((int));
-int link __P_((const char *, const char *));
-off_t lseek __P_((int, off_t, int));
-int pipe __P_((int *));
-ssize_t read __P_((int, void *, size_t));
-u_int sleep __P_((u_int));
-char *ttyname __P_((int));
-int unlink __P_((const char *));
-ssize_t write __P_((int, const void *, size_t));
-
-/* Not implemented for threads yet */
-u_int alarm __P_((u_int));
-char *cuserid __P_((char *));
-int execl __P_((const char *, const char *, ...));
-int execle __P_((const char *, const char *, ...));
-int execlp __P_((const char *, const char *, ...));
-int execv __P_((const char *, char * const *));
-int execvp __P_((const char *, char * const *));
-long fpathconf __P_((int, int)); /* not yet */
-char *getcwd __P_((char *, size_t));
-gid_t getegid __P_((void));
-uid_t geteuid __P_((void));
-gid_t getgid __P_((void));
-int getgroups __P_((int, int *)); /* XXX (gid_t *) */
-char *getlogin __P_((void));
-pid_t getpgrp __P_((void));
-pid_t getpid __P_((void));
-pid_t getppid __P_((void));
-uid_t getuid __P_((void));
-long pathconf __P_((const char *, int)); /* not yet */
-int pause __P_((void));
-int rmdir __P_((const char *));
-int setgid __P_((gid_t));
-int setpgid __P_((pid_t, pid_t));
-pid_t setsid __P_((void));
-int setuid __P_((uid_t));
-long sysconf __P_((int)); /* not yet */
-pid_t tcgetpgrp __P_((int));
-int tcsetpgrp __P_((int, pid_t));
-
-#ifndef _POSIX_SOURCE
-
-int acct __P_((const char *));
-int async_daemon __P_((void));
-char *brk __P_((const char *));
-int chflags __P_((const char *, long));
-int chroot __P_((const char *));
-char *crypt __P_((const char *, const char *));
-int des_cipher __P_((const char *, char *, long, int));
-int des_setkey __P_((const char *key));
-int encrypt __P_((char *, int));
-void endusershell __P_((void));
-int exect __P_((const char *, char * const *, char * const *));
-int fchdir __P_((int));
-int fchflags __P_((int, long));
-int fchown __P_((int, uid_t, gid_t));
-int fsync __P_((int));
-int ftruncate __P_((int, off_t));
-int getdtablesize __P_((void));
-long gethostid __P_((void));
-int gethostname __P_((char *, int));
-mode_t getmode __P_((const void *, mode_t));
-int getpagesize __P_((void));
-char *getpass __P_((const char *));
-char *getusershell __P_((void));
-char *getwd __P_((char *)); /* obsoleted by getcwd() */
-int initgroups __P_((const char *, int));
-int mknod __P_((const char *, mode_t, dev_t));
-int mkstemp __P_((char *));
-char *mktemp __P_((char *));
-int nfssvc __P_((int));
-int nice __P_((int));
-void psignal __P_((u_int, const char *));
-extern char *sys_siglist[];
-int profil __P_((char *, int, int, int));
-int rcmd __P_((char **, int, const char *,
- const char *, const char *, int *));
-char *re_comp __P_((const char *));
-int re_exec __P_((const char *));
-int readlink __P_((const char *, char *, int));
-int reboot __P_((int));
-int revoke __P_((const char *));
-int rresvport __P_((int *));
-int ruserok __P_((const char *, int, const char *, const char *));
-char *sbrk __P_((int));
-int setegid __P_((gid_t));
-int seteuid __P_((uid_t));
-int setgroups __P_((int, const int *));
-void sethostid __P_((long));
-int sethostname __P_((const char *, int));
-int setkey __P_((const char *));
-int setlogin __P_((const char *));
-void *setmode __P_((const char *));
-int setpgrp __P_((pid_t pid, pid_t pgrp)); /* obsoleted by setpgid() */
-int setregid __P_((int, int));
-int setreuid __P_((int, int));
-int setrgid __P_((gid_t));
-int setruid __P_((uid_t));
-void setusershell __P_((void));
-int swapon __P_((const char *));
-int symlink __P_((const char *, const char *));
-void sync __P_((void));
-int syscall __P_((int, ...));
-int truncate __P_((const char *, off_t));
-int ttyslot __P_((void));
-u_int ualarm __P_((u_int, u_int));
-void usleep __P_((u_int));
-int vfork __P_((void));
-
-#endif /* !_POSIX_SOURCE */
-__END_DECLS
-
diff --git a/mit-pthreads/include/pthread/util.h b/mit-pthreads/include/pthread/util.h
deleted file mode 100755
index aaa33a6318d..00000000000
--- a/mit-pthreads/include/pthread/util.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* ==== util.h ============================================================
- * Copyright (c) 1991, 1992, 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Header file for generic utility functions.
- *
- * 91/08/31 proven - Added exchange.
- * Exchange any two objects of any size in any table.
- *
- * 91/10/06 proven - Cleaned out all the old junk.
- *
- * 91/03/06 proven - Added getint.
- */
-
-#ifndef _PTHREAD_UTIL_H
-#define _PTHREAD_UTIL_H
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-/* Stuff only pthread internals really uses */
-#if defined(PTHREAD_KERNEL)
-
-#undef FALSE
-#undef TRUE
-
-typedef enum Boolean {
- FALSE,
- TRUE
-} Boolean;
-
-#define OK 0
-#define NUL '\0'
-#define NOTOK -1
-
-#if ! defined(min)
-#define min(a,b) (((a)<(b))?(a):(b))
-#define max(a,b) (((a)>(b))?(a):(b))
-#endif
-
-/* Alingn the size to the next multiple of 4 bytes */
-#define ALIGN4(size) ((size + 3) & ~3)
-#define ALIGN8(size) ((size + 7) & ~7)
-
-#ifdef DEBUG
-#define DEBUG0(s) printf(s)
-#define DEBUG1(s,a) printf(s,a)
-#define DEBUG2(s,a,b) printf(s,a,b)
-#define DEBUG3(s,a,b,c) printf(s,a,b,c)
-#else
-#define DEBUG0(s)
-#define DEBUG1(s)
-#define DEBUG2(s)
-#define DEBUG3(s)
-#endif
-
-#endif
-
-#endif
diff --git a/mit-pthreads/include/pthread/version.h b/mit-pthreads/include/pthread/version.h
deleted file mode 100755
index fda3af284d0..00000000000
--- a/mit-pthreads/include/pthread/version.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* ==== version.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Header file for programs that what to KNOW the version.
- *
- * 94/08/24 proven - Added this file for pthreads.
- */
-
-#ifndef _PTHREAD_VERSION_H
-#define _PTHREAD_VERSION_H 1
-#define _PTHREAD_VERSION_M 60
-#define _PTHREAD_VERSION_P 0
-#endif
diff --git a/mit-pthreads/include/pthread/xtypes.h b/mit-pthreads/include/pthread/xtypes.h
deleted file mode 100755
index 4dcc4f04f8c..00000000000
--- a/mit-pthreads/include/pthread/xtypes.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* If you need any special typedefs for function pointers &c to try
- testing for in configure.in, define them here. */
-
-/* According to ANSI, two struct types in the same module are not
- compatible types. So there's no way to define a type for
- pthread_sigset_t that's compatible with sigset_t when they're
- structure types, if we assume we can't pull in a __sigset_t or
- something by itself from system header files.
-
- Since that was my main reason for creating this file, there isn't
- anything here now. If after working on this code a bit longer we
- don't find anything else to put here, this file should just go
- away. */
diff --git a/mit-pthreads/include/pwd.h b/mit-pthreads/include/pwd.h
deleted file mode 100644
index af945a2b8db..00000000000
--- a/mit-pthreads/include/pwd.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)pwd.h 8.2 (Berkeley) 1/21/94
- * $Id$
- */
-
-#ifndef _PWD_H_
-#define _PWD_H_
-
-#include <sys/types.h>
-
-#ifndef _POSIX_SOURCE
-#define _PATH_PASSWD "/etc/passwd"
-#define _PATH_MASTERPASSWD "/etc/master.passwd"
-
-#define _PATH_MP_DB "/etc/pwd.db"
-#define _PATH_SMP_DB "/etc/spwd.db"
-
-#define _PATH_PWD_MKDB "/usr/sbin/pwd_mkdb"
-
-#define _PW_KEYBYNAME '1' /* stored by name */
-#define _PW_KEYBYNUM '2' /* stored by entry in the "file" */
-#define _PW_KEYBYUID '3' /* stored by uid */
-
-#define _PASSWORD_EFMT1 '_' /* extended encryption format */
-
-#define _PASSWORD_LEN 128 /* max length, not counting NULL */
-#endif
-
-struct passwd {
- char *pw_name; /* user name */
- char *pw_passwd; /* encrypted password */
- int pw_uid; /* user uid */
- int pw_gid; /* user gid */
- time_t pw_change; /* password change time */
- char *pw_class; /* user access class */
- char *pw_gecos; /* Honeywell login info */
- char *pw_dir; /* home directory */
- char *pw_shell; /* default shell */
- time_t pw_expire; /* account expiration */
-};
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-struct passwd *getpwuid __P_((uid_t));
-struct passwd *getpwnam __P_((const char *));
-#ifndef _POSIX_SOURCE
-struct passwd *getpwent __P_((void));
-#ifndef _XOPEN_SOURCE
-int setpassent __P_((int));
-#endif
-void setpwent __P_((void));
-void endpwent __P_((void));
-#endif
-__END_DECLS
-
-#endif /* !_PWD_H_ */
diff --git a/mit-pthreads/include/resolv.h b/mit-pthreads/include/resolv.h
deleted file mode 100644
index f6313a7229e..00000000000
--- a/mit-pthreads/include/resolv.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (c) 1983, 1987, 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)resolv.h 5.15 (Berkeley) 4/3/91
- * $Id$
- */
-
-#ifndef _RESOLV_H_
-#define _RESOLV_H_
-
-#include <netinet/in.h>
-/*
- * This is specificly for Solaris which defines NOERROR in the streams
- * header files and defines it differently than in arpa/nameser.h
- */
-#ifdef NOERROR
-#undef NOERROR
-#endif
-#include <arpa/nameser.h>
-
-/*
- * revision information. this is the release date in YYYYMMDD format.
- * it can change every day so the right thing to do with it is use it
- * in preprocessor commands such as "#if (__RES > 19931104)". do not
- * compare for equality; rather, use it to determine whether your resolver
- * is new enough to contain a certain feature.
- */
-
-#define __RES 19940703
-
-/*
- * Resolver configuration file.
- * Normally not present, but may contain the address of the
- * inital name server(s) to query and the domain search list.
- */
-
-#ifndef _PATH_RESCONF
-#define _PATH_RESCONF "/etc/resolv.conf"
-#endif
-
-/*
- * Global defines and variables for resolver stub.
- */
-#define MAXNS 3 /* max # name servers we'll track */
-#define MAXDFLSRCH 3 /* # default domain levels to try */
-#define MAXDNSRCH 6 /* max # domains in search path */
-#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
-#define MAXDNSLUS 4 /* max # of host lookup types */
-
-#define RES_TIMEOUT 5 /* min. seconds between retries */
-#define MAXRESOLVSORT 10 /* number of net to sort on */
-#define RES_MAXNDOTS 15 /* should reflect bit field size */
-
-struct __res_state {
- int retrans; /* retransmition time interval */
- int retry; /* number of times to retransmit */
- long options; /* option flags - see below. */
- int nscount; /* number of name servers */
- struct sockaddr_in nsaddr_list[MAXNS]; /* address of name server */
-#define nsaddr nsaddr_list[0] /* for backward compatibility */
- u_short id; /* current packet id */
- char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
- char defdname[MAXDNAME]; /* default domain */
- long pfcode; /* RES_PRF_ flags - see below. */
- u_char ndots:4; /* threshold for initial abs. query */
- u_char nsort:4; /* number of elements in sort_list[] */
- char unused[3];
- struct {
- struct in_addr addr;
- u_long mask;
- } sort_list[MAXRESOLVSORT];
- char lookups[MAXDNSLUS];
-};
-
-/*
- * Resolver options
- */
-#define RES_INIT 0x0001 /* address initialized */
-#define RES_DEBUG 0x0002 /* print debug messages */
-#define RES_AAONLY 0x0004 /* authoritative answers only */
-#define RES_USEVC 0x0008 /* use virtual circuit */
-#define RES_PRIMARY 0x0010 /* query primary server only */
-#define RES_IGNTC 0x0020 /* ignore trucation errors */
-#define RES_RECURSE 0x0040 /* recursion desired */
-#define RES_DEFNAMES 0x0080 /* use default domain name */
-#define RES_STAYOPEN 0x0100 /* Keep TCP socket open */
-#define RES_DNSRCH 0x0200 /* search up local domain tree */
-
-#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
-
-/*
- * Resolver "pfcode" values. Used by dig.
- */
-#define RES_PRF_STATS 0x0001
-/* 0x0002 */
-#define RES_PRF_CLASS 0x0004
-#define RES_PRF_CMD 0x0008
-#define RES_PRF_QUES 0x0010
-#define RES_PRF_ANS 0x0020
-#define RES_PRF_AUTH 0x0040
-#define RES_PRF_ADD 0x0080
-#define RES_PRF_HEAD1 0x0100
-#define RES_PRF_HEAD2 0x0200
-#define RES_PRF_TTLID 0x0400
-#define RES_PRF_HEADX 0x0800
-#define RES_PRF_QUERY 0x1000
-#define RES_PRF_REPLY 0x2000
-#define RES_PRF_INIT 0x4000
-/* 0x8000 */
-
-#define _res (*_res_status())
-#define h_errno (_res_get_error())
-
-#include <sys/cdefs.h>
-#include <stdio.h>
-
-/* Private routines shared between libc/net, named, nslookup and others. */
-#define dn_skipname __dn_skipname
-#define fp_query __fp_query
-#define hostalias __hostalias
-#define putlong __putlong
-#define putshort __putshort
-#define p_class __p_class
-#define p_time __p_time
-#define p_type __p_type
-__BEGIN_DECLS
-struct __res_state *_res_status __P_((void));
-int _res_get_error __P_((void));
-
-int __dn_skipname __P_((const u_char *, const u_char *));
-void __fp_query __P_((char *, FILE *));
-char *__hostalias __P_((const char *));
-void __putlong __P_((pthread_ipaddr_type, unsigned char *));
-void __putshort __P_((pthread_ipport_type, unsigned char *));
-char *__p_class __P_((int));
-char *__p_time __P_((unsigned long));
-char *__p_type __P_((int));
-
-int dn_comp __P_((const unsigned char *, unsigned char *, int,
- unsigned char **, unsigned char **));
-int dn_expand __P_((const unsigned char *, const unsigned char *,
- const unsigned char *, unsigned char *, int));
-int res_init __P_((void));
-int res_mkquery __P_((int, const char *, int, int, const char *, int,
- const char *, char *, int));
-int res_send __P_((const char *, int, char *, int));
-__END_DECLS
-
-#endif /* !_RESOLV_H_ */
-
diff --git a/mit-pthreads/include/sched.h b/mit-pthreads/include/sched.h
deleted file mode 100644
index dcd9d4e3600..00000000000
--- a/mit-pthreads/include/sched.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ==== pthread.h ============================================================
- * Copyright (c) 1995 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic pthread header.
- *
- * 1.00 93/08/29 proven
- * -Started coding this file.
- */
-
-#ifndef _SCHED_H_
-#define _SCHED_H_
-
-#include <pthread/prio_queue.h>
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-int sched_yield __P_((void));
-int sched_get_priority_max __P_((int));
-int sched_get_priority_min __P_((int));
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/include/signal.h b/mit-pthreads/include/signal.h
deleted file mode 100644
index 9fb1ec6e2c8..00000000000
--- a/mit-pthreads/include/signal.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)signal.h 8.3 (Berkeley) 3/30/94
- */
-
-#ifndef _SIGNAL_H
-#define _SIGNAL_H
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-#include <sys/__signal.h>
-
-__BEGIN_DECLS
-
-int raise __P_((int));
-/* RETSIGTYPE signal __P_((int __sig, RETSIGTYPE)); */
-
-#ifndef _ANSI_SOURCE
-
-int sigfillset __P_((sigset_t *));
-int sigemptyset __P_((sigset_t *));
-int sigaddset __P_((sigset_t *, int));
-int sigdelset __P_((sigset_t *, int));
-int sigismember __P_((const sigset_t *, int));
-int sigsuspend __P_((const sigset_t *));
-int sigprocmask __P_((int, const sigset_t *, sigset_t *));
-
-/* Still need work */
-int kill __P_((pid_t, int));
-int sigaction __P_((int, const struct sigaction *, struct sigaction *));
-int sigpending __P_((sigset_t *));
-
-#ifndef _POSIX_SOURCE
-
-int killpg __P_((pid_t, int));
-int siginterrupt __P_((int, int));
-void psignal __P_((unsigned int, const char *));
-
-/* int sigpause __P_((int)); */
-/* int sigsetmask __P_((int)); */
-/* int sigblock __P_((int)); */
-/* int sigreturn __P_((struct sigcontext *)); */
-/* int sigvec __P_((int, struct sigvec *, struct sigvec *)); */
-/* int sigstack __P_((const struct sigstack *, struct sigstack *)); */
-
-#endif /* !_POSIX_SOURCE */
-#endif /* !_ANSI_SOURCE */
-
-__END_DECLS
-
-#endif /* !_USER_SIGNAL_H */
diff --git a/mit-pthreads/include/stdio.h b/mit-pthreads/include/stdio.h
deleted file mode 100644
index 538d4685f3f..00000000000
--- a/mit-pthreads/include/stdio.h
+++ /dev/null
@@ -1,371 +0,0 @@
-/* ==== stdio.h ============================================================
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdio.h 5.17 (Berkeley) 6/3/91
- * $Id$
- */
-
-#ifndef _STDIO_H_
-#define _STDIO_H_
-
-#include <sys/cdefs.h>
-#include <pthread/types.h>
-#include <pthread/posix.h>
-#include <sys/__stdio.h>
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#define _FSTDIO /* Define for new stdio with functions. */
-
-/*
- * NB: to fit things in six character monocase externals, the stdio
- * code uses the prefix `__s' for stdio objects, typically followed
- * by a three-character attempt at a mnemonic.
- */
-
-/* stdio buffers */
-struct __sbuf {
- unsigned char *_base;
- int _size;
-};
-
-/*
- * stdio state variables.
- *
- * The following always hold:
- *
- * if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR),
- * _lbfsize is -_bf._size, else _lbfsize is 0
- * if _flags&__SRD, _w is 0
- * if _flags&__SWR, _r is 0
- *
- * This ensures that the getc and putc macros (or inline functions) never
- * try to write or read from a file that is in `read' or `write' mode.
- * (Moreover, they can, and do, automatically switch from read mode to
- * write mode, and back, on "r+" and "w+" files.)
- *
- * _lbfsize is used only to make the inline line-buffered output stream
- * code as compact as possible.
- *
- * _ub, _up, and _ur are used when ungetc() pushes back more characters
- * than fit in the current _bf, or when ungetc() pushes back a character
- * that does not match the previous one in _bf. When this happens,
- * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
- * _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
- */
-typedef struct __sFILE {
- unsigned char *_p; /* current position in (some) buffer */
- int _r; /* read space left for getc() */
- int _w; /* write space left for putc() */
- short _flags; /* flags, below; this FILE is free if 0 */
- short _file; /* fileno, if Unix descriptor, else -1 */
- struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */
- int _lbfsize; /* 0 or -_bf._size, for inline putc */
-
- /* separate buffer for long sequences of ungetc() */
- struct __sbuf _ub; /* ungetc buffer */
- unsigned char *_up; /* saved _p when _p is doing ungetc data */
- int _ur; /* saved _r when _r is counting ungetc data */
-
- /* tricks to meet minimum requirements even when malloc() fails */
- unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */
- unsigned char _nbuf[1]; /* guarantee a getc() buffer */
-
- /* separate buffer for fgetline() when line crosses buffer boundary */
- struct __sbuf _lb; /* buffer for fgetline() */
-
- /* Unix stdio files get aligned to block boundaries on fseek() */
- int _blksize; /* stat.st_blksize (may be != _bf._size) */
- int _offset; /* current lseek offset */
-} FILE;
-
-__BEGIN_DECLS
-extern FILE __sF[];
-__END_DECLS
-
-#define __SLBF 0x0001 /* line buffered */
-#define __SNBF 0x0002 /* unbuffered */
-#define __SRD 0x0004 /* OK to read */
-#define __SWR 0x0008 /* OK to write */
- /* RD and WR are never simultaneously asserted */
-#define __SRW 0x0010 /* open for reading & writing */
-#define __SEOF 0x0020 /* found EOF */
-#define __SERR 0x0040 /* found error */
-#define __SMBF 0x0080 /* _buf is from malloc */
-#define __SAPP 0x0100 /* fdopen()ed in append mode */
-#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
-#define __SOPT 0x0400 /* do fseek() optimisation */
-#define __SNPT 0x0800 /* do not do fseek() optimisation */
-#define __SOFF 0x1000 /* set iff _offset is in fact correct */
-#define __SMOD 0x2000 /* true => fgetline modified _p text */
-
-/*
- * The following three definitions are for ANSI C, which took them
- * from System V, which brilliantly took internal interface macros and
- * made them official arguments to setvbuf(), without renaming them.
- * Hence, these ugly _IOxxx names are *supposed* to appear in user code.
- *
- * Although numbered as their counterparts above, the implementation
- * does not rely on this.
- */
-#define _IOFBF 0 /* setvbuf should set fully buffered */
-#define _IOLBF 1 /* setvbuf should set line buffered */
-#define _IONBF 2 /* setvbuf should set unbuffered */
-
-#define BUFSIZ 1024 /* size of buffer used by setbuf */
-#define EOF (-1)
-
-/*
- * FOPEN_MAX is a minimum maximum, and should be the number of descriptors
- * that the kernel can provide without allocation of a resource that can
- * fail without the process sleeping. Do not use this for anything.
- */
-#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */
-#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */
-
-/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */
-#ifndef _ANSI_SOURCE
-#define P_tmpdir "/var/tmp/"
-#endif
-#define L_tmpnam 1024 /* XXX must be == PATH_MAX */
-#ifndef TMP_MAX
-#define TMP_MAX 308915776
-#endif
-
-#ifndef SEEK_SET
-#define SEEK_SET 0 /* set file offset to offset */
-#endif
-#ifndef SEEK_CUR
-#define SEEK_CUR 1 /* set file offset to current plus offset */
-#endif
-#ifndef SEEK_END
-#define SEEK_END 2 /* set file offset to EOF plus offset */
-#endif
-
-#define stdin (&__sF[0])
-#define stdout (&__sF[1])
-#define stderr (&__sF[2])
-
-/*
- * Functions defined in ANSI C standard.
- */
-__BEGIN_DECLS
-void clearerr __P_((FILE *));
-int fclose __P_((FILE *));
-int feof __P_((FILE *));
-int ferror __P_((FILE *));
-int fflush __P_((FILE *));
-int fgetc __P_((FILE *));
-int fgetpos __P_((FILE *, fpos_t *));
-char * fgets __P_((char *, size_t, FILE *));
-FILE * fopen __P_((const char *, const char *));
-int fprintf __P_((FILE *, const char *, ...));
-int fputc __P_((int, FILE *));
-int fputs __P_((const char *, FILE *));
-size_t fread __P_((void *, size_t, size_t, FILE *));
-FILE * freopen __P_((const char *, const char *, FILE *));
-int fscanf __P_((FILE *, const char *, ...));
-int fseek __P_((FILE *, long, int));
-int fsetpos __P_((FILE *, const fpos_t *));
-long ftell __P_((const FILE *));
-size_t fwrite __P_((const void *, size_t, size_t, FILE *));
-int getc __P_((FILE *));
-int getchar __P_((void));
-char * gets __P_((char *));
-
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-extern int sys_nerr; /* perror(3) external variables */
-/* Under NetBSD and BSD 4.4, at least, this is expected to be a const
- array of pointers to const. If you take `const' back out of this
- declaration, please make it conditional on __NetBSD__ and bsd4_4. */
-#ifdef HAVE_SYS_ERRLIST_WITHOUT_CONST
-extern char *sys_errlist[];
-#else
-extern const char *const sys_errlist[];
-#endif
-#endif
-
-void perror __P_((const char *));
-int printf __P_((const char *, ...));
-int putc __P_((int, FILE *));
-int putchar __P_((int));
-int puts __P_((const char *));
-int remove __P_((const char *));
-int rename __P_((const char *, const char *));
-void rewind __P_((FILE *));
-int scanf __P_((const char *, ...));
-void setbuf __P_((FILE *, char *));
-int setvbuf __P_((FILE *, char *, int, size_t));
-int sprintf __P_((char *, const char *, ...));
-int sscanf __P_((const char *, const char *, ...));
-FILE * tmpfile __P_((void));
-char * tmpnam __P_((char *));
-int ungetc __P_((int, FILE *));
-int vfprintf __P_((FILE *, const char *, pthread_va_list));
-int vprintf __P_((const char *, pthread_va_list));
-int vsprintf __P_((char *, const char *, pthread_va_list));
-char *mprintf __P_((const char *, ...));
-char *vmprintf __P_((const char *, pthread_va_list));
-__END_DECLS
-
-/*
- * Functions defined in POSIX 1003.1.
- */
-#ifndef _ANSI_SOURCE
-#define L_ctermid 1024 /* size for ctermid(); PATH_MAX */
-#define L_cuserid 9 /* size for cuserid(); UT_NAMESIZE + 1 */
-
-__BEGIN_DECLS
-char * ctermid __P_((char *));
-char * cuserid __P_((char *));
-FILE * fdopen __P_((int, const char *));
-int fileno __P_((FILE *));
-__END_DECLS
-#endif /* not ANSI */
-
-/*
- * Functions defined in POSIX 1003.4a. (1c)
- */
-#ifndef _ANSI_SOURCE
-__BEGIN_DECLS
-void flockfile __P_((FILE *));
-void funlockfile __P_((FILE *));
-int ftrylockfile __P_((FILE *));
-__END_DECLS
-#endif /* not ANSI */
-
-/*
- * Routines that are purely local.
- */
-#if !defined (_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-__BEGIN_DECLS
-char *fgetline __P_((FILE *, size_t *));
-int fpurge __P_((FILE *));
-int getw __P_((FILE *));
-int pclose __P_((FILE *));
-FILE *popen __P_((const char *, const char *));
-int putw __P_((int, FILE *));
-void setbuffer __P_((FILE *, char *, int));
-int setlinebuf __P_((FILE *));
-char *tempnam __P_((const char *, const char *));
-int snprintf __P_((char *, size_t, const char *, ...));
-int vsnprintf __P_((char *, size_t, const char *, pthread_va_list));
-int vscanf __P_((const char *, pthread_va_list));
-int vsscanf __P_((const char *, const char *, pthread_va_list));
-__END_DECLS
-
-/*
- * This is a #define because the function is used internally and
- * (unlike vfscanf) the name __svfscanf is guaranteed not to collide
- * with a user function when _ANSI_SOURCE or _POSIX_SOURCE is defined.
- */
-#define vfscanf __svfscanf
-
-/*
- * Stdio function-access interface.
- */
-__BEGIN_DECLS
-FILE *funopen __P_((const void *,
- int (*)(void *, char *, int),
- int (*)(void *, const char *, int),
- fpos_t (*)(void *, fpos_t, int),
- int (*)(void *)));
-__END_DECLS
-#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
-#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
-#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
-
-/*
- * Functions internal to the implementation.
- */
-__BEGIN_DECLS
-int __srget __P_((FILE *));
-int __svfscanf __P_((FILE *, const char *, pthread_va_list));
-int __swbuf __P_((int, FILE *));
-__END_DECLS
-
-/*
- * The __sfoo macros are here so that we can
- * define function versions in the C library.
- */
-#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
-
-__BEGIN_DECLS
-int __getc __P_((FILE *));
-__END_DECLS
-
-#define getc(fp) __getc(fp)
-#define getchar() getc(stdin)
-#define getc_unlocked(fp) __sgetc(fp)
-#define getchar_unlocked() getc_unlocked(stdin)
-
-#ifdef __CAN_DO_EXTERN_INLINE
-__INLINE int __sputc(int _c, FILE *_p)
-{
- if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
- return (*_p->_p++ = _c);
- else
- return (__swbuf(_c, _p));
-}
-#else
-__BEGIN_DECLS
-int __sputc __P_((int, FILE *));
-__END_DECLS
-#endif
-
-__BEGIN_DECLS
-int __putc __P_((int, FILE *));
-__END_DECLS
-
-#define putc(x, fp) __putc(x, fp)
-#define putchar(x) putc(x, stdout)
-#define putc_unlocked(x, fp) __sputc(x, fp)
-#define putchar_unlocked(x) putc_unlocked(x, stdout)
-
-#define __sfeof(p) (((p)->_flags & __SEOF) != 0)
-#define __sferror(p) (((p)->_flags & __SERR) != 0)
-#define __sfileno(p) ((p)->_file)
-
-#define feof(p) __sfeof(p)
-#define ferror(p) __sferror(p)
-
-#ifndef _ANSI_SOURCE
-#define fileno(p) __sfileno(p)
-#endif
-
-#endif
diff --git a/mit-pthreads/include/stdlib.h b/mit-pthreads/include/stdlib.h
deleted file mode 100644
index 77f84ffa0bb..00000000000
--- a/mit-pthreads/include/stdlib.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * $Id$
- */
-
-#ifndef _STDLIB_H_
-#define _STDLIB_H_
-
-#include <sys/__stdlib.h>
-
-/* Returned by `div'. */
-typedef struct
- {
- int quot; /* Quotient. */
- int rem; /* Remainder. */
- } div_t;
-
-/* Returned by `ldiv'. */
-typedef struct
- {
- long quot; /* Quotient. */
- long rem; /* Remainder. */
- } ldiv_t;
-
-#ifndef RAND_MAX
-#define RAND_MAX 2147483647
-#endif
-
-#define EXIT_FAILURE 1 /* Failing exit status. */
-#define EXIT_SUCCESS 0 /* Successful exit status. */
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-
-double atof __P_((const char *));
-int atoi __P_((const char *));
-long atol __P_((const char *));
-double strtod __P_((const char *, char **));
-long strtol __P_((const char *, char **, int));
-unsigned long strtoul __P_((const char *, char **, int));
-
-int rand __P_((void));
-void srand __P_((unsigned int));
-
-long random __P_((void));
-void srandom __P_((unsigned int));
-char * initstate __P_((unsigned int, char *, int));
-char * setstate __P_((char *));
-
-void * malloc __P_((size_t));
-void * realloc __P_((void *, size_t));
-void * calloc __P_((size_t, size_t));
-void free __P_((void *));
-
-__NORETURN void abort __P_((void));
-int atexit __P_((void (* __func)() ));
-__NORETURN void exit __P_((int));
-int system __P_((const char *));
-
-extern char ** environ;
-
-char * getenv __P_((const char *));
-int putenv __P_((const char *));
-int setenv __P_((const char *, const char *, int));
-void unsetenv __P_((const char *));
-
-void * bsearch __P_((const void *, const void *, size_t, size_t,
- int (* __func)__P_((const void *, const void *)) ));
-void qsort __P_((void *, size_t, size_t,
- int (* __func)__P_((const void *, const void *)) ));
-
-int abs __P_((int));
-long labs __P_((long));
-div_t div __P_((int, int));
-ldiv_t ldiv __P_((long, long));
-
-void * memchr __P_((const void *, int, size_t));
-
-/* Stuff to do */
-int mblen __P_((const char *, size_t));
-int mbtowc __P_((wchar_t *, const char *, size_t));
-int wctomb __P_((char *, wchar_t));
-size_t mbstowcs __P_((wchar_t *, const char *, size_t));
-size_t wcstombs __P_((char *, const wchar_t *, size_t));
-
-
-__END_DECLS
-
-#endif /* !_STDLIB_H_ */
diff --git a/mit-pthreads/include/string.h b/mit-pthreads/include/string.h
deleted file mode 100644
index 4143a1cfec7..00000000000
--- a/mit-pthreads/include/string.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* $NetBSD: string.h,v 1.6 1994/10/26 00:56:30 cgd Exp $ */
-
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)string.h 5.10 (Berkeley) 3/9/91
- */
-
-#ifndef _STRING_H_
-#define _STRING_H_
-#include <sys/cdefs.h>
-#include <pthread/types.h>
-#include <pthread/posix.h>
-#include <sys/__string.h>
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-__BEGIN_DECLS
-void *memchr __P_((const void *, int, size_t));
-int memcmp __P_((const void *, const void *, size_t));
-void *memcpy __P_((void *, const void *, size_t));
-void *memmove __P_((void *, const void *, size_t));
-void *memset __P_((void *, int, size_t));
-char *strcat __P_((char *, const char *));
-char *strchr __P_((const char *, int));
-int strcmp __P_((const char *, const char *));
-int strcoll __P_((const char *, const char *));
-char *strcpy __P_((char *, const char *));
-size_t strcspn __P_((const char *, const char *));
-char *strerror __P_((int));
-size_t strlen __P_((const char *));
-char *strncat __P_((char *, const char *, size_t));
-int strncmp __P_((const char *, const char *, size_t));
-char *strncpy __P_((char *, const char *, size_t));
-char *strpbrk __P_((const char *, const char *));
-char *strrchr __P_((const char *, int));
-size_t strspn __P_((const char *, const char *));
-char *strstr __P_((const char *, const char *));
-char *strtok __P_((char *, const char *));
-char *strtok_r __P_((char *, const char *, char **));
-size_t strxfrm __P_((char *, const char *, size_t));
-
-/* Nonstandard routines common to all pthreads supported platforms */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-int ffs __P_((int));
-void *memccpy __P_((void *, const void *, int, size_t));
-int strcasecmp __P_((const char *, const char *));
-int strncasecmp __P_((const char *, const char *, size_t));
-char *strsignal __P_((int));
-void swab __P_((const void *, void *, size_t));
-#endif
-__END_DECLS
-
-#endif /* _STRING_H_ */
diff --git a/mit-pthreads/include/syslog.h b/mit-pthreads/include/syslog.h
deleted file mode 100644
index 31b42285fc1..00000000000
--- a/mit-pthreads/include/syslog.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 1982, 1986 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- *
- * @(#)syslog.h 7.8 (Berkeley) 5/26/88
- */
-
-#ifndef SYSLOG_H
-#define SYSLOG_H
-
-/* Added __[BEGIN/END]_DECLS so this file would work with C++. (mevans) */
-#include <sys/cdefs.h>
-#include <stdarg.h>
-
-/* Discipline: openlog(), closelog(), and setlogmask() are not thread-safe
- * and should only be called when other threads will not be calling syslog
- * functions. syslog() and vsyslog() are thread-safe and may be called
- * asynchronously, even if openlog() has not been called. */
-
-/*
- * Facility codes
- */
-
-#define LOG_KERN (0<<3) /* kernel messages */
-#define LOG_USER (1<<3) /* random user-level messages */
-#define LOG_MAIL (2<<3) /* mail system */
-#define LOG_DAEMON (3<<3) /* system daemons */
-#define LOG_AUTH (4<<3) /* security/authorization messages */
-#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
-#define LOG_LPR (6<<3) /* line printer subsystem */
-#define LOG_NEWS (7<<3) /* network news subsystem */
-#define LOG_UUCP (8<<3) /* UUCP subsystem */
- /* other codes through 15 reserved for system use */
-#define LOG_LOCAL0 (16<<3) /* reserved for local use */
-#define LOG_LOCAL1 (17<<3) /* reserved for local use */
-#define LOG_LOCAL2 (18<<3) /* reserved for local use */
-#define LOG_LOCAL3 (19<<3) /* reserved for local use */
-#define LOG_LOCAL4 (20<<3) /* reserved for local use */
-#define LOG_LOCAL5 (21<<3) /* reserved for local use */
-#define LOG_LOCAL6 (22<<3) /* reserved for local use */
-#define LOG_LOCAL7 (23<<3) /* reserved for local use */
-
-#define LOG_NFACILITIES 24 /* maximum number of facilities */
-#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
-
-#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) /* facility of pri */
-
-/*
- * Priorities (these are ordered)
- */
-
-#define LOG_EMERG 0 /* system is unusable */
-#define LOG_ALERT 1 /* action must be taken immediately */
-#define LOG_CRIT 2 /* critical conditions */
-#define LOG_ERR 3 /* error conditions */
-#define LOG_WARNING 4 /* warning conditions */
-#define LOG_NOTICE 5 /* normal but signification condition */
-#define LOG_INFO 6 /* informational */
-#define LOG_DEBUG 7 /* debug-level messages */
-
-#define LOG_PRIMASK 0x0007 /* mask to extract priority part (internal) */
-#define LOG_PRI(p) ((p) & LOG_PRIMASK) /* extract priority */
-
-#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
-
-#ifdef KERNEL
-#define LOG_PRINTF -1 /* pseudo-priority to indicate use of printf */
-#endif
-
-/*
- * arguments to setlogmask.
- */
-#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
-#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
-
-/*
- * Option flags for openlog.
- *
- * LOG_ODELAY no longer does anything; LOG_NDELAY is the
- * inverse of what it used to be.
- */
-#define LOG_PID 0x01 /* log the pid with each message */
-#define LOG_CONS 0x02 /* log on the console if errors in sending */
-#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
-#define LOG_NDELAY 0x08 /* don't delay open */
-#define LOG_NOWAIT 0x10 /* if forking to log on console, don't wait() */
-
-__BEGIN_DECLS
-
-/* Syslogging functions. */
-void syslog(int pri, char *fmt, ...);
-void vsyslog(int pri, char *fmt, va_list args);
-void openlog(char *ident, int logstat, int logfac);
-void closelog(void);
-int setlogmask(int pmask);
-
-__END_DECLS
-
-#endif
-
diff --git a/mit-pthreads/include/time.h b/mit-pthreads/include/time.h
deleted file mode 100644
index 614bbeb2a59..00000000000
--- a/mit-pthreads/include/time.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * $Id$
- */
-
-#ifndef _TIME_H_
-#define _TIME_H_
-
-#include <sys/__time.h>
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#ifndef __hpux__
-struct tm {
- int tm_sec; /* seconds after the minute [0-60] */
- int tm_min; /* minutes after the hour [0-59] */
- int tm_hour; /* hours since midnight [0-23] */
- int tm_mday; /* day of the month [1-31] */
- int tm_mon; /* months since January [0-11] */
- int tm_year; /* years since 1900 */
- int tm_wday; /* days since Sunday [0-6] */
- int tm_yday; /* days since January 1 [0-365] */
- int tm_isdst; /* Daylight Savings Time flag */
- long tm_gmtoff; /* offset from CUT in seconds */
- char *tm_zone; /* timezone abbreviation */
-};
-#endif /* __hpux__ */
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-/* clock_t clock __P_((void)); */
-
-char * asctime __P_((const struct tm *));
-double difftime __P_((time_t, time_t));
-char * ctime __P_((const time_t *));
-struct tm * gmtime __P_((const time_t *));
-struct tm * localtime __P_((const time_t *));
-
-char * asctime_r __P_((const struct tm *, char *));
-char * ctime_r __P_((const time_t *, char *));
-struct tm * gmtime_r __P_((const time_t *, struct tm *));
-struct tm * localtime_r __P_((const time_t *, struct tm *));
-
-time_t mktime __P_((struct tm *));
-
-/* size_t strftime __P_((char *, size_t, const char *, const struct tm *)); */
-time_t time __P_((time_t *));
-
-#if !defined(_ANSI_SOURCE)
-/* #define CLK_TCK 100 */
-extern char *tzname[2];
-void tzset __P_((void));
-#endif /* not ANSI */
-
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-/* char *timezone __P_((int, int)); */
-void tzsetwall __P_((void));
-#endif /* neither ANSI nor POSIX */
-
-__END_DECLS
-
-#endif /* !_TIME_H_ */
diff --git a/mit-pthreads/include/timers.h b/mit-pthreads/include/timers.h
deleted file mode 100644
index 9a0196a3631..00000000000
--- a/mit-pthreads/include/timers.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _TIMERS_H_
-#define _TIMERS_H_
-
-#include <sys/timers.h>
-
-#endif
diff --git a/mit-pthreads/include/tzfile.h b/mit-pthreads/include/tzfile.h
deleted file mode 100644
index 7a486302e10..00000000000
--- a/mit-pthreads/include/tzfile.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Arthur David Olson of the National Cancer Institute.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)tzfile.h 5.10 (Berkeley) 4/3/91
- * $Id$
- */
-
-#ifndef _TZFILE_H_
-#define _TZFILE_H_
-
-#include <pthread/paths.h>
-
-/*
- * Information about time zone files.
- */
-#define TZDIR _PATH_TZDIR
-#define TZDEFAULT _PATH_TZFILE
-#define TZDEFRULES "posixrules"
-
-/*
-** Each file begins with. . .
-*/
-
-struct tzhead {
- char tzh_reserved[24]; /* reserved for future use */
- char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
- char tzh_leapcnt[4]; /* coded number of leap seconds */
- char tzh_timecnt[4]; /* coded number of transition times */
- char tzh_typecnt[4]; /* coded number of local time types */
- char tzh_charcnt[4]; /* coded number of abbr. chars */
-};
-
-/*
-** . . .followed by. . .
-**
-** tzh_timecnt (char [4])s coded transition times a la time(2)
-** tzh_timecnt (unsigned char)s types of local time starting at above
-** tzh_typecnt repetitions of
-** one (char [4]) coded GMT offset in seconds
-** one (unsigned char) used to set tm_isdst
-** one (unsigned char) that's an abbreviation list index
-** tzh_charcnt (char)s '\0'-terminated zone abbreviations
-** tzh_leapcnt repetitions of
-** one (char [4]) coded leap second transition times
-** one (char [4]) total correction after above
-** tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition
-** time is standard time, if FALSE,
-** transition time is wall clock time
-** if absent, transition times are
-** assumed to be wall clock time
-*/
-
-/*
-** In the current implementation, "tzset()" refuses to deal with files that
-** exceed any of the limits below.
-*/
-
-/*
-** The TZ_MAX_TIMES value below is enough to handle a bit more than a
-** year's worth of solar time (corrected daily to the nearest second) or
-** 138 years of Pacific Presidential Election time
-** (where there are three time zone transitions every fourth year).
-*/
-#define TZ_MAX_TIMES 370
-
-#define NOSOLAR /* 4BSD doesn't currently handle solar time */
-
-#ifndef NOSOLAR
-#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
-#else
-#define TZ_MAX_TYPES 10 /* Maximum number of local time types */
-#endif
-
-#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */
-
-#define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */
-
-#define SECSPERMIN 60
-#define MINSPERHOUR 60
-#define HOURSPERDAY 24
-#define DAYSPERWEEK 7
-#define DAYSPERNYEAR 365
-#define DAYSPERLYEAR 366
-#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR)
-#define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY)
-#define MONSPERYEAR 12
-
-#define TM_SUNDAY 0
-#define TM_MONDAY 1
-#define TM_TUESDAY 2
-#define TM_WEDNESDAY 3
-#define TM_THURSDAY 4
-#define TM_FRIDAY 5
-#define TM_SATURDAY 6
-
-#define TM_JANUARY 0
-#define TM_FEBRUARY 1
-#define TM_MARCH 2
-#define TM_APRIL 3
-#define TM_MAY 4
-#define TM_JUNE 5
-#define TM_JULY 6
-#define TM_AUGUST 7
-#define TM_SEPTEMBER 8
-#define TM_OCTOBER 9
-#define TM_NOVEMBER 10
-#define TM_DECEMBER 11
-
-#define TM_YEAR_BASE 1900
-
-#define EPOCH_YEAR 1970
-#define EPOCH_WDAY TM_THURSDAY
-
-/*
-** Accurate only for the past couple of centuries;
-** that will probably do.
-*/
-
-#define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0)
-
-#endif /* !_TZFILE_H_ */
-
diff --git a/mit-pthreads/include/unistd.h b/mit-pthreads/include/unistd.h
deleted file mode 100644
index 213aa983172..00000000000
--- a/mit-pthreads/include/unistd.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)unistd.h 5.13 (Berkeley) 6/17/91
- */
-
-#ifndef _UNISTD_H_
-#define _UNISTD_H_
-
-#include <sys/cdefs.h>
-#include <sys/__unistd.h>
-
-#define R_OK 4
-#define W_OK 2
-#define X_OK 1
-#define F_OK 0
-
-#ifndef SEEK_SET
-#define SEEK_SET 0 /* set file offset to offset */
-#endif
-#ifndef SEEK_CUR
-#define SEEK_CUR 1 /* set file offset to current plus offset */
-#endif
-#ifndef SEEK_END
-#define SEEK_END 2 /* set file offset to EOF plus offset */
-#endif
-
-#define STDIN_FILENO 0 /* standard input file descriptor */
-#define STDOUT_FILENO 1 /* standard output file descriptor */
-#define STDERR_FILENO 2 /* standard error file descriptor */
-
-__BEGIN_DECLS
-void _exit __P_((int));
-int access __P_((const char *, int));
-int chdir __P_((const char *));
-int chown __P_((const char *, uid_t, gid_t));
-int close __P_((int));
-int dup __P_((int));
-int dup2 __P_((int, int));
-int execve __P_((const char *, char * const *, char * const *));
-pid_t fork __P_((void));
-int isatty __P_((int));
-int link __P_((const char *, const char *));
-off_t lseek __P_((int, off_t, int));
-int pipe __P_((int *));
-ssize_t read __P_((int, void *, size_t));
-unsigned sleep __P_((unsigned));
-char *ttyname __P_((int));
-int unlink __P_((const char *));
-ssize_t write __P_((int, const void *, size_t));
-
-/* Not implemented for threads yet */
-unsigned alarm __P_((unsigned));
-char *cuserid __P_((char *));
-int execl __P_((const char *, const char *, ...));
-int execle __P_((const char *, const char *, ...));
-int execlp __P_((const char *, const char *, ...));
-int execv __P_((const char *, char * const *));
-int execvp __P_((const char *, char * const *));
-long fpathconf __P_((int, int)); /* not yet */
-char *getcwd __P_((char *, size_t));
-gid_t getegid __P_((void));
-uid_t geteuid __P_((void));
-gid_t getgid __P_((void));
-int getgroups __P_((int, gid_t *)); /* XXX (gid_t *) */
-char *getlogin __P_((void));
-pid_t getpgrp __P_((void));
-pid_t getpid __P_((void));
-pid_t getppid __P_((void));
-uid_t getuid __P_((void));
-long pathconf __P_((const char *, int)); /* not yet */
-int pause __P_((void));
-int rmdir __P_((const char *));
-int setgid __P_((gid_t));
-int setpgid __P_((pid_t, pid_t));
-pid_t setsid __P_((void));
-int setuid __P_((uid_t));
-long sysconf __P_((int)); /* not yet */
-pid_t tcgetpgrp __P_((int));
-int tcsetpgrp __P_((int, pid_t));
-
-#ifndef _POSIX_SOURCE
-
-int acct __P_((const char *));
-int async_daemon __P_((void));
-char *brk __P_((const char *));
-/* int chflags __P_((const char *, long)); */
-int chroot __P_((const char *));
-char *crypt __P_((const char *, const char *));
-int des_cipher __P_((const char *, char *, long, int));
-void des_setkey __P_((const char *key));
-void encrypt __P_((char *, int));
-void endusershell __P_((void));
-int exect __P_((const char *, char * const *, char * const *));
-int fchdir __P_((int));
-/* int fchflags __P_((int, long)); */
-int fchown __P_((int, uid_t, gid_t));
-int fsync __P_((int));
-int ftruncate __P_((int, off_t));
-int getdtablesize __P_((void));
-long gethostid __P_((void));
-int gethostname __P_((char *, int));
-mode_t getmode __P_((const void *, mode_t));
-int getpagesize __P_((void));
-char *getpass __P_((const char *));
-char *getusershell __P_((void));
-char *getwd __P_((char *)); /* obsoleted by getcwd() */
-int initgroups __P_((const char *, gid_t));
-int mknod __P_((const char *, mode_t, dev_t));
-int mkstemp __P_((char *));
-char *mktemp __P_((char *));
-int nfssvc __P_((int));
-int nice __P_((int));
-void psignal __P_((unsigned, const char *));
-/* extern char *sys_siglist[]; */
-int profil __P_((char *, int, int, int));
-int rcmd __P_((char **, int, const char *,
- const char *, const char *, int *));
-char *re_comp __P_((const char *));
-int re_exec __P_((const char *));
-int readlink __P_((const char *, char *, int));
-int reboot __P_((int));
-int revoke __P_((const char *));
-int rresvport __P_((int *));
-int ruserok __P_((const char *, int, const char *, const char *));
-char *sbrk __P_((int));
-int setegid __P_((gid_t));
-int seteuid __P_((uid_t));
-int setgroups __P_((int, const gid_t *));
-void sethostid __P_((long));
-int sethostname __P_((const char *, int));
-void setkey __P_((const char *));
-int setlogin __P_((const char *));
-void *setmode __P_((const char *));
-int setpgrp __P_((pid_t pid, pid_t pgrp)); /* obsoleted by setpgid() */
-int setregid __P_((int, int));
-int setreuid __P_((int, int));
-int setrgid __P_((gid_t));
-int setruid __P_((uid_t));
-void setusershell __P_((void));
-int swapon __P_((const char *));
-int symlink __P_((const char *, const char *));
-void sync __P_((void));
-int syscall __P_((int, ...));
-int truncate __P_((const char *, off_t));
-int ttyslot __P_((void));
-unsigned ualarm __P_((unsigned, unsigned));
-void usleep __P_((unsigned));
-int vfork __P_((void));
-
-#endif /* !_POSIX_SOURCE */
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/lib/.cvsignore b/mit-pthreads/lib/.cvsignore
deleted file mode 100644
index f3c7a7c5da6..00000000000
--- a/mit-pthreads/lib/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-Makefile
diff --git a/mit-pthreads/lib/Makefile.in b/mit-pthreads/lib/Makefile.in
deleted file mode 100644
index 821d293d896..00000000000
--- a/mit-pthreads/lib/Makefile.in
+++ /dev/null
@@ -1,48 +0,0 @@
-# === GNUmakefile ============================================================
-# Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
-#
-# Description: This file is for creating the test programs for libpthread.a
-#
-# 1.00 93/08/03 proven
-# -Initial cut for pthreads.
-#
-
-CC = ../pgcc -notinstalled
-srctop = @srctop@
-srcdir = @srctop@/lib
-VPATH = @srctop@/lib
-CDEBUGFLAGS = @CFLAGS@
-
-CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(ADDL_CFLAGS) -DSRCDIR=\"$(srcdir)\"
-
-#
-DIRS = libpthreadutil
-
-################################################################################
-#
-all:
- (for i in $(DIRS); do cd $$i; $(MAKE) all; cd ..; done)
-
-clean:
- (for i in $(DIRS); do cd $$i; $(MAKE) clean; cd ..; done)
- rm -f *.o $(TESTS) $(BENCHMARKS) a.out core maketmp makeout
-
-depend:
- (for i in $(DIRS); do cd $$i; $(MAKE) depend; cd ..; done)
- sed '/\#\#\# Dependencies/q' < Makefile > maketmp
- (for i in $(CSRC);do $(CPP) -M $$i;done) >> maketmp
- cp maketmp Makefile
-
-install:
- (for i in $(DIRS); do cd $$i; $(MAKE) install; cd ..; done)
-
-realclean: clean
- (for i in $(DIRS); do cd $$i; $(MAKE) realclean; cd ..; done)
- rm -f Makefile
-
-Makefile: Makefile.in
- (cd .. ; sh config.status)
-
-################################################################################
-### Do not remove the following line. It is for depend #########################
-### Dependencies:
diff --git a/mit-pthreads/lib/libpthreadutil/.cvsignore b/mit-pthreads/lib/libpthreadutil/.cvsignore
deleted file mode 100644
index f3c7a7c5da6..00000000000
--- a/mit-pthreads/lib/libpthreadutil/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-Makefile
diff --git a/mit-pthreads/lib/libpthreadutil/Makefile.in b/mit-pthreads/lib/libpthreadutil/Makefile.in
deleted file mode 100755
index 94034f426b3..00000000000
--- a/mit-pthreads/lib/libpthreadutil/Makefile.in
+++ /dev/null
@@ -1,65 +0,0 @@
-# === makefile ============================================================
-# Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
-#
-# Description: This file is for creating the test programs for libpthread.a
-#
-# 1.00 93/08/03 proven
-# -Initial cut for pthreads.
-#
-
-srctop = @srctop@
-srcdir = @srctop@/lib/libpthreadutil
-VPATH = @srctop@/lib/libpthreadutil
-prefix= @prefix@
-exec_prefix= @exec_prefix@
-
-INSTALL_PATH = @exec_prefix@
- BINDIR = $(INSTALL_PATH)/bin
- LIBDIR = $(INSTALL_PATH)/lib
- MANDIR = $(INSTALL_PATH)/man
- INCDIR = $(INSTALL_PATH)/include
-
- CC = ../../pgcc -notinstalled
- CDEBUGFLAGS = @CFLAGS@
- CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(ADDL_CFLAGS) -DSRCDIR=\"$(srcdir)\"
- RANLIB = @RANLIB@
-
- OBJS = pthread_tad.o pthread_atexit.o
- LIBRARY = libpthreadutil.a
- HEADERS = pthreadutil.h
-
-################################################################################
-#
-all : $(LIBRARY)
-
-clean:
- rm -f *.o $(TESTS) $(BENCHMARKS) a.out core maketmp makeout
-
-depend:
- sed '/\#\#\# Dependencies/q' < Makefile > maketmp
- (for i in $(CSRC);do $(CPP) -M $$i;done) >> maketmp
- cp maketmp Makefile
-
-install: $(LIBRARY)
- install $(LIBRARY) $(LIBDIR)
- for x in $(HEADERS); \
- do cp $(srcdir)/$$x $(INCDIR); \
- done
-
-realclean: clean
- rm -f Makefile
-
-Makefile: Makefile.in
- (cd ../.. ; sh config.status)
-
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
-$(LIBRARY) : ${OBJS}
- ar r new.a ${OBJS} && \
- $(RANLIB) new.a && \
- mv -f new.a $(LIBRARY)
-
-################################################################################
-### Do not remove the following line. It is for depend #########################
-### Dependencies:
diff --git a/mit-pthreads/lib/libpthreadutil/pthread_atexit.c b/mit-pthreads/lib/libpthreadutil/pthread_atexit.c
deleted file mode 100755
index f244fbfb0c8..00000000000
--- a/mit-pthreads/lib/libpthreadutil/pthread_atexit.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/* ==== pthread_atexit.c =====================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Pthread attribute functions.
- *
- * 1.20 94/02/13 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#define PTHREAD_KERNEL
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "pthreadutil.h"
-
-static int pthread_atexit_inited = 0;
-static pthread_key_t pthread_atexit_key;
-static pthread_mutex_t pthread_atexit_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-/* ==========================================================================
- * pthread_atexit_done()
- */
-static void pthread_atexit_done(void * arg)
-{
- pthread_atexit_t id, id_next;
-
- for (id = arg; id; id = id_next) {
- id_next = id->next;
- id->rtn(id->arg);
- free(id);
- }
-}
-
-/* ==========================================================================
- * pthread_atexit_add()
- */
-int pthread_atexit_add(pthread_atexit_t *id, void (*rtn)(void *), void * arg)
-{
- int ret;
-
- if (ret = pthread_mutex_lock(&pthread_atexit_mutex)) {
- return(ret);
- }
- if (!pthread_atexit_inited) {
- if (ret = pthread_key_create(&pthread_atexit_key, pthread_atexit_done)){
- pthread_mutex_unlock(&pthread_atexit_mutex);
- return(ret);
- }
- pthread_atexit_inited++;
- }
- pthread_mutex_unlock(&pthread_atexit_mutex);
-
- if ((*id) = (pthread_atexit_t)malloc(sizeof(struct pthread_atexit))) {
- if ((*id)->next = pthread_getspecific(pthread_atexit_key)) {
- (*id)->next->prev = (*id);
- }
- pthread_setspecific(pthread_atexit_key, (void *)*id);
- (*id)->prev = NULL;
- (*id)->rtn = rtn;
- (*id)->arg = arg;
- return(OK);
- }
- return(ENOMEM);
-}
-
-/* ==========================================================================
- * pthread_atexit_remove()
- */
-int pthread_atexit_remove(pthread_atexit_t * id, int execute)
-{
- pthread_atexit_t old;
-
- if (old = pthread_getspecific(pthread_atexit_key)) {
- if (old == *id) {
- old = old->next;
- old->prev = NULL;
- pthread_setspecific(pthread_atexit_key, old);
- } else {
- if ((*id)->next) {
- (*id)->next->prev = (*id)->prev;
- }
- (*id)->prev->next = (*id)->next;
- }
- if (execute) {
- (*id)->rtn((*id)->arg);
- }
- free((*id));
- return(OK);
- }
- return(EINVAL);
-}
-
-/* ==========================================================================
- * A few non void functions that are often used as void functions
- */
-void fflush_nrv(void * fp) { fflush((FILE *)fp); }
-void fclose_nrv(void * fp) { fclose((FILE *)fp); }
-
-void pthread_attr_destroy_nrv(void * attr)
-{
- pthread_attr_destroy((pthread_attr_t *)attr);
-}
diff --git a/mit-pthreads/lib/libpthreadutil/pthread_tad.c b/mit-pthreads/lib/libpthreadutil/pthread_tad.c
deleted file mode 100755
index a59fd9b87bf..00000000000
--- a/mit-pthreads/lib/libpthreadutil/pthread_tad.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* ==== pthread_tad.c =========================================================
- * Copyright (c) 1995 by Chris Provenzano, proven@athena.mit.edu
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano,
- * and its contributors.
- * 4. Neither the name of Chris Provenzano, nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO, AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef lint
-static char copyright[] =
- "@(#) Copyright (c) 1995 Chris Provenzano.\nAll rights reserved.\n";
-#endif /* not lint */
-
-/* tad = thread allocation domain */
-#define PTHREAD_KERNEL
-
-#include "pthreadutil.h"
-#include <stdio.h>
-#include <errno.h>
-
-int pthread_tad_count(pthread_tad_t * tad)
-{
- int ret;
-
- pthread_mutex_lock(&tad->mutex);
- ret = tad->count_current;
- pthread_mutex_unlock(&tad->mutex);
- return(ret);
-}
-
-static void pthread_tad_done(void * arg)
-{
- pthread_tad_t * tad = arg;
- pthread_mutex_lock(&tad->mutex);
- --tad->count_current;
-/* if (--tad->count_current < tad->count_max) */
- pthread_cond_broadcast(&tad->cond);
- pthread_mutex_unlock(&tad->mutex);
-}
-
-#ifndef PTHREAD_KERNEL
-struct tad_start {
- pthread_tad_t * tad;
- void * (*routine)();
- void * arg;
-};
-
-static void * pthread_tad_start(struct tad_start * tad_start)
-{
- void * (*routine)() = tad_start->routine;
- void * arg = tad_start->arg;
-
- pthread_mutex_lock(&tad_start->tad->mutex);
- pthread_cleanup_push(pthread_tad_done, tad_start->tad);
- pthread_mutex_unlock(&tad_start->tad->mutex);
- free(tad_start);
- return(routine(arg));
-}
-#else
-static void * pthread_tad_start(void * tad_start_arg)
-{
- pthread_tad_t * tad = tad_start_arg;
- void * (*routine)() = tad->routine;
- void * arg = tad->arg;
-
- tad->count_current++;
- pthread_cleanup_push(pthread_tad_done, tad);
- pthread_mutex_unlock(&tad->mutex);
- return(routine(arg));
-}
-#endif
-
-int pthread_tad_create(pthread_tad_t * tad, pthread_t *thread_id,
- pthread_attr_t *attr, void * (*routine)(), void * arg)
-{
-#ifndef PTHREAD_KERNEL
- struct tad_start tad;
-#endif
- int ret;
-
- pthread_mutex_lock(&tad->mutex);
- while (tad->count_max && (tad->count_current > tad->count_max))
- pthread_cond_wait(&tad->cond, &tad->mutex);
-
-#ifndef PTHREAD_KERNEL
- if ((tad_start = malloc(sizeof(struct tad_start))) == NULL) {
- pthread_mutex_unlock(&tad->mutex);
- return(ENOMEM);
- }
- tad_start->routine = routine;
- tad_start->arg = arg;
- tad_start->tad = tad;
- if ((ret = pthread_create(thread_id, attr,
- pthread_tad_start, tad_start)) == OK)
- tad->count_current++;
- pthread_mutex_unlock(&tad->mutex);
-#else
- tad->routine = routine;
- tad->arg = arg;
- if (ret = pthread_create(thread_id, attr, pthread_tad_start, tad))
- pthread_mutex_unlock(&tad->mutex);
-#endif
- return(ret);
-}
-
-int pthread_tad_wait(pthread_tad_t * tad, unsigned int count)
-{
- if ((tad->count_max) && (tad->count_max < count)) {
- return(EINVAL);
- }
- pthread_mutex_lock(&tad->mutex);
- while (tad->count_current > count)
- pthread_cond_wait(&tad->cond, &tad->mutex);
- pthread_mutex_unlock(&tad->mutex);
- return(OK);
-}
-
-int pthread_tad_init(pthread_tad_t * tad, unsigned int max_count)
-{
- int ret;
-
- if ((ret = pthread_mutex_init(&tad->mutex, NULL)) == OK) {
- if (ret = pthread_cond_init(&tad->cond, NULL)) {
- pthread_mutex_destroy(&tad->mutex);
- } else {
- tad->count_max = max_count;
- tad->count_current = 0;
- }
- }
- return(ret);
-}
-
-/* User is responsible to make sure their are no threads running */
-int pthread_tad_destroy(pthread_tad_t * tad)
-{
- int ret;
-
- if ((ret = pthread_mutex_destroy(&tad->mutex)) == OK) {
- ret = pthread_cond_destroy(&tad->cond);
- } else {
- pthread_cond_destroy(&tad->cond);
- }
- tad->count_max = NOTOK;
- return(ret);
-}
diff --git a/mit-pthreads/lib/libpthreadutil/pthreadutil.h b/mit-pthreads/lib/libpthreadutil/pthreadutil.h
deleted file mode 100755
index 0d8e6a6ef5f..00000000000
--- a/mit-pthreads/lib/libpthreadutil/pthreadutil.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* ==== pthread_tad.h ========================================================
- * Copyright (c) 1995 by Chris Provenzano, proven@athena.mit.edu
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano,
- * and its contributors.
- * 4. Neither the name of Chris Provenzano, nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO, AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include <pthread.h>
-#include <sys/cdefs.h>
-
-typedef struct pthread_tad_t {
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- unsigned int count_current;
- unsigned int count_max;
- void * arg;
- void * (*routine)();
-} pthread_tad_t;
-
-typedef struct pthread_atexit {
- struct pthread_atexit * next;
- struct pthread_atexit * prev;
- void (*rtn)(void *);
- void * arg;
-} * pthread_atexit_t;
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-int pthread_tad_count __P_((pthread_tad_t *));
-int pthread_tad_create __P_((pthread_tad_t *, pthread_t *, pthread_attr_t *,
- void *(*routine)(), void *));
-int pthread_tad_wait __P_((pthread_tad_t *, unsigned int));
-int pthread_tad_init __P_((pthread_tad_t *, unsigned int));
-int pthread_tad_destroy __P_((pthread_tad_t *));
-
-int pthread_atexit_add __P_((pthread_atexit_t *, void (*)(void *), void *));
-int pthread_atexit_remove __P_((pthread_atexit_t *, int));
-
-
-void fclose_nrv __P_((void *));
-void fflush_nrv __P_((void *));
-void pthread_attr_destroy_nrv __P_((void *));
-
-__END_DECLS
-
diff --git a/mit-pthreads/machdep/alpha-osf1/__math.h b/mit-pthreads/machdep/alpha-osf1/__math.h
deleted file mode 100755
index 12fdc85678c..00000000000
--- a/mit-pthreads/machdep/alpha-osf1/__math.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * ANSI required entries in math.h
- *
- */
-#ifdef _ANSI_C_SOURCE
-
-#if defined(_IEEE_FP)
-# define HUGE_VAL 1.8e308
-#else
-# define HUGE_VAL 1.797693134862315708e308
-#endif
-
-#endif /*_ANSI_C_SOURCE */
-
-
-
diff --git a/mit-pthreads/machdep/alpha-osf1/__signal.h b/mit-pthreads/machdep/alpha-osf1/__signal.h
deleted file mode 100755
index 2bb13380314..00000000000
--- a/mit-pthreads/machdep/alpha-osf1/__signal.h
+++ /dev/null
@@ -1,106 +0,0 @@
-#include <standards.h>
-
-typedef int sig_atomic_t; /* accessable as an atomic entity (ANSI) */
-
-/*
- * valid signal values: all undefined values are reserved for future use
- * note: POSIX requires a value of 0 to be used as the null signal in kill()
- */
-#define SIGHUP 1 /* hangup, generated when terminal disconnects */
-#define SIGINT 2 /* interrupt, generated from terminal special char */
-#define SIGQUIT 3 /* (*) quit, generated from terminal special char */
-#define SIGILL 4 /* (*) illegal instruction (not reset when caught)*/
-#define SIGTRAP 5 /* (*) trace trap (not reset when caught) */
-#define SIGABRT 6 /* (*) abort process */
-#define SIGEMT 7 /* EMT instruction */
-#define SIGFPE 8 /* (*) floating point exception */
-#define SIGKILL 9 /* kill (cannot be caught or ignored) */
-#define SIGBUS 10 /* (*) bus error (specification exception) */
-#define SIGSEGV 11 /* (*) segmentation violation */
-#define SIGSYS 12 /* (*) bad argument to system call */
-#define SIGPIPE 13 /* write on a pipe with no one to read it */
-#define SIGALRM 14 /* alarm clock timeout */
-#define SIGTERM 15 /* software termination signal */
-#define SIGURG 16 /* (+) urgent contition on I/O channel */
-#define SIGSTOP 17 /* (@) stop (cannot be caught or ignored) */
-#define SIGTSTP 18 /* (@) interactive stop */
-#define SIGCONT 19 /* (!) continue (cannot be caught or ignored) */
-#define SIGCHLD 20 /* (+) sent to parent on child stop or exit */
-#define SIGTTIN 21 /* (@) background read attempted from control terminal*/
-#define SIGTTOU 22 /* (@) background write attempted to control terminal */
-#define SIGIO 23 /* (+) I/O possible, or completed */
-#define SIGXCPU 24 /* cpu time limit exceeded (see setrlimit()) */
-#define SIGXFSZ 25 /* file size limit exceeded (see setrlimit()) */
-#define SIGVTALRM 26 /* virtual time alarm (see setitimer) */
-#define SIGPROF 27 /* profiling time alarm (see setitimer) */
-#define SIGWINCH 28 /* (+) window size changed */
-#define SIGINFO 29 /* information request */
-#define SIGUSR1 30 /* user defined signal 1 */
-#define SIGUSR2 31 /* user defined signal 2 */
-#define SIGMAX 31
-#define NSIG 31
-
-/*
- * additional signal names supplied for compatibility, only
- */
-#define SIGIOINT SIGURG /* printer to backend error signal */
-#define SIGAIO SIGIO /* base lan i/o */
-#define SIGPTY SIGIO /* pty i/o */
-#define SIGPOLL SIGIO /* STREAMS version of this signal */
-#define SIGIOT SIGABRT /* abort (terminate) process */
-#define SIGLOST SIGIOT /* old BSD signal ?? */
-#define SIGPWR SIGINFO /* Power Fail/Restart -- SVID3/SVR4 */
-#define SIGCLD SIGCHLD
-
-/*
- * valid signal action values; other values => pointer to handler function
- */
-#define SIG_DFL (void (*)())0
-#define SIG_IGN (void (*)())1
-
-/*
- * values of "how" argument to sigprocmask() call
- */
-#define SIG_BLOCK 1
-#define SIG_UNBLOCK 2
-#define SIG_SETMASK 3
-
-/*
- * sigaction structure used in sigaction() system call
- * The order of the fields in this structure must match those in
- * the sigvec structure (below).
- */
-struct sigaction {
- void (*sa_handler)(); /* signal handler, or action value */
- sigset_t sa_mask; /* signals to block while in handler */
- int sa_flags; /* signal action flags */
-};
-
-#define __SIGEMPTYSET 0
-#define __SIGFILLSET 0xffffffff
-#define __SIGADDSET(s, n) ( *(s) |= 1L << ((n) - 1), 0)
-#define __SIGDELSET(s, n) ( *(s) &= ~(1L << ((n) - 1)), 0)
-#define __SIGISMEMBER(s, n) ( (*(s) & (1L << ((n) - 1))) != (sigset_t)0)
-
-
-#define SIGSTKSZ (16384)
-#define MINSIGSTKSZ (4096)
-
-/*
- * valid flags define for sa_flag field of sigaction structure
- */
-#define SA_ONSTACK 0x00000001 /* run on special signal stack */
-#define SA_RESTART 0x00000002 /* restart system calls on sigs */
-#define SA_NOCLDSTOP 0x00000004 /* do not set SIGCHLD for child stops*/
-#define SA_NODEFER 0x00000008 /* don't block while handling */
-#define SA_RESETHAND 0x00000010 /* old sys5 style behavior */
-#define SA_NOCLDWAIT 0x00000020 /* no zombies */
-#define SA_SIGINFO 0x00000040 /* deliver siginfo to handler */
-
-/* This is for sys/time.h */
-/* Removed for OSF1 V3.2
-typedef union sigval {
- int sival_int;
- void *sival_ptr;
-} sigval_t;
-*/
diff --git a/mit-pthreads/machdep/alpha-osf1/__stdio.h b/mit-pthreads/machdep/alpha-osf1/__stdio.h
deleted file mode 100755
index 39801b125c8..00000000000
--- a/mit-pthreads/machdep/alpha-osf1/__stdio.h
+++ /dev/null
@@ -1,13 +0,0 @@
-
-#ifndef _FPOS_T
-#define _FPOS_T
-typedef pthread_fpos_t fpos_t; /* Must match off_t <sys/types.h> */
-#endif
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-#define HAVE_SYS_ERRLIST_WITHOUT_CONST
-
diff --git a/mit-pthreads/machdep/alpha-osf1/__stdlib.h b/mit-pthreads/machdep/alpha-osf1/__stdlib.h
deleted file mode 100755
index 79ca737e0c8..00000000000
--- a/mit-pthreads/machdep/alpha-osf1/__stdlib.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* bleah */
-
-#include <stddef.h>
diff --git a/mit-pthreads/machdep/alpha-osf1/__string.h b/mit-pthreads/machdep/alpha-osf1/__string.h
deleted file mode 100755
index 6558102a282..00000000000
--- a/mit-pthreads/machdep/alpha-osf1/__string.h
+++ /dev/null
@@ -1,19 +0,0 @@
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-__BEGIN_DECLS
-
-/*
-void * memchr __P_((const void *, int , size_t ));
-void * memcpy __P_((void *, const void *, size_t ));
-void * memset __P_((void *, int , size_t ));
-size_t strcspn __P_((const char *, const char *));
-size_t strlen __P_((const char *));
-size_t strspn __P_((const char *, const char *));
-*/
-
-__END_DECLS
-
diff --git a/mit-pthreads/machdep/alpha-osf1/__time.h b/mit-pthreads/machdep/alpha-osf1/__time.h
deleted file mode 100755
index b4ce1ead2bf..00000000000
--- a/mit-pthreads/machdep/alpha-osf1/__time.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <pthread/types.h>
-#include <machine/machtime.h> /* CLOCKS_PER_SEC is defined here */
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-#ifndef _CLOCK_T
-#define _CLOCK_T
-typedef pthread_clock_t clock_t;
-#endif
-
-#ifndef _TIME_T
-#define _TIME_T
-typedef pthread_time_t time_t;
-#endif
-
-#ifndef CLK_TCK
-#define CLK_TCK 60
-#endif
diff --git a/mit-pthreads/machdep/alpha-osf1/__unistd.h b/mit-pthreads/machdep/alpha-osf1/__unistd.h
deleted file mode 100755
index 2a7fbe9389b..00000000000
--- a/mit-pthreads/machdep/alpha-osf1/__unistd.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <sys/types.h>
-
-#ifndef _SSIZE_T
-#define _SSIZE_T
-typedef long ssize_t; /* Added by monty */
-#endif
diff --git a/mit-pthreads/machdep/alpha-osf1/cdefs.h b/mit-pthreads/machdep/alpha-osf1/cdefs.h
deleted file mode 100755
index c9b54f033ec..00000000000
--- a/mit-pthreads/machdep/alpha-osf1/cdefs.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ==== cdefs.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Similar to the BSD cdefs.h file.
- *
- * 1.00 94/01/26 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_SYS_CDEFS_H_
-#define _PTHREAD_SYS_CDEFS_H_
-
-/* Stuff for compiling */
-#if defined(__GNUC__)
-#if defined(__cplusplus)
-#define __INLINE static inline
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS };
-#else
-#define __INLINE extern inline
-#define __CAN_DO_EXTERN_INLINE
-#define __BEGIN_DECLS
-#define __END_DECLS
-#if !defined(__STDC__)
-#define const __const
-#define inline __inline
-#define signed __signed
-#define volatile __volatile
-#endif
-#endif
-#else /* !__GNUC__ */
-#define __BEGIN_DECLS
-#define __END_DECLS
-#define __INLINE static
-#define inline
-#endif
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif /* __NORETURN not defined. */
-
-#ifndef _U_INT32_T_
-#define _U_INT32_T_
-typedef unsigned int u_int32_t;
-#endif
-
-#ifndef _U_INT16_T_
-#define _U_INT16_T_
-typedef unsigned short u_int16_t;
-#endif
-
-#ifndef _INT32_T_
-#define _INT32_T_
-typedef int int32_t;
-#endif
-
-#ifndef _INT16_T_
-#define _INT16_T_
-typedef short int16_t;
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/alpha-osf1/compat.h b/mit-pthreads/machdep/alpha-osf1/compat.h
deleted file mode 100755
index 4c2801e05de..00000000000
--- a/mit-pthreads/machdep/alpha-osf1/compat.h
+++ /dev/null
@@ -1 +0,0 @@
-#define omsghdr msghdr
diff --git a/mit-pthreads/machdep/alpha-osf1/dirent.h b/mit-pthreads/machdep/alpha-osf1/dirent.h
deleted file mode 100755
index 697ef7b8a8c..00000000000
--- a/mit-pthreads/machdep/alpha-osf1/dirent.h
+++ /dev/null
@@ -1,7 +0,0 @@
-struct dirent {
- ino_t d_ino;
- ushort_t d_reclen, d_namlen;
- char d_name[256];
-};
-#define d_fileno d_ino
-#define MAXNAMLEN 256
diff --git a/mit-pthreads/machdep/alpha-osf1/signal.h b/mit-pthreads/machdep/alpha-osf1/signal.h
deleted file mode 100755
index c387f9f31ad..00000000000
--- a/mit-pthreads/machdep/alpha-osf1/signal.h
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-#include <signal.h>
diff --git a/mit-pthreads/machdep/alpha-osf1/socket.h b/mit-pthreads/machdep/alpha-osf1/socket.h
deleted file mode 100755
index 28e17ca463d..00000000000
--- a/mit-pthreads/machdep/alpha-osf1/socket.h
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Copyright (c) 1982,1985,1986,1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)socket.h 7.13 (Berkeley) 4/20/91
- */
-
-#ifndef _SOCKET_H_
-#define _SOCKET_H_
-
-/*
- * Definitions related to sockets: types, address families, options.
- */
-
-/*
- * Types
- */
-#define SOCK_STREAM 1 /* stream socket */
-#define SOCK_DGRAM 2 /* datagram socket */
-#define SOCK_RAW 4 /* raw-protocol interface */
-#define SOCK_RDM 5 /* reliably-delivered message */
-#define SOCK_SEQPACKET 6 /* sequenced packet stream */
-
-/*
- * Option flags per-socket.
- */
-#define SO_DEBUG 0x0001 /* turn on debugging info recording */
-#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
-#define SO_REUSEADDR 0x0004 /* allow local address reuse */
-#define SO_KEEPALIVE 0x0008 /* keep connections alive */
-#define SO_DONTROUTE 0x0010 /* just use interface addresses */
-#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
-#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
-#define SO_LINGER 0x0080 /* linger on close if data present */
-#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
-#define SO_ERROR 0x1007 /* get error status and clear */
-#define SO_TYPE 0x1008 /* get socket type */
-#define SO_PROTOTYPE 0x1009 /* get/set protocol type */
-
-/*
- * Structure used for manipulating linger option.
- */
-struct linger {
- int l_onoff; /* option on/off */
- int l_linger; /* linger time */
-};
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define SOL_SOCKET 0xffff /* options for socket level */
-
-/*
- * Address families.
- */
-#define AF_UNSPEC 0 /* unspecified */
-#define AF_UNIX 1 /* local to host (pipes, portals) */
-#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
-#define AF_IMPLINK 3 /* arpanet imp addresses */
-#define AF_PUP 4 /* pup protocols: e.g. BSP */
-#define AF_CHAOS 5 /* mit CHAOS protocols */
-#define AF_NS 6 /* XEROX NS protocols */
-#define AF_NBS 7 /* nbs protocols */
-#define AF_ECMA 8 /* european computer manufacturers */
-#define AF_DATAKIT 9 /* datakit protocols */
-#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
-#define AF_SNA 11 /* IBM SNA */
-#define AF_DECnet 12 /* DECnet */
-#define AF_DLI 13 /* DEC Direct data link interface */
-#define AF_LAT 14 /* LAT */
-#define AF_HYLINK 15 /* NSC Hyperchannel */
-#define AF_APPLETALK 16 /* Apple Talk */
-#define AF_NIT 17 /* Network Interface Tap */
-#define AF_802 18 /* IEEE 802.2, also ISO 8802 */
-#define AF_ISO 19 /* ISO protocols */
-#define AF_OSI AF_ISO
-#define AF_X25 20 /* CCITT X.25 in particular */
-#define AF_OSINET 21
-#define AF_GOSIP 22
-#define AF_MAX 22
-
-/* Not supported by solaris */
-/* #define AF_ROUTE 17 /* Internal Routing Protocol */
-/* #define AF_LINK 18 /* Link layer interface */
-/* #define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
-
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
- u_short sa_family; /* address family */
- char sa_data[14]; /* actually longer; address value */
-};
-
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
- u_short sp_family; /* address family */
- u_short sp_protocol; /* protocol */
-};
-
-/*
- * Protocol families, same as address families for now.
- */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_UNIX AF_UNIX
-#define PF_INET AF_INET
-#define PF_IMPLINK AF_IMPLINK
-#define PF_PUP AF_PUP
-#define PF_CHAOS AF_CHAOS
-#define PF_NS AF_NS
-#define PF_NBS AF_NBS
-#define PF_ECMA AF_ECMA
-#define PF_DATAKIT AF_DATAKIT
-#define PF_CCITT AF_CCITT
-#define PF_SNA AF_SNA
-#define PF_DECnet AF_DECnet
-#define PF_DLI AF_DLI
-#define PF_LAT AF_LAT
-#define PF_HYLINK AF_HYLINK
-#define PF_APPLETALK AF_APPLETALK
-#define PF_NIT AF_NIT
-#define PF_802 AF_802
-#define PF_ISO AF_ISO
-#define PF_OSI AF_ISO
-#define PF_X25 AF_X25
-#define PF_OSINET AF_OSINET
-#define PF_GOSIP AF_GOSIP
-#define PF_MAX AF_MAX
-
-/* #define PF_ROUTE AF_ROUTE */
-/* #define PF_LINK AF_LINK */
-/* #define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
-
-/*
- * Maximum queue length specifiable by listen.
- */
-#define SOMAXCONN 5
-
-/*
- * Message header for recvmsg and sendmsg calls.
- * Used value-result for recvmsg, value only for sendmsg.
- */
-struct msghdr {
- caddr_t msg_name; /* optional address */
- u_int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- u_int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_accrights; /* access rights sent/received */
- int msg_accrightslen;
-};
-
-#define MSG_MAXIOVLEN 16
-
-#define MSG_OOB 0x1 /* process out-of-band data */
-#define MSG_PEEK 0x2 /* peek at incoming message */
-#define MSG_DONTROUTE 0x4 /* send without using routing tables */
-
-/* #define MSG_EOR 0x8 data completes record */
-/* #define MSG_TRUNC 0x10 data discarded before delivery */
-/* #define MSG_CTRUNC 0x20 control data lost before delivery */
-/* #define MSG_WAITALL 0x40 wait for full request or error */
-
-/*
- * Header for ancillary data objects in msg_control buffer.
- * Used for additional information with/about a datagram
- * not expressible by flags. The format is a sequence
- * of message elements headed by cmsghdr structures.
- */
-struct cmsghdr {
- u_int cmsg_len; /* data byte count, including hdr */
- int cmsg_level; /* originating protocol */
- int cmsg_type; /* protocol-specific type */
-/* followed by u_char cmsg_data[]; */
-};
-
-/* given pointer to struct adatahdr, return pointer to data */
-#define CMSG_DATA(cmsg) ((u_char *)((cmsg) + 1))
-
-/* given pointer to struct adatahdr, return pointer to next adatahdr */
-#define CMSG_NXTHDR(mhdr, cmsg) \
- (((caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \
- (mhdr)->msg_control + (mhdr)->msg_controllen) ? \
- (struct cmsghdr *)NULL : \
- (struct cmsghdr *)((caddr_t)(cmsg) + ALIGN((cmsg)->cmsg_len)))
-
-#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
-
-/* "Socket"-level control message types: */
-#define SCM_RIGHTS 0x01 /* access rights (array of int) */
-
-/*
- * 4.3 compat sockaddr, move to compat file later
- */
-struct osockaddr {
- u_short sa_family; /* address family */
- char sa_data[14]; /* up to 14 bytes of direct address */
-};
-
-#define SYS_socketcall 83
-
-#define SO_ACCEPT 1
-#define SO_BIND 2
-#define SO_CONNECT 3
-#define SO_GETPEERNAME 4
-#define SO_GETSOCKNAME 5
-#define SO_GETSOCKOPT 6
-#define SO_LISTEN 7
-#define SO_RECV 8
-#define SO_RECVFROM 9
-#define SO_SEND 10
-#define SO_SENDTO 11
-#define SO_SETSOCKOPT 12
-#define SO_SHUTDOWN 13
-#define SO_SOCKET 14
-#define SO_SOCKPOLL 15
-#define SO_GETIPDOMAIN 16
-#define SO_SETIPDOMAIN 17
-#define SO_ADJTIME 18
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int accept __P_((int, struct sockaddr *, int *));
-int bind __P_((int, const struct sockaddr *, int));
-int connect __P_((int, const struct sockaddr *, int));
-int getpeername __P_((int, struct sockaddr *, int *));
-int getsockname __P_((int, struct sockaddr *, int *));
-int getsockopt __P_((int, int, int, void *, int *));
-int listen __P_((int, int));
-/* original definitions
-int recv __P_((int, void *, int, int));
-int recvfrom __P_((int, void *, int, int,
- struct sockaddr *, int *));
-int recvmsg __P_((int, struct msghdr *, int));
-int send __P_((int, const void *, int, int));
-int sendto __P_((int, const void *, int, int, const struct sockaddr *, int));
-int sendmsg __P_((int, const struct msghdr *, int));
-*/
-ssize_t recv __P_((int, void *, size_t, int));
-ssize_t recvfrom __P_((int, void *, size_t, int,
- struct sockaddr *, int *));
-ssize_t recvmsg __P_((int, struct msghdr *, int));
-ssize_t send __P_((int, const void *, size_t, int));
-ssize_t sendto __P_((int, const void *, size_t, int,
- const struct sockaddr *, int));
-ssize_t sendmsg __P_((int, const struct msghdr *, int));
-int setsockopt __P_((int, int, int, const void *, int));
-int shutdown __P_((int, int));
-int socket __P_((int, int, int));
-int socketpair __P_((int, int, int, int *));
-__END_DECLS
-
-#endif /* !_SOCKET_H_ */
diff --git a/mit-pthreads/machdep/alpha-osf1/timers.h b/mit-pthreads/machdep/alpha-osf1/timers.h
deleted file mode 100755
index 36317d083f0..00000000000
--- a/mit-pthreads/machdep/alpha-osf1/timers.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <sys/types.h>
-#include <time.h>
-
-struct timespec {
- time_t tv_sec;
- long tv_nsec;
-};
-
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
-
-#endif
diff --git a/mit-pthreads/machdep/alpha-osf1/uio.h b/mit-pthreads/machdep/alpha-osf1/uio.h
deleted file mode 100755
index 8d494672ee4..00000000000
--- a/mit-pthreads/machdep/alpha-osf1/uio.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* N.B.: The Alpha, under OSF/1, does *not* use size_t for the length,
- or for the returned values from readv and writev. */
-
-struct iovec {
- void *iov_base;
- int iov_len;
-};
-
-/* I'm assuming the iovec structures are const. I haven't verified
- it. */
-extern ssize_t readv (int, const struct iovec *, int);
-extern ssize_t writev (int, const struct iovec *, int);
diff --git a/mit-pthreads/machdep/bsdi-1.1/compat.h b/mit-pthreads/machdep/bsdi-1.1/compat.h
deleted file mode 100755
index e6f60c372c7..00000000000
--- a/mit-pthreads/machdep/bsdi-1.1/compat.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* ==== compat.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : COmpat header to make socket code compile.
- *
- * 1.00 94/08/01 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_COMPAT_H_
-#define _SYS_COMPAT_H_
-
-#endif
diff --git a/mit-pthreads/machdep/bsdi-1.1/dirent.h b/mit-pthreads/machdep/bsdi-1.1/dirent.h
deleted file mode 100755
index d0272a4ee38..00000000000
--- a/mit-pthreads/machdep/bsdi-1.1/dirent.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* BSDI $Id$ */
-
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 5.18 (Berkeley) 2/23/91
- */
-
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-/*
- * A directory entry has a struct dirent at the front of it, containing its
- * inode number, the length of the entry, and the length of the name
- * contained in the entry. These are followed by the name padded to a 4
- * byte boundary with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- */
-
-struct dirent {
- unsigned long
- d_fileno; /* file number of entry */
- unsigned short
- d_reclen; /* length of this record */
- unsigned short
- d_namlen; /* length of string in d_name */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
-#define MAXNAMLEN 255
- char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
-#endif
-};
-
-/*
- * There should probably be no need for this. In the BSDI sources,
- * it is excluded if _POSIX_SOURCE is defined, and pthreads are supposed
- * to be posix. Sources that use d_ino should really be using d_fileno.
- * mbd
- */
-#define d_ino d_fileno /* backward compatibility */
-
-#endif /* !_SYS_DIRENT_H_ */
-
diff --git a/mit-pthreads/machdep/bsdi-1.1/errno.h b/mit-pthreads/machdep/bsdi-1.1/errno.h
deleted file mode 100755
index 3da61d692a3..00000000000
--- a/mit-pthreads/machdep/bsdi-1.1/errno.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/* $NetBSD: errno.h,v 1.8 1994/06/29 06:44:02 cgd Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)errno.h 8.5 (Berkeley) 1/21/94
- */
-
-#ifndef _SYS_ERRNO_H_
-#define _SYS_ERRNO_H_
-
-#define EPERM 1 /* Operation not permitted */
-#define ENOENT 2 /* No such file or directory */
-#define ESRCH 3 /* No such process */
-#define EINTR 4 /* Interrupted system call */
-#define EIO 5 /* Input/output error */
-#define ENXIO 6 /* Device not configured */
-#define E2BIG 7 /* Argument list too long */
-#define ENOEXEC 8 /* Exec format error */
-#define EBADF 9 /* Bad file descriptor */
-#define ECHILD 10 /* No child processes */
-#define EDEADLK 11 /* Resource deadlock avoided */
- /* 11 was EAGAIN */
-#define ENOMEM 12 /* Cannot allocate memory */
-#define EACCES 13 /* Permission denied */
-#define EFAULT 14 /* Bad address */
-#ifndef _POSIX_SOURCE
-#define ENOTBLK 15 /* Block device required */
-#endif
-#define EBUSY 16 /* Device busy */
-#define EEXIST 17 /* File exists */
-#define EXDEV 18 /* Cross-device link */
-#define ENODEV 19 /* Operation not supported by device */
-#define ENOTDIR 20 /* Not a directory */
-#define EISDIR 21 /* Is a directory */
-#define EINVAL 22 /* Invalid argument */
-#define ENFILE 23 /* Too many open files in system */
-#define EMFILE 24 /* Too many open files */
-#define ENOTTY 25 /* Inappropriate ioctl for device */
-#ifndef _POSIX_SOURCE
-#define ETXTBSY 26 /* Text file busy */
-#endif
-#define EFBIG 27 /* File too large */
-#define ENOSPC 28 /* No space left on device */
-#define ESPIPE 29 /* Illegal seek */
-#define EROFS 30 /* Read-only file system */
-#define EMLINK 31 /* Too many links */
-#define EPIPE 32 /* Broken pipe */
-
-/* math software */
-#define EDOM 33 /* Numerical argument out of domain */
-#define ERANGE 34 /* Result too large */
-
-/* non-blocking and interrupt i/o */
-#define EAGAIN 35 /* Resource temporarily unavailable */
-#ifndef _POSIX_SOURCE
-#define EWOULDBLOCK EAGAIN /* Operation would block */
-#define EINPROGRESS 36 /* Operation now in progress */
-#define EALREADY 37 /* Operation already in progress */
-
-/* ipc/network software -- argument errors */
-#define ENOTSOCK 38 /* Socket operation on non-socket */
-#define EDESTADDRREQ 39 /* Destination address required */
-#define EMSGSIZE 40 /* Message too long */
-#define EPROTOTYPE 41 /* Protocol wrong type for socket */
-#define ENOPROTOOPT 42 /* Protocol not available */
-#define EPROTONOSUPPORT 43 /* Protocol not supported */
-#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
-#define EOPNOTSUPP 45 /* Operation not supported */
-#define EPFNOSUPPORT 46 /* Protocol family not supported */
-#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
-#define EADDRINUSE 48 /* Address already in use */
-#define EADDRNOTAVAIL 49 /* Can't assign requested address */
-
-/* ipc/network software -- operational errors */
-#define ENETDOWN 50 /* Network is down */
-#define ENETUNREACH 51 /* Network is unreachable */
-#define ENETRESET 52 /* Network dropped connection on reset */
-#define ECONNABORTED 53 /* Software caused connection abort */
-#define ECONNRESET 54 /* Connection reset by peer */
-#define ENOBUFS 55 /* No buffer space available */
-#define EISCONN 56 /* Socket is already connected */
-#define ENOTCONN 57 /* Socket is not connected */
-#define ESHUTDOWN 58 /* Can't send after socket shutdown */
-#define ETOOMANYREFS 59 /* Too many references: can't splice */
-#define ETIMEDOUT 60 /* Operation timed out */
-#define ECONNREFUSED 61 /* Connection refused */
-
-#define ELOOP 62 /* Too many levels of symbolic links */
-#endif /* _POSIX_SOURCE */
-#define ENAMETOOLONG 63 /* File name too long */
-
-/* should be rearranged */
-#ifndef _POSIX_SOURCE
-#define EHOSTDOWN 64 /* Host is down */
-#define EHOSTUNREACH 65 /* No route to host */
-#endif /* _POSIX_SOURCE */
-#define ENOTEMPTY 66 /* Directory not empty */
-
-/* quotas & mush */
-#ifndef _POSIX_SOURCE
-#define EPROCLIM 67 /* Too many processes */
-#define EUSERS 68 /* Too many users */
-#define EDQUOT 69 /* Disc quota exceeded */
-
-/* Network File System */
-#define ESTALE 70 /* Stale NFS file handle */
-#define EREMOTE 71 /* Too many levels of remote in path */
-#define EBADRPC 72 /* RPC struct is bad */
-#define ERPCMISMATCH 73 /* RPC version wrong */
-#define EPROGUNAVAIL 74 /* RPC prog. not avail */
-#define EPROGMISMATCH 75 /* Program version wrong */
-#define EPROCUNAVAIL 76 /* Bad procedure for program */
-#endif /* _POSIX_SOURCE */
-
-#define ENOLCK 77 /* No locks available */
-#define ENOSYS 78 /* Function not implemented */
-
-#ifndef _POSIX_SOURCE
-#define EFTYPE 79 /* Inappropriate file type or format */
-#define EAUTH 80 /* Authentication error */
-#define ENEEDAUTH 81 /* Need authenticator */
-#define ELAST 81 /* Must be equal largest errno */
-#endif /* _POSIX_SOURCE */
-
-#endif
diff --git a/mit-pthreads/machdep/bsdi-1.1/socket.h b/mit-pthreads/machdep/bsdi-1.1/socket.h
deleted file mode 100755
index 39d7c1cce26..00000000000
--- a/mit-pthreads/machdep/bsdi-1.1/socket.h
+++ /dev/null
@@ -1,277 +0,0 @@
-/* BSDI $Id$ */
-
-/*
- * Copyright (c) 1982,1985,1986,1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)socket.h 7.13 (Berkeley) 4/20/91
- */
-
-#ifndef _SOCKET_H_
-#define _SOCKET_H_
-
-/*
- * Definitions related to sockets: types, address families, options.
- */
-
-/*
- * Types
- */
-#define SOCK_STREAM 1 /* stream socket */
-#define SOCK_DGRAM 2 /* datagram socket */
-#define SOCK_RAW 3 /* raw-protocol interface */
-#define SOCK_RDM 4 /* reliably-delivered message */
-#define SOCK_SEQPACKET 5 /* sequenced packet stream */
-
-/*
- * Option flags per-socket.
- */
-#define SO_DEBUG 0x0001 /* turn on debugging info recording */
-#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
-#define SO_REUSEADDR 0x0004 /* allow local address reuse */
-#define SO_KEEPALIVE 0x0008 /* keep connections alive */
-#define SO_DONTROUTE 0x0010 /* just use interface addresses */
-#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
-#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
-#define SO_LINGER 0x0080 /* linger on close if data present */
-#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
-#define SO_ERROR 0x1007 /* get error status and clear */
-#define SO_TYPE 0x1008 /* get socket type */
-
-/*
- * Structure used for manipulating linger option.
- */
-struct linger {
- int l_onoff; /* option on/off */
- int l_linger; /* linger time */
-};
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define SOL_SOCKET 0xffff /* options for socket level */
-
-/*
- * Address families.
- */
-#define AF_UNSPEC 0 /* unspecified */
-#define AF_UNIX 1 /* local to host (pipes, portals) */
-#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
-#define AF_IMPLINK 3 /* arpanet imp addresses */
-#define AF_PUP 4 /* pup protocols: e.g. BSP */
-#define AF_CHAOS 5 /* mit CHAOS protocols */
-#define AF_NS 6 /* XEROX NS protocols */
-#define AF_ISO 7 /* ISO protocols */
-#define AF_OSI AF_ISO
-#define AF_ECMA 8 /* european computer manufacturers */
-#define AF_DATAKIT 9 /* datakit protocols */
-#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
-#define AF_SNA 11 /* IBM SNA */
-#define AF_DECnet 12 /* DECnet */
-#define AF_DLI 13 /* DEC Direct data link interface */
-#define AF_LAT 14 /* LAT */
-#define AF_HYLINK 15 /* NSC Hyperchannel */
-#define AF_APPLETALK 16 /* Apple Talk */
-#define AF_ROUTE 17 /* Internal Routing Protocol */
-#define AF_LINK 18 /* Link layer interface */
-#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
-
-#define AF_MAX 20
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
- u_char sa_len; /* total length */
- u_char sa_family; /* address family */
- char sa_data[14]; /* actually longer; address value */
-};
-
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
- u_short sp_family; /* address family */
- u_short sp_protocol; /* protocol */
-};
-
-/*
- * Protocol families, same as address families for now.
- */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_UNIX AF_UNIX
-#define PF_INET AF_INET
-#define PF_IMPLINK AF_IMPLINK
-#define PF_PUP AF_PUP
-#define PF_CHAOS AF_CHAOS
-#define PF_NS AF_NS
-#define PF_ISO AF_ISO
-#define PF_OSI AF_ISO
-#define PF_ECMA AF_ECMA
-#define PF_DATAKIT AF_DATAKIT
-#define PF_CCITT AF_CCITT
-#define PF_SNA AF_SNA
-#define PF_DECnet AF_DECnet
-#define PF_DLI AF_DLI
-#define PF_LAT AF_LAT
-#define PF_HYLINK AF_HYLINK
-#define PF_APPLETALK AF_APPLETALK
-#define PF_ROUTE AF_ROUTE
-#define PF_LINK AF_LINK
-#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
-
-#define PF_MAX AF_MAX
-
-/*
- * Maximum queue length specifiable by listen.
- */
-#define SOMAXCONN 5
-
-/*
- * Message header for recvmsg and sendmsg calls.
- * Used value-result for recvmsg, value only for sendmsg.
- */
-struct msghdr {
- caddr_t msg_name; /* optional address */
- u_int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- u_int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_control; /* ancillary data, see below */
- u_int msg_controllen; /* ancillary data buffer len */
- int msg_flags; /* flags on received message */
-};
-
-#define MSG_OOB 0x1 /* process out-of-band data */
-#define MSG_PEEK 0x2 /* peek at incoming message */
-#define MSG_DONTROUTE 0x4 /* send without using routing tables */
-#define MSG_EOR 0x8 /* data completes record */
-#define MSG_TRUNC 0x10 /* data discarded before delivery */
-#define MSG_CTRUNC 0x20 /* control data lost before delivery */
-#define MSG_WAITALL 0x40 /* wait for full request or error */
-
-/*
- * Header for ancillary data objects in msg_control buffer.
- * Used for additional information with/about a datagram
- * not expressible by flags. The format is a sequence
- * of message elements headed by cmsghdr structures.
- */
-struct cmsghdr {
- u_int cmsg_len; /* data byte count, including hdr */
- int cmsg_level; /* originating protocol */
- int cmsg_type; /* protocol-specific type */
-/* followed by u_char cmsg_data[]; */
-};
-
-/* given pointer to struct adatahdr, return pointer to data */
-#define CMSG_DATA(cmsg) ((u_char *)((cmsg) + 1))
-
-/* given pointer to struct adatahdr, return pointer to next adatahdr */
-#define CMSG_NXTHDR(mhdr, cmsg) \
- (((caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \
- (mhdr)->msg_control + (mhdr)->msg_controllen) ? \
- (struct cmsghdr *)NULL : \
- (struct cmsghdr *)((caddr_t)(cmsg) + ALIGN((cmsg)->cmsg_len)))
-
-#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
-
-/* "Socket"-level control message types: */
-#define SCM_RIGHTS 0x01 /* access rights (array of int) */
-
-/*
- * 4.3 compat sockaddr, move to compat file later
- */
-struct osockaddr {
- u_short sa_family; /* address family */
- char sa_data[14]; /* up to 14 bytes of direct address */
-};
-
-/*
- * 4.3-compat message header (move to compat file later).
- */
-struct omsghdr {
- caddr_t msg_name; /* optional address */
- int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_accrights; /* access rights sent/received */
- int msg_accrightslen;
-};
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int accept __P_((int, struct sockaddr *, int *));
-int bind __P_((int, const struct sockaddr *, int));
-int connect __P_((int, const struct sockaddr *, int));
-int getpeername __P_((int, struct sockaddr *, int *));
-int getsockname __P_((int, struct sockaddr *, int *));
-int getsockopt __P_((int, int, int, void *, int *));
-int listen __P_((int, int));
-/* original definitions
-int recv __P_((int, void *, int, int));
-int recvfrom __P_((int, void *, int, int,
- struct sockaddr *, int *));
-int recvmsg __P_((int, struct msghdr *, int));
-int send __P_((int, const void *, int, int));
-int sendto __P_((int, const void *, int, int, const struct sockaddr *, int));
-int sendmsg __P_((int, const struct msghdr *, int));
-*/
-ssize_t recv __P_((int, void *, size_t, int));
-ssize_t recvfrom __P_((int, void *, size_t, int,
- struct sockaddr *, int *));
-ssize_t recvmsg __P_((int, struct msghdr *, int));
-ssize_t send __P_((int, const void *, size_t, int));
-ssize_t sendto __P_((int, const void *, size_t, int,
- const struct sockaddr *, int));
-ssize_t sendmsg __P_((int, const struct msghdr *, int));
-int setsockopt __P_((int, int, int, const void *, int));
-int shutdown __P_((int, int));
-int socket __P_((int, int, int));
-int socketpair __P_((int, int, int, int *));
-__END_DECLS
-
-#endif /* !KERNEL */
-
-#endif /* !_SOCKET_H_ */
diff --git a/mit-pthreads/machdep/bsdi-1.1/timers.h b/mit-pthreads/machdep/bsdi-1.1/timers.h
deleted file mode 100755
index 7101ab99106..00000000000
--- a/mit-pthreads/machdep/bsdi-1.1/timers.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <sys/time.h>
-
-struct timespec {
- time_t tv_sec;
- long tv_nsec;
-};
-
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
-
-#endif
diff --git a/mit-pthreads/machdep/bsdi-2.0/__math.h b/mit-pthreads/machdep/bsdi-2.0/__math.h
deleted file mode 100755
index 2c919472f33..00000000000
--- a/mit-pthreads/machdep/bsdi-2.0/__math.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * ANSI/POSIX
- */
-/* Generate an overflow to create +Inf; the multiply shuts up gcc 1 */
-#define HUGE_VAL (1e250*1e250) /* IEEE: positive infinity */
-
diff --git a/mit-pthreads/machdep/bsdi-2.0/__path.h b/mit-pthreads/machdep/bsdi-2.0/__path.h
deleted file mode 100755
index 9c347016f5f..00000000000
--- a/mit-pthreads/machdep/bsdi-2.0/__path.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * __path.h,v 1.1 1995/01/03 12:53:32 proven Exp
- */
-
-#ifndef _SYS__PATH_H_
-#define _SYS__PATH_H_
-
-#define _PATH_PTY "/dev/"
-#define _PATH_TZDIR "/usr/share/zoneinfo"
-#define _PATH_TZFILE "/etc/localtime"
-
-#endif /* !_SYS__PATH_H_ */
diff --git a/mit-pthreads/machdep/bsdi-2.0/__signal.h b/mit-pthreads/machdep/bsdi-2.0/__signal.h
deleted file mode 100755
index d3deecf15e2..00000000000
--- a/mit-pthreads/machdep/bsdi-2.0/__signal.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <sys/signal.h>
-
-#define __SIGEMPTYSET 0
-#define __SIGFILLSET 0xffffffff
-#define __SIGADDSET(s, n) (*(s) |= 1 << ((n) - 1), 0)
-#define __SIGDELSET(s, n) (*(s) &= ~(1 << ((n) - 1)), 0)
-#define __SIGISMEMBER(s, n) ((*(s) & (1 << ((n) - 1))) != 0)
diff --git a/mit-pthreads/machdep/bsdi-2.0/__stdio.h b/mit-pthreads/machdep/bsdi-2.0/__stdio.h
deleted file mode 100755
index d4d37c2017c..00000000000
--- a/mit-pthreads/machdep/bsdi-2.0/__stdio.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <machine/ansi.h>
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-typedef pthread_fpos_t fpos_t; /* Must match off_t <sys/types.h> */
diff --git a/mit-pthreads/machdep/bsdi-2.0/__stdlib.h b/mit-pthreads/machdep/bsdi-2.0/__stdlib.h
deleted file mode 100755
index 189bb5e8799..00000000000
--- a/mit-pthreads/machdep/bsdi-2.0/__stdlib.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * __stdlib.h,v 1.1 1995/01/03 12:53:34 proven Exp
- */
-
-#ifndef _SYS___STDLIB_H_
-#define _SYS___STDLIB_H_
-
-#include <machine/ansi.h>
-
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-#ifdef _BSD_WCHAR_T_
-typedef _BSD_WCHAR_T_ wchar_t;
-#undef _BSD_WCHAR_T_
-#endif
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#endif /* _STDLIB_H_ */
diff --git a/mit-pthreads/machdep/bsdi-2.0/__string.h b/mit-pthreads/machdep/bsdi-2.0/__string.h
deleted file mode 100755
index 275032946ea..00000000000
--- a/mit-pthreads/machdep/bsdi-2.0/__string.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <machine/ansi.h>
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-/* Non-standard NetBSD string routines. */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-__BEGIN_DECLS
-int bcmp __P_((const void *, const void *, size_t));
-void bcopy __P_((const void *, void *, size_t));
-void bzero __P_((void *, size_t));
-char *index __P_((const char *, int));
-char *rindex __P_((const char *, int));
-char *strdup __P_((const char *));
-void strmode __P_((int, char *));
-char *strsep __P_((char **, const char *));
-__END_DECLS
-#endif
diff --git a/mit-pthreads/machdep/bsdi-2.0/__time.h b/mit-pthreads/machdep/bsdi-2.0/__time.h
deleted file mode 100755
index bc4d956486d..00000000000
--- a/mit-pthreads/machdep/bsdi-2.0/__time.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * __time.h,v 1.1 1994/12/13 07:18:55 proven Exp
- */
-
-#ifndef _SYS__TIME_H_
-#define _SYS__TIME_H_
-
-#include <machine/ansi.h>
-
-#ifdef _BSD_CLOCK_T_
-typedef _BSD_CLOCK_T_ clock_t;
-#undef _BSD_CLOCK_T_
-#endif
-
-#ifdef _BSD_TIME_T_
-typedef _BSD_TIME_T_ time_t;
-#undef _BSD_TIME_T_
-#endif
-
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-#endif /* !_SYS__TIME_H_ */
diff --git a/mit-pthreads/machdep/bsdi-2.0/__unistd.h b/mit-pthreads/machdep/bsdi-2.0/__unistd.h
deleted file mode 100755
index 4a5ee6a245e..00000000000
--- a/mit-pthreads/machdep/bsdi-2.0/__unistd.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * __unistd.h,v 1.1 1995/01/03 12:53:35 proven Exp
- */
-
-#ifndef _SYS___UNISTD_H_
-#define _SYS___UNISTD_H_
-
-#include <sys/types.h>
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#define ioctl_request_type unsigned long /* For fd.c */
-
-/* compile-time symbolic constants */
-#define _POSIX_JOB_CONTROL /* implementation supports job control */
-
-#ifdef _NOT_AVAILABLE
-#define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */
-#endif
-
-#define _POSIX_VERSION 198808L
-#define _POSIX2_VERSION 199212L
-
-/* execution-time symbolic constants */
- /* chown requires appropriate privileges */
-#define _POSIX_CHOWN_RESTRICTED 1
- /* too-long path components generate errors */
-#define _POSIX_NO_TRUNC 1
- /* may disable terminal special characters */
-#define _POSIX_VDISABLE ((unsigned char)'\377')
-
-/* configurable pathname variables */
-#define _PC_LINK_MAX 1
-#define _PC_MAX_CANON 2
-#define _PC_MAX_INPUT 3
-#define _PC_NAME_MAX 4
-#define _PC_PATH_MAX 5
-#define _PC_PIPE_BUF 6
-#define _PC_CHOWN_RESTRICTED 7
-#define _PC_NO_TRUNC 8
-#define _PC_VDISABLE 9
-
-/* configurable system variables */
-#define _SC_ARG_MAX 1
-#define _SC_CHILD_MAX 2
-#define _SC_CLK_TCK 3
-#define _SC_NGROUPS_MAX 4
-#define _SC_OPEN_MAX 5
-#define _SC_JOB_CONTROL 6
-#define _SC_SAVED_IDS 7
-#define _SC_VERSION 8
-#define _SC_BC_BASE_MAX 9
-#define _SC_BC_DIM_MAX 10
-#define _SC_BC_SCALE_MAX 11
-#define _SC_BC_STRING_MAX 12
-#define _SC_COLL_WEIGHTS_MAX 13
-#define _SC_EXPR_NEST_MAX 14
-#define _SC_LINE_MAX 15
-#define _SC_RE_DUP_MAX 16
-#define _SC_2_VERSION 17
-#define _SC_2_C_BIND 18
-#define _SC_2_C_DEV 19
-#define _SC_2_CHAR_TERM 20
-#define _SC_2_FORT_DEV 21
-#define _SC_2_FORT_RUN 22
-#define _SC_2_LOCALEDEF 23
-#define _SC_2_SW_DEV 24
-#define _SC_2_UPE 25
-#define _SC_STREAM_MAX 26
-#define _SC_TZNAME_MAX 27
-
-/* configurable system strings */
-#define _CS_PATH 1
-
-#endif
diff --git a/mit-pthreads/machdep/bsdi-2.0/compat.h b/mit-pthreads/machdep/bsdi-2.0/compat.h
deleted file mode 100755
index 0dfdc27f9e8..00000000000
--- a/mit-pthreads/machdep/bsdi-2.0/compat.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 5.18 (Berkeley) 2/23/91
- */
-
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-/*
- * A directory entry has a struct dirent at the front of it, containing its
- * inode number, the length of the entry, and the length of the name
- * contained in the entry. These are followed by the name padded to a 4
- * byte boundary with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- */
-
-struct dirent {
- u_long d_fileno; /* file number of entry */
- u_short d_reclen; /* length of this record */
- u_short d_namlen; /* length of string in d_name */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
-#define MAXNAMLEN 255
- char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
-#endif
-};
-
-#define d_ino d_fileno /* backward compatibility */
-
-/* definitions for library routines operating on directories. */
-#define DIRBLKSIZ 1024
-
-#endif /* !_DIRENT_H_ */
-
diff --git a/mit-pthreads/machdep/bsdi-2.0/dirent.h b/mit-pthreads/machdep/bsdi-2.0/dirent.h
deleted file mode 100755
index 0dfdc27f9e8..00000000000
--- a/mit-pthreads/machdep/bsdi-2.0/dirent.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 5.18 (Berkeley) 2/23/91
- */
-
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-/*
- * A directory entry has a struct dirent at the front of it, containing its
- * inode number, the length of the entry, and the length of the name
- * contained in the entry. These are followed by the name padded to a 4
- * byte boundary with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- */
-
-struct dirent {
- u_long d_fileno; /* file number of entry */
- u_short d_reclen; /* length of this record */
- u_short d_namlen; /* length of string in d_name */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
-#define MAXNAMLEN 255
- char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
-#endif
-};
-
-#define d_ino d_fileno /* backward compatibility */
-
-/* definitions for library routines operating on directories. */
-#define DIRBLKSIZ 1024
-
-#endif /* !_DIRENT_H_ */
-
diff --git a/mit-pthreads/machdep/bsdi-2.0/errno.h b/mit-pthreads/machdep/bsdi-2.0/errno.h
deleted file mode 100755
index 1a3c37d0147..00000000000
--- a/mit-pthreads/machdep/bsdi-2.0/errno.h
+++ /dev/null
@@ -1,162 +0,0 @@
-
-/* $NetBSD: errno.h,v 1.8 1994/06/29 06:44:02 cgd Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)errno.h 8.5 (Berkeley) 1/21/94
- */
-
-#ifndef _SYS_ERRNO_H_
-#define _SYS_ERRNO_H_
-
-#define EPERM 1 /* Operation not permitted */
-#define ENOENT 2 /* No such file or directory */
-#define ESRCH 3 /* No such process */
-#define EINTR 4 /* Interrupted system call */
-#define EIO 5 /* Input/output error */
-#define ENXIO 6 /* Device not configured */
-#define E2BIG 7 /* Argument list too long */
-#define ENOEXEC 8 /* Exec format error */
-#define EBADF 9 /* Bad file descriptor */
-#define ECHILD 10 /* No child processes */
-#define EDEADLK 11 /* Resource deadlock avoided */
- /* 11 was EAGAIN */
-#define ENOMEM 12 /* Cannot allocate memory */
-#define EACCES 13 /* Permission denied */
-#define EFAULT 14 /* Bad address */
-#ifndef _POSIX_SOURCE
-#define ENOTBLK 15 /* Block device required */
-#endif
-#define EBUSY 16 /* Device busy */
-#define EEXIST 17 /* File exists */
-#define EXDEV 18 /* Cross-device link */
-#define ENODEV 19 /* Operation not supported by device */
-#define ENOTDIR 20 /* Not a directory */
-#define EISDIR 21 /* Is a directory */
-#define EINVAL 22 /* Invalid argument */
-#define ENFILE 23 /* Too many open files in system */
-#define EMFILE 24 /* Too many open files */
-#define ENOTTY 25 /* Inappropriate ioctl for device */
-#ifndef _POSIX_SOURCE
-#define ETXTBSY 26 /* Text file busy */
-#endif
-#define EFBIG 27 /* File too large */
-#define ENOSPC 28 /* No space left on device */
-#define ESPIPE 29 /* Illegal seek */
-#define EROFS 30 /* Read-only file system */
-#define EMLINK 31 /* Too many links */
-#define EPIPE 32 /* Broken pipe */
-
-/* math software */
-#define EDOM 33 /* Numerical argument out of domain */
-#define ERANGE 34 /* Result too large */
-
-/* non-blocking and interrupt i/o */
-#define EAGAIN 35 /* Resource temporarily unavailable */
-#ifndef _POSIX_SOURCE
-#define EWOULDBLOCK EAGAIN /* Operation would block */
-#define EINPROGRESS 36 /* Operation now in progress */
-#define EALREADY 37 /* Operation already in progress */
-
-/* ipc/network software -- argument errors */
-#define ENOTSOCK 38 /* Socket operation on non-socket */
-#define EDESTADDRREQ 39 /* Destination address required */
-#define EMSGSIZE 40 /* Message too long */
-#define EPROTOTYPE 41 /* Protocol wrong type for socket */
-#define ENOPROTOOPT 42 /* Protocol not available */
-#define EPROTONOSUPPORT 43 /* Protocol not supported */
-#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
-#define EOPNOTSUPP 45 /* Operation not supported */
-#define EPFNOSUPPORT 46 /* Protocol family not supported */
-#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
-#define EADDRINUSE 48 /* Address already in use */
-#define EADDRNOTAVAIL 49 /* Can't assign requested address */
-
-/* ipc/network software -- operational errors */
-#define ENETDOWN 50 /* Network is down */
-#define ENETUNREACH 51 /* Network is unreachable */
-#define ENETRESET 52 /* Network dropped connection on reset */
-#define ECONNABORTED 53 /* Software caused connection abort */
-#define ECONNRESET 54 /* Connection reset by peer */
-#define ENOBUFS 55 /* No buffer space available */
-#define EISCONN 56 /* Socket is already connected */
-#define ENOTCONN 57 /* Socket is not connected */
-#define ESHUTDOWN 58 /* Can't send after socket shutdown */
-#define ETOOMANYREFS 59 /* Too many references: can't splice */
-#define ETIMEDOUT 60 /* Operation timed out */
-#define ECONNREFUSED 61 /* Connection refused */
-
-#define ELOOP 62 /* Too many levels of symbolic links */
-#endif /* _POSIX_SOURCE */
-#define ENAMETOOLONG 63 /* File name too long */
-
-/* should be rearranged */
-#ifndef _POSIX_SOURCE
-#define EHOSTDOWN 64 /* Host is down */
-#define EHOSTUNREACH 65 /* No route to host */
-#endif /* _POSIX_SOURCE */
-#define ENOTEMPTY 66 /* Directory not empty */
-
-/* quotas & mush */
-#ifndef _POSIX_SOURCE
-#define EPROCLIM 67 /* Too many processes */
-#define EUSERS 68 /* Too many users */
-#define EDQUOT 69 /* Disc quota exceeded */
-
-/* Network File System */
-#define ESTALE 70 /* Stale NFS file handle */
-#define EREMOTE 71 /* Too many levels of remote in path */
-#define EBADRPC 72 /* RPC struct is bad */
-#define ERPCMISMATCH 73 /* RPC version wrong */
-#define EPROGUNAVAIL 74 /* RPC prog. not avail */
-#define EPROGMISMATCH 75 /* Program version wrong */
-#define EPROCUNAVAIL 76 /* Bad procedure for program */
-#endif /* _POSIX_SOURCE */
-
-#define ENOLCK 77 /* No locks available */
-#define ENOSYS 78 /* Function not implemented */
-
-#ifndef _POSIX_SOURCE
-#define EFTYPE 79 /* Inappropriate file type or format */
-#define EAUTH 80 /* Authentication error */
-#define ENEEDAUTH 81 /* Need authenticator */
-#define ELAST 81 /* Must be equal largest errno */
-#endif /* _POSIX_SOURCE */
-
-#endif
-
diff --git a/mit-pthreads/machdep/bsdi-2.0/time.h b/mit-pthreads/machdep/bsdi-2.0/time.h
deleted file mode 100755
index a8bf0ff8f82..00000000000
--- a/mit-pthreads/machdep/bsdi-2.0/time.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef ts_sec
-#define ts_sec tv_sec
-#define ts_nsec tv_nsec
-#endif
-#include "/usr/include/sys/time.h"
-
diff --git a/mit-pthreads/machdep/bsdi-2.0/timers.h b/mit-pthreads/machdep/bsdi-2.0/timers.h
deleted file mode 100755
index b603b78e6b2..00000000000
--- a/mit-pthreads/machdep/bsdi-2.0/timers.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * timers.h,v 1.50 1994/08/08 03:44:09 proven Exp
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <sys/time.h>
-
-#endif
diff --git a/mit-pthreads/machdep/bsdi-2.0/wait.h b/mit-pthreads/machdep/bsdi-2.0/wait.h
deleted file mode 100755
index 5f7635a73a7..00000000000
--- a/mit-pthreads/machdep/bsdi-2.0/wait.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/* $NetBSD: wait.h,v 1.7 1994/06/29 06:46:23 cgd Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)wait.h 8.1 (Berkeley) 6/2/93
- */
-
-/*
- * This file holds definitions relevent to the wait4 system call
- * and the alternate interfaces that use it (wait, wait3, waitpid).
- */
-
-/*
- * Macros to test the exit status returned by wait
- * and extract the relevant values.
- */
-#ifdef _POSIX_SOURCE
-#define _W_INT(i) (i)
-#else
-#define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */
-#define WCOREFLAG 0200
-#endif
-
-#define _WSTATUS(x) (_W_INT(x) & 0177)
-#define _WSTOPPED 0177 /* _WSTATUS if process is stopped */
-#define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED)
-#define WSTOPSIG(x) (_W_INT(x) >> 8)
-#define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0)
-#define WTERMSIG(x) (_WSTATUS(x))
-#define WIFEXITED(x) (_WSTATUS(x) == 0)
-#define WEXITSTATUS(x) (_W_INT(x) >> 8)
-#ifndef _POSIX_SOURCE
-#define WCOREDUMP(x) (_W_INT(x) & WCOREFLAG)
-
-#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
-#define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED)
-#endif
-
-/*
- * Option bits for the third argument of wait4. WNOHANG causes the
- * wait to not hang if there are no stopped or terminated processes, rather
- * returning an error indication in this case (pid==0). WUNTRACED
- * indicates that the caller should receive status about untraced children
- * which stop due to signals. If children are stopped and a wait without
- * this option is done, it is as though they were still running... nothing
- * about them is returned.
- */
-#define WNOHANG 1 /* dont hang in wait */
-#define WUNTRACED 2 /* tell about stopped, untraced children */
-
-#ifndef _POSIX_SOURCE
-/* POSIX extensions and 4.2/4.3 compatability: */
-
-/*
- * Tokens for special values of the "pid" parameter to wait4.
- */
-#define WAIT_ANY (-1) /* any process */
-#define WAIT_MYPGRP 0 /* any process in my process group */
-
-#include <machine/endian.h>
-
-/*
- * Deprecated:
- * Structure of the information in the status word returned by wait4.
- * If w_stopval==WSTOPPED, then the second structure describes
- * the information returned, else the first.
- */
-union wait {
- int w_status; /* used in syscall */
- /*
- * Terminated process status.
- */
- struct {
-#if BYTE_ORDER == LITTLE_ENDIAN
- unsigned int w_Termsig:7, /* termination signal */
- w_Coredump:1, /* core dump indicator */
- w_Retcode:8, /* exit code if w_termsig==0 */
- w_Filler:16; /* upper bits filler */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- unsigned int w_Filler:16, /* upper bits filler */
- w_Retcode:8, /* exit code if w_termsig==0 */
- w_Coredump:1, /* core dump indicator */
- w_Termsig:7; /* termination signal */
-#endif
- } w_T;
- /*
- * Stopped process status. Returned
- * only for traced children unless requested
- * with the WUNTRACED option bit.
- */
- struct {
-#if BYTE_ORDER == LITTLE_ENDIAN
- unsigned int w_Stopval:8, /* == W_STOPPED if stopped */
- w_Stopsig:8, /* signal that stopped us */
- w_Filler:16; /* upper bits filler */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- unsigned int w_Filler:16, /* upper bits filler */
- w_Stopsig:8, /* signal that stopped us */
- w_Stopval:8; /* == W_STOPPED if stopped */
-#endif
- } w_S;
-};
-#define w_termsig w_T.w_Termsig
-#define w_coredump w_T.w_Coredump
-#define w_retcode w_T.w_Retcode
-#define w_stopval w_S.w_Stopval
-#define w_stopsig w_S.w_Stopsig
-
-#define WSTOPPED _WSTOPPED
-#endif /* _POSIX_SOURCE */
-
-#ifndef KERNEL
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-struct rusage; /* forward declaration */
-
-pid_t wait __P_((int *));
-pid_t waitpid __P_((pid_t, int *, int));
-#ifndef _POSIX_SOURCE
-pid_t wait3 __P_((int *, int, void *));
-pid_t wait4 __P_((pid_t, int *, int, void *));
-#endif
-__END_DECLS
-#endif
-
diff --git a/mit-pthreads/machdep/engine-alpha-netbsd-1.1.c b/mit-pthreads/machdep/engine-alpha-netbsd-1.1.c
deleted file mode 100644
index c1ff04db16d..00000000000
--- a/mit-pthreads/machdep/engine-alpha-netbsd-1.1.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Machine dependent functions for NetBSD/Alpha 1.1(+)
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- *
- * 95/04/22 cgd
- * -Modified to make it go with NetBSD/Alpha
- */
-
-#ifndef lint
-static const char rcsid[] = "engine-alpha-osf1.c,v 1.4.4.1 1995/12/13 05:41:37 proven Exp";
-#endif
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/syscall.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <stdio.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return __machdep_save_int_state(pthread_run->machdep_data.machdep_istate);
-}
-
-void machdep_restore_state(void)
-{
- __machdep_restore_int_state(pthread_run->machdep_data.machdep_istate);
-}
-
-void machdep_save_float_state (void)
-{
- __machdep_save_fp_state(pthread_run->machdep_data.machdep_fstate);
-}
-
-void machdep_restore_float_state (void)
-{
- __machdep_restore_fp_state(pthread_run->machdep_data.machdep_fstate);
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume ();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- /* Set up new stack frame so that it looks like it returned from a
- longjmp() to the beginning of machdep_pthread_start(). */
- machdep_pthread->machdep_istate[8/*ISTATE_RA*/] = 0;
- machdep_pthread->machdep_istate[0/*ISTATE_PC*/] = (long)machdep_pthread_start;
- machdep_pthread->machdep_istate[10/*ISTATE_PV*/] = (long)machdep_pthread_start;
-
- /* Alpha stack starts high and builds down. */
- {
- long stk_addr = (long) machdep_pthread->machdep_stack;
- stk_addr += stack_size - 1024;
- stk_addr &= ~15;
- machdep_pthread->machdep_istate[9/*ISTATE_SP*/] = stk_addr;
- }
-}
-
-int safe_store (loc, new)
- int *loc;
- int new;
-{
- int locked, old;
- asm ("mb" : : : "memory");
- do {
- asm ("ldl_l %0,%1" : "=r" (old) : "m" (*loc));
- asm ("stl_c %0,%1" : "=r" (locked), "=m" (*loc) : "0" (new));
- } while (!locked);
- asm ("mb" : : : "memory");
- return old;
-}
-
-/* ==========================================================================
- * machdep_sys_creat()
- */
-machdep_sys_creat(char * path, int mode)
-{
- return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int a, int * b, int c)
-{
- return(machdep_sys_wait4(a, b, c, NULL));
-}
-
-/* ==========================================================================
- * machdep_sys_getdtablesize()
- */
-machdep_sys_getdtablesize()
-{
- return(sysconf(_SC_OPEN_MAX));
-}
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
-off_t machdep_sys_lseek(int fd, off_t offset, int whence)
-{
- extern off_t __syscall();
-
- return(__syscall((quad_t)SYS_lseek, fd, 0, offset, whence));
-}
diff --git a/mit-pthreads/machdep/engine-alpha-netbsd-1.1.h b/mit-pthreads/machdep/engine-alpha-netbsd-1.1.h
deleted file mode 100644
index 50c872da7b6..00000000000
--- a/mit-pthreads/machdep/engine-alpha-netbsd-1.1.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1994 Chris Provenzano (proven@athena.mit.edu) and
- * Ken Raeburn (raeburn@mit.edu).
- *
- * engine-alpha-osf1.h,v 1.4.4.1 1995/12/13 05:41:42 proven Exp
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-#include <sys/cdefs.h>
-
-/* The first machine dependent functions are the SEMAPHORES needing
- the test and set instruction.
-
- On the Alpha, the actual values here are irrelevant; they just have
- to be different. */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#if 0
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ int *_sem_lock = (lock), locked, old; \
- asm ("mb" : : : "memory"); \
- do { asm ("ldl_l %0,%1" : "=r" (old) : "m" (*_sem_lock)); \
- /* ?? if (old != SEMAPHORE_CLEAR) break; */ \
- asm ("stl_c %0,%1" : "=r" (locked), "=m" (*_sem_lock) \
- : "0" (SEMAPHORE_SET)); \
- } while (!locked); \
- asm ("mb" : : : "memory"); \
- old == SEMAPHORE_CLEAR; })
-
-#define SEMAPHORE_RESET(lock) \
-({ int *_sem_lock = (lock); \
- *_sem_lock = SEMAPHORE_CLEAR; \
- asm ("mb" : : : "memory"); })
-#endif
-
-/*
- * New types
- */
-typedef int semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX 31
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- unsigned long machdep_istate[11];
- unsigned long machdep_fstate[9];
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
- { NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 2048
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-int __machdep_save_int_state __P_((unsigned long *));
-void __machdep_restore_int_state __P_((unsigned long *));
-void __machdep_save_fp_state __P_((unsigned long *));
-void __machdep_restore_fp_state __P_((unsigned long *));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-alpha-netbsd-1.3.c b/mit-pthreads/machdep/engine-alpha-netbsd-1.3.c
deleted file mode 100644
index 0932c421ea2..00000000000
--- a/mit-pthreads/machdep/engine-alpha-netbsd-1.3.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Machine dependent functions for NetBSD/Alpha 1.1(+)
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- *
- * 95/04/22 cgd
- * -Modified to make it go with NetBSD/Alpha
- */
-
-#ifndef lint
-static const char rcsid[] = "engine-alpha-osf1.c,v 1.4.4.1 1995/12/13 05:41:37 proven Exp";
-#endif
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/syscall.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <stdio.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return __machdep_save_int_state(pthread_run->machdep_data.machdep_istate);
-}
-
-void machdep_restore_state(void)
-{
- __machdep_restore_int_state(pthread_run->machdep_data.machdep_istate);
-}
-
-void machdep_save_float_state (void)
-{
- __machdep_save_fp_state(pthread_run->machdep_data.machdep_fstate);
-}
-
-void machdep_restore_float_state (void)
-{
- __machdep_restore_fp_state(pthread_run->machdep_data.machdep_fstate);
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume ();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- /* Set up new stack frame so that it looks like it returned from a
- longjmp() to the beginning of machdep_pthread_start(). */
- machdep_pthread->machdep_istate[8/*ISTATE_RA*/] = 0;
- machdep_pthread->machdep_istate[0/*ISTATE_PC*/] = (long)machdep_pthread_start;
- machdep_pthread->machdep_istate[10/*ISTATE_PV*/] = (long)machdep_pthread_start;
-
- /* Alpha stack starts high and builds down. */
- {
- long stk_addr = (long) machdep_pthread->machdep_stack;
- stk_addr += stack_size - 1024;
- stk_addr &= ~15;
- machdep_pthread->machdep_istate[9/*ISTATE_SP*/] = stk_addr;
- }
-}
-
-int safe_store (loc, new)
- int *loc;
- int new;
-{
- int locked, old;
- asm ("mb" : : : "memory");
- do {
- asm ("ldl_l %0,%1" : "=r" (old) : "m" (*loc));
- asm ("stl_c %0,%1" : "=r" (locked), "=m" (*loc) : "0" (new));
- } while (!locked);
- asm ("mb" : : : "memory");
- return old;
-}
-
-/* ==========================================================================
- * machdep_sys_creat()
- */
-machdep_sys_creat(char * path, int mode)
-{
- return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int a, int * b, int c)
-{
- return(machdep_sys_wait4(a, b, c, NULL));
-}
-
-/* ==========================================================================
- * machdep_sys_getdtablesize()
- */
-machdep_sys_getdtablesize()
-{
- return(sysconf(_SC_OPEN_MAX));
-}
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
-off_t machdep_sys_lseek(int fd, off_t offset, int whence)
-{
- extern off_t __syscall();
-
- return(__syscall((quad_t)SYS_lseek, fd, 0, offset, whence));
-}
-
-/* ==========================================================================
- * machdep_sys_getdirentries()
- */
-machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
-{
- return(machdep_sys_getdents(fd, buf, len));
-}
diff --git a/mit-pthreads/machdep/engine-alpha-netbsd-1.3.h b/mit-pthreads/machdep/engine-alpha-netbsd-1.3.h
deleted file mode 100644
index bc4178d3c41..00000000000
--- a/mit-pthreads/machdep/engine-alpha-netbsd-1.3.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1994 Chris Provenzano (proven@athena.mit.edu) and
- * Ken Raeburn (raeburn@mit.edu).
- *
- * engine-alpha-osf1.h,v 1.4.4.1 1995/12/13 05:41:42 proven Exp
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-#include <sys/cdefs.h>
-#include <sys/signal.h> /* for _NSIG */
-
-/* The first machine dependent functions are the SEMAPHORES needing
- the test and set instruction.
-
- On the Alpha, the actual values here are irrelevant; they just have
- to be different. */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#if 0
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ int *_sem_lock = (lock), locked, old; \
- asm ("mb" : : : "memory"); \
- do { asm ("ldl_l %0,%1" : "=r" (old) : "m" (*_sem_lock)); \
- /* ?? if (old != SEMAPHORE_CLEAR) break; */ \
- asm ("stl_c %0,%1" : "=r" (locked), "=m" (*_sem_lock) \
- : "0" (SEMAPHORE_SET)); \
- } while (!locked); \
- asm ("mb" : : : "memory"); \
- old == SEMAPHORE_CLEAR; })
-
-#define SEMAPHORE_RESET(lock) \
-({ int *_sem_lock = (lock); \
- *_sem_lock = SEMAPHORE_CLEAR; \
- asm ("mb" : : : "memory"); })
-#endif
-
-/*
- * New types
- */
-typedef int semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX (_NSIG-1)
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- unsigned long machdep_istate[11];
- unsigned long machdep_fstate[9];
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
- { NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 2048
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-int __machdep_save_int_state __P_((unsigned long *));
-void __machdep_restore_int_state __P_((unsigned long *));
-void __machdep_save_fp_state __P_((unsigned long *));
-void __machdep_restore_fp_state __P_((unsigned long *));
-
-extern off_t machdep_sys_lseek(int, off_t, int);
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-alpha-osf1.c b/mit-pthreads/machdep/engine-alpha-osf1.c
deleted file mode 100644
index 9b563a56c28..00000000000
--- a/mit-pthreads/machdep/engine-alpha-osf1.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Machine dependent functions for SunOS-4.1.3 on sparc
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <stdlib.h>
-
-/* These would be defined in setjmp.h, if _POSIX_SOURCE and _XOPEN_SOURCE
- were both undefined. But we've already included it, and lost the
- opportunity. */
-#define JB_PC 2
-#define JB_RA 30
-#define JB_PV 31
-#define JB_SP 34
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return setjmp (pthread_run->machdep_data.machdep_state);
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-extern void machdep_restore_from_setjmp (jmp_buf, long);
-void machdep_restore_state(void)
-{
- machdep_restore_from_setjmp (pthread_run->machdep_data.machdep_state, 1);
-}
-
-void machdep_save_float_state (void) { }
-void machdep_restore_float_state (void) { }
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume ();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- setjmp(machdep_pthread->machdep_state);
-
- /* Set up new stack frame so that it looks like it returned from a
- longjmp() to the beginning of machdep_pthread_start(). */
- machdep_pthread->machdep_state[JB_RA] = 0;
- machdep_pthread->machdep_state[JB_PC] = (long)machdep_pthread_start;
- machdep_pthread->machdep_state[JB_PV] = (long)machdep_pthread_start;
-
- /* Alpha stack starts high and builds down. */
- {
- long stk_addr = (long) machdep_pthread->machdep_stack;
- stk_addr += stack_size - 1024;
- stk_addr &= ~15;
- machdep_pthread->machdep_state[JB_SP] = stk_addr;
- }
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int pid, int * statusp, int options)
-{
- return machdep_sys_wait4 (pid, statusp, options, NULL);
-}
-
-/* These are found in flsbuf.o in the Alpha libc. I don't know what
- they're for, precisely. */
-static xxx;
-_bufsync (p)
- char *p;
-{
- long a1 = *(long *)(p+48);
- long t0 = *(long *)(p+8);
- long v0 = a1 - t0;
- long t1, t2;
-
- abort ();
-
- v0 += xxx;
- if (v0 < 0)
- {
- *(char**)(p + 8) = p;
- return v0;
- }
- t1 = *(int*)p;
- t2 = v0 - t1;
- if (t2 < 0)
- *(int*)p = (int) v0;
- return v0;
-}
-
-_findbuf () { abort (); }
-_wrtchk () { abort (); }
-_xflsbuf () { abort (); }
-_flsbuf () { abort (); }
-
-void __xxx_never_called () {
- /* Force other stuff to get dragged in. */
- _cleanup ();
- fflush (NULL);
- fclose (NULL);
-}
-
-int safe_store (loc, new)
- int *loc;
- int new;
-{
- int locked, old;
- asm ("mb" : : : "memory");
- do {
- asm ("ldl_l %0,%1" : "=r" (old) : "m" (*loc));
- asm ("stl_c %0,%1" : "=r" (locked), "=m" (*loc) : "0" (new));
- } while (!locked);
- asm ("mb" : : : "memory");
- return old;
-}
diff --git a/mit-pthreads/machdep/engine-alpha-osf1.h b/mit-pthreads/machdep/engine-alpha-osf1.h
deleted file mode 100644
index fdf374ccc44..00000000000
--- a/mit-pthreads/machdep/engine-alpha-osf1.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1994 Chris Provenzano (proven@athena.mit.edu) and
- * Ken Raeburn (raeburn@mit.edu).
- *
- * $Id$
- *
- */
-
-#ifndef sigwait
-#define sigwait __bogus_osf1_sigwait
-#endif
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-#include <sys/cdefs.h>
-
-#undef sigwait
-
-/* The first machine dependent functions are the SEMAPHORES needing
- the test and set instruction.
-
- On the Alpha, the actual values here are irrelevant; they just have
- to be different. */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#if 0
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ int *_sem_lock = (lock), locked, old; \
- asm ("mb" : : : "memory"); \
- do { asm ("ldl_l %0,%1" : "=r" (old) : "m" (*_sem_lock)); \
- /* ?? if (old != SEMAPHORE_CLEAR) break; */ \
- asm ("stl_c %0,%1" : "=r" (locked), "=m" (*_sem_lock) \
- : "0" (SEMAPHORE_SET)); \
- } while (!locked); \
- asm ("mb" : : : "memory"); \
- old == SEMAPHORE_CLEAR; })
-
-#define SEMAPHORE_RESET(lock) \
-({ int *_sem_lock = (lock); \
- *_sem_lock = SEMAPHORE_CLEAR; \
- asm ("mb" : : : "memory"); })
-#endif
-
-/*
- * New types
- */
-typedef int semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
- { NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 2048
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-arm32-netbsd-1.3.c b/mit-pthreads/machdep/engine-arm32-netbsd-1.3.c
deleted file mode 100644
index 510b35fdb0e..00000000000
--- a/mit-pthreads/machdep/engine-arm32-netbsd-1.3.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Machine dependent functions for NetBSD on arm32
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- *
- * 98/10/22 bad
- * -adapt from i386 version
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/syscall.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <stdio.h>
-
-#if defined(_JB_REG_R13)
-#define REG_LR _JB_REG_R14
-#define REG_SP _JB_REG_R13
-#else
-#define REG_LR JMPBUF_REG_R14
-#define REG_SP JMPBUF_REG_R13
-#endif
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(_setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_float_state(struct pthread * pthread)
-{
- return;
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- _longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_restore_float_state()
- */
-int machdep_restore_float_state(void)
-{
- return;
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
- int ret;
-
- if (machdep_pthread) {
- ret = setitimer(ITIMER_VIRTUAL, &zeroval,
- &(machdep_pthread->machdep_timer));
- } else {
- ret = setitimer(ITIMER_VIRTUAL, &zeroval, NULL);
- }
-
- if (ret) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- _setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state[REG_LR] = (int)machdep_pthread_start;
-
- /* Stack starts high and builds down. */
- machdep_pthread->machdep_state[REG_SP] =
- (int)machdep_pthread->machdep_stack + stack_size;
-}
-
-/* ==========================================================================
- * machdep_sys_creat()
- */
-machdep_sys_creat(char * path, int mode)
-{
- return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int a, int * b, int c)
-{
- return(machdep_sys_wait4(a, b, c, NULL));
-}
-
-/* ==========================================================================
- * machdep_sys_getdtablesize()
- */
-machdep_sys_getdtablesize()
-{
- return(sysconf(_SC_OPEN_MAX));
-}
-
-/* ==========================================================================
- * machdep_sys_getdirentries()
- */
-machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
-{
- return(machdep_sys_getdents(fd, buf, len));
-}
diff --git a/mit-pthreads/machdep/engine-arm32-netbsd-1.3.h b/mit-pthreads/machdep/engine-arm32-netbsd-1.3.h
deleted file mode 100644
index c8a4e79386a..00000000000
--- a/mit-pthreads/machdep/engine-arm32-netbsd-1.3.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * Id: engine-i386-netbsd-1.3.h,v 1.1 1998/02/28 04:53:15 cjs Exp
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-#include <sys/signal.h> /* for _NSIG */
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#if 0
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-long temp = SEMAPHORE_SET; \
- \
-__asm__ volatile ("xchgl %0,(%2)" \
- :"=r" (temp) \
- :"0" (temp),"r" (lock)); \
-temp; \
-})
-
-#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
-#endif
-
-/*
- * New types
- */
-typedef long semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX (_NSIG-1)
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
-#if 0
- char machdep_float_state[108];
-#endif
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-hppa-hpux-10.20.c b/mit-pthreads/machdep/engine-hppa-hpux-10.20.c
deleted file mode 100644
index f6f0b2e0f1d..00000000000
--- a/mit-pthreads/machdep/engine-hppa-hpux-10.20.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Machine dependent functions for HP-UX 9.03 on hppa
- *
- * 1.00 93/12/14 proven
- * -Started coding this file.
- */
-
-#include <pthread.h>
-#include <setjmp.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-volatile int setupStack = 0;
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_save_float_state()
- */
-void machdep_save_float_state(struct pthread * pthread)
-{
- return;
-}
-
-/* ==========================================================================
- * machdep_restore_float_state()
- */
-void machdep_restore_float_state()
-{
- return;
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(jmp_buf j)
-{
- setjmp(j);
- if( setupStack )
- return;
-
- context_switch_done();
- pthread_sched_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- jmp_buf tmp_jmp_buf;
-
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- /*
- * Set up new stack frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- setjmp(machdep_pthread->machdep_state);
-
- /* get the stack frame from the real machdep_pthread_start */
- setupStack = 1;
-/* machdep_pthread_start(machdep_pthread->machdep_state); */
- machdep_pthread_start(tmp_jmp_buf);
- setupStack = 0;
-
- /* copy over the interesting part of the frame */
- ((int *)machdep_pthread->machdep_state)[44] = ((int *)tmp_jmp_buf)[44];
-
- /* Stack starts low and builds up, but needs two start frames */
- ((int *)machdep_pthread->machdep_state)[1] =
- (int)machdep_pthread->machdep_stack + (64 * 2);
-}
-
-int machdep_sys_getdtablesize()
-{
- return sysconf(_SC_OPEN_MAX);
-}
-
-void sig_check_and_resume()
-{
- return;
-}
-
-void ___exit(int status)
-{
- exit(status);
- PANIC();
-}
diff --git a/mit-pthreads/machdep/engine-hppa-hpux-10.20.h b/mit-pthreads/machdep/engine-hppa-hpux-10.20.h
deleted file mode 100644
index 9cbe3349a3d..00000000000
--- a/mit-pthreads/machdep/engine-hppa-hpux-10.20.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-
-/*
- * Stuff for compiling
- */
-#if defined(__GNUC__)
-#if defined(__cplusplus)
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS };
-#else
-#define __BEGIN_DECLS
-#define __END_DECLS
-#if !defined(__STDC__)
-#define const __const
-#define inline __inline
-#define signed __signed
-#define volatile __volatile
-#endif
-#endif
-#else /* !__GNUC__ */
-#define __BEGIN_DECLS
-#define __END_DECLS
-#if !defined(__STDC__)
-#define const
-#endif
-#define inline
-#define signed
-#define volatile
-#endif
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- *
- * Note: The set and clear defines are backwards.
- */
-#define SEMAPHORE_CLEAR { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }
-#define SEMAPHORE_SET 0
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-long real_addr; \
-long temp; \
- \
-real_addr = ((long)((*lock) + 15) & ~15); \
- \
-__asm__ volatile("ldcwx %%r0(%2),%0" \
- :"=r" (temp) \
- :"0" (temp),"r" (real_addr)); \
-temp ? 0 : 1; \
-})
-
-#define SEMAPHORE_RESET(lock) \
-({ \
-char *real_addr; \
- \
-real_addr = (char*)((long)((*lock) + 15) & ~15); \
-*real_addr = 0xff; \
-})
-
-/*
- * New types
- * The semaphore is really 16 bytes but must be aligened on a 16 byte
- * boundary. By specifing 31 bytes the macros can frob it correctly.
- */
-typedef char semaphore[31];
-
-/*
- * Macros for sigset_t
- */
-#define SIGMAX 30
-/* see hpux-9.03/__signal.h for SIG_ANY */
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
- /* long machdep_state[_JBLEN]; */
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 4096
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * page size
- */
-#define getpagesize() 4096
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-hppa-hpux-9.03.c b/mit-pthreads/machdep/engine-hppa-hpux-9.03.c
deleted file mode 100644
index 3770a2e106a..00000000000
--- a/mit-pthreads/machdep/engine-hppa-hpux-9.03.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Machine dependent functions for HP-UX 9.03 on hppa
- *
- * 1.00 93/12/14 proven
- * -Started coding this file.
- */
-
-#include <pthread.h>
-#include <setjmp.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_save_float_state()
- */
-void machdep_save_float_state(struct pthread * pthread)
-{
- return;
-}
-
-/* ==========================================================================
- * machdep_restore_float_state()
- */
-void machdep_restore_float_state()
-{
- return;
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- ((int *)machdep_pthread->machdep_state)[0] = (int)machdep_pthread_start;
-
- /* Stack starts low and builds up, but needs two start frames */
- ((int *)machdep_pthread->machdep_state)[1] =
- (int)machdep_pthread->machdep_stack + (64 * 2);
-}
-
-int machdep_sys_getdtablesize()
-{
- return sysconf(_SC_OPEN_MAX);
-}
-
-void sig_check_and_resume()
-{
- return;
-}
-
-void ___exit(int status)
-{
- exit(status);
- PANIC();
-}
diff --git a/mit-pthreads/machdep/engine-hppa-hpux-9.03.h b/mit-pthreads/machdep/engine-hppa-hpux-9.03.h
deleted file mode 100644
index 7c599400e3e..00000000000
--- a/mit-pthreads/machdep/engine-hppa-hpux-9.03.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-
-/*
- * Stuff for compiling
- */
-#if defined(__GNUC__)
-#if defined(__cplusplus)
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS };
-#else
-#define __BEGIN_DECLS
-#define __END_DECLS
-#if !defined(__STDC__)
-#define const __const
-#define inline __inline
-#define signed __signed
-#define volatile __volatile
-#endif
-#endif
-#else /* !__GNUC__ */
-#define __BEGIN_DECLS
-#define __END_DECLS
-#define const
-#define inline
-#define signed
-#define volatile
-#endif
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- *
- * Note: The set and clear defines are backwards.
- */
-#define SEMAPHORE_CLEAR { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }
-#define SEMAPHORE_SET 0
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-long real_addr; \
-long temp; \
- \
-real_addr = ((long)((*lock) + 15) & ~15); \
- \
-__asm__ volatile("ldcwx %%r0(%2),%0" \
- :"=r" (temp) \
- :"0" (temp),"r" (real_addr)); \
-temp ? 0 : 1; \
-})
-
-#define SEMAPHORE_RESET(lock) \
-({ \
-char *real_addr; \
- \
-real_addr = (char*)((long)((*lock) + 15) & ~15); \
-*real_addr = 0xff; \
-})
-
-/*
- * New types
- * The semaphore is really 16 bytes but must be aligened on a 16 byte
- * boundary. By specifing 31 bytes the macros can frob it correctly.
- */
-typedef char semaphore[31];
-
-/*
- * Macros for sigset_t
- */
-#define SIGMAX 30
-/* see hpux-9.03/__signal.h for SIG_ANY */
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
- /* long machdep_state[_JBLEN]; */
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 4096
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * page size
- */
-#define getpagesize() 4096
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-bsdi-1.1.c b/mit-pthreads/machdep/engine-i386-bsdi-1.1.c
deleted file mode 100644
index da78bef393e..00000000000
--- a/mit-pthreads/machdep/engine-i386-bsdi-1.1.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent functions for NetBSD on i386
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <fcntl.h>
-#include <stdio.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(_setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- _longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- sig_check_and_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * machdep_pthread_create()
- */
-void machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument, long stack_size,
- void *stack_start, long nsec)
-{
- machdep_pthread->machdep_stack = stack_start;
-
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- _setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state[0] = (int)machdep_pthread_start;
-
- /* Stack starts high and builds down. */
- machdep_pthread->machdep_state[2] =
- (int)machdep_pthread->machdep_stack + stack_size;
-}
-
-/* ==========================================================================
- * machdep_sys_creat()
- */
-machdep_sys_creat(char * path, int mode)
-{
- return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int a, int * b, int c)
-{
- return(machdep_sys_wait4(a, b, c, NULL));
-}
-
-/* ==========================================================================
- * machdep_sys_send()
- */
-machdep_sys_send(int s, const void *buf, int len, int flags)
-{
- return(machdep_sys_sendto(s, buf, len, flags, (struct sockaddr*)NULL, 0));
-}
-
-/* ==========================================================================
- * machdep_sys_recv()
- */
-machdep_sys_recv(int s, void *buf, int len, int flags)
-{
- return(machdep_sys_recvfrom(s, buf, len, flags, (struct sockaddr*)NULL, 0));
-}
diff --git a/mit-pthreads/machdep/engine-i386-bsdi-1.1.h b/mit-pthreads/machdep/engine-i386-bsdi-1.1.h
deleted file mode 100644
index 7f7b8a62d06..00000000000
--- a/mit-pthreads/machdep/engine-i386-bsdi-1.1.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-long temp = SEMAPHORE_SET; \
- \
-__asm__ volatile ("xchgl %0,(%2)" \
- :"=r" (temp) \
- :"0" (temp),"r" (lock)); \
-temp; \
-})
-
-#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
-
-/*
- * New types
- */
-typedef long semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX 31
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
-
diff --git a/mit-pthreads/machdep/engine-i386-bsdi-2.0.c b/mit-pthreads/machdep/engine-i386-bsdi-2.0.c
deleted file mode 100644
index 63a6de1b092..00000000000
--- a/mit-pthreads/machdep/engine-i386-bsdi-2.0.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent functions for NetBSD on i386
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <stdio.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(_setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_float_state(struct pthread * pthread)
-{
- char * fdata = (char *)pthread->machdep_data.machdep_float_state;
-
- __asm__ ("fsave %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- _longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_restore_float_state()
- */
-int machdep_restore_float_state(void)
-{
- char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
-
- __asm__ ("frstor %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
- int ret;
-
- if (machdep_pthread) {
- ret = setitimer(ITIMER_VIRTUAL, &zeroval,
- &(machdep_pthread->machdep_timer));
- } else {
- ret = setitimer(ITIMER_VIRTUAL, &zeroval, NULL);
- }
-
- if (ret) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- _setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state[0] = (int)machdep_pthread_start;
-
- /* Stack starts high and builds down. */
- machdep_pthread->machdep_state[2] =
- (int)machdep_pthread->machdep_stack + stack_size;
-}
-
-/* ==========================================================================
- * machdep_sys_creat()
- */
-machdep_sys_creat(char * path, int mode)
-{
- return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int a, int * b, int c)
-{
- return(machdep_sys_wait4(a, b, c, NULL));
-}
-
diff --git a/mit-pthreads/machdep/engine-i386-bsdi-2.0.h b/mit-pthreads/machdep/engine-i386-bsdi-2.0.h
deleted file mode 100644
index 3be254b4090..00000000000
--- a/mit-pthreads/machdep/engine-i386-bsdi-2.0.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * engine-i386-netbsd-1.0.h,v 1.53 1994/12/13 07:17:23 proven Exp
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-long temp = SEMAPHORE_SET; \
- \
-__asm__ volatile ("xchgl %0,(%2)" \
- :"=r" (temp) \
- :"0" (temp),"r" (lock)); \
-temp; \
-})
-
-#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
-
-/*
- * New types
- */
-typedef long semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX 31
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
- char machdep_float_state[108];
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK (O_NONBLOCK|O_NDELAY)
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
-
diff --git a/mit-pthreads/machdep/engine-i386-freebsd-1.1.c b/mit-pthreads/machdep/engine-i386-freebsd-1.1.c
deleted file mode 100644
index 422193e77e3..00000000000
--- a/mit-pthreads/machdep/engine-i386-freebsd-1.1.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent functions for NetBSD on i386
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <stdio.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(_setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- _longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- sig_check_and_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * machdep_pthread_create()
- */
-void machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument, long stack_size,
- void *stack_start, long nsec)
-{
- machdep_pthread->machdep_stack = stack_start;
-
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- _setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state[0] = (int)machdep_pthread_start;
-
- /* Stack starts high and builds down. */
- machdep_pthread->machdep_state[2] =
- (int)machdep_pthread->machdep_stack + stack_size;
-}
-
-/* ==========================================================================
- * machdep_sys_creat()
- */
-machdep_sys_creat(char * path, int mode)
-{
- return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int a, int * b, int c)
-{
- return(machdep_sys_wait4(a, b, c, NULL));
-}
-
-/* ==========================================================================
- * machdep_sys_send()
- */
-machdep_sys_send(int s, const void *buf, int len, int flags)
-{
- return(machdep_sys_sendto(s, buf, len, flags, NULL, 0));
-}
-
-/* ==========================================================================
- * machdep_sys_recv()
- */
-machdep_sys_recv(int s, void *buf, int len, int flags)
-{
- return(machdep_sys_recvfrom(s, buf, len, flags, NULL, 0));
-}
diff --git a/mit-pthreads/machdep/engine-i386-freebsd-1.1.h b/mit-pthreads/machdep/engine-i386-freebsd-1.1.h
deleted file mode 100644
index 0e8e93bdbfb..00000000000
--- a/mit-pthreads/machdep/engine-i386-freebsd-1.1.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-long temp = SEMAPHORE_SET; \
- \
-__asm__ volatile ("xchgl %0,(%2)" \
- :"=r" (temp) \
- :"0" (temp),"r" (lock)); \
-temp; \
-})
-
-#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
-
-/*
- * New types
- */
-typedef long semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX 31
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-freebsd-2.0.c b/mit-pthreads/machdep/engine-i386-freebsd-2.0.c
deleted file mode 100644
index 3b6b8f31ae0..00000000000
--- a/mit-pthreads/machdep/engine-i386-freebsd-2.0.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1995 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent functions for NetBSD on i386
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "engine-i386-freebsd-2.0.c,v 1.1 1995/03/01 01:21:20 proven Exp";
-#endif
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <stdio.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(machdep_sys_setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_float_state(struct pthread * pthread)
-{
- char * fdata = (char *)pthread->machdep_data.machdep_float_state;
-
- __asm__ ("fsave %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- machdep_sys_longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_restore_float_state()
- */
-int machdep_restore_float_state(void)
-{
- char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
-
- __asm__ ("frstor %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
- int ret;
-
- if (machdep_pthread) {
- ret = setitimer(ITIMER_VIRTUAL, &zeroval,
- &(machdep_pthread->machdep_timer));
- } else {
- ret = setitimer(ITIMER_VIRTUAL, &zeroval, NULL);
- }
-
- if (ret) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- machdep_sys_setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state->_jb[0] = (int)machdep_pthread_start;
-
- /* Stack starts high and builds down. */
- machdep_pthread->machdep_state->_jb[2] =
- (int)machdep_pthread->machdep_stack + stack_size;
-}
-
-/* ==========================================================================
- * machdep_sys_creat()
- */
-machdep_sys_creat(char * path, int mode)
-{
- return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int a, int * b, int c)
-{
- return(machdep_sys_wait4(a, b, c, NULL));
-}
-
diff --git a/mit-pthreads/machdep/engine-i386-freebsd-2.0.h b/mit-pthreads/machdep/engine-i386-freebsd-2.0.h
deleted file mode 100644
index 87ef21389ce..00000000000
--- a/mit-pthreads/machdep/engine-i386-freebsd-2.0.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-long temp = SEMAPHORE_SET; \
- \
-__asm__ volatile ("xchgl %0,(%2)" \
- :"=r" (temp) \
- :"0" (temp),"r" (lock)); \
-temp; \
-})
-
-#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
-
-/*
- * New types
- */
-typedef long semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX 31
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
- char machdep_float_state[108];
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-linux-1.0.c b/mit-pthreads/machdep/engine-i386-linux-1.0.c
deleted file mode 100644
index fac044fe47c..00000000000
--- a/mit-pthreads/machdep/engine-i386-linux-1.0.c
+++ /dev/null
@@ -1,503 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Machine dependent functions for Linux-1.0 on i386
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <sys/uio.h>
-#include <sys/types.h>
-#include <sys/param.h> /* for OPEN_MAX */
-#include <sys/socket.h>
-#include <sys/socketcall.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(_setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_save_float_state()
- */
-int machdep_save_float_state(struct pthread * pthread)
-{
- char * fdata = (char *)pthread->machdep_data.machdep_float_state;
-
- __asm__ ("fsave %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_restore_float_state()
- */
-int machdep_restore_float_state(void)
-{
- char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
-
- __asm__ ("frstor %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flag)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state->__pc = (char *)machdep_pthread_start;
- machdep_pthread->machdep_state->__bp = (char *)0;/* So the backtrace
- * is sensible (mevans) *
-
- /* Stack starts high and builds down. */
- machdep_pthread->machdep_state->__sp =
- (char *)machdep_pthread->machdep_stack + stack_size;
-}
-
-
-/* ==========================================================================
- * Linux Socket calls are a bit different
- * ==========================================================================
- * machdep_sys_socket()
- */
-int machdep_sys_socket(int a, int b, int c)
-{
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_SOCKET, array));
-}
-
-/* ==========================================================================
- * machdep_sys_accept()
- */
-int machdep_sys_accept(int a, struct sockaddr * b, int * c)
-{
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_ACCEPT, array));
-}
-
-/* ==========================================================================
- * machdep_sys_bind()
- */
-int machdep_sys_bind(int a, const struct sockaddr * b, int c)
-{
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_BIND, array));
-}
-
-/* ==========================================================================
- * machdep_sys_connect()
- */
-int machdep_sys_connect(int a, const struct sockaddr * b, int c)
-{
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_CONNECT, array));
-}
-
-/* ==========================================================================
- * machdep_sys_listen()
- */
-int machdep_sys_listen(int a, const struct sockaddr * b, int c)
-{
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_LISTEN, array));
-}
-
-/* ==========================================================================
- * machdep_sys_shutdown()
- */
-int machdep_sys_shutdown(int a, int b)
-{
- int array[2];
-
- array[0] = (int)a;
- array[1] = (int)b;
-
- return(machdep_sys_socketcall(SYS_SHUTDOWN, array));
-}
-
-/* ==========================================================================
- * machdep_sys_getsockopt()
- */
-int machdep_sys_getsockopt(int a, int b, int c, char *d, int *e)
-{
- int array[5];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
- array[3] = (int)d;
- array[4] = (int)e;
-
- return(machdep_sys_socketcall(SYS_GETSOCKOPT, array));
-}
-
-/* ==========================================================================
- * machdep_sys_setsockopt()
- */
-int machdep_sys_setsockopt(int a, int b, int c, char *d, int e)
-{
- int array[5];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
- array[3] = (int)d;
- array[4] = (int)e;
-
- return(machdep_sys_socketcall(SYS_SETSOCKOPT, array));
-}
-
-/* ==========================================================================
- * machdep_sys_getpeername()
- */
-int machdep_sys_getpeername(int a, struct sockaddr *b, int *c)
-{
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_GETPEERNAME, array));
-}
-
-/* ==========================================================================
- * machdep_sys_send()
- */
-int machdep_sys_send(int a, char *b, int c, int d)
-{
- int array[4];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
- array[3] = (int)d;
-
- return(machdep_sys_socketcall(SYS_SEND, array));
-}
-
-/* ==========================================================================
- * machdep_sys_sendto()
- */
-int machdep_sys_sendto(int a, char *b, int c, int d,
- struct sockaddr *e, int f)
-{
- int array[6];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
- array[3] = (int)d;
- array[4] = (int)e;
- array[5] = (int)f;
-
- return(machdep_sys_socketcall(SYS_SENDTO, array));
-}
-
-/* ==========================================================================
- * machdep_sys_recv()
- */
-int machdep_sys_recv(int a, char *b, int c, int d)
-{
- int array[4];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
- array[3] = (int)d;
-
- return(machdep_sys_socketcall(SYS_RECV, array));
-}
-
-/* ==========================================================================
- * machdep_sys_recvfrom()
- */
-int machdep_sys_recvfrom(int a, char *b, int c, int d,
- struct sockaddr *e, int *f)
-{
- int array[6];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
- array[3] = (int)d;
- array[4] = (int)e;
- array[5] = (int)f;
-
- return(machdep_sys_socketcall(SYS_RECVFROM, array));
-}
-
-/* ==========================================================================
- * machdep_sys_socketpair()
- */
-int machdep_sys_socketpair(int a, int b, int c, int d[2])
-{
- int array[4];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
- array[3] = (int)d;
-
- return(machdep_sys_socketcall(SYS_SOCKETPAIR, array));
-}
-
-/* ==========================================================================
- * machdep_sys_getsockname()
- */
-int machdep_sys_getsockname(int a, char * b, int * c)
-{
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_GETSOCKNAME, array));
-}
-
-/* ==========================================================================
- * machdep_sys_sendmsg()
- */
-int machdep_sys_sendmsg(int a, char * b, int c)
-{
-#ifdef SYS_SENDMSG
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_SENDMSG, array));
-#else
- return(-ENOSYS);
-#endif
-}
-
-/* ==========================================================================
- * machdep_sys_recvmsg()
- */
-int machdep_sys_recvmsg(int a, char * b, int c)
-{
-#ifdef SYS_RECVMSG
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_RECVMSG, array));
-#else
- return(-ENOSYS);
-#endif
-}
-
-/* ==========================================================================
- * machdep_sys_getdirentries()
- */
-int machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
-{
- int ret;
-
- if ((ret = machdep_sys_readdir(fd, buf, 1)) > 0) {
- return(1);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int a, int * b, int c)
-{
- return(machdep_sys_wait4(a, b, c, NULL));
-}
-
-/* getdtablesize */
-machdep_sys_getdtablesize ()
-{
- return OPEN_MAX;
-}
-
-struct stat;
-
-/* ==========================================================================
- * _fxstat()
- */
-int _fxstat(int __ver, int fd, struct stat *buf)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
- ret = machdep_sys_fstat(fd_table[fd]->fd.i, buf);
- fd_unlock(fd, FD_READ);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * _lxstat()
- */
-int _lxstat(int __ver, const char * path, struct stat * buf)
-{
- int ret;
-
- if ((ret = machdep_sys_lstat(path, buf)) < OK) {
- SET_ERRNO(-ret);
- }
- return(ret);
-
-}
-
-/* ==========================================================================
- * _xstat()
- */
-int _xstat(int __ver, const char * path, struct stat * buf)
-{
- int ret;
-
- if ((ret = machdep_sys_stat(path, buf)) < OK) {
- SET_ERRNO(-ret);
- }
- return(ret);
-
-}
-
-/* ==========================================================================
- * strtol()
- */
-__strtol_internal(char * a, char ** b, int c)
-{
- return(strtol(a, b, c));
-}
-
-
diff --git a/mit-pthreads/machdep/engine-i386-linux-1.0.h b/mit-pthreads/machdep/engine-i386-linux-1.0.h
deleted file mode 100644
index 721618a6f19..00000000000
--- a/mit-pthreads/machdep/engine-i386-linux-1.0.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- */
-
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-volatile long temp = SEMAPHORE_SET; \
- \
-__asm__("xchgl %0,(%2)" \
- :"=r" (temp) \
- :"0" (temp),"r" (lock)); \
-temp; \
-})
-
-#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
-
-/*
- * New types
- */
-typedef long semaphore;
-
-#define SIGMAX 31
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
- char machdep_float_state[108];
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-linux-2.0.c b/mit-pthreads/machdep/engine-i386-linux-2.0.c
deleted file mode 100644
index 72c757fe08a..00000000000
--- a/mit-pthreads/machdep/engine-i386-linux-2.0.c
+++ /dev/null
@@ -1,504 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Machine dependent functions for Linux-1.0 on i386
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <sys/uio.h>
-#include <sys/types.h>
-#include <sys/param.h> /* for OPEN_MAX */
-#include <sys/socket.h>
-#include <sys/socketcall.h>
-#include <linux/net.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(_setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_save_float_state()
- */
-int machdep_save_float_state(struct pthread * pthread)
-{
- char * fdata = (char *)pthread->machdep_data.machdep_float_state;
-
- __asm__ ("fsave %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_restore_float_state()
- */
-int machdep_restore_float_state(void)
-{
- char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
-
- __asm__ ("frstor %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flag)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state->__jmpbuf[JB_PC]= (int) (char *)machdep_pthread_start;
- /* Fix so that the backtrace * is sensible (mevans) */
- machdep_pthread->machdep_state->__jmpbuf[JB_BP] = (int) (char *) 0;
-
- /* Stack starts high and builds down. */
- machdep_pthread->machdep_state->__jmpbuf[JB_SP]=
- (int) (char *) machdep_pthread->machdep_stack + stack_size;
-}
-
-
-/* ==========================================================================
- * Linux Socket calls are a bit different
- * ==========================================================================
- * machdep_sys_socket()
- */
-int machdep_sys_socket(int a, int b, int c)
-{
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_SOCKET, array));
-}
-
-/* ==========================================================================
- * machdep_sys_accept()
- */
-int machdep_sys_accept(int a, struct sockaddr * b, int * c)
-{
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_ACCEPT, array));
-}
-
-/* ==========================================================================
- * machdep_sys_bind()
- */
-int machdep_sys_bind(int a, const struct sockaddr * b, int c)
-{
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_BIND, array));
-}
-
-/* ==========================================================================
- * machdep_sys_connect()
- */
-int machdep_sys_connect(int a, const struct sockaddr * b, int c)
-{
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_CONNECT, array));
-}
-
-/* ==========================================================================
- * machdep_sys_listen()
- */
-int machdep_sys_listen(int a, const struct sockaddr * b, int c)
-{
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_LISTEN, array));
-}
-
-/* ==========================================================================
- * machdep_sys_shutdown()
- */
-int machdep_sys_shutdown(int a, int b)
-{
- int array[2];
-
- array[0] = (int)a;
- array[1] = (int)b;
-
- return(machdep_sys_socketcall(SYS_SHUTDOWN, array));
-}
-
-/* ==========================================================================
- * machdep_sys_getsockopt()
- */
-int machdep_sys_getsockopt(int a, int b, int c, char *d, int *e)
-{
- int array[5];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
- array[3] = (int)d;
- array[4] = (int)e;
-
- return(machdep_sys_socketcall(SYS_GETSOCKOPT, array));
-}
-
-/* ==========================================================================
- * machdep_sys_setsockopt()
- */
-int machdep_sys_setsockopt(int a, int b, int c, char *d, int e)
-{
- int array[5];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
- array[3] = (int)d;
- array[4] = (int)e;
-
- return(machdep_sys_socketcall(SYS_SETSOCKOPT, array));
-}
-
-/* ==========================================================================
- * machdep_sys_getpeername()
- */
-int machdep_sys_getpeername(int a, struct sockaddr *b, int *c)
-{
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_GETPEERNAME, array));
-}
-
-/* ==========================================================================
- * machdep_sys_send()
- */
-int machdep_sys_send(int a, char *b, int c, int d)
-{
- int array[4];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
- array[3] = (int)d;
-
- return(machdep_sys_socketcall(SYS_SEND, array));
-}
-
-/* ==========================================================================
- * machdep_sys_sendto()
- */
-int machdep_sys_sendto(int a, char *b, int c, int d,
- struct sockaddr *e, int f)
-{
- int array[6];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
- array[3] = (int)d;
- array[4] = (int)e;
- array[5] = (int)f;
-
- return(machdep_sys_socketcall(SYS_SENDTO, array));
-}
-
-/* ==========================================================================
- * machdep_sys_recv()
- */
-int machdep_sys_recv(int a, char *b, int c, int d)
-{
- int array[4];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
- array[3] = (int)d;
-
- return(machdep_sys_socketcall(SYS_RECV, array));
-}
-
-/* ==========================================================================
- * machdep_sys_recvfrom()
- */
-int machdep_sys_recvfrom(int a, char *b, int c, int d,
- struct sockaddr *e, int *f)
-{
- int array[6];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
- array[3] = (int)d;
- array[4] = (int)e;
- array[5] = (int)f;
-
- return(machdep_sys_socketcall(SYS_RECVFROM, array));
-}
-
-/* ==========================================================================
- * machdep_sys_socketpair()
- */
-int machdep_sys_socketpair(int a, int b, int c, int d[2])
-{
- int array[4];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
- array[3] = (int)d;
-
- return(machdep_sys_socketcall(SYS_SOCKETPAIR, array));
-}
-
-/* ==========================================================================
- * machdep_sys_getsockname()
- */
-int machdep_sys_getsockname(int a, char * b, int * c)
-{
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_GETSOCKNAME, array));
-}
-
-/* ==========================================================================
- * machdep_sys_sendmsg()
- */
-int machdep_sys_sendmsg(int a, char * b, int c)
-{
-#ifdef SYS_SENDMSG
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_SENDMSG, array));
-#else
- return(-ENOSYS);
-#endif
-}
-
-/* ==========================================================================
- * machdep_sys_recvmsg()
- */
-int machdep_sys_recvmsg(int a, char * b, int c)
-{
-#ifdef SYS_RECVMSG
- int array[3];
-
- array[0] = (int)a;
- array[1] = (int)b;
- array[2] = (int)c;
-
- return(machdep_sys_socketcall(SYS_RECVMSG, array));
-#else
- return(-ENOSYS);
-#endif
-}
-
-/* ==========================================================================
- * machdep_sys_getdirentries()
- */
-int machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
-{
- int ret;
-
- if ((ret = machdep_sys_readdir(fd, buf, 1)) > 0) {
- return(1);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int a, int * b, int c)
-{
- return(machdep_sys_wait4(a, b, c, NULL));
-}
-
-/* getdtablesize */
-machdep_sys_getdtablesize ()
-{
- return OPEN_MAX;
-}
-
-struct stat;
-
-/* ==========================================================================
- * _fxstat()
- */
-int _fxstat(int __ver, int fd, struct stat *buf)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
- ret = machdep_sys_fstat(fd_table[fd]->fd.i, buf);
- fd_unlock(fd, FD_READ);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * _lxstat()
- */
-int _lxstat(int __ver, const char * path, struct stat * buf)
-{
- int ret;
-
- if ((ret = machdep_sys_lstat(path, buf)) < OK) {
- SET_ERRNO(-ret);
- }
- return(ret);
-
-}
-
-/* ==========================================================================
- * _xstat()
- */
-int _xstat(int __ver, const char * path, struct stat * buf)
-{
- int ret;
-
- if ((ret = machdep_sys_stat(path, buf)) < OK) {
- SET_ERRNO(-ret);
- }
- return(ret);
-
-}
-
-/* ==========================================================================
- * strtol()
- */
-__strtol_internal(char * a, char ** b, int c)
-{
- return(strtol(a, b, c));
-}
-
-
diff --git a/mit-pthreads/machdep/engine-i386-linux-2.0.h b/mit-pthreads/machdep/engine-i386-linux-2.0.h
deleted file mode 100644
index f4f75621226..00000000000
--- a/mit-pthreads/machdep/engine-i386-linux-2.0.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- */
-
-/* Avoid problem with including bits/pthreadtypes.h with libc 2.2 */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-volatile long temp = SEMAPHORE_SET; \
- \
-__asm__("xchgl %0,(%2)" \
- :"=r" (temp) \
- :"0" (temp),"r" (lock)); \
-temp; \
-})
-
-#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
-
-/*
- * New types
- */
-typedef long semaphore;
-
-#define SIGMAX 31
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
- char machdep_float_state[108];
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-netbsd-0.9.c b/mit-pthreads/machdep/engine-i386-netbsd-0.9.c
deleted file mode 100644
index c42363fdeda..00000000000
--- a/mit-pthreads/machdep/engine-i386-netbsd-0.9.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent functions for NetBSD on i386
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <stdio.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(_setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- _longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- sig_check_and_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * machdep_pthread_create()
- */
-void machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument, long stack_size,
- void *stack_start, long nsec)
-{
- machdep_pthread->machdep_stack = stack_start;
-
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- _setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state[0] = (int)machdep_pthread_start;
-
- /* Stack starts high and builds down. */
- machdep_pthread->machdep_state[2] =
- (int)machdep_pthread->machdep_stack + stack_size;
-}
-
-/* ==========================================================================
- * machdep_sys_send()
- */
-machdep_sys_send(int s, const void *buf, int len, int flags)
-{
- return(machdep_sys_sendto(s, buf, len, flags, (struct sockaddr*)NULL, 0));
-}
-
-/* ==========================================================================
- * machdep_sys_recv()
- */
-machdep_sys_recv(int s, void *buf, int len, int flags)
-{
- return(machdep_sys_recvfrom(s, buf, len, flags, (struct sockaddr*)NULL, 0));
-}
diff --git a/mit-pthreads/machdep/engine-i386-netbsd-0.9.h b/mit-pthreads/machdep/engine-i386-netbsd-0.9.h
deleted file mode 100644
index 0e8e93bdbfb..00000000000
--- a/mit-pthreads/machdep/engine-i386-netbsd-0.9.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-long temp = SEMAPHORE_SET; \
- \
-__asm__ volatile ("xchgl %0,(%2)" \
- :"=r" (temp) \
- :"0" (temp),"r" (lock)); \
-temp; \
-})
-
-#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
-
-/*
- * New types
- */
-typedef long semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX 31
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-netbsd-1.0.c b/mit-pthreads/machdep/engine-i386-netbsd-1.0.c
deleted file mode 100644
index 7f31cb0305d..00000000000
--- a/mit-pthreads/machdep/engine-i386-netbsd-1.0.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent functions for NetBSD on i386
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <stdio.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(_setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_float_state(struct pthread * pthread)
-{
- char * fdata = (char *)pthread->machdep_data.machdep_float_state;
-
- __asm__ ("fsave %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- _longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_restore_float_state()
- */
-int machdep_restore_float_state(void)
-{
- char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
-
- __asm__ ("frstor %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
- int ret;
-
- if (machdep_pthread) {
- ret = setitimer(ITIMER_VIRTUAL, &zeroval,
- &(machdep_pthread->machdep_timer));
- } else {
- ret = setitimer(ITIMER_VIRTUAL, &zeroval, NULL);
- }
-
- if (ret) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- _setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state[0] = (int)machdep_pthread_start;
-
- /* Stack starts high and builds down. */
- machdep_pthread->machdep_state[2] =
- (int)machdep_pthread->machdep_stack + stack_size;
-}
-
-/* ==========================================================================
- * machdep_sys_creat()
- */
-machdep_sys_creat(char * path, int mode)
-{
- return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int a, int * b, int c)
-{
- return(machdep_sys_wait4(a, b, c, NULL));
-}
-
-/* ==========================================================================
- * machdep_sys_getdtablesize()
- */
-machdep_sys_getdtablesize()
-{
- return(sysconf(_SC_OPEN_MAX));
-}
-
diff --git a/mit-pthreads/machdep/engine-i386-netbsd-1.0.h b/mit-pthreads/machdep/engine-i386-netbsd-1.0.h
deleted file mode 100644
index 80e17fef368..00000000000
--- a/mit-pthreads/machdep/engine-i386-netbsd-1.0.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-long temp = SEMAPHORE_SET; \
- \
-__asm__ volatile ("xchgl %0,(%2)" \
- :"=r" (temp) \
- :"0" (temp),"r" (lock)); \
-temp; \
-})
-
-#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
-
-/*
- * New types
- */
-typedef long semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX 31
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
- char machdep_float_state[108];
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-netbsd-1.3.c b/mit-pthreads/machdep/engine-i386-netbsd-1.3.c
deleted file mode 100644
index f86a9e5ba56..00000000000
--- a/mit-pthreads/machdep/engine-i386-netbsd-1.3.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent functions for NetBSD on i386
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <stdio.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(_setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_float_state(struct pthread * pthread)
-{
- char * fdata = (char *)pthread->machdep_data.machdep_float_state;
-
- __asm__ ("fsave %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- _longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_restore_float_state()
- */
-int machdep_restore_float_state(void)
-{
- char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
-
- __asm__ ("frstor %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
- int ret;
-
- if (machdep_pthread) {
- ret = setitimer(ITIMER_VIRTUAL, &zeroval,
- &(machdep_pthread->machdep_timer));
- } else {
- ret = setitimer(ITIMER_VIRTUAL, &zeroval, NULL);
- }
-
- if (ret) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- _setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state[0] = (int)machdep_pthread_start;
-
- /* Stack starts high and builds down. */
- machdep_pthread->machdep_state[2] =
- (int)machdep_pthread->machdep_stack + stack_size;
-}
-
-/* ==========================================================================
- * machdep_sys_creat()
- */
-machdep_sys_creat(char * path, int mode)
-{
- return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int a, int * b, int c)
-{
- return(machdep_sys_wait4(a, b, c, NULL));
-}
-
-/* ==========================================================================
- * machdep_sys_getdtablesize()
- */
-machdep_sys_getdtablesize()
-{
- return(sysconf(_SC_OPEN_MAX));
-}
-
-/* ==========================================================================
- * machdep_sys_getdirentries()
- */
-machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
-{
- return(machdep_sys_getdents(fd, buf, len));
-}
diff --git a/mit-pthreads/machdep/engine-i386-netbsd-1.3.h b/mit-pthreads/machdep/engine-i386-netbsd-1.3.h
deleted file mode 100644
index f399c4b34b6..00000000000
--- a/mit-pthreads/machdep/engine-i386-netbsd-1.3.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-#include <sys/signal.h> /* for _NSIG */
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-long temp = SEMAPHORE_SET; \
- \
-__asm__ volatile ("xchgl %0,(%2)" \
- :"=r" (temp) \
- :"0" (temp),"r" (lock)); \
-temp; \
-})
-
-#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
-
-/*
- * New types
- */
-typedef long semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX (_NSIG-1)
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
- char machdep_float_state[108];
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-openbsd-2.0.c b/mit-pthreads/machdep/engine-i386-openbsd-2.0.c
deleted file mode 100644
index 09ff0072fdc..00000000000
--- a/mit-pthreads/machdep/engine-i386-openbsd-2.0.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1995 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent functions for NetBSD on i386
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "engine-i386-freebsd-2.0.c,v 1.1 1995/03/01 01:21:20 proven Exp";
-#endif
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <stdio.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(machdep_sys_setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_float_state(struct pthread * pthread)
-{
- char * fdata = (char *)pthread->machdep_data.machdep_float_state;
-
- __asm__ ("fsave %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- machdep_sys_longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_restore_float_state()
- */
-int machdep_restore_float_state(void)
-{
- char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
-
- __asm__ ("frstor %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
- int ret;
-
- if (machdep_pthread) {
- ret = setitimer(ITIMER_VIRTUAL, &zeroval,
- &(machdep_pthread->machdep_timer));
- } else {
- ret = setitimer(ITIMER_VIRTUAL, &zeroval, NULL);
- }
-
- if (ret) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- machdep_sys_setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state[0] = (int)machdep_pthread_start;
-
- /* Stack starts high and builds down. */
- machdep_pthread->machdep_state[2] =
- (int)machdep_pthread->machdep_stack + stack_size;
-}
-
-/* ==========================================================================
- * machdep_sys_creat()
- */
-machdep_sys_creat(char * path, int mode)
-{
- return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int a, int * b, int c)
-{
- return(machdep_sys_wait4(a, b, c, NULL));
-}
-
-/* ==========================================================================
- * machdep_sys_getdtablesize()
- */
-machdep_sys_getdtablesize()
-{
- return(sysconf(_SC_OPEN_MAX));
-}
diff --git a/mit-pthreads/machdep/engine-i386-openbsd-2.0.h b/mit-pthreads/machdep/engine-i386-openbsd-2.0.h
deleted file mode 100644
index 87ef21389ce..00000000000
--- a/mit-pthreads/machdep/engine-i386-openbsd-2.0.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-long temp = SEMAPHORE_SET; \
- \
-__asm__ volatile ("xchgl %0,(%2)" \
- :"=r" (temp) \
- :"0" (temp),"r" (lock)); \
-temp; \
-})
-
-#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
-
-/*
- * New types
- */
-typedef long semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX 31
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
- char machdep_float_state[108];
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-sco-3.2v5.c b/mit-pthreads/machdep/engine-i386-sco-3.2v5.c
deleted file mode 100755
index 95f0d757585..00000000000
--- a/mit-pthreads/machdep/engine-i386-sco-3.2v5.c
+++ /dev/null
@@ -1,1072 +0,0 @@
-
-/* ==== machdep.c ============================================================
- * Copyright (c) 1995 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent functions for SCO3.2v5 on i386
- *
- * 1.00 96/11/21 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "engine-i386-freebsd-2.0.c,v 1.1 1995/03/01 01:21:20 proven Exp";
-#endif
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/timeb.h>
-#include <sys/stat.h>
-#include <stropts.h>
-#include <sys/socket.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <errno.h>
-#include <sys/unistd.h>
-#include <sys/utsname.h>
-#include <sys/sysi86.h>
-
-void machdep_sys_abort(char*fname,int lineno)
-
-{
- char buf[128];
-
- sprintf(buf,"panic: %s => %d\n", fname, lineno);
- machdep_sys_write(1, buf, strlen(buf));
- abort();
-}
-
-#if 0
-int setitimer(int which, struct itimerval* value, struct itimerval* ovalue)
-
-{
- register int ret;
- if ((ret = machdep_sys_setitimer(which,value,ovalue))<0) {
- errno = -ret;
- return -1;
- }
- else {
- return 0;
- }
-}
-#endif
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_float_state(struct pthread * pthread)
-{
- char * fdata = (char *)pthread->machdep_data.machdep_float_state;
- __asm__ ("fsave %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_restore_float_state()
- */
-int machdep_restore_float_state(void)
-{
- char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
- __asm__ ("frstor %0"::"m" (*fdata));
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (machdep_sys_setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
- int ret;
-
- if (machdep_pthread) {
- ret = machdep_sys_setitimer(ITIMER_VIRTUAL, &zeroval,
- &(machdep_pthread->machdep_timer));
- } else {
- ret = machdep_sys_setitimer(ITIMER_VIRTUAL, &zeroval, NULL);
- }
-
- if (ret) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state[JB_PC] = (int)machdep_pthread_start;
-
- /* Stack starts high and builds down. */
- machdep_pthread->machdep_state[JB_SP] =
- (int)machdep_pthread->machdep_stack + stack_size;
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
-#if 0
- return(machdep_sys_wait4(0, b, c, d));
-#else
- return -ENOSYS;
-#endif
-}
-
-/* ==========================================================================
- * machdep_sys_fstat()
- */
-machdep_sys_fstat(int f, struct stat* b)
-{
- return machdep_sys_fxstat(0x33, f, b);
-}
-
-/* ==========================================================================
- * machdep_sys_dup2()
- */
-machdep_sys_dup2(int a, int b)
-{
- machdep_sys_close(b);
- return machdep_sys_fcntl(a, F_DUPFD, b);
-}
-
-/* ==========================================================================
- * machdep_sys_getdtablesize()
- */
-machdep_sys_getdtablesize()
-
-{
- register int ret;
- if ((ret = machdep_sys_sysconf(_SC_OPEN_MAX))<0)
- PANIC();
- return ret;
-}
-
-/* ==========================================================================
- * machdep_sys_fchown()
- */
-machdep_sys_fchown(int fd,uid_t owner,gid_t group)
-
-{
- return -ENOSYS;
-}
-
-/* ==========================================================================
- * machdep_sys_fchmod()
- */
-machdep_sys_fchmod(int fd,mode_t mode)
-
-{
- return -ENOSYS;
-}
-
-/* ==========================================================================
- * machdep_sys_getdirentries()
- */
-int machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
-{
- return(machdep_sys_getdents(fd, buf, len));
-}
-
-/* ==========================================================================
- * SCO Socket calls are a bit different
- * ==========================================================================
- * machdep_sys_socket()
- */
-int machdep_sys_socket(int domain, int type, int protocol)
-{
- register int s, fd, ret;
- struct socksysreq req;
-
- if ((s = machdep_sys_open("/dev/socksys", 0))<0)
- return s;
-
- req.args[0] = SO_SOCKET;
- req.args[1] = (int)domain;
- req.args[2] = (int)type;
- req.args[3] = (int)protocol;
- if ((fd = machdep_sys_ioctl(s, SIOCSOCKSYS, &req))<0) {
- machdep_sys_close(s);
- return fd;
- }
-
- if ((ret=machdep_sys_dup2(fd, s))<0) {
- machdep_sys_close(fd);
- return ret;
- }
-
- machdep_sys_close(fd);
- return s;
-
-}
-
-/* ==========================================================================
- * machdep_sys_accept()
- */
-int machdep_sys_accept(int s, struct sockaddr * b, int * c)
-{
- struct socksysreq req;
-
- req.args[0] = SO_ACCEPT;
- req.args[1] = (int)s;
- req.args[2] = (int)b;
- req.args[3] = (int)c;
-
- return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
-}
-
-/* ==========================================================================
- * machdep_sys_bind()
- */
-int machdep_sys_bind(int s, const struct sockaddr * b, int c)
-{
- struct socksysreq req;
-
- req.args[0] = SO_BIND;
- req.args[1] = (int)s;
- req.args[2] = (int)b;
- req.args[3] = (int)c;
-
- return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
-}
-
-/* ==========================================================================
- * machdep_sys_connect()
- */
-int machdep_sys_connect(int s, const struct sockaddr * b, int c)
-{
- struct socksysreq req;
-
- req.args[0] = SO_CONNECT;
- req.args[1] = (int)s;
- req.args[2] = (int)b;
- req.args[3] = (int)c;
-
- return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
-}
-
-/* ==========================================================================
- * machdep_sys_listen()
- */
-int machdep_sys_listen(int s, int backlog)
-{
- struct socksysreq req;
-
- req.args[0] = SO_LISTEN;
- req.args[1] = (int)s;
- req.args[2] = (int)backlog;
-
- return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
-}
-
-/* ==========================================================================
- * machdep_sys_shutdown()
- */
-int machdep_sys_shutdown(int s, int b)
-{
- struct socksysreq req;
-
- req.args[0] = SO_SHUTDOWN;
- req.args[1] = (int)s;
- req.args[2] = (int)b;
-
- return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
-}
-
-/* ==========================================================================
- * machdep_sys_getsockopt()
- */
-int machdep_sys_getsockopt(int s, int b, int c, char *d, int *e)
-{
- struct socksysreq req;
-
- req.args[0] = SO_GETSOCKOPT;
- req.args[1] = (int)s;
- req.args[2] = (int)b;
- req.args[3] = (int)c;
- req.args[4] = (int)d;
- req.args[5] = (int)e;
-
- return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
-}
-
-/* ==========================================================================
- * machdep_sys_setsockopt()
- */
-int machdep_sys_setsockopt(int s, int b, int c, char *d, int e)
-{
- struct socksysreq req;
-
- req.args[0] = SO_SETSOCKOPT;
- req.args[1] = (int)s;
- req.args[2] = (int)b;
- req.args[3] = (int)c;
- req.args[4] = (int)d;
- req.args[5] = (int)e;
-
- return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
-}
-
-/* ==========================================================================
- * machdep_sys_getpeername()
- */
-int machdep_sys_getpeername(int s, struct sockaddr *b, int *c)
-{
- struct socksysreq req;
-
- req.args[0] = SO_GETPEERNAME;
- req.args[1] = (int)s;
- req.args[2] = (int)b;
- req.args[3] = (int)c;
-
- return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
-}
-
-/* ==========================================================================
- * machdep_sys_send()
- */
-int machdep_sys_send(int s, char *b, int c, int d)
-{
- struct socksysreq req;
-
- req.args[0] = SO_SEND;
- req.args[1] = (int)s;
- req.args[2] = (int)b;
- req.args[3] = (int)c;
- req.args[4] = (int)d;
-
- return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
-}
-
-/* ==========================================================================
- * machdep_sys_sendto()
- */
-int machdep_sys_sendto(int s, char *b, int c, int d,
- struct sockaddr *e, int f)
-{
- struct socksysreq req;
-
- req.args[0] = SO_SENDTO;
- req.args[1] = (int)s;
- req.args[2] = (int)b;
- req.args[3] = (int)c;
- req.args[4] = (int)d;
- req.args[5] = (int)e;
- req.args[6] = (int)f;
-
- return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
-}
-
-/* ==========================================================================
- * machdep_sys_recv()
- */
-int machdep_sys_recv(int s, char *b, int c, int d)
-{
- struct socksysreq req;
-
- req.args[0] = SO_RECV;
- req.args[1] = (int)s;
- req.args[2] = (int)b;
- req.args[3] = (int)c;
- req.args[4] = (int)d;
-
- return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
-}
-
-/* ==========================================================================
- * machdep_sys_recvfrom()
- */
-int machdep_sys_recvfrom(int s, char *buf, int len, int flags,
- struct sockaddr *from, int *fromlen)
-{
- struct socksysreq req;
-
- req.args[0] = SO_RECVFROM;
- req.args[1] = (int)s;
- req.args[2] = (int)buf;
- req.args[3] = (int)len;
- req.args[4] = (int)flags;
- req.args[5] = (int)from;
- req.args[6] = (int)fromlen;
-
- return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
-}
-
-/* ==========================================================================
- * machdep_sys_socketpair()
- */
-int machdep_sys_socketpair(int d, int type, int protocol, int sv[2])
-
-{
- register int s1, s2;
- register int ret;
- struct socksysreq req;
-
- if (d != AF_UNIX)
- return -EPROTONOSUPPORT;
- if ((s1=machdep_sys_socket(d,type,protocol))<0) {
- return s1;
- }
- if ((s2=machdep_sys_socket(d,type,protocol))<0) {
- machdep_sys_close(s1);
- return s2;
- }
- req.args[0] = SO_SOCKPAIR;
- req.args[1] = s1;
- req.args[2] = s2;
- if ((ret=machdep_sys_ioctl(s1,SIOCSOCKSYS,&req))<0) {
- machdep_sys_close(s1);
- machdep_sys_close(s2);
- return ret;
- }
- sv[0] = s1;
- sv[1] = s2;
- return 0;
-}
-
-/* ==========================================================================
- * machdep_sys_getsockname()
- */
-int machdep_sys_getsockname(int s, char * b, int * c)
-{
- struct socksysreq req;
-
- req.args[0] = SO_GETSOCKNAME;
- req.args[1] = (int)s;
- req.args[2] = (int)b;
- req.args[3] = (int)c;
-
- return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
-}
-
-int machdep_sys_sendmsg(int s, const struct msghdr *msg, int flags)
-
-{
- struct socksysreq req;
-
- req.args[0] = SO_SENDMSG;
- req.args[1] = (int)s;
- req.args[2] = (int)msg;
- req.args[3] = (int)flags;
-
- return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
-}
-
-int machdep_sys_recvmsg(int s, struct msghdr *msg, int flags)
-
-{
- struct socksysreq req;
-
- req.args[0] = SO_RECVMSG;
- req.args[1] = (int)s;
- req.args[2] = (int)msg;
- req.args[3] = (int)flags;
-
- return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
-}
-
-u_short ntohs(u_short n)
-
-{
- union {
- unsigned char u_nc[4];
- u_short u_ns;
- } ns;
- register unsigned char* p = &ns.u_nc[0];
-
- ns.u_ns = n;
- return (p[0]<<8)|p[1];
-}
-
-u_short htons(u_short h)
-
-{
- union {
- unsigned char u_nc[2];
- u_short u_ns;
- } ns;
- register unsigned char* p = &ns.u_nc[0];
- p[0] = (h>>8)&0xFF;
- p[1] = (h&0xFF);
- return ns.u_ns;
-}
-
-
-u_long ntohl(u_long n)
-
-{
- union {
- unsigned char u_nc[4];
- u_long u_nl;
- } nl;
- register unsigned char* p = &nl.u_nc[0];
-
- nl.u_nl = n;
- return (p[0]<<24)|(p[1]<<16)|(p[2]<<8)|p[3];
-}
-
-u_long htonl(u_long h)
-
-{
- union {
- unsigned char u_nc[4];
- u_long u_nl;
- } nl;
- register unsigned char* p = &nl.u_nc[0];
- p[0] = (h>>24)&0xFF;
- p[1] = (h>>16)&0xFF;
- p[2] = (h>>8)&0xFF;
- p[3] = (h&0xFF);
- return nl.u_nl;
-}
-
-int getdomainname(char* domain,int len)
-
-{
- /* edi = len */
- struct socksysreq req;
- register int ret, fd;
- if (len>MAXHOSTNAMELEN)
- len = MAXHOSTNAMELEN;
-
- if ((fd = machdep_sys_open("/dev/socksys", 0)) < 0)
- return fd;
-
- req.args[0] = SO_GETIPDOMAIN;
- req.args[1] = (int)domain;
- req.args[2] = (int)len;
- if((ret=machdep_sys_ioctl(fd, SIOCSOCKSYS, &req))<0) {
- machdep_sys_close(fd);
- return ret;
- }
-
- machdep_sys_close(fd);
- domain[len-1] = '\0';
- return 0;
-}
-
-int gethostname(char* name, int namelen)
-
-{
- struct utsname uts;
- register int ret, len;
- char domain[MAXHOSTNAMELEN+1];
-
- if (name==NULL)
- return -EFAULT;
- if ((ret=machdep_sys_uname(&uts))<0)
- return ret;
- if (namelen<(len=strlen(uts.nodename)))
- return -EFAULT;
- strncpy(name,uts.nodename,len);
- if (namelen>len)
- name[len] = '\0';
- if ((ret=getdomainname(domain, namelen - len))<0)
- return ret;
- if (domain[0]=='\0')
- return 0;
- if (len + strlen(domain) + 2 > namelen)
- return -EFAULT;
- strcat(name, ".");
- strcat(name, domain);
- return 0;
-}
-
-int gettimeofday(struct timeval* tp, struct timezone* tz)
-
-{
- register int ret;
- if ((ret = machdep_sys_gettimeofday(tp, NULL))<0) {
- errno = -ret;
- return -1;
- }
- else {
- return 0;
- }
-}
-
-int kill(pid_t pid, int signo)
-
-{
- register int ret;
- if ((ret = machdep_sys_kill(pid,signo))<0) {
- errno = -ret;
- return -1;
- }
- else {
- return 0;
- }
-}
-
-typedef void (*signal_t(int signo, void (*func)(int)))(int);
-
-signal_t* _libc_signal = NULL;
-
-void (*signal(int signo, void (*func)(int)))(int)
-
-{
- int ret;
- void (*oldfunc)(int);
- extern void (*machdep_sys_signal(int signo, void (*func)(int),int* r))(int);
- if (_libc_signal!=NULL)
- return (*_libc_signal)(signo, func);
-
- oldfunc = machdep_sys_signal(signo, func, &ret);
- if (ret!=0) {
- errno = ret;
- return SIG_ERR;
- }
- else {
- return oldfunc;
- }
-}
-
-int (*_libc_sigaction)(int ,const struct sigaction *, struct sigaction *) = NULL;
-int sigaction(int sig,const struct sigaction *act, struct sigaction *oact)
-
-{
- register int ret;
- if (_libc_sigaction!=NULL)
- return (*_libc_sigaction)(sig,act,oact);
- if ((ret = machdep_sys_sigaction(sig,act,oact))<0) {
- errno = -ret;
- return -1;
- }
- else {
- return 0;
- }
-}
-
-int (*_libc_sigprocmask)(int, const sigset_t *, sigset_t *) = NULL;
-
-int sigprocmask(int how, const sigset_t *set, sigset_t * oset)
-
-{
- register int ret;
- if (_libc_sigprocmask!=NULL)
- return (*_libc_sigprocmask)(how,set,oset);
- if ((ret = machdep_sys_sigprocmask(how,set,oset))<0) {
- errno = -ret;
- return -1;
- }
- else {
- return 0;
- }
-}
-
-int (*_libc_sigsuspend)(const sigset_t *) = NULL;
-
-int sigsuspend(const sigset_t *set)
-{
- register int ret;
- if (_libc_sigsuspend!=NULL)
- return (*_libc_sigsuspend)(set);
- if ((ret = machdep_sys_sigsuspend(set))<0) {
- errno = -ret;
- return -1;
- }
- else {
- return 0;
- }
-}
-
-int _sigrelse(sig)
-int sig;
-
-{
- sigset_t mask;
- sigemptyset(&mask);
- sigaddset(&mask, sig);
- return sigprocmask(SIG_UNBLOCK,&mask,NULL);
-}
-
-int _sighold(sig)
-int sig;
-
-{
- sigset_t mask;
- sigemptyset(&mask);
- sigaddset(&mask, sig);
- return sigprocmask(SIG_BLOCK,&mask,NULL);
-}
-
-void (*sigset(int sig, void (*func)(int)))(int)
-{
- return signal(sig, func);
-}
-
-
-int (*_libc_getmsg)(int , struct strbuf *, struct strbuf *, int *) = NULL;
-
-int getmsg(int fd, struct strbuf * ctlptr, struct strbuf * dataptr,
- int * flags)
-{
- register int ret;
- if (_libc_getmsg != NULL)
- return (*_libc_getmsg)(fd,ctlptr,dataptr,flags);
- else if ((ret=machdep_sys_getmsg(fd,ctlptr,dataptr,flags))<0) {
- errno = -ret;
- return -1;
- }
- else
- return ret;
-}
-
-int (*_libc_putmsg)(int , const struct strbuf *, const struct strbuf *, int) = NULL;
-
-int putmsg(int fd, const struct strbuf * ctlptr, const struct strbuf * dataptr,
- int flags)
-{
- register int ret;
- if (_libc_putmsg != NULL)
- return (*_libc_putmsg)(fd,ctlptr,dataptr,flags);
- else if ((ret=machdep_sys_putmsg(fd,ctlptr,dataptr,flags))<0) {
- errno = -ret;
- return -1;
- }
- else
- return ret;
-}
-
-int ftime(struct timeb* tp)
-
-{
- register int ret;
- if ((ret=machdep_sys_ftime(tp))<0) {
- errno = -ret;
- return NOTOK;
- }
- return 0;
-}
-
-int getpagesize()
-
-{
- register int ret;
-#if 0
- if ((ret = machdep_sys_sysconf(_SC_PAGE_SIZE))<0) {
- PANIC();
- SET_ERRNO(-ret);
- return -1;
- }
- else {
- return 0;
- }
-#else
- return PAGESIZE;
-#endif
-}
-
-static pthread_mutex_t machdep_mutex =
-{ MUTEX_TYPE_COUNTING_FAST, PTHREAD_QUEUE_INITIALIZER, \
- NULL, SEMAPHORE_CLEAR, { NULL }, MUTEX_FLAGS_INITED };
-
-static pthread_mutex_t malloc_mutex =
-{ MUTEX_TYPE_COUNTING_FAST, PTHREAD_QUEUE_INITIALIZER, \
- NULL, SEMAPHORE_CLEAR, { NULL }, MUTEX_FLAGS_INITED };
-
-struct stdlock {
- volatile long init;
- pthread_mutex_t* mutex;
-};
-
-static void machdep_stdinitlock(struct stdlock* lock)
-
-{
- if (lock==0) PANIC();
- pthread_mutex_lock(&machdep_mutex);
- if (!lock->init) {
- register pthread_mutex_t* mutex;
- pthread_mutexattr_t attr;
-
- lock->init = 1;
- lock->mutex = &machdep_mutex;
- mutex = (pthread_mutex_t*) malloc(sizeof(pthread_mutex_t));
- pthread_mutexattr_init (&attr);
- pthread_mutexattr_settype (&attr, MUTEX_TYPE_COUNTING_FAST);
- pthread_mutex_init(mutex, &attr);
- lock->mutex = mutex;
- }
- pthread_mutex_unlock(&machdep_mutex);
-}
-
-void machdep_stdlock(struct stdlock* lock)
-
-{
- if (lock==0) PANIC();
- if (!lock->init)
- machdep_stdinitlock(lock);
- pthread_mutex_lock(lock->mutex);
-}
-
-void machdep_stdunlock(struct stdlock* lock)
-
-{
- if (lock==0) PANIC();
- if (!lock->init)
- machdep_stdinitlock(lock);
- pthread_mutex_unlock(lock->mutex);
-}
-
-int machdep_stdtrylock(struct stdlock* lock)
-
-{
- if (lock==0) PANIC();
- if (!lock->init)
- machdep_stdinitlock(lock);
- return pthread_mutex_trylock(lock->mutex);
-}
-
-int machdep_stdtryunlock(struct stdlock* lock)
-
-{
- if (lock==0) PANIC();
- if (!lock->init)
- machdep_stdinitlock(lock);
- if (pthread_mutex_trylock(lock->mutex))
- return pthread_mutex_unlock(lock->mutex);
- return 0;
-}
-
-extern void (*_libc_stdlock)(struct stdlock* lock);
-extern void (*_libc_stdunlock)(struct stdlock* lock);
-extern int (*_libc_stdtrylock)(struct stdlock* lock);
-extern int (*_libc_stdtryunlock)(struct stdlock* lock);
-
-int machdep_sys_init()
-
-{
- typedef void (*voidfunc_t)();
- extern voidfunc_t _libc_read;
- extern voidfunc_t _libc_write;
- extern voidfunc_t _libc_readv;
- extern voidfunc_t _libc_writev;
- extern voidfunc_t _libc_open;
- extern voidfunc_t _libc_close;
- extern voidfunc_t _libc_fork;
- extern voidfunc_t _libc_fcntl;
- extern voidfunc_t _libc_dup;
- extern voidfunc_t _libc_pipe;
- extern voidfunc_t _libc_select;
- extern voidfunc_t _libc_malloc;
- extern voidfunc_t _libc_realloc;
- extern voidfunc_t _libc_free;
- extern ssize_t pthread_read (int , char*, int );
- extern ssize_t pthread_write (int , char*, int );
- extern int pthread_close (int);
- extern int pthread_dup (int);
- extern int pthread_fork ();
- extern int pthread_pipe (int*);
- extern int pthread_fcntl(int, int, ...);
- extern int pthread_open(const char *, int, ...);
- extern ssize_t pthread_readv (int , const struct iovec *, int );
- extern ssize_t pthread_writev (int , const struct iovec *, int );
- extern int pthread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
- extern int pthread_getmsg(int , struct strbuf *, struct strbuf *,int*);
- extern int pthread_putmsg(int , const struct strbuf *, const struct strbuf *,int);
- extern void (*pthread_signal(int , void (*)(int)))(int);
- extern int pthread_sigaction(int,const struct sigaction *, struct sigaction *);
- extern int pthread_sigprocmask(int, const sigset_t *, sigset_t *);
- extern int pthread_sigsuspend(const sigset_t *);
-
-
- static struct {
- voidfunc_t *p;
- voidfunc_t f;
- } maptable[] = {
- {(voidfunc_t*)&_libc_read, (voidfunc_t) pthread_read},
- {(voidfunc_t*)&_libc_write, (voidfunc_t) pthread_write},
- {(voidfunc_t*)&_libc_readv, (voidfunc_t) pthread_readv},
- {(voidfunc_t*)&_libc_writev, (voidfunc_t) pthread_writev},
- {(voidfunc_t*)&_libc_open, (voidfunc_t) pthread_open},
- {(voidfunc_t*)&_libc_close, (voidfunc_t) pthread_close},
- {(voidfunc_t*)&_libc_fork, (voidfunc_t) pthread_fork},
- {(voidfunc_t*)&_libc_fcntl, (voidfunc_t) pthread_fcntl},
- {(voidfunc_t*)&_libc_dup, (voidfunc_t) pthread_dup},
- {(voidfunc_t*)&_libc_pipe, (voidfunc_t) pthread_pipe},
- {(voidfunc_t*)&_libc_select, (voidfunc_t) pthread_select},
- {(voidfunc_t*)&_libc_getmsg, (voidfunc_t) pthread_getmsg},
- {(voidfunc_t*)&_libc_putmsg, (voidfunc_t) pthread_putmsg},
- {(voidfunc_t*)&_libc_signal, (voidfunc_t) pthread_signal},
- {(voidfunc_t*)&_libc_sigaction, (voidfunc_t) pthread_sigaction},
- {(voidfunc_t*)&_libc_sigprocmask, (voidfunc_t) pthread_sigprocmask},
- {(voidfunc_t*)&_libc_sigsuspend, (voidfunc_t) pthread_sigsuspend},
- {(voidfunc_t*) 0, (voidfunc_t) 0}
- };
- register int i;
-
- for (i=0; maptable[i].p; i++)
- *maptable[i].p = maptable[i].f;
-
- _libc_stdlock = machdep_stdlock;
- _libc_stdunlock = machdep_stdunlock;
- _libc_stdtrylock = machdep_stdtrylock;
- _libc_stdtryunlock = machdep_stdtryunlock;
- return 0;
-}
-
-#if 0
-extern end;
-char* nd = (char*) &end;
-char* brk(const char* endds)
-
-{
- register int ret;
-
- if ((ret = machdep_sys_brk((char*)endds))<0) {
- SET_ERRNO(-ret);
- return (char*) -1;
- }
- else {
- nd = (char*) endds;
- return 0;
- }
-}
-
-char *sbrk(int incr)
-
-{
- register char* ret;
- if (incr!=0 && (ret=brk(nd + incr))!=0)
- return ret;
- else
- return nd - incr;
-}
-#endif
-
-sigset_t sigmask(int sig)
-
-{
- sigset_t oset;
- sigemptyset(&oset);
- sigaddset(&oset, sig);
- return oset;
-}
-
-sigset_t sigsetmask(sigset_t set)
-
-{
- sigset_t oset;
- sigprocmask(SIG_SETMASK,&set,&oset);
- return oset;
-}
-
-sigset_t sigblock(sigset_t set)
-
-{
- sigset_t oset;
- sigprocmask(SIG_BLOCK,&set,&oset);
- return oset;
-}
diff --git a/mit-pthreads/machdep/engine-i386-sco-3.2v5.h b/mit-pthreads/machdep/engine-i386-sco-3.2v5.h
deleted file mode 100644
index 8b2aa362f06..00000000000
--- a/mit-pthreads/machdep/engine-i386-sco-3.2v5.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * engine-i386-freebsd-2.0.h,v 1.1.4.1 1995/12/13 05:41:52 proven Exp
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-long temp = SEMAPHORE_SET; \
- \
-__asm__ volatile ("xchgl %0,(%2)" \
- :"=r" (temp) \
- :"0" (temp),"r" (lock)); \
-temp; \
-})
-
-#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
-
-/*
- * New types
- */
-typedef long semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX 31
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
-#define JB_BP 3
-#define JB_SP 4
-#define JB_PC 5
- char machdep_float_state[108];
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 2048
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-ip22-irix-5.2.c b/mit-pthreads/machdep/engine-ip22-irix-5.2.c
deleted file mode 100644
index d205d05f316..00000000000
--- a/mit-pthreads/machdep/engine-ip22-irix-5.2.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1995 Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Machine dependent functions for IRIX-5.2 on the IP22
- *
- * 1.00 95/04/26 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- int i;
-
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- if (setjmp(machdep_pthread->machdep_state)) {
- machdep_pthread_start();
- }
-
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
-
- /* IP22 stack starts high and builds down. */
- machdep_pthread->machdep_state[JB_SP] =
- (int)machdep_pthread->machdep_stack + stack_size - 1024;
- machdep_pthread->machdep_state[JB_SP] &= ~7;
-
- memcpy((void *)machdep_pthread->machdep_state[JB_SP],
- (char *)(((int)&i) - 24), 32);
-
-}
-
-/* ==========================================================================
- * machdep_sys_dup2()
- */
-machdep_sys_dup2(int a, int b)
-{
- machdep_sys_close(b);
- machdep_sys_fcntl(a, F_DUPFD, b);
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_waitsys(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int a, int * b, int c)
-{
- return(machdep_sys_waitsys(a, b, c, NULL));
-}
-
-struct stat;
-
-/* ==========================================================================
- * _fxstat()
- */
-int _fxstat(int __ver, int fd, struct stat *buf)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
- if ((ret = machdep_sys_fstat(fd_table[fd]->fd.i, buf)) < OK) {
- SET_ERRNO(-ret);
- }
- fd_unlock(fd, FD_READ);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * _lxstat()
- */
-int _lxstat(int __ver, const char * path, struct stat * buf)
-{
- int ret;
-
- if ((ret = machdep_sys_lstat(path, buf)) < OK) {
- SET_ERRNO(-ret);
- }
- return(ret);
-
-}
-
-/* ==========================================================================
- * _xstat()
- */
-int _xstat(int __ver, const char * path, struct stat * buf)
-{
- int ret;
-
- if ((ret = machdep_sys_stat(path, buf)) < OK) {
- SET_ERRNO(-ret);
- }
- return(ret);
-
-}
-
-/* ==========================================================================
- * getdtablesize()
- */
-machdep_sys_getdtablesize()
-{
- return(sysconf(_SC_OPEN_MAX));
-}
-
-/* ==========================================================================
- * machdep_sys_getdirentries()
- */
-int machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
-{
- int i;
-
- i = machdep_sys_getdents(fd, buf, len);
- return i;
-}
diff --git a/mit-pthreads/machdep/engine-ip22-irix-5.2.h b/mit-pthreads/machdep/engine-ip22-irix-5.2.h
deleted file mode 100644
index 94dd386608e..00000000000
--- a/mit-pthreads/machdep/engine-ip22-irix-5.2.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-#include <sys/cdefs.h>
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 0xff
-
-/*
- * More machine dependent macros
- */
-#ifdef PTHREAD_KERNEL
-
-#define machdep_save_float_state(x)
-#define machdep_restore_float_state()
-
-#endif
-
-/*
- * New types
- */
-typedef char semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIGMAX 32
-#define SIG_ANY(sig) \
-({ \
- sigset_t *sig_addr = (sigset_t *)&sig; \
- int ret = 0; \
- int i; \
- \
- for (i = 1; i <= SIGMAX; i++) { \
- if (sigismember(sig_addr, i)) { \
- ret = 1; \
- break; \
- } \
- } \
- ret; \
-})
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-m68000-netbsd.c b/mit-pthreads/machdep/engine-m68000-netbsd.c
deleted file mode 100644
index 6346c36ca7c..00000000000
--- a/mit-pthreads/machdep/engine-m68000-netbsd.c
+++ /dev/null
@@ -1,256 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent functions for NetBSD on i386
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- *
- * m68k work from David Leonard <david.leonard@it.uq.edu.au>.
- * updated and NetBSD/m68k work from Andy Finnell <andyf@vei.net>.
- *
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include "pthread.h"
-#include <sys/syscall.h>
-#include <sys/stat.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return( _setjmp(pthread_run->machdep_data.machdep_state) );
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- _longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_save_state()
- */
-void machdep_save_float_state(struct pthread * pthread)
-{
- char * fdata = pthread->machdep_data.machdep_fstate;
-
- __asm__ ( "fmovem fp0-fp7,%0"::"m" (*fdata) );
- __asm__ ( "fmovem fpcr/fpsr/fpi,%0"::"m" (fdata[80]) );
-}
-
-/* ==========================================================================
- * machdep_restore_float_state()
- */
-void machdep_restore_float_state(void)
-{
- char * fdata = pthread_run->machdep_data.machdep_fstate;
-
- __asm__ ( "fmovem %0,fp0-fp7"::"m" (*fdata) );
- __asm__ ( "fmovem %0,fpcr/fpsr/fpi"::"m" (fdata[80]) );
-
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return((void*)malloc(size));
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume();
-
- /* Run current thread's start routine with argument */
- pthread_exit(
- pthread_run->machdep_data.start_routine(
- pthread_run->machdep_data.start_argument
- )
- );
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- _setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stack frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- *
- * state is the set_jmp structure, which for m68k is:
- * long onstack_flag; // [0]
- * long sigmask; // [1]
- * long sp; // [2]
- * long fp; // [3]
- * long ap; // [4]
- * long pc; // [5]
- * long ps; // [6]
- * long regs[10]; // non scratch registers
- */
- machdep_pthread->machdep_state[5] = (long)machdep_pthread_start;
-
- /* Stack starts high and builds down. */
- machdep_pthread->machdep_state[2] =
- (int)machdep_pthread->machdep_stack + stack_size;
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int a, int * b, int c)
-{
- return(machdep_sys_wait4(a, b, c, NULL));
-}
-
-/* ==========================================================================
- * machdep_sys_getdtablesize()
- */
-machdep_sys_getdtablesize()
-{
- return(sysconf(_SC_OPEN_MAX));
-}
-
-/* ==========================================================================
- * machdep_sys_getdirentries()
- */
-machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
-{
- return(machdep_sys_getdents(fd, buf, len));
-}
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
-off_t machdep_sys_lseek(int fd, off_t offset, int whence)
-{
- extern off_t __syscall();
-
- return(__syscall((quad_t)SYS_lseek, fd, 0, offset, whence));
-}
-
-int machdep_sys_ftruncate( int fd, off_t length)
-{
- quad_t q;
- int rv;
-
- q = __syscall((quad_t)SYS_ftruncate, fd,0, length);
- if( /* LINTED constant */ sizeof( quad_t ) == sizeof( register_t ) ||
- /* LINTED constant */ BYTE_ORDER == LITTLE_ENDIAN )
- rv = (int)q;
- else
- rv = (int)((u_quad_t)q >> 32);
-
- return rv;
-}
-
-int machdep_sys_fstat( int f, struct stat* st )
-{
- return __fstat13(f,st);
-}
diff --git a/mit-pthreads/machdep/engine-m68000-netbsd.h b/mit-pthreads/machdep/engine-m68000-netbsd.h
deleted file mode 100644
index ec3c6a01bce..00000000000
--- a/mit-pthreads/machdep/engine-m68000-netbsd.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- * m68k work by Andy Finnell <andyf@vei.net> based off work by
- * David Leonard and Chris Provenzano.
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 0x80;
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
- volatile long temp = SEMAPHORE_CLEAR; \
- __asm__ volatile( \
- "tas %2; bpl 0f; movl #1,%0; 0:" \
- :"=r" (temp) \
- :"0" (temp),"m" (*lock)); \
- temp; \
-})
-
-#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
-
-/*
- * New types
- */
-typedef char semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX 31
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
- char machdep_fstate[92];
-};
-
-/*
- * Min pthread stacksize
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-
-#ifndef __machdep_stack_get
-#define __machdep_stack_get(x) (x)->machdep_stack
-#endif
-#ifndef __machdep_stack_set
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#endif
-#ifndef __machdep_stack_repl
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-#endif
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-powerpc-netbsd.c b/mit-pthreads/machdep/engine-powerpc-netbsd.c
deleted file mode 100644
index fc17e3de5d0..00000000000
--- a/mit-pthreads/machdep/engine-powerpc-netbsd.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Machine dependent functions for NetBSD/PowerPC (1.5+)
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- *
- * 2001/01/10 briggs
- * -Modified to make it go with NetBSD/PowerPC
- */
-
-#ifndef lint
-static const char rcsid[] = "engine-alpha-osf1.c,v 1.4.4.1 1995/12/13 05:41:37 proven Exp";
-#endif
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/syscall.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <stdio.h>
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume ();
-
- /* XXXMLG
- * This is EXTREMELY bogus, but it seems that this function is called
- * with the pthread kernel locked. If this happens, __errno() will
- * return the wrong address until after the first context switch.
- *
- * Clearly there is a leak of pthread_kernel somewhere, but until
- * it is found, we force a context switch here, just before calling
- * the thread start routine. When we return from pthread_yield
- * the kernel will be unlocked.
- */
- pthread_yield();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(void *), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- /* Set up new stack frame so that it looks like it returned from a
- longjmp() to the beginning of machdep_pthread_start(). */
- /* state is sigmask, then r8-r31 where r11 is the LR
- * So, istate[3] is r10, which is the SP
- * So, istate[4] is r11, which is the LR
- * So, istate[5] is r12, which is the CR
- */
- machdep_pthread->machdep_istate[4] = (long)machdep_pthread_start;
- machdep_pthread->machdep_istate[5] = 0;
-
- /* PowerPC stack starts high and builds down, and needs to be 16-byte
- aligned. */
- machdep_pthread->machdep_istate[3] =
- ((long) machdep_pthread->machdep_stack + stack_size) & ~0xf;
-}
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return( _setjmp(pthread_run->machdep_data.machdep_istate) );
-}
-
-void machdep_restore_state(void)
-{
- _longjmp(pthread_run->machdep_data.machdep_istate, 1);
-}
-
-void machdep_save_float_state (struct pthread *pthread)
-{
- __machdep_save_fp_state(pthread->machdep_data.machdep_fstate);
-}
-
-void machdep_restore_float_state (void)
-{
- __machdep_restore_fp_state(pthread_run->machdep_data.machdep_fstate);
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread);
-void machdep_pthread_start(void);
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void
-__machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void *
-__machdep_stack_alloc(size_t size)
-{
- return(malloc(size));
-}
-
-/* ==========================================================================
- * machdep_sys_creat()
- */
-int
-machdep_sys_creat(char * path, int mode)
-{
- return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-int
-machdep_sys_wait3(int * b, int c, int *d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-int
-machdep_sys_waitpid(int a, int * b, int c)
-{
- return(machdep_sys_wait4(a, b, c, NULL));
-}
-
-/* ==========================================================================
- * machdep_sys_getdtablesize()
- */
-int
-machdep_sys_getdtablesize(void)
-{
- return(sysconf(_SC_OPEN_MAX));
-}
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
-off_t
-machdep_sys_lseek(int fd, off_t offset, int whence)
-{
- return(__syscall((quad_t)SYS_lseek, fd, 0, offset, whence));
-}
-
-int
-machdep_sys_ftruncate( int fd, off_t length)
-{
- quad_t q;
- int rv;
-
- q = __syscall((quad_t)SYS_ftruncate, fd,0, length);
- if( /* LINTED constant */ sizeof( quad_t ) == sizeof( register_t ) ||
- /* LINTED constant */ BYTE_ORDER == LITTLE_ENDIAN )
- rv = (int)q;
- else
- rv = (int)((u_quad_t)q >> 32);
-
- return rv;
-}
-
-
-/* ==========================================================================
- * machdep_sys_getdirentries()
- */
-int
-machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
-{
- return(machdep_sys_getdents(fd, buf, len));
-}
diff --git a/mit-pthreads/machdep/engine-powerpc-netbsd.h b/mit-pthreads/machdep/engine-powerpc-netbsd.h
deleted file mode 100644
index 530b7ca81e2..00000000000
--- a/mit-pthreads/machdep/engine-powerpc-netbsd.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1994 Chris Provenzano (proven@athena.mit.edu) and
- * Ken Raeburn (raeburn@mit.edu).
- *
- * engine-alpha-osf1.h,v 1.4.4.1 1995/12/13 05:41:42 proven Exp
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-#include <sys/cdefs.h>
-#include <sys/signal.h> /* for _NSIG */
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 0xffff
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
- volatile long t1, temp = SEMAPHORE_SET; \
- __asm__ volatile( \
- "1: lwarx %0,0,%1; \
- cmpwi %0, 0; \
- bne 2f; \
- stwcx. %2,0,%1; \
- bne- 1b; \
- 2: " \
- :"=r" (t1) \
- :"m" (lock), "r" (temp)); \
- t1; \
-})
-
-#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
-
-/*
- * New types
- */
-typedef int semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX (_NSIG-1)
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_istate;
- unsigned long machdep_fstate[66];
- /* 64-bit fp regs 0-31 + fpscr */
- /* We pretend the fpscr is 64 bits */
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
- { NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, { 0 }, { 0 } }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 2048
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if ((stack = __machdep_stack_get(x))) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-int machdep_save_state(void);
-
-void __machdep_save_fp_state(unsigned long *);
-void __machdep_restore_fp_state(unsigned long *);
-void *__machdep_stack_alloc(size_t);
-void __machdep_stack_free(void *);
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-r2000-ultrix-4.2.c b/mit-pthreads/machdep/engine-r2000-ultrix-4.2.c
deleted file mode 100644
index 45c8cc73f24..00000000000
--- a/mit-pthreads/machdep/engine-r2000-ultrix-4.2.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Machine dependent functions for decstation with r2000/r3000
- *
- * 1.00 93/07/21 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <stdlib.h>
-#include <errno.h>
-
-/*
- * The r2000/r3000 processors do not have a test and set instruction, so
- * the semaphore TEST_AND_SET macro is linked very closely to the interrupt
- * handelling of the pthreads package.
- */
-
-/* ==========================================================================
- * semaphore_test_and_set()
- *
- * SEMAPHORE_TEST_AND_SET prevents interrupts, tests the lock and then
- * turns interrupts back on, checking to see if any interrupts have occured
- * between the prevent and resume.
- */
-int semaphore_test_and_set(semaphore *lock)
-{
- int rval;
-
-/* None of this should be necessary
- sig_prevent();
- if (!(rval = (*lock))) {
- *lock = SEMAPHORE_SET;
- }
- sig_check_and_resume();
- return(rval);
-*/
-}
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_save_float_state()
- */
-void machdep_save_float_state(struct pthread * pthread)
-{
- return;
-}
-
-/* ==========================================================================
- * fake_longjmp()
- */
-void fake_longjmp(jmp_buf env)
-{
- asm("li $5,1; sw $5, 20($4); li $2,103; syscall");
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- *
- * When I redo machdep_save_state, I'll put the asm in machdep_save_state()
- * and machdep_restore_state() and I won't have to do an additional function
- * call.
- */
-void machdep_restore_state(void)
-{
- fake_longjmp(pthread_run->machdep_data.machdep_state);
- /* longjmp(pthread_run->machdep_data.machdep_state, 1); */
-}
-
-/* ==========================================================================
- * machdep_restore_float_state()
- */
-void machdep_restore_float_state(void)
-{
- return;
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state[JB_RA] = (int)machdep_pthread_start;
- machdep_pthread->machdep_state[JB_PC] = (int)machdep_pthread_start;
-
- /* Stack starts high and builds down. */
- machdep_pthread->machdep_state[JB_SP] =
- (int)machdep_pthread->machdep_stack + stack_size;
-
- /* This is the real global pointer */
- /* machdep_pthread->machdep_state[JB_GP] = 0; */
-}
-
-/* ==========================================================================
- * machdep_sys_sigprocmask()
- * This isn't a real implementation; we can make the assumption that the
- * pthreads library is not using oset, and that it is always blocking or
- * unblocking all signals at once.
- */
-int machdep_sys_sigprocmask(int how, const sigset_t *set, sigset_t *oset)
-{
- switch(how) {
- case SIG_BLOCK:
- sigblock(*set);
- break;
- case SIG_UNBLOCK:
- sigsetmask(~*set);
- break;
- case SIG_SETMASK:
- sigsetmask(*set);
- break;
- default:
- return -EINVAL;
- }
- return(OK);
-}
-
diff --git a/mit-pthreads/machdep/engine-r2000-ultrix-4.2.h b/mit-pthreads/machdep/engine-r2000-ultrix-4.2.h
deleted file mode 100644
index 8e2d70f8feb..00000000000
--- a/mit-pthreads/machdep/engine-r2000-ultrix-4.2.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- * Description : Machine dependent header for decstation with r2000/r3000
- * running Ultrix-4.2
- *
- * 1.00 93/07/21 proven
- * -Started coding this file.
- */
-
-#include <setjmp.h>
-#include <sys/time.h>
-#include <sys/cdefs.h>
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 1
-
-#define SEMAPHORE_TEST_AND_SET(lock) semaphore_test_and_set(lock)
-#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
-
-/*
- * New types
- */
-typedef long semaphore;
-
-#if !defined(_POSIX_SOURCE)
-
-/* typedef int ssize_t; */
-
-#if !defined(__GNUC__)
-
-/*
- * sigset_t macros
- */
-typedef int sigset_t;
-#define sigaddset(set, num) ((*set) |= (1 << (num - 1)))
-#define sigemptyset(set) (*set = 0)
-
-#endif
-#endif
-
-#define SIG_ANY(sig) (sig)
-#define SIGMAX 31
-
-/*
- * New Structures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-
-/*
- * Min stacksize, arch dependent
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK (O_NONBLOCK | O_NDELAY)
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int semaphore_test_and_set __P_((semaphore *));
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-romp-bsd.c b/mit-pthreads/machdep/engine-romp-bsd.c
deleted file mode 100644
index dd1a1096ece..00000000000
--- a/mit-pthreads/machdep/engine-romp-bsd.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Machine dependent functions for NetBSD on i386
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- return(_pthread_save(pthread_run->machdep_data.machdep_state, 0, 0));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- _pthread_restore(pthread_run->machdep_data.machdep_state);
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- sig_check_and_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * machdep_pthread_create()
- */
-void machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument, long stack_size,
- void *stack_start, long nsec)
-{
- machdep_pthread->machdep_stack = stack_start;
-
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- _pthread_save(machdep_pthread->machdep_state,
- (void *)((int)machdep_pthread->machdep_stack + stack_size),
- machdep_pthread_start);
-}
-
diff --git a/mit-pthreads/machdep/engine-romp-bsd.h b/mit-pthreads/machdep/engine-romp-bsd.h
deleted file mode 100644
index 28c59d35e70..00000000000
--- a/mit-pthreads/machdep/engine-romp-bsd.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1993 John F. Carr, jfc@athena.mit.edu
- *
- * Description : Machine dependent header for IBM/RT
- *
- * 1.00 93/09/xx jfc
- * -Coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <setjmp.h>
-#include <sys/time.h>
-#include <sys/types.h>
-
-/*
- * Stuff for compiling
- */
-#if defined(__GNUC__)
-#if defined(__cplusplus)
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS };
-#else
-#define __BEGIN_DECLS
-#define __END_DECLS
-#if !defined(__STDC__)
-#define const __const
-#define inline __inline
-#define signed __signed
-#define volatile __volatile
-#endif
-#endif
-#else /* !__GNUC__ */
-#define __BEGIN_DECLS
-#define __END_DECLS
-#define const
-#define inline
-#define signed
-#define volatile
-#endif
-
-#define SEMAPHORE_CLEAR 0x0000
-#define SEMAPHORE_SET 0xff00
-#define SEMAPHORE_TEST_AND_SET(lock) _tsh(lock)
-#define SEMAPHORE_RESET(lock) *(lock) = SEMAPHORE_CLEAR
-extern unsigned short _tsh(volatile unsigned short *);
-
-typedef unsigned short semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX 31
-
-
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Min pthread stacksize
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK O_NONBLOCK
-
-#if defined(PTHREAD_KERNEL)
-
-int machdep_save_state __P_((void));
-
-/* save(jmp_buf, stack pointer, restart proc) */
-extern int _pthread_save(jmp_buf, void *, void (*)());
-extern void _pthread_restore(jmp_buf);
-
-typedef int ssize_t;
-typedef unsigned int sigset_t;
-#define sigemptyset(sp) *(sp) = 0
-#define sigprocmask(op, nssp, ossp) if (ossp) *(int *)ossp = sigsetmask(*nssp); else sigsetmask(*nssp)
-#define sigdelset(sp, i) *(sp) &= ~(1 << (i))
-#define sigaddset(sp, i) *(sp) |= (1 << (i))
-#define sigismember(sp, i) (*(sp) & (1 << (i)))
-#endif
diff --git a/mit-pthreads/machdep/engine-sparc-netbsd-1.3.c b/mit-pthreads/machdep/engine-sparc-netbsd-1.3.c
deleted file mode 100644
index 8e0520cfba5..00000000000
--- a/mit-pthreads/machdep/engine-sparc-netbsd-1.3.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Machine dependent functions for SunOS-4.1.3 on sparc
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- *
- * 98/10/22 bad
- * -update for fat sigset_t in NetBSD 1.3H
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include "config.h"
-#include <pthread.h>
-#include <stdlib.h>
-#include <errno.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- /* Save register windows onto stackframe */
- __asm__ ("ta 3");
-
- return(setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-/* ==========================================================================
- * machdep_save_float_state()
- */
-void machdep_save_float_state(struct pthread * pthread)
-{
- return;
-}
-
-/* ==========================================================================
- * machdep_restore_float_state()
- */
-void machdep_restore_float_state(void)
-{
- return;
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume ();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- /* Save register windows onto stackframe */
- __asm__ ("ta 3");
-
- setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state[3] = (int)machdep_pthread_start;
- machdep_pthread->machdep_state[4] = (int)machdep_pthread_start;
-
- /* Sparc stack starts high and builds down. */
- machdep_pthread->machdep_state[2] =
- (int)machdep_pthread->machdep_stack + stack_size - 1024;
- machdep_pthread->machdep_state[2] &= ~7;
-
-}
-
-#if defined(HAVE_SYSCALL_GETDENTS)
-/* ==========================================================================
- * machdep_sys_getdirentries()
- *
- * Always use getdents in place of getdirentries if possible --proven
- */
-int machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
-{
- return(machdep_sys_getdents(fd, buf, len));
-}
-#endif
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int pid, int * statusp, int options)
-{
- if (pid == -1)
- pid = 0;
- else if (pid == 0)
- pid = - getpgrp ();
- return machdep_sys_wait4 (pid, statusp, options, NULL);
-}
-
-#if !defined(HAVE_SYSCALL_SIGPROCMASK)
-#if 0
-/* ==========================================================================
- * machdep_sys_sigprocmask()
- * This isn't a real implementation; we can make the assumption that the
- * pthreads library is not using oset, and that it is always blocking or
- * unblocking all signals at once.
- */
-int machdep_sys_sigprocmask(int how, const sigset_t *set, sigset_t *oset)
-{
- switch(how) {
- case SIG_BLOCK:
- sigblock(*set);
- break;
- case SIG_UNBLOCK:
- sigsetmask(~*set);
- break;
- case SIG_SETMASK:
- sigsetmask(*set);
- break;
- default:
- return -EINVAL;
- }
- return(OK);
-}
-
-/* ==========================================================================
- * sigaction()
- *
- * Temporary until I do machdep_sys_sigaction()
- */
-int sigaction(int sig, const struct sigaction *act, struct sigaction *oldact)
-{
- return(sigvec(sig, (struct sigvec *)act, (struct sigvec *)oldact));
-}
-#endif
-#endif
-
-#if !defined(HAVE_SYSCALL_GETDTABLESIZE)
-/* ==========================================================================
- * machdep_sys_getdtablesize()
- */
-machdep_sys_getdtablesize()
-{
- return(sysconf(_SC_OPEN_MAX));
-}
-#endif
diff --git a/mit-pthreads/machdep/engine-sparc-netbsd-1.3.h b/mit-pthreads/machdep/engine-sparc-netbsd-1.3.h
deleted file mode 100644
index a187d3dace8..00000000000
--- a/mit-pthreads/machdep/engine-sparc-netbsd-1.3.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * engine-sparc-sunos-4.1.3.h,v 1.52.4.1 1995/12/13 05:42:33 proven Exp
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-#include <sys/cdefs.h>
-#include <sys/signal.h> /* for _NSIG */
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 0xff
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-char *p = lock; \
-long temp; \
- \
-__asm__ volatile("ldstub %1,%0" \
- :"=r" (temp) \
- :"m" (*p) \
- :"memory"); \
-temp; \
-})
-
-#define SEMAPHORE_RESET(lock) \
-{ \
-__asm__ volatile("stb %1, %0" \
- :"=m" (*lock) \
- :"r" (SEMAPHORE_CLEAR) \
- :"memory"); \
-}
-
-/*
- * New types
- */
-typedef char semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX (_NSIG-1)
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK (O_NONBLOCK | O_NDELAY)
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-sparc-sunos-4.1.3.c b/mit-pthreads/machdep/engine-sparc-sunos-4.1.3.c
deleted file mode 100644
index 6916c3610cd..00000000000
--- a/mit-pthreads/machdep/engine-sparc-sunos-4.1.3.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Machine dependent functions for SunOS-4.1.3 on sparc
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include "config.h"
-#include <pthread.h>
-#include <stdlib.h>
-#include <errno.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- /* Save register windows onto stackframe */
- __asm__ ("ta 3");
-
- return(setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-/* ==========================================================================
- * machdep_save_float_state()
- */
-void machdep_save_float_state(struct pthread * pthread)
-{
- return;
-}
-
-/* ==========================================================================
- * machdep_restore_float_state()
- */
-void machdep_restore_float_state(void)
-{
- return;
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume ();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * __machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- /* Save register windows onto stackframe */
- __asm__ ("ta 3");
-
- setjmp(machdep_pthread->machdep_state);
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state[3] = (int)machdep_pthread_start;
- machdep_pthread->machdep_state[4] = (int)machdep_pthread_start;
-
- /* Sparc stack starts high and builds down. */
- machdep_pthread->machdep_state[2] =
- (int)machdep_pthread->machdep_stack + stack_size - 1024;
- machdep_pthread->machdep_state[2] &= ~7;
-
-}
-
-#if defined(HAVE_SYSCALL_GETDENTS)
-/* ==========================================================================
- * machdep_sys_getdirentries()
- *
- * Always use getdents in place of getdirentries if possible --proven
- */
-int machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
-{
- return(machdep_sys_getdents(fd, buf, len));
-}
-#endif
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(machdep_sys_wait4(0, b, c, d));
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int pid, int * statusp, int options)
-{
- if (pid == -1)
- pid = 0;
- else if (pid == 0)
- pid = - getpgrp ();
- return machdep_sys_wait4 (pid, statusp, options, NULL);
-}
-
-#if !defined(HAVE_SYSCALL_SIGPROCMASK)
-/* ==========================================================================
- * machdep_sys_sigprocmask()
- * This isn't a real implementation; we can make the assumption that the
- * pthreads library is not using oset, and that it is always blocking or
- * unblocking all signals at once.
- */
-int machdep_sys_sigprocmask(int how, const sigset_t *set, sigset_t *oset)
-{
- switch(how) {
- case SIG_BLOCK:
- sigblock(*set);
- break;
- case SIG_UNBLOCK:
- sigsetmask(~*set);
- break;
- case SIG_SETMASK:
- sigsetmask(*set);
- break;
- default:
- return -EINVAL;
- }
- return(OK);
-}
-
-/* ==========================================================================
- * sigaction()
- *
- * Temporary until I do machdep_sys_sigaction()
- */
-int sigaction(int sig, const struct sigaction *act, struct sigaction *oldact)
-{
- return(sigvec(sig, (struct sigvec *)act, (struct sigvec *)oldact));
-}
-#endif
-
-#if !defined(HAVE_SYSCALL_GETDTABLESIZE)
-/* ==========================================================================
- * machdep_sys_getdtablesize()
- */
-machdep_sys_getdtablesize()
-{
- return(sysconf(_SC_OPEN_MAX));
-}
-#endif
diff --git a/mit-pthreads/machdep/engine-sparc-sunos-4.1.3.h b/mit-pthreads/machdep/engine-sparc-sunos-4.1.3.h
deleted file mode 100644
index 1a4a8768ad0..00000000000
--- a/mit-pthreads/machdep/engine-sparc-sunos-4.1.3.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-#include <sys/cdefs.h>
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 0xff
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-char *p = lock; \
-long temp; \
- \
-__asm__ volatile("ldstub %1,%0" \
- :"=r" (temp) \
- :"m" (*p) \
- :"memory"); \
-temp; \
-})
-
-#define SEMAPHORE_RESET(lock) \
-{ \
-__asm__ volatile("stb %1, %0" \
- :"=m" (*lock) \
- :"r" (SEMAPHORE_CLEAR) \
- :"memory"); \
-}
-
-/*
- * New types
- */
-typedef char semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIG_ANY(sig) (sig)
-#define SIGMAX 31
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK (O_NONBLOCK | O_NDELAY)
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/engine-sparc-sunos-5.3.c b/mit-pthreads/machdep/engine-sparc-sunos-5.3.c
deleted file mode 100644
index a228a408da3..00000000000
--- a/mit-pthreads/machdep/engine-sparc-sunos-5.3.c
+++ /dev/null
@@ -1,308 +0,0 @@
-/* ==== machdep.c ============================================================
- * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Machine dependent functions for SunOS-4.1.3 on sparc
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <sys/procset.h>
-#include <sys/systeminfo.h>
-#include <poll.h>
-
-/* ==========================================================================
- * machdep_save_state()
- */
-int machdep_save_state(void)
-{
- /* Save register windows onto stackframe */
- __asm__ ("ta 3");
-
- return(setjmp(pthread_run->machdep_data.machdep_state));
-}
-
-/* ==========================================================================
- * machdep_restore_state()
- */
-void machdep_restore_state(void)
-{
- longjmp(pthread_run->machdep_data.machdep_state, 1);
-}
-
-/* ==========================================================================
- * machdep_set_thread_timer()
- */
-void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_unset_thread_timer()
- */
-void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
-{
- struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
-
- if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
- PANIC();
- }
-}
-
-/* ==========================================================================
- * machdep_pthread_cleanup()
- */
-void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
-{
- return(machdep_pthread->machdep_stack);
-}
-
-/* ==========================================================================
- * machdep_pthread_start()
- */
-void machdep_pthread_start(void)
-{
- context_switch_done();
- pthread_sched_resume();
-
- /* Run current threads start routine with argument */
- pthread_exit(pthread_run->machdep_data.start_routine
- (pthread_run->machdep_data.start_argument));
-
- /* should never reach here */
- PANIC();
-}
-
-/* ==========================================================================
- * __machdep_stack_free()
- */
-void __machdep_stack_free(void * stack)
-{
- free(stack);
-}
-
-/* ==========================================================================
- * __machdep_stack_alloc()
- */
-void * __machdep_stack_alloc(size_t size)
-{
- void * stack;
-
- return(malloc(size));
-}
-
-/* ==========================================================================
- * machdep_pthread_create()
- */
-void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
- void *(* start_routine)(), void *start_argument,
- long stack_size, long nsec, long flags)
-{
- machdep_pthread->start_routine = start_routine;
- machdep_pthread->start_argument = start_argument;
-
- machdep_pthread->machdep_timer.it_value.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
- machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
- machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
-
- /* Save register windows onto stackframe */
- __asm__ ("ta 3");
-
- if (setjmp(machdep_pthread->machdep_state)) {
- machdep_pthread_start();
- }
-
- /*
- * Set up new stact frame so that it looks like it
- * returned from a longjmp() to the beginning of
- * machdep_pthread_start().
- */
-
- /* Sparc stack starts high and builds down. */
- machdep_pthread->machdep_state[1] =
- (int)machdep_pthread->machdep_stack + stack_size - 1024;
- machdep_pthread->machdep_state[1] &= ~7;
-
-}
-
-/* ==========================================================================
- * machdep_sys_getdirentries()
- */
-int machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
-{
- return(machdep_sys_getdents(fd, buf, len));
-}
-
-/* ==========================================================================
- * machdep_sys_wait3()
- */
-machdep_sys_wait3(int * b, int c, int * d)
-{
- return(-ENOSYS);
- /* return(machdep_sys_wait4(0, b, c, d)); */
-}
-
-/* ==========================================================================
- * machdep_sys_waitpid()
- */
-machdep_sys_waitpid(int a, int * b, int c)
-{
- idtype_t id;
-
- switch (a) {
- case -1:
- id = P_ALL;
- break;
- case 0:
- a = machdep_sys_pgrpsys(0);
- id = P_PGID;
- break;
- default:
- if (a < 0) {
- id = P_PGID;
- a = -a;
- } else {
- id = P_PID;
- }
- break;
- }
-
- return(machdep_sys_waitsys(id, a, b, c));
-}
-
-/* ==========================================================================
- * machdep_sys_dup2()
- */
-machdep_sys_dup2(int a, int b)
-{
- machdep_sys_close(b);
- machdep_sys_fcntl(a, F_DUPFD, b);
-}
-
-/* ==========================================================================
- * machdep_sys_ftruncate()
- */
-machdep_sys_ftruncate(int a, off_t b)
-{
- flock_t c;
-
- c.l_len = 0;
- c.l_start = b;
- c.l_whence = 0;
- return(machdep_sys_fcntl(a, F_FREESP, c));
-}
-
-/* ==========================================================================
- * machdep_sys_select()
- * Recoded to be quicker by Monty
- */
-static fd_set bogus_fds; /* Always zero, never changed */
-
-machdep_sys_select(int nfds, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds, struct timeval *timeout)
-{
- struct pollfd fds[64],*ptr;
- int i, fds_count, time_out, found;
-
- /* Make sure each arg has a valid pointer */
- if ((readfds == NULL) || (writefds == NULL) || (exceptfds == NULL)) {
- if (exceptfds == NULL) {
- exceptfds = &bogus_fds;
- }
- if (writefds == NULL) {
- writefds = &bogus_fds;
- }
- if (readfds == NULL) {
- readfds = &bogus_fds;
- }
- }
-
- ptr=fds;
- for (i = 0 ; i < nfds; i++)
- {
- if (FD_ISSET(i, readfds))
- {
- if (FD_ISSET(i, writefds))
- ptr->events= POLLIN | POLLOUT;
- else
- ptr->events= POLLIN;
- (ptr++)->fd=i;
- }
- else if (FD_ISSET(i, writefds))
- {
- ptr->events=POLLOUT;
- (ptr++)->fd=i;
- }
- }
- FD_ZERO(readfds);
- FD_ZERO(writefds);
- FD_ZERO(exceptfds);
- time_out = timeout->tv_usec / 1000 + timeout->tv_sec * 1000;
- fds_count=(int) (ptr-fds);
- while ((found = machdep_sys_poll(fds, fds_count, time_out)) <= 0)
- {
- if (found != -ERESTART) /* Try again if restartable */
- return(found); /* Usually 0 ; Cant read or write */
- }
-
- while (ptr-- != fds)
- {
- if (ptr->revents & POLLIN)
- FD_SET(ptr->fd, readfds);
- if (ptr->revents & POLLOUT)
- FD_SET(ptr->fd,writefds);
- }
- return(found);
-}
-
-/* ==========================================================================
- * machdep_sys_getdtablesize()
- */
-machdep_sys_getdtablesize()
-{
- return(sysconf(_SC_OPEN_MAX));
-}
-
-/* ==========================================================================
- * getpagesize()
- */
-getpagesize()
-{
- return(sysconf(_SC_PAGESIZE));
-}
-
-/* ==========================================================================
- * gethostname()
- */
-int gethostname(char * name, int namelen)
-{
- if (sysinfo(SI_HOSTNAME, name, namelen) == NOTOK) {
- return(NOTOK);
- } else {
- return(OK);
- }
-}
-
-/* ==========================================================================
- * machdep_sys_sigaction()
- *
- * This is VERY temporary.
- */
-int machdep_sys_sigaction(int a, void * b, void * c)
-{
- return(sigaction(a, b, c));
-}
diff --git a/mit-pthreads/machdep/engine-sparc-sunos-5.3.h b/mit-pthreads/machdep/engine-sparc-sunos-5.3.h
deleted file mode 100644
index 365ecd799eb..00000000000
--- a/mit-pthreads/machdep/engine-sparc-sunos-5.3.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/* ==== machdep.h ============================================================
- * Copyright (c) 1994 Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- */
-
-#include <unistd.h>
-#include <setjmp.h>
-#include <sys/time.h>
-#include <sys/cdefs.h>
-
-/*
- * The first machine dependent functions are the SEMAPHORES
- * needing the test and set instruction.
- */
-#define SEMAPHORE_CLEAR 0
-#define SEMAPHORE_SET 0xff
-
-#define SEMAPHORE_TEST_AND_SET(lock) \
-({ \
-char *p = lock; \
-long temp; \
- \
-__asm__ volatile("ldstub %1,%0" \
- :"=r" (temp) \
- :"m" (*p) \
- :"memory"); \
-temp; \
-})
-
-#define SEMAPHORE_RESET(lock) \
-{ \
-__asm__ volatile("stb %1, %0" \
- :"=m" (*lock) \
- :"r" (SEMAPHORE_CLEAR) \
- :"memory"); \
-}
-
-/*
- * More machine dependent macros
- */
-#ifdef PTHREAD_KERNEL
-
-#define machdep_save_float_state(x)
-#define machdep_restore_float_state()
-
-#endif
-
-/*
- * New types
- */
-typedef char semaphore;
-
-/*
- * sigset_t macros
- */
-#define SIGMAX 31
-#define SIG_ANY(sig) \
-({ \
- sigset_t *sig_addr = (sigset_t *)&sig; \
- int ret = 0; \
- int i; \
- \
- for (i = 1; i <= SIGMAX; i++) { \
- if (sigismember(sig_addr, i)) { \
- ret = 1; \
- break; \
- } \
- } \
- ret; \
-})
-
-/*
- * New Strutures
- */
-struct machdep_pthread {
- void *(*start_routine)(void *);
- void *start_argument;
- void *machdep_stack;
- struct itimerval machdep_timer;
- jmp_buf machdep_state;
-};
-
-/*
- * Static machdep_pthread initialization values.
- * For initial thread only.
- */
-#define MACHDEP_PTHREAD_INIT \
-{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
-
-/*
- * Minimum stack size
- */
-#undef PTHREAD_STACK_MIN /* Defined in limits.h */
-#define PTHREAD_STACK_MIN 1024
-
-/*
- * Some fd flag defines that are necessary to distinguish between posix
- * behavior and bsd4.3 behavior.
- */
-#define __FD_NONBLOCK (O_NONBLOCK | O_NDELAY)
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-#if defined(PTHREAD_KERNEL)
-
-#define __machdep_stack_get(x) (x)->machdep_stack
-#define __machdep_stack_set(x, y) (x)->machdep_stack = y
-#define __machdep_stack_repl(x, y) \
-{ \
- if (stack = __machdep_stack_get(x)) { \
- __machdep_stack_free(stack); \
- } \
- __machdep_stack_set(x, y); \
-}
-
-void * __machdep_stack_alloc __P_((size_t));
-void __machdep_stack_free __P_((void *));
-
-int machdep_save_state __P_((void));
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/freebsd-1.1/compat.h b/mit-pthreads/machdep/freebsd-1.1/compat.h
deleted file mode 100755
index e7de318aa88..00000000000
--- a/mit-pthreads/machdep/freebsd-1.1/compat.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* ==== compat.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : COmpat header to make socket code compile.
- *
- * 1.00 94/08/01 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_COMPAT_H_
-#define _SYS_COMPAT_H_
-
-#endif
diff --git a/mit-pthreads/machdep/freebsd-1.1/dirent.h b/mit-pthreads/machdep/freebsd-1.1/dirent.h
deleted file mode 100755
index 5226443f86b..00000000000
--- a/mit-pthreads/machdep/freebsd-1.1/dirent.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 5.18 (Berkeley) 2/23/91
- */
-
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-/*
- * A directory entry has a struct dirent at the front of it, containing its
- * inode number, the length of the entry, and the length of the name
- * contained in the entry. These are followed by the name padded to a 4
- * byte boundary with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- */
-
-struct dirent {
- u_long d_fileno; /* file number of entry */
- u_short d_reclen; /* length of this record */
- u_short d_namlen; /* length of string in d_name */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
-#define MAXNAMLEN 255
- char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
-#endif
-};
-
-#define d_ino d_fileno /* backward compatibility */
-
-/* definitions for library routines operating on directories. */
-#define DIRBLKSIZ 1024
-
-#endif /* !_DIRENT_H_ */
diff --git a/mit-pthreads/machdep/freebsd-1.1/socket.h b/mit-pthreads/machdep/freebsd-1.1/socket.h
deleted file mode 100755
index f13d01e7fe5..00000000000
--- a/mit-pthreads/machdep/freebsd-1.1/socket.h
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Copyright (c) 1982,1985,1986,1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)socket.h 7.13 (Berkeley) 4/20/91
- * $Id$
- */
-
-#ifndef _SYS_SOCKET_H_
-#define _SYS_SOCKET_H_ 1
-
-/*
- * Definitions related to sockets: types, address families, options.
- */
-
-/*
- * Types
- */
-#define SOCK_STREAM 1 /* stream socket */
-#define SOCK_DGRAM 2 /* datagram socket */
-#define SOCK_RAW 3 /* raw-protocol interface */
-#define SOCK_RDM 4 /* reliably-delivered message */
-#define SOCK_SEQPACKET 5 /* sequenced packet stream */
-
-/*
- * Option flags per-socket.
- */
-#define SO_DEBUG 0x0001 /* turn on debugging info recording */
-#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
-#define SO_REUSEADDR 0x0004 /* allow local address reuse */
-#define SO_KEEPALIVE 0x0008 /* keep connections alive */
-#define SO_DONTROUTE 0x0010 /* just use interface addresses */
-#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
-#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
-#define SO_LINGER 0x0080 /* linger on close if data present */
-#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
-#define SO_ERROR 0x1007 /* get error status and clear */
-#define SO_TYPE 0x1008 /* get socket type */
-
-/*
- * Structure used for manipulating linger option.
- */
-struct linger {
- int l_onoff; /* option on/off */
- int l_linger; /* linger time */
-};
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define SOL_SOCKET 0xffff /* options for socket level */
-
-/*
- * Address families.
- */
-#define AF_UNSPEC 0 /* unspecified */
-#define AF_UNIX 1 /* local to host (pipes, portals) */
-#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
-#define AF_IMPLINK 3 /* arpanet imp addresses */
-#define AF_PUP 4 /* pup protocols: e.g. BSP */
-#define AF_CHAOS 5 /* mit CHAOS protocols */
-#define AF_NS 6 /* XEROX NS protocols */
-#define AF_ISO 7 /* ISO protocols */
-#define AF_OSI AF_ISO
-#define AF_ECMA 8 /* european computer manufacturers */
-#define AF_DATAKIT 9 /* datakit protocols */
-#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
-#define AF_SNA 11 /* IBM SNA */
-#define AF_DECnet 12 /* DECnet */
-#define AF_DLI 13 /* DEC Direct data link interface */
-#define AF_LAT 14 /* LAT */
-#define AF_HYLINK 15 /* NSC Hyperchannel */
-#define AF_APPLETALK 16 /* Apple Talk */
-#define AF_ROUTE 17 /* Internal Routing Protocol */
-#define AF_LINK 18 /* Link layer interface */
-#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
-#define AF_RMP 20 /* HP's Remote Maint Protocol */
-#define AF_MAX 21
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
- u_char sa_len; /* total length */
- u_char sa_family; /* address family */
- char sa_data[14]; /* actually longer; address value */
-};
-
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
- u_short sp_family; /* address family */
- u_short sp_protocol; /* protocol */
-};
-
-/*
- * Protocol families, same as address families for now.
- */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_UNIX AF_UNIX
-#define PF_INET AF_INET
-#define PF_IMPLINK AF_IMPLINK
-#define PF_PUP AF_PUP
-#define PF_CHAOS AF_CHAOS
-#define PF_NS AF_NS
-#define PF_ISO AF_ISO
-#define PF_OSI AF_ISO
-#define PF_ECMA AF_ECMA
-#define PF_DATAKIT AF_DATAKIT
-#define PF_CCITT AF_CCITT
-#define PF_SNA AF_SNA
-#define PF_DECnet AF_DECnet
-#define PF_DLI AF_DLI
-#define PF_LAT AF_LAT
-#define PF_HYLINK AF_HYLINK
-#define PF_APPLETALK AF_APPLETALK
-#define PF_ROUTE AF_ROUTE
-#define PF_LINK AF_LINK
-#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
-#define PF_RMP AF_RMP
-
-#define PF_MAX AF_MAX
-
-/*
- * Maximum queue length specifiable by listen.
- */
-#define SOMAXCONN 5
-
-/*
- * Message header for recvmsg and sendmsg calls.
- * Used value-result for recvmsg, value only for sendmsg.
- */
-struct msghdr {
- caddr_t msg_name; /* optional address */
- u_int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- u_int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_control; /* ancillary data, see below */
- u_int msg_controllen; /* ancillary data buffer len */
- int msg_flags; /* flags on received message */
-};
-
-#define MSG_OOB 0x1 /* process out-of-band data */
-#define MSG_PEEK 0x2 /* peek at incoming message */
-#define MSG_DONTROUTE 0x4 /* send without using routing tables */
-#define MSG_EOR 0x8 /* data completes record */
-#define MSG_TRUNC 0x10 /* data discarded before delivery */
-#define MSG_CTRUNC 0x20 /* control data lost before delivery */
-#define MSG_WAITALL 0x40 /* wait for full request or error */
-
-/*
- * Header for ancillary data objects in msg_control buffer.
- * Used for additional information with/about a datagram
- * not expressible by flags. The format is a sequence
- * of message elements headed by cmsghdr structures.
- */
-struct cmsghdr {
- u_int cmsg_len; /* data byte count, including hdr */
- int cmsg_level; /* originating protocol */
- int cmsg_type; /* protocol-specific type */
-/* followed by u_char cmsg_data[]; */
-};
-
-/* given pointer to struct adatahdr, return pointer to data */
-#define CMSG_DATA(cmsg) ((u_char *)((cmsg) + 1))
-
-/* given pointer to struct adatahdr, return pointer to next adatahdr */
-#define CMSG_NXTHDR(mhdr, cmsg) \
- (((caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \
- (mhdr)->msg_control + (mhdr)->msg_controllen) ? \
- (struct cmsghdr *)NULL : \
- (struct cmsghdr *)((caddr_t)(cmsg) + ALIGN((cmsg)->cmsg_len)))
-
-#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
-
-/* "Socket"-level control message types: */
-#define SCM_RIGHTS 0x01 /* access rights (array of int) */
-
-/*
- * 4.3 compat sockaddr, move to compat file later
- */
-struct osockaddr {
- u_short sa_family; /* address family */
- char sa_data[14]; /* up to 14 bytes of direct address */
-};
-
-/*
- * 4.3-compat message header (move to compat file later).
- */
-struct omsghdr {
- caddr_t msg_name; /* optional address */
- int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_accrights; /* access rights sent/received */
- int msg_accrightslen;
-};
-
-#ifndef KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int accept __P_((int, struct sockaddr *, int *));
-int bind __P_((int, const struct sockaddr *, int));
-int connect __P_((int, const struct sockaddr *, int));
-int getpeername __P_((int, struct sockaddr *, int *));
-int getsockname __P_((int, struct sockaddr *, int *));
-int getsockopt __P_((int, int, int, void *, int *));
-int listen __P_((int, int));
-ssize_t recv __P_((int, void *, size_t, int));
-ssize_t recvfrom __P_((int, void *, size_t, int,
- struct sockaddr *, int *));
-int recvmsg __P_((int, struct msghdr *, int));
-ssize_t send __P_((int, const void *, size_t, int));
-ssize_t sendto __P_((int, const void *, size_t, int,
- const struct sockaddr *, int));
-int sendmsg __P_((int, const struct msghdr *, int));
-int setsockopt __P_((int, int, int, const void *, int));
-int shutdown __P_((int, int));
-int socket __P_((int, int, int));
-int socketpair __P_((int, int, int, int *));
-__END_DECLS
-
-#endif /* !KERNEL */
-#endif /* _SYS_SOCKET_H_ */
diff --git a/mit-pthreads/machdep/freebsd-1.1/timers.h b/mit-pthreads/machdep/freebsd-1.1/timers.h
deleted file mode 100755
index 3c4d057976a..00000000000
--- a/mit-pthreads/machdep/freebsd-1.1/timers.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <sys/types.h>
-#include <time.h>
-
-struct timespec {
- time_t tv_sec;
- long tv_nsec;
-};
-
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/machdep/freebsd-2.0/__math.h b/mit-pthreads/machdep/freebsd-2.0/__math.h
deleted file mode 100755
index 27ed0f2575d..00000000000
--- a/mit-pthreads/machdep/freebsd-2.0/__math.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * ANSI/POSIX
- */
-extern char __infinity[];
-#define HUGE_VAL (*(double *) __infinity)
-
diff --git a/mit-pthreads/machdep/freebsd-2.0/__path.h b/mit-pthreads/machdep/freebsd-2.0/__path.h
deleted file mode 100755
index 432494daafa..00000000000
--- a/mit-pthreads/machdep/freebsd-2.0/__path.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * $Id$
- */
-
-#ifndef _SYS__PATH_H_
-#define _SYS__PATH_H_
-
-#define _PATH_PTY "/dev/"
-#define _PATH_TZDIR "/usr/share/zoneinfo"
-#define _PATH_TZFILE "/etc/localtime"
-
-#endif /* !_SYS__PATH_H_ */
-
diff --git a/mit-pthreads/machdep/freebsd-2.0/__signal.h b/mit-pthreads/machdep/freebsd-2.0/__signal.h
deleted file mode 100755
index 918955c9948..00000000000
--- a/mit-pthreads/machdep/freebsd-2.0/__signal.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <sys/signal.h>
-
-#define __SIGEMPTYSET 0
-#define __SIGFILLSET 0xffffffff
-#define __SIGADDSET(s, n) (*(s) |= 1 << ((n) - 1), 0)
-#define __SIGDELSET(s, n) (*(s) &= ~(1 << ((n) - 1)), 0)
-#define __SIGISMEMBER(s, n) ((*(s) & (1 << ((n) - 1))) != 0)
-
diff --git a/mit-pthreads/machdep/freebsd-2.0/__stdio.h b/mit-pthreads/machdep/freebsd-2.0/__stdio.h
deleted file mode 100755
index d60b9df7a54..00000000000
--- a/mit-pthreads/machdep/freebsd-2.0/__stdio.h
+++ /dev/null
@@ -1,8 +0,0 @@
-
-#include <machine/ansi.h>
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-typedef pthread_fpos_t fpos_t; /* Must match off_t <sys/types.h> */
diff --git a/mit-pthreads/machdep/freebsd-2.0/__stdlib.h b/mit-pthreads/machdep/freebsd-2.0/__stdlib.h
deleted file mode 100755
index 5ee2b8ed3d9..00000000000
--- a/mit-pthreads/machdep/freebsd-2.0/__stdlib.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * $Id$
- */
-
-#ifndef _SYS___STDLIB_H_
-#define _SYS___STDLIB_H_
-
-#include <machine/ansi.h>
-
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-#ifdef _BSD_WCHAR_T_
-typedef _BSD_WCHAR_T_ wchar_t;
-#ifdef _BSD_RUNE_T_
-typedef _BSD_RUNE_T_ rune_t;
-#undef _BSD_RUNE_T_
-#else
-typedef _BSD_WCHAR_T_ rune_t;
-#endif
-#undef _BSD_WCHAR_T_
-#endif
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#endif /* _STDLIB_H_ */
diff --git a/mit-pthreads/machdep/freebsd-2.0/__string.h b/mit-pthreads/machdep/freebsd-2.0/__string.h
deleted file mode 100755
index 93d4fcf9dd2..00000000000
--- a/mit-pthreads/machdep/freebsd-2.0/__string.h
+++ /dev/null
@@ -1,21 +0,0 @@
-
-#include <machine/ansi.h>
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-/* Non-standard NetBSD string routines. */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-__BEGIN_DECLS
-int bcmp __P_((const void *, const void *, size_t));
-void bcopy __P_((const void *, void *, size_t));
-void bzero __P_((void *, size_t));
-char *index __P_((const char *, int));
-char *rindex __P_((const char *, int));
-char *strdup __P_((const char *));
-void strmode __P_((int, char *));
-char *strsep __P_((char **, const char *));
-__END_DECLS
-#endif
-
diff --git a/mit-pthreads/machdep/freebsd-2.0/__time.h b/mit-pthreads/machdep/freebsd-2.0/__time.h
deleted file mode 100755
index 5c4b722bc3c..00000000000
--- a/mit-pthreads/machdep/freebsd-2.0/__time.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * $Id$
- */
-
-#ifndef _SYS__TIME_H_
-#define _SYS__TIME_H_
-
-#include <machine/ansi.h>
-#include <machine/limits.h>
-
-#ifdef _BSD_CLOCK_T_
-typedef _BSD_CLOCK_T_ clock_t;
-#undef _BSD_CLOCK_T_
-#endif
-
-#ifdef _BSD_TIME_T_
-typedef _BSD_TIME_T_ time_t;
-#undef _BSD_TIME_T_
-#endif
-
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-#define CLOCKS_PER_SEC 100
-
-#if !defined(CLK_TCK)
-#define CLK_TCK 100
-#endif /* not CLK_TCK */
-
-#endif /* !_SYS__TIME_H_ */
diff --git a/mit-pthreads/machdep/freebsd-2.0/__unistd.h b/mit-pthreads/machdep/freebsd-2.0/__unistd.h
deleted file mode 100755
index ed5b0657727..00000000000
--- a/mit-pthreads/machdep/freebsd-2.0/__unistd.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * $Id$
- */
-
-#ifndef _SYS___UNISTD_H_
-#define _SYS___UNISTD_H_
-
-#include <sys/types.h>
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#define ioctl_request_type unsigned long /* For fd.c */
-
-/* compile-time symbolic constants */
-#define _POSIX_JOB_CONTROL /* implementation supports job control */
-
-#ifdef _NOT_AVAILABLE
-#define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */
-#endif
-
-#ifndef _POSIX_VERSION
-#define _POSIX_VERSION 198808L
-#endif
-#ifndef _POSIX2_VERSION
-#define _POSIX2_VERSION 199212L
-#endif
-
-/* execution-time symbolic constants */
- /* chown requires appropriate privileges */
-#define _POSIX_CHOWN_RESTRICTED 1
- /* too-long path components generate errors */
-#define _POSIX_NO_TRUNC 1
- /* may disable terminal special characters */
-#define _POSIX_VDISABLE 0xff
-
-/* configurable pathname variables */
-#define _PC_LINK_MAX 1
-#define _PC_MAX_CANON 2
-#define _PC_MAX_INPUT 3
-#define _PC_NAME_MAX 4
-#define _PC_PATH_MAX 5
-#define _PC_PIPE_BUF 6
-#define _PC_CHOWN_RESTRICTED 7
-#define _PC_NO_TRUNC 8
-#define _PC_VDISABLE 9
-
-/* configurable system variables */
-#define _SC_ARG_MAX 1
-#define _SC_CHILD_MAX 2
-#define _SC_CLK_TCK 3
-#define _SC_NGROUPS_MAX 4
-#define _SC_OPEN_MAX 5
-#define _SC_JOB_CONTROL 6
-#define _SC_SAVED_IDS 7
-#define _SC_VERSION 8
-#define _SC_BC_BASE_MAX 9
-#define _SC_BC_DIM_MAX 10
-#define _SC_BC_SCALE_MAX 11
-#define _SC_BC_STRING_MAX 12
-#define _SC_COLL_WEIGHTS_MAX 13
-#define _SC_EXPR_NEST_MAX 14
-#define _SC_LINE_MAX 15
-#define _SC_RE_DUP_MAX 16
-#define _SC_2_VERSION 17
-#define _SC_2_C_BIND 18
-#define _SC_2_C_DEV 19
-#define _SC_2_CHAR_TERM 20
-#define _SC_2_FORT_DEV 21
-#define _SC_2_FORT_RUN 22
-#define _SC_2_LOCALEDEF 23
-#define _SC_2_SW_DEV 24
-#define _SC_2_UPE 25
-#define _SC_STREAM_MAX 26
-#define _SC_TZNAME_MAX 27
-
-/* configurable system strings */
-#define _CS_PATH 1
-
-#endif
diff --git a/mit-pthreads/machdep/freebsd-2.0/compat.h b/mit-pthreads/machdep/freebsd-2.0/compat.h
deleted file mode 100755
index e7de318aa88..00000000000
--- a/mit-pthreads/machdep/freebsd-2.0/compat.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* ==== compat.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : COmpat header to make socket code compile.
- *
- * 1.00 94/08/01 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_COMPAT_H_
-#define _SYS_COMPAT_H_
-
-#endif
diff --git a/mit-pthreads/machdep/freebsd-2.0/dirent.h b/mit-pthreads/machdep/freebsd-2.0/dirent.h
deleted file mode 100755
index 5226443f86b..00000000000
--- a/mit-pthreads/machdep/freebsd-2.0/dirent.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 5.18 (Berkeley) 2/23/91
- */
-
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-/*
- * A directory entry has a struct dirent at the front of it, containing its
- * inode number, the length of the entry, and the length of the name
- * contained in the entry. These are followed by the name padded to a 4
- * byte boundary with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- */
-
-struct dirent {
- u_long d_fileno; /* file number of entry */
- u_short d_reclen; /* length of this record */
- u_short d_namlen; /* length of string in d_name */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
-#define MAXNAMLEN 255
- char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
-#endif
-};
-
-#define d_ino d_fileno /* backward compatibility */
-
-/* definitions for library routines operating on directories. */
-#define DIRBLKSIZ 1024
-
-#endif /* !_DIRENT_H_ */
diff --git a/mit-pthreads/machdep/freebsd-2.0/errno.h b/mit-pthreads/machdep/freebsd-2.0/errno.h
deleted file mode 100755
index 3da61d692a3..00000000000
--- a/mit-pthreads/machdep/freebsd-2.0/errno.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/* $NetBSD: errno.h,v 1.8 1994/06/29 06:44:02 cgd Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)errno.h 8.5 (Berkeley) 1/21/94
- */
-
-#ifndef _SYS_ERRNO_H_
-#define _SYS_ERRNO_H_
-
-#define EPERM 1 /* Operation not permitted */
-#define ENOENT 2 /* No such file or directory */
-#define ESRCH 3 /* No such process */
-#define EINTR 4 /* Interrupted system call */
-#define EIO 5 /* Input/output error */
-#define ENXIO 6 /* Device not configured */
-#define E2BIG 7 /* Argument list too long */
-#define ENOEXEC 8 /* Exec format error */
-#define EBADF 9 /* Bad file descriptor */
-#define ECHILD 10 /* No child processes */
-#define EDEADLK 11 /* Resource deadlock avoided */
- /* 11 was EAGAIN */
-#define ENOMEM 12 /* Cannot allocate memory */
-#define EACCES 13 /* Permission denied */
-#define EFAULT 14 /* Bad address */
-#ifndef _POSIX_SOURCE
-#define ENOTBLK 15 /* Block device required */
-#endif
-#define EBUSY 16 /* Device busy */
-#define EEXIST 17 /* File exists */
-#define EXDEV 18 /* Cross-device link */
-#define ENODEV 19 /* Operation not supported by device */
-#define ENOTDIR 20 /* Not a directory */
-#define EISDIR 21 /* Is a directory */
-#define EINVAL 22 /* Invalid argument */
-#define ENFILE 23 /* Too many open files in system */
-#define EMFILE 24 /* Too many open files */
-#define ENOTTY 25 /* Inappropriate ioctl for device */
-#ifndef _POSIX_SOURCE
-#define ETXTBSY 26 /* Text file busy */
-#endif
-#define EFBIG 27 /* File too large */
-#define ENOSPC 28 /* No space left on device */
-#define ESPIPE 29 /* Illegal seek */
-#define EROFS 30 /* Read-only file system */
-#define EMLINK 31 /* Too many links */
-#define EPIPE 32 /* Broken pipe */
-
-/* math software */
-#define EDOM 33 /* Numerical argument out of domain */
-#define ERANGE 34 /* Result too large */
-
-/* non-blocking and interrupt i/o */
-#define EAGAIN 35 /* Resource temporarily unavailable */
-#ifndef _POSIX_SOURCE
-#define EWOULDBLOCK EAGAIN /* Operation would block */
-#define EINPROGRESS 36 /* Operation now in progress */
-#define EALREADY 37 /* Operation already in progress */
-
-/* ipc/network software -- argument errors */
-#define ENOTSOCK 38 /* Socket operation on non-socket */
-#define EDESTADDRREQ 39 /* Destination address required */
-#define EMSGSIZE 40 /* Message too long */
-#define EPROTOTYPE 41 /* Protocol wrong type for socket */
-#define ENOPROTOOPT 42 /* Protocol not available */
-#define EPROTONOSUPPORT 43 /* Protocol not supported */
-#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
-#define EOPNOTSUPP 45 /* Operation not supported */
-#define EPFNOSUPPORT 46 /* Protocol family not supported */
-#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
-#define EADDRINUSE 48 /* Address already in use */
-#define EADDRNOTAVAIL 49 /* Can't assign requested address */
-
-/* ipc/network software -- operational errors */
-#define ENETDOWN 50 /* Network is down */
-#define ENETUNREACH 51 /* Network is unreachable */
-#define ENETRESET 52 /* Network dropped connection on reset */
-#define ECONNABORTED 53 /* Software caused connection abort */
-#define ECONNRESET 54 /* Connection reset by peer */
-#define ENOBUFS 55 /* No buffer space available */
-#define EISCONN 56 /* Socket is already connected */
-#define ENOTCONN 57 /* Socket is not connected */
-#define ESHUTDOWN 58 /* Can't send after socket shutdown */
-#define ETOOMANYREFS 59 /* Too many references: can't splice */
-#define ETIMEDOUT 60 /* Operation timed out */
-#define ECONNREFUSED 61 /* Connection refused */
-
-#define ELOOP 62 /* Too many levels of symbolic links */
-#endif /* _POSIX_SOURCE */
-#define ENAMETOOLONG 63 /* File name too long */
-
-/* should be rearranged */
-#ifndef _POSIX_SOURCE
-#define EHOSTDOWN 64 /* Host is down */
-#define EHOSTUNREACH 65 /* No route to host */
-#endif /* _POSIX_SOURCE */
-#define ENOTEMPTY 66 /* Directory not empty */
-
-/* quotas & mush */
-#ifndef _POSIX_SOURCE
-#define EPROCLIM 67 /* Too many processes */
-#define EUSERS 68 /* Too many users */
-#define EDQUOT 69 /* Disc quota exceeded */
-
-/* Network File System */
-#define ESTALE 70 /* Stale NFS file handle */
-#define EREMOTE 71 /* Too many levels of remote in path */
-#define EBADRPC 72 /* RPC struct is bad */
-#define ERPCMISMATCH 73 /* RPC version wrong */
-#define EPROGUNAVAIL 74 /* RPC prog. not avail */
-#define EPROGMISMATCH 75 /* Program version wrong */
-#define EPROCUNAVAIL 76 /* Bad procedure for program */
-#endif /* _POSIX_SOURCE */
-
-#define ENOLCK 77 /* No locks available */
-#define ENOSYS 78 /* Function not implemented */
-
-#ifndef _POSIX_SOURCE
-#define EFTYPE 79 /* Inappropriate file type or format */
-#define EAUTH 80 /* Authentication error */
-#define ENEEDAUTH 81 /* Need authenticator */
-#define ELAST 81 /* Must be equal largest errno */
-#endif /* _POSIX_SOURCE */
-
-#endif
diff --git a/mit-pthreads/machdep/freebsd-2.0/timers.h b/mit-pthreads/machdep/freebsd-2.0/timers.h
deleted file mode 100755
index f9768c68c8f..00000000000
--- a/mit-pthreads/machdep/freebsd-2.0/timers.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <sys/time.h>
-
-#endif
diff --git a/mit-pthreads/machdep/freebsd-2.0/wait.h b/mit-pthreads/machdep/freebsd-2.0/wait.h
deleted file mode 100755
index 7861e3fa180..00000000000
--- a/mit-pthreads/machdep/freebsd-2.0/wait.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)wait.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_WAIT_H_
-#define _SYS_WAIT_H_
-
-/*
- * This file holds definitions relevent to the wait4 system call
- * and the alternate interfaces that use it (wait, wait3, waitpid).
- */
-
-/*
- * Macros to test the exit status returned by wait
- * and extract the relevant values.
- */
-#ifdef _POSIX_SOURCE
-#define _W_INT(i) (i)
-#else
-#define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */
-#define WCOREFLAG 0200
-#endif
-
-#define _WSTATUS(x) (_W_INT(x) & 0177)
-#define _WSTOPPED 0177 /* _WSTATUS if process is stopped */
-#define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED)
-#define WSTOPSIG(x) (_W_INT(x) >> 8)
-#define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0)
-#define WTERMSIG(x) (_WSTATUS(x))
-#define WIFEXITED(x) (_WSTATUS(x) == 0)
-#define WEXITSTATUS(x) (_W_INT(x) >> 8)
-#ifndef _POSIX_SOURCE
-#define WCOREDUMP(x) (_W_INT(x) & WCOREFLAG)
-
-#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
-#define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED)
-#endif
-
-/*
- * Option bits for the third argument of wait4. WNOHANG causes the
- * wait to not hang if there are no stopped or terminated processes, rather
- * returning an error indication in this case (pid==0). WUNTRACED
- * indicates that the caller should receive status about untraced children
- * which stop due to signals. If children are stopped and a wait without
- * this option is done, it is as though they were still running... nothing
- * about them is returned.
- */
-#define WNOHANG 1 /* dont hang in wait */
-#define WUNTRACED 2 /* tell about stopped, untraced children */
-
-#ifndef _POSIX_SOURCE
-/* POSIX extensions and 4.2/4.3 compatability: */
-
-/*
- * Tokens for special values of the "pid" parameter to wait4.
- */
-#define WAIT_ANY (-1) /* any process */
-#define WAIT_MYPGRP 0 /* any process in my process group */
-
-#include <machine/endian.h>
-
-/*
- * Deprecated:
- * Structure of the information in the status word returned by wait4.
- * If w_stopval==WSTOPPED, then the second structure describes
- * the information returned, else the first.
- */
-union wait {
- int w_status; /* used in syscall */
- /*
- * Terminated process status.
- */
- struct {
-#if BYTE_ORDER == LITTLE_ENDIAN
- unsigned int w_Termsig:7, /* termination signal */
- w_Coredump:1, /* core dump indicator */
- w_Retcode:8, /* exit code if w_termsig==0 */
- w_Filler:16; /* upper bits filler */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- unsigned int w_Filler:16, /* upper bits filler */
- w_Retcode:8, /* exit code if w_termsig==0 */
- w_Coredump:1, /* core dump indicator */
- w_Termsig:7; /* termination signal */
-#endif
- } w_T;
- /*
- * Stopped process status. Returned
- * only for traced children unless requested
- * with the WUNTRACED option bit.
- */
- struct {
-#if BYTE_ORDER == LITTLE_ENDIAN
- unsigned int w_Stopval:8, /* == W_STOPPED if stopped */
- w_Stopsig:8, /* signal that stopped us */
- w_Filler:16; /* upper bits filler */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- unsigned int w_Filler:16, /* upper bits filler */
- w_Stopsig:8, /* signal that stopped us */
- w_Stopval:8; /* == W_STOPPED if stopped */
-#endif
- } w_S;
-};
-#define w_termsig w_T.w_Termsig
-#define w_coredump w_T.w_Coredump
-#define w_retcode w_T.w_Retcode
-#define w_stopval w_S.w_Stopval
-#define w_stopsig w_S.w_Stopsig
-
-#define WSTOPPED _WSTOPPED
-#endif /* _POSIX_SOURCE */
-
-#ifndef KERNEL
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-struct rusage; /* forward declaration */
-
-pid_t wait __P_((int *));
-pid_t waitpid __P_((pid_t, int *, int));
-#ifndef _POSIX_SOURCE
-pid_t wait3 __P_((int *, int, void *));
-pid_t wait4 __P_((pid_t, int *, int, void *));
-#endif
-__END_DECLS
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/hpux-10.20/__math.h b/mit-pthreads/machdep/hpux-10.20/__math.h
deleted file mode 100755
index 8066bd60713..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/__math.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#define HUGE_VAL 1.7976931348623157e+308
-
-
diff --git a/mit-pthreads/machdep/hpux-10.20/__signal.h b/mit-pthreads/machdep/hpux-10.20/__signal.h
deleted file mode 100755
index fbb1d6ce2b1..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/__signal.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <sys/signal.h>
-
-#ifndef SIGCLD
-#define SIGCLD SIGCHLD
-#endif
-
-/* #define sigmask(n) ((unsigned int)1 << (((n) - 1) & (32 - 1))) */
-#define sigword(n) (((unsigned int)((n) - 1))>>5)
-
-#define __SIGEMPTYSET { 0, 0, 0, 0, 0, 0, 0, 0 }
-#define __SIGFILLSET { 0xffffffff,0xffffffff,0xffffffff,0xffffffff,\
- 0xffffffff,0xffffffff,0xffffffff,0xffffffff}
-#define __SIGADDSET(s, n) ((s)->sigset[sigword(n)] |= sigmask(n))
-#define __SIGDELSET(s, n) ((s)->sigset[sigword(n)] &= ~sigmask(n))
-#define __SIGISMEMBER(s, n) ((s)->sigset[sigword(n)] & sigmask(n))
-
-#define SIGSET_SIZE sizeof(sigset_t)/sizeof(long)
-
-#define SIG_ANY(sig) sig_any(&sig)
-
-static inline int sig_any(sigset_t *sig) {
- int i;
- for (i=0; i < SIGSET_SIZE; i++)
- if (sig->sigset[i] != 0)
- return 1;
- return 0;
-}
-
diff --git a/mit-pthreads/machdep/hpux-10.20/__stdio.h b/mit-pthreads/machdep/hpux-10.20/__stdio.h
deleted file mode 100755
index b8f1a07d9d6..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/__stdio.h
+++ /dev/null
@@ -1,11 +0,0 @@
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-#include <sys/types.h>
-/*
-typedef pthread_fpos_t fpos_t;
-*/
-
diff --git a/mit-pthreads/machdep/hpux-10.20/__stdlib.h b/mit-pthreads/machdep/hpux-10.20/__stdlib.h
deleted file mode 100755
index 37a14a960d5..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/__stdlib.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* $Id$ */
-
-#ifndef __sys_stdtypes_h
-
-#ifndef _SYS___STDLIB_H_
-#define _SYS___STDLIB_H_
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned int size_t;
-#endif
-
-#ifndef _WCHAR_T
-#define _WCHAR_T
-typedef unsigned int wchar_t;
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/hpux-10.20/__string.h b/mit-pthreads/machdep/hpux-10.20/__string.h
deleted file mode 100755
index 1badf6d660c..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/__string.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-#ifndef _SYS_STDSYMS_INCLUDED
-#endif
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-/* Non-standard SunOS 4.x string routines. */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-__BEGIN_DECLS
-int bcmp __P_((const void *, const void *, size_t));
-void bcopy __P_((const void *, void *, size_t));
-void bzero __P_((void *, size_t));
-char *index __P_((const char *, int));
-char *rindex __P_((const char *, int));
-char *strdup __P_((const char *));
-__END_DECLS
-#endif
diff --git a/mit-pthreads/machdep/hpux-10.20/__time.h b/mit-pthreads/machdep/hpux-10.20/__time.h
deleted file mode 100755
index ae958dcc3cf..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/__time.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* $Id$ */
-
-#ifndef __sys_stdtypes_h
-
-#ifndef _SYS__TIME_H_
-#define _SYS__TIME_H_
-
-#ifndef _CLOCK_T
-#define _CLOCK_T
-typedef long clock_t;
-#endif
-
-#ifndef _TIME_T
-#define _TIME_T
-typedef long time_t;
-#endif
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned int size_t;
-#endif
-
-#define CLOCKS_PER_SEC 1000000
-
-#if !defined(_ANSI_SOURCE) && !defined(CLK_TCK)
-#define CLK_TCK 60
-#endif /* not ANSI */
-
-#endif
-
-#endif /* !_SYS__TIME_H_ */
diff --git a/mit-pthreads/machdep/hpux-10.20/__unistd.h b/mit-pthreads/machdep/hpux-10.20/__unistd.h
deleted file mode 100755
index 218e13d14ec..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/__unistd.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/machdep/hpux-9.03/__unist
-d.h,v 1.2 1995/03/10 03:59:53 snl Exp */
-
-#ifndef _SYS___UNISTD_H_
-#define _SYS___UNISTD_H_
-
-#include <sys/stdsyms.h>
-#include <sys/types.h>
-#include <utime.h>
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#ifndef _GID_T
-#define _GID_T
-typedef long gid_t;
-#endif
-
-#ifndef _UID_T
-#define _UID_T
-typedef long uid_t;
-#endif
-
-#ifndef _PID_T
-#define _PID_T
-typedef long pid_t;
-#endif
-
-#ifndef _OFF_T
-#define _OFF_T
-typedef long off_t;
-#endif
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned int size_t;
-#endif
-
-#ifndef _SSIZE_T
-#define _SSIZE_T
-typedef int ssize_t;
-#endif
-
-#define ioctl_request_type int /* For fd.c */
-
-/* Symbolic constants for sysconf() variables defined by POSIX.1-1988: 0-7 */
-
-#define _SC_ARG_MAX 0 /* ARG_MAX: Max length of argument to exec()
- including environment data */
-#define _SC_CHILD_MAX 1 /* CHILD_MAX: Max of processes per userid */
-#define _SC_CLK_TCK 2 /* Number of clock ticks per second */
-#define _SC_NGROUPS_MAX 3 /* NGROUPS_MAX: Max of simultaneous
- supplementary group IDs per process */
-#define _SC_OPEN_MAX 4 /* OPEN_MAX: Max of files that one process
- can have open at any one time */
-#define _SC_JOB_CONTROL 5 /* _POSIX_JOB_CONTROL: 1 iff supported */
-#define _SC_SAVED_IDS 6 /* _POSIX_SAVED_IDS: 1 iff supported */
-#define _SC_1_VERSION_88 7 /* _POSIX_VERSION: Date of POSIX.1-1988 */
-
-/* Symbolic constants for sysconf() variables added by POSIX.1-1990: 100-199 */
-
-#define _SC_STREAM_MAX 100 /* STREAM_MAX: Max of open stdio FILEs */
-#define _SC_TZNAME_MAX 101 /* TZNAME_MAX: Max length of timezone name */
-#define _SC_1_VERSION_90 102 /* _POSIX_VERSION: Date of POSIX.1-1990 */
-
-#endif /* _SYS___UNISTD_H_ */
-
diff --git a/mit-pthreads/machdep/hpux-10.20/cdefs.h b/mit-pthreads/machdep/hpux-10.20/cdefs.h
deleted file mode 100755
index 643089e6df6..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/cdefs.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* ==== cdefs.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Similar to the BSD cdefs.h file.
- *
- * 1.00 94/01/26 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_SYS_CDEFS_H_
-#define _PTHREAD_SYS_CDEFS_H_
-
-#include <sys/_inttypes.h>
-
-/* Stuff for compiling */
-#if defined(__GNUC__)
-#if defined(__cplusplus)
-#define __INLINE static inline
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS };
-#else
-#define __INLINE extern inline
-#define __CAN_DO_EXTERN_INLINE
-#define __BEGIN_DECLS
-#define __END_DECLS
-#if !defined(__STDC__)
-#define const __const
-#define inline __inline
-#define signed __signed
-#define volatile __volatile
-#endif
-#endif
-#else /* !__GNUC__ */
-#define __INLINE static
-#define __BEGIN_DECLS
-#define __END_DECLS
-#endif
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif /* __NORETURN not defined. */
-
-#ifndef _U_INT32_T_
-#define _U_INT32_T_
-typedef unsigned int u_int32_t;
-#endif
-
-#ifndef _U_INT16_T_
-#define _U_INT16_T_
-typedef unsigned short u_int16_t;
-#endif
-
-#ifndef _INT32_T_
-#define _INT32_T_
-/*
-typedef int int32_t;
-*/
-#endif
-
-#ifndef _INT16_T_
-#define _INT16_T_
-/*
-typedef short int16_t;
-*/
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/hpux-10.20/compat.h b/mit-pthreads/machdep/hpux-10.20/compat.h
deleted file mode 100755
index 5a59434417c..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/compat.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ==== compat.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Compatibility header for networking code.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_COMPAT_H_
-#define _SYS_COMPAT_H_
-
-#define omsghdr msghdr
-
-#endif
diff --git a/mit-pthreads/machdep/hpux-10.20/dirent.h b/mit-pthreads/machdep/hpux-10.20/dirent.h
deleted file mode 100755
index 5f17af345db..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/dirent.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 5.18 (Berkeley) 2/23/91
- */
-
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-/*
- * A directory entry has a struct dirent at the front of it, containing its
- * inode number, the length of the entry, and the length of the name
- * contained in the entry. These are followed by the name padded to a 4
- * byte boundary with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- */
-
-struct dirent {
- u_long d_fileno; /* file number of entry */
- u_short d_reclen; /* length of this record */
- u_short d_namlen; /* length of string in d_name */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
-#define MAXNAMLEN 255
- char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
-#endif
-};
-
-#define d_ino d_fileno
-
-#endif /* !_SYS_DIRENT_H_ */
diff --git a/mit-pthreads/machdep/hpux-10.20/socket.h b/mit-pthreads/machdep/hpux-10.20/socket.h
deleted file mode 100755
index c7a37706940..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/socket.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 1982, 1985, 1986 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @(#)socket.h 7.3 (Berkeley) 6/27/88
- */
-
-/*
- * Definitions related to sockets: types, address families, options.
- */
-
-#include <sys/stdsyms.h>
-#include <pthread/posix.h>
-#include <sys/cdefs.h>
-
-/*
- * Types of sockets
- */
-#define SOCK_STREAM 1 /* stream socket */
-#define SOCK_DGRAM 2 /* datagram socket */
-#define SOCK_RAW 3 /* raw-protocol interface */
-#define SOCK_RDM 4 /* reliably-delivered message */
-#define SOCK_SEQPACKET 5 /* sequenced packet stream */
-
-/*
- * Option flags per-socket.
- */
-#define SO_DEBUG 0x0001 /* turn on debugging info recording */
-#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
-#define SO_REUSEADDR 0x0004 /* allow local address reuse */
-#define SO_KEEPALIVE 0x0008 /* keep connections alive */
-#define SO_DONTROUTE 0x0010 /* just use interface addresses */
-#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
-#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
-#define SO_LINGER 0x0080 /* linger on close if data present */
-#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
-#define SO_ERROR 0x1007 /* get error status and clear */
-#define SO_TYPE 0x1008 /* get socket type */
-#define SO_SND_COPYAVOID 0x1009 /* avoid copy on send*/
-#define SO_RCV_COPYAVOID 0x100a /* avoid copy on rcv */
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define SOL_SOCKET 0xffff /* options for socket level */
-
-/*
- * Address families.
- */
-#define AF_UNSPEC 0 /* unspecified */
-#define AF_UNIX 1 /* local to host (pipes, portals) */
-#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
-#define AF_IMPLINK 3 /* arpanet imp addresses */
-#define AF_PUP 4 /* pup protocols: e.g. BSP */
-#define AF_CHAOS 5 /* mit CHAOS protocols */
-#define AF_NS 6 /* XEROX NS protocols */
-#define AF_NBS 7 /* nbs protocols */
-#define AF_ECMA 8 /* european computer manufacturers */
-#define AF_DATAKIT 9 /* datakit protocols */
-#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
-#define AF_SNA 11 /* IBM SNA */
-#define AF_DECnet 12 /* DECnet */
-#define AF_DLI 13 /* Direct data link interface */
-#define AF_LAT 14 /* LAT */
-#define AF_HYLINK 15 /* NSC Hyperchannel */
-#define AF_APPLETALK 16 /* Apple Talk */
-#define AF_OTS 17 /* Used for OSI in the ifnets */
-#define AF_NIT 18 /* NIT */
-
-#define AF_MAX 19
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
- unsigned short sa_family; /* address family */
- char sa_data[14]; /* up to 14 bytes of direct address */
-};
-
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
- unsigned short sp_family; /* address family */
- unsigned short sp_protocol; /* protocol */
-};
-
-/*
- * Protocol families, same as address families for now.
- */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_UNIX AF_UNIX
-#define PF_INET AF_INET
-#define PF_IMPLINK AF_IMPLINK
-#define PF_PUP AF_PUP
-#define PF_CHAOS AF_CHAOS
-#define PF_NS AF_NS
-#define PF_NBS AF_NBS
-#define PF_ECMA AF_ECMA
-#define PF_DATAKIT AF_DATAKIT
-#define PF_CCITT AF_CCITT
-#define PF_SNA AF_SNA
-#define PF_DECnet AF_DECnet
-#define PF_DLI AF_DLI
-#define PF_LAT AF_LAT
-#define PF_HYLINK AF_HYLINK
-#define PF_APPLETALK AF_APPLETALK
-
-#define PF_MAX AF_MAX
-
-/*
- * Maximum queue length specifiable by listen.
- */
-#define SOMAXCONN 20
-
-/*
- * Message header for recvmsg and sendmsg calls.
- */
-struct msghdr {
- caddr_t msg_name; /* optional address */
- int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_accrights; /* access rights sent/received */
- int msg_accrightslen;
-};
-
-#define MSG_OOB 0x1 /* process out-of-band data */
-#define MSG_PEEK 0x2 /* peek at incoming message */
-#define MSG_DONTROUTE 0x4 /* send without using routing tables */
-
-#define MSG_MAXIOVLEN 16
-
-/*
- * Functions
- */
-
-__BEGIN_DECLS
-
-int accept __P_((int, struct sockaddr *, int *));
-int bind __P_((int, const struct sockaddr *, int));
-int connect __P_((int, const struct sockaddr *, int));
-int listen __P_((int, int));
-int socket __P_((int, int, int));
-
-__END_DECLS
-
diff --git a/mit-pthreads/machdep/hpux-10.20/stdtypes.h b/mit-pthreads/machdep/hpux-10.20/stdtypes.h
deleted file mode 100755
index 2b22abbf818..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/stdtypes.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* @(#)stdtypes.h 1.6 90/01/04 SMI */
-
-/*
- * Suppose you have an ANSI C or POSIX thingy that needs a typedef
- * for thingy_t. Put it here and include this file wherever you
- * define the thingy. This is used so that we don't have size_t in
- * N (N > 1) different places and so that we don't have to have
- * types.h included all the time and so that we can include this in
- * the lint libs instead of termios.h which conflicts with ioctl.h.
- */
-#ifndef __sys_stdtypes_h
-#define __sys_stdtypes_h
-
-#ifndef _SIGSET_T_
-#define _SIGSET_T_
-typedef int sigset_t; /* signal mask - may change */
-#endif
-
-#ifndef _SPEED_T_
-#define _SPEED_T_
-typedef unsigned int speed_t; /* tty speeds */
-#endif
-
-#ifndef _TCFLAG_T_
-#define _TCFLAG_T_
-typedef unsigned long tcflag_t; /* tty line disc modes */
-#endif
-
-#ifndef _CC_T_
-#define _CC_T_
-typedef unsigned char cc_t; /* tty control char */
-#endif
-
-#ifndef _PID_T_
-#define _PID_T_
-typedef int pid_t; /* process id */
-#endif
-
-#ifndef _MODE_T_
-#define _MODE_T_
-typedef unsigned short mode_t; /* file mode bits */
-#endif
-
-#ifndef _NLINK_T_
-#define _NLINK_T_
-typedef short nlink_t; /* links to a file */
-#endif
-
-#ifndef _CLOCK_T_
-#define _CLOCK_T_
-typedef long clock_t; /* units=ticks (typically 60/sec) */
-#endif
-
-#ifndef _TIME_T_
-#define _TIME_T_
-typedef long time_t; /* value = secs since epoch */
-#endif
-
-#ifndef _SIZE_T_
-#define _SIZE_T_
-typedef int size_t; /* ??? */
-#endif
-
-#ifndef _PTRDIFF_T_
-#define _PTRDIFF_T_
-typedef int ptrdiff_t; /* result of subtracting two pointers */
-#endif
-
-#ifndef _WCHAR_T_
-#define _WCHAR_T_
-typedef unsigned short wchar_t; /* big enough for biggest char set */
-#endif
-
-#endif /* !__sys_stdtypes_h */
diff --git a/mit-pthreads/machdep/hpux-10.20/time.h b/mit-pthreads/machdep/hpux-10.20/time.h
deleted file mode 100755
index 544905b0749..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/time.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/* $Header$ */
-
-#ifndef _SYS_TIME_INCLUDED
-#define _SYS_TIME_INCLUDED
-
-/* time.h: Definitions for time handling functions */
-
-#ifdef _KERNEL_BUILD
-#include "../h/stdsyms.h"
-#else /* ! _KERNEL_BUILD */
-#include <sys/stdsyms.h>
-#endif /* _KERNEL_BUILD */
-
-#include <sys/types.h>
-
-/* ANSI C time constants, types, and structures */
-
-#ifdef _INCLUDE__STDC__
-# define CLOCKS_PER_SEC 1000000
-
-# ifndef NULL
-# define NULL 0
-# endif
-
-# ifndef _CLOCK_T
-# define _CLOCK_T
- typedef unsigned long clock_t;
-# endif /* _CLOCK_T */
-
-# ifndef _TIME_T
-# define _TIME_T
- typedef long time_t;
-# endif /* _TIME_T */
-
-# ifndef _SIZE_T
-# define _SIZE_T
- typedef unsigned int size_t;
-# endif /* _SIZE_T */
-
- /* Structure used with gmtime(), localtime(), mktime(), strftime(). */
- struct tm {
- int tm_sec; /* second (0-61, allows for leap seconds) */
- int tm_min; /* minute (0-59) */
- int tm_hour; /* hour (0-23) */
- int tm_mday; /* day of the month (1-31) */
- int tm_mon; /* month (0-11) */
- int tm_year; /* years since 1900 */
- int tm_wday; /* day of the week (0-6) */
- int tm_yday; /* day of the year (0-365) */
- int tm_isdst; /* non-0 if daylight savings time is in effect */
- };
-#endif /* _INCLUDE__STDC__ */
-
-
-/* Additional types needed for HP-UX */
-
-#ifdef _INCLUDE_HPUX_SOURCE
-# ifndef _STRUCT_TIMEVAL
-# define _STRUCT_TIMEVAL
- /* Structure returned by gettimeofday(2) system call and others */
- struct timeval {
- unsigned long tv_sec; /* seconds */
- long tv_usec; /* and microseconds */
- };
-# endif /* _STRUCT_TIMEVAL */
-
- /* Structure used to represent timezones for gettimeofday(2) and others */
- struct timezone {
- int tz_minuteswest; /* minutes west of Greenwich */
- int tz_dsttime; /* type of dst correction */
- };
-
- /* Structure defining a timer setting. */
- struct itimerval {
- struct timeval it_interval; /* timer interval */
- struct timeval it_value; /* current value */
- };
-#endif /* _INCLUDE_HPUX_SOURCE */
-
-
-/* Function prototypes and external variable declarations */
-
-#ifndef _KERNEL
-#ifdef __cplusplus
- extern "C" {
-#endif /* __cplusplus */
-
-#ifdef _INCLUDE__STDC__
-# ifdef _PROTOTYPES
- extern double difftime(time_t, time_t);
- extern time_t mktime(struct tm *);
- extern time_t time(time_t *);
- extern char *ctime(const time_t *);
- extern struct tm *gmtime(const time_t *);
- extern struct tm *localtime(const time_t *);
- extern size_t strftime(char *, size_t, const char *, const struct tm *);
-# else /* not _PROTOTYPES */
- extern double difftime();
- extern time_t mktime();
- extern time_t time();
- extern char *ctime();
- extern struct tm *gmtime();
- extern struct tm *localtime();
- extern size_t strftime();
-# endif /* not _PROTOTYPES */
-
-# ifdef _CLASSIC_ANSI_TYPES
- extern long clock();
-# else /* not _CLASSIC_ANSI_TYPES */
-# ifdef _PROTOTYPES
- extern clock_t clock(void);
-# else /* not _PROTOTYPES */
- extern clock_t clock();
-# endif /* not _PROTOTYPES */
-# endif /* not _CLASSIC_ANSI_TYPES */
-#endif /* _INCLUDE__STDC__ */
-
-#ifdef _INCLUDE_POSIX_SOURCE
-# ifdef _PROTOTYPES
- extern void tzset(void);
-# else /* not _PROTOTYPES */
- extern void tzset();
-# endif /* not _PROTOTYPES */
-
- extern char *tzname[2];
-#endif /* _INCLUDE_POSIX_SOURCE */
-
-
-#ifdef _INCLUDE_XOPEN_SOURCE
-# ifdef _PROTOTYPES
- extern char *strptime(const char *, const char *, struct tm *);
-# else /* not _PROTOTYPES */
- extern char *strptime();
-# endif /* not _PROTOTYPES */
-
- extern long timezone;
- extern int daylight;
-#endif /* _INCLUDE_XOPEN_SOURCE */
-
-
-#ifdef _INCLUDE_HPUX_SOURCE
-# ifdef _PROTOTYPES
- extern struct tm *getdate(const char *);
- extern char *nl_asctime(struct tm *, char *, int);
- extern char *nl_ctime(long *, char *, int);
- extern char *nl_ascxtime(struct tm *, char *);
- extern char *nl_cxtime(long *, char *);
- extern int getitimer(int, struct itimerval *);
- extern int setitimer(int, const struct itimerval *, struct itimerval *);
- extern int gettimeofday(struct timeval *, struct timezone *);
- extern int settimeofday(const struct timeval *, const struct timezone *);
- extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
- extern int stime(const time_t *);
-# else /* not _PROTOTYPES */
- extern struct tm *getdate();
- extern char *nl_asctime();
- extern char *nl_ctime();
- extern char *nl_ascxtime();
- extern char *nl_cxtime();
- extern int getitimer();
- extern int setitimer();
- extern int gettimeofday();
- extern int settimeofday();
- extern int select();
- extern int stime();
-# endif /* not _PROTOTYPES */
- extern int getdate_err;
-#endif /* _INCLUDE_HPUX_SOURCE */
-
-#ifdef __cplusplus
- }
-#endif /* __cplusplus */
-#endif /* not _KERNEL */
-
-
-/*
- * CLK_TCK is needed by the kernel, and also in the POSIX namespace.
- */
-
-#ifdef _INCLUDE_POSIX_SOURCE
-# ifndef CLK_TCK
-# ifdef __hp9000s300
-# define CLK_TCK 50
-# endif /* __hp9000s300 */
-# ifdef __hp9000s800
-# define CLK_TCK 100
-# endif /* __hp9000s800 */
-# endif /* CLK_TCK */
-#endif
-
-
-/* Additional HP-UX structures, macros, and constants */
-
-#ifdef _INCLUDE_HPUX_SOURCE
-
- /* Kernel instrumentation time value */
- struct ki_timeval {
- long tv_sec; /* seconds */
- long tv_nunit; /* and native units */
- };
-
- /* Kinds of daylight savings time */
-# define DST_NONE 0 /* not on dst */
-# define DST_USA 1 /* USA style dst */
-# define DST_AUST 2 /* Australian style dst */
-# define DST_WET 3 /* Western European dst */
-# define DST_MET 4 /* Middle European dst */
-# define DST_EET 5 /* Eastern European dst */
-
- /*
- * Operations on timevals.
- *
- * NB: timercmp does not work for >= or <=.
- */
-# define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
-# define timercmp(tvp, uvp, cmp) \
- ((tvp)->tv_sec cmp (uvp)->tv_sec || \
- (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
-# define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
-
- /* Names of the interval timers */
-# define ITIMER_REAL 0
-# define ITIMER_VIRTUAL 1
-# define ITIMER_PROF 2
-
-#endif /* _INCLUDE_HPUX_SOURCE */
-
-#endif /* _SYS_TIME_INCLUDED */
diff --git a/mit-pthreads/machdep/hpux-10.20/timers.h b/mit-pthreads/machdep/hpux-10.20/timers.h
deleted file mode 100755
index 5a76a295400..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/timers.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <sys/signal.h>
-#include <sys/types.h>
-#include <time.h>
-
-/*
-struct timespec {
- time_t tv_sec;
- long tv_nsec;
-};
-*/
-
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/machdep/hpux-10.20/uio.h b/mit-pthreads/machdep/hpux-10.20/uio.h
deleted file mode 100755
index d1ec4c94f22..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/uio.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* ==== uio.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Correct HP-UX header file.
- */
-
-#ifndef _PTHREAD_UIO_H_
-#define _PTHREAD_UIO_H_
-
-#include <sys/cdefs.h>
-
-struct iovec {
- void *iov_base;
- size_t iov_len;
-};
-
-__BEGIN_DECLS
-
-int readv __P_((int, const struct iovec *, int));
-int writev __P_((int, const struct iovec *, int));
-
-__END_DECLS
-
-#endif
-
diff --git a/mit-pthreads/machdep/hpux-10.20/wait.h b/mit-pthreads/machdep/hpux-10.20/wait.h
deleted file mode 100755
index bca70d9f1ec..00000000000
--- a/mit-pthreads/machdep/hpux-10.20/wait.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)wait.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_WAIT_H_
-#define _SYS_WAIT_H_
-
-/*
- * Macros to test the exit status returned by wait
- * and extract the relevant values.
- */
-#define _W_INT(i) (i)
-#define WCOREFLAG 0200
-
-#define _WSTATUS(x) (_W_INT(x) & 0177)
-#define _WSTOPPED 0177 /* _WSTATUS if process is stopped */
-#define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED)
-#define WSTOPSIG(x) (_W_INT(x) >> 8)
-#define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0)
-#define WTERMSIG(x) (_WSTATUS(x))
-#define WIFEXITED(x) (_WSTATUS(x) == 0)
-#define WEXITSTATUS(x) (_W_INT(x) >> 8)
-#ifndef _POSIX_SOURCE
-#define WCOREDUMP(x) (_W_INT(x) & WCOREFLAG)
-
-#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
-#define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED)
-#endif
-
-#define WNOHANG 1 /* dont hang in wait */
-#define WUNTRACED 2 /* tell about stopped, untraced children */
-
-#ifndef _POSIX_SOURCE
-/* POSIX extensions and 4.2/4.3 compatability: */
-
-/*
- * Tokens for special values of the "pid" parameter to wait4.
- */
-#define WAIT_ANY (-1) /* any process */
-#define WAIT_MYPGRP 0 /* any process in my process group */
-
-#define WSTOPPED _WSTOPPED
-#endif /* _POSIX_SOURCE */
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-struct rusage; /* forward declaration */
-
-pid_t wait __P_((int *));
-pid_t waitpid __P_((pid_t, int *, int));
-
-#ifndef _POSIX_SOURCE
-pid_t wait3 __P_((int *, int, void *));
-#endif
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/machdep/hpux-9.03/__math.h b/mit-pthreads/machdep/hpux-9.03/__math.h
deleted file mode 100755
index 8066bd60713..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/__math.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#define HUGE_VAL 1.7976931348623157e+308
-
-
diff --git a/mit-pthreads/machdep/hpux-9.03/__signal.h b/mit-pthreads/machdep/hpux-9.03/__signal.h
deleted file mode 100755
index fbb1d6ce2b1..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/__signal.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <sys/signal.h>
-
-#ifndef SIGCLD
-#define SIGCLD SIGCHLD
-#endif
-
-/* #define sigmask(n) ((unsigned int)1 << (((n) - 1) & (32 - 1))) */
-#define sigword(n) (((unsigned int)((n) - 1))>>5)
-
-#define __SIGEMPTYSET { 0, 0, 0, 0, 0, 0, 0, 0 }
-#define __SIGFILLSET { 0xffffffff,0xffffffff,0xffffffff,0xffffffff,\
- 0xffffffff,0xffffffff,0xffffffff,0xffffffff}
-#define __SIGADDSET(s, n) ((s)->sigset[sigword(n)] |= sigmask(n))
-#define __SIGDELSET(s, n) ((s)->sigset[sigword(n)] &= ~sigmask(n))
-#define __SIGISMEMBER(s, n) ((s)->sigset[sigword(n)] & sigmask(n))
-
-#define SIGSET_SIZE sizeof(sigset_t)/sizeof(long)
-
-#define SIG_ANY(sig) sig_any(&sig)
-
-static inline int sig_any(sigset_t *sig) {
- int i;
- for (i=0; i < SIGSET_SIZE; i++)
- if (sig->sigset[i] != 0)
- return 1;
- return 0;
-}
-
diff --git a/mit-pthreads/machdep/hpux-9.03/__stdio.h b/mit-pthreads/machdep/hpux-9.03/__stdio.h
deleted file mode 100755
index 091b065a2e9..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/__stdio.h
+++ /dev/null
@@ -1,8 +0,0 @@
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-typedef pthread_fpos_t fpos_t;
-
diff --git a/mit-pthreads/machdep/hpux-9.03/__stdlib.h b/mit-pthreads/machdep/hpux-9.03/__stdlib.h
deleted file mode 100755
index 37a14a960d5..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/__stdlib.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* $Id$ */
-
-#ifndef __sys_stdtypes_h
-
-#ifndef _SYS___STDLIB_H_
-#define _SYS___STDLIB_H_
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned int size_t;
-#endif
-
-#ifndef _WCHAR_T
-#define _WCHAR_T
-typedef unsigned int wchar_t;
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/hpux-9.03/__string.h b/mit-pthreads/machdep/hpux-9.03/__string.h
deleted file mode 100755
index 1badf6d660c..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/__string.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-#ifndef _SYS_STDSYMS_INCLUDED
-#endif
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-/* Non-standard SunOS 4.x string routines. */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-__BEGIN_DECLS
-int bcmp __P_((const void *, const void *, size_t));
-void bcopy __P_((const void *, void *, size_t));
-void bzero __P_((void *, size_t));
-char *index __P_((const char *, int));
-char *rindex __P_((const char *, int));
-char *strdup __P_((const char *));
-__END_DECLS
-#endif
diff --git a/mit-pthreads/machdep/hpux-9.03/__time.h b/mit-pthreads/machdep/hpux-9.03/__time.h
deleted file mode 100755
index ae958dcc3cf..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/__time.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* $Id$ */
-
-#ifndef __sys_stdtypes_h
-
-#ifndef _SYS__TIME_H_
-#define _SYS__TIME_H_
-
-#ifndef _CLOCK_T
-#define _CLOCK_T
-typedef long clock_t;
-#endif
-
-#ifndef _TIME_T
-#define _TIME_T
-typedef long time_t;
-#endif
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned int size_t;
-#endif
-
-#define CLOCKS_PER_SEC 1000000
-
-#if !defined(_ANSI_SOURCE) && !defined(CLK_TCK)
-#define CLK_TCK 60
-#endif /* not ANSI */
-
-#endif
-
-#endif /* !_SYS__TIME_H_ */
diff --git a/mit-pthreads/machdep/hpux-9.03/__unistd.h b/mit-pthreads/machdep/hpux-9.03/__unistd.h
deleted file mode 100755
index 0e8515b1f96..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/__unistd.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/machdep/hpux-9.03/__unist
-d.h,v 1.2 1995/03/10 03:59:53 snl Exp */
-
-#ifndef _SYS___UNISTD_H_
-#define _SYS___UNISTD_H_
-
-#include <sys/stdsyms.h>
-#include <sys/types.h>
-#include <utime.h>
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#ifndef _GID_T
-#define _GID_T
-typedef long gid_t;
-#endif
-
-#ifndef _UID_T
-#define _UID_T
-typedef long uid_t;
-#endif
-
-#ifndef _PID_T
-#define _PID_T
-typedef long pid_t;
-#endif
-
-#ifndef _OFF_T
-#define _OFF_T
-typedef long off_t;
-#endif
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned int size_t;
-#endif
-
-#ifndef _SSIZE_T
-#define _SSIZE_T
-typedef int ssize_t;
-#endif
-
-/* Symbolic constants for sysconf() variables defined by POSIX.1-1988: 0-7 */
-
-#define _SC_ARG_MAX 0 /* ARG_MAX: Max length of argument to exec()
- including environment data */
-#define _SC_CHILD_MAX 1 /* CHILD_MAX: Max of processes per userid */
-#define _SC_CLK_TCK 2 /* Number of clock ticks per second */
-#define _SC_NGROUPS_MAX 3 /* NGROUPS_MAX: Max of simultaneous
- supplementary group IDs per process */
-#define _SC_OPEN_MAX 4 /* OPEN_MAX: Max of files that one process
- can have open at any one time */
-#define _SC_JOB_CONTROL 5 /* _POSIX_JOB_CONTROL: 1 iff supported */
-#define _SC_SAVED_IDS 6 /* _POSIX_SAVED_IDS: 1 iff supported */
-#define _SC_1_VERSION_88 7 /* _POSIX_VERSION: Date of POSIX.1-1988 */
-
-/* Symbolic constants for sysconf() variables added by POSIX.1-1990: 100-199 */
-
-#define _SC_STREAM_MAX 100 /* STREAM_MAX: Max of open stdio FILEs */
-#define _SC_TZNAME_MAX 101 /* TZNAME_MAX: Max length of timezone name */
-#define _SC_1_VERSION_90 102 /* _POSIX_VERSION: Date of POSIX.1-1990 */
-
-#endif /* _SYS___UNISTD_H_ */
-
diff --git a/mit-pthreads/machdep/hpux-9.03/cdefs.h b/mit-pthreads/machdep/hpux-9.03/cdefs.h
deleted file mode 100755
index 041300cbe02..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/cdefs.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ==== cdefs.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Similar to the BSD cdefs.h file.
- *
- * 1.00 94/01/26 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_SYS_CDEFS_H_
-#define _PTHREAD_SYS_CDEFS_H_
-
-/* Stuff for compiling */
-#if defined(__GNUC__)
-#if defined(__cplusplus)
-#define __INLINE static inline
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS };
-#else
-#define __INLINE extern inline
-#define __CAN_DO_EXTERN_INLINE
-#define __BEGIN_DECLS
-#define __END_DECLS
-#if !defined(__STDC__)
-#define const __const
-#define inline __inline
-#define signed __signed
-#define volatile __volatile
-#endif
-#endif
-#else /* !__GNUC__ */
-#define __INLINE static
-#define __BEGIN_DECLS
-#define __END_DECLS
-#endif
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif /* __NORETURN not defined. */
-
-#ifndef _U_INT32_T_
-#define _U_INT32_T_
-typedef unsigned int u_int32_t;
-#endif
-
-#ifndef _U_INT16_T_
-#define _U_INT16_T_
-typedef unsigned short u_int16_t;
-#endif
-
-#ifndef _INT32_T_
-#define _INT32_T_
-typedef int int32_t;
-#endif
-
-#ifndef _INT16_T_
-#define _INT16_T_
-typedef short int16_t;
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/hpux-9.03/compat.h b/mit-pthreads/machdep/hpux-9.03/compat.h
deleted file mode 100755
index 5a59434417c..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/compat.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ==== compat.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Compatibility header for networking code.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_COMPAT_H_
-#define _SYS_COMPAT_H_
-
-#define omsghdr msghdr
-
-#endif
diff --git a/mit-pthreads/machdep/hpux-9.03/dirent.h b/mit-pthreads/machdep/hpux-9.03/dirent.h
deleted file mode 100755
index 5f17af345db..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/dirent.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 5.18 (Berkeley) 2/23/91
- */
-
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-/*
- * A directory entry has a struct dirent at the front of it, containing its
- * inode number, the length of the entry, and the length of the name
- * contained in the entry. These are followed by the name padded to a 4
- * byte boundary with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- */
-
-struct dirent {
- u_long d_fileno; /* file number of entry */
- u_short d_reclen; /* length of this record */
- u_short d_namlen; /* length of string in d_name */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
-#define MAXNAMLEN 255
- char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
-#endif
-};
-
-#define d_ino d_fileno
-
-#endif /* !_SYS_DIRENT_H_ */
diff --git a/mit-pthreads/machdep/hpux-9.03/socket.h b/mit-pthreads/machdep/hpux-9.03/socket.h
deleted file mode 100755
index c7a37706940..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/socket.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 1982, 1985, 1986 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @(#)socket.h 7.3 (Berkeley) 6/27/88
- */
-
-/*
- * Definitions related to sockets: types, address families, options.
- */
-
-#include <sys/stdsyms.h>
-#include <pthread/posix.h>
-#include <sys/cdefs.h>
-
-/*
- * Types of sockets
- */
-#define SOCK_STREAM 1 /* stream socket */
-#define SOCK_DGRAM 2 /* datagram socket */
-#define SOCK_RAW 3 /* raw-protocol interface */
-#define SOCK_RDM 4 /* reliably-delivered message */
-#define SOCK_SEQPACKET 5 /* sequenced packet stream */
-
-/*
- * Option flags per-socket.
- */
-#define SO_DEBUG 0x0001 /* turn on debugging info recording */
-#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
-#define SO_REUSEADDR 0x0004 /* allow local address reuse */
-#define SO_KEEPALIVE 0x0008 /* keep connections alive */
-#define SO_DONTROUTE 0x0010 /* just use interface addresses */
-#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
-#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
-#define SO_LINGER 0x0080 /* linger on close if data present */
-#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
-#define SO_ERROR 0x1007 /* get error status and clear */
-#define SO_TYPE 0x1008 /* get socket type */
-#define SO_SND_COPYAVOID 0x1009 /* avoid copy on send*/
-#define SO_RCV_COPYAVOID 0x100a /* avoid copy on rcv */
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define SOL_SOCKET 0xffff /* options for socket level */
-
-/*
- * Address families.
- */
-#define AF_UNSPEC 0 /* unspecified */
-#define AF_UNIX 1 /* local to host (pipes, portals) */
-#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
-#define AF_IMPLINK 3 /* arpanet imp addresses */
-#define AF_PUP 4 /* pup protocols: e.g. BSP */
-#define AF_CHAOS 5 /* mit CHAOS protocols */
-#define AF_NS 6 /* XEROX NS protocols */
-#define AF_NBS 7 /* nbs protocols */
-#define AF_ECMA 8 /* european computer manufacturers */
-#define AF_DATAKIT 9 /* datakit protocols */
-#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
-#define AF_SNA 11 /* IBM SNA */
-#define AF_DECnet 12 /* DECnet */
-#define AF_DLI 13 /* Direct data link interface */
-#define AF_LAT 14 /* LAT */
-#define AF_HYLINK 15 /* NSC Hyperchannel */
-#define AF_APPLETALK 16 /* Apple Talk */
-#define AF_OTS 17 /* Used for OSI in the ifnets */
-#define AF_NIT 18 /* NIT */
-
-#define AF_MAX 19
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
- unsigned short sa_family; /* address family */
- char sa_data[14]; /* up to 14 bytes of direct address */
-};
-
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
- unsigned short sp_family; /* address family */
- unsigned short sp_protocol; /* protocol */
-};
-
-/*
- * Protocol families, same as address families for now.
- */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_UNIX AF_UNIX
-#define PF_INET AF_INET
-#define PF_IMPLINK AF_IMPLINK
-#define PF_PUP AF_PUP
-#define PF_CHAOS AF_CHAOS
-#define PF_NS AF_NS
-#define PF_NBS AF_NBS
-#define PF_ECMA AF_ECMA
-#define PF_DATAKIT AF_DATAKIT
-#define PF_CCITT AF_CCITT
-#define PF_SNA AF_SNA
-#define PF_DECnet AF_DECnet
-#define PF_DLI AF_DLI
-#define PF_LAT AF_LAT
-#define PF_HYLINK AF_HYLINK
-#define PF_APPLETALK AF_APPLETALK
-
-#define PF_MAX AF_MAX
-
-/*
- * Maximum queue length specifiable by listen.
- */
-#define SOMAXCONN 20
-
-/*
- * Message header for recvmsg and sendmsg calls.
- */
-struct msghdr {
- caddr_t msg_name; /* optional address */
- int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_accrights; /* access rights sent/received */
- int msg_accrightslen;
-};
-
-#define MSG_OOB 0x1 /* process out-of-band data */
-#define MSG_PEEK 0x2 /* peek at incoming message */
-#define MSG_DONTROUTE 0x4 /* send without using routing tables */
-
-#define MSG_MAXIOVLEN 16
-
-/*
- * Functions
- */
-
-__BEGIN_DECLS
-
-int accept __P_((int, struct sockaddr *, int *));
-int bind __P_((int, const struct sockaddr *, int));
-int connect __P_((int, const struct sockaddr *, int));
-int listen __P_((int, int));
-int socket __P_((int, int, int));
-
-__END_DECLS
-
diff --git a/mit-pthreads/machdep/hpux-9.03/stdtypes.h b/mit-pthreads/machdep/hpux-9.03/stdtypes.h
deleted file mode 100755
index 2b22abbf818..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/stdtypes.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* @(#)stdtypes.h 1.6 90/01/04 SMI */
-
-/*
- * Suppose you have an ANSI C or POSIX thingy that needs a typedef
- * for thingy_t. Put it here and include this file wherever you
- * define the thingy. This is used so that we don't have size_t in
- * N (N > 1) different places and so that we don't have to have
- * types.h included all the time and so that we can include this in
- * the lint libs instead of termios.h which conflicts with ioctl.h.
- */
-#ifndef __sys_stdtypes_h
-#define __sys_stdtypes_h
-
-#ifndef _SIGSET_T_
-#define _SIGSET_T_
-typedef int sigset_t; /* signal mask - may change */
-#endif
-
-#ifndef _SPEED_T_
-#define _SPEED_T_
-typedef unsigned int speed_t; /* tty speeds */
-#endif
-
-#ifndef _TCFLAG_T_
-#define _TCFLAG_T_
-typedef unsigned long tcflag_t; /* tty line disc modes */
-#endif
-
-#ifndef _CC_T_
-#define _CC_T_
-typedef unsigned char cc_t; /* tty control char */
-#endif
-
-#ifndef _PID_T_
-#define _PID_T_
-typedef int pid_t; /* process id */
-#endif
-
-#ifndef _MODE_T_
-#define _MODE_T_
-typedef unsigned short mode_t; /* file mode bits */
-#endif
-
-#ifndef _NLINK_T_
-#define _NLINK_T_
-typedef short nlink_t; /* links to a file */
-#endif
-
-#ifndef _CLOCK_T_
-#define _CLOCK_T_
-typedef long clock_t; /* units=ticks (typically 60/sec) */
-#endif
-
-#ifndef _TIME_T_
-#define _TIME_T_
-typedef long time_t; /* value = secs since epoch */
-#endif
-
-#ifndef _SIZE_T_
-#define _SIZE_T_
-typedef int size_t; /* ??? */
-#endif
-
-#ifndef _PTRDIFF_T_
-#define _PTRDIFF_T_
-typedef int ptrdiff_t; /* result of subtracting two pointers */
-#endif
-
-#ifndef _WCHAR_T_
-#define _WCHAR_T_
-typedef unsigned short wchar_t; /* big enough for biggest char set */
-#endif
-
-#endif /* !__sys_stdtypes_h */
diff --git a/mit-pthreads/machdep/hpux-9.03/time.h b/mit-pthreads/machdep/hpux-9.03/time.h
deleted file mode 100755
index 544905b0749..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/time.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/* $Header$ */
-
-#ifndef _SYS_TIME_INCLUDED
-#define _SYS_TIME_INCLUDED
-
-/* time.h: Definitions for time handling functions */
-
-#ifdef _KERNEL_BUILD
-#include "../h/stdsyms.h"
-#else /* ! _KERNEL_BUILD */
-#include <sys/stdsyms.h>
-#endif /* _KERNEL_BUILD */
-
-#include <sys/types.h>
-
-/* ANSI C time constants, types, and structures */
-
-#ifdef _INCLUDE__STDC__
-# define CLOCKS_PER_SEC 1000000
-
-# ifndef NULL
-# define NULL 0
-# endif
-
-# ifndef _CLOCK_T
-# define _CLOCK_T
- typedef unsigned long clock_t;
-# endif /* _CLOCK_T */
-
-# ifndef _TIME_T
-# define _TIME_T
- typedef long time_t;
-# endif /* _TIME_T */
-
-# ifndef _SIZE_T
-# define _SIZE_T
- typedef unsigned int size_t;
-# endif /* _SIZE_T */
-
- /* Structure used with gmtime(), localtime(), mktime(), strftime(). */
- struct tm {
- int tm_sec; /* second (0-61, allows for leap seconds) */
- int tm_min; /* minute (0-59) */
- int tm_hour; /* hour (0-23) */
- int tm_mday; /* day of the month (1-31) */
- int tm_mon; /* month (0-11) */
- int tm_year; /* years since 1900 */
- int tm_wday; /* day of the week (0-6) */
- int tm_yday; /* day of the year (0-365) */
- int tm_isdst; /* non-0 if daylight savings time is in effect */
- };
-#endif /* _INCLUDE__STDC__ */
-
-
-/* Additional types needed for HP-UX */
-
-#ifdef _INCLUDE_HPUX_SOURCE
-# ifndef _STRUCT_TIMEVAL
-# define _STRUCT_TIMEVAL
- /* Structure returned by gettimeofday(2) system call and others */
- struct timeval {
- unsigned long tv_sec; /* seconds */
- long tv_usec; /* and microseconds */
- };
-# endif /* _STRUCT_TIMEVAL */
-
- /* Structure used to represent timezones for gettimeofday(2) and others */
- struct timezone {
- int tz_minuteswest; /* minutes west of Greenwich */
- int tz_dsttime; /* type of dst correction */
- };
-
- /* Structure defining a timer setting. */
- struct itimerval {
- struct timeval it_interval; /* timer interval */
- struct timeval it_value; /* current value */
- };
-#endif /* _INCLUDE_HPUX_SOURCE */
-
-
-/* Function prototypes and external variable declarations */
-
-#ifndef _KERNEL
-#ifdef __cplusplus
- extern "C" {
-#endif /* __cplusplus */
-
-#ifdef _INCLUDE__STDC__
-# ifdef _PROTOTYPES
- extern double difftime(time_t, time_t);
- extern time_t mktime(struct tm *);
- extern time_t time(time_t *);
- extern char *ctime(const time_t *);
- extern struct tm *gmtime(const time_t *);
- extern struct tm *localtime(const time_t *);
- extern size_t strftime(char *, size_t, const char *, const struct tm *);
-# else /* not _PROTOTYPES */
- extern double difftime();
- extern time_t mktime();
- extern time_t time();
- extern char *ctime();
- extern struct tm *gmtime();
- extern struct tm *localtime();
- extern size_t strftime();
-# endif /* not _PROTOTYPES */
-
-# ifdef _CLASSIC_ANSI_TYPES
- extern long clock();
-# else /* not _CLASSIC_ANSI_TYPES */
-# ifdef _PROTOTYPES
- extern clock_t clock(void);
-# else /* not _PROTOTYPES */
- extern clock_t clock();
-# endif /* not _PROTOTYPES */
-# endif /* not _CLASSIC_ANSI_TYPES */
-#endif /* _INCLUDE__STDC__ */
-
-#ifdef _INCLUDE_POSIX_SOURCE
-# ifdef _PROTOTYPES
- extern void tzset(void);
-# else /* not _PROTOTYPES */
- extern void tzset();
-# endif /* not _PROTOTYPES */
-
- extern char *tzname[2];
-#endif /* _INCLUDE_POSIX_SOURCE */
-
-
-#ifdef _INCLUDE_XOPEN_SOURCE
-# ifdef _PROTOTYPES
- extern char *strptime(const char *, const char *, struct tm *);
-# else /* not _PROTOTYPES */
- extern char *strptime();
-# endif /* not _PROTOTYPES */
-
- extern long timezone;
- extern int daylight;
-#endif /* _INCLUDE_XOPEN_SOURCE */
-
-
-#ifdef _INCLUDE_HPUX_SOURCE
-# ifdef _PROTOTYPES
- extern struct tm *getdate(const char *);
- extern char *nl_asctime(struct tm *, char *, int);
- extern char *nl_ctime(long *, char *, int);
- extern char *nl_ascxtime(struct tm *, char *);
- extern char *nl_cxtime(long *, char *);
- extern int getitimer(int, struct itimerval *);
- extern int setitimer(int, const struct itimerval *, struct itimerval *);
- extern int gettimeofday(struct timeval *, struct timezone *);
- extern int settimeofday(const struct timeval *, const struct timezone *);
- extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
- extern int stime(const time_t *);
-# else /* not _PROTOTYPES */
- extern struct tm *getdate();
- extern char *nl_asctime();
- extern char *nl_ctime();
- extern char *nl_ascxtime();
- extern char *nl_cxtime();
- extern int getitimer();
- extern int setitimer();
- extern int gettimeofday();
- extern int settimeofday();
- extern int select();
- extern int stime();
-# endif /* not _PROTOTYPES */
- extern int getdate_err;
-#endif /* _INCLUDE_HPUX_SOURCE */
-
-#ifdef __cplusplus
- }
-#endif /* __cplusplus */
-#endif /* not _KERNEL */
-
-
-/*
- * CLK_TCK is needed by the kernel, and also in the POSIX namespace.
- */
-
-#ifdef _INCLUDE_POSIX_SOURCE
-# ifndef CLK_TCK
-# ifdef __hp9000s300
-# define CLK_TCK 50
-# endif /* __hp9000s300 */
-# ifdef __hp9000s800
-# define CLK_TCK 100
-# endif /* __hp9000s800 */
-# endif /* CLK_TCK */
-#endif
-
-
-/* Additional HP-UX structures, macros, and constants */
-
-#ifdef _INCLUDE_HPUX_SOURCE
-
- /* Kernel instrumentation time value */
- struct ki_timeval {
- long tv_sec; /* seconds */
- long tv_nunit; /* and native units */
- };
-
- /* Kinds of daylight savings time */
-# define DST_NONE 0 /* not on dst */
-# define DST_USA 1 /* USA style dst */
-# define DST_AUST 2 /* Australian style dst */
-# define DST_WET 3 /* Western European dst */
-# define DST_MET 4 /* Middle European dst */
-# define DST_EET 5 /* Eastern European dst */
-
- /*
- * Operations on timevals.
- *
- * NB: timercmp does not work for >= or <=.
- */
-# define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
-# define timercmp(tvp, uvp, cmp) \
- ((tvp)->tv_sec cmp (uvp)->tv_sec || \
- (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
-# define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
-
- /* Names of the interval timers */
-# define ITIMER_REAL 0
-# define ITIMER_VIRTUAL 1
-# define ITIMER_PROF 2
-
-#endif /* _INCLUDE_HPUX_SOURCE */
-
-#endif /* _SYS_TIME_INCLUDED */
diff --git a/mit-pthreads/machdep/hpux-9.03/timers.h b/mit-pthreads/machdep/hpux-9.03/timers.h
deleted file mode 100755
index 3c4d057976a..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/timers.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <sys/types.h>
-#include <time.h>
-
-struct timespec {
- time_t tv_sec;
- long tv_nsec;
-};
-
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/machdep/hpux-9.03/uio.h b/mit-pthreads/machdep/hpux-9.03/uio.h
deleted file mode 100755
index d1ec4c94f22..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/uio.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* ==== uio.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Correct HP-UX header file.
- */
-
-#ifndef _PTHREAD_UIO_H_
-#define _PTHREAD_UIO_H_
-
-#include <sys/cdefs.h>
-
-struct iovec {
- void *iov_base;
- size_t iov_len;
-};
-
-__BEGIN_DECLS
-
-int readv __P_((int, const struct iovec *, int));
-int writev __P_((int, const struct iovec *, int));
-
-__END_DECLS
-
-#endif
-
diff --git a/mit-pthreads/machdep/hpux-9.03/wait.h b/mit-pthreads/machdep/hpux-9.03/wait.h
deleted file mode 100755
index bca70d9f1ec..00000000000
--- a/mit-pthreads/machdep/hpux-9.03/wait.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)wait.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_WAIT_H_
-#define _SYS_WAIT_H_
-
-/*
- * Macros to test the exit status returned by wait
- * and extract the relevant values.
- */
-#define _W_INT(i) (i)
-#define WCOREFLAG 0200
-
-#define _WSTATUS(x) (_W_INT(x) & 0177)
-#define _WSTOPPED 0177 /* _WSTATUS if process is stopped */
-#define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED)
-#define WSTOPSIG(x) (_W_INT(x) >> 8)
-#define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0)
-#define WTERMSIG(x) (_WSTATUS(x))
-#define WIFEXITED(x) (_WSTATUS(x) == 0)
-#define WEXITSTATUS(x) (_W_INT(x) >> 8)
-#ifndef _POSIX_SOURCE
-#define WCOREDUMP(x) (_W_INT(x) & WCOREFLAG)
-
-#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
-#define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED)
-#endif
-
-#define WNOHANG 1 /* dont hang in wait */
-#define WUNTRACED 2 /* tell about stopped, untraced children */
-
-#ifndef _POSIX_SOURCE
-/* POSIX extensions and 4.2/4.3 compatability: */
-
-/*
- * Tokens for special values of the "pid" parameter to wait4.
- */
-#define WAIT_ANY (-1) /* any process */
-#define WAIT_MYPGRP 0 /* any process in my process group */
-
-#define WSTOPPED _WSTOPPED
-#endif /* _POSIX_SOURCE */
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-struct rusage; /* forward declaration */
-
-pid_t wait __P_((int *));
-pid_t waitpid __P_((pid_t, int *, int));
-
-#ifndef _POSIX_SOURCE
-pid_t wait3 __P_((int *, int, void *));
-#endif
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/machdep/irix-5.2/__math.h b/mit-pthreads/machdep/irix-5.2/__math.h
deleted file mode 100755
index 229d5121524..00000000000
--- a/mit-pthreads/machdep/irix-5.2/__math.h
+++ /dev/null
@@ -1,4 +0,0 @@
-
-extern char __infinity[];
-#define HUGE_VAL (*(double *) __infinity)
-
diff --git a/mit-pthreads/machdep/irix-5.2/__signal.h b/mit-pthreads/machdep/irix-5.2/__signal.h
deleted file mode 100755
index 87797da3198..00000000000
--- a/mit-pthreads/machdep/irix-5.2/__signal.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sys/signal.h>
-
-typedef int sig_atomic_t;
-
-#ifndef sigmask
-#define sigmask(n) ((unsigned int)1 << (((n) - 1) & (32 - 1)))
-#endif
-#define sigword(n) (((unsigned int)((n) - 1))>>5)
-
-#define __SIGEMPTYSET { 0, 0, 0, 0 };
-#define __SIGFILLSET { 0xffffffff,0xffffffff,0xffffffff,0xffffffff };
-#define __SIGADDSET(s, n) ((s)->sigbits[sigword(n)] |= sigmask(n))
-#define __SIGDELSET(s, n) ((s)->sigbits[sigword(n)] &= ~sigmask(n))
-#define __SIGISMEMBER(s, n) (sigmask(n) & (s)->sigbits[sigword(n)])
-
diff --git a/mit-pthreads/machdep/irix-5.2/__stdio.h b/mit-pthreads/machdep/irix-5.2/__stdio.h
deleted file mode 100755
index bb4c14b32c6..00000000000
--- a/mit-pthreads/machdep/irix-5.2/__stdio.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#if !defined(_SIZE_T) && !defined(_SIZE_T_)
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-typedef pthread_fpos_t fpos_t;
diff --git a/mit-pthreads/machdep/irix-5.2/__stdlib.h b/mit-pthreads/machdep/irix-5.2/__stdlib.h
deleted file mode 100755
index 2bec122c5f1..00000000000
--- a/mit-pthreads/machdep/irix-5.2/__stdlib.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <sgidefs.h>
-
-#if !defined(_SIZE_T) && !defined(_SIZE_T_)
-#define _SIZE_T
-#if (_MIPS_SZLONG == 32)
-typedef unsigned int size_t;
-#endif
-#if (_MIPS_SZLONG == 64)
-typedef unsigned long size_t;
-#endif
-#endif
-
-#ifndef _WCHAR_T
-#define _WCHAR_T
-#if (_MIPS_SZLONG == 32)
-typedef long wchar_t;
-#endif
-#if (_MIPS_SZLONG == 64)
-typedef __int32_t wchar_t;
-#endif
-#endif
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
diff --git a/mit-pthreads/machdep/irix-5.2/__string.h b/mit-pthreads/machdep/irix-5.2/__string.h
deleted file mode 100755
index 50261e73cfc..00000000000
--- a/mit-pthreads/machdep/irix-5.2/__string.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#if !defined(_SIZE_T) && !defined(_SIZE_T_)
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
diff --git a/mit-pthreads/machdep/irix-5.2/__time.h b/mit-pthreads/machdep/irix-5.2/__time.h
deleted file mode 100755
index 51fb993b38d..00000000000
--- a/mit-pthreads/machdep/irix-5.2/__time.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#if !defined(_SIZE_T) && !defined(_SIZE_T_)
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-#ifndef _CLOCK_T
-#define _CLOCK_T
-typedef pthread_clock_t clock_t;
-#endif
-
-#ifndef _TIME_T
-#define _TIME_T
-typedef pthread_time_t time_t;
-#endif /* !_TIME_T */
-
-#define CLOCKS_PER_SEC 1000000
-
-#ifndef CLK_TCK
-#define CLK_TCK sysconf(3) /* clock ticks per second */
- /* 3 is _SC_CLK_TCK */
-#endif
diff --git a/mit-pthreads/machdep/irix-5.2/__unistd.h b/mit-pthreads/machdep/irix-5.2/__unistd.h
deleted file mode 100755
index 0d71d631a5b..00000000000
--- a/mit-pthreads/machdep/irix-5.2/__unistd.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <sys/types.h>
-#include <sys/unistd.h>
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#define ioctl_request_type int /* For fd.c */
diff --git a/mit-pthreads/machdep/irix-5.2/compat.h b/mit-pthreads/machdep/irix-5.2/compat.h
deleted file mode 100755
index 8fd504e504f..00000000000
--- a/mit-pthreads/machdep/irix-5.2/compat.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ==== compat.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description :
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_COMPAT_H_
-#define _SYS_COMPAT_H_
-
-#define omsghdr msghdr
-
-#endif
diff --git a/mit-pthreads/machdep/irix-5.2/dirent.h b/mit-pthreads/machdep/irix-5.2/dirent.h
deleted file mode 100755
index 79fe486951d..00000000000
--- a/mit-pthreads/machdep/irix-5.2/dirent.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef _SYS_DIRENT_H
-#define _SYS_DIRENT_H
-
-#if !defined(_POSIX_SOURCE)
-#define MAXNAMLEN 255 /* maximum filename length */
-#define DIRBUF 4096 /* buffer size for fs-indep. dirs */
-#endif /* !defined(_POSIX_SOURCE) */
-
-#include <sys/types.h>
-
-struct dirent { /* data from readdir() */
- ino_t d_ino; /* inode number of entry */
- off_t d_off; /* offset of disk direntory entry */
- unsigned short d_reclen; /* length of this record */
- char d_name[MAXNAMLEN+1];/* name of file */
-};
-
-#define d_namlen d_reclen
-#define d_fileno d_ino
-
-#endif /* _SYS_DIRENT_H */
diff --git a/mit-pthreads/machdep/irix-5.2/socket.h b/mit-pthreads/machdep/irix-5.2/socket.h
deleted file mode 100755
index b08d3939802..00000000000
--- a/mit-pthreads/machdep/irix-5.2/socket.h
+++ /dev/null
@@ -1,304 +0,0 @@
-#ifndef __SYS_TPI_SOCKET_H__
-#ifndef __SYS_SOCKET_H__
-#define __SYS_SOCKET_H__
-/*
- * Copyright (c) 1982,1985, 1986 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- *
- * @(#)socket.h 7.1 (Berkeley) 6/4/86
- */
-#include <sys/cdefs.h>
-#include <sys/bsd_types.h>
-
-/*
- * Definitions related to sockets: types, address families, options.
- */
-
-/*
- * Types
- */
-#ifdef _STYPES_LATER /* old ABI */
-#define SOCK_STREAM 1 /* stream socket */
-#define SOCK_DGRAM 2 /* datagram socket */
-#define SOCK_RAW 3 /* raw-protocol interface */
-#define SOCK_RDM 4 /* reliably-delivered message */
-#define SOCK_SEQPACKET 5 /* sequenced packet stream */
-#else /* !_STYPES_LATER, new ABI */
-
-#ifndef NC_TPI_CLTS
-#define NC_TPI_CLTS 1 /* must agree with netconfig.h */
-#define NC_TPI_COTS 2 /* must agree with netconfig.h */
-#define NC_TPI_COTS_ORD 3 /* must agree with netconfig.h */
-#define NC_TPI_RAW 4 /* must agree with netconfig.h */
-#endif /* !NC_TPI_CLTS */
-
-#define SOCK_DGRAM NC_TPI_CLTS /* datagram socket */
-#define SOCK_STREAM NC_TPI_COTS /* stream socket */
-#define SOCK_RAW NC_TPI_RAW /* raw-protocol interface */
-#define SOCK_RDM 5 /* reliably-delivered message */
-#define SOCK_SEQPACKET 6 /* sequenced packet stream */
-
-#ifdef _KERNEL
-#define IRIX4_SOCK_STREAM 1 /* stream socket */
-#define IRIX4_SOCK_DGRAM 2 /* datagram socket */
-#define IRIX4_SOCK_RAW 3 /* raw-protocol interface */
-#define IRIX4_SOCK_RDM 4 /* reliably-delivered message */
-#define IRIX4_SOCK_SEQPACKET 5 /* sequenced packet stream */
-#endif /* _KERNEL */
-#endif /* _STYPES_LATER */
-
-/*
- * Option flags per-socket.
- */
-#define SO_DEBUG 0x0001 /* turn on debugging info recording */
-#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
-#define SO_REUSEADDR 0x0004 /* allow local address reuse */
-#define SO_KEEPALIVE 0x0008 /* keep connections alive */
-#define SO_DONTROUTE 0x0010 /* just use interface addresses */
-#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
-#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
-#define SO_LINGER 0x0080 /* linger on close if data present */
-#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
-#define SO_REUSEPORT 0x0200 /* allow local address,port reuse */
-#define SO_ORDREL 0x0200 /* MIPS ABI - unimplemented */
-#define SO_IMASOCKET 0x0400 /* use libsocket (not TLI) semantics */
-#define SO_CHAMELEON 0x1000 /* (cipso) set label to 1st req rcvd */
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
-#define SO_ERROR 0x1007 /* get error status and clear */
-#define SO_TYPE 0x1008 /* get socket type */
-#define SO_PROTOTYPE 0x1009 /* get protocol type (libsocket) */
-
-/*
- * Structure used for manipulating linger option.
- */
-struct linger {
- int l_onoff; /* option on/off */
- int l_linger; /* linger time */
-};
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define SOL_SOCKET 0xffff /* options for socket level */
-
-/*
- * Address families.
- * XTP really is not an address family, but is included here to take
- * up space, because other AF_ entries are numerically equal to their
- * PF_ counterparts.
- */
-#define AF_UNSPEC 0 /* unspecified */
-#define AF_UNIX 1 /* local to host (pipes, portals) */
-#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
-#define AF_IMPLINK 3 /* arpanet imp addresses */
-#define AF_PUP 4 /* pup protocols: e.g. BSP */
-#define AF_CHAOS 5 /* mit CHAOS protocols */
-#define AF_NS 6 /* XEROX NS protocols */
-#define AF_ISO 7 /* ISO protocols */
-#define AF_ECMA 8 /* european computer manufacturers */
-#define AF_DATAKIT 9 /* datakit protocols */
-#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
-#define AF_SNA 11 /* IBM SNA */
-#define AF_DECnet 12 /* DECnet */
-#define AF_DLI 13 /* DEC Direct data link interface */
-#define AF_LAT 14 /* LAT */
-#define AF_HYLINK 15 /* NSC Hyperchannel */
-#define AF_APPLETALK 16 /* Apple Talk */
-#define AF_ROUTE 17 /* Internal Routing Protocol */
-#ifdef __sgi
-#define AF_RAW 18 /* Raw link layer interface */
-#else
-#define AF_LINK 18 /* Link layer interface */
-#endif
-#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
-
-/* MIPS ABI VALUES - unimplemented */
-#define AF_NIT 17 /* Network Interface Tap */
-#define AF_802 18 /* IEEE 802.2, also ISO 8802 */
-#define AF_OSI 19 /* umbrella for all families used */
-#define AF_X25 20 /* CCITT X.25 in particular */
-#define AF_OSINET 21 /* AFI = 47, IDI = 4 */
-#define AF_GOSIP 22 /* U.S. Government OSI */
-
-
-#define AF_SDL 23 /* SGI Data Link for DLPI */
-
-#define AF_MAX (AF_SDL+1)
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
- u_short sa_family; /* address family */
- char sa_data[14]; /* up to 14 bytes of direct address */
-};
-
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
- u_short sp_family; /* address family */
- u_short sp_protocol; /* protocol */
-};
-
-/*
- * An option specification consists of an opthdr, followed by the value of
- * the option. An options buffer contains one or more options. The len
- * field of opthdr specifies the length of the option value in bytes. This
- * length must be a multiple of sizeof(long) (use OPTLEN macro).
- */
-
-struct opthdr {
- long level; /* protocol level affected */
- long name; /* option to modify */
- long len; /* length of option value */
-};
-
-#define OPTLEN(x) ((((x) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
-#define OPTVAL(opt) ((char *)(opt + 1))
-
-/*
- * the optdefault structure is used for internal tables of option default
- * values.
- */
-struct optdefault {
- int optname; /* the option */
- char *val; /* ptr to default value */
- int len; /* length of value */
-};
-
-struct tpisocket;
-struct T_optmgmt_req;
-struct msgb;
-
-/*
- * the opproc structure is used to build tables of options processing
- * functions for dooptions().
- */
-struct opproc {
- int level; /* options level this function handles */
- int (*func)(struct tpisocket *, struct T_optmgmt_req *,
- struct opthdr *, struct msgb *);
- /* the function */
-};
-
-/*
- * This structure is used to encode pseudo system calls
- */
-struct socksysreq {
- int args[7];
-};
-
-/*
- * This structure is used for adding new protocols to the list supported by
- * sockets.
- */
-
-struct socknewproto {
- int family; /* address family (AF_INET, etc.) */
- int type; /* protocol type (SOCK_STREAM, etc.) */
- int proto; /* per family proto number */
- dev_t dev; /* major/minor to use (must be a clone) */
- int flags; /* protosw flags */
-};
-
-/*
- * Protocol families, same as address families for now.
- */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_UNIX AF_UNIX
-#define PF_INET AF_INET
-#define PF_IMPLINK AF_IMPLINK
-#define PF_PUP AF_PUP
-#define PF_CHAOS AF_CHAOS
-#define PF_NS AF_NS
-#define PF_ISO AF_ISO
-#define PF_ECMA AF_ECMA
-#define PF_DATAKIT AF_DATAKIT
-#define PF_CCITT AF_CCITT
-#define PF_SNA AF_SNA
-#define PF_DECnet AF_DECnet
-#define PF_DLI AF_DLI
-#define PF_LAT AF_LAT
-#define PF_HYLINK AF_HYLINK
-#define PF_APPLETALK AF_APPLETALK
-#define PF_ROUTE AF_ROUTE
-#define PF_LINK AF_LINK
-#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
-#ifdef __sgi
-#define PF_RAW AF_RAW
-#endif
-
-/* MIPS ABI VALUES - unimplemented */
-#define PF_NIT AF_NIT /* Network Interface Tap */
-#define PF_802 AF_802 /* IEEE 802.2, also ISO 8802 */
-#define PF_OSI AF_OSI /* umbrella for all families used */
-#define PF_X25 AF_X25 /* CCITT X.25 in particular */
-#define PF_OSINET AF_OSINET /* AFI = 47, IDI = 4 */
-#define PF_GOSIP AF_GOSIP /* U.S. Government OSI */
-
-#define PF_MAX AF_MAX
-
-/*
- * Maximum queue length specifiable by listen.
- */
-#define SOMAXCONN 5
-
-/*
- * Message header for recvmsg and sendmsg calls.
- */
-struct msghdr {
- caddr_t msg_name; /* optional address */
- int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_accrights; /* access rights sent/received */
- int msg_accrightslen;
-};
-
-#define MSG_OOB 0x1 /* process out-of-band data */
-#define MSG_PEEK 0x2 /* peek at incoming message */
-#define MSG_DONTROUTE 0x4 /* send without using routing tables */
-#define MSG_EOR 0x8 /* data completes record (OSI only) */
-#ifdef XTP
-#define MSG_BTAG 0x40 /* XTP packet with BTAG field */
-#define MSG_ETAG 0x80 /* XTP packet with ETAG field */
-#endif
-
-#define MSG_MAXIOVLEN 16
-
-__BEGIN_DECLS
-int accept __P_((int, struct sockaddr *, int *));
-int bind __P_((int, const struct sockaddr *, int));
-int connect __P_((int, const struct sockaddr *, int));
-int getpeername __P_((int, struct sockaddr *, int *));
-int getsockname __P_((int, struct sockaddr *, int *));
-int getsockopt __P_((int, int, int, void *, int *));
-int listen __P_((int, int));
-ssize_t recv __P_((int, void *, size_t, int));
-ssize_t recvfrom __P_((int, void *, size_t, int, struct sockaddr *, int *));
-int recvmsg __P_((int, struct msghdr *, int));
-ssize_t send __P_((int, const void *, size_t, int));
-ssize_t sendto __P_((int, const void *, size_t, int,
- const struct sockaddr *, int));
-int sendmsg __P_((int, const struct msghdr *, int));
-int setsockopt __P_((int, int, int, const void *, int));
-int shutdown __P_((int, int));
-int socket __P_((int, int, int));
-int socketpair __P_((int, int, int, int *));
-__END_DECLS
-
-#endif /* !__SYS_SOCKET_H__ */
-#endif /* !__SYS_TPI_SOCKET_H__ */
diff --git a/mit-pthreads/machdep/irix-5.2/timers.h b/mit-pthreads/machdep/irix-5.2/timers.h
deleted file mode 100755
index ffa24dc9a15..00000000000
--- a/mit-pthreads/machdep/irix-5.2/timers.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef __SYS_TIMERS_H__
-#define __SYS_TIMERS_H__
-
-struct timespec {
- time_t tv_sec;
- long tv_nsec;
-};
-
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
-
-#endif /* !__SYS_TIMERS_H__ */
diff --git a/mit-pthreads/machdep/irix-5.2/wait.h b/mit-pthreads/machdep/irix-5.2/wait.h
deleted file mode 100755
index c0a7e7113d8..00000000000
--- a/mit-pthreads/machdep/irix-5.2/wait.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 1982, 1986 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- *
- * @(#)wait.h 7.4 (Berkeley) 1/27/88
- */
-#ifndef __SYS_WAIT_H__
-#define __SYS_WAIT_H__
-
-#ifdef _POSIX_SOURCE
-#define _W_INT(i) (i)
-#else
-#define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */
-#define WCOREFLAG 0200
-#endif
-
-#define WSTOPFLG 0177
-#define WIFSTOPPED(stat) ((_W_INT(stat)&0377)==_WSTOPPED&&((_W_INT(stat)>>8)&0377)!=0)
-#define WSTOPSIG(stat) ((_W_INT(stat)>>8)&0377)
-#define WIFSIGNALED(stat) ((_W_INT(stat)&0377)>0&&((_W_INT(stat)>>8)&0377)==0)
-#define WTERMSIG(stat) (_W_INT(stat)&0177)
-#define WIFEXITED(stat) ((_W_INT(stat)&0377)==0)
-#define WEXITSTATUS(stat) ((_W_INT(stat)>>8)&0377)
-#define WCOREDUMP(stat) (_W_INT(stat) & WCOREFLAG)
-
-/*
- * Option bits for the second argument of wait3. WNOHANG causes the
- * wait to not hang if there are no stopped or terminated processes, rather
- * returning an error indication in this case (pid==0). WUNTRACED
- * indicates that the caller should receive status about untraced children
- * which stop due to signals. If children are stopped and a wait without
- * this option is done, it is as though they were still running... nothing
- * about them is returned.
- */
-#define WNOHANG 0100
-#define WUNTRACED 0004 /* for POSIX */
-
-#if !defined(_POSIX_SOURCE)
-
-/*
- * Structure of the information in the first word returned by both
- * wait and wait3. If w_stopval==_WSTOPPED, then the second structure
- * describes the information returned, else the first. See WUNTRACED below.
- */
-typedef union wait {
- int w_status; /* used in syscall */
- /*
- * Terminated process status.
- */
- struct {
-#ifdef _MIPSEL
- unsigned int w_Termsig:7, /* termination signal */
- w_Coredump:1, /* core dump indicator */
- w_Retcode:8, /* exit code if w_termsig==0 */
- w_Filler:16; /* upper bits filler */
-#endif
-#ifdef _MIPSEB
- unsigned int w_Filler:16, /* upper bits filler */
- w_Retcode:8, /* exit code if w_termsig==0 */
- w_Coredump:1, /* core dump indicator */
- w_Termsig:7; /* termination signal */
-#endif
- } w_T;
- /*
- * Stopped process status. Returned
- * only for traced children unless requested
- * with the WUNTRACED option bit.
- */
- struct {
-#ifdef _MIPSEL
- unsigned int w_Stopval:8, /* == W_STOPPED if stopped */
- w_Stopsig:8, /* signal that stopped us */
- w_Filler:16; /* upper bits filler */
-#endif
-#ifdef _MIPSEB
- unsigned int w_Filler:16, /* upper bits filler */
- w_Stopsig:8, /* signal that stopped us */
- w_Stopval:8; /* == W_STOPPED if stopped */
-#endif
- } w_S;
-} wait_t;
-#define w_termsig w_T.w_Termsig
-#define w_coredump w_T.w_Coredump
-#define w_retcode w_T.w_Retcode
-#define w_stopval w_S.w_Stopval
-#define w_stopsig w_S.w_Stopsig
-
-
-
-#define WSTOPPED 0004 /* wait for processes stopped by signals */
-#endif /* !defined(_POSIX_SOURCE) */
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-__BEGIN_DECLS
-pid_t wait __P_((int *));
-pid_t waitpid __P_((pid_t, int *, int));
-#ifndef _POSIX_SOURCE
-pid_t wait3 __P_((int *, int, void *));
-pid_t wait4 __P_((pid_t, int *, int, void *));
-#endif
-
-#endif /* __SYS_WAIT_H__ */
diff --git a/mit-pthreads/machdep/linux-1.0/__math.h b/mit-pthreads/machdep/linux-1.0/__math.h
deleted file mode 100755
index 05c65d58321..00000000000
--- a/mit-pthreads/machdep/linux-1.0/__math.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef HUGE_VAL
-#define HUGE_VAL DBL_MAX
-#endif
-
diff --git a/mit-pthreads/machdep/linux-1.0/__path.h b/mit-pthreads/machdep/linux-1.0/__path.h
deleted file mode 100755
index 9caeb7d3016..00000000000
--- a/mit-pthreads/machdep/linux-1.0/__path.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * $Id$
- */
-
-#ifndef _SYS__PATH_H_
-#define _SYS__PATH_H_
-
-#define _PATH_PTY "/dev/"
-#define _PATH_TZDIR "/usr/lib/zoneinfo"
-#define _PATH_TZFILE "/usr/lib/zoneinfo/localtime"
-
-#endif /* !_SYS__PATH_H_ */
-
diff --git a/mit-pthreads/machdep/linux-1.0/__signal.h b/mit-pthreads/machdep/linux-1.0/__signal.h
deleted file mode 100755
index 4cd671f155c..00000000000
--- a/mit-pthreads/machdep/linux-1.0/__signal.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <features.h>
-#include <linux/signal.h>
-
-#ifndef SIGCLD
-#define SIGCLD SIGCHLD
-#endif
-
-typedef int sig_atomic_t;
-
-typedef __sighandler_t SignalHandler;
-
-#define SignalBad ((SignalHandler)-1)
-#define SignalDefault ((SignalHandler)0)
-#define SignalIgnore ((SignalHandler)1)
-
-#define __sigmask(sig) (1 << ((sig) - 1))
-#define sigmask __sigmask
-
-#define __SIGFILLSET 0xffffffff
-#define __SIGEMPTYSET 0
-#define __SIGADDSET(s,n) ((*s) |= (__sigmask(n)))
-#define __SIGDELSET(s,n) ((*s) &= ~(__sigmask(n)))
-#define __SIGISMEMBER(s,n) ((*s) & (__sigmask(n)))
-
diff --git a/mit-pthreads/machdep/linux-1.0/__stdio.h b/mit-pthreads/machdep/linux-1.0/__stdio.h
deleted file mode 100755
index eb7e904c34d..00000000000
--- a/mit-pthreads/machdep/linux-1.0/__stdio.h
+++ /dev/null
@@ -1,7 +0,0 @@
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-typedef pthread_fpos_t fpos_t;
diff --git a/mit-pthreads/machdep/linux-1.0/__stdlib.h b/mit-pthreads/machdep/linux-1.0/__stdlib.h
deleted file mode 100755
index eaa0bb988ee..00000000000
--- a/mit-pthreads/machdep/linux-1.0/__stdlib.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-#ifndef _SYS___STDLIB_H_
-#define _SYS___STDLIB_H_
-
-#include <features.h>
-
-/* Get size_t, wchar_t and NULL from <stddef.h>. */
-#define __need_size_t
-#define __need_wchar_t
-#define __need_NULL
-#include <stddef.h>
-
-#define __need_Emath
-#include <errno.h>
-
-/* Get HUGE_VAL (returned by strtod on overflow) from <float.h>. */
-#define __need_HUGE_VAL
-#include <float.h>
-
-#endif
diff --git a/mit-pthreads/machdep/linux-1.0/__string.h b/mit-pthreads/machdep/linux-1.0/__string.h
deleted file mode 100755
index 8a5e09608e0..00000000000
--- a/mit-pthreads/machdep/linux-1.0/__string.h
+++ /dev/null
@@ -1,18 +0,0 @@
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-/* Non-standard Linux string routines. */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-__BEGIN_DECLS
-int bcmp __P_((const void *, const void *, size_t));
-void bcopy __P_((const void *, void *, size_t));
-void bzero __P_((void *, size_t));
-char *index __P_((const char *, int));
-char *rindex __P_((const char *, int));
-char *strdup __P_((const char *));
-char *strsep __P_((char **, const char *));
-__END_DECLS
-#endif
diff --git a/mit-pthreads/machdep/linux-1.0/__time.h b/mit-pthreads/machdep/linux-1.0/__time.h
deleted file mode 100755
index a088268286e..00000000000
--- a/mit-pthreads/machdep/linux-1.0/__time.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ==== __time.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : System specific time header.
- *
- * 1.00 94/11/07 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS___TIME_H_
-#define _SYS___TIME_H_
-
-#include <features.h>
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned int size_t;
-#endif
-#ifndef _CLOCK_T
-#define _CLOCK_T
-typedef long clock_t;
-#endif
-#ifndef _TIME_T
-#define _TIME_T
-typedef long time_t;
-
-#ifndef NULL
-#ifdef __cplusplus
-#define NULL 0
-#else
-#define NULL ((void *) 0)
-#endif
-#endif
-#endif
-
-#define CLOCKS_PER_SEC 100
-#define CLK_TCK 100
-
-extern long int timezone;
-extern int daylight;
-
-#endif
diff --git a/mit-pthreads/machdep/linux-1.0/__unistd.h b/mit-pthreads/machdep/linux-1.0/__unistd.h
deleted file mode 100755
index 0f15b7c4883..00000000000
--- a/mit-pthreads/machdep/linux-1.0/__unistd.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * $Id$
- */
-
-#ifndef _SYS___UNISTD_H_
-#define _SYS___UNISTD_H_
-
-#include <features.h>
-
-/* POSIX Standard approved as IEEE Std 1003.1 as of August, 1988. */
-#define _POSIX_VERSION 199009L
-#define _POSIX2_C_BIND 1
-#define _POSIX2_C_DEV 1
-#define _POSIX2_SW_DEV 1
-
-#define __need_size_t
-#define ioctl_request_type int /* For fd.c */
-
-#include <posix_opt.h>
-#include <sys/types.h>
-#include <stddef.h>
-
-#endif
-
diff --git a/mit-pthreads/machdep/linux-1.0/cdefs.h b/mit-pthreads/machdep/linux-1.0/cdefs.h
deleted file mode 100755
index f9d5668cfe6..00000000000
--- a/mit-pthreads/machdep/linux-1.0/cdefs.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* This is intended to eventually find /usr/include/sys/cdefs.h
- * if it's inside the ifdef then it won't work if this file is
- * found in the include files path more than once.
- *
- * include_next is a GNU C extension, we might eventually want
- * to have our own cdefs in here simply to avoid GNU C dependencies
- * (though there are already enough in the asm stuff anyways)
- * [gsstark:19950419.0307EST]
- */
-#include_next <sys/cdefs.h>
-
-#ifndef _PTHREAD_SYS_CDEFS_H_
-#define _PTHREAD_SYS_CDEFS_H_
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif /* __NORETURN not defined. */
-
-#if !defined(__cplusplus)
-#define __CAN_DO_EXTERN_INLINE
-#endif
-
-#endif /* _PTHREAD_SYS_CDEFS_H_ */
diff --git a/mit-pthreads/machdep/linux-1.0/compat.h b/mit-pthreads/machdep/linux-1.0/compat.h
deleted file mode 100755
index 6edb992ac3d..00000000000
--- a/mit-pthreads/machdep/linux-1.0/compat.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ==== compat.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_COMPAT_H_
-#define _SYS_COMPAT_H_
-
-#include <sys/types.h>
-
-#define omsghdr msghdr
-
-#endif
diff --git a/mit-pthreads/machdep/linux-1.0/dirent.h b/mit-pthreads/machdep/linux-1.0/dirent.h
deleted file mode 100755
index 7f783a198e0..00000000000
--- a/mit-pthreads/machdep/linux-1.0/dirent.h
+++ /dev/null
@@ -1,27 +0,0 @@
-
-#ifndef _SYS_DIRENT_H
-#define _SYS_DIRENT_H
-
-#include <sys/types.h>
-#include <linux/limits.h>
-
-struct dirent {
- long d_ino;
- off_t d_off;
- unsigned short d_reclen;
- char d_name[NAME_MAX+1];
-};
-
-#ifndef d_fileno
-#define d_fileno d_ino
-#endif
-
-#ifndef d_namlen
-#define d_namlen d_reclen
-#endif
-
-#ifndef MAXNAMLEN
-#define MAXNAMLEN NAME_MAX
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/linux-1.0/errno.h b/mit-pthreads/machdep/linux-1.0/errno.h
deleted file mode 100755
index a94a56b0437..00000000000
--- a/mit-pthreads/machdep/linux-1.0/errno.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* ==== errno.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Errno is already broken up into data/prototyes.
- */
-
-#ifndef _SYS_ERRNO_H_
-#define _SYS_ERRNO_H_
-
-#include <linux/errno.h>
-
-#endif
diff --git a/mit-pthreads/machdep/linux-1.0/socket.h b/mit-pthreads/machdep/linux-1.0/socket.h
deleted file mode 100755
index cc4c0fd262e..00000000000
--- a/mit-pthreads/machdep/linux-1.0/socket.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/* ==== socket.h.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Correct Linux header file.
- */
-
-#ifndef _PTHREAD_SOCKET_H_
-#define _PTHREAD_SOCKET_H_
-
-/* #include <linux/socket.h> */
-#ifndef _LINUX_SOCKET_H
-#define _LINUX_SOCKET_H
-
-/* IP options */
-#define IP_TOS 1
-#define IPTOS_LOWDELAY 0x10
-#define IPTOS_THROUGHPUT 0x08
-#define IPTOS_RELIABILITY 0x04
-#define IP_TTL 2
-#ifndef IP_HDRINCL
-#define IP_HDRINCL 3
-#endif
-#ifdef V1_3_WILL_DO_THIS_FUNKY_STUFF
-#define IP_OPTIONS 4
-#endif
-
-#endif
-
-/* #include <asm/socket.h> arch-dependent defines */
-#include <linux/sockios.h> /* the SIOCxxx I/O controls */
-#include <pthread/posix.h>
-
-struct sockaddr {
- unsigned short sa_family; /* address family, AF_xxx */
- char sa_data[14]; /* 14 bytes of protocol address */
-};
-
-struct linger {
- int l_onoff; /* Linger active */
- int l_linger; /* How long to linger for */
-};
-
-struct msghdr
-{
- void * msg_name; /* Socket name */
- int msg_namelen; /* Length of name */
- struct iovec * msg_iov; /* Data blocks */
- int msg_iovlen; /* Number of blocks */
- void * msg_accrights; /* Per protocol magic (eg BSD file descriptor passing) */
- int msg_accrightslen;/* Length of rights list */
-};
-
-/* Socket types. */
-#define SOCK_STREAM 1 /* stream (connection) socket */
-#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
-#define SOCK_RAW 3 /* raw socket */
-#define SOCK_RDM 4 /* reliably-delivered message */
-#define SOCK_SEQPACKET 5 /* sequential packet socket */
-#define SOCK_PACKET 10 /* linux specific way of */
- /* getting packets at the dev */
- /* level. For writing rarp and */
- /* other similar things on the */
- /* user level. */
-
-/* Supported address families. */
-#define AF_UNSPEC 0
-#define AF_UNIX 1 /* Unix domain sockets */
-#define AF_INET 2 /* Internet IP Protocol */
-#define AF_AX25 3 /* Amateur Radio AX.25 */
-#define AF_IPX 4 /* Novell IPX */
-#define AF_APPLETALK 5 /* Appletalk DDP */
-#define AF_NETROM 6 /* Amateur radio NetROM */
-#define AF_BRIDGE 7 /* Multiprotocol bridge */
-#define AF_AAL5 8 /* Reserved for Werner's ATM */
-#define AF_X25 9 /* Reserved for X.25 project */
-#define AF_INET6 10 /* IP version 6 */
-#define AF_MAX 12 /* For now.. */
-
-/* Protocol families, same as address families. */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_UNIX AF_UNIX
-#define PF_INET AF_INET
-#define PF_AX25 AF_AX25
-#define PF_IPX AF_IPX
-#define PF_APPLETALK AF_APPLETALK
-#define PF_NETROM AF_NETROM
-#define PF_BRIDGE AF_BRIDGE
-#define PF_AAL5 AF_AAL5
-#define PF_X25 AF_X25
-#define PF_INET6 AF_INET6
-
-#define PF_MAX AF_MAX
-
-/* Maximum queue length specificable by listen. */
-#define SOMAXCONN 128
-
-/* Flags we can use with send/ and recv. */
-#define MSG_OOB 1
-#define MSG_PEEK 2
-#define MSG_DONTROUTE 4
-
-/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
-#define SOL_SOCKET 1
-#define SOL_IP 0
-#define SOL_IPX 256
-#define SOL_AX25 257
-#define SOL_ATALK 258
-#define SOL_NETROM 259
-#define SOL_TCP 6
-#define SOL_UDP 17
-
-/* For setsockoptions(2) */
-#define SO_DEBUG 1
-#define SO_REUSEADDR 2
-#define SO_TYPE 3
-#define SO_ERROR 4
-#define SO_DONTROUTE 5
-#define SO_BROADCAST 6
-#define SO_SNDBUF 7
-#define SO_RCVBUF 8
-#define SO_KEEPALIVE 9
-#define SO_OOBINLINE 10
-#define SO_NO_CHECK 11
-#define SO_PRIORITY 12
-#define SO_LINGER 13
-/* To add :#define SO_REUSEPORT 14 */
-
-
-#define IP_MULTICAST_IF 32
-#define IP_MULTICAST_TTL 33
-#define IP_MULTICAST_LOOP 34
-#define IP_ADD_MEMBERSHIP 35
-#define IP_DROP_MEMBERSHIP 36
-
-
-/* These need to appear somewhere around here */
-#define IP_DEFAULT_MULTICAST_TTL 1
-#define IP_DEFAULT_MULTICAST_LOOP 1
-#define IP_MAX_MEMBERSHIPS 20
-
-/* IPX options */
-#define IPX_TYPE 1
-
-/* TCP options - this way around because someone left a set in the c library includes */
-#define TCP_NODELAY 1
-#define TCP_MAXSEG 2
-
-/* The various priorities. */
-#define SOPRI_INTERACTIVE 0
-#define SOPRI_NORMAL 1
-#define SOPRI_BACKGROUND 2
-
-/*
- * Functions
- */
-
-__BEGIN_DECLS
-
-int accept __P_((int, struct sockaddr *, int *));
-int bind __P_((int, const struct sockaddr *, int));
-int connect __P_((int, const struct sockaddr *, int));
-int listen __P_((int, int));
-int socket __P_((int, int, int));
-
-int getsockopt __P_((int __s, int __level, int __optname,
- void *__optval, int *__optlen));
-int setsockopt __P_((int __s, int __level, int __optname,
- __const void *__optval, int optlen));
-int getsockname __P_((int __sockfd, struct sockaddr *__addr,
- int *__paddrlen));
-int getpeername __P_((int __sockfd, struct sockaddr *__peer,
- int *__paddrlen));
-ssize_t send __P_((int __sockfd, __const void *__buff, size_t __len, int __flags));
-ssize_t recv __P_((int __sockfd, void *__buff, size_t __len, int __flags));
-ssize_t sendto __P_((int __sockfd, __const void *__buff, size_t __len,
- int __flags, __const struct sockaddr *__to,
- int __tolen));
-ssize_t recvfrom __P_((int __sockfd, void *__buff, size_t __len,
- int __flags, struct sockaddr *__from,
- int *__fromlen));
-extern ssize_t sendmsg __P_((int __fd, __const struct msghdr *__message,
- int __flags));
-extern ssize_t recvmsg __P_((int __fd, struct msghdr *__message,
- int __flags));
-int shutdown __P_((int __sockfd, int __how));
-
-__END_DECLS
-
-#endif
-
-
-
-
diff --git a/mit-pthreads/machdep/linux-1.0/timers.h b/mit-pthreads/machdep/linux-1.0/timers.h
deleted file mode 100755
index 110cb27378c..00000000000
--- a/mit-pthreads/machdep/linux-1.0/timers.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <pthread/config.h>
-#include <sys/types.h>
-#include <time.h>
-
-#ifndef _OS_HAS_TIMESPEC
-struct timespec {
- time_t tv_sec;
- long tv_nsec;
-};
-#endif
-
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/machdep/linux-1.0/uio.h b/mit-pthreads/machdep/linux-1.0/uio.h
deleted file mode 100755
index 67af5bf76e0..00000000000
--- a/mit-pthreads/machdep/linux-1.0/uio.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* ==== uio.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Correct Linux header file.
- */
-
-#ifndef _PTHREAD_UIO_H_
-#define _PTHREAD_UIO_H_
-
-struct iovec {
- void *iov_base;
- size_t iov_len;
-};
-
-#endif
diff --git a/mit-pthreads/machdep/linux-1.0/wait.h b/mit-pthreads/machdep/linux-1.0/wait.h
deleted file mode 100755
index bcc28c5ef58..00000000000
--- a/mit-pthreads/machdep/linux-1.0/wait.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* $NetBSD: wait.h,v 1.7 1994/06/29 06:46:23 cgd Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)wait.h 8.1 (Berkeley) 6/2/93
- */
-
-/*
- * This file holds definitions relevent to the wait4 system call
- * and the alternate interfaces that use it (wait, wait3, waitpid).
- */
-
-/*
- * Macros to test the exit status returned by wait and extract the
- * relevant values. Union wait is no supported with pthreads.
- */
-#define __W_INT(i) (i)
-#define __WSTATUS(x) (__W_INT(x) & 0177)
-#define __WSTOPPED 0177 /* __WSTATUS if process is stopped */
-#define WIFSTOPPED(x) (__WSTATUS(x) == __WSTOPPED)
-#define WSTOPSIG(x) (__W_INT(x) >> 8)
-#define WIFSIGNALED(x) (__WSTATUS(x) != __WSTOPPED && __WSTATUS(x) != 0)
-#define WTERMSIG(x) (__WSTATUS(x))
-#define WIFEXITED(x) (__WSTATUS(x) == 0)
-#define WEXITSTATUS(x) (__W_INT(x) >> 8)
-
-#ifndef _POSIX_SOURCE
-#define WCOREDUMP(x) (__W_INT(x) & WCOREFLAG)
-#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
-#define W_STOPCODE(sig) ((sig) << 8 | __WSTOPPED)
-#endif
-
-/*
- * Option bits for the third argument of wait4. WNOHANG causes the
- * wait to not hang if there are no stopped or terminated processes, rather
- * returning an error indication in this case (pid==0). WUNTRACED
- * indicates that the caller should receive status about untraced children
- * which stop due to signals. If children are stopped and a wait without
- * this option is done, it is as though they were still running... nothing
- * about them is returned.
- */
-#define WNOHANG 1 /* dont hang in wait */
-#define WUNTRACED 2 /* tell about stopped, untraced children */
-
-#ifndef _POSIX_SOURCE
-
-/* Tokens for special values of the "pid" parameter to wait4. */
-#define WAIT_ANY (-1) /* any process */
-#define WAIT_MYPGRP 0 /* any process in my process group */
-
-#define WSTOPPED __WSTOPPED
-#endif /* _POSIX_SOURCE */
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-__BEGIN_DECLS
-pid_t wait __P_((int *));
-pid_t waitpid __P_((pid_t, int *, int));
-#ifndef _POSIX_SOURCE
-pid_t wait3 __P_((int *, int, void *));
-pid_t wait4 __P_((pid_t, int *, int, void *));
-#endif
-__END_DECLS
diff --git a/mit-pthreads/machdep/linux-2.0/__math.h b/mit-pthreads/machdep/linux-2.0/__math.h
deleted file mode 100755
index 05c65d58321..00000000000
--- a/mit-pthreads/machdep/linux-2.0/__math.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef HUGE_VAL
-#define HUGE_VAL DBL_MAX
-#endif
-
diff --git a/mit-pthreads/machdep/linux-2.0/__path.h b/mit-pthreads/machdep/linux-2.0/__path.h
deleted file mode 100755
index 9caeb7d3016..00000000000
--- a/mit-pthreads/machdep/linux-2.0/__path.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * $Id$
- */
-
-#ifndef _SYS__PATH_H_
-#define _SYS__PATH_H_
-
-#define _PATH_PTY "/dev/"
-#define _PATH_TZDIR "/usr/lib/zoneinfo"
-#define _PATH_TZFILE "/usr/lib/zoneinfo/localtime"
-
-#endif /* !_SYS__PATH_H_ */
-
diff --git a/mit-pthreads/machdep/linux-2.0/__signal.h b/mit-pthreads/machdep/linux-2.0/__signal.h
deleted file mode 100755
index 81136b8c14d..00000000000
--- a/mit-pthreads/machdep/linux-2.0/__signal.h
+++ /dev/null
@@ -1,86 +0,0 @@
-#include <features.h>
-
-#define SIGHUP 1
-#define SIGINT 2
-#define SIGQUIT 3
-#define SIGILL 4
-#define SIGTRAP 5
-#define SIGABRT 6
-#define SIGIOT 6
-#define SIGBUS 7
-#define SIGFPE 8
-#define SIGKILL 9
-#define SIGUSR1 10
-#define SIGSEGV 11
-#define SIGUSR2 12
-#define SIGPIPE 13
-#define SIGALRM 14
-#define SIGTERM 15
-#define SIGSTKFLT 16
-#define SIGCHLD 17
-#define SIGCONT 18
-#define SIGSTOP 19
-#define SIGTSTP 20
-#define SIGTTIN 21
-#define SIGTTOU 22
-#define SIGURG 23
-#define SIGXCPU 24
-#define SIGXFSZ 25
-#define SIGVTALRM 26
-#define SIGPROF 27
-#define SIGWINCH 28
-#define SIGIO 29
-#define SIGPOLL SIGIO
-/*
-#define SIGLOST 29
-*/
-#define SIGPWR 30
-#define SIGSYS 31
-#define SIGUNUSED 31
-
-#define _NSIG 64 /* Biggest signal number + 1
- (including real-time signals). */
-# define NSIG _NSIG
-
-/* These should not be considered constants from userland. */
-#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
-
-#ifndef SIGCLD
-#define SIGCLD SIGCHLD
-#endif
-
-
-/* Type of a signal handler. */
-typedef void (*__sighandler_t)(int);
-
-#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
-#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
-#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
-
-typedef int sig_atomic_t;
-
-#define SignalBad ((SignalHandler)-1)
-#define SignalDefault ((SignalHandler)0)
-#define SignalIgnore ((SignalHandler)1)
-
-#include "bits/sigset.h"
-
-#define __SIGFILLSET {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
-#define __SIGEMPTYSET { 0,0,0,0,0,0,0,0 }
-#define __SIGADDSET(s,n) __sigaddset((s),(n))
-#define __SIGDELSET(s,n) __sigdelset((s),(n))
-#define __SIGISMEMBER(s,n) __sigismember((s),(n))
-
-
-struct sigaction {
- __sighandler_t sa_handler;
- unsigned long sa_flags;
- void (*sa_restorer)(void);
- sigset_t sa_mask; /* mask last for extensibility */
-};
-
-/* Values for the HOW argument to `sigprocmask'. */
-#define SIG_BLOCK 0 /* Block signals. */
-#define SIG_UNBLOCK 1 /* Unblock signals. */
-#define SIG_SETMASK 2 /* Set the set of blocked signals. */
diff --git a/mit-pthreads/machdep/linux-2.0/__stdio.h b/mit-pthreads/machdep/linux-2.0/__stdio.h
deleted file mode 100755
index 38deb337038..00000000000
--- a/mit-pthreads/machdep/linux-2.0/__stdio.h
+++ /dev/null
@@ -1,12 +0,0 @@
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-/* Hack for configuration with libgcc 2.2 */
-#ifndef pthread_fpos_t
-#define pthread_fpos_t long
-#endif
-
-typedef pthread_fpos_t fpos_t;
diff --git a/mit-pthreads/machdep/linux-2.0/__stdlib.h b/mit-pthreads/machdep/linux-2.0/__stdlib.h
deleted file mode 100755
index eaa0bb988ee..00000000000
--- a/mit-pthreads/machdep/linux-2.0/__stdlib.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-#ifndef _SYS___STDLIB_H_
-#define _SYS___STDLIB_H_
-
-#include <features.h>
-
-/* Get size_t, wchar_t and NULL from <stddef.h>. */
-#define __need_size_t
-#define __need_wchar_t
-#define __need_NULL
-#include <stddef.h>
-
-#define __need_Emath
-#include <errno.h>
-
-/* Get HUGE_VAL (returned by strtod on overflow) from <float.h>. */
-#define __need_HUGE_VAL
-#include <float.h>
-
-#endif
diff --git a/mit-pthreads/machdep/linux-2.0/__string.h b/mit-pthreads/machdep/linux-2.0/__string.h
deleted file mode 100755
index 8a5e09608e0..00000000000
--- a/mit-pthreads/machdep/linux-2.0/__string.h
+++ /dev/null
@@ -1,18 +0,0 @@
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-/* Non-standard Linux string routines. */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-__BEGIN_DECLS
-int bcmp __P_((const void *, const void *, size_t));
-void bcopy __P_((const void *, void *, size_t));
-void bzero __P_((void *, size_t));
-char *index __P_((const char *, int));
-char *rindex __P_((const char *, int));
-char *strdup __P_((const char *));
-char *strsep __P_((char **, const char *));
-__END_DECLS
-#endif
diff --git a/mit-pthreads/machdep/linux-2.0/__time.h b/mit-pthreads/machdep/linux-2.0/__time.h
deleted file mode 100755
index b86c153543a..00000000000
--- a/mit-pthreads/machdep/linux-2.0/__time.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* ==== __time.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : System specific time header.
- *
- * 1.00 94/11/07 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS___TIME_H_
-#define _SYS___TIME_H_
-
-#include <features.h>
-
-struct timespec
- {
- long int tv_sec; /* Seconds. */
- long int tv_nsec; /* Nanoseconds. */
- };
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned int size_t;
-#endif
-#ifndef _CLOCK_T
-#define _CLOCK_T
-typedef long clock_t;
-#endif
-#ifndef _TIME_T
-#define _TIME_T
-typedef long time_t;
-
-#ifndef NULL
-#ifdef __cplusplus
-#define NULL 0
-#else
-#define NULL ((void *) 0)
-#endif
-#endif
-#endif
-
-#define CLOCKS_PER_SEC 100
-#define CLK_TCK 100
-
-extern long int timezone;
-extern int daylight;
-
-#endif
diff --git a/mit-pthreads/machdep/linux-2.0/__unistd.h b/mit-pthreads/machdep/linux-2.0/__unistd.h
deleted file mode 100755
index 444f070659a..00000000000
--- a/mit-pthreads/machdep/linux-2.0/__unistd.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * $Id$
- */
-
-#ifndef _SYS___UNISTD_H_
-#define _SYS___UNISTD_H_
-
-#include <features.h>
-
-/* POSIX Standard approved as IEEE Std 1003.1 as of August, 1988. */
-#define _POSIX_VERSION 199009L
-#define _POSIX2_C_BIND 1
-#define _POSIX2_C_DEV 1
-#define _POSIX2_SW_DEV 1
-
-#define __need_size_t
-
-#include <sys/types.h>
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-int chroot(const char *);
-int gethostname(char *, int);
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/mit-pthreads/machdep/linux-2.0/cdefs.h b/mit-pthreads/machdep/linux-2.0/cdefs.h
deleted file mode 100755
index 04f93a138c9..00000000000
--- a/mit-pthreads/machdep/linux-2.0/cdefs.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* This is intended to eventually find /usr/include/sys/cdefs.h
- * if it's inside the ifdef then it won't work if this file is
- * found in the include files path more than once.
- *
- * include_next is a GNU C extension, we might eventually want
- * to have our own cdefs in here simply to avoid GNU C dependencies
- * (though there are already enough in the asm stuff anyways)
- * [gsstark:19950419.0307EST]
- */
-
-/* We are almost always included from features.h. */
-
-#ifndef _FEATURES_H
-#include <features.h>
-#endif
-
-#ifndef __BITS_SOCKET_H
-#define __BITS_SOCKET_H
-#endif
-
-#define __need_timespec
-
-#include_next <sys/cdefs.h>
-
-#ifndef _PTHREAD_SYS_CDEFS_H_
-#define _PTHREAD_SYS_CDEFS_H_
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif /* __NORETURN not defined. */
-
-#if !defined(__cplusplus)
-#define __CAN_DO_EXTERN_INLINE
-#endif
-
-#endif /* _PTHREAD_SYS_CDEFS_H_ */
diff --git a/mit-pthreads/machdep/linux-2.0/compat.h b/mit-pthreads/machdep/linux-2.0/compat.h
deleted file mode 100755
index 6edb992ac3d..00000000000
--- a/mit-pthreads/machdep/linux-2.0/compat.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ==== compat.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_COMPAT_H_
-#define _SYS_COMPAT_H_
-
-#include <sys/types.h>
-
-#define omsghdr msghdr
-
-#endif
diff --git a/mit-pthreads/machdep/linux-2.0/dirent.h b/mit-pthreads/machdep/linux-2.0/dirent.h
deleted file mode 100755
index 7f783a198e0..00000000000
--- a/mit-pthreads/machdep/linux-2.0/dirent.h
+++ /dev/null
@@ -1,27 +0,0 @@
-
-#ifndef _SYS_DIRENT_H
-#define _SYS_DIRENT_H
-
-#include <sys/types.h>
-#include <linux/limits.h>
-
-struct dirent {
- long d_ino;
- off_t d_off;
- unsigned short d_reclen;
- char d_name[NAME_MAX+1];
-};
-
-#ifndef d_fileno
-#define d_fileno d_ino
-#endif
-
-#ifndef d_namlen
-#define d_namlen d_reclen
-#endif
-
-#ifndef MAXNAMLEN
-#define MAXNAMLEN NAME_MAX
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/linux-2.0/errno.h b/mit-pthreads/machdep/linux-2.0/errno.h
deleted file mode 100755
index a94a56b0437..00000000000
--- a/mit-pthreads/machdep/linux-2.0/errno.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* ==== errno.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Errno is already broken up into data/prototyes.
- */
-
-#ifndef _SYS_ERRNO_H_
-#define _SYS_ERRNO_H_
-
-#include <linux/errno.h>
-
-#endif
diff --git a/mit-pthreads/machdep/linux-2.0/extra/bits/local_lim.h b/mit-pthreads/machdep/linux-2.0/extra/bits/local_lim.h
deleted file mode 100644
index 1a319ccdfd4..00000000000
--- a/mit-pthreads/machdep/linux-2.0/extra/bits/local_lim.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Minimum guaranteed maximum values for system limits. Linux version.
-
-/* The kernel header pollutes the namespace with the NR_OPEN symbol.
- Remove this after including the header if necessary. */
-
-#ifndef NR_OPEN
-# define __undef_NR_OPEN
-#endif
-
-#include <linux/limits.h>
-
-#ifdef __undef_NR_OPEN
-# undef NR_OPEN
-# undef __undef_NR_OPEN
-#endif
diff --git a/mit-pthreads/machdep/linux-2.0/extra/bits/pthreadtypes.h b/mit-pthreads/machdep/linux-2.0/extra/bits/pthreadtypes.h
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/mit-pthreads/machdep/linux-2.0/extra/bits/pthreadtypes.h
+++ /dev/null
diff --git a/mit-pthreads/machdep/linux-2.0/extra/bits/socket.h b/mit-pthreads/machdep/linux-2.0/extra/bits/socket.h
deleted file mode 100755
index 1814e189b64..00000000000
--- a/mit-pthreads/machdep/linux-2.0/extra/bits/socket.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/* ==== socket.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Correct Linux header file.
- */
-
-#ifndef _PTHREAD_BITS_SOCKET_H_
-#define _PTHREAD_BITS_SOCKET_H_
-
-/* #include <linux/socket.h> */
-#ifndef _LINUX_SOCKET_H
-#define _LINUX_SOCKET_H
-
-/* IP options */
-#define IP_TOS 1
-#define IPTOS_LOWDELAY 0x10
-#define IPTOS_THROUGHPUT 0x08
-#define IPTOS_RELIABILITY 0x04
-#define IP_TTL 2
-#ifndef IP_HDRINCL
-#define IP_HDRINCL 3
-#endif
-#ifdef V1_3_WILL_DO_THIS_FUNKY_STUFF
-#define IP_OPTIONS 4
-#endif
-
-#endif
-
-/* Fixes to be able to configure with glibc 2.2 */
-typedef unsigned short int sa_family_t;
-#define __SOCKADDR_COMMON(sa_prefix) \
- sa_family_t sa_prefix##family
-#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int))
-
-/* Type for length arguments in socket calls. */
-typedef unsigned int socklen_t;
-
-/* #include <asm/socket.h> arch-dependent defines */
-#include <linux/sockios.h> /* the SIOCxxx I/O controls */
-#include <pthread/posix.h>
-
-struct sockaddr {
- unsigned short sa_family; /* address family, AF_xxx */
- char sa_data[14]; /* 14 bytes of protocol address */
-};
-
-struct linger {
- int l_onoff; /* Linger active */
- int l_linger; /* How long to linger for */
-};
-
-struct msghdr
-{
- void * msg_name; /* Socket name */
- int msg_namelen; /* Length of name */
- struct iovec * msg_iov; /* Data blocks */
- int msg_iovlen; /* Number of blocks */
- void * msg_accrights; /* Per protocol magic (eg BSD file descriptor passing) */
- int msg_accrightslen;/* Length of rights list */
-};
-
-/* Socket types. */
-#define SOCK_STREAM 1 /* stream (connection) socket */
-#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
-#define SOCK_RAW 3 /* raw socket */
-#define SOCK_RDM 4 /* reliably-delivered message */
-#define SOCK_SEQPACKET 5 /* sequential packet socket */
-#define SOCK_PACKET 10 /* linux specific way of */
- /* getting packets at the dev */
- /* level. For writing rarp and */
- /* other similar things on the */
- /* user level. */
-
-/* Supported address families. */
-#define AF_UNSPEC 0
-#define AF_UNIX 1 /* Unix domain sockets */
-#define AF_INET 2 /* Internet IP Protocol */
-#define AF_AX25 3 /* Amateur Radio AX.25 */
-#define AF_IPX 4 /* Novell IPX */
-#define AF_APPLETALK 5 /* Appletalk DDP */
-#define AF_NETROM 6 /* Amateur radio NetROM */
-#define AF_BRIDGE 7 /* Multiprotocol bridge */
-#define AF_AAL5 8 /* Reserved for Werner's ATM */
-#define AF_X25 9 /* Reserved for X.25 project */
-#define AF_INET6 10 /* IP version 6 */
-#define AF_MAX 12 /* For now.. */
-
-/* Protocol families, same as address families. */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_UNIX AF_UNIX
-#define PF_INET AF_INET
-#define PF_AX25 AF_AX25
-#define PF_IPX AF_IPX
-#define PF_APPLETALK AF_APPLETALK
-#define PF_NETROM AF_NETROM
-#define PF_BRIDGE AF_BRIDGE
-#define PF_AAL5 AF_AAL5
-#define PF_X25 AF_X25
-#define PF_INET6 AF_INET6
-
-#define PF_MAX AF_MAX
-
-/* Maximum queue length specificable by listen. */
-#define SOMAXCONN 128
-
-/* Flags we can use with send/ and recv. */
-#define MSG_OOB 1
-#define MSG_PEEK 2
-#define MSG_DONTROUTE 4
-
-/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
-#define SOL_SOCKET 1
-#define SOL_IP 0
-#define SOL_IPX 256
-#define SOL_AX25 257
-#define SOL_ATALK 258
-#define SOL_NETROM 259
-#define SOL_TCP 6
-#define SOL_UDP 17
-
-/* For setsockoptions(2) */
-#define SO_DEBUG 1
-#define SO_REUSEADDR 2
-#define SO_TYPE 3
-#define SO_ERROR 4
-#define SO_DONTROUTE 5
-#define SO_BROADCAST 6
-#define SO_SNDBUF 7
-#define SO_RCVBUF 8
-#define SO_KEEPALIVE 9
-#define SO_OOBINLINE 10
-#define SO_NO_CHECK 11
-#define SO_PRIORITY 12
-#define SO_LINGER 13
-/* To add :#define SO_REUSEPORT 14 */
-
-
-#define IP_MULTICAST_IF 32
-#define IP_MULTICAST_TTL 33
-#define IP_MULTICAST_LOOP 34
-#define IP_ADD_MEMBERSHIP 35
-#define IP_DROP_MEMBERSHIP 36
-
-
-/* These need to appear somewhere around here */
-#define IP_DEFAULT_MULTICAST_TTL 1
-#define IP_DEFAULT_MULTICAST_LOOP 1
-#define IP_MAX_MEMBERSHIPS 20
-
-/* IPX options */
-#define IPX_TYPE 1
-
-/* TCP options - this way around because someone left a set in the c library includes */
-#define TCP_NODELAY 1
-#define TCP_MAXSEG 2
-
-/* The various priorities. */
-#define SOPRI_INTERACTIVE 0
-#define SOPRI_NORMAL 1
-#define SOPRI_BACKGROUND 2
-
-/*
- * Functions
- */
-
-__BEGIN_DECLS
-
-int accept __P_((int, struct sockaddr *, socklen_t *));
-int bind __P_((int, const struct sockaddr *, socklen_t));
-int connect __P_((int, const struct sockaddr *, socklen_t));
-int listen __P_((int, int));
-int socket __P_((int, int, int));
-
-int getsockopt __P_((int __s, int __level, int __optname,
- void *__optval, socklen_t *__optlen));
-int setsockopt __P_((int __s, int __level, int __optname,
- __const void *__optval, socklen_t optlen));
-int getsockname __P_((int __sockfd, struct sockaddr *__addr,
- socklen_t *__paddrlen));
-int getpeername __P_((int __sockfd, struct sockaddr *__peer,
- socklen_t *__paddrlen));
-ssize_t send __P_((int __sockfd, __const void *__buff, size_t __len, int __flags));
-ssize_t recv __P_((int __sockfd, void *__buff, size_t __len, int __flags));
-ssize_t sendto __P_((int __sockfd, __const void *__buff, size_t __len,
- int __flags, __const struct sockaddr *__to,
- socklen_t __tolen));
-ssize_t recvfrom __P_((int __sockfd, void *__buff, size_t __len,
- int __flags, struct sockaddr *__from,
- socklen_t *__fromlen));
-extern ssize_t sendmsg __P_((int __fd, __const struct msghdr *__message,
- int __flags));
-extern ssize_t recvmsg __P_((int __fd, struct msghdr *__message,
- int __flags));
-int shutdown __P_((int __sockfd, int __how));
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/machdep/linux-2.0/socket.h b/mit-pthreads/machdep/linux-2.0/socket.h
deleted file mode 100755
index 2a8a04f1903..00000000000
--- a/mit-pthreads/machdep/linux-2.0/socket.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* ==== socket.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Correct Linux header file.
- */
-
-#ifndef _PTHREAD_SOCKET_H_
-#define _PTHREAD_SOCKET_H_
-
-#include "bits/socket.h"
-
-#endif
-
diff --git a/mit-pthreads/machdep/linux-2.0/socketcall.h b/mit-pthreads/machdep/linux-2.0/socketcall.h
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/mit-pthreads/machdep/linux-2.0/socketcall.h
+++ /dev/null
diff --git a/mit-pthreads/machdep/linux-2.0/timers.h b/mit-pthreads/machdep/linux-2.0/timers.h
deleted file mode 100755
index 110cb27378c..00000000000
--- a/mit-pthreads/machdep/linux-2.0/timers.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <pthread/config.h>
-#include <sys/types.h>
-#include <time.h>
-
-#ifndef _OS_HAS_TIMESPEC
-struct timespec {
- time_t tv_sec;
- long tv_nsec;
-};
-#endif
-
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/machdep/linux-2.0/uio.h b/mit-pthreads/machdep/linux-2.0/uio.h
deleted file mode 100755
index 67af5bf76e0..00000000000
--- a/mit-pthreads/machdep/linux-2.0/uio.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* ==== uio.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Correct Linux header file.
- */
-
-#ifndef _PTHREAD_UIO_H_
-#define _PTHREAD_UIO_H_
-
-struct iovec {
- void *iov_base;
- size_t iov_len;
-};
-
-#endif
diff --git a/mit-pthreads/machdep/linux-2.0/wait.h b/mit-pthreads/machdep/linux-2.0/wait.h
deleted file mode 100755
index bcc28c5ef58..00000000000
--- a/mit-pthreads/machdep/linux-2.0/wait.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* $NetBSD: wait.h,v 1.7 1994/06/29 06:46:23 cgd Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)wait.h 8.1 (Berkeley) 6/2/93
- */
-
-/*
- * This file holds definitions relevent to the wait4 system call
- * and the alternate interfaces that use it (wait, wait3, waitpid).
- */
-
-/*
- * Macros to test the exit status returned by wait and extract the
- * relevant values. Union wait is no supported with pthreads.
- */
-#define __W_INT(i) (i)
-#define __WSTATUS(x) (__W_INT(x) & 0177)
-#define __WSTOPPED 0177 /* __WSTATUS if process is stopped */
-#define WIFSTOPPED(x) (__WSTATUS(x) == __WSTOPPED)
-#define WSTOPSIG(x) (__W_INT(x) >> 8)
-#define WIFSIGNALED(x) (__WSTATUS(x) != __WSTOPPED && __WSTATUS(x) != 0)
-#define WTERMSIG(x) (__WSTATUS(x))
-#define WIFEXITED(x) (__WSTATUS(x) == 0)
-#define WEXITSTATUS(x) (__W_INT(x) >> 8)
-
-#ifndef _POSIX_SOURCE
-#define WCOREDUMP(x) (__W_INT(x) & WCOREFLAG)
-#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
-#define W_STOPCODE(sig) ((sig) << 8 | __WSTOPPED)
-#endif
-
-/*
- * Option bits for the third argument of wait4. WNOHANG causes the
- * wait to not hang if there are no stopped or terminated processes, rather
- * returning an error indication in this case (pid==0). WUNTRACED
- * indicates that the caller should receive status about untraced children
- * which stop due to signals. If children are stopped and a wait without
- * this option is done, it is as though they were still running... nothing
- * about them is returned.
- */
-#define WNOHANG 1 /* dont hang in wait */
-#define WUNTRACED 2 /* tell about stopped, untraced children */
-
-#ifndef _POSIX_SOURCE
-
-/* Tokens for special values of the "pid" parameter to wait4. */
-#define WAIT_ANY (-1) /* any process */
-#define WAIT_MYPGRP 0 /* any process in my process group */
-
-#define WSTOPPED __WSTOPPED
-#endif /* _POSIX_SOURCE */
-
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-__BEGIN_DECLS
-pid_t wait __P_((int *));
-pid_t waitpid __P_((pid_t, int *, int));
-#ifndef _POSIX_SOURCE
-pid_t wait3 __P_((int *, int, void *));
-pid_t wait4 __P_((pid_t, int *, int, void *));
-#endif
-__END_DECLS
diff --git a/mit-pthreads/machdep/netbsd-0.9/dirent.h b/mit-pthreads/machdep/netbsd-0.9/dirent.h
deleted file mode 100755
index 5226443f86b..00000000000
--- a/mit-pthreads/machdep/netbsd-0.9/dirent.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 5.18 (Berkeley) 2/23/91
- */
-
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-/*
- * A directory entry has a struct dirent at the front of it, containing its
- * inode number, the length of the entry, and the length of the name
- * contained in the entry. These are followed by the name padded to a 4
- * byte boundary with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- */
-
-struct dirent {
- u_long d_fileno; /* file number of entry */
- u_short d_reclen; /* length of this record */
- u_short d_namlen; /* length of string in d_name */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
-#define MAXNAMLEN 255
- char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
-#endif
-};
-
-#define d_ino d_fileno /* backward compatibility */
-
-/* definitions for library routines operating on directories. */
-#define DIRBLKSIZ 1024
-
-#endif /* !_DIRENT_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.0/__math.h b/mit-pthreads/machdep/netbsd-1.0/__math.h
deleted file mode 100755
index dc009d822f4..00000000000
--- a/mit-pthreads/machdep/netbsd-1.0/__math.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * ANSI/POSIX
- */
-extern char __infinity[];
-#define HUGE_VAL (*(double *) __infinity)
-
diff --git a/mit-pthreads/machdep/netbsd-1.0/__path.h b/mit-pthreads/machdep/netbsd-1.0/__path.h
deleted file mode 100755
index 432494daafa..00000000000
--- a/mit-pthreads/machdep/netbsd-1.0/__path.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * $Id$
- */
-
-#ifndef _SYS__PATH_H_
-#define _SYS__PATH_H_
-
-#define _PATH_PTY "/dev/"
-#define _PATH_TZDIR "/usr/share/zoneinfo"
-#define _PATH_TZFILE "/etc/localtime"
-
-#endif /* !_SYS__PATH_H_ */
-
diff --git a/mit-pthreads/machdep/netbsd-1.0/__signal.h b/mit-pthreads/machdep/netbsd-1.0/__signal.h
deleted file mode 100755
index 918955c9948..00000000000
--- a/mit-pthreads/machdep/netbsd-1.0/__signal.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <sys/signal.h>
-
-#define __SIGEMPTYSET 0
-#define __SIGFILLSET 0xffffffff
-#define __SIGADDSET(s, n) (*(s) |= 1 << ((n) - 1), 0)
-#define __SIGDELSET(s, n) (*(s) &= ~(1 << ((n) - 1)), 0)
-#define __SIGISMEMBER(s, n) ((*(s) & (1 << ((n) - 1))) != 0)
-
diff --git a/mit-pthreads/machdep/netbsd-1.0/__stdio.h b/mit-pthreads/machdep/netbsd-1.0/__stdio.h
deleted file mode 100755
index d60b9df7a54..00000000000
--- a/mit-pthreads/machdep/netbsd-1.0/__stdio.h
+++ /dev/null
@@ -1,8 +0,0 @@
-
-#include <machine/ansi.h>
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-typedef pthread_fpos_t fpos_t; /* Must match off_t <sys/types.h> */
diff --git a/mit-pthreads/machdep/netbsd-1.0/__stdlib.h b/mit-pthreads/machdep/netbsd-1.0/__stdlib.h
deleted file mode 100755
index 7b24491b892..00000000000
--- a/mit-pthreads/machdep/netbsd-1.0/__stdlib.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * $Id$
- */
-
-#ifndef _SYS___STDLIB_H_
-#define _SYS___STDLIB_H_
-
-#include <machine/ansi.h>
-
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-#ifdef _BSD_WCHAR_T_
-typedef _BSD_WCHAR_T_ wchar_t;
-#undef _BSD_WCHAR_T_
-#endif
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#endif /* _STDLIB_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.0/__string.h b/mit-pthreads/machdep/netbsd-1.0/__string.h
deleted file mode 100755
index 1ebee28e708..00000000000
--- a/mit-pthreads/machdep/netbsd-1.0/__string.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-#include <machine/ansi.h>
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-/* Non-standard NetBSD string routines. */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-__BEGIN_DECLS
-int bcmp __P_((const void *, const void *, size_t));
-void bcopy __P_((const void *, void *, size_t));
-void bzero __P_((void *, size_t));
-char *index __P_((const char *, int));
-char *rindex __P_((const char *, int));
-char *strdup __P_((const char *));
-void strmode __P_((int, char *));
-char *strsep __P_((char **, const char *));
-__END_DECLS
-#endif
diff --git a/mit-pthreads/machdep/netbsd-1.0/__time.h b/mit-pthreads/machdep/netbsd-1.0/__time.h
deleted file mode 100755
index 16ea9d1f0dd..00000000000
--- a/mit-pthreads/machdep/netbsd-1.0/__time.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * $Id$
- */
-
-#ifndef _SYS__TIME_H_
-#define _SYS__TIME_H_
-
-#include <machine/ansi.h>
-
-#ifdef _BSD_CLOCK_T_
-typedef _BSD_CLOCK_T_ clock_t;
-#undef _BSD_CLOCK_T_
-#endif
-
-#ifdef _BSD_TIME_T_
-typedef _BSD_TIME_T_ time_t;
-#undef _BSD_TIME_T_
-#endif
-
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-#define CLOCKS_PER_SEC 100
-
-#if !defined(_ANSI_SOURCE)
-#define CLK_TCK 100
-#endif /* not ANSI */
-
-#endif /* !_SYS__TIME_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.0/__unistd.h b/mit-pthreads/machdep/netbsd-1.0/__unistd.h
deleted file mode 100755
index b4741ba6725..00000000000
--- a/mit-pthreads/machdep/netbsd-1.0/__unistd.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * $Id$
- */
-
-#ifndef _SYS___UNISTD_H_
-#define _SYS___UNISTD_H_
-
-#include <sys/types.h>
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-/* compile-time symbolic constants */
-#define _POSIX_JOB_CONTROL /* implementation supports job control */
-
-#ifdef _NOT_AVAILABLE
-#define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */
-#endif
-
-#define _POSIX_VERSION 198808L
-#define _POSIX2_VERSION 199212L
-
-/* execution-time symbolic constants */
- /* chown requires appropriate privileges */
-#define _POSIX_CHOWN_RESTRICTED 1
- /* too-long path components generate errors */
-#define _POSIX_NO_TRUNC 1
- /* may disable terminal special characters */
-#define _POSIX_VDISABLE ((unsigned char)'\377')
-
-/* configurable pathname variables */
-#define _PC_LINK_MAX 1
-#define _PC_MAX_CANON 2
-#define _PC_MAX_INPUT 3
-#define _PC_NAME_MAX 4
-#define _PC_PATH_MAX 5
-#define _PC_PIPE_BUF 6
-#define _PC_CHOWN_RESTRICTED 7
-#define _PC_NO_TRUNC 8
-#define _PC_VDISABLE 9
-
-/* configurable system variables */
-#define _SC_ARG_MAX 1
-#define _SC_CHILD_MAX 2
-#define _SC_CLK_TCK 3
-#define _SC_NGROUPS_MAX 4
-#define _SC_OPEN_MAX 5
-#define _SC_JOB_CONTROL 6
-#define _SC_SAVED_IDS 7
-#define _SC_VERSION 8
-#define _SC_BC_BASE_MAX 9
-#define _SC_BC_DIM_MAX 10
-#define _SC_BC_SCALE_MAX 11
-#define _SC_BC_STRING_MAX 12
-#define _SC_COLL_WEIGHTS_MAX 13
-#define _SC_EXPR_NEST_MAX 14
-#define _SC_LINE_MAX 15
-#define _SC_RE_DUP_MAX 16
-#define _SC_2_VERSION 17
-#define _SC_2_C_BIND 18
-#define _SC_2_C_DEV 19
-#define _SC_2_CHAR_TERM 20
-#define _SC_2_FORT_DEV 21
-#define _SC_2_FORT_RUN 22
-#define _SC_2_LOCALEDEF 23
-#define _SC_2_SW_DEV 24
-#define _SC_2_UPE 25
-#define _SC_STREAM_MAX 26
-#define _SC_TZNAME_MAX 27
-
-/* configurable system strings */
-#define _CS_PATH 1
-
-#endif
diff --git a/mit-pthreads/machdep/netbsd-1.0/compat.h b/mit-pthreads/machdep/netbsd-1.0/compat.h
deleted file mode 100755
index e7de318aa88..00000000000
--- a/mit-pthreads/machdep/netbsd-1.0/compat.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* ==== compat.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : COmpat header to make socket code compile.
- *
- * 1.00 94/08/01 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_COMPAT_H_
-#define _SYS_COMPAT_H_
-
-#endif
diff --git a/mit-pthreads/machdep/netbsd-1.0/dirent.h b/mit-pthreads/machdep/netbsd-1.0/dirent.h
deleted file mode 100755
index 5226443f86b..00000000000
--- a/mit-pthreads/machdep/netbsd-1.0/dirent.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 5.18 (Berkeley) 2/23/91
- */
-
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-/*
- * A directory entry has a struct dirent at the front of it, containing its
- * inode number, the length of the entry, and the length of the name
- * contained in the entry. These are followed by the name padded to a 4
- * byte boundary with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- */
-
-struct dirent {
- u_long d_fileno; /* file number of entry */
- u_short d_reclen; /* length of this record */
- u_short d_namlen; /* length of string in d_name */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
-#define MAXNAMLEN 255
- char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
-#endif
-};
-
-#define d_ino d_fileno /* backward compatibility */
-
-/* definitions for library routines operating on directories. */
-#define DIRBLKSIZ 1024
-
-#endif /* !_DIRENT_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.0/errno.h b/mit-pthreads/machdep/netbsd-1.0/errno.h
deleted file mode 100755
index 3da61d692a3..00000000000
--- a/mit-pthreads/machdep/netbsd-1.0/errno.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/* $NetBSD: errno.h,v 1.8 1994/06/29 06:44:02 cgd Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)errno.h 8.5 (Berkeley) 1/21/94
- */
-
-#ifndef _SYS_ERRNO_H_
-#define _SYS_ERRNO_H_
-
-#define EPERM 1 /* Operation not permitted */
-#define ENOENT 2 /* No such file or directory */
-#define ESRCH 3 /* No such process */
-#define EINTR 4 /* Interrupted system call */
-#define EIO 5 /* Input/output error */
-#define ENXIO 6 /* Device not configured */
-#define E2BIG 7 /* Argument list too long */
-#define ENOEXEC 8 /* Exec format error */
-#define EBADF 9 /* Bad file descriptor */
-#define ECHILD 10 /* No child processes */
-#define EDEADLK 11 /* Resource deadlock avoided */
- /* 11 was EAGAIN */
-#define ENOMEM 12 /* Cannot allocate memory */
-#define EACCES 13 /* Permission denied */
-#define EFAULT 14 /* Bad address */
-#ifndef _POSIX_SOURCE
-#define ENOTBLK 15 /* Block device required */
-#endif
-#define EBUSY 16 /* Device busy */
-#define EEXIST 17 /* File exists */
-#define EXDEV 18 /* Cross-device link */
-#define ENODEV 19 /* Operation not supported by device */
-#define ENOTDIR 20 /* Not a directory */
-#define EISDIR 21 /* Is a directory */
-#define EINVAL 22 /* Invalid argument */
-#define ENFILE 23 /* Too many open files in system */
-#define EMFILE 24 /* Too many open files */
-#define ENOTTY 25 /* Inappropriate ioctl for device */
-#ifndef _POSIX_SOURCE
-#define ETXTBSY 26 /* Text file busy */
-#endif
-#define EFBIG 27 /* File too large */
-#define ENOSPC 28 /* No space left on device */
-#define ESPIPE 29 /* Illegal seek */
-#define EROFS 30 /* Read-only file system */
-#define EMLINK 31 /* Too many links */
-#define EPIPE 32 /* Broken pipe */
-
-/* math software */
-#define EDOM 33 /* Numerical argument out of domain */
-#define ERANGE 34 /* Result too large */
-
-/* non-blocking and interrupt i/o */
-#define EAGAIN 35 /* Resource temporarily unavailable */
-#ifndef _POSIX_SOURCE
-#define EWOULDBLOCK EAGAIN /* Operation would block */
-#define EINPROGRESS 36 /* Operation now in progress */
-#define EALREADY 37 /* Operation already in progress */
-
-/* ipc/network software -- argument errors */
-#define ENOTSOCK 38 /* Socket operation on non-socket */
-#define EDESTADDRREQ 39 /* Destination address required */
-#define EMSGSIZE 40 /* Message too long */
-#define EPROTOTYPE 41 /* Protocol wrong type for socket */
-#define ENOPROTOOPT 42 /* Protocol not available */
-#define EPROTONOSUPPORT 43 /* Protocol not supported */
-#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
-#define EOPNOTSUPP 45 /* Operation not supported */
-#define EPFNOSUPPORT 46 /* Protocol family not supported */
-#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
-#define EADDRINUSE 48 /* Address already in use */
-#define EADDRNOTAVAIL 49 /* Can't assign requested address */
-
-/* ipc/network software -- operational errors */
-#define ENETDOWN 50 /* Network is down */
-#define ENETUNREACH 51 /* Network is unreachable */
-#define ENETRESET 52 /* Network dropped connection on reset */
-#define ECONNABORTED 53 /* Software caused connection abort */
-#define ECONNRESET 54 /* Connection reset by peer */
-#define ENOBUFS 55 /* No buffer space available */
-#define EISCONN 56 /* Socket is already connected */
-#define ENOTCONN 57 /* Socket is not connected */
-#define ESHUTDOWN 58 /* Can't send after socket shutdown */
-#define ETOOMANYREFS 59 /* Too many references: can't splice */
-#define ETIMEDOUT 60 /* Operation timed out */
-#define ECONNREFUSED 61 /* Connection refused */
-
-#define ELOOP 62 /* Too many levels of symbolic links */
-#endif /* _POSIX_SOURCE */
-#define ENAMETOOLONG 63 /* File name too long */
-
-/* should be rearranged */
-#ifndef _POSIX_SOURCE
-#define EHOSTDOWN 64 /* Host is down */
-#define EHOSTUNREACH 65 /* No route to host */
-#endif /* _POSIX_SOURCE */
-#define ENOTEMPTY 66 /* Directory not empty */
-
-/* quotas & mush */
-#ifndef _POSIX_SOURCE
-#define EPROCLIM 67 /* Too many processes */
-#define EUSERS 68 /* Too many users */
-#define EDQUOT 69 /* Disc quota exceeded */
-
-/* Network File System */
-#define ESTALE 70 /* Stale NFS file handle */
-#define EREMOTE 71 /* Too many levels of remote in path */
-#define EBADRPC 72 /* RPC struct is bad */
-#define ERPCMISMATCH 73 /* RPC version wrong */
-#define EPROGUNAVAIL 74 /* RPC prog. not avail */
-#define EPROGMISMATCH 75 /* Program version wrong */
-#define EPROCUNAVAIL 76 /* Bad procedure for program */
-#endif /* _POSIX_SOURCE */
-
-#define ENOLCK 77 /* No locks available */
-#define ENOSYS 78 /* Function not implemented */
-
-#ifndef _POSIX_SOURCE
-#define EFTYPE 79 /* Inappropriate file type or format */
-#define EAUTH 80 /* Authentication error */
-#define ENEEDAUTH 81 /* Need authenticator */
-#define ELAST 81 /* Must be equal largest errno */
-#endif /* _POSIX_SOURCE */
-
-#endif
diff --git a/mit-pthreads/machdep/netbsd-1.0/time.h b/mit-pthreads/machdep/netbsd-1.0/time.h
deleted file mode 100755
index f2cc61f8d75..00000000000
--- a/mit-pthreads/machdep/netbsd-1.0/time.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/* $NetBSD: time.h,v 1.8 1994/06/29 06:45:44 cgd Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)time.h 8.1 (Berkeley) 6/2/93
- */
-
-#ifndef _SYS_TIME_H_
-#define _SYS_TIME_H_
-
-/*
- * Structure returned by gettimeofday(2) system call,
- * and used in other calls.
- */
-struct timeval {
- long tv_sec; /* seconds */
- long tv_usec; /* and microseconds */
-};
-
-/*
- * Structure defined by POSIX.4 to be like a timeval.
- */
-struct timespec {
- long tv_sec; /* seconds */
- long tv_nsec; /* and nanoseconds */
-};
-
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
-
-struct timezone {
- int tz_minuteswest; /* minutes west of Greenwich */
- int tz_dsttime; /* type of dst correction */
-};
-#define DST_NONE 0 /* not on dst */
-#define DST_USA 1 /* USA style dst */
-#define DST_AUST 2 /* Australian style dst */
-#define DST_WET 3 /* Western European dst */
-#define DST_MET 4 /* Middle European dst */
-#define DST_EET 5 /* Eastern European dst */
-#define DST_CAN 6 /* Canada */
-
-/* Operations on timevals. */
-#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
-#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
-#define timercmp(tvp, uvp, cmp) \
- (((tvp)->tv_sec == (uvp)->tv_sec) ? \
- ((tvp)->tv_usec cmp (uvp)->tv_usec) : \
- ((tvp)->tv_sec cmp (uvp)->tv_sec))
-
-/*
- * Names of the interval timers, and structure
- * defining a timer setting.
- */
-#define ITIMER_REAL 0
-#define ITIMER_VIRTUAL 1
-#define ITIMER_PROF 2
-
-struct itimerval {
- struct timeval it_interval; /* timer interval */
- struct timeval it_value; /* current value */
-};
-
-/*
- * Getkerninfo clock information structure
- */
-struct clockinfo {
- int hz; /* clock frequency */
- int tick; /* micro-seconds per hz tick */
- int stathz; /* statistics clock frequency */
- int profhz; /* profiling clock frequency */
-};
-
-#include <time.h>
-
-#ifndef _POSIX_SOURCE
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int adjtime __P_((const struct timeval *, struct timeval *));
-int getitimer __P_((int, struct itimerval *));
-int gettimeofday __P_((struct timeval *, struct timezone *));
-int setitimer __P_((int, const struct itimerval *, struct itimerval *));
-int settimeofday __P_((const struct timeval *, const struct timezone *));
-int utimes __P_((const char *, const struct timeval *));
-__END_DECLS
-#endif /* !POSIX */
-
-#endif /* !_SYS_TIME_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.0/timers.h b/mit-pthreads/machdep/netbsd-1.0/timers.h
deleted file mode 100755
index f9768c68c8f..00000000000
--- a/mit-pthreads/machdep/netbsd-1.0/timers.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <sys/time.h>
-
-#endif
diff --git a/mit-pthreads/machdep/netbsd-1.0/wait.h b/mit-pthreads/machdep/netbsd-1.0/wait.h
deleted file mode 100755
index c1cd876d052..00000000000
--- a/mit-pthreads/machdep/netbsd-1.0/wait.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/* $NetBSD: wait.h,v 1.7 1994/06/29 06:46:23 cgd Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)wait.h 8.1 (Berkeley) 6/2/93
- */
-
-/*
- * This file holds definitions relevent to the wait4 system call
- * and the alternate interfaces that use it (wait, wait3, waitpid).
- */
-
-/*
- * Macros to test the exit status returned by wait
- * and extract the relevant values.
- */
-#ifdef _POSIX_SOURCE
-#define _W_INT(i) (i)
-#else
-#define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */
-#define WCOREFLAG 0200
-#endif
-
-#define _WSTATUS(x) (_W_INT(x) & 0177)
-#define _WSTOPPED 0177 /* _WSTATUS if process is stopped */
-#define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED)
-#define WSTOPSIG(x) (_W_INT(x) >> 8)
-#define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0)
-#define WTERMSIG(x) (_WSTATUS(x))
-#define WIFEXITED(x) (_WSTATUS(x) == 0)
-#define WEXITSTATUS(x) (_W_INT(x) >> 8)
-#ifndef _POSIX_SOURCE
-#define WCOREDUMP(x) (_W_INT(x) & WCOREFLAG)
-
-#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
-#define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED)
-#endif
-
-/*
- * Option bits for the third argument of wait4. WNOHANG causes the
- * wait to not hang if there are no stopped or terminated processes, rather
- * returning an error indication in this case (pid==0). WUNTRACED
- * indicates that the caller should receive status about untraced children
- * which stop due to signals. If children are stopped and a wait without
- * this option is done, it is as though they were still running... nothing
- * about them is returned.
- */
-#define WNOHANG 1 /* dont hang in wait */
-#define WUNTRACED 2 /* tell about stopped, untraced children */
-
-#ifndef _POSIX_SOURCE
-/* POSIX extensions and 4.2/4.3 compatability: */
-
-/*
- * Tokens for special values of the "pid" parameter to wait4.
- */
-#define WAIT_ANY (-1) /* any process */
-#define WAIT_MYPGRP 0 /* any process in my process group */
-
-#include <machine/endian.h>
-
-/*
- * Deprecated:
- * Structure of the information in the status word returned by wait4.
- * If w_stopval==WSTOPPED, then the second structure describes
- * the information returned, else the first.
- */
-union wait {
- int w_status; /* used in syscall */
- /*
- * Terminated process status.
- */
- struct {
-#if BYTE_ORDER == LITTLE_ENDIAN
- unsigned int w_Termsig:7, /* termination signal */
- w_Coredump:1, /* core dump indicator */
- w_Retcode:8, /* exit code if w_termsig==0 */
- w_Filler:16; /* upper bits filler */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- unsigned int w_Filler:16, /* upper bits filler */
- w_Retcode:8, /* exit code if w_termsig==0 */
- w_Coredump:1, /* core dump indicator */
- w_Termsig:7; /* termination signal */
-#endif
- } w_T;
- /*
- * Stopped process status. Returned
- * only for traced children unless requested
- * with the WUNTRACED option bit.
- */
- struct {
-#if BYTE_ORDER == LITTLE_ENDIAN
- unsigned int w_Stopval:8, /* == W_STOPPED if stopped */
- w_Stopsig:8, /* signal that stopped us */
- w_Filler:16; /* upper bits filler */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- unsigned int w_Filler:16, /* upper bits filler */
- w_Stopsig:8, /* signal that stopped us */
- w_Stopval:8; /* == W_STOPPED if stopped */
-#endif
- } w_S;
-};
-#define w_termsig w_T.w_Termsig
-#define w_coredump w_T.w_Coredump
-#define w_retcode w_T.w_Retcode
-#define w_stopval w_S.w_Stopval
-#define w_stopsig w_S.w_Stopsig
-
-#define WSTOPPED _WSTOPPED
-#endif /* _POSIX_SOURCE */
-
-#ifndef KERNEL
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-struct rusage; /* forward declaration */
-
-pid_t wait __P_((int *));
-pid_t waitpid __P_((pid_t, int *, int));
-#ifndef _POSIX_SOURCE
-pid_t wait3 __P_((int *, int, void *));
-pid_t wait4 __P_((pid_t, int *, int, void *));
-#endif
-__END_DECLS
-#endif
diff --git a/mit-pthreads/machdep/netbsd-1.1/__math.h b/mit-pthreads/machdep/netbsd-1.1/__math.h
deleted file mode 100755
index dc009d822f4..00000000000
--- a/mit-pthreads/machdep/netbsd-1.1/__math.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * ANSI/POSIX
- */
-extern char __infinity[];
-#define HUGE_VAL (*(double *) __infinity)
-
diff --git a/mit-pthreads/machdep/netbsd-1.1/__path.h b/mit-pthreads/machdep/netbsd-1.1/__path.h
deleted file mode 100755
index be7f9f6c658..00000000000
--- a/mit-pthreads/machdep/netbsd-1.1/__path.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * __path.h,v 1.1 1995/01/03 12:53:32 proven Exp
- */
-
-#ifndef _SYS__PATH_H_
-#define _SYS__PATH_H_
-
-#define _PATH_PTY "/dev/"
-#define _PATH_TZDIR "/usr/share/zoneinfo"
-#define _PATH_TZFILE "/etc/localtime"
-
-#endif /* !_SYS__PATH_H_ */
-
diff --git a/mit-pthreads/machdep/netbsd-1.1/__signal.h b/mit-pthreads/machdep/netbsd-1.1/__signal.h
deleted file mode 100755
index ea2979f2b4e..00000000000
--- a/mit-pthreads/machdep/netbsd-1.1/__signal.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <sys/signal.h>
-
-__BEGIN_DECLS
-
-#if NSIG <= 32
-#define __SIGEMPTYSET 0
-#define __SIGFILLSET 0xffffffff
-#define __SIGADDSET(s, n) (*(s) |= 1 << ((n) - 1), 0)
-#define __SIGDELSET(s, n) (*(s) &= ~(1 << ((n) - 1)), 0)
-#define __SIGISMEMBER(s, n) ((*(s) & (1 << ((n) - 1))) != 0)
-
-#else /* XXX Netbsd >= 1.3H */
-
-int sigaction __P_((int, const struct sigaction *, struct sigaction *)) __RENAME(__sigaction14);
-
-#define __SIGEMPTYSET { 0, 0, 0, 0}
-#define __SIGFILLSET { 0xffffffff, 0xffffffff, \
- 0xffffffff, 0xffffffff }
-#define __SIGMASK(n) (1 << (((n) - 1) & 31))
-#define __SIGWORD(n) (((n) - 1) >> 5)
-#define __SIGADDSET(s, n) ((s)->__bits[__SIGWORD(n)] |= __SIGMASK(n))
-#define __SIGDELSET(s, n) ((s)->__bits[__SIGWORD(n)] &= ~__SIGMASK(n))
-#define __SIGISMEMBER(s, n) (((s)->__bits[__SIGWORD(n)] & __SIGMASK(n)) != 0)
-
-#endif
-
-__END_DECLS
diff --git a/mit-pthreads/machdep/netbsd-1.1/__stdio.h b/mit-pthreads/machdep/netbsd-1.1/__stdio.h
deleted file mode 100755
index d60b9df7a54..00000000000
--- a/mit-pthreads/machdep/netbsd-1.1/__stdio.h
+++ /dev/null
@@ -1,8 +0,0 @@
-
-#include <machine/ansi.h>
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-typedef pthread_fpos_t fpos_t; /* Must match off_t <sys/types.h> */
diff --git a/mit-pthreads/machdep/netbsd-1.1/__stdlib.h b/mit-pthreads/machdep/netbsd-1.1/__stdlib.h
deleted file mode 100755
index 189bb5e8799..00000000000
--- a/mit-pthreads/machdep/netbsd-1.1/__stdlib.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * __stdlib.h,v 1.1 1995/01/03 12:53:34 proven Exp
- */
-
-#ifndef _SYS___STDLIB_H_
-#define _SYS___STDLIB_H_
-
-#include <machine/ansi.h>
-
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-#ifdef _BSD_WCHAR_T_
-typedef _BSD_WCHAR_T_ wchar_t;
-#undef _BSD_WCHAR_T_
-#endif
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#endif /* _STDLIB_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.1/__string.h b/mit-pthreads/machdep/netbsd-1.1/__string.h
deleted file mode 100755
index 1ebee28e708..00000000000
--- a/mit-pthreads/machdep/netbsd-1.1/__string.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-#include <machine/ansi.h>
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-/* Non-standard NetBSD string routines. */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-__BEGIN_DECLS
-int bcmp __P_((const void *, const void *, size_t));
-void bcopy __P_((const void *, void *, size_t));
-void bzero __P_((void *, size_t));
-char *index __P_((const char *, int));
-char *rindex __P_((const char *, int));
-char *strdup __P_((const char *));
-void strmode __P_((int, char *));
-char *strsep __P_((char **, const char *));
-__END_DECLS
-#endif
diff --git a/mit-pthreads/machdep/netbsd-1.1/__time.h b/mit-pthreads/machdep/netbsd-1.1/__time.h
deleted file mode 100755
index 27ceb815852..00000000000
--- a/mit-pthreads/machdep/netbsd-1.1/__time.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * __time.h,v 1.1 1994/12/13 07:18:55 proven Exp
- */
-
-#ifndef _SYS__TIME_H_
-#define _SYS__TIME_H_
-
-#include <machine/ansi.h>
-
-#ifdef _BSD_CLOCK_T_
-typedef _BSD_CLOCK_T_ clock_t;
-#undef _BSD_CLOCK_T_
-#endif
-
-#ifdef _BSD_TIME_T_
-typedef _BSD_TIME_T_ time_t;
-#undef _BSD_TIME_T_
-#endif
-
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-#define CLOCKS_PER_SEC 100
-
-#if !defined(_ANSI_SOURCE)
-#define CLK_TCK 100
-#endif /* not ANSI */
-
-#endif /* !_SYS__TIME_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.1/__unistd.h b/mit-pthreads/machdep/netbsd-1.1/__unistd.h
deleted file mode 100755
index cea3165c229..00000000000
--- a/mit-pthreads/machdep/netbsd-1.1/__unistd.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * __unistd.h,v 1.1 1995/01/03 12:53:35 proven Exp
- */
-
-#ifndef _SYS___UNISTD_H_
-#define _SYS___UNISTD_H_
-
-#include <sys/types.h>
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-/* compile-time symbolic constants */
-#define _POSIX_JOB_CONTROL /* implementation supports job control */
-
-#ifdef _NOT_AVAILABLE
-#define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */
-#endif
-
-#define _POSIX_VERSION 198808L
-#define _POSIX2_VERSION 199212L
-
-/* execution-time symbolic constants */
- /* chown requires appropriate privileges */
-#define _POSIX_CHOWN_RESTRICTED 1
- /* too-long path components generate errors */
-#define _POSIX_NO_TRUNC 1
- /* may disable terminal special characters */
-#define _POSIX_VDISABLE ((unsigned char)'\377')
-
-/* configurable pathname variables */
-#define _PC_LINK_MAX 1
-#define _PC_MAX_CANON 2
-#define _PC_MAX_INPUT 3
-#define _PC_NAME_MAX 4
-#define _PC_PATH_MAX 5
-#define _PC_PIPE_BUF 6
-#define _PC_CHOWN_RESTRICTED 7
-#define _PC_NO_TRUNC 8
-#define _PC_VDISABLE 9
-
-/* configurable system variables */
-#define _SC_ARG_MAX 1
-#define _SC_CHILD_MAX 2
-#define _SC_CLK_TCK 3
-#define _SC_NGROUPS_MAX 4
-#define _SC_OPEN_MAX 5
-#define _SC_JOB_CONTROL 6
-#define _SC_SAVED_IDS 7
-#define _SC_VERSION 8
-#define _SC_BC_BASE_MAX 9
-#define _SC_BC_DIM_MAX 10
-#define _SC_BC_SCALE_MAX 11
-#define _SC_BC_STRING_MAX 12
-#define _SC_COLL_WEIGHTS_MAX 13
-#define _SC_EXPR_NEST_MAX 14
-#define _SC_LINE_MAX 15
-#define _SC_RE_DUP_MAX 16
-#define _SC_2_VERSION 17
-#define _SC_2_C_BIND 18
-#define _SC_2_C_DEV 19
-#define _SC_2_CHAR_TERM 20
-#define _SC_2_FORT_DEV 21
-#define _SC_2_FORT_RUN 22
-#define _SC_2_LOCALEDEF 23
-#define _SC_2_SW_DEV 24
-#define _SC_2_UPE 25
-#define _SC_STREAM_MAX 26
-#define _SC_TZNAME_MAX 27
-
-/* configurable system strings */
-#define _CS_PATH 1
-
-#endif
diff --git a/mit-pthreads/machdep/netbsd-1.1/compat.h b/mit-pthreads/machdep/netbsd-1.1/compat.h
deleted file mode 100755
index f843795cc0a..00000000000
--- a/mit-pthreads/machdep/netbsd-1.1/compat.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* ==== compat.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * compat.h,v 1.50 1994/08/08 03:44:05 proven Exp
- *
- * Description : COmpat header to make socket code compile.
- *
- * 1.00 94/08/01 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_COMPAT_H_
-#define _SYS_COMPAT_H_
-
-#endif
diff --git a/mit-pthreads/machdep/netbsd-1.1/dirent.h b/mit-pthreads/machdep/netbsd-1.1/dirent.h
deleted file mode 100755
index cf004a274d6..00000000000
--- a/mit-pthreads/machdep/netbsd-1.1/dirent.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* $NetBSD: dirent.h,v 1.12 1996/04/09 20:55:25 cgd Exp $ */
-
-/*-
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 8.3 (Berkeley) 8/10/94
- */
-
-/*
- * The dirent structure defines the format of directory entries returned by
- * the getdirentries(2) system call.
- *
- * A directory entry has a struct dirent at the front of it, containing its
- * inode number, the length of the entry, and the length of the name
- * contained in the entry. These are followed by the name padded to a 4
- * byte boundary with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- */
-
-struct dirent {
- u_int32_t d_fileno; /* file number of entry */
- u_int16_t d_reclen; /* length of this record */
- u_int8_t d_type; /* file type, see below */
- u_int8_t d_namlen; /* length of string in d_name */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
-#define MAXNAMLEN 255
- char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
-#endif
-};
-
-#ifdef PTHREAD_KERNEL
-#define d_ino d_fileno
-#endif
-
-/*
- * File types
- */
-#define DT_UNKNOWN 0
-#define DT_FIFO 1
-#define DT_CHR 2
-#define DT_DIR 4
-#define DT_BLK 6
-#define DT_REG 8
-#define DT_LNK 10
-#define DT_SOCK 12
-#define DT_WHT 14
-
-/*
- * Convert between stat structure types and directory types.
- */
-#define IFTODT(mode) (((mode) & 0170000) >> 12)
-#define DTTOIF(dirtype) ((dirtype) << 12)
-
-#if defined(_KERNEL)
-/*
- * The DIRENT_SIZE macro gives the minimum record length which will hold
- * the directory entry. This requires the amount of space in struct dirent
- * without the d_name field, plus enough space for the name with a terminating
- * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
- */
-#define DIRENT_SIZE(dp) \
- ((sizeof (struct dirent) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
-
-#endif /* !_KERNEL */
diff --git a/mit-pthreads/machdep/netbsd-1.1/errno.h b/mit-pthreads/machdep/netbsd-1.1/errno.h
deleted file mode 100755
index c313b578c5a..00000000000
--- a/mit-pthreads/machdep/netbsd-1.1/errno.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/* $NetBSD: errno.h,v 1.10 1996/01/20 01:33:53 jtc Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)errno.h 8.5 (Berkeley) 1/21/94
- */
-
-#ifndef _KERNEL
-extern int errno; /* global error number */
-
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-extern int sys_nerr;
-extern const char *const sys_errlist[];
-#endif
-#endif
-
-#define EPERM 1 /* Operation not permitted */
-#define ENOENT 2 /* No such file or directory */
-#define ESRCH 3 /* No such process */
-#define EINTR 4 /* Interrupted system call */
-#define EIO 5 /* Input/output error */
-#define ENXIO 6 /* Device not configured */
-#define E2BIG 7 /* Argument list too long */
-#define ENOEXEC 8 /* Exec format error */
-#define EBADF 9 /* Bad file descriptor */
-#define ECHILD 10 /* No child processes */
-#define EDEADLK 11 /* Resource deadlock avoided */
- /* 11 was EAGAIN */
-#define ENOMEM 12 /* Cannot allocate memory */
-#define EACCES 13 /* Permission denied */
-#define EFAULT 14 /* Bad address */
-#ifndef _POSIX_SOURCE
-#define ENOTBLK 15 /* Block device required */
-#endif
-#define EBUSY 16 /* Device busy */
-#define EEXIST 17 /* File exists */
-#define EXDEV 18 /* Cross-device link */
-#define ENODEV 19 /* Operation not supported by device */
-#define ENOTDIR 20 /* Not a directory */
-#define EISDIR 21 /* Is a directory */
-#define EINVAL 22 /* Invalid argument */
-#define ENFILE 23 /* Too many open files in system */
-#define EMFILE 24 /* Too many open files */
-#define ENOTTY 25 /* Inappropriate ioctl for device */
-#ifndef _POSIX_SOURCE
-#define ETXTBSY 26 /* Text file busy */
-#endif
-#define EFBIG 27 /* File too large */
-#define ENOSPC 28 /* No space left on device */
-#define ESPIPE 29 /* Illegal seek */
-#define EROFS 30 /* Read-only file system */
-#define EMLINK 31 /* Too many links */
-#define EPIPE 32 /* Broken pipe */
-
-/* math software */
-#define EDOM 33 /* Numerical argument out of domain */
-#define ERANGE 34 /* Result too large */
-
-/* non-blocking and interrupt i/o */
-#define EAGAIN 35 /* Resource temporarily unavailable */
-#ifndef _POSIX_SOURCE
-#define EWOULDBLOCK EAGAIN /* Operation would block */
-#define EINPROGRESS 36 /* Operation now in progress */
-#define EALREADY 37 /* Operation already in progress */
-
-/* ipc/network software -- argument errors */
-#define ENOTSOCK 38 /* Socket operation on non-socket */
-#define EDESTADDRREQ 39 /* Destination address required */
-#define EMSGSIZE 40 /* Message too long */
-#define EPROTOTYPE 41 /* Protocol wrong type for socket */
-#define ENOPROTOOPT 42 /* Protocol not available */
-#define EPROTONOSUPPORT 43 /* Protocol not supported */
-#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
-#define EOPNOTSUPP 45 /* Operation not supported */
-#define EPFNOSUPPORT 46 /* Protocol family not supported */
-#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
-#define EADDRINUSE 48 /* Address already in use */
-#define EADDRNOTAVAIL 49 /* Can't assign requested address */
-
-/* ipc/network software -- operational errors */
-#define ENETDOWN 50 /* Network is down */
-#define ENETUNREACH 51 /* Network is unreachable */
-#define ENETRESET 52 /* Network dropped connection on reset */
-#define ECONNABORTED 53 /* Software caused connection abort */
-#define ECONNRESET 54 /* Connection reset by peer */
-#define ENOBUFS 55 /* No buffer space available */
-#define EISCONN 56 /* Socket is already connected */
-#define ENOTCONN 57 /* Socket is not connected */
-#define ESHUTDOWN 58 /* Can't send after socket shutdown */
-#define ETOOMANYREFS 59 /* Too many references: can't splice */
-#define ETIMEDOUT 60 /* Operation timed out */
-#define ECONNREFUSED 61 /* Connection refused */
-
-#define ELOOP 62 /* Too many levels of symbolic links */
-#endif /* _POSIX_SOURCE */
-#define ENAMETOOLONG 63 /* File name too long */
-
-/* should be rearranged */
-#ifndef _POSIX_SOURCE
-#define EHOSTDOWN 64 /* Host is down */
-#define EHOSTUNREACH 65 /* No route to host */
-#endif /* _POSIX_SOURCE */
-#define ENOTEMPTY 66 /* Directory not empty */
-
-/* quotas & mush */
-#ifndef _POSIX_SOURCE
-#define EPROCLIM 67 /* Too many processes */
-#define EUSERS 68 /* Too many users */
-#define EDQUOT 69 /* Disc quota exceeded */
-
-/* Network File System */
-#define ESTALE 70 /* Stale NFS file handle */
-#define EREMOTE 71 /* Too many levels of remote in path */
-#define EBADRPC 72 /* RPC struct is bad */
-#define ERPCMISMATCH 73 /* RPC version wrong */
-#define EPROGUNAVAIL 74 /* RPC prog. not avail */
-#define EPROGMISMATCH 75 /* Program version wrong */
-#define EPROCUNAVAIL 76 /* Bad procedure for program */
-#endif /* _POSIX_SOURCE */
-
-#define ENOLCK 77 /* No locks available */
-#define ENOSYS 78 /* Function not implemented */
-
-#ifndef _POSIX_SOURCE
-#define EFTYPE 79 /* Inappropriate file type or format */
-#define EAUTH 80 /* Authentication error */
-#define ENEEDAUTH 81 /* Need authenticator */
-#define ELAST 81 /* Must be equal largest errno */
-#endif /* _POSIX_SOURCE */
-
-#ifdef _KERNEL
-/* pseudo-errors returned inside kernel to modify return to process */
-#define ERESTART -1 /* restart syscall */
-#define EJUSTRETURN -2 /* don't modify regs, just return */
-#endif
diff --git a/mit-pthreads/machdep/netbsd-1.1/time.h b/mit-pthreads/machdep/netbsd-1.1/time.h
deleted file mode 100755
index a701db9c62e..00000000000
--- a/mit-pthreads/machdep/netbsd-1.1/time.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/* $NetBSD: time.h,v 1.17 1996/02/01 00:10:36 jtc Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)time.h 8.2 (Berkeley) 7/10/94
- */
-
-#ifndef _SYS_TIME_H_
-#define _SYS_TIME_H_
-
-#include <sys/types.h>
-
-/*
- * Structure returned by gettimeofday(2) system call,
- * and used in other calls.
- */
-struct timeval {
- long tv_sec; /* seconds */
- long tv_usec; /* and microseconds */
-};
-
-/*
- * Structure defined by POSIX.1b to be like a timeval.
- */
-struct timespec {
- time_t tv_sec; /* seconds */
- long tv_nsec; /* and nanoseconds */
-};
-
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
-
-struct timezone {
- int tz_minuteswest; /* minutes west of Greenwich */
- int tz_dsttime; /* type of dst correction */
-};
-#define DST_NONE 0 /* not on dst */
-#define DST_USA 1 /* USA style dst */
-#define DST_AUST 2 /* Australian style dst */
-#define DST_WET 3 /* Western European dst */
-#define DST_MET 4 /* Middle European dst */
-#define DST_EET 5 /* Eastern European dst */
-#define DST_CAN 6 /* Canada */
-
-/* Operations on timevals. */
-#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
-#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
-#define timercmp(tvp, uvp, cmp) \
- (((tvp)->tv_sec == (uvp)->tv_sec) ? \
- ((tvp)->tv_usec cmp (uvp)->tv_usec) : \
- ((tvp)->tv_sec cmp (uvp)->tv_sec))
-#define timeradd(tvp, uvp, vvp) \
- do { \
- (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
- (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
- if ((vvp)->tv_usec >= 1000000) { \
- (vvp)->tv_sec++; \
- (vvp)->tv_usec -= 1000000; \
- } \
- } while (0)
-#define timersub(tvp, uvp, vvp) \
- do { \
- (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
- (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
- if ((vvp)->tv_usec < 0) { \
- (vvp)->tv_sec--; \
- (vvp)->tv_usec += 1000000; \
- } \
- } while (0)
-
-/*
- * Names of the interval timers, and structure
- * defining a timer setting.
- */
-#define ITIMER_REAL 0
-#define ITIMER_VIRTUAL 1
-#define ITIMER_PROF 2
-
-struct itimerval {
- struct timeval it_interval; /* timer interval */
- struct timeval it_value; /* current value */
-};
-
-/*
- * Getkerninfo clock information structure
- */
-struct clockinfo {
- int hz; /* clock frequency */
- int tick; /* micro-seconds per hz tick */
- int tickadj; /* clock skew rate for adjtime() */
- int stathz; /* statistics clock frequency */
- int profhz; /* profiling clock frequency */
-};
-
-#ifdef _KERNEL
-int itimerfix __P_((struct timeval *tv));
-int itimerdecr __P_((struct itimerval *itp, int usec));
-void microtime __P_((struct timeval *tv));
-#else /* !_KERNEL */
-#include <time.h>
-
-#ifndef _POSIX_SOURCE
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int adjtime __P_((const struct timeval *, struct timeval *));
-int getitimer __P_((int, struct itimerval *));
-int gettimeofday __P_((struct timeval *, struct timezone *));
-int setitimer __P_((int, const struct itimerval *, struct itimerval *));
-int settimeofday __P_((const struct timeval *, const struct timezone *));
-int utimes __P_((const char *, const struct timeval *));
-__END_DECLS
-#endif /* !POSIX */
-
-#endif /* !_KERNEL */
-
-#endif /* !_SYS_TIME_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.1/timers.h b/mit-pthreads/machdep/netbsd-1.1/timers.h
deleted file mode 100755
index b603b78e6b2..00000000000
--- a/mit-pthreads/machdep/netbsd-1.1/timers.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * timers.h,v 1.50 1994/08/08 03:44:09 proven Exp
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <sys/time.h>
-
-#endif
diff --git a/mit-pthreads/machdep/netbsd-1.1/wait.h b/mit-pthreads/machdep/netbsd-1.1/wait.h
deleted file mode 100755
index 0a1e9285e56..00000000000
--- a/mit-pthreads/machdep/netbsd-1.1/wait.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/* $NetBSD: wait.h,v 1.11 1996/04/09 20:55:51 cgd Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1989, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)wait.h 8.2 (Berkeley) 7/10/94
- */
-
-#ifndef _SYS_WAIT_H_
-#define _SYS_WAIT_H_
-
-/*
- * This file holds definitions relevent to the wait4 system call
- * and the alternate interfaces that use it (wait, wait3, waitpid).
- */
-
-/*
- * Macros to test the exit status returned by wait
- * and extract the relevant values.
- */
-#ifdef _POSIX_SOURCE
-#define _W_INT(i) (i)
-#else
-#define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */
-#define WCOREFLAG 0200
-#endif
-
-#define _WSTATUS(x) (_W_INT(x) & 0177)
-#define _WSTOPPED 0177 /* _WSTATUS if process is stopped */
-#define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED)
-#define WSTOPSIG(x) (_W_INT(x) >> 8)
-#define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0)
-#define WTERMSIG(x) (_WSTATUS(x))
-#define WIFEXITED(x) (_WSTATUS(x) == 0)
-#define WEXITSTATUS(x) (_W_INT(x) >> 8)
-#ifndef _POSIX_SOURCE
-#define WCOREDUMP(x) (_W_INT(x) & WCOREFLAG)
-
-#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
-#define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED)
-#endif
-
-/*
- * Option bits for the third argument of wait4. WNOHANG causes the
- * wait to not hang if there are no stopped or terminated processes, rather
- * returning an error indication in this case (pid==0). WUNTRACED
- * indicates that the caller should receive status about untraced children
- * which stop due to signals. If children are stopped and a wait without
- * this option is done, it is as though they were still running... nothing
- * about them is returned.
- */
-#define WNOHANG 1 /* don't hang in wait */
-#define WUNTRACED 2 /* tell about stopped, untraced children */
-
-#ifndef _POSIX_SOURCE
-/* POSIX extensions and 4.2/4.3 compatability: */
-
-/*
- * Tokens for special values of the "pid" parameter to wait4.
- */
-#define WAIT_ANY (-1) /* any process */
-#define WAIT_MYPGRP 0 /* any process in my process group */
-
-#include <machine/endian.h>
-
-/*
- * Deprecated:
- * Structure of the information in the status word returned by wait4.
- * If w_stopval==WSTOPPED, then the second structure describes
- * the information returned, else the first.
- */
-union wait {
- int w_status; /* used in syscall */
- /*
- * Terminated process status.
- */
- struct {
-#if BYTE_ORDER == LITTLE_ENDIAN
- unsigned int w_Termsig:7, /* termination signal */
- w_Coredump:1, /* core dump indicator */
- w_Retcode:8, /* exit code if w_termsig==0 */
- w_Filler:16; /* upper bits filler */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- unsigned int w_Filler:16, /* upper bits filler */
- w_Retcode:8, /* exit code if w_termsig==0 */
- w_Coredump:1, /* core dump indicator */
- w_Termsig:7; /* termination signal */
-#endif
- } w_T;
- /*
- * Stopped process status. Returned
- * only for traced children unless requested
- * with the WUNTRACED option bit.
- */
- struct {
-#if BYTE_ORDER == LITTLE_ENDIAN
- unsigned int w_Stopval:8, /* == W_STOPPED if stopped */
- w_Stopsig:8, /* signal that stopped us */
- w_Filler:16; /* upper bits filler */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- unsigned int w_Filler:16, /* upper bits filler */
- w_Stopsig:8, /* signal that stopped us */
- w_Stopval:8; /* == W_STOPPED if stopped */
-#endif
- } w_S;
-};
-#define w_termsig w_T.w_Termsig
-#define w_coredump w_T.w_Coredump
-#define w_retcode w_T.w_Retcode
-#define w_stopval w_S.w_Stopval
-#define w_stopsig w_S.w_Stopsig
-
-#define WSTOPPED _WSTOPPED
-#endif /* _POSIX_SOURCE */
-
-#ifndef _KERNEL
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-struct rusage; /* forward declaration */
-
-pid_t wait __P_((int *));
-pid_t waitpid __P_((pid_t, int *, int));
-#ifndef _POSIX_SOURCE
-pid_t wait3 __P_((int *, int, void *));
-pid_t wait4 __P_((pid_t, int *, int, void *));
-#endif
-__END_DECLS
-#endif
-
-#endif /* !_SYS_WAIT_H_ */
diff --git a/mit-pthreads/machdep/openbsd-2.0/__math.h b/mit-pthreads/machdep/openbsd-2.0/__math.h
deleted file mode 100755
index 27ed0f2575d..00000000000
--- a/mit-pthreads/machdep/openbsd-2.0/__math.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * ANSI/POSIX
- */
-extern char __infinity[];
-#define HUGE_VAL (*(double *) __infinity)
-
diff --git a/mit-pthreads/machdep/openbsd-2.0/__path.h b/mit-pthreads/machdep/openbsd-2.0/__path.h
deleted file mode 100755
index 432494daafa..00000000000
--- a/mit-pthreads/machdep/openbsd-2.0/__path.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * $Id$
- */
-
-#ifndef _SYS__PATH_H_
-#define _SYS__PATH_H_
-
-#define _PATH_PTY "/dev/"
-#define _PATH_TZDIR "/usr/share/zoneinfo"
-#define _PATH_TZFILE "/etc/localtime"
-
-#endif /* !_SYS__PATH_H_ */
-
diff --git a/mit-pthreads/machdep/openbsd-2.0/__signal.h b/mit-pthreads/machdep/openbsd-2.0/__signal.h
deleted file mode 100755
index 918955c9948..00000000000
--- a/mit-pthreads/machdep/openbsd-2.0/__signal.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <sys/signal.h>
-
-#define __SIGEMPTYSET 0
-#define __SIGFILLSET 0xffffffff
-#define __SIGADDSET(s, n) (*(s) |= 1 << ((n) - 1), 0)
-#define __SIGDELSET(s, n) (*(s) &= ~(1 << ((n) - 1)), 0)
-#define __SIGISMEMBER(s, n) ((*(s) & (1 << ((n) - 1))) != 0)
-
diff --git a/mit-pthreads/machdep/openbsd-2.0/__stdio.h b/mit-pthreads/machdep/openbsd-2.0/__stdio.h
deleted file mode 100755
index d60b9df7a54..00000000000
--- a/mit-pthreads/machdep/openbsd-2.0/__stdio.h
+++ /dev/null
@@ -1,8 +0,0 @@
-
-#include <machine/ansi.h>
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-typedef pthread_fpos_t fpos_t; /* Must match off_t <sys/types.h> */
diff --git a/mit-pthreads/machdep/openbsd-2.0/__stdlib.h b/mit-pthreads/machdep/openbsd-2.0/__stdlib.h
deleted file mode 100755
index 5ee2b8ed3d9..00000000000
--- a/mit-pthreads/machdep/openbsd-2.0/__stdlib.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * $Id$
- */
-
-#ifndef _SYS___STDLIB_H_
-#define _SYS___STDLIB_H_
-
-#include <machine/ansi.h>
-
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-#ifdef _BSD_WCHAR_T_
-typedef _BSD_WCHAR_T_ wchar_t;
-#ifdef _BSD_RUNE_T_
-typedef _BSD_RUNE_T_ rune_t;
-#undef _BSD_RUNE_T_
-#else
-typedef _BSD_WCHAR_T_ rune_t;
-#endif
-#undef _BSD_WCHAR_T_
-#endif
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#endif /* _STDLIB_H_ */
diff --git a/mit-pthreads/machdep/openbsd-2.0/__string.h b/mit-pthreads/machdep/openbsd-2.0/__string.h
deleted file mode 100755
index 93d4fcf9dd2..00000000000
--- a/mit-pthreads/machdep/openbsd-2.0/__string.h
+++ /dev/null
@@ -1,21 +0,0 @@
-
-#include <machine/ansi.h>
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-/* Non-standard NetBSD string routines. */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-__BEGIN_DECLS
-int bcmp __P_((const void *, const void *, size_t));
-void bcopy __P_((const void *, void *, size_t));
-void bzero __P_((void *, size_t));
-char *index __P_((const char *, int));
-char *rindex __P_((const char *, int));
-char *strdup __P_((const char *));
-void strmode __P_((int, char *));
-char *strsep __P_((char **, const char *));
-__END_DECLS
-#endif
-
diff --git a/mit-pthreads/machdep/openbsd-2.0/__time.h b/mit-pthreads/machdep/openbsd-2.0/__time.h
deleted file mode 100755
index 5c4b722bc3c..00000000000
--- a/mit-pthreads/machdep/openbsd-2.0/__time.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * $Id$
- */
-
-#ifndef _SYS__TIME_H_
-#define _SYS__TIME_H_
-
-#include <machine/ansi.h>
-#include <machine/limits.h>
-
-#ifdef _BSD_CLOCK_T_
-typedef _BSD_CLOCK_T_ clock_t;
-#undef _BSD_CLOCK_T_
-#endif
-
-#ifdef _BSD_TIME_T_
-typedef _BSD_TIME_T_ time_t;
-#undef _BSD_TIME_T_
-#endif
-
-#ifdef _BSD_SIZE_T_
-typedef _BSD_SIZE_T_ size_t;
-#undef _BSD_SIZE_T_
-#endif
-
-#define CLOCKS_PER_SEC 100
-
-#if !defined(CLK_TCK)
-#define CLK_TCK 100
-#endif /* not CLK_TCK */
-
-#endif /* !_SYS__TIME_H_ */
diff --git a/mit-pthreads/machdep/openbsd-2.0/__unistd.h b/mit-pthreads/machdep/openbsd-2.0/__unistd.h
deleted file mode 100755
index 41244522461..00000000000
--- a/mit-pthreads/machdep/openbsd-2.0/__unistd.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * $Id$
- */
-
-#ifndef _SYS___UNISTD_H_
-#define _SYS___UNISTD_H_
-
-#include <sys/types.h>
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#define ioctl_request_type unsigned long /* For fd.c */
-
-/* compile-time symbolic constants */
-#define _POSIX_JOB_CONTROL /* implementation supports job control */
-
-#ifdef _NOT_AVAILABLE
-#define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */
-#endif
-
-#define _POSIX_VERSION 198808L
-#define _POSIX2_VERSION 199212L
-
-/* execution-time symbolic constants */
- /* chown requires appropriate privileges */
-#define _POSIX_CHOWN_RESTRICTED 1
- /* too-long path components generate errors */
-#define _POSIX_NO_TRUNC 1
- /* may disable terminal special characters */
-/* #define _POSIX_VDISABLE 0xff */
-
-/* configurable pathname variables */
-#define _PC_LINK_MAX 1
-#define _PC_MAX_CANON 2
-#define _PC_MAX_INPUT 3
-#define _PC_NAME_MAX 4
-#define _PC_PATH_MAX 5
-#define _PC_PIPE_BUF 6
-#define _PC_CHOWN_RESTRICTED 7
-#define _PC_NO_TRUNC 8
-#define _PC_VDISABLE 9
-
-/* configurable system variables */
-#define _SC_ARG_MAX 1
-#define _SC_CHILD_MAX 2
-#define _SC_CLK_TCK 3
-#define _SC_NGROUPS_MAX 4
-#define _SC_OPEN_MAX 5
-#define _SC_JOB_CONTROL 6
-#define _SC_SAVED_IDS 7
-#define _SC_VERSION 8
-#define _SC_BC_BASE_MAX 9
-#define _SC_BC_DIM_MAX 10
-#define _SC_BC_SCALE_MAX 11
-#define _SC_BC_STRING_MAX 12
-#define _SC_COLL_WEIGHTS_MAX 13
-#define _SC_EXPR_NEST_MAX 14
-#define _SC_LINE_MAX 15
-#define _SC_RE_DUP_MAX 16
-#define _SC_2_VERSION 17
-#define _SC_2_C_BIND 18
-#define _SC_2_C_DEV 19
-#define _SC_2_CHAR_TERM 20
-#define _SC_2_FORT_DEV 21
-#define _SC_2_FORT_RUN 22
-#define _SC_2_LOCALEDEF 23
-#define _SC_2_SW_DEV 24
-#define _SC_2_UPE 25
-#define _SC_STREAM_MAX 26
-#define _SC_TZNAME_MAX 27
-
-/* configurable system strings */
-#define _CS_PATH 1
-
-#endif
diff --git a/mit-pthreads/machdep/openbsd-2.0/compat.h b/mit-pthreads/machdep/openbsd-2.0/compat.h
deleted file mode 100755
index e7de318aa88..00000000000
--- a/mit-pthreads/machdep/openbsd-2.0/compat.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* ==== compat.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : COmpat header to make socket code compile.
- *
- * 1.00 94/08/01 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_COMPAT_H_
-#define _SYS_COMPAT_H_
-
-#endif
diff --git a/mit-pthreads/machdep/openbsd-2.0/dirent.h b/mit-pthreads/machdep/openbsd-2.0/dirent.h
deleted file mode 100755
index 5226443f86b..00000000000
--- a/mit-pthreads/machdep/openbsd-2.0/dirent.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 5.18 (Berkeley) 2/23/91
- */
-
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-/*
- * A directory entry has a struct dirent at the front of it, containing its
- * inode number, the length of the entry, and the length of the name
- * contained in the entry. These are followed by the name padded to a 4
- * byte boundary with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- */
-
-struct dirent {
- u_long d_fileno; /* file number of entry */
- u_short d_reclen; /* length of this record */
- u_short d_namlen; /* length of string in d_name */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
-#define MAXNAMLEN 255
- char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
-#endif
-};
-
-#define d_ino d_fileno /* backward compatibility */
-
-/* definitions for library routines operating on directories. */
-#define DIRBLKSIZ 1024
-
-#endif /* !_DIRENT_H_ */
diff --git a/mit-pthreads/machdep/openbsd-2.0/errno.h b/mit-pthreads/machdep/openbsd-2.0/errno.h
deleted file mode 100755
index 3da61d692a3..00000000000
--- a/mit-pthreads/machdep/openbsd-2.0/errno.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/* $NetBSD: errno.h,v 1.8 1994/06/29 06:44:02 cgd Exp $ */
-
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)errno.h 8.5 (Berkeley) 1/21/94
- */
-
-#ifndef _SYS_ERRNO_H_
-#define _SYS_ERRNO_H_
-
-#define EPERM 1 /* Operation not permitted */
-#define ENOENT 2 /* No such file or directory */
-#define ESRCH 3 /* No such process */
-#define EINTR 4 /* Interrupted system call */
-#define EIO 5 /* Input/output error */
-#define ENXIO 6 /* Device not configured */
-#define E2BIG 7 /* Argument list too long */
-#define ENOEXEC 8 /* Exec format error */
-#define EBADF 9 /* Bad file descriptor */
-#define ECHILD 10 /* No child processes */
-#define EDEADLK 11 /* Resource deadlock avoided */
- /* 11 was EAGAIN */
-#define ENOMEM 12 /* Cannot allocate memory */
-#define EACCES 13 /* Permission denied */
-#define EFAULT 14 /* Bad address */
-#ifndef _POSIX_SOURCE
-#define ENOTBLK 15 /* Block device required */
-#endif
-#define EBUSY 16 /* Device busy */
-#define EEXIST 17 /* File exists */
-#define EXDEV 18 /* Cross-device link */
-#define ENODEV 19 /* Operation not supported by device */
-#define ENOTDIR 20 /* Not a directory */
-#define EISDIR 21 /* Is a directory */
-#define EINVAL 22 /* Invalid argument */
-#define ENFILE 23 /* Too many open files in system */
-#define EMFILE 24 /* Too many open files */
-#define ENOTTY 25 /* Inappropriate ioctl for device */
-#ifndef _POSIX_SOURCE
-#define ETXTBSY 26 /* Text file busy */
-#endif
-#define EFBIG 27 /* File too large */
-#define ENOSPC 28 /* No space left on device */
-#define ESPIPE 29 /* Illegal seek */
-#define EROFS 30 /* Read-only file system */
-#define EMLINK 31 /* Too many links */
-#define EPIPE 32 /* Broken pipe */
-
-/* math software */
-#define EDOM 33 /* Numerical argument out of domain */
-#define ERANGE 34 /* Result too large */
-
-/* non-blocking and interrupt i/o */
-#define EAGAIN 35 /* Resource temporarily unavailable */
-#ifndef _POSIX_SOURCE
-#define EWOULDBLOCK EAGAIN /* Operation would block */
-#define EINPROGRESS 36 /* Operation now in progress */
-#define EALREADY 37 /* Operation already in progress */
-
-/* ipc/network software -- argument errors */
-#define ENOTSOCK 38 /* Socket operation on non-socket */
-#define EDESTADDRREQ 39 /* Destination address required */
-#define EMSGSIZE 40 /* Message too long */
-#define EPROTOTYPE 41 /* Protocol wrong type for socket */
-#define ENOPROTOOPT 42 /* Protocol not available */
-#define EPROTONOSUPPORT 43 /* Protocol not supported */
-#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
-#define EOPNOTSUPP 45 /* Operation not supported */
-#define EPFNOSUPPORT 46 /* Protocol family not supported */
-#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
-#define EADDRINUSE 48 /* Address already in use */
-#define EADDRNOTAVAIL 49 /* Can't assign requested address */
-
-/* ipc/network software -- operational errors */
-#define ENETDOWN 50 /* Network is down */
-#define ENETUNREACH 51 /* Network is unreachable */
-#define ENETRESET 52 /* Network dropped connection on reset */
-#define ECONNABORTED 53 /* Software caused connection abort */
-#define ECONNRESET 54 /* Connection reset by peer */
-#define ENOBUFS 55 /* No buffer space available */
-#define EISCONN 56 /* Socket is already connected */
-#define ENOTCONN 57 /* Socket is not connected */
-#define ESHUTDOWN 58 /* Can't send after socket shutdown */
-#define ETOOMANYREFS 59 /* Too many references: can't splice */
-#define ETIMEDOUT 60 /* Operation timed out */
-#define ECONNREFUSED 61 /* Connection refused */
-
-#define ELOOP 62 /* Too many levels of symbolic links */
-#endif /* _POSIX_SOURCE */
-#define ENAMETOOLONG 63 /* File name too long */
-
-/* should be rearranged */
-#ifndef _POSIX_SOURCE
-#define EHOSTDOWN 64 /* Host is down */
-#define EHOSTUNREACH 65 /* No route to host */
-#endif /* _POSIX_SOURCE */
-#define ENOTEMPTY 66 /* Directory not empty */
-
-/* quotas & mush */
-#ifndef _POSIX_SOURCE
-#define EPROCLIM 67 /* Too many processes */
-#define EUSERS 68 /* Too many users */
-#define EDQUOT 69 /* Disc quota exceeded */
-
-/* Network File System */
-#define ESTALE 70 /* Stale NFS file handle */
-#define EREMOTE 71 /* Too many levels of remote in path */
-#define EBADRPC 72 /* RPC struct is bad */
-#define ERPCMISMATCH 73 /* RPC version wrong */
-#define EPROGUNAVAIL 74 /* RPC prog. not avail */
-#define EPROGMISMATCH 75 /* Program version wrong */
-#define EPROCUNAVAIL 76 /* Bad procedure for program */
-#endif /* _POSIX_SOURCE */
-
-#define ENOLCK 77 /* No locks available */
-#define ENOSYS 78 /* Function not implemented */
-
-#ifndef _POSIX_SOURCE
-#define EFTYPE 79 /* Inappropriate file type or format */
-#define EAUTH 80 /* Authentication error */
-#define ENEEDAUTH 81 /* Need authenticator */
-#define ELAST 81 /* Must be equal largest errno */
-#endif /* _POSIX_SOURCE */
-
-#endif
diff --git a/mit-pthreads/machdep/openbsd-2.0/timers.h b/mit-pthreads/machdep/openbsd-2.0/timers.h
deleted file mode 100755
index f9768c68c8f..00000000000
--- a/mit-pthreads/machdep/openbsd-2.0/timers.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <sys/time.h>
-
-#endif
diff --git a/mit-pthreads/machdep/openbsd-2.0/wait.h b/mit-pthreads/machdep/openbsd-2.0/wait.h
deleted file mode 100755
index 7861e3fa180..00000000000
--- a/mit-pthreads/machdep/openbsd-2.0/wait.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)wait.h 8.1 (Berkeley) 6/2/93
- * $Id$
- */
-
-#ifndef _SYS_WAIT_H_
-#define _SYS_WAIT_H_
-
-/*
- * This file holds definitions relevent to the wait4 system call
- * and the alternate interfaces that use it (wait, wait3, waitpid).
- */
-
-/*
- * Macros to test the exit status returned by wait
- * and extract the relevant values.
- */
-#ifdef _POSIX_SOURCE
-#define _W_INT(i) (i)
-#else
-#define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */
-#define WCOREFLAG 0200
-#endif
-
-#define _WSTATUS(x) (_W_INT(x) & 0177)
-#define _WSTOPPED 0177 /* _WSTATUS if process is stopped */
-#define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED)
-#define WSTOPSIG(x) (_W_INT(x) >> 8)
-#define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0)
-#define WTERMSIG(x) (_WSTATUS(x))
-#define WIFEXITED(x) (_WSTATUS(x) == 0)
-#define WEXITSTATUS(x) (_W_INT(x) >> 8)
-#ifndef _POSIX_SOURCE
-#define WCOREDUMP(x) (_W_INT(x) & WCOREFLAG)
-
-#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
-#define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED)
-#endif
-
-/*
- * Option bits for the third argument of wait4. WNOHANG causes the
- * wait to not hang if there are no stopped or terminated processes, rather
- * returning an error indication in this case (pid==0). WUNTRACED
- * indicates that the caller should receive status about untraced children
- * which stop due to signals. If children are stopped and a wait without
- * this option is done, it is as though they were still running... nothing
- * about them is returned.
- */
-#define WNOHANG 1 /* dont hang in wait */
-#define WUNTRACED 2 /* tell about stopped, untraced children */
-
-#ifndef _POSIX_SOURCE
-/* POSIX extensions and 4.2/4.3 compatability: */
-
-/*
- * Tokens for special values of the "pid" parameter to wait4.
- */
-#define WAIT_ANY (-1) /* any process */
-#define WAIT_MYPGRP 0 /* any process in my process group */
-
-#include <machine/endian.h>
-
-/*
- * Deprecated:
- * Structure of the information in the status word returned by wait4.
- * If w_stopval==WSTOPPED, then the second structure describes
- * the information returned, else the first.
- */
-union wait {
- int w_status; /* used in syscall */
- /*
- * Terminated process status.
- */
- struct {
-#if BYTE_ORDER == LITTLE_ENDIAN
- unsigned int w_Termsig:7, /* termination signal */
- w_Coredump:1, /* core dump indicator */
- w_Retcode:8, /* exit code if w_termsig==0 */
- w_Filler:16; /* upper bits filler */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- unsigned int w_Filler:16, /* upper bits filler */
- w_Retcode:8, /* exit code if w_termsig==0 */
- w_Coredump:1, /* core dump indicator */
- w_Termsig:7; /* termination signal */
-#endif
- } w_T;
- /*
- * Stopped process status. Returned
- * only for traced children unless requested
- * with the WUNTRACED option bit.
- */
- struct {
-#if BYTE_ORDER == LITTLE_ENDIAN
- unsigned int w_Stopval:8, /* == W_STOPPED if stopped */
- w_Stopsig:8, /* signal that stopped us */
- w_Filler:16; /* upper bits filler */
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
- unsigned int w_Filler:16, /* upper bits filler */
- w_Stopsig:8, /* signal that stopped us */
- w_Stopval:8; /* == W_STOPPED if stopped */
-#endif
- } w_S;
-};
-#define w_termsig w_T.w_Termsig
-#define w_coredump w_T.w_Coredump
-#define w_retcode w_T.w_Retcode
-#define w_stopval w_S.w_Stopval
-#define w_stopsig w_S.w_Stopsig
-
-#define WSTOPPED _WSTOPPED
-#endif /* _POSIX_SOURCE */
-
-#ifndef KERNEL
-#include <sys/types.h>
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-struct rusage; /* forward declaration */
-
-pid_t wait __P_((int *));
-pid_t waitpid __P_((pid_t, int *, int));
-#ifndef _POSIX_SOURCE
-pid_t wait3 __P_((int *, int, void *));
-pid_t wait4 __P_((pid_t, int *, int, void *));
-#endif
-__END_DECLS
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/posix-alpha-osf1.h b/mit-pthreads/machdep/posix-alpha-osf1.h
deleted file mode 100644
index 1d8bb6c5c4b..00000000000
--- a/mit-pthreads/machdep/posix-alpha-osf1.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-#define __WAIT_STATUS int *
-#include <pthread/types.h>
-
-#endif
diff --git a/mit-pthreads/machdep/posix-bsdi-1.1.h b/mit-pthreads/machdep/posix-bsdi-1.1.h
deleted file mode 100644
index 4c56ea93a3b..00000000000
--- a/mit-pthreads/machdep/posix-bsdi-1.1.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
- *
- * $Id$
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-#include <sys/cdefs.h>
-
-/* More stuff for compiling */
-#if defined(__GNUC__)
-#define __INLINE extern inline
-#else
-#define __INLINE static
-#endif
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#define __NORETURN
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#endif
-
diff --git a/mit-pthreads/machdep/posix-bsdi-2.0.h b/mit-pthreads/machdep/posix-bsdi-2.0.h
deleted file mode 100644
index 4c56ea93a3b..00000000000
--- a/mit-pthreads/machdep/posix-bsdi-2.0.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
- *
- * $Id$
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-#include <sys/cdefs.h>
-
-/* More stuff for compiling */
-#if defined(__GNUC__)
-#define __INLINE extern inline
-#else
-#define __INLINE static
-#endif
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#define __NORETURN
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#endif
-
diff --git a/mit-pthreads/machdep/posix-freebsd-1.1.h b/mit-pthreads/machdep/posix-freebsd-1.1.h
deleted file mode 100644
index e1a00e9efd1..00000000000
--- a/mit-pthreads/machdep/posix-freebsd-1.1.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
- *
- * $Id$
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-#include <sys/cdefs.h>
-
-/* More stuff for compiling */
-#if defined(__GNUC__)
-#define __INLINE extern inline
-#else
-#define __INLINE static
-#endif
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#define __NORETURN
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/posix-freebsd-2.0.h b/mit-pthreads/machdep/posix-freebsd-2.0.h
deleted file mode 100644
index 7bad77aba02..00000000000
--- a/mit-pthreads/machdep/posix-freebsd-2.0.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
- *
- * $Id$
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-#include <sys/cdefs.h>
-
-/* More stuff for compiling */
-#if defined(__GNUC__)
-#define __INLINE extern inline
-#else
-#define __INLINE static
-#endif
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/posix-hpux-10.20.h b/mit-pthreads/machdep/posix-hpux-10.20.h
deleted file mode 100644
index c7ecb429e79..00000000000
--- a/mit-pthreads/machdep/posix-hpux-10.20.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#endif
-
diff --git a/mit-pthreads/machdep/posix-hpux-9.03.h b/mit-pthreads/machdep/posix-hpux-9.03.h
deleted file mode 100644
index c7ecb429e79..00000000000
--- a/mit-pthreads/machdep/posix-hpux-9.03.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#endif
-
diff --git a/mit-pthreads/machdep/posix-i386-sco-3.2v5.h b/mit-pthreads/machdep/posix-i386-sco-3.2v5.h
deleted file mode 100644
index ab91311612d..00000000000
--- a/mit-pthreads/machdep/posix-i386-sco-3.2v5.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
- *
- * posix-freebsd-2.0.h,v 1.1 1995/03/01 01:21:30 proven Exp
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-#include <sys/cdefs.h>
-
-/* More stuff for compiling */
-#if defined(__GNUC__)
-#define __INLINE extern inline
-#else
-#define __INLINE static
-#endif
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/posix-irix-5.2.h b/mit-pthreads/machdep/posix-irix-5.2.h
deleted file mode 100644
index d387bbbbf69..00000000000
--- a/mit-pthreads/machdep/posix-irix-5.2.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1995 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Convert an IRIX-5.2 system to a more or less POSIX system.
- *
- * $Id$
- *
- * 1.00 95/06/01 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-#include <sys/cdefs.h>
-
-/* More stuff for compiling */
-#if defined(__GNUC__)
-#define __INLINE extern inline
-#else
-#define __INLINE static
-#endif
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/posix-linux-1.0.h b/mit-pthreads/machdep/posix-linux-1.0.h
deleted file mode 100644
index 7f665d6b44a..00000000000
--- a/mit-pthreads/machdep/posix-linux-1.0.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- * Description : Convert a Linux-1.0 system to a more or less POSIX system.
- * Mostly POSIX already
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-#include <sys/cdefs.h>
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#define __INLINE extern inline
-/*
- * OK now do stuff to make the code compile.
- * Every OS has its own prototypes for each function
- */
-#ifdef malloc
-#undef malloc
-#endif
-
-#ifdef free
-#undef free
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/posix-linux-2.0.h b/mit-pthreads/machdep/posix-linux-2.0.h
deleted file mode 100644
index 7f665d6b44a..00000000000
--- a/mit-pthreads/machdep/posix-linux-2.0.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- * Description : Convert a Linux-1.0 system to a more or less POSIX system.
- * Mostly POSIX already
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-#include <sys/cdefs.h>
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#define __INLINE extern inline
-/*
- * OK now do stuff to make the code compile.
- * Every OS has its own prototypes for each function
- */
-#ifdef malloc
-#undef malloc
-#endif
-
-#ifdef free
-#undef free
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/posix-netbsd-0.9.h b/mit-pthreads/machdep/posix-netbsd-0.9.h
deleted file mode 100644
index 00ff2efa327..00000000000
--- a/mit-pthreads/machdep/posix-netbsd-0.9.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
- *
- * $Id$
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-#include <sys/cdefs.h>
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#define __NORETURN
-
-#endif
diff --git a/mit-pthreads/machdep/posix-netbsd-1.0.h b/mit-pthreads/machdep/posix-netbsd-1.0.h
deleted file mode 100644
index 7bad77aba02..00000000000
--- a/mit-pthreads/machdep/posix-netbsd-1.0.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
- *
- * $Id$
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-#include <sys/cdefs.h>
-
-/* More stuff for compiling */
-#if defined(__GNUC__)
-#define __INLINE extern inline
-#else
-#define __INLINE static
-#endif
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/posix-netbsd-1.1.h b/mit-pthreads/machdep/posix-netbsd-1.1.h
deleted file mode 100644
index f4ff1dfae05..00000000000
--- a/mit-pthreads/machdep/posix-netbsd-1.1.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
- *
- * posix-netbsd-1.0.h,v 1.53 1995/02/17 03:41:34 proven Exp
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-#include <sys/cdefs.h>
-
-/* More stuff for compiling */
-#if defined(__GNUC__)
-#define __INLINE extern inline
-#else
-#define __INLINE static
-#endif
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/posix-openbsd-2.0.h b/mit-pthreads/machdep/posix-openbsd-2.0.h
deleted file mode 100644
index 7bad77aba02..00000000000
--- a/mit-pthreads/machdep/posix-openbsd-2.0.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
- *
- * $Id$
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-#include <sys/cdefs.h>
-
-/* More stuff for compiling */
-#if defined(__GNUC__)
-#define __INLINE extern inline
-#else
-#define __INLINE static
-#endif
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/posix-romp-bsd.h b/mit-pthreads/machdep/posix-romp-bsd.h
deleted file mode 100644
index 7825622b064..00000000000
--- a/mit-pthreads/machdep/posix-romp-bsd.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Convert a system to a more or less POSIX system.
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#ifndef O_NONBLOCK
-#ifdef FNDELAY
-#define O_NONBLOCK FNDELAY
-#endif
-#endif
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY|O_RDWR|O_WRONLY)
-#endif
-
-#ifndef S_ISREG
-#define S_ISREG(x) ((x & S_IFMT) == S_IFREG)
-#endif
-
-#ifndef ENOSYS
-#define ENOSYS EINVAL
-#endif
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
diff --git a/mit-pthreads/machdep/posix-sco-3.2v5.h b/mit-pthreads/machdep/posix-sco-3.2v5.h
deleted file mode 100644
index ab91311612d..00000000000
--- a/mit-pthreads/machdep/posix-sco-3.2v5.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
- *
- * posix-freebsd-2.0.h,v 1.1 1995/03/01 01:21:30 proven Exp
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-#include <sys/cdefs.h>
-
-/* More stuff for compiling */
-#if defined(__GNUC__)
-#define __INLINE extern inline
-#else
-#define __INLINE static
-#endif
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/posix-sunos-4.1.3.h b/mit-pthreads/machdep/posix-sunos-4.1.3.h
deleted file mode 100644
index 719386bc558..00000000000
--- a/mit-pthreads/machdep/posix-sunos-4.1.3.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- * Description : Do the right thing for a sunos 4.1.3 system.
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#define _PTHREAD_POSIX_H_
-
-#include <sys/cdefs.h>
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-extern long strtol();
-extern unsigned long strtoul();
-
-#endif
diff --git a/mit-pthreads/machdep/posix-sunos-5.3.h b/mit-pthreads/machdep/posix-sunos-5.3.h
deleted file mode 100644
index 9fb765d60c3..00000000000
--- a/mit-pthreads/machdep/posix-sunos-5.3.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- * Description : Do the right thing for a sunos 4.1.3 system.
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/posix-sunos-5.5.h b/mit-pthreads/machdep/posix-sunos-5.5.h
deleted file mode 100644
index 9fb765d60c3..00000000000
--- a/mit-pthreads/machdep/posix-sunos-5.5.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- * Description : Do the right thing for a sunos 4.1.3 system.
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/posix-ultrix-4.2.h b/mit-pthreads/machdep/posix-ultrix-4.2.h
deleted file mode 100644
index f21aec23ea3..00000000000
--- a/mit-pthreads/machdep/posix-ultrix-4.2.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ==== posix.h ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * $Id$
- *
- * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_POSIX_H_
-#define _PTHREAD_POSIX_H_
-
-#include <sys/cdefs.h>
-
-/* Make sure we have size_t defined */
-#include <pthread/types.h>
-
-#ifndef __WAIT_STATUS
-#define __WAIT_STATUS int *
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-4.1.3/__math.h b/mit-pthreads/machdep/sunos-4.1.3/__math.h
deleted file mode 100755
index 9de1dc6d4bd..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/__math.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * Posix (actually ansi C) section
- */
-#define HUGE_VAL (__infinity()) /* Produces IEEE Infinity. */
-
diff --git a/mit-pthreads/machdep/sunos-4.1.3/__path.h b/mit-pthreads/machdep/sunos-4.1.3/__path.h
deleted file mode 100755
index 2665b5a0e8a..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/__path.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef _SYS__PATH_H_
-#define _SYS__PATH_H_
-
-#define _PATH_PTY "/dev/"
-#define _PATH_TZDIR "/usr/share/zoneinfo"
-#define _PATH_TZFILE "localtime"
-
-#endif /* !_SYS__PATH_H_ */
diff --git a/mit-pthreads/machdep/sunos-4.1.3/__signal.h b/mit-pthreads/machdep/sunos-4.1.3/__signal.h
deleted file mode 100755
index f8b4fb8b6de..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/__signal.h
+++ /dev/null
@@ -1,11 +0,0 @@
-
-#include <sys/signal.h>
-#include <sys/stdtypes.h>
-
-typedef int sig_atomic_t;
-
-#define __SIGFILLSET 0xffffffff
-#define __SIGEMPTYSET 0
-#define __SIGADDSET(s,n) ((*s) |= (1 << ((n) - 1)))
-#define __SIGDELSET(s,n) ((*s) &= ~(1 << ((n) - 1)))
-#define __SIGISMEMBER(s,n) ((*s) & (1 << ((n) - 1)))
diff --git a/mit-pthreads/machdep/sunos-4.1.3/__stdio.h b/mit-pthreads/machdep/sunos-4.1.3/__stdio.h
deleted file mode 100755
index 6ca5e57396d..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/__stdio.h
+++ /dev/null
@@ -1,4 +0,0 @@
-
-typedef pthread_fpos_t fpos_t;
-
-#include <sys/stdtypes.h>
diff --git a/mit-pthreads/machdep/sunos-4.1.3/__stdlib.h b/mit-pthreads/machdep/sunos-4.1.3/__stdlib.h
deleted file mode 100755
index 7bb9093c51c..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/__stdlib.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* $Id$ */
-
-#ifndef __sys_stdtypes_h
-
-#ifndef _SYS___STDLIB_H_
-#define _SYS___STDLIB_H_
-
-#include <sys/stdtypes.h> /* to get size_t */
-
-#if (! defined _SIZE_T_ ) && (! defined(_GCC_SIZE_T))
-#define _SIZE_T_
-#define _GCC_SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-#if (! defined _WCHAR_T_ ) && (! defined(_GCC_WCHAR_T))
-#define _WCHAR_T_
-#define _GCC_WCHAR_T
-typedef unsigned int wchar_t;
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-4.1.3/__string.h b/mit-pthreads/machdep/sunos-4.1.3/__string.h
deleted file mode 100755
index 0859a80cf24..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/__string.h
+++ /dev/null
@@ -1,14 +0,0 @@
-
-#include <sys/stdtypes.h>
-
-/* Non-standard SunOS 4.x string routines. */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-__BEGIN_DECLS
-int bcmp __P_((const void *, const void *, size_t));
-void bcopy __P_((const void *, void *, size_t));
-void bzero __P_((void *, size_t));
-char *index __P_((const char *, int));
-char *rindex __P_((const char *, int));
-char *strdup __P_((const char *));
-__END_DECLS
-#endif
diff --git a/mit-pthreads/machdep/sunos-4.1.3/__time.h b/mit-pthreads/machdep/sunos-4.1.3/__time.h
deleted file mode 100755
index 1ffa0e47d3f..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/__time.h
+++ /dev/null
@@ -1,2 +0,0 @@
-
-#include <sys/stdtypes.h>
diff --git a/mit-pthreads/machdep/sunos-4.1.3/__unistd.h b/mit-pthreads/machdep/sunos-4.1.3/__unistd.h
deleted file mode 100755
index 3b86527252c..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/__unistd.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * $Id$
- */
-
-#ifndef _SYS___UNISTD_H_
-#define _SYS___UNISTD_H_
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-#define _SC_ARG_MAX 1 /* space for argv & envp */
-#define _SC_CHILD_MAX 2 /* maximum children per process??? */
-#define _SC_CLK_TCK 3 /* clock ticks/sec */
-#define _SC_NGROUPS_MAX 4 /* number of groups if multple supp. */
-#define _SC_OPEN_MAX 5 /* max open files per process */
-#define _SC_JOB_CONTROL 6 /* do we have job control */
-#define _SC_SAVED_IDS 7 /* do we have saved uid/gids */
-#define _SC_VERSION 8 /* POSIX version supported */
-
-#define _POSIX_JOB_CONTROL 1
-#define _POSIX_SAVED_IDS 1
-#define _POSIX_VERSION 198808
-
-#define _PC_LINK_MAX 1 /* max links to file/dir */
-#define _PC_MAX_CANON 2 /* max line length */
-#define _PC_MAX_INPUT 3 /* max "packet" to a tty device */
-#define _PC_NAME_MAX 4 /* max pathname component length */
-#define _PC_PATH_MAX 5 /* max pathname length */
-#define _PC_PIPE_BUF 6 /* size of a pipe */
-#define _PC_CHOWN_RESTRICTED 7 /* can we give away files */
-#define _PC_NO_TRUNC 8 /* trunc or error on >NAME_MAX */
-#define _PC_VDISABLE 9 /* best char to shut off tty c_cc */
-#define _PC_LAST 9 /* highest value of any _PC_* */
-
-#ifndef NULL
-#define NULL 0 /* null pointer constant */
-#endif
-
-typedef int ssize_t;
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-4.1.3/cdefs.h b/mit-pthreads/machdep/sunos-4.1.3/cdefs.h
deleted file mode 100755
index a059fa3d3fc..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/cdefs.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ==== cdefs.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Similar to the BSD cdefs.h file.
- *
- * 1.00 94/01/26 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_SYS_CDEFS_H_
-#define _PTHREAD_SYS_CDEFS_H_
-
-/* Stuff for compiling */
-#if defined(__GNUC__)
-#if defined(__cplusplus)
-#define __INLINE static inline
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS };
-#else
-#define __INLINE extern inline
-#define __CAN_DO_EXTERN_INLINE
-#define __BEGIN_DECLS
-#define __END_DECLS
-#if !defined(__STDC__)
-#define const __const
-#define inline __inline
-#define signed __signed
-#define volatile __volatile
-#endif
-#endif
-#else /* !__GNUC__ */
-#define __BEGIN_DECLS
-#define __END_DECLS
-#define __INLINE static
-#endif
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif /* __NORETURN not defined. */
-
-#ifndef _U_INT32_T_
-#define _U_INT32_T_
-typedef unsigned int u_int32_t;
-#endif
-
-#ifndef _U_INT16_T_
-#define _U_INT16_T_
-typedef unsigned short u_int16_t;
-#endif
-
-#ifndef _INT32_T_
-#define _INT32_T_
-typedef int int32_t;
-#endif
-
-#ifndef _INT16_T_
-#define _INT16_T_
-typedef short int16_t;
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-4.1.3/compat.h b/mit-pthreads/machdep/sunos-4.1.3/compat.h
deleted file mode 100755
index b2a846d00ee..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/compat.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ==== compat.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_COMPAT_H_
-#define _SYS_COMPAT_H_
-
-#define omsghdr msghdr
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-4.1.3/dirent.h b/mit-pthreads/machdep/sunos-4.1.3/dirent.h
deleted file mode 100755
index c2048b1741c..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/dirent.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 5.18 (Berkeley) 2/23/91
- */
-
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-/*
- * A directory entry has a struct dirent at the front of it, containing its
- * inode number, the length of the entry, and the length of the name
- * contained in the entry. These are followed by the name padded to a 4
- * byte boundary with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- */
-
-struct dirent {
- off_t d_off; /* offset of next disk dir entry */
- u_long d_fileno; /* file number of entry */
- u_short d_reclen; /* length of this record */
- u_short d_namlen; /* length of string in d_name */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
-#define MAXNAMLEN 255
- char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
-#endif
-};
-
-#define d_ino d_fileno
-
-#endif /* !_SYS_DIRENT_H_ */
-
-
diff --git a/mit-pthreads/machdep/sunos-4.1.3/fcntlcom.h b/mit-pthreads/machdep/sunos-4.1.3/fcntlcom.h
deleted file mode 100755
index 2b7acce7696..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/fcntlcom.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/* @(#)fcntlcom.h 1.13 91/06/18 SMI; from UCB fcntl.h 5.2 1/8/86 */
-
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- */
-
-#ifndef __sys_fcntlcom_h
-#define __sys_fcntlcom_h
-
-#include <sys/cdefs.h>
-
-/*
- * Rewack the FXXXXX values as _FXXXX so that _POSIX_SOURCE works.
- */
-#define _FOPEN (-1) /* from sys/file.h, kernel use only */
-#define _FREAD 0x0001 /* read enabled */
-#define _FWRITE 0x0002 /* write enabled */
-#define _FNDELAY 0x0004 /* non blocking I/O (4.2 style) */
-#define _FAPPEND 0x0008 /* append (writes guaranteed at the end) */
-#define _FSETBLK 0x0010 /* use block offsets */
-#define _FASYNC 0x0040 /* signal pgrp when data ready */
-#define _FSHLOCK 0x0080 /* BSD flock() shared lock present */
-#define _FEXLOCK 0x0100 /* BSD flock() exclusive lock present */
-#define _FCREAT 0x0200 /* open with file create */
-#define _FTRUNC 0x0400 /* open with truncation */
-#define _FEXCL 0x0800 /* error on open if file exists */
-#define _FNBIO 0x1000 /* non blocking I/O (sys5 style) */
-#define _FSYNC 0x2000 /* do all writes synchronously */
-#define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */
-#define _FNOCTTY 0x8000 /* don't assign a ctty on this open */
-#define _FMARK 0x10000 /* internal; mark during gc() */
-#define _FDEFER 0x20000 /* internal; defer for next gc pass */
-
-#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
-
-/*
- * Flag values for open(2) and fcntl(2)
- * The kernel adds 1 to the open modes to turn it into some
- * combination of FREAD and FWRITE.
- */
-#define O_RDONLY 0 /* +1 == FREAD */
-#define O_WRONLY 1 /* +1 == FWRITE */
-#define O_RDWR 2 /* +1 == FREAD|FWRITE */
-#define O_APPEND _FAPPEND
-#define O_CREAT _FCREAT
-#define O_TRUNC _FTRUNC
-#define O_EXCL _FEXCL
-/* O_SYNC _FSYNC not posix, defined below */
-/* O_NDELAY _FNDELAY set in include/fcntl.h */
-/* O_NDELAY _FNBIO set in 5include/fcntl.h */
-#define O_NONBLOCK _FNONBLOCK
-#define O_NOCTTY _FNOCTTY
-
-#ifndef _POSIX_SOURCE
-
-#define O_SYNC _FSYNC
-
-/*
- * Flags that work for fcntl(fd, F_SETFL, FXXXX)
- */
-#define FAPPEND _FAPPEND
-#define FSYNC _FSYNC
-#define FASYNC _FASYNC
-#define FNBIO _FNBIO
-#define FNONBIO _FNONBLOCK /* XXX fix to be NONBLOCK everywhere */
-#define FNDELAY _FNDELAY
-
-/*
- * Flags that are disallowed for fcntl's (FCNTLCANT);
- * used for opens, internal state, or locking.
- */
-#define FREAD _FREAD
-#define FWRITE _FWRITE
-#define FMARK _FMARK
-#define FDEFER _FDEFER
-#define FSETBLK _FSETBLK
-#define FSHLOCK _FSHLOCK
-#define FEXLOCK _FEXLOCK
-
-/*
- * The rest of the flags, used only for opens
- */
-#define FOPEN _FOPEN
-#define FCREAT _FCREAT
-#define FTRUNC _FTRUNC
-#define FEXCL _FEXCL
-#define FNOCTTY _FNOCTTY
-
-#endif !_POSIX_SOURCE
-
-/* XXX close on exec request; must match UF_EXCLOSE in user.h */
-#define FD_CLOEXEC 1 /* posix */
-
-/* fcntl(2) requests */
-#define F_DUPFD 0 /* Duplicate fildes */
-#define F_GETFD 1 /* Get fildes flags (close on exec) */
-#define F_SETFD 2 /* Set fildes flags (close on exec) */
-#define F_GETFL 3 /* Get file flags */
-#define F_SETFL 4 /* Set file flags */
-#ifndef _POSIX_SOURCE
-#define F_GETOWN 5 /* Get owner - for ASYNC */
-#define F_SETOWN 6 /* Set owner - for ASYNC */
-#endif /* !_POSIX_SOURCE */
-#define F_GETLK 7 /* Get record-locking information */
-#define F_SETLK 8 /* Set or Clear a record-lock (Non-Blocking) */
-#define F_SETLKW 9 /* Set or Clear a record-lock (Blocking) */
-#ifndef _POSIX_SOURCE
-#define F_RGETLK 10 /* Test a remote lock to see if it is blocked */
-#define F_RSETLK 11 /* Set or unlock a remote lock */
-#define F_CNVT 12 /* Convert a fhandle to an open fd */
-#define F_RSETLKW 13 /* Set or Clear remote record-lock(Blocking) */
-#endif /* !_POSIX_SOURCE */
-
-/* fcntl(2) flags (l_type field of flock structure) */
-#define F_RDLCK 1 /* read lock */
-#define F_WRLCK 2 /* write lock */
-#define F_UNLCK 3 /* remove lock(s) */
-#ifndef _POSIX_SOURCE
-#define F_UNLKSYS 4 /* remove remote locks for a given system */
-#endif /* !_POSIX_SOURCE */
-
-#include <sys/stdtypes.h>
-
-/* file segment locking set data type - information passed to system by user */
-struct flock {
- short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
- short l_whence; /* flag to choose starting offset */
- long l_start; /* relative offset, in bytes */
- long l_len; /* length, in bytes; 0 means lock to EOF */
- short l_pid; /* returned with F_GETLK */
- short l_xxx; /* reserved for future use */
-};
-
-#ifndef _POSIX_SOURCE
-/* extended file segment locking set data type */
-struct eflock {
- short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
- short l_whence; /* flag to choose starting offset */
- long l_start; /* relative offset, in bytes */
- long l_len; /* length, in bytes; 0 means lock to EOF */
- short l_pid; /* returned with F_GETLK */
- short l_xxx; /* reserved for future use */
- long l_rpid; /* Remote process id wanting this lock */
- long l_rsys; /* Remote system id wanting this lock */
-};
-#endif /* !_POSIX_SOURCE */
-
-#ifndef KERNEL
-#include <sys/stat.h> /* sigh. for the mode bits for open/creat */
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-
-int open __P_((const char *path, int flags, ...));
-int creat __P_((const char *path, mode_t modes));
-int fcntl __P_((int fd, int cmd, ...));
-
-__END_DECLS
-
-#endif /* !KERNEL */
-#endif /* !__sys_fcntlcom_h */
diff --git a/mit-pthreads/machdep/sunos-4.1.3/signal.h b/mit-pthreads/machdep/sunos-4.1.3/signal.h
deleted file mode 100755
index 02a19860922..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/signal.h
+++ /dev/null
@@ -1,98 +0,0 @@
-#ifndef __sys_signal_h
-#define __sys_signal_h
-
-#define NSIG 32
-
-/*
- * If any signal defines (SIG*) are added, deleted, or changed, the same
- * changes must be made in /usr/include/signal.h as well.
- */
-#define SIGHUP 1 /* hangup */
-#define SIGINT 2 /* interrupt */
-#define SIGQUIT 3 /* quit */
-#define SIGILL 4 /* illegal instruction (not reset when caught) */
-#define SIGTRAP 5 /* trace trap (not reset when caught) */
-#define SIGIOT 6 /* IOT instruction */
-#define SIGABRT 6 /* used by abort, replace SIGIOT in the future */
-#define SIGEMT 7 /* EMT instruction */
-#define SIGFPE 8 /* floating point exception */
-#define SIGKILL 9 /* kill (cannot be caught or ignored) */
-#define SIGBUS 10 /* bus error */
-#define SIGSEGV 11 /* segmentation violation */
-#define SIGSYS 12 /* bad argument to system call */
-#define SIGPIPE 13 /* write on a pipe with no one to read it */
-#define SIGALRM 14 /* alarm clock */
-#define SIGTERM 15 /* software termination signal from kill */
-#define SIGURG 16 /* urgent condition on IO channel */
-#define SIGSTOP 17 /* sendable stop signal not from tty */
-#define SIGTSTP 18 /* stop signal from tty */
-#define SIGCONT 19 /* continue a stopped process */
-#define SIGCHLD 20 /* to parent on child stop or exit */
-#define SIGCLD 20 /* System V name for SIGCHLD */
-#define SIGTTIN 21 /* to readers pgrp upon background tty read */
-#define SIGTTOU 22 /* like TTIN for output if (tp->t_local&LTOSTOP) */
-#define SIGIO 23 /* input/output possible signal */
-#define SIGPOLL SIGIO /* System V name for SIGIO */
-#define SIGXCPU 24 /* exceeded CPU time limit */
-#define SIGXFSZ 25 /* exceeded file size limit */
-#define SIGVTALRM 26 /* virtual time alarm */
-#define SIGPROF 27 /* profiling time alarm */
-#define SIGWINCH 28 /* window changed */
-#define SIGLOST 29 /* resource lost (eg, record-lock lost) */
-#define SIGUSR1 30 /* user defined signal 1 */
-#define SIGUSR2 31 /* user defined signal 2 */
-
-struct sigvec {
- void (*sv_handler)(); /* signal handler */
- int sv_mask; /* signal mask to apply */
- int sv_flags; /* see signal options below */
-};
-#define SV_ONSTACK 0x0001 /* take signal on signal stack */
-#define SV_INTERRUPT 0x0002 /* do not restart system on signal return */
-#define SV_RESETHAND 0x0004 /* reset signal handler to SIG_DFL when signal taken */
-/*
- * If any SA_NOCLDSTOP or SV_NOCLDSTOP is change, the same
- * changes must be made in /usr/include/signal.h as well.
- */
-#define SV_NOCLDSTOP 0x0008 /* don't send a SIGCHLD on child stop */
-#define SA_ONSTACK SV_ONSTACK
-#define SA_INTERRUPT SV_INTERRUPT
-#define SA_RESETHAND SV_RESETHAND
-
-#define SA_NOCLDSTOP SV_NOCLDSTOP
-#define sv_onstack sv_flags /* isn't compatibility wonderful! */
-
-/*
- * If SIG_ERR, SIG_DFL, SIG_IGN, or SIG_HOLD are changed, the same changes
- * must be made in /usr/include/signal.h as well.
- */
-#define SIG_ERR (void (*)())-1
-#define SIG_DFL (void (*)())0
-#define SIG_IGN (void (*)())1
-
-/*
- * Macro for converting signal number to a mask suitable for sigblock().
- */
-#define sigmask(m) (1 << ((m)-1))
-
-/*
- * If SIG_BLOCK, SIG_UNBLOCK, or SIG_SETMASK are changed, the same changes
- * must be made in /usr/include/signal.h as well.
- */
-#define SIG_BLOCK 0x0001
-#define SIG_UNBLOCK 0x0002
-#define SIG_SETMASK 0x0004
-
-/*
- * If changes are made to sigset_t or struct sigaction, the same changes
- * must be made in /usr/include/signal.h as well.
- */
-#include <sys/stdtypes.h>
-
-struct sigaction {
- void (*sa_handler)();
- sigset_t sa_mask;
- int sa_flags;
-};
-
-#endif /* !__sys_signal_h */
diff --git a/mit-pthreads/machdep/sunos-4.1.3/stat.h b/mit-pthreads/machdep/sunos-4.1.3/stat.h
deleted file mode 100755
index 35e7f760204..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/stat.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* @(#)stat.h 2.19 90/01/24 SMI; from UCB 4.7 83/05/21 */
-
-/*
- * NOTE: changes to this file should also be made to xpg2include/sys/stat.h
- */
-
-#ifndef __sys_stat_h
-#define __sys_stat_h
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-struct stat {
- dev_t st_dev;
- ino_t st_ino;
- mode_t st_mode;
- short st_nlink;
- uid_t st_uid;
- gid_t st_gid;
- dev_t st_rdev;
- off_t st_size;
- time_t st_atime;
- int st_spare1;
- time_t st_mtime;
- int st_spare2;
- time_t st_ctime;
- int st_spare3;
- long st_blksize;
- long st_blocks;
- long st_spare4[2];
-};
-
-#define _IFMT 0170000 /* type of file */
-#define _IFDIR 0040000 /* directory */
-#define _IFCHR 0020000 /* character special */
-#define _IFBLK 0060000 /* block special */
-#define _IFREG 0100000 /* regular */
-#define _IFLNK 0120000 /* symbolic link */
-#define _IFSOCK 0140000 /* socket */
-#define _IFIFO 0010000 /* fifo */
-
-#define S_ISUID 0004000 /* set user id on execution */
-#define S_ISGID 0002000 /* set group id on execution */
-#ifndef _POSIX_SOURCE
-#define S_ISVTX 0001000 /* save swapped text even after use */
-#define S_IREAD 0000400 /* read permission, owner */
-#define S_IWRITE 0000200 /* write permission, owner */
-#define S_IEXEC 0000100 /* execute/search permission, owner */
-
-#define S_ENFMT 0002000 /* enforcement-mode locking */
-
-#define S_IFMT _IFMT
-#define S_IFDIR _IFDIR
-#define S_IFCHR _IFCHR
-#define S_IFBLK _IFBLK
-#define S_IFREG _IFREG
-#define S_IFLNK _IFLNK
-#define S_IFSOCK _IFSOCK
-#define S_IFIFO _IFIFO
-#endif !_POSIX_SOURCE
-
-#define S_IRWXU 0000700 /* rwx, owner */
-#define S_IRUSR 0000400 /* read permission, owner */
-#define S_IWUSR 0000200 /* write permission, owner */
-#define S_IXUSR 0000100 /* execute/search permission, owner */
-#define S_IRWXG 0000070 /* rwx, group */
-#define S_IRGRP 0000040 /* read permission, group */
-#define S_IWGRP 0000020 /* write permission, grougroup */
-#define S_IXGRP 0000010 /* execute/search permission, group */
-#define S_IRWXO 0000007 /* rwx, other */
-#define S_IROTH 0000004 /* read permission, other */
-#define S_IWOTH 0000002 /* write permission, other */
-#define S_IXOTH 0000001 /* execute/search permission, other */
-
-#define S_ISBLK(m) (((m)&_IFMT) == _IFBLK)
-#define S_ISCHR(m) (((m)&_IFMT) == _IFCHR)
-#define S_ISDIR(m) (((m)&_IFMT) == _IFDIR)
-#define S_ISFIFO(m) (((m)&_IFMT) == _IFIFO)
-#define S_ISREG(m) (((m)&_IFMT) == _IFREG)
-#ifndef _POSIX_SOURCE
-#define S_ISLNK(m) (((m)&_IFMT) == _IFLNK)
-#define S_ISSOCK(m) (((m)&_IFMT) == _IFSOCK)
-#endif
-
-__BEGIN_DECLS
-int chmod __P_((const char *path, mode_t mode));
-int fstat __P_((int fd, struct stat *sbuf));
-int mkdir __P_((char *path, mode_t mode));
-int mkfifo __P_((char *path, mode_t mode));
-int stat __P_((const char *path, struct stat *sbuf));
-mode_t umask __P_((mode_t mask));
-__END_DECLS
-
-#endif /* !__sys_stat_h */
diff --git a/mit-pthreads/machdep/sunos-4.1.3/time.h b/mit-pthreads/machdep/sunos-4.1.3/time.h
deleted file mode 100755
index 20bb085e4d8..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/time.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* @(#)time.h 2.12 91/05/22 SMI; from UCB 7.1 6/4/86 */
-
-/*
- * Copyright (c) 1982, 1986 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- */
-
-#ifndef _SYS_TIME_H_
-#define _SYS_TIME_H_
-
-#include <sys/cdefs.h>
-/*
- * Structure returned by gettimeofday(2) system call,
- * and used in other calls.
- */
-
-struct timeval {
- long tv_sec; /* seconds */
- long tv_usec; /* and microseconds */
-};
-
-struct timezone {
- int tz_minuteswest; /* minutes west of Greenwich */
- int tz_dsttime; /* type of dst correction */
-};
-
-#define DST_NONE 0 /* not on dst */
-#define DST_USA 1 /* USA style dst */
-#define DST_AUST 2 /* Australian style dst */
-#define DST_WET 3 /* Western European dst */
-#define DST_MET 4 /* Middle European dst */
-#define DST_EET 5 /* Eastern European dst */
-#define DST_CAN 6 /* Canada */
-#define DST_GB 7 /* Great Britain and Eire */
-#define DST_RUM 8 /* Rumania */
-#define DST_TUR 9 /* Turkey */
-#define DST_AUSTALT 10 /* Australian style with shift in 1986 */
-
-/*
- * Operations on timevals.
- *
- * NB: timercmp does not work for >= or <=.
- */
-#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
-#define timercmp(tvp, uvp, cmp) \
- ((tvp)->tv_sec cmp (uvp)->tv_sec || \
- (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
-#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
-
-/*
- * Names of the interval timers, and structure
- * defining a timer setting.
- */
-#define ITIMER_REAL 0
-#define ITIMER_VIRTUAL 1
-#define ITIMER_PROF 2
-
-struct itimerval {
- struct timeval it_interval; /* timer interval */
- struct timeval it_value; /* current value */
-};
-
-__BEGIN_DECLS
-int gettimeofday __P_((struct timeval *, struct timezone *));
-__END_DECLS
-
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-4.1.3/timers.h b/mit-pthreads/machdep/sunos-4.1.3/timers.h
deleted file mode 100755
index 3c4d057976a..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/timers.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <sys/types.h>
-#include <time.h>
-
-struct timespec {
- time_t tv_sec;
- long tv_nsec;
-};
-
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-4.1.3/wait.h b/mit-pthreads/machdep/sunos-4.1.3/wait.h
deleted file mode 100755
index 97f5fb261f7..00000000000
--- a/mit-pthreads/machdep/sunos-4.1.3/wait.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _SYS_WAIT_H_
-#define _SYS_WAIT_H_
-
-#define WNOHANG 1 /* dont hang in wait */
-#define WUNTRACED 2 /* tell about stopped, untraced children */
-
-pid_t wait __P_((int *));
-pid_t waitpid __P_((pid_t, int *, int));
-
-#define _W_INT(i) (i)
-#define WCOREFLAG 0200
-
-#define _WSTATUS(x) (_W_INT(x) & 0177)
-#define _WSTOPPED 0177 /* _WSTATUS if process is stopped */
-#define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED)
-#define WSTOPSIG(x) (_W_INT(x) >> 8)
-#define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0)
-#define WTERMSIG(x) (_WSTATUS(x))
-#define WIFEXITED(x) (_WSTATUS(x) == 0)
-#define WEXITSTATUS(x) (_W_INT(x) >> 8)
-
-#endif /* _SYS_WAIT_H_ */
diff --git a/mit-pthreads/machdep/sunos-5.3/__math.h b/mit-pthreads/machdep/sunos-5.3/__math.h
deleted file mode 100755
index 5404b52c661..00000000000
--- a/mit-pthreads/machdep/sunos-5.3/__math.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * ANSI/POSIX
- */
-typedef union _h_val {
- unsigned long _i[2];
- double _d;
-} _h_val;
-
-#ifdef __STDC__
-extern const _h_val __huge_val;
-#else
-extern _h_val __huge_val;
-#endif
-
-#define HUGE_VAL __huge_val._d
-
diff --git a/mit-pthreads/machdep/sunos-5.3/__signal.h b/mit-pthreads/machdep/sunos-5.3/__signal.h
deleted file mode 100755
index 638c1ca7331..00000000000
--- a/mit-pthreads/machdep/sunos-5.3/__signal.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sys/feature_tests.h>
-#include <sys/signal.h>
-
-/*
-typedef struct {
- unsigned long __sigbits[4];
-} sigset_t;
-*/
-
-typedef int sig_atomic_t;
-
-#define sigmask(n) ((unsigned int)1 << (((n) - 1) & (32 - 1)))
-#define sigword(n) (((unsigned int)((n) - 1))>>5)
-
-#define __SIGEMPTYSET { 0, 0, 0, 0 };
-#define __SIGFILLSET { 0xffffffff,0xffffffff,0xffffffff,0xffffffff };
-#define __SIGADDSET(s, n) ((s)->__sigbits[sigword(n)] |= sigmask(n))
-#define __SIGDELSET(s, n) ((s)->__sigbits[sigword(n)] &= ~sigmask(n))
-#define __SIGISMEMBER(s, n) (sigmask(n) & (s)->__sigbits[sigword(n)])
diff --git a/mit-pthreads/machdep/sunos-5.3/__stdio.h b/mit-pthreads/machdep/sunos-5.3/__stdio.h
deleted file mode 100755
index 4dd4becdbe9..00000000000
--- a/mit-pthreads/machdep/sunos-5.3/__stdio.h
+++ /dev/null
@@ -1,6 +0,0 @@
-typedef pthread_fpos_t fpos_t;
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.3/__stdlib.h b/mit-pthreads/machdep/sunos-5.3/__stdlib.h
deleted file mode 100755
index a0717ce3c2b..00000000000
--- a/mit-pthreads/machdep/sunos-5.3/__stdlib.h
+++ /dev/null
@@ -1,27 +0,0 @@
-
-#ifndef _SYS___STDLIB_H_
-#define _SYS___STDLIB_H_
-
-#include <sys/feature_tests.h>
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned int size_t;
-#endif
-
-#ifndef _UID_T
-#define _UID_T
-typedef long uid_t;
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#ifndef _WCHAR_T
-#define _WCHAR_T
-typedef long wchar_t;
-#endif
-
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.3/__string.h b/mit-pthreads/machdep/sunos-5.3/__string.h
deleted file mode 100755
index 9cb12a07bb7..00000000000
--- a/mit-pthreads/machdep/sunos-5.3/__string.h
+++ /dev/null
@@ -1,12 +0,0 @@
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-/* Non-standard NetBSD string routines. */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-__BEGIN_DECLS
-char *strdup __P_((const char *));
-__END_DECLS
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.3/__time.h b/mit-pthreads/machdep/sunos-5.3/__time.h
deleted file mode 100755
index 231e997acfa..00000000000
--- a/mit-pthreads/machdep/sunos-5.3/__time.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : System specific time header.
- *
- * 1.00 94/11/07 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS___TIME_H_
-#define _SYS___TIME_H_
-
-#include <sys/feature_tests.h>
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned size_t;
-#endif
-#ifndef _CLOCK_T
-#define _CLOCK_T
-typedef long clock_t;
-#endif
-#ifndef _TIME_T
-#define _TIME_T
-typedef long time_t;
-#endif
-#ifndef _CLOCKID_T
-#define _CLOCKID_T
-typedef int clockid_t;
-#endif
-#ifndef _TIMER_T
-#define _TIMER_T
-typedef int timer_t;
-#endif
-
-#include <sys/time.h>
-#include <sys/siginfo.h>
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.3/__unistd.h b/mit-pthreads/machdep/sunos-5.3/__unistd.h
deleted file mode 100755
index 4e83a863735..00000000000
--- a/mit-pthreads/machdep/sunos-5.3/__unistd.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * $Id$
- */
-
-#ifndef _SYS___UNISTD_H_
-#define _SYS___UNISTD_H_
-
-#include <sys/types.h>
-#include <sys/unistd.h>
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.3/cdefs.h b/mit-pthreads/machdep/sunos-5.3/cdefs.h
deleted file mode 100755
index f95f7b36958..00000000000
--- a/mit-pthreads/machdep/sunos-5.3/cdefs.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ==== cdefs.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Similar to the BSD cdefs.h file.
- *
- * 1.00 94/01/26 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_SYS_CDEFS_H_
-#define _PTHREAD_SYS_CDEFS_H_
-
-/* Stuff for compiling */
-#if defined(__GNUC__)
-#if defined(__cplusplus)
-#define __INLINE static inline
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS };
-#else
-#define __INLINE extern inline
-#define __CAN_DO_EXTERN_INLINE
-#define __BEGIN_DECLS
-#define __END_DECLS
-#define const __const
-#define inline __inline
-#define signed __signed
-#define volatile __volatile
-#endif
-#else /* !__GNUC__ */
-#define __BEGIN_DECLS
-#define __END_DECLS
-#define __INLINE static
-#endif
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif /* __NORETURN not defined. */
-
-#ifndef _U_INT32_T_
-#define _U_INT32_T_
-typedef unsigned int u_int32_t;
-#endif
-
-#ifndef _U_INT16_T_
-#define _U_INT16_T_
-typedef unsigned short u_int16_t;
-#endif
-
-#ifndef _INT32_T_
-#define _INT32_T_
-typedef int int32_t;
-#endif
-
-#ifndef _INT16_T_
-#define _INT16_T_
-typedef short int16_t;
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.3/compat.h b/mit-pthreads/machdep/sunos-5.3/compat.h
deleted file mode 100755
index b2a846d00ee..00000000000
--- a/mit-pthreads/machdep/sunos-5.3/compat.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ==== compat.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_COMPAT_H_
-#define _SYS_COMPAT_H_
-
-#define omsghdr msghdr
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.3/dirent.h b/mit-pthreads/machdep/sunos-5.3/dirent.h
deleted file mode 100755
index 303d3d7df2b..00000000000
--- a/mit-pthreads/machdep/sunos-5.3/dirent.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 5.18 (Berkeley) 2/23/91
- */
-
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-/*
- * A directory entry has a struct dirent at the front of it, containing its
- * inode number, the length of the entry, and the length of the name
- * contained in the entry. These are followed by the name padded to a 4
- * byte boundary with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- */
-
-struct dirent {
- u_long d_fileno; /* file number of entry */
- off_t d_off; /* offset of next disk dir entry */
- u_short d_reclen; /* length of this record */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
-#define MAXNAMLEN 255
- char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
-#endif
-};
-
-#define d_namlen d_reclen
-#define d_ino d_fileno
-
-#endif /* !_SYS_DIRENT_H_ */
-
-
diff --git a/mit-pthreads/machdep/sunos-5.3/socket.h b/mit-pthreads/machdep/sunos-5.3/socket.h
deleted file mode 100755
index 0b075622fed..00000000000
--- a/mit-pthreads/machdep/sunos-5.3/socket.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) 1982, 1985, 1986 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @(#)socket.h 7.3 (Berkeley) 6/27/88
- */
-
-#ifndef _SYS_SOCKET_H
-#define _SYS_SOCKET_H
-
-/*
- * Types of sockets
- */
-#define SOCK_STREAM 2 /* stream socket */
-#define SOCK_DGRAM 1 /* datagram socket */
-#define SOCK_RAW 4 /* raw-protocol interface */
-#define SOCK_RDM 5 /* reliably-delivered message */
-#define SOCK_SEQPACKET 6 /* sequenced packet stream */
-
-/*
- * Option flags per-socket.
- */
-#define SO_DEBUG 0x0001 /* turn on debugging info recording */
-#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
-#define SO_REUSEADDR 0x0004 /* allow local address reuse */
-#define SO_KEEPALIVE 0x0008 /* keep connections alive */
-#define SO_DONTROUTE 0x0010 /* just use interface addresses */
-#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
-#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
-#define SO_LINGER 0x0080 /* linger on close if data present */
-#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
-#define SO_ERROR 0x1007 /* get error status and clear */
-#define SO_TYPE 0x1008 /* get socket type */
-#define SO_PROTOTYPE 0x1009 /* get/set protocol type */
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define SOL_SOCKET 0xffff /* options for socket level */
-
-/*
- * Address families.
- */
-#define AF_UNSPEC 0 /* unspecified */
-#define AF_UNIX 1 /* local to host (pipes, portals) */
-#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
-#define AF_IMPLINK 3 /* arpanet imp addresses */
-#define AF_PUP 4 /* pup protocols: e.g. BSP */
-#define AF_CHAOS 5 /* mit CHAOS protocols */
-#define AF_NS 6 /* XEROX NS protocols */
-#define AF_NBS 7 /* nbs protocols */
-#define AF_ECMA 8 /* european computer manufacturers */
-#define AF_DATAKIT 9 /* datakit protocols */
-#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
-#define AF_SNA 11 /* IBM SNA */
-#define AF_DECnet 12 /* DECnet */
-#define AF_DLI 13 /* Direct data link interface */
-#define AF_LAT 14 /* LAT */
-#define AF_HYLINK 15 /* NSC Hyperchannel */
-#define AF_APPLETALK 16 /* Apple Talk */
-#define AF_NIT 17 /* NIT */
-#define AF_802 18 /* IEEE 802.2, also ISO 8802 */
-#define AF_ISO 19 /* ISO protocols */
-#define AF_OSI AF_ISO
-#define AF_X25 20 /* CCITT X.25 in particular */
-#define AF_OSINET 21
-#define AF_GOSIP 22
-#define AF_MAX 22
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
- unsigned short sa_family; /* address family */
- char sa_data[14]; /* up to 14 bytes of direct address */
-};
-
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
- unsigned short sp_family; /* address family */
- unsigned short sp_protocol; /* protocol */
-};
-
-/*
- * Protocol families, same as address families for now.
- */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_UNIX AF_UNIX
-#define PF_INET AF_INET
-#define PF_IMPLINK AF_IMPLINK
-#define PF_PUP AF_PUP
-#define PF_CHAOS AF_CHAOS
-#define PF_NS AF_NS
-#define PF_NBS AF_NBS
-#define PF_ECMA AF_ECMA
-#define PF_DATAKIT AF_DATAKIT
-#define PF_CCITT AF_CCITT
-#define PF_SNA AF_SNA
-#define PF_DECnet AF_DECnet
-#define PF_DLI AF_DLI
-#define PF_LAT AF_LAT
-#define PF_HYLINK AF_HYLINK
-#define PF_APPLETALK AF_APPLETALK
-#define PF_NIT AF_NIT
-#define PF_802 AF_802
-#define PF_ISO AF_ISO
-#define PF_OSI AF_ISO
-#define PF_X25 AF_X25
-#define PF_OSINET AF_OSINET
-#define PF_GOSIP AF_GOSIP
-#define PF_MAX AF_MAX
-
-/*
- * Maximum queue length specifiable by listen.
- */
-#define SOMAXCONN 5
-
-/*
- * Message header for recvmsg and sendmsg calls.
- */
-struct msghdr {
- caddr_t msg_name; /* optional address */
- int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_accrights; /* access rights sent/received */
- int msg_accrightslen;
-};
-
-#define MSG_OOB 0x1 /* process out-of-band data */
-#define MSG_PEEK 0x2 /* peek at incoming message */
-#define MSG_DONTROUTE 0x4 /* send without using routing tables */
-
-#define MSG_MAXIOVLEN 16
-
-#include <sys/cdefs.h>
-/*
- * Functions
- */
-
-__BEGIN_DECLS
-
-int accept __P_((int, struct sockaddr *, int *));
-int bind __P_((int, const struct sockaddr *, int));
-int connect __P_((int, const struct sockaddr *, int));
-int listen __P_((int, int));
-int socket __P_((int, int, int));
-int setsockopt __P_((int, int, int, const void *, int));
-int getsockname __P_((int, struct sockaddr *, int *));
-int shutdown __P_((int, int));
-int getpeername __P_((int, struct sockaddr *, int *));
-__END_DECLS
-
-#endif /* _SYS_SOCKET_H */
diff --git a/mit-pthreads/machdep/sunos-5.3/timers.h b/mit-pthreads/machdep/sunos-5.3/timers.h
deleted file mode 100755
index 3ee2c78f088..00000000000
--- a/mit-pthreads/machdep/sunos-5.3/timers.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <sys/types.h>
-#include <time.h>
-
-#define tv_sec tv_sec
-#define tv_nsec tv_nsec
-
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
-
-/*
- * New functions
- */
-
-#ifndef NOT_USED
-/* for sleep.h */
-/* int gettimeofday __P_((struct timeval *,struct timezone *)); */
-int gettimeofday __P_((struct timeval *,void *));
-#endif
-
-__BEGIN_DECLS
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.3/uio.h b/mit-pthreads/machdep/sunos-5.3/uio.h
deleted file mode 100755
index 7786142dd87..00000000000
--- a/mit-pthreads/machdep/sunos-5.3/uio.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ==== uio.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Correct Solaris header file.
- */
-
-#ifndef _PTHREAD_UIO_H_
-#define _PTHREAD_UIO_H_
-
-#include <sys/cdefs.h>
-
-struct iovec {
- void *iov_base;
- size_t iov_len;
-};
-
-typedef struct iovec iovec_t;
-
-struct uio {
- iovec_t *uio_iov; /* pointer to array of iovecs */
- int uio_iovcnt; /* number of iovecs */
- /* These are all bogus */
- int _uio_offset; /* file offset */
- int uio_segflg; /* address space (kernel or user) */
- short uio_fmode; /* file mode flags */
- int _uio_limit; /* u-limit (maximum "block" offset) */
- int uio_resid; /* residual count */
-};
-
-typedef struct uio uio_t;
-
-__BEGIN_DECLS
-
-int readv __P_((int, const struct iovec *, int));
-int writev __P_((int, const struct iovec *, int));
-
-__END_DECLS
-
-#endif
-
diff --git a/mit-pthreads/machdep/sunos-5.5/__math.h b/mit-pthreads/machdep/sunos-5.5/__math.h
deleted file mode 100755
index 5404b52c661..00000000000
--- a/mit-pthreads/machdep/sunos-5.5/__math.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * ANSI/POSIX
- */
-typedef union _h_val {
- unsigned long _i[2];
- double _d;
-} _h_val;
-
-#ifdef __STDC__
-extern const _h_val __huge_val;
-#else
-extern _h_val __huge_val;
-#endif
-
-#define HUGE_VAL __huge_val._d
-
diff --git a/mit-pthreads/machdep/sunos-5.5/__signal.h b/mit-pthreads/machdep/sunos-5.5/__signal.h
deleted file mode 100755
index 638c1ca7331..00000000000
--- a/mit-pthreads/machdep/sunos-5.5/__signal.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sys/feature_tests.h>
-#include <sys/signal.h>
-
-/*
-typedef struct {
- unsigned long __sigbits[4];
-} sigset_t;
-*/
-
-typedef int sig_atomic_t;
-
-#define sigmask(n) ((unsigned int)1 << (((n) - 1) & (32 - 1)))
-#define sigword(n) (((unsigned int)((n) - 1))>>5)
-
-#define __SIGEMPTYSET { 0, 0, 0, 0 };
-#define __SIGFILLSET { 0xffffffff,0xffffffff,0xffffffff,0xffffffff };
-#define __SIGADDSET(s, n) ((s)->__sigbits[sigword(n)] |= sigmask(n))
-#define __SIGDELSET(s, n) ((s)->__sigbits[sigword(n)] &= ~sigmask(n))
-#define __SIGISMEMBER(s, n) (sigmask(n) & (s)->__sigbits[sigword(n)])
diff --git a/mit-pthreads/machdep/sunos-5.5/__stdio.h b/mit-pthreads/machdep/sunos-5.5/__stdio.h
deleted file mode 100755
index 4dd4becdbe9..00000000000
--- a/mit-pthreads/machdep/sunos-5.5/__stdio.h
+++ /dev/null
@@ -1,6 +0,0 @@
-typedef pthread_fpos_t fpos_t;
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.5/__stdlib.h b/mit-pthreads/machdep/sunos-5.5/__stdlib.h
deleted file mode 100755
index a0717ce3c2b..00000000000
--- a/mit-pthreads/machdep/sunos-5.5/__stdlib.h
+++ /dev/null
@@ -1,27 +0,0 @@
-
-#ifndef _SYS___STDLIB_H_
-#define _SYS___STDLIB_H_
-
-#include <sys/feature_tests.h>
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned int size_t;
-#endif
-
-#ifndef _UID_T
-#define _UID_T
-typedef long uid_t;
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#ifndef _WCHAR_T
-#define _WCHAR_T
-typedef long wchar_t;
-#endif
-
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.5/__string.h b/mit-pthreads/machdep/sunos-5.5/__string.h
deleted file mode 100755
index 9cb12a07bb7..00000000000
--- a/mit-pthreads/machdep/sunos-5.5/__string.h
+++ /dev/null
@@ -1,12 +0,0 @@
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef pthread_size_t size_t;
-#endif
-
-/* Non-standard NetBSD string routines. */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-__BEGIN_DECLS
-char *strdup __P_((const char *));
-__END_DECLS
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.5/__time.h b/mit-pthreads/machdep/sunos-5.5/__time.h
deleted file mode 100755
index 231e997acfa..00000000000
--- a/mit-pthreads/machdep/sunos-5.5/__time.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : System specific time header.
- *
- * 1.00 94/11/07 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS___TIME_H_
-#define _SYS___TIME_H_
-
-#include <sys/feature_tests.h>
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned size_t;
-#endif
-#ifndef _CLOCK_T
-#define _CLOCK_T
-typedef long clock_t;
-#endif
-#ifndef _TIME_T
-#define _TIME_T
-typedef long time_t;
-#endif
-#ifndef _CLOCKID_T
-#define _CLOCKID_T
-typedef int clockid_t;
-#endif
-#ifndef _TIMER_T
-#define _TIMER_T
-typedef int timer_t;
-#endif
-
-#include <sys/time.h>
-#include <sys/siginfo.h>
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.5/__unistd.h b/mit-pthreads/machdep/sunos-5.5/__unistd.h
deleted file mode 100755
index 4e83a863735..00000000000
--- a/mit-pthreads/machdep/sunos-5.5/__unistd.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * $Id$
- */
-
-#ifndef _SYS___UNISTD_H_
-#define _SYS___UNISTD_H_
-
-#include <sys/types.h>
-#include <sys/unistd.h>
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.5/cdefs.h b/mit-pthreads/machdep/sunos-5.5/cdefs.h
deleted file mode 100755
index f95f7b36958..00000000000
--- a/mit-pthreads/machdep/sunos-5.5/cdefs.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ==== cdefs.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Similar to the BSD cdefs.h file.
- *
- * 1.00 94/01/26 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_SYS_CDEFS_H_
-#define _PTHREAD_SYS_CDEFS_H_
-
-/* Stuff for compiling */
-#if defined(__GNUC__)
-#if defined(__cplusplus)
-#define __INLINE static inline
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS };
-#else
-#define __INLINE extern inline
-#define __CAN_DO_EXTERN_INLINE
-#define __BEGIN_DECLS
-#define __END_DECLS
-#define const __const
-#define inline __inline
-#define signed __signed
-#define volatile __volatile
-#endif
-#else /* !__GNUC__ */
-#define __BEGIN_DECLS
-#define __END_DECLS
-#define __INLINE static
-#endif
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif /* __NORETURN not defined. */
-
-#ifndef _U_INT32_T_
-#define _U_INT32_T_
-typedef unsigned int u_int32_t;
-#endif
-
-#ifndef _U_INT16_T_
-#define _U_INT16_T_
-typedef unsigned short u_int16_t;
-#endif
-
-#ifndef _INT32_T_
-#define _INT32_T_
-typedef int int32_t;
-#endif
-
-#ifndef _INT16_T_
-#define _INT16_T_
-typedef short int16_t;
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.5/compat.h b/mit-pthreads/machdep/sunos-5.5/compat.h
deleted file mode 100755
index b2a846d00ee..00000000000
--- a/mit-pthreads/machdep/sunos-5.5/compat.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ==== compat.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_COMPAT_H_
-#define _SYS_COMPAT_H_
-
-#define omsghdr msghdr
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.5/dirent.h b/mit-pthreads/machdep/sunos-5.5/dirent.h
deleted file mode 100755
index 303d3d7df2b..00000000000
--- a/mit-pthreads/machdep/sunos-5.5/dirent.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 5.18 (Berkeley) 2/23/91
- */
-
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-/*
- * A directory entry has a struct dirent at the front of it, containing its
- * inode number, the length of the entry, and the length of the name
- * contained in the entry. These are followed by the name padded to a 4
- * byte boundary with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- */
-
-struct dirent {
- u_long d_fileno; /* file number of entry */
- off_t d_off; /* offset of next disk dir entry */
- u_short d_reclen; /* length of this record */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
-#define MAXNAMLEN 255
- char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
-#endif
-};
-
-#define d_namlen d_reclen
-#define d_ino d_fileno
-
-#endif /* !_SYS_DIRENT_H_ */
-
-
diff --git a/mit-pthreads/machdep/sunos-5.5/socket.h b/mit-pthreads/machdep/sunos-5.5/socket.h
deleted file mode 100755
index 0b075622fed..00000000000
--- a/mit-pthreads/machdep/sunos-5.5/socket.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) 1982, 1985, 1986 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @(#)socket.h 7.3 (Berkeley) 6/27/88
- */
-
-#ifndef _SYS_SOCKET_H
-#define _SYS_SOCKET_H
-
-/*
- * Types of sockets
- */
-#define SOCK_STREAM 2 /* stream socket */
-#define SOCK_DGRAM 1 /* datagram socket */
-#define SOCK_RAW 4 /* raw-protocol interface */
-#define SOCK_RDM 5 /* reliably-delivered message */
-#define SOCK_SEQPACKET 6 /* sequenced packet stream */
-
-/*
- * Option flags per-socket.
- */
-#define SO_DEBUG 0x0001 /* turn on debugging info recording */
-#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
-#define SO_REUSEADDR 0x0004 /* allow local address reuse */
-#define SO_KEEPALIVE 0x0008 /* keep connections alive */
-#define SO_DONTROUTE 0x0010 /* just use interface addresses */
-#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
-#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
-#define SO_LINGER 0x0080 /* linger on close if data present */
-#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
-#define SO_ERROR 0x1007 /* get error status and clear */
-#define SO_TYPE 0x1008 /* get socket type */
-#define SO_PROTOTYPE 0x1009 /* get/set protocol type */
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define SOL_SOCKET 0xffff /* options for socket level */
-
-/*
- * Address families.
- */
-#define AF_UNSPEC 0 /* unspecified */
-#define AF_UNIX 1 /* local to host (pipes, portals) */
-#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
-#define AF_IMPLINK 3 /* arpanet imp addresses */
-#define AF_PUP 4 /* pup protocols: e.g. BSP */
-#define AF_CHAOS 5 /* mit CHAOS protocols */
-#define AF_NS 6 /* XEROX NS protocols */
-#define AF_NBS 7 /* nbs protocols */
-#define AF_ECMA 8 /* european computer manufacturers */
-#define AF_DATAKIT 9 /* datakit protocols */
-#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
-#define AF_SNA 11 /* IBM SNA */
-#define AF_DECnet 12 /* DECnet */
-#define AF_DLI 13 /* Direct data link interface */
-#define AF_LAT 14 /* LAT */
-#define AF_HYLINK 15 /* NSC Hyperchannel */
-#define AF_APPLETALK 16 /* Apple Talk */
-#define AF_NIT 17 /* NIT */
-#define AF_802 18 /* IEEE 802.2, also ISO 8802 */
-#define AF_ISO 19 /* ISO protocols */
-#define AF_OSI AF_ISO
-#define AF_X25 20 /* CCITT X.25 in particular */
-#define AF_OSINET 21
-#define AF_GOSIP 22
-#define AF_MAX 22
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
- unsigned short sa_family; /* address family */
- char sa_data[14]; /* up to 14 bytes of direct address */
-};
-
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
- unsigned short sp_family; /* address family */
- unsigned short sp_protocol; /* protocol */
-};
-
-/*
- * Protocol families, same as address families for now.
- */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_UNIX AF_UNIX
-#define PF_INET AF_INET
-#define PF_IMPLINK AF_IMPLINK
-#define PF_PUP AF_PUP
-#define PF_CHAOS AF_CHAOS
-#define PF_NS AF_NS
-#define PF_NBS AF_NBS
-#define PF_ECMA AF_ECMA
-#define PF_DATAKIT AF_DATAKIT
-#define PF_CCITT AF_CCITT
-#define PF_SNA AF_SNA
-#define PF_DECnet AF_DECnet
-#define PF_DLI AF_DLI
-#define PF_LAT AF_LAT
-#define PF_HYLINK AF_HYLINK
-#define PF_APPLETALK AF_APPLETALK
-#define PF_NIT AF_NIT
-#define PF_802 AF_802
-#define PF_ISO AF_ISO
-#define PF_OSI AF_ISO
-#define PF_X25 AF_X25
-#define PF_OSINET AF_OSINET
-#define PF_GOSIP AF_GOSIP
-#define PF_MAX AF_MAX
-
-/*
- * Maximum queue length specifiable by listen.
- */
-#define SOMAXCONN 5
-
-/*
- * Message header for recvmsg and sendmsg calls.
- */
-struct msghdr {
- caddr_t msg_name; /* optional address */
- int msg_namelen; /* size of address */
- struct iovec *msg_iov; /* scatter/gather array */
- int msg_iovlen; /* # elements in msg_iov */
- caddr_t msg_accrights; /* access rights sent/received */
- int msg_accrightslen;
-};
-
-#define MSG_OOB 0x1 /* process out-of-band data */
-#define MSG_PEEK 0x2 /* peek at incoming message */
-#define MSG_DONTROUTE 0x4 /* send without using routing tables */
-
-#define MSG_MAXIOVLEN 16
-
-#include <sys/cdefs.h>
-/*
- * Functions
- */
-
-__BEGIN_DECLS
-
-int accept __P_((int, struct sockaddr *, int *));
-int bind __P_((int, const struct sockaddr *, int));
-int connect __P_((int, const struct sockaddr *, int));
-int listen __P_((int, int));
-int socket __P_((int, int, int));
-int setsockopt __P_((int, int, int, const void *, int));
-int getsockname __P_((int, struct sockaddr *, int *));
-int shutdown __P_((int, int));
-int getpeername __P_((int, struct sockaddr *, int *));
-__END_DECLS
-
-#endif /* _SYS_SOCKET_H */
diff --git a/mit-pthreads/machdep/sunos-5.5/timers.h b/mit-pthreads/machdep/sunos-5.5/timers.h
deleted file mode 100755
index 3aad5f80065..00000000000
--- a/mit-pthreads/machdep/sunos-5.5/timers.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <sys/types.h>
-#include <time.h>
-
-#define tv_sec tv_sec
-#define tv_nsec tv_nsec
-
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
-
-/*
- * New functions
- */
-
-#ifdef NOT_USED
-int gettimeofday __P_((struct timeval *,struct timezone *)); /* for sleep.h */
-#endif
-
-__BEGIN_DECLS
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/machdep/sunos-5.5/uio.h b/mit-pthreads/machdep/sunos-5.5/uio.h
deleted file mode 100755
index 7786142dd87..00000000000
--- a/mit-pthreads/machdep/sunos-5.5/uio.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ==== uio.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Correct Solaris header file.
- */
-
-#ifndef _PTHREAD_UIO_H_
-#define _PTHREAD_UIO_H_
-
-#include <sys/cdefs.h>
-
-struct iovec {
- void *iov_base;
- size_t iov_len;
-};
-
-typedef struct iovec iovec_t;
-
-struct uio {
- iovec_t *uio_iov; /* pointer to array of iovecs */
- int uio_iovcnt; /* number of iovecs */
- /* These are all bogus */
- int _uio_offset; /* file offset */
- int uio_segflg; /* address space (kernel or user) */
- short uio_fmode; /* file mode flags */
- int _uio_limit; /* u-limit (maximum "block" offset) */
- int uio_resid; /* residual count */
-};
-
-typedef struct uio uio_t;
-
-__BEGIN_DECLS
-
-int readv __P_((int, const struct iovec *, int));
-int writev __P_((int, const struct iovec *, int));
-
-__END_DECLS
-
-#endif
-
diff --git a/mit-pthreads/machdep/syscall-alpha-netbsd-1.1.S b/mit-pthreads/machdep/syscall-alpha-netbsd-1.1.S
deleted file mode 100644
index 5b7dd017426..00000000000
--- a/mit-pthreads/machdep/syscall-alpha-netbsd-1.1.S
+++ /dev/null
@@ -1,206 +0,0 @@
-#include <machine/asm.h>
-#define CHMK() call_pal 0x83
-#define COMPAT_43
-#include <sys/syscall.h>
-#ifndef __CONCAT
-#include <sys/cdefs.h>
-#endif
-#define CONCAT __CONCAT
-
-#undef SYSCALL
-
-/* Kernel syscall interface:
- Input:
- v0 - system call number
- a* - arguments, as in C
- Output:
- a3 - zero iff successful
- v0 - errno value on failure, else result
-
- This macro is similar to SYSCALL in asm.h, but not completely.
- There's room for optimization, if we assume this will continue to
- be assembled as one file.
-
- This macro expansions does not include the return instruction.
- If there's no other work to be done, use something like:
- SYSCALL(foo) ; ret
- If there is other work to do (in fork, maybe?), do it after the
- SYSCALL invocation. */
-
-#define SYSCALL(x) \
- .align 4 ;\
- .globl CONCAT(machdep_sys_,x) ;\
- .ent CONCAT(machdep_sys_,x), 0 ;\
-CONCAT(machdep_sys_,x): ;\
- .frame sp,0,ra ;\
- ldiq v0, CONCAT(SYS_,x) ;\
- CHMK() ;\
- beq a3, CONCAT(Lsys_noerr_,x) ;\
- br gp, CONCAT(Lsys_err_,x) ;\
-CONCAT(Lsys_err_,x): ;\
- /* Load gp so we can find cerror to jump to. */;\
- ldgp gp, 0(gp) ;\
- jmp zero, machdep_cerror ;\
-CONCAT(Lsys_noerr_,x):
-
-#define XSYSCALL(x) SYSCALL(x) ; RET ; .end CONCAT(machdep_sys_,x)
-
- .globl machdep_cerror
-machdep_cerror:
- br t0, Lmachdep_cerror_setgp
-Lmachdep_cerror_setgp:
- ldgp gp, 0(t0)
- stl v0, errno
-#if 0
- ldiq v0, -1
-#else
- subq zero, v0, v0
-#endif
- RET
-
-/* The fork system call is special... */
-SYSCALL(fork)
- cmovne a4, 0, v0
- RET
- .end machdep_sys_fork
-
-/* The pipe system call is special... */
-SYSCALL(pipe)
- stl v0, 0(a0)
- stl a4, 4(a0)
- mov zero, v0
- RET
- .end machdep_sys_pipe
-
-/* The sigsuspend system call is special... */
- .align 4
- .globl machdep_sys_sigsuspend
- .ent machdep_sys_sigsuspend, 0
-machdep_sys_sigsuspend:
- ldl a0, 0(a0) /* pass *mask instead of mask */
- ldiq v0, SYS_sigsuspend
- CHMK()
- mov zero, v0 /* shouldn't need; just in case... */
- RET
- .end machdep_sys_sigsuspend
-
-/* The sigprocmask system call is special... */
- .align 4
- .globl machdep_sys_sigprocmask
- .ent machdep_sys_sigprocmask, 0
-machdep_sys_sigprocmask:
- mov a2, a5 /* safe */
- cmoveq a1, 1, a0 /* if set == NULL, how = SIG_BLOCK */
- beq a1, Ldoit /* and set = 0, and do it. */
- ldl a1, 0(a1) /* load the set from *set */
-Ldoit: ldiq v0, SYS_sigprocmask
- CHMK()
- beq a5, Lret /* if they don't want old mask, done */
- stl v0, 0(a5) /* otherwise, give it to them. */
-Lret: mov zero, v0
- RET
- .end machdep_sys_sigprocmask
-
-/* More stuff ... */
- .align 4
- .global __machdep_save_int_state
- .ent __machdep_save_int_state, 0
-__machdep_save_int_state:
- .frame sp, 16, ra
- ldgp gp, 0(t12)
- lda sp, -16(sp)
- stq ra, 0(sp)
-
- /* save integer registers */
- stq ra, ( 0 * 8)(a0) /* return address */
- stq s0, ( 1 * 8)(a0) /* callee-saved registers */
- stq s1, ( 2 * 8)(a0)
- stq s2, ( 3 * 8)(a0)
- stq s3, ( 4 * 8)(a0)
- stq s4, ( 5 * 8)(a0)
- stq s5, ( 6 * 8)(a0)
- stq s6, ( 7 * 8)(a0)
- stq sp, ( 9 * 8)(a0)
- stq ra, ( 8 * 8)(a0) /* RA on return */
- stq pv, (10 * 8)(a0) /* and PV; we restore it */
-
- mov zero, v0
- lda sp, 16(sp)
- RET
- .end __machdep_save_int_state
-
- .align 4
- .global __machdep_restore_int_state
- .ent __machdep_restore_int_state, 0
-__machdep_restore_int_state:
- .frame sp, 16, ra
- ldgp gp, 0(t12)
- lda sp, -16(sp)
- stq ra, 0(sp)
-
- /* restore integer registers */
- ldq t0, ( 0 * 8)(a0) /* return address */
- ldq s0, ( 1 * 8)(a0) /* callee-saved registers */
- ldq s1, ( 2 * 8)(a0)
- ldq s2, ( 3 * 8)(a0)
- ldq s3, ( 4 * 8)(a0)
- ldq s4, ( 5 * 8)(a0)
- ldq s5, ( 6 * 8)(a0)
- ldq s6, ( 7 * 8)(a0)
- ldq ra, ( 8 * 8)(a0) /* RA after return */
- ldq sp, ( 9 * 8)(a0)
- ldq pv, (10 * 8)(a0) /* and PV; we restore it */
-
- ldiq v0, 1
- ret zero,(t0),1
- .end __machdep_restore_int_state
-
- .align 4
- .global __machdep_save_fp_state
- .ent __machdep_save_fp_state, 0
-__machdep_save_fp_state:
- .frame sp, 16, ra
- ldgp gp, 0(t12)
- lda sp, -16(sp)
- stq ra, 0(sp)
-
- /* save FP registers */
- stt fs0, (0 * 8)(a0) /* callee-saved registers */
- stt fs1, (1 * 8)(a0)
- stt fs2, (2 * 8)(a0)
- stt fs3, (3 * 8)(a0)
- stt fs4, (4 * 8)(a0)
- stt fs5, (5 * 8)(a0)
- stt fs6, (6 * 8)(a0)
- stt fs7, (7 * 8)(a0)
- mf_fpcr ft0 /* and FP control reg */
- stt ft0, (8 * 8)(a0)
-
- lda sp, 16(sp)
- RET
- .end __machdep_save_fp_state
-
- .align 4
- .global __machdep_restore_fp_state
- .ent __machdep_restore_fp_state, 0
-__machdep_restore_fp_state:
- .frame sp, 16, ra
- ldgp gp, 0(t12)
- lda sp, -16(sp)
- stq ra, 0(sp)
-
- /* restore FP registers */
- ldt fs0, (0 * 8)(a0) /* callee-saved registers */
- ldt fs1, (1 * 8)(a0)
- ldt fs2, (2 * 8)(a0)
- ldt fs3, (3 * 8)(a0)
- ldt fs4, (4 * 8)(a0)
- ldt fs5, (5 * 8)(a0)
- ldt fs6, (6 * 8)(a0)
- ldt fs7, (7 * 8)(a0)
- ldt ft0, (8 * 8)(a0)
- mt_fpcr ft0 /* and FP control reg */
-
- lda sp, 16(sp)
- RET
- .end __machdep_restore_fp_state
diff --git a/mit-pthreads/machdep/syscall-alpha-netbsd-1.3.S b/mit-pthreads/machdep/syscall-alpha-netbsd-1.3.S
deleted file mode 100644
index 61435a729d7..00000000000
--- a/mit-pthreads/machdep/syscall-alpha-netbsd-1.3.S
+++ /dev/null
@@ -1,228 +0,0 @@
-#include <machine/asm.h>
-#define CHMK() call_pal 0x83
-#define COMPAT_43
-#include <sys/syscall.h>
-#ifndef __CONCAT
-#include <sys/cdefs.h>
-#endif
-#define CONCAT __CONCAT
-
-#undef SYSCALL
-
-/* Kernel syscall interface:
- Input:
- v0 - system call number
- a* - arguments, as in C
- Output:
- a3 - zero iff successful
- v0 - errno value on failure, else result
-
- This macro is similar to SYSCALL in asm.h, but not completely.
- There's room for optimization, if we assume this will continue to
- be assembled as one file.
-
- This macro expansions does not include the return instruction.
- If there's no other work to be done, use something like:
- SYSCALL(foo) ; ret
- If there is other work to do (in fork, maybe?), do it after the
- SYSCALL invocation. */
-
-#define SYSCALL(x) \
- .align 4 ;\
- .globl CONCAT(machdep_sys_,x) ;\
- .ent CONCAT(machdep_sys_,x), 0 ;\
-CONCAT(machdep_sys_,x): ;\
- .frame sp,0,ra ;\
- ldiq v0, CONCAT(SYS_,x) ;\
- CHMK() ;\
- beq a3, CONCAT(Lsys_noerr_,x) ;\
- br gp, CONCAT(Lsys_err_,x) ;\
-CONCAT(Lsys_err_,x): ;\
- /* Load gp so we can find cerror to jump to. */;\
- ldgp gp, 0(gp) ;\
- jmp zero, machdep_cerror ;\
-CONCAT(Lsys_noerr_,x):
-
-#define XSYSCALL(x) SYSCALL(x) ; RET ; .end CONCAT(machdep_sys_,x)
-
- .globl machdep_cerror
-machdep_cerror:
- br t0, Lmachdep_cerror_setgp
-Lmachdep_cerror_setgp:
- ldgp gp, 0(t0)
- stl v0, errno
-#if 0
- ldiq v0, -1
-#else
- subq zero, v0, v0
-#endif
- RET
-
-/* The fork system call is special... */
-SYSCALL(fork)
- cmovne a4, 0, v0
- RET
- .end machdep_sys_fork
-
-/* The pipe system call is special... */
-SYSCALL(pipe)
- stl v0, 0(a0)
- stl a4, 4(a0)
- mov zero, v0
- RET
- .end machdep_sys_pipe
-
-#ifndef SYS___sigsuspend14
-/* The sigsuspend system call is special... */
- .align 4
- .globl machdep_sys_sigsuspend
- .ent machdep_sys_sigsuspend, 0
-machdep_sys_sigsuspend:
- ldl a0, 0(a0) /* pass *mask instead of mask */
- ldiq v0, SYS_sigsuspend
- CHMK()
- mov zero, v0 /* shouldn't need; just in case... */
- RET
- .end machdep_sys_sigsuspend
-#endif /* SYS_sigsuspend14 */
-
-#ifndef SYS___sigprocmask14
-/* The sigprocmask system call is special... */
- .align 4
- .globl machdep_sys_sigprocmask
- .ent machdep_sys_sigprocmask, 0
-machdep_sys_sigprocmask:
- mov a2, a5 /* safe */
- cmoveq a1, 1, a0 /* if set == NULL, how = SIG_BLOCK */
- beq a1, Ldoit /* and set = 0, and do it. */
- ldl a1, 0(a1) /* load the set from *set */
-Ldoit: ldiq v0, SYS_sigprocmask
- CHMK()
- beq a5, Lret /* if they don't want old mask, done */
- stl v0, 0(a5) /* otherwise, give it to them. */
-Lret: mov zero, v0
- RET
- .end machdep_sys_sigprocmask
-#endif /* SYS_sigprocmask14 */
-
-/* More stuff ... */
- .align 4
- .global __machdep_save_int_state
- .ent __machdep_save_int_state, 0
-__machdep_save_int_state:
- .frame sp, 16, ra
- ldgp gp, 0(t12)
- lda sp, -16(sp)
- stq ra, 0(sp)
-
- /* save integer registers */
- stq ra, ( 0 * 8)(a0) /* return address */
- stq s0, ( 1 * 8)(a0) /* callee-saved registers */
- stq s1, ( 2 * 8)(a0)
- stq s2, ( 3 * 8)(a0)
- stq s3, ( 4 * 8)(a0)
- stq s4, ( 5 * 8)(a0)
- stq s5, ( 6 * 8)(a0)
- stq s6, ( 7 * 8)(a0)
- stq sp, ( 9 * 8)(a0)
- stq ra, ( 8 * 8)(a0) /* RA on return */
- stq pv, (10 * 8)(a0) /* and PV; we restore it */
-
- mov zero, v0
- lda sp, 16(sp)
- RET
- .end __machdep_save_int_state
-
- .align 4
- .global __machdep_restore_int_state
- .ent __machdep_restore_int_state, 0
-__machdep_restore_int_state:
- .frame sp, 16, ra
- ldgp gp, 0(t12)
- lda sp, -16(sp)
- stq ra, 0(sp)
-
- /* restore integer registers */
- ldq t0, ( 0 * 8)(a0) /* return address */
- ldq s0, ( 1 * 8)(a0) /* callee-saved registers */
- ldq s1, ( 2 * 8)(a0)
- ldq s2, ( 3 * 8)(a0)
- ldq s3, ( 4 * 8)(a0)
- ldq s4, ( 5 * 8)(a0)
- ldq s5, ( 6 * 8)(a0)
- ldq s6, ( 7 * 8)(a0)
- ldq ra, ( 8 * 8)(a0) /* RA after return */
- ldq sp, ( 9 * 8)(a0)
- ldq pv, (10 * 8)(a0) /* and PV; we restore it */
-
- ldiq v0, 1
- ret zero,(t0),1
- .end __machdep_restore_int_state
-
- .align 4
- .global __machdep_save_fp_state
- .ent __machdep_save_fp_state, 0
-__machdep_save_fp_state:
- .frame sp, 16, ra
- ldgp gp, 0(t12)
- lda sp, -16(sp)
- stq ra, 0(sp)
-
- /* save FP registers */
- stt fs0, (0 * 8)(a0) /* callee-saved registers */
- stt fs1, (1 * 8)(a0)
- stt fs2, (2 * 8)(a0)
- stt fs3, (3 * 8)(a0)
- stt fs4, (4 * 8)(a0)
- stt fs5, (5 * 8)(a0)
- stt fs6, (6 * 8)(a0)
- stt fs7, (7 * 8)(a0)
- mf_fpcr ft0 /* and FP control reg */
- stt ft0, (8 * 8)(a0)
-
- lda sp, 16(sp)
- RET
- .end __machdep_save_fp_state
-
- .align 4
- .global __machdep_restore_fp_state
- .ent __machdep_restore_fp_state, 0
-__machdep_restore_fp_state:
- .frame sp, 16, ra
- ldgp gp, 0(t12)
- lda sp, -16(sp)
- stq ra, 0(sp)
-
- /* restore FP registers */
- ldt fs0, (0 * 8)(a0) /* callee-saved registers */
- ldt fs1, (1 * 8)(a0)
- ldt fs2, (2 * 8)(a0)
- ldt fs3, (3 * 8)(a0)
- ldt fs4, (4 * 8)(a0)
- ldt fs5, (5 * 8)(a0)
- ldt fs6, (6 * 8)(a0)
- ldt fs7, (7 * 8)(a0)
- ldt ft0, (8 * 8)(a0)
- mt_fpcr ft0 /* and FP control reg */
-
- lda sp, 16(sp)
- RET
- .end __machdep_restore_fp_state
-
-/* For fstat() we actually syscall fstat13. */
- .align 4
- .globl machdep_sys_fstat
- .ent machdep_sys_fstat, 0
-machdep_sys_fstat:
- .frame sp,0,ra
- ldiq v0, SYS___fstat13
- CHMK()
- beq a3, Lsys_noerr_fstat
- br gp, Lsys_err_fstat
-Lsys_err_fstat:
- /* Load gp so we can find cerror to jump to. */
- ldgp gp, 0(gp)
- jmp zero, machdep_cerror
-Lsys_noerr_fstat:
- RET
- .end machdep_sys_fstat
diff --git a/mit-pthreads/machdep/syscall-alpha-osf1.S b/mit-pthreads/machdep/syscall-alpha-osf1.S
deleted file mode 100644
index fad823a7352..00000000000
--- a/mit-pthreads/machdep/syscall-alpha-osf1.S
+++ /dev/null
@@ -1,97 +0,0 @@
-#include <asm.h>
-#include <regdef.h>
-#define COMPAT_43
-#include <syscall.h>
-
-#undef SYSCALL
-
-/* Kernel syscall interface:
- Input:
- v0 - system call number
- a* - arguments, as in C
- Output:
- a3 - zero iff successful
- v0 - errno value on failure, else result
-
- This macro is similar to SYSCALL in asm.h, but not completely.
- There's room for optimization, if we assume this will continue to
- be assembled as one file.
-
- This macro expansions does not include the return instruction.
- If there's no other work to be done, use something like:
- SYSCALL(foo) ; ret
- If there is other work to do (in fork, maybe?), do it after the
- SYSCALL invocation. */
-
-#define SYSCALL(x) \
- .align 4 ;\
- .globl machdep_sys_##x ;\
- .ent machdep_sys_##x, 0 ;\
-machdep_sys_##x: ;\
- .frame sp,0,ra ;\
- ldiq v0, SYS_##x ;\
- CHMK() ;\
- beq a3, 2f ;\
- br gp, 1f ;\
-1: ;\
- /* Load gp so we can find cerror to jump to. */;\
- ldgp gp, 0(gp) ;\
- jmp zero, machdep_cerror ;\
-2:
-
-#define XSYSCALL(x) SYSCALL(x) ; ret ; .end machdep_sys_##x
-
- .globl machdep_cerror
-machdep_cerror:
- br t0, 1f
-1:
- ldgp gp, 0(t0)
- stl v0, errno
-#if 0
- ldiq v0, -1
-#else
- subq zero, v0, v0
-#endif
- ret
-
-/* The fork system call is special... */
-SYSCALL(fork)
- cmovne a4, 0, v0
- ret
- .end machdep_sys_fork
-
-/* So is the sigsuspend system call */
- .align 4
- .globl machdep_sys_sigsuspend
- .ent machdep_sys_sigsuspend, 0
-machdep_sys_sigsuspend:
- .frame sp,0,ra
-
- bis a0, a0, a1
- ldq a0, 0(a1)
- ldiq v0, SYS_sigsuspend
- CHMK()
- ret
- .end machdep_sys_sigsuspend
-
-/* More stuff ... */
- .align 4
- .globl machdep_restore_from_setjmp
- .ent machdep_restore_from_setjmp, 0
-machdep_restore_from_setjmp:
- .frame sp, 16, ra
- ldgp gp, 0(t12)
- lda sp, -16(sp)
- stq ra, 0(sp)
- ldq v0, 280(a0)
- subq v0, 0x00000000acedbade, t0
- bne t0, botch
- cmoveq a1, 0x1, a1
- stq a1, 32(a0)
- ldiq v0, 0x67
- call_pal 0x83
-botch:
- /* This should cause the program to crash. Eventually, fix it
- up to print a message first. */
- jsr abort
- .end machdep_restore_from_setjmp
diff --git a/mit-pthreads/machdep/syscall-arm32-netbsd-1.3.S b/mit-pthreads/machdep/syscall-arm32-netbsd-1.3.S
deleted file mode 100644
index 5914674b508..00000000000
--- a/mit-pthreads/machdep/syscall-arm32-netbsd-1.3.S
+++ /dev/null
@@ -1,193 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent syscalls for i386/i486/i586
- *
- * 1.00 93/08/26 proven
- * -Started coding this file.
- *
- * 1.01 93/11/13 proven
- * -The functions readv() and writev() added.
- */
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#if defined(SYSLIBC_SCCS) && !defined(lint)
- .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
-#endif /* SYSLIBC_SCCS and not lint */
-
-#include <machine/asm.h>
-#include <sys/syscall.h>
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 0
-
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl _C_LABEL(machdep_sys_fork);
-
-_C_LABEL(machdep_sys_fork):;
-
- swi SYS_fork
- bcs 1f
- sub r1, r1, #0x00000001
- and r0, r0, r1
- mov r15, r14
-
-
-
-/* ==========================================================================
- * machdep_sys_fstat()
- */
- .globl _C_LABEL(machdep_sys_fstat);
-
-_C_LABEL(machdep_sys_fstat):;
-
- swi SYS___fstat13
- bcs 1f
- mov r15, r14
-
-/* ==========================================================================
- * machdep_sys___syscall()
- */
-
-_machdep_sys___syscall:;
-
- swi SYS___syscall
- bcs 1f
- mov r15, r14
-
-
-#ifndef SYS___sigsuspend14
-/* ==========================================================================
- * machdep_sys_sigsuspend()
- */
- .globl _C_LABEL(machdep_sys_sigsuspend);
-
-_C_LABEL(machdep_sys_sigsuspend):;
-
- ldr r0, [r0]
- swi SYS_sigsuspend
- bcs 1f
- mov r0, #0x00000000
- mov r15, r14
-
-#endif
-
-#ifndef SYS___sigprocmask14
-/* ==========================================================================
- * machdep_sys_sigprocmask()
- */
- .globl _C_LABEL(machdep_sys_sigprocmask);
-
-_C_LABEL(machdep_sys_sigprocmask):;
-
- teq r1, #0x00000000
- moveq r0, #0x00000001
- moveq r1, #0x00000000
- ldrne r1, [r1]
- swi SYS_sigprocmask
- bcs 1f
- teq r2, #0x00000000
- strne r0, [r2]
- mov r0, #0x00000000
- mov r15, r14
-#endif
-
-/* ==========================================================================
- * machdep_sys_ftruncate()
- */
- .global _C_LABEL(machdep_sys_ftruncate)
-_C_LABEL(machdep_sys_ftruncate):
- mov r12, r13
- stmfd r13!, {r11, r12, r14, r15}
- sub r13, r13, #8
- stmia r13, {r1-r2}
- mov r3, #0
- sub r11, r12, #4
- mov r2, r0
- mov r1, #0
- mov r0, #201
- bl _machdep_sys___syscall
- ldmea r11, {r11, r13, r15}
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
- .global _C_LABEL(machdep_sys_lseek)
-
-_C_LABEL(machdep_sys_lseek):
- mov r12, r13
- stmfd r13!, {r11, r12, r14, r15}
- str r3, [r13, #-4]!
- sub r13, r13, #8
- stmia r13, {r1-r2}
- sub r11, r12, #4
- mov r3, #0
- mov r2, r0
- mov r1, #0
- mov r0, #SYS_lseek
- bl _machdep_sys___syscall
- ldmea r11, {r11, r13, r15}
-
-/* ==========================================================================
- * machdep_sys_pipe()
- */
- .globl _C_LABEL(machdep_sys_pipe);
-
-_C_LABEL(machdep_sys_pipe):;
-
- mov r2, r0
- swi SYS_pipe
- bcs 1f
- str r0, [r2, #0x0000]
- str r1, [r2, #0x0004]
- mov r0, #0x00000000
- mov r15, r14
-
-
-1:
- rsb r0, r0, #0x00000000
- mvn r1, #0x00000000
- mov r15, r14
diff --git a/mit-pthreads/machdep/syscall-hppa-hpux-10.20.S b/mit-pthreads/machdep/syscall-hppa-hpux-10.20.S
deleted file mode 100644
index c63d845bae5..00000000000
--- a/mit-pthreads/machdep/syscall-hppa-hpux-10.20.S
+++ /dev/null
@@ -1,23 +0,0 @@
- .CODE
-
-machdep_error
- sub %r0,%r28,%r28
- bv,n %r0(%r2)
-
-machdep_sys_fork
-
- .PROC
- .CALLINFO NO_CALLS,FRAME=0
-
- ldil -0x80000,%r1
- ble 4(%sr7,%r1)
- ldi 2 ,%r22
- or,= %r0,%r22,%r0
- b,n machdep_error
- or,= %r29,%r0,%r0
- copy %r0,%r28
- bv,n %r0(%r2)
-
- .PROCEND
- .EXPORT machdep_sys_fork,ENTRY
-
diff --git a/mit-pthreads/machdep/syscall-hppa-hpux-9.03.S b/mit-pthreads/machdep/syscall-hppa-hpux-9.03.S
deleted file mode 100644
index c63d845bae5..00000000000
--- a/mit-pthreads/machdep/syscall-hppa-hpux-9.03.S
+++ /dev/null
@@ -1,23 +0,0 @@
- .CODE
-
-machdep_error
- sub %r0,%r28,%r28
- bv,n %r0(%r2)
-
-machdep_sys_fork
-
- .PROC
- .CALLINFO NO_CALLS,FRAME=0
-
- ldil -0x80000,%r1
- ble 4(%sr7,%r1)
- ldi 2 ,%r22
- or,= %r0,%r22,%r0
- b,n machdep_error
- or,= %r29,%r0,%r0
- copy %r0,%r28
- bv,n %r0(%r2)
-
- .PROCEND
- .EXPORT machdep_sys_fork,ENTRY
-
diff --git a/mit-pthreads/machdep/syscall-i386-bsdi-1.1.S b/mit-pthreads/machdep/syscall-i386-bsdi-1.1.S
deleted file mode 100644
index e54cd0d0773..00000000000
--- a/mit-pthreads/machdep/syscall-i386-bsdi-1.1.S
+++ /dev/null
@@ -1,288 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent syscalls for i386/i486/i586
- *
- * 1.00 93/08/26 proven
- * -Started coding this file.
- *
- * 1.01 93/11/13 proven
- * -The functions readv() and writev() added.
- */
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#if defined(SYSLIBC_SCCS) && !defined(lint)
- .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
-#endif /* SYSLIBC_SCCS and not lint */
-
-#include <sys/syscall.h>
-
-#define SYSCALL(x) \
- .globl _machdep_sys_/**/x; \
- \
-_machdep_sys_/**/x:; \
- \
- movl $(SYS_/**/x), %eax; \
- .byte 0x9a; .long 0; .word 7; \
- jb 1b; \
- ret;
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- neg %eax
- ret
-
-/* ==========================================================================
- * machdep_sys_write()
- */
-SYSCALL(write)
-
-/* ==========================================================================
- * machdep_sys_read()
- */
-SYSCALL(read)
-
-/* ==========================================================================
- * machdep_sys_open()
- */
-SYSCALL(open)
-
-/* ==========================================================================
- * machdep_sys_close()
- */
-SYSCALL(close)
-
-/* ==========================================================================
- * machdep_sys_fcntl()
- */
-SYSCALL(fcntl)
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
-SYSCALL(lseek)
-
-/* ==========================================================================
- * machdep_sys_pipe()
- */
-SYSCALL(pipe)
-
-/* ==========================================================================
- * machdep_sys_dup()
- */
-SYSCALL(dup)
-
-/* ==========================================================================
- * machdep_sys_dup2()
- */
-SYSCALL(dup2)
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl _machdep_sys_fork;
-
-_machdep_sys_fork:;
-
- movl $(SYS_fork), %eax;
- .byte 0x9a; .long 0; .word 7;
- cmpl $0, %edx
- je 2f
- movl $0, %eax
-2:
- ret;
-
-/* ==========================================================================
- * machdep_sys_execve()
- */
-SYSCALL(execve)
-
-/* ==========================================================================
- * machdep_sys_fstat()
- */
-SYSCALL(fstat)
-
-/* ==========================================================================
- * machdep_sys_fchown()
- */
-SYSCALL(fchown)
-
-/* ==========================================================================
- * machdep_sys_fchmod()
- */
-SYSCALL(fchmod)
-
-/* ==========================================================================
- * machdep_sys_chown()
- */
-SYSCALL(chown)
-
-/* ==========================================================================
- * machdep_sys_chmod()
- */
-SYSCALL(chmod)
-
-/* ==========================================================================
- * machdep_sys_chdir()
- */
-SYSCALL(chdir)
-
-/* ==========================================================================
- * machdep_sys_chdir()
- */
-SYSCALL(link)
-
-/* ==========================================================================
- * machdep_sys_chdir()
- */
-SYSCALL(unlink)
-
-/* ==========================================================================
- * machdep_sys_chdir()
- */
-SYSCALL(rename)
-
-/* ==========================================================================
- * Nonstandard calls used to make the system work
- *
- * ==========================================================================
- * machdep_sys_select()
- */
-SYSCALL(select)
-
-/* ==========================================================================
- * machdep_sys_getdirentries()
- */
-SYSCALL(getdirentries)
-
-/* ==========================================================================
- * machdep_sys_wait4()
- */
-SYSCALL(wait4)
-
-/* ==========================================================================
- * Berkeley socket stuff
- *
- * ==========================================================================
- * machdep_sys_socket()
- */
-SYSCALL(socket)
-
-/* ==========================================================================
- * machdep_sys_bind()
- */
-SYSCALL(bind)
-
-/* ==========================================================================
- * machdep_sys_connect()
- */
-SYSCALL(connect)
-
-/* ==========================================================================
- * machdep_sys_accept()
- */
-SYSCALL(accept)
-
-/* ==========================================================================
- * machdep_sys_listen()
- */
-SYSCALL(listen)
-
-/* ==========================================================================
- * machdep_sys_getsockopt()
- */
-SYSCALL(getsockopt)
-
-/* ==========================================================================
- * machdep_sys_readv()
- */
-SYSCALL(readv)
-
-/* ==========================================================================
- * machdep_sys_writev()
- */
-SYSCALL(writev)
-
-/* ==========================================================================
- * machdep_sys_getpeername()
- */
-SYSCALL(getpeername)
-
-/* ==========================================================================
- * machdep_sys_getsockname()
- */
-SYSCALL(getsockname)
-
-/* ==========================================================================
- * machdep_sys_sendto()
- */
-SYSCALL(sendto)
-
-/* ==========================================================================
- * machdep_sys_recvfrom()
- */
-SYSCALL(recvfrom)
-
-/* ==========================================================================
- * machdep_sys_sendmsg()
- */
-SYSCALL(sendmsg)
-
-/* ==========================================================================
- * machdep_sys_recvmsg()
- */
-SYSCALL(recvmsg)
-
-/* ==========================================================================
- * machdep_sys_shutdown() - Is this correct?
- */
-SYSCALL(shutdown)
-
diff --git a/mit-pthreads/machdep/syscall-i386-bsdi-2.0.S b/mit-pthreads/machdep/syscall-i386-bsdi-2.0.S
deleted file mode 100644
index 8a56717da31..00000000000
--- a/mit-pthreads/machdep/syscall-i386-bsdi-2.0.S
+++ /dev/null
@@ -1,294 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent syscalls for i386/i486/i586
- *
- * 1.00 93/08/26 proven
- * -Started coding this file.
- *
- * 1.01 93/11/13 proven
- * -The functions readv() and writev() added.
- */
-
-#ifndef lint
- .text
- .asciz "syscall-i386-netbsd-1.0.S,v 1.56 1995/09/26 21:04:05 raeburn Exp";
-#endif
-
-#if defined(SYSLIBC_SCCS) && !defined(lint)
- .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
-#endif /* SYSLIBC_SCCS and not lint */
-
-#include <sys/syscall.h>
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- neg %eax
- ret
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl _machdep_sys_fork;
-
-_machdep_sys_fork:;
-
- movl $(SYS_fork), %eax;
- .byte 0x9a; .long 0; .word 7;
- cmpl $0, %edx
- je 2f
- movl $0, %eax
-2:
- ret;
-
-/* ==========================================================================
- * machdep_sys___syscall()
- */
-
-_machdep_sys___syscall:;
-
- movl $(SYS___syscall), %eax;
- .byte 0x9a; .long 0; .word 7;
- jb 3f;
- ret
-
-/* ==========================================================================
- * machdep_sys_sigsuspend()
- */
- .globl _machdep_sys_sigsuspend;
-
-_machdep_sys_sigsuspend:;
-
- movl 4(%esp),%eax # fetch mask arg
- movl (%eax),%eax # indirect to mask arg
- movl %eax,4(%esp)
- movl $(SYS_sigsuspend), %eax;
- .byte 0x9a; .long 0; .word 7;
- jb 3f;
- ret
-
-3:
-
- neg %eax
- movl $0xffffffff,%edx
- ret
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
- .globl _machdep_sys_lseek;
-
-_machdep_sys_lseek:;
-
- pushl %ebp;
- movl %esp,%ebp;
- pushl 0x14(%ebp);
- pushl 0x10(%ebp);
- pushl 0xc(%ebp);
- pushl $0x0;
- pushl 0x8(%ebp);
- pushl $0x0;
- pushl $(SYS_lseek);
- call _machdep_sys___syscall;
- leave
- ret
-
-/* ==========================================================================
- * machdep_sys_ftruncate() ; Added by Monty
- */
- .globl _machdep_sys_ftruncate;
-
-_machdep_sys_ftruncate:;
-
- pushl %ebp;
- movl %esp,%ebp;
- pushl 0x10(%ebp);
- pushl 0xc(%ebp);
- pushl $0x0; # Why this?
- pushl 0x8(%ebp);
- pushl $0x0; # And this?
- pushl $(SYS_ftruncate);
- call _machdep_sys___syscall;
- leave
- ret
-
-
-/* BSDI DEFS.h,v 2.1 1995/02/03 06:28:24 polk Exp */
-
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)DEFS.h 8.1 (Berkeley) 6/4/93
- */
-
-#ifdef PROF
-#define ENTRY(x) .globl _/**/x; .align 2; _/**/x: \
- .data; 1:; .long 0; .text; \
- pushl %ebp; movl %esp,%ebp; \
- leal 1b,%eax; call mcount; leave
-#define ASENTRY(x) .globl x; .align 2; x: \
- .data; 1:; .long 0; .text; \
- pushl %ebp; movl %esp,%ebp; \
- leal 1b,%eax; call mcount; leave
-#else
-#define ENTRY(x) .globl _/**/x; .align 2; _/**/x:
-#define ASENTRY(x) .globl x; .align 2; x:
-#endif
-
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
- .asciz "@(#)_setjmp.s 8.1 (Berkeley) 6/4/93"
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * C library -- _setjmp, _longjmp
- *
- * _longjmp(a,v)
- * will generate a "return(v)" from the last call to
- * _setjmp(a)
- * by restoring registers from the stack.
- * The previous signal state is NOT restored.
- */
-
-
-.globl __setjmp; /* Patch by Jan Legenhausen (monty) */
-.align 2;
-__setjmp:
- movl 4(%esp),%eax
- movl 0(%esp),%edx
- movl %edx, 0(%eax) /* rta */
- movl %ebx, 4(%eax)
- movl %esp, 8(%eax)
- movl %ebp,12(%eax)
- movl %esi,16(%eax)
- movl %edi,20(%eax)
- movl $0,%eax
- ret
-
-.globl __longjmp; /* Patch by Jan Legenhausen ? (monty) */
-.align 2;
-__longjmp:
- movl 4(%esp),%edx
- movl 8(%esp),%eax
- movl 0(%edx),%ecx
- movl 4(%edx),%ebx
- movl 8(%edx),%esp
- movl 12(%edx),%ebp
- movl 16(%edx),%esi
- movl 20(%edx),%edi
- cmpl $0,%eax
- jne 1f
- movl $1,%eax
-1: movl %ecx,0(%esp)
- ret
diff --git a/mit-pthreads/machdep/syscall-i386-freebsd-1.1.S b/mit-pthreads/machdep/syscall-i386-freebsd-1.1.S
deleted file mode 100644
index 5777cc5e06d..00000000000
--- a/mit-pthreads/machdep/syscall-i386-freebsd-1.1.S
+++ /dev/null
@@ -1,293 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent syscalls for i386/i486/i586
- *
- * 1.00 93/08/26 proven
- * -Started coding this file.
- *
- * 1.01 93/11/13 proven
- * -The functions readv() and writev() added.
- */
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#if defined(SYSLIBC_SCCS) && !defined(lint)
- .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
-#endif /* SYSLIBC_SCCS and not lint */
-
-#include <sys/syscall.h>
-
-#define SYSCALL(x) \
- .globl _machdep_sys_/**/x; \
- \
-_machdep_sys_/**/x:; \
- \
- movl $(SYS_/**/x), %eax; \
- .byte 0x9a; .long 0; .word 7; \
- jb 1b; \
- ret;
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- neg %eax
- ret
-
-/* ==========================================================================
- * machdep_sys_write()
- */
-SYSCALL(write)
-
-/* ==========================================================================
- * machdep_sys_read()
- */
-SYSCALL(read)
-
-/* ==========================================================================
- * machdep_sys_open()
- */
-SYSCALL(open)
-
-/* ==========================================================================
- * machdep_sys_close()
- */
-SYSCALL(close)
-
-/* ==========================================================================
- * machdep_sys_fcntl()
- */
-SYSCALL(fcntl)
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
-SYSCALL(lseek)
-
-/* ==========================================================================
- * machdep_sys_stat()
- */
-SYSCALL(stat)
-
-/* ==========================================================================
- * machdep_sys_pipe()
- */
-SYSCALL(pipe)
-
-/* ==========================================================================
- * machdep_sys_dup()
- */
-SYSCALL(dup)
-
-/* ==========================================================================
- * machdep_sys_dup2()
- */
-SYSCALL(dup2)
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl _machdep_sys_fork;
-
-_machdep_sys_fork:;
-
- movl $(SYS_fork), %eax;
- .byte 0x9a; .long 0; .word 7;
- cmpl $0, %edx
- je 2f
- movl $0, %eax
-2:
- ret;
-
-/* ==========================================================================
- * machdep_sys_execve()
- */
-SYSCALL(execve)
-
-/* ==========================================================================
- * machdep_sys_fstat()
- */
-SYSCALL(fstat)
-
-/* ==========================================================================
- * machdep_sys_fchown()
- */
-SYSCALL(fchown)
-
-/* ==========================================================================
- * machdep_sys_fchmod()
- */
-SYSCALL(fchmod)
-
-/* ==========================================================================
- * machdep_sys_chown()
- */
-SYSCALL(chown)
-
-/* ==========================================================================
- * machdep_sys_chmod()
- */
-SYSCALL(chmod)
-
-/* ==========================================================================
- * machdep_sys_chdir()
- */
-SYSCALL(chdir)
-
-/* ==========================================================================
- * machdep_sys_chdir()
- */
-SYSCALL(link)
-
-/* ==========================================================================
- * machdep_sys_chdir()
- */
-SYSCALL(unlink)
-
-/* ==========================================================================
- * machdep_sys_chdir()
- */
-SYSCALL(rename)
-
-/* ==========================================================================
- * Nonstandard calls used to make the system work
- *
- * ==========================================================================
- * machdep_sys_select()
- */
-SYSCALL(select)
-
-/* ==========================================================================
- * machdep_sys_getdirentries()
- */
-SYSCALL(getdirentries)
-
-/* ==========================================================================
- * machdep_sys_wait4()
- */
-SYSCALL(wait4)
-
-/* ==========================================================================
- * Berkeley socket stuff
- *
- * ==========================================================================
- * machdep_sys_socket()
- */
-SYSCALL(socket)
-
-/* ==========================================================================
- * machdep_sys_bind()
- */
-SYSCALL(bind)
-
-/* ==========================================================================
- * machdep_sys_connect()
- */
-SYSCALL(connect)
-
-/* ==========================================================================
- * machdep_sys_accept()
- */
-SYSCALL(accept)
-
-/* ==========================================================================
- * machdep_sys_listen()
- */
-SYSCALL(listen)
-
-/* ==========================================================================
- * machdep_sys_getsockopt()
- */
-SYSCALL(getsockopt)
-
-/* ==========================================================================
- * machdep_sys_readv()
- */
-SYSCALL(readv)
-
-/* ==========================================================================
- * machdep_sys_writev()
- */
-SYSCALL(writev)
-
-/* ==========================================================================
- * machdep_sys_getpeername()
- */
-SYSCALL(getpeername)
-
-/* ==========================================================================
- * machdep_sys_getsockname()
- */
-SYSCALL(getsockname)
-
-/* ==========================================================================
- * machdep_sys_sendto()
- */
-SYSCALL(sendto)
-
-/* ==========================================================================
- * machdep_sys_recvfrom()
- */
-SYSCALL(recvfrom)
-
-/* ==========================================================================
- * machdep_sys_sendmsg()
- */
-SYSCALL(sendmsg)
-
-/* ==========================================================================
- * machdep_sys_recvmsg()
- */
-SYSCALL(recvmsg)
-
-/* ==========================================================================
- * machdep_sys_shutdown()
- */
-SYSCALL(shutdown)
-
diff --git a/mit-pthreads/machdep/syscall-i386-freebsd-2.0.S b/mit-pthreads/machdep/syscall-i386-freebsd-2.0.S
deleted file mode 100644
index b713bcac344..00000000000
--- a/mit-pthreads/machdep/syscall-i386-freebsd-2.0.S
+++ /dev/null
@@ -1,240 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1995 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent syscalls for i386/i486/i586
- *
- */
-
-#ifndef lint
- .text
- .asciz "syscall-i386-freebsd-2.0.S,v 1.2 1995/05/26 07:44:29 proven Exp";
-#endif
-
-#if defined(SYSLIBC_SCCS) && !defined(lint)
- .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
-#endif /* SYSLIBC_SCCS and not lint */
-
-#include <sys/syscall.h>
-
-#ifdef __STDC__
-
-#ifdef __ELF__
-#define NAME(X) machdep_sys_##X
-#else
-#define NAME(X) _machdep_sys_##X
-#endif
-
-#else
-
-#ifdef __ELF__
-#define NAME(X) machdep_sys_/**/X
-#else
-#define NAME(X) _machdep_sys_/**/X
-#endif
-
-#endif
-
-#ifdef __ELF__
-#define END(X) 5: ; .type NAME(X),@function ; .size NAME(X),5b - NAME(X)
-#define KERNCALL int $0x80
-#else
-#define END(X)
-#define KERNCALL .byte 0x9a; .long 0; .word 7;
-#endif
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- neg %eax
- ret
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl NAME(fork);
-
-NAME(fork):;
-
- movl $(SYS_fork), %eax;
- KERNCALL;
- cmpl $0, %edx
- je 2f
- movl $0, %eax
-2:
- ret;
- END(fork)
-
-/* ==========================================================================
- * machdep_sys___syscall()
- */
-
-_machdep_sys___syscall:;
-
- movl $(SYS___syscall), %eax;
- KERNCALL;
- jb 3f;
- ret
-
-/* ==========================================================================
- * machdep_sys_sigsuspend()
- */
- .globl NAME(sigsuspend);
-
-NAME(sigsuspend):;
-
- movl 4(%esp),%eax # fetch mask arg
- movl (%eax),%eax # indirect to mask arg
- movl %eax,4(%esp)
- movl $(SYS_sigsuspend), %eax;
- KERNCALL;
- jb 3f;
- ret
-3:
- neg %eax
- movl $0xffffffff,%edx
- ret
- END(sigsuspend)
-
-/* ==========================================================================
- * machdep_sys_sigprocmask()
- */
- .globl NAME(sigprocmask);
-
-NAME(sigprocmask):;
-
- movl 8(%esp),%ecx
- movl (%ecx),%ecx
- movl %ecx,8(%esp)
- movl $ SYS_sigprocmask , %eax
- KERNCALL;
- jb 4f;
- ret
-4:
- neg %eax
- movl $0xffffffff,%edx
- ret
- END(sigprocmask)
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
- .globl NAME(lseek);
-
-NAME(lseek):;
-
- pushl %ebp;
- movl %esp,%ebp;
- pushl 0x14(%ebp);
- pushl 0x10(%ebp);
- pushl 0xc(%ebp);
- pushl $0x0;
- pushl 0x8(%ebp);
- pushl $0x0;
- pushl $(SYS_lseek);
- call _machdep_sys___syscall;
- leave
- ret
- END(lseek)
-
-/* ==========================================================================
- * machdep_sys_ftruncate() ; Added by Monty
- */
- .globl NAME(ftruncate);
-
-NAME(ftruncate):;
-
- pushl %ebp;
- movl %esp,%ebp;
- pushl 0x10(%ebp);
- pushl 0xc(%ebp);
- pushl $0x0; # Why this?
- pushl 0x8(%ebp);
- pushl $0x0; # And this?
- pushl $(SYS_ftruncate);
- call _machdep_sys___syscall;
- leave
- ret
- END(ftruncate)
-
-/* ==========================================================================
- * machdep_sys_setjmp()
- */
- .globl NAME(setjmp);
-
-NAME(setjmp):;
- movl 4(%esp),%eax
- movl 0(%esp),%edx
- movl %edx, 0(%eax) /* rta */
- movl %ebx, 4(%eax)
- movl %esp, 8(%eax)
- movl %ebp,12(%eax)
- movl %esi,16(%eax)
- movl %edi,20(%eax)
- xorl %eax,%eax
- ret
- END(setjmp)
-
-/* ==========================================================================
- * machdep_sys_longjmp()
- */
- .globl NAME(longjmp);
-
-NAME(longjmp):;
- movl 4(%esp),%edx
- movl 8(%esp),%eax
- movl 0(%edx),%ecx
- movl 4(%edx),%ebx
- movl 8(%edx),%esp
- movl 12(%edx),%ebp
- movl 16(%edx),%esi
- movl 20(%edx),%edi
- testl %eax,%eax
- jnz 1f
- incl %eax
-1:
- movl %ecx,0(%esp)
- ret
- END(longjmp)
diff --git a/mit-pthreads/machdep/syscall-i386-linux-1.0.S b/mit-pthreads/machdep/syscall-i386-linux-1.0.S
deleted file mode 100644
index 1399c812e2f..00000000000
--- a/mit-pthreads/machdep/syscall-i386-linux-1.0.S
+++ /dev/null
@@ -1,406 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Description : Machine dependent syscalls for i386/i486/i586
- *
- * 1.00 93/08/26 proven
- * -Started coding this file.
- *
- * 1.01 93/11/13 proven
- * -The functions readv() and writev() added.
- *
- * 1.16 94/01/30 proven
- * -This file now requires gas version 2.0 or greater.
- */
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#include <sys/syscall.h>
-#include <config.h>
-
-#ifdef __ELF__
-
-#define NAME(X) machdep_sys_##X
-#define END(X) 1: ; .type NAME(X),@function ; .size NAME(X),1b - NAME(X)
-
-#else
-
-#define NAME(X) _machdep_sys_##X
-#define END(X)
-
-#endif
-
-#define SYSCALL0(x) \
- .globl NAME(x) ; \
- \
-NAME(x): \
- \
- push %ebx; \
- lea SYS_##x, %eax; \
- int $0x80; \
- pop %ebx; \
- ret; \
- \
- END(x)
-
-#define SYSCALL1(x) \
- .globl NAME(x) ; \
- \
-NAME(x): \
- \
- push %ebx; \
- mov 8(%esp), %ebx; \
- lea SYS_##x, %eax; \
- int $0x80; \
- pop %ebx; \
- ret; \
- \
- END(x)
-
-#define SYSCALL2(x) \
- .globl NAME(x) ; \
- \
-NAME(x): \
- \
- push %ebx; \
- mov 8(%esp), %ebx; \
- mov 12(%esp), %ecx; \
- lea SYS_##x, %eax; \
- int $0x80; \
- pop %ebx; \
- ret; \
- \
- END(x)
-
-#define STATCALL2(x) \
- .globl NAME(x) ; \
- \
-NAME(x): \
- \
- push %ebx; \
- mov 8(%esp), %ebx; \
- mov 12(%esp), %ecx; \
- lea SYS_prev_##x, %eax; \
- int $0x80; \
- pop %ebx; \
- ret; \
- END(x)
-
-#define SYSCALL3(x) \
- .globl NAME(x) ; \
- \
-NAME(x): \
- \
- push %ebx; \
- mov 8(%esp), %ebx; \
- mov 12(%esp), %ecx; \
- mov 16(%esp), %edx; \
- lea SYS_##x, %eax; \
- int $0x80; \
- pop %ebx; \
- ret; \
- END(x)
-
-
-#define SYSCALL4(x) \
- .globl NAME(x) ; \
- \
-NAME(x): \
- \
- push %ebx; \
- push %esi; \
- mov 12(%esp), %ebx; \
- mov 16(%esp), %ecx; \
- mov 20(%esp), %edx; \
- mov 24(%esp), %esi; \
- lea SYS_##x, %eax; \
- int $0x80; \
- pop %esi; \
- pop %ebx; \
- ret; \
- END(x)
-
-#define SYSCALL5(x) \
- .globl NAME(x) ; \
- \
-NAME(x): \
- \
- push %ebx; \
- push %esi; \
- push %edi; \
- mov 16(%esp), %ebx; \
- mov 20(%esp), %ecx; \
- mov 24(%esp), %edx; \
- mov 28(%esp), %esi; \
- mov 32(%esp), %edi; \
- lea SYS_##x, %eax; \
- int $0x80; \
- pop %edi; \
- pop %esi; \
- pop %ebx; \
- ret; \
- END(x)
-
-/* =========================================================================
- * exit 1 select 82
- * fork 2 fstatfs 100
- * read 3 socketcall 102
- * write 4 flock 143
- * open 5 readv 145
- * creat 8 writev 146
- * link 9
- * unlink 10
- * execve 11
- * chdir 12
- * chmod 15
- * chown 16
- * lseek 19
- * rename 38
- * dup 41
- * pipe 42
- * ioctl 54
- * fcntl 55
- * dup2 63
- * readdir 89
- * ftruncate 93
- * fchmod 94
- * fchown 95
- */
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * machdep_sys_read()
- */
-SYSCALL3(read)
-
-/* ==========================================================================
- * machdep_sys_write()
- */
-SYSCALL3(write)
-
-/* ==========================================================================
- * machdep_sys_open()
- */
-SYSCALL3(open)
-
-/* ==========================================================================
- * machdep_sys_close()
- */
-SYSCALL1(close)
-
-/* ==========================================================================
- * machdep_sys_creat()
- */
-SYSCALL2(creat)
-
-/* ==========================================================================
- * machdep_sys_dup2()
- */
-SYSCALL2(dup2)
-
-/* ==========================================================================
- * machdep_sys_fcntl()
- */
-SYSCALL3(fcntl)
-
-/* ==========================================================================
- * machdep_sys_fchown()
- */
-SYSCALL3(fchown)
-
-/* ==========================================================================
- * machdep_sys_fchmod()
- */
-SYSCALL2(fchmod)
-
-/* ==========================================================================
- * machdep_sys_ioctl()
- */
-SYSCALL3(ioctl)
-
-/* ==========================================================================
- * machdep_sys_chown()
- */
-SYSCALL3(chown)
-
-/* ==========================================================================
- * machdep_sys_chmod()
- */
-SYSCALL2(chmod)
-
-/* ==========================================================================
- * machdep_sys_chdir()
- */
-SYSCALL1(chdir)
-
-/* ==========================================================================
- * machdep_sys_unlink()
- */
-SYSCALL1(unlink)
-
-/* ==========================================================================
- * machdep_sys_link()
- */
-SYSCALL2(link)
-
-/* ==========================================================================
- * machdep_sys_rename()
- */
-SYSCALL2(rename)
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
-SYSCALL3(lseek)
-
-/* ==========================================================================
- * machdep_sys_pipe()
- */
-SYSCALL1(pipe)
-
-/* ==========================================================================
- * machdep_sys_dup()
- */
-SYSCALL1(dup)
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
-SYSCALL0(fork)
-
-/* ==========================================================================
- * machdep_sys_execve()
- */
-SYSCALL3(execve)
-
-/* ==========================================================================
- * machdep_sys_stat()
- */
-#ifdef __ELF__
-STATCALL2(stat)
-#else
-SYSCALL2(stat)
-#endif
-
-/* ==========================================================================
- * machdep_sys_fstat()
- */
-#ifdef __ELF__
-STATCALL2(fstat)
-#else
-SYSCALL2(fstat)
-#endif
-
-/* ==========================================================================
- * machdep_sys_lstat()
- */
-#ifdef __ELF__
-STATCALL2(lstat)
-#else
-SYSCALL2(lstat)
-#endif
-
-/* ==========================================================================
- * machdep_sys_fstatfs()
- */
-SYSCALL2(fstatfs)
-
-
-/* ==========================================================================
- * machdep_sys_ftruncate()
- */
-SYSCALL2(ftruncate)
-
-/* ==========================================================================
- * Nonstandard calls used to make the system work
- *
- * ==========================================================================
- * machdep_sys_select()
- */
-
- .globl NAME(select)
-
-NAME(select):
-
- push %ebx
- lea 8(%esp), %ebx
- lea SYS_select, %eax
- int $0x80
- pop %ebx
- ret
- END(select)
-
-/* ==========================================================================
- * machdep_sys_wait4()
- */
-SYSCALL4(wait4)
-
-/* ==========================================================================
- * machdep_sys_readdir()
- */
-SYSCALL3(readdir)
-
-/* ==========================================================================
- * machdep_sys_socketcall()
- */
-SYSCALL2(socketcall)
-
-
-SYSCALL1(exit)
-SYSCALL3(sigprocmask)
-
-/* ==========================================================================
- * machdep_sys_sigsuspend()
- */
-
- .globl NAME(sigsuspend)
-
-NAME(sigsuspend):
-
- push %ebp
- mov %esp,%ebp
- push %edi
- push %esi
- push %ebx
- mov 8(%ebp), %edx
- mov (%edx), %edx
- lea SYS_sigsuspend, %eax
- int $0x80
- pop %ebx
- pop %esi
- pop %edi
- mov %ebp,%esp
- pop %ebp
- ret
- END(sigsuspend)
-
-/* ==========================================================================
- * machdep_sys_readv()
- */
-#ifdef HAVE_SYSCALL_READV
-SYSCALL3(readv)
-#endif
-
-/* ==========================================================================
- * machdep_sys_writev()
- */
-#ifdef HAVE_SYSCALL_WRITEV
-SYSCALL3(writev)
-#endif
-
-/* ==========================================================================
- * machdep_sys_flock()
- */
-#ifdef HAVE_SYSCALL_FLOCK
-SYSCALL2(flock)
-#endif
diff --git a/mit-pthreads/machdep/syscall-i386-linux-2.0.S b/mit-pthreads/machdep/syscall-i386-linux-2.0.S
deleted file mode 100644
index d5807b2d9b4..00000000000
--- a/mit-pthreads/machdep/syscall-i386-linux-2.0.S
+++ /dev/null
@@ -1,389 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Description : Machine dependent syscalls for i386/i486/i586
- *
- * 1.00 93/08/26 proven
- * -Started coding this file.
- *
- * 1.01 93/11/13 proven
- * -The functions readv() and writev() added.
- *
- * 1.16 94/01/30 proven
- * -This file now requires gas version 2.0 or greater.
- */
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#include <sys/syscall.h>
-#include <config.h>
-
-#ifdef __ELF__
-
-#define NAME(X) machdep_sys_##X
-#define END(X) 1: ; .type NAME(X),@function ; .size NAME(X),1b - NAME(X)
-
-#else
-
-#define NAME(X) _machdep_sys_##X
-#define END(X)
-
-#endif
-
-#define SYSCALL0(x) \
- .globl NAME(x) ; \
- \
-NAME(x): \
- \
- push %ebx; \
- lea SYS_##x, %eax; \
- int $0x80; \
- pop %ebx; \
- ret; \
- \
- END(x)
-
-#define SYSCALL1(x) \
- .globl NAME(x) ; \
- \
-NAME(x): \
- \
- push %ebx; \
- mov 8(%esp), %ebx; \
- lea SYS_##x, %eax; \
- int $0x80; \
- pop %ebx; \
- ret; \
- \
- END(x)
-
-#define SYSCALL2(x) \
- .globl NAME(x) ; \
- \
-NAME(x): \
- \
- push %ebx; \
- mov 8(%esp), %ebx; \
- mov 12(%esp), %ecx; \
- lea SYS_##x, %eax; \
- int $0x80; \
- pop %ebx; \
- ret; \
- \
- END(x)
-
-#define SYSCALL3(x) \
- .globl NAME(x) ; \
- \
-NAME(x): \
- \
- push %ebx; \
- mov 8(%esp), %ebx; \
- mov 12(%esp), %ecx; \
- mov 16(%esp), %edx; \
- lea SYS_##x, %eax; \
- int $0x80; \
- pop %ebx; \
- ret; \
- END(x)
-
-
-#define SYSCALL4(x) \
- .globl NAME(x) ; \
- \
-NAME(x): \
- \
- push %ebx; \
- push %esi; \
- mov 12(%esp), %ebx; \
- mov 16(%esp), %ecx; \
- mov 20(%esp), %edx; \
- mov 24(%esp), %esi; \
- lea SYS_##x, %eax; \
- int $0x80; \
- pop %esi; \
- pop %ebx; \
- ret; \
- END(x)
-
-#define SYSCALL5(x) \
- .globl NAME(x) ; \
- \
-NAME(x): \
- \
- push %ebx; \
- push %esi; \
- push %edi; \
- mov 16(%esp), %ebx; \
- mov 20(%esp), %ecx; \
- mov 24(%esp), %edx; \
- mov 28(%esp), %esi; \
- mov 32(%esp), %edi; \
- lea SYS_##x, %eax; \
- int $0x80; \
- pop %edi; \
- pop %esi; \
- pop %ebx; \
- ret; \
- END(x)
-
-/* =========================================================================
- * exit 1 select 82
- * fork 2 fstatfs 100
- * read 3 socketcall 102
- * write 4 flock 143
- * open 5 readv 145
- * creat 8 writev 146
- * link 9
- * unlink 10
- * execve 11
- * chdir 12
- * chmod 15
- * chown 16
- * lseek 19
- * rename 38
- * dup 41
- * pipe 42
- * ioctl 54
- * fcntl 55
- * dup2 63
- * readdir 89
- * ftruncate 93
- * fchmod 94
- * fchown 95
- */
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * machdep_sys_read()
- */
-SYSCALL3(read)
-
-/* ==========================================================================
- * machdep_sys_write()
- */
-SYSCALL3(write)
-
-/* ==========================================================================
- * machdep_sys_open()
- */
-SYSCALL3(open)
-
-/* ==========================================================================
- * machdep_sys_close()
- */
-SYSCALL1(close)
-
-/* ==========================================================================
- * machdep_sys_creat()
- */
-SYSCALL2(creat)
-
-/* ==========================================================================
- * machdep_sys_dup2()
- */
-SYSCALL2(dup2)
-
-/* ==========================================================================
- * machdep_sys_fcntl()
- */
-SYSCALL3(fcntl)
-
-/* ==========================================================================
- * machdep_sys_fchown()
- */
-SYSCALL3(fchown)
-
-/* ==========================================================================
- * machdep_sys_fchmod()
- */
-SYSCALL2(fchmod)
-
-/* ==========================================================================
- * machdep_sys_ioctl()
- */
-SYSCALL3(ioctl)
-
-/* ==========================================================================
- * machdep_sys_chown()
- */
-SYSCALL3(chown)
-
-/* ==========================================================================
- * machdep_sys_chmod()
- */
-SYSCALL2(chmod)
-
-/* ==========================================================================
- * machdep_sys_chdir()
- */
-SYSCALL1(chdir)
-
-/* ==========================================================================
- * machdep_sys_unlink()
- */
-SYSCALL1(unlink)
-
-/* ==========================================================================
- * machdep_sys_link()
- */
-SYSCALL2(link)
-
-/* ==========================================================================
- * machdep_sys_rename()
- */
-SYSCALL2(rename)
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
-SYSCALL3(lseek)
-
-/* ==========================================================================
- * machdep_sys_pipe()
- */
-SYSCALL1(pipe)
-
-/* ==========================================================================
- * machdep_sys_dup()
- */
-SYSCALL1(dup)
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
-SYSCALL0(fork)
-
-/* ==========================================================================
- * machdep_sys_execve()
- */
-SYSCALL3(execve)
-
-/* ==========================================================================
- * machdep_sys_stat()
- */
-SYSCALL2(stat)
-
-/* ==========================================================================
- * machdep_sys_fstat()
- */
-SYSCALL2(fstat)
-
-/* ==========================================================================
- * machdep_sys_lstat()
- */
-SYSCALL2(lstat)
-
-/* ==========================================================================
- * machdep_sys_fstatfs()
- */
-SYSCALL2(fstatfs)
-
-/* ==========================================================================
- * machdep_sys_ftruncate()
- */
-SYSCALL2(ftruncate)
-
-/* ==========================================================================
- * machdep_sys_chroot()
- */
-SYSCALL1(chroot)
-
-/* ==========================================================================
- * machdep_sys_uname()
- */
-SYSCALL1(uname)
-
-/* ==========================================================================
- * Nonstandard calls used to make the system work
- *
- * ==========================================================================
- * machdep_sys_select()
- */
-
- .globl NAME(select)
-
-NAME(select):
-
- push %ebx
- lea 8(%esp), %ebx
- lea SYS_select, %eax
- int $0x80
- pop %ebx
- ret
- END(select)
-
-/* ==========================================================================
- * machdep_sys_wait4()
- */
-SYSCALL4(wait4)
-
-/* ==========================================================================
- * machdep_sys_readdir()
- */
-SYSCALL3(readdir)
-
-/* ==========================================================================
- * machdep_sys_socketcall()
- */
-SYSCALL2(socketcall)
-
-
-SYSCALL1(exit)
-SYSCALL3(sigprocmask)
-
-/* ==========================================================================
- * machdep_sys_sigsuspend()
- */
-
- .globl NAME(sigsuspend)
-
-NAME(sigsuspend):
-
- push %ebp
- mov %esp,%ebp
- push %edi
- push %esi
- push %ebx
- mov 8(%ebp), %edx
- mov (%edx), %edx
- lea SYS_sigsuspend, %eax
- int $0x80
- pop %ebx
- pop %esi
- pop %edi
- mov %ebp,%esp
- pop %ebp
- ret
- END(sigsuspend)
-
-/* ==========================================================================
- * machdep_sys_readv()
- */
-#ifdef HAVE_SYSCALL_READV
-SYSCALL3(readv)
-#endif
-
-/* ==========================================================================
- * machdep_sys_writev()
- */
-#ifdef HAVE_SYSCALL_WRITEV
-SYSCALL3(writev)
-#endif
-
-/* ==========================================================================
- * machdep_sys_flock()
- */
-#ifdef HAVE_SYSCALL_FLOCK
-SYSCALL2(flock)
-#endif
diff --git a/mit-pthreads/machdep/syscall-i386-netbsd-0.9.S b/mit-pthreads/machdep/syscall-i386-netbsd-0.9.S
deleted file mode 100644
index 8d768a673d3..00000000000
--- a/mit-pthreads/machdep/syscall-i386-netbsd-0.9.S
+++ /dev/null
@@ -1,229 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent syscalls for i386/i486/i586
- *
- * 1.00 93/08/26 proven
- * -Started coding this file.
- *
- * 1.01 93/11/13 proven
- * -The functions readv() and writev() added.
- */
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#if defined(SYSLIBC_SCCS) && !defined(lint)
- .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
-#endif /* SYSLIBC_SCCS and not lint */
-
-#include <machine/asm.h>
-#include <sys/syscall.h>
-
-#define SYSCALL(x) \
- .globl _machdep_sys_/**/x; \
- \
-_machdep_sys_/**/x:; \
- \
- movl $(SYS_/**/x), %eax; \
- .byte 0x9a; .long 0; .word 7; \
- jb 1b; \
- ret;
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- neg %eax
- ret
-
-/* ==========================================================================
- * machdep_sys_write()
- */
-SYSCALL(write)
-
-/* ==========================================================================
- * machdep_sys_read()
- */
-SYSCALL(read)
-
-/* ==========================================================================
- * machdep_sys_open()
- */
-SYSCALL(open)
-
-/* ==========================================================================
- * machdep_sys_close()
- */
-SYSCALL(close)
-
-/* ==========================================================================
- * machdep_sys_fcntl()
- */
-SYSCALL(fcntl)
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
-SYSCALL(lseek)
-
-/* ==========================================================================
- * machdep_sys_pipe()
- */
-SYSCALL(pipe)
-
-/* ==========================================================================
- * machdep_sys_dup()
- */
-SYSCALL(dup)
-
-/* ==========================================================================
- * machdep_sys_dup2()
- */
-SYSCALL(dup2)
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl _machdep_sys_fork;
-
-_machdep_sys_fork:;
-
- movl $(SYS_fork), %eax;
- .byte 0x9a; .long 0; .word 7;
- cmpl $0, %edx
- je 2f
- movl $0, %eax
-2:
- ret;
-
-/* ==========================================================================
- * machdep_sys_execve()
- */
-SYSCALL(execve)
-
-/* ==========================================================================
- * machdep_sys_fstat()
- */
-SYSCALL(fstat)
-
-/* ==========================================================================
- * Nonstandard calls used to make the system work
- *
- * ==========================================================================
- * machdep_sys_select()
- */
-SYSCALL(select)
-
-/* ==========================================================================
- * machdep_sys_getdirentries()
- */
-SYSCALL(getdirentries)
-
-/* ==========================================================================
- * Berkeley socket stuff
- *
- * ==========================================================================
- * machdep_sys_socket()
- */
-SYSCALL(socket)
-
-/* ==========================================================================
- * machdep_sys_bind()
- */
-SYSCALL(bind)
-
-/* ==========================================================================
- * machdep_sys_connect()
- */
-SYSCALL(connect)
-
-/* ==========================================================================
- * machdep_sys_accept()
- */
-SYSCALL(accept)
-
-/* ==========================================================================
- * machdep_sys_listen()
- */
-SYSCALL(listen)
-
-/* ==========================================================================
- * machdep_sys_getsockopt()
- */
-SYSCALL(getsockopt)
-
-/* ==========================================================================
- * machdep_sys_readv()
- */
-SYSCALL(readv)
-
-/* ==========================================================================
- * machdep_sys_writev()
- */
-SYSCALL(writev)
-
-/* ==========================================================================
- * machdep_sys_getpeername()
- */
-SYSCALL(getpeername)
-
-/* ==========================================================================
- * machdep_sys_getsockname()
- */
-SYSCALL(getsockname)
-
-/* ==========================================================================
- * machdep_sys_sendto()
- */
-SYSCALL(sendto)
-
-/* ==========================================================================
- * machdep_sys_recvfrom()
- */
-SYSCALL(recvfrom)
-
diff --git a/mit-pthreads/machdep/syscall-i386-netbsd-1.0.S b/mit-pthreads/machdep/syscall-i386-netbsd-1.0.S
deleted file mode 100644
index da535dd2f80..00000000000
--- a/mit-pthreads/machdep/syscall-i386-netbsd-1.0.S
+++ /dev/null
@@ -1,158 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent syscalls for i386/i486/i586
- *
- * 1.00 93/08/26 proven
- * -Started coding this file.
- *
- * 1.01 93/11/13 proven
- * -The functions readv() and writev() added.
- */
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#if defined(SYSLIBC_SCCS) && !defined(lint)
- .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
-#endif /* SYSLIBC_SCCS and not lint */
-
-#include <machine/asm.h>
-#include <sys/syscall.h>
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- neg %eax
- ret
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl _machdep_sys_fork;
-
-_machdep_sys_fork:;
-
- movl $(SYS_fork), %eax;
- .byte 0x9a; .long 0; .word 7;
- cmpl $0, %edx
- je 2f
- movl $0, %eax
-2:
- ret;
-
-/* ==========================================================================
- * machdep_sys___syscall()
- */
-
-_machdep_sys___syscall:;
-
- movl $(SYS___syscall), %eax;
- .byte 0x9a; .long 0; .word 7;
- jb 3f;
- ret
-
-/* ==========================================================================
- * machdep_sys_sigsuspend()
- */
- .globl _machdep_sys_sigsuspend;
-
-_machdep_sys_sigsuspend:;
-
- movl 4(%esp),%eax # fetch mask arg
- movl (%eax),%eax # indirect to mask arg
- movl %eax,4(%esp)
- movl $(SYS_sigsuspend), %eax;
- .byte 0x9a; .long 0; .word 7;
- jb 3f;
- ret
-
-3:
-
- neg %eax
- movl $0xffffffff,%edx
- ret
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
- .globl _machdep_sys_lseek;
-
-_machdep_sys_lseek:;
-
- pushl %ebp;
- movl %esp,%ebp;
- pushl 0x14(%ebp);
- pushl 0x10(%ebp);
- pushl 0xc(%ebp);
- pushl $0x0;
- pushl 0x8(%ebp);
- pushl $0x0;
- pushl $(SYS_lseek);
- call _machdep_sys___syscall;
- leave
- ret
-
-/* ==========================================================================
- * machdep_sys_ftruncate() ; Added by Monty
- */
- .globl _machdep_sys_ftruncate;
-
-_machdep_sys_ftruncate:;
-
- pushl %ebp;
- movl %esp,%ebp;
- pushl 0x10(%ebp);
- pushl 0xc(%ebp);
- pushl $0x0; # Why this?
- pushl 0x8(%ebp);
- pushl $0x0; # And this?
- pushl $(SYS_ftruncate);
- call _machdep_sys___syscall;
- leave
- ret
diff --git a/mit-pthreads/machdep/syscall-i386-netbsd-1.1.S b/mit-pthreads/machdep/syscall-i386-netbsd-1.1.S
deleted file mode 100644
index a74d2ac1af6..00000000000
--- a/mit-pthreads/machdep/syscall-i386-netbsd-1.1.S
+++ /dev/null
@@ -1,181 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent syscalls for i386/i486/i586
- *
- * 1.00 93/08/26 proven
- * -Started coding this file.
- *
- * 1.01 93/11/13 proven
- * -The functions readv() and writev() added.
- */
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#if defined(SYSLIBC_SCCS) && !defined(lint)
- .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
-#endif /* SYSLIBC_SCCS and not lint */
-
-#include <machine/asm.h>
-#include <sys/syscall.h>
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl _machdep_sys_fork;
-
-_machdep_sys_fork:;
-
- movl $(SYS_fork), %eax;
- .byte 0x9a; .long 0; .word 7;
- cmpl $0, %edx
- je 2f
- movl $0, %eax
-2:
- ret;
-
-/* ==========================================================================
- * machdep_sys___syscall()
- */
-
-_machdep_sys___syscall:;
-
- movl $(SYS___syscall), %eax;
- int $0x80;
- jb 3f;
- ret
-
-/* ==========================================================================
- * machdep_sys_sigsuspend()
- */
- .globl _machdep_sys_sigsuspend;
-
-_machdep_sys_sigsuspend:;
-
- movl 4(%esp),%eax # fetch mask arg
- movl (%eax),%eax # indirect to mask arg
- movl %eax,4(%esp)
- movl $(SYS_sigsuspend), %eax;
- int $0x80;
- jb 3f;
- ret
-
-3:
-
- neg %eax
- movl $0xffffffff,%edx
- ret
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
- .globl _machdep_sys_lseek;
-
-_machdep_sys_lseek:;
-
- pushl %ebp;
- movl %esp,%ebp;
- pushl 0x14(%ebp);
- pushl 0x10(%ebp);
- pushl 0xc(%ebp);
- pushl $0x0;
- pushl 0x8(%ebp);
- pushl $0x0;
- pushl $(SYS_lseek);
- call _machdep_sys___syscall;
- leave
- ret
-
-/* ==========================================================================
- * machdep_sys_ftruncate() ; Added by Monty
- */
- .globl _machdep_sys_ftruncate;
-
-_machdep_sys_ftruncate:;
-
- pushl %ebp;
- movl %esp,%ebp;
- pushl 0x10(%ebp);
- pushl 0xc(%ebp);
- pushl $0x0; # Why this?
- pushl 0x8(%ebp);
- pushl $0x0; # And this?
- pushl $(SYS_ftruncate);
- call _machdep_sys___syscall;
- leave
- ret
-
-/* ==========================================================================
- * machdep_sys_sigprocmask()
- */
- .globl _machdep_sys_sigprocmask;
-
-_machdep_sys_sigprocmask:;
-
- movl 8(%esp),%ecx
- movl (%ecx),%ecx
- movl %ecx,8(%esp)
- movl $(SYS_sigprocmask), %eax;
- int $0x80;
- jb 3b;
- ret
-
-/* ==========================================================================
- * machdep_sys_pipe()
- */
- .globl _machdep_sys_pipe;
-
-_machdep_sys_pipe:;
-
- movl $(SYS_pipe), %eax;
- int $0x80;
- jb 3b;
- movl 4(%esp),%ecx
- movl %eax,(%ecx)
- movl %edx,4(%ecx)
- xorl %eax,%eax
- ret
-
diff --git a/mit-pthreads/machdep/syscall-i386-netbsd-1.3.S b/mit-pthreads/machdep/syscall-i386-netbsd-1.3.S
deleted file mode 100644
index 85dc6b3e5bc..00000000000
--- a/mit-pthreads/machdep/syscall-i386-netbsd-1.3.S
+++ /dev/null
@@ -1,200 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent syscalls for i386/i486/i586
- *
- * 1.00 93/08/26 proven
- * -Started coding this file.
- *
- * 1.01 93/11/13 proven
- * -The functions readv() and writev() added.
- */
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#if defined(SYSLIBC_SCCS) && !defined(lint)
- .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
-#endif /* SYSLIBC_SCCS and not lint */
-
-#include <machine/asm.h>
-#include <sys/syscall.h>
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl _C_LABEL(machdep_sys_fork);
-
-_C_LABEL(machdep_sys_fork):;
-
- movl $(SYS_fork), %eax;
- .byte 0x9a; .long 0; .word 7;
- cmpl $0, %edx
- je 2f
- movl $0, %eax
-2:
- ret;
-
-/* ==========================================================================
- * machdep_sys___syscall()
- */
-
-_machdep_sys___syscall:;
-
- movl $(SYS___syscall), %eax;
- int $0x80;
- jb 3f;
- ret
-
-#ifndef SYS___sigsuspend14
-/* ==========================================================================
- * machdep_sys_sigsuspend()
- */
- .globl _C_LABEL(machdep_sys_sigsuspend);
-
-_C_LABEL(machdep_sys_sigsuspend):;
-
- movl 4(%esp),%eax # fetch mask arg
- movl (%eax),%eax # indirect to mask arg
- movl %eax,4(%esp)
- movl $(SYS_sigsuspend), %eax;
- int $0x80;
- jb 3f;
- ret
-#endif
-
-3:
-
- neg %eax
- movl $0xffffffff,%edx
- ret
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
- .globl _C_LABEL(machdep_sys_lseek);
-
-_C_LABEL(machdep_sys_lseek):;
-
- pushl %ebp;
- movl %esp,%ebp;
- pushl 0x14(%ebp);
- pushl 0x10(%ebp);
- pushl 0xc(%ebp);
- pushl $0x0;
- pushl 0x8(%ebp);
- pushl $0x0;
- pushl $(SYS_lseek);
- call _machdep_sys___syscall;
- leave
- ret
-
-/* ==========================================================================
- * machdep_sys_ftruncate() ; Added by Monty
- */
- .globl _C_LABEL(machdep_sys_ftruncate);
-
-_C_LABEL(machdep_sys_ftruncate):;
-
- pushl %ebp;
- movl %esp,%ebp;
- pushl 0x10(%ebp);
- pushl 0xc(%ebp);
- pushl $0x0; # Why this?
- pushl 0x8(%ebp);
- pushl $0x0; # And this?
- pushl $(SYS_ftruncate);
- call _machdep_sys___syscall;
- leave
- ret
-
-#ifndef SYS___sigprocmask14
-/* ==========================================================================
- * machdep_sys_sigprocmask()
- */
- .globl _C_LABEL(machdep_sys_sigprocmask);
-
-_C_LABEL(machdep_sys_sigprocmask):;
-
- movl 8(%esp),%ecx
- movl (%ecx),%ecx
- movl %ecx,8(%esp)
- movl $(SYS_sigprocmask), %eax;
- int $0x80;
- jb 3b;
- ret
-#endif
-
-/* ==========================================================================
- * machdep_sys_pipe()
- */
- .globl _C_LABEL(machdep_sys_pipe);
-
-_C_LABEL(machdep_sys_pipe):;
-
- movl $(SYS_pipe), %eax;
- int $0x80;
- jb 3b;
- movl 4(%esp),%ecx
- movl %eax,(%ecx)
- movl %edx,4(%ecx)
- xorl %eax,%eax
- ret
-
-/* ==========================================================================
- * machdep_sys_fstat()
- */
- .globl _C_LABEL(machdep_sys_fstat);
-
-_C_LABEL(machdep_sys_fstat):;
- movl $(SYS___fstat13), %eax;
- int $0x80;
- jb 4f;
- ret
-4:
- neg %eax
- movl $0xffffffff,%edx
- ret
-
diff --git a/mit-pthreads/machdep/syscall-i386-openbsd-2.0.S b/mit-pthreads/machdep/syscall-i386-openbsd-2.0.S
deleted file mode 100644
index cfdbbc77f73..00000000000
--- a/mit-pthreads/machdep/syscall-i386-openbsd-2.0.S
+++ /dev/null
@@ -1,237 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1995 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent syscalls for i386/i486/i586
- *
- */
-
-#ifndef lint
- .text
- .asciz "syscall-i386-freebsd-2.0.S,v 1.2 1995/05/26 07:44:29 proven Exp";
-#endif
-
-#if defined(SYSLIBC_SCCS) && !defined(lint)
- .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
-#endif /* SYSLIBC_SCCS and not lint */
-
-#include <sys/syscall.h>
-
-#ifdef __STDC__
-
-#define SYSCALL(x) \
- .globl _machdep_sys_##x##; \
- \
-_machdep_sys_##x##:; \
- \
- movl $(SYS_##x##), %eax; \
- .byte 0x9a; .long 0; .word 7; \
- jb 1b; \
- ret;
-
-#else
-
-#define SYSCALL(x) \
- .globl _machdep_sys_/**/x; \
- \
-_machdep_sys_/**/x:; \
- \
- movl $(SYS_/**/x), %eax; \
- .byte 0x9a; .long 0; .word 7; \
- jb 1b; \
- ret;
-
-#endif
-
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- neg %eax
- ret
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl _machdep_sys_fork;
-
-_machdep_sys_fork:;
-
- movl $(SYS_fork), %eax;
- .byte 0x9a; .long 0; .word 7;
- cmpl $0, %edx
- je 2f
- movl $0, %eax
-2:
- ret;
-
-/* ==========================================================================
- * machdep_sys___syscall()
- */
-
-_machdep_sys___syscall:;
-
- movl $(SYS___syscall), %eax;
- .byte 0x9a; .long 0; .word 7;
- jb 3f;
- ret
-
-/* ==========================================================================
- * machdep_sys_sigsuspend()
- */
- .globl _machdep_sys_sigsuspend;
-
-_machdep_sys_sigsuspend:;
-
- movl 4(%esp),%eax # fetch mask arg
- movl (%eax),%eax # indirect to mask arg
- movl %eax,4(%esp)
- movl $(SYS_sigsuspend), %eax;
- .byte 0x9a; .long 0; .word 7;
- jb 3f;
- ret
-
-3:
-
- neg %eax
- movl $0xffffffff,%edx
- ret
-
-/* ==========================================================================
- * machdep_sys_sigprocmask()
- */
- .globl _machdep_sys_sigprocmask;
-
-_machdep_sys_sigprocmask:;
-
- movl 8(%esp),%ecx
- movl (%ecx),%ecx
- movl %ecx,8(%esp)
- movl $ SYS_sigprocmask , %eax
- .byte 0x9a; .long 0; .word 7;
- jb 4f;
- ret
-
-4:
- neg %eax
- movl $0xffffffff,%edx
- ret
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
- .globl _machdep_sys_lseek;
-
-_machdep_sys_lseek:;
-
- pushl %ebp;
- movl %esp,%ebp;
- pushl 0x14(%ebp);
- pushl 0x10(%ebp);
- pushl 0xc(%ebp);
- pushl $0x0;
- pushl 0x8(%ebp);
- pushl $0x0;
- pushl $(SYS_lseek);
- call _machdep_sys___syscall;
- leave
- ret
-
-/* ==========================================================================
- * machdep_sys_ftruncate() ; Added by Monty
- */
- .globl _machdep_sys_ftruncate;
-
-_machdep_sys_ftruncate:;
-
- pushl %ebp;
- movl %esp,%ebp;
- pushl 0x10(%ebp);
- pushl 0xc(%ebp);
- pushl $0x0; # Why this?
- pushl 0x8(%ebp);
- pushl $0x0; # And this?
- pushl $(SYS_ftruncate);
- call _machdep_sys___syscall;
- leave
- ret
-
-/* ==========================================================================
- * machdep_sys_setjmp()
- */
- .globl _machdep_sys_setjmp;
-
-_machdep_sys_setjmp:;
- movl 4(%esp),%eax
- movl 0(%esp),%edx
- movl %edx, 0(%eax) /* rta */
- movl %ebx, 4(%eax)
- movl %esp, 8(%eax)
- movl %ebp,12(%eax)
- movl %esi,16(%eax)
- movl %edi,20(%eax)
- xorl %eax,%eax
- ret
-
-/* ==========================================================================
- * machdep_sys_longjmp()
- */
- .globl _machdep_sys_longjmp;
-
-_machdep_sys_longjmp:;
- movl 4(%esp),%edx
- movl 8(%esp),%eax
- movl 0(%edx),%ecx
- movl 4(%edx),%ebx
- movl 8(%edx),%esp
- movl 12(%edx),%ebp
- movl 16(%edx),%esi
- movl 20(%edx),%edi
- testl %eax,%eax
- jnz 1f
- incl %eax
-1: movl %ecx,0(%esp)
- ret
-
diff --git a/mit-pthreads/machdep/syscall-i386-sco-3.2v5.S b/mit-pthreads/machdep/syscall-i386-sco-3.2v5.S
deleted file mode 100644
index 0a60dcdd866..00000000000
--- a/mit-pthreads/machdep/syscall-i386-sco-3.2v5.S
+++ /dev/null
@@ -1,442 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1995 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent syscalls for i386/i486/i586
- *
- */
-
-#ifndef lint
- .text
- .asciz "syscall-i386-sco-3.2v5.S,v 1.2 1995/05/26 07:44:29 proven Exp";
-#endif
-
-#if defined(SYSLIBC_SCCS) && !defined(lint)
- .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
-#endif /* SYSLIBC_SCCS and not lint */
-
-#include <sys/errno.h>
-#include <sys/syscall.h>
-
-#ifdef _SCO_ELF
-
-#define NAME(X) machdep_sys_##X
-#define GETADDR(X) \
- call 1f; \
-1: \
- popl %ebx; \
- addl $NAME(X)+[.-1b], %ebx
-
-#define END(X) 1: ; .type NAME(X),@function ; .size NAME(X),1b - NAME(X)
-
-#else
-
-#define NAME(X) _machdep_sys_##X
-#define END(X)
-
-#endif
-
-#ifdef __STDC__
-
-#define SYSCALL(x) \
- .globl NAME(x); \
- \
-NAME(x): \
- movl $(SYS_##x##), %eax; \
- lcall $7, $0; \
- jae 1f; \
- cmp $(ERESTART), %eax; \
- je NAME(x); \
- neg %eax; \
-1: \
- ret; \
-\
- END(x)
-
-
-#else
-
-#define SYSCALL(x) \
- .globl NAME(x); \
- \
-NAME(x): \
- \
- movl $(SYS_/**/x), %eax; \
- lcall $7, $0; \
- jb 1b; \
- ret; \
- END(x)
-
-#endif
-
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl NAME(fork);
-
-NAME(fork):;
- movl $(SYS_fork), %eax
- lcall $7, $0
- jae 1f
- neg %eax
- ret
-1:
- test %edx, %edx
- je 2f
- xor %eax, %eax
-2:
- ret;
- END(fork)
-
-/* ==========================================================================
- * NAME(getdents)
- */
- .globl NAME(getdents);
-
-NAME(getdents):
- movl $(SYS_getdents), %eax;
- lcall $7, $0
- jae 1f
- neg %eax
-1:
- ret;
- END(getdents)
-
-/* ==========================================================================
- * NAME(fxstat)
- */
- .globl NAME(fxstat);
-
-NAME(fxstat):;
- movl $(SYS_fxstat), %eax;
- lcall $7, $0
- jae 1f
- neg %eax;
- ret;
-1:
- xor %eax, %eax;
- ret;
- END(fxstat)
-
-/* ==========================================================================
- * NAME(signal)
- */
- .globl NAME(signal);
-
-NAME(signal):;
- movl 4(%esp), %ecx
- movl $(SYS_signal),%eax
-#if 0
- call .L1
-.L1:
- popl %edx
- addl $(NAME(sigreturn)+[.-.L1]), %edx
-#else
- movl $NAME(sigreturn), %edx
-#endif
- lcall $7,$0
- jae 1f
-# movl %eax, 12(%esp)
- neg %eax
- ret
-1:
-# xor %eax, %eax
-# movl %eax, 12(%esp)
- ret
- END(signal)
-
-/* ==========================================================================
- * NAME(sigaction)
- */
- .globl NAME(sigaction);
-
-NAME(sigaction):
- movl $(SYS_sigaction),%eax
-#if 0
- call .L2
-.L2:
- popl %edx
- addl $(NAME(sigreturn)+[.-.L2]), %edx
-#else
- movl $NAME(sigreturn), %edx
-#endif
- lcall $7, $0
- jb 1f
- xor %eax, %eax
- ret
-1:
- neg %eax
- ret
- END(sigaction)
-
- .globl NAME(sigreturn)
-NAME(sigreturn):
- addl $4,%esp
- lcall $0xf, $0
- nop
- nop
- END(sigreturn)
-
-/* ==========================================================================
- * NAME(waitpid)
- */
- .globl NAME(waitpid);
-
-NAME(waitpid):
- .byte 0x9c
- popl %eax
- orl $0x8c4, %eax
- pushl %eax
- .byte 0x9d
- movl $(SYS_wait), %eax
- lcall $7, $0
- jae 2f
- cmpl $(ERESTART), %al
- je NAME(waitpid)
- neg %eax
-3:
- ret
-2:
- movl 8(%esp), %ecx
- test %ecx,%ecx
- je 3b
- mov %edx, (%ecx)
- ret
- END(waitpid)
-
-/* ==========================================================================
- * NAME(uname)
- */
- .globl NAME(uname);
-
-NAME(uname):
- pushl $0
- pushl $0
- pushl 12(%esp)
- subl $4, %esp
- movl $(SYS_utssys), %eax
- .byte 0x9a; .long 0; .word 7;
- jb 1f
- addl $16, %esp
- ret
-1:
- addl $16, %esp
- neg %eax
- ret
- END(uname)
-
-
-/* ==========================================================================
- * machdep_sys_ftruncate
- */
-
-SYSCALL(ftruncate)
-
-/* ==========================================================================
- * machdep_sys_ftime
- */
-
-SYSCALL(ftime)
-
-/* ==========================================================================
- * machdep_sys_gettimeofday()
- */
-
-SYSCALL(gettimeofday)
-
-/* ==========================================================================
- * machdep_sys_kill()
- */
-
-SYSCALL(kill)
-
-/* ==========================================================================
- * pthread_sys_setitimer
- */
- .globl NAME(setitimer);
-
-NAME(setitimer):;
- movl $(SYS_setitimer), %eax;
- lcall $7, $0
- jae 1f
- neg %eax
- ret
-1:
- xor %eax, %eax
- ret;
- END(setitimer)
-
-/* ==========================================================================
- * pthread_sys_sysconf
- */
- .globl NAME(sysconf);
-
-NAME(sysconf):;
- movl $(SYS_sysconf), %eax;
- lcall $7, $0
- jae 1f
- neg %eax
-1:
- ret;
- END(sysconf)
-
-/* ==========================================================================
- * pthread_sys_sysi86()
- */
- .globl NAME(sysi86);
-
-NAME(sysi86):;
- movl $(SYS_sysi86), %eax
- lcall $7, $0
- jae 1f
- neg %eax
-1:
- ret;
- END(sysi86)
-
-
-/* ==========================================================================
- * machdep_sys_brk()
- */
- .globl NAME(brk);
-
-NAME(brk):;
- movl $(SYS_break), %eax
- lcall $7, $0
- jae 1f
- neg %eax
- ret
-1:
- xor %eax, %eax
- ret;
- END(brk)
-
-/* ==========================================================================
- * machdep_sys_pipe()
- */
- .globl NAME(pipe);
-
-NAME(pipe):;
- movl $(SYS_pipe), %eax;
- lcall $7, $0
- jae 1f
- neg %eax
- ret
-1:
- movl 4(%esp), %ecx
- movl %eax, (%ecx)
- movl %edx, 4(%ecx)
- xor %eax, %eax
- ret;
- END(brk)
-
-/* ==========================================================================
- * machdep_sys_fcntl()
- */
- .globl NAME(fcntl);
-
-NAME(fcntl):;
- movl $(SYS_fcntl), %eax
- lcall $7, $0
- jae 1f
- neg %eax
-1:
- ret
- END(fcntl)
-
-
-/* ==========================================================================
- * machdep_sys_select()
- */
- .globl NAME(select);
-
-NAME(select):;
- movl $(SYS_select), %eax
- lcall $7, $0
- jae 1f
- cmp $(ERESTART), %eax
- jne 2f
- movl $(EINTR), %eax
-2:
- neg %eax
-1:
- ret
- END(select)
-
-
-/* ==========================================================================
- * setjmp()
- */
- .globl setjmp;
-
-setjmp:
- movl 4(%esp),%eax
- movl %ebx,(%eax)
- movl %esi,4(%eax)
- movl %edi,8(%eax)
- movl %ebp,12(%eax)
- popl %edx
- movl %esp,16(%eax)
- movl %edx,20(%eax)
- subl %eax,%eax
- jmp *%edx
-1: ; .type setjmp,@function ; .size setjmp,1b - setjmp
-
-/* ==========================================================================
- * longjmp()
- */
- .globl longjmp;
-
-longjmp:
- movl 4(%esp),%edx
- movl 8(%esp),%eax
- movl 0(%edx),%ebx
- movl 4(%edx),%esi
- movl 8(%edx),%edi
- movl 12(%edx),%ebp
- movl 16(%edx),%esp
- test %eax,%eax
- jne 1f
- inc %eax
-1:
- jmp *20(%edx)
-1: ; .type longjmp,@function ; .size longjmp,1b - longjmp
diff --git a/mit-pthreads/machdep/syscall-ip22-irix-5.2.S b/mit-pthreads/machdep/syscall-ip22-irix-5.2.S
deleted file mode 100644
index ded0fc55e38..00000000000
--- a/mit-pthreads/machdep/syscall-ip22-irix-5.2.S
+++ /dev/null
@@ -1,106 +0,0 @@
-#include <sys.s>
-#include <sys/regdef.h>
-
-/*
- Kernel syscall interface:
- Input:
- v0 syscall number
- Output:
-
- This macro is similar to SYSCALL in sys/syscall.h, but not completely.
- There's room for optimization, if we assume this will continue to
- be assembled as one file.
-
- Compile with -DPIC for pic code.
-*/
-
-#ifdef PIC
-#define PICOPT .option pic2
-#else
-#define PICOPT
-#endif
-
-
-#define YSYSCALL(x) \
- PICOPT; \
- .globl machdep_sys_##x; \
- .ent machdep_sys_##x, 0; \
-machdep_sys_##x:; \
- .frame sp,0,ra; \
- .set noreorder; \
- li v0, SYS_##x; \
- syscall; \
- bne a3, zero, 1b; \
- nop; \
- j ra; \
- nop; \
- .end machdep_sys_##x
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- subu v0,zero,v0;
- j ra;
-
-/* ==========================================================================
- * lstat
- */
- PICOPT;
- .globl machdep_sys_lstat;
- .ent machdep_sys_lstat, 0;
-machdep_sys_lstat:;
- .frame sp,0,ra;
- .set noreorder;
- move a2, a1
- move a1, a0
- li a0, 2
- li v0, SYS_lxstat;
- syscall;
- bne a3, zero, 1b;
- nop;
- j ra;
- nop;
- .end machdep_sys_lstat
-
-/* ==========================================================================
- * fstat
- */
- PICOPT;
- .globl machdep_sys_fstat;
- .ent machdep_sys_fstat, 0;
-machdep_sys_fstat:;
- .frame sp,0,ra;
- .set noreorder;
- move a2, a1
- move a1, a0
- li a0, 2
- li v0, SYS_fxstat;
- syscall;
- bne a3, zero, 1b;
- nop;
- j ra;
- nop;
- .end machdep_sys_fstat
-
-/* ==========================================================================
- * stat
- */
- PICOPT;
- .globl machdep_sys_stat;
- .ent machdep_sys_stat, 0;
-machdep_sys_stat:;
- .frame sp,0,ra;
- .set noreorder;
- move a2, a1
- move a1, a0
- li a0, 2
- li v0, SYS_xstat;
- syscall;
- bne a3, zero, 1b;
- nop;
- j ra;
- nop;
- .end machdep_sys_stat
diff --git a/mit-pthreads/machdep/syscall-m68000-netbsd.S b/mit-pthreads/machdep/syscall-m68000-netbsd.S
deleted file mode 100644
index f36286770a2..00000000000
--- a/mit-pthreads/machdep/syscall-m68000-netbsd.S
+++ /dev/null
@@ -1,83 +0,0 @@
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#include <machine/asm.h>
-#include <sys/syscall.h>
-
-#ifdef __STDC__
-#define IMM #
-#define SYSCALL(x) .even; ENTRY(machdep_sys_ ## x); \
- movl IMM SYS_ ## x,d0; trap IMM 0; jcs err; rts
-#else /* !__STDC__ */
-#define SYSCALL(x) .even; ENTRY(machdep_sys_/**/x); \
- movl #SYS_/**/x,d0; trap #0; jcs err; rts
-#endif /* !__STDC__ */
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .even
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-err:
- negl d0
- rts
-
-/* ==========================================================================
- * machdep_sys_pipe
- */
- .even
-ENTRY(machdep_sys_pipe);
- movl #SYS_pipe,d0
- trap #0
- jcs err
- movl sp@(4),a0
- movl d0,a0@+
- movl d1,a0@
- clrl d0
- rts
-
-#ifndef SYS___sigsuspend14
- .even
-ENTRY(machdep_sys_sigsuspend)
- movl sp@(4),a0
- movl a0@,sp@(4)
- movl #SYS_compat_13_sigsuspend13,d0
- trap #0
- jcs err
- clrl d0
- rts
-#endif
-
-#ifndef SYS___sigprocmask14
- .even
-ENTRY(machdep_sys_sigprocmask)
- tstl sp@(8)
- jne gotptr
-/* movl #0,sp@(8) /* null mask pointer; block empty set */
- movl #1,sp@(4)
- jra doit
-gotptr:
- movl sp@(8),a0
- movl a0@,sp@(8)
-doit:
- movl #SYS_compat_13_sigprocmask13,d0
- trap #0
- jcs err
- tstl sp@(12)
- jeq out
- movl sp@(12),a0
- movl d0,a0@
-out:
- clrl d0
- rts
-#endif
diff --git a/mit-pthreads/machdep/syscall-powerpc-netbsd.S b/mit-pthreads/machdep/syscall-powerpc-netbsd.S
deleted file mode 100644
index bdda457f116..00000000000
--- a/mit-pthreads/machdep/syscall-powerpc-netbsd.S
+++ /dev/null
@@ -1,185 +0,0 @@
-#include <machine/asm.h>
-#define COMPAT_43
-#include <sys/syscall.h>
-#ifndef __CONCAT
-#include <sys/cdefs.h>
-#endif
-#define CONCAT __CONCAT
-
-#undef SYSCALL
-
-/* Kernel syscall interface:
- Input:
- 0 - system call number
- 3-8 - arguments, as in C
- Output:
- so - (summary overflow) clear iff successful
-
- This macro is similar to SYSCALL in asm.h, but not completely.
- There's room for optimization, if we assume this will continue to
- be assembled as one file.
-
- This macro expansions does not include the return instruction.
- If there's no other work to be done, use something like:
- SYSCALL(foo) ; ret
- If there is other work to do (in fork, maybe?), do it after the
- SYSCALL invocation. */
-
-ENTRY(machdep_cerror)
- mflr 0 # Save LR in 0
- stwu 1,-16(1) # allocate new stack frame
- stw 0,20(1) # Stash 0 in stack
- stw 31,8(1) # Stash 31 in stack (since it's callee-saved
- mr 31,3 # and we stash return there)
- bl PIC_PLT(_C_LABEL(__errno))
- stw 31,0(3) # *errno() = err
- lwz 0,20(1) # Restore LR from stack to 0
- neg 3,31 # return -errno to 3
- lwz 31,8(1) # Restore 31 from stack
- mtlr 0
- la 1,16(1) # Restore stack frame
- li 4,-1 # Put -1 in r4 for those syscalls that return
- blr # two values
-
-/* The fork system call is special... */
-ENTRY(machdep_sys_fork)
- li 0, SYS_fork
- sc
- bso PIC_PLT(_C_LABEL(machdep_cerror))
- addi 4,4,-1
- blr
-
-/* The pipe system call is special... */
-ENTRY(machdep_sys_pipe)
- mr 5,3
- li 0,SYS_pipe
- sc
- bso PIC_PLT(_C_LABEL(machdep_cerror))
- stw 3,0(5) # Success, store fds
- stw 4,4(5)
- li 3,0
- blr # And return 0
-
-#ifndef SYS___sigsuspend14
-/* The sigsuspend system call is special... */
-ENTRY(machdep_sys_sigsuspend)
- lwz 3,0(3)
- li 0,SYS_compat_13_sigsuspend13
- sc
- b PIC_PLT(_C_LABEL(machdep_cerror))
-#endif /* SYS_sigsuspend14 */
-
-#ifndef SYS___sigprocmask14
-/* The sigprocmask system call is special... */
-ENTRY(machdep_sys_sigprocmask)
- or. 4,4,4 # Set == NULL ?
- li 6,1 # how = SIG_BLOCK
- beq Ldoit
- lwz 4,0(4) # if not, replace it in r4 with #set
- mr 6,3
-Ldoit: mr 3,6 # ... using sigprocmask(SIG_BLOCK)
- li 0,SYS_compat_13_sigprocmask13
- sc
- bso PIC_PLT(_C_LABEL(machdep_cerror))
- or. 5,5,5 # Check to see if oset requested
- beq Ldone # if oset != NULL
- stw 3,0(5) # *oset = oldmask
-Ldone:
- li 3,0 # return 0
- blr
-#endif /* SYS_sigprocmask14 */
-
-/* More stuff ... */
-
-/* For fstat() we actually syscall fstat13. */
-ENTRY(machdep_sys_fstat)
- li 0, SYS___fstat13
- sc
- bnslr
- b PIC_PLT(_C_LABEL(machdep_cerror))
-
-/* Do we need to save the entire floating point state? I think so... */
-ENTRY(__machdep_save_fp_state)
- stwu 1,-8(1)
- stw 3,4(1)
- stfd 0,0(3)
- stfdu 1,8(3)
- stfdu 2,8(3)
- stfdu 3,8(3)
- stfdu 4,8(3)
- stfdu 5,8(3)
- stfdu 6,8(3)
- stfdu 7,8(3)
- stfdu 8,8(3)
- stfdu 9,8(3)
- stfdu 10,8(3)
- stfdu 11,8(3)
- stfdu 12,8(3)
- stfdu 13,8(3)
- stfdu 14,8(3)
- stfdu 15,8(3)
- stfdu 16,8(3)
- stfdu 17,8(3)
- stfdu 18,8(3)
- stfdu 19,8(3)
- stfdu 20,8(3)
- stfdu 21,8(3)
- stfdu 22,8(3)
- stfdu 23,8(3)
- stfdu 24,8(3)
- stfdu 25,8(3)
- stfdu 26,8(3)
- stfdu 27,8(3)
- stfdu 28,8(3)
- stfdu 29,8(3)
- stfdu 30,8(3)
- stfdu 31,8(3)
- mffs 0
- stfdu 0,8(3)
- lwz 3,4(1)
- lwz 1,0(1)
- blr
-
-ENTRY(__machdep_restore_fp_state)
- stwu 1,-12(1)
- stw 3,4(1)
- stw 4,8(1)
- mr 4,3
- lfdu 1,8(3)
- lfdu 2,8(3)
- lfdu 3,8(3)
- lfdu 4,8(3)
- lfdu 5,8(3)
- lfdu 6,8(3)
- lfdu 7,8(3)
- lfdu 8,8(3)
- lfdu 9,8(3)
- lfdu 10,8(3)
- lfdu 11,8(3)
- lfdu 12,8(3)
- lfdu 13,8(3)
- lfdu 14,8(3)
- lfdu 15,8(3)
- lfdu 16,8(3)
- lfdu 17,8(3)
- lfdu 18,8(3)
- lfdu 19,8(3)
- lfdu 20,8(3)
- lfdu 21,8(3)
- lfdu 22,8(3)
- lfdu 23,8(3)
- lfdu 24,8(3)
- lfdu 25,8(3)
- lfdu 26,8(3)
- lfdu 27,8(3)
- lfdu 28,8(3)
- lfdu 29,8(3)
- lfdu 30,8(3)
- lfdu 31,8(3)
- lfdu 0,8(3)
- mtfsf 127,0
- lfd 0,0(4)
- lwz 3,4(1)
- lwz 4,8(1)
- lwz 1,0(1)
- blr
diff --git a/mit-pthreads/machdep/syscall-r2000-ultrix-4.2.S b/mit-pthreads/machdep/syscall-r2000-ultrix-4.2.S
deleted file mode 100644
index dc891dc37bd..00000000000
--- a/mit-pthreads/machdep/syscall-r2000-ultrix-4.2.S
+++ /dev/null
@@ -1,166 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent syscalls for decstation with r2000/r3000
- *
- * 1.00 93/08/14 proven
- * -Started coding this file.
- */
-
- .text
- .ascii "$Id$";
-
-#include <syscall.h>
-#include <machine/regdef.h>
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value. Eventually I want to load the errno value directly
- * into pthread_run->error but until then ...
- */
-machdep_error:
- negu v0, v0 /* Return negative of errno value. */
- j ra
-
-/* ==========================================================================
- * Syscalls already done,
- * Standard Other important BSD sockets
- * fork = 2 select = 93 socket = 97
- * read = 3 readv = 120 connect = 98
- * write = 4 writev = 121 accept = 99
- * open = 5 getdirentries = send = 101
- * close = 6 recv = 102
- * creat = 8 bind = 104
- * link = 9 listen = 106
- * unlink = 10 recvmsg = 113
- * chdir = 12 sendmsg = 114
- * chmod = 15 getsockopt = 118
- * chown = 16 recvfrom = 125
- * lseek = 19 sendto = 133
- * stat = 38 shutdown = 134
- * dup = 41 getpeername = 141
- * pipe = 42
- * execve = 59
- * fstat = 62
- * wait3 = 84
- * dup2 = 90
- * fcntl = 92
- * fchown = 123
- * fchmod = 124
- * rename = 128
- * waitpid = 189
- * ======================================================================= */
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl machdep_sys_fork
- .ent machdep_sys_fork
-
-machdep_sys_fork:
-
- .frame sp,0,ra /* No frame, return address in ra */
-
- li v0,SYS_fork /* Load fork syscall # into v0 */
- syscall
- bne a3,zero,machdep_error /* Error if a3 != 0 */
- beqz v1,__fork_parent /* Second return value = 0, if parent */
- li v0,0
-__fork_parent:
- j ra
-
- .end machdep_sys_fork
-
-/* ==========================================================================
- * machdep_sys_pipe()
- */
- .globl machdep_sys_pipe
- .ent machdep_sys_pipe
-
-machdep_sys_pipe:
-
- .frame sp,0,ra /* No frame, return address in ra */
-
- li v0,SYS_pipe /* Load pipe syscall # into v0 */
- syscall
- bne a3,zero,machdep_error /* Error if a3 != 0 */
- sw v0, 0(a0)
- sw v1, 4(a0)
- li v0, 0
- j ra
-
- .end machdep_sys_pipe
-
-/* ==========================================================================
- * Other important asm routines.
- * ======================================================================= */
-/* ==========================================================================
- * fake_setjmp()
- */
- .globl fake_setjmp
- .ent fake_setjmp
-
-fake_setjmp:
-
- .frame sp,0,ra /* No frame, return address in ra */
-
- /* Save all the important registers */
- sw ra,8(a0)
- sw gp,124(a0)
- sw sp,128(a0)
- sw s0,76(a0)
- /* More registers needed. */
- j ra
-
- .end fake_longjmp
-
-/* ==========================================================================
- * machdep_sys_longjmp()
- */
- .globl machdep_sys_longjmp
- .ent machdep_sys_longjmp
-
-machdep_sys_longjmp:
-
- .frame sp,0,ra /* No frame, return address in ra */
- li a1,1 /* Load 1 into reg a1 */
- sw a1, 20(a0); /* Load a1 into address a0 + 20 */
- li v0,SYS_sigreturn /* Load sigreturn syscall # into v0 */
- syscall /* Do syscall to do longjmp */
- j ra
-
- .end machdep_sys_longjmp
diff --git a/mit-pthreads/machdep/syscall-romp-bsd.S b/mit-pthreads/machdep/syscall-romp-bsd.S
deleted file mode 100644
index 233f0b9430b..00000000000
--- a/mit-pthreads/machdep/syscall-romp-bsd.S
+++ /dev/null
@@ -1,327 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1993 by John F. Carr, jfc@mit.edu
- *
- * 1.00 93/09/xx proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-/* DO NOT USE COLONS IN THIS FILE, GCC CAN'T HANDLE THEM */
-/* #include <copyright.h> */
-
- .globl .oVncs
- .text
- .align 2
-
-/* ==========================================================================
- * machdep_sys_write()
- */
- .globl _machdep_sys_write
- .globl _.machdep_sys_write
-
- .text 2
-_machdep_sys_write:
- .long _.machdep_sys_write
-
- .text
-_.machdep_sys_write:
- lcs r0,0(r3)
- svc 4(r0)
- bntbr r15
- store r2,_errno,r5
- brx r15
- cal r2,-1(r0)
-
-
-/* ==========================================================================
- * machdep_sys_read()
- */
- .globl _machdep_sys_read
- .globl _.machdep_sys_read
-
- .text 2
-_machdep_sys_read:
- .long _.machdep_sys_read
-
- .text
-_.machdep_sys_read:
- lcs r0,0(r3)
- svc 3(r0)
- bntbr r15
- store r2,_errno,r5
- brx r15
- cal r2,-1(r0)
-
-
-/* ==========================================================================
- * machdep_sys_open()
- */
- .globl _machdep_sys_open
- .globl _.machdep_sys_open
-
- .text 2
-_machdep_sys_open:
- .long _.machdep_sys_open
-
- .text
-_.machdep_sys_open:
- lcs r0,0(r2)
- svc 5(r0)
- bntbr r15
- store r2,_errno,r5
- brx r15
- cal r2,-1(r0)
-
-
-/* ==========================================================================
- * machdep_sys_bind()
- */
- .globl _machdep_sys_bind
- .globl _.machdep_sys_bind
-
- .text 2
-_machdep_sys_bind:
- .long _.machdep_sys_bind
-
- .text
-_.machdep_sys_bind:
- ls r0,0(r3)
- svc 104(r0)
- bntbr r15
- store r2,_errno,r5
- brx r15
- cal r2,-1(r0)
-
-
-/* ==========================================================================
- * machdep_sys_socket()
- */
- .globl _machdep_sys_socket
- .globl _.machdep_sys_socket
-
- .text 2
-_machdep_sys_socket:
- .long _.machdep_sys_socket
-
- .text
- .align 2
-_.machdep_sys_socket:
- svc 97(r0)
- bntbr r15
- store r2,_errno,r5
- brx r15
- cal r2,-1(r0)
-
-
-/* ==========================================================================
- * machdep_sys_close()
- */
- .globl _machdep_sys_close
- .globl _.machdep_sys_close
-
- .text 2
-_machdep_sys_close:
- .long _.machdep_sys_close
-
- .text
- .align 2
-_.machdep_sys_close:
- svc 6(r0)
- bntbr r15
- store r2,_errno,r5
- brx r15
- cal r2,-1(r0)
-
-
-/* ==========================================================================
- * machdep_sys_connect()
- */
- .globl _machdep_sys_connect
- .globl _.machdep_sys_connect
-
- .text 2
-_machdep_sys_connect:
- .long _.machdep_sys_connect
-
- .text
-_.machdep_sys_connect:
- lcs r0,0(r3)
- svc 98(r0)
- bntbr r15
- store r2,_errno,r5
- brx r15
- cal r2,-1(r0)
-
-/* ==========================================================================
- * machdep_sys_accept()
- */
- .globl _machdep_sys_accept
- .globl _.machdep_sys_accept
-
- .text 2
-_machdep_sys_accept:
- .long _.machdep_sys_accept
-
- .text
-_.machdep_sys_accept:
- lcs r0,0(r3)
- svc 99(r0)
- bntbr r15
- store r2,_errno,r5
- cal r2,-1(r0)
-
-/* ==========================================================================
- * machdep_sys_listen()
- */
- .globl _machdep_sys_listen
- .globl _.machdep_sys_listen
-
- .text 2
- .align 2
-_machdep_sys_listen:
- .long _.machdep_sys_listen
-
- .text
- .align 2
-_.machdep_sys_listen:
- svc 106(r0)
- bntbr r15
- brx r15
- twoc r2,r2
-
-/* ==========================================================================
- * machdep_sys_fcntl()
- */
- .globl _.machdep_sys_fcntl
- .globl _machdep_sys_fcntl
-
- .text 2
-_machdep_sys_fcntl:
- .long _.machdep_sys_fcntl
- .text
-_.machdep_sys_fcntl:
- lcs r0,0(sp)
- svc 92(r0)
- bntbr r15
- store r2,_errno,r5
- brx r15
- cal r2,-1(r0)
-
-/* ==========================================================================
- * machdep_sys_getpeername()
- */
- .globl _machdep_sys_getpeername
- .globl _.machdep_sys_getpeername
-
- .text 2
-_machdep_sys_getpeername:
- .long _.machdep_sys_getpeername
-
- .text
-_.machdep_sys_getpeername:
- ls r0,0(sp)
- svc 141(r0)
- bntbr r15
- brx r15
- twoc r2,r2
-
-
-/* ==========================================================================
- * machdep_sys_getsockopt()
- */
- .globl _machdep_sys_getsockopt
- .globl _.machdep_sys_getsockopt
-
- .text 2
-_machdep_sys_getsockopt:
- .long _.machdep_sys_getsockopt
-
- .text
-_.machdep_sys_getsockopt:
- ls r0,0(sp)
- svc 118(r0)
- bntbr r15
- brx r15
- twoc r2,r2
-
-
-/* ==========================================================================
- * machdep_sys_select()
- */
-
- .globl _.machdep_sys_select
- .globl _machdep_sys_select
-
- .text 2
-_machdep_sys_select:
- .long _.machdep_sys_select
- .text
-_.machdep_sys_select:
- svc 93(r0)
- bntbr r15
- brx r15
- twoc r2,r2
-
-/* ==========================================================================
- * __tsh()
- */
- .globl _._tsh
- .globl __tsh
- .text 2
-__tsh: .long _._tsh
- .text
- .align 2
-_._tsh:
- brx r15
- tsh r2,0(r2)
-
-
-/* ==========================================================================
- * __pthread_save()
- */
- .globl __pthread_save
- .globl _._pthread_save
- .text 2
-__pthread_save:
- .long _._pthread_save
- .text
- .align 2
-_._pthread_save:
- ail r5,r4,0
- jne 1f
- mr r4,sp
- lis r5,0
- stm r4,0(r2)
- brx r15
- lis r2,0
-1:
- mr r0,r15 # save old return address
- ls r15,0(r4) # new return address
- mr r5,r4 # r0 to restore
- mr r4,r3 # sp to restore
- stm r4,0(r2)
- brx r0
- lis r2,0
-
-
-/* ==========================================================================
- * __pthread_restore()
- */
- .globl __pthread_restore
- .globl _._pthread_restore
- .text 2
-__pthread_restore:
- .long _._pthread_restore
- .text
- .align 2
-_._pthread_restore:
- lm r4,0(r2)
- mr r0,r5
- lis r2,1
- brx r15
- mr sp,r4
-
-
diff --git a/mit-pthreads/machdep/syscall-sparc-netbsd-1.1.S b/mit-pthreads/machdep/syscall-sparc-netbsd-1.1.S
deleted file mode 100644
index 9c4da4b1325..00000000000
--- a/mit-pthreads/machdep/syscall-sparc-netbsd-1.1.S
+++ /dev/null
@@ -1,102 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- */
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#include <sys/syscall.h>
-
-#define SYSCALL(x) \
- .globl _machdep_sys_##x; \
- \
-_machdep_sys_##x:; \
- \
- mov SYS_##x, %g1; \
- ta 0; \
- bcs,a 2b; \
- sub %r0,%o0,%o0; \
- retl
-
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 4
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- sub %r0, %o0, %o0
-2:
- retl
- nop
-
-/* ==========================================================================
- * machdep_sys_pipe()
- */
- .globl _machdep_sys_pipe
-
-_machdep_sys_pipe:
- mov %o0, %o2
- mov SYS_pipe, %g1
- ta 0
- bcs 1b
- nop
- st %o0, [ %o2 ]
- st %o1, [ %o2 + 4 ]
- retl
- mov %g0, %o0
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl _machdep_sys_fork;
-
-_machdep_sys_fork:;
-
- mov SYS_fork, %g1;
- ta 0;
- bcs 1b;
- nop;
- dec %o1;
- retl;
- and %o0, %o1, %o0; ! return 0 in child, pid in parent
-
-/* ==========================================================================
- * machdep_sys_sigprocmask()
- */
- .globl _machdep_sys_sigprocmask;
-
-_machdep_sys_sigprocmask:;
-
- ld [%o1], %o1;
- mov SYS_sigprocmask, %g1;
- ta 0;
- bcs 1b;
- nop;
- retl
- nop
-
-/* ==========================================================================
- * machdep_sys_sigsuspend()
- */
- .globl _machdep_sys_sigsuspend;
-
-_machdep_sys_sigsuspend:;
-
- ld [%o0], %o0;
- mov SYS_sigsuspend, %g1;
- ta 0;
- bcs 1b;
- nop;
- retl
- nop
diff --git a/mit-pthreads/machdep/syscall-sparc-netbsd-1.3.S b/mit-pthreads/machdep/syscall-sparc-netbsd-1.3.S
deleted file mode 100644
index 74a51e756b7..00000000000
--- a/mit-pthreads/machdep/syscall-sparc-netbsd-1.3.S
+++ /dev/null
@@ -1,172 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- */
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#include <machine/asm.h>
-#include <sys/syscall.h>
-
-#define SYSCALL(x) \
- .globl _C_LABEL(machdep_sys_##x); \
- \
-_C_LABEL(machdep_sys_##x):; \
- \
- mov SYS_##x, %g1; \
- ta 0; \
- bcs,a 2b; \
- sub %r0,%o0,%o0; \
- retl
-
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 4
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- sub %r0, %o0, %o0
-2:
- retl
- nop
-
-/* ==========================================================================
- * machdep_sys_pipe()
- */
- .globl _C_LABEL(machdep_sys_pipe)
-
-_C_LABEL(machdep_sys_pipe):
- mov %o0, %o2
- mov SYS_pipe, %g1
- ta 0
- bcs 1b
- nop
- st %o0, [ %o2 ]
- st %o1, [ %o2 + 4 ]
- retl
- mov %g0, %o0
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl _C_LABEL(machdep_sys_fork);
-
-_C_LABEL(machdep_sys_fork):;
-
- mov SYS_fork, %g1;
- ta 0;
- bcs 1b;
- nop;
- dec %o1;
- retl;
- and %o0, %o1, %o0; ! return 0 in child, pid in parent
-
-#ifndef SYS___sigprocmask14
-/* ==========================================================================
- * machdep_sys_sigprocmask()
- */
- .globl _C_LABEL(machdep_sys_sigprocmask);
-
-_C_LABEL(machdep_sys_sigprocmask):;
-
- ld [%o1], %o1;
- mov SYS_sigprocmask, %g1;
- ta 0;
- bcs 1b;
- nop;
- retl
- nop
-#endif
-
-#ifndef SYS___sigsuspend14
-/* ==========================================================================
- * machdep_sys_sigsuspend()
- */
- .globl _C_LABEL(machdep_sys_sigsuspend);
-
-_C_LABEL(machdep_sys_sigsuspend):;
-
- ld [%o0], %o0;
- mov SYS_sigsuspend, %g1;
- ta 0;
- bcs 1b;
- nop;
- retl
- nop
-#endif
-
-/* ==========================================================================
- * machdep_sys_fstat()
- */
- .globl _C_LABEL(machdep_sys_fstat);
-
-_C_LABEL(machdep_sys_fstat):;
-
- mov SYS___fstat13, %g1;
- ta 0;
- bcs 1b;
- nop;
- retl
- nop
-
-/* ==========================================================================
- * machdep_sys___syscall()
- */
-_machdep_sys___syscall:;
-
- mov SYS___syscall, %g1;
- ta 0;
- bcs 1b;
- nop;
- retl
- nop
-
-/* ==========================================================================
- * machdep_sys_lseek()
- */
- .global _C_LABEL(machdep_sys_lseek)
-
-_C_LABEL(machdep_sys_lseek):
- save %sp,-112,%sp
- mov %i1,%o4
- mov %i2,%o5
- st %i3,[%sp+92]
- mov 0,%o0
- mov SYS_lseek,%o1
- mov %i0,%o2
- call _machdep_sys___syscall,0
- mov 0,%o3
- mov %o0,%i0
- mov %o1,%i1
- ret
- restore
-
-/* ==========================================================================
- * machdep_sys_ftruncate()
- */
- .global _C_LABEL(machdep_sys_ftruncate)
-
-_C_LABEL(machdep_sys_ftruncate):
- save %sp,-104,%sp
- mov %i1,%o4
- mov %i2,%o5
- mov 0,%o0
- mov SYS_ftruncate,%o1
- mov %i0,%o2
- call _machdep_sys___syscall,0
- mov 0,%o3
- mov %o0,%o1
- sra %o0,31,%o0
- ret
- restore %g0,%o1,%o0
diff --git a/mit-pthreads/machdep/syscall-sparc-sunos-4.1.3.S b/mit-pthreads/machdep/syscall-sparc-sunos-4.1.3.S
deleted file mode 100644
index ec293b0ca3f..00000000000
--- a/mit-pthreads/machdep/syscall-sparc-sunos-4.1.3.S
+++ /dev/null
@@ -1,113 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- */
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#include <sys/syscall.h>
-
-#define SYSCALL(x) \
- .globl _machdep_sys_##x; \
- \
-_machdep_sys_##x:; \
- \
- mov SYS_##x, %g1; \
- ta 0; \
- bcs,a 2b; \
- sub %r0,%o0,%o0; \
- retl
-
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 4
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- sub %r0, %o0, %o0
-2:
- retl
- nop
-
-/* ==========================================================================
- * machdep_sys_pipe()
- */
- .globl _machdep_sys_pipe
-
-_machdep_sys_pipe:
- mov %o0, %o2
- mov SYS_pipe, %g1
- ta 0
- bcs 1b
- nop
- st %o0, [ %o2 ]
- st %o1, [ %o2 + 4 ]
- retl
- mov %g0, %o0
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl _machdep_sys_fork;
-
-_machdep_sys_fork:;
-
- mov SYS_fork, %g1;
- ta 0;
- bcs 1b;
- nop;
- tst %o1
- bne,a __fork_parent
- mov %g0, %o0
-__fork_parent:;
- retl
-
-/* POSIX-compliant getpgrp() takes no arguments. The SunOS syscall wants
- one, and gives the POSIXy result if that argument is zero. */
- .globl _getpgrp
-_getpgrp:
- mov SYS_getpgrp, %g1
- mov 0, %i0
- ta 0
- bcs 1b
- nop
- retl
- nop
-
-#if 0
-/* I think this bit of magic will do the right thing for other syscalls.
- We get here with the new `errno' code in %o0. It should get stored in
- *__error(), and -1 returned to the caller. */
- .globl cerror
-cerror:
- save %sp,-104,%sp
- /* Now value is in %i0. Store it in *__error(). */
- call ___error
- nop
- st %i0,[%o0]
-
- /* Now also store a copy in global variable errno, for routines
- like isatty that want to examine it and which haven't been
- converted yet. */
- sethi %hi(_errno), %o0
- st %i0,[%o0+%lo(_errno)]
-
-#if 0 /* use this if you want -errno returned */
- sub %r0,%i0,%i0
-#else /* return -1 */
- mov -1,%i0
-#endif
- retl
- restore
-#endif
diff --git a/mit-pthreads/machdep/syscall-sparc-sunos-5.3.S b/mit-pthreads/machdep/syscall-sparc-sunos-5.3.S
deleted file mode 100644
index 822055ad04e..00000000000
--- a/mit-pthreads/machdep/syscall-sparc-sunos-5.3.S
+++ /dev/null
@@ -1,65 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- */
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#define _ASM
-#include <sys/syscall.h>
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 4
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- sub %r0, %o0, %o0
-2:
- retl
- nop
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl machdep_sys_fork;
-
-machdep_sys_fork:;
-
- mov SYS_fork, %g1;
- ta 0;
- bcs 1b;
- nop;
- tst %o1
- bne,a __fork_parent
- mov %g0, %o0
-__fork_parent:;
- retl
- nop; /* Added by monty to keep sparc assembler happy */
-
-/* ==========================================================================
- * Berkeley socket stuff
- *
- * ==========================================================================
- * machdep_sys_socketcall()
- */
- .globl machdep_sys_socketcall;
-
-machdep_sys_socketcall:;
-
- mov 83, %g1;
- ta 0;
- bcs,a 2b;
- sub %r0,%o0,%o0;
- retl
- nop; /* Added by monty to keep sparc assembler happy */
diff --git a/mit-pthreads/machdep/syscall-sparc-sunos4.S b/mit-pthreads/machdep/syscall-sparc-sunos4.S
deleted file mode 100644
index ec293b0ca3f..00000000000
--- a/mit-pthreads/machdep/syscall-sparc-sunos4.S
+++ /dev/null
@@ -1,113 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- */
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#include <sys/syscall.h>
-
-#define SYSCALL(x) \
- .globl _machdep_sys_##x; \
- \
-_machdep_sys_##x:; \
- \
- mov SYS_##x, %g1; \
- ta 0; \
- bcs,a 2b; \
- sub %r0,%o0,%o0; \
- retl
-
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 4
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- sub %r0, %o0, %o0
-2:
- retl
- nop
-
-/* ==========================================================================
- * machdep_sys_pipe()
- */
- .globl _machdep_sys_pipe
-
-_machdep_sys_pipe:
- mov %o0, %o2
- mov SYS_pipe, %g1
- ta 0
- bcs 1b
- nop
- st %o0, [ %o2 ]
- st %o1, [ %o2 + 4 ]
- retl
- mov %g0, %o0
-
-/* ==========================================================================
- * machdep_sys_fork()
- */
- .globl _machdep_sys_fork;
-
-_machdep_sys_fork:;
-
- mov SYS_fork, %g1;
- ta 0;
- bcs 1b;
- nop;
- tst %o1
- bne,a __fork_parent
- mov %g0, %o0
-__fork_parent:;
- retl
-
-/* POSIX-compliant getpgrp() takes no arguments. The SunOS syscall wants
- one, and gives the POSIXy result if that argument is zero. */
- .globl _getpgrp
-_getpgrp:
- mov SYS_getpgrp, %g1
- mov 0, %i0
- ta 0
- bcs 1b
- nop
- retl
- nop
-
-#if 0
-/* I think this bit of magic will do the right thing for other syscalls.
- We get here with the new `errno' code in %o0. It should get stored in
- *__error(), and -1 returned to the caller. */
- .globl cerror
-cerror:
- save %sp,-104,%sp
- /* Now value is in %i0. Store it in *__error(). */
- call ___error
- nop
- st %i0,[%o0]
-
- /* Now also store a copy in global variable errno, for routines
- like isatty that want to examine it and which haven't been
- converted yet. */
- sethi %hi(_errno), %o0
- st %i0,[%o0+%lo(_errno)]
-
-#if 0 /* use this if you want -errno returned */
- sub %r0,%i0,%i0
-#else /* return -1 */
- mov -1,%i0
-#endif
- retl
- restore
-#endif
diff --git a/mit-pthreads/machdep/syscall-template-alpha-netbsd-1.1.S b/mit-pthreads/machdep/syscall-template-alpha-netbsd-1.1.S
deleted file mode 100644
index a2941ece7c9..00000000000
--- a/mit-pthreads/machdep/syscall-template-alpha-netbsd-1.1.S
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <machine/asm.h>
-#define COMPAT_43
-#include <sys/syscall.h>
-#define CHMK() call_pal 0x83
-
-#undef SYSCALL
-
-/* Kernel syscall interface:
- Input:
- v0 - system call number
- a* - arguments, as in C
- Output:
- a3 - zero iff successful
- v0 - errno value on failure, else result
-
- This macro is similar to SYSCALL in asm.h, but not completely.
- There's room for optimization, if we assume this will continue to
- be assembled as one file.
-
- This macro expansions does not include the return instruction.
- If there's no other work to be done, use something like:
- SYSCALL(foo) ; ret
- If there is other work to do (in fork, maybe?), do it after the
- SYSCALL invocation. */
-
-#define SYSCALL(x) \
- .align 4 ;\
- .globl machdep_sys_##x ;\
- .ent machdep_sys_##x, 0 ;\
-machdep_sys_##x: ;\
- .frame sp,0,ra ;\
- ldiq v0, SYS_##x ;\
- CHMK() ;\
- beq a3, Lsys_noerr_##x ;\
- br gp, Lsys_err_##x ;\
-Lsys_err_##x: ;\
- /* Load gp so we can find cerror to jump to. */;\
- ldgp gp, 0(gp) ;\
- jmp zero, machdep_cerror ;\
-Lsys_noerr_##x:
-
-#define SIMPLE_SYSCALL(x) SYSCALL(x) ; ret ; .end machdep_sys_##x
-
-#define XSYSCALL(x) SIMPLE_SYSCALL(x)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-alpha-netbsd-1.3.S b/mit-pthreads/machdep/syscall-template-alpha-netbsd-1.3.S
deleted file mode 100644
index 12595feabc1..00000000000
--- a/mit-pthreads/machdep/syscall-template-alpha-netbsd-1.3.S
+++ /dev/null
@@ -1,53 +0,0 @@
-#include <machine/asm.h>
-#define COMPAT_43
-#include <sys/syscall.h>
-#define CHMK() call_pal 0x83
-
-#ifdef SYS___sigsuspend14
-#define SYS_sigsuspend SYS___sigsuspend14
-#endif
-#ifdef SYS___sigprocmask14
-#define SYS_sigprocmask SYS___sigprocmask14
-#endif
-
-#undef SYSCALL
-
-/* Kernel syscall interface:
- Input:
- v0 - system call number
- a* - arguments, as in C
- Output:
- a3 - zero iff successful
- v0 - errno value on failure, else result
-
- This macro is similar to SYSCALL in asm.h, but not completely.
- There's room for optimization, if we assume this will continue to
- be assembled as one file.
-
- This macro expansions does not include the return instruction.
- If there's no other work to be done, use something like:
- SYSCALL(foo) ; ret
- If there is other work to do (in fork, maybe?), do it after the
- SYSCALL invocation. */
-
-#define SYSCALL(x) \
- .align 4 ;\
- .globl machdep_sys_##x ;\
- .ent machdep_sys_##x, 0 ;\
-machdep_sys_##x: ;\
- .frame sp,0,ra ;\
- ldiq v0, SYS_##x ;\
- CHMK() ;\
- beq a3, Lsys_noerr_##x ;\
- br gp, Lsys_err_##x ;\
-Lsys_err_##x: ;\
- /* Load gp so we can find cerror to jump to. */;\
- ldgp gp, 0(gp) ;\
- jmp zero, machdep_cerror ;\
-Lsys_noerr_##x:
-
-#define SIMPLE_SYSCALL(x) SYSCALL(x) ; ret ; .end machdep_sys_##x
-
-#define XSYSCALL(x) SIMPLE_SYSCALL(x)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-alpha-osf1.S b/mit-pthreads/machdep/syscall-template-alpha-osf1.S
deleted file mode 100644
index bc4653b5f9e..00000000000
--- a/mit-pthreads/machdep/syscall-template-alpha-osf1.S
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <asm.h>
-#include <regdef.h>
-#define COMPAT_43
-#include <syscall.h>
-
-#undef SYSCALL
-
-/* Kernel syscall interface:
- Input:
- v0 - system call number
- a* - arguments, as in C
- Output:
- a3 - zero iff successful
- v0 - errno value on failure, else result
-
- This macro is similar to SYSCALL in asm.h, but not completely.
- There's room for optimization, if we assume this will continue to
- be assembled as one file.
-
- This macro expansions does not include the return instruction.
- If there's no other work to be done, use something like:
- SYSCALL(foo) ; ret
- If there is other work to do (in fork, maybe?), do it after the
- SYSCALL invocation. */
-
-#define SYSCALL(x) \
- .align 4 ;\
- .globl machdep_sys_##x ;\
- .ent machdep_sys_##x, 0 ;\
-machdep_sys_##x: ;\
- .frame sp,0,ra ;\
- ldiq v0, SYS_##x ;\
- CHMK() ;\
- beq a3, 2f ;\
- br gp, 1f ;\
-1: ;\
- /* Load gp so we can find cerror to jump to. */;\
- ldgp gp, 0(gp) ;\
- jmp zero, machdep_cerror ;\
-2:
-
-#define SIMPLE_SYSCALL(x) SYSCALL(x) ; ret ; .end machdep_sys_##x
-
-#define XSYSCALL(x) SIMPLE_SYSCALL(x)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-arm32-netbsd-1.3.S b/mit-pthreads/machdep/syscall-template-arm32-netbsd-1.3.S
deleted file mode 100644
index 923d2c03a75..00000000000
--- a/mit-pthreads/machdep/syscall-template-arm32-netbsd-1.3.S
+++ /dev/null
@@ -1,55 +0,0 @@
-#include <machine/asm.h>
-#include <sys/syscall.h>
-
-#ifdef SYS___sigsuspend14
-#define SYS_sigsuspend SYS___sigsuspend14
-#endif
-#ifdef SYS___sigprocmask14
-#define SYS_sigprocmask SYS___sigprocmask14
-#endif
-
-#ifdef __STDC__
-
-#define SYSCALL(x) \
- .globl _C_LABEL(machdep_sys_##x); \
- \
-_C_LABEL(machdep_sys_##x):; \
- \
- swi SYS_##x; \
- bcs 1b; \
- mov r15, r14;
-
-#else
-
-#define SYSCALL(x) \
- .globl _C_LABEL(_machdep_sys_/**/x); \
- \
-_C_LABEL(machdep_sys_/**/x):; \
- \
- swi SYS_/**/x; \
- bcs 1b; \
- mov r15, r14;
-
-#endif
-
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 0
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- rsb r0, r0, #0x00000000
- mvn r1, #0x00000000
- mov r15, r14
-
-#define XSYSCALL(NAME) SYSCALL(NAME)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-hppa-hpux-10.20.S b/mit-pthreads/machdep/syscall-template-hppa-hpux-10.20.S
deleted file mode 100644
index 0123b1deee7..00000000000
--- a/mit-pthreads/machdep/syscall-template-hppa-hpux-10.20.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ==== syscall.S ============================================================
- * Written 1996 by Stefan Grefen, grefen@convex.com
- */
-
-#include <sys/syscall.h>
-
-#define _CAT(a,b)a##b
-#define CAT(a,b)_CAT(a,b)
-
-#define MKNAME(a)CAT(a,SYSCALL_NAME)
-
- .CODE
-machdep_error
- sub %r0,%r28,%r28
- bv,n %r0(%r2)
-
- .label MKNAME(machdep_sys_)
- .PROC
- .CALLINFO NO_CALLS,FRAME=0
- ldil -0x80000,%r1
- ble 4(%sr7,%r1)
- ldi MKNAME(SYS_),%r22
- or,= %r0,%r22,%r0
- b,n machdep_error
- bv,n %r0(%r2)
- .PROCEND
- .EXPORT MKNAME(machdep_sys_)
diff --git a/mit-pthreads/machdep/syscall-template-hppa-hpux-9.03.S b/mit-pthreads/machdep/syscall-template-hppa-hpux-9.03.S
deleted file mode 100644
index 0123b1deee7..00000000000
--- a/mit-pthreads/machdep/syscall-template-hppa-hpux-9.03.S
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ==== syscall.S ============================================================
- * Written 1996 by Stefan Grefen, grefen@convex.com
- */
-
-#include <sys/syscall.h>
-
-#define _CAT(a,b)a##b
-#define CAT(a,b)_CAT(a,b)
-
-#define MKNAME(a)CAT(a,SYSCALL_NAME)
-
- .CODE
-machdep_error
- sub %r0,%r28,%r28
- bv,n %r0(%r2)
-
- .label MKNAME(machdep_sys_)
- .PROC
- .CALLINFO NO_CALLS,FRAME=0
- ldil -0x80000,%r1
- ble 4(%sr7,%r1)
- ldi MKNAME(SYS_),%r22
- or,= %r0,%r22,%r0
- b,n machdep_error
- bv,n %r0(%r2)
- .PROCEND
- .EXPORT MKNAME(machdep_sys_)
diff --git a/mit-pthreads/machdep/syscall-template-i386-bsdi-2.0.S b/mit-pthreads/machdep/syscall-template-i386-bsdi-2.0.S
deleted file mode 100644
index 3299f49195f..00000000000
--- a/mit-pthreads/machdep/syscall-template-i386-bsdi-2.0.S
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <sys/syscall.h>
-
-#ifdef __STDC__
-
-#define SYSCALL(x) \
- .globl _machdep_sys_##x##; \
- \
-_machdep_sys_##x##:; \
- \
- movl $(SYS_##x##), %eax; \
- .byte 0x9a; .long 0; .word 7; \
- jb 1b; \
- ret;
-
-#else
-
-#define SYSCALL(x) \
- .globl _machdep_sys_/**/x/**/; \
- \
-_machdep_sys_/**/x/**/:; \
- \
- movl $(SYS_/**/x/**/), %eax; \
- .byte 0x9a; .long 0; .word 7; \
- jb 1b; \
- ret;
-
-#endif
-
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- neg %eax
- ret
-
-#define XSYSCALL(NAME) SYSCALL(NAME)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-i386-freebsd-2.0.S b/mit-pthreads/machdep/syscall-template-i386-freebsd-2.0.S
deleted file mode 100644
index 1906a949c8b..00000000000
--- a/mit-pthreads/machdep/syscall-template-i386-freebsd-2.0.S
+++ /dev/null
@@ -1,59 +0,0 @@
-#include <sys/syscall.h>
-
-#ifdef __STDC__
-
-#define SYS(X) SYS_##X
-#ifdef __ELF__
-#define NAME(X) machdep_sys_##X
-#else
-#define NAME(X) _machdep_sys_##X
-#endif
-
-#else
-
-#define SYS(X) SYS_/**/X
-#ifdef __ELF__
-#define NAME(X) machdep_sys_/**/X
-#else
-#define NAME(X) _machdep_sys_/**/X
-#endif
-
-#endif
-
-#ifdef __ELF__
-#define END(X) 5: ; .type NAME(X),@function ; .size NAME(X),5b - NAME(X)
-#define KERNCALL int $0x80
-#else
-#define END(X)
-#define KERNCALL .byte 0x9a; .long 0; .word 7;
-#endif
-
-#define SYSCALL(x) \
- .globl NAME(x); \
- \
-NAME(x):; \
- movl $(SYS(x)), %eax; \
- KERNCALL; \
- jb 1b; \
- ret; \
- END(x)
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- neg %eax
- ret
-
-#define XSYSCALL(NAME) SYSCALL(NAME)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-i386-netbsd-1.1.S b/mit-pthreads/machdep/syscall-template-i386-netbsd-1.1.S
deleted file mode 100644
index c5e76bb4538..00000000000
--- a/mit-pthreads/machdep/syscall-template-i386-netbsd-1.1.S
+++ /dev/null
@@ -1,49 +0,0 @@
-#include <machine/asm.h>
-#include <sys/syscall.h>
-
-#ifdef __STDC__
-
-#define SYSCALL(x) \
- .globl _machdep_sys_##x; \
- \
-_machdep_sys_##x:; \
- \
- movl $(SYS_##x), %eax; \
- int $0x80; \
- jb 1b; \
- ret;
-
-#else
-
-#define SYSCALL(x) \
- .globl _machdep_sys_/**/x; \
- \
-_machdep_sys_/**/x:; \
- \
- movl $(SYS_/**/x), %eax; \
- int $0x80; \
- jb 1b; \
- ret;
-
-#endif
-
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- neg %eax
- ret
-
-#define XSYSCALL(NAME) SYSCALL(NAME)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-i386-netbsd-1.3.S b/mit-pthreads/machdep/syscall-template-i386-netbsd-1.3.S
deleted file mode 100644
index d6dffc35132..00000000000
--- a/mit-pthreads/machdep/syscall-template-i386-netbsd-1.3.S
+++ /dev/null
@@ -1,56 +0,0 @@
-#include <machine/asm.h>
-#include <sys/syscall.h>
-
-#ifdef SYS___sigsuspend14
-#define SYS_sigsuspend SYS___sigsuspend14
-#endif
-#ifdef SYS___sigprocmask14
-#define SYS_sigprocmask SYS___sigprocmask14
-#endif
-
-#ifdef __STDC__
-
-#define SYSCALL(x) \
- .globl _C_LABEL(machdep_sys_##x); \
- \
-_C_LABEL(machdep_sys_##x):; \
- \
- movl $(SYS_##x), %eax; \
- int $0x80; \
- jb 1b; \
- ret;
-
-#else
-
-#define _SYSCALL(x) \
- .globl _C_LABEL(machdep_sys_/**/x); \
- \
-_C_LABEL(machdep_sys_/**/x):; \
- \
- movl $(SYS_/**/x), %eax; \
- int $0x80; \
- jb 1b; \
- ret;
-
-#endif
-
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- neg %eax
- ret
-
-#define XSYSCALL(NAME) SYSCALL(NAME)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-i386-netbsd1.0.S b/mit-pthreads/machdep/syscall-template-i386-netbsd1.0.S
deleted file mode 100644
index 83a2405ed51..00000000000
--- a/mit-pthreads/machdep/syscall-template-i386-netbsd1.0.S
+++ /dev/null
@@ -1,49 +0,0 @@
-#include <machine/asm.h>
-#include <sys/syscall.h>
-
-#ifdef __STDC__
-
-#define SYSCALL(x) \
- .globl _machdep_sys_##x; \
- \
-_machdep_sys_##x:; \
- \
- movl $(SYS_##x), %eax; \
- .byte 0x9a; .long 0; .word 7; \
- jb 1b; \
- ret;
-
-#else
-
-#define SYSCALL(x) \
- .globl _machdep_sys_/**/x; \
- \
-_machdep_sys_/**/x:; \
- \
- movl $(SYS_/**/x), %eax; \
- .byte 0x9a; .long 0; .word 7; \
- jb 1b; \
- ret;
-
-#endif
-
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- neg %eax
- ret
-
-#define XSYSCALL(NAME) SYSCALL(NAME)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-i386-openbsd-2.0.S b/mit-pthreads/machdep/syscall-template-i386-openbsd-2.0.S
deleted file mode 100644
index 34fb5caaa43..00000000000
--- a/mit-pthreads/machdep/syscall-template-i386-openbsd-2.0.S
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <sys/syscall.h>
-
-#ifdef __STDC__
-
-#define SYSCALL(x) \
- .globl _machdep_sys_##x##; \
- \
-_machdep_sys_##x:##; \
- \
- movl $(SYS_##x##), %eax; \
- .byte 0x9a; .long 0; .word 7; \
- jb 1b; \
- ret;
-
-#else
-
-#define SYSCALL(x) \
- .globl _machdep_sys_/**/x; \
- \
-_machdep_sys_/**/x:; \
- \
- movl $(SYS_/**/x), %eax; \
- .byte 0x9a; .long 0; .word 7; \
- jb 1b; \
- ret;
-
-#endif
-
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- neg %eax
- ret
-
-#define XSYSCALL(NAME) SYSCALL(NAME)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-i386-sco-3.2v5.S b/mit-pthreads/machdep/syscall-template-i386-sco-3.2v5.S
deleted file mode 100644
index 753475b5c3d..00000000000
--- a/mit-pthreads/machdep/syscall-template-i386-sco-3.2v5.S
+++ /dev/null
@@ -1,67 +0,0 @@
-#include <sys/errno.h>
-#include <sys/syscall.h>
-
-#ifdef _SCO_ELF
-
-#define NAME(X) machdep_sys_##X
-#define END(X) 1: ; .type NAME(X),@function ; .size NAME(X),1b - NAME(X)
-#define GETBX(X) \
- push %ebx; \
- call 1f; \
-1: \
- popl %ebx;
-#else
-
-#define NAME(X) _machdep_sys_##X
-#define END(X)
-
-#endif
-
-#ifdef __STDC__
-
-#define SYSCALL(x) \
- .globl NAME(x); \
- \
-NAME(x):; \
- movl $(SYS_##x##), %eax; \
- .byte 0x9a; .long 0; .word 7; \
- jae 1f; \
- cmp $(ERESTART), %eax; \
- je NAME(x); \
- neg %eax; \
-1: \
- ret; \
- END(x)
-
-#else
-
-#define SYSCALL(x) \
- .globl _machdep_sys_/**/x; \
- \
-machdep_sys_/**/x:; \
- \
- movl $(SYS_/**/x), %eax; \
- .byte 0x9a; .long 0; .word 7; \
- jae 1f; \
- neg %eax;
-1: \
- ret;
-
-#endif
-
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-#define XSYSCALL(NAME) SYSCALL(NAME)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-ip22-irix-5.2.S b/mit-pthreads/machdep/syscall-template-ip22-irix-5.2.S
deleted file mode 100644
index 722b001671b..00000000000
--- a/mit-pthreads/machdep/syscall-template-ip22-irix-5.2.S
+++ /dev/null
@@ -1,51 +0,0 @@
-#include <sys.s>
-#include <sys/regdef.h>
-/* #include <sys/asm.h> */
-
-/*
- Kernel syscall interface:
- Input:
- v0 syscall number
- Output:
-
- This macro is similar to SYSCALL in sys/syscall.h, but not completely.
- There's room for optimization, if we assume this will continue to
- be assembled as one file.
-
- Compile with -DPIC for pic code.
-*/
-
-#ifdef PIC
-#define PICOPT .option pic2
-#else
-#define PICOPT
-#endif
-
-
-#define YSYSCALL(x) \
- PICOPT; \
- .globl machdep_sys_##x; \
- .ent machdep_sys_##x, 0; \
-machdep_sys_##x:; \
- .frame sp,0,ra; \
- .set noreorder; \
- li v0, SYS_##x; \
- syscall; \
- bne a3, zero, 1b; \
- nop; \
- j ra; \
- nop; \
- .end machdep_sys_##x
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- subu v0,zero,v0;
- j ra;
-
-#define XSYSCALL(x) YSYSCALL(x)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-m68000-netbsd.S b/mit-pthreads/machdep/syscall-template-m68000-netbsd.S
deleted file mode 100644
index ce16bb5523c..00000000000
--- a/mit-pthreads/machdep/syscall-template-m68000-netbsd.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#include <machine/asm.h>
-#include <sys/syscall.h>
-
-#ifdef SYS___sigsuspend14
-#define SYS_sigsuspend SYS___sigsuspend14
-#endif
-#ifdef SYS___sigprocmask14
-#define SYS_sigprocmask SYS___sigprocmask14
-#endif
-
-
-#ifdef __STDC__
-#define IMM #
-#define SYSCALL(x) .even; \
- ENTRY(machdep_sys_ ## x); \
- movl IMM SYS_ ## x,d0; \
- trap IMM 0; \
- jcs err; \
- rts
-#else /* !__STDC__ */
-#define SYSCALL(x) .even; ENTRY(machdep_sys_/**/x); \
- movl #SYS_/**/x,d0; trap #0; jcs err; rts
-#endif /* !__STDC__ */
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .even
-
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-err:
- negl d0
- rts
-
-#define XSYSCALL(NAME) SYSCALL(NAME)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-powerpc-netbsd.S b/mit-pthreads/machdep/syscall-template-powerpc-netbsd.S
deleted file mode 100644
index 1755c1ab2e8..00000000000
--- a/mit-pthreads/machdep/syscall-template-powerpc-netbsd.S
+++ /dev/null
@@ -1,45 +0,0 @@
-#include <machine/asm.h>
-#define COMPAT_43
-#include <sys/syscall.h>
-
-#ifdef SYS___sigsuspend14
-#define SYS_sigsuspend SYS___sigsuspend14
-#endif
-
-#ifdef SYS___sigaction14
-#define SYS_sigaction SYS___sigaction14
-#endif
-
-#ifdef SYS___sigprocmask14
-#define SYS_sigprocmask SYS___sigprocmask14
-#endif
-
-#undef SYSCALL
-
-/* Kernel syscall interface:
- Input:
- 0 - system call number
- 3-8 - arguments, as in C
- Output:
- so - (summary overflow) clear iff successful
-
- This macro is similar to SYSCALL in asm.h, but not completely.
- There's room for optimization, if we assume this will continue to
- be assembled as one file.
-
- This macro expansions does not include the return instruction.
- If there's no other work to be done, use something like:
- SYSCALL(foo) ; ret
- If there is other work to do (in fork, maybe?), do it after the
- SYSCALL invocation. */
-
-#define SYSCALL(x) \
- ENTRY(machdep_sys_ ## x) \
- li 0, SYS_ ## x ; \
- sc ; \
- bnslr ; \
- b PIC_PLT(_C_LABEL(machdep_cerror))
-
-#define XSYSCALL(x) SYSCALL(x) ; blr
-
- XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-r2000-ultrix-4.2.S b/mit-pthreads/machdep/syscall-template-r2000-ultrix-4.2.S
deleted file mode 100644
index 575fe3c3d74..00000000000
--- a/mit-pthreads/machdep/syscall-template-r2000-ultrix-4.2.S
+++ /dev/null
@@ -1,77 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Machine dependent syscalls for decstation with r2000/r3000
- *
- * 1.00 93/08/14 proven
- * -Started coding this file.
- */
-
- .text
- .ascii "$Id$";
-
-#include <syscall.h>
-#include <machine/regdef.h>
-
-#define SYSCALL(x) \
- \
- .globl machdep_sys_##x; \
- .ent machdep_sys_##x; \
- \
-machdep_sys_##x:; \
- \
- .frame sp,0,ra; /* No frame, return address in ra */ \
- \
- li v0,SYS_##x; /* Load syscall # into v0 */ \
- syscall; \
- bne a3,zero,machdep_error; /* Error if a3 != 0 */ \
- j ra; \
- \
- .end machdep_sys_##x
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 2
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value. Eventually I want to load the errno value directly
- * into pthread_run->error but until then ...
- */
-machdep_error:
- negu v0, v0 /* Return negative of errno value. */
- j ra
-
-#define XSYSCALL(NAME) SYSCALL(NAME)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-sparc-netbsd-1.1.S b/mit-pthreads/machdep/syscall-template-sparc-netbsd-1.1.S
deleted file mode 100644
index 2d07892a315..00000000000
--- a/mit-pthreads/machdep/syscall-template-sparc-netbsd-1.1.S
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- */
-
-#include <sys/syscall.h>
-
-#define SYSCALL(x) \
- .globl _machdep_sys_##x; \
- \
-_machdep_sys_##x:; \
- \
- mov SYS_##x, %g1; \
- ta 0; \
- bcs,a 2b; \
- sub %r0,%o0,%o0; \
- retl; \
- nop
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 4
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- sub %r0, %o0, %o0
-2:
- retl
- nop
-
-#define XSYSCALL(NAME) SYSCALL(NAME)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-sparc-netbsd-1.3.S b/mit-pthreads/machdep/syscall-template-sparc-netbsd-1.3.S
deleted file mode 100644
index 2caad5c3437..00000000000
--- a/mit-pthreads/machdep/syscall-template-sparc-netbsd-1.3.S
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- */
-
-#include <machine/asm.h>
-#include <sys/syscall.h>
-
-#ifdef SYS___sigsuspend14
-#define SYS_sigsuspend SYS___sigsuspend14
-#endif
-#ifdef SYS___sigprocmask14
-#define SYS_sigprocmask SYS___sigprocmask14
-#endif
-
-#define SYSCALL(x) \
- .globl _C_LABEL(machdep_sys_##x); \
- \
-_C_LABEL(machdep_sys_##x):; \
- \
- mov SYS_##x, %g1; \
- ta 0; \
- bcs,a 2b; \
- sub %r0,%o0,%o0; \
- retl; \
- nop
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 4
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- sub %r0, %o0, %o0
-2:
- retl
- nop
-
-#define XSYSCALL(NAME) SYSCALL(NAME)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-sparc-sunos-5.3.S b/mit-pthreads/machdep/syscall-template-sparc-sunos-5.3.S
deleted file mode 100644
index 65a796a057d..00000000000
--- a/mit-pthreads/machdep/syscall-template-sparc-sunos-5.3.S
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- */
-
-#ifndef lint
- .text
- .asciz "$Id$";
-#endif
-
-#define _ASM
-#include <sys/syscall.h>
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 4
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- sub %r0, %o0, %o0
-2:
- retl
- nop
-
-#define concat2(a,b) a ## b
-#define concat(a,b) concat2(a,b)
-#define SYSval concat(SYS_,SYSCALL_NAME)
-#define procname concat(machdep_sys_,SYSCALL_NAME)
-
- .globl procname
-
-procname:
- mov SYSval, %g1
- ta 0
- bcs,a 2b
- sub %r0,%o0,%o0
- retl
- nop
diff --git a/mit-pthreads/machdep/syscall-template-sparc-sunos4.S b/mit-pthreads/machdep/syscall-template-sparc-sunos4.S
deleted file mode 100644
index 2d07892a315..00000000000
--- a/mit-pthreads/machdep/syscall-template-sparc-sunos4.S
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ==== syscall.S ============================================================
- * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- */
-
-#include <sys/syscall.h>
-
-#define SYSCALL(x) \
- .globl _machdep_sys_##x; \
- \
-_machdep_sys_##x:; \
- \
- mov SYS_##x, %g1; \
- ta 0; \
- bcs,a 2b; \
- sub %r0,%o0,%o0; \
- retl; \
- nop
-
-/*
- * Initial asm stuff for all functions.
- */
- .text
- .align 4
-
-/* ==========================================================================
- * error code for all syscalls. The error value is returned as the negative
- * of the errno value.
- */
-
-1:
- sub %r0, %o0, %o0
-2:
- retl
- nop
-
-#define XSYSCALL(NAME) SYSCALL(NAME)
-
-XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/ultrix-4.2/__math.h b/mit-pthreads/machdep/ultrix-4.2/__math.h
deleted file mode 100755
index 6249d720039..00000000000
--- a/mit-pthreads/machdep/ultrix-4.2/__math.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#define HUGE_VAL 1.8e+308
-
diff --git a/mit-pthreads/machdep/ultrix-4.2/__signal.h b/mit-pthreads/machdep/ultrix-4.2/__signal.h
deleted file mode 100755
index 68364772a6a..00000000000
--- a/mit-pthreads/machdep/ultrix-4.2/__signal.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#include <ansi_compat.h>
-
-#define NSIG 32
-
-#define SIGHUP 1 /* hangup */
-#define SIGINT 2 /* interrupt */
-#define SIGQUIT 3 /* quit */
-#define SIGILL 4 /* illegal instruction (not reset when caught) */
-#define SIGTRAP 5 /* trace trap (not reset when caught) */
-#define SIGIOT 6 /* IOT instruction */
-#define SIGEMT 7 /* EMT instruction */
-#define SIGFPE 8 /* floating point exception */
-#define SIGKILL 9 /* kill (cannot be caught or ignored) */
-#define SIGBUS 10 /* bus error */
-#define SIGSEGV 11 /* segmentation violation */
-#define SIGSYS 12 /* bad argument to system call */
-#define SIGPIPE 13 /* write on a pipe with no one to read it */
-#define SIGALRM 14 /* alarm clock */
-#define SIGTERM 15 /* software termination signal from kill */
-#define SIGURG 16 /* urgent condition on IO channel */
-#define SIGSTOP 17 /* sendable stop signal not from tty */
-#define SIGTSTP 18 /* stop signal from tty */
-#define SIGCONT 19 /* continue a stopped process */
-#define SIGCHLD 20 /* to parent on child stop or exit */
-#define SIGTTIN 21 /* to readers pgrp upon background tty read */
-#define SIGTTOU 22 /* like TTIN for output if (tp->t_local&LTOSTOP) */
-#define SIGIO 23 /* input/output possible signal */
-#define SIGXCPU 24 /* exceeded CPU time limit */
-#define SIGXFSZ 25 /* exceeded file size limit */
-#define SIGVTALRM 26 /* virtual time alarm */
-#define SIGPROF 27 /* profiling time alarm */
-#define SIGWINCH 28 /* window size changes */
-#define SIGLOST 29 /* Sys-V rec lock: notify user upon server crash */
-#define SIGUSR1 30 /* User signal 1 (from SysV) */
-#define SIGUSR2 31 /* User signal 2 (from SysV) */
-
-/* Add System V signal definitions (DLB001) */
-#define SIGCLD SIGCHLD /* System V name for SIGCHLD */
-#define SIGABRT SIGIOT
-
-typedef long sig_atomic_t;
-typedef unsigned int sigset_t;
-
-struct sigaction {
- void (*sa_handler)(); /* signal handler */
- sigset_t sa_mask; /* signal mask to apply */
- int sa_flags; /* see signal options below */
-};
-
-/* Defines for sigprocmask() call. POSIX.
- */
-#define SIG_BLOCK 1 /* Add these signals to block mask */
-#define SIG_UNBLOCK 2 /* Remove these signals from block mask */
-#define SIG_SETMASK 3 /* Set block mask to this mask */
-
-#define SIG_ERR ((void (*)())(-1))
-#define SIG_DFL ((void (*)())( 0))
-#define SIG_IGN ((void (*)())( 1))
-
-
-#define __SIGFILLSET 0xffffffff
-#define __SIGEMPTYSET 0
-#define __SIGADDSET(s,n) ((*s) |= (1 << ((n) - 1)))
-#define __SIGDELSET(s,n) ((*s) &= ~(1 << ((n) - 1)))
-#define __SIGISMEMBER(s,n) ((*s) & (1 << ((n) - 1)))
-
diff --git a/mit-pthreads/machdep/ultrix-4.2/__stdio.h b/mit-pthreads/machdep/ultrix-4.2/__stdio.h
deleted file mode 100755
index 3f6aee47de3..00000000000
--- a/mit-pthreads/machdep/ultrix-4.2/__stdio.h
+++ /dev/null
@@ -1,7 +0,0 @@
-
-#if ! defined(_SIZE_T_)
-#define _SIZE_T_
-typedef pthread_size_t size_t;
-#endif
-
-typedef pthread_fpos_t fpos_t;
diff --git a/mit-pthreads/machdep/ultrix-4.2/__stdlib.h b/mit-pthreads/machdep/ultrix-4.2/__stdlib.h
deleted file mode 100755
index e2e52cc41c9..00000000000
--- a/mit-pthreads/machdep/ultrix-4.2/__stdlib.h
+++ /dev/null
@@ -1,21 +0,0 @@
-
-#ifndef _SYS___STDLIB_H_
-#define _SYS___STDLIB_H_
-
-#include <ansi_compat.h>
-
-#ifndef _SIZE_T_
-#define _SIZE_T_
-typedef unsigned int size_t;
-#endif
-
-#ifndef _WCHAR_T_
-#define _WCHAR_T_
-typedef unsigned int wchar_t;
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/ultrix-4.2/__string.h b/mit-pthreads/machdep/ultrix-4.2/__string.h
deleted file mode 100755
index 03039b5cf73..00000000000
--- a/mit-pthreads/machdep/ultrix-4.2/__string.h
+++ /dev/null
@@ -1,17 +0,0 @@
-
-#if ! defined(_SIZE_T_)
-#define _SIZE_T_
-typedef pthread_size_t size_t;
-#endif
-
-/* Non-standard Ultrix string routines. */
-#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-__BEGIN_DECLS
-int bcmp __P_((const void *, const void *, size_t));
-void bcopy __P_((const void *, void *, size_t));
-void bzero __P_((void *, size_t));
-char *index __P_((const char *, int));
-char *rindex __P_((const char *, int));
-__END_DECLS
-#endif
-
diff --git a/mit-pthreads/machdep/ultrix-4.2/__time.h b/mit-pthreads/machdep/ultrix-4.2/__time.h
deleted file mode 100755
index dddc54430bc..00000000000
--- a/mit-pthreads/machdep/ultrix-4.2/__time.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * $Id$
- */
-
-#ifndef _SYS__TIME_H_
-#define _SYS__TIME_H_
-
-#include <ansi_compat.h>
-
-#ifndef _CLOCK_T_
-#define _CLOCK_T_
-typedef int clock_t;
-#endif
-
-#ifndef _TIME_T_
-#define _TIME_T_
-typedef int time_t;
-#endif
-
-#ifndef _SIZE_T_
-#define _SIZE_T_
-typedef unsigned int size_t;
-#endif
-
-#define CLOCKS_PER_SEC 1000000
-
-#if !defined(_ANSI_SOURCE)
-#define CLK_TCK 60
-#endif /* not ANSI */
-
-#endif /* !_SYS__TIME_H_ */
diff --git a/mit-pthreads/machdep/ultrix-4.2/__unistd.h b/mit-pthreads/machdep/ultrix-4.2/__unistd.h
deleted file mode 100755
index f570242ef0d..00000000000
--- a/mit-pthreads/machdep/ultrix-4.2/__unistd.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
- * $Id$
- */
-
-#ifndef _SYS___UNISTD_H_
-#define _SYS___UNISTD_H_
-
-#include <sys/types.h>
-
-#ifndef _SSIZE_T_
-#define _SSIZE_T_
-typedef int ssize_t;
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/ultrix-4.2/cdefs.h b/mit-pthreads/machdep/ultrix-4.2/cdefs.h
deleted file mode 100755
index 4e1dc1c280d..00000000000
--- a/mit-pthreads/machdep/ultrix-4.2/cdefs.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* ==== cdefs.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Similar to the BSD cdefs.h file.
- *
- * 1.00 94/01/26 proven
- * -Started coding this file.
- */
-
-#ifndef _PTHREAD_SYS_CDEFS_H_
-#define _PTHREAD_SYS_CDEFS_H_
-
-/* Stuff for compiling */
-#if defined(__GNUC__)
-#if defined(__cplusplus)
-#define __INLINE static inline
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS };
-#else
-#define __INLINE extern inline
-#define __CAN_DO_EXTERN_INLINE
-#define __BEGIN_DECLS
-#define __END_DECLS
-#if !defined(__STDC__)
-#define const __const
-#define inline __inline
-#define signed __signed
-#define volatile __volatile
-#endif
-#endif
-#else /* !__GNUC__ */
-#define __INLINE static
-#define __BEGIN_DECLS
-#define __END_DECLS
-#endif
-
-#ifndef __NORETURN
-#define __NORETURN
-#endif /* __NORETURN not defined. */
-
-#ifndef _U_INT32_T_
-#define _U_INT32_T_
-typedef unsigned int u_int32_t;
-#endif
-
-#ifndef _U_INT16_T_
-#define _U_INT16_T_
-typedef unsigned short u_int16_t;
-#endif
-
-#ifndef _INT32_T_
-#define _INT32_T_
-typedef int int32_t;
-#endif
-
-#ifndef _INT16_T_
-#define _INT16_T_
-typedef short int16_t;
-#endif
-
-#ifndef _SSIZE_T_
-#define _SSIZE_T_
-typedef int ssize_t;
-#endif
-
-#endif
diff --git a/mit-pthreads/machdep/ultrix-4.2/compat.h b/mit-pthreads/machdep/ultrix-4.2/compat.h
deleted file mode 100755
index b2a846d00ee..00000000000
--- a/mit-pthreads/machdep/ultrix-4.2/compat.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ==== compat.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_COMPAT_H_
-#define _SYS_COMPAT_H_
-
-#define omsghdr msghdr
-
-#endif
diff --git a/mit-pthreads/machdep/ultrix-4.2/dirent.h b/mit-pthreads/machdep/ultrix-4.2/dirent.h
deleted file mode 100755
index 5f17af345db..00000000000
--- a/mit-pthreads/machdep/ultrix-4.2/dirent.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dirent.h 5.18 (Berkeley) 2/23/91
- */
-
-#ifndef _SYS_DIRENT_H_
-#define _SYS_DIRENT_H_
-
-/*
- * A directory entry has a struct dirent at the front of it, containing its
- * inode number, the length of the entry, and the length of the name
- * contained in the entry. These are followed by the name padded to a 4
- * byte boundary with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
- */
-
-struct dirent {
- u_long d_fileno; /* file number of entry */
- u_short d_reclen; /* length of this record */
- u_short d_namlen; /* length of string in d_name */
-#ifdef _POSIX_SOURCE
- char d_name[255 + 1]; /* name must be no longer than this */
-#else
-#define MAXNAMLEN 255
- char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
-#endif
-};
-
-#define d_ino d_fileno
-
-#endif /* !_SYS_DIRENT_H_ */
diff --git a/mit-pthreads/machdep/ultrix-4.2/errno.h b/mit-pthreads/machdep/ultrix-4.2/errno.h
deleted file mode 100755
index b47633a9456..00000000000
--- a/mit-pthreads/machdep/ultrix-4.2/errno.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) 1982, 1986, 1989 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)errno.h 7.13 (Berkeley) 2/19/91
- * errno.h,v 1.3 1993/05/20 16:22:09 cgd Exp
- */
-
-#ifndef _SYS_ERRNO_H_
-#define _SYS_ERRNO_H_
-
-#define EPERM 1 /* Operation not permitted */
-#define ENOENT 2 /* No such file or directory */
-#define ESRCH 3 /* No such process */
-#define EINTR 4 /* Interrupted system call */
-#define EIO 5 /* Input/output error */
-#define ENXIO 6 /* Device not configured */
-#define E2BIG 7 /* Argument list too long */
-#define ENOEXEC 8 /* Exec format error */
-#define EBADF 9 /* Bad file descriptor */
-#define ECHILD 10 /* No child processes */
-#define EAGAIN 11 /* No more processes */
-#define ENOMEM 12 /* Cannot allocate memory */
-#define EACCES 13 /* Permission denied */
-#define EFAULT 14 /* Bad address */
-/* 15 Non POSIX */
-/* 16 Non POSIX */
-#define EEXIST 17 /* File exists */
-#define EXDEV 18 /* Cross-device link */
-#define ENODEV 19 /* Operation not supported by device */
-#define ENOTDIR 20 /* Not a directory */
-#define EISDIR 21 /* Is a directory */
-#define EINVAL 22 /* Invalid argument */
-#define ENFILE 23 /* Too many open files in system */
-#define EMFILE 24 /* Too many open files */
-#define ENOTTY 25 /* Inappropriate ioctl for device */
-/* 26 Non POSIX */
-#define EFBIG 27 /* File too large */
-#define ENOSPC 28 /* No space left on device */
-#define ESPIPE 29 /* Illegal seek */
-#define EROFS 30 /* Read-only file system */
-#define EMLINK 31 /* Too many links */
-#define EPIPE 32 /* Broken pipe */
-
-/* math software */
-#define EDOM 33 /* Numerical argument out of domain */
-#define ERANGE 34 /* Result too large */
-/* 35 Non POSIX */
-/* 36 Non POSIX */
-/* 37 Non POSIX */
-/* 38 Non POSIX */
-/* 39 Non POSIX */
-/* 40 Non POSIX */
-/* 41 Non POSIX */
-/* 42 Non POSIX */
-/* 43 Non POSIX */
-/* 44 Non POSIX */
-/* 45 Non POSIX */
-/* 46 Non POSIX */
-/* 47 Non POSIX */
-/* 48 Non POSIX */
-/* 49 Non POSIX */
-/* 50 Non POSIX */
-/* 51 Non POSIX */
-/* 52 Non POSIX */
-/* 53 Non POSIX */
-/* 54 Non POSIX */
-/* 55 Non POSIX */
-/* 56 Non POSIX */
-/* 57 Non POSIX */
-/* 58 Non POSIX */
-/* 59 Non POSIX */
-/* 60 Non POSIX */
-/* 61 Non POSIX */
-/* 62 Non POSIX */
-#define ENAMETOOLONG 63 /* File name too long */
-/* 64 Non POSIX */
-/* 65 Non POSIX */
-#define ENOTEMPTY 66 /* Directory not empty */
-/* 67 Non POSIX */
-/* 68 Non POSIX */
-/* 69 Non POSIX */
-/* 70 Non POSIX */
-/* 71 Non POSIX */
-/* 72 Non POSIX */
-/* 73 Non POSIX */
-/* 74 Non POSIX */
-#define ENOLCK 75 /* No locks available */
-#define ENOSYS 76 /* Function not implemented */
-
-#ifndef _POSIX_SOURCE
-#define ENOTBLK 15 /* Block device required */
-#define EBUSY 16 /* Device busy */
-#define ETXTBSY 26 /* Text file busy */
-
-/* non-blocking and interrupt i/o */
-#define EWOULDBLOCK 35 /* Operation would block */
-#define EDEADLK EWOULDBLOCK /* Resource deadlock avoided */
-#define EINPROGRESS 36 /* Operation now in progress */
-#define EALREADY 37 /* Operation already in progress */
-
-/* ipc/network software -- argument errors */
-#define ENOTSOCK 38 /* Socket operation on non-socket */
-#define EDESTADDRREQ 39 /* Destination address required */
-#define EMSGSIZE 40 /* Message too long */
-#define EPROTOTYPE 41 /* Protocol wrong type for socket */
-#define ENOPROTOOPT 42 /* Protocol not available */
-#define EPROTONOSUPPORT 43 /* Protocol not supported */
-#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
-#define EOPNOTSUPP 45 /* Operation not supported on socket */
-#define EPFNOSUPPORT 46 /* Protocol family not supported */
-#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
-#define EADDRINUSE 48 /* Address already in use */
-#define EADDRNOTAVAIL 49 /* Can't assign requested address */
-
-/* ipc/network software -- operational errors */
-#define ENETDOWN 50 /* Network is down */
-#define ENETUNREACH 51 /* Network is unreachable */
-#define ENETRESET 52 /* Network dropped connection on reset */
-#define ECONNABORTED 53 /* Software caused connection abort */
-#define ECONNRESET 54 /* Connection reset by peer */
-#define ENOBUFS 55 /* No buffer space available */
-#define EISCONN 56 /* Socket is already connected */
-#define ENOTCONN 57 /* Socket is not connected */
-#define ESHUTDOWN 58 /* Can't send after socket shutdown */
-#define ETOOMANYREFS 59 /* Too many references: can't splice */
-#define ETIMEDOUT 60 /* Connection timed out */
-#define ECONNREFUSED 61 /* Connection refused */
-
-#define ELOOP 62 /* Too many levels of symbolic links */
-
-#define EHOSTDOWN 64 /* Host is down */
-#define EHOSTUNREACH 65 /* No route to host */
-
-/* quotas & mush */
-#define EPROCLIM 67 /* Too many processes */
-#define EUSERS 68 /* Too many users */
-#define EDQUOT 69 /* Disc quota exceeded */
-
-/* Network File System */
-#define ESTALE 70 /* Stale NFS file handle */
-#define EREMOTE 71 /* Too many levels of remote in path */
-
-/* IPC errors */
-#define ENOMSG 72 /* RPC struct is bad */
-#define EIDRM 73 /* RPC version wrong */
-
-/* Alignment error of some type (i.e., cluster, page, block ...) */
-#define EALIGN 74 /* RPC prog. not avail */
-#endif /* _POSIX_SOURCE */
-
-#endif /* _SYS_ERRNO_H_ */
diff --git a/mit-pthreads/machdep/ultrix-4.2/time.h b/mit-pthreads/machdep/ultrix-4.2/time.h
deleted file mode 100755
index 1dbb32b67a4..00000000000
--- a/mit-pthreads/machdep/ultrix-4.2/time.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)time.h 5.12 (Berkeley) 3/9/91
- * $Id$
- */
-
-#ifndef _SYS_TIME_H_
-#define _SYS_TIME_H_
-
-#include <time.h>
-#include <sys/cdefs.h>
-
-struct timeval {
- long tv_sec; /* seconds */
- long tv_usec; /* microseconds */
-};
-
-struct timezone {
- int tz_minuteswest; /* minutes west of Greenwich */
- int tz_dsttime; /* dst correction */
-};
-#define DST_NONE 0 /* not on dst */
-#define DST_USA 1 /* USA style dst */
-#define DST_AUST 2 /* Australian style dst */
-#define DST_WET 3 /* Western European dst */
-#define DST_MET 4 /* Middle European dst */
-#define DST_EET 5 /* Eastern European dst */
-
-
-struct itimerval {
- struct timeval it_interval; /* timer interval */
- struct timeval it_value; /* current value */
-};
-#define ITIMER_REAL 0
-#define ITIMER_VIRTUAL 1
-#define ITIMER_PROF 2
-
-/*
- * Functions
- */
-__BEGIN_DECLS
-
-int gettimeofday __P_((struct timeval *, struct timezone *));
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/machdep/ultrix-4.2/timers.h b/mit-pthreads/machdep/ultrix-4.2/timers.h
deleted file mode 100755
index 3c4d057976a..00000000000
--- a/mit-pthreads/machdep/ultrix-4.2/timers.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ==== timers.h ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Basic timers header.
- *
- * 1.00 94/06/13 proven
- * -Started coding this file.
- */
-
-#ifndef _SYS_TIMERS_H_
-#define _SYS_TIMERS_H_
-
-#include <sys/types.h>
-#include <time.h>
-
-struct timespec {
- time_t tv_sec;
- long tv_nsec;
-};
-
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
- (ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
- (tv)->tv_sec = (ts)->tv_sec; \
- (tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
-
-/*
- * New functions
- */
-
-__BEGIN_DECLS
-
-__END_DECLS
-
-#endif
diff --git a/mit-pthreads/machdep/ultrix-4.2/wait.h b/mit-pthreads/machdep/ultrix-4.2/wait.h
deleted file mode 100755
index 8114f7e461d..00000000000
--- a/mit-pthreads/machdep/ultrix-4.2/wait.h
+++ /dev/null
@@ -1,121 +0,0 @@
-
-#ifndef _SYS_WAIT_H_
-#define _SYS_WAIT_H_
-
-#include <ansi_compat.h>
-#include <sys/cdefs.h>
-
-#if !defined(_POSIX_SOURCE)
-union wait {
-#else
-union __wait {
-#endif /* !defined(_POSIX_SOURCE) */
-#ifdef __vax
- int w_status; /* used in syscall */
-#endif /* __vax */
-#ifdef __mips__
- unsigned int w_status; /* used in syscall */
-#endif /* __mips */
- /*
- * Terminated process status.
- */
- struct {
-#ifdef __vax
- unsigned short w_Termsig:7; /* termination signal */
- unsigned short w_Coredump:1; /* core dump indicator */
- unsigned short w_Retcode:8; /* exit code if w_termsig==0 */
-#endif /* __vax */
-#ifdef __mips__
-#ifdef __MIPSEL__
- unsigned int w_Termsig:7; /* termination signal */
- unsigned int w_Coredump:1; /* core dump indicator */
- unsigned int w_Retcode:8; /* exit code if w_termsig==0 */
- unsigned int w_Filler:16; /* pad to word boundary */
-#endif /* __MIPSEL */
-#ifdef __MIPSEB__
- unsigned int w_Filler:16; /* pad to word boundary */
- unsigned int w_Retcode:8; /* exit code if w_termsig==0 */
- unsigned int w_Coredump:1; /* core dump indicator */
- unsigned int w_Termsig:7; /* termination signal */
-#endif /* __MIPSEB */
-#endif /* __mips */
- } w_T;
- /*
- * Stopped process status. Returned
- * only for traced children unless requested
- * with the WUNTRACED option bit.
- */
- struct {
-#ifdef __vax
- unsigned short w_Stopval:8; /* == W_STOPPED if stopped */
- unsigned short w_Stopsig:8; /* signal that stopped us */
-#endif /* __vax */
-#ifdef __mips__
-#ifdef __MIPSEL__
- unsigned int w_Stopval:8; /* == W_STOPPED if stopped */
- unsigned int w_Stopsig:8; /* signal that stopped us */
- unsigned int w_Filler:16; /* pad to word boundary */
-#endif /* __MIPSEL */
-#ifdef __MIPSEB__
- unsigned int w_Filler:16; /* pad to word boundary */
- unsigned int w_Stopsig:8; /* signal that stopped us */
- unsigned int w_Stopval:8; /* == W_STOPPED if stopped */
-#endif /* __MIPSEB */
-#endif /* __mips */
- } w_S;
-};
-
-#if !defined(_POSIX_SOURCE)
-#define w_termsig w_T.w_Termsig
-#define w_coredump w_T.w_Coredump
-#define w_retcode w_T.w_Retcode
-#define w_stopval w_S.w_Stopval
-#define w_stopsig w_S.w_Stopsig
-#define WSTOPPED 0177 /* value of s.stopval if process is stopped */
-#endif /* !defined(_POSIX_SOURCE) */
-
-#ifdef WSTOPPED
-#define _WSTOPPED WSTOPPED
-#else
-#define _WSTOPPED 0177
-#endif
-
-/*
- * Option bits for the second argument of wait3. WNOHANG causes the
- * wait to not hang if there are no stopped or terminated processes, rather
- * returning an error indication in this case (pid==0). WUNTRACED
- * indicates that the caller should receive status about untraced children
- * which stop due to signals. If children are stopped and a wait without
- * this option is done, it is as though they were still running... nothing
- * about them is returned.
- */
-#define WNOHANG 1 /* dont hang in wait */
-#define WUNTRACED 2 /* tell about stopped, untraced children */
-
-/*
- * Must cast as union wait * because POSIX defines the input to these macros
- * as int.
- */
-
-#ifdef _POSIX_SOURCE
-#define WIFSTOPPED(x) (((union __wait *)&(x))->w_S.w_Stopval == _WSTOPPED)
-#define WIFSIGNALED(x) (((union __wait *)&(x))->w_S.w_Stopval != _WSTOPPED && ((union __wait *)&(x))->w_T.w_Termsig != 0)
-#define WIFEXITED(x) (((union __wait *)&(x))->w_S.w_Stopval != _WSTOPPED && ((union __wait *)&(x))->w_T.w_Termsig == 0)
-#define WEXITSTATUS(x) (((union __wait *)&(x))->w_T.w_Retcode)
-#define WTERMSIG(x) (((union __wait *)&(x))->w_T.w_Termsig)
-#define WSTOPSIG(x) (((union __wait *)&(x))->w_S.w_Stopsig)
-#endif /* _POSIX_SOURCE */
-
-#if !defined(_POSIX_SOURCE)
-#define WIFSTOPPED(x) (((union wait *)&(x))->w_stopval == WSTOPPED)
-#define WIFSIGNALED(x) (((union wait *)&(x))->w_stopval != WSTOPPED && ((union wait *)&(x))->w_termsig != 0)
-#define WIFEXITED(x) (((union wait *)&(x))->w_stopval != WSTOPPED && ((union wait *)&(x))->w_termsig == 0)
-#define WEXITSTATUS(x) (((union wait *)&(x))->w_retcode)
-#define WTERMSIG(x) (((union wait *)&(x))->w_termsig)
-#define WSTOPSIG(x) (((union wait *)&(x))->w_stopsig)
-#endif /* !defined(_POSIX_SOURCE) */
-
-pid_t wait __P_((int *));
-pid_t waitpid __P_((pid_t, int *, int));
-
-#endif /* _SYS_WAIT_H_ */
diff --git a/mit-pthreads/machdep/unistd-i386-freebsd-1.1.h b/mit-pthreads/machdep/unistd-i386-freebsd-1.1.h
deleted file mode 100644
index 033e70de5e5..00000000000
--- a/mit-pthreads/machdep/unistd-i386-freebsd-1.1.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)unistd.h 5.13 (Berkeley) 6/17/91
- */
-
-#ifndef _UNISTD_H_
-#define _UNISTD_H_
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <sys/unistd.h>
-
-#define STDIN_FILENO 0 /* standard input file descriptor */
-#define STDOUT_FILENO 1 /* standard output file descriptor */
-#define STDERR_FILENO 2 /* standard error file descriptor */
-
-#ifndef NULL
-#define NULL 0 /* null pointer constant */
-#endif
-
-typedef int ssize_t; /* count of bytes or error indication */
-
-__BEGIN_DECLS
-void _exit __P_((int));
-int access __P_((const char *, int));
-u_int alarm __P_((u_int));
-int chdir __P_((const char *));
-int chown __P_((const char *, uid_t, gid_t));
-int close __P_((int));
-char *cuserid __P_((char *));
-int dup __P_((int));
-int dup2 __P_((int, int));
-int execl __P_((const char *, const char *, ...));
-int execle __P_((const char *, const char *, ...));
-int execlp __P_((const char *, const char *, ...));
-int execv __P_((const char *, char * const *));
-int execve __P_((const char *, char * const *, char * const *));
-int execvp __P_((const char *, char * const *));
-pid_t fork __P_((void));
-long fpathconf __P_((int, int)); /* not yet */
-char *getcwd __P_((char *, size_t));
-gid_t getegid __P_((void));
-uid_t geteuid __P_((void));
-gid_t getgid __P_((void));
-int getgroups __P_((int, int *)); /* XXX (gid_t *) */
-char *getlogin __P_((void));
-pid_t getpgrp __P_((void));
-pid_t getpid __P_((void));
-pid_t getppid __P_((void));
-uid_t getuid __P_((void));
-int isatty __P_((int));
-int link __P_((const char *, const char *));
-off_t lseek __P_((int, off_t, int));
-long pathconf __P_((const char *, int)); /* not yet */
-int pause __P_((void));
-int pipe __P_((int *));
-ssize_t read __P_((int, void *, size_t));
-int rmdir __P_((const char *));
-int setgid __P_((gid_t));
-int setpgid __P_((pid_t, pid_t));
-pid_t setsid __P_((void));
-int setuid __P_((uid_t));
-u_int sleep __P_((u_int));
-long sysconf __P_((int)); /* not yet */
-pid_t tcgetpgrp __P_((int));
-int tcsetpgrp __P_((int, pid_t));
-char *ttyname __P_((int));
-int unlink __P_((const char *));
-ssize_t write __P_((int, const void *, size_t));
-
-#ifndef _POSIX_SOURCE
-
-/* structure timeval required for select() */
-#include <sys/time.h>
-
-int acct __P_((const char *));
-int async_daemon __P_((void));
-char *brk __P_((const char *));
-int chflags __P_((const char *, long));
-int chroot __P_((const char *));
-char *crypt __P_((const char *, const char *));
-int des_cipher __P_((const char *, char *, long, int));
-int des_setkey __P_((const char *key));
-int encrypt __P_((char *, int));
-void endusershell __P_((void));
-int exect __P_((const char *, char * const *, char * const *));
-int fchdir __P_((int));
-int fchflags __P_((int, long));
-int fchown __P_((int, uid_t, gid_t));
-int fsync __P_((int));
-int ftruncate __P_((int, off_t));
-int getdtablesize __P_((void));
-long gethostid __P_((void));
-int gethostname __P_((char *, int));
-mode_t getmode __P_((const void *, mode_t));
-int getpagesize __P_((void));
-char *getpass __P_((const char *));
-char *getusershell __P_((void));
-char *getwd __P_((char *)); /* obsoleted by getcwd() */
-int initgroups __P_((const char *, int));
-int mknod __P_((const char *, mode_t, dev_t));
-int mkstemp __P_((char *));
-char *mktemp __P_((char *));
-int nfssvc __P_((int));
-int nice __P_((int));
-void psignal __P_((u_int, const char *));
-extern char *sys_siglist[];
-int profil __P_((char *, int, int, int));
-int rcmd __P_((char **, int, const char *,
- const char *, const char *, int *));
-char *re_comp __P_((const char *));
-int re_exec __P_((const char *));
-int readlink __P_((const char *, char *, int));
-int reboot __P_((int));
-int revoke __P_((const char *));
-int rresvport __P_((int *));
-int ruserok __P_((const char *, int, const char *, const char *));
-char *sbrk __P_((int));
-int select __P_((int, fd_set *, fd_set *, fd_set *, struct timeval *));
-int setegid __P_((gid_t));
-int seteuid __P_((uid_t));
-int setgroups __P_((int, const int *));
-void sethostid __P_((long));
-int sethostname __P_((const char *, int));
-int setkey __P_((const char *));
-int setlogin __P_((const char *));
-void *setmode __P_((const char *));
-int setpgrp __P_((pid_t pid, pid_t pgrp)); /* obsoleted by setpgid() */
-int setregid __P_((int, int));
-int setreuid __P_((int, int));
-int setrgid __P_((gid_t));
-int setruid __P_((uid_t));
-void setusershell __P_((void));
-int swapon __P_((const char *));
-int symlink __P_((const char *, const char *));
-void sync __P_((void));
-int syscall __P_((int, ...));
-int truncate __P_((const char *, off_t));
-int ttyslot __P_((void));
-u_int ualarm __P_((u_int, u_int));
-void usleep __P_((u_int));
-void *valloc __P_((size_t)); /* obsoleted by malloc() */
-int vfork __P_((void));
-
-#endif /* !_POSIX_SOURCE */
-__END_DECLS
-
-#endif /* !_UNISTD_H_ */
diff --git a/mit-pthreads/machdep/unistd-i386-linux-1.0.h b/mit-pthreads/machdep/unistd-i386-linux-1.0.h
deleted file mode 100644
index e7a3c5de1e4..00000000000
--- a/mit-pthreads/machdep/unistd-i386-linux-1.0.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)unistd.h 5.13 (Berkeley) 6/17/91
- */
-
-#ifndef _UNISTD_H_
-#define _UNISTD_H_
-
-#include <features.h>
-
-/* POSIX Standard approved as IEEE Std 1003.1 as of August, 1988. */
-#define _POSIX_VERSION 199009L
-#define _POSIX2_C_BIND 1
-#define _POSIX2_C_DEV 1
-#define _POSIX2_SW_DEV 1
-
-#define __need_size_t
-
-#include <posix_opt.h>
-#include <sys/types.h>
-#include <stddef.h>
-
-#define STDIN_FILENO 0 /* standard input file descriptor */
-#define STDOUT_FILENO 1 /* standard output file descriptor */
-#define STDERR_FILENO 2 /* standard error file descriptor */
-
-#include <pthread/unistd.h>
-
-#endif /* !_UNISTD_H_ */
diff --git a/mit-pthreads/machdep/unistd-i386-linux-2.0.h b/mit-pthreads/machdep/unistd-i386-linux-2.0.h
deleted file mode 100644
index e7a3c5de1e4..00000000000
--- a/mit-pthreads/machdep/unistd-i386-linux-2.0.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)unistd.h 5.13 (Berkeley) 6/17/91
- */
-
-#ifndef _UNISTD_H_
-#define _UNISTD_H_
-
-#include <features.h>
-
-/* POSIX Standard approved as IEEE Std 1003.1 as of August, 1988. */
-#define _POSIX_VERSION 199009L
-#define _POSIX2_C_BIND 1
-#define _POSIX2_C_DEV 1
-#define _POSIX2_SW_DEV 1
-
-#define __need_size_t
-
-#include <posix_opt.h>
-#include <sys/types.h>
-#include <stddef.h>
-
-#define STDIN_FILENO 0 /* standard input file descriptor */
-#define STDOUT_FILENO 1 /* standard output file descriptor */
-#define STDERR_FILENO 2 /* standard error file descriptor */
-
-#include <pthread/unistd.h>
-
-#endif /* !_UNISTD_H_ */
diff --git a/mit-pthreads/machdep/unistd-sparc-sunos-4.1.3.h b/mit-pthreads/machdep/unistd-sparc-sunos-4.1.3.h
deleted file mode 100644
index 4d2161b628f..00000000000
--- a/mit-pthreads/machdep/unistd-sparc-sunos-4.1.3.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)unistd.h 5.13 (Berkeley) 6/17/91
- * $Id$
- */
-
-#ifndef _UNISTD_H_
-#define _UNISTD_H_
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-#define _NO_STDIO_SIZE_T
-
-#define _SC_ARG_MAX 1 /* space for argv & envp */
-#define _SC_CHILD_MAX 2 /* maximum children per process??? */
-#define _SC_CLK_TCK 3 /* clock ticks/sec */
-#define _SC_NGROUPS_MAX 4 /* number of groups if multple supp. */
-#define _SC_OPEN_MAX 5 /* max open files per process */
-#define _SC_JOB_CONTROL 6 /* do we have job control */
-#define _SC_SAVED_IDS 7 /* do we have saved uid/gids */
-#define _SC_VERSION 8 /* POSIX version supported */
-
-#define _POSIX_JOB_CONTROL 1
-#define _POSIX_SAVED_IDS 1
-#define _POSIX_VERSION 198808
-
-#define _PC_LINK_MAX 1 /* max links to file/dir */
-#define _PC_MAX_CANON 2 /* max line length */
-#define _PC_MAX_INPUT 3 /* max "packet" to a tty device */
-#define _PC_NAME_MAX 4 /* max pathname component length */
-#define _PC_PATH_MAX 5 /* max pathname length */
-#define _PC_PIPE_BUF 6 /* size of a pipe */
-#define _PC_CHOWN_RESTRICTED 7 /* can we give away files */
-#define _PC_NO_TRUNC 8 /* trunc or error on >NAME_MAX */
-#define _PC_VDISABLE 9 /* best char to shut off tty c_cc */
-#define _PC_LAST 9 /* highest value of any _PC_* */
-
-
-#define STDIN_FILENO 0 /* standard input file descriptor */
-#define STDOUT_FILENO 1 /* standard output file descriptor */
-#define STDERR_FILENO 2 /* standard error file descriptor */
-
-#ifndef NULL
-#define NULL 0 /* null pointer constant */
-#endif
-
-typedef int ssize_t;
-
-__BEGIN_DECLS
-void _exit __P_((int));
-int access __P_((const char *, int));
-unsigned alarm __P_((unsigned));
-int chdir __P_((const char *));
-int chown __P_((const char *, uid_t, gid_t));
-int close __P_((int));
-size_t confstr __P_((int, char *, size_t));
-char *cuserid __P_((char *));
-int dup __P_((int));
-int dup2 __P_((int, int));
-int execl __P_((const char *, const char *, ...));
-int execle __P_((const char *, const char *, ...));
-int execlp __P_((const char *, const char *, ...));
-int execv __P_((const char *, char * const *));
-int execve __P_((const char *, char * const *, char * const *));
-int execvp __P_((const char *, char * const *));
-pid_t fork __P_((void));
-long fpathconf __P_((int, int)); /* not yet */
-char *getcwd __P_((char *, size_t));
-gid_t getegid __P_((void));
-uid_t geteuid __P_((void));
-gid_t getgid __P_((void));
-int getgroups __P_((int, int *)); /* XXX (gid_t *) */
-char *getlogin __P_((void));
-pid_t getpgrp __P_((void));
-pid_t getpid __P_((void));
-pid_t getppid __P_((void));
-uid_t getuid __P_((void));
-int isatty __P_((int));
-int link __P_((const char *, const char *));
-off_t lseek __P_((int, off_t, int));
-long pathconf __P_((const char *, int)); /* not yet */
-int pause __P_((void));
-int pipe __P_((int *));
-ssize_t read __P_((int, void *, size_t));
-int rmdir __P_((const char *));
-int setgid __P_((gid_t));
-int setpgid __P_((pid_t, pid_t));
-pid_t setsid __P_((void));
-int setuid __P_((uid_t));
-unsigned sleep __P_((unsigned));
-long sysconf __P_((int)); /* not yet */
-pid_t tcgetpgrp __P_((int));
-int tcsetpgrp __P_((int, pid_t));
-char *ttyname __P_((int));
-int unlink __P_((const char *));
-ssize_t write __P_((int, const void *, size_t));
-
-#ifndef _POSIX_SOURCE
-
-/* structure timeval required for select() */
-#include <sys/time.h>
-
-int acct __P_((const char *));
-int async_daemon __P_((void));
-char *brk __P_((const char *));
-int chflags __P_((const char *, long));
-int chroot __P_((const char *));
-char *crypt __P_((const char *, const char *));
-int des_cipher __P_((const char *, char *, long, int));
-int des_setkey __P_((const char *key));
-int encrypt __P_((char *, int));
-void endusershell __P_((void));
-int exect __P_((const char *, char * const *, char * const *));
-int fchdir __P_((int));
-int fchflags __P_((int, long));
-int fchown __P_((int, uid_t, gid_t));
-int fsync __P_((int));
-int ftruncate __P_((int, off_t));
-int getdomainname __P_((char *, int));
-int getdtablesize __P_((void));
-long gethostid __P_((void));
-int gethostname __P_((char *, int));
-mode_t getmode __P_((const void *, mode_t));
-int getpagesize __P_((void));
-char *getpass __P_((const char *));
-char *getusershell __P_((void));
-char *getwd __P_((char *)); /* obsoleted by getcwd() */
-int initgroups __P_((const char *, int));
-int mknod __P_((const char *, mode_t, dev_t));
-int mkstemp __P_((char *));
-char *mktemp __P_((char *));
-int nfssvc __P_((int));
-int nice __P_((int));
-void psignal __P_((u_int, const char *));
-extern const char *const sys_siglist[];
-int profil __P_((char *, int, int, int));
-int rcmd __P_((char **, int, const char *,
- const char *, const char *, int *));
-char *re_comp __P_((const char *));
-int re_exec __P_((const char *));
-int readlink __P_((const char *, char *, int));
-int reboot __P_((int));
-int revoke __P_((const char *));
-int rresvport __P_((int *));
-int ruserok __P_((const char *, int, const char *, const char *));
-char *sbrk __P_((int));
-int select __P_((int, fd_set *, fd_set *, fd_set *, struct timeval *));
-int setdomainname __P_((const char *, int));
-int setegid __P_((gid_t));
-int seteuid __P_((uid_t));
-int setgroups __P_((int, const int *));
-void sethostid __P_((long));
-int sethostname __P_((const char *, int));
-int setkey __P_((const char *));
-int setlogin __P_((const char *));
-void *setmode __P_((const char *));
-int setpgrp __P_((pid_t pid, pid_t pgrp)); /* obsoleted by setpgid() */
-int setregid __P_((int, int));
-int setreuid __P_((int, int));
-int setrgid __P_((gid_t));
-int setruid __P_((uid_t));
-void setusershell __P_((void));
-int swapon __P_((const char *));
-int symlink __P_((const char *, const char *));
-void sync __P_((void));
-int syscall __P_((int, ...));
-int truncate __P_((const char *, off_t));
-int ttyslot __P_((void));
-u_int ualarm __P_((u_int, u_int));
-void usleep __P_((u_int));
-void *valloc __P_((size_t)); /* obsoleted by malloc() */
-pid_t vfork __P_((void));
-
-int getopt __P_((int, char * const *, const char *));
-extern char *optarg; /* getopt(3) external variables */
-extern int opterr;
-extern int optind;
-extern int optopt;
-int getsubopt __P_((char **, char * const *, char **));
-extern char *suboptarg; /* getsubopt(3) external variable */
-#endif /* !_POSIX_SOURCE */
-__END_DECLS
-
-#endif /* !_UNISTD_H_ */
diff --git a/mit-pthreads/net/GNUmakefile.inc b/mit-pthreads/net/GNUmakefile.inc
deleted file mode 100644
index 6b89617f63b..00000000000
--- a/mit-pthreads/net/GNUmakefile.inc
+++ /dev/null
@@ -1,14 +0,0 @@
-# from: @(#)Makefile.inc 5.21 (Berkeley) 5/24/91
-# $Id$
-
-# gen sources
-VPATH:= ${VPATH}:${srcdir}/net
-
-SRCS:= gethostbyaddr.c gethostbyname.c gethostent.c getnetbyaddr.c \
- getnetbyname.c getnetent.c getproto.c getprotoent.c getprotoname.c \
- getservbyname.c getservbyport.c getservent.c herror.c inet_addr.c \
- inet_lnaof.c inet_makeaddr.c inet_netof.c inet_network.c inet_ntoa.c \
- net_internal.c proto_internal.c res_comp.c res_init.c res_internal.c \
- res_mkquery.c res_query.c res_querydomain.c res_search.c res_send.c \
- res_debug.c serv_internal.c $(SRCS)
-
diff --git a/mit-pthreads/net/Makefile.inc b/mit-pthreads/net/Makefile.inc
deleted file mode 100644
index 08be88c808f..00000000000
--- a/mit-pthreads/net/Makefile.inc
+++ /dev/null
@@ -1,13 +0,0 @@
-# from: @(#)Makefile.inc 5.21 (Berkeley) 5/24/91
-# $Id$
-
-# gen sources
-.PATH: ${srcdir}/net
-
-SRCS+= gethostbyaddr.c gethostbyname.c gethostent.c getnetbyaddr.c \
- getnetbyname.c getnetent.c getproto.c getprotoent.c getprotoname.c \
- getservbyname.c getservbyport.c getservent.c herror.c inet_addr.c \
- inet_lnaof.c inet_makeaddr.c inet_netof.c inet_network.c inet_ntoa.c \
- net_internal.c proto_internal.c res_comp.c res_init.c res_internal.c \
- res_mkquery.c res_query.c res_querydomain.c res_search.c res_send.c \
- serv_internal.c gethostname.c
diff --git a/mit-pthreads/net/gethostbyaddr.c b/mit-pthreads/net/gethostbyaddr.c
deleted file mode 100644
index f80e47ffd99..00000000000
--- a/mit-pthreads/net/gethostbyaddr.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 1985, 1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)gethostbyaddr.c 6.45 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-
-#include <pthread.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <resolv.h>
-#include <netinet/in.h>
-#include <errno.h>
-#include <sys/socket.h>
-#include "res_internal.h"
-
-static struct hostent *file_find_addr(const char *addr, int len, int type,
- struct hostent *result, char *buf,
- int bufsize, int *errval);
-
-struct hostent *gethostbyaddr(const char *addr, int len, int type)
-{
- struct res_data *data = _res_init();
-
- if (!data)
- return NULL;
- if (!data->buf) {
- data->buf = malloc(sizeof(struct hostent) + HOST_BUFSIZE);
- if (!data->buf) {
- errno = 0;
- data->errval = NO_RECOVERY;
- return NULL;
- }
- }
- return gethostbyaddr_r(addr, len, type, (struct hostent *) data->buf,
- data->buf + sizeof(struct hostent), HOST_BUFSIZE,
- &data->errval);
-}
-
-struct hostent *gethostbyaddr_r(const char *addr, int len, int type,
- struct hostent *result, char *buf, int bufsize,
- int *errval)
-{
- struct res_data *data;
- querybuf qbuf;
- char lookups[MAXDNSLUS], addrbuf[MAXDNAME], *abuf;
- struct hostent *hp;
- int n, i;
-
- /* Default failure condition is not a range error and not recoverable. */
- errno = 0;
- *errval = NO_RECOVERY;
-
- data = _res_init();
- if (!data)
- return NULL;
-
- if (type != AF_INET)
- return NULL;
- sprintf(addrbuf, "%u.%u.%u.%u.in-addr.arpa",
- (unsigned)addr[3] & 0xff, (unsigned)addr[2] & 0xff,
- (unsigned)addr[1] & 0xff, (unsigned)addr[0] & 0xff);
-
- memcpy(lookups, data->state.lookups, sizeof(lookups));
- if (*lookups == 0)
- strncpy(lookups, "bf", sizeof(lookups));
-
- hp = NULL;
- for (i = 0; i < MAXDNSLUS && hp == NULL && lookups[i]; i++) {
- switch (lookups[i]) {
- case 'b':
-
- /* Allocate space for a one-item list of addresses. */
- abuf = SP(SP(buf, char *, 2), struct in_addr, 1);
- if (abuf > buf + bufsize) {
- errno = ERANGE;
- return NULL;
- }
-
- /* Perform and parse the query. */
- n = res_query(addrbuf, C_IN, T_PTR, (char *)&qbuf, sizeof(qbuf));
- if (n < 0)
- break;
- hp = _res_parse_answer(&qbuf, n, 1, result, abuf,
- bufsize - (abuf - buf), errval);
- if (hp == NULL)
- break;
-
- /* Fill in our own address list. */
- result->h_addrtype = type;
- result->h_length = len;
- result->h_addr_list = (char **) ALIGN(buf, char *);
- result->h_addr_list[0] = ALIGN(&result->h_addr_list[2],
- struct in_addr);
- result->h_addr_list[1] = NULL;
- break;
-
- case 'f':
- hp = file_find_addr(addr, len, type, result, buf, bufsize, errval);
- break;
- }
- }
-
- return hp;
-}
-
-static struct hostent *file_find_addr(const char *addr, int len, int type,
- struct hostent *result, char *buf,
- int bufsize, int *errval)
-{
- FILE *fp = NULL;
-
- pthread_mutex_lock(&host_iterate_lock);
- sethostent(0);
- while ((result = gethostent_r(result, buf, bufsize, errval)) != NULL) {
- /* Check the entry against the given address. */
- if (result->h_addrtype == type &&
- memcmp(result->h_addr, addr, len) == 0)
- break;
- }
- pthread_mutex_unlock(&host_iterate_lock);
- if (!result && errno != ERANGE)
- *errval = HOST_NOT_FOUND;
- return result;
-}
-
diff --git a/mit-pthreads/net/gethostbyname.c b/mit-pthreads/net/gethostbyname.c
deleted file mode 100644
index aaaaf79b31b..00000000000
--- a/mit-pthreads/net/gethostbyname.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 1985, 1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)gethostbyname.c 6.45 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <resolv.h>
-#include "res_internal.h"
-
-static struct hostent *fake_hostent(const char *hostname, struct in_addr addr,
- struct hostent *result, char *buf,
- int bufsize, int *errval);
-static struct hostent *file_find_name(const char *name, struct hostent *result,
- char *buf, int bufsize, int *errval);
-
-struct hostent *gethostbyname(const char *hostname)
-{
- struct res_data *data = _res_init();
-
- if (!data)
- return NULL;
- if (!data->buf) {
- data->buf = malloc(sizeof(struct hostent) + HOST_BUFSIZE);
- if (!data->buf) {
- errno = 0;
- data->errval = NO_RECOVERY;
- return NULL;
- }
- }
- return gethostbyname_r(hostname, (struct hostent *) data->buf,
- data->buf + sizeof(struct hostent), HOST_BUFSIZE,
- &data->errval);
-}
-
-struct hostent *gethostbyname_r(const char *hostname, struct hostent *result,
- char *buf, int bufsize, int *errval)
-{
- struct in_addr addr;
- querybuf qbuf;
- const char *p;
- int n;
-
- /* Default failure condition is not a range error and not recoverable. */
- errno = 0;
- *errval = NO_RECOVERY;
-
- /* Check for all-numeric hostname with no trailing dot. */
- if (isdigit(hostname[0])) {
- p = hostname;
- while (*p && (isdigit(*p) || *p == '.'))
- p++;
- if (!*p && p[-1] != '.') {
- /* Looks like an IP address; convert it. */
- if (inet_aton(hostname, &addr) == -1) {
- *errval = HOST_NOT_FOUND;
- return NULL;
- }
- return fake_hostent(hostname, addr, result, buf, bufsize, errval);
- }
- }
-
- /* Do the search. */
- n = res_search(hostname, C_IN, T_A, qbuf.buf, sizeof(qbuf));
- if (n >= 0)
- return _res_parse_answer(&qbuf, n, 0, result, buf, bufsize, errval);
- else if (errno == ECONNREFUSED)
- return file_find_name(hostname, result, buf, bufsize, errval);
- else
- return NULL;
-}
-
-static struct hostent *fake_hostent(const char *hostname, struct in_addr addr,
- struct hostent *result, char *buf,
- int bufsize, int *errval)
-{
- int len = strlen(hostname);
- char *name, *addr_ptr;
-
- if (SP(SP(SP(buf, char, len + 1), addr, 1), char *, 3) > buf + bufsize) {
- errno = ERANGE;
- return NULL;
- }
-
- /* Copy faked name and address into buffer. */
- strcpy(buf, hostname);
- name = buf;
- buf = ALIGN(buf + len + 1, addr);
- *((struct in_addr *) buf) = addr;
- addr_ptr = buf;
- buf = ALIGN(buf + sizeof(addr), char *);
- ((char **) buf)[0] = addr_ptr;
- ((char **) buf)[1] = NULL;
- ((char **) buf)[2] = NULL;
-
- result->h_name = name;
- result->h_aliases = ((char **) buf) + 2;
- result->h_addrtype = AF_INET;
- result->h_length = sizeof(addr);
- result->h_addr_list = (char **) buf;
-
- return result;
-}
-
-static struct hostent *file_find_name(const char *name, struct hostent *result,
- char *buf, int bufsize, int *errval)
-{
- char **alias;
- FILE *fp = NULL;
-
- pthread_mutex_lock(&host_iterate_lock);
- sethostent(0);
- while ((result = gethostent_r(result, buf, bufsize, errval)) != NULL) {
- /* Check the entry's name and aliases against the given name. */
- if (strcasecmp(result->h_name, name) == 0)
- break;
- for (alias = result->h_aliases; *alias; alias++) {
- if (strcasecmp(*alias, name) == 0)
- goto end; /* Josip Gracin */
- }
- }
-end:
- pthread_mutex_unlock(&host_iterate_lock);
- if (!result && errno != ERANGE)
- *errval = HOST_NOT_FOUND;
- return result;
-}
-
diff --git a/mit-pthreads/net/gethostent.c b/mit-pthreads/net/gethostent.c
deleted file mode 100644
index d6feb7aa164..00000000000
--- a/mit-pthreads/net/gethostent.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)gethostent.c 5.8 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include "res_internal.h"
-
-static pthread_mutex_t res_file_lock = PTHREAD_MUTEX_INITIALIZER;
-static int res_file_stayopen;
-static FILE *res_file;
-
-void sethostent(int stayopen)
-{
- pthread_mutex_lock(&res_file_lock);
- res_file_stayopen |= stayopen;
- if (res_file)
- rewind(res_file);
- else
- res_file = fopen(_PATH_HOSTS, "r");
- pthread_mutex_unlock(&res_file_lock);
-}
-
-void endhostent()
-{
- pthread_mutex_lock(&res_file_lock);
- if (res_file)
- fclose(res_file);
- pthread_mutex_unlock(&res_file_lock);
-}
-
-struct hostent *gethostent()
-{
- struct res_data *data = _res_init();
-
- if (!data)
- return NULL;
- if (!data->buf) {
- data->buf = malloc(sizeof(struct hostent) + HOST_BUFSIZE);
- if (!data->buf) {
- data->errval = NO_RECOVERY;
- return NULL;
- }
- }
- return gethostent_r((struct hostent *) data->buf,
- data->buf + sizeof(struct hostent), HOST_BUFSIZE,
- &data->errval);
-}
-
-struct hostent *gethostent_r(struct hostent *result, char *buf, int bufsize,
- int *errval)
-{
- char *p, **alias;
- struct in_addr *addr;
- int l;
-
- errno = 0;
- pthread_mutex_lock(&res_file_lock);
- if (res_file == NULL && (res_file = fopen(_PATH_HOSTS, "r")) == NULL) {
- pthread_mutex_unlock(&res_file_lock);
- return NULL;
- }
- while (fgets(buf, bufsize, res_file)) {
- if (*buf == '#')
- continue;
- p = strpbrk(buf, "#\n");
- if (p == NULL)
- continue;
- l = strlen(buf) + 1;
- *p = '\0';
- p = strpbrk(buf, " \t");
- if (p == NULL)
- continue;
- *p++ = '\0';
-
- /* THIS STUFF IS INTERNET SPECIFIC */
- if (SP(SP(SP(buf, char, l), *addr, 1), char *, 3) > buf + bufsize) {
- errno = ERANGE;
- break;
- }
- addr = (struct in_addr *) ALIGN(buf + l, struct in_addr);
- if (inet_aton(buf, addr) == 0)
- continue;
- result->h_length = sizeof(*addr);
- result->h_addrtype = AF_INET;
- result->h_addr_list = (char **) ALIGN(addr + sizeof(*addr), char *);
- result->h_addr_list[0] = (char *) addr;
- result->h_addr_list[1] = NULL;
- result->h_aliases = result->h_addr_list + 2;
- while (*p == ' ' || *p == '\t')
- p++;
- result->h_name = p;
- alias = result->h_aliases;
- p = strpbrk(p, " \t");
- if (p != NULL)
- *p++ = '\0';
- while (p && *p) {
- if (*p == ' ' || *p == '\t') {
- p++;
- continue;
- }
- if ((char *) &alias[2] > buf + bufsize) {
- errno = ERANGE;
- break;
- }
- *alias++ = p;
- p = strpbrk(p, " \t");
- if (p != NULL)
- *p++ = '\0';
- }
- if (p && *p)
- break;
- *alias = NULL;
- pthread_mutex_unlock(&res_file_lock);
- return result;
- }
-
- pthread_mutex_unlock(&res_file_lock);
- *errval = (errno == ERANGE) ? NO_RECOVERY : 0;
- return NULL;
-}
-
diff --git a/mit-pthreads/net/gethostname.c b/mit-pthreads/net/gethostname.c
deleted file mode 100644
index 8bec0793296..00000000000
--- a/mit-pthreads/net/gethostname.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Copyright Abandoned 2000 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind */
-
-#include "config.h"
-#include <pthread.h>
-#include <sys/utsname.h>
-
-#ifdef HAVE_SYSCALL_UNAME
-int gethostname(char *name, int len)
-{
- int ret;
- struct utsname buf;
-
- if ((ret = machdep_sys_chroot(&buf)) < OK)
- {
- SET_ERRNO(-ret);
- }
- else
- strncpy(name,uname->sysname, len);
- return(ret);
-}
-#endif
diff --git a/mit-pthreads/net/getnetbyaddr.c b/mit-pthreads/net/getnetbyaddr.c
deleted file mode 100644
index 6fba661c92e..00000000000
--- a/mit-pthreads/net/getnetbyaddr.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getnetbyaddr.c 5.7 (Berkeley) 6/1/90";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-#include <netdb.h>
-#include "net_internal.h"
-
-struct netent *getnetbyaddr(long net, int type)
-{
- char *buf = _net_buf();
-
- if (!buf)
- return NULL;
- return getnetbyaddr_r(net, type, (struct netent *) buf,
- buf + sizeof(struct netent), NET_BUFSIZE);
-}
-
-struct netent *getnetbyaddr_r(long net, int type, struct netent *result,
- char *buf, int bufsize)
-{
- pthread_mutex_lock(&net_iterate_lock);
- setnetent(0);
- while ((result = getnetent_r(result, buf, bufsize)) != NULL) {
- if (result->n_addrtype == type && result->n_net == net)
- break;
- }
- pthread_mutex_unlock(&net_iterate_lock);
- return result;
-}
-
diff --git a/mit-pthreads/net/getnetbyname.c b/mit-pthreads/net/getnetbyname.c
deleted file mode 100644
index 5b044ceb7a7..00000000000
--- a/mit-pthreads/net/getnetbyname.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getnetbyname.c 5.7 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-#include <string.h>
-#include "net_internal.h"
-
-struct netent *getnetbyname(const char *name)
-{
- char *buf = _net_buf();
-
- if (!buf)
- return NULL;
- return getnetbyname_r(name, (struct netent *) buf,
- buf + sizeof(struct netent), NET_BUFSIZE);
-}
-
-struct netent *getnetbyname_r(const char *name, struct netent *result,
- char *buf, int bufsize)
-{
- char **alias;
-
- pthread_mutex_lock(&net_iterate_lock);
- setnetent(0);
- while ((result = getnetent_r(result, buf, bufsize)) != NULL) {
- /* Check the entry's name and aliases against the given name. */
- if (strcmp(result->n_name, name) == 0)
- break;
- for (alias = result->n_aliases; *alias != 0; alias++) {
- if (strcmp(*alias, name) == 0)
- break;
- }
- }
- pthread_mutex_unlock(&net_iterate_lock);
- return result;
-}
-
diff --git a/mit-pthreads/net/getnetent.c b/mit-pthreads/net/getnetent.c
deleted file mode 100644
index 05af0b09159..00000000000
--- a/mit-pthreads/net/getnetent.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getnetent.c 5.8 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include "net_internal.h"
-
-static pthread_mutex_t net_file_lock = PTHREAD_MUTEX_INITIALIZER;
-static int net_file_stayopen;
-static FILE *net_file;
-
-void setnetent(int stayopen)
-{
- pthread_mutex_lock(&net_file_lock);
- net_file_stayopen |= stayopen;
- if (net_file)
- rewind(net_file);
- else
- net_file = fopen(_PATH_NETWORKS, "r");
- pthread_mutex_unlock(&net_file_lock);
-}
-
-void endnetent()
-{
- pthread_mutex_lock(&net_file_lock);
- if (net_file)
- fclose(net_file);
- pthread_mutex_unlock(&net_file_lock);
-}
-
-struct netent *getnetent()
-{
- char *buf = _net_buf();
-
- return getnetent_r((struct netent *) buf, buf + sizeof(struct netent),
- NET_BUFSIZE);
-}
-
-struct netent *getnetent_r(struct netent *result, char *buf, int bufsize)
-{
- char *p, *q, **alias;
- int l;
-
- errno = 0;
- pthread_mutex_lock(&net_file_lock);
- if (net_file == NULL && (net_file = fopen(_PATH_NETWORKS, "r")) == NULL) {
- pthread_mutex_unlock(&net_file_lock);
- return NULL;
- }
- while (fgets(buf, bufsize, net_file)) {
- if (*buf == '#')
- continue;
- p = strpbrk(buf, "#\n");
- if (p == NULL)
- continue;
- *p = '\0';
- l = strlen(buf) + 1;
- result->n_name = buf;
- p = strpbrk(buf, " \t");
- if (p == NULL)
- continue;
- *p++ = '\0';
- while (*p == ' ' || *p == '\t')
- p++;
- q = strpbrk(p, " \t");
- if (q != NULL)
- *q++ = '\0';
- if (SP(SP(buf, char, l), char *, 1) > buf + bufsize) {
- errno = ERANGE;
- break;
- }
- result->n_net = inet_network(p);
- result->n_addrtype = AF_INET;
- result->n_aliases = (char **) ALIGN(buf + l, char *);
- alias = result->n_aliases;
- if (q != NULL) {
- p = q;
- while (p && *p) {
- if (*p == ' ' || *p == '\t') {
- p++;
- continue;
- }
- if ((char *) &alias[2] > buf + bufsize) {
- errno = ERANGE;
- break;
- }
- *alias++ = p;
- p = strpbrk(p, " \t");
- if (p != NULL)
- *p++ = '\0';
- }
- if (p && *p)
- break;
- }
- *alias = NULL;
- pthread_mutex_unlock(&net_file_lock);
- return result;
- }
-
- pthread_mutex_unlock(&net_file_lock);
- return NULL;
-}
-
diff --git a/mit-pthreads/net/getproto.c b/mit-pthreads/net/getproto.c
deleted file mode 100644
index f6313bf1510..00000000000
--- a/mit-pthreads/net/getproto.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getproto.c 5.6 (Berkeley) 6/1/90";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-#include <netdb.h>
-#include "proto_internal.h"
-
-struct protoent *getprotobynumber(int proto)
-{
- char *buf = _proto_buf();
-
- if (!buf)
- return NULL;
- return getprotobynumber_r(proto, (struct protoent *) buf,
- buf + sizeof(struct protoent), PROTO_BUFSIZE);
-}
-
-struct protoent *getprotobynumber_r(int proto, struct protoent *result,
- char *buf, int bufsize)
-{
- pthread_mutex_lock(&proto_iterate_lock);
- setprotoent(0);
- while ((result = getprotoent_r(result, buf, bufsize)) != NULL) {
- if (result->p_proto == proto)
- break;
- }
- pthread_mutex_unlock(&proto_iterate_lock);
- return result;
-}
-
diff --git a/mit-pthreads/net/getprotoent.c b/mit-pthreads/net/getprotoent.c
deleted file mode 100644
index 8bd8d95ec14..00000000000
--- a/mit-pthreads/net/getprotoent.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getprotoent.c 5.8 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include "proto_internal.h"
-
-static pthread_mutex_t proto_file_lock = PTHREAD_MUTEX_INITIALIZER;
-static int proto_file_stayopen;
-static FILE *proto_file;
-
-void setprotoent(int stayopen)
-{
- pthread_mutex_lock(&proto_file_lock);
- proto_file_stayopen |= stayopen;
- if (proto_file)
- rewind(proto_file);
- else
- proto_file = fopen(_PATH_PROTOCOLS, "r");
- pthread_mutex_unlock(&proto_file_lock);
-}
-
-void endprotoent()
-{
- pthread_mutex_lock(&proto_file_lock);
- if (proto_file)
- fclose(proto_file);
- pthread_mutex_unlock(&proto_file_lock);
-}
-
-struct protoent *getprotoent()
-{
- char *buf = _proto_buf();
-
- return getprotoent_r((struct protoent *) buf,
- buf + sizeof(struct protoent), PROTO_BUFSIZE);
-}
-
-struct protoent *getprotoent_r(struct protoent *result, char *buf, int bufsize)
-{
- char *p, *q, **alias;
- int l;
-
- errno = 0;
- pthread_mutex_lock(&proto_file_lock);
- if (proto_file == NULL && !(proto_file = fopen(_PATH_PROTOCOLS, "r"))) {
- pthread_mutex_unlock(&proto_file_lock);
- return NULL;
- }
- while (fgets(buf, bufsize, proto_file)) {
- if (*buf == '#')
- continue;
- p = strpbrk(buf, "#\n");
- if (p == NULL)
- continue;
- *p = '\0';
- l = strlen(buf) + 1;
- result->p_name = buf;
- p = strpbrk(buf, " \t");
- if (p == NULL)
- continue;
- *p++ = '\0';
- while (*p == ' ' || *p == '\t')
- p++;
- q = strpbrk(p, " \t");
- if (q != NULL)
- *q++ = '\0';
- if (SP(SP(buf, char, l), char *, 1) > buf + bufsize) {
- errno = ERANGE;
- break;
- }
- result->p_proto = atoi(p);
- result->p_aliases = (char **) ALIGN(buf + l, char *);
- alias = result->p_aliases;
- if (q != NULL) {
- p = q;
- while (p && *p) {
- if (*p == ' ' || *p == '\t') {
- p++;
- continue;
- }
- if ((char *) &alias[2] > buf + bufsize) {
- errno = ERANGE;
- break;
- }
- *alias++ = p;
- p = strpbrk(p, " \t");
- if (p != NULL)
- *p++ = '\0';
- }
- if (p && *p)
- break;
- }
- *alias = NULL;
- pthread_mutex_unlock(&proto_file_lock);
- return result;
- }
-
- pthread_mutex_unlock(&proto_file_lock);
- return NULL;
-}
-
diff --git a/mit-pthreads/net/getprotoname.c b/mit-pthreads/net/getprotoname.c
deleted file mode 100644
index 7bd7b925091..00000000000
--- a/mit-pthreads/net/getprotoname.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getprotoname.c 5.7 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <netdb.h>
-#include <string.h>
-#include "proto_internal.h"
-
-struct protoent *getprotobyname(const char *name)
-{
- char *buf = _proto_buf();
-
- if (!buf)
- return NULL;
- return getprotobyname_r(name, (struct protoent *) buf,
- buf + sizeof(struct protoent), PROTO_BUFSIZE);
-}
-
-struct protoent *getprotobyname_r(const char *name, struct protoent *result,
- char *buf, int bufsize)
-{
- char **alias;
-
- pthread_mutex_lock(&proto_iterate_lock);
- setprotoent(0);
- while ((result = getprotoent_r(result, buf, bufsize)) != NULL) {
- /* Check the entry's name and aliases against the given name. */
- if (strcmp(result->p_name, name) == 0)
- break;
- for (alias = result->p_aliases; *alias != 0; alias++) {
- if (strcmp(*alias, name) == 0)
- break;
- }
- }
- pthread_mutex_unlock(&proto_iterate_lock);
- return result;
-}
-
diff --git a/mit-pthreads/net/getservbyname.c b/mit-pthreads/net/getservbyname.c
deleted file mode 100644
index f482b544fd0..00000000000
--- a/mit-pthreads/net/getservbyname.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getservbyname.c 5.7 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <netdb.h>
-#include <string.h>
-#include "serv_internal.h"
-
-struct servent *getservbyname(const char *name, const char *proto)
-{
- char *buf = _serv_buf();
-
- if (!buf)
- return NULL;
- return getservbyname_r(name, proto, (struct servent *) buf,
- buf + sizeof(struct servent), SERV_BUFSIZE);
-}
-
-struct servent *getservbyname_r(const char *name, const char *proto,
- struct servent *result, char *buf, int bufsize)
-{
- char **alias;
-
- pthread_mutex_lock(&serv_iterate_lock);
- setservent(0);
- while ((result = getservent_r(result, buf, bufsize)) != NULL) {
- /* Check the entry's name and aliases against the given name. */
- if (strcmp(result->s_name, name) != 0) {
- for (alias = result->s_aliases; *alias != NULL; alias++) {
- if (strcmp(*alias, name) == 0)
- break;
- }
- if (*alias == NULL)
- continue;
- }
- if (proto == NULL || strcmp(result->s_proto, proto) == 0)
- break;
- }
- pthread_mutex_unlock(&serv_iterate_lock);
- return result;
-}
-
diff --git a/mit-pthreads/net/getservbyport.c b/mit-pthreads/net/getservbyport.c
deleted file mode 100644
index e3418212c0b..00000000000
--- a/mit-pthreads/net/getservbyport.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getservbyport.c 5.7 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-#include <netdb.h>
-#include <string.h>
-#include "serv_internal.h"
-
-struct servent *getservbyport(int port, const char *proto)
-{
- char *buf = _serv_buf();
-
- if (!buf)
- return NULL;
- return getservbyport_r(port, proto, (struct servent *) buf,
- buf + sizeof(struct servent), SERV_BUFSIZE);
-}
-
-struct servent *getservbyport_r(int port, const char *proto,
- struct servent *result, char *buf, int bufsize)
-{
- pthread_mutex_lock(&serv_iterate_lock);
- setservent(0);
- while ((result = getservent_r(result, buf, bufsize)) != NULL) {
- if (result->s_port != port)
- continue;
- if (proto == NULL || strcmp(result->s_proto, proto) == 0)
- break;
- }
- pthread_mutex_unlock(&serv_iterate_lock);
- return result;
-}
-
diff --git a/mit-pthreads/net/getservent.c b/mit-pthreads/net/getservent.c
deleted file mode 100644
index b0a7e039f69..00000000000
--- a/mit-pthreads/net/getservent.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getservent.c 5.9 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include "serv_internal.h"
-
-static pthread_mutex_t serv_file_lock = PTHREAD_MUTEX_INITIALIZER;
-static int serv_file_stayopen=0;
-static FILE *serv_file=NULL;
-
-void setservent(int stayopen)
-{
- pthread_mutex_lock(&serv_file_lock);
- serv_file_stayopen |= stayopen;
- if (serv_file)
- rewind(serv_file);
- else
- serv_file = fopen(_PATH_SERVICES, "r");
- pthread_mutex_unlock(&serv_file_lock);
-}
-
-void endservent()
-{
- pthread_mutex_lock(&serv_file_lock);
- if (serv_file)
- {
- fclose(serv_file);
- serv_file=NULL;
- }
- pthread_mutex_unlock(&serv_file_lock);
-}
-
-struct servent *getservent()
-{
- char *buf = _serv_buf();
-
- return getservent_r((struct servent *) buf, buf + sizeof(struct servent),
- SERV_BUFSIZE);
-}
-
-struct servent *getservent_r(struct servent *result, char *buf, int bufsize)
-{
- char *p, *q, **alias;
- int l;
-
- errno = 0;
- pthread_mutex_lock(&serv_file_lock);
- if (serv_file == NULL && !(serv_file = fopen(_PATH_SERVICES, "r"))) {
- pthread_mutex_unlock(&serv_file_lock);
- return NULL;
- }
- while (fgets(buf, bufsize, serv_file)) {
- if (*buf == '#')
- continue;
- p = strpbrk(buf, "#\n");
- if (p == NULL)
- continue;
- *p = '\0';
- l = strlen(buf) + 1;
- result->s_name = buf;
- q = strpbrk(buf, " \t");
- if (q == NULL)
- continue;
- *q++ = '\0';
- while (*q == ' ' || *q == '\t')
- q++;
- p = strpbrk(q, ",/");
- if (p == NULL)
- continue;
- *p++ = '\0';
- if (SP(SP(buf, char, l), char *, 1) > buf + bufsize) {
- errno = ERANGE;
- break;
- }
- result->s_port = htons((u_short)atoi(q));
- result->s_proto = p;
- result->s_aliases = (char **) ALIGN(buf + l, char *);
- alias = result->s_aliases;
- p = strpbrk(p, " \t");
- if (p != NULL)
- *p++ = '\0';
- while (p && *p) {
- if (*p == ' ' || *p == '\t') {
- p++;
- continue;
- }
- if ((char *) &alias[2] > buf + bufsize) {
- errno = ERANGE;
- break;
- }
- *alias++ = p;
- p = strpbrk(p, " \t");
- if (p != NULL)
- *p++ = '\0';
- }
- *alias = NULL;
- pthread_mutex_unlock(&serv_file_lock);
- return result;
- }
-
- pthread_mutex_unlock(&serv_file_lock);
- return NULL;
-}
-
diff --git a/mit-pthreads/net/herror.c b/mit-pthreads/net/herror.c
deleted file mode 100644
index 935c8e7ea38..00000000000
--- a/mit-pthreads/net/herror.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1987 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)herror.c 6.6 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <netdb.h>
-#include <unistd.h>
-#include <string.h>
-#include <resolv.h>
-
-char *h_errlist[] = {
- "Error 0",
- "Unknown host", /* 1 HOST_NOT_FOUND */
- "Host name lookup failure", /* 2 TRY_AGAIN */
- "Unknown server error", /* 3 NO_RECOVERY */
- "No address associated with name", /* 4 NO_ADDRESS */
-};
-int h_nerr = { sizeof(h_errlist)/sizeof(h_errlist[0]) };
-
-/*
- * herror --
- * print the error indicated by the h_errno value.
- */
-void
-herror(s)
- const char *s;
-{
- struct iovec iov[4];
- register struct iovec *v = iov;
- int error = h_errno;
-
- if (s && *s) {
- v->iov_base = (char *)s;
- v->iov_len = strlen(s);
- v++;
- v->iov_base = ": ";
- v->iov_len = 2;
- v++;
- }
- v->iov_base = ((unsigned int)(error) < h_nerr) ?
- h_errlist[error] : "Unknown error";
- v->iov_len = strlen(v->iov_base);
- v++;
- v->iov_base = "\n";
- v->iov_len = 1;
- writev(STDERR_FILENO, iov, (v - iov) + 1);
-}
-
-char *
-hstrerror(err)
- int err;
-{
- return ((unsigned int)(err) < h_nerr) ? h_errlist[err]
- : "Unknown resolver error";
-}
-
diff --git a/mit-pthreads/net/inet_addr.c b/mit-pthreads/net/inet_addr.c
deleted file mode 100644
index 75ca154d4c2..00000000000
--- a/mit-pthreads/net/inet_addr.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 1983, 1990 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)inet_addr.c 5.10 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <ctype.h>
-
-#ifndef INADDR_NONE
-#define INADDR_NONE 0xffffffff
-#endif
-/*
- * Ascii internet address interpretation routine.
- * The value returned is in network order.
- */
-pthread_ipaddr_type
-inet_addr(cp)
- register const char *cp;
-{
- struct in_addr val;
-
- if (inet_aton(cp, &val))
- return (val.s_addr);
- return (INADDR_NONE);
-}
-
-/*
- * Check whether "cp" is a valid ascii representation
- * of an Internet address and convert to a binary address.
- * Returns 1 if the address is valid, 0 if not.
- * This replaces inet_addr, the return value from which
- * cannot distinguish between failure and a local broadcast address.
- */
-
-inet_aton(cp, addr)
- const register char *cp;
- struct in_addr *addr;
-{
- pthread_ipaddr_type parts[4], *pp = parts;
- pthread_ipaddr_type val, base, n;
- register char c;
-
- for (;;) {
- /*
- * Collect number up to ``.''.
- * Values are specified as for C:
- * 0x=hex, 0=octal, other=decimal.
- */
- val = 0; base = 10;
- if (*cp == '0') {
- if (*++cp == 'x' || *cp == 'X')
- base = 16, cp++;
- else
- base = 8;
- }
- while ((c = *cp) != '\0') {
- if (isascii(c) && isdigit(c)) {
- val = (val * base) + (c - '0');
- cp++;
- continue;
- }
- if (base == 16 && isascii(c) && isxdigit(c)) {
- val = (val << 4) +
- (c + 10 - (islower(c) ? 'a' : 'A'));
- cp++;
- continue;
- }
- break;
- }
- if (*cp == '.') {
- /*
- * Internet format:
- * a.b.c.d
- * a.b.c (with c treated as 16-bits)
- * a.b (with b treated as 24 bits)
- */
- if (pp >= parts + 3 || val > 0xff)
- return (0);
- *pp++ = val, cp++;
- } else
- break;
- }
- /*
- * Check for trailing characters.
- */
- if (*cp && (!isascii(*cp) || !isspace(*cp)))
- return (0);
- /*
- * Concoct the address according to
- * the number of parts specified.
- */
- n = pp - parts + 1;
- switch (n) {
-
- case 1: /* a -- 32 bits */
- break;
-
- case 2: /* a.b -- 8.24 bits */
- if (val > 0xffffff)
- return (0);
- val |= parts[0] << 24;
- break;
-
- case 3: /* a.b.c -- 8.8.16 bits */
- if (val > 0xffff)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16);
- break;
-
- case 4: /* a.b.c.d -- 8.8.8.8 bits */
- if (val > 0xff)
- return (0);
- val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
- break;
- }
- if (addr)
- addr->s_addr = htonl(val);
- return (1);
-}
-
diff --git a/mit-pthreads/net/inet_lnaof.c b/mit-pthreads/net/inet_lnaof.c
deleted file mode 100644
index 752a5f03f79..00000000000
--- a/mit-pthreads/net/inet_lnaof.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)inet_lnaof.c 5.7 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Return the local network address portion of an
- * internet address; handles class a/b/c network
- * number formats.
- */
-pthread_ipaddr_type
-inet_lnaof(in)
- struct in_addr in;
-{
- register pthread_ipaddr_type i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return ((i)&IN_CLASSA_HOST);
- else if (IN_CLASSB(i))
- return ((i)&IN_CLASSB_HOST);
- else
- return ((i)&IN_CLASSC_HOST);
-}
diff --git a/mit-pthreads/net/inet_makeaddr.c b/mit-pthreads/net/inet_makeaddr.c
deleted file mode 100644
index a4995e2b4c4..00000000000
--- a/mit-pthreads/net/inet_makeaddr.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)inet_makeaddr.c 5.6 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Formulate an Internet address from network + host. Used in
- * building addresses stored in the ifnet structure.
- */
-struct in_addr
-inet_makeaddr(net, host)
- pthread_ipaddr_type net, host;
-{
- pthread_ipaddr_type addr;
-
- if (net < 128)
- addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
- else if (net < 65536)
- addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
- else if (net < 16777216L)
- addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
- else
- addr = net | host;
- addr = htonl(addr);
- return (*(struct in_addr *)&addr);
-}
diff --git a/mit-pthreads/net/inet_netof.c b/mit-pthreads/net/inet_netof.c
deleted file mode 100644
index 40d3f4c3385..00000000000
--- a/mit-pthreads/net/inet_netof.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)inet_netof.c 5.7 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/*
- * Return the network number from an internet
- * address; handles class a/b/c network #'s.
- */
-pthread_ipaddr_type
-inet_netof(in)
- struct in_addr in;
-{
- register pthread_ipaddr_type i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
- else if (IN_CLASSB(i))
- return (((i)&IN_CLASSB_NET) >> IN_CLASSB_NSHIFT);
- else
- return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
-}
diff --git a/mit-pthreads/net/inet_network.c b/mit-pthreads/net/inet_network.c
deleted file mode 100644
index cc0f1b4e603..00000000000
--- a/mit-pthreads/net/inet_network.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)inet_network.c 5.8 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <ctype.h>
-
-#ifndef INADDR_NONE
-#define INADDR_NONE 0xffffffff
-#endif
-/*
- * Internet network address interpretation routine.
- * The library routines call this routine to interpret
- * network numbers.
- */
-pthread_ipaddr_type
-inet_network(cp)
- register const char *cp;
-{
- pthread_ipaddr_type parts[4], *pp = parts;
- pthread_ipaddr_type val, base, n;
- register char c;
- register int i;
-
-again:
- val = 0; base = 10;
- if (*cp == '0')
- base = 8, cp++;
- if (*cp == 'x' || *cp == 'X')
- base = 16, cp++;
- while (c = *cp) {
- if (isdigit(c)) {
- val = (val * base) + (c - '0');
- cp++;
- continue;
- }
- if (base == 16 && isxdigit(c)) {
- val = (val << 4) + (c + 10 - (islower(c) ? 'a' : 'A'));
- cp++;
- continue;
- }
- break;
- }
- if (*cp == '.') {
- if (pp >= parts + 4)
- return (INADDR_NONE);
- *pp++ = val, cp++;
- goto again;
- }
- if (*cp && !isspace(*cp))
- return (INADDR_NONE);
- *pp++ = val;
- n = pp - parts;
- if (n > 4)
- return (INADDR_NONE);
- for (val = 0, i = 0; i < n; i++) {
- val <<= 8;
- val |= parts[i] & 0xff;
- }
- return (val);
-}
diff --git a/mit-pthreads/net/inet_ntoa.c b/mit-pthreads/net/inet_ntoa.c
deleted file mode 100644
index cd206afcf2a..00000000000
--- a/mit-pthreads/net/inet_ntoa.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)inet_ntoa.c 5.6 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Convert network-format internet address
- * to base 256 d.d.d.d representation.
- */
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-char *inet_ntoa(struct in_addr in)
-{
- static pthread_mutex_t inet_ntoa_mutex = PTHREAD_MUTEX_INITIALIZER;
- static pthread_key_t inet_ntoa_key = -1;
- char *buf, *inet_ntoa_r();
-
- if (inet_ntoa_key < 0) {
- pthread_mutex_lock(&inet_ntoa_mutex);
- if (inet_ntoa_key < 0) {
- if (pthread_key_create(&inet_ntoa_key, free) < 0) {
- pthread_mutex_unlock(&inet_ntoa_mutex);
- return(NULL);
- }
- }
- pthread_mutex_unlock(&inet_ntoa_mutex);
- }
- if ((buf = pthread_getspecific(inet_ntoa_key)) == NULL) {
- if ((buf = (char *) malloc(18)) == NULL) {
- return(NULL);
- }
- pthread_setspecific(inet_ntoa_key, buf);
- }
- return inet_ntoa_r(in, buf, 18);
-}
-
-char *inet_ntoa_r(struct in_addr in, char *buf, int bufsize)
-{
- register char *p;
-
- p = (char *)&in;
-#define UC(b) (((int)b)&0xff)
- (void)snprintf(buf, bufsize,
- "%d.%d.%d.%d", UC(p[0]), UC(p[1]), UC(p[2]), UC(p[3]));
- return (buf);
-}
-
diff --git a/mit-pthreads/net/net_internal.c b/mit-pthreads/net/net_internal.c
deleted file mode 100644
index 2c25ff76693..00000000000
--- a/mit-pthreads/net/net_internal.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)net_internal.c 6.22 (Berkeley) 3/19/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "net_internal.h"
-
-static void _net_init_global(void);
-
-pthread_mutex_t net_iterate_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_once_t init_once = PTHREAD_ONCE_INIT;
-static pthread_key_t key;
-static int init_status;
-
-/* Performs global initialization. */
-char *_net_buf()
-{
- char *buf;
-
- /* Make sure the global initializations have been done. */
- pthread_once(&init_once, _net_init_global);
-
- /* Initialize thread-specific data for this thread if it hasn't
- * been done already. */
- buf = (char *) pthread_getspecific(key);
- if (!buf) {
- buf = (char *) malloc(NET_BUFSIZE);
- if (buf == NULL)
- return NULL;
- if (pthread_setspecific(key, buf) < 0) {
- free(buf);
- return NULL;
- }
- }
- return buf;
-}
-
-static void _net_init_global()
-{
- init_status = pthread_key_create(&key, free);
-}
-
diff --git a/mit-pthreads/net/net_internal.h b/mit-pthreads/net/net_internal.h
deleted file mode 100644
index 0dc5c866e5d..00000000000
--- a/mit-pthreads/net/net_internal.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)net_internal.h 6.22 (Berkeley) 3/19/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#ifndef _NET_INTERNAL_H
-#define _NET_INTERNAL_H
-
-#include <pthread.h>
-#include <netdb.h>
-#include <resolv.h>
-
-#define NET_BUFSIZE 4096
-#undef ALIGN
-#define ALIGN(p, t) ((char *)(((((long)(p) - 1) / sizeof(t)) + 1) * sizeof(t)))
-#define SP(p, t, n) (ALIGN(p, t) + (n) * sizeof(t))
-
-extern pthread_mutex_t net_iterate_lock;
-
-__BEGIN_DECLS
-char *_net_buf(void);
-__END_DECLS
-
-#endif
-
diff --git a/mit-pthreads/net/proto_internal.c b/mit-pthreads/net/proto_internal.c
deleted file mode 100644
index db3ab04ec77..00000000000
--- a/mit-pthreads/net/proto_internal.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)proto_internal.c 6.22 (Berkeley) 3/19/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "proto_internal.h"
-
-static void _proto_init_global(void);
-
-pthread_mutex_t proto_iterate_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_once_t init_once = PTHREAD_ONCE_INIT;
-static pthread_key_t key;
-static int init_status;
-
-/* Performs global initialization. */
-char *_proto_buf()
-{
- char *buf;
-
- /* Make sure the global initializations have been done. */
- pthread_once(&init_once, _proto_init_global);
-
- /* Initialize thread-specific data for this thread if it hasn't
- * been done already. */
- buf = (char *) pthread_getspecific(key);
- if (!buf) {
- buf = (char *) malloc(PROTO_BUFSIZE);
- if (buf == NULL)
- return NULL;
- if (pthread_setspecific(key, buf) < 0) {
- free(buf);
- return NULL;
- }
- }
- return buf;
-}
-
-static void _proto_init_global()
-{
- init_status = pthread_key_create(&key, free);
-}
-
diff --git a/mit-pthreads/net/proto_internal.h b/mit-pthreads/net/proto_internal.h
deleted file mode 100644
index 4ed06883f25..00000000000
--- a/mit-pthreads/net/proto_internal.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)proto_internal.h 6.22 (Berkeley) 3/19/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#ifndef _PROTO_INTERNAL_H
-#define _PROTO_INTERNAL_H
-
-#include <pthread.h>
-#include <netdb.h>
-#include <resolv.h>
-
-#define PROTO_BUFSIZE 4096
-#undef ALIGN
-#define ALIGN(p, t) ((char *)(((((long)(p) - 1) / sizeof(t)) + 1) * sizeof(t)))
-#define SP(p, t, n) (ALIGN(p, t) + (n) * sizeof(t))
-
-extern pthread_mutex_t proto_iterate_lock;
-
-__BEGIN_DECLS
-char *_proto_buf(void);
-__END_DECLS
-
-#endif
-
diff --git a/mit-pthreads/net/res_comp.c b/mit-pthreads/net/res_comp.c
deleted file mode 100644
index 45a4bcafed2..00000000000
--- a/mit-pthreads/net/res_comp.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)res_comp.c 6.22 (Berkeley) 3/19/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/param.h>
-#include <sys/cdefs.h>
-#include <netinet/in.h>
-#include <resolv.h>
-#include <stdio.h>
-
-static dn_find();
-
-/*
- * Expand compressed domain name 'comp_dn' to full domain name.
- * 'msg' is a pointer to the begining of the message,
- * 'eomorig' points to the first location after the message,
- * 'exp_dn' is a pointer to a buffer of size 'length' for the result.
- * Return size of compressed name or -1 if there was an error.
- */
-dn_expand(msg, eomorig, comp_dn, exp_dn, length)
- const u_char *msg, *eomorig, *comp_dn;
- u_char *exp_dn;
- int length;
-{
- register u_char *cp, *dn;
- register int n, c;
- u_char *eom;
- int len = -1, checked = 0;
-
- dn = exp_dn;
- cp = (u_char *)comp_dn;
- eom = exp_dn + length;
- /*
- * fetch next label in domain name
- */
- while (n = *cp++) {
- /*
- * Check for indirection
- */
- switch (n & INDIR_MASK) {
- case 0:
- if (dn != exp_dn) {
- if (dn >= eom)
- return (-1);
- *dn++ = '.';
- }
- if (dn+n >= eom)
- return (-1);
- checked += n + 1;
- while (--n >= 0) {
- if ((c = *cp++) == '.') {
- if (dn + n + 2 >= eom)
- return (-1);
- *dn++ = '\\';
- }
- *dn++ = c;
- if (cp >= eomorig) /* out of range */
- return(-1);
- }
- break;
-
- case INDIR_MASK:
- if (len < 0)
- len = cp - comp_dn + 1;
- cp = (u_char *)msg + (((n & 0x3f) << 8) | (*cp & 0xff));
- if (cp < msg || cp >= eomorig) /* out of range */
- return(-1);
- checked += 2;
- /*
- * Check for loops in the compressed name;
- * if we've looked at the whole message,
- * there must be a loop.
- */
- if (checked >= eomorig - msg)
- return (-1);
- break;
-
- default:
- return (-1); /* flag error */
- }
- }
- *dn = '\0';
- if (len < 0)
- len = cp - comp_dn;
- return (len);
-}
-
-/*
- * Compress domain name 'exp_dn' into 'comp_dn'.
- * Return the size of the compressed name or -1.
- * 'length' is the size of the array pointed to by 'comp_dn'.
- * 'dnptrs' is a list of pointers to previous compressed names. dnptrs[0]
- * is a pointer to the beginning of the message. The list ends with NULL.
- * 'lastdnptr' is a pointer to the end of the arrary pointed to
- * by 'dnptrs'. Side effect is to update the list of pointers for
- * labels inserted into the message as we compress the name.
- * If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr'
- * is NULL, we don't update the list.
- */
-dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr)
- const u_char *exp_dn;
- u_char *comp_dn, **dnptrs, **lastdnptr;
- int length;
-{
- register u_char *cp, *dn;
- register int c, l;
- u_char **cpp, **lpp, *sp, *eob;
- u_char *msg;
-
- dn = (u_char *)exp_dn;
- cp = comp_dn;
- eob = cp + length;
- if (dnptrs != NULL) {
- if ((msg = *dnptrs++) != NULL) {
- for (cpp = dnptrs; *cpp != NULL; cpp++)
- ;
- lpp = cpp; /* end of list to search */
- }
- } else
- msg = NULL;
- for (c = *dn++; c != '\0'; ) {
- /* look to see if we can use pointers */
- if (msg != NULL) {
- if ((l = dn_find(dn-1, msg, dnptrs, lpp)) >= 0) {
- if (cp+1 >= eob)
- return (-1);
- *cp++ = (l >> 8) | INDIR_MASK;
- *cp++ = l % 256;
- return (cp - comp_dn);
- }
- /* not found, save it */
- if (lastdnptr != NULL && cpp < lastdnptr-1) {
- *cpp++ = cp;
- *cpp = NULL;
- }
- }
- sp = cp++; /* save ptr to length byte */
- do {
- if (c == '.') {
- c = *dn++;
- break;
- }
- if (c == '\\') {
- if ((c = *dn++) == '\0')
- break;
- }
- if (cp >= eob) {
- if (msg != NULL)
- *lpp = NULL;
- return (-1);
- }
- *cp++ = c;
- } while ((c = *dn++) != '\0');
- /* catch trailing '.'s but not '..' */
- if ((l = cp - sp - 1) == 0 && c == '\0') {
- cp--;
- break;
- }
- if (l <= 0 || l > MAXLABEL) {
- if (msg != NULL)
- *lpp = NULL;
- return (-1);
- }
- *sp = l;
- }
- if (cp >= eob) {
- if (msg != NULL)
- *lpp = NULL;
- return (-1);
- }
- *cp++ = '\0';
- return (cp - comp_dn);
-}
-
-/*
- * Skip over a compressed domain name. Return the size or -1.
- */
-__dn_skipname(comp_dn, eom)
- const u_char *comp_dn, *eom;
-{
- register u_char *cp;
- register int n;
-
- cp = (u_char *)comp_dn;
- while (cp < eom && (n = *cp++)) {
- /*
- * check for indirection
- */
- switch (n & INDIR_MASK) {
- case 0: /* normal case, n == len */
- cp += n;
- continue;
- case INDIR_MASK: /* indirection */
- cp++;
- break;
- default: /* illegal type */
- return (-1);
- }
- break;
- }
- if (cp > eom)
- return -1;
- return (cp - comp_dn);
-}
-
-/*
- * Search for expanded name from a list of previously compressed names.
- * Return the offset from msg if found or -1.
- * dnptrs is the pointer to the first name on the list,
- * not the pointer to the start of the message.
- */
-static int
-dn_find(exp_dn, msg, dnptrs, lastdnptr)
- u_char *exp_dn, *msg;
- u_char **dnptrs, **lastdnptr;
-{
- register u_char *dn, *cp, **cpp;
- register int n;
- u_char *sp;
-
- for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
- dn = exp_dn;
- sp = cp = *cpp;
- while (n = *cp++) {
- /*
- * check for indirection
- */
- switch (n & INDIR_MASK) {
- case 0: /* normal case, n == len */
- while (--n >= 0) {
- if (*dn == '.')
- goto next;
- if (*dn == '\\')
- dn++;
- if (*dn++ != *cp++)
- goto next;
- }
- if ((n = *dn++) == '\0' && *cp == '\0')
- return (sp - msg);
- if (n == '.')
- continue;
- goto next;
-
- default: /* illegal type */
- return (-1);
-
- case INDIR_MASK: /* indirection */
- cp = msg + (((n & 0x3f) << 8) | *cp);
- }
- }
- if (*dn == '\0')
- return (sp - msg);
- next: ;
- }
- return (-1);
-}
-
-/*
- * Routines to insert/extract short/long's. Must account for byte
- * order and non-alignment problems. This code at least has the
- * advantage of being portable.
- *
- * used by sendmail.
- */
-
-u_short
-_getshort(msgp)
- register const u_char *msgp;
-{
- register u_short u;
-
- GETSHORT(u, msgp);
- return (u);
-}
-
-pthread_ipaddr_type
-_getlong(msgp)
- const u_char *msgp;
-{
- pthread_ipaddr_type u;
-
- GETLONG(u, msgp);
- return (u);
-}
-
-void
-#ifdef __STDC__
-__putshort(register u_short s, register u_char *msgp)
-#else
- __putshort(s, msgp)
- register u_short s;
- register u_char *msgp;
-#endif
-{
- PUTSHORT(s, msgp);
-}
-
-void
-__putlong(l, msgp)
- register pthread_ipaddr_type l;
- register u_char *msgp;
-{
- PUTLONG(l, msgp);
-}
-
diff --git a/mit-pthreads/net/res_debug.c b/mit-pthreads/net/res_debug.c
deleted file mode 100644
index 3e2084fccf8..00000000000
--- a/mit-pthreads/net/res_debug.c
+++ /dev/null
@@ -1,749 +0,0 @@
-/*
- * Copyright (c) 1985, 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies, and that
- * the name of Digital Equipment Corporation not be used in advertising or
- * publicity pertaining to distribution of the document or software without
- * specific, written prior permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
- * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/param.h>
-#include <stdio.h>
-#include <string.h>
-#include <resolv.h>
-#include <arpa/inet.h>
-
-void __fp_query();
-char *__p_class(), *__p_time(), *__p_type();
-char *p_cdname(), *p_fqname(), *p_rr();
-static char *p_option __P_((u_long));
-
-char *_res_opcodes[] = {
- "QUERY",
- "IQUERY",
- "CQUERYM",
- "CQUERYU",
- "4",
- "5",
- "6",
- "7",
- "8",
- "UPDATEA",
- "UPDATED",
- "UPDATEDA",
- "UPDATEM",
- "UPDATEMA",
- "ZONEINIT",
- "ZONEREF",
-};
-
-char *_res_resultcodes[] = {
- "NOERROR",
- "FORMERR",
- "SERVFAIL",
- "NXDOMAIN",
- "NOTIMP",
- "REFUSED",
- "6",
- "7",
- "8",
- "9",
- "10",
- "11",
- "12",
- "13",
- "14",
- "NOCHANGE",
-};
-
-static char retbuf[16];
-
-static char *
-dewks(wks)
- int wks;
-{
- switch (wks) {
- case 5: return("rje");
- case 7: return("echo");
- case 9: return("discard");
- case 11: return("systat");
- case 13: return("daytime");
- case 15: return("netstat");
- case 17: return("qotd");
- case 19: return("chargen");
- case 20: return("ftp-data");
- case 21: return("ftp");
- case 23: return("telnet");
- case 25: return("smtp");
- case 37: return("time");
- case 39: return("rlp");
- case 42: return("name");
- case 43: return("whois");
- case 53: return("domain");
- case 57: return("apts");
- case 59: return("apfs");
- case 67: return("bootps");
- case 68: return("bootpc");
- case 69: return("tftp");
- case 77: return("rje");
- case 79: return("finger");
- case 87: return("link");
- case 95: return("supdup");
- case 100: return("newacct");
- case 101: return("hostnames");
- case 102: return("iso-tsap");
- case 103: return("x400");
- case 104: return("x400-snd");
- case 105: return("csnet-ns");
- case 109: return("pop-2");
- case 111: return("sunrpc");
- case 113: return("auth");
- case 115: return("sftp");
- case 117: return("uucp-path");
- case 119: return("nntp");
- case 121: return("erpc");
- case 123: return("ntp");
- case 133: return("statsrv");
- case 136: return("profile");
- case 144: return("NeWS");
- case 161: return("snmp");
- case 162: return("snmp-trap");
- case 170: return("print-srv");
- default: (void) sprintf(retbuf, "%d", wks); return(retbuf);
- }
-}
-
-static char *
-deproto(protonum)
- int protonum;
-{
- switch (protonum) {
- case 1: return("icmp");
- case 2: return("igmp");
- case 3: return("ggp");
- case 5: return("st");
- case 6: return("tcp");
- case 7: return("ucl");
- case 8: return("egp");
- case 9: return("igp");
- case 11: return("nvp-II");
- case 12: return("pup");
- case 16: return("chaos");
- case 17: return("udp");
- default: (void) sprintf(retbuf, "%d", protonum); return(retbuf);
- }
-}
-
-static char *
-do_rrset(msg, cp, cnt, pflag, file, hs)
- int cnt, pflag;
- char *cp,*msg, *hs;
- FILE *file;
-{
- int n;
- int sflag;
- /*
- * Print answer records
- */
- sflag = (_res.pfcode & pflag);
- if (n = ntohs(cnt)) {
- if ((!_res.pfcode) || ((sflag) && (_res.pfcode & RES_PRF_HEAD1)))
- fprintf(file, hs);
- while (--n >= 0) {
- cp = p_rr(cp, msg, file);
- if ((cp-msg) > PACKETSZ)
- return (NULL);
- }
- if ((!_res.pfcode) || ((sflag) && (_res.pfcode & RES_PRF_HEAD1)))
- putc('\n', file);
- }
- return(cp);
-}
-
-__p_query(msg)
- char *msg;
-{
- __fp_query(msg, stdout);
-}
-
-/*
- * Print the current options.
- * This is intended to be primarily a debugging routine.
- */
-void
-__fp_resstat(statp, file)
- struct __res_state *statp;
- FILE *file;
-{
- int bit;
-
- fprintf(file, ";; res options:");
- if (!statp)
- statp = &_res;
- for (bit = 0; bit < 32; bit++) { /* XXX 32 - bad assumption! */
- if (statp->options & (1<<bit))
- fprintf(file, " %s", p_option(1<<bit));
- }
- putc('\n', file);
-}
-
-/*
- * Print the contents of a query.
- * This is intended to be primarily a debugging routine.
- */
-void
-__fp_query(msg,file)
- char *msg;
- FILE *file;
-{
- register char *cp;
- register HEADER *hp;
- register int n;
-
- /*
- * Print header fields.
- */
- hp = (HEADER *)msg;
- cp = msg + sizeof(HEADER);
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEADX) || hp->rcode) {
- fprintf(file,";; ->>HEADER<<- opcode: %s, status: %s, id: %d",
- _res_opcodes[hp->opcode],
- _res_resultcodes[hp->rcode],
- ntohs(hp->id));
- putc('\n', file);
- }
- putc(';', file);
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEAD2)) {
- fprintf(file,"; flags:");
- if (hp->qr)
- fprintf(file," qr");
- if (hp->aa)
- fprintf(file," aa");
- if (hp->tc)
- fprintf(file," tc");
- if (hp->rd)
- fprintf(file," rd");
- if (hp->ra)
- fprintf(file," ra");
- if (hp->pr)
- fprintf(file," pr");
- }
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEAD1)) {
- fprintf(file,"; Ques: %d", ntohs(hp->qdcount));
- fprintf(file,", Ans: %d", ntohs(hp->ancount));
- fprintf(file,", Auth: %d", ntohs(hp->nscount));
- fprintf(file,", Addit: %d", ntohs(hp->arcount));
- }
-#if 1
- if ((!_res.pfcode) || (_res.pfcode &
- (RES_PRF_HEADX | RES_PRF_HEAD2 | RES_PRF_HEAD1))) {
- putc('\n',file);
- }
-#endif
- /*
- * Print question records.
- */
- if (n = ntohs(hp->qdcount)) {
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES))
- fprintf(file,";; QUESTIONS:\n");
- while (--n >= 0) {
- fprintf(file,";;\t");
- cp = p_cdname(cp, msg, file);
- if (cp == NULL)
- return;
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES))
- fprintf(file, ", type = %s",
- __p_type(_getshort(cp)));
- cp += sizeof(u_short);
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES))
- fprintf(file, ", class = %s\n",
- __p_class(_getshort(cp)));
- cp += sizeof(u_short);
- putc('\n', file);
- }
- }
- /*
- * Print authoritative answer records
- */
- cp = do_rrset(msg, cp, hp->ancount, RES_PRF_ANS, file,
- ";; ANSWERS:\n");
- if (cp == NULL)
- return;
-
- /*
- * print name server records
- */
- cp = do_rrset(msg, cp, hp->nscount, RES_PRF_AUTH, file,
- ";; AUTHORITY RECORDS:\n");
- if (!cp)
- return;
-
- /*
- * print additional records
- */
- cp = do_rrset(msg, cp, hp->arcount, RES_PRF_ADD, file,
- ";; ADDITIONAL RECORDS:\n");
- if (!cp)
- return;
-}
-
-char *
-p_cdname(cp, msg, file)
- char *cp, *msg;
- FILE *file;
-{
- char name[MAXDNAME];
- int n;
-
- if ((n = dn_expand((u_char *)msg, (u_char *)cp + MAXCDNAME,
- (u_char *)cp, (u_char *)name, sizeof(name))) < 0)
- return (NULL);
- if (name[0] == '\0')
- putc('.', file);
- else
- fputs(name, file);
- return (cp + n);
-}
-
-char *
-p_fqname(cp, msg, file)
- char *cp, *msg;
- FILE *file;
-{
- char name[MAXDNAME];
- int n, len;
-
- if ((n = dn_expand((u_char *)msg, (u_char *)cp + MAXCDNAME,
- (u_char *)cp, (u_char *)name, sizeof(name))) < 0)
- return (NULL);
- if (name[0] == '\0') {
- putc('.', file);
- } else {
- fputs(name, file);
- if (name[strlen(name) - 1] != '.')
- putc('.', file);
- }
- return (cp + n);
-}
-
-/*
- * Print resource record fields in human readable form.
- *
- * Removed calls to non-reentrant routines to simplify varifying
- * POSIX thread-safe implementations. (mevans).
- */
-char *
-p_rr(cp, msg, file)
- char *cp, *msg;
- FILE *file;
-{
- int type, class, dlen, n, c;
- struct in_addr inaddr;
- char *cp1, *cp2;
- u_long tmpttl, t;
- int lcnt;
- char buf[32];
-
- if ((cp = p_fqname(cp, msg, file)) == NULL)
- return (NULL); /* compression error */
- type = _getshort(cp);
- cp += sizeof(u_short);
- class = _getshort(cp);
- cp += sizeof(u_short);
- tmpttl = _getlong(cp);
- cp += sizeof(u_long);
- dlen = _getshort(cp);
- cp += sizeof(u_short);
- cp1 = cp;
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_TTLID))
- fprintf(file, "\t%lu", tmpttl);
- if ((!_res.pfcode) || (_res.pfcode & RES_PRF_CLASS))
- fprintf(file, "\t%s", __p_class(class));
- fprintf(file, "\t%s", __p_type(type));
- /*
- * Print type specific data, if appropriate
- */
- switch (type) {
- case T_A:
- switch (class) {
- case C_IN:
- case C_HS:
- bcopy(cp, (char *)&inaddr, sizeof(inaddr));
- if (dlen == 4) {
- fprintf(file,"\t%s",
- inet_ntoa_r(inaddr, buf, sizeof(buf)));
- cp += dlen;
- } else if (dlen == 7) {
- char *address;
- u_char protocol;
- u_short port;
-
- address = inet_ntoa_r(inaddr,
- buf, sizeof(buf));
- cp += sizeof(inaddr);
- protocol = *(u_char*)cp;
- cp += sizeof(u_char);
- port = _getshort(cp);
- cp += sizeof(u_short);
- fprintf(file, "\t%s\t; proto %d, port %d",
- address, protocol, port);
- }
- break;
- default:
- cp += dlen;
- }
- break;
- case T_CNAME:
- case T_MB:
- case T_MG:
- case T_MR:
- case T_NS:
- case T_PTR:
- putc('\t', file);
- cp = p_fqname(cp, msg, file);
- break;
-
- case T_HINFO:
- if (n = *cp++) {
- fprintf(file,"\t%.*s", n, cp);
- cp += n;
- }
- if (n = *cp++) {
- fprintf(file,"\t%.*s", n, cp);
- cp += n;
- }
- break;
-
- case T_SOA:
- putc('\t', file);
- cp = p_fqname(cp, msg, file); /* origin */
- putc(' ', file);
- cp = p_fqname(cp, msg, file); /* mail addr */
- fputs(" (\n", file);
- t = _getlong(cp); cp += sizeof(u_long);
- fprintf(file,"\t\t\t%lu\t; serial\n", t);
- t = _getlong(cp); cp += sizeof(u_long);
- fprintf(file,"\t\t\t%lu\t; refresh (%s)\n", t, __p_time(t));
- t = _getlong(cp); cp += sizeof(u_long);
- fprintf(file,"\t\t\t%lu\t; retry (%s)\n", t, __p_time(t));
- t = _getlong(cp); cp += sizeof(u_long);
- fprintf(file,"\t\t\t%lu\t; expire (%s)\n", t, __p_time(t));
- t = _getlong(cp); cp += sizeof(u_long);
- fprintf(file,"\t\t\t%lu )\t; minimum (%s)", t, __p_time(t));
- break;
-
- case T_MX:
- case T_AFSDB:
- fprintf(file,"\t%d ", _getshort(cp));
- cp += sizeof(u_short);
- cp = p_fqname(cp, msg, file);
- break;
-
- case T_TXT:
- (void) fputs("\t\"", file);
- cp2 = cp1 + dlen;
- while (cp < cp2) {
- if (n = (unsigned char) *cp++) {
- for (c = n; c > 0 && cp < cp2; c--)
- if (*cp == '\n') {
- (void) putc('\\', file);
- (void) putc(*cp++, file);
- } else
- (void) putc(*cp++, file);
- }
- }
- putc('"', file);
- break;
-
- case T_MINFO:
- case T_RP:
- putc('\t', file);
- cp = p_fqname(cp, msg, file);
- putc(' ', file);
- cp = p_fqname(cp, msg, file);
- break;
-
- case T_UINFO:
- putc('\t', file);
- fputs(cp, file);
- cp += dlen;
- break;
-
- case T_UID:
- case T_GID:
- if (dlen == 4) {
- fprintf(file,"\t%u", _getlong(cp));
- cp += sizeof(long);
- }
- break;
-
- case T_WKS:
- if (dlen < sizeof(u_long) + 1)
- break;
- bcopy(cp, (char *)&inaddr, sizeof(inaddr));
- cp += sizeof(u_long);
- fprintf(file, "\t%s %s ( ",
- inet_ntoa_r(inaddr, buf, sizeof(buf)),
- deproto((int) *cp));
- cp += sizeof(u_char);
- n = 0;
- lcnt = 0;
- while (cp < cp1 + dlen) {
- c = *cp++;
- do {
- if (c & 0200) {
- if (lcnt == 0) {
- fputs("\n\t\t\t", file);
- lcnt = 5;
- }
- fputs(dewks(n), file);
- putc(' ', file);
- lcnt--;
- }
- c <<= 1;
- } while (++n & 07);
- }
- putc(')', file);
- break;
-
-#ifdef ALLOW_T_UNSPEC
- case T_UNSPEC:
- {
- int NumBytes = 8;
- char *DataPtr;
- int i;
-
- if (dlen < NumBytes) NumBytes = dlen;
- fprintf(file, "\tFirst %d bytes of hex data:",
- NumBytes);
- for (i = 0, DataPtr = cp; i < NumBytes; i++, DataPtr++)
- fprintf(file, " %x", *DataPtr);
- cp += dlen;
- }
- break;
-#endif /* ALLOW_T_UNSPEC */
-
- default:
- fprintf(file,"\t?%d?", type);
- cp += dlen;
- }
-#if 0
- fprintf(file, "\t; dlen=%d, ttl %s\n", dlen, __p_time(tmpttl));
-#else
- putc('\n', file);
-#endif
- if (cp - cp1 != dlen) {
- fprintf(file,";; packet size error (found %d, dlen was %d)\n",
- cp - cp1, dlen);
- cp = NULL;
- }
- return (cp);
-}
-
-static char nbuf[40];
-
-/*
- * Return a string for the type
- */
-char *
-__p_type(type)
- int type;
-{
- switch (type) {
- case T_A:
- return("A");
- case T_NS: /* authoritative server */
- return("NS");
- case T_CNAME: /* canonical name */
- return("CNAME");
- case T_SOA: /* start of authority zone */
- return("SOA");
- case T_MB: /* mailbox domain name */
- return("MB");
- case T_MG: /* mail group member */
- return("MG");
- case T_MR: /* mail rename name */
- return("MR");
- case T_NULL: /* null resource record */
- return("NULL");
- case T_WKS: /* well known service */
- return("WKS");
- case T_PTR: /* domain name pointer */
- return("PTR");
- case T_HINFO: /* host information */
- return("HINFO");
- case T_MINFO: /* mailbox information */
- return("MINFO");
- case T_MX: /* mail routing info */
- return("MX");
- case T_TXT: /* text */
- return("TXT");
- case T_RP: /* responsible person */
- return("RP");
- case T_AFSDB: /* AFS cell database */
- return("AFSDB");
- case T_AXFR: /* zone transfer */
- return("AXFR");
- case T_MAILB: /* mail box */
- return("MAILB");
- case T_MAILA: /* mail address */
- return("MAILA");
- case T_ANY: /* matches any type */
- return("ANY");
- case T_UINFO:
- return("UINFO");
- case T_UID:
- return("UID");
- case T_GID:
- return("GID");
-#ifdef ALLOW_T_UNSPEC
- case T_UNSPEC:
- return("UNSPEC");
-#endif /* ALLOW_T_UNSPEC */
-
- default:
- (void)sprintf(nbuf, "%d", type);
- return(nbuf);
- }
-}
-
-/*
- * Return a mnemonic for class
- */
-char *
-__p_class(class)
- int class;
-{
-
- switch (class) {
- case C_IN: /* internet class */
- return("IN");
- case C_HS: /* hesiod class */
- return("HS");
- case C_ANY: /* matches any class */
- return("ANY");
- default:
- (void)sprintf(nbuf, "%d", class);
- return(nbuf);
- }
-}
-
-/*
- * Return a mnemonic for an option
- */
-static char *
-p_option(option)
- u_long option;
-{
- switch (option) {
- case RES_INIT: return "init";
- case RES_DEBUG: return "debug";
- case RES_AAONLY: return "aaonly";
- case RES_USEVC: return "usevc";
- case RES_PRIMARY: return "primry";
- case RES_IGNTC: return "igntc";
- case RES_RECURSE: return "recurs";
- case RES_DEFNAMES: return "defnam";
- case RES_STAYOPEN: return "styopn";
- case RES_DNSRCH: return "dnsrch";
- default: sprintf(nbuf, "?0x%x?", option); return nbuf;
- }
-}
-
-/*
- * Return a mnemonic for a time to live
- */
-char *
-__p_time(value)
- u_long value;
-{
- int secs, mins, hours, days;
- register char *p;
-
- if (value == 0) {
- strcpy(nbuf, "0 secs");
- return(nbuf);
- }
-
- secs = value % 60;
- value /= 60;
- mins = value % 60;
- value /= 60;
- hours = value % 24;
- value /= 24;
- days = value;
- value = 0;
-
-#define PLURALIZE(x) x, (x == 1) ? "" : "s"
- p = nbuf;
- if (days) {
- (void)sprintf(p, "%d day%s", PLURALIZE(days));
- while (*++p);
- }
- if (hours) {
- if (days)
- *p++ = ' ';
- (void)sprintf(p, "%d hour%s", PLURALIZE(hours));
- while (*++p);
- }
- if (mins) {
- if (days || hours)
- *p++ = ' ';
- (void)sprintf(p, "%d min%s", PLURALIZE(mins));
- while (*++p);
- }
- if (secs || ! (days || hours || mins)) {
- if (days || hours || mins)
- *p++ = ' ';
- (void)sprintf(p, "%d sec%s", PLURALIZE(secs));
- }
- return(nbuf);
-}
diff --git a/mit-pthreads/net/res_init.c b/mit-pthreads/net/res_init.c
deleted file mode 100644
index 0a5c944c974..00000000000
--- a/mit-pthreads/net/res_init.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)res_init.c 6.22 (Berkeley) 3/19/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <resolv.h>
-#include <netdb.h>
-#include "res_internal.h"
-
-int res_init()
-{
- if (_res_init()) {
- return 0;
- } else {
- /* Due to clever tricks in _res_init(), a check for h_errno will
- * return NO_RECOVERY even if the next try at initialization
- * succeeds, so it's okay that we can't set an error value here. */
- return -1;
- }
-}
-
diff --git a/mit-pthreads/net/res_internal.c b/mit-pthreads/net/res_internal.c
deleted file mode 100644
index 4eab65bf5aa..00000000000
--- a/mit-pthreads/net/res_internal.c
+++ /dev/null
@@ -1,576 +0,0 @@
-/*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)res_internal.c 6.22 (Berkeley) 3/19/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <resolv.h>
-#include <netdb.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <errno.h>
-#include "res_internal.h"
-
-#define DEFAULT_RETRIES 4
-
-pthread_mutex_t host_iterate_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_once_t init_once = PTHREAD_ONCE_INIT;
-static pthread_key_t key;
-static int init_status;
-
-static void _res_init_global(void);
-static void set_options(const char *options, const char *source);
-static pthread_ipaddr_type net_mask(struct in_addr in);
-static int qcomp(const void *arg1, const void *arg2);
-
-static struct __res_state start;
-/* We want to define _res for partial binary compatibility with libraries. */
-#undef _res
-struct __res_state _res = {
- RES_TIMEOUT, /* retransmition time interval */
- 4, /* number of times to retransmit */
- RES_DEFAULT, /* options flags */
- 1, /* number of name servers */
-};
-
-struct hostent *_res_parse_answer(querybuf *answer, int anslen, int iquery,
- struct hostent *result, char *buf,
- int bufsize, int *errval)
-{
- struct res_data *data = _res_init();
- register HEADER *hp;
- register u_char *cp;
- register int n;
- u_char *eom;
- char *aliases[__NETDB_MAXALIASES], *addrs[__NETDB_MAXADDRS];
- char *bp = buf, **ap = aliases, **hap = addrs;
- int type, class, ancount, qdcount, getclass = C_ANY, iquery_done = 0;
-
- eom = answer->buf + anslen;
- /*
- * find first satisfactory answer
- */
- hp = &answer->hdr;
- ancount = ntohs(hp->ancount);
- qdcount = ntohs(hp->qdcount);
- bp = buf;
- cp = answer->buf + sizeof(HEADER);
-
- /* Read in the hostname if this is an address lookup. */
- if (qdcount) {
- if (iquery) {
- if ((n = dn_expand((u_char *) answer->buf,
- (u_char *) eom, (u_char *) cp, (u_char *) bp,
- bufsize - (bp - buf))) < 0) {
- *errval = NO_RECOVERY;
- return ((struct hostent *) NULL);
- }
- cp += n + QFIXEDSZ;
- result->h_name = bp;
- bp += strlen(bp) + 1;
- } else {
- cp += __dn_skipname(cp, eom) + QFIXEDSZ;
- }
- while (--qdcount > 0)
- cp += __dn_skipname(cp, eom) + QFIXEDSZ;
- } else if (iquery) {
- *errval = (hp->aa) ? HOST_NOT_FOUND : TRY_AGAIN;
- return ((struct hostent *) NULL);
- }
-
- /* Read in the answers. */
- *ap = NULL;
- *hap = NULL;
- while (--ancount >= 0 && cp < eom) {
- if ((n = dn_expand((u_char *) answer->buf, (u_char *) eom,
- (u_char *) cp, (u_char *) bp,
- bufsize - (bp - buf))) < 0)
- break;
- cp += n;
- type = _getshort(cp);
- cp += sizeof(u_short);
- class = _getshort(cp);
- cp += sizeof(u_short) + sizeof(pthread_ipaddr_type);
- n = _getshort(cp);
- cp += sizeof(u_short);
- if (type == T_CNAME) {
- cp += n;
- if (ap >= aliases + __NETDB_MAXALIASES - 1)
- continue;
- *ap++ = bp;
- bp += strlen(bp) + 1;
- continue;
- }
- if (iquery && type == T_PTR) {
- if ((n = dn_expand((u_char *) answer->buf, (u_char *) eom,
- (u_char *) cp, (u_char *) bp,
- bufsize - (bp - buf))) < 0)
- break;
- cp += n;
- result->h_name = bp;
- bp += strlen(bp) + 1;
- iquery_done = 1;
- break;
- }
- if (iquery || type != T_A) {
-#ifdef DEBUG_RESOLVER
- if (data->state.options & RES_DEBUG)
- printf("unexpected answer type %d, size %d\n",
- type, n);
-#endif
- cp += n;
- continue;
- }
- if (hap > addrs) {
- if (n != result->h_length) {
- cp += n;
- continue;
- }
- if (class != getclass) {
- cp += n;
- continue;
- }
- } else {
- result->h_length = n;
- getclass = class;
- result->h_addrtype = (class == C_IN) ? AF_INET : AF_UNSPEC;
- if (!iquery) {
- result->h_name = bp;
- bp += strlen(bp) + 1;
- }
- }
- bp = ALIGN(bp, pthread_ipaddr_type);
- if (bp + n >= buf + bufsize) {
- errno = ERANGE;
- return NULL;
- }
- memcpy(bp, cp, n);
- cp += n;
- if (hap >= addrs + __NETDB_MAXADDRS - 1)
- continue;
- *hap++ = bp;
- bp += n;
- cp += n;
- }
-
- if (hap > addrs || iquery_done) {
- *ap++ = NULL;
- *hap++ = NULL;
- if (data->state.nsort)
- qsort(addrs, hap - addrs, sizeof(struct in_addr), qcomp);
- if (SP(bp, char *, (hap - addrs) + (ap - aliases)) > buf + bufsize) {
- errno = ERANGE;
- return NULL;
- }
- result->h_addr_list = (char **) ALIGN(bp, char *);
- memcpy(result->h_addr_list, addrs, (hap - addrs) * sizeof(char *));
- result->h_aliases = result->h_addr_list + (hap - addrs);
- memcpy(result->h_aliases, aliases, (ap - aliases) * sizeof(char *));
- return result;
- } else {
- *errval = TRY_AGAIN;
- return NULL;
- }
-}
-
-/* Performs global initialization. */
-struct res_data *_res_init()
-{
- struct res_data *data;
-
- /* Make sure the global initializations have been done. */
- pthread_once(&init_once, _res_init_global);
- if (init_status < 0)
- return NULL;
-
- /* Initialize thread-specific data for this thread if it hasn't
- * been done already. */
- data = (struct res_data *) pthread_getspecific(key);
- if (!data) {
- data = (struct res_data *) malloc(sizeof(struct res_data));
- if (data == NULL)
- return NULL;
- if (pthread_setspecific(key, data) < 0) {
- free(data);
- return NULL;
- }
- data->buf = NULL;
- data->state = start;
- data->errval = NO_RECOVERY;
- data->sock = -1;
- }
- return data;
-}
-
-static void _res_init_global()
-{
- int result;
- char line[BUFSIZ], buf[BUFSIZ], *domain, *p, *net;
- int i, localdomain_set = 0, num_servers = 0, num_sorts = 0;
- FILE *fp;
- struct in_addr addr;
-
- /* Assume an error state until we finish. */
- init_status = -1;
-
- /* Initialize the key for thread-specific data. */
- result = pthread_key_create(&key, free);
- if (result < 0)
- return;
-
- /* Initialize starting state. */
- start.retrans = RES_TIMEOUT;
- start.retry = DEFAULT_RETRIES;
- start.options = RES_DEFAULT;
- start.id = 0;
- start.nscount = 1;
- start.nsaddr.sin_addr.s_addr = INADDR_ANY;
- start.nsaddr.sin_family = AF_INET;
- start.nsaddr.sin_port = htons(NAMESERVER_PORT);
- start.nscount = 1;
- start.ndots = 1;
- start.pfcode = 0;
- strncpy(start.lookups, "f", sizeof(start.lookups));
-
- /* Look for a LOCALDOMAIN definition. */
- domain = getenv("LOCALDOMAIN");
- if (domain != NULL) {
- strncpy(start.defdname, domain, sizeof(start.defdname));
- domain = start.defdname;
- localdomain_set = 1;
-
- /* Construct a search path from the LOCALDOMAIN value, which is
- * a space-separated list of strings. For backwards-compatibility,
- * a newline terminates the list. */
- i = 0;
- while (*domain && i < MAXDNSRCH) {
- start.dnsrch[i] = domain;
- while (*domain && !isspace(*domain))
- domain++;
- if (!*domain || *domain == '\n') {
- *domain = 0;
- break;
- }
- *domain++ = 0;
- while (isspace(*domain))
- domain++;
- i++;
- }
- }
-
- /* Look for a config file and read it in. */
- fp = fopen(_PATH_RESCONF, "r");
- if (fp != NULL) {
- strncpy(start.lookups, "bf", sizeof(start.lookups));
-
- /* Read in the configuration file. */
- while (fgets(line, sizeof(line), fp)) {
-
- /* Ignore blank lines and comments. */
- if (*line == ';' || *line == '#' || !*line)
- continue;
-
- if (strncmp(line, "domain", 6) == 0) {
-
- /* Read in the default domain, and initialize a one-
- * element search path. Skip the domain line if we
- * already got one from the LOCALDOMAIN environment
- * variable. */
- if (localdomain_set)
- continue;
-
- /* Look for the next word in the line. */
- p = line + 6;
- while (*p == ' ' || *p == '\t')
- p++;
- if (!*p || *p == '\n')
- continue;
-
- /* Copy in the domain, and null-terminate it at the
- * first tab or newline. */
- strncpy(start.defdname, p, sizeof(start.defdname) - 1);
- p = strpbrk(start.defdname, "\t\n");
- if (p)
- *p = 0;
-
- start.dnsrch[0] = start.defdname;
- start.dnsrch[1] = NULL;
-
- } else if (strncmp(line, "lookup", 6) == 0) {
-
- /* Get a list of lookup types. */
- memset(start.lookups, 0, sizeof(start.lookups));
-
- /* Find the next word in the line. */
- p = line + 6;
- while (isspace(*p))
- p++;
-
- i = 0;
- while (*p && i < MAXDNSLUS) {
- /* Add a lookup type. */
- if (*p == 'y' || *p == 'b' || *p == 'f')
- start.lookups[i++] = *p;
-
- /* Find the next word. */
- while (*p && !isspace(*p))
- p++;
- while (isspace(*p))
- p++;
- }
-
- } else if (strncmp(line, "search", 6) == 0) {
-
- /* Read in a space-separated list of domains to search
- * when a name is not fully-qualified. Skip this line
- * if the LOCALDOMAIN environment variable was set. */
- if (localdomain_set)
- continue;
-
- /* Look for the next word on the line. */
- p = line + 6;
- while (*p == ' ' || *p == '\t')
- p++;
- if (!*p || *p == '\n')
- continue;
-
- /* Copy the rest of the line into start.defdname. */
- strncpy(start.defdname, p, sizeof(start.defdname) - 1);
- domain = start.defdname;
- p = strchr(domain, '\n');
- if (*p)
- *p = 0;
-
- /* Construct a search path from the line, which is a
- * space-separated list of strings. */
- i = 0;
- while (*domain && i < MAXDNSRCH) {
- start.dnsrch[i] = domain;
- while (*domain && !isspace(*domain))
- domain++;
- if (!*domain || *domain == '\n') {
- *domain = 0;
- break;
- }
- *domain++ = 0;
- while (isspace(*domain))
- domain++;
- i++;
- }
-
- } else if (strncmp(line, "nameserver", 10) == 0) {
-
- /* Add an address to the list of name servers we can
- * connect to. */
-
- /* Look for the next word in the line. */
- p = line + 10;
- while (*p == ' ' || *p == '\t')
- p++;
- if (*p && *p != '\n' && inet_aton(p, &addr)) {
- start.nsaddr_list[num_servers].sin_addr = addr;
- start.nsaddr_list[num_servers].sin_family = AF_INET;
- start.nsaddr_list[num_servers].sin_port =
- htons(NAMESERVER_PORT);
- if (++num_servers >= MAXNS)
- break;
- }
-
- } else if (strncmp(line, "sortlist", 8) == 0) {
-
- p = line + 8;
- while (num_sorts < MAXRESOLVSORT) {
-
- /* Find the next word in the line. */
- p = line + 8;
- while (*p == ' ' || *p == '\t')
- p++;
-
- /* Read in an IP address and netmask. */
- if (sscanf(p, "%[0-9./]s", buf) != 1)
- break;
- net = strchr(buf, '/');
- if (net)
- *net = 0;
-
- /* Translate the address into an IP address
- * and netmask. */
- if (inet_aton(buf, &addr)) {
- start.sort_list[num_sorts].addr = addr;
- if (net && inet_aton(net + 1, &addr)) {
- start.sort_list[num_sorts].mask = addr.s_addr;
- } else {
- start.sort_list[num_sorts].mask =
- net_mask(start.sort_list[num_sorts].addr);
- }
- num_sorts++;
- }
-
- /* Skip past this word. */
- if (net)
- *net = '/';
- p += strlen(buf);
- }
-
- }
- }
- fclose(fp);
- }
-
- /* If we don't have a default domain, strip off the first
- * component of this machine's domain name, and make a one-
- * element search path consisting of the default domain. */
- if (*start.defdname == 0) {
- if (gethostname(buf, sizeof(start.defdname) - 1) == 0) {
- p = strchr(buf, '.');
- if (p)
- strcpy(start.defdname, p + 1);
- }
- start.dnsrch[0] = start.defdname;
- start.dnsrch[1] = NULL;
- }
-
- p = getenv("RES_OPTIONS");
- if (p)
- set_options(p, "env");
-
- start.options |= RES_INIT;
- _res = start;
- init_status = 0;
-}
-
-static void set_options(const char *options, const char *source)
-{
- const char *p = options;
- int i;
-
- while (*p) {
-
- /* Skip leading and inner runs of spaces. */
- while (*p == ' ' || *p == '\t')
- p++;
-
- /* Search for and process individual options. */
- if (strncmp(p, "ndots:", 6) == 0) {
- i = atoi(p + 6);
- start.ndots = (i <= RES_MAXNDOTS) ? i : RES_MAXNDOTS;
- } else if (!strncmp(p, "debug", 5))
- start.options |= RES_DEBUG;
- else if (!strncmp(p, "usevc", 5))
- start.options |= RES_USEVC;
- else if (!strncmp(p, "stayopen", 8))
- start.options |= RES_STAYOPEN;
-
- /* Skip to next run of spaces */
- while (*p && *p != ' ' && *p != '\t')
- p++;
- }
-}
-
-static pthread_ipaddr_type net_mask(struct in_addr in)
-{
- pthread_ipaddr_type i = ntohl(in.s_addr);
-
- if (IN_CLASSA(i))
- return htonl(IN_CLASSA_NET);
- if (IN_CLASSB(i))
- return htonl(IN_CLASSB_NET);
- return htonl(IN_CLASSC_NET);
-}
-
-/* Get the error value for this thread, or NO_RECOVERY if none has been
- * successfully set. The screw case to worry about here is if
- * __res_init() fails for a resolver routine because it can't allocate
- * or set the thread-specific data, and then __res_init() succeeds here.
- * Because __res_init() sets errval to NO_RECOVERY after a successful
- * initialization, we return NO_RECOVERY in that case, which is correct. */
-int _res_get_error()
-{
- struct res_data *data;
-
- data = _res_init();
- return (data) ? data->errval : NO_RECOVERY;
-}
-
-struct __res_state *_res_status()
-{
- struct res_data *data;
-
- data = _res_init();
- return (data) ? &data->state : NULL;
-}
-
-static int qcomp(const void *arg1, const void *arg2)
-{
- const struct in_addr **a1 = (const struct in_addr **) arg1;
- const struct in_addr **a2 = (const struct in_addr **) arg2;
- struct __res_state *state = _res_status();
-
- int pos1, pos2;
-
- for (pos1 = 0; pos1 < state->nsort; pos1++) {
- if (state->sort_list[pos1].addr.s_addr ==
- ((*a1)->s_addr & state->sort_list[pos1].mask))
- break;
- }
- for (pos2 = 0; pos2 < state->nsort; pos2++) {
- if (state->sort_list[pos2].addr.s_addr ==
- ((*a2)->s_addr & state->sort_list[pos2].mask))
- break;
- }
- return pos1 - pos2;
-}
-
-/*
- * This routine is for closing the socket if a virtual circuit is used and
- * the program wants to close it. We don't use this routine, but libc
- * might reference it.
- *
- * This routine is not expected to be user visible.
- */
-void _res_close()
-{
- struct res_data *data;
-
- data = _res_init();
- if (data && data->sock != -1) {
- (void) close(data->sock);
- data->sock = -1;
- }
-}
diff --git a/mit-pthreads/net/res_internal.h b/mit-pthreads/net/res_internal.h
deleted file mode 100644
index 24e70278644..00000000000
--- a/mit-pthreads/net/res_internal.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)res_internal.h 6.22 (Berkeley) 3/19/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#ifndef _RES_INTERNAL_H
-#define _RES_INTERNAL_H
-
-#include <pthread.h>
-#include <netdb.h>
-#include <resolv.h>
-
-#define HOST_BUFSIZE 4096
-#undef ALIGN
-#define ALIGN(p, t) ((char *)(((((long)(p) - 1) / sizeof(t)) + 1) * sizeof(t)))
-#define SP(p, t, n) (ALIGN(p, t) + (n) * sizeof(t))
-
-struct res_data {
- char *buf;
- struct __res_state state;
- int errval;
- int sock;
-};
-
-#if PACKETSZ > 1024
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 1024
-#endif
-
-typedef union {
- HEADER hdr;
- unsigned char buf[MAXPACKET];
-} querybuf;
-
-typedef union {
- long al;
- char ac;
-} align;
-
-extern pthread_mutex_t host_iterate_lock;
-
-__BEGIN_DECLS
-struct hostent *_res_parse_answer(querybuf *answer, int anslen, int iquery,
- struct hostent *result, char *buf,
- int buflen, int *errval);
-void _res_set_error(int val);
-struct res_data *_res_init(void);
-__END_DECLS
-
-#endif
-
diff --git a/mit-pthreads/net/res_mkquery.c b/mit-pthreads/net/res_mkquery.c
deleted file mode 100644
index 42f27318368..00000000000
--- a/mit-pthreads/net/res_mkquery.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)res_mkquery.c 6.16 (Berkeley) 3/6/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/param.h>
-#include <sys/cdefs.h>
-#include <netinet/in.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <string.h>
-
-/*
- * Form all types of queries.
- * Returns the size of the result or -1.
- */
-res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
- int op; /* opcode of query */
- const char *dname; /* domain name */
- int class, type; /* class and type of query */
- const char *data; /* resource record data */
- int datalen; /* length of data */
- const char *newrr_in; /* new rr for modify or append */
- char *buf; /* buffer to put query */
- int buflen; /* size of buffer */
-{
- register HEADER *hp;
- register char *cp;
- register int n;
- struct rrec *newrr = (struct rrec *) newrr_in;
- char *dnptrs[10], **dpp, **lastdnptr;
- struct __res_state *_rs;
-
- /*
- * Initialize header fields.
- */
-
- _rs = _res_status();
- if (!_rs)
- return -1;
- if ((buf == NULL) || (buflen < sizeof(HEADER)))
- return(-1);
- memset(buf, 0, sizeof(HEADER));
- hp = (HEADER *) buf;
- hp->id = htons(++_rs->id);
- hp->opcode = op;
- hp->pr = (_rs->options & RES_PRIMARY) != 0;
- hp->rd = (_rs->options & RES_RECURSE) != 0;
- hp->rcode = NOERROR;
- cp = buf + sizeof(HEADER);
- buflen -= sizeof(HEADER);
- dpp = dnptrs;
- *dpp++ = buf;
- *dpp++ = NULL;
- lastdnptr = dnptrs + sizeof(dnptrs)/sizeof(dnptrs[0]);
- /*
- * perform opcode specific processing
- */
- switch (op) {
- case QUERY:
- if ((buflen -= QFIXEDSZ) < 0)
- return(-1);
- if ((n = dn_comp((u_char *)dname, (u_char *)cp, buflen,
- (u_char **)dnptrs, (u_char **)lastdnptr)) < 0)
- return (-1);
- cp += n;
- buflen -= n;
- __putshort(type, (u_char *)cp);
- cp += sizeof(u_short);
- __putshort(class, (u_char *)cp);
- cp += sizeof(u_short);
- hp->qdcount = htons(1);
- if (op == QUERY || data == NULL)
- break;
- /*
- * Make an additional record for completion domain.
- */
- buflen -= RRFIXEDSZ;
- if ((n = dn_comp((u_char *)data, (u_char *)cp, buflen,
- (u_char **)dnptrs, (u_char **)lastdnptr)) < 0)
- return (-1);
- cp += n;
- buflen -= n;
- __putshort(T_NULL, (u_char *)cp);
- cp += sizeof(u_short);
- __putshort(class, (u_char *)cp);
- cp += sizeof(u_short);
- __putlong(0, (u_char *)cp);
- cp += sizeof(pthread_ipaddr_type);
- __putshort(0, (u_char *)cp);
- cp += sizeof(u_short);
- hp->arcount = htons(1);
- break;
-
- case IQUERY:
- /*
- * Initialize answer section
- */
- if (buflen < 1 + RRFIXEDSZ + datalen)
- return (-1);
- *cp++ = '\0'; /* no domain name */
- __putshort(type, (u_char *)cp);
- cp += sizeof(u_short);
- __putshort(class, (u_char *)cp);
- cp += sizeof(u_short);
- __putlong(0, (u_char *)cp);
- cp += sizeof(pthread_ipaddr_type);
- __putshort(datalen, (u_char *)cp);
- cp += sizeof(u_short);
- if (datalen) {
- memcpy(cp, data, datalen);
- cp += datalen;
- }
- hp->ancount = htons(1);
- break;
-
-#ifdef ALLOW_UPDATES
- /*
- * For UPDATEM/UPDATEMA, do UPDATED/UPDATEDA followed by UPDATEA
- * (Record to be modified is followed by its replacement in msg.)
- */
- case UPDATEM:
- case UPDATEMA:
-
- case UPDATED:
- /*
- * The res code for UPDATED and UPDATEDA is the same; user
- * calls them differently: specifies data for UPDATED; server
- * ignores data if specified for UPDATEDA.
- */
- case UPDATEDA:
- buflen -= RRFIXEDSZ + datalen;
- if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
- return (-1);
- cp += n;
- __putshort(type, cp);
- cp += sizeof(u_short);
- __putshort(class, cp);
- cp += sizeof(u_short);
- __putlong(0, cp);
- cp += sizeof(pthread_ipaddr_type);
- __putshort(datalen, cp);
- cp += sizeof(u_short);
- if (datalen) {
- memcpy(cp, data, datalen);
- cp += datalen;
- }
- if ( (op == UPDATED) || (op == UPDATEDA) ) {
- hp->ancount = htons(0);
- break;
- }
- /* Else UPDATEM/UPDATEMA, so drop into code for UPDATEA */
-
- case UPDATEA: /* Add new resource record */
- buflen -= RRFIXEDSZ + datalen;
- if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
- return (-1);
- cp += n;
- __putshort(newrr->r_type, cp);
- cp += sizeof(u_short);
- __putshort(newrr->r_class, cp);
- cp += sizeof(u_short);
- __putlong(0, cp);
- cp += sizeof(pthread_ipaddr_type);
- __putshort(newrr->r_size, cp);
- cp += sizeof(u_short);
- if (newrr->r_size) {
- memcpy(cp, newrr->r_data, newrr->r_size);
- cp += newrr->r_size;
- }
- hp->ancount = htons(0);
- break;
-
-#endif /* ALLOW_UPDATES */
- }
- return (cp - buf);
-}
-
diff --git a/mit-pthreads/net/res_query.c b/mit-pthreads/net/res_query.c
deleted file mode 100644
index 1727e6d1179..00000000000
--- a/mit-pthreads/net/res_query.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)res_query.c 6.22 (Berkeley) 3/19/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <resolv.h>
-#include <netdb.h>
-#include "res_internal.h"
-
-#if PACKETSZ > 1024
-#define MAXPACKET PACKETSZ
-#else
-#define MAXPACKET 1024
-#endif
-
-int res_query(char *name, int class, int type, unsigned char *answer,
- int anslen)
-{
- struct res_data *data;
- char buf[MAXPACKET];
- int result;
- HEADER *hp;
-
- data = _res_init();
- if (!data)
- return -1;
-
- /* Make the query. */
- result = res_mkquery(QUERY, name, class, type, NULL, 0, NULL, buf,
- sizeof(buf));
- if (result <= 0) {
- data->errval = NO_RECOVERY;
- return result;
- }
-
- result = res_send(buf, result, (char *) answer, anslen);
- if (result < 0) {
- data->errval = TRY_AGAIN;
- return result;
- }
-
- hp = (HEADER *) answer;
- if (hp->rcode == NOERROR && ntohs(hp->ancount) != 0)
- return result;
-
- /* Translate the error code and return. */
- switch(hp->rcode) {
- case NOERROR:
- data->errval = NO_DATA;
- break;
- case SERVFAIL:
- data->errval = TRY_AGAIN;
- break;
- case NXDOMAIN:
- data->errval = HOST_NOT_FOUND;
- break;
- default:
- data->errval = NO_RECOVERY;
- break;
- }
- return -1;
-}
-
diff --git a/mit-pthreads/net/res_querydomain.c b/mit-pthreads/net/res_querydomain.c
deleted file mode 100644
index 31beeb7a62c..00000000000
--- a/mit-pthreads/net/res_querydomain.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)res_querydomain.c 6.22 (Berkeley) 3/19/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <resolv.h>
-#include <string.h>
-
-/* For backwards compatibility. */
-int res_querydomain(char *name, char *domain, int class, int type,
- unsigned char *answer, int anslen)
-{
- char buf[2 * MAXDNAME + 2];
- char *longname = buf;
- int len;
-
- if (domain == NULL) {
- /* Check for trailing '.'; copy without '.' if present. */
- len = strlen(name);
- if (len > 0 && name[len - 1] == '.' && len < sizeof(buf)) {
- memcpy(buf, name, len - 1);
- buf[len - 1] = '\0';
- } else {
- longname = name;
- }
- } else {
- sprintf(buf, "%.*s.%.*s", MAXDNAME, name, MAXDNAME, domain);
- }
-
- return (res_query(longname, class, type, answer, anslen));
-}
-
diff --git a/mit-pthreads/net/res_search.c b/mit-pthreads/net/res_search.c
deleted file mode 100644
index 2c84f0d68f3..00000000000
--- a/mit-pthreads/net/res_search.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 1985, 1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)res_search.c 6.45 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <resolv.h>
-#include <netdb.h>
-#include "res_internal.h"
-
-static char *search_aliases(const char *name, char *buf, int bufsize);
-
-int res_search(const char *name, int class, int type, unsigned char *answer,
- int anslen)
-{
- struct res_data *data;
- const char *p;
- int num_dots, len, result, no_data = 0, error;
- char buf[2 * MAXDNAME + 2], *domain, **dptr, *alias;
-
- data = _res_init();
- if (!data)
- return -1;
-
- /* Count the dots in name, and get a pointer to the end of name. */
- num_dots = 0;
- for (p = name; *p; p++) {
- if (*p == '.')
- num_dots++;
- }
- len = p - name;
-
- /* If there aren't any dots, check to see if name is an alias for
- * another host. If so, try the resolved alias as a fully-qualified
- * name. */
- alias = search_aliases(name, buf, sizeof(buf));
- if (alias != NULL)
- return res_query(alias, class, type, answer, anslen);
-
- /* If there's a trailing dot, try to strip it off and query the name. */
- if (len > 0 && p[-1] == '.') {
- if (len > sizeof(buf)) {
- /* It's too long; just query the original name. */
- return res_query(name, class, type, answer, anslen);
- } else {
- /* Copy the name without the trailing dot and query. */
- memcpy(buf, name, len - 1);
- buf[len] = 0;
- return res_query(buf, class, type, answer, anslen);
- }
- }
-
- if (data->state.options & RES_DNSRCH) {
- /* If RES_DNSRCH is set, query all the domains until we get a
- * definitive answer. */
- for (dptr = data->state.dnsrch; *dptr; dptr++) {
- domain = *dptr;
- sprintf(buf, "%.*s.%.*s", MAXDNAME, name, MAXDNAME, domain);
- result = res_query(buf, class, type, answer, anslen);
- if (result > 0)
- return result;
- if (data->errval == NO_DATA)
- no_data = 1;
- else if (data->errval != HOST_NOT_FOUND)
- break;
- }
- } else if (num_dots == 0 && data->state.options & RES_DEFNAMES) {
- /* If RES_DEFNAMES is set and there is no dot, query the default
- * domain. */
- domain = data->state.defdname;
- sprintf(buf, "%.*s.%.%s", MAXDNAME, name, MAXDNAME, domain);
- result = res_query(buf, class, type, answer, anslen);
- if (result > 0)
- return result;
- if (data->errval == NO_DATA)
- no_data = 1;
- }
-
- /* If all the domain queries failed, try the name as fully-qualified.
- * Only do this if there is at least one dot in the name. */
- if (num_dots > 0) {
- result = res_query(name, class, type, answer, anslen);
- if (result > 0)
- return result;
- }
-
- if (no_data)
- data->errval = NO_DATA;
-
- return -1;
-}
-
-static char *search_aliases(const char *name, char *buf, int bufsize)
-{
- FILE *fp;
- char *filename, *p;
- int len;
-
- filename = getenv("HOSTALIASES");
- if (filename == NULL)
- return NULL;
-
- fp = fopen(filename, "r");
- if (fp == NULL)
- return NULL;
-
- len = strlen(name);
- while (fgets(buf, bufsize, fp)) {
-
- /* Get the first word from the buffer. */
- p = buf;
- while (*p && !isspace(*p))
- p++;
- if (!*p)
- break;
-
- /* Null-terminate the first word and compare it with the name. */
- *p = 0;
- if (strcasecmp(buf, name) != 0)
- continue;
-
- p++;
- while (isspace(*p))
- p++;
- fclose(fp);
- return (*p) ? p : NULL;
- }
-
- fclose(fp);
- return NULL;
-}
-
diff --git a/mit-pthreads/net/res_send.c b/mit-pthreads/net/res_send.c
deleted file mode 100644
index 84162e8e387..00000000000
--- a/mit-pthreads/net/res_send.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Copyright (c) 1985, 1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)res_send.c 6.45 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <errno.h>
-#include <resolv.h>
-#include <netdb.h>
-#include <time.h>
-#include <sys/timers.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-#include <netinet/in.h>
-#include "res_internal.h"
-
-enum { SEND_GIVE_UP = -1, SEND_TRY_NEXT = -2, SEND_TRY_SAME = -3,
- SEND_TIMEOUT = -4, SEND_TRUNCATED = -5 };
-
-static int send_datagram(int server, int sock, const char *buf, int buflen,
- char *answer, int anslen, int try,
- struct res_data *data);
-static int send_circuit(int server, const char *buf, int buflen, char *answer,
- int anslen, struct res_data *data);
-static int close_save_errno(int sock);
-
-int res_send(const char *buf, int buflen, char *answer, int anslen)
-{
- struct res_data *data;
- struct sockaddr_in local;
- int use_virtual_circuit, result, udp_sock, have_seen_same, terrno = 0;
- int try, server;
-
- data = _res_init();
- if (!data)
- return -1;
-
- try = 0;
- server = 0;
-
- /* Try doing connectionless queries if appropriate. */
- if (!(data->state.options & RES_USEVC) && buflen <= PACKETSZ) {
- /* Create and bind a local UDP socket. */
- udp_sock = socket(AF_INET, SOCK_DGRAM, 0);
- if (udp_sock < 0)
- return -1;
- local.sin_family = AF_INET;
- local.sin_addr.s_addr = htonl(INADDR_ANY);
- local.sin_port = htons(0);
- if (bind(udp_sock, (struct sockaddr *) &local, sizeof(local)) < 0) {
- close(udp_sock);
- return -1;
- }
-
- /* Cycle through the retries and servers, sending off queries and
- * waiting for responses. */
- for (; try < data->state.retry; try++) {
- for (; server < data->state.nscount; server++) {
- result = send_datagram(server, udp_sock, buf, buflen, answer,
- anslen, try, data);
- if (result == SEND_TIMEOUT)
- terrno = ETIMEDOUT;
- else if (result != SEND_TRY_NEXT)
- break;
- }
- if (server < data->state.nscount)
- break;
- }
-
- close(udp_sock);
- if (result < 0)
- errno = (terrno == ETIMEDOUT) ? ETIMEDOUT : ECONNREFUSED;
- else
- errno = 0;
- if (result != SEND_TRUNCATED)
- return (result >= 0) ? result : -1;
- }
-
- /* Either we have to use the virtual circuit, or the server couldn't
- * fit its response in a UDP packet. Cycle through the retries and
- * servers, sending off queries and waiting for responses. Allow a
- * response of SEND_TRY_SAME to cause an extra retry once. */
- for (; try < data->state.retry; try++) {
- for (; server < data->state.nscount; server++) {
- result = send_circuit(server, buf, buflen, answer, anslen, data);
- terrno = errno;
- if (result == SEND_TRY_SAME) {
- if (!have_seen_same)
- server--;
- have_seen_same = 1;
- } else if (result != SEND_TRY_NEXT) {
- break;
- }
- }
- }
-
- errno = terrno;
- return (result >= 0) ? result : -1;
-}
-
-static int send_datagram(int server, int sock, const char *buf, int buflen,
- char *answer, int anslen, int try,
- struct res_data *data)
-{
- int count, interval;
- struct sockaddr_in local_addr;
- HEADER *request = (HEADER *) buf, *response = (HEADER *) answer;
- struct timespec timeout;
- struct timeval current;
- struct timezone zone;
-
-#ifdef DEBUG_RESOLVER
- if (_res.options & RES_DEBUG) {
- printf("res_send: request:\n");
- __p_query(buf);
- }
-#endif /* DEBUG_RESOLVER */
- /* Send a packet to the server. */
- count = sendto(sock, buf, buflen, 0,
- (struct sockaddr *) &data->state.nsaddr_list[server],
- sizeof(struct sockaddr_in));
-
- if (count != buflen) {
-#ifdef DEBUG_RESOLVER
- if (count < 0){
- if (_res.options & RES_DEBUG)
- perror("send_datagram:sendto");
- }
-#endif /* DEBUG_RESOLVER */
- return SEND_TRY_NEXT;
- }
-
- /* Await a reply with the correct ID. */
- while (1) {
- struct sockaddr_in from;
- int from_len;
-
- from_len = sizeof(from);
- interval = data->state.retrans << try;
- if (try > 0)
- interval /= data->state.nscount;
- gettimeofday(&current, &zone);
- current.tv_sec += interval;
- TIMEVAL_TO_TIMESPEC(&current, &timeout);
- count = recvfrom_timedwait(sock, answer, anslen, 0,
- &from, &from_len, &timeout);
- if (count < 0)
- return SEND_TRY_NEXT;
- /* If the ID is wrong, it's from an old query; ignore it. */
- if (response->id == request->id)
- break;
-#ifdef DEBUG_RESOLVER
- if (_res.options & RES_DEBUG) {
- printf("res_sendto: count=%d, response:\n", count);
- __p_query(answer);
- }
-#endif /* DEBUG_RESOLVER */
- }
-
- /* Report a truncated response unless RES_IGNTC is set. This will
- * cause the res_send() loop to fall back to TCP. */
- if (response->tc && !(data->state.options & RES_IGNTC))
- return SEND_TRUNCATED;
-
- return count;
-}
-
-static int send_circuit(int server, const char *buf, int buflen, char *answer,
- int anslen, struct res_data *data)
-{
- HEADER *response = (HEADER *) answer;
- int sock = -1, result, n, response_len, count;
- unsigned short len;
- struct iovec iov[2];
- char *p, junk[512];
-
- /* If data->sock is valid, then it's an open connection to the
- * first server. Grab it if it's appropriate; close it if not. */
- if (data->sock) {
- if (server == 0)
- sock = data->sock;
- else
- close(data->sock);
- data->sock = -1;
- }
-
- /* Initialize our socket if we didn't grab it from data. */
- if (sock == -1) {
- sock = socket(AF_INET, SOCK_STREAM, 0);
- if (sock < 0)
- return SEND_GIVE_UP;
- result = connect(sock,
- (struct sockaddr *) &data->state.nsaddr_list[server],
- sizeof(struct sockaddr_in));
- if (result < 0) {
- close_save_errno(sock);
- return SEND_TRY_NEXT;
- }
- }
-
- /* Send length and message. */
- len = htons((unsigned short) buflen);
- iov[0].iov_base = (caddr_t) &len;
- iov[0].iov_len = sizeof(len);
- iov[1].iov_base = (char *) buf;
- iov[1].iov_len = buflen;
- if (writev(sock, iov, 2) != sizeof(len) + buflen) {
- close_save_errno(sock);
- return SEND_TRY_NEXT;
- }
-
- /* Receive length. */
- p = (char *) &len;
- n = sizeof(len);
- while (n) {
- count = read(sock, p, n);
- if (count <= 0) {
- /* If we got ECONNRESET, the remote server may have restarted,
- * and we report SEND_TRY_SAME. (The main loop will only
- * allow one of these, so we don't have to worry about looping
- * indefinitely.) */
- close_save_errno(sock);
- return (errno == ECONNRESET) ? SEND_TRY_SAME : SEND_TRY_NEXT;
- }
- p += count;
- n -= count;
- }
- len = ntohs(len);
- response_len = (len > anslen) ? anslen : len;
- len -= response_len;
-
- /* Receive message. */
- p = answer;
- n = response_len;
- while (n) {
- count = read(sock, p, n);
- if (count <= 0) {
- close_save_errno(sock);
- return SEND_TRY_NEXT;
- }
- p += count;
- n -= count;
- }
-
- /* If the reply is longer than our answer buffer, set the truncated
- * bit and flush the rest of the reply, to keep the connection in
- * sync. */
- if (len) {
- response->tc = 1;
- while (len) {
- n = (len > sizeof(junk)) ? sizeof(junk) : len;
- count = read(sock, junk, n);
- if (count <= 0) {
- close_save_errno(sock);
- return response_len;
- }
- len -= count;
- }
- }
-
- /* If this is the first server, and RES_USEVC and RES_STAYOPEN are
- * both set, save the connection. Otherwise, close it. */
- if (server == 0 && (data->state.options & RES_USEVC &&
- data->state.options & RES_STAYOPEN))
- data->sock = sock;
- else
- close_save_errno(sock);
-
- return response_len;
-}
-
-static int close_save_errno(int sock)
-{
- int terrno;
-
- terrno = errno;
- close(sock);
- errno = terrno;
-}
diff --git a/mit-pthreads/net/serv_internal.c b/mit-pthreads/net/serv_internal.c
deleted file mode 100644
index f4acc8697ae..00000000000
--- a/mit-pthreads/net/serv_internal.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)serv_internal.c 6.22 (Berkeley) 3/19/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "serv_internal.h"
-
-#define DEFAULT_RETRIES 4
-
-static void _serv_init_global();
-
-pthread_mutex_t serv_iterate_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_once_t init_once = PTHREAD_ONCE_INIT;
-static pthread_key_t key;
-static int init_status;
-
-/* Performs global initialization. */
-char *_serv_buf()
-{
- char *buf;
-
- /* Make sure the global initializations have been done. */
- pthread_once(&init_once, _serv_init_global);
-
- /* Initialize thread-specific data for this thread if it hasn't
- * been done already. */
- buf = (char *) pthread_getspecific(key);
- if (!buf) {
- buf = (char *) malloc(sizeof(struct servent) + SERV_BUFSIZE);
- if (buf == NULL)
- return NULL;
- if (pthread_setspecific(key, buf) < 0) {
- free(buf);
- return NULL;
- }
- }
- return buf;
-}
-
-static void _serv_init_global()
-{
- init_status = pthread_key_create(&key, free);
-}
-
diff --git a/mit-pthreads/net/serv_internal.h b/mit-pthreads/net/serv_internal.h
deleted file mode 100644
index 60a7c02c2ea..00000000000
--- a/mit-pthreads/net/serv_internal.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)serv_internal.h 6.22 (Berkeley) 3/19/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#ifndef _SERV_INTERNAL_H
-#define _SERV_INTERNAL_H
-
-#include <pthread.h>
-#include <netdb.h>
-#include <resolv.h>
-
-#define SERV_BUFSIZE 4096
-#undef ALIGN
-#define ALIGN(p, t) ((char *)(((((long)(p) - 1) / sizeof(t)) + 1) * sizeof(t)))
-#define SP(p, t, n) (ALIGN(p, t) + (n) * sizeof(t))
-
-extern pthread_mutex_t serv_iterate_lock;
-
-__BEGIN_DECLS
-char *_serv_buf(void);
-__END_DECLS
-
-#endif
-
diff --git a/mit-pthreads/patches/Streepy.html b/mit-pthreads/patches/Streepy.html
deleted file mode 100755
index a3b4faa815f..00000000000
--- a/mit-pthreads/patches/Streepy.html
+++ /dev/null
@@ -1,2873 +0,0 @@
-diff -c -r1.1.1.1 pthread.h
-*** pthread.h 1996/03/13 04:30:57 1.1.1.1
---- pthread.h 1996/10/02 17:52:47
-***************
-*** 35,40 ****
---- 35,43 ----
- *
- * 1.00 93/07/20 proven
- * -Started coding this file.
-+ *
-+ * 93/9/28 streepy - Added support for pthread cancel
-+ *
- */
-
- #ifndef _PTHREAD_H_
-***************
-*** 65,70 ****
---- 68,82 ----
- /* More includes, that need size_t */
- #include <pthread/pthread_attr.h>
-
-+ /* Constants for use with pthread_setcancelstate and pthread_setcanceltype */
-+ #define PTHREAD_CANCEL_DISABLE 0
-+ #define PTHREAD_CANCEL_ENABLE 1
-+ #define PTHREAD_CANCEL_DEFERRED 0
-+ #define PTHREAD_CANCEL_ASYNCHRONOUS 1
-+
-+ #define PTHREAD_CANCELLED (void *)1 /* Exit status of a cancelled thread */
-+
-+
- #ifdef PTHREAD_KERNEL
-
- #include <signal.h> /* for sigset_t */
-***************
-*** 78,120 ****
- PS_STATE_MAX
- };
-
-- #define PF_WAIT_EVENT 0x01
-- #define PF_DONE_EVENT 0x02
--
- /* Put PANIC inside an expression that evaluates to non-void type, to
- make it easier to combine it in expressions. */
-! #define DO_PANIC() (PANIC (), 0)
-! #define PANICIF(x) ((x) ? DO_PANIC () : 0)
-
-! #define SET_PF_DONE_EVENT(x) \
-! ( !(x->flags & PF_DONE_EVENT) \
-! ? ( (x->flags & PF_WAIT_EVENT) \
-! ? (x->flags = PF_DONE_EVENT, OK) \
-! : DO_PANIC ()) \
- : NOTOK )
-
-! #define SET_PF_WAIT_EVENT(x) \
-! ( PANICIF (x->flags & (PF_WAIT_EVENT | PF_DONE_EVENT)), \
-! (x->flags = PF_WAIT_EVENT), 0)
-!
-! #define CLEAR_PF_DONE_EVENT(x) \
-! ( PANICIF (!(x->flags & PF_DONE_EVENT)), \
-! x->flags = 0 )
-
- struct pthread_select_data {
-! int nfds;
-! fd_set readfds;
-! fd_set writefds;
-! fd_set exceptfds;
- };
-
- union pthread_wait_data {
-! pthread_mutex_t * mutex;
-! pthread_cond_t * cond;
-! const sigset_t * sigwait; /* Waiting on a signal in sigwait */
- struct {
-! short fd; /* Used when thread waiting on fd */
-! short branch; /* line number, for debugging */
- } fd;
- struct pthread_select_data * select_data;
- };
---- 90,185 ----
- PS_STATE_MAX
- };
-
- /* Put PANIC inside an expression that evaluates to non-void type, to
- make it easier to combine it in expressions. */
-! #define DO_PANIC() (PANIC (), 0)
-! #define PANICIF(x) ((x) ? DO_PANIC () : 0)
-!
-! /* In the thread flag field, we use a series of bit flags. Flags can
-! * organized into "groups" of mutually exclusive flags. Other flags
-! * are unrelated and can be set and cleared with a single bit operation.
-! */
-
-! #define PF_WAIT_EVENT 0x01
-! #define PF_DONE_EVENT 0x02
-! #define PF_EVENT_GROUP 0x03 /* All event bits */
-!
-! #define PF_CANCEL_STATE 0x04 /* cancellability state */
-! #define PF_CANCEL_TYPE 0x08 /* cancellability type */
-! #define PF_THREAD_CANCELLED 0x10 /* thread has been cancelled */
-! #define PF_RUNNING_TO_CANCEL 0x20 /* Thread is running so it can cancel*/
-! #define PF_AT_CANCEL_POINT 0x40 /* Thread is at a cancel point */
-!
-! /* Flag operations */
-!
-! #define SET_PF_FLAG(x,f) ( (x)->flags |= (f) )
-! #define TEST_PF_FLAG(x,f) ( (x)->flags & (f) )
-! #define CLEAR_PF_FLAG(x,f) ( (x)->flags &= ~(f) )
-! #define CLEAR_PF_GROUP(x,g) ( (x)->flags &= ~(g) )
-! #define SET_PF_FLAG_IN_GROUP(x,g,f) ( CLEAR_PF_GROUP(x,g),SET_PF_FLAG(x,f))
-! #define TEST_PF_GROUP(x,g) ( (x)->flags & (g) )
-!
-! #define SET_PF_DONE_EVENT(x) \
-! ( !TEST_PF_FLAG(x,PF_DONE_EVENT) \
-! ? ( TEST_PF_FLAG(x,PF_WAIT_EVENT) \
-! ? (SET_PF_FLAG_IN_GROUP(x,PF_EVENT_GROUP,PF_DONE_EVENT), OK) \
-! : DO_PANIC ()) \
- : NOTOK )
-
-! #define SET_PF_WAIT_EVENT(x) \
-! ( PANICIF (TEST_PF_GROUP(x,PF_EVENT_GROUP) ), \
-! SET_PF_FLAG_IN_GROUP(x,PF_EVENT_GROUP,PF_WAIT_EVENT), 0)
-!
-! #define CLEAR_PF_DONE_EVENT(x) \
-! ( PANICIF (!TEST_PF_FLAG(x,PF_DONE_EVENT)), \
-! CLEAR_PF_GROUP(x,PF_EVENT_GROUP) )
-!
-! #define SET_PF_CANCELLED(x) ( SET_PF_FLAG(x,PF_THREAD_CANCELLED) )
-! #define TEST_PF_CANCELLED(x) ( TEST_PF_FLAG(x,PF_THREAD_CANCELLED) )
-!
-! #define SET_PF_RUNNING_TO_CANCEL(x) ( SET_PF_FLAG(x,PF_RUNNING_TO_CANCEL) )
-! #define CLEAR_PF_RUNNING_TO_CANCEL(x)( CLEAR_PF_FLAG(x,PF_RUNNING_TO_CANCEL) )
-! #define TEST_PF_RUNNING_TO_CANCEL(x)( TEST_PF_FLAG(x,PF_RUNNING_TO_CANCEL) )
-!
-! #define SET_PF_AT_CANCEL_POINT(x) ( SET_PF_FLAG(x,PF_AT_CANCEL_POINT) )
-! #define CLEAR_PF_AT_CANCEL_POINT(x) ( CLEAR_PF_FLAG(x,PF_AT_CANCEL_POINT) )
-! #define TEST_PF_AT_CANCEL_POINT(x) ( TEST_PF_FLAG(x,PF_AT_CANCEL_POINT) )
-!
-! #define SET_PF_CANCEL_STATE(x,f) \
-! ( (f) ? SET_PF_FLAG(x,PF_CANCEL_STATE) : CLEAR_PF_FLAG(x,PF_CANCEL_STATE) )
-! #define TEST_PF_CANCEL_STATE(x) \
-! ( (TEST_PF_FLAG(x,PF_CANCEL_STATE)) ? PTHREAD_CANCEL_ENABLE \
-! : PTHREAD_CANCEL_DISABLE )
-!
-! #define SET_PF_CANCEL_TYPE(x,f) \
-! ( (f) ? SET_PF_FLAG(x,PF_CANCEL_TYPE) : CLEAR_PF_FLAG(x,PF_CANCEL_TYPE) )
-! #define TEST_PF_CANCEL_TYPE(x) \
-! ( (TEST_PF_FLAG(x,PF_CANCEL_TYPE)) ? PTHREAD_CANCEL_ASYNCHRONOUS \
-! : PTHREAD_CANCEL_DEFERRED )
-!
-! /* See if a thread is in a state that it can be cancelled */
-! #define TEST_PTHREAD_IS_CANCELLABLE(x) \
-! ( (TEST_PF_CANCEL_STATE(x) == PTHREAD_CANCEL_ENABLE && TEST_PF_CANCELLED(x)) \
-! ? ((TEST_PF_CANCEL_TYPE(x) == PTHREAD_CANCEL_ASYNCHRONOUS) \
-! ? 1 \
-! : TEST_PF_AT_CANCEL_POINT(x)) \
-! : 0 )
-!
-
- struct pthread_select_data {
-! int nfds;
-! fd_set readfds;
-! fd_set writefds;
-! fd_set exceptfds;
- };
-
- union pthread_wait_data {
-! pthread_mutex_t * mutex;
-! pthread_cond_t * cond;
-! const sigset_t * sigwait; /* Waiting on a signal in sigwait */
- struct {
-! short fd; /* Used when thread waiting on fd */
-! short branch; /* line number, for debugging */
- } fd;
- struct pthread_select_data * select_data;
- };
-***************
-*** 122,143 ****
- #define PTT_USER_THREAD 0x0001
-
- struct pthread {
-! int thread_type;
- struct machdep_pthread machdep_data;
-! pthread_attr_t attr;
-
- /* Signal interface */
-! sigset_t sigmask;
-! sigset_t sigpending;
-! int sigcount; /* Number of signals pending */
-
- /* Timeout time */
-! struct timespec wakeup_time;
-
- /* Join queue for waiting threads */
- struct pthread_queue join_queue;
-
--
- /*
- * Thread implementations are just multiple queue type implemenations,
- * Below are the various link lists currently necessary
---- 187,207 ----
- #define PTT_USER_THREAD 0x0001
-
- struct pthread {
-! int thread_type;
- struct machdep_pthread machdep_data;
-! pthread_attr_t attr;
-
- /* Signal interface */
-! sigset_t sigmask;
-! sigset_t sigpending;
-! int sigcount; /* Number of signals pending */
-
- /* Timeout time */
-! struct timespec wakeup_time;
-
- /* Join queue for waiting threads */
- struct pthread_queue join_queue;
-
- /*
- * Thread implementations are just multiple queue type implemenations,
- * Below are the various link lists currently necessary
-***************
-*** 152,165 ****
- * ALL threads, in any state.
- * Must lock kernel lock before manipulating.
- */
-! struct pthread * pll;
-
- /*
- * Standard link list for running threads, mutexes, etc ...
- * It can't be on both a running link list and a wait queue.
- * Must lock kernel lock before manipulating.
- */
-! struct pthread * next;
- union pthread_wait_data data;
-
- /*
---- 216,229 ----
- * ALL threads, in any state.
- * Must lock kernel lock before manipulating.
- */
-! struct pthread * pll;
-
- /*
- * Standard link list for running threads, mutexes, etc ...
- * It can't be on both a running link list and a wait queue.
- * Must lock kernel lock before manipulating.
- */
-! struct pthread * next;
- union pthread_wait_data data;
-
- /*
-***************
-*** 167,197 ****
- * (Note: "priority" is a reserved word in Concurrent C, please
- * don't use it. --KR)
- */
-! struct pthread_queue * queue;
-! enum pthread_state state;
-! char flags;
-! char pthread_priority;
-
- /*
- * Sleep queue, this is different from the standard link list
- * because it is possible to be on both (pthread_cond_timedwait();
- * Must lock sleep mutex before manipulating
- */
-! struct pthread *sll; /* For sleeping threads */
-
- /*
- * Data that doesn't need to be locked
-! * Mostly it's because only the thread owning the data can manipulate it
- */
-! void * ret;
-! int error;
-! int * error_p;
-! const void ** specific_data;
-! int specific_data_count;
-
- /* Cleanup handlers Link List */
- struct pthread_cleanup *cleanup;
--
- };
-
- #else /* not PTHREAD_KERNEL */
---- 231,261 ----
- * (Note: "priority" is a reserved word in Concurrent C, please
- * don't use it. --KR)
- */
-! struct pthread_queue * queue;
-! enum pthread_state state;
-! enum pthread_state old_state; /* Used when cancelled */
-! char flags;
-! char pthread_priority;
-
- /*
- * Sleep queue, this is different from the standard link list
- * because it is possible to be on both (pthread_cond_timedwait();
- * Must lock sleep mutex before manipulating
- */
-! struct pthread *sll; /* For sleeping threads */
-
- /*
- * Data that doesn't need to be locked
-! * Mostly because only the thread owning the data can manipulate it
- */
-! void * ret;
-! int error;
-! int * error_p;
-! const void ** specific_data;
-! int specific_data_count;
-
- /* Cleanup handlers Link List */
- struct pthread_cleanup *cleanup;
- };
-
- #else /* not PTHREAD_KERNEL */
-***************
-*** 200,223 ****
-
- #endif
-
-! typedef struct pthread * pthread_t;
-
- /*
- * Globals
- */
- #ifdef PTHREAD_KERNEL
-
-! extern struct pthread * pthread_run;
-! extern struct pthread * pthread_initial;
-! extern struct pthread * pthread_link_list;
- extern struct pthread_queue pthread_dead_queue;
- extern struct pthread_queue pthread_alloc_queue;
-
-! extern pthread_attr_t pthread_attr_default;
-! extern volatile int fork_lock;
-! extern pthread_size_t pthread_pagesize;
-!
-! extern sigset_t * uthread_sigmask;
-
- #endif
-
---- 264,293 ----
-
- #endif
-
-! typedef struct pthread *pthread_t;
-
- /*
- * Globals
- */
- #ifdef PTHREAD_KERNEL
-
-! extern struct pthread * pthread_run;
-! extern struct pthread * pthread_initial;
-! extern struct pthread * pthread_link_list;
- extern struct pthread_queue pthread_dead_queue;
- extern struct pthread_queue pthread_alloc_queue;
-
-! extern pthread_attr_t pthread_attr_default;
-! extern volatile int fork_lock;
-! extern pthread_size_t pthread_pagesize;
-!
-! extern sigset_t * uthread_sigmask;
-!
-! /* Kernel global functions */
-! extern void pthread_sched_prevent(void);
-! extern void pthread_sched_resume(void);
-! extern int __pthread_is_valid( pthread_t );
-! extern void pthread_cancel_internal( int freelocks );
-
- #endif
-
-***************
-*** 229,271 ****
-
- #if defined(DCE_COMPAT)
-
-! typedef void * (*pthread_startroutine_t)(void *)
-! typedef void * pthread_addr_t
-
-! int pthread_create __P((pthread_t *, pthread_attr_t,
-! pthread_startroutine_t,
-! pthread_addr_t));
-! void pthread_exit __P((pthread_addr_t));
-! int pthread_join __P((pthread_t, pthread_addr_t *));
-
- #else
-
-! void pthread_init __P((void));
-! int pthread_create __P((pthread_t *,
-! const pthread_attr_t *,
-! void * (*start_routine)(void *),
-! void *));
-! void pthread_exit __P((void *));
-! pthread_t pthread_self __P((void));
-! int pthread_equal __P((pthread_t, pthread_t));
-! int pthread_join __P((pthread_t, void **));
-! int pthread_detach __P((pthread_t));
-! void pthread_yield __P((void));
-!
-! int pthread_setschedparam __P((pthread_t pthread, int policy,
-! struct sched_param * param));
-! int pthread_getschedparam __P((pthread_t pthread, int * policy,
-! struct sched_param * param));
-!
-! int pthread_kill __P((struct pthread *, int));
-! int pthread_signal __P((int, void (*)(int)));
-
- #endif
-
- #if defined(PTHREAD_KERNEL)
-
- /* Not valid, but I can't spell so this will be caught at compile time */
-! #define pthread_yeild(notvalid)
-
- #endif
-
---- 299,343 ----
-
- #if defined(DCE_COMPAT)
-
-! typedef void * (*pthread_startroutine_t)(void *);
-! typedef void * pthread_addr_t;
-
-! int pthread_create __P((pthread_t *, pthread_attr_t,
-! pthread_startroutine_t, pthread_addr_t));
-! void pthread_exit __P((pthread_addr_t));
-! int pthread_join __P((pthread_t, pthread_addr_t *));
-
- #else
-
-! void pthread_init __P((void));
-! int pthread_create __P((pthread_t *, const pthread_attr_t *,
-! void * (*start_routine)(void *), void *));
-! void pthread_exit __P((void *));
-! pthread_t pthread_self __P((void));
-! int pthread_equal __P((pthread_t, pthread_t));
-! int pthread_join __P((pthread_t, void **));
-! int pthread_detach __P((pthread_t));
-! void pthread_yield __P((void));
-!
-! int pthread_setschedparam __P((pthread_t pthread, int policy,
-! struct sched_param * param));
-! int pthread_getschedparam __P((pthread_t pthread, int * policy,
-! struct sched_param * param));
-!
-! int pthread_kill __P((struct pthread *, int));
-! int pthread_signal __P((int, void (*)(int)));
-!
-! int pthread_cancel __P(( pthread_t pthread ));
-! int pthread_setcancelstate __P(( int state, int *oldstate ));
-! int pthread_setcanceltype __P(( int type, int *oldtype ));
-! void pthread_testcancel __P(( void ));
-
- #endif
-
- #if defined(PTHREAD_KERNEL)
-
- /* Not valid, but I can't spell so this will be caught at compile time */
-! #define pthread_yeild(notvalid)
-
- #endif
-
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/include/signal.h,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 signal.h
-*** signal.h 1995/12/25 03:03:09 1.1.1.1
---- signal.h 1996/09/26 21:46:04
-***************
-*** 43,48 ****
---- 43,49 ----
- __BEGIN_DECLS
-
- int raise __P((int));
-+ __sighandler_t signal __P((int __sig, __sighandler_t));
-
- #ifndef _ANSI_SOURCE
-
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/include/pthread/kernel.h,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 kernel.h
-*** kernel.h 1994/12/13 07:09:01 1.1.1.1
---- kernel.h 1996/10/02 19:08:41
-***************
-*** 42,48 ****
- */
- #if defined(PTHREAD_KERNEL)
-
-! #define PANIC() abort()
-
- /* Time each rr thread gets */
- #define PTHREAD_RR_TIMEOUT 100000000
---- 42,54 ----
- */
- #if defined(PTHREAD_KERNEL)
-
-! #ifdef __GNUC__
-! #include <assert.h>
-! #define PANIC() panic_kernel( __FILE__, __LINE__, __ASSERT_FUNCTION )
-! #else
-! #define PANIC() panic_kernel( __FILE__, __LINE__, (const char *)0 )
-! #endif
-!
-
- /* Time each rr thread gets */
- #define PTHREAD_RR_TIMEOUT 100000000
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/machdep/syscall-i386-linux-1.0.S,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 syscall-i386-linux-1.0.S
-*** syscall-i386-linux-1.0.S 1995/09/27 04:38:55 1.1.1.1
---- syscall-i386-linux-1.0.S 1996/06/04 19:20:17
-***************
-*** 147,154 ****
-
- /* =========================================================================
- * exit 1 select 82
-! * fork 2 socketcall 102
-! * read 3
- * write 4
- * open 5
- * creat 8
---- 147,154 ----
-
- /* =========================================================================
- * exit 1 select 82
-! * fork 2 fstatfs 100
-! * read 3 socketcall 102
- * write 4
- * open 5
- * creat 8
-***************
-*** 160,166 ****
- * chown 16
- * lseek 19
- * rename 38
-! * dup 41
- * pipe 42
- * ioctl 54
- * fcntl 55
---- 160,166 ----
- * chown 16
- * lseek 19
- * rename 38
-! * dup 41
- * pipe 42
- * ioctl 54
- * fcntl 55
-***************
-*** 302,314 ****
- #endif
-
- /* ==========================================================================
-! * machdep_sys_fstat()
- */
- #ifdef __ELF__
- STATCALL2(lstat)
- #else
- SYSCALL2(lstat)
- #endif
-
- /* ==========================================================================
- * machdep_sys_ftruncate()
---- 302,320 ----
- #endif
-
- /* ==========================================================================
-! * machdep_sys_lstat()
- */
- #ifdef __ELF__
- STATCALL2(lstat)
- #else
- SYSCALL2(lstat)
- #endif
-+
-+ /* ==========================================================================
-+ * machdep_sys_fstatfs()
-+ */
-+ SYSCALL2(fstatfs)
-+
-
- /* ==========================================================================
- * machdep_sys_ftruncate()
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/machdep/linux-1.0/socket.h,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 socket.h
-*** socket.h 1995/12/26 02:28:03 1.1.1.1
---- socket.h 1996/09/27 18:12:45
-***************
-*** 26,32 ****
-
- #endif
-
-! /* #include <asm/socket.h> /* arch-dependent defines */
- #include <linux/sockios.h> /* the SIOCxxx I/O controls */
- #include <pthread/posix.h>
-
---- 26,32 ----
-
- #endif
-
-! /* #include <asm/socket.h> arch-dependent defines */
- #include <linux/sockios.h> /* the SIOCxxx I/O controls */
- #include <pthread/posix.h>
-
-***************
-*** 161,166 ****
---- 161,188 ----
- int connect __P((int, const struct sockaddr *, int));
- int listen __P((int, int));
- int socket __P((int, int, int));
-+
-+ int getsockopt __P ((int __s, int __level, int __optname,
-+ void *__optval, int *__optlen));
-+ int setsockopt __P ((int __s, int __level, int __optname,
-+ __const void *__optval, int optlen));
-+ int getsockname __P ((int __sockfd, struct sockaddr *__addr,
-+ int *__paddrlen));
-+ int getpeername __P ((int __sockfd, struct sockaddr *__peer,
-+ int *__paddrlen));
-+ ssize_t send __P ((int __sockfd, __const void *__buff, size_t __len, int __flags));
-+ ssize_t recv __P ((int __sockfd, void *__buff, size_t __len, int __flags));
-+ ssize_t sendto __P ((int __sockfd, __const void *__buff, size_t __len,
-+ int __flags, __const struct sockaddr *__to,
-+ int __tolen));
-+ ssize_t recvfrom __P ((int __sockfd, void *__buff, size_t __len,
-+ int __flags, struct sockaddr *__from,
-+ int *__fromlen));
-+ extern ssize_t sendmsg __P ((int __fd, __const struct msghdr *__message,
-+ int __flags));
-+ extern ssize_t recvmsg __P ((int __fd, struct msghdr *__message,
-+ int __flags));
-+ int shutdown __P ((int __sockfd, int __how));
-
- __END_DECLS
-
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/machdep/linux-1.0/timers.h,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 timers.h
-*** timers.h 1996/03/05 08:28:36 1.1.1.1
---- timers.h 1996/05/25 21:30:08
-***************
-*** 43,52 ****
---- 43,54 ----
- #include <sys/types.h>
- #include <time.h>
-
-+ #ifndef _LINUX_TIME_H
- struct timespec {
- time_t tv_sec;
- long tv_nsec;
- };
-+ #endif /* _LINUX_TIME_H */
-
- #define TIMEVAL_TO_TIMESPEC(tv, ts) { \
- (ts)->tv_sec = (tv)->tv_sec; \
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/net/getprotoent.c,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 getprotoent.c
-*** getprotoent.c 1996/02/09 05:39:41 1.1.1.1
---- getprotoent.c 1996/05/27 01:11:27
-***************
-*** 128,135 ****
- if (p != NULL)
- *p++ = '\0';
- }
-! if (p && *p);
-! break;
- }
- *alias = NULL;
- pthread_mutex_unlock(&proto_file_lock);
---- 128,135 ----
- if (p != NULL)
- *p++ = '\0';
- }
-! if (p && *p)
-! break;
- }
- *alias = NULL;
- pthread_mutex_unlock(&proto_file_lock);
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/net/proto_internal.c,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 proto_internal.c
-*** proto_internal.c 1996/02/09 05:39:49 1.1.1.1
---- proto_internal.c 1996/06/04 16:25:57
-***************
-*** 49,55 ****
- static int init_status;
-
- /* Performs global initialization. */
-! char *_proto_init()
- {
- char *buf;
-
---- 49,55 ----
- static int init_status;
-
- /* Performs global initialization. */
-! char *_proto_buf()
- {
- char *buf;
-
-***************
-*** 75,78 ****
- {
- init_status = pthread_key_create(&key, free);
- }
--
---- 75,77 ----
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/net/res_internal.c,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 res_internal.c
-*** res_internal.c 1996/02/09 05:39:53 1.1.1.1
---- res_internal.c 1996/09/25 23:31:11
-***************
-*** 144,149 ****
---- 144,150 ----
- break;
- cp += n;
- result->h_name = bp;
-+ bp += strlen(bp) + 1;
- iquery_done = 1;
- break;
- }
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/pthreads/GNUmakefile.inc,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 GNUmakefile.inc
-*** GNUmakefile.inc 1995/08/30 22:27:04 1.1.1.1
---- GNUmakefile.inc 1996/10/02 19:04:29
-***************
-*** 8,14 ****
- syscall.S pthread_join.c pthread_detach.c pthread_once.c sleep.c \
- specific.c process.c wait.c errno.c schedparam.c _exit.c prio_queue.c \
- pthread_init.c init.cc sig.c info.c mutexattr.c select.c wrapper.c \
-! dump_state.c pthread_kill.c stat.c readv.c writev.c condattr.c $(SRCS)
-
- ifeq ($(HAVE_SYSCALL_TEMPLATE),yes)
- SYSCALL_FILTER_RULE= for s in $(AVAILABLE_SYSCALLS) ; do \
---- 8,15 ----
- syscall.S pthread_join.c pthread_detach.c pthread_once.c sleep.c \
- specific.c process.c wait.c errno.c schedparam.c _exit.c prio_queue.c \
- pthread_init.c init.cc sig.c info.c mutexattr.c select.c wrapper.c \
-! dump_state.c pthread_kill.c stat.c readv.c writev.c condattr.c \
-! pthread_cancel.c panic.c $(SRCS)
-
- ifeq ($(HAVE_SYSCALL_TEMPLATE),yes)
- SYSCALL_FILTER_RULE= for s in $(AVAILABLE_SYSCALLS) ; do \
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/pthreads/Makefile.inc,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 Makefile.inc
-*** Makefile.inc 1995/08/22 22:09:07 1.1.1.1
---- Makefile.inc 1996/10/02 19:04:38
-***************
-*** 8,14 ****
- pthread_join.c pthread_detach.c pthread_once.c sleep.c specific.c \
- process.c wait.c errno.c schedparam.c _exit.c prio_queue.c \
- pthread_init.c init.cc sig.c info.c mutexattr.c select.c wrapper.c \
-! dump_state.c pthread_kill.c condattr.c
-
- .if $(HAVE_SYSCALL_TEMPLATE) == yes
- OBJS+= syscalls.o
---- 8,14 ----
- pthread_join.c pthread_detach.c pthread_once.c sleep.c specific.c \
- process.c wait.c errno.c schedparam.c _exit.c prio_queue.c \
- pthread_init.c init.cc sig.c info.c mutexattr.c select.c wrapper.c \
-! dump_state.c pthread_kill.c condattr.c pthread_cancel.c panic.c
-
- .if $(HAVE_SYSCALL_TEMPLATE) == yes
- OBJS+= syscalls.o
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/pthreads/cond.c,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 cond.c
-*** cond.c 1996/03/05 08:29:12 1.1.1.1
---- cond.c 1996/10/03 18:19:04
-***************
-*** 188,197 ****
---- 188,204 ----
- pthread_queue_enq(&cond->c_queue, pthread_run);
- pthread_mutex_unlock(mutex);
-
-+ pthread_run->data.mutex = mutex;
-+
- SET_PF_WAIT_EVENT(pthread_run);
-+ SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- /* Reschedule will unlock pthread_run */
- pthread_resched_resume(PS_COND_WAIT);
-+ CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
- CLEAR_PF_DONE_EVENT(pthread_run);
-+
-+ pthread_run->data.mutex = NULL;
-+
- rval = pthread_mutex_lock(mutex);
- return(rval);
- break;
-***************
-*** 203,212 ****
---- 210,226 ----
- pthread_mutex_unlock(mutex);
- mutex->m_data.m_count = 1;
-
-+ pthread_run->data.mutex = mutex;
-+
- SET_PF_WAIT_EVENT(pthread_run);
-+ SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- /* Reschedule will unlock pthread_run */
- pthread_resched_resume(PS_COND_WAIT);
-+ CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
- CLEAR_PF_DONE_EVENT(pthread_run);
-+
-+ pthread_run->data.mutex = NULL;
-+
- rval = pthread_mutex_lock(mutex);
- mutex->m_data.m_count = count;
- return(rval);
-***************
-*** 258,265 ****
---- 272,285 ----
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_mutex_unlock(mutex);
-
-+ pthread_run->data.mutex = mutex;
-+
-+ SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- /* Reschedule will unlock pthread_run */
- pthread_resched_resume(PS_COND_WAIT);
-+ CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
-+
-+ pthread_run->data.mutex = NULL;
-
- /* Remove ourselves from sleep queue. If we fail then we timedout */
- if (sleep_cancel(pthread_run) == NOTOK) {
-***************
-*** 285,292 ****
---- 305,318 ----
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_mutex_unlock(mutex);
-
-+ pthread_run->data.mutex = mutex;
-+
-+ SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- /* Reschedule will unlock pthread_run */
- pthread_resched_resume(PS_COND_WAIT);
-+ CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
-+
-+ pthread_run->data.mutex = NULL;
-
- /* Remove ourselves from sleep queue. If we fail then we timedout */
- if (sleep_cancel(pthread_run) == NOTOK) {
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/pthreads/fd.c,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 fd.c
-*** fd.c 1996/02/09 02:54:19 1.1.1.1
---- fd.c 1996/10/03 01:33:03
-***************
-*** 48,54 ****
---- 48,59 ----
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <sys/uio.h>
-+ #include <sys/ioctl.h>
-+ #if __STDC__
- #include <stdarg.h>
-+ #else
-+ #include <varargs.h>
-+ #endif
- #include <fcntl.h>
- #include <errno.h>
- #include <pthread/posix.h>
-***************
-*** 62,67 ****
---- 67,74 ----
- static const int dtablecount = 4096/sizeof(struct fd_table_entry);
- int dtablesize;
-
-+ static int fd_get_pthread_fd_from_kernel_fd( int );
-+
- /* ==========================================================================
- * Allocate dtablecount entries at once and populate the fd_table.
- *
-***************
-*** 199,204 ****
---- 206,244 ----
- return(NOTOK);
- }
-
-+ /*----------------------------------------------------------------------
-+ * Function: fd_get_pthread_fd_from_kernel_fd
-+ * Purpose: get the fd_table index of a kernel fd
-+ * Args: fd = kernel fd to convert
-+ * Returns: fd_table index, -1 if not found
-+ * Notes:
-+ *----------------------------------------------------------------------*/
-+ static int
-+ fd_get_pthread_fd_from_kernel_fd( int kfd )
-+ {
-+ int j;
-+
-+ /* This is *SICK*, but unless there is a faster way to
-+ * turn a kernel fd into an fd_table index, this has to do.
-+ */
-+ for( j=0; j < dtablesize; j++ ) {
-+ if( fd_table[j] &&
-+ fd_table[j]->type != FD_NT &&
-+ fd_table[j]->type != FD_NIU &&
-+ fd_table[j]->fd.i == kfd ) {
-+ return j;
-+ }
-+ }
-+
-+ /* Not listed byfd, Check for kernel fd == pthread fd */
-+ if( fd_table[kfd] == NULL || fd_table[kfd]->type == FD_NT ) {
-+ /* Assume that the kernel fd is the same */
-+ return kfd;
-+ }
-+
-+ return NOTOK; /* Not found */
-+ }
-+
- /* ==========================================================================
- * fd_basic_basic_unlock()
- *
-***************
-*** 288,293 ****
---- 328,334 ----
- switch (fd_table[fd]->type) {
- case FD_NIU:
- /* If not in use return EBADF error */
-+ SET_ERRNO(EBADF);
- return(NOTOK);
- break;
- case FD_NT:
-***************
-*** 297,302 ****
---- 338,344 ----
- */
- fd_kern_init(fd);
- if (fd_table[fd]->type == FD_NIU) {
-+ SET_ERRNO(EBADF);
- return(NOTOK);
- }
- break;
-***************
-*** 409,414 ****
---- 451,545 ----
- return(OK);
- }
-
-+ /*----------------------------------------------------------------------
-+ * Function: fd_unlock_for_cancel
-+ * Purpose: Unlock all fd locks held prior to being cancelled
-+ * Args: void
-+ * Returns:
-+ * OK or NOTOK
-+ * Notes:
-+ * Assumes the kernel is locked on entry
-+ *----------------------------------------------------------------------*/
-+ int
-+ fd_unlock_for_cancel( void )
-+ {
-+ int i, fd;
-+ struct pthread_select_data *data;
-+ int rdlk, wrlk, lktype;
-+ int found;
-+
-+ /* What we do depends on the previous state of the thread */
-+ switch( pthread_run->old_state ) {
-+ case PS_RUNNING:
-+ case PS_JOIN:
-+ case PS_SLEEP_WAIT:
-+ case PS_WAIT_WAIT:
-+ case PS_SIGWAIT:
-+ case PS_FDLR_WAIT:
-+ case PS_FDLW_WAIT:
-+ case PS_DEAD:
-+ case PS_UNALLOCED:
-+ break; /* Nothing to do */
-+
-+ case PS_COND_WAIT:
-+ CLEAR_PF_GROUP( pthread_run, PF_EVENT_GROUP );
-+ /* Must reaquire the mutex according to the standard */
-+ if( pthread_run->data.mutex == NULL ) {
-+ PANIC();
-+ }
-+ pthread_mutex_lock( pthread_run->data.mutex );
-+ break;
-+
-+ case PS_FDR_WAIT:
-+ CLEAR_PF_GROUP( pthread_run, PF_EVENT_GROUP);
-+ /* Free the lock on the fd being used */
-+ fd = fd_get_pthread_fd_from_kernel_fd( pthread_run->data.fd.fd );
-+ if( fd == NOTOK ) {
-+ PANIC(); /* Can't find fd */
-+ }
-+ fd_unlock( fd, FD_READ );
-+ break;
-+
-+ case PS_FDW_WAIT: /* Waiting on i/o */
-+ CLEAR_PF_GROUP( pthread_run, PF_EVENT_GROUP);
-+ /* Free the lock on the fd being used */
-+ fd = fd_get_pthread_fd_from_kernel_fd( pthread_run->data.fd.fd );
-+ if( fd == NOTOK ) {
-+ PANIC(); /* Can't find fd */
-+ }
-+ fd_unlock( fd, FD_WRITE );
-+ break;
-+
-+ case PS_SELECT_WAIT:
-+ data = pthread_run->data.select_data;
-+
-+ CLEAR_PF_GROUP( pthread_run, PF_EVENT_GROUP);
-+
-+ for( i = 0; i < data->nfds; i++) {
-+ rdlk =(FD_ISSET(i,&data->readfds)
-+ || FD_ISSET(i,&data->exceptfds));
-+ wrlk = FD_ISSET(i, &data->writefds);
-+ lktype = rdlk ? (wrlk ? FD_RDWR : FD_READ) : FD_WRITE;
-+
-+ if( ! (rdlk || wrlk) )
-+ continue; /* No locks, no unlock */
-+
-+ if( (fd = fd_get_pthread_fd_from_kernel_fd( i )) == NOTOK ) {
-+ PANIC(); /* Can't find fd */
-+ }
-+
-+ fd_unlock( fd, lktype );
-+ }
-+ break;
-+
-+ case PS_MUTEX_WAIT:
-+ PANIC(); /* Should never cancel a mutex wait */
-+
-+ default:
-+ PANIC(); /* Unknown thread status */
-+ }
-+ }
-+
- /* ==========================================================================
- * fd_lock()
- */
-***************
-*** 476,481 ****
---- 607,616 ----
- ret = fd_table[fd]->ops->read(fd_table[fd]->fd,
- fd_table[fd]->flags, buf, nbytes, timeout);
- fd_unlock(fd, FD_READ);
-+ if( ret < 0 ) {
-+ SET_ERRNO(-ret);
-+ ret = NOTOK;
-+ }
- }
- return(ret);
- }
-***************
-*** 500,505 ****
---- 635,644 ----
- ret = fd_table[fd]->ops->readv(fd_table[fd]->fd,
- fd_table[fd]->flags, iov, iovcnt, timeout);
- fd_unlock(fd, FD_READ);
-+ if( ret < 0 ) {
-+ SET_ERRNO(-ret);
-+ ret = NOTOK;
-+ }
- }
- return(ret);
- }
-***************
-*** 524,529 ****
---- 663,672 ----
- ret = fd_table[fd]->ops->write(fd_table[fd]->fd,
- fd_table[fd]->flags, buf, nbytes, timeout);
- fd_unlock(fd, FD_WRITE);
-+ if( ret < 0 ) {
-+ SET_ERRNO(-ret);
-+ ret = NOTOK;
-+ }
- }
- return(ret);
- }
-***************
-*** 548,553 ****
---- 691,700 ----
- ret = fd_table[fd]->ops->writev(fd_table[fd]->fd,
- fd_table[fd]->flags, iov, iovcnt, timeout);
- fd_unlock(fd, FD_WRITE);
-+ if( ret < 0 ) {
-+ SET_ERRNO(-ret);
-+ ret = NOTOK;
-+ }
- }
- return(ret);
- }
-***************
-*** 599,677 ****
- union fd_data realfd;
- int ret, flags;
-
- /* Need to lock the newfd by hand */
-! if (fd < dtablesize) {
-! pthread_mutex_lock(&fd_table_mutex);
-! if (fd_table[fd]) {
-! pthread_mutex_unlock(&fd_table_mutex);
-! mutex = &(fd_table[fd]->mutex);
-! pthread_mutex_lock(mutex);
-
-! /*
-! * XXX Gross hack ... because of fork(), any fd closed by the
-! * parent should not change the fd of the child, unless it owns it.
- */
-! switch(fd_table[fd]->type) {
-! case FD_NIU:
-! pthread_mutex_unlock(mutex);
-! ret = -EINVAL;
-! break;
-! case FD_NT:
-! /*
-! * If it's not tested then the only valid possibility is it's
-! * kernel fd.
-! */
-! ret = machdep_sys_close(fd);
-! fd_table[fd]->type = FD_NIU;
-! pthread_mutex_unlock(mutex);
-! break;
-! case FD_TEST_FULL_DUPLEX:
-! case FD_TEST_HALF_DUPLEX:
- realfd = fd_table[fd]->fd;
- flags = fd_table[fd]->flags;
- if ((entry = fd_free(fd)) == NULL) {
-! ret = fd_table[fd]->ops->close(realfd, flags);
- } else {
-! /* There can't be any others waiting for fd. */
- pthread_mutex_unlock(&entry->mutex);
- /* Note: entry->mutex = mutex */
-- mutex = &(fd_table[fd]->mutex);
- }
- pthread_mutex_unlock(mutex);
-- break;
-- default:
-- ret = fd_basic_lock(fd, FD_RDWR, mutex, NULL);
-- if (ret == OK) {
-- realfd = fd_table[fd]->fd;
-- flags = fd_table[fd]->flags;
-- pthread_mutex_unlock(mutex);
-- if ((entry = fd_free(fd)) == NULL) {
-- ret = fd_table[fd]->ops->close(realfd, flags);
-- } else {
-- fd_basic_basic_unlock(entry, FD_RDWR);
-- pthread_mutex_unlock(&entry->mutex);
-- /* Note: entry->mutex = mutex */
-- }
-- fd_unlock(fd, FD_RDWR);
-- } else {
-- pthread_mutex_unlock(mutex);
-- }
-- break;
- }
-! } else {
-! /* Don't bother creating a table entry */
-! pthread_mutex_unlock(&fd_table_mutex);
-! ret = machdep_sys_close(fd);
- }
-! return(ret);
- }
-! return(-EINVAL);
- }
-
- /* ==========================================================================
- * fd_basic_dup()
- *
- * Might need to do more than just what's below.
- */
- static inline void fd_basic_dup(int fd, int newfd)
- {
---- 746,836 ----
- union fd_data realfd;
- int ret, flags;
-
-+ if( fd < 0 || fd >= dtablesize ) {
-+ SET_ERRNO(EBADF);
-+ return -1;
-+ }
-+
- /* Need to lock the newfd by hand */
-! pthread_mutex_lock(&fd_table_mutex);
-! if (fd_table[fd]) {
-! pthread_mutex_unlock(&fd_table_mutex);
-! mutex = &(fd_table[fd]->mutex);
-! pthread_mutex_lock(mutex);
-
-! /*
-! * XXX Gross hack ... because of fork(), any fd closed by the
-! * parent should not change the fd of the child, unless it owns it.
-! */
-! switch(fd_table[fd]->type) {
-! case FD_NIU:
-! pthread_mutex_unlock(mutex);
-! ret = -EBADF;
-! break;
-! case FD_NT:
-! /*
-! * If it's not tested then the only valid possibility is it's
-! * kernel fd.
- */
-! ret = machdep_sys_close(fd);
-! fd_table[fd]->type = FD_NIU;
-! pthread_mutex_unlock(mutex);
-! break;
-! case FD_TEST_FULL_DUPLEX:
-! case FD_TEST_HALF_DUPLEX:
-! realfd = fd_table[fd]->fd;
-! flags = fd_table[fd]->flags;
-! if ((entry = fd_free(fd)) == NULL) {
-! ret = fd_table[fd]->ops->close(realfd, flags);
-! } else {
-! /* There can't be any others waiting for fd. */
-! pthread_mutex_unlock(&entry->mutex);
-! /* Note: entry->mutex = mutex */
-! mutex = &(fd_table[fd]->mutex);
-! }
-! pthread_mutex_unlock(mutex);
-! break;
-! default:
-! ret = fd_basic_lock(fd, FD_RDWR, mutex, NULL);
-! if (ret == OK) {
- realfd = fd_table[fd]->fd;
- flags = fd_table[fd]->flags;
-+ pthread_mutex_unlock(mutex);
- if ((entry = fd_free(fd)) == NULL) {
-! ret = fd_table[fd]->ops->close(realfd, flags);
- } else {
-! fd_basic_basic_unlock(entry, FD_RDWR);
- pthread_mutex_unlock(&entry->mutex);
- /* Note: entry->mutex = mutex */
- }
-+ fd_unlock(fd, FD_RDWR);
-+ } else {
- pthread_mutex_unlock(mutex);
- }
-! break;
- }
-! } else {
-! /* Don't bother creating a table entry */
-! pthread_mutex_unlock(&fd_table_mutex);
-! ret = machdep_sys_close(fd);
-! }
-!
-! if( ret < 0 ) {
-! SET_ERRNO(-ret);
-! ret = -1;
- }
-!
-! return ret;
- }
-
- /* ==========================================================================
- * fd_basic_dup()
- *
- * Might need to do more than just what's below.
-+ *
-+ * This is a MAJOR guess!! I don't know if the mutext unlock is valid
-+ * in the BIG picture. But it seems to be needed to avoid deadlocking
-+ * with ourselves when we try to close the duped file descriptor.
- */
- static inline void fd_basic_dup(int fd, int newfd)
- {
-***************
-*** 679,684 ****
---- 838,845 ----
- fd_table[fd]->next = fd_table[newfd];
- fd_table[newfd] = fd_table[fd];
- fd_table[fd]->count++;
-+ pthread_mutex_unlock(&fd_table[newfd]->next->mutex);
-+
- }
-
- /* ==========================================================================
-***************
-*** 896,904 ****
- * ala select()... --SNL
- */
- int
-! ioctl(int fd, unsigned long request, caddr_t arg)
- {
- int ret;
-
- if (fd < 0 || fd >= dtablesize)
- ret = NOTOK;
---- 1057,1071 ----
- * ala select()... --SNL
- */
- int
-! ioctl(int fd, int request, ...)
- {
- int ret;
-+ pthread_va_list ap;
-+ caddr_t arg;
-+
-+ va_start( ap, request ); /* Get the arg */
-+ arg = va_arg(ap,caddr_t);
-+ va_end( ap );
-
- if (fd < 0 || fd >= dtablesize)
- ret = NOTOK;
-***************
-*** 906,911 ****
---- 1073,1086 ----
- ret = machdep_sys_ioctl(fd, request, arg);
- else if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- ret = machdep_sys_ioctl(fd_table[fd]->fd.i, request, arg);
-+ if( ret == 0 && request == FIONBIO ) {
-+ /* Properly set NONBLOCK flag */
-+ int v = *(int *)arg;
-+ if( v )
-+ fd_table[fd]->flags |= __FD_NONBLOCK;
-+ else
-+ fd_table[fd]->flags &= ~__FD_NONBLOCK;
-+ }
- fd_unlock(fd, FD_RDWR);
- }
- return ret;
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/pthreads/fd_kern.c,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 fd_kern.c
-*** fd_kern.c 1996/02/12 00:58:30 1.1.1.1
---- fd_kern.c 1996/10/03 01:54:15
-***************
-*** 128,134 ****
-
-
- if ((count = machdep_sys_select(dtablesize, &fd_set_read,
-! &fd_set_write, NULL, &__fd_kern_poll_timeout)) < OK) {
- if (count == -EINTR) {
- return;
- }
---- 128,134 ----
-
-
- if ((count = machdep_sys_select(dtablesize, &fd_set_read,
-! &fd_set_write, &fd_set_except, &__fd_kern_poll_timeout)) < OK) {
- if (count == -EINTR) {
- return;
- }
-***************
-*** 167,200 ****
-
- for (pthread = fd_wait_select.q_next; count && pthread; ) {
- int found_one = 0;
-
- for (i = 0; i < pthread->data.select_data->nfds; i++) {
- int count_dec = 0;
-
-! if ((FD_ISSET(i, &pthread->data.select_data->exceptfds) &&
-! ! FD_ISSET(i, &fd_set_except))) {
-! FD_CLR(i, &pthread->data.select_data->exceptfds);
-! } else {
-! count_dec++;
- }
-! if ((FD_ISSET(i, &pthread->data.select_data->writefds) &&
-! ! FD_ISSET(i, &fd_set_write))) {
-! FD_CLR(i, &pthread->data.select_data->writefds);
-! } else {
-! count_dec++;
- }
-! if ((FD_ISSET(i, &pthread->data.select_data->readfds) &&
-! ! FD_ISSET(i, &fd_set_read))) {
-! FD_CLR(i, &pthread->data.select_data->readfds);
-! } else {
-! count_dec++;
- }
- if (count_dec) {
- found_one++;
- count--;
- }
- }
- if (found_one) {
- deq = pthread;
- pthread = pthread->next;
- pthread_queue_remove(&fd_wait_select, deq);
---- 167,223 ----
-
- for (pthread = fd_wait_select.q_next; count && pthread; ) {
- int found_one = 0;
-+ fd_set tmp_readfds, tmp_writefds, tmp_exceptfds;
-+
-+ memcpy(&tmp_readfds, &pthread->data.select_data->readfds,
-+ sizeof(fd_set));
-+ memcpy(&tmp_writefds, &pthread->data.select_data->writefds,
-+ sizeof(fd_set));
-+ memcpy(&tmp_exceptfds, &pthread->data.select_data->exceptfds,
-+ sizeof(fd_set));
-
- for (i = 0; i < pthread->data.select_data->nfds; i++) {
- int count_dec = 0;
-
-! if( (FD_ISSET(i, &tmp_exceptfds)) ) {
-! if( FD_ISSET(i, &fd_set_except) ) {
-! count_dec++; /* got a hit */
-! } else {
-! FD_CLR(i, &tmp_exceptfds);
-! }
- }
-!
-! if( (FD_ISSET(i, &tmp_writefds)) ) {
-! if( FD_ISSET(i, &fd_set_write) ) {
-! count_dec++; /* got a hit */
-! } else {
-! FD_CLR(i, &tmp_writefds);
-! }
- }
-!
-! if( (FD_ISSET(i, &tmp_readfds)) ) {
-! if( FD_ISSET(i, &fd_set_read) ) {
-! count_dec++; /* got a hit */
-! } else {
-! FD_CLR(i, &tmp_readfds);
-! }
- }
-+
- if (count_dec) {
- found_one++;
- count--;
- }
- }
-+
- if (found_one) {
-+ /* Update the threads saved select data fd sets */
-+ memcpy(&pthread->data.select_data->readfds, &tmp_readfds,
-+ sizeof(fd_set));
-+ memcpy(&pthread->data.select_data->writefds, &tmp_writefds,
-+ sizeof(fd_set));
-+ memcpy(&pthread->data.select_data->exceptfds, &tmp_exceptfds,
-+ sizeof(fd_set));
-+
- deq = pthread;
- pthread = pthread->next;
- pthread_queue_remove(&fd_wait_select, deq);
-***************
-*** 266,272 ****
- */
-
- while ((count = machdep_sys_select(dtablesize, &fd_set_read,
-! &fd_set_write, NULL, &__fd_kern_wait_timeout)) < OK) {
- if (count == -EINTR) {
- return;
- }
---- 289,295 ----
- */
-
- while ((count = machdep_sys_select(dtablesize, &fd_set_read,
-! &fd_set_write, &fd_set_except, &__fd_kern_wait_timeout)) < OK) {
- if (count == -EINTR) {
- return;
- }
-***************
-*** 305,338 ****
-
- for (pthread = fd_wait_select.q_next; count && pthread; ) {
- int found_one = 0;
-
- for (i = 0; i < pthread->data.select_data->nfds; i++) {
- int count_dec = 0;
-
-! if ((FD_ISSET(i, &pthread->data.select_data->exceptfds) &&
-! ! FD_ISSET(i, &fd_set_except))) {
-! FD_CLR(i, &pthread->data.select_data->exceptfds);
-! } else {
-! count_dec++;
- }
-! if ((FD_ISSET(i, &pthread->data.select_data->writefds) &&
-! ! FD_ISSET(i, &fd_set_write))) {
-! FD_CLR(i, &pthread->data.select_data->writefds);
-! } else {
-! count_dec++;
- }
-! if ((FD_ISSET(i, &pthread->data.select_data->readfds) &&
-! ! FD_ISSET(i, &fd_set_read))) {
-! FD_CLR(i, &pthread->data.select_data->readfds);
-! } else {
-! count_dec++;
- }
- if (count_dec) {
- found_one++;
- count--;
- }
- }
- if (found_one) {
- deq = pthread;
- pthread = pthread->next;
- pthread_queue_remove(&fd_wait_select, deq);
---- 328,383 ----
-
- for (pthread = fd_wait_select.q_next; count && pthread; ) {
- int found_one = 0;
-+ fd_set tmp_readfds, tmp_writefds, tmp_exceptfds;
-+
-+ memcpy(&tmp_readfds, &pthread->data.select_data->readfds,
-+ sizeof(fd_set));
-+ memcpy(&tmp_writefds, &pthread->data.select_data->writefds,
-+ sizeof(fd_set));
-+ memcpy(&tmp_exceptfds, &pthread->data.select_data->exceptfds,
-+ sizeof(fd_set));
-
- for (i = 0; i < pthread->data.select_data->nfds; i++) {
- int count_dec = 0;
-
-! if( (FD_ISSET(i, &tmp_exceptfds)) ) {
-! if( FD_ISSET(i, &fd_set_except) ) {
-! count_dec++; /* got a hit */
-! } else {
-! FD_CLR(i, &tmp_exceptfds);
-! }
- }
-!
-! if( (FD_ISSET(i, &tmp_writefds)) ) {
-! if( FD_ISSET(i, &fd_set_write) ) {
-! count_dec++; /* got a hit */
-! } else {
-! FD_CLR(i, &tmp_writefds);
-! }
- }
-!
-! if( (FD_ISSET(i, &tmp_readfds)) ) {
-! if( FD_ISSET(i, &fd_set_read) ) {
-! count_dec++; /* got a hit */
-! } else {
-! FD_CLR(i, &tmp_readfds);
-! }
- }
-+
- if (count_dec) {
- found_one++;
- count--;
- }
- }
- if (found_one) {
-+ /* Update the threads saved select data fd sets */
-+ memcpy(&pthread->data.select_data->readfds, &tmp_readfds,
-+ sizeof(fd_set));
-+ memcpy(&pthread->data.select_data->writefds, &tmp_writefds,
-+ sizeof(fd_set));
-+ memcpy(&pthread->data.select_data->exceptfds, &tmp_exceptfds,
-+ sizeof(fd_set));
-+
- deq = pthread;
- pthread = pthread->next;
- pthread_queue_remove(&fd_wait_select, deq);
-***************
-*** 380,404 ****
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
- pthread_resched_resume(PS_FDR_WAIT);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
-- SET_ERRNO(ETIMEDOUT);
- ret = -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
- } else {
- pthread_resched_resume(PS_FDR_WAIT);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- } else {
-- SET_ERRNO(-ret);
-- ret = NOTOK;
- break;
- }
- }
---- 425,450 ----
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
-+ SET_PF_AT_CANCEL_POINT(pthread_run);
- pthread_resched_resume(PS_FDR_WAIT);
-+ CLEAR_PF_AT_CANCEL_POINT(pthread_run);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- ret = -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
- } else {
-+ SET_PF_AT_CANCEL_POINT(pthread_run);
- pthread_resched_resume(PS_FDR_WAIT);
-+ CLEAR_PF_AT_CANCEL_POINT(pthread_run);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- } else {
- break;
- }
- }
-***************
-*** 437,443 ****
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
-- SET_ERRNO(ETIMEDOUT);
- ret = -ETIMEDOUT;
- break;
- }
---- 483,488 ----
-***************
-*** 447,454 ****
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- } else {
-- SET_ERRNO(-ret);
-- ret = NOTOK;
- break;
- }
- }
---- 492,497 ----
-***************
-*** 480,504 ****
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
- pthread_resched_resume(PS_FDW_WAIT);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
-- SET_ERRNO(ETIMEDOUT);
- ret = -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
- } else {
- pthread_resched_resume(PS_FDW_WAIT);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- } else {
-- SET_ERRNO(-ret);
-- ret = NOTOK;
- break;
- }
- }
---- 523,548 ----
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
-+ SET_PF_AT_CANCEL_POINT(pthread_run);
- pthread_resched_resume(PS_FDW_WAIT);
-+ CLEAR_PF_AT_CANCEL_POINT(pthread_run);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- ret = -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
- } else {
-+ SET_PF_AT_CANCEL_POINT(pthread_run);
- pthread_resched_resume(PS_FDW_WAIT);
-+ CLEAR_PF_AT_CANCEL_POINT(pthread_run);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- } else {
- break;
- }
- }
-***************
-*** 537,543 ****
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
-- SET_ERRNO(ETIMEDOUT);
- ret = -ETIMEDOUT;
- break;
- }
---- 581,586 ----
-***************
-*** 547,554 ****
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- } else {
-- SET_ERRNO(-ret);
-- ret = NOTOK;
- break;
- }
- }
---- 590,595 ----
-***************
-*** 662,668 ****
- */
- int create(const char *path, mode_t mode)
- {
-! return creat (path, mode);
- }
-
- /* ==========================================================================
---- 703,709 ----
- */
- int create(const char *path, mode_t mode)
- {
-! return creat (path, mode);
- }
-
- /* ==========================================================================
-***************
-*** 672,678 ****
-
- int creat(const char *path, mode_t mode)
- {
-! return open (path, O_CREAT | O_TRUNC | O_WRONLY, mode);
- }
-
- /* ==========================================================================
---- 713,719 ----
-
- int creat(const char *path, mode_t mode)
- {
-! return open (path, O_CREAT | O_TRUNC | O_WRONLY, mode);
- }
-
- /* ==========================================================================
-***************
-*** 1079,1090 ****
- int bind(int fd, const struct sockaddr *name, int namelen)
- {
- /* Not much to do in bind */
-- semaphore *plock;
- int ret;
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- if ((ret = machdep_sys_bind(fd_table[fd]->fd.i, name, namelen)) < OK) {
- SET_ERRNO(-ret);
- }
- fd_unlock(fd, FD_RDWR);
- }
---- 1120,1131 ----
- int bind(int fd, const struct sockaddr *name, int namelen)
- {
- /* Not much to do in bind */
- int ret;
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- if ((ret = machdep_sys_bind(fd_table[fd]->fd.i, name, namelen)) < OK) {
- SET_ERRNO(-ret);
-+ ret = NOTOK;
- }
- fd_unlock(fd, FD_RDWR);
- }
-***************
-*** 1100,1113 ****
- */
- int connect(int fd, const struct sockaddr *name, int namelen)
- {
-! struct sockaddr tmpname;
-! int ret, tmpnamelen;
-
-! if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- if ((ret = machdep_sys_connect(fd_table[fd]->fd.i, name, namelen)) < OK) {
- if (!(fd_table[fd]->flags & __FD_NONBLOCK) &&
-! ((ret == -EWOULDBLOCK) || (ret == -EINPROGRESS) ||
-! (ret == -EALREADY) || (ret == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDW_WAIT */
---- 1141,1154 ----
- */
- int connect(int fd, const struct sockaddr *name, int namelen)
- {
-! struct sockaddr tmpname;
-! int ret, tmpnamelen;
-
-! if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- if ((ret = machdep_sys_connect(fd_table[fd]->fd.i, name, namelen)) < OK) {
- if (!(fd_table[fd]->flags & __FD_NONBLOCK) &&
-! ((ret == -EWOULDBLOCK) || (ret == -EINPROGRESS) ||
-! (ret == -EALREADY) || (ret == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDW_WAIT */
-***************
-*** 1121,1131 ****
- tmpnamelen = sizeof(tmpname);
- /* OK now lets see if it really worked */
- if (((ret = machdep_sys_getpeername(fd_table[fd]->fd.i,
-! &tmpname, &tmpnamelen)) < OK) && (ret == -ENOTCONN)) {
-
- /* Get the error, this function should not fail */
- machdep_sys_getsockopt(fd_table[fd]->fd.i, SOL_SOCKET,
-! SO_ERROR, &pthread_run->error, &tmpnamelen);
- }
- } else {
- SET_ERRNO(-ret);
---- 1162,1180 ----
- tmpnamelen = sizeof(tmpname);
- /* OK now lets see if it really worked */
- if (((ret = machdep_sys_getpeername(fd_table[fd]->fd.i,
-! &tmpname, &tmpnamelen)) < OK)
-! && (ret == -ENOTCONN)) {
-
- /* Get the error, this function should not fail */
- machdep_sys_getsockopt(fd_table[fd]->fd.i, SOL_SOCKET,
-! SO_ERROR, &ret, &tmpnamelen);
-! SET_ERRNO(-ret);
-! ret = NOTOK;
-! } else {
-! if( ret < 0 ) {
-! SET_ERRNO(-ret);
-! ret = NOTOK;
-! }
- }
- } else {
- SET_ERRNO(-ret);
-***************
-*** 1133,1140 ****
- }
- }
- fd_unlock(fd, FD_RDWR);
-! }
-! return(ret);
- }
-
- #endif
---- 1182,1189 ----
- }
- }
- fd_unlock(fd, FD_RDWR);
-! }
-! return(ret);
- }
-
- #endif
-***************
-*** 1164,1170 ****
- } else {
- fd_unlock(fd, FD_RDWR);
- SET_ERRNO(-fd_kern);
-! return(fd_kern);
- }
- }
- fd_unlock(fd, FD_RDWR);
---- 1213,1219 ----
- } else {
- fd_unlock(fd, FD_RDWR);
- SET_ERRNO(-fd_kern);
-! return(NOTOK);
- }
- }
- fd_unlock(fd, FD_RDWR);
-***************
-*** 1198,1205 ****
- int ret;
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
-! ret = machdep_sys_listen(fd_table[fd]->fd.i, backlog);
-! if ((ret = machdep_sys_listen(fd_table[fd]->fd.i, backlog)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
---- 1247,1253 ----
- int ret;
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
-! if ((ret = machdep_sys_listen(fd_table[fd]->fd.i, backlog)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
-***************
-*** 1246,1252 ****
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
-! ret = -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
---- 1294,1300 ----
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
-! ret = NOTOK;
- break;
- }
- pthread_sched_resume();
-***************
-*** 1311,1317 ****
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
-! ret = -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
---- 1359,1365 ----
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
-! ret = NOTOK;
- break;
- }
- pthread_sched_resume();
-***************
-*** 1405,1411 ****
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
-! ret = -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
---- 1453,1459 ----
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
-! ret = NOTOK;
- break;
- }
- pthread_sched_resume();
-***************
-*** 1471,1477 ****
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
-! ret = -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
---- 1519,1525 ----
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
-! ret = NOTOK;
- break;
- }
- pthread_sched_resume();
-***************
-*** 1536,1542 ****
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
-! ret = -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
---- 1584,1590 ----
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
-! ret = NOTOK;
- break;
- }
- pthread_sched_resume();
-***************
-*** 1603,1609 ****
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
-! ret = -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
---- 1651,1657 ----
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
-! ret = NOTOK;
- break;
- }
- pthread_sched_resume();
-***************
-*** 1734,1744 ****
- */
- int getsockopt(int fd, int level, int optname, void * optval, int * optlen)
- {
-! int ret;
-
-! if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
- if ((ret = machdep_sys_getsockopt(fd_table[fd]->fd.i, level,
-! optname, optval, optlen)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
---- 1782,1792 ----
- */
- int getsockopt(int fd, int level, int optname, void * optval, int * optlen)
- {
-! int ret;
-
-! if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
- if ((ret = machdep_sys_getsockopt(fd_table[fd]->fd.i, level,
-! optname, optval, optlen)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
-***************
-*** 1756,1772 ****
- */
- int getsockname(int fd, struct sockaddr * name, int * naddrlen)
- {
-! int ret;
-
-! if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
-! if ((ret = machdep_sys_getsockname(fd_table[fd]->fd.i,
-! name, naddrlen)) < OK) {
-! SET_ERRNO(-ret);
-! ret = NOTOK;
-! }
-! fd_unlock(fd, FD_RDWR);
-! }
-! return ret;
- }
-
- #endif
---- 1804,1820 ----
- */
- int getsockname(int fd, struct sockaddr * name, int * naddrlen)
- {
-! int ret;
-
-! if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
-! if ((ret = machdep_sys_getsockname(fd_table[fd]->fd.i,
-! name, naddrlen)) < OK) {
-! SET_ERRNO(-ret);
-! ret = NOTOK;
-! }
-! fd_unlock(fd, FD_RDWR);
-! }
-! return ret;
- }
-
- #endif
-***************
-*** 1778,1793 ****
- */
- int getpeername(int fd, struct sockaddr * peer, int * paddrlen)
- {
-! int ret;
-
-! if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
-! if ((ret = machdep_sys_getpeername(fd_table[fd]->fd.i,
-! peer, paddrlen)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
-! }
-! fd_unlock(fd, FD_READ);
-! }
- return ret;
- }
-
---- 1826,1841 ----
- */
- int getpeername(int fd, struct sockaddr * peer, int * paddrlen)
- {
-! int ret;
-
-! if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
-! if ((ret = machdep_sys_getpeername(fd_table[fd]->fd.i,
-! peer, paddrlen)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
-! }
-! fd_unlock(fd, FD_READ);
-! }
- return ret;
- }
-
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/pthreads/pthread.c,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 pthread.c
-*** pthread.c 1995/12/13 05:53:01 1.1.1.1
---- pthread.c 1996/10/01 21:42:01
-***************
-*** 129,134 ****
---- 129,160 ----
-
- }
-
-+ /*----------------------------------------------------------------------
-+ * Function: __pthread_is_valid
-+ * Purpose: Scan the list of threads to see if a specified thread exists
-+ * Args:
-+ * pthread = The thread to scan for
-+ * Returns:
-+ * int = 1 if found, 0 if not
-+ * Notes:
-+ * The kernel is assumed to be locked
-+ *----------------------------------------------------------------------*/
-+ int
-+ __pthread_is_valid( pthread_t pthread )
-+ {
-+ int rtn = 0; /* Assume not found */
-+ pthread_t t;
-+
-+ for( t = pthread_link_list; t; t = t->pll ) {
-+ if( t == pthread ) {
-+ rtn = 1; /* Found it */
-+ break;
-+ }
-+ }
-+
-+ return rtn;
-+ }
-+
- /* ==========================================================================
- * __pthread_free()
- */
-***************
-*** 242,247 ****
---- 268,277 ----
- new_thread->next = NULL;
- new_thread->flags = 0;
-
-+ /* PTHREADS spec says we start with cancellability on and deferred */
-+ SET_PF_CANCEL_STATE(new_thread, PTHREAD_CANCEL_ENABLE);
-+ SET_PF_CANCEL_TYPE(new_thread, PTHREAD_CANCEL_DEFERRED);
-+
- new_thread->error_p = NULL;
- new_thread->sll = NULL;
-
-***************
-*** 261,269 ****
- }
- return(retval);
- }
--
-- /* ==========================================================================
-- * pthread_cancel()
-- *
-- * This routine will also require a sig_prevent/sig_check_and_resume()
-- */
---- 291,293 ----
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/pthreads/pthread_init.c,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 pthread_init.c
-*** pthread_init.c 1996/03/13 04:33:10 1.1.1.1
---- pthread_init.c 1996/10/01 21:43:59
-***************
-*** 92,99 ****
- pthread_initial->next = NULL;
- pthread_initial->flags = 0;
- pthread_initial->pll = NULL;
-- pthread_initial->flags = 0;
- pthread_initial->sll = NULL;
-
- /* Ugly errno hack */
- pthread_initial->error_p = &errno;
---- 92,103 ----
- pthread_initial->next = NULL;
- pthread_initial->flags = 0;
- pthread_initial->pll = NULL;
- pthread_initial->sll = NULL;
-+
-+ /* PTHREADS spec says we start with cancellability on and deferred */
-+ SET_PF_CANCEL_STATE(pthread_initial, PTHREAD_CANCEL_ENABLE);
-+ SET_PF_CANCEL_TYPE(pthread_initial, PTHREAD_CANCEL_DEFERRED);
-+
-
- /* Ugly errno hack */
- pthread_initial->error_p = &errno;
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/pthreads/pthread_join.c,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 pthread_join.c
-*** pthread_join.c 1995/12/13 05:53:07 1.1.1.1
---- pthread_join.c 1996/10/02 16:54:36
-***************
-*** 42,47 ****
---- 42,49 ----
- #include <pthread.h>
- #include <errno.h>
-
-+ static int testDeadlock( struct pthread_queue *queue, pthread_t target );
-+
- /* ==========================================================================
- * pthread_join()
- */
-***************
-*** 51,56 ****
---- 53,64 ----
-
- pthread_sched_prevent();
-
-+ /* Ensure they gave us a legal pthread pointer */
-+ if( ! __pthread_is_valid( pthread ) ) {
-+ pthread_sched_resume();
-+ return(EINVAL);
-+ }
-+
- /* Check that thread isn't detached already */
- if (pthread->attr.flags & PTHREAD_DETACHED) {
- pthread_sched_resume();
-***************
-*** 62,81 ****
- * Note: This must happen after checking detached state.
- */
- if (pthread_queue_remove(&pthread_dead_queue, pthread) != OK) {
-! pthread_queue_enq(&(pthread->join_queue), pthread_run);
-! pthread_resched_resume(PS_JOIN);
-! pthread_sched_prevent();
-!
-! if (pthread_queue_remove(&pthread_dead_queue, pthread) == OK) {
-! pthread_queue_enq(&pthread_alloc_queue, pthread);
-! pthread->attr.flags |= PTHREAD_DETACHED;
-! pthread->state = PS_UNALLOCED;
-! if (thread_return) {
-! *thread_return = pthread->ret;
-! }
-! ret = OK;
- } else {
-! ret = ESRCH;
- }
- } else {
- /* Just get the return value and detach the thread */
---- 70,98 ----
- * Note: This must happen after checking detached state.
- */
- if (pthread_queue_remove(&pthread_dead_queue, pthread) != OK) {
-!
-! /* Before we pend on the join, ensure there is no dead lock */
-!
-! if( testDeadlock( &pthread_run->join_queue, pthread ) == NOTOK ) {
-! ret = EDEADLK;
- } else {
-! pthread_queue_enq(&(pthread->join_queue), pthread_run);
-! SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
-! pthread_resched_resume(PS_JOIN);
-! CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
-! pthread_sched_prevent();
-!
-! if (pthread_queue_remove(&pthread_dead_queue, pthread) == OK) {
-! pthread_queue_enq(&pthread_alloc_queue, pthread);
-! pthread->attr.flags |= PTHREAD_DETACHED;
-! pthread->state = PS_UNALLOCED;
-! if (thread_return) {
-! *thread_return = pthread->ret;
-! }
-! ret = OK;
-! } else {
-! ret = ESRCH;
-! }
- }
- } else {
- /* Just get the return value and detach the thread */
-***************
-*** 89,92 ****
---- 106,139 ----
- }
- pthread_sched_resume();
- return(ret);
-+ }
-+
-+ /*----------------------------------------------------------------------
-+ * Function: testDeadlock
-+ * Purpose: recursive queue walk to check for deadlocks
-+ * Args:
-+ * queue = the queue to walk
-+ * pthread = target to scan for
-+ * Returns:
-+ * OK = no deadlock, NOTOK = deadlock
-+ * Notes:
-+ *----------------------------------------------------------------------*/
-+ static int
-+ testDeadlock( struct pthread_queue *queue, pthread_t target )
-+ {
-+ pthread_t t;
-+
-+ if( queue == NULL )
-+ return OK; /* Empty queue, obviously ok */
-+
-+ for( t = queue->q_next; t; t = t->next ) {
-+ if( t == target )
-+ return NOTOK; /* bang, your dead */
-+
-+ if( testDeadlock( &t->join_queue, target ) == NOTOK ) {
-+ return NOTOK;
-+ }
-+ }
-+
-+ return OK; /* No deadlock */
- }
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/pthreads/select.c,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 select.c
-*** select.c 1996/03/05 08:29:14 1.1.1.1
---- select.c 1996/10/02 16:56:27
-***************
-*** 56,220 ****
- int select(int numfds, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds, struct timeval *timeout)
- {
-! fd_set real_exceptfds, real_readfds, real_writefds; /* mapped fd_sets */
-! fd_set * real_readfds_p, * real_writefds_p, * real_exceptfds_p;
-! fd_set read_locks, write_locks, rdwr_locks;
-! struct timespec timeout_time, current_time;
-! struct timeval zero_timeout = { 0, 0 };
-! int i, j, ret = 0, got_all_locks = 1;
-! struct pthread_select_data data;
-!
-! if (numfds > dtablesize) {
-! numfds = dtablesize;
-! }
-!
-! data.nfds = 0;
-! FD_ZERO(&data.readfds);
-! FD_ZERO(&data.writefds);
-! FD_ZERO(&data.exceptfds);
-
-! /* Do this first */
-! if (timeout) {
- machdep_gettimeofday(&current_time);
-! timeout_time.tv_sec = current_time.tv_sec + timeout->tv_sec;
-! if ((timeout_time.tv_nsec = current_time.tv_nsec +
-! (timeout->tv_usec * 1000)) > 1000000000) {
-! timeout_time.tv_nsec -= 1000000000;
-! timeout_time.tv_sec++;
-! }
-! }
-!
-! FD_ZERO(&read_locks);
-! FD_ZERO(&write_locks);
-! FD_ZERO(&rdwr_locks);
-! FD_ZERO(&real_readfds);
-! FD_ZERO(&real_writefds);
-! FD_ZERO(&real_exceptfds);
-!
-! /* lock readfds */
-! if (readfds || writefds || exceptfds) {
-! for (i = 0; i < numfds; i++) {
-! if ((readfds && (FD_ISSET(i, readfds))) ||
-! (exceptfds && FD_ISSET(i, exceptfds))) {
-! if (writefds && FD_ISSET(i ,writefds)) {
-! if ((ret = fd_lock(i, FD_RDWR, NULL)) != OK) {
-! got_all_locks = 0;
-! break;
-! }
-! FD_SET(i, &rdwr_locks);
-! FD_SET(fd_table[i]->fd.i,&real_writefds);
-! } else {
-! if ((ret = fd_lock(i, FD_READ, NULL)) != OK) {
-! got_all_locks = 0;
-! break;
-! }
-! FD_SET(i, &read_locks);
-! }
-! if (readfds && FD_ISSET(i,readfds)) {
-! FD_SET(fd_table[i]->fd.i, &real_readfds);
-! }
-! if (exceptfds && FD_ISSET(i,exceptfds)) {
-! FD_SET(fd_table[i]->fd.i, &real_exceptfds);
-! }
-! if (fd_table[i]->fd.i >= data.nfds) {
-! data.nfds = fd_table[i]->fd.i + 1;
-! }
-! } else {
-! if (writefds && FD_ISSET(i, writefds)) {
-! if ((ret = fd_lock(i, FD_WRITE, NULL)) != OK) {
-! got_all_locks = 0;
-! break;
-! }
-! FD_SET(i, &write_locks);
-! FD_SET(fd_table[i]->fd.i,&real_writefds);
-! }
-! if (fd_table[i]->fd.i >= data.nfds) {
-! data.nfds = fd_table[i]->fd.i + 1;
-! }
-! }
-! }
-! }
-!
-! if (got_all_locks) {
-!
-! memcpy(&data.readfds,&real_readfds,sizeof(fd_set));
-! memcpy(&data.writefds,&real_writefds,sizeof(fd_set));
-! memcpy(&data.exceptfds,&real_exceptfds,sizeof(fd_set));
-!
-! real_readfds_p = (readfds == NULL) ? NULL : &real_readfds;
-! real_writefds_p = (writefds == NULL) ? NULL : &real_writefds;
-! real_exceptfds_p = (exceptfds == NULL) ? NULL : &real_exceptfds;
-!
-! if ((ret = machdep_sys_select(data.nfds, real_readfds_p,
-! real_writefds_p, real_exceptfds_p, &zero_timeout)) == OK) {
-!
-! pthread_sched_prevent();
-!
-! real_exceptfds_p = (exceptfds == NULL) ? NULL : &data.exceptfds;
-! real_writefds_p = (writefds == NULL) ? NULL : &data.writefds;
-! real_readfds_p = (readfds == NULL) ? NULL : &data.readfds;
-!
-! pthread_queue_enq(&fd_wait_select, pthread_run);
-! pthread_run->data.select_data = &data;
-! SET_PF_WAIT_EVENT(pthread_run);
-!
-! if (timeout) {
-! machdep_gettimeofday(&current_time);
-! sleep_schedule(&current_time, &timeout_time);
-!
-! pthread_resched_resume(PS_SELECT_WAIT);
-!
-! /* We're awake */
-! CLEAR_PF_DONE_EVENT(pthread_run);
-! if (sleep_cancel(pthread_run) == NOTOK) {
-! ret = OK;
-! } else {
-! ret = data.nfds;
-! }
-! } else {
-! pthread_resched_resume(PS_SELECT_WAIT);
-! CLEAR_PF_DONE_EVENT(pthread_run);
-! ret = data.nfds; /* XXX ??? snl */
-! }
-! } else if (ret < 0) {
-! SET_ERRNO(-ret);
-! ret = NOTOK;
-! }
-! }
-!
-! /* clean up the locks */
-! for (i = 0; i < numfds; i++)
-! if (FD_ISSET(i,&read_locks)) fd_unlock(i,FD_READ);
-! for (i = 0; i < numfds; i++)
-! if (FD_ISSET(i,&rdwr_locks)) fd_unlock(i,FD_RDWR);
-! for (i = 0; i < numfds; i++)
-! if (FD_ISSET(i,&write_locks)) fd_unlock(i,FD_WRITE);
-!
-! if (ret > 0) {
-! if (readfds != NULL) {
-! for (i = 0; i < numfds; i++) {
-! if (! (FD_ISSET(i,readfds) &&
-! FD_ISSET(fd_table[i]->fd.i,real_readfds_p)))
-! FD_CLR(i,readfds);
-! }
-! }
-! if (writefds != NULL) {
-! for (i = 0; i < numfds; i++)
-! if (! (FD_ISSET(i,writefds) &&
-! FD_ISSET(fd_table[i]->fd.i,real_writefds_p)))
-! FD_CLR(i,writefds);
-! }
-! if (exceptfds != NULL) {
-! for (i = 0; i < numfds; i++)
-! if (! (FD_ISSET(i,exceptfds) &&
-! FD_ISSET(fd_table[i]->fd.i,real_exceptfds_p)))
-! FD_CLR(i,exceptfds);
-! }
-! } else {
-! if (exceptfds != NULL) FD_ZERO(exceptfds);
-! if (writefds != NULL) FD_ZERO(writefds);
-! if (readfds != NULL) FD_ZERO(readfds);
- }
-
-! return(ret);
- }
---- 56,223 ----
- int select(int numfds, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds, struct timeval *timeout)
- {
-! fd_set real_exceptfds, real_readfds, real_writefds; /* mapped fd_sets */
-! fd_set * real_readfds_p, * real_writefds_p, * real_exceptfds_p;
-! fd_set read_locks, write_locks, rdwr_locks;
-! struct timespec timeout_time, current_time;
-! struct timeval zero_timeout = { 0, 0 };
-! int i, j, ret = 0, got_all_locks = 1;
-! struct pthread_select_data data;
-!
-! if (numfds > dtablesize) {
-! numfds = dtablesize;
-! }
-!
-! data.nfds = 0;
-! FD_ZERO(&data.readfds);
-! FD_ZERO(&data.writefds);
-! FD_ZERO(&data.exceptfds);
-!
-! /* Do this first */
-! if (timeout) {
-! machdep_gettimeofday(&current_time);
-! timeout_time.tv_sec = current_time.tv_sec + timeout->tv_sec;
-! if ((timeout_time.tv_nsec = current_time.tv_nsec +
-! (timeout->tv_usec * 1000)) > 1000000000) {
-! timeout_time.tv_nsec -= 1000000000;
-! timeout_time.tv_sec++;
-! }
-! }
-!
-! FD_ZERO(&read_locks);
-! FD_ZERO(&write_locks);
-! FD_ZERO(&rdwr_locks);
-! FD_ZERO(&real_readfds);
-! FD_ZERO(&real_writefds);
-! FD_ZERO(&real_exceptfds);
-!
-! /* lock readfds */
-! if (readfds || writefds || exceptfds) {
-! for (i = 0; i < numfds; i++) {
-! if ((readfds && (FD_ISSET(i, readfds))) ||
-! (exceptfds && FD_ISSET(i, exceptfds))) {
-! if (writefds && FD_ISSET(i ,writefds)) {
-! if ((ret = fd_lock(i, FD_RDWR, NULL)) != OK) {
-! got_all_locks = 0;
-! break;
-! }
-! FD_SET(i, &rdwr_locks);
-! FD_SET(fd_table[i]->fd.i,&real_writefds);
-! } else {
-! if ((ret = fd_lock(i, FD_READ, NULL)) != OK) {
-! got_all_locks = 0;
-! break;
-! }
-! FD_SET(i, &read_locks);
-! }
-! if (readfds && FD_ISSET(i,readfds)) {
-! FD_SET(fd_table[i]->fd.i, &real_readfds);
-! }
-! if (exceptfds && FD_ISSET(i,exceptfds)) {
-! FD_SET(fd_table[i]->fd.i, &real_exceptfds);
-! }
-! if (fd_table[i]->fd.i >= data.nfds) {
-! data.nfds = fd_table[i]->fd.i + 1;
-! }
-! } else {
-! if (writefds && FD_ISSET(i, writefds)) {
-! if ((ret = fd_lock(i, FD_WRITE, NULL)) != OK) {
-! got_all_locks = 0;
-! break;
-! }
-! FD_SET(i, &write_locks);
-! FD_SET(fd_table[i]->fd.i,&real_writefds);
-! if (fd_table[i]->fd.i >= data.nfds) {
-! data.nfds = fd_table[i]->fd.i + 1;
-! }
-! }
-! }
-! }
-! }
-!
-! if (got_all_locks) {
-! memcpy(&data.readfds,&real_readfds,sizeof(fd_set));
-! memcpy(&data.writefds,&real_writefds,sizeof(fd_set));
-! memcpy(&data.exceptfds,&real_exceptfds,sizeof(fd_set));
-!
-! real_readfds_p = (readfds == NULL) ? NULL : &real_readfds;
-! real_writefds_p = (writefds == NULL) ? NULL : &real_writefds;
-! real_exceptfds_p = (exceptfds == NULL) ? NULL : &real_exceptfds;
-!
-! if ((ret = machdep_sys_select(data.nfds, real_readfds_p,
-! real_writefds_p, real_exceptfds_p,
-! &zero_timeout)) == OK) {
-! pthread_sched_prevent();
-!
-! real_exceptfds_p = (exceptfds == NULL) ? NULL : &data.exceptfds;
-! real_writefds_p = (writefds == NULL) ? NULL : &data.writefds;
-! real_readfds_p = (readfds == NULL) ? NULL : &data.readfds;
-!
-! pthread_queue_enq(&fd_wait_select, pthread_run);
-! pthread_run->data.select_data = &data;
-! SET_PF_WAIT_EVENT(pthread_run);
-
-! if (timeout) {
- machdep_gettimeofday(&current_time);
-! sleep_schedule(&current_time, &timeout_time);
-!
-! SET_PF_AT_CANCEL_POINT(pthread_run);
-! pthread_resched_resume(PS_SELECT_WAIT);
-! CLEAR_PF_AT_CANCEL_POINT(pthread_run);
-!
-! /* We're awake */
-! CLEAR_PF_DONE_EVENT(pthread_run);
-! if (sleep_cancel(pthread_run) == NOTOK) {
-! ret = OK;
-! } else {
-! ret = data.nfds;
-! }
-! } else {
-! SET_PF_AT_CANCEL_POINT(pthread_run);
-! pthread_resched_resume(PS_SELECT_WAIT);
-! CLEAR_PF_AT_CANCEL_POINT(pthread_run);
-! CLEAR_PF_DONE_EVENT(pthread_run);
-! ret = data.nfds; /* XXX ??? snl */
-! }
-! } else if (ret < 0) {
-! SET_ERRNO(-ret);
-! ret = NOTOK;
-! }
-! }
-!
-! /* clean up the locks */
-! for (i = 0; i < numfds; i++)
-! if (FD_ISSET(i,&read_locks)) fd_unlock(i,FD_READ);
-! for (i = 0; i < numfds; i++)
-! if (FD_ISSET(i,&rdwr_locks)) fd_unlock(i,FD_RDWR);
-! for (i = 0; i < numfds; i++)
-! if (FD_ISSET(i,&write_locks)) fd_unlock(i,FD_WRITE);
-!
-! if (ret > 0) {
-! if (readfds != NULL) {
-! for (i = 0; i < numfds; i++) {
-! if (! (FD_ISSET(i,readfds) &&
-! FD_ISSET(fd_table[i]->fd.i,real_readfds_p)))
-! FD_CLR(i,readfds);
-! }
-! }
-! if (writefds != NULL) {
-! for (i = 0; i < numfds; i++)
-! if (! (FD_ISSET(i,writefds) &&
-! FD_ISSET(fd_table[i]->fd.i,real_writefds_p)))
-! FD_CLR(i,writefds);
-! }
-! if (exceptfds != NULL) {
-! for (i = 0; i < numfds; i++)
-! if (! (FD_ISSET(i,exceptfds) &&
-! FD_ISSET(fd_table[i]->fd.i,real_exceptfds_p)))
-! FD_CLR(i,exceptfds);
- }
-+ } else {
-+ if (exceptfds != NULL) FD_ZERO(exceptfds);
-+ if (writefds != NULL) FD_ZERO(writefds);
-+ if (readfds != NULL) FD_ZERO(readfds);
-+ }
-
-! return(ret);
- }
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/pthreads/sig.c,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 sig.c
-*** sig.c 1996/03/13 04:33:13 1.1.1.1
---- sig.c 1996/10/03 01:07:54
-***************
-*** 301,307 ****
---- 301,310 ----
- pthread_run->data.sigwait = set;
- pthread_run->ret = sig;
-
-+ SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- pthread_resched_resume(PS_SIGWAIT);
-+ CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
-+
- return(OK);
- }
-
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/pthreads/signal.c,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 signal.c
-*** signal.c 1996/03/13 04:33:17 1.1.1.1
---- signal.c 1996/10/03 17:30:16
-***************
-*** 72,77 ****
---- 72,78 ----
-
- static void sig_handler(int signal);
- static void set_thread_timer();
-+ static void __cleanup_after_resume( void );
- void sig_prevent(void);
- void sig_resume(void);
-
-***************
-*** 482,502 ****
- }
- }
-
-! /* Only bother if we are truly unlocking the kernel */
-! while (!(--pthread_kernel_lock)) {
-! if (sig_to_process) {
-! /* if (SIG_ANY(sig_to_process)) { */
-! pthread_kernel_lock++;
-! sig_handler(0);
-! continue;
-! }
-! if (pthread_run && pthread_run->sigcount) {
-! pthread_kernel_lock++;
-! pthread_sig_process();
-! continue;
-! }
-! break;
-! }
- }
-
- /* ==========================================================================
---- 483,489 ----
- }
- }
-
-! __cleanup_after_resume();
- }
-
- /* ==========================================================================
-***************
-*** 508,530 ****
- void pthread_resched_resume(enum pthread_state state)
- {
- pthread_run->state = state;
-- sig_handler(SIGVTALRM);
-
-! /* Only bother if we are truely unlocking the kernel */
-! while (!(--pthread_kernel_lock)) {
-! if (sig_to_process) {
-! /* if (SIG_ANY(sig_to_process)) { */
-! pthread_kernel_lock++;
-! sig_handler(0);
-! continue;
-! }
-! if (pthread_run && pthread_run->sigcount) {
-! pthread_kernel_lock++;
-! pthread_sig_process();
-! continue;
-! }
-! break;
- }
- }
-
- /* ==========================================================================
---- 495,523 ----
- void pthread_resched_resume(enum pthread_state state)
- {
- pthread_run->state = state;
-
-! /* Since we are about to block this thread, lets see if we are
-! * at a cancel point and if we've been cancelled.
-! * Avoid cancelling dead or unalloced threads.
-! */
-! if( ! TEST_PF_RUNNING_TO_CANCEL(pthread_run) &&
-! TEST_PTHREAD_IS_CANCELLABLE(pthread_run) &&
-! state != PS_DEAD && state != PS_UNALLOCED ) {
-!
-! /* Set this flag to avoid recursively calling pthread_exit */
-! /* We have to set this flag here because we will unlock the
-! * kernel prior to calling pthread_cancel_internal.
-! */
-! SET_PF_RUNNING_TO_CANCEL(pthread_run);
-!
-! pthread_run->old_state = state; /* unlock needs this data */
-! pthread_sched_resume(); /* Unlock kernel before cancel */
-! pthread_cancel_internal( 1 ); /* free locks and exit */
- }
-+
-+ sig_handler(SIGVTALRM);
-+
-+ __cleanup_after_resume();
- }
-
- /* ==========================================================================
-***************
-*** 532,537 ****
---- 525,543 ----
- */
- void pthread_sched_resume()
- {
-+ __cleanup_after_resume();
-+ }
-+
-+ /*----------------------------------------------------------------------
-+ * Function: __cleanup_after_resume
-+ * Purpose: cleanup kernel locks after a resume
-+ * Args: void
-+ * Returns: void
-+ * Notes:
-+ *----------------------------------------------------------------------*/
-+ static void
-+ __cleanup_after_resume( void )
-+ {
- /* Only bother if we are truely unlocking the kernel */
- while (!(--pthread_kernel_lock)) {
- /* if (SIG_ANY(sig_to_process)) { */
-***************
-*** 546,551 ****
---- 552,568 ----
- continue;
- }
- break;
-+ }
-+
-+ if( pthread_run == NULL )
-+ return; /* Must be during init processing */
-+
-+ /* Test for cancel that should be handled now */
-+
-+ if( ! TEST_PF_RUNNING_TO_CANCEL(pthread_run) &&
-+ TEST_PTHREAD_IS_CANCELLABLE(pthread_run) ) {
-+ /* Kernel is already unlocked */
-+ pthread_cancel_internal( 1 ); /* free locks and exit */
- }
- }
-
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/pthreads/sleep.c,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 sleep.c
-*** sleep.c 1996/03/11 08:33:32 1.1.1.1
---- sleep.c 1996/10/03 01:14:58
-***************
-*** 249,255 ****
---- 249,257 ----
-
- /* Reschedule thread */
- SET_PF_WAIT_EVENT(pthread_run);
-+ SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- pthread_resched_resume(PS_SLEEP_WAIT);
-+ CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
- CLEAR_PF_DONE_EVENT(pthread_run);
-
- /* Return actual time slept */
-***************
-*** 332,338 ****
- current_time.tv_sec++;
- }
- machdep_start_timer(&(current_time),
-! &(pthread_sleep->wakeup_time));
- }
- } else {
- for (pthread_last = pthread_sleep; pthread_last;
---- 334,340 ----
- current_time.tv_sec++;
- }
- machdep_start_timer(&(current_time),
-! &(pthread_sleep->wakeup_time));
- }
- } else {
- for (pthread_last = pthread_sleep; pthread_last;
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/pthreads/stat.c,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 stat.c
-*** stat.c 1995/09/21 02:36:05 1.1.1.1
---- stat.c 1996/06/04 19:17:33
-***************
-*** 43,48 ****
---- 43,49 ----
- #include <errno.h>
-
- struct stat;
-+ struct statfs;
-
- /* ==========================================================================
- * fstat()
-***************
-*** 91,95 ****
---- 92,115 ----
- }
- return(ret);
-
-+ }
-+
-+ /* ==========================================================================
-+ * fstatfs()
-+ *
-+ * Might want to indirect this.
-+ */
-+ int fstatfs(int fd, struct statfs *buf)
-+ {
-+ int ret;
-+
-+ if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
-+ if ((ret = machdep_sys_fstatfs(fd_table[fd]->fd.i, buf)) < OK) {
-+ SET_ERRNO(-ret);
-+ ret = NOTOK;
-+ }
-+ fd_unlock(fd, FD_READ);
-+ }
-+ return(ret);
- }
-
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/pthreads/wait.c,v retrieving revision 1.1.1.1
-diff -c -r1.1.1.1 wait.c
-*** wait.c 1995/02/21 08:07:24 1.1.1.1
---- wait.c 1996/10/03 01:20:02
-***************
-*** 103,109 ****
---- 103,111 ----
- pthread_queue_enq(&wait_queue, pthread_run);
-
- /* reschedule unlocks scheduler */
-+ SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- pthread_resched_resume(PS_WAIT_WAIT);
-+ CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
-
- pthread_sched_prevent();
- }
-***************
-*** 126,132 ****
---- 128,136 ----
- pthread_queue_enq(&wait_queue, pthread_run);
-
- /* reschedule unlocks scheduler */
-+ SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- pthread_resched_resume(PS_WAIT_WAIT);
-+ CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
-
- pthread_sched_prevent();
- }
-<pre><font size=-1>
diff --git a/mit-pthreads/patches/Streepy2.html b/mit-pthreads/patches/Streepy2.html
deleted file mode 100755
index 80d44d6440c..00000000000
--- a/mit-pthreads/patches/Streepy2.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<html>
-<head>
- <title>Diffs on diffs :-) by Larry V. Streepy, Jr.</title>
- <base target=_top>
- <meta name="GENERATOR" content="FindMail Communications">
- <meta name="Date" content="Monday, October 07, 1996 02:03 PM PST">
- <meta name="Author" content="Larry V. Streepy, Jr.">
-</head>
-<body background="/gifs/betafm.gif" bgcolor="#ffffff" text="#000000" link="#0000ee" vlink="#ff0000" alink="#000099">
-<h3>Diffs on diffs :-)</h3>
-Larry V. Streepy, Jr. (<a href="mailto.html?mid=2079859748&num=398" target="_top">@healthcare.com</a>)<br>Monday, October 07, 1996 02:03 PM PST<br>
-<p>
-This is a multi-part message in MIME format.<p>
---------------65BE18E23639BCDD7BE55F7F <br>
-Content-Type: text/plain; charset=us-ascii <br>
-Content-Transfer-Encoding: 7bit<p>
-Unfortunately, there are a couple of bugs in my pthread_cancel support (no, say it isn't so :-)<p>
-Oh well, I cam across a couple of cases that I missed in my testing last week. Here are the bugs:<p>
-1. If a thread calls pthread_testcancel during it's cleanup processing after being cancelled, the pthread kernel would hang.<p>
-2. I didn't realize that threads in PS_SLEEP_WAIT state are *NOT* on any queue, they are handled using a linked list. So, when cancelling a thread that was sleeping, a PANIC() I put in possiblymakeRunnable would go off.<p>
-Both of these are fixed. The diffs are attached.<br>
--- <br>
-Larry V. Streepy, Jr. <br>
-Chief Technical Officer, Healthcare Communications, Inc. mailto:<a href="mailto.html?mid=2079859748&num=398" target="_top">@healthcare.com</a> <br>
-(214) 851-7033 (Dallas Main #) <br>
-(970) 626-5028 (My office #) (970) 626-4425 (Fax)<p>
---------------65BE18E23639BCDD7BE55F7F <br>
-Content-Type: text/plain; charset=us-ascii; name=&#34;cancel.diffs&#34; Content-Transfer-Encoding: 7bit <br>
-Content-Disposition: inline; filename=&#34;cancel.diffs&#34;<p>
-Index: pthread_cancel.c<br>
-=================================================================== RCS file: /usr/cvssrc/pthreads-1_60_beta5/pthreads/pthread_cancel.c,v retrieving revision 1.1 <br>
-diff -c -r1.1 pthread_cancel.c<br>
-*** pthread_cancel.c 1996/10/06 00:31:27 1.1<br>
---- pthread_cancel.c 1996/10/07 18:33:27<br>
-***************<br>
-*** 187,192 ****<br>
---- 187,197 ----<br>
- return; /* Can't be cancelled */<br>
- }<br>
- <br>
-+ /* Ensure that we aren't in the process of exiting already */<br>
-+ if( TEST_PF_RUNNING_TO_CANCEL(pthread_run) ) {<br>
-+ return;<br>
-+ }<br>
-+ <br>
- /* See if we have been cancelled */<br>
- if( TEST_PF_CANCELLED(pthread_run) ) {<br>
- /* Set this flag to avoid recursively calling pthread_exit */<br>
-***************<br>
-*** 266,277 ****<br>
- if( pthread-&gt;state == PS_RUNNING )<br>
- return; /* will happen at context switch */<br>
- <br>
-! /* Otherwise, we need to take it off the queue and make it runnable */<br>
-! if( pthread-&gt;queue == NULL ) {<br>
-! PANIC(); /* Must be on a queue */<br>
-! }<br>
- <br>
-- pthread_queue_remove(pthread-&gt;queue, pthread);<br>
- pthread_prio_queue_enq(pthread_current_prio_queue, pthread);<br>
- pthread-&gt;old_state = pthread-&gt;state;<br>
- pthread-&gt;state = PS_RUNNING;<br>
---- 271,291 ----<br>
- if( pthread-&gt;state == PS_RUNNING )<br>
- return; /* will happen at context switch */<br>
- <br>
-! /* If the thread is sleeping, the it isn't on a queue. */<br>
-! if( pthread-&gt;state == PS_SLEEP_WAIT ) {<br>
-! sleep_cancel( pthread ); /* Remove from sleep list */<br>
-! } else {<br>
-! /* Otherwise, we need to take it off the queue and make it runnable */<br>
-! <br>
-! if( pthread-&gt;queue == NULL ) {<br>
-! PANIC(); /* Must be on a queue */<br>
-! }<br>
-! <br>
-! pthread_queue_remove(pthread-&gt;queue, pthread);<br>
-! }<br>
-! <br>
-! /* And make it runnable */<br>
- <br>
- pthread_prio_queue_enq(pthread_current_prio_queue, pthread);<br>
- pthread-&gt;old_state = pthread-&gt;state;<br>
- pthread-&gt;state = PS_RUNNING;<p>
-<pre><font size=-1>
---------------65BE18E23639BCDD7BE55F7F--
-
-</pre><p></pre>
-<hr>
-<a href="http://www.findmail.com/" target="_top"><font size=-1>Powered by FindMail Communications</font><br></a>
-<br>Please email comments and suggestions to:<a href="/cgi-bin/comments.py" target="_top">comments@findmail.com</a>
-<br><font size=-3 color="#ffffff">xmlarchive</font>
-</body></html> \ No newline at end of file
diff --git a/mit-pthreads/patches/bill_lear b/mit-pthreads/patches/bill_lear
deleted file mode 100755
index f49b79c4272..00000000000
--- a/mit-pthreads/patches/bill_lear
+++ /dev/null
@@ -1,70 +0,0 @@
-From rael@dejanews.com Wed Jan 29 06:06:14 1997
-X-VM-v5-Data: ([nil nil nil t nil nil nil nil nil]
- ["1497" "Tue" "28" "January" "1997" "21:52:57" "-0600" "William S. Lear" "rael@dejanews.com" "<199701290352.VAA08678@homer.dejanews.com>" "53" "Patches for linux2.0" "^From:" nil nil "1" "1997012903:52:57" "Patches for linux2.0" nil nil]
- nil)
-Received: from MIT.EDU (PACIFIC-CARRIER-ANNEX.MIT.EDU [18.69.0.28])
- by analytik.analytikerna.se (8.8.4/8.8.4) with SMTP
- id GAA23245 for <monty@analytikerna.se>; Wed, 29 Jan 1997 06:06:12 +0100 (MET)
-Received: from host-205-238-143-2.dejanews.com by MIT.EDU with SMTP
- id AA25254; Tue, 28 Jan 97 22:53:08 EST
-Received: (from rael@localhost) by homer.dejanews.com (8.7.6/8.6.12) id VAA08678 for pthreads@mit.edu; Tue, 28 Jan 1997 21:52:57 -0600 (CST)
-Message-Id: <199701290352.VAA08678@homer.dejanews.com>
-Content-Length: 1496
-From: "William S. Lear" <rael@dejanews.com>
-To: pthreads@MIT.EDU
-Subject: Patches for linux2.0
-Date: Tue, 28 Jan 1997 21:52:57 -0600 (CST)
-
-
-The following are some patches I found necessary to run smoothly
-under linux2.0. The PTEST directory below refers to the original
-pthreads 1.60 beta 6 release. Of course, the '-O2' "fix" is not strictly
-needed.
-
-#============================================================
-# < pthreads-1_60beta6/config/configure
-# > PTEST/pthreads-1_60beta6/config/configure
-#------------------------------------------------------------
-642c642
-< CFLAGS="-g -O2"
----
-> CFLAGS="-g -O"
-1104,1106d1103
-< cat >> confdefs.h <<EOF
-< #define BSD_TM 1
-< EOF
-
-# Diff for:
-#============================================================
-# < pthreads-1_60beta6/config/config.h.in
-# > PTEST/pthreads-1_60beta6/config/config.h.in
-#------------------------------------------------------------
-3,8d2
-< /* Does the OS have tm needing bsd'ish initialization? */
-< #undef BSD_TM
-<
-< /* Does the OS already support struct timespec */
-< #undef _OS_HAS_TIMESPEC
-<
-
-# Diff for:
-#============================================================
-# < pthreads-1_60beta6/gen/ctime.c
-# > PTEST/pthreads-1_60beta6/gen/ctime.c
-#------------------------------------------------------------
-49c49
-< #include "config.h"
----
->
-
-# Diff for:
-#============================================================
-# < pthreads-1_60beta6/include/math.h
-# > PTEST/pthreads-1_60beta6/include/math.h
-#------------------------------------------------------------
-54d53
-< double hypot __P((double, double));
-
-
-Bill Lear (rael@dejanews.com)
-
diff --git a/mit-pthreads/patches/chris_demetriou b/mit-pthreads/patches/chris_demetriou
deleted file mode 100755
index 283d6c1999c..00000000000
--- a/mit-pthreads/patches/chris_demetriou
+++ /dev/null
@@ -1,149 +0,0 @@
-From cgd@pa.dec.com Fri Aug 15 04:22:21 1997
-X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
- ["3982" "Thu" "14" "August" "1997" "18:57:55" "-0700" "Chris G. Demetriou" "cgd@pa.dec.com" "<15218.871610275@dnaunix.pa.dec.com>" "126" "patches to get 1.60 beta6 to build on ELF NetBSD/alpha systems" "^From:" nil nil "8" "1997081501:57:55" "patches to get 1.60 beta6 to build on ELF NetBSD/alpha systems" nil nil]
- nil)
-Received: from MIT.EDU (PACIFIC-CARRIER-ANNEX.MIT.EDU [18.69.0.28])
- by analytik.analytikerna.se (8.8.4/8.8.4) with SMTP
- id EAA10207 for <monty@analytikerna.se>; Fri, 15 Aug 1997 04:22:19 +0200 (MET DST)
-Received: from mail2.digital.com by MIT.EDU with SMTP
- id AA13470; Thu, 14 Aug 97 22:01:37 EDT
-Received: from dnaunix.pa.dec.com (dnaunix.pa.dec.com [16.4.208.21])
- by mail2.digital.com (8.7.5/UNX 1.5/1.0/WV) with SMTP id SAA15366;
- Thu, 14 Aug 1997 18:58:16 -0700 (PDT)
-Received: by dnaunix.pa.dec.com; id AA15044; Thu, 14 Aug 1997 18:57:56 -0700
-Message-Id: <15218.871610275@dnaunix.pa.dec.com>
-X-Mts: smtp
-Content-Length: 3981
-From: "Chris G. Demetriou" <cgd@pa.dec.com>
-Sender: cgd@pa.dec.com
-To: pthreads-bugs@MIT.EDU
-Cc: "Chris G. Demetriou" <cgd@pa.dec.com>, pthreads@MIT.EDU
-Subject: patches to get 1.60 beta6 to build on ELF NetBSD/alpha systems
-Date: Thu, 14 Aug 97 18:57:55 -0700
-
-Enclosed below are patches to pthreads 1.60 beta6 to build on
-current NetBSD/alpha systems (which use ELF). With these patches,
-pthreads passes 'make check.'
-
-As an aside, the test_switch test generates _340k_ of output ("a"
-for a while, then "ab" for a while) when run one the machine I was
-testing on. In my opinion, that's a ... bit excessive, especially
-since 'make check' has to be run interactively!
-
-
-
-chris
-============================================================================
-diff -rc pthreads-1_60_beta6.orig/config/Makefile.in pthreads-1_60_beta6/config/Makefile.in
-*** pthreads-1_60_beta6.orig/config/Makefile.in Thu Mar 21 20:29:54 1996
---- pthreads-1_60_beta6/config/Makefile.in Thu Aug 14 17:56:55 1997
-***************
-*** 29,35 ****
- # pathname for srcdir here, and live with it.
- srcdir = $(srctop)
-
-! beforeinstall:: install-dirs
-
- .include "${srcdir}/pthreads/Makefile.inc"
- .include "${srcdir}/stdlib/Makefile.inc"
---- 29,35 ----
- # pathname for srcdir here, and live with it.
- srcdir = $(srctop)
-
-! beforeinstall: install-dirs
-
- .include "${srcdir}/pthreads/Makefile.inc"
- .include "${srcdir}/stdlib/Makefile.inc"
-diff -rc pthreads-1_60_beta6.orig/machdep/syscall-alpha-netbsd-1.1.S pthreads-1_60_beta6/machdep/syscall-alpha-netbsd-1.1.S
-*** pthreads-1_60_beta6.orig/machdep/syscall-alpha-netbsd-1.1.S Wed Nov 13 13:03:28 1996
---- pthreads-1_60_beta6/machdep/syscall-alpha-netbsd-1.1.S Thu Aug 14 18:03:27 1997
-***************
-*** 35,54 ****
- .frame sp,0,ra ;\
- ldiq v0, CONCAT(SYS_,x) ;\
- CHMK() ;\
-! beq a3, 2f ;\
-! br gp, 1f ;\
-! 1: ;\
- /* Load gp so we can find cerror to jump to. */;\
- ldgp gp, 0(gp) ;\
-! jmp zero, machdep_cerror ;\
-! 2:
-
- #define XSYSCALL(x) SYSCALL(x) ; RET ; .end CONCAT(machdep_sys_,x)
-
- .globl machdep_cerror
- machdep_cerror:
-! br t0, 1f
-! 1:
- ldgp gp, 0(t0)
- stl v0, errno
- #if 0
---- 35,54 ----
- .frame sp,0,ra ;\
- ldiq v0, CONCAT(SYS_,x) ;\
- CHMK() ;\
-! beq a3, CONCAT(Lsys_noerr_,x) ;\
-! br gp, CONCAT(Lsys_err_,x) ;\
-! CONCAT(Lsys_err_,x): ;\
- /* Load gp so we can find cerror to jump to. */;\
- ldgp gp, 0(gp) ;\
-! jmp zero, machdep_cerror ;\
-! CONCAT(Lsys_noerr_,x):
-
- #define XSYSCALL(x) SYSCALL(x) ; RET ; .end CONCAT(machdep_sys_,x)
-
- .globl machdep_cerror
- machdep_cerror:
-! br t0, Lmachdep_cerror_setgp
-! Lmachdep_cerror_setgp:
- ldgp gp, 0(t0)
- stl v0, errno
- #if 0
-diff -rc pthreads-1_60_beta6.orig/machdep/syscall-template-alpha-netbsd-1.1.S pthreads-1_60_beta6/machdep/syscall-template-alpha-netbsd-1.1.S
-*** pthreads-1_60_beta6.orig/machdep/syscall-template-alpha-netbsd-1.1.S Mon Apr 22 23:15:42 1996
---- pthreads-1_60_beta6/machdep/syscall-template-alpha-netbsd-1.1.S Thu Aug 14 17:58:14 1997
-***************
-*** 31,43 ****
- .frame sp,0,ra ;\
- ldiq v0, SYS_##x ;\
- CHMK() ;\
-! beq a3, 2f ;\
-! br gp, 1f ;\
-! 1: ;\
- /* Load gp so we can find cerror to jump to. */;\
- ldgp gp, 0(gp) ;\
-! jmp zero, machdep_cerror ;\
-! 2:
-
- #define SIMPLE_SYSCALL(x) SYSCALL(x) ; ret ; .end machdep_sys_##x
-
---- 31,43 ----
- .frame sp,0,ra ;\
- ldiq v0, SYS_##x ;\
- CHMK() ;\
-! beq a3, Lsys_noerr_##x ;\
-! br gp, Lsys_err_##x ;\
-! Lsys_err_##x: ;\
- /* Load gp so we can find cerror to jump to. */;\
- ldgp gp, 0(gp) ;\
-! jmp zero, machdep_cerror ;\
-! Lsys_noerr_##x:
-
- #define SIMPLE_SYSCALL(x) SYSCALL(x) ; ret ; .end machdep_sys_##x
-
-diff -rc pthreads-1_60_beta6.orig/pthreads/process.c pthreads-1_60_beta6/pthreads/process.c
-*** pthreads-1_60_beta6.orig/pthreads/process.c Tue Nov 12 05:45:16 1996
---- pthreads-1_60_beta6/pthreads/process.c Thu Aug 14 18:12:49 1997
-***************
-*** 40,45 ****
---- 40,47 ----
- #include <stdarg.h>
- #include <unistd.h>
-
-+ extern void *alloca();
-+
- #ifndef lint
- static const char rcsid[] = "$Id$";
- #endif
-
diff --git a/mit-pthreads/patches/mevans b/mit-pthreads/patches/mevans
deleted file mode 100755
index d5ff2f27610..00000000000
--- a/mit-pthreads/patches/mevans
+++ /dev/null
@@ -1,642 +0,0 @@
-=A0
-Attached are several patches for pthreads-1_60_beta6. The patches fall
-into 3 catagories:
-
- 1. Crashes and hangs.
- 2. Missing functionality (namely flock())
- 3. Use of POSIX reentrant safe routines.
-
-Most of the patches contain a comment as to why the change was made.
-The one major exception is to fd_kern.c at line 257 (unpatched). The
-change to that line is to fix a "hang" that prevents threads for
-scheduling for an hour if there is no external I/O event.
-
-I also include patches that modify several functions to use POSIX
-reentrant safe routines. I know that MIT pthreads implements routine
-like gethostbyname in a thread safe manner, but we're pretty, um, anal
-about trying to keep our code as portable as possible. By excluding
-using routines that are not reentrant safe according to the PTHREAD
-safe, it's easy for us to stub out the unsafe routines and catch
-non-compliant code. I almost left these patches out, but I'm hoping
-they'll be adopted. :-)
-
-WARNING: None of the MIT pthreads routines that convert floats/doubles
-between their native forms and strings are thread safe! (i.e printf,
-sprintf, fprintf, atod, strtod, etc) I have replacements, but I need to
-check with the author of the replacements and my employer.
-
-Mark Evans
-
-------------69CDAAF52A3566916F8ED01A0
-Content-Disposition: inline; filename="pthreads-1_60_beta6.patch"
-Content-Type: text/plain; charset=us-ascii; name="pthreads-1_60_beta6.patch"
-Content-Transfer-Encoding: 7bit
-
-diff -c -b -r -d -I .*$Id:.* pthreads-1_60_beta6/config/config.h.in pthreads-1_60_beta6+/config/config.h.in
-*** pthreads-1_60_beta6/config/config.h.in Thu Mar 21 21:30:04 1996
---- pthreads-1_60_beta6+/config/config.h.in Sat Mar 15 14:08:55 1997
-***************
-*** 137,142 ****
---- 137,145 ----
- /* Define if you have the syscall_ftruncate function. */
- #undef HAVE_SYSCALL_FTRUNCATE
-
-+ /* Define if you have the syscall_flock function. */
-+ #undef HAVE_SYSCALL_FLOCK
-+
- /* Define if you have the syscall_getdents function. */
- #undef HAVE_SYSCALL_GETDENTS
-
-diff -c -b -r -d -I .*$Id:.* pthreads-1_60_beta6/config/configure.in pthreads-1_60_beta6+/config/configure.in
-*** pthreads-1_60_beta6/config/configure.in Wed Nov 13 14:03:08 1996
---- pthreads-1_60_beta6+/config/configure.in Sat Mar 15 14:08:55 1997
-***************
-*** 241,247 ****
-
- PTHREADS_CHECK_SYSCALLS(open write read creat close fcntl lseek dup2 dup pipe
- fchmod fchown execve fstat lstat link unlink chdir chown chmod stat
-! rename select getdtablesize ioctl ftruncate
- dnl - signals
- sigsuspend sigaction sigpause sigprocmask ksigaction
- dnl - directory reading
---- 241,247 ----
-
- PTHREADS_CHECK_SYSCALLS(open write read creat close fcntl lseek dup2 dup pipe
- fchmod fchown execve fstat lstat link unlink chdir chown chmod stat
-! rename select getdtablesize ioctl ftruncate flock
- dnl - signals
- sigsuspend sigaction sigpause sigprocmask ksigaction
- dnl - directory reading
-diff -c -b -r -d -I .*$Id:.* pthreads-1_60_beta6/gen/directory.c pthreads-1_60_beta6+/gen/directory.c
-*** pthreads-1_60_beta6/gen/directory.c Sat May 20 10:55:34 1995
---- pthreads-1_60_beta6+/gen/directory.c Sat Mar 15 14:08:55 1997
-***************
-*** 251,262 ****
---- 251,266 ----
- /*
- * Seek to an entry in a directory.
- * _seekdir is in telldir.c so that it can share opaque data structures.
-+ *
-+ * Use the POSIX reentrant safe readdir_r to simplify varifying POSIX
-+ * thread-safe compliance.
- */
- void seekdir(DIR * dirp, long loc)
- {
- register struct ddloc ** prevlp;
- register struct ddloc * lp;
- struct dirent * dp;
-+ struct dirent de;
-
- pthread_mutex_lock (dirp->dd_lock);
- prevlp = (struct ddloc **)&(dirp->dd_ddloc);
-***************
-*** 277,283 ****
- dirp->dd_seek = lp->loc_seek;
- dirp->dd_loc = 0;
- while (dirp->dd_loc < lp->loc_loc) {
-! if (!(dp = readdir(dirp))) {
- *prevlp = lp->loc_next;
- break;
- }
---- 281,287 ----
- dirp->dd_seek = lp->loc_seek;
- dirp->dd_loc = 0;
- while (dirp->dd_loc < lp->loc_loc) {
-! if (readdir_r(dirp, &de, &dp)) {
- *prevlp = lp->loc_next;
- break;
- }
-diff -c -b -r -d -I .*$Id:.* pthreads-1_60_beta6/gen/getcwd.c pthreads-1_60_beta6+/gen/getcwd.c
-*** pthreads-1_60_beta6/gen/getcwd.c Sat Sep 2 17:39:30 1995
---- pthreads-1_60_beta6+/gen/getcwd.c Sat Mar 15 14:08:55 1997
-***************
-*** 50,67 ****
- (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \
- dp->d_name[1] == '.' && dp->d_name[2] == '\0'))
-
- char *
- getcwd(pt, size)
- char *pt;
- size_t size;
- {
-- register struct dirent *dp;
- register DIR *dir;
- register dev_t dev;
- register ino_t ino;
- register int first;
- register char *bpt, *bup;
- struct stat s;
- dev_t root_dev;
- ino_t root_ino;
- size_t ptsize, upsize;
---- 50,71 ----
- (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \
- dp->d_name[1] == '.' && dp->d_name[2] == '\0'))
-
-+ /* Only use reentrant safe routines to simplify varifying POSIX thread-safe
-+ * compliance. (mevans).
-+ */
- char *
- getcwd(pt, size)
- char *pt;
- size_t size;
- {
- register DIR *dir;
- register dev_t dev;
- register ino_t ino;
- register int first;
- register char *bpt, *bup;
- struct stat s;
-+ struct dirent *dp;
-+ struct dirent de;
- dev_t root_dev;
- ino_t root_ino;
- size_t ptsize, upsize;
-***************
-*** 166,179 ****
- save_errno = 0;
- if (s.st_dev == dev) {
- for (;;) {
-! if (!(dp = readdir(dir)))
- goto notfound;
- if (dp->d_fileno == ino)
- break;
- }
- } else
- for (;;) {
-! if (!(dp = readdir(dir)))
- goto notfound;
- if (ISDOT(dp))
- continue;
---- 170,183 ----
- save_errno = 0;
- if (s.st_dev == dev) {
- for (;;) {
-! if (readdir_r(dir, &de, &dp))
- goto notfound;
- if (dp->d_fileno == ino)
- break;
- }
- } else
- for (;;) {
-! if (readdir_r(dir, &de, &dp))
- goto notfound;
- if (ISDOT(dp))
- continue;
-diff -c -b -r -d -I .*$Id:.* pthreads-1_60_beta6/include/syslog.h pthreads-1_60_beta6+/include/syslog.h
-*** pthreads-1_60_beta6/include/syslog.h Mon Sep 26 21:26:29 1994
---- pthreads-1_60_beta6+/include/syslog.h Sat Mar 15 14:08:56 1997
-***************
-*** 9,14 ****
---- 9,16 ----
- #ifndef SYSLOG_H
- #define SYSLOG_H
-
-+ /* Added __[BEGIN/END]_DECLS so this file would work with C++. (mevans) */
-+ #include <sys/cdefs.h>
- #include <stdarg.h>
-
- /* Discipline: openlog(), closelog(), and setlogmask() are not thread-safe
-***************
-*** 84,95 ****
---- 86,101 ----
- #define LOG_NDELAY 0x08 /* don't delay open */
- #define LOG_NOWAIT 0x10 /* if forking to log on console, don't wait() */
-
-+ __BEGIN_DECLS
-+
- /* Syslogging functions. */
- void syslog(int pri, char *fmt, ...);
- void vsyslog(int pri, char *fmt, va_list args);
- void openlog(char *ident, int logstat, int logfac);
- void closelog(void);
- int setlogmask(int pmask);
-+
-+ __END_DECLS
-
- #endif
-
-diff -c -b -r -d -I .*$Id:.* pthreads-1_60_beta6/machdep/engine-i386-linux-1.0.c pthreads-1_60_beta6+/machdep/engine-i386-linux-1.0.c
-*** pthreads-1_60_beta6/machdep/engine-i386-linux-1.0.c Mon Oct 21 20:39:13 1996
---- pthreads-1_60_beta6+/machdep/engine-i386-linux-1.0.c Sat Mar 15 14:08:56 1997
-***************
-*** 142,147 ****
---- 142,149 ----
- * machdep_pthread_start().
- */
- machdep_pthread->machdep_state->__pc = (char *)machdep_pthread_start;
-+ machdep_pthread->machdep_state->__bp = (char *)0;/* So the backtrace
-+ * is sensible (mevans) */
-
- /* Stack starts high and builds down. */
- machdep_pthread->machdep_state->__sp =
-diff -c -b -r -d -I .*$Id:.* pthreads-1_60_beta6/machdep/syscall-i386-linux-1.0.S pthreads-1_60_beta6+/machdep/syscall-i386-linux-1.0.S
-*** pthreads-1_60_beta6/machdep/syscall-i386-linux-1.0.S Mon Oct 21 22:17:32 1996
---- pthreads-1_60_beta6+/machdep/syscall-i386-linux-1.0.S Sat Mar 15 14:08:56 1997
-***************
-*** 148,156 ****
- /* =========================================================================
- * exit 1 select 82
- * fork 2 socketcall 102
-! * read 3 readv 145
-! * write 4 writev 146
-! * open 5
- * creat 8
- * link 9
- * unlink 10
---- 148,156 ----
- /* =========================================================================
- * exit 1 select 82
- * fork 2 socketcall 102
-! * read 3 flock 143
-! * write 4 readv 145
-! * open 5 writev 146
- * creat 8
- * link 9
- * unlink 10
-***************
-*** 390,394 ****
---- 390,401 ----
- */
- #ifdef HAVE_SYSCALL_WRITEV
- SYSCALL3(writev)
-+ #endif
-+
-+ /* ==========================================================================
-+ * machdep_sys_flock()
-+ */
-+ #ifdef HAVE_SYSCALL_FLOCK
-+ SYSCALL2(flock)
- #endif
-
-diff -c -b -r -d -I .*$Id:.* pthreads-1_60_beta6/net/gethostbyname.c pthreads-1_60_beta6+/net/gethostbyname.c
-*** pthreads-1_60_beta6/net/gethostbyname.c Mon Apr 22 22:41:21 1996
---- pthreads-1_60_beta6+/net/gethostbyname.c Sat Mar 15 14:08:58 1997
-***************
-*** 146,161 ****
- {
- char **alias;
- FILE *fp = NULL;
-
- pthread_mutex_lock(&host_iterate_lock);
- sethostent(0);
-! while ((result = gethostent_r(result, buf, bufsize, errval)) != NULL) {
- /* Check the entry's name and aliases against the given name. */
- if (strcasecmp(result->h_name, name) == 0)
- break;
- for (alias = result->h_aliases; *alias; alias++) {
-! if (strcasecmp(*alias, name) == 0)
- break;
- }
- }
- pthread_mutex_unlock(&host_iterate_lock);
---- 146,166 ----
- {
- char **alias;
- FILE *fp = NULL;
-+ int fFound = FALSE;
-
- pthread_mutex_lock(&host_iterate_lock);
- sethostent(0);
-! while (!fFound && (result = gethostent_r(result, buf, bufsize, errval))
-! != NULL) {
- /* Check the entry's name and aliases against the given name. */
- if (strcasecmp(result->h_name, name) == 0)
- break;
- for (alias = result->h_aliases; *alias; alias++) {
-! if (strcasecmp(*alias, name) == 0) {
-! /* fFound will exit while loop. (mevans). */
-! fFound = TRUE;
- break;
-+ }
- }
- }
- pthread_mutex_unlock(&host_iterate_lock);
-diff -c -b -r -d -I .*$Id:.* pthreads-1_60_beta6/net/res_debug.c pthreads-1_60_beta6+/net/res_debug.c
-*** pthreads-1_60_beta6/net/res_debug.c Thu Feb 23 22:42:35 1995
---- pthreads-1_60_beta6+/net/res_debug.c Sat Mar 15 14:08:58 1997
-***************
-*** 375,380 ****
---- 375,383 ----
-
- /*
- * Print resource record fields in human readable form.
-+ *
-+ * Removed calls to non-reentrant routines to simplify varifying
-+ * POSIX thread-safe implementations. (mevans).
- */
- char *
- p_rr(cp, msg, file)
-***************
-*** 386,391 ****
---- 389,395 ----
- char *cp1, *cp2;
- u_long tmpttl, t;
- int lcnt;
-+ char buf[32];
-
- if ((cp = p_fqname(cp, msg, file)) == NULL)
- return (NULL); /* compression error */
-***************
-*** 413,426 ****
- case C_HS:
- bcopy(cp, (char *)&inaddr, sizeof(inaddr));
- if (dlen == 4) {
-! fprintf(file,"\t%s", inet_ntoa(inaddr));
- cp += dlen;
- } else if (dlen == 7) {
- char *address;
- u_char protocol;
- u_short port;
-
-! address = inet_ntoa(inaddr);
- cp += sizeof(inaddr);
- protocol = *(u_char*)cp;
- cp += sizeof(u_char);
---- 417,432 ----
- case C_HS:
- bcopy(cp, (char *)&inaddr, sizeof(inaddr));
- if (dlen == 4) {
-! fprintf(file,"\t%s",
-! inet_ntoa_r(inaddr, buf, sizeof(buf)));
- cp += dlen;
- } else if (dlen == 7) {
- char *address;
- u_char protocol;
- u_short port;
-
-! address = inet_ntoa_r(inaddr,
-! buf, sizeof(buf));
- cp += sizeof(inaddr);
- protocol = *(u_char*)cp;
- cp += sizeof(u_char);
-***************
-*** 524,530 ****
- bcopy(cp, (char *)&inaddr, sizeof(inaddr));
- cp += sizeof(u_long);
- fprintf(file, "\t%s %s ( ",
-! inet_ntoa(inaddr),
- deproto((int) *cp));
- cp += sizeof(u_char);
- n = 0;
---- 530,536 ----
- bcopy(cp, (char *)&inaddr, sizeof(inaddr));
- cp += sizeof(u_long);
- fprintf(file, "\t%s %s ( ",
-! inet_ntoa_r(inaddr, buf, sizeof(buf)),
- deproto((int) *cp));
- cp += sizeof(u_char);
- n = 0;
-diff -c -b -r -d -I .*$Id:.* pthreads-1_60_beta6/pthreads/fd_kern.c pthreads-1_60_beta6+/pthreads/fd_kern.c
-*** pthreads-1_60_beta6/pthreads/fd_kern.c Tue Oct 1 12:26:48 1996
---- pthreads-1_60_beta6+/pthreads/fd_kern.c Sat Mar 15 14:09:00 1997
-***************
-*** 215,221 ****
- * Called when there is no active thread to run.
- */
- extern struct timeval __fd_kern_wait_timeout;
-!
- void fd_kern_wait()
- {
- fd_set fd_set_read, fd_set_write, fd_set_except;
---- 215,221 ----
- * Called when there is no active thread to run.
- */
- extern struct timeval __fd_kern_wait_timeout;
-! extern volatile sig_atomic_t sig_to_process;
- void fd_kern_wait()
- {
- fd_set fd_set_read, fd_set_write, fd_set_except;
-***************
-*** 254,260 ****
-
- machdep_unset_thread_timer(NULL);
- __fd_kern_wait_timeout.tv_usec = 0;
-! __fd_kern_wait_timeout.tv_sec = 3600;
-
- machdep_sys_sigprocmask(SIG_UNBLOCK, &sig_to_block, &oset);
-
---- 254,260 ----
-
- machdep_unset_thread_timer(NULL);
- __fd_kern_wait_timeout.tv_usec = 0;
-! __fd_kern_wait_timeout.tv_sec = (sig_to_process) ? 0 : 3600;
-
- machdep_sys_sigprocmask(SIG_UNBLOCK, &sig_to_block, &oset);
-
-***************
-*** 726,731 ****
---- 726,753 ----
- return(ret);
- }
-
-+ #if defined (HAVE_SYSCALL_FLOCK)
-+ /* ==========================================================================
-+ * flock()
-+ *
-+ * Added (mevans)
-+ */
-+ int flock(int fd, int operation)
-+ {
-+ int ret;
-+
-+ if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
-+ if ((ret = machdep_sys_flock(fd_table[fd]->fd.i,
-+ operation)) < OK) {
-+ SET_ERRNO(-ret);
-+ ret = NOTOK;
-+ }
-+ fd_unlock(fd, FD_RDWR);
-+ }
-+ return(ret);
-+ }
-+ #endif
-+
- /* ==========================================================================
- * pipe()
- */
-***************
-*** 1126,1132 ****
- /* Get the error, this function should not fail */
- machdep_sys_getsockopt(fd_table[fd]->fd.i, SOL_SOCKET,
- SO_ERROR, &ret, &tmpnamelen);
-! SET_ERRNO(-ret);
- ret = NOTOK;
- }
- } else {
---- 1148,1155 ----
- /* Get the error, this function should not fail */
- machdep_sys_getsockopt(fd_table[fd]->fd.i, SOL_SOCKET,
- SO_ERROR, &ret, &tmpnamelen);
-! /* ret is already positive (mevans) */
-! SET_ERRNO(ret);
- ret = NOTOK;
- }
- } else {
-diff -c -b -r -d -I .*$Id:.* pthreads-1_60_beta6/pthreads/malloc.c pthreads-1_60_beta6+/pthreads/malloc.c
-*** pthreads-1_60_beta6/pthreads/malloc.c Thu Mar 9 21:06:43 1995
---- pthreads-1_60_beta6+/pthreads/malloc.c Sat Mar 15 14:09:00 1997
-***************
-*** 196,204 ****
- else
- n = n - x;
- if (n) {
-! if (sbrk(n) == (char *)-1)
- return (NULL);
- }
- bucket = 0;
- amt = 8;
- while (pagesz > amt) {
---- 196,207 ----
- else
- n = n - x;
- if (n) {
-! if (sbrk(n) == (char *)-1) {
-! /* Unlock before returning (mevans) */
-! pthread_mutex_unlock(mutex);
- return (NULL);
- }
-+ }
- bucket = 0;
- amt = 8;
- while (pagesz > amt) {
-***************
-*** 363,366 ****
---- 366,382 ----
- free(cp);
-
- return (res);
-+ }
-+ /* ==========================================================================
-+ * calloc()
-+ *
-+ * Added to ensure pthread's allocation is used (mevans).
-+ */
-+ void *calloc(size_t nmemb, size_t size)
-+ {
-+ void *p;
-+ size *= nmemb;
-+ p = malloc(size);
-+ if (p) memset(p, 0, size);
-+ return (p);
- }
-diff -c -b -r -d -I .*$Id:.* pthreads-1_60_beta6/pthreads/select.c pthreads-1_60_beta6+/pthreads/select.c
-*** pthreads-1_60_beta6/pthreads/select.c Sat Jul 6 21:58:55 1996
---- pthreads-1_60_beta6+/pthreads/select.c Sat Mar 15 14:09:00 1997
-***************
-*** 165,176 ****
- pthread_resched_resume(PS_SELECT_WAIT);
-
- /* We're awake */
-- CLEAR_PF_DONE_EVENT(pthread_run);
- if (sleep_cancel(pthread_run) == NOTOK) {
- ret = OK;
- } else {
- ret = data.nfds;
- }
- } else {
- pthread_resched_resume(PS_SELECT_WAIT);
- CLEAR_PF_DONE_EVENT(pthread_run);
---- 165,180 ----
- pthread_resched_resume(PS_SELECT_WAIT);
-
- /* We're awake */
- if (sleep_cancel(pthread_run) == NOTOK) {
- ret = OK;
- } else {
- ret = data.nfds;
- }
-+ /* Moving this after the sleep_cancel() seemed
-+ * to fix intermittent crashes during heavy
-+ * socket use. (mevans)
-+ */
-+ CLEAR_PF_DONE_EVENT(pthread_run);
- } else {
- pthread_resched_resume(PS_SELECT_WAIT);
- CLEAR_PF_DONE_EVENT(pthread_run);
-diff -c -b -r -d -I .*$Id:.* pthreads-1_60_beta6/pthreads/signal.c pthreads-1_60_beta6+/pthreads/signal.c
-*** pthreads-1_60_beta6/pthreads/signal.c Tue Mar 12 21:33:17 1996
---- pthreads-1_60_beta6+/pthreads/signal.c Sat Mar 15 14:09:00 1997
-***************
-*** 65,71 ****
- */
-
- static sig_atomic_t signum_to_process[SIGMAX + 1] = { 0, };
-! static sig_atomic_t sig_to_process = 0;
-
- /* static volatile sigset_t sig_to_process; */
- static volatile int sig_count = 0;
---- 65,71 ----
- */
-
- static sig_atomic_t signum_to_process[SIGMAX + 1] = { 0, };
-! volatile sig_atomic_t sig_to_process = 0;
-
- /* static volatile sigset_t sig_to_process; */
- static volatile int sig_count = 0;
-***************
-*** 303,309 ****
- break;
- case NOTOK:
- /* Do the registered action, no threads were sleeping */
-! sigdefault(sig);
- break;
- }
- break;
---- 303,317 ----
- break;
- case NOTOK:
- /* Do the registered action, no threads were sleeping */
-! /* There is a timing window that gets
-! * here when no threads are on the
-! * sleep queue. This is a quick fix.
-! * The real problem is possibly related
-! * to heavy use of condition variables
-! * with time outs.
-! * (mevans)
-! *sigdefault(sig);
-! */
- break;
- }
- break;
-diff -c -b -r -d -I .*$Id:.* pthreads-1_60_beta6/stdio/setvbuf.c pthreads-1_60_beta6+/stdio/setvbuf.c
-*** pthreads-1_60_beta6/stdio/setvbuf.c Sat Sep 3 20:58:36 1994
---- pthreads-1_60_beta6+/stdio/setvbuf.c Sat Mar 15 14:09:00 1997
-***************
-*** 142,148 ****
- flags |= __SLBF;
- if (flags & __SRW)
- flags &= ~(__SRD | __SWR);
-! fp->_w = 0;
- fp->_flags = flags;
- fp->_bf._base = fp->_p = (unsigned char *)buf;
- fp->_bf._size = size;
---- 142,148 ----
- flags |= __SLBF;
- if (flags & __SRW)
- flags &= ~(__SRD | __SWR);
-! fp->_w = size; /* Was 0 (mevans) */
- fp->_flags = flags;
- fp->_bf._base = fp->_p = (unsigned char *)buf;
- fp->_bf._size = size;
-diff -c -b -r -d -I .*$Id:.* pthreads-1_60_beta6/stdlib/system.c pthreads-1_60_beta6+/stdlib/system.c
-*** pthreads-1_60_beta6/stdlib/system.c Wed Apr 24 21:18:56 1996
---- pthreads-1_60_beta6+/stdlib/system.c Sat Mar 15 14:09:01 1997
-***************
-*** 62,68 ****
- argp[2] = (char *) command;
- sigemptyset(&tmp_mask);
- sigaddset(&tmp_mask, SIGCHLD);
-! pthread_sigmask(SIG_BLOCK, tmp_mask, &old_mask);
- switch(pid = fork()) {
- case -1: /* error */
- (void)pthread_sigmask(SIG_SETMASK, &old_mask, NULL);
---- 62,69 ----
- argp[2] = (char *) command;
- sigemptyset(&tmp_mask);
- sigaddset(&tmp_mask, SIGCHLD);
-! /* Pass the address of tmp_mask to avoid a sigfault. (mevans). */
-! pthread_sigmask(SIG_BLOCK, &tmp_mask, &old_mask);
- switch(pid = fork()) {
- case -1: /* error */
- (void)pthread_sigmask(SIG_SETMASK, &old_mask, NULL);
diff --git a/mit-pthreads/patches/p153 b/mit-pthreads/patches/p153
deleted file mode 100755
index 4e374e29a10..00000000000
--- a/mit-pthreads/patches/p153
+++ /dev/null
@@ -1,90 +0,0 @@
-<HEAD><TITLE>discuss@charon.mit.edu: [153] in "Pthreads Bugs"</TITLE>
-<H1>[153] in Pthreads Bugs</H1></HEAD>
-<A HREF="/"><IMG SRC="/i-d.gif" ALT="root"></A>
-<A HREF="?153"><IMG SRC="/i-back.gif" ALT="meeting"></A>
-<A HREF="/help.html"><IMG SRC="/i-help.gif" ALT="help"></A>
-<A HREF="1"><IMG SRC="/i-first.gif" ALT="first"></A>
-<A HREF="151"><IMG SRC="/i-fref.gif" ALT="first in chain"></A>
-<A HREF="152"><IMG SRC="/i-pref.gif" ALT="previous in chain"></A>
-<A HREF="152"><IMG SRC="/i-prev.gif" ALT="previous"></A>
-<A HREF="154"><IMG SRC="/i-next.gif" ALT="next"></A>
-<IMG SRC="/n-nref.gif" ALT="">
-<IMG SRC="/n-lref.gif" ALT="">
-<A HREF="161"><IMG SRC="/i-last.gif" ALT="last"></A>
-<HR><H2>Re: sleep / SIGALRM problem in 1_60_beta6</H2>
-<H3>daemon@ATHENA.MIT.EDU (Mon Dec 9 19:32:22 1996
-)</H3>
-<PRE>
-Date: Mon, 09 Dec 1996 17:22:50 -0700
-From: "Mark M. Evans" &lt;mevans@cti-ltd.com&gt;
-To: Tim Hinderliter &lt;kyd@internap.com&gt;
-Cc: pthreads-bugs@MIT.EDU
-
-I think I found what caused fd_kern_wait() to block for the entire
-hour (instead of waking up due to the SIGALRM). Basically, the
-SIGALRM that would move the sleeping thread to the run queue occurs
-while pthread_kernel_lock is set, but *before* the critical section in
-fd_kern_wait() that sets __fd_kern_wait_timeout.tv_sec to 3600. So,
-sig_handler_real() clears __fd_kern_wait_timeout.tv_sec "too soon."
-
-I've worked around this by checking sig_to_process in the critical
-section to determine if we are truly idle. To do this I had to make
-sig_to_process publicly available.
-
-Here are the diffs (relative to the pthreads/pthreads directory):
-
-diff -c -r1.2 -r1.3
-*** signal.c 1996/11/20 05:09:50 1.2
---- signal.c 1996/12/09 23:14:52 1.3
-***************
-*** 65,71 ****
- */
-
- static sig_atomic_t signum_to_process[SIGMAX + 1] = { 0, };
-! static sig_atomic_t sig_to_process = 0;
-
- /* static volatile sigset_t sig_to_process; */
- static volatile int sig_count = 0;
---- 65,71 ----
- */
-
- static sig_atomic_t signum_to_process[SIGMAX + 1] = { 0, };
-! sig_atomic_t sig_to_process = 0;
-
- /* static volatile sigset_t sig_to_process; */
- static volatile int sig_count = 0;
-*** fd_kern.c 1996/12/03 04:14:59 1.6
---- fd_kern.c 1996/12/09 23:14:51 1.7
-***************
-*** 215,221 ****
- * Called when there is no active thread to run.
- */
- extern struct timeval __fd_kern_wait_timeout;
-!
- void fd_kern_wait()
- {
- fd_set fd_set_read, fd_set_write, fd_set_except;
---- 215,221 ----
- * Called when there is no active thread to run.
- */
- extern struct timeval __fd_kern_wait_timeout;
-! extern volatile sig_atomic_t sig_to_process;
- void fd_kern_wait()
- {
- fd_set fd_set_read, fd_set_write, fd_set_except;
-***************
-*** 254,260 ****
-
- machdep_unset_thread_timer(NULL);
- __fd_kern_wait_timeout.tv_usec = 0;
-! __fd_kern_wait_timeout.tv_sec = 3600;
-
- machdep_sys_sigprocmask(SIG_UNBLOCK, &amp;sig_to_block, &amp;oset);
-
---- 254,260 ----
-
- machdep_unset_thread_timer(NULL);
- __fd_kern_wait_timeout.tv_usec = 0;
-! __fd_kern_wait_timeout.tv_sec = (sig_to_process) ? 0 : 3600;
-
- machdep_sys_sigprocmask(SIG_UNBLOCK, &amp;sig_to_block, &amp;oset);
diff --git a/mit-pthreads/patches/p155 b/mit-pthreads/patches/p155
deleted file mode 100755
index dbdfa7de899..00000000000
--- a/mit-pthreads/patches/p155
+++ /dev/null
@@ -1,96 +0,0 @@
-<HEAD><TITLE>discuss@charon.mit.edu: [155] in "Pthreads Bugs"</TITLE>
-<H1>[155] in Pthreads Bugs</H1></HEAD>
-<A HREF="/"><IMG SRC="/i-d.gif" ALT="root"></A>
-<A HREF="?155"><IMG SRC="/i-back.gif" ALT="meeting"></A>
-<A HREF="/help.html"><IMG SRC="/i-help.gif" ALT="help"></A>
-<A HREF="1"><IMG SRC="/i-first.gif" ALT="first"></A>
-<IMG SRC="/n-fref.gif" ALT="">
-<IMG SRC="/n-pref.gif" ALT="">
-<A HREF="154"><IMG SRC="/i-prev.gif" ALT="previous"></A>
-<A HREF="156"><IMG SRC="/i-next.gif" ALT="next"></A>
-<IMG SRC="/n-nref.gif" ALT="">
-<IMG SRC="/n-lref.gif" ALT="">
-<A HREF="161"><IMG SRC="/i-last.gif" ALT="last"></A>
-<HR><H2>pthread_kill() Bug</H2>
-<H3>daemon@ATHENA.MIT.EDU (Thu Dec 26 20:34:45 1996
-)</H3>
-<PRE>
-From: Chris Colohan &lt;colohan@eecg.toronto.edu&gt;
-To: pthreads-bugs@MIT.EDU, proven@MIT.EDU
-Date: Thu, 26 Dec 1996 20:33:48 -0500
-
-pthread_kill() has a problem in PThreads 1.60beta6. It checks to see
-if the target thread is in the state PS_SIGWAIT, and if it is it
-reschedules it. But it does not check if there is more than one
-thread in the PS_SIGWAIT state, and hence mangles the pthread_sigwait
-linked list, potentially resulting in threads getting blocked forever,
-and signals never being delivered. I have a *very* contrived test
-case that demonstrates this problem if you would like it. Please let
-me know...
-
-Chris
-===
-
-Diffs created with diff -c:
-
-*** /home/colohan/thesis/t/pthreads-1_60_beta6/pthreads/pthread_kill.c Tue Feb 21 03:07:18 1995
---- pthread_kill.c Thu Dec 26 19:50:22 1996
-***************
-*** 41,51 ****
---- 41,58 ----
-
- #include &lt;pthread.h&gt;
-
-+ /* Defined in sig.c, a linked list of threads currently
-+ * blocked in sigwait(): */
-+ extern struct pthread * pthread_sigwait;
-+
-+
- /* ==========================================================================
- * pthread_kill()
- */
- int pthread_kill(struct pthread * pthread, int sig)
- {
-+ struct pthread ** pthread_ptr;
-+
- pthread_sched_prevent();
-
- /* Check who is the current owner of pthread */
-***************
-*** 53,62 ****
- if (0) {
- } else {
- if (pthread-&gt;state == PS_SIGWAIT) {
-! if (sigismember(pthread-&gt;data.sigwait, sig)) {
-! *(int *)(pthread-&gt;ret) = sig;
-! pthread_sched_other_resume(pthread);
-! return(OK);
- }
- }
- sigaddset(&amp;(pthread-&gt;sigpending), sig);
---- 60,84 ----
- if (0) {
- } else {
- if (pthread-&gt;state == PS_SIGWAIT) {
-! if(sigismember(pthread-&gt;data.sigwait, sig)) {
-! for (pthread_ptr = &amp;pthread_sigwait;
-! (*pthread_ptr);
-! pthread_ptr = &amp;((*pthread_ptr)-&gt;next)) {
-! if ((*pthread_ptr) == pthread) {
-!
-! /* Take the thread out of the
-! * pthread_sigwait linked list: */
-! *pthread_ptr=(*pthread_ptr)-&gt;next;
-!
-! *(int *)(pthread-&gt;ret) = sig;
-! pthread_sched_other_resume(pthread);
-! return(OK);
-! }
-! }
-! /* A thread should not be in the state PS_SIGWAIT
-! * without being in the pthread_sigwait linked
-! * list: */
-! PANIC();
- }
- }
- sigaddset(&amp;(pthread-&gt;sigpending), sig);
diff --git a/mit-pthreads/pthreads/GNUmakefile.inc b/mit-pthreads/pthreads/GNUmakefile.inc
deleted file mode 100644
index c8621495bac..00000000000
--- a/mit-pthreads/pthreads/GNUmakefile.inc
+++ /dev/null
@@ -1,46 +0,0 @@
-# from: @(#)Makefile.inc 5.6 (Berkeley) 6/4/91
-
-# pthread sources
-VPATH := $(VPATH):${srcdir}/pthreads
-
-SRCS:= cleanup.c cond.c fd.c fd_kern.c fd_pipe.c fd_sysv.c file.c globals.c \
- malloc.c mutex.c pthread.c pthread_attr.c queue.c signal.c machdep.c \
- syscall.S pthread_join.c pthread_detach.c pthread_once.c sleep.c \
- specific.c process.c wait.c errno.c schedparam.c _exit.c prio_queue.c \
- pthread_init.c init.cc sig.c info.c mutexattr.c select.c wrapper.c \
- dump_state.c pthread_kill.c stat.c readv.c writev.c condattr.c \
- pthread_cancel.c panic.c $(SRCS)
-
-ifeq ($(HAVE_SYSCALL_TEMPLATE),yes)
-SYSCALL_FILTER_RULE= for s in $(AVAILABLE_SYSCALLS) ; do \
- case " $(SYSCALL_EXCEPTIONS) " in \
- *" "$$s" "*) ;; \
- *) echo $$s ;; \
- esac ; \
- done
-STD_SYSCALLS:=$(shell $(SYSCALL_FILTER_RULE))
-STD_SYSCALL_FILES:= $(addprefix S,$(addsuffix .o,$(STD_SYSCALLS)))
-EXTRA_OBJS := $(EXTRA_OBJS) syscalls.o
-# EXTRA_OBJS := $(EXTRA_OBJS) $(STD_SYSCALL_FILES)
-
-ifndef SYSCALL_PIC_COMPILE
-SYSCALL_PIC_COMPILE=true
-endif
-
-obj/syscalls.o: syscall-template.S
- -rm -rf obj/syscalls
- mkdir obj/syscalls
- for syscall in $(STD_SYSCALLS) ; do \
- echo $$syscall ; \
- $(CC) $(CFLAGS) -DSYSCALL_NAME=$$syscall -c syscall-template.S -o obj/syscalls/S$$syscall.o ; \
- $(SYSCALL_PIC_COMPILE) ; \
- done
- x=`pwd` && cd obj/syscalls && ld -r -o ../syscalls.o S*.o && cd $$x
- rm -r obj/syscalls
-endif
-
-syscall.o: ${.CURDIR}/pthreads/syscall.S
- cpp ${CPPFLAGS} ${.CURDIR}/pthreads/syscall.S > syscall.i
- as syscall.i
- rm syscall.i
- mv a.out syscall.o
diff --git a/mit-pthreads/pthreads/Makefile.inc b/mit-pthreads/pthreads/Makefile.inc
deleted file mode 100644
index 3939d57de6e..00000000000
--- a/mit-pthreads/pthreads/Makefile.inc
+++ /dev/null
@@ -1,75 +0,0 @@
-# from: @(#)Makefile.inc 5.6 (Berkeley) 6/4/91
-
-# pthread sources
-.PATH: ${srcdir}/pthreads
-
-SRCS+= cleanup.c cond.c fd.c fd_kern.c fd_pipe.c file.c globals.c malloc.c \
- mutex.c pthread.c pthread_attr.c queue.c signal.c machdep.c syscall.S \
- pthread_join.c pthread_detach.c pthread_once.c sleep.c specific.c \
- process.c wait.c errno.c schedparam.c _exit.c prio_queue.c \
- pthread_init.c init.cc sig.c info.c mutexattr.c select.c wrapper.c \
- dump_state.c pthread_kill.c condattr.c pthread_cancel.c panic.c
-
-.if $(HAVE_SYSCALL_TEMPLATE) == yes
-OBJS+= syscalls.o
-.if !defined(NOPIC)
-SOBJS+= syscalls.so
-SYSCALL_PIC_COMPILE= $(CC) $(CFLAGS) -DSYSCALL_NAME=$$syscall -DPIC -c ${.CURDIR}/syscall-template.S -o ${.OBJDIR}/syscalls/S$$syscall.so
-.else
-SYSCALL_PIC_COMPILE= true
-.endif
-.if !defined(NOPROFILE)
-POBJS+= syscalls.po
-SYSCALL_PROF_COMPILE= $(CC) $(CFLAGS) -DSYSCALL_NAME=$$syscall -pg -c ${.CURDIR}/syscall-template.S -o ${.OBJDIR}/syscalls/S$$syscall.po
-.else
-SYSCALL_PROF_COMPILE= true
-.endif
-
-OPSYS!= uname -s
-
-syscalls.o syscalls.so syscalls.po : syscall-template.S
- -rm -rf ${.OBJDIR}/syscalls
- mkdir ${.OBJDIR}/syscalls
- for syscall in $(AVAILABLE_SYSCALLS) ; do \
- case " $(SYSCALL_EXCEPTIONS) " in \
- *" "$$syscall" "*) ;; \
- *) echo $$syscall ; \
- $(CC) $(CFLAGS) -DSYSCALL_NAME=$$syscall -c ${.CURDIR}/syscall-template.S -o ${.OBJDIR}/syscalls/S$$syscall.o ; \
- $(SYSCALL_PIC_COMPILE) ; \
- $(SYSCALL_PROF_COMPILE) ;; \
- esac ; \
- done
- x=`pwd` && cd ${.OBJDIR}/syscalls && ld -r -o ../syscalls.o *.o && cd $$x
-.if !defined(NOPIC)
- x=`pwd` && cd ${.OBJDIR}/syscalls && ld -r -o ../syscalls.so *.so && cd $$x
-.endif
-.if !defined(NOPROFILE)
- x=`pwd` && cd ${.OBJDIR}/syscalls && ld -r -o ../syscalls.po *.po && cd $$x
-.endif
- rm -r ${.OBJDIR}/syscalls
-.endif
-
-syscall.o: syscall.S
-.if (${OPSYS} == "FreeBSD")
- $(CC) -c -x assembler-with-cpp -o syscall.o ${.CURDIR}/syscall.S
-.else
- cpp ${CPPFLAGS} ${.CURDIR}/syscall.S > syscall.i
- as syscall.i
- rm syscall.i
- mv a.out syscall.o
-.endif
-
-syscall.po: syscall.S
-.if (${OPSYS} == "FreeBSD")
- $(CC) -c -x assembler-with-cpp -o syscall.po ${.CURDIR}/syscall.S
-.else
- cpp ${CPPFLAGS} ${.CURDIR}/syscall.S > syscall.i
- as syscall.i
- rm syscall.i
- mv a.out syscall.po
-.endif
-
-MAN2+=
-
-MAN3+=
-
diff --git a/mit-pthreads/pthreads/_exit.c b/mit-pthreads/pthreads/_exit.c
deleted file mode 100644
index fde795011ce..00000000000
--- a/mit-pthreads/pthreads/_exit.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* ==== _exit.c ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : The locking functions for stdio.
- *
- * 1.00 94/09/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <fcntl.h>
-
-/* ==========================================================================
- * _exit()
- *
- * Change all file descriptors back to their original state,
- * before exiting for good.
- */
-void _exit(int status)
-{
- int fd;
-
- pthread_sched_prevent();
-
- for (fd = 0; fd < dtablesize; fd++) {
- if (fd_table[fd] == NULL) {
- continue;
- }
- /* Is it a kernel fd ? */
- if ((!fd_table[fd]->ops) || (fd_table[fd]->ops->use_kfds != 1)) {
- continue;
- }
- switch (fd_table[fd]->type) {
- case FD_HALF_DUPLEX:
- machdep_sys_fcntl(fd_table[fd]->fd.i, F_SETFL, fd_table[fd]->flags);
- fd_table[fd]->type = FD_TEST_HALF_DUPLEX;
- break;
- case FD_FULL_DUPLEX:
- machdep_sys_fcntl(fd_table[fd]->fd.i, F_SETFL, fd_table[fd]->flags);
- fd_table[fd]->type = FD_TEST_FULL_DUPLEX;
- break;
- default:
- break;
- }
- }
- machdep_sys_exit(status);
-}
-
diff --git a/mit-pthreads/pthreads/cleanup.c b/mit-pthreads/pthreads/cleanup.c
deleted file mode 100644
index 3eb096b8337..00000000000
--- a/mit-pthreads/pthreads/cleanup.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/* ==== cleanup.c =======================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Pthread attribute functions.
- *
- * 1.20 94/02/13 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/* ==========================================================================
- * pthread_cleanup_push()
- */
-int pthread_cleanup_push(void (*routine)(void *), void *routine_arg)
-{
- struct pthread_cleanup *new;
- int ret;
-
- if ((new = (struct pthread_cleanup*)malloc(sizeof(struct pthread_cleanup))))
- {
- new->routine = routine;
- new->routine_arg = routine_arg;
- new->next = pthread_run->cleanup;
-
- pthread_run->cleanup = new;
- ret = OK;
- } else {
- ret = ENOMEM;
- }
- return(ret);
-}
-
-/* ==========================================================================
- * pthread_cleanup_pop()
- */
-void pthread_cleanup_pop(int execute)
-{
- struct pthread_cleanup *old;
-
- if ((old = pthread_run->cleanup))
- {
- pthread_run->cleanup = old->next;
- if (execute) {
- old->routine(old->routine_arg);
- }
- free(old);
- }
-}
-
diff --git a/mit-pthreads/pthreads/cond.c b/mit-pthreads/pthreads/cond.c
deleted file mode 100644
index 8dacd0397ce..00000000000
--- a/mit-pthreads/pthreads/cond.c
+++ /dev/null
@@ -1,437 +0,0 @@
-/* ==== cond.c ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Condition variable functions.
- *
- * 1.00 93/10/28 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <sys/time.h>
-#include <stdlib.h>
-#include <timers.h>
-#include <errno.h>
-
-#ifndef ETIME
-#define ETIME ETIMEDOUT
-#endif
-
-/* ==========================================================================
- * pthread_cond_is_debug()
- *
- * Check that cond is a debug cond and if so returns entry number into
- * array of debug condes.
- */
-static int pthread_cond_debug_count = 0;
-static pthread_cond_t ** pthread_cond_debug_ptrs = NULL;
-static pthread_mutex_t pthread_cond_debug_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-static inline int pthread_cond_is_debug(pthread_cond_t * cond)
-{
- int i;
-
- for (i = 0; i < pthread_cond_debug_count; i++) {
- if (pthread_cond_debug_ptrs[i] == cond) {
- return(i);
- }
- }
- return(NOTOK);
-}
-/* ==========================================================================
- * pthread_cond_init()
- *
- * In this implementation I don't need to allocate memory.
- * ENOMEM, EAGAIN should never be returned. Arch that have
- * weird constraints may need special coding.
- */
-int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *cond_attr)
-{
- enum pthread_condtype type;
-
- /* Only check if attr specifies some mutex type other than fast */
- if ((cond_attr) && (cond_attr->c_type != COND_TYPE_FAST)) {
- if (cond_attr->c_type >= COND_TYPE_MAX) {
- return(EINVAL);
- }
- type = cond_attr->c_type;
- } else {
- type = COND_TYPE_FAST;
- }
-
- switch (type) {
- case COND_TYPE_FAST:
- case COND_TYPE_COUNTING_FAST:
- break;
- case COND_TYPE_DEBUG:
- pthread_mutex_lock(&pthread_cond_debug_mutex);
- if (pthread_cond_is_debug(cond) == NOTOK) {
- pthread_cond_t ** new;
-
- if ((new = (pthread_cond_t **)realloc(pthread_cond_debug_ptrs,
- (pthread_cond_debug_count + 1) * (sizeof(void *)))) == NULL) {
- pthread_mutex_unlock(&pthread_cond_debug_mutex);
- return(ENOMEM);
- }
- pthread_cond_debug_ptrs = new;
- pthread_cond_debug_ptrs[pthread_cond_debug_count++] = cond;
- } else {
- pthread_mutex_unlock(&pthread_cond_debug_mutex);
- return(EBUSY);
- }
- pthread_mutex_unlock(&pthread_cond_debug_mutex);
- break;
- case COND_TYPE_STATIC_FAST:
- defualt:
- return(EINVAL);
- break;
- }
-
- /* Set all other paramaters */
- pthread_queue_init(&cond->c_queue);
- cond->c_flags |= COND_FLAGS_INITED;
- cond->c_type = type;
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_cond_destroy()
- */
-int pthread_cond_destroy(pthread_cond_t *cond)
-{
- int i;
-
- /* Only check if cond is of type other than fast */
- switch(cond->c_type) {
- case COND_TYPE_FAST:
- case COND_TYPE_COUNTING_FAST:
- break;
- case COND_TYPE_DEBUG:
- if (pthread_queue_get(&(cond->c_queue))) {
- return(EBUSY);
- }
- pthread_mutex_lock(&pthread_cond_debug_mutex);
- if ((i = pthread_cond_is_debug(cond)) == NOTOK) {
- pthread_mutex_unlock(&pthread_cond_debug_mutex);
- return(EINVAL);
- }
-
- /* Remove the cond from the list of debug condition variables */
- pthread_cond_debug_ptrs[i] =
- pthread_cond_debug_ptrs[--pthread_cond_debug_count];
- pthread_cond_debug_ptrs[pthread_cond_debug_count] = NULL;
- pthread_mutex_unlock(&pthread_cond_debug_mutex);
- break;
- case COND_TYPE_STATIC_FAST:
- default:
- return(EINVAL);
- break;
- }
-
- /* Cleanup cond, others might want to use it. */
- pthread_queue_init(&cond->c_queue);
- cond->c_flags = 0;
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_cond_wait()
- */
-int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
-{
- int rval;
-
- pthread_sched_prevent();
- switch (cond->c_type) {
- case COND_TYPE_DEBUG:
- pthread_mutex_lock(&pthread_cond_debug_mutex);
- if (pthread_cond_is_debug(cond) == NOTOK) {
- pthread_mutex_unlock(&pthread_cond_debug_mutex);
- pthread_sched_resume();
- return(EINVAL);
- }
- pthread_mutex_unlock(&pthread_cond_debug_mutex);
-
- /*
- * Fast condition variables do not check for any error conditions.
- */
- case COND_TYPE_FAST:
- case COND_TYPE_STATIC_FAST:
- pthread_queue_enq(&cond->c_queue, pthread_run);
- pthread_mutex_unlock(mutex);
-
- pthread_run->data.mutex = mutex;
-
- SET_PF_WAIT_EVENT(pthread_run);
- SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- /* Reschedule will unlock pthread_run */
- pthread_resched_resume(PS_COND_WAIT);
- CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
- CLEAR_PF_DONE_EVENT(pthread_run);
-
- pthread_run->data.mutex = NULL;
-
- rval = pthread_mutex_lock(mutex);
- return(rval);
- break;
- case COND_TYPE_COUNTING_FAST:
- {
- int count = mutex->m_data.m_count;
-
- pthread_queue_enq(&cond->c_queue, pthread_run);
- pthread_mutex_unlock(mutex);
- mutex->m_data.m_count = 1;
-
- pthread_run->data.mutex = mutex;
-
- SET_PF_WAIT_EVENT(pthread_run);
- SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- /* Reschedule will unlock pthread_run */
- pthread_resched_resume(PS_COND_WAIT);
- CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
- CLEAR_PF_DONE_EVENT(pthread_run);
-
- pthread_run->data.mutex = NULL;
-
- rval = pthread_mutex_lock(mutex);
- mutex->m_data.m_count = count;
- return(rval);
- break;
- }
- default:
- rval = EINVAL;
- break;
- }
- pthread_sched_resume();
- return(rval);
-}
-
-/* ==========================================================================
- * pthread_cond_timedwait()
- */
-int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
- const struct timespec * abstime)
-{
- struct timespec current_time, new_time;
- int rval = OK;
-
- pthread_sched_prevent();
- machdep_gettimeofday(& current_time);
-
- switch (cond->c_type) {
- case COND_TYPE_DEBUG:
- pthread_mutex_lock(&pthread_cond_debug_mutex);
- if (pthread_cond_is_debug(cond) == NOTOK) {
- pthread_mutex_unlock(&pthread_cond_debug_mutex);
- pthread_sched_resume();
- return(EINVAL);
- }
- pthread_mutex_unlock(&pthread_cond_debug_mutex);
-
- /*
- * Fast condition variables do not check for any error conditions.
- */
- case COND_TYPE_FAST:
- case COND_TYPE_STATIC_FAST:
-
- /* Set pthread wakeup time*/
- pthread_run->wakeup_time = *abstime;
-
- /* Install us on the sleep queue */
- sleep_schedule (&current_time, &(pthread_run->wakeup_time));
-
- pthread_queue_enq(&cond->c_queue, pthread_run);
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_mutex_unlock(mutex);
-
- pthread_run->data.mutex = mutex;
-
- SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- /* Reschedule will unlock pthread_run */
- pthread_resched_resume(PS_COND_WAIT);
- CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
-
- pthread_run->data.mutex = NULL;
-
- /* Remove ourselves from sleep queue. If we fail then we timedout */
- if (sleep_cancel(pthread_run) == NOTOK) {
- SET_ERRNO(ETIME);
- rval = ETIME;
- }
-
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_mutex_lock(mutex);
- return(rval);
- break;
- case COND_TYPE_COUNTING_FAST:
- {
- int count = mutex->m_data.m_count;
-
- /* Set pthread wakeup time*/
- pthread_run->wakeup_time = *abstime;
-
- /* Install us on the sleep queue */
- sleep_schedule (&current_time, &(pthread_run->wakeup_time));
-
- pthread_queue_enq(&cond->c_queue, pthread_run);
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_mutex_unlock(mutex);
-
- pthread_run->data.mutex = mutex;
-
- SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- /* Reschedule will unlock pthread_run */
- pthread_resched_resume(PS_COND_WAIT);
- CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
-
- pthread_run->data.mutex = NULL;
-
- /* Remove ourselves from sleep queue. If we fail then we timedout */
- if (sleep_cancel(pthread_run) == NOTOK) {
- SET_ERRNO(ETIME);
- rval = ETIME;
- }
-
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_mutex_lock(mutex);
- mutex->m_data.m_count = count;
- return(rval);
- break;
- }
- default:
- rval = EINVAL;
- break;
- }
- pthread_sched_resume();
- return(rval);
-}
-
-/* ==========================================================================
- * pthread_cond_signal()
- */
-int pthread_cond_signal(pthread_cond_t *cond)
-{
- struct pthread *pthread;
- int rval;
-
- pthread_sched_prevent();
- switch (cond->c_type) {
- case COND_TYPE_DEBUG:
- pthread_mutex_lock(&pthread_cond_debug_mutex);
- if (pthread_cond_is_debug(cond) == NOTOK) {
- pthread_mutex_unlock(&pthread_cond_debug_mutex);
- pthread_sched_resume();
- return(EINVAL);
- }
- pthread_mutex_unlock(&pthread_cond_debug_mutex);
-
- case COND_TYPE_FAST:
- case COND_TYPE_STATIC_FAST:
- if (pthread = pthread_queue_deq(&cond->c_queue)) {
- if ((SET_PF_DONE_EVENT(pthread)) == OK) {
- pthread_sched_other_resume(pthread);
- } else {
- pthread_sched_resume();
- }
- return(OK);
- }
- rval = OK;
- break;
- default:
- rval = EINVAL;
- break;
- }
- pthread_sched_resume();
- return(rval);
-}
-
-/* ==========================================================================
- * pthread_cond_broadcast()
- *
- * Not much different then the above routine.
- */
-int pthread_cond_broadcast(pthread_cond_t *cond)
-{
- struct pthread * pthread, * high_pthread, * low_pthread;
- int rval;
-
- pthread_sched_prevent();
- switch (cond->c_type) {
- case COND_TYPE_DEBUG:
- pthread_mutex_lock(&pthread_cond_debug_mutex);
- if (pthread_cond_is_debug(cond) == NOTOK) {
- pthread_mutex_unlock(&pthread_cond_debug_mutex);
- pthread_sched_resume();
- return(EINVAL);
- }
- pthread_mutex_unlock(&pthread_cond_debug_mutex);
-
- case COND_TYPE_FAST:
- case COND_TYPE_STATIC_FAST:
- if (pthread = pthread_queue_deq(&cond->c_queue)) {
- pthread->state = PS_RUNNING;
- high_pthread = pthread;
-
- while (pthread = pthread_queue_deq(&cond->c_queue)) {
- if (pthread->pthread_priority >
- high_pthread->pthread_priority) {
- low_pthread = high_pthread;
- high_pthread = pthread;
- } else {
- low_pthread = pthread;
- }
- if ((SET_PF_DONE_EVENT(low_pthread)) == OK) {
- pthread_prio_queue_enq(pthread_current_prio_queue,
- low_pthread);
- low_pthread->state = PS_RUNNING;
- }
- }
- if ((SET_PF_DONE_EVENT(high_pthread)) == OK) {
- pthread_sched_other_resume(high_pthread);
- } else {
- pthread_sched_resume();
- }
- return(OK);
- }
- rval = OK;
- break;
- default:
- rval = EINVAL;
- break;
- }
- pthread_sched_resume();
- return(rval);
-}
-
diff --git a/mit-pthreads/pthreads/condattr.c b/mit-pthreads/pthreads/condattr.c
deleted file mode 100644
index ac010bdf4b1..00000000000
--- a/mit-pthreads/pthreads/condattr.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* ==== condattr.c ===========================================================
- * Copyright (c) 1995 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Mutex functions.
- *
- * 1.00 95/08/22 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <errno.h>
-
-/* ==========================================================================
- * pthread_condattr_init()
- */
-int pthread_condattr_init(pthread_condattr_t *attr)
-{
- attr->c_type = COND_TYPE_FAST;
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_condattr_destroy()
- */
-int pthread_condattr_destroy(pthread_condattr_t *attr)
-{
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_condattr_settype()
- */
-int pthread_condattr_settype(pthread_condattr_t *attr, unsigned int type)
-{
- switch(type) {
- case PTHREAD_CONDTYPE_FAST:
- attr->c_type = COND_TYPE_FAST;
- break;
- case PTHREAD_CONDTYPE_RECURSIVE:
- attr->c_type = COND_TYPE_COUNTING_FAST;
- break;
- case PTHREAD_CONDTYPE_DEBUG:
- attr->c_type = COND_TYPE_DEBUG;
- break;
- default:
- return(EINVAL);
- }
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_condattr_gettype()
- */
-int pthread_condattr_gettype(pthread_condattr_t *attr, unsigned int * type)
-{
- *type = (unsigned int)attr->c_type;
- return(OK);
-}
diff --git a/mit-pthreads/pthreads/dump_state.c b/mit-pthreads/pthreads/dump_state.c
deleted file mode 100644
index 3d9840bad64..00000000000
--- a/mit-pthreads/pthreads/dump_state.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* ==== dump_state.c ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Description : Bogus debugging output routines.
- *
- * 1.00 95/02/08 snl
- * -Started coding this file.
- */
-
-#include <pthread.h>
-#include <stdio.h>
-
-/* ==========================================================================
- * pthread_dump_state()
- *
- * Totally, totally bogus routine to dump the state of pthreads.
- */
-
-void
-pthread_dump_state()
-{
- pthread_t thread;
-
- for (thread = pthread_link_list; thread; thread = thread->pll) {
- printf("Thread %lx", thread);
- if (thread == pthread_initial)
- printf("*");
- if (thread == pthread_run)
- printf("^");
- printf(" ");
- switch (thread->state) {
- case PS_RUNNING: printf("RUNNING "); break;
- case PS_MUTEX_WAIT: printf("MUTEX_WAIT "); break;
- case PS_COND_WAIT: printf("COND_WAIT "); break;
- case PS_FDLR_WAIT: printf("FDLR_WAIT "); break;
- case PS_FDLW_WAIT: printf("FDLW_WAIT "); break;
- case PS_FDR_WAIT: printf("FDR_WAIT "); break;
- case PS_FDW_WAIT: printf("FDW_WAIT "); break;
- case PS_SELECT_WAIT: printf("SELECT "); break;
- case PS_SLEEP_WAIT: printf("SLEEP_WAIT "); break;
- case PS_WAIT_WAIT: printf("WAIT_WAIT "); break;
- case PS_SIGWAIT: printf("SIGWAIT "); break;
- case PS_JOIN: printf("JOIN "); break;
- case PS_DEAD: printf("DEAD "); break;
- default: printf("*UNKNOWN %d* ", thread->state);
- break;
- }
- switch (thread->attr.schedparam_policy) {
- case SCHED_RR: printf("RR "); break;
- case SCHED_IO: printf("IO "); break;
- case SCHED_FIFO: printf("FIFO "); break;
- case SCHED_OTHER: printf("OTHER "); break;
- default: printf("*UNKNOWN %d* ",
- thread->attr.schedparam_policy);
- break;
- }
- }
-}
diff --git a/mit-pthreads/pthreads/errno.c b/mit-pthreads/pthreads/errno.c
deleted file mode 100644
index bc680235424..00000000000
--- a/mit-pthreads/pthreads/errno.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* ==== errno.c ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Return the pointer to the threads errno address.
- *
- * 1.32 94/05/25 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-
-/* ==========================================================================
- * __error()
- */
-int * __error()
-{
- if (!pthread_run->error_p) {
- pthread_run->error_p = &pthread_run->error;
- }
- return(pthread_run->error_p);
-}
diff --git a/mit-pthreads/pthreads/fd.c b/mit-pthreads/pthreads/fd.c
deleted file mode 100644
index 3eb59c11bd1..00000000000
--- a/mit-pthreads/pthreads/fd.c
+++ /dev/null
@@ -1,1083 +0,0 @@
-/* ==== fd.c ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : All the syscalls dealing with fds.
- *
- * 1.00 93/08/14 proven
- * -Started coding this file.
- *
- * 1.01 93/11/13 proven
- * -The functions readv() and writev() added.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include "config.h"
-#include <pthread.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/uio.h>
-#include <sys/ioctl.h>
-#ifdef HAVE_SYS_FILIO_H
-#include <sys/filio.h> /* For ioctl */
-#endif
-#if __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#include <fcntl.h>
-#include <errno.h>
-#include <pthread/posix.h>
-
-/*
- * These first functions really should not be called by the user.
- *
- * I really should dynamically figure out what the table size is.
- */
-static pthread_mutex_t fd_table_mutex = PTHREAD_MUTEX_INITIALIZER;
-static const int dtablecount = 4096/sizeof(struct fd_table_entry);
-int dtablesize;
-
-static int fd_get_pthread_fd_from_kernel_fd( int );
-
-/* ==========================================================================
- * Allocate dtablecount entries at once and populate the fd_table.
- *
- * fd_init_entry()
- */
-int fd_init_entry(int entry)
-{
- struct fd_table_entry *fd_entry;
- int i, round;
-
- if (fd_table[entry] == NULL) {
- round = entry - entry % dtablecount;
-
- if ((fd_entry = (struct fd_table_entry *)malloc(
- sizeof(struct fd_table_entry) * dtablecount)) == NULL) {
- return(NOTOK);
- }
-
- for (i = 0; i < dtablecount && round+i < dtablesize; i++) {
- fd_table[round + i] = &fd_entry[i];
-
- fd_table[round + i]->ops = NULL;
- fd_table[round + i]->type = FD_NT;
- fd_table[round + i]->fd.i = NOTOK;
- fd_table[round + i]->flags = 0;
- fd_table[round + i]->count = 0;
-
- pthread_mutex_init(&(fd_table[round + i]->mutex), NULL);
- pthread_queue_init(&(fd_table[round + i]->r_queue));
- pthread_queue_init(&(fd_table[round + i]->w_queue));
- fd_table[round + i]->r_owner = NULL;
- fd_table[round + i]->w_owner = NULL;
- fd_table[round + i]->r_lockcount= 0;
- fd_table[round + i]->w_lockcount= 0;
-
- fd_table[round + i]->next = NULL;
- }
- }
- return(OK);
-}
-
-/* ==========================================================================
- * fd_check_entry()
- */
-int fd_check_entry(unsigned int entry)
-{
- int ret = OK;
-
- pthread_mutex_lock(&fd_table_mutex);
-
- if (entry < dtablesize) {
- if (fd_table[entry] == NULL) {
- if (fd_init_entry(entry)) {
- SET_ERRNO(EBADF);
- ret = -EBADF;
- }
- }
- } else {
- SET_ERRNO(EBADF);
- ret = -EBADF;
- }
-
- pthread_mutex_unlock(&fd_table_mutex);
- return(ret);
-}
-
-/* ==========================================================================
- * fd_init()
- */
-void fd_init(void)
-{
- int i;
-
- if ((dtablesize = machdep_sys_getdtablesize()) < 0) {
- /* Can't figure out the table size. */
- PANIC();
- }
-
- /* select() can only handle FD_SETSIZE descriptors, so our inner loop will
- * break if dtablesize is higher than that. This should be removed if and
- * when the inner loop is rewritten to use poll(). */
- if (dtablesize > FD_SETSIZE) {
- dtablesize = FD_SETSIZE;
- }
-
- if (fd_table = (struct fd_table_entry **)malloc(
- sizeof(struct fd_table_entry) * dtablesize)) {
- memset(fd_table, 0, sizeof(struct fd_table_entry) * dtablesize);
- if (fd_check_entry(0) == OK) {
- return;
- }
- }
-
- /*
- * There isn't enough memory to allocate a fd table at init time.
- * This is a problem.
- */
- PANIC();
-
-}
-
-/* ==========================================================================
- * fd_allocate()
- */
-int fd_allocate()
-{
- pthread_mutex_t * mutex;
- int i;
-
- for (i = 0; i < dtablesize; i++) {
- if (fd_check_entry(i) == OK) {
- mutex = &(fd_table[i]->mutex);
- if (pthread_mutex_trylock(mutex)) {
- continue;
- }
- if (fd_table[i]->count || fd_table[i]->r_owner
- || fd_table[i]->w_owner) {
- pthread_mutex_unlock(mutex);
- continue;
- }
- if (fd_table[i]->type == FD_NT) {
- /* Test to see if the kernel version is in use */
- if ((machdep_sys_fcntl(i, F_GETFL, NULL)) >= OK) {
- /* If so continue; */
- pthread_mutex_unlock(mutex);
- continue;
- }
- }
- fd_table[i]->count++;
- pthread_mutex_unlock(mutex);
- return(i);
- }
- }
- SET_ERRNO(ENFILE);
- return(NOTOK);
-}
-
-/*----------------------------------------------------------------------
- * Function: fd_get_pthread_fd_from_kernel_fd
- * Purpose: get the fd_table index of a kernel fd
- * Args: fd = kernel fd to convert
- * Returns: fd_table index, -1 if not found
- * Notes:
- *----------------------------------------------------------------------*/
-static int
-fd_get_pthread_fd_from_kernel_fd( int kfd )
-{
- int j;
-
- /* This is *SICK*, but unless there is a faster way to
- * turn a kernel fd into an fd_table index, this has to do.
- */
- for( j=0; j < dtablesize; j++ ) {
- if( fd_table[j] &&
- fd_table[j]->type != FD_NT &&
- fd_table[j]->type != FD_NIU &&
- fd_table[j]->fd.i == kfd ) {
- return j;
- }
- }
-
- /* Not listed byfd, Check for kernel fd == pthread fd */
- if( fd_table[kfd] == NULL || fd_table[kfd]->type == FD_NT ) {
- /* Assume that the kernel fd is the same */
- return kfd;
- }
-
- return NOTOK; /* Not found */
-}
-
-/* ==========================================================================
- * fd_basic_basic_unlock()
- *
- * The real work of unlock without the locking of fd_table[fd].lock.
- */
-void fd_basic_basic_unlock(struct fd_table_entry * entry, int lock_type)
-{
- struct pthread *pthread;
-
- if (entry->r_owner == pthread_run) {
- if ((entry->type == FD_HALF_DUPLEX) ||
- (entry->type == FD_TEST_HALF_DUPLEX) ||
- (lock_type == FD_READ) || (lock_type == FD_RDWR)) {
- if (entry->r_lockcount == 0) {
- if (pthread = pthread_queue_deq(&entry->r_queue)) {
- pthread_sched_prevent();
- entry->r_owner = pthread;
- if ((SET_PF_DONE_EVENT(pthread)) == OK) {
- pthread_sched_other_resume(pthread);
- } else {
- pthread_sched_resume();
- }
- } else {
- entry->r_owner = NULL;
- }
- } else {
- entry->r_lockcount--;
- }
- }
- }
-
- if (entry->w_owner == pthread_run) {
- if ((entry->type != FD_HALF_DUPLEX) &&
- (entry->type != FD_TEST_HALF_DUPLEX) &&
- ((lock_type == FD_WRITE) || (lock_type == FD_RDWR))) {
- if (entry->w_lockcount == 0) {
- if (pthread = pthread_queue_deq(&entry->w_queue)) {
- pthread_sched_prevent();
- entry->w_owner = pthread;
- if ((SET_PF_DONE_EVENT(pthread)) == OK) {
- pthread_sched_other_resume(pthread);
- } else {
- pthread_sched_resume();
- }
- } else {
- entry->w_owner = NULL;
- }
- } else {
- entry->w_lockcount--;
- }
- }
- }
-}
-
-/* ==========================================================================
- * fd_basic_unlock()
- */
-void fd_basic_unlock(int fd, int lock_type)
-{
- fd_basic_basic_unlock(fd_table[fd], lock_type);
-}
-
-/* ==========================================================================
- * fd_unlock()
- */
-void fd_unlock(int fd, int lock_type)
-{
- pthread_mutex_t *mutex;
-
- mutex = &(fd_table[fd]->mutex);
- pthread_mutex_lock(mutex);
- fd_basic_basic_unlock(fd_table[fd], lock_type);
- pthread_mutex_unlock(mutex);
-}
-
-/* ==========================================================================
- * fd_basic_lock()
- *
- * The real work of lock without the locking of fd_table[fd].lock.
- * Be sure to leave the lock the same way you found it. i.e. locked.
- */
-int fd_basic_lock(unsigned int fd, int lock_type, pthread_mutex_t * mutex,
- struct timespec * timeout)
-{
- semaphore *plock;
-
- switch (fd_table[fd]->type) {
- case FD_NIU:
- /* If not in use return EBADF error */
- SET_ERRNO(EBADF);
- return(NOTOK);
- break;
- case FD_NT:
- /*
- * If not tested, test it and see if it is valid
- * If not ok return EBADF error
- */
- fd_kern_init(fd);
- if (fd_table[fd]->type == FD_NIU) {
- SET_ERRNO(EBADF);
- return(NOTOK);
- }
- break;
- case FD_TEST_HALF_DUPLEX:
- case FD_TEST_FULL_DUPLEX:
- /* If a parent process reset the fd to its proper state */
- if (!fork_lock) {
- /* It had better be a kernel fd */
- fd_kern_reset(fd);
- }
- break;
- default:
- break;
- }
-
- if ((fd_table[fd]->type == FD_HALF_DUPLEX) ||
- (fd_table[fd]->type == FD_TEST_HALF_DUPLEX) ||
- (lock_type == FD_READ) || (lock_type == FD_RDWR)) {
- if (fd_table[fd]->r_owner) {
- if (fd_table[fd]->r_owner != pthread_run) {
- pthread_sched_prevent();
- pthread_queue_enq(&fd_table[fd]->r_queue, pthread_run);
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_mutex_unlock(mutex);
-
- if (timeout) {
- /* get current time */
- struct timespec current_time;
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
- /* Reschedule will unlock pthread_run */
- pthread_run->data.fd.fd = fd;
- pthread_run->data.fd.branch = __LINE__;
- pthread_resched_resume(PS_FDLR_WAIT);
- pthread_mutex_lock(mutex);
-
- /* If we're the owner then we have to cancel the sleep */
- if (fd_table[fd]->r_owner != pthread_run) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- SET_ERRNO(ETIMEDOUT);
- return(NOTOK);
- }
- sleep_cancel(pthread_run);
- } else {
- /* Reschedule will unlock pthread_run */
- pthread_run->data.fd.fd = fd;
- pthread_run->data.fd.branch = __LINE__;
- pthread_resched_resume(PS_FDLR_WAIT);
- pthread_mutex_lock(mutex);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- } else {
- fd_table[fd]->r_lockcount++;
- }
- }
- fd_table[fd]->r_owner = pthread_run;
- }
- if ((fd_table[fd]->type != FD_HALF_DUPLEX) &&
- (fd_table[fd]->type != FD_TEST_HALF_DUPLEX) &&
- ((lock_type == FD_WRITE) || (lock_type == FD_RDWR))) {
- if (fd_table[fd]->w_owner) {
- if (fd_table[fd]->w_owner != pthread_run) {
- pthread_sched_prevent();
- pthread_queue_enq(&fd_table[fd]->w_queue, pthread_run);
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_mutex_unlock(mutex);
-
- if (timeout) {
- /* get current time */
- struct timespec current_time;
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
- /* Reschedule will unlock pthread_run */
- pthread_run->data.fd.fd = fd;
- pthread_run->data.fd.branch = __LINE__;
- pthread_resched_resume(PS_FDLR_WAIT);
- pthread_mutex_lock(mutex);
-
- /* If we're the owner then we have to cancel the sleep */
- if (fd_table[fd]->w_owner != pthread_run) {
- if (lock_type == FD_RDWR) {
- /* Unlock current thread */
- fd_basic_unlock(fd, FD_READ);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- SET_ERRNO(ETIMEDOUT);
- return(NOTOK);
- }
- sleep_cancel(pthread_run);
- } else {
- /* Reschedule will unlock pthread_run */
- pthread_run->data.fd.fd = fd;
- pthread_run->data.fd.branch = __LINE__;
- pthread_resched_resume(PS_FDLR_WAIT);
- pthread_mutex_lock(mutex);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- } else {
- fd_table[fd]->w_lockcount++;
- }
- }
- fd_table[fd]->w_owner = pthread_run;
- }
- if (!fd_table[fd]->count) {
- fd_basic_unlock(fd, lock_type);
- return(NOTOK);
- }
- return(OK);
-}
-
-/*----------------------------------------------------------------------
- * Function: fd_unlock_for_cancel
- * Purpose: Unlock all fd locks held prior to being cancelled
- * Args: void
- * Returns:
- * OK or NOTOK
- * Notes:
- * Assumes the kernel is locked on entry
- *----------------------------------------------------------------------*/
-int
-fd_unlock_for_cancel( void )
-{
- int i, fd;
- struct pthread_select_data *data;
- int rdlk, wrlk, lktype;
- int found;
-
- /* What we do depends on the previous state of the thread */
- switch( pthread_run->old_state ) {
- case PS_RUNNING:
- case PS_JOIN:
- case PS_SLEEP_WAIT:
- case PS_WAIT_WAIT:
- case PS_SIGWAIT:
- case PS_FDLR_WAIT:
- case PS_FDLW_WAIT:
- case PS_DEAD:
- case PS_UNALLOCED:
- break; /* Nothing to do */
-
- case PS_COND_WAIT:
- CLEAR_PF_GROUP( pthread_run, PF_EVENT_GROUP );
- /* Must reaquire the mutex according to the standard */
- if( pthread_run->data.mutex == NULL ) {
- PANIC();
- }
- pthread_mutex_lock( pthread_run->data.mutex );
- break;
-
- case PS_FDR_WAIT:
- CLEAR_PF_GROUP( pthread_run, PF_EVENT_GROUP);
- /* Free the lock on the fd being used */
- fd = fd_get_pthread_fd_from_kernel_fd( pthread_run->data.fd.fd );
- if( fd == NOTOK ) {
- PANIC(); /* Can't find fd */
- }
- fd_unlock( fd, FD_READ );
- break;
-
- case PS_FDW_WAIT: /* Waiting on i/o */
- CLEAR_PF_GROUP( pthread_run, PF_EVENT_GROUP);
- /* Free the lock on the fd being used */
- fd = fd_get_pthread_fd_from_kernel_fd( pthread_run->data.fd.fd );
- if( fd == NOTOK ) {
- PANIC(); /* Can't find fd */
- }
- fd_unlock( fd, FD_WRITE );
- break;
-
- case PS_SELECT_WAIT:
- data = pthread_run->data.select_data;
-
- CLEAR_PF_GROUP( pthread_run, PF_EVENT_GROUP);
-
- for( i = 0; i < data->nfds; i++) {
- rdlk =(FD_ISSET(i,&data->readfds)
- || FD_ISSET(i,&data->exceptfds));
- wrlk = FD_ISSET(i, &data->writefds);
- lktype = rdlk ? (wrlk ? FD_RDWR : FD_READ) : FD_WRITE;
-
- if( ! (rdlk || wrlk) )
- continue; /* No locks, no unlock */
-
- if( (fd = fd_get_pthread_fd_from_kernel_fd( i )) == NOTOK ) {
- PANIC(); /* Can't find fd */
- }
-
- fd_unlock( fd, lktype );
- }
- break;
-
- case PS_MUTEX_WAIT:
- PANIC(); /* Should never cancel a mutex wait */
-
- default:
- PANIC(); /* Unknown thread status */
- }
-}
-
-/* ==========================================================================
- * fd_lock()
- */
-#define pthread_mutex_lock_timedwait(a, b) pthread_mutex_lock(a)
-
-int fd_lock(unsigned int fd, int lock_type, struct timespec * timeout)
-{
- struct timespec current_time;
- pthread_mutex_t *mutex;
- int error;
-
- if ((error = fd_check_entry(fd)) == OK) {
- mutex = &(fd_table[fd]->mutex);
- if (pthread_mutex_lock_timedwait(mutex, timeout)) {
- SET_ERRNO(ETIMEDOUT);
- return(-ETIMEDOUT);
- }
- error = fd_basic_lock(fd, lock_type, mutex, timeout);
- pthread_mutex_unlock(mutex);
- }
- return(error);
-}
-
-/* ==========================================================================
- * fd_free()
- *
- * Assumes fd is locked and owner by pthread_run
- * Don't clear the queues, fd_unlock will do that.
- */
-struct fd_table_entry * fd_free(int fd)
-{
- struct fd_table_entry *fd_valid;
-
- fd_valid = NULL;
- fd_table[fd]->r_lockcount = 0;
- fd_table[fd]->w_lockcount = 0;
- if (--fd_table[fd]->count) {
- fd_valid = fd_table[fd];
- fd_table[fd] = fd_table[fd]->next;
- fd_valid->next = fd_table[fd]->next;
- /* Don't touch queues of fd_valid */
- }
-
- fd_table[fd]->type = FD_NIU;
- fd_table[fd]->fd.i = NOTOK;
- fd_table[fd]->next = NULL;
- fd_table[fd]->flags = 0;
- fd_table[fd]->count = 0;
- return(fd_valid);
-}
-
-
-/* ==========================================================================
- * ======================================================================= */
-
-/* ==========================================================================
- * read_timedwait()
- */
-ssize_t read_timedwait(int fd, void *buf, size_t nbytes,
- struct timespec * timeout)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
- ret = fd_table[fd]->ops->read(fd_table[fd]->fd,
- fd_table[fd]->flags, buf, nbytes, timeout);
- fd_unlock(fd, FD_READ);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * read()
- */
-ssize_t read(int fd, void *buf, size_t nbytes)
-{
- return(read_timedwait(fd, buf, nbytes, NULL));
-}
-
-/* ==========================================================================
- * readv_timedwait()
- */
-int readv_timedwait(int fd, const struct iovec *iov, int iovcnt,
- struct timespec * timeout)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
- ret = fd_table[fd]->ops->readv(fd_table[fd]->fd,
- fd_table[fd]->flags, iov, iovcnt, timeout);
- fd_unlock(fd, FD_READ);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * readv()
- */
-ssize_t readv(int fd, const struct iovec *iov, int iovcnt)
-{
- return(readv_timedwait(fd, iov, iovcnt, NULL));
-}
-
-/* ==========================================================================
- * write()
- */
-ssize_t write_timedwait(int fd, const void *buf, size_t nbytes,
- struct timespec * timeout)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_WRITE, NULL)) == OK)
- {
- ret = fd_table[fd]->ops->write(fd_table[fd]->fd,
- fd_table[fd]->flags, buf, nbytes,
- timeout);
- fd_unlock(fd, FD_WRITE);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * write()
- */
-ssize_t write(int fd, const void * buf, size_t nbytes)
-{
- return(write_timedwait(fd, buf, nbytes, NULL));
-}
-
-/* ==========================================================================
- * writev_timedwait()
- */
-int writev_timedwait(int fd, const struct iovec *iov, int iovcnt,
- struct timespec * timeout)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_WRITE, NULL)) == OK) {
- ret = fd_table[fd]->ops->writev(fd_table[fd]->fd,
- fd_table[fd]->flags, iov, iovcnt, timeout);
- fd_unlock(fd, FD_WRITE);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * writev()
- */
-ssize_t writev(int fd, const struct iovec *iov, int iovcnt)
-{
- return(writev_timedwait(fd, iov, iovcnt, NULL));
-}
-
-/* ==========================================================================
- * lseek()
- */
-off_t lseek(int fd, off_t offset, int whence)
-{
- off_t ret;
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- ret = fd_table[fd]->ops->seek(fd_table[fd]->fd,
- fd_table[fd]->flags, offset, whence);
- fd_unlock(fd, FD_RDWR);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * close()
- *
- * The whole close procedure is a bit odd and needs a bit of a rethink.
- * For now close() locks the fd, calls fd_free() which checks to see if
- * there are any other fd values poinging to the same real fd. If so
- * It breaks the wait queue into two sections those that are waiting on fd
- * and those waiting on other fd's. Those that are waiting on fd are connected
- * to the fd_table[fd] queue, and the count is set to zero, (BUT THE LOCK IS NOT
- * RELEASED). close() then calls fd_unlock which give the fd to the next queued
- * element which determins that the fd is closed and then calls fd_unlock etc...
- *
- * XXX close() is even uglier now. You may assume that the kernel fd is the
- * same as fd if fd_table[fd] == NULL or if fd_table[fd]->type == FD_NT.
- * This is true because before any fd_table[fd] is allocated the corresponding
- * kernel fd must be checks to see if it's valid.
- */
-int close(int fd)
-{
- struct fd_table_entry * entry;
- pthread_mutex_t *mutex;
- union fd_data realfd;
- int ret, flags;
-
- if(fd < 0 || fd >= dtablesize)
- {
- SET_ERRNO(EBADF);
- return -1;
- }
- /* Need to lock the newfd by hand */
- pthread_mutex_lock(&fd_table_mutex);
- if (fd_table[fd]) {
- pthread_mutex_unlock(&fd_table_mutex);
- mutex = &(fd_table[fd]->mutex);
- pthread_mutex_lock(mutex);
-
- /*
- * XXX Gross hack ... because of fork(), any fd closed by the
- * parent should not change the fd of the child, unless it owns it.
- */
- switch(fd_table[fd]->type) {
- case FD_NIU:
- pthread_mutex_unlock(mutex);
- ret = -EBADF;
- break;
- case FD_NT:
- /*
- * If it's not tested then the only valid possibility is it's
- * kernel fd.
- */
- ret = machdep_sys_close(fd);
- fd_table[fd]->type = FD_NIU;
- pthread_mutex_unlock(mutex);
- break;
- case FD_TEST_FULL_DUPLEX:
- case FD_TEST_HALF_DUPLEX:
- realfd = fd_table[fd]->fd;
- flags = fd_table[fd]->flags;
- if ((entry = fd_free(fd)) == NULL) {
- ret = fd_table[fd]->ops->close(realfd, flags);
- } else {
- /* There can't be any others waiting for fd. */
- pthread_mutex_unlock(&entry->mutex);
- /* Note: entry->mutex = mutex */
- mutex = &(fd_table[fd]->mutex);
- }
- pthread_mutex_unlock(mutex);
- break;
- default:
- ret = fd_basic_lock(fd, FD_RDWR, mutex, NULL);
- if (ret == OK) {
- realfd = fd_table[fd]->fd;
- flags = fd_table[fd]->flags;
- pthread_mutex_unlock(mutex);
- if ((entry = fd_free(fd)) == NULL) {
- ret = fd_table[fd]->ops->close(realfd, flags);
- } else {
- fd_basic_basic_unlock(entry, FD_RDWR);
- pthread_mutex_unlock(&entry->mutex);
- /* Note: entry->mutex = mutex */
- }
- fd_unlock(fd, FD_RDWR);
- } else {
- pthread_mutex_unlock(mutex);
- }
- break;
- }
- } else {
- /* Don't bother creating a table entry */
- pthread_mutex_unlock(&fd_table_mutex);
- ret = machdep_sys_close(fd);
- }
- if( ret < 0) {
- SET_ERRNO(-ret);
- ret = -1;
- }
- return(ret);
-}
-
-/* ==========================================================================
- * fd_basic_dup()
- *
- *
- * This is a MAJOR guess!! I don't know if the mutext unlock is valid
- * in the BIG picture. But it seems to be needed to avoid deadlocking
- * with ourselves when we try to close the duped file descriptor.
- */
-static inline void fd_basic_dup(int fd, int newfd)
-{
- fd_table[newfd]->next = fd_table[fd]->next;
- fd_table[fd]->next = fd_table[newfd];
- fd_table[newfd] = fd_table[fd];
- fd_table[fd]->count++;
- pthread_mutex_unlock(&fd_table[newfd]->next->mutex);
-
-}
-
-/* ==========================================================================
- * dup2()
- *
- * Note: Always lock the lower number fd first to avoid deadlocks.
- * Note: Leave the newfd locked. It will be unlocked at close() time.
- * Note: newfd must be locked by hand so it can be closed if it is open,
- * or it won't be opened while dup is in progress.
- */
-int dup2(fd, newfd)
-{
- struct fd_table_entry * entry;
- pthread_mutex_t *mutex;
- union fd_data realfd;
- int ret, flags;
-
- if ((ret = fd_check_entry(newfd)) != OK)
- return ret;
-
- if (newfd < dtablesize) {
- if (fd < newfd) {
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- /* Need to lock the newfd by hand */
- mutex = &(fd_table[newfd]->mutex);
- pthread_mutex_lock(mutex);
-
- /* Is it inuse */
- if (fd_basic_lock(newfd, FD_RDWR, mutex, NULL) == OK) {
- realfd = fd_table[newfd]->fd;
- flags = fd_table[newfd]->flags;
- /* free it and check close status */
- if ((entry = fd_free(newfd)) == NULL) {
- entry = fd_table[newfd];
- entry->ops->close(realfd, flags);
- if (entry->r_queue.q_next) {
- if (fd_table[fd]->next) {
- fd_table[fd]->r_queue.q_last->next =
- entry->r_queue.q_next;
- } else {
- fd_table[fd]->r_queue.q_next =
- entry->r_queue.q_next;
- }
- fd_table[fd]->r_queue.q_last =
- entry->r_queue.q_last;
- }
- if (entry->w_queue.q_next) {
- if (fd_table[fd]->next) {
- fd_table[fd]->w_queue.q_last->next =
- entry->w_queue.q_next;
- } else {
- fd_table[fd]->w_queue.q_next =
- entry->w_queue.q_next;
- }
- fd_table[fd]->w_queue.q_last =
- entry->w_queue.q_last;
- }
- entry->r_queue.q_next = NULL;
- entry->w_queue.q_next = NULL;
- entry->r_queue.q_last = NULL;
- entry->w_queue.q_last = NULL;
- entry->r_owner = NULL;
- entry->w_owner = NULL;
- ret = OK;
- } else {
- fd_basic_basic_unlock(entry, FD_RDWR);
- pthread_mutex_unlock(&entry->mutex);
- /* Note: entry->mutex = mutex */
- }
- }
- fd_basic_dup(fd, newfd);
- }
- fd_unlock(fd, FD_RDWR);
- } else {
- /* Need to lock the newfd by hand */
- mutex = &(fd_table[newfd]->mutex);
- pthread_mutex_lock(mutex);
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- /* Is newfd inuse */
- if ((ret = fd_basic_lock(newfd, FD_RDWR, mutex, NULL)) == OK) {
- realfd = fd_table[newfd]->fd;
- flags = fd_table[newfd]->flags;
- /* free it and check close status */
- if ((entry = fd_free(newfd)) == NULL) {
- entry = fd_table[newfd];
- entry->ops->close(realfd, flags);
- if (entry->r_queue.q_next) {
- if (fd_table[fd]->next) {
- fd_table[fd]->r_queue.q_last->next =
- entry->r_queue.q_next;
- } else {
- fd_table[fd]->r_queue.q_next =
- entry->r_queue.q_next;
- }
- fd_table[fd]->r_queue.q_last =
- entry->r_queue.q_last;
- }
- if (entry->w_queue.q_next) {
- if (fd_table[fd]->next) {
- fd_table[fd]->w_queue.q_last->next =
- entry->w_queue.q_next;
- } else {
- fd_table[fd]->w_queue.q_next =
- entry->w_queue.q_next;
- }
- fd_table[fd]->w_queue.q_last =
- entry->w_queue.q_last;
- }
- entry->r_queue.q_next = NULL;
- entry->w_queue.q_next = NULL;
- entry->r_queue.q_last = NULL;
- entry->w_queue.q_last = NULL;
- entry->r_owner = NULL;
- entry->w_owner = NULL;
- ret = OK;
- } else {
- fd_basic_basic_unlock(entry, FD_RDWR);
- pthread_mutex_unlock(&entry->mutex);
- /* Note: entry->mutex = mutex */
- }
- fd_basic_dup(fd, newfd);
- }
- fd_unlock(fd, FD_RDWR);
- }
- }
- } else {
- ret = NOTOK;
- }
- return(ret);
-
-}
-
-/* ==========================================================================
- * dup()
- */
-int dup(int fd)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- ret = fd_allocate();
- fd_basic_dup(fd, ret);
- fd_unlock(fd, FD_RDWR);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * fcntl()
- */
-int fcntl(int fd, int cmd, ...)
-{
- int ret, realfd, flags;
- struct flock *flock;
- semaphore *plock;
- va_list ap;
-
- flags = 0;
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- va_start(ap, cmd);
- switch(cmd) {
- case F_DUPFD:
- ret = fd_allocate();
- fd_basic_dup(va_arg(ap, int), ret);
- break;
- case F_SETFD:
- break;
- case F_GETFD:
- break;
- case F_GETFL:
- ret = fd_table[fd]->flags;
- break;
- case F_SETFL:
- flags = va_arg(ap, int);
- if ((ret = fd_table[fd]->ops->fcntl(fd_table[fd]->fd,
- fd_table[fd]->flags, cmd, flags | __FD_NONBLOCK)) == OK) {
- fd_table[fd]->flags = flags;
- }
- break;
-/* case F_SETLKW: */
- /*
- * Do the same as SETLK but if it fails with EACCES or EAGAIN
- * block the thread and try again later, not implemented yet
- */
-/* case F_SETLK: */
-/* case F_GETLK:
- flock = va_arg(ap, struct flock*);
- ret = fd_table[fd]->ops->fcntl(fd_table[fd]->fd,
- fd_table[fd]->flags, cmd, flock);
- break; */
- default:
- /* Might want to make va_arg use a union */
- ret = fd_table[fd]->ops->fcntl(fd_table[fd]->fd,
- fd_table[fd]->flags, cmd, va_arg(ap, void*));
- break;
- }
- va_end(ap);
- fd_unlock(fd, FD_RDWR);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * getdtablesize()
- */
-int getdtablesize()
-{
- return dtablesize;
-}
-
-/* ==========================================================================
- * ioctl()
- *
- * Really want to do a real implementation of this that parses the args ala
- * fcntl(), above, but it will have to be a totally platform-specific,
- * nightmare-on-elm-st-style sort of thing. Might even deserve its own file
- * ala select()... --SNL
- */
-#ifndef ioctl_request_type
-#define ioctl_request_type unsigned long /* Dummy patch by Monty */
-#endif
-
-int
-ioctl(int fd, ioctl_request_type request, ...)
-{
- int ret;
- pthread_va_list ap;
- caddr_t arg;
-
- va_start( ap, request ); /* Get the arg */
- arg = va_arg(ap,caddr_t);
- va_end( ap );
-
- if (fd < 0 || fd >= dtablesize)
- ret = NOTOK;
- else if (fd_table[fd]->fd.i == NOTOK)
- ret = machdep_sys_ioctl(fd, request, arg);
- else if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- ret = machdep_sys_ioctl(fd_table[fd]->fd.i, request, arg);
- if( ret == 0 && request == FIONBIO ) {
- /* Properly set NONBLOCK flag */
- int v = *(int *)arg;
- if( v )
- fd_table[fd]->flags |= __FD_NONBLOCK;
- else
- fd_table[fd]->flags &= ~__FD_NONBLOCK;
- }
- fd_unlock(fd, FD_RDWR);
- }
- return ret;
-}
-
diff --git a/mit-pthreads/pthreads/fd_kern.c b/mit-pthreads/pthreads/fd_kern.c
deleted file mode 100644
index f4ada4e4fd4..00000000000
--- a/mit-pthreads/pthreads/fd_kern.c
+++ /dev/null
@@ -1,1950 +0,0 @@
-/* ==== fd_kern.c ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Deals with the valid kernel fds.
- *
- * 1.00 93/09/27 proven
- * -Started coding this file.
- *
- * 1.01 93/11/13 proven
- * -The functions readv() and writev() added.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include "config.h"
-#include <pthread.h>
-#include <unistd.h>
-#include <sys/compat.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/uio.h>
-#include <stdarg.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <pthread/posix.h>
-#include <string.h>
-
-#if defined (HAVE_SYSCALL_SENDTO) && !defined (HAVE_SYSCALL_SEND)
-
-pthread_ssize_t machdep_sys_send (int fd, const void *msg, size_t len,
- int flags)
-{
- return machdep_sys_sendto (fd, msg, len, flags,
- (const struct sockaddr *) 0, 0);
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_RECVFROM) && !defined (HAVE_SYSCALL_RECV)
-
-pthread_ssize_t machdep_sys_recv (int fd, void *buf, size_t len, int flags)
-{
- return machdep_sys_recvfrom (fd, buf, len, flags,
- (struct sockaddr *) 0, (int *) 0);
-}
-
-#endif
-
-/* ==========================================================================
- * Check if there is any signal with must be handled. Added by Monty
- * This could be somewhat system dependent but it should work.
- */
-
-static int fd_check_if_pending_signal(struct pthread *pthread)
-{
- int i;
- unsigned long *pending,*mask;
- if (!pthread->sigcount)
- return 0;
- pending= (unsigned long*) &pthread->sigpending;
- mask= (unsigned long*) &pthread->sigmask;
-
- for (i=0 ; i < sizeof(pthread->sigpending)/sizeof(unsigned long); i++)
- {
- if (*pending && (*mask ^ (unsigned) ~0L))
- return 1;
- pending++;
- mask++;
- }
- return 0;
-}
-
-/* ==========================================================================
- * Variables used by both fd_kern_poll and fd_kern_wait
- */
-struct pthread_queue fd_wait_read = PTHREAD_QUEUE_INITIALIZER;
-struct pthread_queue fd_wait_write = PTHREAD_QUEUE_INITIALIZER;
-struct pthread_queue fd_wait_select = PTHREAD_QUEUE_INITIALIZER;
-
-static struct timeval __fd_kern_poll_timeout = { 0, 0 }; /* Moved by monty */
-extern struct timeval __fd_kern_wait_timeout;
-extern volatile sig_atomic_t sig_to_process;
-
-/*
- * ==========================================================================
- * Do a select if there is someting to wait for.
- * This is to a combination of the old fd_kern_poll() and fd_kern_wait()
- * Return 1 if nothing to do.
- */
-
-static int fd_kern_select(struct timeval *timeout)
-{
- fd_set fd_set_read, fd_set_write, fd_set_except;
- struct pthread *pthread, *deq;
- int count, i;
-
- if (!fd_wait_read.q_next && !fd_wait_write.q_next && !fd_wait_select.q_next)
- return 1; /* Nothing to do */
-
- FD_ZERO(&fd_set_read);
- FD_ZERO(&fd_set_write);
- FD_ZERO(&fd_set_except);
- for (pthread = fd_wait_read.q_next; pthread; pthread = pthread->next)
- FD_SET(pthread->data.fd.fd, &fd_set_read);
- for (pthread = fd_wait_write.q_next; pthread; pthread = pthread->next)
- FD_SET(pthread->data.fd.fd, &fd_set_write);
- for (pthread = fd_wait_select.q_next; pthread; pthread = pthread->next)
- {
- for (i = 0; i < pthread->data.select_data->nfds; i++) {
- if (FD_ISSET(i, &pthread->data.select_data->exceptfds))
- FD_SET(i, &fd_set_except);
- if (FD_ISSET(i, &pthread->data.select_data->writefds))
- FD_SET(i, &fd_set_write);
- if (FD_ISSET(i, &pthread->data.select_data->readfds))
- FD_SET(i, &fd_set_read);
- }
- }
-
- /* Turn off interrupts for real while we set the timer. */
-
- if (timeout == &__fd_kern_wait_timeout)
- { /* from fd_kern_wait() */
- sigset_t sig_to_block, oset;
- sigfillset(&sig_to_block);
- machdep_sys_sigprocmask(SIG_BLOCK, &sig_to_block, &oset);
-
- machdep_unset_thread_timer(NULL);
- __fd_kern_wait_timeout.tv_usec = 0;
- __fd_kern_wait_timeout.tv_sec = (sig_to_process) ? 0 : 3600;
-
- machdep_sys_sigprocmask(SIG_UNBLOCK, &sig_to_block, &oset);
- }
- /*
- * There is a small but finite chance that an interrupt will
- * occure between the unblock and the select. Because of this
- * sig_handler_real() sets the value of __fd_kern_wait_timeout
- * to zero causing the select to do a poll instead of a wait.
- */
-
- while ((count = machdep_sys_select(dtablesize, &fd_set_read,
- &fd_set_write, &fd_set_except,
- timeout)) < OK)
- {
- if (count == -EINTR)
- return 0;
- PANIC();
- }
-
- for (pthread = fd_wait_read.q_next; pthread; ) {
- if (count && FD_ISSET(pthread->data.fd.fd, &fd_set_read) ||
- fd_check_if_pending_signal(pthread))
- {
- if (FD_ISSET(pthread->data.fd.fd, &fd_set_read))
- count--;
- deq = pthread;
- pthread = pthread->next;
- pthread_queue_remove(&fd_wait_read, deq);
- if (SET_PF_DONE_EVENT(deq) == OK) {
- pthread_prio_queue_enq(pthread_current_prio_queue, deq);
- deq->state = PS_RUNNING;
- }
- continue;
- }
- pthread = pthread->next;
- }
-
- for (pthread = fd_wait_write.q_next; pthread; ) {
- if (count && FD_ISSET(pthread->data.fd.fd, &fd_set_write) ||
- fd_check_if_pending_signal(pthread))
- {
- if (FD_ISSET(pthread->data.fd.fd, &fd_set_read))
- count--;
- deq = pthread;
- pthread = pthread->next;
- pthread_queue_remove(&fd_wait_write, deq);
- if (SET_PF_DONE_EVENT(deq) == OK) {
- pthread_prio_queue_enq(pthread_current_prio_queue, deq);
- deq->state = PS_RUNNING;
- }
- continue;
- }
- pthread = pthread->next;
- }
-
- for (pthread = fd_wait_select.q_next; pthread; )
- {
- int found_one=0; /* Loop fixed by monty */
- if (count)
- {
- fd_set tmp_readfds, tmp_writefds, tmp_exceptfds;
- memcpy(&tmp_readfds, &pthread->data.select_data->readfds,
- sizeof(fd_set));
- memcpy(&tmp_writefds, &pthread->data.select_data->writefds,
- sizeof(fd_set));
- memcpy(&tmp_exceptfds, &pthread->data.select_data->exceptfds,
- sizeof(fd_set));
-
- for (i = 0; i < pthread->data.select_data->nfds; i++) {
- if (FD_ISSET(i, &tmp_exceptfds))
- {
- if (! FD_ISSET(i, &fd_set_except))
- FD_CLR(i, &tmp_exceptfds);
- else
- found_one=1;
- }
- if (FD_ISSET(i, &tmp_writefds))
- {
- if (! FD_ISSET(i, &fd_set_write))
- FD_CLR(i, &tmp_writefds);
- else
- found_one=1;
- }
- if (FD_ISSET(i, &tmp_readfds))
- {
- if (! FD_ISSET(i, &fd_set_read))
- FD_CLR(i, &tmp_readfds);
- else
- found_one=1;
- }
- }
- if (found_one)
- {
- memcpy(&pthread->data.select_data->readfds, &tmp_readfds,
- sizeof(fd_set));
- memcpy(&pthread->data.select_data->writefds, &tmp_writefds,
- sizeof(fd_set));
- memcpy(&pthread->data.select_data->exceptfds, &tmp_exceptfds,
- sizeof(fd_set));
- }
- }
- if (found_one || fd_check_if_pending_signal(pthread))
- {
- deq = pthread;
- pthread = pthread->next;
- pthread_queue_remove(&fd_wait_select, deq);
- if (SET_PF_DONE_EVENT(deq) == OK) {
- pthread_prio_queue_enq(pthread_current_prio_queue, deq);
- deq->state = PS_RUNNING;
- }
- } else {
- pthread = pthread->next;
- }
- }
- return 0;
-}
-
-
-/* ==========================================================================
- * fd_kern_poll()
- *
- * Called only from context_switch(). The kernel must be locked.
- *
- * This function uses a linked list of waiting pthreads, NOT a queue.
- */
-
-void fd_kern_poll()
-{
- fd_kern_select(&__fd_kern_poll_timeout);
-}
-
-
-/* ==========================================================================
- * fd_kern_wait()
- *
- * Called when there is no active thread to run.
- */
-
-void fd_kern_wait()
-{
- if (fd_kern_select(&__fd_kern_wait_timeout))
- /* No threads, waiting on I/O, do a sigsuspend */
- sig_handler_pause();
-}
-
-
-/* ==========================================================================
- * Special Note: All operations return the errno as a negative of the errno
- * listed in errno.h
- * ======================================================================= */
-
-/* ==========================================================================
- * read()
- */
-pthread_ssize_t __fd_kern_read(union fd_data fd_data, int flags, void *buf,
- size_t nbytes, struct timespec * timeout)
-{
- int fd = fd_data.i;
- int ret;
-
- pthread_run->sighandled=0; /* Added by monty */
- while ((ret = machdep_sys_read(fd, buf, nbytes)) < OK) {
- if (!(flags & __FD_NONBLOCK) &&
- ((ret == -EWOULDBLOCK) || (ret == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDR_WAIT */
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_run->data.fd.fd = fd;
- pthread_queue_enq(&fd_wait_read, pthread_run);
-
- if (timeout) {
- /* get current time */
- struct timespec current_time;
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
- SET_PF_AT_CANCEL_POINT(pthread_run);
- pthread_resched_resume(PS_FDR_WAIT);
- CLEAR_PF_AT_CANCEL_POINT(pthread_run);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
- ret= NOTOK;
- break;
- }
- pthread_sched_resume();
- } else {
- SET_PF_AT_CANCEL_POINT(pthread_run);
- pthread_resched_resume(PS_FDR_WAIT);
- CLEAR_PF_AT_CANCEL_POINT(pthread_run);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- if (pthread_run->sighandled) /* Added by monty */
- { /* We where aborted */
- SET_ERRNO(EINTR);
- ret= NOTOK;
- break;
- }
- } else {
- SET_ERRNO(-ret);
- ret = NOTOK;
- break;
- }
- }
- return(ret);
-}
-
-/* ==========================================================================
- * readv()
- */
-int __fd_kern_readv(union fd_data fd_data, int flags, const struct iovec *iov,
- int iovcnt, struct timespec * timeout)
-{
- int fd = fd_data.i;
- int ret;
-
- pthread_run->sighandled=0; /* Added by monty */
- while ((ret = machdep_sys_readv(fd, iov, iovcnt)) < OK) {
- if (!(flags & __FD_NONBLOCK) &&
- ((ret == -EWOULDBLOCK) || (ret == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDR_WAIT */
- pthread_run->data.fd.fd = fd;
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_queue_enq(&fd_wait_read, pthread_run);
-
- if (timeout) {
- /* get current time */
- struct timespec current_time;
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
- SET_PF_AT_CANCEL_POINT(pthread_run);
- pthread_resched_resume(PS_FDW_WAIT);
- CLEAR_PF_AT_CANCEL_POINT(pthread_run);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
- ret = NOTOK;
- break;
- }
- pthread_sched_resume();
- } else {
- SET_PF_AT_CANCEL_POINT(pthread_run);
- pthread_resched_resume(PS_FDW_WAIT);
- CLEAR_PF_AT_CANCEL_POINT(pthread_run);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- if (pthread_run->sighandled) /* Added by monty */
- { /* We where aborted */
- SET_ERRNO(EINTR);
- ret= NOTOK;
- break;
- }
- } else {
- SET_ERRNO(-ret);
- ret = NOTOK;
- break;
- }
- }
- return(ret);
-}
-
-/* ==========================================================================
- * write()
- */
-pthread_ssize_t __fd_kern_write(union fd_data fd_data, int flags,
- const void *buf, size_t nbytes, struct timespec * timeout)
-{
- int fd = fd_data.i;
- int ret;
-
- pthread_run->sighandled=0; /* Added by monty */
- while ((ret = machdep_sys_write(fd, buf, nbytes)) < OK) {
- if (!(flags & __FD_NONBLOCK) &&
- ((ret == -EWOULDBLOCK) || (ret == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDW_WAIT */
- pthread_run->data.fd.fd = fd;
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_queue_enq(&fd_wait_write, pthread_run);
-
- if (timeout) {
- /* get current time */
- struct timespec current_time;
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
- pthread_resched_resume(PS_FDW_WAIT);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
- ret = NOTOK;
- break;
- }
- pthread_sched_resume();
- } else {
- pthread_resched_resume(PS_FDW_WAIT);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- if (pthread_run->sighandled) /* Added by monty */
- { /* We where aborted */
- SET_ERRNO(EINTR);
- ret= NOTOK;
- break;
- }
- } else {
- SET_ERRNO(-ret);
- ret = NOTOK;
- break;
- }
- }
- return(ret);
-}
-
-/* ==========================================================================
- * writev()
- */
-int __fd_kern_writev(union fd_data fd_data, int flags, const struct iovec *iov,
- int iovcnt, struct timespec * timeout)
-{
- int fd = fd_data.i;
- int ret;
-
- pthread_run->sighandled=0; /* Added by monty */
- while ((ret = machdep_sys_writev(fd, iov, iovcnt)) < OK) {
- if (!(flags & __FD_NONBLOCK) &&
- ((ret == -EWOULDBLOCK) || (ret == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDW_WAIT */
- pthread_run->data.fd.fd = fd;
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_queue_enq(&fd_wait_write, pthread_run);
-
- if (timeout) {
- /* get current time */
- struct timespec current_time;
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
- pthread_resched_resume(PS_FDW_WAIT);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
- ret = NOTOK;
- break;
- }
- pthread_sched_resume();
- } else {
- pthread_resched_resume(PS_FDW_WAIT);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- if (pthread_run->sighandled) /* Added by monty */
- { /* We where aborted */
- SET_ERRNO(EINTR);
- ret= NOTOK;
- break;
- }
- } else {
- break;
- }
- }
- return(ret);
-}
-
-/* ==========================================================================
- * For blocking version we really should set an interrupt
- * fcntl()
- */
-int __fd_kern_fcntl(union fd_data fd_data, int flags, int cmd, int arg)
-{
- int fd = fd_data.i;
-
- return(machdep_sys_fcntl(fd, cmd, arg));
-}
-
-/* ==========================================================================
- * close()
- */
-int __fd_kern_close(union fd_data fd_data, int flags)
-{
- int fd = fd_data.i;
-
- return(machdep_sys_close(fd));
-}
-
-/* ==========================================================================
- * lseek()
- * Assume that error number is in the range 0- 255 to get bigger
- * range of seek. ; Monty
- */
-off_t __fd_kern_lseek(union fd_data fd_data, int f, off_t offset, int whence)
-{
- int fd = fd_data.i;
- extern off_t machdep_sys_lseek(int, off_t, int);
- off_t ret=machdep_sys_lseek(fd, offset, whence);
- if ((long) ret < 0L && (long) ret >= -255L)
- {
- SET_ERRNO(ret);
- ret= NOTOK;
- }
- return ret;
-}
-
-/*
- * File descriptor operations
- */
-extern machdep_sys_close();
-
-/* Normal file operations */
-static struct fd_ops __fd_kern_ops = {
- __fd_kern_write, __fd_kern_read, __fd_kern_close, __fd_kern_fcntl,
- __fd_kern_writev, __fd_kern_readv, __fd_kern_lseek, 1
-};
-
-/* NFS file opperations */
-
-/* FIFO file opperations */
-
-/* Device operations */
-
-/* ==========================================================================
- * open()
- *
- * Because open could potentially block opening a file from a remote
- * system, we want to make sure the call will timeout. We then try and open
- * the file, and stat the file to determine what operations we should
- * associate with the fd.
- *
- * This is not done yet
- *
- * A regular file on the local system needs no special treatment.
- */
-int open(const char *path, int flags, ...)
-{
- int fd, mode, fd_kern;
- struct stat stat_buf;
- va_list ap;
-
- /* If pthread scheduling == FIFO set a virtual timer */
- if (flags & O_CREAT) {
- va_start(ap, flags);
- mode = va_arg(ap, int);
- va_end(ap);
- } else {
- mode = 0;
- }
-
- if (!((fd = fd_allocate()) < OK)) {
- fd_table[fd]->flags = flags;
- flags |= __FD_NONBLOCK;
-
- if (!((fd_kern = machdep_sys_open(path, flags, mode)) < OK)) {
-
- /* fstat the file to determine what type it is */
- if (machdep_sys_fstat(fd_kern, &stat_buf)) {
- PANIC();
- }
- if (S_ISREG(stat_buf.st_mode)) {
- fd_table[fd]->ops = &(__fd_kern_ops);
- fd_table[fd]->type = FD_HALF_DUPLEX;
- } else {
- fd_table[fd]->ops = &(__fd_kern_ops);
- fd_table[fd]->type = FD_FULL_DUPLEX;
- }
- fd_table[fd]->fd.i = fd_kern;
- return(fd);
- }
-
- fd_table[fd]->count = 0;
- SET_ERRNO(-fd_kern);
- }
- return(NOTOK);
-}
-
-/* ==========================================================================
- * create()
- */
-int create(const char *path, mode_t mode)
-{
- return creat (path, mode);
-}
-
-/* ==========================================================================
- * creat()
- */
-#undef creat
-
-int creat(const char *path, mode_t mode)
-{
- return open (path, O_CREAT | O_TRUNC | O_WRONLY, mode);
-}
-
-/* ==========================================================================
- * fchown()
- */
-int fchown(int fd, uid_t owner, gid_t group)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_WRITE, NULL)) == OK) {
- if ((ret = machdep_sys_fchown(fd_table[fd]->fd.i, owner, group)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_WRITE);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * fchmod()
- */
-int fchmod(int fd, mode_t mode)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_WRITE, NULL)) == OK) {
- if ((ret = machdep_sys_fchmod(fd_table[fd]->fd.i, mode)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_WRITE);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * ftruncate()
- */
-int ftruncate(int fd, off_t length)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_WRITE, NULL)) == OK) {
- if ((ret = machdep_sys_ftruncate(fd_table[fd]->fd.i, length)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_WRITE);
- }
- return(ret);
-}
-
-#if defined (HAVE_SYSCALL_FLOCK)
-/* ==========================================================================
- * flock()
- *
- * Added (mevans)
- */
-int flock(int fd, int operation)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- if ((ret = machdep_sys_flock(fd_table[fd]->fd.i,
- operation)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_RDWR);
- }
- return(ret);
-}
-#endif
-
-/* ==========================================================================
- * pipe()
- */
-int pipe(int fds[2])
-{
- int kfds[2];
- int ret;
-
- if ((fds[0] = fd_allocate()) >= OK) {
- if ((fds[1] = fd_allocate()) >= OK) {
- if ((ret = machdep_sys_pipe(kfds)) >= OK) {
- fd_table[fds[0]]->flags = machdep_sys_fcntl(kfds[0], F_GETFL, NULL);
- machdep_sys_fcntl(kfds[0], F_SETFL, fd_table[fds[0]]->flags | __FD_NONBLOCK);
- fd_table[fds[1]]->flags = machdep_sys_fcntl(kfds[1], F_GETFL, NULL);
- machdep_sys_fcntl(kfds[1], F_SETFL, fd_table[fds[1]]->flags | __FD_NONBLOCK);
-
- fd_table[fds[0]]->ops = &(__fd_kern_ops);
- fd_table[fds[1]]->ops = &(__fd_kern_ops);
-
- /* Not really full duplex but ... */
- fd_table[fds[0]]->type = FD_FULL_DUPLEX;
- fd_table[fds[1]]->type = FD_FULL_DUPLEX;
-
- fd_table[fds[0]]->fd.i = kfds[0];
- fd_table[fds[1]]->fd.i = kfds[1];
-
- return(OK);
- } else {
- SET_ERRNO(-ret);
- }
- fd_table[fds[1]]->count = 0;
- }
- fd_table[fds[0]]->count = 0;
- }
- return(NOTOK);
-}
-
-/* ==========================================================================
- * fd_kern_reset()
- * Change the fcntl blocking flag back to NONBLOCKING. This should only
- * be called after a fork.
- */
-void fd_kern_reset(int fd)
-{
- switch (fd_table[fd]->type) {
- case FD_TEST_HALF_DUPLEX:
- machdep_sys_fcntl(fd_table[fd]->fd.i, F_SETFL,
- fd_table[fd]->flags | __FD_NONBLOCK);
- fd_table[fd]->type = FD_HALF_DUPLEX;
- break;
- case FD_TEST_FULL_DUPLEX:
- machdep_sys_fcntl(fd_table[fd]->fd.i, F_SETFL,
- fd_table[fd]->flags | __FD_NONBLOCK);
- fd_table[fd]->type = FD_FULL_DUPLEX;
- break;
- default:
- break;
- }
-}
-
-/* ==========================================================================
- * fd_kern_init()
- *
- * Assume the entry is locked before routine is invoked
- *
- * This may change. The problem is setting the fd to nonblocking changes
- * the parents fd too, which may not be the desired result.
- *
- * New added feature: If the fd in question is a tty then we open it again
- * and close the original, this way we don't have to worry about the
- * fd being NONBLOCKING to the outside world.
- */
-void fd_kern_init(int fd)
-{
- if ((fd_table[fd]->flags = machdep_sys_fcntl(fd, F_GETFL, NULL)) >= OK) {
- if (isatty_basic(fd)) {
- int new_fd;
-
- if ((new_fd = machdep_sys_open(__ttyname_basic(fd), O_RDWR)) >= OK){
- if (machdep_sys_dup2(new_fd, fd) == OK) {
- /* Should print a warning */
-
- /* Should also set the flags to that of opened outside of
- process */
- }
- machdep_sys_close(new_fd);
- }
- }
- /* We do these things regaurdless of the above results */
- machdep_sys_fcntl(fd, F_SETFL, fd_table[fd]->flags | __FD_NONBLOCK);
- fd_table[fd]->ops = &(__fd_kern_ops);
- fd_table[fd]->type = FD_HALF_DUPLEX;
- fd_table[fd]->fd.i = fd;
- fd_table[fd]->count = 1;
-
- }
-}
-
-/* ==========================================================================
- * fd_kern_gettableentry()
- *
- * Remember only return a a file descriptor that I will modify later.
- * Don't return file descriptors that aren't owned by the child, or don't
- * have kernel operations.
- */
-static int fd_kern_gettableentry(const int child, int fd)
-{
- int i;
-
- for (i = 0; i < dtablesize; i++) {
- if (fd_table[i]) {
- if (fd_table[i]->fd.i == fd) {
- if (child) {
- if ((fd_table[i]->type != FD_TEST_HALF_DUPLEX) &&
- (fd_table[i]->type != FD_TEST_FULL_DUPLEX)) {
- continue;
- }
- } else {
- if ((fd_table[i]->type == FD_NT) ||
- (fd_table[i]->type == FD_NIU)) {
- continue;
- }
- }
- /* Is it a kernel fd ? */
- if ((!fd_table[i]->ops) ||
- (fd_table[i]->ops->use_kfds != 1)) {
- continue;
- }
- return(i);
- }
- }
- }
- return(NOTOK);
-}
-
-/* ==========================================================================
- * fd_kern_exec()
- *
- * Fixup the fd_table such that (fd == fd_table[fd]->fd.i) this way
- * the new immage will be OK.
- *
- * Only touch those that won't be used by the parent if we're in a child
- * otherwise fixup all.
- *
- * Returns:
- * 0 no fixup necessary
- * 1 fixup without problems
- * 2 failed fixup on some descriptors, and clobbered them.
- */
-int fd_kern_exec(const int child)
-{
- int ret = 0;
- int fd, i;
-
- for (fd = 0; fd < dtablesize; fd++) {
- if (fd_table[fd] == NULL) {
- continue;
- }
- /* Is the fd already in use ? */
- if (child) {
- if ((fd_table[fd]->type != FD_TEST_HALF_DUPLEX) &&
- (fd_table[fd]->type != FD_TEST_FULL_DUPLEX)) {
- continue;
- }
- } else {
- if ((fd_table[fd]->type == FD_NT) ||
- (fd_table[fd]->type == FD_NIU)) {
- continue;
- }
- }
- /* Is it a kernel fd ? */
- if ((!fd_table[fd]->ops) ||
- (fd_table[fd]->ops->use_kfds != 1)) {
- continue;
- }
- /* Does it match ? */
- if (fd_table[fd]->fd.i == fd) {
- continue;
- }
- /* OK, fixup entry: Read comments before changing. This isn't obvious */
-
- /* i is the real file descriptor fd currently represents */
- if (((i = fd_table[fd]->fd.i) >= dtablesize) || (i < 0)) {
- /* This should never happen */
- PANIC();
- }
-
- /*
- * if the real file descriptor with the same number as the fake file
- * descriptor number fd is actually in use by the program, we have
- * to move it out of the way
- */
- if ((machdep_sys_fcntl(fd, F_GETFL, NULL)) >= OK) {
- /* fd is busy */
- int j;
-
- /*
- * j is the fake file descriptor that represents the real file
- * descriptor that we want to move. This way the fake file
- * descriptor fd can move its real file descriptor i such that
- * fd == i.
- */
- if ((j = fd_kern_gettableentry(child, fd)) >= OK) {
-
- /*
- * Since j represents a fake file descriptor and fd represents
- * a fake file descriptor. If j < fd then a previous pass
- * should have set fd_table[j]->fd.i == j.
- */
- if (fd < j) {
- if ((fd_table[j]->fd.i = machdep_sys_dup(fd)) < OK) {
- /* Close j, there is nothing else we can do */
- fd_table[j]->type = FD_NIU;
- ret = 2;
- }
- } else {
- /* This implies fd_table[j]->fd.i != j */
- PANIC();
- }
- }
- }
-
- /*
- * Here the real file descriptor i is set to equel the fake file
- * descriptor fd
- */
- machdep_sys_dup2(i, fd);
-
- /*
- * Now comes the really complicated part: UNDERSTAND before changing
- *
- * Here are the things this routine wants to do ...
- *
- * Case 1. The real file descriptor has only one fake file descriptor
- * representing it.
- * fd -> i, fd != i ===> fd -> fd, close(i)
- * Example fd = 4, i = 2: then close(2), set fd -> i = 4
- *
- * Case 2. The real file descriptor has more than one fake file
- * descriptor representing it, and this is the first fake file
- * descriptor representing the real file descriptor
- * fd -> i, fd' -> i, fd != i ===> fd -> fd, fd' -> fd, close(i)
- *
- * The problem is achiving the above is very messy and difficult,
- * but I should be able to take a short cut. If fd > i then there
- * will be no need to ever move i, this is because the fake file
- * descriptor foo that we would have wanted to represent the real
- * file descriptor i has already been processed. If fd < i then by
- * moving i to fd all subsequent fake file descriptors fd' should fall
- * into the previous case and won't need aditional adjusting.
- *
- * Does this break the above fd < j check .... It shouldn't because j
- * is a fake file descriptor and if j < fd then j has already moved
- * its real file descriptor foo such that foo <= j therefore foo < fd
- * and not foo == fd therefor j cannot represent the real
- * filedescriptor that fd want to move to and be less than fd
- */
- if (fd < i) {
- fd_table[fd]->fd.i = fd;
- machdep_sys_close(i);
- }
- if (ret < 1) {
- ret = 1;
- }
- }
-}
-
-/* ==========================================================================
- * fd_kern_fork()
- */
-void fd_kern_fork()
-{
- pthread_mutex_t *mutex;
- int fd;
-
- for (fd = 0; fd < dtablesize; fd++) {
- if (fd_table[fd] == NULL) {
- continue;
- }
- mutex = & (fd_table[fd]->mutex);
- if (pthread_mutex_trylock(mutex)) {
- continue;
- }
- if ((fd_table[fd]->r_owner) || (fd_table[fd]->w_owner)) {
- pthread_mutex_unlock(mutex);
- continue;
- }
- /* Is it a kernel fd ? */
- if ((!fd_table[fd]->ops) || (fd_table[fd]->ops->use_kfds != 1)) {
- pthread_mutex_unlock(mutex);
- continue;
- }
- switch (fd_table[fd]->type) {
- case FD_HALF_DUPLEX:
- machdep_sys_fcntl(fd_table[fd]->fd.i, F_SETFL, fd_table[fd]->flags);
- fd_table[fd]->type = FD_TEST_HALF_DUPLEX;
- break;
- case FD_FULL_DUPLEX:
- machdep_sys_fcntl(fd_table[fd]->fd.i, F_SETFL, fd_table[fd]->flags);
- fd_table[fd]->type = FD_TEST_FULL_DUPLEX;
- break;
- default:
- break;
- }
- pthread_mutex_unlock(mutex);
- }
-}
-
-/* ==========================================================================
- * Here are the berkeley socket functions. These are not POSIX.
- * ======================================================================= */
-
-#if defined (HAVE_SYSCALL_SOCKET) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * socket()
- */
-int socket(int af, int type, int protocol)
-{
- int fd, fd_kern;
-
- if (!((fd = fd_allocate()) < OK)) {
-
- if (!((fd_kern = machdep_sys_socket(af, type, protocol)) < OK)) {
- int tmp_flags;
-
- tmp_flags = machdep_sys_fcntl(fd_kern, F_GETFL, 0);
- machdep_sys_fcntl(fd_kern, F_SETFL, tmp_flags | __FD_NONBLOCK);
-
- /* Should fstat the file to determine what type it is */
- fd_table[fd]->ops = & __fd_kern_ops;
- fd_table[fd]->type = FD_FULL_DUPLEX;
- fd_table[fd]->fd.i = fd_kern;
- fd_table[fd]->flags = tmp_flags;
- return(fd);
- }
-
- fd_table[fd]->count = 0;
- SET_ERRNO(-fd_kern);
- }
- return(NOTOK);
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_BIND) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * bind()
- */
-#ifdef _OS_HAS_SOCKLEN_T
-int bind(int fd, const struct sockaddr *name, socklen_t namelen)
-#else
-int bind(int fd, const struct sockaddr *name, int namelen)
-#endif
-{
- /* Not much to do in bind */
- int ret;
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- if ((ret = machdep_sys_bind(fd_table[fd]->fd.i, name, namelen)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_RDWR);
- }
- return(ret);
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_CONNECT) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * connect()
- */
-#ifdef _OS_HAS_SOCKLEN_T
-int connect(int fd, const struct sockaddr *name, socklen_t namelen)
-#else
-int connect(int fd, const struct sockaddr *name, int namelen)
-#endif
-{
- struct sockaddr tmpname;
- int ret, tmpnamelen;
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- if ((ret = machdep_sys_connect(fd_table[fd]->fd.i, name, namelen)) < OK) {
- if (!(fd_table[fd]->flags & __FD_NONBLOCK) &&
- ((ret == -EWOULDBLOCK) || (ret == -EINPROGRESS) ||
- (ret == -EALREADY) || (ret == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDW_WAIT */
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_run->data.fd.fd = fd_table[fd]->fd.i;
- pthread_queue_enq(&fd_wait_write, pthread_run);
-
- pthread_resched_resume(PS_FDW_WAIT);
- CLEAR_PF_DONE_EVENT(pthread_run);
-
- tmpnamelen = sizeof(tmpname);
- /* OK now lets see if it really worked */
- if (((ret = machdep_sys_getpeername(fd_table[fd]->fd.i,
- &tmpname, &tmpnamelen)) < OK) &&
- (ret == -ENOTCONN))
- {
- /* Get the error, this function should not fail */
- machdep_sys_getsockopt(fd_table[fd]->fd.i, SOL_SOCKET,
- SO_ERROR, &ret, &tmpnamelen);
- SET_ERRNO(ret); /* ret is already positive (mevans) */
- ret = NOTOK;
- }
- } else {
- if (ret < 0)
- {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- }
- }
- fd_unlock(fd, FD_RDWR);
- }
- return(ret);
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_ACCEPT) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * accept()
- */
-#ifdef _OS_HAS_SOCKLEN_T
-int accept(int fd, struct sockaddr *name, socklen_t *namelen)
-#else
-int accept(int fd, struct sockaddr *name, int *namelen)
-#endif
-{
- int ret, fd_kern;
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- while ((fd_kern = machdep_sys_accept(fd_table[fd]->fd.i, name, namelen)) < OK) {
- if (!(fd_table[fd]->flags & __FD_NONBLOCK) &&
- ((fd_kern == -EWOULDBLOCK) || (fd_kern == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDR_WAIT */
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_run->data.fd.fd = fd_table[fd]->fd.i;
- pthread_queue_enq(&fd_wait_read, pthread_run);
-
- pthread_resched_resume(PS_FDR_WAIT);
- CLEAR_PF_DONE_EVENT(pthread_run);
- } else {
- fd_unlock(fd, FD_RDWR);
- SET_ERRNO(-fd_kern);
- return(NOTOK);
- }
- }
- fd_unlock(fd, FD_RDWR);
-
- if (!((ret = fd_allocate()) < OK)) {
-
- /* This may be unnecessary */
- machdep_sys_fcntl(fd_kern, F_SETFL, __FD_NONBLOCK);
-
- /* Should fstat the file to determine what type it is */
- fd_table[ret]->ops = & __fd_kern_ops;
- fd_table[ret]->type = FD_FULL_DUPLEX;
- fd_table[ret]->fd.i = fd_kern;
-
- /* XXX Flags should be the same as those on the listening fd */
- fd_table[ret]->flags = fd_table[fd]->flags;
- }
- }
- return(ret);
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_LISTEN) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * listen()
- */
-int listen(int fd, int backlog)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- if ((ret = machdep_sys_listen(fd_table[fd]->fd.i, backlog)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_RDWR);
- }
- return(ret);
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_SEND) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * send_timedwait()
- */
-ssize_t send_timedwait(int fd, const void * msg, size_t len, int flags,
- struct timespec * timeout)
-{
- int ret;
-
- pthread_run->sighandled=0; /* Added by monty */
- if ((ret = fd_lock(fd, FD_WRITE, timeout)) == OK) {
- while ((ret = machdep_sys_send(fd_table[fd]->fd.i,
- msg, len, flags)) < OK)
- {
- if (!(fd_table[fd]->flags & __FD_NONBLOCK) &&
- ((ret == -EWOULDBLOCK) || (ret == -EAGAIN)))
- {
- pthread_sched_prevent();
-
- /* queue pthread for a FDW_WAIT */
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_run->data.fd.fd = fd_table[fd]->fd.i;
- pthread_queue_enq(&fd_wait_write, pthread_run);
-
- if (timeout) {
- /* get current time */
- struct timespec current_time;
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
- pthread_resched_resume(PS_FDW_WAIT);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- ret = -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
- } else {
- pthread_resched_resume(PS_FDW_WAIT);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- if (pthread_run->sighandled) /* Added by monty */
- { /* We where aborted */
- ret= -EINTR;
- break;
- }
- } else {
- break;
- }
- }
- fd_unlock(fd, FD_WRITE);
- }
- if (ret < 0)
- {
- SET_ERRNO(-ret);
- return(NOTOK);
- }
- return ret;
-}
-
-/* ==========================================================================
- * send()
- */
-ssize_t send(int fd, const void * msg, size_t len, int flags)
-{
- return(send_timedwait(fd, msg, len, flags, NULL));
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_SENDTO) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * sendto_timedwait()
- */
-ssize_t sendto_timedwait(int fd, const void * msg, size_t len,
- int flags, const struct sockaddr *to, int to_len,
- struct timespec * timeout)
-{
- int ret;
-
- pthread_run->sighandled=0; /* Added by monty */
- if ((ret = fd_lock(fd, FD_WRITE, timeout)) == OK) {
- while ((ret = machdep_sys_sendto(fd_table[fd]->fd.i,
- msg, len, flags, to, to_len)) < OK) {
- if (!(fd_table[fd]->flags & __FD_NONBLOCK) &&
- ((ret == -EWOULDBLOCK) || (ret == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDW_WAIT */
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_run->data.fd.fd = fd_table[fd]->fd.i;
- pthread_queue_enq(&fd_wait_write, pthread_run);
-
- if (timeout) {
- /* get current time */
- struct timespec current_time;
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
- pthread_resched_resume(PS_FDW_WAIT);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- ret= -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
- } else {
- pthread_resched_resume(PS_FDW_WAIT);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- if (pthread_run->sighandled) /* Added by monty */
- { /* We where aborted */
- ret= -EINTR;
- break;
- }
- }
- else
- break; /* ret contains the errorcode */
- }
- fd_unlock(fd, FD_WRITE);
- }
- if (ret < 0)
- {
- SET_ERRNO(-ret);
- return(NOTOK);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * sendto()
- */
-#ifdef _OS_HAS_SOCKLEN_T
-ssize_t sendto(int fd, const void * msg, size_t len, int flags,
- const struct sockaddr *to, socklen_t to_len)
-#else
-ssize_t sendto(int fd, const void * msg, size_t len, int flags,
- const struct sockaddr *to, int to_len)
-#endif
-{
- return(sendto_timedwait(fd, msg, len, flags, to, to_len, NULL));
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_SENDMSG) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * sendmsg_timedwait()
- */
-ssize_t sendmsg_timedwait(int fd, const struct msghdr *msg, int flags,
- struct timespec * timeout)
-{
- int passed_fd, ret, i;
-
- /* Handle getting the real file descriptor */
- for(i = 0; i < (((struct omsghdr *)msg)->msg_accrightslen/sizeof(i)); i++) {
- passed_fd = *(((int *)((struct omsghdr *)msg)->msg_accrights) + i);
- if ((ret = fd_lock(passed_fd, FD_RDWR, NULL)) == OK) {
- *(((int *)((struct omsghdr *)msg)->msg_accrights) + i)
- = fd_table[passed_fd]->fd.i;
- machdep_sys_fcntl(fd_table[passed_fd]->fd.i, F_SETFL,
- fd_table[passed_fd]->flags);
- switch(fd_table[passed_fd]->type) {
- case FD_TEST_FULL_DUPLEX:
- case FD_TEST_HALF_DUPLEX:
- break;
- case FD_FULL_DUPLEX:
- fd_table[passed_fd]->type = FD_TEST_FULL_DUPLEX;
- break;
- case FD_HALF_DUPLEX:
- fd_table[passed_fd]->type = FD_TEST_HALF_DUPLEX;
- break;
- default:
- PANIC();
- }
- } else {
- fd_unlock(fd, FD_RDWR);
- SET_ERRNO(EBADF);
- return(NOTOK);
- }
- fd_unlock(fd, FD_RDWR);
- }
-
- pthread_run->sighandled=0; /* Added by monty */
- if ((ret = fd_lock(fd, FD_WRITE, timeout)) == OK) {
- while((ret = machdep_sys_sendmsg(fd_table[fd]->fd.i, msg, flags)) < OK){
- if (!(fd_table[fd]->flags & __FD_NONBLOCK) &&
- ((ret == -EWOULDBLOCK) || (ret == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDW_WAIT */
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_run->data.fd.fd = fd_table[fd]->fd.i;
- pthread_queue_enq(&fd_wait_write, pthread_run);
-
- if (timeout) {
- /* get current time */
- struct timespec current_time;
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
- pthread_resched_resume(PS_FDW_WAIT);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
- ret = NOTOK;
- break;
- }
- pthread_sched_resume();
-
- } else {
- pthread_resched_resume(PS_FDW_WAIT);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- if (pthread_run->sighandled) /* Added by monty */
- { /* We where aborted */
- SET_ERRNO(EINTR);
- ret= NOTOK;
- break;
- }
-
- } else {
- SET_ERRNO(-ret);
- ret = NOTOK;
- break;
- }
- }
- fd_unlock(fd, FD_WRITE);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * sendmsg()
- */
-ssize_t sendmsg(int fd, const struct msghdr *msg, int flags)
-{
- return(sendmsg_timedwait(fd, msg, flags, NULL));
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_RECV) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * recv_timedwait()
- */
-ssize_t recv_timedwait(int fd, void * buf, size_t len, int flags,
- struct timespec * timeout)
-{
- int ret;
-
- pthread_run->sighandled=0; /* Added by monty */
- if ((ret = fd_lock(fd, FD_READ, timeout)) == OK) {
- while ((ret = machdep_sys_recv(fd_table[fd]->fd.i,
- buf, len, flags)) < OK) {
- if (!(fd_table[fd]->flags & __FD_NONBLOCK) &&
- ((ret == -EWOULDBLOCK) || (ret == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDR_WAIT */
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_run->data.fd.fd = fd_table[fd]->fd.i;
- pthread_queue_enq(&fd_wait_read, pthread_run);
-
- if (timeout) {
- /* get current time */
- struct timespec current_time;
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
- pthread_resched_resume(PS_FDR_WAIT);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- ret = -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
- } else {
- pthread_resched_resume(PS_FDR_WAIT);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- if (pthread_run->sighandled) /* Added by monty */
- { /* We where aborted */
- ret= -EINTR;
- break;
- }
-
- } else {
- break;
- }
- }
- fd_unlock(fd, FD_READ);
- }
- if (ret < 0)
- {
- SET_ERRNO(-ret);
- return(NOTOK);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * recv()
- */
-ssize_t recv(int fd, void * buf, size_t len, int flags)
-{
- return(recv_timedwait(fd, buf, len, flags, NULL));
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_RECVFROM) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * recvfrom_timedwait()
- */
-ssize_t recvfrom_timedwait(int fd, void * buf, size_t len, int flags,
- struct sockaddr * from, int * from_len,
- struct timespec * timeout)
-{
- int ret;
-
- pthread_run->sighandled=0; /* Added by monty */
- if ((ret = fd_lock(fd, FD_READ, timeout)) == OK) {
- while ((ret = machdep_sys_recvfrom(fd_table[fd]->fd.i,
- buf, len, flags, from, from_len)) < OK) {
- if (!(fd_table[fd]->flags & __FD_NONBLOCK) &&
- ((ret == -EWOULDBLOCK) || (ret == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDR_WAIT */
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_run->data.fd.fd = fd_table[fd]->fd.i;
- pthread_queue_enq(&fd_wait_read, pthread_run);
-
- if (timeout) {
- /* get current time */
- struct timespec current_time;
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
- pthread_resched_resume(PS_FDR_WAIT);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- ret= -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
-
- } else {
- pthread_resched_resume(PS_FDR_WAIT);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- if (pthread_run->sighandled) /* Added by monty */
- { /* We where aborted */
- ret= -EINTR;
- break;
- }
- } else {
- break;
- }
- }
- fd_unlock(fd, FD_READ);
- }
- if (ret < 0)
- {
- SET_ERRNO(-ret);
- return(NOTOK);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * recvfrom()
- */
-#ifdef _OS_HAS_SOCKLEN_T
-ssize_t recvfrom(int fd, void * buf, size_t len, int flags,
- struct sockaddr * from, socklen_t * from_len)
-#else
-ssize_t recvfrom(int fd, void * buf, size_t len, int flags,
- struct sockaddr * from, int * from_len)
-#endif
-{
- return(recvfrom_timedwait(fd, buf, len, flags, from, from_len, NULL));
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_RECVMSG) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * recvmsg_timedwait()
- */
-ssize_t recvmsg_timedwait(int fd, struct msghdr *msg, int flags,
- struct timespec * timeout)
-{
- struct stat stat_buf;
- int passed_fd, ret, i;
-
- pthread_run->sighandled=0; /* Added by monty */
- if ((ret = fd_lock(fd, FD_READ, timeout)) == OK) {
- while ((ret = machdep_sys_recvmsg(fd_table[fd]->fd.i, msg, flags)) < OK) {
- if (!(fd_table[fd]->flags & __FD_NONBLOCK) &&
- ((ret == -EWOULDBLOCK) || (ret == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDR_WAIT */
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_run->data.fd.fd = fd_table[fd]->fd.i;
- pthread_queue_enq(&fd_wait_read, pthread_run);
-
- if (timeout) {
- /* get current time */
- struct timespec current_time;
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, timeout);
-
- pthread_resched_resume(PS_FDR_WAIT);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
- ret = NOTOK;
- break;
- }
- pthread_sched_resume();
-
- } else {
- pthread_resched_resume(PS_FDR_WAIT);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- if (pthread_run->sighandled) /* Added by monty */
- { /* We where aborted */
- SET_ERRNO(EINTR);
- ret= NOTOK;
- break;
- }
- } else {
- SET_ERRNO(-ret);
- ret = NOTOK;
- break;
- }
- }
- fd_unlock(fd, FD_READ);
-
- /* Handle getting the real file descriptor */
- for (i = 0; i < (((struct omsghdr *)msg)->msg_accrightslen / sizeof(i));
- i++) {
- passed_fd = *(((int *)((struct omsghdr *)msg)->msg_accrights) + i);
- if (!((fd = fd_allocate()) < OK)) {
- fd_table[fd]->flags = machdep_sys_fcntl(passed_fd, F_GETFL);
-
- if (!( fd_table[fd]->flags & __FD_NONBLOCK)) {
- machdep_sys_fcntl(passed_fd, F_SETFL,
- fd_table[fd]->flags | __FD_NONBLOCK);
- }
-
- /* fstat the file to determine what type it is */
- machdep_sys_fstat(passed_fd, &stat_buf);
- if (S_ISREG(stat_buf.st_mode)) {
- fd_table[fd]->type = FD_HALF_DUPLEX;
- } else {
- fd_table[fd]->type = FD_FULL_DUPLEX;
- }
- *(((int *)((struct omsghdr *)msg)->msg_accrights) + i) = fd;
- fd_table[fd]->ops = &(__fd_kern_ops);
- fd_table[fd]->fd.i = passed_fd;
- } else {
- SET_ERRNO(EBADF);
- return(NOTOK);
- break;
- }
- }
- }
- return(ret);
-}
-
-/* ==========================================================================
- * recvmsg()
- */
-ssize_t recvmsg(int fd, struct msghdr *msg, int flags)
-{
- return(recvmsg_timedwait(fd, msg, flags, NULL));
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_SHUTDOWN) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * shutdown()
- */
-int shutdown(int fd, int how)
-{
- int ret;
-
- switch(how) {
- case 0: /* Read */
- if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
- if ((ret = machdep_sys_shutdown(fd_table[fd]->fd.i, how)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_READ);
- }
- case 1: /* Write */
- if ((ret = fd_lock(fd, FD_WRITE, NULL)) == OK) {
- if ((ret = machdep_sys_shutdown(fd_table[fd]->fd.i, how)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_WRITE);
- }
- case 2: /* Read-Write */
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- if ((ret = machdep_sys_shutdown(fd_table[fd]->fd.i, how)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_RDWR);
- }
- default:
- SET_ERRNO(EBADF);
- ret = NOTOK;
- break;
- }
- return(ret);
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_SETSOCKOPT) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * setsockopt()
- */
-#ifdef _OS_HAS_SOCKLEN_T
-int setsockopt(int fd, int level, int optname, const void * optval, socklen_t optlen)
-#else
-int setsockopt(int fd, int level, int optname, const void * optval, int optlen)
-#endif
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK) {
- if ((ret = machdep_sys_setsockopt(fd_table[fd]->fd.i, level,
- optname, optval, optlen)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_RDWR);
- }
- return ret;
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_GETSOCKOPT) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * getsockopt()
- */
-#ifdef _OS_HAS_SOCKLEN_T
-int getsockopt(int fd, int level, int optname, void * optval, socklen_t * optlen)
-#else
-int getsockopt(int fd, int level, int optname, void * optval, int * optlen)
-#endif
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
- if ((ret = machdep_sys_getsockopt(fd_table[fd]->fd.i, level,
- optname, optval, optlen)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_RDWR);
- }
- return ret;
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_GETSOCKOPT) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * getsockname()
- */
-#ifdef _OS_HAS_SOCKLEN_T
-int getsockname(int fd, struct sockaddr * name, socklen_t * naddrlen)
-#else
-int getsockname(int fd, struct sockaddr * name, int * naddrlen)
-#endif
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
- if ((ret = machdep_sys_getsockname(fd_table[fd]->fd.i,
- name, naddrlen)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_RDWR);
- }
- return ret;
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_GETPEERNAME) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * getpeername()
- */
-#ifdef _OS_HAS_SOCKLEN_T
-int getpeername(int fd, struct sockaddr * peer, socklen_t * paddrlen)
-#else
-int getpeername(int fd, struct sockaddr * peer, int * paddrlen)
-#endif
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
- if ((ret = machdep_sys_getpeername(fd_table[fd]->fd.i,
- peer, paddrlen)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_READ);
- }
- return ret;
-}
-
-#endif
-
-#if defined (HAVE_SYSCALL_SOCKETPAIR) || defined (HAVE_SYSCALL_SOCKETCALL)
-
-/* ==========================================================================
- * socketpair()
- */
-int socketpair(int af, int type, int protocol, int pair[2])
-{
- int ret, fd[2];
-
- if (!((pair[0] = fd_allocate()) < OK)) {
- if (!((pair[1] = fd_allocate()) < OK)) {
- if (!((ret = machdep_sys_socketpair(af, type, protocol, fd)) < OK)){
- int tmp_flags;
-
- tmp_flags = machdep_sys_fcntl(fd[0], F_GETFL, 0);
- machdep_sys_fcntl(fd[0], F_SETFL, tmp_flags | __FD_NONBLOCK);
- fd_table[pair[0]]->ops = & __fd_kern_ops;
- fd_table[pair[0]]->type = FD_FULL_DUPLEX;
- fd_table[pair[0]]->flags = tmp_flags;
- fd_table[pair[0]]->fd.i = fd[0];
-
- tmp_flags = machdep_sys_fcntl(fd[1], F_GETFL, 0);
- machdep_sys_fcntl(fd[1], F_SETFL, tmp_flags | __FD_NONBLOCK);
- fd_table[pair[1]]->ops = & __fd_kern_ops;
- fd_table[pair[1]]->type = FD_FULL_DUPLEX;
- fd_table[pair[1]]->flags = tmp_flags;
- fd_table[pair[1]]->fd.i = fd[1];
-
- return(ret);
- }
- fd_table[pair[1]]->count = 0;
- }
- fd_table[pair[0]]->count = 0;
- SET_ERRNO(-ret);
- }
- return(NOTOK);
-}
-
-#endif
diff --git a/mit-pthreads/pthreads/fd_pipe.c b/mit-pthreads/pthreads/fd_pipe.c
deleted file mode 100644
index e8bc20857ed..00000000000
--- a/mit-pthreads/pthreads/fd_pipe.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/* ==== fd_pipe.c ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : The new fast ITC pipe routines.
- *
- * 1.00 93/08/14 proven
- * -Started coding this file.
- *
- * 1.01 93/11/13 proven
- * -The functions readv() and writev() added.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <pthread/fd_pipe.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <pthread/posix.h>
-#include <string.h>
-#include <stdlib.h>
-
-#ifndef MIN
-#define MIN(a,b) ((a)<(b)?(a):(b))
-#endif
-
-/* ==========================================================================
- * The pipe lock is never unlocked until all pthreads waiting are done with it
- * read()
- */
-pthread_ssize_t __pipe_read(union fd_data fd_data, int flags, void *buf,
- size_t nbytes, struct timespec * timeout)
-{
- struct __pipe *fd = (struct __pipe *)fd_data.ptr;
- struct pthread * pthread;
- int ret = 0;
-
- if (flags & O_ACCMODE) { return(NOTOK); }
-
- /* If there is nothing to read, go to sleep */
- if (fd->count == 0) {
- if (flags == WR_CLOSED) {
- return(0);
- }
-
- pthread_sched_prevent();
-
- /* queue pthread for a FDR_WAIT */
- pthread_run->next = NULL;
- fd->wait = pthread_run;
-
- pthread_resched_resume(PS_FDR_WAIT);
- ret = fd->size;
- } else {
- ret = MIN(nbytes, fd->count);
- memcpy(buf, fd->buf + fd->offset, ret);
- if (!(fd->count -= ret)) {
- fd->offset = 0;
- }
-
- if (pthread = fd->wait) {
- fd->wait = NULL;
- pthread_sched_prevent();
- pthread_sched_other_resume(pthread);
- }
- }
- return(ret);
-}
-
-/* ==========================================================================
- * __pipe_write()
- *
- * First check to see if the read side is still open, then
- * check to see if there is a thread in a read wait for this pipe, if so
- * copy as much data as possible directly into the read waiting threads
- * buffer. The write thread(whether or not there was a read thread)
- * copies as much data as it can into the pipe buffer and it there
- * is still data it goes to sleep.
- */
-pthread_ssize_t __pipe_write(union fd_data fd_data, int flags, const void *buf,
- size_t nbytes, struct timespec * timeout) {
- struct __pipe *fd = (struct __pipe *)fd_data.ptr;
- struct pthread * pthread;
- int ret, count;
-
- if (!(flags & O_ACCMODE)) { return(NOTOK); }
-
- while (fd->flags != RD_CLOSED) {
- if (pthread = fd->wait) {
-
- pthread_sched_prevent();
-
- /* Copy data directly into waiting pthreads buf */
- fd->wait_size = MIN(nbytes, fd->wait_size);
- memcpy(fd->wait_buf, buf, fd->wait_size);
- buf = (const char *)buf + fd->wait_size;
- nbytes -= fd->wait_size;
- ret = fd->wait_size;
- fd->wait = NULL;
-
- /* Wake up waiting pthread */
- pthread_sched_other_resume(pthread);
- }
-
- if (count = MIN(nbytes, fd->size - (fd->offset + fd->count))) {
- memcpy(fd->buf + (fd->offset + fd->count), buf, count);
- buf = (const char *)buf + count;
- nbytes -= count;
- ret += count;
- }
- if (nbytes) {
- pthread_sched_prevent();
- fd->wait = pthread_run;
- pthread_resched_resume(PS_FDW_WAIT);
- } else {
- return(ret);
- }
- }
- return(NOTOK);
-}
-
-/* ==========================================================================
- * __pipe_close()
- *
- * The whole close procedure is a bit odd and needs a bit of a rethink.
- * For now close() locks the fd, calls fd_free() which checks to see if
- * there are any other fd values poinging to the same real fd. If so
- * It breaks the wait queue into two sections those that are waiting on fd
- * and those waiting on other fd's. Those that are waiting on fd are connected
- * to the fd_table[fd] queue, and the count is set to zero, (BUT THE LOCK IS NOT
- * RELEASED). close() then calls fd_unlock which give the fd to the next queued
- * element which determins that the fd is closed and then calls fd_unlock etc...
- */
-int __pipe_close(struct __pipe *fd, int flags)
-{
- struct pthread * pthread;
-
- if (!(fd->flags)) {
- if (pthread = fd->wait) {
- if (flags & O_ACCMODE) {
- fd->count = 0;
- fd->wait = NULL;
- fd->flags |= WR_CLOSED;
- pthread_sched_prevent();
- pthread_resched_resume(pthread);
- } else {
- /* Should send a signal */
- fd->flags |= RD_CLOSED;
- }
- }
- } else {
- free(fd);
- return(OK);
- }
-}
-
-/* ==========================================================================
- * For fcntl() which isn't implemented yet
- * __pipe_enosys()
- */
-static int __pipe_enosys()
-{
- SET_ERRNO(ENOSYS);
- return(NOTOK);
-}
-
-/* ==========================================================================
- * For writev() and readv() which aren't implemented yet
- * __pipe_enosys_v()
- */
-static int __pipe_enosys_v(union fd_data fd, int flags,
- const struct iovec *vec, int nvec,
- struct timespec *timeout)
-{
- SET_ERRNO(ENOSYS);
- return(NOTOK);
-}
-
-/* ==========================================================================
- * For lseek() which isn't implemented yet
- * __pipe_enosys_o()
- */
-static off_t __pipe_enosys_o()
-{
- SET_ERRNO(ENOSYS);
- return(NOTOK);
-}
-
-/*
- * File descriptor operations
- */
-struct fd_ops fd_ops[] = {
-{ __pipe_write, __pipe_read, __pipe_close, __pipe_enosys,
- __pipe_enosys_v, __pipe_enosys_v, __pipe_enosys_o, 0 },
-};
-
-/* ==========================================================================
- * open()
- */
-/* int __pipe_open(const char *path, int flags, ...) */
-int newpipe(int fd[2])
-{
- struct __pipe *fd_data;
-
- if ((!((fd[0] = fd_allocate()) < OK)) && (!((fd[1] = fd_allocate()) < OK))) {
- fd_data = malloc(sizeof(struct __pipe));
- fd_data->buf = malloc(4096);
- fd_data->size = 4096;
- fd_data->count = 0;
- fd_data->offset = 0;
-
- fd_data->wait = NULL;
- fd_data->flags = 0;
-
- fd_table[fd[0]]->fd.ptr = fd_data;
- fd_table[fd[0]]->flags = O_RDONLY;
- fd_table[fd[1]]->fd.ptr = fd_data;
- fd_table[fd[1]]->flags = O_WRONLY;
-
- return(OK);
- }
- return(NOTOK);
-}
-
diff --git a/mit-pthreads/pthreads/fd_sysv.c b/mit-pthreads/pthreads/fd_sysv.c
deleted file mode 100644
index 6dc01a49aa4..00000000000
--- a/mit-pthreads/pthreads/fd_sysv.c
+++ /dev/null
@@ -1,897 +0,0 @@
-/* ==== fd_sysv.c ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Transforms BSD socket calls to SYSV streams.
- *
- * 1.00 94/11/19 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <config.h>
-#include <pthread.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#if defined (HAVE_SYSCALL_PUTMSG) && defined (HAVE_SYSCALL_GETMSG) && !defined(HAVE_SYSCALL_SOCKETCALL) && !defined(HAVE_SYSCALL_SOCKET)
-#define HAVE_STREAMS 1
-
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <sys/socket.h>
-#include <sys/stream.h>
-#include <sys/stropts.h>
-#include <tiuser.h>
-#include <sys/tihdr.h>
-#include <netinet/in.h>
-#include <sys/timod.h>
-
-#define STREAM_BUF_SIZE sizeof(union T_primitives) + sizeof(struct sockaddr)
-
-extern struct pthread_queue fd_wait_read, fd_wait_write;
-
-/* ==========================================================================
- * putmsg_timedwait_basic()
- */
-static int putmsg_timedwait_basic(int fd, struct strbuf * ctlptr,
- struct strbuf * dataptr, int flags, struct timespec * timeout)
-{
-
- int ret;
-
- pthread_run->sighandled=0; /* Added by monty */
- while ((ret = machdep_sys_putmsg(fd_table[fd]->fd.i,
- ctlptr, dataptr, flags)) < OK) {
- if (!(fd_table[fd]->flags & __FD_NONBLOCK) &&
- ((ret == -EWOULDBLOCK) || (ret == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDW_WAIT */
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_run->data.fd.fd = fd_table[fd]->fd.i;
- pthread_queue_enq(&fd_wait_write, pthread_run);
-
- if (timeout) {
- /* get current time */
- struct timespec current_time;
- machdep_gettimeofday(&current_time);
- sleep_schedule(& current_time, timeout);
-
- pthread_resched_resume(PS_FDW_WAIT);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
- ret = -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
- } else {
- pthread_resched_resume(PS_FDW_WAIT);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- if (pthread_run->sighandled) /* Added by monty */
- { /* We where aborted */
- SET_ERRNO(EINTR);
- ret= -EINTR;
- break;
- }
- } else {
- SET_ERRNO(-ret);
- break;
- }
- }
- return(ret);
-}
-
-/* ==========================================================================
- * putmsg_timedwait()
- */
-int putmsg_timedwait(int fd, struct strbuf * ctlptr, struct strbuf * dataptr,
- int flags, struct timespec * timeout)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_WRITE, timeout)) == OK) {
- ret = putmsg_timedwait_basic(fd, ctlptr, dataptr, flags, timeout);
- fd_unlock(fd, FD_WRITE);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * putmsg()
- */
-int putmsg(int fd, struct strbuf * ctlptr, struct strbuf * dataptr,
- int flags)
-{
- return(putmsg_timedwait(fd, ctlptr, dataptr, flags, NULL));
-}
-
-/* ==========================================================================
- * getmsg_timedwait_basic()
- */
-int getmsg_timedwait_basic(int fd, struct strbuf * ctlptr,
- struct strbuf * dataptr, int * flags, struct timespec * timeout)
-{
- int ret;
-
- pthread_run->sighandled=0; /* Added by monty */
- while ((ret = machdep_sys_getmsg(fd_table[fd]->fd.i,
- ctlptr, dataptr, flags)) < OK) {
- if (!(fd_table[fd]->flags & __FD_NONBLOCK) &&
- ((ret == -EWOULDBLOCK) || (ret == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDR_WAIT */
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_run->data.fd.fd = fd_table[fd]->fd.i;
- pthread_queue_enq(&fd_wait_read, pthread_run);
-
- if (timeout) {
- /* get current time */
- struct timespec current_time;
- machdep_gettimeofday(&current_time);
- sleep_schedule(& current_time, timeout);
-
- pthread_resched_resume(PS_FDR_WAIT);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
- ret = -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
- } else {
- pthread_resched_resume(PS_FDR_WAIT);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- if (pthread_run->sighandled) /* Added by monty */
- { /* We where aborted */
- SET_ERRNO(EINTR);
- ret= -EINTR;
- break;
- }
-
- } else {
- SET_ERRNO(-ret);
- break;
- }
- }
- return(ret);
-}
-
-/* ==========================================================================
- * getmsg_timedwait()
- */
-int getmsg_timedwait(int fd, struct strbuf * ctlptr, struct strbuf * dataptr,
- int * flags, struct timespec * timeout)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_READ, timeout)) == OK) {
- ret = getmsg_timedwait_basic(fd, ctlptr, dataptr, flags, timeout);
- fd_unlock(fd, FD_READ);
- }
- return (ret);
-}
-
-/* ==========================================================================
- * getmsg()
- */
-int getmsg(int fd, struct strbuf * ctlptr, struct strbuf * dataptr,
- int * flags)
-{
- return(getmsg_timedwait(fd, ctlptr, dataptr, flags, NULL));
-}
-
-#endif
-
-/* ==========================================================================
- * Here are the berkeley socket functions implemented with stream calls.
- * These are not POSIX.
- * ======================================================================= */
-
-#if (!defined (HAVE_SYSCALL_BIND)) && defined(HAVE_STREAMS)
-
-/* ==========================================================================
- * bind()
- */
-int bind(int fd, const struct sockaddr *name, int namelen)
-{
- char buf[STREAM_BUF_SIZE];
- union T_primitives * res;
- struct T_bind_req * req;
- struct T_bind_ack * ack;
- struct strbuf strbuf;
- int flags, ret;
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK)
- {
- req = (struct T_bind_req *)buf;
- req->PRIM_type = T_BIND_REQ;
- req->ADDR_length = namelen;
- req->ADDR_offset = sizeof(struct T_bind_req);
- req->CONIND_number = 4;
- memcpy(buf + sizeof(struct T_bind_req), name, namelen);
-
- strbuf.len = sizeof(struct T_bind_req) + namelen;
- strbuf.maxlen = STREAM_BUF_SIZE;
- strbuf.buf = buf;
-
- if ((ret=putmsg_timedwait_basic(fd, &strbuf, NULL, 0, NULL)) == OK)
- {
- memset(buf, 0, STREAM_BUF_SIZE);
-
- strbuf.len = sizeof(struct T_bind_ack) + namelen;
- strbuf.maxlen = STREAM_BUF_SIZE;
- strbuf.buf = buf;
- flags = 0;
-
- if ((ret = getmsg_timedwait_basic(fd, &strbuf, NULL,
- &flags, NULL)) >= OK)
- {
- res = (union T_primitives *)buf;
-
- switch(res->type) {
- case T_BIND_ACK:
- ret = OK;
- break;
- default:
- SET_ERRNO(EPROTO); /* What should this be? */
- ret = NOTOK;
- break;
- }
- }
- else
- {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- }
- else
- {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_RDWR);
- }
- return(ret);
-}
-
-#endif
-
-#if (!defined (HAVE_SYSCALL_CONNECT)) && defined(HAVE_STREAMS)
-
-/* ==========================================================================
- * connect()
- */
-int connect(int fd, const struct sockaddr *name, int namelen)
-{
- char buf[STREAM_BUF_SIZE];
- union T_primitives * res;
- struct T_conn_req * req;
- struct T_conn_con * con;
- struct T_ok_ack * ok;
- struct strbuf strbuf;
- int flags, ret;
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK)
- {
- req = (struct T_conn_req *)buf;
- req->PRIM_type = T_CONN_REQ;
- req->DEST_length = namelen;
- req->DEST_offset = sizeof(struct T_conn_req);
- req->OPT_length = 0;
- req->OPT_offset = 0;
- memcpy(buf + sizeof(struct T_conn_req), name, namelen);
-
- strbuf.len = sizeof(struct T_conn_req) + namelen;
- strbuf.maxlen = STREAM_BUF_SIZE;
- strbuf.buf = buf;
-
- if ((ret=putmsg_timedwait_basic(fd, &strbuf, NULL, 0, NULL)) != OK)
- goto err;
-
- memset(buf, 0, STREAM_BUF_SIZE);
- ok = (struct T_ok_ack *)buf;
-
- strbuf.maxlen = STREAM_BUF_SIZE;
- strbuf.len = STREAM_BUF_SIZE;
- strbuf.buf = buf;
- flags = 0;
-
- if ((ret=getmsg_timedwait_basic(fd, &strbuf, NULL, &flags, NULL)) < OK)
- goto err; /* Fixed by monty */
- if (ok->PRIM_type != T_OK_ACK)
- {
- ret= -EPROTO; /* What should this be? */
- goto err;
- }
-
- memset(buf, 0, STREAM_BUF_SIZE);
- strbuf.maxlen = STREAM_BUF_SIZE;
- strbuf.len = STREAM_BUF_SIZE;
- strbuf.buf = buf;
- flags = 0;
-
- if ((ret=getmsg_timedwait_basic(fd, &strbuf, NULL, &flags, NULL) < OK))
- goto err;
-
- res = (union T_primitives *) buf;
- switch(res->type) {
- case T_CONN_CON:
- ret = OK;
- break;
- case T_DISCON_IND:
- ret= -ECONNREFUSED;
- goto err;
- default:
- ret= -EPROTO; /* What should this be? */
- goto err;
- }
- fd_unlock(fd, FD_RDWR);
- }
- return(ret);
-
- err:
- fd_unlock(fd, FD_RDWR);
- SET_ERRNO(-ret); /* Proably not needed... */
- return NOTOK;
-}
-
-#endif
-
-#if (!defined (HAVE_SYSCALL_LISTEN)) && defined(HAVE_STREAMS)
-
-/* ==========================================================================
- * listen()
- */
-int listen(int fd, int backlog)
-{
- return(OK);
-}
-
-#endif
-
-#if (!defined (HAVE_SYSCALL_SOCKET)) && defined(HAVE_STREAMS)
-
-extern ssize_t __fd_kern_write();
-static pthread_ssize_t __fd_sysv_read();
-extern int __fd_kern_close();
-extern int __fd_kern_fcntl();
-extern int __fd_kern_writev();
-extern int __fd_kern_readv();
-extern off_t __fd_kern_lseek();
-
-/* Normal file operations */
-static struct fd_ops __fd_sysv_ops = {
- __fd_kern_write, __fd_sysv_read, __fd_kern_close, __fd_kern_fcntl,
- __fd_kern_writev, __fd_kern_readv, __fd_kern_lseek, 1
-};
-
-/* ==========================================================================
- * read()
- */
-static pthread_ssize_t __fd_sysv_read(union fd_data fd_data, int flags,
- void *buf, size_t nbytes, struct timespec * timeout)
-{
- struct strbuf dataptr;
- int fd = fd_data.i;
- int getmsg_flags;
- int ret;
-
- getmsg_flags = 0;
- dataptr.len = 0;
- dataptr.buf = buf;
- dataptr.maxlen = nbytes;
-
- pthread_run->sighandled=0; /* Added by monty */
- while ((ret = machdep_sys_getmsg(fd, NULL, &dataptr, &getmsg_flags)) < OK) {
- if (!(fd_table[fd]->flags & __FD_NONBLOCK) &&
- ((ret == -EWOULDBLOCK) || (ret == -EAGAIN))) {
- pthread_sched_prevent();
-
- /* queue pthread for a FDR_WAIT */
- pthread_run->data.fd.fd = fd;
- SET_PF_WAIT_EVENT(pthread_run);
- pthread_queue_enq(&fd_wait_read, pthread_run);
-
- if (timeout) {
- /* get current time */
- struct timespec current_time;
- machdep_gettimeofday(&current_time);
- sleep_schedule(& current_time, timeout);
-
- pthread_resched_resume(PS_FDR_WAIT);
-
- /* We're awake */
- pthread_sched_prevent();
- if (sleep_cancel(pthread_run) == NOTOK) {
- CLEAR_PF_DONE_EVENT(pthread_run);
- pthread_sched_resume();
- SET_ERRNO(ETIMEDOUT);
- ret = -ETIMEDOUT;
- break;
- }
- pthread_sched_resume();
- } else {
- pthread_resched_resume(PS_FDR_WAIT);
- }
- CLEAR_PF_DONE_EVENT(pthread_run);
- if (pthread_run->sighandled) /* Added by monty */
- { /* We where aborted */
- SET_ERRNO(EINTR);
- return(NOTOK);
- }
- } else {
- SET_ERRNO(-ret);
- return(NOTOK);
- break;
- }
- }
- return(dataptr.len);
-}
-
-/* ==========================================================================
- * socket_tcp()
- */
-static int socket_tcp(int fd)
-{
- int ret;
-
- if ((ret = machdep_sys_open("/dev/tcp", O_RDWR | O_NONBLOCK, 0)) >= OK) {
- /* Should fstat the file to determine what type it is */
- fd_table[fd]->ops = & __fd_sysv_ops;
- fd_table[fd]->type = FD_FULL_DUPLEX;
- fd_table[fd]->fd.i = ret;
- fd_table[fd]->flags = 0;
- }
- return(ret);
-}
-
-/* ==========================================================================
- * socket()
- */
-int socket(int af, int type, int protocol)
-{
- int fd, fd_kern;
-
- if ((fd = fd_allocate()) < OK)
- return (fd);
-
- switch(af) {
- case AF_INET:
- switch(type) {
- case SOCK_STREAM:
- if ((fd_kern = socket_tcp(fd)) >= OK)
- return(fd);
- SET_ERRNO(-fd_kern);
- break;
- case SOCK_DGRAM:
- if ((fd_kern = machdep_sys_open("/dev/udp",
- O_RDWR | O_NONBLOCK, 0)) >= OK) {
- /* Should fstat the file to determine what type it is */
- fd_table[fd]->ops = & __fd_sysv_ops;
- fd_table[fd]->type = FD_FULL_DUPLEX;
- fd_table[fd]->fd.i = fd_kern;
- fd_table[fd]->flags = 0;
- return(fd);
- }
- SET_ERRNO(-fd_kern);
- break;
- default:
- SET_ERRNO(EPROTONOSUPPORT);
- break;
- }
- break;
- case AF_UNIX:
- case AF_ISO:
- case AF_NS:
- default:
- SET_ERRNO(EPROTONOSUPPORT);
- break;
- }
- fd_table[fd]->count = 0;
- return(NOTOK); /* Fixed by monty */
-}
-
-#endif
-
-#if (!defined (HAVE_SYSCALL_ACCEPT)) && defined(HAVE_STREAMS)
-
-/* ==========================================================================
- * accept_fd()
- */
-static int accept_fd(int fd, struct sockaddr *name, int *namelen, char * buf,
- int SEQ_number)
-{
- struct T_conn_res * res;
- struct strbuf strbuf;
- int fd_new, fd_kern;
-
- /* Get a new table entry */
- if ((fd_new = fd_allocate()) < OK)
- return(NOTOK);
-
- /* Get the new kernel entry */
- if (!((fd_kern = socket_tcp(fd_new)) < OK)) {
- res = (struct T_conn_res *)buf;
- res->PRIM_type = T_CONN_RES;
- /* res->QUEUE_ptr = (queue_t *)&fd_kern; */
- res->OPT_length = 0;
- res->OPT_offset = 0;
- res->SEQ_number = SEQ_number;
-
- strbuf.maxlen = sizeof(union T_primitives) +sizeof(struct sockaddr);
- strbuf.len = sizeof(struct T_conn_ind) + (*namelen);
- strbuf.buf = buf;
-
- {
- struct strfdinsert insert;
-
- insert.ctlbuf.maxlen = (sizeof(union T_primitives) +
- sizeof(struct sockaddr));
- insert.ctlbuf.len = sizeof(struct T_conn_ind);
- insert.ctlbuf.buf = buf;
- insert.databuf.maxlen = 0;
- insert.databuf.len = 0;
- insert.databuf.buf = NULL;
- insert.flags = 0;
- insert.fildes = fd_kern;
- insert.offset = 4;
- /* Should the following be checked ? */
- machdep_sys_ioctl(fd_table[fd]->fd.i, I_FDINSERT, &insert);
- }
-
- /* if (putmsg_timedwait_basic(fd, &strbuf, NULL, 0, NULL) == OK) {
- /* return(fd_new); */
- {
- int flags = 0;
- int ret;
-
- /* Should the following be checked ? */
- ret = getmsg_timedwait_basic(fd, &strbuf, NULL, &flags, NULL);
- return(fd_new);
-
- }
- machdep_sys_close(fd_kern);
- }
- fd_table[fd_new]->count = 0;
- return(NOTOK);
-}
-
-
-/* ==========================================================================
- * accept()
- */
-int accept(int fd, struct sockaddr *name, int *namelen)
-{
- char buf[sizeof(union T_primitives) + sizeof(struct sockaddr)];
- struct T_conn_ind * ind;
- struct strbuf strbuf;
- int flags, ret;
-
- if ((ret = fd_lock(fd, FD_RDWR, NULL)) == OK)
- {
- ind = (struct T_conn_ind *)buf;
- ind->PRIM_type = T_CONN_IND;
- ind->SRC_length = (*namelen);
- ind->SRC_offset = sizeof(struct T_conn_ind);
- ind->OPT_length = 0;
- ind->OPT_offset = 0;
- ind->SEQ_number = 0;
-
- strbuf.maxlen = sizeof(union T_primitives) + sizeof(struct sockaddr);
- strbuf.len = sizeof(struct T_conn_ind) + (*namelen);
- strbuf.buf = buf;
- flags = 0;
-
- if ((ret=getmsg_timedwait_basic(fd, &strbuf, NULL, &flags, NULL)) < OK)
- {
- SET_ERRNO(-ret);
- ret= NOTOK;
- }
- else
- ret = accept_fd(fd, name, namelen, buf, ind->SEQ_number);
- fd_unlock(fd, FD_RDWR);
- }
- return(ret);
-}
-
-#endif /* HAVE_SYSCALL_ACCEPT */
-
-#if (!defined (HAVE_SYSCALL_SENDTO)) && defined (HAVE_STREAMS)
-
-/* ==========================================================================
- * sendto_timedwait()
- */
-ssize_t sendto_timedwait(int fd, const void * msg, size_t len, int flags,
- const struct sockaddr *name, int namelen, struct timespec * timeout)
-{
- char buf[STREAM_BUF_SIZE];
- struct T_unitdata_req * req;
- struct strbuf dataptr;
- struct strbuf ctlptr;
- ssize_t ret, prio;
-
- req = (struct T_unitdata_req *)buf;
- req->PRIM_type = T_UNITDATA_REQ;
- req->DEST_length = namelen;
- req->DEST_offset = sizeof(struct T_unitdata_req);
- req->OPT_length = 0;
- req->OPT_offset = 0;
- memcpy(buf + sizeof(struct T_unitdata_req), name, namelen);
-
- ctlptr.len = sizeof(struct T_unitdata_req) + namelen;
- ctlptr.maxlen = STREAM_BUF_SIZE;
- ctlptr.buf = buf;
-
- dataptr.len = len;
- dataptr.maxlen = len;
- dataptr.buf = (void *)msg;
-
- if ((ret = putmsg_timedwait(fd, &ctlptr, &dataptr, 0, timeout)) == OK) {
- ret = len;
- }
- return(ret);
-}
-
-/* ==========================================================================
- * sendto()
- */
-ssize_t sendto(int fd, const void * msg, size_t len, int flags,
- const struct sockaddr *to, int to_len)
-{
- return(sendto_timedwait(fd, msg, len, flags, to, to_len, NULL));
-}
-
-#endif
-
-#if (!defined (HAVE_SYSCALL_SEND)) && defined (HAVE_STREAMS)
-
-/* ==========================================================================
- * send_timedwait()
- */
-ssize_t send_timedwait(int fd, const void * msg, size_t len, int flags,
- struct timespec * timeout)
-{
- char buf[STREAM_BUF_SIZE];
- struct T_unitdata_req * req;
- struct strbuf dataptr;
- struct strbuf ctlptr;
- ssize_t ret, prio;
-
- req = (struct T_unitdata_req *)buf;
- req->PRIM_type = T_UNITDATA_REQ;
- req->DEST_length = 0;
- req->DEST_offset = 0;
- req->OPT_length = 0;
- req->OPT_offset = 0;
-
- ctlptr.len = sizeof(struct T_unitdata_req);
- ctlptr.maxlen = STREAM_BUF_SIZE;
- ctlptr.buf = buf;
-
- dataptr.len = len;
- dataptr.maxlen = len;
- dataptr.buf = (void *)msg;
-
- if ((ret = putmsg_timedwait(fd, &ctlptr, &dataptr, 0, timeout)) == OK) {
- ret = len;
- }
- return(ret);
-}
-
-/* ==========================================================================
- * send()
- */
-ssize_t send(int fd, const void * msg, size_t len, int flags)
-{
- return(send_timedwait(fd, msg, len, flags, NULL));
-}
-
-#endif
-
-#if (!defined (HAVE_SYSCALL_RECVFROM)) && defined(HAVE_STREAMS)
-
-/* ==========================================================================
- * recvfrom_timedwait()
- */
-ssize_t recvfrom_timedwait(int fd, void * msg, size_t len, int flags,
- struct sockaddr * name, int * namelen, struct timespec * timeout)
-{
- char buf[STREAM_BUF_SIZE];
- struct T_unitdata_ind * ind;
- struct strbuf dataptr;
- struct strbuf ctlptr;
- int ret, prio;
-
- ctlptr.len = 0;
- ctlptr.maxlen = STREAM_BUF_SIZE;
- ctlptr.buf = buf;
-
- dataptr.maxlen = len;
- dataptr.len = 0;
- dataptr.buf = msg;
-
- prio = 0;
-
- ret = getmsg_timedwait(fd, &ctlptr, &dataptr, &prio, timeout);
- if (ret >= OK) {
- if (name != NULL) {
- ind = (struct T_unitdata_ind *)buf;
-
- if (*namelen > ind->SRC_length)
- *namelen = ind->SRC_length;
- memcpy(name, buf + ind->SRC_offset, *namelen);
- }
- ret = dataptr.len;
- }
-
- return(ret);
-}
-
-/* ==========================================================================
- * recvfrom()
- */
-ssize_t recvfrom(int fd, void * buf, size_t len, int flags,
- struct sockaddr * from, int * from_len)
-{
- return(recvfrom_timedwait(fd, buf, len, flags, from, from_len, NULL));
-}
-
-#endif
-
-#if (!defined (HAVE_SYSCALL_RECV)) && defined(HAVE_STREAMS)
-
-/* ==========================================================================
- * recv_timedwait()
- */
-ssize_t recv_timedwait(int fd, void * msg, size_t len, int flags,
- struct timespec * timeout)
-{
- char buf[STREAM_BUF_SIZE];
- struct T_unitdata_ind * ind;
- struct strbuf dataptr;
- struct strbuf ctlptr;
- int ret, prio;
-
- ctlptr.len = 0;
- ctlptr.maxlen = STREAM_BUF_SIZE;
- ctlptr.buf = buf;
-
- dataptr.maxlen = len;
- dataptr.len = 0;
- dataptr.buf = msg;
-
- prio = 0;
-
- ret = getmsg_timedwait(fd, &ctlptr, &dataptr, &prio, timeout);
- if (ret >= OK)
- ret = dataptr.len;
-
- return(ret);
-}
-
-/* ==========================================================================
- * recv()
- */
-ssize_t recv(int fd, void * buf, size_t len, int flags,
- struct sockaddr * from, int * from_len)
-{
- return(recv_timedwait(fd, buf, len, flags, NULL));
-}
-
-#endif
-
-#if (!defined (HAVE_SYSCALL_SETSOCKOPT)) && defined(HAVE_STREAMS)
-/* ==========================================================================
- * setsockopt()
- */
-int setsockopt(int s, int level, int optname, const void *optval, int optlen)
-{
- return(0);
-}
-#endif
-
-struct foo { /* Used by getsockname and getpeername */
- long a;
- int b;
- struct sockaddr *name;
-};
-
-#if (!defined (HAVE_SYSCALL_GETSOCKNAME)) && defined(HAVE_STREAMS)
-/* ==========================================================================
- * getsockname()
- */
-
-
-int getsockname(int s, struct sockaddr *name, int *namelen)
-{
- struct foo foo;
- int i;
- if (*namelen < sizeof(struct sockaddr)) {
- SET_ERRNO(ENOMEM);
- return(-1);
- }
- foo.a = 0x84;
- foo.b = 0;
- foo.name = name;
- i = ioctl(s, TI_GETMYNAME, &foo);
- *namelen = foo.b;
- return(i);
-}
-#endif
-
-#if (!defined (HAVE_SYSCALL_GETPEERNAME)) && defined(HAVE_STREAMS)
-/* ==========================================================================
- * getpeername() ; Added by Monty
- */
-
-int getpeername(int s, struct sockaddr *name, int *namelen)
-{
- struct foo foo;
- int i;
- if (*namelen < sizeof(struct sockaddr)) {
- SET_ERRNO(ENOMEM);
- return(-1);
- }
- foo.a = 0x84; /* Max length ? */
- foo.b = 0; /* Return length */
- foo.name = name; /* Return buffer */
- i = ioctl(s, TI_GETPEERNAME, &foo);
- *namelen = foo.b;
- return(i);
-}
-#endif
-
-
-#if (!defined (HAVE_SYSCALL_SHUTDOWN)) && defined(HAVE_STREAMS)
-/* ==========================================================================
- * shutdown()
- */
-
-int shutdown(int s, int how)
-{
- return(0);
-}
-#endif
diff --git a/mit-pthreads/pthreads/file.c b/mit-pthreads/pthreads/file.c
deleted file mode 100644
index 4b8a8aad6db..00000000000
--- a/mit-pthreads/pthreads/file.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/* ==== file.c ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : The locking functions for stdio.
- *
- * 1.00 93/09/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <stdio.h>
-
-/* ==========================================================================
- * flockfile()
- */
-void flockfile(FILE *fp)
-{
- pthread_mutex_t *mutex;
- int fd, flags;
-
- if ((fd = fileno(fp)) >= 0) {
- pthread_mutex_lock(mutex = &(fd_table[fd]->mutex));
-
- if (fp->_flags & __SRW) {
- flags = FD_READ | FD_WRITE;
- } else {
- if (fp->_flags & __SWR) {
- flags = FD_WRITE;
- } else {
- flags = FD_READ;
- }
- }
-
- /* This might fail but POSIX doesn't give a damn. */
- fd_basic_lock(fd, flags, mutex, NULL);
- pthread_mutex_unlock(mutex);
- }
-}
-
-/* ==========================================================================
- * ftrylockfile()
- */
-int ftrylockfile(FILE *fp)
-{
- pthread_mutex_t *mutex;
- int fd, flags;
-
- if ((fd = fileno(fp)) >= 0) {
- pthread_mutex_lock(mutex = &(fd_table[fd]->mutex));
-
- if (fp->_flags & __SRW) {
- flags = FD_READ | FD_WRITE;
- } else {
- if (fp->_flags & __SWR) {
- flags = FD_WRITE;
- } else {
- flags = FD_READ;
- }
- }
- if (!(fd_table[fd]->r_owner && fd_table[fd]->w_owner)) {
- fd_basic_lock(fd, flags, mutex, NULL);
- fd = OK;
- } else {
- fd = NOTOK;
- }
- pthread_mutex_unlock(mutex);
- } else {
- fd = OK;
- }
- return(fd);
-}
-
-/* ==========================================================================
- * funlockfile()
- */
-void funlockfile(FILE *fp)
-{
- pthread_mutex_t *mutex;
- int fd, flags;
-
- if ((fd = fileno(fp)) >= 0) {
- pthread_mutex_lock(mutex = &(fd_table[fd]->mutex));
-
- if (fp->_flags & __SRW) {
- flags = FD_READ | FD_WRITE;
- } else {
- if (fp->_flags & __SWR) {
- flags = FD_WRITE;
- } else {
- flags = FD_READ;
- }
- }
- fd_basic_unlock(fd, flags);
- pthread_mutex_unlock(mutex);
- }
-}
-
diff --git a/mit-pthreads/pthreads/globals.c b/mit-pthreads/pthreads/globals.c
deleted file mode 100644
index 921588fb220..00000000000
--- a/mit-pthreads/pthreads/globals.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ==== globals.c ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Global variables.
- *
- * 1.00 93/07/26 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-
-/*
- * Initial thread, running thread, and top of link list of all threads.
- */
-struct pthread *pthread_run=NULL;
-struct pthread *pthread_initial=NULL;
-struct pthread *pthread_link_list=NULL;
-
-sigset_t * uthread_sigmask; /* Current process signal mask */
-
-/*
- * Dead thread queue, and threads elligible to be alloced queue.
- */
-struct pthread_queue pthread_dead_queue;
-struct pthread_queue pthread_alloc_queue;
-
-/*
- * Queue for all threads elidgeable to run this scheduling round.
- */
-struct pthread_prio_queue * pthread_current_prio_queue=NULL;
-
-/*
- * default thread attributes
- */
-pthread_attr_t pthread_attr_default = { SCHED_RR, PTHREAD_DEFAULT_PRIORITY,
- PTHREAD_CREATE_JOINABLE, NULL, NULL, NULL, PTHREAD_STACK_DEFAULT };
-
-/*
- * File table information
- */
-struct fd_table_entry **fd_table=NULL;
-
-/*
- * A we a fork()ed process
- */
-volatile int fork_lock = 0;
-volatile int pthread_kernel_lock=0;
-
-/*
- * The page size, as returned by getpagesize()
- */
-size_t pthread_pagesize=0;
-
diff --git a/mit-pthreads/pthreads/info.c b/mit-pthreads/pthreads/info.c
deleted file mode 100644
index 2b9722ba291..00000000000
--- a/mit-pthreads/pthreads/info.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* hello */
-
-#include <stdio.h>
-#include <pthread.h>
-#include <signal.h>
-
-static const char *const state_names[] = {
-#define __pthread_defstate(S,NAME) NAME,
-#include "pthread/state.def"
-#undef __pthread_defstate
- 0
-};
-
-void (*dump_thread_info_fn) (struct pthread *, FILE *);
-
-static void
-dump_thread_info (thread, file)
- struct pthread *thread;
- FILE *file;
-{
- /* machdep */
- /* attr */
- /* signals */
- /* wakeup_time */
- /* join */
- fprintf (file, " thread @%p prio %3d %s", thread,
- thread->pthread_priority, state_names[(int) thread->state]);
- switch (thread->state) {
- case PS_FDLR_WAIT:
- fprintf (file, " fd %d[%d]", thread->data.fd.fd,
- thread->data.fd.branch);
- fprintf (file, " owner %pr/%pw",
- fd_table[thread->data.fd.fd]->r_owner,
- fd_table[thread->data.fd.fd]->w_owner);
- break;
- }
- /* show where the signal handler gets run */
- if (thread == pthread_run)
- fprintf (file, "\t\t[ME!]");
- fprintf (file, "\n");
- if (dump_thread_info_fn)
- (*dump_thread_info_fn) (thread, file);
-}
-
-static void
-pthread_dump_info_to_file (file)
- FILE *file;
-{
- pthread_t t;
- for (t = pthread_link_list; t; t = t->pll)
- dump_thread_info (t, file);
-}
-
-void
-pthread_dump_info ()
-{
- if (ftrylockfile (stderr) != 0)
- return;
- fprintf (stderr, "process id %ld:\n", (long) getpid ());
- pthread_dump_info_to_file (stderr);
- funlockfile (stderr);
-}
-
-#ifdef SIGINFO
-static void
-sig_handler (sig)
- int sig;
-{
- pthread_dump_info ();
-}
-
-void
-pthread_setup_siginfo ()
-{
- (void) signal (SIGINFO, sig_handler);
-}
-#endif
diff --git a/mit-pthreads/pthreads/init.cc b/mit-pthreads/pthreads/init.cc
deleted file mode 100644
index 24a131a60a5..00000000000
--- a/mit-pthreads/pthreads/init.cc
+++ /dev/null
@@ -1,9 +0,0 @@
-
-/*
- * DO not delete this file. The hack here ensures that pthread_init() gets
- * called before main does. This doesn't fix everything. It is still
- * possible for a c++ module to reley on constructors that need pthreads.
- */
-#include <pthread.h>
-
-char __pthread_init_hack = 42;
diff --git a/mit-pthreads/pthreads/malloc.c b/mit-pthreads/pthreads/malloc.c
deleted file mode 100644
index 76fe03824ac..00000000000
--- a/mit-pthreads/pthreads/malloc.c
+++ /dev/null
@@ -1,383 +0,0 @@
-/* ==== malloc.c ============================================================
- * Copyright (c) 1983 Regents of the University of California.
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Malloc functions.
- * This is a very fast storage allocator. It allocates blocks of a small
- * number of different sizes, and keeps free lists of each size. Blocks that
- * don't exactly fit are passed up to the next larger size. In this
- * implementation, the available sizes are 2^n-4 (or 2^n-10) bytes long.
- * This is designed for use in a virtual memory environment.
- *
- * 0.00 82/02/21 Chris Kingsley kingsley@cit-20
- *
- * 1.00 93/11/06 proven
- * -Modified BSD libc malloc to be threadsafe.
- *
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <string.h>
-#include <pthread/posix.h>
-
-/*
- * The overhead on a block is at least 4 bytes. When free, this space
- * contains a pointer to the next free block, and the bottom two bits must
- * be zero. When in use, the first byte is set to MAGIC, and the second
- * byte is the size index. The remaining bytes are for alignment.
- * If range checking is enabled then a second word holds the size of the
- * requested block, less 1, rounded up to a multiple of sizeof(RMAGIC).
- * The order of elements is critical: ov_magic must overlay the low order
- * bits of ov_next, and ov_magic can not be a valid ov_next bit pattern.
- */
-#ifdef __alpha
-#define _MOST_RESTRICTIVE_ALIGNMENT_TYPE char*
-#else
-#define _MOST_RESTRICTIVE_ALIGNMENT_TYPE double
-#endif /* __alpha */
-union overhead {
- _MOST_RESTRICTIVE_ALIGNMENT_TYPE __alignment_pad0;
- union overhead *ov_next; /* when free */
- struct {
- u_char ovu_magic; /* magic number */
- u_char ovu_index; /* bucket # */
-#ifdef RCHECK
- u_short ovu_rmagic; /* range magic number */
- size_t ovu_size; /* actual block size */
-#endif
- } ovu;
-#define ov_magic ovu.ovu_magic
-#define ov_index ovu.ovu_index
-#define ov_rmagic ovu.ovu_rmagic
-#define ov_size ovu.ovu_size
-};
-
-#define MAGIC 0xef /* magic # on accounting info */
-#define RMAGIC 0x5555 /* magic # on range info */
-
-#ifdef RCHECK
-#define RSLOP sizeof (u_short)
-#else
-#define RSLOP 0
-#endif
-
-/*
- * nextf[i] is the pointer to the next free block of size 2^(i+3). The
- * smallest allocatable block is 8 bytes. The overhead information
- * precedes the data area returned to the user.
- */
-#define NBUCKETS 30
-static union overhead *nextf[NBUCKETS];
-#ifndef hpux
-extern char *sbrk();
-#endif
-
-static size_t pagesz; /* page size */
-static int pagebucket; /* page size bucket */
-static pthread_mutex_t malloc_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-#if defined(DEBUG) || defined(RCHECK)
-#define ASSERT(p) if (!(p)) botch("p")
-#include <stdio.h>
-static
-botch(s)
- char *s;
-{
- fprintf(stderr, "\r\nassertion botched: %s\r\n", s);
- (void) fflush(stderr); /* just in case user buffered it */
- abort();
-}
-#else
-#define ASSERT(p)
-#endif
-
-/* ==========================================================================
- * morecore()
- *
- * Allocate more memory to the indicated bucket
- */
-static inline void morecore(int bucket)
-{
- register union overhead *op;
- register size_t sz; /* size of desired block */
- size_t amt; /* amount to allocate */
- size_t nblks; /* how many blocks we get */
-
- /*
- * sbrk_size <= 0 only for big, FLUFFY, requests (about
- * 2^30 bytes on a VAX, I think) or for a negative arg.
- */
- sz = 1L << (bucket + 3);
-#ifdef DEBUG
- ASSERT(sz > 0);
-#else
- if (sz <= 0)
- return;
-#endif
- if (sz < pagesz) {
- amt = pagesz;
- nblks = amt / sz;
- } else {
- amt = sz + pagesz;
- nblks = 1;
- }
- op = (union overhead *)sbrk(amt);
- /* no more room! */
- if (op == (union overhead *) -1)
- return;
- /*
- * Add new memory allocated to that on
- * free list for this hash bucket.
- */
- nextf[bucket] = op;
- while (--nblks > 0) {
- op->ov_next = (union overhead *)((caddr_t)op + sz);
- op = (union overhead *)((caddr_t)op + sz);
- }
-}
-
-/* ==========================================================================
- * malloc()
- */
-void *malloc(size_t nbytes)
-{
- pthread_mutex_t *mutex;
- union overhead *op;
- size_t amt;
- size_t bucket, n;
-
- mutex = &malloc_mutex;
- pthread_mutex_lock(mutex);
- /*
- * First time malloc is called, setup page size and
- * align break pointer so all data will be page aligned.
- */
- if (pagesz == 0) {
- size_t x;
- pagesz = n = getpagesize();
- op = (union overhead *)sbrk(0);
- x = sizeof (*op) - ((long)op & (n - 1));
- if (n < x)
- n = n + pagesz - x;
- else
- n = n - x;
- if (n) {
- if (sbrk(n) == (char *)-1) {
- /* Unlock before returning (mevans) */
- pthread_mutex_unlock(mutex);
- return (NULL);
- }
- }
- bucket = 0;
- amt = 8;
- while (pagesz > amt) {
- amt <<= 1;
- bucket++;
- }
- pagebucket = bucket;
- }
- /*
- * Convert amount of memory requested into closest block size
- * stored in hash buckets which satisfies request.
- * Account for space used per block for accounting.
- */
- if (nbytes <= (n = pagesz - sizeof (*op) - RSLOP)) {
-#ifndef RCHECK
- amt = 8; /* size of first bucket */
- bucket = 0;
-#else
- amt = 16; /* size of first bucket */
- bucket = 1;
-#endif
- n = -(sizeof (*op) + RSLOP);
- } else {
- amt = pagesz;
- bucket = pagebucket;
- }
- while (nbytes > amt + n) {
- amt <<= 1;
- if (amt == 0) {
- pthread_mutex_unlock(mutex);
- return (NULL);
- }
- bucket++;
- }
- ASSERT (bucket < NBUCKETS);
- /*
- * If nothing in hash bucket right now,
- * request more memory from the system.
- */
- if ((op = nextf[bucket]) == NULL) {
- morecore(bucket);
- if ((op = nextf[bucket]) == NULL) {
- pthread_mutex_unlock(mutex);
- return (NULL);
- }
- }
- /* remove from linked list */
- nextf[bucket] = op->ov_next;
- op->ov_magic = MAGIC;
- op->ov_index = bucket;
-#ifdef RCHECK
- /*
- * Record allocated size of block and
- * bound space with magic numbers.
- */
- op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1);
- op->ov_rmagic = RMAGIC;
- *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC;
-#endif
- pthread_mutex_unlock(mutex);
- return ((char *)(op + 1));
-}
-
-/* ==========================================================================
- * free()
- */
-void free(void *cp)
-{
- pthread_mutex_t *mutex;
- union overhead *op;
- int size;
-
- mutex = &malloc_mutex;
- pthread_mutex_lock(mutex);
- if (cp == NULL) {
- pthread_mutex_unlock(mutex);
- return;
- }
- op = (union overhead *)((caddr_t)cp - sizeof (union overhead));
-#ifdef DEBUG
- ASSERT(op->ov_magic == MAGIC); /* make sure it was in use */
-#else
- if (op->ov_magic != MAGIC) {
- pthread_mutex_unlock(mutex);
- return; /* sanity */
- }
-#endif
-#ifdef RCHECK
- ASSERT(op->ov_rmagic == RMAGIC);
- ASSERT(*(u_short *)((caddr_t)(op + 1) + op->ov_size) == RMAGIC);
-#endif
- size = op->ov_index;
- ASSERT(size < NBUCKETS);
- op->ov_next = nextf[size]; /* also clobbers ov_magic */
- nextf[size] = op;
-
- pthread_mutex_unlock(mutex);
-}
-
-/* ==========================================================================
- * realloc()
- *
- * Storage compaction is no longer supported, fix program and try again.
- */
-void *realloc(void *cp, size_t nbytes)
-{
- pthread_mutex_t *mutex;
- size_t onb;
- size_t i;
- union overhead *op;
- char *res;
-
- if (cp == NULL)
- return (malloc(nbytes));
- op = (union overhead *)((caddr_t)cp - sizeof (union overhead));
-
- if (op->ov_magic == MAGIC) {
- i = op->ov_index;
- } else {
- /*
- * This will cause old programs using storage compaction feature of
- * realloc to break in a pseudo resonable way that is easy to debug.
- * Returning a malloced buffer without the copy may cause
- * indeterministic behavior.
- */
- return(NULL);
- }
-
- mutex = &malloc_mutex;
- pthread_mutex_lock(mutex);
- onb = 1L << (i + 3);
- if (onb < pagesz)
- onb -= sizeof (*op) + RSLOP;
- else
- onb += pagesz - sizeof (*op) - RSLOP;
-
- /* avoid the copy if same size block */
- if (i) {
- i = 1L << (i + 2);
- if (i < pagesz)
- i -= sizeof (*op) + RSLOP;
- else
- i += pagesz - sizeof (*op) - RSLOP;
- }
-
- if (nbytes <= onb && nbytes > i) {
-#ifdef RCHECK
- op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1);
- *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC;
-#endif
- pthread_mutex_unlock(mutex);
- return(cp);
- }
- pthread_mutex_unlock(mutex);
-
- if ((res = malloc(nbytes)) == NULL) {
- free(cp);
- return (NULL);
- }
-
- memcpy(res, cp, (nbytes < onb) ? nbytes : onb);
- free(cp);
-
- return (res);
-}
-
-/* ==========================================================================
- * calloc()
- *
- * Added to ensure pthread's allocation is used (mevans).
- */
-void *calloc(size_t nmemb, size_t size)
-{
- void *p;
- size *= nmemb;
- p = malloc(size);
- if (p) memset(p, 0, size);
- return (p);
-}
diff --git a/mit-pthreads/pthreads/mutex.c b/mit-pthreads/pthreads/mutex.c
deleted file mode 100644
index 1a2ca6fa1c1..00000000000
--- a/mit-pthreads/pthreads/mutex.c
+++ /dev/null
@@ -1,371 +0,0 @@
-/* ==== mutex.c ==============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Mutex functions.
- *
- * 1.00 93/07/19 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <stdlib.h>
-#include <errno.h>
-
-/* ==========================================================================
- * pthread_mutex_is_debug()
- *
- * Check that mutex is a debug mutex and if so returns entry number into
- * array of debug mutexes.
- */
-static int pthread_mutex_debug_count = 0;
-static pthread_mutex_t ** pthread_mutex_debug_ptrs = NULL;
-
-static inline int pthread_mutex_is_debug(pthread_mutex_t * mutex)
-{
- int i;
-
- for (i = 0; i < pthread_mutex_debug_count; i++) {
- if (pthread_mutex_debug_ptrs[i] == mutex) {
- return(i);
- }
- }
- return(NOTOK);
-}
-
-/* ==========================================================================
- * pthread_mutex_init()
- *
- * In this implementation I don't need to allocate memory.
- * ENOMEM, EAGAIN should never be returned. Arch that have
- * weird constraints may need special coding.
- */
-int pthread_mutex_init(pthread_mutex_t *mutex,
- const pthread_mutexattr_t *mutex_attr)
-{
- enum pthread_mutextype type;
-
- /* Only check if attr specifies some mutex type other than fast */
- if ((mutex_attr) && (mutex_attr->m_type != MUTEX_TYPE_FAST)) {
- if (mutex_attr->m_type >= MUTEX_TYPE_MAX) {
- return(EINVAL);
- }
- type = mutex_attr->m_type;
- } else {
- type = MUTEX_TYPE_FAST;
- }
- mutex->m_flags = 0;
-
- pthread_sched_prevent();
-
- switch(type) {
- case MUTEX_TYPE_FAST:
- break;
- case MUTEX_TYPE_STATIC_FAST:
- pthread_sched_resume();
- return(EINVAL);
- break;
- case MUTEX_TYPE_COUNTING_FAST:
- mutex->m_data.m_count = 0;
- break;
- case MUTEX_TYPE_DEBUG:
- if (pthread_mutex_is_debug(mutex) == NOTOK) {
- pthread_mutex_t ** new;
-
- if ((new = (pthread_mutex_t **)realloc(pthread_mutex_debug_ptrs,
- (pthread_mutex_debug_count + 1) * (sizeof(void *)))) == NULL) {
- pthread_sched_resume();
- return(ENOMEM);
- }
- pthread_mutex_debug_ptrs = new;
- pthread_mutex_debug_ptrs[pthread_mutex_debug_count++] = mutex;
- } else {
- pthread_sched_resume();
- return(EBUSY);
- }
- break;
- default:
- pthread_sched_resume();
- return(EINVAL);
- break;
- }
- /* Set all other paramaters */
- pthread_queue_init(&mutex->m_queue);
- mutex->m_flags |= MUTEX_FLAGS_INITED;
- mutex->m_owner = NULL;
- mutex->m_type = type;
-
- pthread_sched_resume();
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_mutex_destroy()
- */
-int pthread_mutex_destroy(pthread_mutex_t *mutex)
-{
- int i;
-
- pthread_sched_prevent();
-
- /* Only check if mutex is of type other than fast */
- switch(mutex->m_type) {
- case MUTEX_TYPE_FAST:
- break;
- case MUTEX_TYPE_STATIC_FAST:
- pthread_sched_resume();
- return(EINVAL);
- break;
- case MUTEX_TYPE_COUNTING_FAST:
- mutex->m_data.m_count = 0;
- break;
- case MUTEX_TYPE_DEBUG:
- if ((i = pthread_mutex_is_debug(mutex)) == NOTOK) {
- pthread_sched_resume();
- return(EINVAL);
- }
- if (mutex->m_owner) {
- pthread_sched_resume();
- return(EBUSY);
- }
-
- /* Remove the mutex from the list of debug mutexes */
- pthread_mutex_debug_ptrs[i] =
- pthread_mutex_debug_ptrs[--pthread_mutex_debug_count];
- pthread_mutex_debug_ptrs[pthread_mutex_debug_count] = NULL;
- break;
- default:
- pthread_sched_resume();
- return(EINVAL);
- break;
- }
-
- /* Cleanup mutex, others might want to use it. */
- pthread_queue_init(&mutex->m_queue);
- mutex->m_owner = NULL;
- mutex->m_flags = 0;
-
- pthread_sched_resume();
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_mutex_trylock()
- */
-int pthread_mutex_trylock(pthread_mutex_t *mutex)
-{
- int rval;
-
- pthread_sched_prevent();
- switch (mutex->m_type) {
- /*
- * Fast mutexes do not check for any error conditions.
- */
- case MUTEX_TYPE_FAST:
- case MUTEX_TYPE_STATIC_FAST:
- if (!mutex->m_owner) {
- mutex->m_owner = pthread_run;
- rval = OK;
- } else {
- rval = EBUSY;
- }
- break;
- case MUTEX_TYPE_COUNTING_FAST:
- if (mutex->m_owner) {
- if (mutex->m_owner == pthread_run) {
- mutex->m_data.m_count++;
- rval = OK;
- } else {
- rval = EBUSY;
- }
- } else {
- mutex->m_owner = pthread_run;
- rval = OK;
- }
- break;
- case MUTEX_TYPE_DEBUG:
- if (pthread_mutex_is_debug(mutex) != NOTOK) {
- if (!mutex->m_owner) {
- mutex->m_owner = pthread_run;
- rval = OK;
- } else {
- rval = EBUSY;
- }
- } else {
- rval = EINVAL;
- }
- break;
- default:
- rval = EINVAL;
- break;
- }
-
- pthread_sched_resume();
- return(rval);
-}
-
-/* ==========================================================================
- * pthread_mutex_lock()
- */
-int pthread_mutex_lock(pthread_mutex_t *mutex)
-{
- int rval;
-
- pthread_sched_prevent();
- switch (mutex->m_type) {
- /*
- * Fast mutexes do not check for any error conditions.
- */
- case MUTEX_TYPE_FAST:
- case MUTEX_TYPE_STATIC_FAST:
- if (mutex->m_owner) {
- pthread_queue_enq(&mutex->m_queue, pthread_run);
-
- /* Reschedule will unlock scheduler */
- pthread_resched_resume(PS_MUTEX_WAIT);
- return(OK);
- }
- mutex->m_owner = pthread_run;
- rval = OK;
- break;
- case MUTEX_TYPE_COUNTING_FAST:
- if (mutex->m_owner) {
- if (mutex->m_owner != pthread_run) {
- pthread_queue_enq(&mutex->m_queue, pthread_run);
-
- /* Reschedule will unlock scheduler */
- pthread_resched_resume(PS_MUTEX_WAIT);
- return(OK);
- } else {
- mutex->m_data.m_count++;
- }
- } else {
- mutex->m_owner = pthread_run;
- }
- rval = OK;
- break;
- case MUTEX_TYPE_DEBUG:
- if (pthread_mutex_is_debug(mutex) != NOTOK) {
- if (mutex->m_owner) {
- if (mutex->m_owner != pthread_run) {
- pthread_queue_enq(&mutex->m_queue, pthread_run);
-
- /* Reschedule will unlock pthread_run */
- pthread_resched_resume(PS_MUTEX_WAIT);
-
- if (mutex->m_owner != pthread_run) {
- PANIC();
- }
- return(OK);
- }
- rval = EDEADLK;
- break;
- }
- mutex->m_owner = pthread_run;
- rval = OK;
- break;
- }
- rval = EINVAL;
- break;
- default:
- rval = EINVAL;
- break;
- }
-
- pthread_sched_resume();
- return(rval);
-}
-
-/* ==========================================================================
- * pthread_mutex_unlock()
- */
-int pthread_mutex_unlock(pthread_mutex_t *mutex)
-{
- struct pthread *pthread;
- int rval;
-
- pthread_sched_prevent();
-
- switch (mutex->m_type) {
- /*
- * Fast mutexes do not check for any error conditions.
- */
- case MUTEX_TYPE_FAST:
- case MUTEX_TYPE_STATIC_FAST:
- if (mutex->m_owner = pthread_queue_deq(&mutex->m_queue)) {
-
- /* Reschedule will unlock scheduler */
- pthread_sched_other_resume(mutex->m_owner);
- return(OK);
- }
- rval = OK;
- break;
- case MUTEX_TYPE_COUNTING_FAST:
- if (mutex->m_data.m_count) {
- mutex->m_data.m_count--;
- rval = OK;
- break;
- }
- if (mutex->m_owner = pthread_queue_deq(&mutex->m_queue)) {
-
- /* Reschedule will unlock scheduler */
- pthread_sched_other_resume(mutex->m_owner);
- return(OK);
- }
- rval = OK;
- break;
- case MUTEX_TYPE_DEBUG:
- if (pthread_mutex_is_debug(mutex) != NOTOK) {
- if (mutex->m_owner == pthread_run) {
- if (mutex->m_owner = pthread_queue_deq(&mutex->m_queue)) {
-
- /* Reschedule will unlock scheduler */
- pthread_sched_other_resume(mutex->m_owner);
- return(OK);
- }
- rval = OK;
- } else {
- rval = EPERM;
- }
- } else {
- rval = EINVAL;
- }
- break;
- default:
- rval = EINVAL;
- break;
- }
- pthread_sched_resume();
- return(rval);
-}
diff --git a/mit-pthreads/pthreads/mutexattr.c b/mit-pthreads/pthreads/mutexattr.c
deleted file mode 100644
index d045b5041a0..00000000000
--- a/mit-pthreads/pthreads/mutexattr.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* ==== mutexattr.c ===========================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Mutex functions.
- *
- * 1.00 93/07/19 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <errno.h>
-
-/* ==========================================================================
- * pthread_mutexattr_init()
- */
-int pthread_mutexattr_init(pthread_mutexattr_t *attr)
-{
- attr->m_type = MUTEX_TYPE_FAST;
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_mutexattr_destroy()
- */
-int pthread_mutexattr_destroy(pthread_mutexattr_t *attr)
-{
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_mutexattr_settype()
- */
-int pthread_mutexattr_settype(pthread_mutexattr_t *attr, unsigned int type)
-{
- switch(type) {
- case PTHREAD_MUTEXTYPE_FAST:
- attr->m_type = MUTEX_TYPE_FAST;
- break;
- case PTHREAD_MUTEXTYPE_RECURSIVE:
- attr->m_type = MUTEX_TYPE_COUNTING_FAST;
- break;
- case PTHREAD_MUTEXTYPE_DEBUG:
- attr->m_type = MUTEX_TYPE_DEBUG;
- break;
- default:
- return(EINVAL);
- }
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_mutexattr_gettype()
- */
-int pthread_mutexattr_gettype(pthread_mutexattr_t *attr, unsigned int * type)
-{
- *type = (unsigned int)attr->m_type;
- return(OK);
-}
diff --git a/mit-pthreads/pthreads/panic.c b/mit-pthreads/pthreads/panic.c
deleted file mode 100644
index 6b963acd651..00000000000
--- a/mit-pthreads/pthreads/panic.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* ==== panic.c =======================================================
- * Copyright (c) 1996 by Larry V. Streepy, Jr.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Larry V. Streepy, Jr.
- * 4. The name of Larry V. Streepy, Jr. may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Larry V. Streepy, Jr. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL Larry V. Streepy, Jr. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : pthread kernel panic
- *
- * 02 Oct 1996 - Larry V. Streepy, Jr.
- * - Initial coding
- */
-
-#include <pthread.h>
-#include <stdio.h>
-/*----------------------------------------------------------------------
- * Function: panic_kernel
- * Purpose: print a message and panic the pthreads kernel
- * Args: file name, line number, and function
- * Returns: doesn't
- * Notes:
- *----------------------------------------------------------------------*/ void
-panic_kernel( const char *file, unsigned int line, const char *func )
-{
-#ifdef __GNUC__
- (void) fprintf( stderr, "%s:%u: %s%sPhtreads kernel panic.\n",
- file, line, func ? func : "", func ? ": " : "" );
- (void) fflush (stderr);
-#else
- (void) fprintf( stderr, "%s:%u: Phtreads kernel panic.\n", file, line );
- (void) fflush (stderr);
-#endif
- abort();
-}
diff --git a/mit-pthreads/pthreads/prio_queue.c b/mit-pthreads/pthreads/prio_queue.c
deleted file mode 100644
index d976f9cd68f..00000000000
--- a/mit-pthreads/pthreads/prio_queue.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/* ==== prio_queue.c ==========================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Priority Queue functions.
- *
- * 1.00 94/09/19 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-
-/* A thread when it becomes eligeble to run is placed on the run queue.
- This requires locking the kernel lock
-*/
-
-/* ==========================================================================
- * pthread_prio_queue_init()
- */
-void pthread_prio_queue_init(struct pthread_prio_queue * queue)
-{
- int i;
-
- for (i = 0; i <= PTHREAD_MAX_PRIORITY; i++) {
- queue->level[i].first = NULL;
- queue->level[i].last = NULL;
- }
- queue->next = NULL;
- queue->data = NULL;
-}
-
-/* ==========================================================================
- * pthread_priority_enq()
- */
-void pthread_prio_queue_enq(struct pthread_prio_queue * queue,
- struct pthread * pthread)
-{
- int priority = pthread->pthread_priority;
-
- if (queue->next) {
- if (queue->level[priority].first) {
- pthread->next = (queue->level[priority].last)->next;
- (queue->level[priority].last)->next = pthread;
- queue->level[priority].last = pthread;
- return;
- }
- if (priority != PTHREAD_MAX_PRIORITY) {
- int prev_priority;
- /* Find first higher priority thread queued on queue */
- for (prev_priority = priority + 1; prev_priority <=
- PTHREAD_MAX_PRIORITY; prev_priority++) {
- if (queue->level[prev_priority].first) {
- pthread->next = (queue->level[prev_priority].last)->next;
- (queue->level[prev_priority].last)->next = pthread;
- queue->level[priority].first = pthread;
- queue->level[priority].last = pthread;
- return;
- }
- }
- }
- }
- queue->level[priority].first = pthread;
- queue->level[priority].last = pthread;
- pthread->next = queue->next;
- queue->next = pthread;
-}
-
-/* ==========================================================================
- * pthread_prio_queue_deq()
- */
-struct pthread * pthread_prio_queue_deq(struct pthread_prio_queue * queue)
-{
- struct pthread * pthread;
- int priority;
-
- if (pthread = queue->next) {
- priority = queue->next->pthread_priority;
- if (queue->level[priority].first == queue->level[priority].last) {
- queue->level[priority].first = NULL;
- queue->level[priority].last = NULL;
- } else {
- queue->level[priority].first = pthread->next;
- }
- queue->next = pthread->next;
- pthread->next = NULL;
- }
- return(pthread);
-}
-
-/* ==========================================================================
- * pthread_prio_queue_remove()
- */
-int pthread_prio_queue_remove(struct pthread_prio_queue *queue,
- struct pthread *thread)
-{
- /* XXX This is slow, should start with thread priority */
- int priority = thread->pthread_priority;
- struct pthread **current = &(queue->level[priority].first);
- struct pthread *prev = NULL;
-
- if (thread==*current) {
- int current_priority=priority+1;
-
- if (*current == queue->next){
- pthread_prio_queue_deq(queue);
- thread->next = NULL;
- return(OK);
- }
- for (current_priority; current_priority <= PTHREAD_MAX_PRIORITY;
- current_priority++) {
- if (queue->level[current_priority].last) {
- queue->level[current_priority].last->next = (*current)->next;
- if ((*current)->next &&
- (*current)->next->pthread_priority == priority)
- queue->level[priority].first = (*current)->next;
- else {
- queue->level[priority].first = NULL;
- queue->level[priority].last = NULL;
- }
- thread->next = NULL;
- return(OK);
- }
- }
- }
-
- if (*current == NULL) /* Mati Sauks */
- {
- return (NOTOK);
- }
- for (prev=*current,current=&((*current)->next);
- *current && ((*current)->pthread_priority == priority);
- prev=*current,current=&((*current)->next)) {
- if (*current == thread) {
- if (*current == queue->level[priority].last) {
- queue->level[priority].last = prev;
- }
-
- *current = (*current)->next;
- thread->next=NULL;
- return(OK);
- }
- }
- return(NOTOK);
-}
-
diff --git a/mit-pthreads/pthreads/process.c b/mit-pthreads/pthreads/process.c
deleted file mode 100644
index 9b3abb3384b..00000000000
--- a/mit-pthreads/pthreads/process.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/* ==== process.c ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Process functions (fork, exec, ...).
- *
- * 1.23 94/04/18 proven
- * -Started coding this file.
- */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <pthread.h>
-#include <stdarg.h>
-#include <unistd.h>
-#ifdef HAVE_ALLOC_H
-#include <alloc.h>
-#endif
-
-extern void *alloca();
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-/* ==========================================================================
- * fork()
- *
- * This function requires a sig_prevent()/sig_check_and_resume() for the
- * parent. The child never unlocks.
- */
-pid_t fork()
-{
- pid_t ret;
-
- pthread_sched_prevent();
-
- fd_kern_fork();
- if (ret = machdep_sys_fork()) { /* Parent or error */
- pthread_sched_resume();
- } else { /* Child */
- machdep_unset_thread_timer(NULL);
- machdep_stop_timer(NULL);
- fork_lock++;
- pthread_kernel_lock--;
- }
- return(ret);
-}
-
-#ifdef HAVE_VFORK
-/* The semantics of vfork probably won't mix well with the pthread
- library code. Don't even try. */
-pid_t vfork ()
-{
- return fork ();
-}
-#endif
-
-/* ==========================================================================
- * execve()
- *
- * This function requires a sig_prevent()/sig_check_and_resume() if one
- * hasn't been done in the fork routine. Normally machdep_sys_execve()
- * should never return.
- */
-int execve(const char *name, char * const *argv, char * const *envp)
-{
- int ret;
-
- if (!fork_lock) {
- pthread_sched_prevent();
- fd_kern_exec(0);
- ret = machdep_sys_execve(name, argv, envp);
- pthread_sched_resume();
- } else {
- fd_kern_exec(1);
- ret = machdep_sys_execve(name, argv, envp);
- }
- return(ret);
-}
-
-/* Variants of execve. Define them here so that the system versions
- don't get used and drag in the system version of execve. */
-#include <sys/stat.h>
-#include <string.h>
-#include <sys/param.h>
-extern char **environ;
-
-static const char *find (const char *name, char *buf)
-{
- char *p1, *p2;
- extern char *getenv ();
- struct stat sb;
-
- if (strchr (name, '/'))
- return name;
- p1 = getenv ("PATH");
- if (p1 == 0)
- p1 = "/bin:/usr/bin:";
- while (*p1) {
- memset (buf, 0, MAXPATHLEN);
- p2 = strchr (p1, ':');
- if (p2 == 0)
- p2 = p1 + strlen (p1);
- strncpy (buf, p1, p2 - p1);
- buf[p2 - p1] = 0;
- strcat (buf, "/");
- strcat (buf, name);
- if (lstat (buf, &sb) == 0)
- return buf;
-
- if (*p2 == ':')
- p2++;
- p1 = p2;
- }
- return name;
-}
-
-int execl (const char *path, const char *arg, ...)
-{
-#ifdef SCO_3_5
- return execve (path, (char *const *) &arg, environ);
-#else
- char ** argv;
- va_list ap;
- int i;
-
- va_start(ap, arg);
- for (i = 1; va_arg(ap, char *) != NULL; i++);
- va_end(ap);
-
- argv = alloca (i * sizeof (char *));
-
- va_start(ap, arg);
- argv[0] = (char *) arg;
- for (i = 1; (argv[i] = (char *) va_arg(ap, char *)) != NULL; i++);
- va_end(ap);
-
- return execve (path, argv, environ);
-#endif
-}
-
-int execlp (const char *name, const char *arg, ...)
-{
-#ifdef SCO_3_5
- char buf[MAXPATHLEN];
- return execve (find (name, buf), (char *const *) &arg, environ);
-#else
- char buf[MAXPATHLEN];
- char ** argv;
- va_list ap;
- int i;
-
- va_start(ap, arg);
- for (i = 1; va_arg(ap, char *) != NULL; i++);
- va_end(ap);
-
- argv = alloca (i * sizeof (char *));
-
- va_start(ap, arg);
- argv[0] = (char *) arg;
- for (i = 1; (argv[i] = (char *) va_arg(ap, char *)) != NULL; i++);
- va_end(ap);
-
- return execve (find (name, buf), argv, environ);
-#endif
-}
-
-int execle (const char *name, const char *arg, ... /* , char *const envp[] */);
-
-/* This one turns on ptrace-style tracing? */
-int exect (const char *path, char *const argv[], char *const envp[]);
-
-int execv (const char *path, char *const argv[]) {
- return execve (path, argv, environ);
-}
-
-int execvp (const char *name, char *const argv[]) {
- char buf[MAXPATHLEN];
- return execve (find (name, buf), argv, environ);
-}
diff --git a/mit-pthreads/pthreads/pthread.c b/mit-pthreads/pthreads/pthread.c
deleted file mode 100644
index 6f7e2d53980..00000000000
--- a/mit-pthreads/pthreads/pthread.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/* ==== pthread.c ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Pthread functions.
- *
- * 1.00 93/07/26 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <errno.h>
-#include <string.h>
-#include <sched.h>
-
-/* ==========================================================================
- * sched_yield()
- */
-int sched_yield()
-{
- sig_handler_fake(SIGVTALRM);
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_yield()
- */
-void pthread_yield()
-{
- sig_handler_fake(SIGVTALRM);
-}
-
-/* ==========================================================================
- * pthread_self()
- */
-pthread_t pthread_self()
-{
- return(pthread_run);
-}
-
-/* ==========================================================================
- * pthread_equal()
- */
-int pthread_equal(pthread_t t1, pthread_t t2)
-{
- return(t1 == t2);
-}
-
-/* ==========================================================================
- * pthread_exit()
- */
-extern void pthread_cleanupspecific(void);
-
-void pthread_exit(void *status)
-{
- pthread_t pthread;
-
- /* Save return value */
- pthread_run->ret = status;
-
- /* First execute all cleanup handlers */
- while (pthread_run->cleanup) {
- pthread_cleanup_pop(1);
- }
-
- /* Don't forget the cleanup attr */
- if (pthread_run->attr.cleanup_attr) {
- pthread_run->attr.cleanup_attr(pthread_run->attr.arg_attr);
- }
-
- /* Next run thread-specific data desctructors */
- if (pthread_run->specific_data) {
- pthread_cleanupspecific();
- }
-
- pthread_sched_prevent();
-
- if (!(pthread_run->attr.flags & PTHREAD_DETACHED)) {
- /*
- * Are there any threads joined to this one,
- * if so wake them and let them detach this thread.
- */
- while (pthread = pthread_queue_deq(&(pthread_run->join_queue))) {
- pthread_prio_queue_enq(pthread_current_prio_queue, pthread);
- pthread->state = PS_RUNNING;
- }
- pthread_queue_enq(&pthread_dead_queue, pthread_run);
- pthread_resched_resume(PS_DEAD);
- } else {
- pthread_queue_enq(&pthread_alloc_queue, pthread_run);
- pthread_resched_resume(PS_UNALLOCED);
- }
-
- /* This thread will never run again */
- PANIC();
-
-}
-
-/*----------------------------------------------------------------------
- * Function: __pthread_is_valid
- * Purpose: Scan the list of threads to see if a specified thread exists
- * Args:
- * pthread = The thread to scan for
- * Returns:
- * int = 1 if found, 0 if not
- * Notes:
- * The kernel is assumed to be locked
- *----------------------------------------------------------------------*/
-int
-__pthread_is_valid( pthread_t pthread )
-{
- int rtn = 0; /* Assume not found */
- pthread_t t;
-
- for( t = pthread_link_list; t; t = t->pll ) {
- if( t == pthread ) {
- rtn = 1; /* Found it */
- break;
- }
- }
-
- return rtn;
-}
-
-/* ==========================================================================
- * __pthread_free()
- */
-static inline void __pthread_free(pthread_t new_thread)
-{
- pthread_sched_prevent();
- new_thread->state = PS_UNALLOCED;
- new_thread->attr.stacksize_attr = 0;
- new_thread->attr.stackaddr_attr = NULL;
- pthread_queue_enq(&pthread_alloc_queue, new_thread);
- pthread_sched_resume();
-}
-/* ==========================================================================
- * __pthread_alloc()
- */
-/* static inline pthread_t __pthread_alloc(const pthread_attr_t *attr) */
-static pthread_t __pthread_alloc(const pthread_attr_t *attr)
-{
- pthread_t thread;
- void * stack;
- void * old;
-
- pthread_sched_prevent();
- thread = pthread_queue_deq(&pthread_alloc_queue);
- pthread_sched_resume();
-
- if (thread) {
- if (stack = attr->stackaddr_attr) {
- __machdep_stack_repl(&(thread->machdep_data), stack);
- } else {
- if ((__machdep_stack_get(&(thread->machdep_data)) == NULL)
- || (attr->stacksize_attr > thread->attr.stacksize_attr)) {
- if (stack = __machdep_stack_alloc(attr->stacksize_attr)) {
- __machdep_stack_repl(&(thread->machdep_data), stack);
- } else {
- __pthread_free(thread);
- thread = NULL;
- }
- }
- }
- } else {
- /* We should probable allocate several for efficiency */
- if (thread = (pthread_t)malloc(sizeof(struct pthread))) {
- /* Link new thread into list of all threads */
-
- pthread_sched_prevent();
- thread->state = PS_UNALLOCED;
- thread->pll = pthread_link_list;
- pthread_link_list = thread;
- pthread_sched_resume();
-
- if ((stack = attr->stackaddr_attr) ||
- (stack = __machdep_stack_alloc(attr->stacksize_attr))) {
- __machdep_stack_set(&(thread->machdep_data), stack);
- } else {
- __machdep_stack_set(&(thread->machdep_data), NULL);
- __pthread_free(thread);
- thread = NULL;
- }
- }
- }
- return(thread);
-}
-
-/* ==========================================================================
- * pthread_create()
- *
- * After the new thread structure is allocated and set up, it is added to
- * pthread_run_next_queue, which requires a sig_prevent(),
- * sig_check_and_resume()
- */
-int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
- void * (*start_routine)(void *), void *arg)
-{
- pthread_t new_thread;
- int nsec = 100000000;
- int retval = OK;
-
- if (! attr)
- attr = &pthread_attr_default;
-
- if (new_thread = __pthread_alloc(attr)) {
-
- __machdep_pthread_create(&(new_thread->machdep_data),
- start_routine, arg, attr->stacksize_attr, nsec, 0);
-
- memcpy(&new_thread->attr, attr, sizeof(pthread_attr_t));
- if (new_thread->attr.flags & PTHREAD_INHERIT_SCHED) {
- new_thread->pthread_priority = pthread_run->pthread_priority;
- new_thread->attr.sched_priority = pthread_run->pthread_priority;
- new_thread->attr.schedparam_policy =
- pthread_run->attr.schedparam_policy;
- } else {
- new_thread->pthread_priority = new_thread->attr.sched_priority;
- }
-
- if (!(new_thread->attr.flags & PTHREAD_NOFLOAT)) {
- machdep_save_float_state(new_thread);
- }
-
- /* Initialize signalmask */
- new_thread->sigmask = pthread_run->sigmask;
- sigemptyset(&(new_thread->sigpending));
- new_thread->sigcount = 0;
-
- pthread_queue_init(&(new_thread->join_queue));
- new_thread->specific_data = NULL;
- new_thread->specific_data_count = 0;
- new_thread->cleanup = NULL;
- new_thread->queue = NULL;
- new_thread->next = NULL;
- new_thread->flags = 0;
-
- /* PTHREADS spec says we start with cancellability on and deferred */
- SET_PF_CANCEL_STATE(new_thread, PTHREAD_CANCEL_ENABLE);
- SET_PF_CANCEL_TYPE(new_thread, PTHREAD_CANCEL_DEFERRED);
-
- new_thread->error_p = NULL;
- new_thread->sll = NULL;
-
- pthread_sched_prevent();
-
-
- pthread_sched_other_resume(new_thread);
- /*
- * Assignment must be outside of the locked pthread kernel incase
- * thread is a bogus address resulting in a seg-fault. We want the
- * original thread to be capable of handling the resulting signal.
- * --proven
- */
- (*thread) = new_thread;
- } else {
- retval = EAGAIN;
- }
- return(retval);
-}
diff --git a/mit-pthreads/pthreads/pthread_attr.c b/mit-pthreads/pthreads/pthread_attr.c
deleted file mode 100644
index 5e1c0302227..00000000000
--- a/mit-pthreads/pthreads/pthread_attr.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/* ==== pthread_attr.c =======================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Pthread attribute functions.
- *
- * 1.00 93/11/04 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <errno.h>
-#include <string.h>
-
-/* Currently we do no locking, should we just to be safe? CAP */
-/* ==========================================================================
- * pthread_attr_init()
- */
-int pthread_attr_init(pthread_attr_t *attr)
-{
- memcpy(attr, &pthread_attr_default, sizeof(pthread_attr_t));
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_attr_destroy()
- */
-int pthread_attr_destroy(pthread_attr_t *attr)
-{
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_attr_getstacksize()
- */
-int pthread_attr_getstacksize(pthread_attr_t *attr, size_t * stacksize)
-{
- *stacksize = attr->stacksize_attr;
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_attr_setstacksize()
- */
-int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize)
-{
- if (stacksize >= PTHREAD_STACK_MIN) {
- attr->stacksize_attr = stacksize;
- return(OK);
- }
- return(EINVAL);
-}
-
-/* ==========================================================================
- * pthread_attr_getstackaddr()
- */
-int pthread_attr_getstackaddr(pthread_attr_t *attr, void ** stackaddr)
-{
- *stackaddr = attr->stackaddr_attr;
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_attr_setstackaddr()
- */
-int pthread_attr_setstackaddr(pthread_attr_t *attr, void * stackaddr)
-{
- attr->stackaddr_attr = stackaddr;
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_attr_setcleanup()
- */
-int pthread_attr_setcleanup(pthread_attr_t *attr, void (*routine)(void *),
- void * arg)
-{
- attr->cleanup_attr = routine;
- attr->arg_attr = arg;
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_attr_getdetachstate()
- */
-int pthread_attr_getdetachstate(pthread_attr_t *attr, int * detachstate)
-{
- *detachstate = attr->flags & PTHREAD_DETACHED;
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_attr_setdetachstate()
- */
-int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate)
-{
- attr->flags = (attr->flags & ~(PTHREAD_DETACHED)) |
- (detachstate & PTHREAD_DETACHED);
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_attr_getfloatstate()
- */
-int pthread_attr_getfloatstate(pthread_attr_t *attr, int * floatstate)
-{
- *floatstate = attr->flags & PTHREAD_NOFLOAT;
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_attr_setfloatstate()
- */
-int pthread_attr_setfloatstate(pthread_attr_t *attr, int floatstate)
-{
- attr->flags = (attr->flags & ~(PTHREAD_NOFLOAT)) |
- (floatstate & PTHREAD_NOFLOAT);
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_attr_getscope()
- */
-int pthread_attr_getscope(pthread_attr_t *attr, int * contentionscope)
-{
- *contentionscope = attr->flags & PTHREAD_SCOPE_SYSTEM;
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_attr_setscope()
- */
-int pthread_attr_setscope(pthread_attr_t *attr, int contentionscope)
-{
- int ret;
-
- switch (contentionscope) {
- case PTHREAD_SCOPE_PROCESS:
- attr->flags = (attr->flags & ~(PTHREAD_SCOPE_PROCESS))
- | PTHREAD_SCOPE_PROCESS;
- ret = OK;
- break;
- case PTHREAD_SCOPE_SYSTEM:
- ret = ENOSYS;
- break;
- default:
- ret = EINVAL;
- break;
- }
-
- return(ret);
-}
-
-/* ==========================================================================
- * pthread_attr_getinheritsched()
- */
-int pthread_attr_getinheritsched(pthread_attr_t *attr, int * inheritsched)
-{
- *inheritsched = attr->flags & PTHREAD_INHERIT_SCHED;
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_attr_setinheritsched()
- */
-int pthread_attr_setinheritsched(pthread_attr_t *attr, int inheritsched)
-{
- attr->flags = (attr->flags & ~(PTHREAD_INHERIT_SCHED)) |
- (inheritsched & PTHREAD_INHERIT_SCHED);
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_attr_getschedpolicy()
- */
-int pthread_attr_getschedpolicy(pthread_attr_t *attr, int * schedpolicy)
-{
- *schedpolicy = (int)attr->schedparam_policy;
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_attr_setschedpolicy()
- */
-int pthread_attr_setschedpolicy(pthread_attr_t *attr, int schedpolicy)
-{
- int ret;
-
- switch(schedpolicy) {
- case SCHED_FIFO:
- case SCHED_IO:
- case SCHED_RR:
- attr->schedparam_policy = schedpolicy;
- ret = OK;
- break;
- default:
- ret = EINVAL;
- break;
- }
- return(ret);
-}
-
-/* ==========================================================================
- * pthread_attr_getschedparam()
- */
-int pthread_attr_getschedparam(pthread_attr_t *attr, struct sched_param * param)
-{
- param->sched_priority = attr->sched_priority;
- return(OK);
-}
-
-/* ==========================================================================
- * pthread_attr_setschedparam()
- */
-int pthread_attr_setschedparam(pthread_attr_t *attr, struct sched_param * param)
-{
- if ((param->sched_priority >= PTHREAD_MIN_PRIORITY) &&
- (param->sched_priority <= PTHREAD_MAX_PRIORITY)) {
- attr->sched_priority = param->sched_priority;
- return(OK);
- }
- return(EINVAL);
-}
-
diff --git a/mit-pthreads/pthreads/pthread_cancel.c b/mit-pthreads/pthreads/pthread_cancel.c
deleted file mode 100644
index 4191a269027..00000000000
--- a/mit-pthreads/pthreads/pthread_cancel.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/* ==== pthread_cancel.c ====================================================
- * Copyright (c) 1996 by Larry V. Streepy, Jr.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Larry V. Streepy, Jr.
- * 4. The name of Larry V. Streepy, Jr. may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Larry V. Streepy, Jr. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL Larry V. Streepy, Jr. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : pthread_cancel operations
- *
- * 27 Sep 1996 - Larry V. Streepy, Jr.
- * - Initial coding
- */
-#ifndef lint
-static const char rcsid[] = "$Id:";
-#endif
-#include <pthread.h>
-#include <errno.h>
-static void possiblyMakeRunnable( pthread_t pthread );
-
-/*----------------------------------------------------------------------
- * Function: pthread_cancel
- * Purpose: Allows a thread to request that it or another thread
- * terminate execution
- * Args:
- * thread = thread to mark as cancelled
- * Returns:
- * int 0 = ok, -1 = some error (see errno)
- * Notes:
- * The thread is simply marked as CANCELLED, it is up to the cancelled
- * thread to decide how to handle it.
- *----------------------------------------------------------------------*/ int
-pthread_cancel( pthread_t pthread )
-{
- int rtn = 0; /* Assume all ok */
- pthread_sched_prevent();
- /* Ensure they gave us a legal pthread pointer */
- if( ! __pthread_is_valid( pthread ) ) {
- rtn = ESRCH; /* No such thread */
- } else if( pthread->state == PS_UNALLOCED || pthread->state == PS_DEAD ) {
- /* The standard doesn't call these out as errors, so return 0 */
- rtn = 0;
- } else {
- SET_PF_CANCELLED(pthread); /* Set the flag */
- /* If the thread is in the right state, then stick it on the
- * run queue so it will get a chance to process the cancel.
- */
- if( pthread != pthread_run ) {
- possiblyMakeRunnable( pthread );
- }
- }
- pthread_sched_resume();
- if( rtn == 0 )
- pthread_testcancel(); /* See if we cancelled ourself */
- return rtn;
-}
-
-/*----------------------------------------------------------------------
- * Function: pthread_setcancelstate
- * Purpose: Set the current thread's cancellability state
- * Args:
- * state = PTHREAD_CANCEL_DISABLE or PTHREAD_CANCEL_ENABLE
- * oldstate= pointer to holder for old state or NULL (*MODIFIED*)
- * Returns:
- * int 0 = ok
- * EINVAL = state is neither of the legal states
- * Notes:
- * This has to be async-cancel safe, so we prevent scheduling in
- * here
- *----------------------------------------------------------------------*/
-
-int
-pthread_setcancelstate( int newstate, int *oldstate )
-{
- int ostate = TEST_PF_CANCEL_STATE(pthread_run);
- int rtn = 0;
- pthread_sched_prevent();
- if( newstate == PTHREAD_CANCEL_ENABLE ||
- newstate == PTHREAD_CANCEL_DISABLE ) {
- SET_PF_CANCEL_STATE(pthread_run, newstate);
- if( oldstate != NULL )
- *oldstate = ostate;
- } else { /* Invalid new state */
- rtn = EINVAL;
- }
- pthread_sched_resume();
- if( rtn == 0 ) {
- /* Test to see if we have a pending cancel to handle */
- pthread_testcancel();
- }
- return rtn;
-}
-
-/*----------------------------------------------------------------------
- * Function: pthread_setcanceltype
- * Purpose: Set the current thread's cancellability type
- * Args:
- * type = PTHREAD_CANCEL_DEFERRED or PTHREAD_CANCEL_ASYNCHRONOUS
- * oldtype = pointer to holder for old type or NULL (*MODIFIED*)
- * Returns:
- * int 0 = ok
- * EINVAL = type is neither of the legal states
- * Notes:
- * This has to be async-cancel safe, so we prevent scheduling in
- * here
- *----------------------------------------------------------------------*/
-
-int
-pthread_setcanceltype( int newtype, int *oldtype )
-{
- int otype = TEST_PF_CANCEL_TYPE(pthread_run);
- int rtn = 0;
- pthread_sched_prevent();
- if( newtype == PTHREAD_CANCEL_DEFERRED ||
- newtype == PTHREAD_CANCEL_ASYNCHRONOUS) {
- SET_PF_CANCEL_TYPE(pthread_run, newtype);
- if( oldtype != NULL )
- *oldtype = otype;
- } else { /* Invalid new type */
- rtn = EINVAL;
- }
- pthread_sched_resume();
- if( rtn == 0 ) {
- /* Test to see if we have a pending cancel to handle */
- pthread_testcancel();
- }
- return rtn;
-}
-
-/*----------------------------------------------------------------------
- * Function: pthread_testcancel
- * Purpose: Requests delivery of a pending cancel to the current thread
- * Args: void
- * Returns: void
- * Notes:
- * If the current thread has been cancelled, this function will not
- * return and the threads exit processing will be initiated.
- *----------------------------------------------------------------------*/
-
-void
-pthread_testcancel( void )
-{
- if( TEST_PF_CANCEL_STATE(pthread_run) == PTHREAD_CANCEL_DISABLE ) {
- return; /* Can't be cancelled */
- }
- /* Ensure that we aren't in the process of exiting already */
- if( TEST_PF_RUNNING_TO_CANCEL(pthread_run) )
- return;
-
- /* See if we have been cancelled */
- if( TEST_PF_CANCELLED(pthread_run) ) {
- /* Set this flag to avoid recursively calling pthread_exit */
- SET_PF_RUNNING_TO_CANCEL(pthread_run);
- pthread_exit( PTHREAD_CANCELLED ); /* Easy - just call pthread_exit */
- }
- return; /* Not cancelled */
-}
-
-/*----------------------------------------------------------------------
- * Function: pthread_cancel_internal
- * Purpose: An internal routine to begin the cancel processing
- * Args: freelocks = do we need to free locks before exiting
- * Returns: void
- * Notes:
- * This routine is called from pthread_resched_resume
- * prior to a context switch, and after a thread has resumed.
- *
- * The kernel must *NOT* be locked on entry here
- *----------------------------------------------------------------------*/
-
-void
-pthread_cancel_internal( int freelocks )
-{
- pthread_sched_prevent(); /* gotta stay focused */
- /* Since we can be called from pthread_resched_resume(), our
- * state is currently not PS_RUNNING. Since we side stepped
- * the actually blocking, we need to be removed from the queue
- * and marked as running.
- */
- if( pthread_run->state != PS_RUNNING ) {
- if( pthread_run->queue == NULL ) {
- PANIC(); /* Must be on a queue */
- }
- /* We MUST NOT put the thread on the prio_queue here. It
- * is already running (although it's state has changed) and if we
- * put it on the run queue, it will get resumed after it is dead
- * and we end up with a nice panic.
- */
- pthread_queue_remove(pthread_run->queue, pthread_run);
- pthread_run->state = PS_RUNNING; /* we are running */
- }
- /* Set this flag to avoid recursively calling pthread_exit */
- SET_PF_RUNNING_TO_CANCEL(pthread_run);
- /* Free up any locks we hold if told to. */
- if( freelocks ) {
- fd_unlock_for_cancel();
- }
- pthread_sched_resume();
- pthread_exit( PTHREAD_CANCELLED ); /* Easy - just call pthread_exit */
-}
-
-/*----------------------------------------------------------------------
- * Function: possiblyMakeRunnable
- * Purpose: Make a thread runnable so it can be cancelled if state allows
- * Args:
- * pthread = thread to process
- * Returns:
- * Notes:
- *----------------------------------------------------------------------*/
-
-static void
-possiblyMakeRunnable( pthread_t pthread )
-{
- if( ! TEST_PTHREAD_IS_CANCELLABLE(pthread) )
- return; /* Not currently cancellable */
- /* If the thread is currently runnable, then we just let things
- * take their course when it is next resumed.
- */
- if( pthread->state == PS_RUNNING )
- return; /* will happen at context switch */
- /* If the thread is sleeping, the it isn't on a queue. */
- if( pthread->state == PS_SLEEP_WAIT ) {
- sleep_cancel( pthread ); /* Remove from sleep list */
- } else {
- /* Otherwise, we need to take it off the queue and make it runnable */
- if( pthread->queue == NULL ) {
- PANIC(); /* Must be on a queue */
- }
- pthread_queue_remove(pthread->queue, pthread);
- }
- /* And make it runnable */
- pthread_prio_queue_enq(pthread_current_prio_queue, pthread);
- pthread->old_state = pthread->state;
- pthread->state = PS_RUNNING;
-}
diff --git a/mit-pthreads/pthreads/pthread_detach.c b/mit-pthreads/pthreads/pthread_detach.c
deleted file mode 100644
index d3ae8c03bb3..00000000000
--- a/mit-pthreads/pthreads/pthread_detach.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* ==== pthread_detach.c =======================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : pthread_join function.
- *
- * 1.00 94/01/15 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <errno.h>
-#include <pthread.h>
-
-/* ==========================================================================
- * pthread_detach()
- */
-int pthread_detach(pthread_t pthread)
-{
- struct pthread * next_thread, * high_thread, * low_thread;
- int ret;
-
- pthread_sched_prevent();
-
- /* Check that thread isn't detached already */
- if (!(pthread->attr.flags & PTHREAD_DETACHED)) {
-
- pthread->attr.flags |= PTHREAD_DETACHED;
-
- /* Wakeup all threads waiting on a join */
- if (next_thread = pthread_queue_deq(&(pthread->join_queue))) {
- high_thread = next_thread;
-
- while (next_thread = pthread_queue_deq(&(pthread->join_queue))) {
- if (high_thread->pthread_priority < next_thread->pthread_priority) {
- low_thread = high_thread;
- high_thread = next_thread;
- } else {
- low_thread = next_thread;
- }
- pthread_prio_queue_enq(pthread_current_prio_queue, low_thread);
- low_thread->state = PS_RUNNING;
- }
- /* If the thread is dead then move it to the alloc queue */
- if (pthread_queue_remove(&pthread_dead_queue, pthread) == OK) {
- pthread_queue_enq(&pthread_alloc_queue, pthread);
- }
- pthread_sched_other_resume(high_thread);
- return(OK);
- }
- /* If the thread is dead then move it to the alloc queue */
- if (pthread_queue_remove(&pthread_dead_queue, pthread) == OK) {
- pthread_queue_enq(&pthread_alloc_queue, pthread);
- pthread->state = PS_UNALLOCED;
- }
- ret = OK;
- } else {
- ret = ESRCH;
- }
- pthread_sched_resume();
- return(ret);
-}
diff --git a/mit-pthreads/pthreads/pthread_init.c b/mit-pthreads/pthreads/pthread_init.c
deleted file mode 100644
index 83e19fe0229..00000000000
--- a/mit-pthreads/pthreads/pthread_init.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/* ==== pthread_init.c ========================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Pthread_init routine.
- *
- * 1.00 94/09/20 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <stdlib.h>
-#include <string.h>
-
-/*
- * errno is declared here to prevent the linker from pulling in errno
- * from the C library (and whatever else is in that file). I also use
- * errno as the default location for error numbers for the initial thread
- * giving some backwards compatibility.
- */
-#ifdef errno
-#undef errno
-#endif
-
-#if !defined(M_UNIX)
-int errno;
-#else
-extern int errno;
-#endif
-
-/* ==========================================================================
- * pthread_init()
- *
- * We use features of the C++ linker to make sure this function is called
- * before anything else is done in the program. See init.cc.
- */
-void pthread_init(void)
-{
- struct machdep_pthread machdep_data = MACHDEP_PTHREAD_INIT;
-
- /* Only call this once */
- if (pthread_initial) {
- return;
- }
-
- pthread_pagesize = getpagesize();
-
- /* Initialize the first thread */
- if ((pthread_initial = (pthread_t)malloc(sizeof(struct pthread))) &&
- (pthread_current_prio_queue = (struct pthread_prio_queue *)
- malloc(sizeof(struct pthread_prio_queue)))) {
- memcpy(&(pthread_initial->machdep_data), &machdep_data,
- sizeof(machdep_data));
- memcpy(&pthread_initial->attr, &pthread_attr_default,
- sizeof(pthread_attr_t));
-
- pthread_initial->pthread_priority = PTHREAD_DEFAULT_PRIORITY;
- pthread_initial->state = PS_RUNNING;
-
- pthread_queue_init(&(pthread_initial->join_queue));
- pthread_initial->specific_data = NULL;
- pthread_initial->specific_data_count = 0;
- pthread_initial->cleanup = NULL;
- pthread_initial->queue = NULL;
- pthread_initial->next = NULL;
- pthread_initial->flags = 0;
- pthread_initial->pll = NULL;
- pthread_initial->sll = NULL;
-
- /* PTHREADS spec says we start with cancellability on and deferred */
- SET_PF_CANCEL_STATE(pthread_initial, PTHREAD_CANCEL_ENABLE);
- SET_PF_CANCEL_TYPE(pthread_initial, PTHREAD_CANCEL_DEFERRED);
-
-
- /* Ugly errno hack */
- pthread_initial->error_p = &errno;
- pthread_initial->error = 0;
-
- pthread_prio_queue_init(pthread_current_prio_queue);
- pthread_link_list = pthread_initial;
- pthread_run = pthread_initial;
-
- uthread_sigmask = &(pthread_run->sigmask);
-
- /* XXX can I assume the mask and pending siganl sets are empty. */
- sigemptyset(&(pthread_initial->sigpending));
- sigemptyset(&(pthread_initial->sigmask));
- pthread_initial->sigcount = 0;
-
- /* Initialize the signal handler. */
- sig_init();
-
- /* Initialize the fd table. */
- fd_init();
-
- /* Start the scheduler */
- machdep_set_thread_timer(&(pthread_run->machdep_data));
-#ifdef M_UNIX
- machdep_sys_init();
-#endif
- return;
- }
- PANIC();
-}
diff --git a/mit-pthreads/pthreads/pthread_join.c b/mit-pthreads/pthreads/pthread_join.c
deleted file mode 100644
index 879250020a1..00000000000
--- a/mit-pthreads/pthreads/pthread_join.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/* ==== pthread_join.c =======================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : pthread_join function.
- *
- * 1.00 94/01/15 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <errno.h>
-
-static int testDeadlock( struct pthread_queue *queue, pthread_t target );
-
-/* ==========================================================================
- * pthread_join()
- */
-int pthread_join(pthread_t pthread, void **thread_return)
-{
- int ret;
-
- pthread_sched_prevent();
-
- /* Ensure they gave us a legal pthread pointer */
- if( ! __pthread_is_valid( pthread ) ) {
- pthread_sched_resume();
- return(EINVAL);
- }
-
- /* Check that thread isn't detached already */
- if (pthread->attr.flags & PTHREAD_DETACHED) {
- pthread_sched_resume();
- return(ESRCH);
- }
-
- /*
- * Now check if other thread has exited
- * Note: This must happen after checking detached state.
- */
- if (pthread_queue_remove(&pthread_dead_queue, pthread) != OK) {
-
- /* Before we pend on the join, ensure there is no dead lock */
-
- if( testDeadlock( &pthread_run->join_queue, pthread ) == NOTOK ) {
- ret = EDEADLK;
- } else {
- pthread_queue_enq(&(pthread->join_queue), pthread_run);
- SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- pthread_resched_resume(PS_JOIN);
- CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
- pthread_sched_prevent();
-
- if (pthread_queue_remove(&pthread_dead_queue, pthread) == OK) {
- pthread_queue_enq(&pthread_alloc_queue, pthread);
- pthread->attr.flags |= PTHREAD_DETACHED;
- pthread->state = PS_UNALLOCED;
- if (thread_return) {
- *thread_return = pthread->ret;
- }
- ret = OK;
- } else {
- ret = ESRCH;
- }
- }
- } else {
- /* Just get the return value and detach the thread */
- pthread_queue_enq(&pthread_alloc_queue, pthread);
- pthread->attr.flags |= PTHREAD_DETACHED;
- pthread->state = PS_UNALLOCED;
- if (thread_return) {
- *thread_return = pthread->ret;
- }
- ret = OK;
- }
- pthread_sched_resume();
- return(ret);
-}
-
-/*----------------------------------------------------------------------
- * Function: testDeadlock
- * Purpose: recursive queue walk to check for deadlocks
- * Args:
- * queue = the queue to walk
- * pthread = target to scan for
- * Returns:
- * OK = no deadlock, NOTOK = deadlock
- * Notes:
- *----------------------------------------------------------------------*/
-static int
-testDeadlock( struct pthread_queue *queue, pthread_t target )
-{
- pthread_t t;
-
- if( queue == NULL )
- return OK; /* Empty queue, obviously ok */
-
- for( t = queue->q_next; t; t = t->next ) {
- if( t == target )
- return NOTOK; /* bang, your dead */
-
- if( testDeadlock( &t->join_queue, target ) == NOTOK ) {
- return NOTOK;
- }
- }
-
- return OK; /* No deadlock */
-}
diff --git a/mit-pthreads/pthreads/pthread_kill.c b/mit-pthreads/pthreads/pthread_kill.c
deleted file mode 100644
index 9e3e61488a3..00000000000
--- a/mit-pthreads/pthreads/pthread_kill.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ==== pthread_kill.c =======================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : pthread_kill function.
- *
- * 1.32 94/06/12 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-
-/* Defined in sig.c, a linked list of threads currently
- * blocked in sigwait(): */
-extern struct pthread * pthread_sigwait;
-
-
-/* ==========================================================================
- * pthread_kill()
- */
-int pthread_kill(struct pthread * pthread, int sig)
-{
- struct pthread ** pthread_ptr;
-
- pthread_sched_prevent();
-
- /* Check who is the current owner of pthread */
-/* if (pthread->kthread != pthread_run->kthread) { */
- if (0) {
- } else {
- if (pthread->state == PS_SIGWAIT) {
- if(sigismember(pthread->data.sigwait, sig)) {
- for (pthread_ptr = &pthread_sigwait;
- (*pthread_ptr);
- pthread_ptr = &((*pthread_ptr)->next)) {
- if ((*pthread_ptr) == pthread) {
-
- /* Take the thread out of the
- * pthread_sigwait linked list: */
- *pthread_ptr=(*pthread_ptr)->next;
-
- *(int *)(pthread->ret) = sig;
- pthread_sched_other_resume(pthread);
- return(OK);
- }
- }
- /* A thread should not be in the state PS_SIGWAIT
- * without being in the pthread_sigwait linked
- * list: */
- PANIC();
- }
- }
- if (!sigismember(&pthread->sigpending,sig)) /* Added by monty */
- {
- sigaddset(&(pthread->sigpending), sig);
- pthread->sigcount++;
- }
- }
-
- pthread_sched_resume();
- return(OK);
-}
diff --git a/mit-pthreads/pthreads/pthread_once.c b/mit-pthreads/pthreads/pthread_once.c
deleted file mode 100644
index 0a3dcd23fae..00000000000
--- a/mit-pthreads/pthreads/pthread_once.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ==== pthread_once.c =======================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : pthread_once function.
- *
- * 1.00 93/12/12 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-
-/* ==========================================================================
- * pthread_once()
- */
-int pthread_once(pthread_once_t *once_control, void (*init_routine)(void))
-{
- /* Check first for speed */
- if (once_control->state == PTHREAD_NEEDS_INIT) {
- pthread_mutex_lock(&(once_control->mutex));
- if (once_control->state == PTHREAD_NEEDS_INIT) {
- init_routine();
- once_control->state = PTHREAD_DONE_INIT;
- }
- pthread_mutex_unlock(&(once_control->mutex));
- }
- return(OK);
-}
diff --git a/mit-pthreads/pthreads/queue.c b/mit-pthreads/pthreads/queue.c
deleted file mode 100644
index c33774bf4dd..00000000000
--- a/mit-pthreads/pthreads/queue.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/* ==== queue.c ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Queue functions.
- *
- * 1.00 93/07/15 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-
-/*
- * All routines in this file assume that the queue has been appropriatly
- * locked.
- */
-
-/* ==========================================================================
- * pthread_queue_init()
- */
-void pthread_queue_init(struct pthread_queue *queue)
-{
- queue->q_next = NULL;
- queue->q_last = NULL;
- queue->q_data = NULL;
-}
-
-/* ==========================================================================
- * pthread_queue_enq()
- */
-void pthread_queue_enq(struct pthread_queue *queue, struct pthread *thread)
-{
- if (queue->q_last) {
- queue->q_last->next = thread;
- } else {
- queue->q_next = thread;
- }
- queue->q_last = thread;
- thread->queue = queue;
- thread->next = NULL;
-
-}
-
-/* ==========================================================================
- * pthread_queue_get()
- */
-struct pthread *pthread_queue_get(struct pthread_queue *queue)
-{
- return(queue->q_next);
-}
-
-/* ==========================================================================
- * pthread_queue_deq()
- */
-struct pthread *pthread_queue_deq(struct pthread_queue *queue)
-{
- struct pthread *thread = NULL;
-
- if (queue->q_next) {
- thread = queue->q_next;
- if (!(queue->q_next = queue->q_next->next)) {
- queue->q_last = NULL;
- }
- thread->queue = NULL;
- thread->next = NULL;
- }
- return(thread);
-}
-
-/* ==========================================================================
- * pthread_queue_remove()
- */
-int pthread_queue_remove(struct pthread_queue *queue, struct pthread *thread)
-{
- struct pthread **current = &(queue->q_next);
- struct pthread *prev = NULL;
- int ret = NOTOK;
-
- while (*current) {
- if (*current == thread) {
- if ((*current)->next) {
- *current = (*current)->next;
- } else {
- queue->q_last = prev;
- *current = NULL;
- }
- thread->queue = NULL;
- thread->next = NULL;
- ret = OK;
- break;
- }
- prev = *current;
- current = &((*current)->next);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * pthread_llist_remove()
- */
-int pthread_llist_remove(struct pthread **llist, struct pthread *thread)
-{
- while (*llist) {
- if (*llist == thread) {
- *llist = thread->next;
- return(OK);
- }
- llist = &(*llist)->next;
- }
- return(NOTOK);
-}
-
diff --git a/mit-pthreads/pthreads/readv.c b/mit-pthreads/pthreads/readv.c
deleted file mode 100644
index fd63d31cf94..00000000000
--- a/mit-pthreads/pthreads/readv.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ==== readv.c ============================================================
- * Copyright (c) 1995 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Implementation of readv().
- *
- * 1.00 95/06/19 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include "config.h"
-
-#ifndef HAVE_SYSCALL_READV
-
-#include <errno.h>
-#include <unistd.h>
-#include <sys/uio.h>
-#include <sys/types.h>
-
-/* ==========================================================================
- * machdep_sys_readv()
- */
-int machdep_sys_readv(int fd, struct iovec * vector, int count)
-{
- size_t bytes, i;
- char *buffer;
- int ret = 0;
-
- /* Find the total number of bytes to be read. */
- for (bytes = 0, i = 0; i < count; ++i)
- bytes += vector[i].iov_len;
-
- if (bytes) {
- /*
- * Allocate a temporary buffer to hold the data.
- * Don't use alloca because threads tend to have smaller stacks.
- */
- if ((buffer = (char *)malloc(bytes)) == NULL) {
- return(-ENOMEM);
- }
- ret = (int)machdep_sys_read(fd, buffer, bytes);
-
- /* Copy the data from memory specified by VECTOR to BUFFER */
- for (i = 0, bytes = 0; ret > 0; ret -= vector[i].iov_len) {
- memcpy(vector[i].iov_base, buffer + bytes,
- ret > vector[i].iov_len ? vector[i].iov_len : ret);
- bytes += vector[i].iov_len;
- }
- free(buffer);
- }
- return(ret);
-}
-
-#endif
diff --git a/mit-pthreads/pthreads/schedparam.c b/mit-pthreads/pthreads/schedparam.c
deleted file mode 100644
index b4b28577022..00000000000
--- a/mit-pthreads/pthreads/schedparam.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* ==== schedparam.c =======================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Pthread schedparam functions.
- *
- * 1.38 94/06/15 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <sched.h>
-#include <errno.h>
-
-/* ==========================================================================
- * sched_get_priority_max
- */
-int sched_get_priority_max(int policy)
-{
- return PTHREAD_MAX_PRIORITY;
-}
-
-/* ==========================================================================
- * sched_get_priority_min
- */
-int sched_get_priority_min(int policy)
-{
- return PTHREAD_MIN_PRIORITY;
-}
-
-/* Currently only policy is supported */
-/* ==========================================================================
- * pthread_setschedparam()
- */
-int pthread_setschedparam(pthread_t pthread, int policy,
- struct sched_param * param)
-{
- enum schedparam_policy new_policy, old_policy;
- int ret = OK;
- int prio;
-
- new_policy = policy;
- pthread_sched_prevent();
- old_policy = pthread->attr.schedparam_policy;
-
- if (param) {
- if ((param->sched_priority < PTHREAD_MIN_PRIORITY) ||
- (param->sched_priority > PTHREAD_MAX_PRIORITY)) {
- pthread_sched_resume();
- return(EINVAL);
- }
- prio = param->sched_priority;
- } else {
- prio = pthread->pthread_priority;
- }
-
- if (pthread == pthread_run) {
- switch(new_policy) {
- case SCHED_RR:
- pthread->attr.schedparam_policy = new_policy;
- switch (old_policy) {
- case SCHED_FIFO:
- machdep_unset_thread_timer(NULL);
- default:
- pthread->pthread_priority = prio;
- break;
- }
- break;
- case SCHED_FIFO:
- pthread->attr.schedparam_policy = new_policy;
- switch (old_policy) {
- case SCHED_IO:
- case SCHED_RR:
- if (pthread->pthread_priority < prio) {
- pthread->pthread_priority = prio;
- pthread_sched_resume();
- pthread_yield();
- return(OK);
- }
- default:
- pthread->pthread_priority = prio;
- break;
- }
- break;
- case SCHED_IO:
- pthread->attr.schedparam_policy = new_policy;
- switch (old_policy) {
- case SCHED_FIFO:
- machdep_unset_thread_timer(NULL);
- default:
- pthread->pthread_priority = prio;
- break;
- }
- break;
- default:
- SET_ERRNO(EINVAL);
- ret = EINVAL;
- break;
- }
- } else {
- switch(new_policy) {
- case SCHED_FIFO:
- case SCHED_IO:
- case SCHED_RR:
- if(pthread_prio_queue_remove(pthread_current_prio_queue,pthread) == OK) {
- pthread->attr.schedparam_policy = new_policy;
- pthread->pthread_priority = prio;
- pthread_sched_other_resume(pthread);
- } else {
- pthread->attr.schedparam_policy = new_policy;
- pthread->pthread_priority = prio;
- pthread_sched_resume();
- }
- return(OK);
- break;
- default:
- SET_ERRNO(EINVAL);
- ret = EINVAL;
- break;
- }
- }
-
- pthread_sched_resume();
- return(ret);
-}
-
-/* ==========================================================================
- * pthread_getschedparam()
- */
-int pthread_getschedparam(pthread_t pthread, int * policy,
- struct sched_param * param)
-{
- *policy = pthread->attr.schedparam_policy;
- if (param) {
- param->sched_priority = pthread->pthread_priority;
- }
- return(OK);
-}
-
diff --git a/mit-pthreads/pthreads/select.c b/mit-pthreads/pthreads/select.c
deleted file mode 100644
index eaafce31f19..00000000000
--- a/mit-pthreads/pthreads/select.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/* ==== select.c ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * This code based on code contributed by
- * Peter Hofmann <peterh@prz.tu-berlin.d400.de>
- *
- * Description : Select.
- *
- * 1.23 94/04/26 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <string.h>
-#include <errno.h>
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/time.h>
-
-extern struct pthread_queue fd_wait_select;
-static struct timeval zero_timeout = { 0, 0 }; /* Moved by monty */
-
-/* ==========================================================================
- * select()
- */
-int select(int numfds, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds, struct timeval *timeout)
-{
- fd_set real_exceptfds, real_readfds, real_writefds; /* mapped fd_sets */
- fd_set * real_readfds_p, * real_writefds_p, * real_exceptfds_p;
- fd_set read_locks, write_locks, rdwr_locks;
- struct timespec timeout_time, current_time;
- int i, j, ret = 0, got_all_locks = 1;
- struct pthread_select_data data;
-
- if (numfds > dtablesize) {
- numfds = dtablesize;
- }
-
- data.nfds = 0;
- FD_ZERO(&data.readfds);
- FD_ZERO(&data.writefds);
- FD_ZERO(&data.exceptfds);
-
- /* Do this first */
- if (timeout) {
- machdep_gettimeofday(&current_time);
- timeout_time.tv_sec = current_time.tv_sec + timeout->tv_sec;
- if ((timeout_time.tv_nsec = current_time.tv_nsec +
- (timeout->tv_usec * 1000)) > 1000000000) {
- timeout_time.tv_nsec -= 1000000000;
- timeout_time.tv_sec++;
- }
- }
-
- FD_ZERO(&read_locks);
- FD_ZERO(&write_locks);
- FD_ZERO(&rdwr_locks);
- FD_ZERO(&real_readfds);
- FD_ZERO(&real_writefds);
- FD_ZERO(&real_exceptfds);
-
- /* lock readfds */
- if (readfds || writefds || exceptfds) {
- for (i = 0; i < numfds; i++) {
- if ((readfds && (FD_ISSET(i, readfds))) ||
- (exceptfds && FD_ISSET(i, exceptfds))) {
- if (writefds && FD_ISSET(i ,writefds)) {
- if ((ret = fd_lock(i, FD_RDWR, NULL)) != OK) {
- got_all_locks = 0;
- break;
- }
- FD_SET(i, &rdwr_locks);
- FD_SET(fd_table[i]->fd.i,&real_writefds);
- } else {
- if ((ret = fd_lock(i, FD_READ, NULL)) != OK) {
- got_all_locks = 0;
- break;
- }
- FD_SET(i, &read_locks);
- }
- if (readfds && FD_ISSET(i,readfds)) {
- FD_SET(fd_table[i]->fd.i, &real_readfds);
- }
- if (exceptfds && FD_ISSET(i,exceptfds)) {
- FD_SET(fd_table[i]->fd.i, &real_exceptfds);
- }
- if (fd_table[i]->fd.i >= data.nfds) {
- data.nfds = fd_table[i]->fd.i + 1;
- }
- } else {
- if (writefds && FD_ISSET(i, writefds)) {
- if ((ret = fd_lock(i, FD_WRITE, NULL)) != OK) {
- got_all_locks = 0;
- break;
- }
- FD_SET(i, &write_locks);
- FD_SET(fd_table[i]->fd.i,&real_writefds);
- if (fd_table[i]->fd.i >= data.nfds) {
- data.nfds = fd_table[i]->fd.i + 1;
- }
- }
- }
- }
- }
-
- if (got_all_locks)
- {
- memcpy(&data.readfds,&real_readfds,sizeof(fd_set));
- memcpy(&data.writefds,&real_writefds,sizeof(fd_set));
- memcpy(&data.exceptfds,&real_exceptfds,sizeof(fd_set));
-
- real_readfds_p = (readfds == NULL) ? NULL : &real_readfds;
- real_writefds_p = (writefds == NULL) ? NULL : &real_writefds;
- real_exceptfds_p = (exceptfds == NULL) ? NULL : &real_exceptfds;
-
- pthread_run->sighandled=0;
- if ((ret = machdep_sys_select(data.nfds, real_readfds_p,
- real_writefds_p, real_exceptfds_p,
- &zero_timeout)) == OK) {
- pthread_sched_prevent();
-
- real_exceptfds_p = (exceptfds == NULL) ? NULL : &data.exceptfds;
- real_writefds_p = (writefds == NULL) ? NULL : &data.writefds;
- real_readfds_p = (readfds == NULL) ? NULL : &data.readfds;
-
- pthread_queue_enq(&fd_wait_select, pthread_run);
- pthread_run->data.select_data = &data;
- SET_PF_WAIT_EVENT(pthread_run);
-
- if (timeout) {
- machdep_gettimeofday(&current_time);
- sleep_schedule(&current_time, &timeout_time);
-
- SET_PF_AT_CANCEL_POINT(pthread_run);
- pthread_resched_resume(PS_SELECT_WAIT);
- CLEAR_PF_AT_CANCEL_POINT(pthread_run);
-
- /* We're awake */
- if (sleep_cancel(pthread_run) == NOTOK) {
- ret = OK;
- }
- else
- {
- int count = 0;
- for (i = 0; i < numfds; i++)
- {
- if (real_readfds_p && (FD_ISSET(i, real_readfds_p)))
- count++;
- if (real_writefds_p && (FD_ISSET(i, real_writefds_p)))
- count++;
- if (real_exceptfds_p && (FD_ISSET(i, real_exceptfds_p)))
- count++;
- }
- ret = count;
- }
- /* Moving this after the sleep_cancel() seemed
- * to fix intermittent crashes during heavy
- * socket use. (mevans)
- */
- CLEAR_PF_DONE_EVENT(pthread_run);
- } else {
- int count = 0;
- SET_PF_AT_CANCEL_POINT(pthread_run);
- pthread_resched_resume(PS_SELECT_WAIT);
- CLEAR_PF_AT_CANCEL_POINT(pthread_run);
- CLEAR_PF_DONE_EVENT(pthread_run);
- for (i = 0; i < numfds; i++)
- {
- if (real_readfds_p && (FD_ISSET(i, real_readfds_p)))
- count++;
- if (real_writefds_p && (FD_ISSET(i, real_writefds_p)))
- count++;
- if (real_exceptfds_p && (FD_ISSET(i, real_exceptfds_p)))
- count++;
- }
- ret = count;
- }
- if (pthread_run->sighandled) /* Added by monty */
- { /* We where aborted */
- ret= NOTOK;
- SET_ERRNO(EINTR);
- }
- } else if (ret < 0) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- }
-
- /* clean up the locks */
- for (i = 0; i < numfds; i++)
- { /* Changed by monty */
- if (FD_ISSET(i,&read_locks)) fd_unlock(i,FD_READ);
- if (FD_ISSET(i,&rdwr_locks)) fd_unlock(i,FD_RDWR);
- if (FD_ISSET(i,&write_locks)) fd_unlock(i,FD_WRITE);
- }
- if (ret > 0) {
- if (readfds != NULL) {
- for (i = 0; i < numfds; i++) {
- if (! (FD_ISSET(i,readfds) &&
- FD_ISSET(fd_table[i]->fd.i,real_readfds_p)))
- FD_CLR(i,readfds);
- }
- }
- if (writefds != NULL) {
- for (i = 0; i < numfds; i++)
- if (! (FD_ISSET(i,writefds) &&
- FD_ISSET(fd_table[i]->fd.i,real_writefds_p)))
- FD_CLR(i,writefds);
- }
- if (exceptfds != NULL) {
- for (i = 0; i < numfds; i++)
- if (! (FD_ISSET(i,exceptfds) &&
- FD_ISSET(fd_table[i]->fd.i,real_exceptfds_p)))
- FD_CLR(i,exceptfds);
- }
- } else {
- if (exceptfds != NULL) FD_ZERO(exceptfds);
- if (writefds != NULL) FD_ZERO(writefds);
- if (readfds != NULL) FD_ZERO(readfds);
- }
-
- return(ret);
-}
diff --git a/mit-pthreads/pthreads/sig.c b/mit-pthreads/pthreads/sig.c
deleted file mode 100644
index 85d4465bf1c..00000000000
--- a/mit-pthreads/pthreads/sig.c
+++ /dev/null
@@ -1,452 +0,0 @@
-/* ==== sig.c =======================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : All the thread signal functions.
- *
- * 1.32 94/06/12 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <errno.h>
-#include <pthread.h>
-#include <signal.h>
-#include <string.h>
-
-#if defined(M_UNIX)
-#define signal(A,B) machdep_sys_signal((A),(B))
-#endif
-
-extern void sig_handler_real();
-
-struct pthread * pthread_sigwait;
-static sigset_t pending_signals;
-
-struct pthread_sigvec {
- void (*vector)();
- sigset_t mask;
- int flags;
-} pthread_sigvec[SIGMAX];
-
-/* ==========================================================================
- * pthread_sig_register()
- *
- * Assumes the kernel is locked.
- */
-int pthread_sig_register(int sig)
-{
- struct pthread ** pthread_ptr, * pthread;
- int ret;
-
- /*
- * If we have a siginfo structure and the signal is synchronous then
- * only deliver the signal to the current thread.
- */
-
- /* Check waiting threads for delivery */
- for (pthread_ptr = &pthread_sigwait; (*pthread_ptr);
- pthread_ptr = &((*pthread_ptr)->next)) {
- if (sigismember((*pthread_ptr)->data.sigwait, sig)) {
- pthread=*pthread_ptr;
- *pthread_ptr=(*pthread_ptr)->next;
-
- pthread_prio_queue_enq(pthread_current_prio_queue, pthread);
- ret = pthread->pthread_priority;
- *(int *)(pthread->ret) = sig;
- pthread->state = PS_RUNNING;
-
- return(ret);
- }
- }
-
- /* Check current running thread */
- if (pthread_run) {
- if (!sigismember(&pthread_run->sigmask, sig)) {
- sigaddset(&pthread_run->sigpending, sig);
- pthread_run->sigcount++;
- return(0);
- }
- }
-
- /* Check any running thread */
- for (pthread = pthread_current_prio_queue->next;
- pthread; pthread = pthread->next) {
- if (!sigismember(&pthread->sigmask, sig)) {
- sigaddset(&pthread->sigpending, sig);
- pthread->sigcount++;
- return(0);
- }
- }
-
- /* Check any thread */
- for (pthread = pthread_link_list; pthread; pthread = pthread->pll) {
- if (!sigismember(&pthread->sigmask, sig)) {
- sigaddset(&pthread->sigpending, sig);
- pthread->sigcount++;
- return(0);
- }
- }
-
- sigaddset(&pending_signals, sig);
- return(0);
-}
-
-/* ==========================================================================
- * pthread_sig_default()
- */
-void pthread_sig_default(int sig)
-{
- sigset_t mask, omask;
-
- if (pthread_sigvec[sig].vector == SIG_DFL) {
- /* Set the signal handler to default before issueing the kill */
- signal(sig, SIG_DFL);
- kill(getpid(), sig);
- sigemptyset(&mask);
- sigaddset(&mask, sig);
- machdep_sys_sigprocmask(SIG_UNBLOCK, &mask, &omask);
- signal(sig, sig_handler_real);
- }
-}
-
-/* ==========================================================================
- * pthread_sig_process()
- *
- * Assumes the kernel is locked.
- */
-void pthread_sig_process()
-{
- void (*vector)();
- int i, j;
-
- for (i = 1; i < SIGMAX; i++) {
- if (sigismember(&(pthread_run->sigpending), i)) {
- if (! sigismember(&(pthread_run->sigmask), i)) {
- sigdelset(&(pthread_run->sigpending), i);
- pthread_run->sigcount--;
-
- if (pthread_sigvec[i].vector == SIG_IGN) {
- continue;
- }
- if (pthread_sigvec[i].vector == SIG_DFL) {
- pthread_sig_default(i);
- continue;
- }
-
- {
- sigset_t omask;
-
- sigemptyset(&omask);
- /* Save old mask */
- for (j = 1; j < SIGMAX; j++) {
- if (sigismember(&(pthread_run->sigmask), j)) {
- if (sigismember(&(pthread_sigvec[i].mask), j))
- sigaddset(&(pthread_run->sigmask), j);
- sigaddset(&omask, j);
- }
- }
- /* The signal is masked while handling the signal */
- sigaddset(&(pthread_run->sigmask), i);
-
- /*
- * Allow interrupts during a signal,
- * but not a change in the vector
- */
- vector = pthread_sigvec[i].vector;
- if (--pthread_kernel_lock) {
- PANIC();
- }
- vector(i);
- pthread_run->sighandled=1; /* Mark for select; Monty */
- pthread_kernel_lock++;
-
- memcpy(&(pthread_run->sigmask), &omask, sizeof(omask));
- }
- }
- }
- }
-}
-
-/* ==========================================================================
- * pthread_sigmask()
- *
- * It is unclear wheather this call should be implemented as an atomic
- * operation. The resulting mask could be wrong if in the signal
- * handler the thread calls sigprocmask for any signal other than the
- * signal the handler is dealing with.
- */
-int pthread_sigmask(int how, const sigset_t *set, sigset_t * oset)
-{
- int i;
-
- if (oset) {
- sigemptyset(oset);
- for (i = 1; i < SIGMAX; i++) {
- if (sigismember(&(pthread_run->sigmask), i)) {
- sigaddset(oset, i);
- }
- }
- }
-
- if (set) {
- switch(how) {
- case SIG_BLOCK:
- for (i = 1; i < SIGMAX; i++) {
- if (sigismember(set, i)) {
- sigaddset(&(pthread_run->sigmask), i);
- }
- }
- break;
- case SIG_UNBLOCK:
- pthread_sched_prevent();
- for (i = 1; i < SIGMAX; i++) {
- if (sigismember(set, i)) {
- sigdelset(&(pthread_run->sigmask), i);
- if (sigismember(&pending_signals, i)) {
- sigaddset(&(pthread_run->sigpending), i);
- sigdelset(&pending_signals, i);
- pthread_run->sigcount++;
- }
- }
- }
- pthread_sched_resume();
- break;
- case SIG_SETMASK:
- sigfillset(&(pthread_run->sigmask));
- pthread_sched_prevent();
- for (i = 1; i < SIGMAX; i++) {
- if (! sigismember(set, i)) {
- sigdelset(&(pthread_run->sigmask), i);
- if (sigismember(&pending_signals, i)) {
- sigaddset(&(pthread_run->sigpending), i);
- sigdelset(&pending_signals, i);
- pthread_run->sigcount++;
- }
- }
- }
- pthread_sched_resume();
- break;
- default:
- SET_ERRNO(EINVAL);
- return(NOTOK);
- }
- }
- return(OK);
-}
-
-int sigprocmask(int how, const sigset_t *set, sigset_t * oset)
-{
- return(pthread_sigmask(how, set, oset));
-}
-
-/* ==========================================================================
- * sigwait()
- */
-int sigwait(const sigset_t * set, int * sig)
-{
- int i;
-
- /* Check that sig is valid */
- *sig = 0;
-
- pthread_sched_prevent();
- for (i = 1; i < SIGMAX; i++) {
- if (sigismember(set, i)) {
- /* Check personal signals */
- if (sigismember(&(pthread_run->sigpending), i)) {
- sigdelset(&(pthread_run->sigpending), i);
- pthread_sched_resume();
- *sig = i;
- return(OK);
- }
- /* Check kernel signals */
- if (sigismember(&pending_signals, i)) {
- sigdelset(&pending_signals, i);
- pthread_sched_resume();
- *sig = i;
- return(OK);
- }
- }
- }
-
- /* No pending signals, wait for one */
- pthread_run->next = pthread_sigwait;
- pthread_sigwait = pthread_run;
- pthread_run->data.sigwait = set;
- pthread_run->ret = sig;
-
- SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- pthread_resched_resume(PS_SIGWAIT);
- CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
-
- return(OK);
-}
-
-/* ==========================================================================
- * raise()
- */
-int raise(int sig)
-{
- return(pthread_kill(pthread_self(), sig));
-}
-
-/* ==========================================================================
- * sigsuspend()
- */
-int sigsuspend(const sigset_t * mask)
-{
- int ret_sig, ret;
- sigset_t nm, om;
-
- sigfillset(&nm);
- for(ret_sig = 1; ret_sig < SIGMAX; ret_sig++) {
- if (sigismember(mask, ret_sig)) {
- sigdelset(&nm, ret_sig);
- }
- }
- pthread_sigmask(SIG_BLOCK, &nm, &om);
- if ((ret = sigwait(&nm, &ret_sig)) == OK) {
- sigemptyset(&nm);
- sigaddset(&nm, ret_sig);
- pthread_kill(pthread_self(), ret_sig);
- pthread_sigmask(SIG_UNBLOCK, &nm, NULL);
- /* There is a race condition here, it's not worth worring about */
- pthread_sigmask(SIG_BLOCK, &nm, NULL);
- SET_ERRNO(EINTR);
- ret = NOTOK;
- }
- pthread_sigmask(SIG_SETMASK, &om, NULL);
- return(ret);
-}
-
-/* ==========================================================================
- * pthread_signal()
- */
-void (*pthread_signal(int sig, void (*dispatch)(int)))()
-{
- void (*odispatch)(int);
-
- odispatch = pthread_sigvec[sig].vector;
- if ((sig > 0) && (sig < SIGMAX)) {
- pthread_sigvec[sig].vector = dispatch;
- sigemptyset(&(pthread_sigvec[sig].mask));
- pthread_sigvec[sig].flags = 0;
- }
- return(odispatch);
-}
-
-/* ==========================================================================
- * pthread_sigprocmask()
- */
-int pthread_sigaction(int sig, const struct sigaction * act,
- struct sigaction * oact)
-{
- if ((sig > 0) && (sig < SIGMAX)) {
- if (oact) {
- memcpy(&(oact->sa_mask), &(pthread_sigvec[sig].mask),
- sizeof(sigset_t));
- oact->sa_handler = pthread_sigvec[sig].vector;
- oact->sa_flags = pthread_sigvec[sig].flags;
- }
- if (act) {
- memcpy(&(pthread_sigvec[sig].mask), &(act->sa_mask),
- sizeof(sigset_t));
- pthread_sigvec[sig].vector = act->sa_handler;
- pthread_sigvec[sig].flags = act->sa_flags;
- }
- return(OK);
- }
- SET_ERRNO(EINVAL);
- return(NOTOK);
-}
-
-/*
- * The following here are stolen from BSD because I get mutiply defined
- * symbols between sig.o and posix_sig.o in Sun's libc.a under Sunos 4.1.3.
- * The problem is that sigprocmask() is defined in posix_sig.o, in the same
- * module that a lot of other sigset-primitives are defined, and we have
- * our definition of sigprocmask() here, but use those other primitives.
- */
-
-#undef sigemptyset
-#undef sigfillset
-#undef sigaddset
-#undef sigdelset
-#undef sigismember
-
-static const sigset_t __sigemptyset = __SIGEMPTYSET;
-int sigemptyset(sigset_t *set)
-{
- *set = __sigemptyset;
- return (0);
-}
-
-static const sigset_t __sigfillset = __SIGFILLSET;
-int sigfillset(sigset_t * set)
-{
- *set = __sigfillset;
- return (0);
-}
-
-#define _MAXIMUM_SIG NSIG
-
-int sigaddset(sigset_t *set, int signo)
-{
- if (signo <= 0 || signo >= _MAXIMUM_SIG) {
- errno = EINVAL;
- return -1;
- }
- __SIGADDSET(set, signo);
- return (0);
-}
-
-int sigdelset(sigset_t *set, int signo)
-{
- if (signo <= 0 || signo >= _MAXIMUM_SIG) {
- errno = EINVAL;
- return -1;
- }
- __SIGDELSET(set, signo);
- return (0);
-}
-
-int sigismember(const sigset_t *set, int signo)
-{
- if (signo <= 0 || signo >= _MAXIMUM_SIG) {
- errno = EINVAL;
- return -1;
- }
- return(__SIGISMEMBER(set, signo));
-}
-
diff --git a/mit-pthreads/pthreads/signal.c b/mit-pthreads/pthreads/signal.c
deleted file mode 100644
index 7da4183c1cb..00000000000
--- a/mit-pthreads/pthreads/signal.c
+++ /dev/null
@@ -1,653 +0,0 @@
-/* ==== signal.c ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Queue functions.
- *
- * 1.00 93/07/21 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <config.h>
-#include <pthread.h>
-#include <signal.h>
-
-/* This will force init.o to get dragged in; if you've got support for
- C++ initialization, that'll cause pthread_init to be called at
- program startup automatically, so the application won't need to
- call it explicitly. */
-
-extern char __pthread_init_hack;
-char *__pthread_init_hack_2 = &__pthread_init_hack;
-
-/*
- * Time which select in fd_kern_wait() will sleep.
- * If there are no threads to run we sleep for an hour or until
- * we get an interrupt or an fd thats awakens. To make sure we
- * don't miss an interrupt this variable gets reset too zero in
- * sig_handler_real().
- */
-struct timeval __fd_kern_wait_timeout = { 0, 0 };
-
-/*
- * Global for user-kernel lock, and blocked signals
- */
-
-static sig_atomic_t signum_to_process[SIGMAX + 1] = { 0, };
-volatile sig_atomic_t sig_to_process = 0;
-
-/* static volatile sigset_t sig_to_process; */
-static volatile int sig_count = 0;
-
-static void sig_handler(int signal);
-static void set_thread_timer();
-static void __cleanup_after_resume( void );
-void sig_prevent(void);
-void sig_resume(void);
-
-/* ==========================================================================
- * context_switch()
- *
- * This routine saves the current state of the running thread gets
- * the next thread to run and restores it's state. To allow different
- * processors to work with this routine, I allow the machdep_restore_state()
- * to either return or have it return from machdep_save_state with a value
- * other than 0, this is for implementations which use setjmp/longjmp.
- */
-static void context_switch()
-{
- struct pthread **current, *next, *last, **dead;
-
- if (pthread_run->state == PS_RUNNING) {
- /* Put current thread back on the queue */
- pthread_prio_queue_enq(pthread_current_prio_queue, pthread_run);
- }
-
- /* save floating point registers if necessary */
- if (!(pthread_run->attr.flags & PTHREAD_NOFLOAT)) {
- machdep_save_float_state(pthread_run);
- }
- /* save state of current thread */
- if (machdep_save_state()) {
- return;
- }
-
- last = pthread_run;
-
- /* Poll all fds */
- fd_kern_poll();
-
-context_switch_reschedule:;
- /* Are there any threads to run */
- if (pthread_run = pthread_prio_queue_deq(pthread_current_prio_queue)) {
- /* restore floating point registers if necessary */
- if (!(pthread_run->attr.flags & PTHREAD_NOFLOAT)) {
- machdep_restore_float_state();
- }
- uthread_sigmask = &(pthread_run->sigmask);
- /* restore state of new current thread */
- machdep_restore_state();
- return;
- }
-
- /* Are there any threads at all */
- for (next = pthread_link_list; next; next = next->pll) {
- if ((next->state != PS_UNALLOCED) && (next->state != PS_DEAD)) {
- sigset_t sig_to_block, oset;
-
- sigfillset(&sig_to_block);
-
- /*
- * Check sig_to_process before calling fd_kern_wait, to handle
- * things like zero timeouts to select() which would register
- * a signal with the sig_handler_fake() call.
- *
- * This case should ignore SIGVTALRM
- */
- machdep_sys_sigprocmask(SIG_BLOCK, &sig_to_block, &oset);
- signum_to_process[SIGVTALRM] = 0;
- if (sig_to_process) {
- /* Process interrupts */
- /*
- * XXX pthread_run should not be set!
- * Places where it dumps core should be fixed to
- * check for the existance of pthread_run --proven
- */
- sig_handler(0);
- } else {
- machdep_sys_sigprocmask(SIG_UNBLOCK, &sig_to_block, &oset);
- /*
- * Do a wait, timeout is set to a hour unless we get an
- * intr. before the select in wich case it polls.
- */
- fd_kern_wait();
- machdep_sys_sigprocmask(SIG_BLOCK, &sig_to_block, &oset);
- /* Check for interrupts, but ignore SIGVTALR */
- signum_to_process[SIGVTALRM] = 0;
- if (sig_to_process) {
- /* Process interrupts */
- sig_handler(0);
- }
- }
- machdep_sys_sigprocmask(SIG_UNBLOCK, &sig_to_block, &oset);
- goto context_switch_reschedule;
- }
- }
-
- /* There are no threads alive. */
- pthread_run = last;
- exit(0);
-}
-
-#if !defined(HAVE_SYSCALL_SIGSUSPEND) && defined(HAVE_SYSCALL_SIGPAUSE)
-
-/* ==========================================================================
- * machdep_sys_sigsuspend()
- */
-int machdep_sys_sigsuspend(sigset_t * set)
-{
- return(machdep_sys_sigpause(* set));
-}
-
-#endif
-
-/* ==========================================================================
- * sig_handler_pause()
- *
- * Wait until a signal is sent to the process.
- */
-void sig_handler_pause()
-{
- sigset_t sig_to_block, sig_to_pause, oset;
-
- sigfillset(&sig_to_block);
- sigemptyset(&sig_to_pause);
- machdep_sys_sigprocmask(SIG_BLOCK, &sig_to_block, &oset);
-/* if (!(SIG_ANY(sig_to_process))) { */
- if (!sig_to_process) {
- machdep_sys_sigsuspend(&sig_to_pause);
- }
- machdep_sys_sigprocmask(SIG_UNBLOCK, &sig_to_block, &oset);
-}
-
-/* ==========================================================================
- * context_switch_done()
- *
- * This routine does all the things that are necessary after a context_switch()
- * calls the machdep_restore_state(). DO NOT put this in the context_switch()
- * routine because sometimes the machdep_restore_state() doesn't return
- * to context_switch() but instead ends up in machdep_thread_start() or
- * some such routine, which will need to call this routine and
- * sig_check_and_resume().
- */
-void context_switch_done()
-{
- /* sigdelset((sigset_t *)&sig_to_process, SIGVTALRM); */
- signum_to_process[SIGVTALRM] = 0;
- set_thread_timer();
-}
-
-/* ==========================================================================
- * set_thread_timer()
- *
- * Assums kernel is locked.
- */
-static void set_thread_timer()
-{
- static int last_sched_attr = SCHED_RR;
-
- switch (pthread_run->attr.schedparam_policy) {
- case SCHED_RR:
- machdep_set_thread_timer(&(pthread_run->machdep_data));
- break;
- case SCHED_FIFO:
- if (last_sched_attr != SCHED_FIFO) {
- machdep_unset_thread_timer(NULL);
- }
- break;
- case SCHED_IO:
- if ((last_sched_attr != SCHED_IO) && (!sig_count)) {
- machdep_set_thread_timer(&(pthread_run->machdep_data));
- }
- break;
- default:
- machdep_set_thread_timer(&(pthread_run->machdep_data));
- break;
- }
- last_sched_attr = pthread_run->attr.schedparam_policy;
-}
-
-/* ==========================================================================
- * sigvtalrm()
- */
-static inline void sigvtalrm()
-{
- if (sig_count) {
- sigset_t sigall, oset;
-
- sig_count = 0;
-
- /* Unblock all signals */
- sigemptyset(&sigall);
- machdep_sys_sigprocmask(SIG_SETMASK, &sigall, &oset);
- }
- context_switch();
- context_switch_done();
-}
-
-/* ==========================================================================
- * sigdefault()
- */
-static inline void sigdefault(int sig)
-{
- int ret;
-
- ret = pthread_sig_register(sig);
- if (pthread_run && (ret > pthread_run->pthread_priority)) {
- sigvtalrm();
- }
-}
-
-/* ==========================================================================
- * sig_handler_switch()
- */
-static inline void sig_handler_switch(int sig)
-{
- int ret;
-
- switch(sig) {
- case 0:
- break;
- case SIGVTALRM:
- sigvtalrm();
- break;
- case SIGALRM:
-/* sigdelset((sigset_t *)&sig_to_process, SIGALRM); */
- signum_to_process[SIGALRM] = 0;
- switch (ret = sleep_wakeup()) {
- default:
- if (pthread_run && (ret > pthread_run->pthread_priority)) {
- sigvtalrm();
- }
- case 0:
- break;
- case NOTOK:
- /* Do the registered action, no threads were sleeping */
- /* There is a timing window that gets
- * here when no threads are on the
- * sleep queue. This is a quick fix.
- * The real problem is possibly related
- * to heavy use of condition variables
- * with time outs.
- * (mevans)
- *sigdefault(sig);
- */
- break;
- }
- break;
- case SIGCHLD:
-/* sigdelset((sigset_t *)&sig_to_process, SIGCHLD); */
- signum_to_process[SIGCHLD] = 0;
- switch (ret = wait_wakeup()) {
- default:
- if (pthread_run && (ret > pthread_run->pthread_priority)) {
- sigvtalrm();
- }
- case 0:
- break;
- case NOTOK:
- /* Do the registered action, no threads were waiting */
- sigdefault(sig);
- break;
- }
- break;
-
-#ifdef SIGINFO
- case SIGINFO:
- pthread_dump_info ();
- /* Then fall through, invoking the application's
- signal handler after printing our info out.
-
- I'm not convinced that this is right, but I'm not
- 100% convinced that it is wrong, and this is how
- Chris wants it done... */
-#endif
-
- default:
- /* Do the registered action */
- if (!sigismember(uthread_sigmask, sig)) {
- /*
- * If the signal isn't masked by the last running thread and
- * the signal behavior is default or ignore then we can
- * execute it immediatly. --proven
- */
- pthread_sig_default(sig);
- }
- signum_to_process[sig] = 0;
- sigdefault(sig);
- break;
- }
-
-}
-
-/* ==========================================================================
- * sig_handler()
- *
- * Process signal that just came in, plus any pending on the signal mask.
- * All of these must be resolved.
- *
- * Assumes the kernel is locked.
- */
-static void sig_handler(int sig)
-{
- if (pthread_kernel_lock != 1) {
- PANIC();
- }
-
- if (sig) {
- sig_handler_switch(sig);
- }
-
- while (sig_to_process) {
- for (sig_to_process = 0, sig = 1; sig <= SIGMAX; sig++) {
- if (signum_to_process[sig]) {
- sig_handler_switch(sig);
- }
- }
- }
-
-
-/*
- if (SIG_ANY(sig_to_process)) {
- for (sig = 1; sig <= SIGMAX; sig++) {
- if (sigismember((sigset_t *)&sig_to_process, sig)) {
- goto sig_handler_top;
- }
- }
- }
-*/
-}
-
-/* ==========================================================================
- * sig_handler_real()
- *
- * On a multi-processor this would need to use the test and set instruction
- * otherwise the following will work.
- */
-void sig_handler_real(int sig)
-{
- /*
- * Get around systems with BROKEN signal handlers.
- *
- * Some systems will reissue SIGCHLD if the handler explicitly
- * clear the signal pending by either doing a wait() or
- * ignoring the signal.
- */
-#if defined BROKEN_SIGNALS
- if (sig == SIGCHLD) {
- sigignore(SIGCHLD);
- signal(SIGCHLD, sig_handler_real);
- }
-#endif
-
- if (pthread_kernel_lock) {
- /* sigaddset((sigset_t *)&sig_to_process, sig); */
- __fd_kern_wait_timeout.tv_sec = 0;
- signum_to_process[sig] = 1;
- sig_to_process = 1;
- return;
- }
- pthread_kernel_lock++;
-
- sig_count++;
- sig_handler(sig);
-
- /* Handle any signals the current thread might have just gotten */
- if (pthread_run && pthread_run->sigcount) {
- pthread_sig_process();
- }
- pthread_kernel_lock--;
-}
-
-/* ==========================================================================
- * sig_handler_fake()
- */
-void sig_handler_fake(int sig)
-{
- if (pthread_kernel_lock) {
- /* sigaddset((sigset_t *)&sig_to_process, sig); */
- signum_to_process[sig] = 1;
- sig_to_process = 1;
- return;
- }
- pthread_kernel_lock++;
- sig_handler(sig);
- while (!(--pthread_kernel_lock)) {
- if (sig_to_process) {
- /* if (SIG_ANY(sig_to_process)) { */
- pthread_kernel_lock++;
- sig_handler(0);
- } else {
- break;
- }
- }
-}
-
-/* ==========================================================================
- * __pthread_signal_delete(int sig)
- *
- * Assumes the kernel is locked.
- */
-void __pthread_signal_delete(int sig)
-{
- signum_to_process[sig] = 0;
-}
-
-/* ==========================================================================
- * pthread_sched_other_resume()
- *
- * Check if thread to be resumed is of higher priority and if so
- * stop current thread and start new thread.
- */
-pthread_sched_other_resume(struct pthread * pthread)
-{
- pthread->state = PS_RUNNING;
- pthread_prio_queue_enq(pthread_current_prio_queue, pthread);
-
- if (pthread->pthread_priority > pthread_run->pthread_priority) {
- if (pthread_kernel_lock == 1) {
- sig_handler(SIGVTALRM);
- }
- }
-
- __cleanup_after_resume();
-}
-
-/* ==========================================================================
- * pthread_resched_resume()
- *
- * This routine assumes that the caller is the current pthread, pthread_run
- * and that it has a lock the kernel thread and it wants to reschedule itself.
- */
-void pthread_resched_resume(enum pthread_state state)
-{
- pthread_run->state = state;
-
- /* Since we are about to block this thread, lets see if we are
- * at a cancel point and if we've been cancelled.
- * Avoid cancelling dead or unalloced threads.
- */
- if( ! TEST_PF_RUNNING_TO_CANCEL(pthread_run) &&
- TEST_PTHREAD_IS_CANCELLABLE(pthread_run) &&
- state != PS_DEAD && state != PS_UNALLOCED ) {
-
- /* Set this flag to avoid recursively calling pthread_exit */
- /* We have to set this flag here because we will unlock the
- * kernel prior to calling pthread_cancel_internal.
- */
- SET_PF_RUNNING_TO_CANCEL(pthread_run);
-
- pthread_run->old_state = state; /* unlock needs this data */
- pthread_sched_resume(); /* Unlock kernel before cancel */
- pthread_cancel_internal( 1 ); /* free locks and exit */
- }
-
- sig_handler(SIGVTALRM);
-
- __cleanup_after_resume();
-}
-
-/* ==========================================================================
- * pthread_sched_resume()
- */
-void pthread_sched_resume()
-{
- __cleanup_after_resume();
-}
-
-/*----------------------------------------------------------------------
- * Function: __cleanup_after_resume
- * Purpose: cleanup kernel locks after a resume
- * Args: void
- * Returns: void
- * Notes:
- *----------------------------------------------------------------------*/
-static void
-__cleanup_after_resume( void )
-{
- /* Only bother if we are truely unlocking the kernel */
- while (!(--pthread_kernel_lock)) {
- /* if (SIG_ANY(sig_to_process)) { */
- if (sig_to_process) {
- pthread_kernel_lock++;
- sig_handler(0);
- continue;
- }
- if (pthread_run && pthread_run->sigcount) {
- pthread_kernel_lock++;
- pthread_sig_process();
- continue;
- }
- break;
- }
-
- if( pthread_run == NULL )
- return; /* Must be during init processing */
-
- /* Test for cancel that should be handled now */
-
- if( ! TEST_PF_RUNNING_TO_CANCEL(pthread_run) &&
- TEST_PTHREAD_IS_CANCELLABLE(pthread_run) ) {
- /* Kernel is already unlocked */
- pthread_cancel_internal( 1 ); /* free locks and exit */
- }
-}
-
-/* ==========================================================================
- * pthread_sched_prevent()
- */
-void pthread_sched_prevent(void)
-{
- pthread_kernel_lock++;
-}
-
-/* ==========================================================================
- * sig_init()
- *
- * SIGVTALRM (NOT POSIX) needed for thread timeslice timeouts.
- * Since it's not POSIX I will replace it with a
- * virtual timer for threads.
- * SIGALRM (IS POSIX) so some special handling will be
- * necessary to fake SIGALRM signals
- */
-#ifndef SIGINFO
-#define SIGINFO 0
-#endif
-void sig_init(void)
-{
- static const int signum_to_initialize[] =
- { SIGCHLD, SIGALRM, SIGVTALRM, SIGINFO, 0 };
- static const int signum_to_ignore[] = { SIGKILL, SIGSTOP, 0 };
- int i, j;
-
-#if defined(HAVE_SYSCALL_SIGACTION) || defined(HAVE_SYSCALL_KSIGACTION)
- struct sigaction act;
-
- act.sa_handler = sig_handler_real;
- sigemptyset(&(act.sa_mask));
- act.sa_flags = 0;
-#endif
-
- /* Initialize the important signals */
- for (i = 0; signum_to_initialize[i]; i++) {
-
-#if defined(HAVE_SYSCALL_SIGACTION) || defined(HAVE_SYSCALL_KSIGACTION)
- if (sigaction(signum_to_initialize[i], &act, NULL)) {
-#else
- if (signal(signum_to_initialize[i], sig_handler_real)) {
-#endif
- PANIC();
- }
- }
-
- /* Initialize the rest of the signals */
- for (j = 1; j < SIGMAX; j++) {
- for (i = 0; signum_to_initialize[i]; i++) {
- if (signum_to_initialize[i] == j) {
- goto sig_next;
- }
- }
- /* Because Solaris 2.4 can't deal -- proven */
- for (i = 0; signum_to_ignore[i]; i++) {
- if (signum_to_ignore[i] == j) {
- goto sig_next;
- }
- }
- pthread_signal(j, SIG_DFL);
-
-#if defined(HAVE_SYSCALL_SIGACTION) || defined(HAVE_SYSCALL_KSIGACTION)
- sigaction(j, &act, NULL);
-#else
- signal(j, sig_handler_real);
-#endif
-
- sig_next:;
- }
-
-#if defined BROKEN_SIGNALS
- signal(SIGCHLD, sig_handler_real);
-#endif
-
-}
-
diff --git a/mit-pthreads/pthreads/sleep.c b/mit-pthreads/pthreads/sleep.c
deleted file mode 100644
index 1c13dd2eb1d..00000000000
--- a/mit-pthreads/pthreads/sleep.c
+++ /dev/null
@@ -1,367 +0,0 @@
-/* ==== sleep.c ============================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : All the appropriate sleep routines.
- *
- * 1.00 93/12/28 proven
- * -Started coding this file.
- *
- * 1.36 94/06/04 proven
- * -Use new timer structure pthread_timer, that uses seconds
- * -nano seconds. Rewrite all routines completely.
- *
- * 1.38 94/06/13 proven
- * -switch pthread_timer to timespec
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <stdio.h>
-#include <errno.h>
-#include <sys/time.h>
-#include <signal.h>
-#include <unistd.h>
-#include <sys/compat.h>
-
-struct pthread * pthread_sleep = NULL;
-
-/* ==========================================================================
- * sleep_compare_time()
- */
-/* static inline int sleep_compare_time(struct timespec * time1,
- struct timespec * time2) */
-static int sleep_compare_time(struct timespec * time1, struct timespec * time2)
-{
- if ((time1->tv_sec < time2->tv_sec) ||
- ((time1->tv_sec == time2->tv_sec) && (time1->tv_nsec < time2->tv_nsec))) {
- return(-1);
- }
- if ((time1->tv_sec == time2->tv_sec) && (time1->tv_nsec == time2->tv_nsec)){
- return(0);
- }
- return(1);
-}
-
-/* ==========================================================================
- * machdep_stop_timer()
- *
- * Returns the time left on the timer.
- */
-static struct itimerval timestop = { { 0, 0 }, { 0, 0 } };
-
-void machdep_stop_timer(struct timespec *current)
-{
- struct itimerval timenow;
-
- setitimer(ITIMER_REAL, & timestop, & timenow);
- __pthread_signal_delete(SIGALRM);
- if (current) {
- current->tv_nsec = timenow.it_value.tv_usec * 1000;
- current->tv_sec = timenow.it_value.tv_sec;
- }
-}
-
-/* ==========================================================================
- * machdep_start_timer()
- */
-int machdep_start_timer(struct timespec *current, struct timespec *wakeup)
-{
- struct itimerval timeout;
-
- timeout.it_value.tv_usec = (wakeup->tv_nsec - current->tv_nsec) / 1000;
- timeout.it_value.tv_sec = wakeup->tv_sec - current->tv_sec;
- timeout.it_interval.tv_usec = 0;
- timeout.it_interval.tv_sec = 0;
- if (timeout.it_value.tv_usec < 0) {
- timeout.it_value.tv_usec += 1000000;
- timeout.it_value.tv_sec--;
- }
-
- if (((long) timeout.it_value.tv_sec >= 0) &&
- ((timeout.it_value.tv_usec) || (timeout.it_value.tv_sec))) {
- if (setitimer(ITIMER_REAL, & timeout, NULL) < 0)
- {
- fprintf(stderr,"Got error %d from setitimer with:\n\
- wakeup: tv_sec: %ld tv_nsec: %ld\n\
- current: tv_sec: %ld tv_nsec: %ld\n\
- argument: tv_sec: %ld tv_usec: %ld\n",
- errno,
- wakeup->tv_sec, wakeup->tv_nsec,
- current->tv_sec, current->tv_nsec,
- timeout.it_value.tv_sec, timeout.it_value.tv_usec);
- PANIC();
- }
- } else {
- /*
- * There is no time on the timer.
- * This shouldn't happen,
- * but isn't fatal.
- */
- sig_handler_fake(SIGALRM);
- }
- return(OK);
-}
-
-/* ==========================================================================
- * sleep_schedule()
- *
- * Assumes that the current thread is the thread to be scheduled
- * and that the kthread is already locked.
- */
-void sleep_schedule(struct timespec *current_time, struct timespec *new_time)
-{
- struct pthread * pthread_sleep_current, * pthread_sleep_prev;
-
- /* Record the new time as the current thread's wakeup time. */
- pthread_run->wakeup_time = *new_time;
-
- /* any threads? */
- if (pthread_sleep_current = pthread_sleep) {
- if (sleep_compare_time(&(pthread_sleep_current->wakeup_time),
- new_time) <= 0) {
- /* Don't need to restart timer */
- while (pthread_sleep_current->sll) {
-
- pthread_sleep_prev = pthread_sleep_current;
- pthread_sleep_current = pthread_sleep_current->sll;
-
- if (sleep_compare_time(&(pthread_sleep_current->wakeup_time),
- new_time) > 0) {
- pthread_run->sll = pthread_sleep_current;
- pthread_sleep_prev->sll = pthread_run;
- return;
- }
- }
-
- /* No more threads in queue, attach pthread_run to end of list */
- pthread_sleep_current->sll = pthread_run;
- pthread_run->sll = NULL;
-
- } else {
- /* Start timer and enqueue thread */
- machdep_start_timer(current_time, new_time);
- pthread_run->sll = pthread_sleep_current;
- pthread_sleep = pthread_run;
- }
- } else {
- /* Start timer and enqueue thread */
- machdep_start_timer(current_time, new_time);
- pthread_sleep = pthread_run;
- pthread_run->sll = NULL;
- }
-}
-
-/* ==========================================================================
- * sleep_wakeup()
- *
- * This routine is called by the interrupt handler, which has already
- * locked the current kthread. Since all threads on this list are owned
- * by the current kthread, rescheduling won't be a problem.
- */
-int sleep_spurious_wakeup = 0;
-int sleep_wakeup()
-{
- struct pthread *pthread_sleep_next;
- struct timespec current_time;
- int ret = 0;
-
- if (pthread_sleep == NULL) {
- return(NOTOK);
- }
-
- machdep_gettimeofday(&current_time);
- if (sleep_compare_time(&(pthread_sleep->wakeup_time), &current_time) > 0) {
- machdep_start_timer(&current_time, &(pthread_sleep->wakeup_time));
- sleep_spurious_wakeup++;
- return(OK);
- }
-
- do {
- if (pthread_sleep->pthread_priority > ret) {
- ret = pthread_sleep->pthread_priority;
- }
-
- /*
- * Clean up removed thread and start it running again.
- *
- * Note: It is VERY important to remove the thread form the
- * current queue before putting it on the run queue.
- * Both queues use pthread_sleep->next, and the thread that points
- * to pthread_sleep should point to pthread_sleep->next then
- * pthread_sleep should be put on the run queue.
- */
- if ((SET_PF_DONE_EVENT(pthread_sleep)) == OK) {
- if (pthread_sleep->queue)
- pthread_queue_remove(pthread_sleep->queue, pthread_sleep);
- pthread_prio_queue_enq(pthread_current_prio_queue, pthread_sleep);
- pthread_sleep->state = PS_RUNNING;
- }
-
- pthread_sleep_next = pthread_sleep->sll;
- pthread_sleep->sll = NULL;
-
- if ((pthread_sleep = pthread_sleep_next) == NULL) {
- /* No more threads on sleep queue */
- return(ret);
- }
- } while (sleep_compare_time(&(pthread_sleep->wakeup_time), &(current_time)) <= 0);
-
- /* Start timer for next time interval */
- machdep_start_timer(&current_time, &(pthread_sleep->wakeup_time));
- return(ret);
-}
-
-
-/* ==========================================================================
- * __sleep()
- */
-void __sleep(struct timespec * time_to_sleep)
-{
- struct pthread *pthread_sleep_prev;
- struct timespec current_time, wakeup_time;
-
- pthread_sched_prevent();
-
- /* Get real time */
- machdep_gettimeofday(&current_time);
- wakeup_time.tv_sec = current_time.tv_sec + time_to_sleep->tv_sec;
- wakeup_time.tv_nsec = current_time.tv_nsec + time_to_sleep->tv_nsec;
-
- sleep_schedule(&current_time, &wakeup_time);
-
- /* Reschedule thread */
- SET_PF_WAIT_EVENT(pthread_run);
- SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- pthread_resched_resume(PS_SLEEP_WAIT);
- CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
- CLEAR_PF_DONE_EVENT(pthread_run);
-
- /* Return actual time slept */
- time_to_sleep->tv_sec = pthread_run->wakeup_time.tv_sec;
- time_to_sleep->tv_nsec = pthread_run->wakeup_time.tv_nsec;
-}
-
-/* ==========================================================================
- * pthread_nanosleep()
- */
-unsigned int pthread_nanosleep(unsigned int nseconds)
-{
- struct timespec time_to_sleep;
-
- if (nseconds) {
- time_to_sleep.tv_nsec = nseconds;
- time_to_sleep.tv_sec = 0;
- __sleep(&time_to_sleep);
- nseconds = time_to_sleep.tv_nsec;
- }
- return(nseconds);
-}
-
-/* ==========================================================================
- * usleep()
- */
-void usleep(unsigned int useconds)
-{
- struct timespec time_to_sleep;
-
- if (useconds) {
- time_to_sleep.tv_nsec = (useconds % 1000000) * 1000;
- time_to_sleep.tv_sec = useconds / 1000000;
- __sleep(&time_to_sleep);
- }
-}
-
-/* ==========================================================================
- * sleep()
- */
-unsigned int sleep(unsigned int seconds)
-{
- struct timespec time_to_sleep;
-
- if (seconds) {
- time_to_sleep.tv_sec = seconds;
- time_to_sleep.tv_nsec = 0;
- __sleep(&time_to_sleep);
- seconds = time_to_sleep.tv_sec;
- }
- return(seconds);
-}
-
-/* ==========================================================================
- * sleep_cancel()
- *
- * Cannot be called while kernel is locked.
- * Does not wake sleeping thread up, just remove it from the sleep queue.
- */
-int sleep_cancel(struct pthread * pthread)
-{
- struct timespec current_time, delta_time;
- struct pthread * pthread_last;
- int rval = NOTOK;
-
- /* Lock sleep queue, Note this may be on a different kthread queue */
- pthread_sched_prevent();
-
- if (pthread_sleep) {
- if (pthread == pthread_sleep) {
- rval = OK;
- machdep_stop_timer(&delta_time);
- if (pthread_sleep = pthread_sleep->sll) {
- current_time.tv_sec = delta_time.tv_sec;
- current_time.tv_nsec = delta_time.tv_nsec;
- current_time.tv_sec += pthread_sleep->wakeup_time.tv_sec;
- current_time.tv_nsec += pthread_sleep->wakeup_time.tv_nsec;
- while (current_time.tv_nsec > 1000000000) {
- current_time.tv_nsec -= 1000000000;
- current_time.tv_sec++;
- }
- machdep_start_timer(&(current_time),
- &(pthread_sleep->wakeup_time));
- }
- } else {
- for (pthread_last = pthread_sleep; pthread_last;
- pthread_last = pthread_last->sll) {
- if (pthread_last->sll == pthread) {
- pthread_last->sll = pthread->sll;
- rval = OK;
- break;
- }
- }
- }
- }
-
- pthread_sched_resume();
- pthread->sll = NULL;
- return(rval);
-}
diff --git a/mit-pthreads/pthreads/specific.c b/mit-pthreads/pthreads/specific.c
deleted file mode 100644
index 898f9b0cd1b..00000000000
--- a/mit-pthreads/pthreads/specific.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/* ==== specific.c =======================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Pthread thread specific data management.
- *
- * 1.20 94/03/30 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <errno.h>
-#include <pthread.h>
-#include <stdlib.h>
-#include <string.h>
-
-static struct pthread_key key_table[PTHREAD_DATAKEYS_MAX];
-static pthread_mutex_t key_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-/* ==========================================================================
- * pthread_key_create()
- */
-int pthread_key_create(pthread_key_t *key, void (*destructor)(void *))
-{
- pthread_mutex_lock(&key_mutex);
- for ((*key) = 0; (*key) < PTHREAD_DATAKEYS_MAX; (*key)++) {
- if (key_table[(*key)].count == 0) {
- key_table[(*key)].count++;
- key_table[(*key)].destructor = destructor;
- pthread_mutex_init(&(key_table[(*key)].mutex), NULL);
- pthread_mutex_unlock(&key_mutex);
- return(OK);
- }
- }
- pthread_mutex_unlock(&key_mutex);
- return(EAGAIN);
-}
-
-/* ==========================================================================
- * pthread_key_delete()
- */
-int pthread_key_delete(pthread_key_t key)
-{
- int ret;
-
- if (key < PTHREAD_DATAKEYS_MAX) {
- pthread_mutex_lock(&(key_table[key].mutex));
- switch (key_table[key].count) {
- case 1:
- pthread_mutex_destroy(&(key_table[key].mutex));
- key_table[key].destructor = NULL;
- key_table[key].count = 0;
- case 0:
- ret = OK;
- break;
- default:
- ret = EBUSY;
- }
- pthread_mutex_unlock(&(key_table[key].mutex));
- } else {
- ret = EINVAL;
- }
- return(ret);
-}
-
-/* ==========================================================================
- * pthread_cleanupspecific()
- */
-void pthread_cleanupspecific(void)
-{
- void * data;
- int key;
- int itr;
-
- pthread_mutex_lock(&key_mutex);
- for (itr = 0; itr < _POSIX_THREAD_DESTRUTOR_ITERATIONS; itr++) {
- for (key = 0; key < PTHREAD_DATAKEYS_MAX; key++) {
- if (pthread_run->specific_data_count) {
- if (pthread_run->specific_data[key]) {
- data = (void *)pthread_run->specific_data[key];
- pthread_run->specific_data[key] = NULL;
- pthread_run->specific_data_count--;
- if (key_table[key].destructor) {
- pthread_mutex_unlock(&key_mutex);
- key_table[key].destructor(data);
- pthread_mutex_lock(&key_mutex);
- }
- key_table[key].count--;
- }
- } else {
- free(pthread_run->specific_data);
- pthread_mutex_unlock(&key_mutex);
- return;
- }
- }
- }
- free(pthread_run->specific_data);
- pthread_mutex_unlock(&key_mutex);
-}
-
-static inline const void ** pthread_key_allocate_data(void)
-{
- const void ** new_data;
- if(new_data = (const void**)malloc(sizeof(void *) * PTHREAD_DATAKEYS_MAX)) {
- memset((void *)new_data, 0, sizeof(void *) * PTHREAD_DATAKEYS_MAX);
- }
- return(new_data);
-}
-
-/* ==========================================================================
- * pthread_setspecific()
- */
-int pthread_setspecific(pthread_key_t key, const void * value)
-{
- int ret;
-
- if ((pthread_run->specific_data) ||
- (pthread_run->specific_data = pthread_key_allocate_data())) {
- if ((key < PTHREAD_DATAKEYS_MAX) && (key_table)) {
- pthread_mutex_lock(&(key_table[key].mutex));
- if (key_table[key].count) {
- if (pthread_run->specific_data[key] == NULL) {
- if (value != NULL) {
- pthread_run->specific_data_count++;
- key_table[key].count++;
- }
- } else {
- if (value == NULL) {
- pthread_run->specific_data_count--;
- key_table[key].count--;
- }
- }
- pthread_run->specific_data[key] = value;
- ret = OK;
- } else {
- ret = EINVAL;
- }
- pthread_mutex_unlock(&(key_table[key].mutex));
- } else {
- ret = EINVAL;
- }
- } else {
- ret = ENOMEM;
- }
- return(ret);
-}
-
-/* ==========================================================================
- * pthread_getspecific()
- */
-void * pthread_getspecific(pthread_key_t key)
-{
- void *ret;
-
- if ((pthread_run->specific_data) && (key < PTHREAD_DATAKEYS_MAX)
- && (key_table)) {
- pthread_mutex_lock(&(key_table[key].mutex));
- if (key_table[key].count) {
- ret = (void *)pthread_run->specific_data[key];
- } else {
- ret = NULL;
- }
- pthread_mutex_unlock(&(key_table[key].mutex));
- } else {
- ret = NULL;
- }
- return(ret);
-}
diff --git a/mit-pthreads/pthreads/stat.c b/mit-pthreads/pthreads/stat.c
deleted file mode 100644
index f18b7c6bd24..00000000000
--- a/mit-pthreads/pthreads/stat.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/* ==== stat.c ============================================================
- * Copyright (c) 1995 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : All the syscalls dealing with fds.
- *
- * 1.00 93/05/27 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <errno.h>
-
-struct stat;
-struct statfs;
-
-/* ==========================================================================
- * fstat()
- *
- * Might want to indirect this.
- */
-int fstat(int fd, struct stat *buf)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
- if ((ret = machdep_sys_fstat(fd_table[fd]->fd.i, buf)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_READ);
- }
- return(ret);
-}
-
-/* ==========================================================================
- * stat()
- */
-int stat(const char * path, struct stat * buf)
-{
- int ret;
-
- if ((ret = machdep_sys_stat(path, buf)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- return(ret);
-
-}
-
-/* ==========================================================================
- * lstat()
- */
-int lstat(const char * path, struct stat * buf)
-{
- int ret;
-
- if ((ret = machdep_sys_lstat(path, buf)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- return(ret);
-
-}
-
-#ifdef HAVE_SYSCALL_FSTATFS
-/* ==========================================================================
- * fstatfs()
- *
- * Might want to indirect this.
- */
-int fstatfs(int fd, struct statfs *buf)
-{
- int ret;
-
- if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
- if ((ret = machdep_sys_fstatfs(fd_table[fd]->fd.i, buf)) < OK) {
- SET_ERRNO(-ret);
- ret = NOTOK;
- }
- fd_unlock(fd, FD_READ);
- }
- return(ret);
-}
-#endif
diff --git a/mit-pthreads/pthreads/wait.c b/mit-pthreads/pthreads/wait.c
deleted file mode 100644
index 9f0418ca8a1..00000000000
--- a/mit-pthreads/pthreads/wait.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/* ==== wait.c ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : All the appropriate wait routines.
- *
- * 1.38 94/06/13 proven
- * -Started coding this file.
- *
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include <pthread.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <pthread/posix.h>
-#include <sys/compat.h>
-#include <sys/wait.h>
-
-/* This is an UGLY hack to get wait to compile, something better is needed. */
-/* #define _POSIX_SOURCE
-#undef _POSIX_SOURCE
-*/
-
-struct pthread_queue wait_queue = { NULL, NULL, NULL };
-extern void sig_handler_real();
-
-/* ==========================================================================
- * wait_wakeup()
- *
- * This routine is called by the interrupt handler which has locked
- * the current kthread semaphore. Since only threads owned by the
- * current kthread can be queue here, no additional locks are necessary.
- */
-int wait_wakeup()
-{
- struct pthread *pthread;
- int ret = 0;
-
- if (pthread = pthread_queue_deq(& wait_queue)) {
- /* Wakeup all threads, and enqueue them on the run queue */
- do {
- pthread->state = PS_RUNNING;
- if (pthread->pthread_priority > ret) {
- ret = pthread->pthread_priority;
- }
- pthread_prio_queue_enq(pthread_current_prio_queue, pthread);
- } while (pthread = pthread_queue_deq(&wait_queue));
- return(ret);
- }
- return(NOTOK);
-}
-
-/* ==========================================================================
- * For the wait calls, it is important that the current kthread is locked
- * before the apropriate wait syscall is preformed. This way we ensure
- * that there is never a case where a thread is waiting for a child but
- * missed the interrupt for that child.
- * Patched by William S. Lear 1997-02-02
- */
-
-/* ==========================================================================
- * waitpid()
- */
-pid_t waitpid(pid_t pid, int *status, int options)
-{
- pid_t ret;
-
- pthread_sched_prevent();
- ret = machdep_sys_waitpid(pid, status, options | WNOHANG);
- /* If we are not doing nohang, try again, else return immediately */
- if (!(options & WNOHANG)) {
- while (ret == OK) {
- /* Enqueue thread on wait queue */
- pthread_queue_enq(&wait_queue, pthread_run);
-
- /* reschedule unlocks scheduler */
- SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- pthread_resched_resume(PS_WAIT_WAIT);
- CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
-
- pthread_sched_prevent();
-
- ret = machdep_sys_waitpid(pid, status, options | WNOHANG);
- }
- }
- pthread_sched_resume();
- return(ret);
-}
-
-/* ==========================================================================
- * wait3()
- * Patched by Monty 1997-02-02
- */
-pid_t wait3(__WAIT_STATUS status, int options, void * rusage)
-{
- semaphore * lock;
- pid_t ret;
-
- pthread_sched_prevent();
- ret = machdep_sys_wait3(status, options | WNOHANG, rusage);
- /* If we are not doing nohang, try again, else return immediately */
- if (!(options & WNOHANG)) {
- while (ret == OK) {
- /* Enqueue thread on wait queue */
- pthread_queue_enq(&wait_queue, pthread_run);
-
- /* reschedule unlocks scheduler */
- SET_PF_AT_CANCEL_POINT(pthread_run); /* This is a cancel point */
- pthread_resched_resume(PS_WAIT_WAIT);
- CLEAR_PF_AT_CANCEL_POINT(pthread_run); /* No longer at cancel point */
-
- pthread_sched_prevent();
-
- machdep_sys_wait3(status, options | WNOHANG, rusage);
- }
- }
- pthread_sched_resume();
- return(ret);
-}
-
-/* ==========================================================================
- * wait()
- */
-pid_t wait(__WAIT_STATUS status)
-{
- return(waitpid((pid_t)-1, (int *)status, 0));
-}
diff --git a/mit-pthreads/pthreads/wrapper.c b/mit-pthreads/pthreads/wrapper.c
deleted file mode 100644
index 6e3f4478fcf..00000000000
--- a/mit-pthreads/pthreads/wrapper.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/* ==== wrapper.c ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Wrapper functions for syscalls that only need errno redirected
- *
- * 1.4x 94/07/23 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include "config.h"
-#include <pthread.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <pthread/posix.h>
-
-/* ==========================================================================
- * link()
- */
-int link(const char * name1, const char * name2)
-{
- int ret;
-
- if ((ret = machdep_sys_link(name1, name2)) < OK) {
- SET_ERRNO(-ret);
- }
- return(ret);
-
-}
-
-/* ==========================================================================
- * unlink()
- */
-int unlink(const char * path)
-{
- int ret;
-
- if ((ret = machdep_sys_unlink(path)) < OK) {
- SET_ERRNO(-ret);
- }
- return(ret);
-
-}
-
-/* ==========================================================================
- * chdir()
- */
-int chdir(const char * path)
-{
- int ret;
-
- if ((ret = machdep_sys_chdir(path)) < OK) {
- SET_ERRNO(-ret);
- }
- return(ret);
-
-}
-
-/* ==========================================================================
- * chmod()
- */
-int chmod(const char * path, mode_t mode)
-{
- int ret;
-
- if ((ret = machdep_sys_chmod(path, mode)) < OK) {
- SET_ERRNO(-ret);
- }
- return(ret);
-
-}
-
-/* ==========================================================================
- * chown()
- */
-int chown(const char * path, uid_t owner, gid_t group)
-{
- int ret;
-
- if ((ret = machdep_sys_chown(path, owner, group)) < OK) {
- SET_ERRNO(-ret);
- }
- return(ret);
-
-}
-
-/* ==========================================================================
- * rename()
- */
-int rename(const char * name1, const char * name2)
-{
- int ret;
-
- if ((ret = machdep_sys_rename(name1, name2)) < OK) {
- SET_ERRNO(-ret);
- }
- return(ret);
-
-}
-
-
-/* ==========================================================================
- * chroot()
- */
-
-#ifdef HAVE_SYSCALL_CHROOT
-int chroot(const char * name)
-{
- int ret;
-
- if ((ret = machdep_sys_chroot(name)) < OK) {
- SET_ERRNO(-ret);
- }
- return(ret);
-
-}
-#endif
diff --git a/mit-pthreads/pthreads/writev.c b/mit-pthreads/pthreads/writev.c
deleted file mode 100644
index 9823d5ad201..00000000000
--- a/mit-pthreads/pthreads/writev.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* ==== writev.c ============================================================
- * Copyright (c) 1995 by Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Chris Provenzano.
- * 4. The name of Chris Provenzano may not be used to endorse or promote
- * products derived from this software without specific prior written
- * permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Description : Implementation of writev().
- *
- * 1.00 95/06/19 proven
- * -Started coding this file.
- */
-
-#ifndef lint
-static const char rcsid[] = "$Id$";
-#endif
-
-#include "config.h"
-
-#ifndef HAVE_SYSCALL_WRITEV
-
-#include <errno.h>
-#include <unistd.h>
-#include <sys/uio.h>
-#include <sys/types.h>
-
-/* ==========================================================================
- * machdep_sys_writev()
- *
- * modified from the GNU C Library posix/writev.c
- */
-int machdep_sys_writev(int fd, struct iovec * vector, int count)
-{
- size_t bytes, i;
- char *buffer;
- int ret;
-
- /* Find the total number of bytes to be written. */
- for (bytes = 0, i = 0; i < count; ++i)
- bytes += vector[i].iov_len;
-
- if (bytes) {
- /*
- * Allocate a temporary buffer to hold the data.
- * Don't use alloca because threads tend to have smaller stacks.
- */
- if ((buffer = (char *)malloc(bytes)) == NULL) {
- return(-ENOMEM);
- }
- /* Copy the data from memory specified by VECTOR to BUFFER */
- for (ret = 0, i = 0; i < count; ++i) {
- memcpy(buffer + ret, vector[i].iov_base, vector[i].iov_len);
- ret += vector[i].iov_len;
- }
- } else {
- buffer = NULL;
- }
-
- ret = (int)machdep_sys_write(fd, buffer, bytes);
- if (buffer)
- free(buffer);
- return(ret);
-}
-
-#endif
diff --git a/mit-pthreads/scripts/GNUmakefile.inc b/mit-pthreads/scripts/GNUmakefile.inc
deleted file mode 100755
index 6309f28ca55..00000000000
--- a/mit-pthreads/scripts/GNUmakefile.inc
+++ /dev/null
@@ -1,24 +0,0 @@
-VPATH := $(VPATH):${srcdir}/scripts
-SCRIPTS= pgcc pg++
-
-abspath := $(shell pwd)
-
-all-bin: $(SCRIPTS)
-
-pgcc: pgcc.sh
- sed -e 's!EXEC_PREFIX!$(exec_prefix)!g' \
- -e 's!BUILD_PREFIX!$(abspath)!g' \
- -e 's!SRC_PREFIX!$(srcdir)!g' \
- -e 's!COMPILER!gcc!g' \
- < $(srcdir)/scripts/pgcc.sh > pgcc.new
- chmod a+x pgcc.new
- mv -f pgcc.new pgcc
-
-pg++: pgcc.sh
- sed -e 's!EXEC_PREFIX!$(exec_prefix)!g' \
- -e 's!BUILD_PREFIX!$(abspath)!g' \
- -e 's!SRC_PREFIX!$(srcdir)!g' \
- -e 's!COMPILER!g++!g' \
- < $(srcdir)/scripts/pgcc.sh > pg++.new
- chmod a+x pg++.new
- mv -f pg++.new pg++
diff --git a/mit-pthreads/scripts/Makefile.inc b/mit-pthreads/scripts/Makefile.inc
deleted file mode 100644
index 441f6b51d29..00000000000
--- a/mit-pthreads/scripts/Makefile.inc
+++ /dev/null
@@ -1,30 +0,0 @@
-.PATH : ${srcdir}/scripts
-SCRIPTS= pgcc pg++
-
-abspath != pwd
-
-all-bin: $(SCRIPTS)
-
-#
-# Objects go in the obj directory for both BSD and GNU make but these
-# scripts get put in the obj dir for BSD and the root dir for GNU.
-#
-pgcc: pgcc.sh
- sed -e 's!EXEC_PREFIX!$(exec_prefix)!g' \
- -e 's!BUILD_PREFIX!$(.CURDIR)!g' \
- -e 's!SRC_PREFIX!$(srcdir)!g' \
- -e 's!COMPILER!gcc!g' \
- < $(srcdir)/scripts/pgcc.sh > pgcc.new
- chmod a+x pgcc.new
- mv -f pgcc.new pgcc
- ln -fs obj/pgcc ../pgcc
-
-pg++: pgcc.sh
- sed -e 's!EXEC_PREFIX!$(exec_prefix)!g' \
- -e 's!BUILD_PREFIX!$(.CURDIR)!g' \
- -e 's!SRC_PREFIX!$(srcdir)!g' \
- -e 's!COMPILER!g++!g' \
- < $(srcdir)/scripts/pgcc.sh > pg++.new
- chmod a+x pg++.new
- mv -f pg++.new pg++
- ln -fs obj/pg++ ../pg++
diff --git a/mit-pthreads/scripts/pgcc.sh b/mit-pthreads/scripts/pgcc.sh
deleted file mode 100755
index 6bd6cbeccdb..00000000000
--- a/mit-pthreads/scripts/pgcc.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-pthreads_root=EXEC_PREFIX
-build_root=BUILD_PREFIX
-src_root=SRC_PREFIX
-
-include_dir='-I$pthreads_root/include'
-lib_dir='-L$pthreads_root/lib'
-libs='-lpthread -lm -lgcc -lpthread'
-
-# Might be a good idea to also provide a way to override pthreads_root
-# so that we can use this script in the build tree, before installation.
-if arg="$1" ; then
- case $arg in
- -notinstalled)
- include_dir='-I$build_root/include -I$src_root/include'
- lib_dir='-L$build_root/obj'
- shift
- ;;
- esac
-fi
-
-for arg in "$@" ; do
- case $arg in
- -nostdinc) include_dir= ;;
- -nostdlib | -c) libs= ;;
- esac
-done
-
-# Include the -L option in any case, just in case the user provided the
-# names of some libraries we've built threaded versions of.
-eval exec COMPILER '"$@"' $include_dir $lib_dir $libs
diff --git a/mit-pthreads/stdio/GNUmakefile.inc b/mit-pthreads/stdio/GNUmakefile.inc
deleted file mode 100755
index 7cb1371661d..00000000000
--- a/mit-pthreads/stdio/GNUmakefile.inc
+++ /dev/null
@@ -1,26 +0,0 @@
-
-# from: @(#)Makefile.inc 5.7 (Berkeley) 6/27/91
-# $Id$
-
-# Thread safe stdio sources
-VPATH:= ${VPATH}:${srcdir}/stdio
-
-SRCS:= clrerr.c fclose.c fdopen.c feof.c ferror.c fflush.c fgetc.c \
- fgetline.c fgetpos.c fgets.c fileno.c findfp.c flags.c fopen.c \
- fpurge.c fputc.c fputs.c fread.c freopen.c fscanf.c \
- fseek.c fsetpos.c ftell.c funopen.c fvwrite.c fwalk.c fwrite.c \
- getc.c getchar.c gets.c getw.c makebuf.c perror.c putc.c \
- putchar.c puts.c putw.c refill.c remove.c rewind.c rget.c scanf.c \
- setbuf.c setbuffer.c setvbuf.c sscanf.c \
- stdio.c ungetc.c \
- vfscanf.c vscanf.c vsscanf.c \
- wsetup.c putc_unlocked.c putchar_unlocked.c getc_unlocked.c \
- getchar_unlocked.c strerror.c wbuf.c xprintf.c $(SRCS)
-
-# tempnam.c tmpnam.c tmpfile.c
-#
-# SRCS:= sys_errlist.c $(SRCS)
-# sys_errlist.c: make_errlist
-# (FOO=`pwd`; cd ${srcdir}/stdio/make_errlist; \
-# $(MAKE) CC=$(CC) srcdir=${srcdir} objdir=$${FOO})
-# `pwd`/make_errlist;
diff --git a/mit-pthreads/stdio/Makefile.inc b/mit-pthreads/stdio/Makefile.inc
deleted file mode 100644
index 10c598c328f..00000000000
--- a/mit-pthreads/stdio/Makefile.inc
+++ /dev/null
@@ -1,20 +0,0 @@
-
-# from: @(#)Makefile.inc 5.7 (Berkeley) 6/27/91
-# $Id$
-
-# Thread safe stdio sources
-.PATH: ${srcdir}/stdio
-
-# SRCS+= tempnam.c tmpfile.c tmpnam.c
-
-SRCS+= clrerr.c fclose.c fdopen.c feof.c ferror.c fflush.c fgetc.c \
- fgetline.c fgetpos.c fgets.c fileno.c findfp.c flags.c fopen.c \
- fpurge.c fputc.c fputs.c fread.c freopen.c fscanf.c \
- fseek.c fsetpos.c ftell.c funopen.c fvwrite.c fwalk.c fwrite.c \
- getc.c getchar.c gets.c getw.c makebuf.c perror.c putc.c \
- putchar.c puts.c putw.c refill.c remove.c rewind.c rget.c scanf.c \
- setbuf.c setbuffer.c setvbuf.c sscanf.c \
- stdio.c ungetc.c \
- vfscanf.c vscanf.c vsscanf.c \
- wsetup.c putc_unlocked.c putchar_unlocked.c getc_unlocked.c \
- getchar_unlocked.c strerror.c wbuf.c xprintf.c
diff --git a/mit-pthreads/stdio/README b/mit-pthreads/stdio/README
deleted file mode 100755
index 8e4c07909e9..00000000000
--- a/mit-pthreads/stdio/README
+++ /dev/null
@@ -1,41 +0,0 @@
-Copyright (c) 1993, 1994 Chris Provenzano. All rights reserved.
-
-This is a threadsafe stdio based on the BSD stdio written by Chris Torek.
-This product includes software developed by the Univeristy of California,
-Berkeley and its contributors.
-
-INCLUDE FILES AND PORTING
-To continue to make this package portable, some basic rules on includes
-files must be followed.
-
-pthread.h should be included first (if it is to be included).
-stdio.h should be included.
-
-INTERNAL LOCKING
-1. All functions that can be called by the user must have flockfile() at the
- begining and a funlockfile() at the end. The routine flockfile() is a
- counting mutex, The thread that owns the lock can call flockfile() as
- many times as it wants, but must call an equal number of funlockfile()
- before the lock will be released.
-2. All functions starting with __ shouldn't need addtional locking.
-3. Anything that writes the variable __sglue should lock __sfp_mutex,
- check __sfp_state, and do a condion wait if it is set.
-4. Anything that checks fp->_flag for valididity should also lock
- __sfp_mutex.
-5. Anything that reads the variable __sglue should lock __sfp_mutex, increment
- __sfp_state, and then unlock the mutex. At function return it should
- lock the mutex again decrement __sfp_state and check if zero. If so
- do a cond_signal, and unlock the mutex.
-6. The functions fopen, fdopen, and freopen are the only functions that
- will change a fp->_file
-7. fdopen and fopen both allocate the next fp by locking __sfp_mutex
- checking fp->_flags and then setting it if free.
-8. freopen tries to preserve fp->_file. It sets __sfp_mutex, then it
- tries to lock fp->_file and close it.
-9. __sinit is done with a pthread_once routine.
-
-
-
-Things to do.
-
-Fix printf so it uses the ininf function.
diff --git a/mit-pthreads/stdio/clrerr.c b/mit-pthreads/stdio/clrerr.c
deleted file mode 100644
index e809cfb8efd..00000000000
--- a/mit-pthreads/stdio/clrerr.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)clrerr.c 5.3 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-
-void clearerr(FILE *fp)
-{
- flockfile(fp);
- fp->_flags &= ~(__SERR|__SEOF);
- funlockfile(fp);
-}
diff --git a/mit-pthreads/stdio/fclose.c b/mit-pthreads/stdio/fclose.c
deleted file mode 100644
index c5db0808f6a..00000000000
--- a/mit-pthreads/stdio/fclose.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fclose.c 5.2 (Berkeley) 2/1/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "local.h"
-
-/* Do not reset the fd */
-fclose(fp)
- register FILE *fp;
-{
- register int r;
-
- if (fp->_flags) {
- flockfile(fp);
- r = fp->_flags & __SWR ? __sflush(fp) : 0;
- if (fp->_flags & __SMBF)
- free((char *)fp->_bf._base);
- if (HASUB(fp))
- FREEUB(fp);
- if (HASLB(fp))
- FREELB(fp);
- if (__sclose(fp) < 0)
- r = EOF;
-/* funlockfile(fp); Don't unlock. The close() already has. */
- fp->_file = -1;
- fp->_flags = 0; /* release this FILE for reuse, DO THIS LAST */
- return(r);
- }
- errno = EBADF;
- return(EOF);
-}
diff --git a/mit-pthreads/stdio/fdopen.c b/mit-pthreads/stdio/fdopen.c
deleted file mode 100644
index 4c006f24c7c..00000000000
--- a/mit-pthreads/stdio/fdopen.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fdopen.c 5.6 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <errno.h>
-#include "local.h"
-
-extern pthread_mutex_t __sfp_mutex;
-extern pthread_cond_t __sfp_cond;
-extern int __sfp_state;
-
-FILE *fdopen(int fd, const char *mode)
-{
- register FILE *fp;
- int flags, oflags, fdflags, tmp;
-
- if ((flags = __sflags(mode, &oflags)) == 0)
- return (NULL);
-
- /* Make sure the mode the user wants is a subset of the actual mode. */
- if ((fdflags = fcntl(fd, F_GETFL, 0)) < 0)
- return (NULL);
- tmp = fdflags & O_ACCMODE;
- if (tmp != O_RDWR && (tmp != (oflags & O_ACCMODE))) {
- errno = EINVAL;
- return (NULL);
- }
-
- __sinit ();
- pthread_mutex_lock(&__sfp_mutex);
- while (__sfp_state) {
- pthread_cond_wait(&__sfp_cond, &__sfp_mutex);
- }
-
- if (fp = __sfp()) {
- fp->_flags = flags;
-
- /*
- * If opened for appending, but underlying descriptor does not have
- * O_APPEND bit set, assert __SAPP so that __swrite() will lseek to
- * end before each write.
- */
- if ((oflags & O_APPEND) && !(fdflags & O_APPEND))
- fp->_flags |= __SAPP;
- fp->_file = fd;
-
- }
- pthread_mutex_unlock(&__sfp_mutex);
- return (fp);
-}
diff --git a/mit-pthreads/stdio/feof.c b/mit-pthreads/stdio/feof.c
deleted file mode 100644
index 10946fee581..00000000000
--- a/mit-pthreads/stdio/feof.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)feof.c 5.1 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-
-/*
- * A subroutine version of the macro feof.
- */
-#undef feof
-
-feof(fp)
- FILE *fp;
-{
- return (__sfeof(fp));
-}
diff --git a/mit-pthreads/stdio/ferror.c b/mit-pthreads/stdio/ferror.c
deleted file mode 100644
index b80ddab037e..00000000000
--- a/mit-pthreads/stdio/ferror.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)ferror.c 5.1 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-
-/*
- * A subroutine version of the macro ferror.
- */
-#undef ferror
-
-ferror(fp)
- FILE *fp;
-{
- return (__sferror(fp));
-}
diff --git a/mit-pthreads/stdio/fflush.c b/mit-pthreads/stdio/fflush.c
deleted file mode 100644
index 766691045b5..00000000000
--- a/mit-pthreads/stdio/fflush.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fflush.c 5.1 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <errno.h>
-#include <stdio.h>
-#include "local.h"
-
-/* Flush a single file, or (if fp is NULL) all files. */
-fflush(fp)
- register FILE *fp;
-{
- int retval;
-
- if (fp == NULL)
- return (__swalk_sflush());
- flockfile(fp);
-
- if ((fp->_flags & (__SWR | __SRW)) == 0) {
- errno = EBADF;
- retval = EOF;
- } else {
- retval = __sflush(fp);
- }
- funlockfile(fp);
- return(retval);
-}
-
-__sflush(fp)
- register FILE *fp;
-{
- register unsigned char *p;
- register int n, t;
-
- t = fp->_flags;
- if ((t & __SWR) == 0)
- return (0);
-
- if ((p = fp->_bf._base) == NULL)
- return (0);
-
- n = fp->_p - p; /* write this much */
-
- /*
- * Set these immediately to avoid problems with longjmp and to allow
- * exchange buffering (via setvbuf) in user write function.
- */
- fp->_p = p;
- fp->_w = t & (__SLBF|__SNBF) ? 0 : fp->_bf._size;
-
- for (; n > 0; n -= t, p += t) {
- t = __swrite(fp, (char *)p, n);
- if (t <= 0) {
- fp->_flags |= __SERR;
- return (EOF);
- }
- }
- return (0);
-}
diff --git a/mit-pthreads/stdio/fgetc.c b/mit-pthreads/stdio/fgetc.c
deleted file mode 100644
index c5eb2ee5986..00000000000
--- a/mit-pthreads/stdio/fgetc.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fgetc.c 5.3 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-
-fgetc(fp)
- FILE *fp;
-{
- int ret;
-
- flockfile(fp);
- ret = __sgetc(fp);
- funlockfile(fp);
- return(ret);
-}
-
-int __getc(FILE *_p)
-{
- int ret;
- flockfile(_p);
- ret = __sgetc(_p);
- funlockfile(_p);
- return(ret);
-}
-
diff --git a/mit-pthreads/stdio/fgetline.c b/mit-pthreads/stdio/fgetline.c
deleted file mode 100644
index 219660612f1..00000000000
--- a/mit-pthreads/stdio/fgetline.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fgetline.c 5.2 (Berkeley) 5/4/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "local.h"
-
-/*
- * Expand the line buffer. Return -1 on error.
- * The `new size' does not account for a terminating '\0',
- * so we add 1 here.
- */
-__slbexpand(fp, newsize)
- FILE *fp;
- size_t newsize;
-{
- void *p;
-
- if (fp->_lb._size >= ++newsize)
- return (0);
- if ((p = realloc(fp->_lb._base, newsize)) == NULL)
- return (-1);
- fp->_lb._base = p;
- fp->_lb._size = newsize;
- return (0);
-}
-
-/*
- * Get an input line. The returned pointer often (but not always)
- * points into a stdio buffer. Fgetline smashes the newline (if any)
- * in the stdio buffer; callers must not use it on streams that
- * have `magic' setvbuf() games happening.
- */
-char *
-fgetline(fp, lenp)
- register FILE *fp;
- size_t *lenp;
-{
- register unsigned char *p;
- register size_t len;
- size_t off;
-
- flockfile(fp);
-
- /* make sure there is input */
- if (fp->_r <= 0 && __srefill(fp)) {
- if (lenp != NULL)
- *lenp = 0;
- funlockfile(fp);
- return (NULL);
- }
-
- /* look for a newline in the input */
- if ((p = memchr((void *)fp->_p, '\n', fp->_r)) != NULL) {
- register char *ret;
-
- /*
- * Found one. Flag buffer as modified to keep
- * fseek from `optimising' a backward seek, since
- * the newline is about to be trashed. (We should
- * be able to get away with doing this only if
- * p is not pointing into an ungetc buffer, since
- * fseek discards ungetc data, but this is the
- * usual case anyway.)
- */
- ret = (char *)fp->_p;
- len = p - fp->_p;
- fp->_flags |= __SMOD;
- *p = 0;
- fp->_r -= len + 1;
- fp->_p = p + 1;
- if (lenp != NULL)
- *lenp = len;
- funlockfile(fp);
- return (ret);
- }
-
- /*
- * We have to copy the current buffered data to the line buffer.
- *
- * OPTIMISTIC is length that we (optimistically)
- * expect will accomodate the `rest' of the string,
- * on each trip through the loop below.
- */
-#define OPTIMISTIC 80
-
- for (len = fp->_r, off = 0;; len += fp->_r) {
- register size_t diff;
-
- /*
- * Make sure there is room for more bytes.
- * Copy data from file buffer to line buffer,
- * refill file and look for newline. The
- * loop stops only when we find a newline.
- */
- if (__slbexpand(fp, len + OPTIMISTIC))
- goto error;
- (void) memcpy((void *)(fp->_lb._base + off), (void *)fp->_p,
- len - off);
- off = len;
- if (__srefill(fp))
- break; /* EOF or error: return partial line */
- if ((p = memchr((void *)fp->_p, '\n', fp->_r)) == NULL)
- continue;
-
- /* got it: finish up the line (like code above) */
- fp->_flags |= __SMOD; /* soon */
- diff = p - fp->_p;
- len += diff;
- if (__slbexpand(fp, len))
- goto error;
- (void) memcpy((void *)(fp->_lb._base + off), (void *)fp->_p, diff);
- fp->_r -= diff + 1;
- fp->_p = p + 1;
- break;
- }
- if (lenp != NULL)
- *lenp = len;
- fp->_lb._base[len] = 0;
-
- funlockfile(fp);
- return ((char *)fp->_lb._base);
-
-error:
- if (lenp != NULL)
- *lenp = 0; /* ??? */
- funlockfile(fp);
- return (NULL); /* ??? */
-}
diff --git a/mit-pthreads/stdio/fgetpos.c b/mit-pthreads/stdio/fgetpos.c
deleted file mode 100644
index c81b48e3cc8..00000000000
--- a/mit-pthreads/stdio/fgetpos.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fgetpos.c 5.1 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <unistd.h>
-#include <stdio.h>
-#include "local.h"
-
-fgetpos(fp, pos)
- FILE *fp;
- fpos_t *pos;
-{
- flockfile(fp);
-
- /*
- * Find offset of underlying I/O object, then
- * adjust for buffered bytes.
- */
- if (fp->_flags & __SOFF) {
- *pos = fp->_offset;
- } else {
- *pos = __sseek(fp, (off_t)0, SEEK_CUR);
- }
-
- if (*pos != (fpos_t)-1) {
- if (fp->_flags & __SRD) {
- /*
- * Reading. Any unread characters (including
- * those from ungetc) cause the position to be
- * smaller than that in the underlying object.
- */
- *pos -= fp->_r;
- if (HASUB(fp))
- *pos -= fp->_ur;
- } else if (fp->_flags & __SWR && fp->_p != NULL) {
- /*
- * Writing. Any buffered characters cause the
- * position to be greater than that in the
- * underlying object.
- */
- *pos += fp->_p - fp->_bf._base;
- }
- }
- funlockfile(fp);
- return ((*pos) == (fpos_t)-1);
-}
diff --git a/mit-pthreads/stdio/fgets.c b/mit-pthreads/stdio/fgets.c
deleted file mode 100644
index 5ee5c4d6608..00000000000
--- a/mit-pthreads/stdio/fgets.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fgets.c 5.4 (Berkeley) 5/4/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/*
- * Read at most n-1 characters from the given file.
- * Stop when a newline has been read, or the count runs out.
- * Return first argument, or NULL if no characters were read.
- */
-char *
-fgets(buf, n, fp)
- char *buf;
- register size_t n;
- register FILE *fp;
-{
- register size_t len;
- register char *s;
- register unsigned char *p, *t;
-
- if (n < 2) /* sanity check */
- return (NULL);
-
- flockfile(fp);
- s = buf;
- n--; /* leave space for NUL */
- do {
- /*
- * If the buffer is empty, refill it.
- */
- if ((len = fp->_r) <= 0) {
- if (__srefill(fp)) {
- /* EOF/error: stop with partial or no line */
- if (s == buf)
- buf = NULL;
- break;
- }
- len = fp->_r;
- }
- p = fp->_p;
-
- /*
- * Scan through at most n bytes of the current buffer,
- * looking for '\n'. If found, copy up to and including
- * newline, and stop. Otherwise, copy entire chunk
- * and loop.
- */
- if (len > n)
- len = n;
- t = memchr((void *)p, '\n', len);
- if (t != NULL) {
- len = ++t - p;
- fp->_r -= len;
- fp->_p = t;
- (void) memcpy((void *)s, (void *)p, len);
- s += len;
- break;
- }
- fp->_r -= len;
- fp->_p += len;
- (void) memcpy((void *)s, (void *)p, len);
- s += len;
- } while ((n -= len) != 0);
-
- *s = 0;
- funlockfile(fp);
- return (buf);
-}
diff --git a/mit-pthreads/stdio/fileno.c b/mit-pthreads/stdio/fileno.c
deleted file mode 100644
index 475bd509993..00000000000
--- a/mit-pthreads/stdio/fileno.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fileno.c 5.1 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-
-/*
- * A subroutine version of the macro fileno.
- */
-#undef fileno
-
-fileno(fp)
- FILE *fp;
-{
- return (__sfileno(fp));
-}
diff --git a/mit-pthreads/stdio/findfp.c b/mit-pthreads/stdio/findfp.c
deleted file mode 100644
index 35817eb6a5f..00000000000
--- a/mit-pthreads/stdio/findfp.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)findfp.c 5.10 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include "local.h"
-#include "glue.h"
-
-
-#define NSTATIC 20 /* stdin + stdout + stderr + the usual */
-#define NDYNAMIC 10 /* add ten more whenever necessary */
-
-#define std(flags, file) \
- {0,0,0,flags,file,{0},0 }
-/* p r w flags file _bf z */
-
-static FILE usual[NSTATIC - 3]; /* the usual */
-static struct glue uglue = { 0, NSTATIC - 3, usual };
-
-FILE __sF[3] = {
- std(__SRD, 0), /* stdin */
- std(__SWR, 1), /* stdout */
- std(__SWR|__SNBF, 2) /* stderr */
-};
-struct glue __sglue = { &uglue, 3, __sF };
-FILE *__iob = __sF;
-FILE *_iob = __sF;
-
-pthread_mutex_t __sfp_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_cond_t __sfp_cond = PTHREAD_COND_INITIALIZER;
-/*
- * __sfp_state = 0, when free, > 0 when in _fwalk
- * This allows multiple readers in _fwalk, but only one writer __sfp,
- * or freopen() at a time.
- */
-int __sfp_state = 0;
-
-static struct glue *moreglue(register int n)
-{
- register struct glue *g;
- register FILE *p;
- static FILE empty;
-
- g = (struct glue *)malloc(sizeof(struct glue) + n * sizeof(FILE));
- if (g == NULL)
- return (NULL);
- p = (FILE *)(g + 1);
- g->next = NULL;
- g->niobs = n;
- g->iobs = p;
- while (--n >= 0)
- *p++ = empty;
- return (g);
-}
-
-/*
- * Find a free FILE for fopen et al.
- */
-FILE *__sfp()
-{
- register FILE *fp;
- register int n;
- register struct glue *g;
-
- for (g = &__sglue;; g = g->next) {
- for (fp = g->iobs, n = g->niobs; --n >= 0; fp++)
- if (fp->_flags == 0) {
- fp->_flags = 1; /* reserve this slot; caller sets real flags */
- fp->_p = NULL; /* no current pointer */
- fp->_w = 0; /* nothing to read or write */
- fp->_r = 0;
- fp->_bf._base = NULL; /* no buffer */
- fp->_bf._size = 0;
- fp->_lbfsize = 0; /* not line buffered */
- fp->_file = -1; /* no file */
- fp->_ub._base = NULL; /* no ungetc buffer */
- fp->_ub._size = 0;
- fp->_lb._base = NULL; /* no line buffer */
- fp->_lb._size = 0;
- goto __sfp_done;
- }
- if (g->next == NULL && (g->next = moreglue(NDYNAMIC)) == NULL) {
- fp = NULL;
- break;
- }
- }
-__sfp_done:;
- return (fp);
-}
-
-/*
- * exit() calls _cleanup() through *__cleanup, set whenever we
- * open or buffer a file. This chicanery is done so that programs
- * that do not use stdio need not link it all in.
- *
- * The name `_cleanup' is, alas, fairly well known outside stdio.
- */
-void _cleanup()
-{
- (void) __swalk_sflush();
-}
-
-/*
- * __sinit() is called whenever stdio's internal variables must be set up.
- * Do the pthread_once stuff here to keep pthread_once_t out of the
- * header files. No reason sprintf.c &c should need to include pthread.h...
- */
-static void __s_real_init ()
-{
- /* make sure we clean up on exit */
- __cleanup = _cleanup;
-}
-
-static pthread_once_t sdidinit = PTHREAD_ONCE_INIT;
-
-void __sinit ()
-{
- pthread_once (&sdidinit, __s_real_init);
-}
diff --git a/mit-pthreads/stdio/flags.c b/mit-pthreads/stdio/flags.c
deleted file mode 100644
index c0971003312..00000000000
--- a/mit-pthreads/stdio/flags.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)flags.c 5.1 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-
-/*
- * Return the (stdio) flags for a given mode. Store the flags
- * to be passed to an open() syscall through *optr.
- * Return 0 on error.
- */
-__sflags(mode, optr)
- register char *mode;
- int *optr;
-{
- register int ret, m, o;
-
- switch (*mode++) {
-
- case 'r': /* open for reading */
- ret = __SRD;
- m = O_RDONLY;
- o = 0;
- break;
-
- case 'w': /* open for writing */
- ret = __SWR;
- m = O_WRONLY;
- o = O_CREAT | O_TRUNC;
- break;
-
- case 'a': /* open for appending */
- ret = __SWR;
- m = O_WRONLY;
- o = O_CREAT | O_APPEND;
- break;
-
- default: /* illegal mode */
- errno = EINVAL;
- return (0);
- }
-
- /* [rwa]\+ or [rwa]b\+ means read and write */
- if (*mode == '+' || (*mode == 'b' && mode[1] == '+')) {
- ret = __SRW;
- m = O_RDWR;
- }
- *optr = m | o;
- return (ret);
-}
diff --git a/mit-pthreads/stdio/floatio.h b/mit-pthreads/stdio/floatio.h
deleted file mode 100644
index cf3821488ae..00000000000
--- a/mit-pthreads/stdio/floatio.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)floatio.h 5.1 (Berkeley) 1/20/91
- * $Id$
- */
-
-/*
- * Floating point scanf/printf (input/output) definitions.
- */
-
-/* 11-bit exponent (VAX G floating point) is 308 decimal digits */
-#define MAXEXP 308
-/* 128 bit fraction takes up 39 decimal digits; max reasonable precision */
-#define MAXFRACT 39
diff --git a/mit-pthreads/stdio/fopen.c b/mit-pthreads/stdio/fopen.c
deleted file mode 100644
index d44c17b633f..00000000000
--- a/mit-pthreads/stdio/fopen.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fopen.c 5.5 (Berkeley) 2/5/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <errno.h>
-#include "local.h"
-
-extern pthread_mutex_t __sfp_mutex;
-extern pthread_cond_t __sfp_cond;
-extern int __sfp_state;
-
-FILE *fopen(const char *file, const char *mode)
-{
- register FILE *fp;
- register int f;
- int flags, oflags;
-
- if ((flags = __sflags(mode, &oflags)) == 0)
- return (NULL);
- if ((f = open(file, oflags, 0666)) < 0) {
- return (NULL);
- }
-
- __sinit ();
- pthread_mutex_lock(&__sfp_mutex);
- while (__sfp_state) {
- pthread_cond_wait(&__sfp_cond, &__sfp_mutex);
- }
-
- if (fp = __sfp()) {
- fp->_file = f;
- fp->_flags = flags;
-
- /*
- * When opening in append mode, even though we use O_APPEND,
- * we need to seek to the end so that ftell() gets the right
- * answer. If the user then alters the seek pointer, or
- * the file extends, this will fail, but there is not much
- * we can do about this. (We could set __SAPP and check in
- * fseek and ftell.)
- */
- if (oflags & O_APPEND)
- (void) __sseek((void *)fp, (off_t)0, SEEK_END);
- }
- pthread_mutex_unlock(&__sfp_mutex);
- return (fp);
-}
diff --git a/mit-pthreads/stdio/fprintf.c b/mit-pthreads/stdio/fprintf.c
deleted file mode 100644
index bdeb49c054d..00000000000
--- a/mit-pthreads/stdio/fprintf.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fprintf.c 5.6 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#if __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#if __STDC__
-fprintf(FILE *fp, const char *fmt, ...)
-#else
-fprintf(fp, fmt, va_alist)
- FILE *fp;
- char *fmt;
- va_dcl
-#endif
-{
- int ret;
- va_list ap;
-
-#if __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
- ret = vfprintf(fp, fmt, ap);
- va_end(ap);
- return (ret);
-}
diff --git a/mit-pthreads/stdio/fpurge.c b/mit-pthreads/stdio/fpurge.c
deleted file mode 100644
index 7edbb0b30cd..00000000000
--- a/mit-pthreads/stdio/fpurge.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fpurge.c 5.2 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "local.h"
-
-/*
- * fpurge: like fflush, but without writing anything: leave the
- * given FILE's buffer empty.
- */
-int
-fpurge(fp)
- register FILE *fp;
-{
- int ret;
-
- flockfile(fp);
- if (fp->_flags) {
- if (HASUB(fp))
- FREEUB(fp);
- fp->_p = fp->_bf._base;
- fp->_r = 0;
- fp->_w = fp->_flags & (__SLBF|__SNBF) ? 0 : fp->_bf._size;
- ret = 0;
- } else {
- errno = EBADF;
- ret = EOF;
- }
- funlockfile(fp);
- return (ret);
-}
diff --git a/mit-pthreads/stdio/fputc.c b/mit-pthreads/stdio/fputc.c
deleted file mode 100644
index e6dd752f81b..00000000000
--- a/mit-pthreads/stdio/fputc.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fputc.c 5.3 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-
-fputc(c, fp)
- int c;
- register FILE *fp;
-{
- int ret;
- flockfile(fp);
- ret = __sputc(c, fp);
- funlockfile(fp);
- return(ret);
-}
-
-int __putc(int _c, FILE *_p)
-{
- int ret;
- flockfile(_p);
- ret = __sputc(_c, _p);
- funlockfile(_p);
- return(ret);
-}
-
-int __sputc(int _c, FILE *_p)
-{
- if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
- return (*_p->_p++ = _c);
- else
- return (__swbuf(_c, _p));
-}
-
diff --git a/mit-pthreads/stdio/fputs.c b/mit-pthreads/stdio/fputs.c
deleted file mode 100644
index 882b828409e..00000000000
--- a/mit-pthreads/stdio/fputs.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fputs.c 5.6 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <string.h>
-#include "fvwrite.h"
-
-/*
- * Write the given string to the given file.
- */
-fputs(s, fp)
- const char *s;
- FILE *fp;
-{
- struct __suio uio;
- struct __siov iov;
- int ret;
-
- iov.iov_base = (void *)s;
- iov.iov_len = uio.uio_resid = strlen(s);
- uio.uio_iov = &iov;
- uio.uio_iovcnt = 1;
- flockfile(fp);
- ret = __sfvwrite(fp, &uio);
- funlockfile(fp);
- return(ret);
-}
diff --git a/mit-pthreads/stdio/fread.c b/mit-pthreads/stdio/fread.c
deleted file mode 100644
index 0d8ec6186c7..00000000000
--- a/mit-pthreads/stdio/fread.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fread.c 5.4 (Berkeley) 5/4/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <string.h>
-
-size_t
-fread(buf, size, count, fp)
- void *buf;
- size_t size, count;
- register FILE *fp;
-{
- register size_t resid;
- register char *p;
- register int r;
- size_t total;
-
- if ((resid = count * size) == 0)
- return (count);
-
- flockfile(fp);
- if (fp->_r < 0)
- fp->_r = 0;
- total = resid;
- p = buf;
- while (resid > (r = fp->_r)) {
- (void) memcpy((void *)p, (void *)fp->_p, (size_t)r);
- fp->_p += r;
- /* fp->_r = 0 ... done in __srefill */
- p += r;
- resid -= r;
- if (__srefill(fp)) {
- /* no more input: return partial result */
- count = (total - resid) / size;
- goto done_fread;
- }
- }
- (void) memcpy((void *)p, (void *)fp->_p, resid);
- fp->_r -= resid;
- fp->_p += resid;
-done_fread:;
- funlockfile(fp);
- return (count);
-}
diff --git a/mit-pthreads/stdio/freopen.c b/mit-pthreads/stdio/freopen.c
deleted file mode 100644
index f45571c8ea0..00000000000
--- a/mit-pthreads/stdio/freopen.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)freopen.c 5.6 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "local.h"
-
-extern pthread_mutex_t __sfp_mutex;
-extern pthread_cond_t __sfp_cond;
-extern int __sfp_state;
-
-/*
- * Re-direct an existing, open (probably) file to some other file.
- * ANSI is written such that the original file gets closed if at
- * all possible, no matter what.
- */
-FILE *
-freopen(file, mode, fp)
- const char *file, *mode;
- register FILE *fp;
-{
- int f, flags, oflags;
- FILE *ret;
-
- if ((flags = __sflags(mode, &oflags)) == 0) {
- (void) fclose(fp);
- return (NULL);
- }
-
- __sinit ();
-
- /*
- * There are actually programs that depend on being able to "freopen"
- * descriptors that weren't originally open. Keep this from breaking.
- * Remember whether the stream was open to begin with, and which file
- * descriptor (if any) was associated with it. If it was attached to
- * a descriptor, defer closing it; freopen("/dev/stdin", "r", stdin)
- * should work. This is unnecessary if it was not a Unix file.
- */
- /* while lock __sfp_mutex, to block out fopen, and other freopen calls */
- while (pthread_mutex_lock(&__sfp_mutex) == OK) {
- if (ftrylockfile(fp) == OK) {
- if (fp->_flags) {
- /* flush the stream; ANSI doesn't require this. */
- if (fp->_flags & __SWR)
- (void) __sflush(fp);
- __sclose(fp);
- /*
- * Finish closing fp. We cannot keep fp->_base:
- * it may be the wrong size. This loses the effect
- * of any setbuffer calls, but stdio has always done
- * this before.
- * NOTE: We do this even if __ftrylockfilr failed with
- * an error to avoid memory leaks.
- */
- if (fp->_flags & __SMBF)
- free((char *)fp->_bf._base);
- fp->_w = 0;
- fp->_r = 0;
- fp->_p = NULL;
- fp->_bf._base = NULL;
- fp->_bf._size = 0;
- fp->_lbfsize = 0;
- if (HASUB(fp))
- FREEUB(fp);
- fp->_ub._size = 0;
- if (HASLB(fp))
- FREELB(fp);
- fp->_lb._size = 0;
- }
- /* Get a new descriptor to refer to the new file. */
- if ((f = open(file, oflags, 0666)) < OK)
- ret = NULL;
- /*
- * If reopening something that was open before on a real file, try
- * to maintain the descriptor. Various C library routines (perror)
- * assume stderr is always fd STDERR_FILENO, even if being
- * freopen'd.
- */
- /* Testing f == fp->_file may no longer be necessary */
- if (fp->_file >= 0 && f != fp->_file) {
- if (dup2(f, fp->_file) >= OK) {
- (void)close(f);
- f = fp->_file;
- }
- }
- fp->_flags = flags;
- fp->_file = f;
- ret = fp;
- } else {
- /* unlock __sfp_mutex, and try again later */
- pthread_mutex_unlock(&__sfp_mutex);
- pthread_yield();
- continue;
- }
- /* @@ Yo, Chris! Between the "break" and "continue" statements
- above, the program will never get here. What gives? */
- pthread_mutex_unlock(&__sfp_mutex);
- funlockfile(fp);
- return(ret);
- }
- (void)fclose(fp);
- return(NULL);
-}
diff --git a/mit-pthreads/stdio/fscanf.c b/mit-pthreads/stdio/fscanf.c
deleted file mode 100644
index 8fbbac5d102..00000000000
--- a/mit-pthreads/stdio/fscanf.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fscanf.c 5.1 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#if __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#if __STDC__
-fscanf(FILE *fp, char const *fmt, ...) {
- int r;
- va_list ap;
-
- va_start(ap, fmt);
-#else
-fscanf(fp, fmt, va_alist)
- FILE *fp;
- char *fmt;
- va_dcl
-{
- int r;
- va_list ap;
-
- va_start(ap);
-#endif
- flockfile(fp);
- r = __svfscanf(fp, fmt, ap);
- funlockfile(fp);
- va_end(ap);
- return(r);
-}
diff --git a/mit-pthreads/stdio/fseek.c b/mit-pthreads/stdio/fseek.c
deleted file mode 100644
index 5c7feda638f..00000000000
--- a/mit-pthreads/stdio/fseek.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fseek.c 5.7 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include "local.h"
-
-#define POS_ERR (-(fpos_t)1)
-
-/*
- * Seek the given file to the given offset.
- * `Whence' must be one of the three SEEK_* macros.
- */
-fseek(fp, offset, whence)
- register FILE *fp;
- long offset;
- int whence;
-{
-#if __STDC__
- register fpos_t (*seekfn)(void *, fpos_t, int);
-#else
- register fpos_t (*seekfn)();
-#endif
- fpos_t target, curoff;
- size_t n;
- struct stat st;
- int havepos;
-
- /* make sure stdio is set up */
- __sinit ();
-
- flockfile(fp);
-
- /*
- * Change any SEEK_CUR to SEEK_SET, and check `whence' argument.
- * After this, whence is either SEEK_SET or SEEK_END.
- */
- switch (whence) {
- case SEEK_CUR:
- /*
- * In order to seek relative to the current stream offset,
- * we have to first find the current stream offset a la
- * ftell (see ftell for details).
- */
- if (fp->_flags & __SOFF)
- curoff = fp->_offset;
- else {
- curoff = __sseek(fp, (off_t)0, SEEK_CUR);
- if (curoff == -1L) {
- funlockfile(fp);
- return (EOF);
- }
- }
- if (fp->_flags & __SRD) {
- curoff -= fp->_r;
- if (HASUB(fp))
- curoff -= fp->_ur;
- } else if (fp->_flags & __SWR && fp->_p != NULL)
- curoff += fp->_p - fp->_bf._base;
-
- offset += curoff;
- whence = SEEK_SET;
- havepos = 1;
- break;
-
- case SEEK_SET:
- case SEEK_END:
- curoff = 0; /* XXX just to keep gcc quiet */
- havepos = 0;
- break;
-
- default:
- errno = EINVAL;
- funlockfile(fp);
- return (EOF);
- }
-
- /*
- * Can only optimise if:
- * reading (and not reading-and-writing);
- * not unbuffered; and
- * this is a `regular' Unix file (and hence seekfn==__sseek).
- * We must check __NBF first, because it is possible to have __NBF
- * and __SOPT both set.
- */
- if (fp->_bf._base == NULL)
- __smakebuf(fp);
- if (fp->_flags & (__SWR | __SRW | __SNBF | __SNPT))
- goto dumb;
- if ((fp->_flags & __SOPT) == 0) {
- if (fp->_file < 0 || fstat(fp->_file, &st) ||
- (st.st_mode & S_IFMT) != S_IFREG) {
- fp->_flags |= __SNPT;
- goto dumb;
- }
- fp->_blksize = st.st_blksize;
- fp->_flags |= __SOPT;
- }
-
- /*
- * We are reading; we can try to optimise.
- * Figure out where we are going and where we are now.
- */
- if (whence == SEEK_SET)
- target = offset;
- else {
- if (fstat(fp->_file, &st))
- goto dumb;
- target = st.st_size + offset;
- }
-
- if (!havepos) {
- if (fp->_flags & __SOFF)
- curoff = fp->_offset;
- else {
- curoff = __sseek(fp, (off_t)0, SEEK_CUR);
- if (curoff == POS_ERR)
- goto dumb;
- }
- curoff -= fp->_r;
- if (HASUB(fp))
- curoff -= fp->_ur;
- }
-
- /*
- * Compute the number of bytes in the input buffer (pretending
- * that any ungetc() input has been discarded). Adjust current
- * offset backwards by this count so that it represents the
- * file offset for the first byte in the current input buffer.
- */
- if (HASUB(fp)) {
- n = fp->_up - fp->_bf._base;
- curoff -= n;
- n += fp->_ur;
- } else {
- n = fp->_p - fp->_bf._base;
- curoff -= n;
- n += fp->_r;
- }
-
- /*
- * If the target offset is within the current buffer,
- * simply adjust the pointers, clear EOF, undo ungetc(),
- * and return. (If the buffer was modified, we have to
- * skip this; see fgetline.c.)
- */
- if ((fp->_flags & __SMOD) == 0 &&
- target >= curoff && target < curoff + n) {
- register int o = target - curoff;
-
- fp->_p = fp->_bf._base + o;
- fp->_r = n - o;
- if (HASUB(fp))
- FREEUB(fp);
- fp->_flags &= ~__SEOF;
- funlockfile(fp);
- return (0);
- }
-
- /*
- * The place we want to get to is not within the current buffer,
- * but we can still be kind to the kernel copyout mechanism.
- * By aligning the file offset to a block boundary, we can let
- * the kernel use the VM hardware to map pages instead of
- * copying bytes laboriously. Using a block boundary also
- * ensures that we only read one block, rather than two.
- */
- curoff = target & ~(fp->_blksize - 1);
- if (__sseek(fp, (off_t)curoff, SEEK_SET) != POS_ERR) {
- fp->_r = 0;
- fp->_p = fp->_bf._base;
- if (HASUB(fp))
- FREEUB(fp);
- fp->_flags &= ~__SEOF;
- n = target - curoff;
- if (n) {
- if (__srefill(fp) || fp->_r < n)
- goto dumb;
- fp->_p += n;
- fp->_r -= n;
- }
- funlockfile(fp);
- return (0);
- }
-
- /*
- * We get here if we cannot optimise the seek ... just
- * do it. Allow the seek function to change fp->_bf._base.
- */
-dumb:
- if (__sflush(fp) || __sseek(fp, (off_t)offset, whence) == POS_ERR) {
- funlockfile(fp);
- return (EOF);
- }
- /* success: clear EOF indicator and discard ungetc() data */
- if (HASUB(fp))
- FREEUB(fp);
- fp->_p = fp->_bf._base;
- fp->_r = 0;
- /* fp->_w = 0; */ /* unnecessary (I think...) */
- fp->_flags &= ~__SEOF;
- funlockfile(fp);
- return (0);
-}
diff --git a/mit-pthreads/stdio/fsetpos.c b/mit-pthreads/stdio/fsetpos.c
deleted file mode 100644
index a421d405f51..00000000000
--- a/mit-pthreads/stdio/fsetpos.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fsetpos.c 5.2 (Berkeley) 2/5/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-
-/*
- * fsetpos: like fseek.
- * Don't bother locking, fseek does it.
- */
-fsetpos(iop, pos)
- FILE *iop;
- const fpos_t *pos;
-{
- return (fseek(iop, (long)*pos, SEEK_SET));
-}
diff --git a/mit-pthreads/stdio/ftell.c b/mit-pthreads/stdio/ftell.c
deleted file mode 100644
index e5961fa50b6..00000000000
--- a/mit-pthreads/stdio/ftell.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)ftell.c 5.4 (Berkeley) 2/5/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <errno.h>
-#include "local.h"
-
-/*
- * ftell: return current offset.
- */
-long
-ftell(fp)
- register const FILE *fp;
-{
- long pos;
-
- flockfile((FILE *)fp);
-
- /*
- * Find offset of underlying I/O object, then
- * adjust for buffered bytes.
- */
- if (fp->_flags & __SOFF) {
- pos = fp->_offset;
- } else {
- pos = (long)__sseek((FILE *)fp, (off_t)0, SEEK_CUR);
- }
-
- if (pos != -1L) {
- if (fp->_flags & __SRD) {
- /*
- * Reading. Any unread characters (including
- * those from ungetc) cause the position to be
- * smaller than that in the underlying object.
- */
- pos -= fp->_r;
- if (HASUB(fp))
- pos -= fp->_ur;
- } else if (fp->_flags & __SWR && fp->_p != NULL) {
- /*
- * Writing. Any buffered characters cause the
- * position to be greater than that in the
- * underlying object.
- */
- pos += fp->_p - fp->_bf._base;
- }
- }
- funlockfile((FILE *)fp);
- return (pos);
-}
diff --git a/mit-pthreads/stdio/funopen.c b/mit-pthreads/stdio/funopen.c
deleted file mode 100644
index f8b37ed0ae4..00000000000
--- a/mit-pthreads/stdio/funopen.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)funopen.c 5.2 (Berkeley) 2/5/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <errno.h>
-#include "local.h"
-
-FILE *
-funopen(cookie, readfn, writefn, seekfn, closefn)
- const void *cookie;
- int (*readfn)(), (*writefn)();
-#if __STDC__
- fpos_t (*seekfn)(void *cookie, fpos_t off, int whence);
-#else
- fpos_t (*seekfn)();
-#endif
- int (*closefn)();
-{
- struct fd_ops *fd_ops;
- char *flags;
- FILE *fp;
- int fd;
-
- if (readfn == NULL) {
- if (writefn == NULL) { /* illegal */
- errno = EINVAL;
- return (NULL);
- } else
- flags = "w"; /* write only */
- } else {
- if (writefn == NULL)
- flags = "r"; /* read only */
- else
- flags = "r+"; /* read-write */
- }
-
- if (fd_ops = (struct fd_ops*)malloc(sizeof(struct fd_ops))) {
- if ((fd = fd_allocate()) >= OK) {
-
- /* Set functions */
- fd_ops->seek = (off_t(*)())seekfn;
- fd_ops->read = (pthread_ssize_t(*)())readfn;
- fd_ops->write = (pthread_ssize_t(*)())writefn;
- fd_ops->close = closefn;
- fd_ops->use_kfds = 2;
-
- /* Alloc space for funtion pointer table */
- fd_table[fd]->type = FD_HALF_DUPLEX;
- fd_table[fd]->ops = fd_ops;
- fd_table[fd]->flags = O_RDWR;
-
- /* Save the cookie, it's important */
- fd_table[fd]->fd.ptr = (void *)cookie;
-
- if (fp = fdopen(fd, flags))
- return(fp);
-
- fd_free(fd);
- }
- free(fd_ops);
- }
- return(NULL);
-}
diff --git a/mit-pthreads/stdio/fvwrite.c b/mit-pthreads/stdio/fvwrite.c
deleted file mode 100644
index 5ed25b4e7b4..00000000000
--- a/mit-pthreads/stdio/fvwrite.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fvwrite.c 5.3 (Berkeley) 5/4/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "local.h"
-#include "fvwrite.h"
-
-/*
- * Write some memory regions. Return zero on success, EOF on error.
- *
- * This routine is large and unsightly, but most of the ugliness due
- * to the three different kinds of output buffering is handled here.
- */
-__sfvwrite(fp, uio)
- register FILE *fp;
- register struct __suio *uio;
-{
- register size_t len;
- register char *p;
- register struct __siov *iov;
- register int w, s;
- char *nl;
- int nlknown, nldist;
-
- if ((len = uio->uio_resid) == 0)
- return (0);
- /* make sure we can write */
- if (cantwrite(fp))
- return (EOF);
-
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#define COPY(n) (void) memcpy((void *)fp->_p, (void *)p, (size_t)(n));
-
- iov = uio->uio_iov;
- p = iov->iov_base;
- len = iov->iov_len;
- iov++;
-#define GETIOV(extra_work) \
- while (len == 0) { \
- extra_work; \
- p = iov->iov_base; \
- len = iov->iov_len; \
- iov++; \
- }
- if (fp->_flags & __SNBF) {
- /*
- * Unbuffered: write up to BUFSIZ bytes at a time.
- */
- do {
- GETIOV(;);
- w = __swrite(fp, p, MIN(len, BUFSIZ));
- if (w <= 0)
- goto err;
- p += w;
- len -= w;
- } while ((uio->uio_resid -= w) != 0);
- } else if ((fp->_flags & __SLBF) == 0) {
- /*
- * Fully buffered: fill partially full buffer, if any,
- * and then flush. If there is no partial buffer, write
- * one _bf._size byte chunk directly (without copying).
- *
- * String output is a special case: write as many bytes
- * as fit, but pretend we wrote everything. This makes
- * snprintf() return the number of bytes needed, rather
- * than the number used, and avoids its write function
- * (so that the write function can be invalid).
- */
- do {
- GETIOV(;);
- w = fp->_w;
- if (fp->_flags & __SSTR) {
- if (len < w)
- w = len;
- COPY(w); /* copy MIN(fp->_w,len), */
- fp->_w -= w;
- fp->_p += w;
- w = len; /* but pretend copied all */
- } else if (fp->_p > fp->_bf._base && len > w) {
- /* fill and flush */
- COPY(w);
- /* fp->_w -= w; */ /* unneeded */
- fp->_p += w;
- if (fflush(fp))
- goto err;
- } else if (len >= (w = fp->_bf._size)) {
- if ((w = __swrite(fp, p, w)) <= 0)
- goto err;
- } else {
- /* fill and done */
- w = len;
- COPY(w);
- fp->_w -= w;
- fp->_p += w;
- }
- p += w;
- len -= w;
- } while ((uio->uio_resid -= w) != 0);
- } else {
- /*
- * Line buffered: like fully buffered, but we
- * must check for newlines. Compute the distance
- * to the first newline (including the newline),
- * or `infinity' if there is none, then pretend
- * that the amount to write is MIN(len,nldist).
- */
- nlknown = 0;
- nldist = 0; /* XXX just to keep gcc happy */
- do {
- GETIOV(nlknown = 0);
- if (!nlknown) {
- nl = memchr((void *)p, '\n', len);
- nldist = nl ? nl + 1 - p : len + 1;
- nlknown = 1;
- }
- s = MIN(len, nldist);
- w = fp->_w + fp->_bf._size;
- if (fp->_p > fp->_bf._base && s > w) {
- COPY(w);
- /* fp->_w -= w; */
- fp->_p += w;
- if (fflush(fp))
- goto err;
- } else if (s >= (w = fp->_bf._size)) {
- if ((w = __swrite(fp, p, w)) <= 0)
- goto err;
- } else {
- w = s;
- COPY(w);
- fp->_w -= w;
- fp->_p += w;
- }
- if ((nldist -= w) == 0) {
- /* copied the newline: flush and forget */
- if (fflush(fp))
- goto err;
- nlknown = 0;
- }
- p += w;
- len -= w;
- } while ((uio->uio_resid -= w) != 0);
- }
- return (0);
-
-err:
- fp->_flags |= __SERR;
- return (EOF);
-}
diff --git a/mit-pthreads/stdio/fvwrite.h b/mit-pthreads/stdio/fvwrite.h
deleted file mode 100644
index b3474563a4e..00000000000
--- a/mit-pthreads/stdio/fvwrite.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)fvwrite.h 5.1 (Berkeley) 1/20/91
- * $Id$
- */
-
-/*
- * I/O descriptors for __sfvwrite().
- */
-struct __siov {
- void *iov_base;
- size_t iov_len;
-};
-
-struct __suio {
- struct __siov *uio_iov;
- int uio_iovcnt;
- int uio_resid;
-};
-
-extern int __sfvwrite __P_(( FILE *, struct __suio *));
diff --git a/mit-pthreads/stdio/fwalk.c b/mit-pthreads/stdio/fwalk.c
deleted file mode 100644
index 58a199e0707..00000000000
--- a/mit-pthreads/stdio/fwalk.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fwalk.c 5.2 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <errno.h>
-#include <stdio.h>
-#include "local.h"
-#include "glue.h"
-
-extern pthread_mutex_t __sfp_mutex;
-extern pthread_cond_t __sfp_cond;
-extern int __sfp_state;
-
-/*
- * fwalk now can only be used for flushing the buffers.
- * This is all it was originally used for.
- * The function has also become much more complicated.
- * The first time through we flush everything we can.
- * If this fails to flush everything because we couldn't get a lock
- * we wait on the locksfor the second pass. Why this works ...
- *
- * This function must allow for multiple threads to flush everything.
- * This function cannot flush buffers locked by another thread.
- * So we flush everything we can the first pass. This includes all
- * buffers locked by this thread, and wait on buffers that are locked.
- * Eventually other threads willl unlock there buffers or flush them themselves
- * at which point this thread will notice that it's empty or be able to
- * flush the buffer. This is fine so long as no other thread tries to flush
- * all buffers. Here is the possible deadlock condition, but since this thread
- * has flushed all buffers it can, there are NO buffers locked by this thread
- * that need flushing so any other thread flushing won't block waiting on this
- * thread thereby eliminating the deadlock condition.
- */
-
-int __swalk_sflush()
-{
- register FILE *fp, *savefp;
- register int n, ret, saven;
- register struct glue *g, *saveg;
-
- /* Only allow other threads to read __sglue */
- pthread_mutex_lock(&__sfp_mutex);
- __sfp_state++;
- pthread_mutex_unlock(&__sfp_mutex);
-
- ret = 0;
- saven = 0;
- saveg = NULL;
- savefp = NULL;
- for (g = &__sglue; g != NULL; g = g->next) {
- for (fp = g->iobs, n = g->niobs; --n >= 0; fp++) {
- if (fp->_flags != 0) {
- /* Is there anything to flush? */
- if (fp->_bf._base && (fp->_bf._base - fp->_p)) {
- if (ftrylockfile(fp)) { /* Can we flush it */
- if (!saven) { /* No, save first fp we can't flush */
- saven = n;
- saveg = g;
- savefp = fp;
- continue;
- }
- } else {
- ret |= __sflush(fp);
- funlockfile(fp);
- }
- }
- }
- }
- }
- if (savefp) {
- for (g = saveg; g != NULL; g = g->next) {
- for (fp = savefp, n = saven + 1; --n >= 0; fp++) {
- if (fp->_flags != 0) {
- /* Anything to flush */
- while (fp->_bf._base && (fp->_bf._base - fp->_p)) {
- flockfile(fp);
- ret |= __sflush(fp);
- funlockfile(fp);
- }
- }
- }
- }
- }
-
- /* If no other readers wakeup a thread waiting to do __sfp */
- pthread_mutex_lock(&__sfp_mutex);
- if (! (--__sfp_state)) {
- pthread_cond_signal(&__sfp_cond);
- }
- pthread_mutex_unlock(&__sfp_mutex);
- return (ret);
-}
-
diff --git a/mit-pthreads/stdio/fwrite.c b/mit-pthreads/stdio/fwrite.c
deleted file mode 100644
index 5eada4ee84b..00000000000
--- a/mit-pthreads/stdio/fwrite.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)fwrite.c 5.5 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include "local.h"
-#include "fvwrite.h"
-
-/*
- * Write `count' objects (each size `size') from memory to the given file.
- * Return the number of whole objects written.
- */
-size_t
-fwrite(buf, size, count, fp)
- const void *buf;
- size_t size, count;
- FILE *fp;
-{
- struct __suio uio;
- struct __siov iov;
- size_t n;
-
- iov.iov_base = (void *)buf;
- uio.uio_resid = iov.iov_len = n = count * size;
- uio.uio_iov = &iov;
- uio.uio_iovcnt = 1;
- if (! n)
- return(0);
-
- flockfile(fp);
-
- /*
- * The usual case is success (__sfvwrite returns 0);
- * skip the divide if this happens, since divides are
- * generally slow and since this occurs whenever size==0.
- */
- if (__sfvwrite(fp, &uio) == 0)
- count = (n - uio.uio_resid) / size;
- funlockfile(fp);
- return(count);
-}
diff --git a/mit-pthreads/stdio/getc.c b/mit-pthreads/stdio/getc.c
deleted file mode 100644
index 6896e78bc7e..00000000000
--- a/mit-pthreads/stdio/getc.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getc.c 5.1 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-
-/*
- * A subroutine version of the macro getc.
- */
-#undef getc
-
-getc(fp)
- register FILE *fp;
-{
- int ret;
- flockfile(fp);
- ret = __sgetc(fp);
- funlockfile(fp);
- return(ret);
-}
diff --git a/mit-pthreads/stdio/getc_unlocked.c b/mit-pthreads/stdio/getc_unlocked.c
deleted file mode 100644
index 01db3bcea2a..00000000000
--- a/mit-pthreads/stdio/getc_unlocked.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getc.c 5.1 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-
-/*
- * A subroutine version of the macro getc.
- */
-#undef getc_unlocked
-
-getc_unlocked(fp)
- register FILE *fp;
-{
- return (__sgetc(fp));
-}
diff --git a/mit-pthreads/stdio/getchar.c b/mit-pthreads/stdio/getchar.c
deleted file mode 100644
index 6e631c6c1b1..00000000000
--- a/mit-pthreads/stdio/getchar.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getchar.c 5.3 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * A subroutine version of the macro getchar.
- */
-#include <pthread.h>
-#include <stdio.h>
-
-#undef getchar
-
-getchar()
-{
- int ret;
- flockfile(stdin);
- ret = getc(stdin);
- funlockfile(stdin);
- return(ret);
-}
diff --git a/mit-pthreads/stdio/getchar_unlocked.c b/mit-pthreads/stdio/getchar_unlocked.c
deleted file mode 100644
index 40945c5dd57..00000000000
--- a/mit-pthreads/stdio/getchar_unlocked.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getchar.c 5.3 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * A subroutine version of the macro getchar.
- */
-#include <pthread.h>
-#include <stdio.h>
-
-#undef getchar_unlocked
-
-getchar_unlocked()
-{
- return (getc(stdin));
-}
diff --git a/mit-pthreads/stdio/gets.c b/mit-pthreads/stdio/gets.c
deleted file mode 100644
index 0e7967ae3fe..00000000000
--- a/mit-pthreads/stdio/gets.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)gets.c 5.3 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <unistd.h>
-#include <stdio.h>
-
-char *
-gets(buf)
- char *buf;
-{
- register int c;
- register char *s;
- static int warned;
- static char w[] =
- "warning: this program uses gets(), which is unsafe.\r\n";
-
- if (!warned) {
- (void) write(STDERR_FILENO, w, sizeof(w) - 1);
- warned = 1;
- }
- for (s = buf; (c = getchar()) != '\n';)
- if (c == EOF)
- if (s == buf)
- return (NULL);
- else
- break;
- else
- *s++ = c;
- *s = 0;
- return (buf);
-}
diff --git a/mit-pthreads/stdio/getw.c b/mit-pthreads/stdio/getw.c
deleted file mode 100644
index 623ba6258a1..00000000000
--- a/mit-pthreads/stdio/getw.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getw.c 5.3 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-
-getw(fp)
- FILE *fp;
-{
- int x;
-
- return (fread((void *)&x, sizeof(x), 1, fp) == 1 ? x : EOF);
-}
diff --git a/mit-pthreads/stdio/glue.h b/mit-pthreads/stdio/glue.h
deleted file mode 100644
index e5103bbb0b3..00000000000
--- a/mit-pthreads/stdio/glue.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)glue.h 5.1 (Berkeley) 1/20/91
- * $Id$
- */
-
-/*
- * The first few FILEs are statically allocated; others are dynamically
- * allocated and linked in via this glue structure.
- */
-typedef struct glue {
- struct glue *next;
- int niobs;
- FILE *iobs;
-} __sglue_type;
-extern struct glue __sglue;
diff --git a/mit-pthreads/stdio/local.h b/mit-pthreads/stdio/local.h
deleted file mode 100644
index 068754fad38..00000000000
--- a/mit-pthreads/stdio/local.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)local.h 5.3 (Berkeley) 5/6/93
- * $Id$
- */
-
-/*
- * Information local to this implementation of stdio,
- * in particular, macros and private variables.
- */
-
-#include <sys/types.h>
-#include <stddef.h>
-
-extern FILE *__sfp __P_((void));
-extern int __sflush __P_((FILE *));
-extern int __srefill __P_((FILE *));
-extern int __swrite __P_((FILE *, const char *, int));
-extern int __sread __P_((FILE *, char *, int));
-extern fpos_t __sseek __P_((FILE *, off_t, int));
-extern int __sclose __P_((FILE *));
-extern void __sinit __P_((void));
-extern void _cleanup __P_((void));
-extern void __smakebuf __P_((FILE *));
-extern int __swhatbuf __P_((FILE *, size_t *, int *));
-extern int __swalk_sflush __P_(());
-extern int __swsetup __P_((FILE *));
-extern int __sflags __P_((const char *, int *));
-
-extern void (*__cleanup) __P_((void));
-
-/*
- * Return true iff the given FILE cannot be written now.
- */
-#define cantwrite(fp) \
- ((((fp)->_flags & __SWR) == 0 || (fp)->_bf._base == NULL) && \
- __swsetup(fp))
-
-/*
- * Test whether the given stdio file has an active ungetc buffer;
- * release such a buffer, without restoring ordinary unread data.
- */
-#define HASUB(fp) ((fp)->_ub._base != NULL)
-#define FREEUB(fp) { \
- if ((fp)->_ub._base != (fp)->_ubuf) \
- free((char *)(fp)->_ub._base); \
- (fp)->_ub._base = NULL; \
-}
-
-/*
- * test for an fgetline() buffer.
- */
-#define HASLB(fp) ((fp)->_lb._base != NULL)
-#define FREELB(fp) { \
- free((char *)(fp)->_lb._base); \
- (fp)->_lb._base = NULL; \
-}
diff --git a/mit-pthreads/stdio/makebuf.c b/mit-pthreads/stdio/makebuf.c
deleted file mode 100644
index 316abe054b6..00000000000
--- a/mit-pthreads/stdio/makebuf.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)makebuf.c 5.3 (Berkeley) 5/6/93";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "local.h"
-
-void (*__cleanup) __P_((void));
-
-/*
- * Allocate a file buffer, or switch to unbuffered I/O.
- * Per the ANSI C standard, ALL tty devices default to line buffered.
- *
- * As a side effect, we set __SOPT or __SNPT (en/dis-able fseek
- * optimisation) right after the fstat() that finds the buffer size.
- */
-void
-__smakebuf(fp)
- register FILE *fp;
-{
- register void *p;
- register int flags;
- size_t size;
- int couldbetty;
-
- if (fp->_flags & __SNBF) {
- fp->_bf._base = fp->_p = fp->_nbuf;
- fp->_bf._size = 1;
- return;
- }
- flags = __swhatbuf(fp, &size, &couldbetty);
- if ((p = malloc(size)) == NULL) {
- fp->_flags |= __SNBF;
- fp->_bf._base = fp->_p = fp->_nbuf;
- fp->_bf._size = 1;
- return;
- }
- __cleanup = _cleanup;
- flags |= __SMBF;
- fp->_bf._base = fp->_p = p;
- fp->_bf._size = size;
- if (couldbetty && isatty(fp->_file))
- flags |= __SLBF;
- fp->_flags |= flags;
-}
-
-/*
- * Internal routine to determine `proper' buffering for a file.
- */
-int
-__swhatbuf(fp, bufsize, couldbetty)
- register FILE *fp;
- size_t *bufsize;
- int *couldbetty;
-{
- struct stat st;
-
- if (fp->_file < 0 || fstat(fp->_file, &st) < 0) {
- *couldbetty = 0;
- *bufsize = BUFSIZ;
- return (__SNPT);
- }
-
- /* could be a tty iff it is a character device */
- *couldbetty = (st.st_mode & S_IFMT) == S_IFCHR;
- if (st.st_blksize <= 0) {
- *bufsize = BUFSIZ;
- return (__SNPT);
- }
-
- /*
- * Optimise fseek() only if it is a regular file. (The test for
- * __sseek is mainly paranoia.) It is safe to set _blksize
- * unconditionally; it will only be used if __SOPT is also set.
- */
- *bufsize = st.st_blksize;
- fp->_blksize = st.st_blksize;
- return ((st.st_mode & S_IFMT) == S_IFREG ? __SOPT : __SNPT);
-}
diff --git a/mit-pthreads/stdio/mktemp.c b/mit-pthreads/stdio/mktemp.c
deleted file mode 100644
index 7fdc631ad0b..00000000000
--- a/mit-pthreads/stdio/mktemp.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 1987 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)mktemp.c 5.10 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-
-static int _gettemp();
-
-mkstemp(path)
- char *path;
-{
- int fd;
-
- return (_gettemp(path, &fd) ? fd : -1);
-}
-
-char *
-mktemp(path)
- char *path;
-{
- return(_gettemp(path, (int *)NULL) ? path : (char *)NULL);
-}
-
-static
-_gettemp(path, doopen)
- char *path;
- register int *doopen;
-{
- extern int errno;
- register char *start, *trv;
- struct stat sbuf;
- u_int pid;
-
- pid = getpid();
- for (trv = path; *trv; ++trv); /* extra X's get set to 0's */
- while (*--trv == 'X') {
- *trv = (pid % 10) + '0';
- pid /= 10;
- }
-
- /*
- * check the target directory; if you have six X's and it
- * doesn't exist this runs for a *very* long time.
- */
- for (start = trv + 1;; --trv) {
- if (trv <= path)
- break;
- if (*trv == '/') {
- *trv = '\0';
- if (stat(path, &sbuf))
- return(0);
- if (!S_ISDIR(sbuf.st_mode)) {
- errno = ENOTDIR;
- return(0);
- }
- *trv = '/';
- break;
- }
- }
-
- for (;;) {
- if (doopen) {
- if ((*doopen =
- open(path, O_CREAT|O_EXCL|O_RDWR, 0600)) >= 0)
- return(1);
- if (errno != EEXIST)
- return(0);
- }
- else if (stat(path, &sbuf))
- return(errno == ENOENT ? 1 : 0);
-
- /* tricky little algorithm for backward compatibility */
- for (trv = start;;) {
- if (!*trv)
- return(0);
- if (*trv == 'z')
- *trv++ = 'a';
- else {
- if (isdigit(*trv))
- *trv = 'a';
- else
- ++*trv;
- break;
- }
- }
- }
- /*NOTREACHED*/
-}
diff --git a/mit-pthreads/stdio/perror.c b/mit-pthreads/stdio/perror.c
deleted file mode 100644
index 19fe52f5010..00000000000
--- a/mit-pthreads/stdio/perror.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 1988 Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)perror.c 5.11 (Berkeley) 2/24/91";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-char *strerror(int); /* For systems that don't prototype it in string.h */
-
-void
-perror(s)
- const char *s;
-{
- char * e;
-
- if (fd_lock(STDERR_FILENO, FD_WRITE, NULL) == OK) {
- if (s && *s) {
- fd_table[STDERR_FILENO]->ops->write(fd_table[STDERR_FILENO]->fd,
- fd_table[STDERR_FILENO]->flags, s, strlen(s), NULL);
- fd_table[STDERR_FILENO]->ops->write(fd_table[STDERR_FILENO]->fd,
- fd_table[STDERR_FILENO]->flags, ": ", 2, NULL);
- }
- e = strerror(errno);
- fd_table[STDERR_FILENO]->ops->write(fd_table[STDERR_FILENO]->fd,
- fd_table[STDERR_FILENO]->flags, e, strlen(e), NULL);
- fd_table[STDERR_FILENO]->ops->write(fd_table[STDERR_FILENO]->fd,
- fd_table[STDERR_FILENO]->flags, "\n", 1, NULL);
- fd_unlock(STDERR_FILENO, FD_WRITE);
- }
-}
diff --git a/mit-pthreads/stdio/printf.c b/mit-pthreads/stdio/printf.c
deleted file mode 100644
index a298509d341..00000000000
--- a/mit-pthreads/stdio/printf.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)printf.c 5.6 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdarg.h>
-#include <pthread.h>
-#include <stdio.h>
-
-printf(char const *fmt, ...)
-{
- int ret;
- va_list ap;
-
- va_start(ap, fmt);
- ret = vfprintf(stdout, fmt, ap);
- va_end(ap);
- return (ret);
-}
diff --git a/mit-pthreads/stdio/putc.c b/mit-pthreads/stdio/putc.c
deleted file mode 100644
index ac71e35ff25..00000000000
--- a/mit-pthreads/stdio/putc.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)putc.c 5.1 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-
-/*
- * A subroutine version of the macro putc.
- */
-#undef putc
-
-putc(c, fp)
- int c;
- register FILE *fp;
-{
- int ret;
- flockfile(fp);
- ret = __sputc(c, fp);
- funlockfile(fp);
- return(ret);
-}
diff --git a/mit-pthreads/stdio/putc_unlocked.c b/mit-pthreads/stdio/putc_unlocked.c
deleted file mode 100644
index 7c9c78ff1e8..00000000000
--- a/mit-pthreads/stdio/putc_unlocked.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)putc.c 5.1 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-
-/*
- * A subroutine version of the macro putc.
- */
-#undef putc_unlocked
-
-putc_unlocked(c, fp)
- int c;
- register FILE *fp;
-{
- return (__sputc(c, fp));
-}
diff --git a/mit-pthreads/stdio/putchar.c b/mit-pthreads/stdio/putchar.c
deleted file mode 100644
index c22a11ea25d..00000000000
--- a/mit-pthreads/stdio/putchar.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)putchar.c 5.3 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-
-#undef putchar
-
-/*
- * A subroutine version of the macro putchar
- */
-putchar(c)
- int c;
-{
- register FILE *so = stdout;
- int ret;
-
- flockfile(so);
- ret = __sputc(c, so);
- funlockfile(so);
- return(ret);
-}
diff --git a/mit-pthreads/stdio/putchar_unlocked.c b/mit-pthreads/stdio/putchar_unlocked.c
deleted file mode 100644
index df27a501211..00000000000
--- a/mit-pthreads/stdio/putchar_unlocked.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)putchar.c 5.3 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-
-#undef putchar_unlocked
-/*
- * A subroutine version of the macro putchar
- */
-putchar_unlocked(c)
- int c;
-{
- register FILE *so = stdout;
-
- return (__sputc(c, so));
-}
diff --git a/mit-pthreads/stdio/puts.c b/mit-pthreads/stdio/puts.c
deleted file mode 100644
index 97f8b3599f2..00000000000
--- a/mit-pthreads/stdio/puts.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)puts.c 5.6 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <string.h>
-#include "fvwrite.h"
-
-/*
- * Write the given string to stdout, appending a newline.
- */
-puts(s)
- char const *s;
-{
- size_t c = strlen(s);
- struct __suio uio;
- struct __siov iov[2];
- int r;
-
- iov[0].iov_base = (void *)s;
- iov[0].iov_len = c;
- iov[1].iov_base = "\n";
- iov[1].iov_len = 1;
- uio.uio_resid = c + 1;
- uio.uio_iov = &iov[0];
- uio.uio_iovcnt = 2;
-
- flockfile(stdout);
- r = (__sfvwrite(stdout, &uio) ? EOF : '\n');
- funlockfile(stdout);
- return(r);
-}
diff --git a/mit-pthreads/stdio/putw.c b/mit-pthreads/stdio/putw.c
deleted file mode 100644
index 79473f0e243..00000000000
--- a/mit-pthreads/stdio/putw.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)putw.c 5.3 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include "fvwrite.h"
-
-putw(w, fp)
- int w;
- FILE *fp;
-{
- struct __suio uio;
- struct __siov iov;
- int r;
-
- iov.iov_base = &w;
- iov.iov_len = uio.uio_resid = sizeof(w);
- uio.uio_iov = &iov;
- uio.uio_iovcnt = 1;
-
- flockfile(fp);
- r = (__sfvwrite(fp, &uio));
- funlockfile(fp);
- return(r);
-}
diff --git a/mit-pthreads/stdio/refill.c b/mit-pthreads/stdio/refill.c
deleted file mode 100644
index 396895e56ff..00000000000
--- a/mit-pthreads/stdio/refill.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)refill.c 5.3 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "local.h"
-#include "glue.h"
-
-extern pthread_mutex_t __sfp_mutex;
-extern pthread_cond_t __sfp_cond;
-extern struct glue __sglue;
-extern int __sfp_state;
-
-/* This function is very similar to __swalk_sflush */
-static void __swalk_lflush()
-{
- register FILE *fp, *savefp;
- register int n, saven;
- register struct glue *g, *saveg;
-
- /* Only allow other threads to read __sglue */
- pthread_mutex_lock(&__sfp_mutex);
- __sfp_state++;
- pthread_mutex_unlock(&__sfp_mutex);
-
- saven = 0;
- saveg = NULL;
- savefp = NULL;
- for (g = &__sglue; g != NULL; g = g->next) {
- for (fp = g->iobs, n = g->niobs; --n >= 0; fp++) {
- if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR)) {
- /* Is there anything to flush? */
- if (fp->_bf._base && (fp->_bf._base - fp->_p)) {
- if (ftrylockfile(fp)) { /* Can we flush it */
- if (!saven) { /* No, save first fp we can't flush */
- saven = n;
- saveg = g;
- savefp = fp;
- continue;
- }
- } else {
- (void) __sflush(fp);
- funlockfile(fp);
- }
- }
- }
- }
- }
- if (savefp) {
- for (g = saveg; g != NULL; g = g->next) {
- for (fp = savefp, n = saven + 1; --n >= 0; fp++) {
- if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR)) {
- /* Anything to flush */
- while (fp->_bf._base && (fp->_bf._base - fp->_p)) {
- flockfile(fp);
- (void) __sflush(fp);
- funlockfile(fp);
- }
- }
- }
- }
- }
-
- /* If no other readers wakeup a thread waiting to do __sfp */
- pthread_mutex_lock(&__sfp_mutex);
- if (! (--__sfp_state)) {
- pthread_cond_signal(&__sfp_cond);
- }
- pthread_mutex_unlock(&__sfp_mutex);
-}
-
-/*
- * Refill a stdio buffer.
- * Return EOF on eof or error, 0 otherwise.
- */
-__srefill(fp)
- register FILE *fp;
-{
-
- /* make sure stdio is set up */
- __sinit ();
-
- fp->_r = 0; /* largely a convenience for callers */
-
- /* SysV does not make this test; take it out for compatibility */
- if (fp->_flags & __SEOF)
- return (EOF);
-
- /* if not already reading, have to be reading and writing */
- if ((fp->_flags & __SRD) == 0) {
- if ((fp->_flags & __SRW) == 0) {
- errno = EBADF;
- return (EOF);
- }
- /* switch to reading */
- if (fp->_flags & __SWR) {
- if (__sflush(fp))
- return (EOF);
- fp->_flags &= ~__SWR;
- fp->_w = 0;
- fp->_lbfsize = 0;
- }
- fp->_flags |= __SRD;
- } else {
- /*
- * We were reading. If there is an ungetc buffer,
- * we must have been reading from that. Drop it,
- * restoring the previous buffer (if any). If there
- * is anything in that buffer, return.
- */
- if (HASUB(fp)) {
- FREEUB(fp);
- if ((fp->_r = fp->_ur) != 0) {
- fp->_p = fp->_up;
- return (0);
- }
- }
- }
-
- if (fp->_file == -1) {
- fp->_flags |= __SEOF;
- return(EOF);
- }
-
- if (fp->_bf._base == NULL)
- __smakebuf(fp);
-
- /*
- * Before reading from a line buffered or unbuffered file,
- * flush all line buffered output files, per the ANSI C
- * standard.
- */
- if (fp->_flags & (__SLBF|__SNBF))
- __swalk_lflush();
- fp->_p = fp->_bf._base;
- fp->_r = __sread(fp, (char *)fp->_p, fp->_bf._size);
- fp->_flags &= ~__SMOD; /* buffer contents are again pristine */
- if (fp->_r <= 0) {
- if (fp->_r == 0)
- fp->_flags |= __SEOF;
- else {
- fp->_r = 0;
- fp->_flags |= __SERR;
- }
- return (EOF);
- }
- return (0);
-}
diff --git a/mit-pthreads/stdio/remove.c b/mit-pthreads/stdio/remove.c
deleted file mode 100644
index 116537e3a0f..00000000000
--- a/mit-pthreads/stdio/remove.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)remove.c 5.3 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <unistd.h>
-
-remove(file)
- const char *file;
-{
- return (unlink(file));
-}
diff --git a/mit-pthreads/stdio/rewind.c b/mit-pthreads/stdio/rewind.c
deleted file mode 100644
index 17d4418db39..00000000000
--- a/mit-pthreads/stdio/rewind.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)rewind.c 5.6 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <errno.h>
-#include <stdio.h>
-
-void
-rewind(fp)
- register FILE *fp;
-{
- flockfile(fp);
- (void) fseek(fp, 0L, SEEK_SET);
- fp->_flags &= ~(__SERR|__SEOF); /* clearerr */
- funlockfile(fp);
- errno = 0; /* not required, but seems reasonable */
-}
diff --git a/mit-pthreads/stdio/rget.c b/mit-pthreads/stdio/rget.c
deleted file mode 100644
index a2b19afb130..00000000000
--- a/mit-pthreads/stdio/rget.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)rget.c 5.1 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-
-/*
- * Handle getc() when the buffer ran out:
- * Refill, then return the first character
- * in the newly-filled buffer.
- */
-__srget(fp)
- register FILE *fp;
-{
- if (__srefill(fp) == 0) {
- fp->_r--;
- return (*fp->_p++);
- }
- return (EOF);
-}
diff --git a/mit-pthreads/stdio/scanf.c b/mit-pthreads/stdio/scanf.c
deleted file mode 100644
index 9f9f5a6665e..00000000000
--- a/mit-pthreads/stdio/scanf.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)scanf.c 5.3 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#if __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#if __STDC__
-scanf(char const *fmt, ...)
-#else
-scanf(fmt, va_alist)
- char *fmt;
- va_dcl
-#endif
-{
- int ret;
- va_list ap;
-
-#if __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
- flockfile(stdin);
- ret = __svfscanf(stdin, fmt, ap);
- funlockfile(stdin);
- va_end(ap);
- return (ret);
-}
diff --git a/mit-pthreads/stdio/setbuf.c b/mit-pthreads/stdio/setbuf.c
deleted file mode 100644
index af8d088089d..00000000000
--- a/mit-pthreads/stdio/setbuf.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)setbuf.c 5.3 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-#include "local.h"
-
-void
-setbuf(fp, buf)
- FILE *fp;
- char *buf;
-{
- (void) setvbuf(fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
-}
diff --git a/mit-pthreads/stdio/setbuffer.c b/mit-pthreads/stdio/setbuffer.c
deleted file mode 100644
index 0c79e55fd93..00000000000
--- a/mit-pthreads/stdio/setbuffer.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)setbuffer.c 5.5 (Berkeley) 3/18/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-
-void
-setbuffer(fp, buf, size)
- register FILE *fp;
- char *buf;
- int size;
-{
-
- (void) setvbuf(fp, buf, buf ? _IOFBF : _IONBF, size);
-}
-
-/*
- * set line buffering
- */
-setlinebuf(fp)
- FILE *fp;
-{
-
- (void) setvbuf(fp, (char *)NULL, _IOLBF, (size_t)0);
- return (0); /* ??? */
-}
diff --git a/mit-pthreads/stdio/setvbuf.c b/mit-pthreads/stdio/setvbuf.c
deleted file mode 100644
index 288d8c32db0..00000000000
--- a/mit-pthreads/stdio/setvbuf.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)setvbuf.c 5.5 (Berkeley) 5/6/93";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "local.h"
-
-/*
- * Set one of the three kinds of buffering, optionally including
- * a buffer.
- */
-setvbuf(fp, buf, mode, size)
- register FILE *fp;
- char *buf;
- register int mode;
- register size_t size;
-{
- register int ret, flags;
- size_t iosize;
- int ttyflag;
-
- /*
- * Verify arguments. The `int' limit on `size' is due to this
- * particular implementation. Note, buf and size are ignored
- * when setting _IONBF.
- */
- if (mode != _IONBF)
- if ((mode != _IOFBF && mode != _IOLBF) || (int)size < 0)
- return (EOF);
-
- flockfile(fp);
- /*
- * Write current buffer, if any. Discard unread input, cancel
- * line buffering, and free old buffer if malloc()ed.
- */
- ret = 0;
- (void)__sflush(fp);
- fp->_r = fp->_lbfsize = 0;
- flags = fp->_flags;
- if (flags & __SMBF)
- free((void *)fp->_bf._base);
- flags &= ~(__SLBF | __SNBF | __SMBF | __SOPT | __SNPT);
-
- /* If setting unbuffered mode, skip all the hard work. */
- if (mode == _IONBF)
- goto nbf;
-
- /*
- * Find optimal I/O size for seek optimization. This also returns
- * a `tty flag' to suggest that we check isatty(fd), but we do not
- * care since our caller told us how to buffer.
- */
- flags |= __swhatbuf(fp, &iosize, &ttyflag);
- if (size == 0) {
- buf = NULL; /* force local allocation */
- size = iosize;
- }
-
- /* Allocate buffer if needed. */
- if (buf == NULL) {
- if ((buf = malloc(size)) == NULL) {
- /*
- * Unable to honor user's request. We will return
- * failure, but try again with file system size.
- */
- ret = EOF;
- if (size != iosize) {
- size = iosize;
- buf = malloc(size);
- }
- }
- if (buf == NULL) {
- /* No luck; switch to unbuffered I/O. */
-nbf:
- fp->_flags = flags | __SNBF;
- fp->_w = 0;
- fp->_bf._base = fp->_p = fp->_nbuf;
- fp->_bf._size = 1;
- funlockfile(fp);
- return (ret);
- }
- flags |= __SMBF;
- }
-
- /*
- * Kill any seek optimization if the buffer is not the
- * right size.
- *
- * SHOULD WE ALLOW MULTIPLES HERE (i.e., ok iff (size % iosize) == 0)?
- */
- if (size != iosize)
- flags |= __SNPT;
-
- /*
- * Fix up the FILE fields, and set __cleanup for output flush on
- * exit (since we are buffered in some way). If in r/w mode, go
- * to the intermediate state, so that everyone has to call
- * __srefill or __swsetup on the first operation -- it is more
- * trouble than it is worth to set things up correctly here.
- */
- if (mode == _IOLBF)
- flags |= __SLBF;
- if (flags & __SRW)
- flags &= ~(__SRD | __SWR);
- fp->_w = size; /* Was 0 (mevans) */
- fp->_flags = flags;
- fp->_bf._base = fp->_p = (unsigned char *)buf;
- fp->_bf._size = size;
- fp->_lbfsize = 0;
- __cleanup = _cleanup;
-
- funlockfile(fp);
- return (ret);
-}
diff --git a/mit-pthreads/stdio/snprintf.c b/mit-pthreads/stdio/snprintf.c
deleted file mode 100644
index dd9bca24f73..00000000000
--- a/mit-pthreads/stdio/snprintf.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)snprintf.c 5.1 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-#if __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#if __STDC__
-snprintf(char *str, size_t n, char const *fmt, ...)
-#else
-snprintf(str, n, fmt, va_alist)
- char *str;
- size_t n;
- char *fmt;
- va_dcl
-#endif
-{
- int ret;
- va_list ap;
- FILE f;
-
- if ((int)n < 1)
- return (EOF);
-#if __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
- f._file = -1;
- f._flags = __SWR | __SSTR;
- f._bf._base = f._p = (unsigned char *)str;
- f._bf._size = f._w = n - 1;
- ret = vfprintf(&f, fmt, ap);
- *f._p = 0;
- va_end(ap);
- return (ret);
-}
diff --git a/mit-pthreads/stdio/sprintf.c b/mit-pthreads/stdio/sprintf.c
deleted file mode 100644
index a500e8d4afa..00000000000
--- a/mit-pthreads/stdio/sprintf.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)sprintf.c 5.7 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <limits.h>
-#include <stdio.h>
-#if __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#include "local.h"
-
-#if __STDC__
-sprintf(char *str, char const *fmt, ...)
-#else
-sprintf(str, fmt, va_alist)
- char *str;
- char *fmt;
- va_dcl
-#endif
-{
- int ret;
- va_list ap;
- FILE f;
-
- f._file = -1;
- f._flags = __SWR | __SSTR;
- f._bf._base = f._p = (unsigned char *)str;
- f._bf._size = f._w = INT_MAX;
-#if __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
- ret = vfprintf(&f, fmt, ap);
- va_end(ap);
- *f._p = 0;
- return (ret);
-}
diff --git a/mit-pthreads/stdio/sscanf.c b/mit-pthreads/stdio/sscanf.c
deleted file mode 100644
index 50148192b9c..00000000000
--- a/mit-pthreads/stdio/sscanf.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)sscanf.c 5.1 (Berkeley) 1/20/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-#include <string.h>
-#if __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#include "local.h"
-
-#if __STDC__
-sscanf(const char *str, char const *fmt, ...)
-#else
-sscanf(str, fmt, va_alist)
- const char *str;
- char *fmt;
- va_dcl
-#endif
-{
- int ret;
- va_list ap;
- FILE f;
-
- f._flags = __SRD;
- f._file = -1;
- f._bf._base = f._p = (unsigned char *)str;
- f._bf._size = f._r = strlen(str);
- f._ub._base = NULL;
- f._lb._base = NULL;
-#if __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
- ret = __svfscanf(&f, fmt, ap);
- va_end(ap);
- return (ret);
-}
diff --git a/mit-pthreads/stdio/stdio.c b/mit-pthreads/stdio/stdio.c
deleted file mode 100644
index 0b676eeb09b..00000000000
--- a/mit-pthreads/stdio/stdio.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)stdio.c 5.3 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdio.h>
-#include "local.h"
-
-/*
- * Small standard I/O/seek/close functions.
- * These maintain the `known seek offset' for seek optimisation.
- */
-int __sread(FILE *fp, char *buf, int n)
-{
- register int ret;
-
- /* if the read succeeded, update the current offset */
- if (fd_table[fp->_file]->ops->use_kfds < 2) {
- ret = fd_table[fp->_file]->ops->read(fd_table[fp->_file]->fd,
- fd_table[fp->_file]->flags, buf, n, NULL);
- } else {
- pthread_ssize_t (*readfn)() = fd_table[fp->_file]->ops->read;
- ret = readfn(fd_table[fp->_file]->fd, buf, n);
- }
- if (ret >= 0) {
- fp->_offset += ret;
- } else {
- fp->_flags &= ~__SOFF; /* paranoia */
- }
- return (ret);
-}
-
-int __swrite(FILE *fp, const char *buf, int n)
-{
- if (fp->_flags & __SAPP)
- (void) lseek(fp->_file, (off_t)0, SEEK_END);
- fp->_flags &= ~__SOFF; /* in case FAPPEND mode is set */
- if (fd_table[fp->_file]->ops->use_kfds < 2) {
- return(fd_table[fp->_file]->ops->write(fd_table[fp->_file]->fd,
- fd_table[fp->_file]->flags, buf, n, NULL));
- } else {
- pthread_ssize_t (*writefn)() = fd_table[fp->_file]->ops->write;
- return(writefn(fd_table[fp->_file]->fd,buf,n));
- }
-}
-
-fpos_t __sseek(FILE *fp, off_t offset, int whence)
-{
- register fpos_t ret;
-
- ret = (fpos_t)lseek(fp->_file, offset, whence);
- if (ret == -1L)
- fp->_flags &= ~__SOFF;
- else {
- fp->_flags |= __SOFF;
- fp->_offset = ret;
- }
- return (ret);
-}
-
-int __sclose(FILE *fp)
-{
- return (close(fp->_file));
-}
diff --git a/mit-pthreads/stdio/strerror.c b/mit-pthreads/stdio/strerror.c
deleted file mode 100644
index d35235e63b0..00000000000
--- a/mit-pthreads/stdio/strerror.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)strerror.c 5.6 (Berkeley) 5/4/91";
-#endif /* LIBC_SCCS and not lint */
-
-#include <string.h>
-#if defined(__NetBSD__)
-#include <errno.h>
-#endif
-
-char *
-strerror(num)
- int num;
-{
-#if !defined(__NetBSD__)
- extern int sys_nerr;
- extern char *sys_errlist[];
-#endif
-#define UPREFIX "Unknown error: "
- static char ebuf[40] = UPREFIX; /* 64-bit number + slop */
- register unsigned int errnum;
- register char *p, *t;
- char tmp[40];
-
- errnum = num; /* convert to unsigned */
- if (errnum < sys_nerr)
- return((char *)sys_errlist[errnum]);
-
- /* Do this by hand, so we don't include stdio(3). */
- t = tmp;
- do {
- *t++ = "0123456789"[errnum % 10];
- } while (errnum /= 10);
- for (p = ebuf + sizeof(UPREFIX) - 1;;) {
- *p++ = *--t;
- if (t <= tmp)
- break;
- }
- return(ebuf);
-}
diff --git a/mit-pthreads/stdio/tempnam.c b/mit-pthreads/stdio/tempnam.c
deleted file mode 100644
index 88150a18019..00000000000
--- a/mit-pthreads/stdio/tempnam.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)tempnam.c 5.1 (Berkeley) 2/22/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/param.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-/* #include <paths.h> */
-
-char *
-tempnam(dir, pfx)
- const char *dir, *pfx;
-{
- int sverrno;
- char *f, *name;
-
- if (!(name = malloc(MAXPATHLEN)))
- return(NULL);
-
- if (!pfx)
- pfx = "tmp.";
-
- if (f = getenv("TMPDIR")) {
- (void)snprintf(name, MAXPATHLEN, "%s%s%sXXXXXX", f,
- *(f + strlen(f) - 1) == '/'? "": "/", pfx);
- if (f = mktemp(name))
- return(f);
- }
-
- if (f = (char *)dir) {
- (void)snprintf(name, MAXPATHLEN, "%s%s%sXXXXXX", f,
- *(f + strlen(f) - 1) == '/'? "": "/", pfx);
- if (f = mktemp(name))
- return(f);
- }
-
- f = P_tmpdir;
- (void)snprintf(name, MAXPATHLEN, "%s%sXXXXXX", f, pfx);
- if (f = mktemp(name))
- return(f);
-
- f = _PATH_TMP;
- (void)snprintf(name, MAXPATHLEN, "%s%sXXXXXX", f, pfx);
- if (f = mktemp(name))
- return(f);
-
- sverrno = errno;
- free(name);
- errno = sverrno;
- return(NULL);
-}
diff --git a/mit-pthreads/stdio/tmpfile.c b/mit-pthreads/stdio/tmpfile.c
deleted file mode 100644
index 471bed33716..00000000000
--- a/mit-pthreads/stdio/tmpfile.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)tmpfile.c 5.4 (Berkeley) 5/27/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <signal.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdio.h>
-#include <paths.h>
-
-FILE *
-tmpfile()
-{
- sigset_t set, oset;
- FILE *fp;
- int fd, sverrno;
-#define TRAILER "tmp.XXXXXX"
- char buf[sizeof(_PATH_TMP) + sizeof(TRAILER)];
-
- memcpy(buf, _PATH_TMP, sizeof(_PATH_TMP) - 1);
- memcpy( buf + sizeof(_PATH_TMP) - 1, TRAILER, sizeof(TRAILER));
-
- sigfillset(&set);
- (void)sigprocmask(SIG_BLOCK, &set, &oset);
-
- fd = mkstemp(buf);
- if (fd != -1)
- (void)unlink(buf);
-
- (void)sigprocmask(SIG_SETMASK, &oset, NULL);
-
- if (fd == -1)
- return (NULL);
-
- if (!(fp = fdopen(fd, "w+"))) {
- sverrno = errno;
- (void)close(fd);
- errno = sverrno;
- return (NULL);
- }
- return (fp);
-}
diff --git a/mit-pthreads/stdio/tmpnam.c b/mit-pthreads/stdio/tmpnam.c
deleted file mode 100644
index 8d65b21b037..00000000000
--- a/mit-pthreads/stdio/tmpnam.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)tmpnam.c 5.3 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <unistd.h>
-#include <stdio.h>
-
-char *
-tmpnam(s)
- char *s;
-{
- static char buf[L_tmpnam];
-
- if (s == NULL)
- s = buf;
- (void)snprintf(s, L_tmpnam, "%stmp.XXXXXX", P_tmpdir);
- return(mktemp(s));
-}
diff --git a/mit-pthreads/stdio/ungetc.c b/mit-pthreads/stdio/ungetc.c
deleted file mode 100644
index e035f93d5f2..00000000000
--- a/mit-pthreads/stdio/ungetc.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)ungetc.c 5.6 (Berkeley) 5/4/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "local.h"
-
-/*
- * Expand the ungetc buffer `in place'. That is, adjust fp->_p when
- * the buffer moves, so that it points the same distance from the end,
- * and move the bytes in the buffer around as necessary so that they
- * are all at the end (stack-style).
- */
-static
-__submore(fp)
- register FILE *fp;
-{
- register int i;
- register unsigned char *p;
-
- if (fp->_ub._base == fp->_ubuf) {
- /*
- * Get a new buffer (rather than expanding the old one).
- */
- if ((p = malloc((size_t)BUFSIZ)) == NULL)
- return (EOF);
- fp->_ub._base = p;
- fp->_ub._size = BUFSIZ;
- p += BUFSIZ - sizeof(fp->_ubuf);
- for (i = sizeof(fp->_ubuf); --i >= 0;)
- p[i] = fp->_ubuf[i];
- fp->_p = p;
- return (0);
- }
- i = fp->_ub._size;
- p = realloc(fp->_ub._base, i << 1);
- if (p == NULL)
- return (EOF);
- (void) memcpy((void *)(p + i), (void *)p, (size_t)i);
- fp->_p = p + i;
- fp->_ub._base = p;
- fp->_ub._size = i << 1;
- return (0);
-}
-
-ungetc(c, fp)
- int c;
- register FILE *fp;
-{
- if (c == EOF)
- return (EOF);
- __sinit ();
-
- flockfile(fp);
- if ((fp->_flags & __SRD) == 0) {
- /*
- * Not already reading: no good unless reading-and-writing.
- * Otherwise, flush any current write stuff.
- */
- if ((fp->_flags & __SRW) == 0)
- c = EOF;
- goto ungetc_end;
- if (fp->_flags & __SWR) {
- if (__sflush(fp))
- c = EOF;
- goto ungetc_end;
- fp->_flags &= ~__SWR;
- fp->_w = 0;
- fp->_lbfsize = 0;
- }
- fp->_flags |= __SRD;
- }
- c = (unsigned char)c;
-
- /*
- * If we are in the middle of ungetc'ing, just continue.
- * This may require expanding the current ungetc buffer.
- */
- if (HASUB(fp)) {
- if (fp->_r >= fp->_ub._size && __submore(fp))
- return (EOF);
- *--fp->_p = c;
- fp->_r++;
- goto ungetc_end;
- }
-
- /*
- * If we can handle this by simply backing up, do so,
- * but never replace the original character.
- * (This makes sscanf() work when scanning `const' data.)
- */
- if (fp->_bf._base != NULL && fp->_p > fp->_bf._base &&
- fp->_p[-1] == c) {
- fp->_p--;
- fp->_r++;
- goto ungetc_end;
- }
-
- /*
- * Create an ungetc buffer.
- * Initially, we will use the `reserve' buffer.
- */
- fp->_ur = fp->_r;
- fp->_up = fp->_p;
- fp->_ub._base = fp->_ubuf;
- fp->_ub._size = sizeof(fp->_ubuf);
- fp->_ubuf[sizeof(fp->_ubuf) - 1] = c;
- fp->_p = &fp->_ubuf[sizeof(fp->_ubuf) - 1];
- fp->_r = 1;
-
-ungetc_end:;
- funlockfile(fp);
- return (c);
-}
diff --git a/mit-pthreads/stdio/vfprintf.c b/mit-pthreads/stdio/vfprintf.c
deleted file mode 100644
index fd990bb1889..00000000000
--- a/mit-pthreads/stdio/vfprintf.c
+++ /dev/null
@@ -1,788 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)vfprintf.c 5.50 (Berkeley) 12/16/92";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Actual printf innards.
- *
- * This code is large and complicated...
- */
-
-#include <pthread.h>
-#include <sys/types.h>
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "local.h"
-#include "fvwrite.h"
-
-/* Define FLOATING_POINT to get floating point. */
-#define FLOATING_POINT
-
-/*
- * Flush out all the vectors defined by the given uio,
- * then reset it so that it can be reused.
- */
-static int
-__sprint(fp, uio)
- register FILE* fp;
- register struct __suio *uio;
-{
- register int err;
-
- if (uio->uio_resid == 0) {
- uio->uio_iovcnt = 0;
- return (0);
- }
- err = __sfvwrite(fp, uio);
- uio->uio_resid = 0;
- uio->uio_iovcnt = 0;
- return (err);
-}
-
-/*
- * Helper function for `fprintf to unbuffered unix file': creates a
- * temporary buffer. We only work on write-only files; this avoids
- * worries about ungetc buffers and so forth.
- */
-static int
-__sbprintf(fp, fmt, ap)
- FILE *fp;
- const char *fmt;
- pthread_va_list ap;
-{
- unsigned char buf[BUFSIZ];
- FILE fake;
- int ret;
-
- /* copy the important variables */
- fake._flags = fp->_flags & ~__SNBF;
- fake._file = fp->_file;
-
- /* set up the buffer */
- fake._bf._base = fake._p = buf;
- fake._bf._size = fake._w = sizeof(buf);
- fake._lbfsize = 0; /* not actually used, but Just In Case */
-
- /* do the work, then copy any error status */
- ret = vfprintf(&fake, fmt, ap);
- if (ret >= 0 && fflush(&fake))
- ret = EOF;
- if (fake._flags & __SERR)
- fp->_flags |= __SERR;
- return (ret);
-}
-
-
-#ifdef FLOATING_POINT
-#include <locale.h>
-#include <math.h>
-#include "floatio.h"
-
-#define BUF (MAXEXP+MAXFRACT+1) /* + decimal point */
-#define DEFPREC 6
-
-static char *cvt __P_((double, int, int, char *, int *, int, int *));
-static int exponent __P_((char *, int, int));
-
-#else /* no FLOATING_POINT */
-
-#define BUF 40
-
-#endif /* FLOATING_POINT */
-
-
-/*
- * Macros for converting digits to letters and vice versa
- */
-#define to_digit(c) ((c) - '0')
-#define is_digit(c) ((unsigned)to_digit(c) <= 9)
-#define to_char(n) ((n) + '0')
-
-/*
- * Flags used during conversion.
- */
-#define ALT 0x001 /* alternate form */
-#define HEXPREFIX 0x002 /* add 0x or 0X prefix */
-#define LADJUST 0x004 /* left adjustment */
-#define LONGDBL 0x008 /* long double; unimplemented */
-#define LONGINT 0x010 /* long integer */
-#define QUADINT 0x020 /* quad integer */
-#define SHORTINT 0x040 /* short integer */
-#define ZEROPAD 0x080 /* zero (as opposed to blank) pad */
-#define FPT 0x100 /* Floating point number */
-int
-vfprintf(fp, fmt0, ap)
- FILE *fp;
- const char *fmt0;
- pthread_va_list ap;
-{
- register char *fmt; /* format string */
- register int ch; /* character from fmt */
- register int n; /* handy integer (short term usage) */
- register char *cp; /* handy char pointer (short term usage) */
- register struct __siov *iovp;/* for PRINT macro */
- register int flags; /* flags as above */
- int ret; /* return value accumulator */
- int width; /* width from format (%8d), or 0 */
- int prec; /* precision from format (%.3d), or -1 */
- char sign; /* sign prefix (' ', '+', '-', or \0) */
-#ifdef FLOATING_POINT
- char softsign; /* temporary negative sign for floats */
- double _double; /* double precision arguments %[eEfgG] */
- int expt; /* integer value of exponent */
- int expsize; /* character count for expstr */
- int ndig; /* actual number of digits returned by cvt */
- char expstr[7]; /* buffer for exponent string */
-#endif
-
-#if defined (__alpha) && !defined(_GNUC_)
-#define quad_t long
-#define u_quad_t unsigned long
-#else /* gcc has builtin quad type (long long) SOS */
-#define quad_t long long
-#define u_quad_t unsigned long long
-#endif
-
- u_quad_t _uquad; /* integer arguments %[diouxX] */
- enum { OCT, DEC, HEX } base;/* base for [diouxX] conversion */
- int dprec; /* a copy of prec if [diouxX], 0 otherwise */
- int fieldsz; /* field size expanded by sign, etc */
- int realsz; /* field size expanded by dprec */
- int size; /* size of converted field or string */
- char *xdigs; /* digits for [xX] conversion */
-#define NIOV 8
- struct __suio uio; /* output information: summary */
- struct __siov iov[NIOV];/* ... and individual io vectors */
- char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */
- char ox[2]; /* space for 0x hex-prefix */
-
- /*
- * Choose PADSIZE to trade efficiency vs. size. If larger printf
- * fields occur frequently, increase PADSIZE and make the initialisers
- * below longer.
- */
-#define PADSIZE 16 /* pad chunk size */
- static char blanks[PADSIZE] =
- {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '};
- static char zeroes[PADSIZE] =
- {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'};
-
- /*
- * BEWARE, these `goto error' on error, and PAD uses `n'.
- */
-#define PRINT(ptr, len) { \
- iovp->iov_base = (ptr); \
- iovp->iov_len = (len); \
- uio.uio_resid += (len); \
- iovp++; \
- if (++uio.uio_iovcnt >= NIOV) { \
- if (__sprint(fp, &uio)) \
- goto error; \
- iovp = iov; \
- } \
-}
-#define PAD(howmany, with) { \
- if ((n = (howmany)) > 0) { \
- while (n > PADSIZE) { \
- PRINT(with, PADSIZE); \
- n -= PADSIZE; \
- } \
- PRINT(with, n); \
- } \
-}
-#define FLUSH() { \
- if (uio.uio_resid && __sprint(fp, &uio)) \
- goto error; \
- uio.uio_iovcnt = 0; \
- iovp = iov; \
-}
-
- /*
- * To extend shorts properly, we need both signed and unsigned
- * argument extraction methods.
- */
-#define SARG() \
- (flags&QUADINT ? va_arg(ap, quad_t) : \
- flags&LONGINT ? va_arg(ap, long) : \
- flags&SHORTINT ? (long)(short)va_arg(ap, int) : \
- (long)va_arg(ap, int))
-#define UARG() \
- (flags&QUADINT ? va_arg(ap, u_quad_t) : \
- flags&LONGINT ? va_arg(ap, u_long) : \
- flags&SHORTINT ? (u_long)(u_short)va_arg(ap, int) : \
- (u_long)va_arg(ap, u_int))
-
- flockfile(fp);
-
- /* sorry, fprintf(read_only_file, "") returns EOF, not 0 */
- if (cantwrite(fp))
- return (EOF);
-
- /* optimise fprintf(stderr) (and other unbuffered Unix files) */
- if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) &&
- fp->_file >= 0) {
- ret = (__sbprintf(fp, fmt0, ap));
- funlockfile(fp);
- return(ret);
- }
-
- fmt = (char *)fmt0;
- uio.uio_iov = iovp = iov;
- uio.uio_resid = 0;
- uio.uio_iovcnt = 0;
- ret = 0;
-
- /*
- * Scan the format for conversions (`%' character).
- */
- for (;;) {
- for (cp = fmt; (ch = *fmt) != '\0' && ch != '%'; fmt++)
- /* void */;
- if ((n = fmt - cp) != 0) {
- PRINT(cp, n);
- ret += n;
- }
- if (ch == '\0')
- goto done;
- fmt++; /* skip over '%' */
-
- flags = 0;
- dprec = 0;
- width = 0;
- prec = -1;
- sign = '\0';
-
-rflag: ch = *fmt++;
-reswitch: switch (ch) {
- case ' ':
- /*
- * ``If the space and + flags both appear, the space
- * flag will be ignored.''
- * -- ANSI X3J11
- */
- if (!sign)
- sign = ' ';
- goto rflag;
- case '#':
- flags |= ALT;
- goto rflag;
- case '*':
- /*
- * ``A negative field width argument is taken as a
- * - flag followed by a positive field width.''
- * -- ANSI X3J11
- * They don't exclude field widths read from args.
- */
- if ((width = va_arg(ap, int)) >= 0)
- goto rflag;
- width = -width;
- /* FALLTHROUGH */
- case '-':
- flags |= LADJUST;
- goto rflag;
- case '+':
- sign = '+';
- goto rflag;
- case '.':
- if ((ch = *fmt++) == '*') {
- n = va_arg(ap, int);
- prec = n < 0 ? -1 : n;
- goto rflag;
- }
- n = 0;
- while (is_digit(ch)) {
- n = 10 * n + to_digit(ch);
- ch = *fmt++;
- }
- prec = n < 0 ? -1 : n;
- goto reswitch;
- case '0':
- /*
- * ``Note that 0 is taken as a flag, not as the
- * beginning of a field width.''
- * -- ANSI X3J11
- */
- flags |= ZEROPAD;
- goto rflag;
- case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- n = 0;
- do {
- n = 10 * n + to_digit(ch);
- ch = *fmt++;
- } while (is_digit(ch));
- width = n;
- goto reswitch;
-#ifdef FLOATING_POINT
- case 'L':
- flags |= LONGDBL;
- goto rflag;
-#endif
- case 'h':
- flags |= SHORTINT;
- goto rflag;
- case 'l':
- flags |= LONGINT;
- goto rflag;
- case 'q':
- flags |= QUADINT;
- goto rflag;
- case 'c':
- *(cp = buf) = va_arg(ap, int);
- size = 1;
- sign = '\0';
- break;
- case 'D':
- flags |= LONGINT;
- /*FALLTHROUGH*/
- case 'd':
- case 'i':
- _uquad = SARG();
- if ((quad_t)_uquad < 0) {
- _uquad = -_uquad;
- sign = '-';
- }
- base = DEC;
- goto number;
-#ifdef FLOATING_POINT
- case 'e':
- case 'E':
- case 'f':
- case 'g':
- case 'G':
- if (prec == -1) {
- prec = DEFPREC;
- } else if ((ch == 'g' || ch == 'G') && prec == 0) {
- prec = 1;
- }
-
- if (flags & LONGDBL) {
- _double = (double) va_arg(ap, long double);
- } else {
- _double = va_arg(ap, double);
- }
-
- /* do this before tricky precision changes */
- /* if (isinf(_double)) {
- if (_double < 0)
- sign = '-';
- cp = "Inf";
- size = 3;
- break;
- } */
-/* if (isnan(_double)) {
- cp = "NaN";
- size = 3;
- break;
- } */
-
- flags |= FPT;
- cp = cvt(_double, prec, flags, &softsign,
- &expt, ch, &ndig);
- if (ch == 'g' || ch == 'G') {
- if (expt <= -4 || expt > prec)
- ch = (ch == 'g') ? 'e' : 'E';
- else
- ch = 'g';
- }
- if (ch <= 'e') { /* 'e' or 'E' fmt */
- --expt;
- expsize = exponent(expstr, expt, ch);
- size = expsize + ndig;
- if (ndig > 1 || flags & ALT)
- ++size;
- } else if (ch == 'f') { /* f fmt */
- if (expt > 0) {
- size = expt;
- if (prec || flags & ALT)
- size += prec + 1;
- } else /* "0.X" */
- size = prec + 2;
- } else if (expt >= ndig) { /* fixed g fmt */
- size = expt;
- if (flags & ALT)
- ++size;
- } else
- size = ndig + (expt > 0 ?
- 1 : 2 - expt);
-
- if (softsign)
- sign = '-';
- break;
-#endif /* FLOATING_POINT */
- case 'n':
- if (flags & QUADINT)
- *va_arg(ap, quad_t *) = ret;
- else if (flags & LONGINT)
- *va_arg(ap, long *) = ret;
- else if (flags & SHORTINT)
- *va_arg(ap, short *) = ret;
- else
- *va_arg(ap, int *) = ret;
- continue; /* no output */
- case 'O':
- flags |= LONGINT;
- /*FALLTHROUGH*/
- case 'o':
- _uquad = UARG();
- base = OCT;
- goto nosign;
- case 'p':
- /*
- * ``The argument shall be a pointer to void. The
- * value of the pointer is converted to a sequence
- * of printable characters, in an implementation-
- * defined manner.''
- * -- ANSI X3J11
- */
- /* NOSTRICT */
- _uquad = (u_quad_t)(size_t)va_arg(ap, void *);
- base = HEX;
- xdigs = "0123456789abcdef";
- flags |= HEXPREFIX;
- ch = 'x';
- goto nosign;
- case 's':
- if ((cp = va_arg(ap, char *)) == NULL)
- cp = "(null)";
- if (prec >= 0) {
- /*
- * can't use strlen; can only look for the
- * NUL in the first `prec' characters, and
- * strlen() will go further.
- */
- char *p = memchr(cp, 0, prec);
-
- if (p != NULL) {
- size = p - cp;
- if (size > prec)
- size = prec;
- } else
- size = prec;
- } else
- size = strlen(cp);
- sign = '\0';
- break;
- case 'U':
- flags |= LONGINT;
- /*FALLTHROUGH*/
- case 'u':
- _uquad = UARG();
- base = DEC;
- goto nosign;
- case 'X':
- xdigs = "0123456789ABCDEF";
- goto hex;
- case 'x':
- xdigs = "0123456789abcdef";
-hex: _uquad = UARG();
- base = HEX;
- /* leading 0x/X only if non-zero */
- if (flags & ALT && _uquad != 0)
- flags |= HEXPREFIX;
-
- /* unsigned conversions */
-nosign: sign = '\0';
- /*
- * ``... diouXx conversions ... if a precision is
- * specified, the 0 flag will be ignored.''
- * -- ANSI X3J11
- */
-number: if ((dprec = prec) >= 0)
- flags &= ~ZEROPAD;
-
- /*
- * ``The result of converting a zero value with an
- * explicit precision of zero is no characters.''
- * -- ANSI X3J11
- */
- cp = buf + BUF;
- if (_uquad != 0 || prec != 0) {
- /*
- * Unsigned mod is hard, and unsigned mod
- * by a constant is easier than that by
- * a variable; hence this switch.
- */
- switch (base) {
- case OCT:
- do {
- *--cp = to_char(_uquad & 7);
- _uquad >>= 3;
- } while (_uquad);
- /* handle octal leading 0 */
- if (flags & ALT && *cp != '0')
- *--cp = '0';
- break;
-
- case DEC:
- /* many numbers are 1 digit */
- while (_uquad >= 10) {
- *--cp = to_char(_uquad % 10);
- _uquad /= 10;
- }
- *--cp = to_char(_uquad);
- break;
-
- case HEX:
- do {
- *--cp = xdigs[_uquad & 15];
- _uquad >>= 4;
- } while (_uquad);
- break;
-
- default:
- cp = "bug in vfprintf: bad base";
- size = strlen(cp);
- goto skipsize;
- }
- }
- size = buf + BUF - cp;
- skipsize:
- break;
- default: /* "%?" prints ?, unless ? is NUL */
- if (ch == '\0')
- goto done;
- /* pretend it was %c with argument ch */
- cp = buf;
- *cp = ch;
- size = 1;
- sign = '\0';
- break;
- }
-
- /*
- * All reasonable formats wind up here. At this point, `cp'
- * points to a string which (if not flags&LADJUST) should be
- * padded out to `width' places. If flags&ZEROPAD, it should
- * first be prefixed by any sign or other prefix; otherwise,
- * it should be blank padded before the prefix is emitted.
- * After any left-hand padding and prefixing, emit zeroes
- * required by a decimal [diouxX] precision, then print the
- * string proper, then emit zeroes required by any leftover
- * floating precision; finally, if LADJUST, pad with blanks.
- *
- * Compute actual size, so we know how much to pad.
- * fieldsz excludes decimal prec; realsz includes it.
- */
- fieldsz = size;
- if (sign)
- fieldsz++;
- else if (flags & HEXPREFIX)
- fieldsz += 2;
- realsz = dprec > fieldsz ? dprec : fieldsz;
-
- /* right-adjusting blank padding */
- if ((flags & (LADJUST|ZEROPAD)) == 0)
- PAD(width - realsz, blanks);
-
- /* prefix */
- if (sign) {
- PRINT(&sign, 1);
- } else if (flags & HEXPREFIX) {
- ox[0] = '0';
- ox[1] = ch;
- PRINT(ox, 2);
- }
-
- /* right-adjusting zero padding */
- if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD)
- PAD(width - realsz, zeroes);
-
- /* leading zeroes from decimal precision */
- PAD(dprec - fieldsz, zeroes);
-
- /* the string or number proper */
-#ifdef FLOATING_POINT
- if ((flags & FPT) == 0) {
- PRINT(cp, size);
- } else { /* glue together f_p fragments */
- if (ch >= 'f') { /* 'f' or 'g' */
- if (_double == 0) {
- /* kludge for __dtoa irregularity */
- if (expt >= ndig && (flags & ALT) == 0) {
- PRINT("0", 1);
- } else {
- PRINT("0.", 2);
- PAD(ndig - 1, zeroes);
- }
- } else if (expt <= 0) {
- PRINT("0.", 2);
- PAD(-expt, zeroes);
- PRINT(cp, ndig);
- } else if (expt >= ndig) {
- PRINT(cp, ndig);
- PAD(expt - ndig, zeroes);
- if (flags & ALT)
- PRINT(".", 1);
- } else {
- PRINT(cp, expt);
- cp += expt;
- PRINT(".", 1);
- PRINT(cp, ndig-expt);
- }
- } else { /* 'e' or 'E' */
- if (ndig > 1 || flags & ALT) {
- ox[0] = *cp++;
- ox[1] = '.';
- PRINT(ox, 2);
- if (_double || flags & ALT == 0) {
- PRINT(cp, ndig-1);
- } else /* 0.[0..] */
- /* __dtoa irregularity */
- PAD(ndig - 1, zeroes);
- } else /* XeYYY */
- PRINT(cp, 1);
- PRINT(expstr, expsize);
- }
- }
-#else
- PRINT(cp, size);
-#endif
- /* left-adjusting padding (always blank) */
- if (flags & LADJUST)
- PAD(width - realsz, blanks);
-
- /* finally, adjust ret */
- ret += width > realsz ? width : realsz;
-
- FLUSH(); /* copy out the I/O vectors */
- }
-done:
- FLUSH();
-error:
- if (__sferror(fp))
- ret = EOF;
- funlockfile(fp);
- return (ret);
-}
-
-#ifdef FLOATING_POINT
-
-extern char *__dtoa __P_((double, int, int, int *, int *, char **));
-
-static char *
-cvt(value, ndigits, flags, sign, decpt, ch, length)
- double value;
- int ndigits, flags, *decpt, ch, *length;
- char *sign;
-{
- int mode, dsgn;
- char *digits, *bp, *rve;
-
- if (ch == 'f') {
- mode = 3; /* ndigits after the decimal point */
- } else {
- /* To obtain ndigits after the decimal point for the 'e'
- * and 'E' formats, round to ndigits + 1 significant
- * figures.
- */
- if (ch == 'e' || ch == 'E') {
- ndigits++;
- }
- mode = 2; /* ndigits significant digits */
- }
-
- if (value < 0) {
- value = -value;
- *sign = '-';
- } else
- *sign = '\000';
-/* #if !defined(__alpha__) && !defined(hpux) */
-#ifndef THIS_IS_NEVER_DEFINED
- digits = __dtoa(value, mode, ndigits, decpt, &dsgn, &rve);
-#else
- { char *ecvt(double,int,int*,int*);
-
- digits = ecvt(value, ndigits, decpt, &dsgn);
- rve = (digits + (int)strlen(digits));
- }
-#endif
- if ((ch != 'g' && ch != 'G') || flags & ALT) { /* Print trailing zeros */
- bp = digits + ndigits;
- if (ch == 'f') {
- if (*digits == '0' && value)
- *decpt = -ndigits + 1;
- bp += *decpt;
- }
- if (value == 0) /* kludge for __dtoa irregularity */
- rve = bp;
- while (rve < bp)
- *rve++ = '0';
- }
- *length = rve - digits;
- return (digits);
-}
-
-static int
-exponent(p0, exp, fmtch)
- char *p0;
- int exp, fmtch;
-{
- register char *p, *t;
- char expbuf[MAXEXP];
-
- p = p0;
- *p++ = fmtch;
- if (exp < 0) {
- exp = -exp;
- *p++ = '-';
- }
- else
- *p++ = '+';
- t = expbuf + MAXEXP;
- if (exp > 9) {
- do {
- *--t = to_char(exp % 10);
- } while ((exp /= 10) > 9);
- *--t = to_char(exp);
- for (; t < expbuf + MAXEXP; *p++ = *t++);
- }
- else {
- *p++ = '0';
- *p++ = to_char(exp);
- }
- return (p - p0);
-}
-#endif /* FLOATING_POINT */
diff --git a/mit-pthreads/stdio/vfscanf.c b/mit-pthreads/stdio/vfscanf.c
deleted file mode 100644
index f6d0a40aa51..00000000000
--- a/mit-pthreads/stdio/vfscanf.c
+++ /dev/null
@@ -1,750 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)vfscanf.c 5.7 (Berkeley) 12/14/92";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#if __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#include "local.h"
-
-#define FLOATING_POINT
-
-#include "floatio.h"
-#define BUF 513 /* Maximum length of numeric string. */
-
-/*
- * Flags used during conversion.
- */
-#define LONG 0x01 /* l: long or double */
-#define LONGDBL 0x02 /* L: long double; unimplemented */
-#define SHORT 0x04 /* h: short */
-#define SUPPRESS 0x08 /* suppress assignment */
-#define POINTER 0x10 /* weird %p pointer (`fake hex') */
-#define NOSKIP 0x20 /* do not skip blanks */
-
-/*
- * The following are used in numeric conversions only:
- * SIGNOK, NDIGITS, DPTOK, and EXPOK are for floating point;
- * SIGNOK, NDIGITS, PFXOK, and NZDIGITS are for integral.
- */
-#define SIGNOK 0x40 /* +/- is (still) legal */
-#define NDIGITS 0x80 /* no digits detected */
-
-#define DPTOK 0x100 /* (float) decimal point is still legal */
-#define EXPOK 0x200 /* (float) exponent (e+3, etc) still legal */
-
-#define PFXOK 0x100 /* 0x prefix is (still) legal */
-#define NZDIGITS 0x200 /* no zero digits detected */
-
-/*
- * Conversion types.
- */
-#define CT_CHAR 0 /* %c conversion */
-#define CT_CCL 1 /* %[...] conversion */
-#define CT_STRING 2 /* %s conversion */
-#define CT_INT 3 /* integer, i.e., strtol or strtoul */
-#define CT_FLOAT 4 /* floating, i.e., strtod */
-
-#define u_char unsigned char
-#define u_long unsigned long
-
-static u_char *__sccl();
-
-/*
- * vfscanf
- */
-__svfscanf(fp, fmt0, ap)
- register FILE *fp;
- char const *fmt0;
- pthread_va_list ap;
-{
- register u_char *fmt = (u_char *)fmt0;
- register int c; /* character from format, or conversion */
- register size_t width; /* field width, or 0 */
- register char *p; /* points into all kinds of strings */
- register int n; /* handy integer */
- register int flags; /* flags as defined above */
- register char *p0; /* saves original value of p when necessary */
- int nassigned; /* number of fields assigned */
- int nread; /* number of characters consumed from fp */
- int base; /* base argument to strtol/strtoul */
- u_long (*ccfn)(); /* conversion function (strtol/strtoul) */
- char ccltab[256]; /* character class table for %[...] */
- char buf[BUF]; /* buffer for numeric conversions */
-
- /* `basefix' is used to avoid `if' tests in the integer scanner */
- static short basefix[17] =
- { 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
-
- nassigned = 0;
- nread = 0;
- base = 0; /* XXX just to keep gcc happy */
- ccfn = NULL; /* XXX just to keep gcc happy */
- for (;;) {
- c = *fmt++;
- if (c == 0)
- return (nassigned);
- if (isspace(c)) {
- for (;;) {
- if (fp->_r <= 0 && __srefill(fp))
- return (nassigned);
- if (!isspace(*fp->_p))
- break;
- nread++, fp->_r--, fp->_p++;
- }
- continue;
- }
- if (c != '%')
- goto literal;
- width = 0;
- flags = 0;
- /*
- * switch on the format. continue if done;
- * break once format type is derived.
- */
-again: c = *fmt++;
- switch (c) {
- case '%':
-literal:
- if (fp->_r <= 0 && __srefill(fp))
- goto input_failure;
- if (*fp->_p != c)
- goto match_failure;
- fp->_r--, fp->_p++;
- nread++;
- continue;
-
- case '*':
- flags |= SUPPRESS;
- goto again;
- case 'l':
- flags |= LONG;
- goto again;
- case 'L':
- flags |= LONGDBL;
- goto again;
- case 'h':
- flags |= SHORT;
- goto again;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- width = width * 10 + c - '0';
- goto again;
-
- /*
- * Conversions.
- * Those marked `compat' are for 4.[123]BSD compatibility.
- *
- * (According to ANSI, E and X formats are supposed
- * to the same as e and x. Sorry about that.)
- */
- case 'D': /* compat */
- flags |= LONG;
- /* FALLTHROUGH */
- case 'd':
- c = CT_INT;
- ccfn = (u_long (*)())strtol;
- base = 10;
- break;
-
- case 'i':
- c = CT_INT;
- ccfn = (u_long (*)())strtol;
- base = 0;
- break;
-
- case 'O': /* compat */
- flags |= LONG;
- /* FALLTHROUGH */
- case 'o':
- c = CT_INT;
- ccfn = strtoul;
- base = 8;
- break;
-
- case 'u':
- c = CT_INT;
- ccfn = strtoul;
- base = 10;
- break;
-
- case 'X': /* compat XXX */
- flags |= LONG;
- /* FALLTHROUGH */
- case 'x':
- flags |= PFXOK; /* enable 0x prefixing */
- c = CT_INT;
- ccfn = strtoul;
- base = 16;
- break;
-
-#ifdef FLOATING_POINT
- case 'E': /* compat XXX */
- case 'F': /* compat */
- flags |= LONG;
- /* FALLTHROUGH */
- case 'e': case 'f': case 'g':
- c = CT_FLOAT;
- break;
-#endif
-
- case 's':
- c = CT_STRING;
- break;
-
- case '[':
- fmt = __sccl(ccltab, fmt);
- flags |= NOSKIP;
- c = CT_CCL;
- break;
-
- case 'c':
- flags |= NOSKIP;
- c = CT_CHAR;
- break;
-
- case 'p': /* pointer format is like hex */
- flags |= POINTER | PFXOK;
- c = CT_INT;
- ccfn = strtoul;
- base = 16;
- break;
-
- case 'n':
- if (flags & SUPPRESS) /* ??? */
- continue;
- if (flags & SHORT)
- *va_arg(ap, short *) = nread;
- else if (flags & LONG)
- *va_arg(ap, long *) = nread;
- else
- *va_arg(ap, int *) = nread;
- continue;
-
- /*
- * Disgusting backwards compatibility hacks. XXX
- */
- case '\0': /* compat */
- return (EOF);
-
- default: /* compat */
- if (isupper(c))
- flags |= LONG;
- c = CT_INT;
- ccfn = (u_long (*)())strtol;
- base = 10;
- break;
- }
-
- /*
- * We have a conversion that requires input.
- */
- if (fp->_r <= 0 && __srefill(fp))
- goto input_failure;
-
- /*
- * Consume leading white space, except for formats
- * that suppress this.
- */
- if ((flags & NOSKIP) == 0) {
- while (isspace(*fp->_p)) {
- nread++;
- if (--fp->_r > 0)
- fp->_p++;
- else if (__srefill(fp))
- goto input_failure;
- }
- /*
- * Note that there is at least one character in
- * the buffer, so conversions that do not set NOSKIP
- * ca no longer result in an input failure.
- */
- }
-
- /*
- * Do the conversion.
- */
- switch (c) {
-
- case CT_CHAR:
- /* scan arbitrary characters (sets NOSKIP) */
- if (width == 0)
- width = 1;
- if (flags & SUPPRESS) {
- size_t sum = 0;
- for (;;) {
- if ((n = fp->_r) < width) {
- sum += n;
- width -= n;
- fp->_p += n;
- if (__srefill(fp)) {
- if (sum == 0)
- goto input_failure;
- break;
- }
- } else {
- sum += width;
- fp->_r -= width;
- fp->_p += width;
- break;
- }
- }
- nread += sum;
- } else {
- size_t r = fread((void *)va_arg(ap, char *), 1,
- width, fp);
-
- if (r == 0)
- goto input_failure;
- nread += r;
- nassigned++;
- }
- break;
-
- case CT_CCL:
- /* scan a (nonempty) character class (sets NOSKIP) */
- if (width == 0)
- width = ~0; /* `infinity' */
- /* take only those things in the class */
- if (flags & SUPPRESS) {
- n = 0;
- while (ccltab[*fp->_p]) {
- n++, fp->_r--, fp->_p++;
- if (--width == 0)
- break;
- if (fp->_r <= 0 && __srefill(fp)) {
- if (n == 0)
- goto input_failure;
- break;
- }
- }
- if (n == 0)
- goto match_failure;
- } else {
- p0 = p = va_arg(ap, char *);
- while (ccltab[*fp->_p]) {
- fp->_r--;
- *p++ = *fp->_p++;
- if (--width == 0)
- break;
- if (fp->_r <= 0 && __srefill(fp)) {
- if (p == p0)
- goto input_failure;
- break;
- }
- }
- n = p - p0;
- if (n == 0)
- goto match_failure;
- *p = 0;
- nassigned++;
- }
- nread += n;
- break;
-
- case CT_STRING:
- /* like CCL, but zero-length string OK, & no NOSKIP */
- if (width == 0)
- width = ~0;
- if (flags & SUPPRESS) {
- n = 0;
- while (!isspace(*fp->_p)) {
- n++, fp->_r--, fp->_p++;
- if (--width == 0)
- break;
- if (fp->_r <= 0 && __srefill(fp))
- break;
- }
- nread += n;
- } else {
- p0 = p = va_arg(ap, char *);
- while (!isspace(*fp->_p)) {
- fp->_r--;
- *p++ = *fp->_p++;
- if (--width == 0)
- break;
- if (fp->_r <= 0 && __srefill(fp))
- break;
- }
- *p = 0;
- nread += p - p0;
- nassigned++;
- }
- continue;
-
- case CT_INT:
- /* scan an integer as if by strtol/strtoul */
-#ifdef hardway
- if (width == 0 || width > sizeof(buf) - 1)
- width = sizeof(buf) - 1;
-#else
- /* size_t is unsigned, hence this optimisation */
- if (--width > sizeof(buf) - 2)
- width = sizeof(buf) - 2;
- width++;
-#endif
- flags |= SIGNOK | NDIGITS | NZDIGITS;
- for (p = buf; width; width--) {
- c = *fp->_p;
- /*
- * Switch on the character; `goto ok'
- * if we accept it as a part of number.
- */
- switch (c) {
-
- /*
- * The digit 0 is always legal, but is
- * special. For %i conversions, if no
- * digits (zero or nonzero) have been
- * scanned (only signs), we will have
- * base==0. In that case, we should set
- * it to 8 and enable 0x prefixing.
- * Also, if we have not scanned zero digits
- * before this, do not turn off prefixing
- * (someone else will turn it off if we
- * have scanned any nonzero digits).
- */
- case '0':
- if (base == 0) {
- base = 8;
- flags |= PFXOK;
- }
- if (flags & NZDIGITS)
- flags &= ~(SIGNOK|NZDIGITS|NDIGITS);
- else
- flags &= ~(SIGNOK|PFXOK|NDIGITS);
- goto ok;
-
- /* 1 through 7 always legal */
- case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- base = basefix[base];
- flags &= ~(SIGNOK | PFXOK | NDIGITS);
- goto ok;
-
- /* digits 8 and 9 ok iff decimal or hex */
- case '8': case '9':
- base = basefix[base];
- if (base <= 8)
- break; /* not legal here */
- flags &= ~(SIGNOK | PFXOK | NDIGITS);
- goto ok;
-
- /* letters ok iff hex */
- case 'A': case 'B': case 'C':
- case 'D': case 'E': case 'F':
- case 'a': case 'b': case 'c':
- case 'd': case 'e': case 'f':
- /* no need to fix base here */
- if (base <= 10)
- break; /* not legal here */
- flags &= ~(SIGNOK | PFXOK | NDIGITS);
- goto ok;
-
- /* sign ok only as first character */
- case '+': case '-':
- if (flags & SIGNOK) {
- flags &= ~SIGNOK;
- goto ok;
- }
- break;
-
- /* x ok iff flag still set & 2nd char */
- case 'x': case 'X':
- if (flags & PFXOK && p == buf + 1) {
- base = 16; /* if %i */
- flags &= ~PFXOK;
- goto ok;
- }
- break;
- }
-
- /*
- * If we got here, c is not a legal character
- * for a number. Stop accumulating digits.
- */
- break;
- ok:
- /*
- * c is legal: store it and look at the next.
- */
- *p++ = c;
- if (--fp->_r > 0)
- fp->_p++;
- else if (__srefill(fp))
- break; /* EOF */
- }
- /*
- * If we had only a sign, it is no good; push
- * back the sign. If the number ends in `x',
- * it was [sign] '0' 'x', so push back the x
- * and treat it as [sign] '0'.
- */
- if (flags & NDIGITS) {
- if (p > buf)
- (void) ungetc(*(u_char *)--p, fp);
- goto match_failure;
- }
- c = ((u_char *)p)[-1];
- if (c == 'x' || c == 'X') {
- --p;
- (void) ungetc(c, fp);
- }
- if ((flags & SUPPRESS) == 0) {
- u_long res;
-
- *p = 0;
- res = (*ccfn)(buf, (char **)NULL, base);
- if (flags & POINTER)
- *va_arg(ap, void **) = (void *)res;
- else if (flags & SHORT)
- *va_arg(ap, short *) = res;
- else if (flags & LONG)
- *va_arg(ap, long *) = res;
- else
- *va_arg(ap, int *) = res;
- nassigned++;
- }
- nread += p - buf;
- break;
-
-#ifdef FLOATING_POINT
- case CT_FLOAT:
- /* scan a floating point number as if by strtod */
-#ifdef hardway
- if (width == 0 || width > sizeof(buf) - 1)
- width = sizeof(buf) - 1;
-#else
- /* size_t is unsigned, hence this optimisation */
- if (--width > sizeof(buf) - 2)
- width = sizeof(buf) - 2;
- width++;
-#endif
- flags |= SIGNOK | NDIGITS | DPTOK | EXPOK;
- for (p = buf; width; width--) {
- c = *fp->_p;
- /*
- * This code mimicks the integer conversion
- * code, but is much simpler.
- */
- switch (c) {
-
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- case '8': case '9':
- flags &= ~(SIGNOK | NDIGITS);
- goto fok;
-
- case '+': case '-':
- if (flags & SIGNOK) {
- flags &= ~SIGNOK;
- goto fok;
- }
- break;
- case '.':
- if (flags & DPTOK) {
- flags &= ~(SIGNOK | DPTOK);
- goto fok;
- }
- break;
- case 'e': case 'E':
- /* no exponent without some digits */
- if ((flags&(NDIGITS|EXPOK)) == EXPOK) {
- flags =
- (flags & ~(EXPOK|DPTOK)) |
- SIGNOK | NDIGITS;
- goto fok;
- }
- break;
- }
- break;
- fok:
- *p++ = c;
- if (--fp->_r > 0)
- fp->_p++;
- else if (__srefill(fp))
- break; /* EOF */
- }
- /*
- * If no digits, might be missing exponent digits
- * (just give back the exponent) or might be missing
- * regular digits, but had sign and/or decimal point.
- */
- if (flags & NDIGITS) {
- if (flags & EXPOK) {
- /* no digits at all */
- while (p > buf)
- ungetc(*(u_char *)--p, fp);
- goto match_failure;
- }
- /* just a bad exponent (e and maybe sign) */
- c = *(u_char *)--p;
- if (c != 'e' && c != 'E') {
- (void) ungetc(c, fp);/* sign */
- c = *(u_char *)--p;
- }
- (void) ungetc(c, fp);
- }
- if ((flags & SUPPRESS) == 0) {
- double res;
-
- *p = 0;
- res = strtod(buf, (char **) NULL);
- if (flags & LONG)
- *va_arg(ap, double *) = res;
- else
- *va_arg(ap, float *) = res;
- nassigned++;
- }
- nread += p - buf;
- break;
-#endif /* FLOATING_POINT */
- }
- }
-input_failure:
- return (nassigned ? nassigned : -1);
-match_failure:
- return (nassigned);
-}
-
-/*
- * Fill in the given table from the scanset at the given format
- * (just after `['). Return a pointer to the character past the
- * closing `]'. The table has a 1 wherever characters should be
- * considered part of the scanset.
- */
-static u_char *
-__sccl(tab, fmt)
- register char *tab;
- register u_char *fmt;
-{
- register int c, n, v;
-
- /* first `clear' the whole table */
- c = *fmt++; /* first char hat => negated scanset */
- if (c == '^') {
- v = 1; /* default => accept */
- c = *fmt++; /* get new first char */
- } else
- v = 0; /* default => reject */
- /* should probably use memset here */
- for (n = 0; n < 256; n++)
- tab[n] = v;
- if (c == 0)
- return (fmt - 1);/* format ended before closing ] */
-
- /*
- * Now set the entries corresponding to the actual scanset
- * to the opposite of the above.
- *
- * The first character may be ']' (or '-') without being special;
- * the last character may be '-'.
- */
- v = 1 - v;
- for (;;) {
- tab[c] = v; /* take character c */
-doswitch:
- n = *fmt++; /* and examine the next */
- switch (n) {
-
- case 0: /* format ended too soon */
- return (fmt - 1);
-
- case '-':
- /*
- * A scanset of the form
- * [01+-]
- * is defined as `the digit 0, the digit 1,
- * the character +, the character -', but
- * the effect of a scanset such as
- * [a-zA-Z0-9]
- * is implementation defined. The V7 Unix
- * scanf treats `a-z' as `the letters a through
- * z', but treats `a-a' as `the letter a, the
- * character -, and the letter a'.
- *
- * For compatibility, the `-' is not considerd
- * to define a range if the character following
- * it is either a close bracket (required by ANSI)
- * or is not numerically greater than the character
- * we just stored in the table (c).
- */
- n = *fmt;
- if (n == ']' || n < c) {
- c = '-';
- break; /* resume the for(;;) */
- }
- fmt++;
- do { /* fill in the range */
- tab[++c] = v;
- } while (c < n);
-#if 1 /* XXX another disgusting compatibility hack */
- /*
- * Alas, the V7 Unix scanf also treats formats
- * such as [a-c-e] as `the letters a through e'.
- * This too is permitted by the standard....
- */
- goto doswitch;
-#else
- c = *fmt++;
- if (c == 0)
- return (fmt - 1);
- if (c == ']')
- return (fmt);
-#endif
- break;
-
- case ']': /* end of scanset */
- return (fmt);
-
- default: /* just another character */
- c = n;
- break;
- }
- }
- /* NOTREACHED */
-}
diff --git a/mit-pthreads/stdio/vprintf.c b/mit-pthreads/stdio/vprintf.c
deleted file mode 100644
index 4999c4fb239..00000000000
--- a/mit-pthreads/stdio/vprintf.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)vprintf.c 5.6 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdarg.h>
-#include <stdio.h>
-
-vprintf(fmt, ap)
- char const *fmt;
- pthread_va_list ap;
-{
- return (vfprintf(stdout, fmt, ap));
-}
diff --git a/mit-pthreads/stdio/vscanf.c b/mit-pthreads/stdio/vscanf.c
deleted file mode 100644
index 5a562f89528..00000000000
--- a/mit-pthreads/stdio/vscanf.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Donn Seeley at UUNET Technologies, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)vscanf.c 5.1 (Berkeley) 4/15/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdarg.h>
-#include <stdio.h>
-
-vscanf(fmt, ap)
- const char *fmt;
- pthread_va_list ap;
-{
- int r;
- flockfile(stdin);
- r = __svfscanf(stdin, fmt, ap);
- funlockfile(stdin);
- return(r);
-}
diff --git a/mit-pthreads/stdio/vsnprintf.c b/mit-pthreads/stdio/vsnprintf.c
deleted file mode 100644
index 8fd1e6d8613..00000000000
--- a/mit-pthreads/stdio/vsnprintf.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)vsnprintf.c 5.2 (Berkeley) 2/5/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdio.h>
-
-vsnprintf(str, n, fmt, ap)
- char *str;
- size_t n;
- const char *fmt;
- pthread_va_list ap;
-{
- int ret;
- FILE f;
-
- if ((int)n < 1)
- return (EOF);
- f._file = -1;
- f._flags = __SWR | __SSTR;
- f._bf._base = f._p = (unsigned char *)str;
- f._bf._size = f._w = n - 1;
- ret = vfprintf(&f, fmt, ap);
- *f._p = 0;
- return (ret);
-}
diff --git a/mit-pthreads/stdio/vsprintf.c b/mit-pthreads/stdio/vsprintf.c
deleted file mode 100644
index c6cdb708be3..00000000000
--- a/mit-pthreads/stdio/vsprintf.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)vsprintf.c 5.5 (Berkeley) 2/5/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdarg.h>
-#include <limits.h>
-#include <stdio.h>
-
-vsprintf(str, fmt, ap)
- char *str;
- const char *fmt;
- pthread_va_list ap;
-{
- int ret;
- FILE f;
-
- f._file = -1;
- f._flags = __SWR | __SSTR;
- f._bf._base = f._p = (unsigned char *)str;
- f._bf._size = f._w = INT_MAX;
- ret = vfprintf(&f, fmt, ap);
- *f._p = 0;
- return (ret);
-}
diff --git a/mit-pthreads/stdio/vsscanf.c b/mit-pthreads/stdio/vsscanf.c
deleted file mode 100644
index 9d9cdcffeeb..00000000000
--- a/mit-pthreads/stdio/vsscanf.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Donn Seeley at UUNET Technologies, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)vsscanf.c 5.1 (Berkeley) 4/15/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-
-vsscanf(str, fmt, ap)
- const char *str;
- const char *fmt;
- pthread_va_list ap;
-{
- int ret;
- FILE f;
-
- f._flags = __SRD;
- f._file = -1; /* This will do the right thing */
- f._bf._base = f._p = (unsigned char *)str;
- f._bf._size = f._r = strlen(str);
- f._ub._base = NULL;
- f._lb._base = NULL;
- return (__svfscanf(&f, fmt, ap));
-}
diff --git a/mit-pthreads/stdio/wbuf.c b/mit-pthreads/stdio/wbuf.c
deleted file mode 100644
index 58cb9ad058e..00000000000
--- a/mit-pthreads/stdio/wbuf.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)wbuf.c 5.6 (Berkeley) 1/20/91";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-#include "local.h"
-
-/*
- * Write the given character into the (probably full) buffer for
- * the given file. Flush the buffer out if it is or becomes full,
- * or if c=='\n' and the file is line buffered.
- */
-__swbuf(c, fp)
- register int c;
- register FILE *fp;
-{
- register int n;
-
- /*
- * In case we cannot write, or longjmp takes us out early,
- * make sure _w is 0 (if fully- or un-buffered) or -_bf._size
- * (if line buffered) so that we will get called again.
- * If we did not do this, a sufficient number of putc()
- * calls might wrap _w from negative to positive.
- */
- fp->_w = fp->_lbfsize;
- if (cantwrite(fp))
- return (EOF);
- c = (unsigned char)c;
-
- /*
- * If it is completely full, flush it out. Then, in any case,
- * stuff c into the buffer. If this causes the buffer to fill
- * completely, or if c is '\n' and the file is line buffered,
- * flush it (perhaps a second time). The second flush will always
- * happen on unbuffered streams, where _bf._size==1; fflush()
- * guarantees that putc() will always call wbuf() by setting _w
- * to 0, so we need not do anything else.
- */
- n = fp->_p - fp->_bf._base;
- if (n >= fp->_bf._size) {
- if (fflush(fp))
- return (EOF);
- n = 0;
- }
- fp->_w--;
- *fp->_p++ = c;
- if (++n == fp->_bf._size || (fp->_flags & __SLBF && c == '\n'))
- if (fflush(fp))
- return (EOF);
- return (c);
-}
diff --git a/mit-pthreads/stdio/wsetup.c b/mit-pthreads/stdio/wsetup.c
deleted file mode 100644
index 1c86f45a973..00000000000
--- a/mit-pthreads/stdio/wsetup.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1993, 1994 Chris Provenzano.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Chris Torek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)wsetup.c 5.2 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "local.h"
-
-/*
- * Various output routines call wsetup to be sure it is safe to write,
- * because either _flags does not include __SWR, or _buf is NULL.
- * _wsetup returns 0 if OK to write, nonzero otherwise.
- */
-__swsetup(fp)
- register FILE *fp;
-{
- /* make sure stdio is set up */
- __sinit ();
-
- /*
- * If we are not writing, we had better be reading and writing.
- */
- if ((fp->_flags & __SWR) == 0) {
- if ((fp->_flags & __SRW) == 0)
- return (EOF);
- if (fp->_flags & __SRD) {
- /* clobber any ungetc data */
- if (HASUB(fp))
- FREEUB(fp);
- fp->_flags &= ~(__SRD|__SEOF);
- fp->_r = 0;
- fp->_p = fp->_bf._base;
- }
- fp->_flags |= __SWR;
- }
-
- /*
- * Make a buffer if necessary, then set _w.
- */
- if (fp->_bf._base == NULL)
- __smakebuf(fp);
- if (fp->_flags & __SLBF) {
- /*
- * It is line buffered, so make _lbfsize be -_bufsize
- * for the putc() macro. We will change _lbfsize back
- * to 0 whenever we turn off __SWR.
- */
- fp->_w = 0;
- fp->_lbfsize = -fp->_bf._size;
- } else
- fp->_w = fp->_flags & __SNBF ? 0 : fp->_bf._size;
- return (0);
-}
diff --git a/mit-pthreads/stdio/xprintf.c b/mit-pthreads/stdio/xprintf.c
deleted file mode 100644
index 668e8bc0605..00000000000
--- a/mit-pthreads/stdio/xprintf.c
+++ /dev/null
@@ -1,883 +0,0 @@
-/*
-** It turns out that the printf functions in the stock MIT pthread library
-** is busted. It isn't thread safe. If two threads try to do a printf
-** of a floating point value at the same time, a core-dump might result.
-** So this code is substituted.
-*/
-/*
-** NAME: $Source$
-** VERSION: $Revision$
-** DATE: $Date$
-**
-** ONELINER: A replacement for formatted printing programs.
-**
-** COPYRIGHT:
-** Copyright (c) 1990 by D. Richard Hipp. This code is an original
-** work and has been prepared without reference to any prior
-** implementations of similar functions. No part of this code is
-** subject to licensing restrictions of any telephone company or
-** university.
-**
-** This copyright was released and the code placed in the public domain
-** by the author, D. Richard Hipp, on October 3, 1996.
-**
-** DESCRIPTION:
-** This program is an enhanced replacement for the "printf" programs
-** found in the standard library. The following enhancements are
-** supported:
-**
-** + Additional functions. The standard set of "printf" functions
-** includes printf, fprintf, sprintf, vprintf, vfprintf, and
-** vsprintf. This module adds the following:
-**
-** * snprintf -- Works like sprintf, but has an extra argument
-** which is the size of the buffer written to.
-**
-** * mprintf -- Similar to sprintf. Writes output to memory
-** obtained from mem_alloc.
-**
-** * xprintf -- Calls a function to dispose of output.
-**
-** * nprintf -- No output, but returns the number of characters
-** that would have been output by printf.
-**
-** * A v- version (ex: vsnprintf) of every function is also
-** supplied.
-**
-** + A few extensions to the formatting notation are supported:
-**
-** * The "=" flag (similar to "-") causes the output to be
-** be centered in the appropriately sized field.
-**
-** * The %b field outputs an integer in binary notation.
-**
-** * The %c field now accepts a precision. The character output
-** is repeated by the number of times the precision specifies.
-**
-** * The %' field works like %c, but takes as its character the
-** next character of the format string, instead of the next
-** argument. For example, printf("%.78'-") prints 78 minus
-** signs, the same as printf("%.78c",'-').
-**
-** + When compiled using GCC on a SPARC, this version of printf is
-** faster than the library printf for SUN OS 4.1.
-**
-** + All functions are fully reentrant.
-**
-*/
-/*
-** Undefine COMPATIBILITY to make some slight changes in the way things
-** work. I think the changes are an improvement, but they are not
-** backwards compatible.
-*/
-/* #define COMPATIBILITY / * Compatible with SUN OS 4.1 */
-#include <stdio.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-/*
-** The maximum number of digits of accuracy in a floating-point conversion.
-*/
-#define MAXDIG 20
-
-/*
-** Conversion types fall into various categories as defined by the
-** following enumeration.
-*/
-enum e_type { /* The type of the format field */
- RADIX, /* Integer types. %d, %x, %o, and so forth */
- FLOAT, /* Floating point. %f */
- EXP, /* Exponentional notation. %e and %E */
- GENERIC, /* Floating or exponential, depending on exponent. %g */
- SIZE, /* Return number of characters processed so far. %n */
- STRING, /* Strings. %s */
- PERCENT, /* Percent symbol. %% */
- CHAR, /* Characters. %c */
- ERROR, /* Used to indicate no such conversion type */
-/* The rest are extensions, not normally found in printf() */
- CHARLIT, /* Literal characters. %' */
- SEEIT, /* Strings with visible control characters. %S */
- MEM_STRING, /* A string which should be deleted after use. %z */
- ORDINAL, /* 1st, 2nd, 3rd and so forth */
-};
-
-/*
-** Each builtin conversion character (ex: the 'd' in "%d") is described
-** by an instance of the following structure
-*/
-typedef struct s_info { /* Information about each format field */
- int fmttype; /* The format field code letter */
- int base; /* The base for radix conversion */
- char *charset; /* The character set for conversion */
- int flag_signed; /* Is the quantity signed? */
- char *prefix; /* Prefix on non-zero values in alt format */
- enum e_type type; /* Conversion paradigm */
-} info;
-
-/*
-** The following table is searched linearly, so it is good to put the
-** most frequently used conversion types first.
-*/
-static info fmtinfo[] = {
- { 'd', 10, "0123456789", 1, 0, RADIX, },
- { 's', 0, 0, 0, 0, STRING, },
- { 'S', 0, 0, 0, 0, SEEIT, },
- { 'z', 0, 0, 0, 0, MEM_STRING, },
- { 'c', 0, 0, 0, 0, CHAR, },
- { 'o', 8, "01234567", 0, "0", RADIX, },
- { 'u', 10, "0123456789", 0, 0, RADIX, },
- { 'x', 16, "0123456789abcdef", 0, "x0", RADIX, },
- { 'X', 16, "0123456789ABCDEF", 0, "X0", RADIX, },
- { 'r', 10, "0123456789", 0, 0, ORDINAL, },
- { 'f', 0, 0, 1, 0, FLOAT, },
- { 'e', 0, "e", 1, 0, EXP, },
- { 'E', 0, "E", 1, 0, EXP, },
- { 'g', 0, "e", 1, 0, GENERIC, },
- { 'G', 0, "E", 1, 0, GENERIC, },
- { 'i', 10, "0123456789", 1, 0, RADIX, },
- { 'n', 0, 0, 0, 0, SIZE, },
- { 'S', 0, 0, 0, 0, SEEIT, },
- { '%', 0, 0, 0, 0, PERCENT, },
- { 'b', 2, "01", 0, "b0", RADIX, }, /* Binary notation */
- { 'p', 10, "0123456789", 0, 0, RADIX, }, /* Pointers */
- { '\'', 0, 0, 0, 0, CHARLIT, }, /* Literal char */
-};
-#define NINFO (sizeof(fmtinfo)/sizeof(info)) /* Size of the fmtinfo table */
-
-/*
-** If NOFLOATINGPOINT is defined, then none of the floating point
-** conversions will work.
-*/
-#ifndef NOFLOATINGPOINT
-/*
-** "*val" is a double such that 0.1 <= *val < 10.0
-** Return the ascii code for the leading digit of *val, then
-** multiply "*val" by 10.0 to renormalize.
-**
-** Example:
-** input: *val = 3.14159
-** output: *val = 1.4159 function return = '3'
-**
-** The counter *cnt is incremented each time. After counter exceeds
-** 16 (the number of significant digits in a 64-bit float) '0' is
-** always returned.
-*/
-static int getdigit(long double *val, int *cnt){
- int digit;
- long double d;
- if( (*cnt)++ >= MAXDIG ) return '0';
- digit = (int)*val;
- d = digit;
- digit += '0';
- *val = (*val - d)*10.0;
- return digit;
-}
-#endif
-
-/*
-** Setting the size of the BUFFER involves trade-offs. No %d or %f
-** conversion can have more than BUFSIZE characters. If the field
-** width is larger than BUFSIZE, it is silently shortened. On the
-** other hand, this routine consumes more stack space with larger
-** BUFSIZEs. If you have some threads for which you want to minimize
-** stack space, you should keep BUFSIZE small.
-*/
-#define BUFSIZE 100 /* Size of the output buffer */
-
-/*
-** The root program. All variations call this core.
-**
-** INPUTS:
-** func This is a pointer to a function taking three arguments
-** 1. A pointer to the list of characters to be output
-** (Note, this list is NOT null terminated.)
-** 2. An integer number of characters to be output.
-** (Note: This number might be zero.)
-** 3. A pointer to anything. Same as the "arg" parameter.
-**
-** arg This is the pointer to anything which will be passed as the
-** third argument to "func". Use it for whatever you like.
-**
-** fmt This is the format string, as in the usual print.
-**
-** ap This is a pointer to a list of arguments. Same as in
-** vfprint.
-**
-** OUTPUTS:
-** The return value is the total number of characters sent to
-** the function "func". Returns -1 on a error.
-**
-** Note that the order in which automatic variables are declared below
-** seems to make a big difference in determining how fast this beast
-** will run.
-*/
-static int vxprintf(func,arg,format,ap)
- void (*func)(char*,int,void*);
- void *arg;
- const char *format;
- va_list ap;
-{
- register const char *fmt; /* The format string. */
- register int c; /* Next character in the format string */
- register char *bufpt; /* Pointer to the conversion buffer */
- register int precision; /* Precision of the current field */
- register int length; /* Length of the field */
- register int idx; /* A general purpose loop counter */
- int count; /* Total number of characters output */
- int width; /* Width of the current field */
- int flag_leftjustify; /* True if "-" flag is present */
- int flag_plussign; /* True if "+" flag is present */
- int flag_blanksign; /* True if " " flag is present */
- int flag_alternateform; /* True if "#" flag is present */
- int flag_zeropad; /* True if field width constant starts with zero */
- int flag_long; /* True if "l" flag is present */
- int flag_center; /* True if "=" flag is present */
- unsigned long longvalue; /* Value for integer types */
- long double realvalue; /* Value for real types */
- info *infop; /* Pointer to the appropriate info structure */
- char buf[BUFSIZE]; /* Conversion buffer */
- char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */
- int errorflag = 0; /* True if an error is encountered */
- enum e_type xtype; /* Conversion paradigm */
- char *zMem; /* String to be freed */
- static char spaces[] =
- " ";
-#define SPACESIZE (sizeof(spaces)-1)
-#ifndef NOFLOATINGPOINT
- int exp; /* exponent of real numbers */
- long double rounder; /* Used for rounding floating point values */
- int flag_dp; /* True if decimal point should be shown */
- int flag_rtz; /* True if trailing zeros should be removed */
- int flag_exp; /* True to force display of the exponent */
- int nsd; /* Number of significant digits returned */
-#endif
-
- fmt = format; /* Put in a register for speed */
- count = length = 0;
- bufpt = 0;
- for(; (c=(*fmt))!=0; ++fmt){
- if( c!='%' ){
- register int amt;
- bufpt = (char *)fmt;
- amt = 1;
- while( (c=(*++fmt))!='%' && c!=0 ) amt++;
- (*func)(bufpt,amt,arg);
- count += amt;
- if( c==0 ) break;
- }
- if( (c=(*++fmt))==0 ){
- errorflag = 1;
- (*func)("%",1,arg);
- count++;
- break;
- }
- /* Find out what flags are present */
- flag_leftjustify = flag_plussign = flag_blanksign =
- flag_alternateform = flag_zeropad = flag_center = 0;
- do{
- switch( c ){
- case '-': flag_leftjustify = 1; c = 0; break;
- case '+': flag_plussign = 1; c = 0; break;
- case ' ': flag_blanksign = 1; c = 0; break;
- case '#': flag_alternateform = 1; c = 0; break;
- case '0': flag_zeropad = 1; c = 0; break;
- case '=': flag_center = 1; c = 0; break;
- default: break;
- }
- }while( c==0 && (c=(*++fmt))!=0 );
- if( flag_center ) flag_leftjustify = 0;
- /* Get the field width */
- width = 0;
- if( c=='*' ){
- width = va_arg(ap,int);
- if( width<0 ){
- flag_leftjustify = 1;
- width = -width;
- }
- c = *++fmt;
- }else{
- while( isdigit(c) ){
- width = width*10 + c - '0';
- c = *++fmt;
- }
- }
- if( width > BUFSIZE-10 ){
- width = BUFSIZE-10;
- }
- /* Get the precision */
- if( c=='.' ){
- precision = 0;
- c = *++fmt;
- if( c=='*' ){
- precision = va_arg(ap,int);
-#ifndef COMPATIBILITY
- /* This is sensible, but SUN OS 4.1 doesn't do it. */
- if( precision<0 ) precision = -precision;
-#endif
- c = *++fmt;
- }else{
- while( isdigit(c) ){
- precision = precision*10 + c - '0';
- c = *++fmt;
- }
- }
- /* Limit the precision to prevent overflowing buf[] during conversion */
- if( precision>BUFSIZE-40 ) precision = BUFSIZE-40;
- }else{
- precision = -1;
- }
- /* Get the conversion type modifier */
- if( c=='l' ){
- flag_long = 1;
- c = *++fmt;
- }else{
- flag_long = 0;
- }
- /* Fetch the info entry for the field */
- infop = 0;
- for(idx=0; idx<NINFO; idx++){
- if( c==fmtinfo[idx].fmttype ){
- infop = &fmtinfo[idx];
- break;
- }
- }
- /* No info entry found. It must be an error. */
- if( infop==0 ){
- xtype = ERROR;
- }else{
- xtype = infop->type;
- }
-
- /*
- ** At this point, variables are initialized as follows:
- **
- ** flag_alternateform TRUE if a '#' is present.
- ** flag_plussign TRUE if a '+' is present.
- ** flag_leftjustify TRUE if a '-' is present or if the
- ** field width was negative.
- ** flag_zeropad TRUE if the width began with 0.
- ** flag_long TRUE if the letter 'l' (ell) prefixed
- ** the conversion character.
- ** flag_blanksign TRUE if a ' ' is present.
- ** width The specified field width. This is
- ** always non-negative. Zero is the default.
- ** precision The specified precision. The default
- ** is -1.
- ** xtype The class of the conversion.
- ** infop Pointer to the appropriate info struct.
- */
- switch( xtype ){
- case ORDINAL:
- case RADIX:
- if( flag_long ) longvalue = va_arg(ap,long);
- else longvalue = va_arg(ap,int);
-#ifdef COMPATIBILITY
- /* For the format %#x, the value zero is printed "0" not "0x0".
- ** I think this is stupid. */
- if( longvalue==0 ) flag_alternateform = 0;
-#else
- /* More sensible: turn off the prefix for octal (to prevent "00"),
- ** but leave the prefix for hex. */
- if( longvalue==0 && infop->base==8 ) flag_alternateform = 0;
-#endif
- if( infop->flag_signed ){
- if( *(long*)&longvalue<0 ){
- longvalue = -*(long*)&longvalue;
- prefix = '-';
- }else if( flag_plussign ) prefix = '+';
- else if( flag_blanksign ) prefix = ' ';
- else prefix = 0;
- }else prefix = 0;
- if( flag_zeropad && precision<width-(prefix!=0) ){
- precision = width-(prefix!=0);
- }
- bufpt = &buf[BUFSIZE];
- if( xtype==ORDINAL ){
- long a,b;
- a = longvalue%10;
- b = longvalue%100;
- bufpt -= 2;
- if( a==0 || a>3 || (b>10 && b<14) ){
- bufpt[0] = 't';
- bufpt[1] = 'h';
- }else if( a==1 ){
- bufpt[0] = 's';
- bufpt[1] = 't';
- }else if( a==2 ){
- bufpt[0] = 'n';
- bufpt[1] = 'd';
- }else if( a==3 ){
- bufpt[0] = 'r';
- bufpt[1] = 'd';
- }
- }
- {
- register char *cset; /* Use registers for speed */
- register int base;
- cset = infop->charset;
- base = infop->base;
- do{ /* Convert to ascii */
- *(--bufpt) = cset[longvalue%base];
- longvalue = longvalue/base;
- }while( longvalue>0 );
- }
- length = (int)(&buf[BUFSIZE]-bufpt);
- for(idx=precision-length; idx>0; idx--){
- *(--bufpt) = '0'; /* Zero pad */
- }
- if( prefix ) *(--bufpt) = prefix; /* Add sign */
- if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */
- char *pre, x;
- pre = infop->prefix;
- if( *bufpt!=pre[0] ){
- for(pre=infop->prefix; (x=(*pre))!=0; pre++) *(--bufpt) = x;
- }
- }
- length = (int)(&buf[BUFSIZE]-bufpt);
- break;
- case FLOAT:
- case EXP:
- case GENERIC:
- realvalue = va_arg(ap,double);
-#ifndef NOFLOATINGPOINT
- if( precision<0 ) precision = 6; /* Set default precision */
- if( precision>BUFSIZE-10 ) precision = BUFSIZE-10;
- if( realvalue<0.0 ){
- realvalue = -realvalue;
- prefix = '-';
- }else{
- if( flag_plussign ) prefix = '+';
- else if( flag_blanksign ) prefix = ' ';
- else prefix = 0;
- }
- if( infop->type==GENERIC && precision>0 ) precision--;
- rounder = 0.0;
-#ifdef COMPATIBILITY
- /* Rounding works like BSD when the constant 0.4999 is used. Wierd! */
- for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1);
-#else
- /* It makes more sense to use 0.5 */
- if( precision>MAXDIG-1 ) idx = MAXDIG-1;
- else idx = precision;
- for(rounder=0.5; idx>0; idx--, rounder*=0.1);
-#endif
- if( infop->type==FLOAT ) realvalue += rounder;
- /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */
- exp = 0;
- if( realvalue>0.0 ){
- int k = 0;
- while( realvalue>=1e8 && k++<100 ){ realvalue *= 1e-8; exp+=8; }
- while( realvalue>=10.0 && k++<100 ){ realvalue *= 0.1; exp++; }
- while( realvalue<1e-8 && k++<100 ){ realvalue *= 1e8; exp-=8; }
- while( realvalue<1.0 && k++<100 ){ realvalue *= 10.0; exp--; }
- if( k>=100 ){
- bufpt = "NaN";
- length = 3;
- break;
- }
- }
- bufpt = buf;
- /*
- ** If the field type is GENERIC, then convert to either EXP
- ** or FLOAT, as appropriate.
- */
- flag_exp = xtype==EXP;
- if( xtype!=FLOAT ){
- realvalue += rounder;
- if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; }
- }
- if( xtype==GENERIC ){
- flag_rtz = !flag_alternateform;
- if( exp<-4 || exp>precision ){
- xtype = EXP;
- }else{
- precision = precision - exp;
- xtype = FLOAT;
- }
- }else{
- flag_rtz = 0;
- }
- /*
- ** The "exp+precision" test causes output to be of type EXP if
- ** the precision is too large to fit in buf[].
- */
- nsd = 0;
- if( xtype==FLOAT && exp+precision<BUFSIZE-30 ){
- flag_dp = (precision>0 || flag_alternateform);
- if( prefix ) *(bufpt++) = prefix; /* Sign */
- if( exp<0 ) *(bufpt++) = '0'; /* Digits before "." */
- else for(; exp>=0; exp--) *(bufpt++) = getdigit(&realvalue,&nsd);
- if( flag_dp ) *(bufpt++) = '.'; /* The decimal point */
- for(exp++; exp<0 && precision>0; precision--, exp++){
- *(bufpt++) = '0';
- }
- while( (precision--)>0 ) *(bufpt++) = getdigit(&realvalue,&nsd);
- *(bufpt--) = 0; /* Null terminate */
- if( flag_rtz && flag_dp ){ /* Remove trailing zeros and "." */
- while( bufpt>=buf && *bufpt=='0' ) *(bufpt--) = 0;
- if( bufpt>=buf && *bufpt=='.' ) *(bufpt--) = 0;
- }
- bufpt++; /* point to next free slot */
- }else{ /* EXP or GENERIC */
- flag_dp = (precision>0 || flag_alternateform);
- if( prefix ) *(bufpt++) = prefix; /* Sign */
- *(bufpt++) = getdigit(&realvalue,&nsd); /* First digit */
- if( flag_dp ) *(bufpt++) = '.'; /* Decimal point */
- while( (precision--)>0 ) *(bufpt++) = getdigit(&realvalue,&nsd);
- bufpt--; /* point to last digit */
- if( flag_rtz && flag_dp ){ /* Remove tail zeros */
- while( bufpt>=buf && *bufpt=='0' ) *(bufpt--) = 0;
- if( bufpt>=buf && *bufpt=='.' ) *(bufpt--) = 0;
- }
- bufpt++; /* point to next free slot */
- if( exp || flag_exp ){
- *(bufpt++) = infop->charset[0];
- if( exp<0 ){ *(bufpt++) = '-'; exp = -exp; } /* sign of exp */
- else { *(bufpt++) = '+'; }
- if( exp>=100 ){
- *(bufpt++) = (exp/100)+'0'; /* 100's digit */
- exp %= 100;
- }
- *(bufpt++) = exp/10+'0'; /* 10's digit */
- *(bufpt++) = exp%10+'0'; /* 1's digit */
- }
- }
- /* The converted number is in buf[] and zero terminated. Output it.
- ** Note that the number is in the usual order, not reversed as with
- ** integer conversions. */
- length = (int)(bufpt-buf);
- bufpt = buf;
-
- /* Special case: Add leading zeros if the flag_zeropad flag is
- ** set and we are not left justified */
- if( flag_zeropad && !flag_leftjustify && length < width){
- int i;
- int nPad = width - length;
- for(i=width; i>=nPad; i--){
- bufpt[i] = bufpt[i-nPad];
- }
- i = prefix!=0;
- while( nPad-- ) bufpt[i++] = '0';
- length = width;
- }
-#endif
- break;
- case SIZE:
- *(va_arg(ap,int*)) = count;
- length = width = 0;
- break;
- case PERCENT:
- buf[0] = '%';
- bufpt = buf;
- length = 1;
- break;
- case CHARLIT:
- case CHAR:
- c = buf[0] = (xtype==CHAR ? va_arg(ap,int) : *++fmt);
- if( precision>=0 ){
- for(idx=1; idx<precision; idx++) buf[idx] = c;
- length = precision;
- }else{
- length =1;
- }
- bufpt = buf;
- break;
- case STRING:
- case MEM_STRING:
- zMem = bufpt = va_arg(ap,char*);
- if( bufpt==0 ) bufpt = "(null)";
- length = strlen(bufpt);
- if( precision>=0 && precision<length ) length = precision;
- break;
- case SEEIT:
- {
- int i;
- int c;
- char *arg = va_arg(ap,char*);
- for(i=0; i<BUFSIZE-1 && (c = *arg++)!=0; i++){
- if( c<0x20 || c>=0x7f ){
- buf[i++] = '^';
- buf[i] = (c&0x1f)+0x40;
- }else{
- buf[i] = c;
- }
- }
- bufpt = buf;
- length = i;
- if( precision>=0 && precision<length ) length = precision;
- }
- break;
- case ERROR:
- buf[0] = '%';
- buf[1] = c;
- errorflag = 0;
- idx = 1+(c!=0);
- (*func)("%",idx,arg);
- count += idx;
- if( c==0 ) fmt--;
- break;
- }/* End switch over the format type */
- /*
- ** The text of the conversion is pointed to by "bufpt" and is
- ** "length" characters long. The field width is "width". Do
- ** the output.
- */
- if( !flag_leftjustify ){
- register int nspace;
- nspace = width-length;
- if( nspace>0 ){
- if( flag_center ){
- nspace = nspace/2;
- width -= nspace;
- flag_leftjustify = 1;
- }
- count += nspace;
- while( nspace>=SPACESIZE ){
- (*func)(spaces,SPACESIZE,arg);
- nspace -= SPACESIZE;
- }
- if( nspace>0 ) (*func)(spaces,nspace,arg);
- }
- }
- if( length>0 ){
- (*func)(bufpt,length,arg);
- count += length;
- }
- if( xtype==MEM_STRING && zMem ){
- free(zMem);
- }
- if( flag_leftjustify ){
- register int nspace;
- nspace = width-length;
- if( nspace>0 ){
- count += nspace;
- while( nspace>=SPACESIZE ){
- (*func)(spaces,SPACESIZE,arg);
- nspace -= SPACESIZE;
- }
- if( nspace>0 ) (*func)(spaces,nspace,arg);
- }
- }
- }/* End for loop over the format string */
- return errorflag ? -1 : count;
-} /* End of function */
-
-/*
-** This non-standard function is still occasionally useful....
-*/
-int xprintf(
- void (*func)(char*,int,void*),
- void *arg,
- const char *format,
- ...
-){
- va_list ap;
- va_start(ap,format);
- return vxprintf(func,arg,format,ap);
-}
-
-/*
-** Now for string-print, also as found in any standard library.
-** Add to this the snprint function which stops added characters
-** to the string at a given length.
-**
-** Note that snprint returns the length of the string as it would
-** be if there were no limit on the output.
-*/
-struct s_strargument { /* Describes the string being written to */
- char *next; /* Next free slot in the string */
- char *last; /* Last available slot in the string */
-};
-
-static void sout(txt,amt,arg)
- char *txt;
- int amt;
- void *arg;
-{
- register char *head;
- register const char *t;
- register int a;
- register char *tail;
- a = amt;
- t = txt;
- head = ((struct s_strargument*)arg)->next;
- tail = ((struct s_strargument*)arg)->last;
- if( tail ){
- while( a-- >0 && head<tail ) *(head++) = *(t++);
- }else{
- while( a-- >0 ) *(head++) = *(t++);
- }
- *head = 0;
- ((struct s_strargument*)arg)->next = head;
-}
-
-int sprintf(char *buf, const char *fmt, ...){
- int rc;
- va_list ap;
- struct s_strargument arg;
-
- va_start(ap,fmt);
- arg.next = buf;
- arg.last = 0;
- *arg.next = 0;
- rc = vxprintf(sout,&arg,fmt,ap);
- va_end(ap);
-}
-int vsprintf(char *buf,const char *fmt,va_list ap){
- struct s_strargument arg;
- arg.next = buf;
- arg.last = 0;
- *buf = 0;
- return vxprintf(sout,&arg,fmt,ap);
-}
-int snprintf(char *buf, size_t n, const char *fmt, ...){
- int rc;
- va_list ap;
- struct s_strargument arg;
-
- va_start(ap,fmt);
- arg.next = buf;
- arg.last = &arg.next[n-1];
- *arg.next = 0;
- rc = vxprintf(sout,&arg,fmt,ap);
- va_end(ap);
-}
-int vsnprintf(char *buf, size_t n, const char *fmt, va_list ap){
- struct s_strargument arg;
- arg.next = buf;
- arg.last = &buf[n-1];
- *buf = 0;
- return vxprintf(sout,&arg,fmt,ap);
-}
-
-/*
-** The following section of code handles the mprintf routine, that
-** writes to memory obtained from malloc().
-*/
-
-/* This structure is used to store state information about the
-** write in progress
-*/
-struct sgMprintf {
- char *zBase; /* A base allocation */
- char *zText; /* The string collected so far */
- int nChar; /* Length of the string so far */
- int nAlloc; /* Amount of space allocated in zText */
-};
-
-/* The xprintf callback function. */
-static void mout(zNewText,nNewChar,arg)
- char *zNewText;
- int nNewChar;
- void *arg;
-{
- struct sgMprintf *pM = (struct sgMprintf*)arg;
- if( pM->nChar + nNewChar + 1 > pM->nAlloc ){
- pM->nAlloc = pM->nChar + nNewChar*2 + 1;
- if( pM->zText==pM->zBase ){
- pM->zText = malloc(pM->nAlloc);
- if( pM->zText && pM->nChar ) memcpy(pM->zText,pM->zBase,pM->nChar);
- }else{
- pM->zText = realloc(pM->zText, pM->nAlloc);
- }
- }
- if( pM->zText ){
- memcpy(&pM->zText[pM->nChar], zNewText, nNewChar);
- pM->nChar += nNewChar;
- pM->zText[pM->nChar] = 0;
- }
-}
-
-/*
-** mprintf() works like printf(), but allocations memory to hold the
-** resulting string and returns a pointer to the allocated memory.
-**
-** We changed the name to TclMPrint() to conform with the Tcl private
-** routine naming conventions.
-*/
-char *mprintf(const char *zFormat, ...){
- va_list ap;
- struct sgMprintf sMprintf;
- char *zNew;
- char zBuf[200];
-
- va_start(ap,zFormat);
- sMprintf.nChar = 0;
- sMprintf.nAlloc = sizeof(zBuf);
- sMprintf.zText = zBuf;
- sMprintf.zBase = zBuf;
- vxprintf(mout,&sMprintf,zFormat,ap);
- va_end(ap);
- if( sMprintf.zText==sMprintf.zBase ){
- zNew = malloc( sMprintf.nChar+1 );
- if( zNew ) strcpy(zNew,zBuf);
- }else{
- zNew = realloc(sMprintf.zText,sMprintf.nChar+1);
- }
-
- return zNew;
-}
-
-/* This is the varargs version of mprintf.
-**
-** The name is changed to TclVMPrintf() to conform with Tcl naming
-** conventions.
-*/
-char *vmprintf(const char *zFormat,va_list ap){
- struct sgMprintf sMprintf;
- char zBuf[200];
- sMprintf.nChar = 0;
- sMprintf.zText = zBuf;
- sMprintf.nAlloc = sizeof(zBuf);
- sMprintf.zBase = zBuf;
- vxprintf(mout,&sMprintf,zFormat,ap);
- if( sMprintf.zText==sMprintf.zBase ){
- sMprintf.zText = malloc( strlen(zBuf)+1 );
- if( sMprintf.zText ) strcpy(sMprintf.zText,zBuf);
- }else{
- sMprintf.zText = realloc(sMprintf.zText,sMprintf.nChar+1);
- }
- return sMprintf.zText;
-}
-
-/*
-** The following section of code handles the standard fprintf routines
-** for pthreads.
-*/
-
-/* The xprintf callback function. */
-static void fout(zNewText,nNewChar,arg)
- char *zNewText;
- int nNewChar;
- void *arg;
-{
- fwrite(zNewText,1,nNewChar,(FILE*)arg);
-}
-
-/* The public interface routines */
-int fprintf(FILE *pOut, const char *zFormat, ...){
- va_list ap;
- int retc;
-
- va_start(ap,zFormat);
- retc = vxprintf(fout,pOut,zFormat,ap);
- va_end(ap);
- return retc;
-}
-int vfprintf(FILE *pOut, const char *zFormat, va_list ap){
- return vxprintf(fout,pOut,zFormat,ap);
-}
-int printf(const char *zFormat, ...){
- va_list ap;
- int retc;
-
- va_start(ap,zFormat);
- retc = vxprintf(fout,stdout,zFormat,ap);
- va_end(ap);
- return retc;
-}
-int vprintf(const char *zFormat, va_list ap){
- return vxprintf(fout,stdout,zFormat,ap);
-}
diff --git a/mit-pthreads/stdlib/GNUmakefile.inc b/mit-pthreads/stdlib/GNUmakefile.inc
deleted file mode 100755
index 2f55ce8b217..00000000000
--- a/mit-pthreads/stdlib/GNUmakefile.inc
+++ /dev/null
@@ -1,7 +0,0 @@
-# @(#)Makefile.inc 5.6 (Berkeley) 6/4/91
-
-# stdlib sources
-VPATH:= ${VPATH}:${srcdir}/stdlib
-
-SRCS:= abort.c exit.c strtod.c getopt.c rand.c random.c strtol.c strtoul.c \
- system.c $(SRCS)
diff --git a/mit-pthreads/stdlib/Makefile.inc b/mit-pthreads/stdlib/Makefile.inc
deleted file mode 100644
index cc323d1d0e1..00000000000
--- a/mit-pthreads/stdlib/Makefile.inc
+++ /dev/null
@@ -1,10 +0,0 @@
-# @(#)Makefile.inc 5.6 (Berkeley) 6/4/91
-
-# stdlib sources
-.PATH: ${srcdir}/${MACHINE}/stdlib ${srcdir}/stdlib
-
-SRCS+= exit.c strtod.c getopt.c rand.c random.c strtol.c strtoul.c
-
-# SRCS+=abort.c atexit.c atoi.c atof.c atol.c bsearch.c calloc.c div.c \
-# getenv.c heapsort.c labs.c ldiv.c malloc.c multibyte.c \
-# putenv.c qsort.c radixsort.c setenv.c system.c
diff --git a/mit-pthreads/stdlib/abort.c b/mit-pthreads/stdlib/abort.c
deleted file mode 100644
index 474c35f6107..00000000000
--- a/mit-pthreads/stdlib/abort.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)abort.c 5.11 (Berkeley) 2/23/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-
-void
-abort()
-{
- sigset_t mask;
-
- sigfillset(&mask);
- /*
- * don't block SIGABRT to give any handler a chance; we ignore
- * any errors -- X3J11 doesn't allow abort to return anyway.
- */
- sigdelset(&mask, SIGABRT);
- pthread_sigmask(SIG_SETMASK, &mask, NULL);
- kill(getpid(), SIGABRT);
-
- /*
- * if SIGABRT ignored, or caught and the handler returns, do
- * it again, only harder.
- */
- pthread_signal(SIGABRT, SIG_DFL);
- pthread_sigmask(SIG_SETMASK, &mask, NULL);
- kill(getpid(), SIGABRT);
- exit(1);
-}
diff --git a/mit-pthreads/stdlib/atexit.h b/mit-pthreads/stdlib/atexit.h
deleted file mode 100644
index d13dc588781..00000000000
--- a/mit-pthreads/stdlib/atexit.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)atexit.h 5.1 (Berkeley) 5/15/90
- * $Id$
- */
-
-/* must be at least 32 to guarantee ANSI conformance */
-#define ATEXIT_SIZE 32
-
-struct atexit {
- struct atexit *next; /* next in list */
- int ind; /* next index in this table */
- void (*fns[ATEXIT_SIZE])(); /* the table itself */
-};
-
-struct atexit *__atexit; /* points to head of LIFO stack */
diff --git a/mit-pthreads/stdlib/exit.c b/mit-pthreads/stdlib/exit.c
deleted file mode 100644
index 159a066d797..00000000000
--- a/mit-pthreads/stdlib/exit.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)exit.c 5.4 (Berkeley) 2/23/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/cdefs.h>
-#include <pthread/posix.h>
-#include "atexit.h"
-
-void (*__cleanup)();
-
-/*
- * Exit, flushing stdio buffers if necessary.
- */
-void __NORETURN exit(int status)
-{
- register struct atexit *p;
- register int n;
-
- for (p = __atexit; p; p = p->next)
- for (n = p->ind; --n >= 0;)
- (*p->fns[n])();
- if (__cleanup)
- (*__cleanup)();
- _exit(status);
-
- /* This is to shut up gcc, which complains about this function
- * returning even if _exit() is declared noreturn. */
- while (1);
-}
-
-
-/*
- * Register a function to be performed at exit.
- */
-int atexit(void (*fn)())
-{
- static struct atexit __atexit0; /* one guaranteed table */
- register struct atexit *p;
-
- if ((p = __atexit) == NULL)
- __atexit = p = &__atexit0;
- else if (p->ind >= ATEXIT_SIZE) {
- if ((p = malloc(sizeof(*p))) == NULL)
- return (-1);
- p->ind = 0;
- p->next = __atexit;
- __atexit = p;
- }
- p->fns[p->ind++] = fn;
- return (0);
-}
diff --git a/mit-pthreads/stdlib/getopt.c b/mit-pthreads/stdlib/getopt.c
deleted file mode 100644
index 71fafd49490..00000000000
--- a/mit-pthreads/stdlib/getopt.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 1987 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getopt.c 4.13 (Berkeley) 2/23/91";
-#endif /* LIBC_SCCS and not lint */
-
-#include <config.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/*
- * get option letter from argument vector
- */
-
-#ifndef LD_LINKS_STATIC_DATA
-/*
- * Under the Solaris ld, some data sections are linked in regaurdless of
- * whether or not the name has been resolved.
- */
-int opterr = 1, /* if error message should be printed */
- optind = 1, /* index into parent argv vector */
- optopt = 0; /* character checked for validity */
-char * optarg = NULL; /* argument associated with option */
-
-#else
-
-extern int opterr, optind, optopt;
-extern char *optarg;
-
-#endif
-
-#define BADCH (int)'?'
-#define EMSG ""
-
-int
-getopt(nargc, nargv, ostr)
- int nargc;
- char * const *nargv;
- const char *ostr;
-{
- static char *place = EMSG; /* option letter processing */
- register char *oli; /* option letter list index */
- char *p;
-
- if (!*place) { /* update scanning pointer */
- if (optind >= nargc || *(place = nargv[optind]) != '-') {
- place = EMSG;
- return(EOF);
- }
- if (place[1] && *++place == '-') { /* found "--" */
- ++optind;
- place = EMSG;
- return(EOF);
- }
- } /* option letter okay? */
- if ((optopt = (int)*place++) == (int)':' ||
- !(oli = strchr(ostr, optopt))) {
- /*
- * if the user didn't specify '-' as an option,
- * assume it means EOF.
- */
- if (optopt == (int)'-')
- return(EOF);
- if (!*place)
- ++optind;
- if (opterr) {
- if (!(p = strrchr(*nargv, '/')))
- p = *nargv;
- else
- ++p;
- (void)fprintf(stderr, "%s: illegal option -- %c\n",
- p, optopt);
- }
- return(BADCH);
- }
- if (*++oli != ':') { /* don't need argument */
- optarg = NULL;
- if (!*place)
- ++optind;
- }
- else { /* need an argument */
- if (*place) /* no white space */
- optarg = place;
- else if (nargc <= ++optind) { /* no arg */
- place = EMSG;
- if (!(p = strrchr(*nargv, '/')))
- p = *nargv;
- else
- ++p;
- if (opterr)
- (void)fprintf(stderr,
- "%s: option requires an argument -- %c\n",
- p, optopt);
- return(BADCH);
- }
- else /* white space */
- optarg = nargv[optind];
- place = EMSG;
- ++optind;
- }
- return(optopt); /* dump back option letter */
-}
diff --git a/mit-pthreads/stdlib/rand.c b/mit-pthreads/stdlib/rand.c
deleted file mode 100644
index 9367dceed25..00000000000
--- a/mit-pthreads/stdlib/rand.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rand.c 5.6 (Berkeley) 6/24/91";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <stdlib.h>
-
-static u_long next = 1;
-
-int rand_r(u_int * next_r)
-{
- int ret;
-
- (*next_r) = (*next_r) * 1103515245 + 12345;
- ret = (*next_r) & RAND_MAX;
- return(ret);
-}
-
-#undef rand
-int rand(void)
-{
- return ((next = next * 1103515245 + 12345) & RAND_MAX);
-}
-
-#undef srand
-void srand(unsigned int seed)
-{
- next = seed;
-}
diff --git a/mit-pthreads/stdlib/random.c b/mit-pthreads/stdlib/random.c
deleted file mode 100644
index 8cba96e7534..00000000000
--- a/mit-pthreads/stdlib/random.c
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)random.c 5.9 (Berkeley) 2/23/91";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-/*
- * random.c:
- *
- * An improved random number generation package. In addition to the standard
- * rand()/srand() like interface, this package also has a special state info
- * interface. The initstate() routine is called with a seed, an array of
- * bytes, and a count of how many bytes are being passed in; this array is
- * then initialized to contain information for random number generation with
- * that much state information. Good sizes for the amount of state
- * information are 32, 64, 128, and 256 bytes. The state can be switched by
- * calling the setstate() routine with the same array as was initiallized
- * with initstate(). By default, the package runs with 128 bytes of state
- * information and generates far better random numbers than a linear
- * congruential generator. If the amount of state information is less than
- * 32 bytes, a simple linear congruential R.N.G. is used.
- *
- * Internally, the state information is treated as an array of longs; the
- * zeroeth element of the array is the type of R.N.G. being used (small
- * integer); the remainder of the array is the state information for the
- * R.N.G. Thus, 32 bytes of state information will give 7 longs worth of
- * state information, which will allow a degree seven polynomial. (Note:
- * the zeroeth word of state information also has some other information
- * stored in it -- see setstate() for details).
- *
- * The random number generation technique is a linear feedback shift register
- * approach, employing trinomials (since there are fewer terms to sum up that
- * way). In this approach, the least significant bit of all the numbers in
- * the state table will act as a linear feedback shift register, and will
- * have period 2^deg - 1 (where deg is the degree of the polynomial being
- * used, assuming that the polynomial is irreducible and primitive). The
- * higher order bits will have longer periods, since their values are also
- * influenced by pseudo-random carries out of the lower bits. The total
- * period of the generator is approximately deg*(2**deg - 1); thus doubling
- * the amount of state information has a vast influence on the period of the
- * generator. Note: the deg*(2**deg - 1) is an approximation only good for
- * large deg, when the period of the shift register is the dominant factor.
- * With deg equal to seven, the period is actually much longer than the
- * 7*(2**7 - 1) predicted by this formula.
- */
-
-/*
- * For each of the currently supported random number generators, we have a
- * break value on the amount of state information (you need at least this
- * many bytes of state info to support this random number generator), a degree
- * for the polynomial (actually a trinomial) that the R.N.G. is based on, and
- * the separation between the two lower order coefficients of the trinomial.
- */
-#define TYPE_0 0 /* linear congruential */
-#define BREAK_0 8
-#define DEG_0 0
-#define SEP_0 0
-
-#define TYPE_1 1 /* x**7 + x**3 + 1 */
-#define BREAK_1 32
-#define DEG_1 7
-#define SEP_1 3
-
-#define TYPE_2 2 /* x**15 + x + 1 */
-#define BREAK_2 64
-#define DEG_2 15
-#define SEP_2 1
-
-#define TYPE_3 3 /* x**31 + x**3 + 1 */
-#define BREAK_3 128
-#define DEG_3 31
-#define SEP_3 3
-
-#define TYPE_4 4 /* x**63 + x + 1 */
-#define BREAK_4 256
-#define DEG_4 63
-#define SEP_4 1
-
-/*
- * Array versions of the above information to make code run faster --
- * relies on fact that TYPE_i == i.
- */
-#define MAX_TYPES 5 /* max number of types above */
-
-static int degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 };
-static int seps [MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 };
-
-/*
- * Initially, everything is set up as if from:
- *
- * initstate(1, &randtbl, 128);
- *
- * Note that this initialization takes advantage of the fact that srandom()
- * advances the front and rear pointers 10*rand_deg times, and hence the
- * rear pointer which starts at 0 will also end up at zero; thus the zeroeth
- * element of the state information, which contains info about the current
- * position of the rear pointer is just
- *
- * MAX_TYPES * (rptr - state) + TYPE_3 == TYPE_3.
- */
-
-static long randtbl[DEG_3 + 1] = {
- TYPE_3,
- 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342, 0xde3b81e0, 0xdf0a6fb5,
- 0xf103bc02, 0x48f340fb, 0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd,
- 0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86, 0xda672e2a, 0x1588ca88,
- 0xe369735d, 0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc,
- 0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, 0xf5ad9d0e, 0x8999220b,
- 0x27fb47b9,
-};
-
-/*
- * fptr and rptr are two pointers into the state info, a front and a rear
- * pointer. These two pointers are always rand_sep places aparts, as they
- * cycle cyclically through the state information. (Yes, this does mean we
- * could get away with just one pointer, but the code for random() is more
- * efficient this way). The pointers are left positioned as they would be
- * from the call
- *
- * initstate(1, randtbl, 128);
- *
- * (The position of the rear pointer, rptr, is really 0 (as explained above
- * in the initialization of randtbl) because the state table pointer is set
- * to point to randtbl[1] (as explained below).
- */
-static long *fptr = &randtbl[SEP_3 + 1];
-static long *rptr = &randtbl[1];
-
-/*
- * The following things are the pointer to the state information table, the
- * type of the current generator, the degree of the current polynomial being
- * used, and the separation between the two pointers. Note that for efficiency
- * of random(), we remember the first location of the state information, not
- * the zeroeth. Hence it is valid to access state[-1], which is used to
- * store the type of the R.N.G. Also, we remember the last location, since
- * this is more efficient than indexing every time to find the address of
- * the last element to see if the front and rear pointers have wrapped.
- */
-static long *state = &randtbl[1];
-static int rand_type = TYPE_3;
-static int rand_deg = DEG_3;
-static int rand_sep = SEP_3;
-static long *end_ptr = &randtbl[DEG_3 + 1];
-
-/*
- * State info won't be corrupted by multiple simultaneous calls,
- * but srandom(), initstate(), and setstate() affect all threads
- */
-static pthread_mutex_t random_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-/*
- * random:
- *
- * If we are using the trivial TYPE_0 R.N.G., just do the old linear
- * congruential bit. Otherwise, we do our fancy trinomial stuff, which is
- * the same in all the other cases due to all the global variables that have
- * been set up. The basic operation is to add the number at the rear pointer
- * into the one at the front pointer. Then both pointers are advanced to
- * the next location cyclically in the table. The value returned is the sum
- * generated, reduced to 31 bits by throwing away the "least random" low bit.
- *
- * Note: the code takes advantage of the fact that both the front and
- * rear pointers can't wrap on the same call by not testing the rear
- * pointer if the front one has wrapped.
- *
- * Returns a 31-bit random number.
- */
-static long random_basic()
-{
- long i;
-
- if (rand_type == TYPE_0)
- i = state[0] = (state[0] * 1103515245 + 12345) & 0x7fffffff;
- else {
- *fptr += *rptr;
- i = (*fptr >> 1) & 0x7fffffff; /* chucking least random bit */
- if (++fptr >= end_ptr) {
- fptr = state;
- ++rptr;
- } else if (++rptr >= end_ptr)
- rptr = state;
- }
- return(i);
-}
-
-long random()
-{
- long ret;
-
- pthread_mutex_lock(&random_mutex);
- ret = random_basic();
- pthread_mutex_unlock(&random_mutex);
- return(ret);
-}
-/*
- * srandom:
- *
- * Initialize the random number generator based on the given seed. If the
- * type is the trivial no-state-information type, just remember the seed.
- * Otherwise, initializes state[] based on the given "seed" via a linear
- * congruential generator. Then, the pointers are set to known locations
- * that are exactly rand_sep places apart. Lastly, it cycles the state
- * information a given number of times to get rid of any initial dependencies
- * introduced by the L.C.R.N.G. Note that the initialization of randtbl[]
- * for default usage relies on values produced by this routine.
- */
-static void srandom_basic(u_int x)
-{
- int i;
-
- state[0] = x;
- for (i = 1; i < rand_deg; i++)
- state[i] = 1103515245 * state[i - 1] + 12345;
- fptr = &state[rand_sep];
- rptr = &state[0];
-
- for (i = 0; i < 10 * rand_deg; i++)
- (void)random_basic();
-}
-
-void srandom(u_int x)
-{
- pthread_mutex_lock(&random_mutex);
- srandom_basic(x);
- pthread_mutex_unlock(&random_mutex);
-}
-
-/*
- * initstate:
- *
- * Initialize the state information in the given array of n bytes for future
- * random number generation. Based on the number of bytes we are given, and
- * the break values for the different R.N.G.'s, we choose the best (largest)
- * one we can and set things up for it. srandom() is then called to
- * initialize the state information.
- *
- * Note that on return from srandom(), we set state[-1] to be the type
- * multiplexed with the current value of the rear pointer; this is so
- * successive calls to initstate() won't lose this information and will be
- * able to restart with setstate().
- *
- * Note: the first thing we do is save the current state, if any, just like
- * setstate() so that it doesn't matter when initstate is called.
- *
- * Returns a pointer to the old state.
- */
-#ifdef initstate
-#undef initstate
-#endif
-char * initstate(u_int seed, char * arg_state, int n)
-{
- register char *ostate = (char *)(&state[-1]);
-
- pthread_mutex_lock(&random_mutex);
-
- if (rand_type == TYPE_0)
- state[-1] = rand_type;
- else
- state[-1] = MAX_TYPES * (rptr - state) + rand_type;
- if (n < BREAK_0) {
- (void)fprintf(stderr,
- "random: not enough state (%d bytes); ignored.\n", n);
- pthread_mutex_unlock(&random_mutex);
- return(0);
- }
- if (n < BREAK_1) {
- rand_type = TYPE_0;
- rand_deg = DEG_0;
- rand_sep = SEP_0;
- } else if (n < BREAK_2) {
- rand_type = TYPE_1;
- rand_deg = DEG_1;
- rand_sep = SEP_1;
- } else if (n < BREAK_3) {
- rand_type = TYPE_2;
- rand_deg = DEG_2;
- rand_sep = SEP_2;
- } else if (n < BREAK_4) {
- rand_type = TYPE_3;
- rand_deg = DEG_3;
- rand_sep = SEP_3;
- } else {
- rand_type = TYPE_4;
- rand_deg = DEG_4;
- rand_sep = SEP_4;
- }
- state = &(((long *)arg_state)[1]); /* first location */
- end_ptr = &state[rand_deg]; /* must set end_ptr before srandom */
- srandom_basic(seed);
- if (rand_type == TYPE_0)
- state[-1] = rand_type;
- else
- state[-1] = MAX_TYPES*(rptr - state) + rand_type;
- pthread_mutex_unlock(&random_mutex);
- return(ostate);
-}
-
-/*
- * setstate:
- *
- * Restore the state from the given state array.
- *
- * Note: it is important that we also remember the locations of the pointers
- * in the current state information, and restore the locations of the pointers
- * from the old state information. This is done by multiplexing the pointer
- * location into the zeroeth word of the state information.
- *
- * Note that due to the order in which things are done, it is OK to call
- * setstate() with the same state as the current state.
- *
- * Returns a pointer to the old state information.
- */
-#ifdef setstate
-#undef setstate
-#endif
-char * setstate(char * arg_state)
-{
- register long *new_state = (long *)arg_state;
- register int type = new_state[0] % MAX_TYPES;
- register int rear = new_state[0] / MAX_TYPES;
- char *ostate = (char *)(&state[-1]);
-
- pthread_mutex_lock(&random_mutex);
-
- if (rand_type == TYPE_0)
- state[-1] = rand_type;
- else
- state[-1] = MAX_TYPES * (rptr - state) + rand_type;
- switch(type) {
- case TYPE_0:
- case TYPE_1:
- case TYPE_2:
- case TYPE_3:
- case TYPE_4:
- rand_type = type;
- rand_deg = degrees[type];
- rand_sep = seps[type];
- break;
- default:
- (void)fprintf(stderr,
- "random: state info corrupted; not changed.\n");
- }
- state = &new_state[1];
- if (rand_type != TYPE_0) {
- rptr = &state[rear];
- fptr = &state[(rear + rand_sep) % rand_deg];
- }
- end_ptr = &state[rand_deg]; /* set end_ptr too */
-
- pthread_mutex_unlock(&random_mutex);
- return(ostate);
-}
-
diff --git a/mit-pthreads/stdlib/strtod.c b/mit-pthreads/stdlib/strtod.c
deleted file mode 100644
index 173ca1e4bdf..00000000000
--- a/mit-pthreads/stdlib/strtod.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
-** An alternative implemtation of "strtod()" that is both
-** simplier, and thread-safe.
-*/
-#include <pthread.h>
-#include <ctype.h>
-#include <math.h>
-
-#ifdef TEST
-# define strtod NewStrtod
-#include <stdio.h>
-#endif
-
-static double scaler10[] = {
- 1.0, 1e10, 1e20, 1e30, 1e40, 1e50, 1e60, 1e70, 1e80, 1e90
-};
-static double scaler1[] = {
- 1.0, 10.0, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9
-};
-static double pastpoint[] = {
- 1e-1, 1e-2, 1e-3, 1e-4, 1e-5, 1e-6, 1e-7, 1e-8, 1e-9,
- 1e-10, 1e-11, 1e-12, 1e-13, 1e-14, 1e-15, 1e-16, 1e-17, 1e-18, 1e-19,
- 1e-20, 1e-21, 1e-22, 1e-23, 1e-24, 1e-25, 1e-26, 1e-27, 1e-28, 1e-29,
- 1e-30, 1e-31, 1e-32, 1e-33, 1e-34, 1e-35, 1e-36, 1e-37, 1e-38, 1e-39,
- 1e-40, 1e-41, 1e-42, 1e-43, 1e-44, 1e-45, 1e-46, 1e-47, 1e-48, 1e-49,
- 1e-50, 1e-51, 1e-52, 1e-53, 1e-54, 1e-55, 1e-56, 1e-57, 1e-58, 1e-59,
-};
-
-#ifndef DBL_MAX
-#define DBL_MAX 1.7976931348623157e+308
-#endif
-
-double strtod(const char *zNum, char **pzEnd){
- double rResult = 0.0;
- int isNegative = 0;
-
- while( isspace(*zNum) ){
- zNum++;
- }
- if( *zNum=='-' ){
- zNum++;
- isNegative = 1;
- }else if( *zNum=='+' ){
- zNum++;
- }
- while( isdigit(*zNum) ){
- rResult = rResult*10.0 + (*zNum - '0');
- zNum++;
- }
- if( *zNum=='.' ){
- int n = 0;
- zNum++;
- while( isdigit(*zNum) ){
- if( n<sizeof(pastpoint)/sizeof(pastpoint[0]) ){
- rResult += pastpoint[n] * (*zNum - '0');
- n++;
- }
- zNum++;
- }
- }
- if( *zNum=='e' || *zNum=='E' ){
- int expVal = 0;
- int isNegExp = 0;
- const char *zExpStart = zNum;
- zNum++;
- if( *zNum=='-' ){
- isNegExp = 1;
- zNum++;
- }else if( *zNum=='+' ){
- zNum++;
- }
- if( !isdigit(*zNum) ){
- zNum = zExpStart;
- }else{
- double scaler = 1.0;
- while( isdigit(*zNum) ){
- expVal = expVal*10 + *zNum - '0';
- zNum++;
- }
- if( expVal >= 1000 ){
- if( isNegExp ){
- rResult = 0.0;
- }else{
- rResult = DBL_MAX;
- }
- goto done;
- }
- while( expVal >= 100 ){
- scaler *= 1.0e100;
- expVal -= 100;
- }
- scaler *= scaler10[expVal/10]*scaler1[expVal%10];
- if( isNegExp ){
- scaler = 1.0/scaler;
- }
- rResult *= scaler;
- }
-
- }
-
-done:
- if( pzEnd ){
- *pzEnd = (char *)zNum;
- }
- if( isNegative && rResult!=0.0 ){
- rResult = -rResult;
- }
- return rResult;
-}
-
-double atof(const char *nptr)
-{
- return (strtod(nptr, 0));
-}
-
-#ifdef TEST
-#undef strtod
-
-double strtod(const char*,char**);
-double NewStrtod(const char*,char**);
-
-int main(int argc, char **argv){
- int nTest = 0;
- int nFail = 0;
- int nBigFail = 0;
- char zBuf[1000];
-
- while( fgets(zBuf,sizeof(zBuf),stdin) ){
- double old, new;
- char *zTailOld, *zTailNew;
- int i;
-
- for(i=0; zBuf[i] && zBuf[i]!='\n'; i++){}
- zBuf[i] = 0;
-
-#if TEST==1
- printf("Input line: [%s]\n",zBuf);
- old = strtod(zBuf,&zTailOld);
- printf("value=%g\n",old);
- printf("Old: 0x%08x%08x tail=[%s]\n",
- ((int*)&old)[1], ((int*)&old)[0], zTailOld);
- new = NewStrtod(zBuf,&zTailNew);
- printf("value=%g\n",new);
- printf("New: 0x%08x%08x tail=[%s]\n\n",
- ((int*)&new)[1], ((int*)&new)[0], zTailNew);
-#else
- old = strtod(zBuf,&zTailOld);
- new = NewStrtod(zBuf,&zTailNew);
- nTest++;
- if( strcmp(zTailOld,zTailNew)
- || ((int*)&old)[0]!=((int*)&new)[0]
- || ((int*)&old)[1]!=((int*)&new)[1]
- ){
- int olda, oldb, newa, newb;
-
- nFail++;
- olda = ((int*)&old)[1];
- oldb = ((int*)&old)[0];
- newa = ((int*)&new)[1];
- newb = ((int*)&new)[0];
-
- if( olda!=newa || abs(oldb-newb)>2 ){
- nBigFail++;
- printf("******* Big failure \n");
- }
- printf("Input = [%s]\n",zBuf);
- printf("old: val=%g 0x%08x%08x tail=[%s]\n",
- old, olda, oldb, zTailOld);
- printf("new: val=%g 0x%08x%08x tail=[%s]\n\n",
- new, newa, newb, zTailNew);
- }
-#endif
- }
-
- printf("Out of %d tests, %d failures and %d big failurs\n",
- nTest,nFail, nBigFail);
-}
-#endif
diff --git a/mit-pthreads/stdlib/strtol.c b/mit-pthreads/stdlib/strtol.c
deleted file mode 100644
index 91be90cc94c..00000000000
--- a/mit-pthreads/stdlib/strtol.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)strtol.c 5.4 (Berkeley) 2/23/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <limits.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdlib.h>
-
-
-/*
- * Convert a string to a long integer.
- *
- * Ignores `locale' stuff. Assumes that the upper and lower case
- * alphabets and digits are each contiguous.
- */
-long
-strtol(nptr, endptr, base)
- const char *nptr;
- char **endptr;
- register int base;
-{
- register const char *s = nptr;
- register unsigned long acc;
- register int c;
- register unsigned long cutoff;
- register int neg = 0, any, cutlim;
-
- /*
- * Skip white space and pick up leading +/- sign if any.
- * If base is 0, allow 0x for hex and 0 for octal, else
- * assume decimal; if base is already 16, allow 0x.
- */
- do {
- c = *s++;
- } while (isspace(c));
- if (c == '-') {
- neg = 1;
- c = *s++;
- } else if (c == '+')
- c = *s++;
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
- c = s[1];
- s += 2;
- base = 16;
- }
- if (base == 0)
- base = c == '0' ? 8 : 10;
-
- /*
- * Compute the cutoff value between legal numbers and illegal
- * numbers. That is the largest legal value, divided by the
- * base. An input number that is greater than this value, if
- * followed by a legal input character, is too big. One that
- * is equal to this value may be valid or not; the limit
- * between valid and invalid numbers is then based on the last
- * digit. For instance, if the range for longs is
- * [-2147483648..2147483647] and the input base is 10,
- * cutoff will be set to 214748364 and cutlim to either
- * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated
- * a value > 214748364, or equal but the next digit is > 7 (or 8),
- * the number is too big, and we will return a range error.
- *
- * Set any if any `digits' consumed; make it negative to indicate
- * overflow.
- */
- cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX;
- cutlim = cutoff % (unsigned long)base;
- cutoff /= (unsigned long)base;
- for (acc = 0, any = 0;; c = *s++) {
- if (isdigit(c))
- c -= '0';
- else if (isalpha(c))
- c -= isupper(c) ? 'A' - 10 : 'a' - 10;
- else
- break;
- if (c >= base)
- break;
- if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
- any = -1;
- else {
- any = 1;
- acc *= base;
- acc += c;
- }
- }
- if (any < 0) {
- acc = neg ? LONG_MIN : LONG_MAX;
- errno = ERANGE;
- } else if (neg)
- acc = -acc;
- if (endptr != 0)
- *endptr = (char *) (any ? s - 1 : nptr);
- return (acc);
-}
diff --git a/mit-pthreads/stdlib/strtoul.c b/mit-pthreads/stdlib/strtoul.c
deleted file mode 100644
index c6b6b01a0f2..00000000000
--- a/mit-pthreads/stdlib/strtoul.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 1990 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)strtoul.c 5.3 (Berkeley) 2/23/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <limits.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/*
- * Convert a string to an unsigned long integer.
- *
- * Ignores `locale' stuff. Assumes that the upper and lower case
- * alphabets and digits are each contiguous.
- */
-unsigned long
-strtoul(nptr, endptr, base)
- const char *nptr;
- char **endptr;
- register int base;
-{
- register const char *s = nptr;
- register unsigned long acc;
- register int c;
- register unsigned long cutoff;
- register int neg = 0, any, cutlim;
-
- /*
- * See strtol for comments as to the logic used.
- */
- do {
- c = *s++;
- } while (isspace(c));
- if (c == '-') {
- neg = 1;
- c = *s++;
- } else if (c == '+')
- c = *s++;
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
- c = s[1];
- s += 2;
- base = 16;
- }
- if (base == 0)
- base = c == '0' ? 8 : 10;
- cutoff = (unsigned long)ULONG_MAX / (unsigned long)base;
- cutlim = (unsigned long)ULONG_MAX % (unsigned long)base;
- for (acc = 0, any = 0;; c = *s++) {
- if (isdigit(c))
- c -= '0';
- else if (isalpha(c))
- c -= isupper(c) ? 'A' - 10 : 'a' - 10;
- else
- break;
- if (c >= base)
- break;
- if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
- any = -1;
- else {
- any = 1;
- acc *= base;
- acc += c;
- }
- }
- if (any < 0) {
- acc = ULONG_MAX;
- errno = ERANGE;
- } else if (neg)
- acc = -acc;
- if (endptr != 0)
- *endptr = (char *) (any ? s - 1 : nptr);
- return (acc);
-}
diff --git a/mit-pthreads/stdlib/system.c b/mit-pthreads/stdlib/system.c
deleted file mode 100644
index e7cc164fbc7..00000000000
--- a/mit-pthreads/stdlib/system.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 1988 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)system.c 5.10 (Berkeley) 2/23/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <pthread/paths.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-
-extern char **environ;
-
-system(command)
- const char *command;
-{
- char *argp[] = {"sh", "-c", "*to be filled in*", NULL};
- void (*intsave)(), (*quitsave)(), (*signal())();
- sigset_t tmp_mask, old_mask;
- int pstat;
- pid_t pid;
-
- if (!command) /* just checking... */
- return(1);
-
- argp[2] = (char *) command;
- sigemptyset(&tmp_mask);
- sigaddset(&tmp_mask, SIGCHLD);
- pthread_sigmask(SIG_BLOCK, &tmp_mask, &old_mask);
- switch(pid = fork()) {
- case -1: /* error */
- (void)pthread_sigmask(SIG_SETMASK, &old_mask, NULL);
- return(-1);
- case 0: /* child */
- (void)pthread_sigmask(SIG_SETMASK, &old_mask, NULL);
- execve(_PATH_BSHELL, argp, environ);
- _exit(127);
- }
-
- intsave = pthread_signal(SIGINT, SIG_IGN);
- quitsave = pthread_signal(SIGQUIT, SIG_IGN);
- pid = waitpid(pid, (int *)&pstat, 0);
- (void)pthread_sigmask(SIG_SETMASK, &old_mask, NULL);
- (void)pthread_signal(SIGQUIT, quitsave);
- (void)pthread_signal(SIGINT, intsave);
- return(pid == -1 ? -1 : pstat);
-}
diff --git a/mit-pthreads/string/GNUmakefile.inc b/mit-pthreads/string/GNUmakefile.inc
deleted file mode 100755
index f3994d31479..00000000000
--- a/mit-pthreads/string/GNUmakefile.inc
+++ /dev/null
@@ -1,7 +0,0 @@
-# from: @(#)Makefile.inc 5.21 (Berkeley) 5/24/91
-# $Id$
-
-# gen sources
-VPATH:= ${VPATH}:${srcdir}/string
-
-SRCS:= strtok.c $(SRCS)
diff --git a/mit-pthreads/string/Makefile.inc b/mit-pthreads/string/Makefile.inc
deleted file mode 100644
index 4a5536bac4a..00000000000
--- a/mit-pthreads/string/Makefile.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-# from: @(#)Makefile.inc 5.21 (Berkeley) 5/24/91
-# $Id$
-
-# string sources
-.PATH: ${srcdir}/string
-
-SRCS+= strtok.c
-
diff --git a/mit-pthreads/string/strtok.c b/mit-pthreads/string/strtok.c
deleted file mode 100644
index 4c08dcc4d37..00000000000
--- a/mit-pthreads/string/strtok.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)strtok.c 5.8 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id$";
-#endif /* LIBC_SCCS and not lint */
-
-#include <pthread.h>
-#include <string.h>
-#include <stdlib.h>
-
-char *
-strtok(s, delim)
- register char *s;
- register const char *delim;
-{
- static pthread_mutex_t strtok_mutex = PTHREAD_MUTEX_INITIALIZER;
- static pthread_key_t strtok_key = -1;
- char **lasts;
-
- pthread_mutex_lock(&strtok_mutex);
- if (strtok_key < 0) {
- if (pthread_key_create(&strtok_key, free) < 0) {
- pthread_mutex_unlock(&strtok_mutex);
- return(NULL);
- }
- }
- pthread_mutex_unlock(&strtok_mutex);
- if ((lasts = pthread_getspecific(strtok_key)) == NULL) {
- if ((lasts = (char **)malloc(sizeof(char *))) == NULL) {
- return(NULL);
- }
- pthread_setspecific(strtok_key, lasts);
- }
-
- return(strtok_r(s, delim, lasts));
-}
-
-char *
-strtok_r(s, delim, lasts)
- register char *s;
- register const char *delim;
- register char **lasts;
-{
- register char *spanp;
- register int c, sc;
- char *tok;
-
-
- if (s == NULL && (s = *lasts) == NULL)
- return (NULL);
-
- /*
- * Skip (span) leading delimiters (s += strspn(s, delim), sort of).
- */
-cont:
- c = *s++;
- for (spanp = (char *)delim; (sc = *spanp++) != 0;) {
- if (c == sc)
- goto cont;
- }
-
- if (c == 0) { /* no non-delimiter characters */
- *lasts = NULL;
- return (NULL);
- }
- tok = s - 1;
-
- /*
- * Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
- * Note that delim must have one NUL; we stop if we see that, too.
- */
- for (;;) {
- c = *s++;
- spanp = (char *)delim;
- do {
- if ((sc = *spanp++) == c) {
- if (c == 0)
- s = NULL;
- else
- s[-1] = 0;
- *lasts = s;
- return (tok);
- }
- } while (sc != 0);
- }
- /* NOTREACHED */
-}
diff --git a/mit-pthreads/tests/.cvsignore b/mit-pthreads/tests/.cvsignore
deleted file mode 100644
index f3c7a7c5da6..00000000000
--- a/mit-pthreads/tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-Makefile
diff --git a/mit-pthreads/tests/Makefile.in b/mit-pthreads/tests/Makefile.in
deleted file mode 100644
index 6e01b6bffc3..00000000000
--- a/mit-pthreads/tests/Makefile.in
+++ /dev/null
@@ -1,164 +0,0 @@
-# === GNUmakefile ============================================================
-# Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
-#
-# Description: This file is for creating the test programs for libpthread.a
-#
-# 1.00 93/08/03 proven
-# -Initial cut for pthreads.
-#
-
-CC = ../pgcc -notinstalled
-CPP = @CPP@
-srctop = @srctop@
-srcdir = @srctop@/tests
-VPATH = @srctop@/tests
-CDEBUGFLAGS = @CFLAGS@
-
-INCLUDES= -I../include -I.. -I$(srctop)/include
-CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(ADDL_CFLAGS) -DSRCDIR=\"$(srcdir)\"
-LIBS = -lm -lgcc -L../obj/ -lpthread
-#LIBS = -static
-
-# This list used to include test_select, but that test doesn't terminate.
-TESTS = test_create test_pthread_join test_switch test_sleep test_readdir \
- test_fork test_execve test_preemption test_preemption_float \
- test_sock_1 test_sock_2 test_stdio_1 test_pthread_mutex \
- test_pthread_cond_timedwait test_netdb test_pw test_cwd
-# This list used to include p_bench_semaphore, but the semaphore support isn't
-# defined for all targets (or used for any).
-BENCHMARKS = p_bench_read p_bench_mutex p_bench_yield \
- p_bench_getpid p_bench_pthread_create
-
-all : $(TESTS) $(BENCHMARKS)
-
-check : $(TESTS)
- set -e ; \
- for i in $(TESTS) ; do \
- echo Running test $$i ... ; \
- ./$$i ; \
- done
-
-# More flags
-ADDITIONALFLAGS = -DPTHREAD_INITIAL_PORT
-################################################################################
-#
-
-clean:
- rm -f *.o $(TESTS) $(BENCHMARKS) a.out core maketmp makeout
-
-depend:
- sed '/\#\#\# Dependencies/q' < Makefile > maketmp
- (for i in $(CSRC);do $(CPP) -M $$i;done) >> maketmp
- cp maketmp Makefile
-
-install:
-
-realclean: clean
- rm -f Makefile
-
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
-Makefile: Makefile.in
- (cd .. ; sh config.status)
-
-test_create : test_create.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_create test_create.o $(LIBS)
-
-test_pthread_join : test_pthread_join.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_pthread_join test_pthread_join.o $(LIBS)
-
-test_switch : test_switch.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_switch test_switch.o $(LIBS)
-
-test_sleep : test_sleep.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_sleep test_sleep.o $(LIBS)
-
-test_readdir : test_readdir.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_readdir test_readdir.o $(LIBS)
-
-test_fork : test_fork.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_fork test_fork.o $(LIBS)
-
-test_execve : test_execve.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_execve test_execve.o $(LIBS)
-
-test_preemption : test_preemption.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_preemption test_preemption.o $(LIBS)
-
-test_preemption_float : test_preemption_float.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_preemption_float test_preemption_float.o $(LIBS)
-
-test_stdio_1 : test_stdio_1.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_stdio_1 test_stdio_1.o $(LIBS)
-
-test_sock_1 : test_sock_1.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_sock_1 test_sock_1.o $(LIBS)
-
-test_sock_2 : test_sock_2a test_sock_2.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_sock_2 test_sock_2.o $(LIBS)
-
-test_sock_2a : test_sock_2a.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_sock_2a test_sock_2a.o $(LIBS)
-
-test_pthread_mutex : test_pthread_mutex.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_pthread_mutex test_pthread_mutex.o $(LIBS)
-
-test_pthread_cond_timedwait : test_pthread_cond_timedwait.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_pthread_cond_timedwait test_pthread_cond_timedwait.o $(LIBS)
-
-test_netdb : test_netdb.o ../libpthread.a
- $(CC) $(CFLAGS) -o test_netdb test_netdb.o $(LIBS)
-
-test_select : test_select.o ../obj/libpthread.a
- $(CC) $(CFLAGS) -o test_select test_select.o $(LIBS)
-
-test_pw : test_pw.o ../obj/libpthread.a
- $(CC) $(CFLAGS) -o test_pw test_pw.o $(LIBS)
-
-test_cwd : test_cwd.o ../obj/libpthread.a
- $(CC) $(CFLAGS) -o test_cwd test_cwd.o $(LIBS)
-
-p_bench_read : p_bench_read.o ../libpthread.a
- $(CC) $(CFLAGS) -o p_bench_read p_bench_read.o $(LIBS)
-
-p_bench_semaphore : p_bench_semaphore.o ../libpthread.a
- $(CC) $(CFLAGS) -o p_bench_semaphore p_bench_semaphore.o $(LIBS)
-
-p_bench_mutex : p_bench_mutex.o ../libpthread.a
- $(CC) $(CFLAGS) -o p_bench_mutex p_bench_mutex.o $(LIBS)
-
-p_bench_yield : p_bench_yield.o ../libpthread.a
- $(CC) $(CFLAGS) -o p_bench_yield p_bench_yield.o $(LIBS)
-
-p_bench_getpid : p_bench_getpid.o ../libpthread.a
- $(CC) $(CFLAGS) -o p_bench_getpid p_bench_getpid.o $(LIBS)
-
-p_bench_pthread_create : p_bench_pthread_create.o ../libpthread.a
- $(CC) $(CFLAGS) -o p_bench_pthread_create p_bench_pthread_create.o $(LIBS)
-
-test_create.o : test_create.c
-test_pthread_join.o : test_pthread_join.c
-test_switch.o : test_switch.c
-test_sleep.o : test_sleep.c
-test_readdir.o : test_readdir.c
-test_fork.o : test_fork.c
-test_execve.o : test_execve.c
-test_preemption.o : test_preemption.c
-test_preemption_float.o : test_preemption_float.c
-test_sock_1.o : test_sock_1.c
-test_sock_2.o : test_sock_2.c
-test_sock_3.o : test_sock_3.c
-test_stdio_1.o : test_stdio_1.c
-test_pthread_mutex.o : test_pthread_mutex.c
-test_pthread_cond_timedwait.o : test_pthread_cond_timedwait.c
-p_bench_read.o : p_bench_read.c
-p_bench_semaphore.o : p_bench_semaphore.c
-p_bench_mutex.o : p_bench_mutex.c
-p_bench_yield.o : p_bench_yield.c
-p_bench_getpid.o : p_bench_getpid.c
-p_bench_pthread_create.o : p_bench_pthread_create.c
-
-################################################################################
-### Do not remove the following line. It is for depend #########################
-### Dependencies:
diff --git a/mit-pthreads/tests/README b/mit-pthreads/tests/README
deleted file mode 100755
index bb4a3e7ce01..00000000000
--- a/mit-pthreads/tests/README
+++ /dev/null
@@ -1,26 +0,0 @@
-This directory contains a few test and benchmark programs that I've
-developed to help me test the consistancy of the libpthread.a.
-
-TEST
-----------------------
-test_create Tests the pthread_create() routine. The stack addresses
- should be very different (ie the upper values of the
- address should be different) and the arg should be
- 0xdeadbeaf.
-
-test_switch A nondeterministic test. It should show context switching,
- by displaying different letters.
-
-test_sleep Timing this test should result in a time of about 20 seconds.
- It should sleep for 10 seconds and then print ba 10 times
- at the rate of about once a second.
-
-p_bench_* Benchmarks for various routines.
-
-------------------------------------------------------------------------------
-Copyright (c) 1994 Chris Provenzano. All rights reserved.
-This product includes software developed by the Univeristy of California,
-Berkeley and its contributors.
-
-For further licencing and distribution restrictions see the file COPYRIGHT
-included in the parent directory.
diff --git a/mit-pthreads/tests/bench_fcntl.c b/mit-pthreads/tests/bench_fcntl.c
deleted file mode 100644
index 046046adda4..00000000000
--- a/mit-pthreads/tests/bench_fcntl.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/* ==== bench_read.c ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Benchmark reads of /dev/null. Gives a good aprox. of
- * syscall times.
- *
- * 1.00 93/08/01 proven
- * -Started coding this file.
- */
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#define OK 0
-#define NOTOK -1
-/* ==========================================================================
- * usage();
- */
-void usage(void)
-{
- printf("getopt [-d?] [-c count]\n");
- errno = 0;
-}
-
-main(int argc, char **argv)
-{
- struct timeval starttime, endtime;
- int count = 1000000;
- int debug = 0;
- int flags;
- int fd;
- int i;
-
- char word[8192];
-
- /* Getopt variables. */
- extern int optind, opterr;
- extern char *optarg;
-
- while ((word[0] = getopt(argc, argv, "c:d?")) != (char)EOF) {
- switch (word[0]) {
- case 'd':
- debug++;
- break;
- case 'c':
- count = atoi(optarg);
- break;
- case '?':
- usage();
- return(OK);
- default:
- usage();
- return(NOTOK);
- }
- }
-
- if ((fd = open("/dev/zero", O_RDONLY)) < OK) {
- printf("Error: open\n");
- exit(0);
- }
-
- if (gettimeofday(&starttime, NULL)) {
- printf("Error: gettimeofday\n");
- exit(0);
- }
- for (i = 0; i < count; i++) {
- if ((flags = fcntl(0, F_GETFL)) < 0) {
- perror("fcntl 1st GETFL");
- }
- }
- if (gettimeofday(&endtime, NULL)) {
- printf("Error: gettimeofday\n");
- exit(0);
- }
-
- printf("%d fcntls of /dev/null took %d usecs.\n", count,
- (endtime.tv_sec - starttime.tv_sec) * 1000000 +
- (endtime.tv_usec - starttime.tv_usec));
-}
diff --git a/mit-pthreads/tests/bench_pipe.c b/mit-pthreads/tests/bench_pipe.c
deleted file mode 100644
index 8555cf37f67..00000000000
--- a/mit-pthreads/tests/bench_pipe.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* ==== bench_pipe.c ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Benchmark reads of /dev/null. Gives a good aprox. of
- * syscall times.
- *
- * 1.00 93/08/01 proven
- * -Started coding this file.
- */
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#define OK 0
-#define NOTOK -1
-
-/* ==========================================================================
- * usage();
- */
-void usage(void)
-{
- printf("bench_pipe [-d?] [-c count]\n");
- errno = 0;
-}
-
-main(int argc, char **argv)
-{
- struct timeval starttime, endtime;
- char buf[1];
- int count = 1000;
- int debug = 0;
- int fd0[2];
- int fd1[2];
- int i;
-
- char word[256];
-
- /* Getopt variables. */
- extern int optind, opterr;
- extern char *optarg;
-
- while ((word[0] = getopt(argc, argv, "c:d?")) != (char)EOF) {
- switch (word[0]) {
- case 'd':
- debug++;
- break;
- case 'c':
- count = atoi(optarg);
- break;
- case '?':
- usage();
- return(OK);
- default:
- usage();
- return(NOTOK);
- }
- }
-
- if ((pipe(fd0) < OK) || (pipe(fd1) < OK)) {
- printf("Error: pipe\n");
- exit(0);
- }
-
- switch (fork()) {
- case NOTOK:
- printf("Error: fork\n");
- exit(0);
- case OK: /* Child */
- for (i = 0; i < count; i++) {
- if (read(fd1[0], buf, 1) < OK) {
- printf("Error: child read\n");
- exit(0);
- }
- if (write(fd0[1], buf, 1) < OK) {
- printf("Error: child write\n");
- exit(0);
- }
- }
- exit(0);
- break;
- default:
- break;
- }
-
- if (gettimeofday(&starttime, NULL)) {
- printf("Error: gettimeofday\n");
- exit(0);
- }
- count --;
- if (write(fd1[1], buf, 1) < OK) {
- perror("first parent write");
- exit(0);
- }
- for (i = 0; i < count; i++) {
- if (read(fd0[0], buf, 1) < OK) {
- printf("Error: parent read\n");
- exit(0);
- }
- if (write(fd1[1], buf, 1) < OK) {
- printf("Error: parent write\n");
- exit(0);
- }
- }
- if (gettimeofday(&endtime, NULL)) {
- printf("Error: gettimeofday\n");
- exit(0);
- }
-
- printf("%d ping pong tests took %d usecs.\n", count,
- (endtime.tv_sec - starttime.tv_sec) * 1000000 +
- (endtime.tv_usec - starttime.tv_usec));
-}
diff --git a/mit-pthreads/tests/bench_read.c b/mit-pthreads/tests/bench_read.c
deleted file mode 100644
index 28c8469e270..00000000000
--- a/mit-pthreads/tests/bench_read.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* ==== bench_read.c ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Benchmark reads of /dev/null. Gives a good aprox. of
- * syscall times.
- *
- * 1.00 93/08/01 proven
- * -Started coding this file.
- */
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#define OK 0
-#define NOTOK -1
-/* ==========================================================================
- * usage();
- */
-void usage(void)
-{
- printf("getopt [-d?] [-c count] [-s size]\n");
- errno = 0;
-}
-
-main(int argc, char **argv)
-{
- struct timeval starttime, endtime;
- int count = 1000000;
- int debug = 0;
- int size = 1;
- int fd;
- int i;
-
- char word[8192];
-
- /* Getopt variables. */
- extern int optind, opterr;
- extern char *optarg;
-
- while ((word[0] = getopt(argc, argv, "s:c:d?")) != (char)EOF) {
- switch (word[0]) {
- case 'd':
- debug++;
- break;
- case 'c':
- count = atoi(optarg);
- break;
- case 's':
- if ((size = atoi(optarg)) > 8192) {
- size = 8192;
- }
- break;
- case '?':
- usage();
- return(OK);
- default:
- usage();
- return(NOTOK);
- }
- }
-
- if ((fd = open("/netbsd", O_RDONLY)) < OK) {
- printf("Error: open\n");
- exit(0);
- }
-
- if (gettimeofday(&starttime, NULL)) {
- printf("Error: gettimeofday\n");
- exit(0);
- }
- for (i = 0; i < count; i++) {
- if (read(fd, word, size) < OK) {
- printf("Error: read\n");
- exit(0);
- }
- }
- if (gettimeofday(&endtime, NULL)) {
- printf("Error: gettimeofday\n");
- exit(0);
- }
-
- printf("%d reads of /netbsd took %d usecs.\n", count,
- (endtime.tv_sec - starttime.tv_sec) * 1000000 +
- (endtime.tv_usec - starttime.tv_usec));
-}
diff --git a/mit-pthreads/tests/p_bench_getpid.c b/mit-pthreads/tests/p_bench_getpid.c
deleted file mode 100644
index d972d075c1d..00000000000
--- a/mit-pthreads/tests/p_bench_getpid.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/* ==== p_bench_getpid.c =================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Benchmark mutex lock and unlock times
- *
- * 1.00 93/11/08 proven
- * -Started coding this file.
- */
-
-#include <errno.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <stdio.h>
-
-#define OK 0
-#define NOTOK -1
-
-/* ==========================================================================
- * usage();
- */
-void usage(void)
-{
- printf("p_bench_getpid [-d?] [-c count]\n");
- errno = 0;
-}
-
-main(int argc, char **argv)
-{
- struct timeval starttime, endtime;
- pthread_mutex_t lock;
- pid_t process_id;
- int count = 1000000;
- int debug = 0;
- int i;
-
- char word[256];
-
- /* Getopt variables. */
- extern int optind, opterr;
- extern char *optarg;
-
- pthread_init();
-
- while ((word[0] = getopt(argc, argv, "c:d?")) != (char)EOF) {
- switch (word[0]) {
- case 'd':
- debug++;
- break;
- case 'c':
- count = atoi(optarg);
- break;
- case '?':
- usage();
- return(OK);
- default:
- usage();
- return(NOTOK);
- }
- }
-
- if (gettimeofday(&starttime, NULL)) {
- perror ("gettimeofday");
- return 1;
- }
- for (i = 0; i < count; i++) {
- process_id = getpid();
- }
- if (gettimeofday(&endtime, NULL)) {
- perror ("gettimeofday");
- return 1;
- }
-
- printf("%d getpid calls took %d usecs.\n", count,
- (endtime.tv_sec - starttime.tv_sec) * 1000000 +
- (endtime.tv_usec - starttime.tv_usec));
-
- return 0;
-}
diff --git a/mit-pthreads/tests/p_bench_mutex.c b/mit-pthreads/tests/p_bench_mutex.c
deleted file mode 100644
index e3179f08072..00000000000
--- a/mit-pthreads/tests/p_bench_mutex.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/* ==== p_bench_mutex.c =================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Benchmark mutex lock and unlock times
- *
- * 1.00 93/11/08 proven
- * -Started coding this file.
- */
-
-#include <errno.h>
-#include <pthread.h>
-#include <stdio.h>
-
-#define OK 0
-#define NOTOK -1
-
-/* ==========================================================================
- * usage();
- */
-void usage(void)
-{
- printf("getopt [-d?] [-c count]\n");
- errno = 0;
-}
-
-main(int argc, char **argv)
-{
- struct timeval starttime, endtime;
- pthread_mutex_t lock;
- int count = 1000000;
- int debug = 0;
- int i;
-
- char word[256];
-
- /* Getopt variables. */
- extern int optind, opterr;
- extern char *optarg;
-
- pthread_init();
-
- while ((word[0] = getopt(argc, argv, "c:d?")) != (char)EOF) {
- switch (word[0]) {
- case 'd':
- debug++;
- break;
- case 'c':
- count = atoi(optarg);
- break;
- case '?':
- usage();
- return(OK);
- default:
- usage();
- return(NOTOK);
- }
- }
-
- pthread_mutex_init(&lock, NULL);
- if (gettimeofday(&starttime, NULL)) {
- perror ("gettimeofday");
- return 1;
- }
- for (i = 0; i < count; i++) {
- pthread_mutex_lock(&lock);
- pthread_mutex_unlock(&lock);
- }
- if (gettimeofday(&endtime, NULL)) {
- perror ("gettimeofday");
- return 1;
- }
-
- printf("%d mutex locks/unlocks no contention took %d usecs.\n", count,
- (endtime.tv_sec - starttime.tv_sec) * 1000000 +
- (endtime.tv_usec - starttime.tv_usec));
-
- return 0;
-}
diff --git a/mit-pthreads/tests/p_bench_pthread_create.c b/mit-pthreads/tests/p_bench_pthread_create.c
deleted file mode 100644
index b31b680c665..00000000000
--- a/mit-pthreads/tests/p_bench_pthread_create.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* ==== p_bench_pthread_create.c =============================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Benchmark mutex lock and unlock times
- *
- * 1.00 93/11/08 proven
- * -Started coding this file.
- */
-
-#define PTHREAD_KERNEL
-
-#include <errno.h>
-#include <pthread.h>
-#include <stdio.h>
-
-extern pthread_attr_t pthread_attr_default;
-
-/* ==========================================================================
- * new_thread();
- */
-void * new_thread(void * arg)
-{
- PANIC();
-}
-
-/* ==========================================================================
- * usage();
- */
-void usage(void)
-{
- printf("p_bench_getpid [-d?] [-c count]\n");
- errno = 0;
-}
-
-main(int argc, char **argv)
-{
- struct timeval starttime, endtime;
- pthread_mutex_t lock;
- pthread_t thread_id;
- int count = 10000;
- int debug = 0;
- int i;
-
- char word[256];
-
- /* Getopt variables. */
- extern int optind, opterr;
- extern char *optarg;
-
- pthread_init();
- /* Shut timer off */
- machdep_unset_thread_timer(NULL);
- pthread_attr_default.stackaddr_attr = &word;
-
- while ((word[0] = getopt(argc, argv, "c:d?")) != (char)EOF) {
- switch (word[0]) {
- case 'd':
- debug++;
- break;
- case 'c':
- count = atoi(optarg);
- break;
- case '?':
- usage();
- return(OK);
- default:
- usage();
- return(NOTOK);
- }
- }
-
- if (gettimeofday(&starttime, NULL)) {
- perror ("gettimeofday");
- return 1;
- }
- for (i = 0; i < count; i++) {
- if (pthread_create(&thread_id, & pthread_attr_default, new_thread, NULL)) {
- printf("Bad pthread create routine\n");
- exit(1);
- }
- }
- if (gettimeofday(&endtime, NULL)) {
- perror ("gettimeofday");
- return 1;
- }
-
- printf("%d getpid calls took %d usecs.\n", count,
- (endtime.tv_sec - starttime.tv_sec) * 1000000 +
- (endtime.tv_usec - starttime.tv_usec));
-
- return 0;
-}
diff --git a/mit-pthreads/tests/p_bench_read.c b/mit-pthreads/tests/p_bench_read.c
deleted file mode 100644
index 52a6aca7706..00000000000
--- a/mit-pthreads/tests/p_bench_read.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* ==== p_bench_read.c ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Benchmark reads of /dev/null. Gives a good aprox. of
- * syscall times.
- *
- * 1.00 93/08/01 proven
- * -Started coding this file.
- */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#define OK 0
-#define NOTOK -1
-
-/* ==========================================================================
- * usage();
- */
-void usage(void)
-{
- printf("p_bench_read [-d?] [-c count] [-s size] [-f file]\n");
- errno = 0;
-}
-
-main(int argc, char **argv)
-{
- struct timeval starttime, endtime;
- char *infile = "/dev/null";
- int count = 1000000;
- int debug = 0;
- int size = 1;
- int fd;
- int i;
-
- char word[16384], *word_ptr;
-
- /* Getopt variables. */
- extern int optind, opterr;
- extern char *optarg;
-
- pthread_init();
-
- while ((word[0] = getopt(argc, argv, "c:df:s:?")) != (char)EOF) {
- switch (word[0]) {
- case 'c':
- count = atoi(optarg);
- break;
- case 'd':
- debug++;
- break;
- case 'f':
- infile = optarg;
- break;
- case 's':
- if ((size = atoi(optarg)) > 8192) {
- size = 8192;
- }
- break;
- case '?':
- usage();
- return(OK);
- default:
- usage();
- return(NOTOK);
- }
- }
-
- /* Align buffer boundary to a page boundary */
- word_ptr = (char *)(((size_t) word + 4095) & ~4095);
-
- if ((fd = open(infile, O_RDONLY)) < OK) {
- perror ("open");
- return 1;
- }
-
- if (gettimeofday(&starttime, NULL)) {
- perror ("gettimeofday");
- return 1;
- }
-
- for (i = 0; i < count; i++) {
- if (read(fd, word_ptr, size) < OK) {
- printf("Error: read\n");
- exit(0);
- }
- }
-
- if (gettimeofday(&endtime, NULL)) {
- perror ("gettimeofday");
- return 1;
- }
-
- printf("%d reads of %s took %d usecs.\n", count, infile,
- (endtime.tv_sec - starttime.tv_sec) * 1000000 +
- (endtime.tv_usec - starttime.tv_usec));
-
- return 0;
-}
diff --git a/mit-pthreads/tests/p_bench_semaphore.c b/mit-pthreads/tests/p_bench_semaphore.c
deleted file mode 100644
index b3bce340b95..00000000000
--- a/mit-pthreads/tests/p_bench_semaphore.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/* ==== p_bench_semaphore.c =================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Benchmark semaphore Test and Set/ CLear times
- *
- * 1.00 93/11/08 proven
- * -Started coding this file.
- */
-
-#include <errno.h>
-#include <pthread.h>
-#include <stdio.h>
-
-#define OK 0
-#define NOTOK -1
-
-/* ==========================================================================
- * usage();
- */
-void usage(void)
-{
- printf("getopt [-d?] [-c count]\n");
- errno = 0;
-}
-
-main(int argc, char **argv)
-{
- struct timeval starttime, endtime;
- semaphore lock = SEMAPHORE_CLEAR;
- semaphore *lock_addr;
- int count = 1000000;
- int debug = 0;
- int i;
-
- char word[256];
-
- /* Getopt variables. */
- extern int optind, opterr;
- extern char *optarg;
-
- pthread_init();
-
- while ((word[0] = getopt(argc, argv, "c:d?")) != (char)EOF) {
- switch (word[0]) {
- case 'd':
- debug++;
- break;
- case 'c':
- count = atoi(optarg);
- break;
- case '?':
- usage();
- return(OK);
- default:
- usage();
- return(NOTOK);
- }
- }
-
- lock_addr = &lock;
- if (gettimeofday(&starttime, NULL)) {
- perror ("gettimeofday");
- return 1;
- }
- for (i = 0; i < count; i++) {
- if (SEMAPHORE_TEST_AND_SET(lock_addr)) {
- printf("Semaphore already locked error\n");
- return 1;
- }
- SEMAPHORE_RESET(lock_addr);
- }
- if (gettimeofday(&endtime, NULL)) {
- perror ("gettimeofday");
- return 1;
- }
-
- printf("%d locks/unlocks of a semaphore took %d usecs.\n", count,
- (endtime.tv_sec - starttime.tv_sec) * 1000000 +
- (endtime.tv_usec - starttime.tv_usec));
-
- return 0;
-}
diff --git a/mit-pthreads/tests/p_bench_yield.c b/mit-pthreads/tests/p_bench_yield.c
deleted file mode 100644
index bb6d86be09e..00000000000
--- a/mit-pthreads/tests/p_bench_yield.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/* ==== p_bench_mutex.c =================================================
- * Copyright (c) 1993-1995 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Benchmark mutex lock and unlock times
- *
- * 1.00 93/11/08 proven
- * -Started coding this file.
- */
-
-#include <errno.h>
-#include <pthread.h>
-#include <stdio.h>
-
-#define OK 0
-#define NOTOK -1
-
-/* ==========================================================================
- * usage();
- */
-void usage(void)
-{
- printf("p_bench_yield [-d?] \\\n");
- printf("\t[-c count] \\\n");
- printf("\t[-C thread count] \\\n");
- printf("\t[-O optimization level]\n");
- errno = 0;
-}
-
-void *yield(void * arg)
-{
- int i, * count;
-
- count = (int *)arg;
- for (i = 0; i < *count; i++) {
- pthread_yield();
- }
- return(NULL);
-}
-
-main(int argc, char **argv)
-{
- struct timeval starttime, endtime;
- pthread_mutex_t lock;
- pthread_attr_t attr;
- pthread_t thread_id;
- int thread_count = 1;
- int optimization = 0;
- int count = 1000000;
- int i, debug = 0;
-
- char word[256];
-
- /* Getopt variables. */
- extern int optind, opterr;
- extern char *optarg;
-
- pthread_init();
-
- while ((word[0] = getopt(argc, argv, "C:O:c:d?")) != (char)EOF) {
- switch (word[0]) {
- case 'C':
- thread_count = atoi(optarg);
- break;
- case 'O':
- optimization = atoi(optarg);
- break;
- case 'c':
- count = atoi(optarg);
- break;
- case 'd':
- debug++;
- break;
- case '?':
- usage();
- return(OK);
- default:
- usage();
- return(NOTOK);
- }
- }
-
- pthread_attr_init(&attr);
- if (optimization > 0) {
- pthread_attr_setschedpolicy(&attr, SCHED_FIFO);
- }
- if (optimization > 1) {
- pthread_attr_setfloatstate(&attr, PTHREAD_NOFLOAT);
- }
-
- pthread_mutex_init(&lock, NULL);
- if (gettimeofday(&starttime, NULL)) {
- perror ("gettimeofday");
- return 1;
- }
- for (i = 1; i < thread_count; i++) {
- if (pthread_create(&thread_id, &attr, yield, &count)) {
- perror ("pthread_create");
- return 1;
- }
- if (pthread_detach(thread_id)) {
- perror ("pthread_detach");
- return 1;
- }
- }
- if (pthread_create(&thread_id, &attr, yield, &count)) {
- perror ("pthread_create");
- return 1;
- }
- if (pthread_join(thread_id, NULL)) {
- perror ("pthread_join");
- return 1;
- }
- if (gettimeofday(&endtime, NULL)) {
- perror ("gettimeofday");
- return 1;
- }
-
- printf("%d pthread_yields took %d usecs.\n", count,
- (endtime.tv_sec - starttime.tv_sec) * 1000000 +
- (endtime.tv_usec - starttime.tv_usec));
-
- return 0;
-}
diff --git a/mit-pthreads/tests/test_create.c b/mit-pthreads/tests/test_create.c
deleted file mode 100644
index 2d82db07c5f..00000000000
--- a/mit-pthreads/tests/test_create.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ==== test_create.c ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Test pthread_create() and pthread_exit() calls.
- *
- * 1.00 93/08/03 proven
- * -Started coding this file.
- */
-
-#define PTHREAD_KERNEL
-#include <pthread.h>
-#include <stdio.h>
-
-void* new_thread(void* arg)
-{
- int i;
-
- printf("New thread was passed arg address %x\n", arg);
- printf("New thread stack at %x\n", &i);
- return(NULL);
- PANIC();
-}
-
-main()
-{
- pthread_t thread;
- int i;
-
- printf("Original thread stack at %x\n", &i);
- if (pthread_create(&thread, NULL, new_thread, (void *)0xdeadbeef)) {
- printf("Error: creating new thread\n");
- }
- pthread_exit(NULL);
- PANIC();
-}
diff --git a/mit-pthreads/tests/test_cwd.c b/mit-pthreads/tests/test_cwd.c
deleted file mode 100644
index 979c173d5fc..00000000000
--- a/mit-pthreads/tests/test_cwd.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <stdio.h>
-
-main(int argc, char **argv)
-{
- char wd[1024], *getcwd(), *getwd();
-
- pthread_init();
- printf("getcwd => %s\n", getcwd(wd, 1024));
- printf("getwd => %s\n", getwd(wd));
- exit(0);
-}
diff --git a/mit-pthreads/tests/test_execve.c b/mit-pthreads/tests/test_execve.c
deleted file mode 100644
index f7988457df9..00000000000
--- a/mit-pthreads/tests/test_execve.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ==== test_execve.c ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Test execve() and dup2() calls.
- *
- * 1.00 94/04/29 proven
- * -Started coding this file.
- */
-
-#define PTHREAD_KERNEL
-#include <pthread.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdio.h>
-
-extern char **environ;
-char *argv[] = {
- "/bin/echo",
- "This message should be displayed after the execve system call",
- NULL
-};
-
-char * should_succeed = "This line should be displayed\n";
-char * should_fail = "Error: This line should NOT be displayed\n";
-
-main()
-{
- pthread_t thread;
- int fd;
-
- pthread_init();
-
- printf("This is the first message\n");
- if (isatty(1)) {
- if ((fd = open(ttyname(1), O_RDWR)) < OK) {
- printf("Error: opening tty\n");
- exit(1);
- }
- } else {
- printf("Error: stdout not a tty\n");
- exit(1);
- }
-
- printf("This output is necessary to set the stdout fd to NONBLOCKING\n");
-
- /* do a dup2 */
- dup2(fd, 1);
- write(1, should_succeed, (size_t)strlen(should_succeed));
- machdep_sys_write(1, should_fail, strlen(should_fail));
-
- if (execve(argv[0], argv, environ) < OK) {
- printf("Error: execve\n");
- exit(1);
- }
- PANIC();
-}
diff --git a/mit-pthreads/tests/test_fcntl.c b/mit-pthreads/tests/test_fcntl.c
deleted file mode 100644
index 60bc77ce464..00000000000
--- a/mit-pthreads/tests/test_fcntl.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <stdio.h>
-#include <fcntl.h>
-
-main()
-{
- int flags, child;
-
- if ((flags = fcntl(0, F_GETFL)) < 0) {
- perror("fcntl 1st GETFL");
- }
- printf ("flags = %x\n", flags);
-
- switch(child = fork()) {
- case -1:
- printf("error during fork\n");
- break;
- case 0: /* child */
- execlp("test_create", "test_create", NULL);
- break;
- default: /* parent */
- wait(NULL);
- break;
- }
-
- while(1){
- if ((flags = fcntl(0, F_GETFL)) < 0) {
- perror("fcntl parent GETFL");
- }
- printf ("parent %d flags = %x\n", child, flags);
- sleep(1);
- }
-}
diff --git a/mit-pthreads/tests/test_fork.c b/mit-pthreads/tests/test_fork.c
deleted file mode 100644
index 4c2125e678a..00000000000
--- a/mit-pthreads/tests/test_fork.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* ==== test_fork.c ============================================================
- * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Test fork() and dup2() calls.
- *
- * 1.00 94/04/29 proven
- * -Started coding this file.
- */
-
-#define PTHREAD_KERNEL
-#include <pthread.h>
-#include <stdio.h>
-#include <fcntl.h>
-
-main()
-{
- pthread_t thread;
- int flags, pid;
-
- pthread_init();
-
- if (((flags = machdep_sys_fcntl(1, F_GETFL, NULL)) >= OK) &&
- (flags & __FD_NONBLOCK | O_NDELAY)) {
- machdep_sys_fcntl(1, F_SETFL, flags & (~__FD_NONBLOCK | O_NDELAY));
- }
- printf("parent process %d\n", getpid());
-
- switch(pid = fork()) {
- case OK:
- exit(OK);
- break;
- case NOTOK:
- printf("fork() FAILED\n");
- exit(2);
- break;
- default:
- if ((flags = machdep_sys_fcntl(1, F_GETFL, NULL)) >= OK) {
- if (flags & (__FD_NONBLOCK | O_NDELAY)) {
- printf("fd flags not set to BLOCKING ERROR\n");
- printf("test_fork FAILED\n");
- exit(1);
- break;
- }
- printf("The stdout fd was set to BLOCKING\n");
- printf("child process %d\n", pid);
- flags = machdep_sys_fcntl(1, F_GETFL, NULL);
- if (flags & (__FD_NONBLOCK | O_NDELAY)) {
- printf("The stdout fd was reset to O_NDELAY\n");
- } else {
- printf("Error: the stdout fd was not reset\n");
- printf("test_fork FAILED\n");
- exit(1);
- }
- }
- break;
- }
-
- printf("test_fork PASSED\n");
- pthread_exit(NULL);
-}
diff --git a/mit-pthreads/tests/test_netdb.c b/mit-pthreads/tests/test_netdb.c
deleted file mode 100644
index a944579237f..00000000000
--- a/mit-pthreads/tests/test_netdb.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/* ==== test_netdb.c =========================================================
- * Copyright (c) 1995 by Greg Hudson, ghudson@.mit.edu
- *
- * Description : Test netdb calls.
- *
- * 1.00 95/01/05 ghudson
- * -Started coding this file.
- */
-
-#define PTHREAD_KERNEL /* Needed for OK and NOTOK defines */
-#include <pthread.h>
-#include <string.h>
-#include <stdio.h>
-#include <netdb.h>
-#include <errno.h>
-
-int debug = 0;
-
-static int test_serv()
-{
- struct servent *serv;
- char answer[1024];
-
- if (serv = getservbyname("telnet", "tcp"))
- printf("getservbyname -> port %d\n", ntohs(serv->s_port));
- else
- printf("getservbyname -> NULL (bad)\n");
-
- if (serv = getservbyname_r("telnet", "tcp", serv, answer, 1024))
- printf("getservbyname_r -> port %d\n", ntohs(serv->s_port));
- else
- printf("getservbyname_r -> NULL (bad)\n");
- return(OK);
-}
-
-static int test_host()
-{
- struct hostent *host;
- struct in_addr addr;
- char answer[1024];
- int error;
-
- if (host = gethostbyname("maze.mit.edu")) {
- memcpy(&addr, host->h_addr, sizeof(addr));
- printf("gethostbyname -> %s\n", inet_ntoa(addr));
- } else {
- printf("gethostbyname -> NULL (bad)\n");
- host = (struct hostent *)answer;
- }
-
- if (host = gethostbyname_r("maze.mit.edu", host, answer, 1024, &error)) {
- memcpy(&addr, host->h_addr, sizeof(addr));
- printf("gethostbyname_r -> %s\n", inet_ntoa(addr));
- } else {
- printf("gethostbyname_r -> NULL (bad)\n");
- }
- return(OK);
-}
-
-static int test_localhost()
-{
- struct hostent *host;
-
- if (host = gethostbyname("127.0.0.1")) {
- return(OK);
- }
- return(NOTOK);
-}
-
-/* ==========================================================================
- * usage();
- */
-void usage(void)
-{
- printf("test_netdb [-d?]\n");
- errno = 0;
-}
-
-main(int argc, char **argv)
-{
-
- /* Getopt variables. */
- extern int optind, opterr;
- extern char *optarg;
- char ch;
-
- while ((ch = getopt(argc, argv, "d?")) != (char)EOF) {
- switch (ch) {
- case 'd':
- debug++;
- break;
- case '?':
- usage();
- return(OK);
- default:
- usage();
- return(NOTOK);
- }
- }
-
- printf("test_netdb START\n");
-
- if (test_serv() || test_localhost() || test_host()) {
- printf("test_netdb FAILED\n");
- exit(1);
- }
-
- printf("test_netdb PASSED\n");
- exit(0);
-}
diff --git a/mit-pthreads/tests/test_pause.c b/mit-pthreads/tests/test_pause.c
deleted file mode 100644
index 46c5080e43e..00000000000
--- a/mit-pthreads/tests/test_pause.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <stdio.h>
-#include <signal.h>
-
-foo(int sig)
-{
- return;
-}
-
-main()
-{
- sigset_t all;
-
- signal (1, foo);
- sigfillset(&all);
- sigprocmask(SIG_BLOCK, &all, NULL);
- printf("Begin pause\n");
- pause();
- printf("Done pause\n");
-}
diff --git a/mit-pthreads/tests/test_preemption.c b/mit-pthreads/tests/test_preemption.c
deleted file mode 100644
index 9181c127fe4..00000000000
--- a/mit-pthreads/tests/test_preemption.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* ==== test_pthread_cond.c =========================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Test pthread_cond(). Run this after test_create()
- *
- * 1.23 94/05/04 proven
- * -Started coding this file.
- */
-
-#include <pthread.h>
-#include <stdio.h>
-
-void* new_thread(void * new_buf)
-{
- int i;
-
- for (i = 0; i < 10; i++) {
- pthread_yield();
- }
- printf("test_preemption PASSED\n");
- exit(0);
-}
-
-main()
-{
- pthread_t thread;
- int error;
-
- printf("test_preemption START\n");
-
- if (pthread_create(&thread, NULL, new_thread, NULL)) {
- printf("pthread_create failed\n");
- exit(2);
- }
-
- while(1);
- exit(1);
-}
diff --git a/mit-pthreads/tests/test_preemption_float.c b/mit-pthreads/tests/test_preemption_float.c
deleted file mode 100644
index e12192044c6..00000000000
--- a/mit-pthreads/tests/test_preemption_float.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Test to see if floating point state is being properly maintained
- for each thread. Different threads doing floating point operations
- simultaneously should not interfere with one another. This
- includes operations that might change some FPU flags, such as
- rounding modes, at least implicitly. */
-
-#include <pthread.h>
-#include <math.h>
-#include <stdio.h>
-
-int limit = 2;
-int float_passed = 0;
-int float_failed = 1;
-
-void *log_loop (void *x) {
- int i;
- double d, d1, d2;
- /* sleep (1); */
- for (i = 0; i < limit; i++) {
- d = 42.0;
- d = log (exp (d));
- d = (d + 39.0) / d;
- if (i == 0)
- d1 = d;
- else {
- d2 = d;
- d = sin(d);
- /* if (d2 != d1) { */
- if (memcmp (&d2, &d1, 8)) {
- pthread_exit(&float_failed);
- }
- }
- }
- pthread_exit(&float_passed);
-}
-
-void *trig_loop (void *x) {
- int i;
- double d, d1, d2;
- /* sleep (1); */
- for (i = 0; i < limit; i++) {
- d = 35.0;
- d *= M_PI;
- d /= M_LN2;
- d = sin (d);
- d = cos (1 / d);
- if (i == 0)
- d1 = d;
- else {
- d2 = d;
- d = sin(d);
- /* if (d2 != d1) { */
- if (memcmp (&d2, &d1, 8)) {
- pthread_exit(&float_failed);
- }
- }
- }
- pthread_exit(&float_passed);
-}
-
-#define N 10
-int main () {
- int i;
- pthread_t thread[2];
- pthread_attr_t attr;
- int *x, *y;
-
- pthread_init ();
- pthread_attr_init(&attr);
- pthread_attr_setfloatstate(&attr, PTHREAD_NOFLOAT);
-
- while(limit < 100000) {
- pthread_create (&thread[0], &attr, trig_loop, 0);
- pthread_create (&thread[1], &attr, log_loop, 0);
- pthread_join(thread[0], (void **) &x);
- pthread_join(thread[1], (void **) &y);
- if ((*x == float_failed) || (*y == float_failed)) {
- limit *= 4;
- break;
- }
- limit *= 4;
- }
- if ((*x == float_passed) && (*y == float_passed)) {
- printf("test_preemption_float INDETERMINATE\n");
- return(0);
- }
- pthread_create (&thread[0], NULL, trig_loop, 0);
- pthread_create (&thread[1], NULL, log_loop, 0);
- pthread_join(thread[0], (void **) &x);
- pthread_join(thread[1], (void **) &y);
-
- if ((*x == float_failed) || (*y == float_failed)) {
- printf("test_preemption_float FAILED\n");
- return(1);
- }
- printf("test_preemption_float PASSED\n");
- return(0);
-}
diff --git a/mit-pthreads/tests/test_pthread_cond_timedwait.c b/mit-pthreads/tests/test_pthread_cond_timedwait.c
deleted file mode 100644
index fe21408f11e..00000000000
--- a/mit-pthreads/tests/test_pthread_cond_timedwait.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ==== test_pthread_cond.c =========================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Test pthread_cond(). Run this after test_create()
- *
- * 1.23 94/05/04 proven
- * -Started coding this file.
- */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <errno.h>
-
-#ifndef ETIME
-#define ETIME ETIMEDOUT
-#endif
-
-pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
-
-void* thread_1(void * new_buf)
-{
- pthread_mutex_lock(&mutex);
- pthread_cond_signal(&cond);
- pthread_mutex_unlock(&mutex);
- pthread_exit(NULL);
-}
-
-void* thread_2(void * new_buf)
-{
- sleep(1);
- pthread_mutex_lock(&mutex);
- pthread_cond_signal(&cond);
- pthread_mutex_unlock(&mutex);
- pthread_exit(NULL);
-}
-
-main()
-{
- struct timespec abstime = { 0, 0 };
- struct timeval curtime;
- pthread_t thread;
- int error;
-
- pthread_init();
- printf("pthread_cond_timedwait START\n");
-
- pthread_mutex_lock(&mutex);
- gettimeofday(&curtime, NULL);
- abstime.tv_sec = curtime.tv_sec + 5;
-
- /* Test a condition timeout */
- if (pthread_cond_timedwait(&cond, &mutex, &abstime) != ETIME) {
- printf("pthread_cond_timedwait failed to timeout\n");
- printf("pthread_cond_timedwait FAILED\n");
- pthread_mutex_unlock(&mutex);
- exit(1);
- }
- printf("Got first timeout ok\n"); /* Added by monty */
- /* Test a normal condition signal */
- if (pthread_create(&thread, NULL, thread_1, NULL)) {
- printf("pthread_create failed\n");
- exit(2);
- }
-
- abstime.tv_sec = curtime.tv_sec + 10;
- if (pthread_cond_timedwait(&cond, &mutex, &abstime)) {
- printf("pthread_cond_timedwait #1 timedout\n");
- printf("pthread_cond_timedwait FAILED\n");
- pthread_mutex_unlock(&mutex);
- exit(1);
- }
-
- /* Test a normal condition signal after a sleep */
- if (pthread_create(&thread, NULL, thread_2, NULL)) {
- printf("pthread_create failed\n");
- exit(2);
- }
-
- pthread_yield();
-
- abstime.tv_sec = curtime.tv_sec + 10;
- if (pthread_cond_timedwait(&cond, &mutex, &abstime)) {
- printf("pthread_cond_timedwait #2 timedout\n");
- printf("pthread_cond_timedwait FAILED\n");
- pthread_mutex_unlock(&mutex);
- exit(1);
- }
-
- printf("pthread_cond_timedwait PASSED\n");
- pthread_mutex_unlock(&mutex);
- exit(0);
-}
diff --git a/mit-pthreads/tests/test_pthread_join.c b/mit-pthreads/tests/test_pthread_join.c
deleted file mode 100644
index fd2ec6a78b2..00000000000
--- a/mit-pthreads/tests/test_pthread_join.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/* ==== test_pthread_join.c =================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Test pthread_join(). Run this after test_create()
- *
- * 1.23 94/05/04 proven
- * -Started coding this file.
- */
-
-#define PTHREAD_KERNEL
-#include <pthread.h>
-#include <stdio.h>
-
-/* This thread yields so the creator has a live thread to wait on */
-void* new_thread_1(void * new_buf)
-{
- int i;
-
- sprintf((char *)new_buf, "New thread %%d stack at %x\n", &i);
- pthread_yield();
- return(new_buf);
- PANIC();
-}
-
-/* This thread doesn't yield so the creator has a dead thread to wait on */
-void* new_thread_2(void * new_buf)
-{
- int i;
-
- sprintf((char *)new_buf, "New thread %%d stack at %x\n", &i);
- return(new_buf);
- PANIC();
-}
-
-main()
-{
- char buf[256], *status;
- pthread_t thread;
- int debug = 1;
- int i = 0;
-
- pthread_init();
-
- printf("Original thread stack at %x\n", &i);
- if (pthread_create(&thread, NULL, new_thread_1, (void *)buf) == OK) {
- if (pthread_join(thread, (void **)(&status)) == OK) {
- if (debug) { printf(status, ++i); }
- } else {
- printf("ERROR: Joining with new thread #1.\n");
- printf("FAILED: test_pthread_join\n");
- exit(1);
- }
- } else {
- printf("ERROR: Creating new thread #1\n");
- printf("FAILED: test_pthread_join\n");
- exit(2);
- }
-
-
- /* Now have the created thread finishing before the join. */
- if (pthread_create(&thread, NULL, new_thread_2, (void *)buf) == OK){
- pthread_yield();
- if (pthread_join(thread, (void **)(&status)) == OK) {
- if (debug) { printf(status, ++i); }
- } else {
- printf("ERROR: Joining with new thread #2.\n");
- printf("FAILED: test_pthread_join\n");
- exit(1);
- }
- } else {
- printf("ERROR: Creating new thread #2\n");
- printf("FAILED: test_pthread_join\n");
- exit(2);
- }
- printf("test_pthread_join PASSED\n");
- pthread_exit(NULL);
-}
-
diff --git a/mit-pthreads/tests/test_pthread_mutex.c b/mit-pthreads/tests/test_pthread_mutex.c
deleted file mode 100644
index 2fb0574f5cb..00000000000
--- a/mit-pthreads/tests/test_pthread_mutex.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/* ==== test_pthread_cond.c =========================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Test pthread_cond(). Run this after test_create()
- *
- * 1.23 94/05/04 proven
- * -Started coding this file.
- */
-
-#include <errno.h>
-#include <pthread.h>
-#include <stdio.h>
-
-#define OK 0
-#define NOTOK -1
-
-int contention_variable;
-
-void * thread_contention(void * arg)
-{
- pthread_mutex_t * mutex = arg;
-
- if (pthread_mutex_lock(mutex)) {
- printf("pthread_mutex_lock() ERROR\n");
- pthread_exit(NULL);
- }
-
- if (contention_variable != 1) {
- printf("contention_variable != 1 ERROR\n");
- pthread_exit(NULL);
- }
- contention_variable = 2;
-
- if (pthread_mutex_unlock(mutex)) {
- printf("pthread_mutex_unlock() ERROR\n");
- pthread_exit(NULL);
- }
- pthread_exit(NULL);
-}
-
-int test_contention_lock(pthread_mutex_t * mutex)
-{
- pthread_t thread;
-
- printf("test_contention_lock()\n");
-
- if (pthread_mutex_lock(mutex)) {
- printf("pthread_mutex_lock() ERROR\n");
- return(NOTOK);
- }
- contention_variable = 0;
-
- if (pthread_create(&thread, NULL, thread_contention, mutex)) {
- printf("pthread_create() FAILED\n");
- exit(2);
- }
-
- pthread_yield();
-
- contention_variable = 1;
-
- if (pthread_mutex_unlock(mutex)) {
- printf("pthread_mutex_unlock() ERROR\n");
- return(NOTOK);
- }
-
- if (pthread_mutex_lock(mutex)) {
- printf("pthread_mutex_lock() ERROR\n");
- return(NOTOK);
- }
-
- if (contention_variable != 2) {
- printf("contention_variable != 2 ERROR\n");
- return(NOTOK);
- }
-
- if (pthread_mutex_unlock(mutex)) {
- printf("pthread_mutex_unlock() ERROR\n");
- return(NOTOK);
- }
-
- return(OK);
-}
-
-int test_nocontention_lock(pthread_mutex_t * mutex)
-{
- printf("test_nocontention_lock()\n");
- if (pthread_mutex_lock(mutex)) {
- printf("pthread_mutex_lock() ERROR\n");
- return(NOTOK);
- }
- if (pthread_mutex_unlock(mutex)) {
- printf("pthread_mutex_unlock() ERROR\n");
- return(NOTOK);
- }
- return(OK);
-}
-
-int test_debug_double_lock(pthread_mutex_t * mutex)
-{
- printf("test_debug_double_lock()\n");
- if (pthread_mutex_lock(mutex)) {
- printf("pthread_mutex_lock() ERROR\n");
- return(NOTOK);
- }
- if (pthread_mutex_lock(mutex) != EDEADLK) {
- printf("double lock error not detected ERROR\n");
- return(NOTOK);
- }
- if (pthread_mutex_unlock(mutex)) {
- printf("pthread_mutex_unlock() ERROR\n");
- return(NOTOK);
- }
- return(OK);
-}
-
-int test_debug_double_unlock(pthread_mutex_t * mutex)
-{
- printf("test_debug_double_unlock()\n");
- if (pthread_mutex_lock(mutex)) {
- printf("pthread_mutex_lock() ERROR\n");
- return(NOTOK);
- }
- if (pthread_mutex_unlock(mutex)) {
- printf("pthread_mutex_unlock() ERROR\n");
- return(NOTOK);
- }
- if (pthread_mutex_unlock(mutex) != EPERM) {
- printf("double unlock error not detected ERROR\n");
- return(NOTOK);
- }
- return(OK);
-}
-
-int test_nocontention_trylock(pthread_mutex_t * mutex)
-{
- printf("test_nocontention_trylock()\n");
- if (pthread_mutex_trylock(mutex)) {
- printf("pthread_mutex_trylock() ERROR\n");
- return(NOTOK);
- }
- if (pthread_mutex_unlock(mutex)) {
- printf("pthread_mutex_unlock() ERROR\n");
- return(NOTOK);
- }
- return(OK);
-}
-
-int test_mutex_static(void)
-{
- pthread_mutex_t mutex_static = PTHREAD_MUTEX_INITIALIZER;
-
- printf("test_mutex_static()\n");
- if (test_nocontention_lock(&mutex_static) ||
- test_contention_lock(&mutex_static)) {
- return(NOTOK);
- }
- return(OK);
-}
-
-int test_mutex_fast(void)
-{
- pthread_mutex_t mutex_fast;
-
- printf("test_mutex_fast()\n");
- if (pthread_mutex_init(&mutex_fast, NULL)) {
- printf("pthread_mutex_init() ERROR\n");
- return(NOTOK);
- }
- if (test_nocontention_lock(&mutex_fast) ||
- test_contention_lock(&mutex_fast)) {
- return(NOTOK);
- }
- if (pthread_mutex_destroy(&mutex_fast)) {
- printf("pthread_mutex_destroy() ERROR\n");
- return(NOTOK);
- }
- return(OK);
-}
-
-int test_mutex_debug()
-{
- pthread_mutexattr_t mutex_debug_attr;
- pthread_mutex_t mutex_debug;
-
- printf("test_mutex_debug()\n");
- pthread_mutexattr_init(&mutex_debug_attr);
- pthread_mutexattr_settype(&mutex_debug_attr, PTHREAD_MUTEXTYPE_DEBUG);
-
- if (pthread_mutex_init(&mutex_debug, &mutex_debug_attr)) {
- printf("pthread_mutex_init() ERROR\n");
- return(NOTOK);
- }
- if (test_nocontention_lock(&mutex_debug) ||
- test_contention_lock(&mutex_debug) ||
- test_debug_double_lock(&mutex_debug) ||
- test_debug_double_unlock(&mutex_debug)) {
- return(NOTOK);
- }
- if (pthread_mutex_destroy(&mutex_debug)) {
- printf("pthread_mutex_destroy() ERROR\n");
- return(NOTOK);
- }
- return(OK);
-}
-
-main()
-{
- pthread_init();
-
- printf("test_pthread_mutex START\n");
-
- if (test_mutex_static() || test_mutex_fast() || test_mutex_debug()) {
- printf("test_pthread_mutex FAILED\n");
- exit(1);
- }
-
- printf("test_pthread_mutex PASSED\n");
- exit(0);
-}
-
diff --git a/mit-pthreads/tests/test_pw.c b/mit-pthreads/tests/test_pw.c
deleted file mode 100644
index 0ef6d428180..00000000000
--- a/mit-pthreads/tests/test_pw.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <stdio.h>
-#include <sys/types.h>
-#include <pwd.h>
-
-main()
-{
- struct passwd *pw;
-
- pthread_init();
- pw = getpwuid(getuid());
- if (!pw) {
- printf("getpwuid(%d) died!\n", getuid());
- exit(1);
- }
- printf("getpwuid(%d) => %lx\n", getuid(), pw);
- printf(" you are: %s\n uid: %d\n gid: %d\n class: %s\n gecos: %s\n dir: %s\n shell: %s\n",
- pw->pw_name, pw->pw_uid, pw->pw_gid, pw->pw_class, pw->pw_gecos, pw->pw_dir,
- pw->pw_shell);
- exit(0);
-}
diff --git a/mit-pthreads/tests/test_readdir.c b/mit-pthreads/tests/test_readdir.c
deleted file mode 100644
index 6de1841bdbc..00000000000
--- a/mit-pthreads/tests/test_readdir.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ==== test_readdir.c ========================================================
- * Copyright (c) 1993, 1994 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Test pthread_create() and pthread_exit() calls.
- *
- * 1.00 94/05/19 proven
- * -Started coding this file.
- */
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <stdio.h>
-
-main()
-{
- struct dirent * file;
- DIR * dot_dir;
- int i, found = 0;
-
- pthread_init();
-
- if (dot_dir = opendir(".")) {
- while (file = readdir(dot_dir)) {
- if (!strcmp("test_readdir", file->d_name)) {
- found = 1;
- }
- }
- closedir(dot_dir);
- if (found) {
- printf("test_readdir PASSED\n");
- exit(0);
- } else {
- printf("Couldn't find file test_readdir ERROR\n");
- }
- } else {
- printf("opendir() ERROR\n");
- }
- printf("test_readdir FAILED\n");
- exit(1);
-}
-
diff --git a/mit-pthreads/tests/test_select.c b/mit-pthreads/tests/test_select.c
deleted file mode 100644
index 0401d77a666..00000000000
--- a/mit-pthreads/tests/test_select.c
+++ /dev/null
@@ -1,115 +0,0 @@
-#include <pthread.h>
-#include <stdio.h>
-#ifndef ultrix
-#include <sys/fcntl.h>
-#else /* ultrix */
-#include <fcntl.h>
-#endif /* !ultrix */
-#include <sys/types.h>
-#include <sys/time.h>
-#ifdef hpux
-#include <sys/file.h>
-#endif /* hpux */
-#include <errno.h>
-#define NLOOPS 1000
-
-int ntouts = 0;
-
-void *
-bg_routine(void *arg)
-{
- write(1,"bg routine running\n",19);
- /*pthread_dump_state();*/
- while (1) {
- int n;
- char dot;
-
- dot = '.';
- pthread_yield();
- write(1,&dot,1);
- pthread_yield();
- n = NLOOPS;
- while (n-- > 0)
- pthread_yield();
- }
-}
-
-void *
-fg_routine(void *arg)
-{
- int flags, stat, nonblock_flag;
- static struct timeval tout = { 0, 500000 };
-
-#if 0
-#if defined(hpux) || defined(__alpha)
- nonblock_flag = O_NONBLOCK;
-#else
- nonblock_flag = FNDELAY;
-#endif
- printf("fg_routine running\n");
- flags = fcntl(0, F_GETFL, 0);
- printf("stdin flags b4 anything = %x\n", flags);
- stat = fcntl(0, F_SETFL, flags | nonblock_flag);
- if (stat < 0) {
- printf("fcntl(%x) => %d\n", nonblock_flag, errno);
- printf("could not set nonblocking i/o on stdin [oldf %x, stat %d]\n",
- flags, stat);
- exit(1);
- }
- printf("stdin flags = 0x%x after turning on %x\n", flags, nonblock_flag);
-#endif
- while (1) {
- int n;
- fd_set r;
-
- FD_ZERO(&r);
- FD_SET(0,&r);
- printf("select>");
- n = select(1, &r, (fd_set*)0, (fd_set*)0, (struct timeval *)0);
- if (n < 0) {
- perror ("select");
- exit(1);
- } else if (n > 0) {
- int nb;
- char buf[128];
-
- printf("=> select returned: %d\n", n);
- while ((nb = read(0, buf, sizeof(buf)-1)) >= 0) {
- buf[nb] = '\0';
- printf("read %d: |%s|\n", nb, buf);
- }
- printf("=> out of read loop: %d / %d\n", nb, errno);
- if (nb < 0) {
- if (errno != EWOULDBLOCK && errno != EAGAIN) {
- perror ("read");
- exit(1);
- }
- }
- } else
- ntouts++;
- }
-}
-
-main(int argc, char **argv)
-{
- pthread_t bg_thread, fg_thread;
- int junk;
-
- pthread_init();
- setbuf(stdout,NULL);
- setbuf(stderr,NULL);
- if (argc > 1) {
- if (pthread_create(&bg_thread, NULL, bg_routine, 0) < 0) {
- printf("error: could not create bg thread\n");
- exit(1);
- }
- }
- if (pthread_create(&fg_thread, NULL, fg_routine, 0) < 0) {
- printf("error: could not create fg thread\n");
- exit(1);
- }
- printf("threads forked: bg=%lx fg=%lx\n", bg_thread, fg_thread);
- /*pthread_dump_state();*/
- printf("initial thread %lx joining fg...\n", pthread_self());
- pthread_join(fg_thread, (void **)&junk);
-}
diff --git a/mit-pthreads/tests/test_setjmp.c b/mit-pthreads/tests/test_setjmp.c
deleted file mode 100644
index ea24ecd63bc..00000000000
--- a/mit-pthreads/tests/test_setjmp.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <setjmp.h>
-
-main()
-{
-jmp_buf foo;
-
-if (setjmp(foo)) {
- exit(0);
-}
-printf("Hi mom\n");
-longjmp(foo, 1);
-printf("Should never reach here\n");
-}
diff --git a/mit-pthreads/tests/test_sleep.c b/mit-pthreads/tests/test_sleep.c
deleted file mode 100644
index f228d08a2ca..00000000000
--- a/mit-pthreads/tests/test_sleep.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ==== test_switch.c ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Test context switch functionality.
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#include <pthread.h>
-#include <stdio.h>
-
-const char buf[] = "abcdefghijklimnopqrstuvwxyz";
-int fd = 1;
-
-void* new_thread(void* arg)
-{
- int i;
-
- for (i = 0; i < 10; i++) {
- write(fd, buf + (long) arg, 1);
- sleep(1);
- }
-}
-
-main()
-{
- pthread_t thread;
- int count = 2;
- long i;
-
- pthread_init();
-
- printf("Going to sleep\n");
- sleep(10);
- printf("Done sleeping\n");
-
- for(i = 0; i < count; i++) {
- if (pthread_create(&thread, NULL, new_thread, (void *) i)) {
- printf("error creating new thread %d\n", i);
- }
- }
- pthread_exit(NULL);
- fprintf(stderr, "pthread_exit returned\n");
- exit(1);
-}
diff --git a/mit-pthreads/tests/test_sock_1.c b/mit-pthreads/tests/test_sock_1.c
deleted file mode 100644
index e23755a67dc..00000000000
--- a/mit-pthreads/tests/test_sock_1.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/* ==== test_sock_1.c =========================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Test pthread_create() and pthread_exit() calls.
- *
- * 1.00 93/08/03 proven
- * -Started coding this file.
- */
-
-#include <pthread.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-struct sockaddr_in a_sout;
-pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_attr_t attr;
-
-#define MESSAGE5 "This should be message #5"
-#define MESSAGE6 "This should be message #6"
-
-void * sock_connect(void* arg)
-{
- char buf[1024];
- int fd, tmp;
-
- /* Ensure sock_read runs first */
- if (pthread_mutex_lock(&mutex)) {
- printf("Error: sock_connect:pthread_mutex_lock()\n");
- exit(1);
- }
-
- a_sout.sin_addr.s_addr = htonl(0x7f000001); /* loopback */
-
- if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
- printf("Error: sock_connect:socket()\n");
- exit(1);
- }
-
- printf("This should be message #2\n");
- if (connect(fd, (struct sockaddr *) &a_sout, sizeof(a_sout)) < 0) {
- printf("Error: sock_connect:connect()\n");
- exit(1);
- }
- close(fd);
-
- if (pthread_mutex_unlock(&mutex)) {
- printf("Error: sock_connect:pthread_mutex_lock()\n");
- exit(1);
- }
-
- if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
- printf("Error: sock_connect:socket()\n");
- exit(1);
- }
-
- printf("This should be message #3\n");
-
- if (connect(fd, (struct sockaddr *) &a_sout, sizeof(a_sout)) < 0) {
- printf("Error: sock_connect:connect()\n");
- exit(1);
- }
-
- /* Ensure sock_read runs again */
- pthread_yield();
- pthread_yield();
- pthread_yield();
- pthread_yield();
- if (pthread_mutex_lock(&mutex)) {
- printf("Error: sock_connect:pthread_mutex_lock()\n");
- exit(1);
- }
-
- if ((tmp = read(fd, buf, 1024)) <= 0) {
- printf("Error: sock_connect:read() == %d\n", tmp);
- exit(1);
- }
- write(fd, MESSAGE6, sizeof(MESSAGE6));
- printf("%s\n", buf);
- close(fd);
-}
-
-extern struct fd_table_entry ** fd_table;
-void * sock_write(void* arg)
-{
- int fd = *(int *)arg;
-
- write(fd, MESSAGE5, sizeof(MESSAGE5));
- return(NULL);
-}
-
-void * sock_accept(void* arg)
-{
- pthread_t thread;
- struct sockaddr a_sin;
- int a_sin_size, a_fd, fd, tmp;
- short port;
- char buf[1024];
-
- if (pthread_mutex_unlock(&mutex)) {
- printf("Error: sock_accept:pthread_mutex_lock()\n");
- exit(1);
- }
-
- port = 3276;
- a_sout.sin_family = AF_INET;
- a_sout.sin_port = htons(port);
- a_sout.sin_addr.s_addr = INADDR_ANY;
-
- if ((a_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
- printf("Error: sock_accept:socket()\n");
- exit(1);
- }
-
- while (bind(a_fd, (struct sockaddr *) &a_sout, sizeof(a_sout)) < 0) {
- if (errno == EADDRINUSE) {
- a_sout.sin_port = htons((++port));
- continue;
- }
- printf("Error: sock_accept:bind()\n");
- exit(1);
- }
-
- if (listen(a_fd, 2)) {
- printf("Error: sock_accept:listen()\n");
- exit(1);
- }
-
- a_sin_size = sizeof(a_sin);
- printf("This should be message #1\n");
- if ((fd = accept(a_fd, &a_sin, &a_sin_size)) < 0) {
- printf("Error: sock_accept:accept()\n");
- exit(1);
- }
-
- if (pthread_mutex_lock(&mutex)) {
- printf("Error: sock_accept:pthread_mutex_lock()\n");
- exit(1);
- }
- close(fd);
-
- a_sin_size = sizeof(a_sin);
- printf("This should be message #4\n");
- if ((fd = accept(a_fd, &a_sin, &a_sin_size)) < 0) {
- printf("Error: sock_accept:accept()\n");
- exit(1);
- }
-
- if (pthread_mutex_unlock(&mutex)) {
- printf("Error: sock_accept:pthread_mutex_lock()\n");
- exit(1);
- }
-
- /* Setup a write thread */
- if (pthread_create(&thread, &attr, sock_write, &fd)) {
- printf("Error: sock_accept:pthread_create(sock_write)\n");
- exit(1);
- }
- if ((tmp = read(fd, buf, 1024)) <= 0) {
- printf("Error: sock_accept:read() == %d\n", tmp);
- exit(1);
- }
- printf("%s\n", buf);
- close(fd);
-}
-
-main()
-{
- pthread_t thread;
- int i;
-
- pthread_init();
- setbuf(stdout, NULL);
- setbuf(stderr, NULL);
-
- /* Ensure sock_read runs first */
- if (pthread_mutex_lock(&mutex)) {
- printf("Error: main:pthread_mutex_lock()\n");
- exit(1);
- }
-
- if (pthread_attr_init(&attr)) {
- printf("Error: main:pthread_attr_init()\n");
- exit(1);
- }
- if (pthread_attr_setschedpolicy(&attr, SCHED_FIFO)) {
- printf("Error: main:pthread_attr_setschedpolicy()\n");
- exit(1);
- }
- if (pthread_create(&thread, &attr, sock_accept, (void *)0xdeadbeaf)) {
- printf("Error: main:pthread_create(sock_accept)\n");
- exit(1);
- }
- if (pthread_create(&thread, &attr, sock_connect, (void *)0xdeadbeaf)) {
- printf("Error: main:pthread_create(sock_connect)\n");
- exit(1);
- }
- printf("initial thread %lx going to sleep\n", pthread_self());
- sleep(10);
- printf("done sleeping\n");
- return 0;
-}
diff --git a/mit-pthreads/tests/test_sock_2.c b/mit-pthreads/tests/test_sock_2.c
deleted file mode 100644
index 5ec82fd7499..00000000000
--- a/mit-pthreads/tests/test_sock_2.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/* ==== test_sock_1.c =========================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Test pthread_create() and pthread_exit() calls.
- *
- * 1.00 93/08/03 proven
- * -Started coding this file.
- */
-
-#include <pthread.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-struct sockaddr_in a_sout;
-
-#define MESSAGE5 "This should be message #5"
-#define MESSAGE6 "This should be message #6"
-
-void * sock_write(void* arg)
-{
- int fd = *(int *)arg;
-
- write(fd, MESSAGE5, sizeof(MESSAGE5));
- return(NULL);
-}
-
-void * sock_accept(void* arg)
-{
- pthread_t thread;
- struct sockaddr a_sin;
- int a_sin_size, a_fd, fd, tmp;
- short port;
- char buf[1024];
-
- port = 3276;
- a_sout.sin_family = AF_INET;
- a_sout.sin_port = htons(port);
- a_sout.sin_addr.s_addr = INADDR_ANY;
-
- if ((a_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
- printf("Error: sock_accept:socket()\n");
- exit(1);
- }
-
- while (bind(a_fd, (struct sockaddr *) &a_sout, sizeof(a_sout)) < 0) {
- if (errno == EADDRINUSE) {
- a_sout.sin_port = htons((++port));
- continue;
- }
- printf("Error: sock_accept:bind()\n");
- exit(1);
- }
-
- if (listen(a_fd, 2)) {
- printf("Error: sock_accept:listen()\n");
- exit(1);
- }
-
- a_sin_size = sizeof(a_sin);
- printf("This should be message #1\n");
- if ((fd = accept(a_fd, &a_sin, &a_sin_size)) < 0) {
- printf("Error: sock_accept:accept()\n");
- exit(1);
- }
- close(fd);
- sleep(1);
-
- a_sin_size = sizeof(a_sin);
- memset(&a_sin, 0, sizeof(a_sin));
- printf("This should be message #4\n");
- if ((fd = accept(a_fd, &a_sin, &a_sin_size)) < 0) {
- printf("Error: sock_accept:accept()\n");
- exit(1);
- }
-
- /* Setup a write thread */
- if (pthread_create(&thread, NULL, sock_write, &fd)) {
- printf("Error: sock_accept:pthread_create(sock_write)\n");
- exit(1);
- }
- if ((tmp = read(fd, buf, 1024)) <= 0) {
- tmp = read(fd, buf, 1024);
- printf("Error: sock_accept:read() == %d\n", tmp);
- exit(1);
- }
- printf("%s\n", buf);
- close(fd);
-}
-
-main()
-{
- pthread_t thread;
- int i;
-
- switch(fork()) {
- case -1:
- printf("Error: main:fork()\n");
- break;
- case 0:
- execl("test_sock_2a", "test_sock_2a", "fork okay", NULL);
- default:
- break;
- }
-
- setbuf(stdout, NULL);
- setbuf(stderr, NULL);
-
- if (pthread_create(&thread, NULL, sock_accept, (void *)0xdeadbeaf)) {
- printf("Error: main:pthread_create(sock_accept)\n");
- exit(1);
- }
- pthread_exit(NULL);
-}
diff --git a/mit-pthreads/tests/test_sock_2a.c b/mit-pthreads/tests/test_sock_2a.c
deleted file mode 100644
index 9f767b7c675..00000000000
--- a/mit-pthreads/tests/test_sock_2a.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* ==== test_sock_1.c =========================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Test pthread_create() and pthread_exit() calls.
- *
- * 1.00 93/08/03 proven
- * -Started coding this file.
- */
-
-#include <pthread.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-struct sockaddr_in a_sout;
-
-#define MESSAGE5 "This should be message #5"
-#define MESSAGE6 "This should be message #6"
-
-void * sock_connect(void* arg)
-{
- char buf[1024];
- int fd, tmp;
- short port;
-
- port = 3276;
- a_sout.sin_family = AF_INET;
- a_sout.sin_port = htons(port);
- a_sout.sin_addr.s_addr = htonl(0x7f000001); /* loopback */
-
- if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
- printf("Error: sock_connect:socket()\n");
- exit(1);
- }
-
- printf("This should be message #2\n");
- if (connect(fd, (struct sockaddr *) &a_sout, sizeof(a_sout)) < 0) {
- printf("Error: sock_connect:connect()\n");
- exit(1);
- }
- close(fd);
-
- if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
- printf("Error: sock_connect:socket()\n");
- exit(1);
- }
-
- printf("This should be message #3\n");
-
- if (connect(fd, (struct sockaddr *) &a_sout, sizeof(a_sout)) < 0) {
- printf("Error: sock_connect:connect()\n");
- exit(1);
- }
-
- /* Ensure sock_read runs again */
-
- if ((tmp = read(fd, buf, 1024)) <= 0) {
- printf("Error: sock_connect:read() == %d\n", tmp);
- exit(1);
- }
- write(fd, MESSAGE6, sizeof(MESSAGE6));
- printf("%s\n", buf);
- close(fd);
-}
-
-main(int argc, char **argv)
-{
- pthread_t thread;
- int i;
-
- if (argv[1] && (!strcmp(argv[1], "fork okay"))) {
- sleep(1);
- setbuf(stdout, NULL);
- setbuf(stderr, NULL);
-
- if (pthread_create(&thread, NULL, sock_connect, (void *)0xdeadbeaf)) {
- printf("Error: main:pthread_create(sock_connect)\n");
- exit(1);
- }
- pthread_exit(NULL);
- }
- printf("test_sock_2a needs to be execed from test_sock_2.\n");
- printf("It is not a stand alone test.\n");
- exit(1);
-}
diff --git a/mit-pthreads/tests/test_stdio_1.c b/mit-pthreads/tests/test_stdio_1.c
deleted file mode 100644
index 648343a2c9d..00000000000
--- a/mit-pthreads/tests/test_stdio_1.c
+++ /dev/null
@@ -1,124 +0,0 @@
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-char * base_name = "test_stdio_1.c";
-char * dir_name = SRCDIR;
-char * fullname;
-
-#define OK 0
-#define NOTOK -1
-
-/* Test fopen()/ftell()/getc() */
-int test_1(void)
-{
- struct stat statbuf;
- FILE * fp;
- int i;
-
- if (stat(fullname, &statbuf) < OK) {
- printf("ERROR: Couldn't stat %s\n", fullname);
- return(NOTOK);
- }
-
- if ((fp = fopen(fullname, "r")) == NULL) {
- printf("ERROR: Couldn't open %s\n", fullname);
- return(NOTOK);
- }
-
- /* Get the entire file */
- while ((i = getc(fp)) != EOF);
-
- if (ftell(fp) != statbuf.st_size) {
- printf("ERROR: ftell() and stat() don't agree.");
- return(NOTOK);
- }
-
- if (fclose(fp) < OK) {
- printf("ERROR: fclose() failed.");
- return(NOTOK);
- }
- return(OK);
-}
-
-/* Test fopen()/fclose() */
-int test_2(void)
-{
- FILE *fp1, *fp2;
-
- if ((fp1 = fopen(fullname, "r")) == NULL) {
- printf("ERROR: Couldn't fopen %s\n", fullname);
- return(NOTOK);
- }
-
- if (fclose(fp1) < OK) {
- printf("ERROR: fclose() failed.");
- return(NOTOK);
- }
-
- if ((fp2 = fopen(fullname, "r")) == NULL) {
- printf("ERROR: Couldn't fopen %s\n", fullname);
- return(NOTOK);
- }
-
- if (fclose(fp2) < OK) {
- printf("ERROR: fclose() failed.");
- return(NOTOK);
- }
-
- if (fp1 != fp2) {
- printf("ERROR: FILE table leak.\n");
- return(NOTOK);
- }
-
- return(OK);
-}
-
-/* Test sscanf()/sprintf() */
-int test_3(void)
-{
- char * str = "10 4.53";
- char buf[64];
- double d;
- int i;
-
- if (sscanf(str, "%d %lf", &i, &d) != 2) {
- printf("ERROR: sscanf didn't parse input string correctly\n");
- return(NOTOK);
- }
-
- /* Should have a check */
- sprintf(buf, "%d %2.2lf", i, d);
-
- if (strcmp(buf, str)) {
- printf("ERROR: sscanf()/sprintf() didn't parse unparse correctly\n");
- return(NOTOK);
- }
- return(OK);
-}
-
-main()
-{
-
- printf("test_stdio_1 START\n");
-
- if (fullname = malloc (strlen (dir_name) + strlen (base_name) + 2)) {
- sprintf (fullname, "%s/%s", dir_name, base_name);
- } else {
- perror ("malloc");
- exit(1);
- }
-
- if (test_1() || test_2() || test_3()) {
- printf("test_stdio_1 FAILED\n");
- exit(1);
- }
-
- printf("test_stdio_1 PASSED\n");
- exit(0);
-}
-
-
diff --git a/mit-pthreads/tests/test_switch.c b/mit-pthreads/tests/test_switch.c
deleted file mode 100644
index 4c184158fb8..00000000000
--- a/mit-pthreads/tests/test_switch.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ==== test_switch.c ============================================================
- * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
- *
- * Description : Test context switch functionality.
- *
- * 1.00 93/08/04 proven
- * -Started coding this file.
- */
-
-#include <pthread.h>
-#include <stdio.h>
-#include <errno.h>
-
-#define OK 0
-#define NOTOK -1
-
-const char buf[] = "abcdefghijklmnopqrstuvwxyz";
-char x[sizeof(buf)];
-int fd = 1;
-
-/* ==========================================================================
- * usage();
- */
-void usage(void)
-{
- printf("test_switch [-d?] [-c count]\n");
- printf("count must be between 2 and 26\n");
- errno = 0;
-}
-
-void* new_thread(void* arg)
-{
- while(1) {
- write (fd, (char *) arg, 1);
- x[(char *)arg - buf] = 1;
- }
- fprintf(stderr, "Compiler error\n");
- exit(1);
-}
-
-main(int argc, char **argv)
-{
- pthread_t thread;
- int count = 2;
- int debug = 0;
- int eof = 0;
- long i;
-
- /* Getopt variables. */
- extern int optind, opterr;
- extern char *optarg;
-
- while (!eof)
- switch (getopt (argc, argv, "c:d?"))
- {
- case EOF:
- eof = 1;
- break;
- case 'd':
- debug++;
- break;
- case 'c':
- count = atoi(optarg);
- if ((count > 26) || (count < 2)) {
- count = 2;
- }
- break;
- case '?':
- usage();
- return(OK);
- default:
- usage();
- return(NOTOK);
- }
-
- for (i = 0; i < count; i++) {
- if (pthread_create(&thread, NULL, new_thread, (void*)(buf+i))) {
- fprintf (stderr, "error creating new thread %d\n", i);
- exit (1);
- }
- }
-#if 0 /* This would cause the program to loop forever, and "make
- check" would never complete. */
- pthread_exit (NULL);
- fprintf(stderr, "pthread_exit returned\n");
- exit(1);
-#else
- sleep (10);
- for (i = 0; i < count; i++)
- if (x[i] == 0) {
- fprintf (stderr, "thread %d never ran\n", i);
- return 1;
- }
- printf ("\n%s PASSED\n", argv[0]);
- return 0;
-#endif
-}
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index 6829ac95f1e..1a70113f0ad 100644
--- a/myisam/ft_boolean_search.c
+++ b/myisam/ft_boolean_search.c
@@ -24,7 +24,8 @@
/* search with boolean queries */
-static double _wghts[11]={
+static double _wghts[11]=
+{
0.131687242798354,
0.197530864197531,
0.296296296296296,
@@ -38,7 +39,8 @@ static double _wghts[11]={
7.593750000000000};
static double *wghts=_wghts+5; /* wghts[i] = 1.5**i */
-static double _nwghts[11]={
+static double _nwghts[11]=
+{
-0.065843621399177,
-0.098765432098766,
-0.148148148148148,
@@ -57,7 +59,8 @@ static double *nwghts=_nwghts+5; /* nwghts[i] = -0.5*1.5**i */
#define FTB_FLAG_NO 4 /* should NEVER be set both */
typedef struct st_ftb_expr FTB_EXPR;
-struct st_ftb_expr {
+struct st_ftb_expr
+{
FTB_EXPR *up;
byte *quot, *qend;
float weight;
@@ -70,7 +73,8 @@ struct st_ftb_expr {
int yweaks; /* number of "yes" words for scan only */
};
-typedef struct st_ftb_word {
+typedef struct st_ftb_word
+{
FTB_EXPR *up;
float weight;
uint flags;
@@ -81,7 +85,8 @@ typedef struct st_ftb_word {
byte word[1];
} FTB_WORD;
-typedef struct st_ft_info {
+typedef struct st_ft_info
+{
struct _ft_vft *please;
MI_INFO *info;
uint keynr;
@@ -95,16 +100,22 @@ typedef struct st_ft_info {
MEM_ROOT mem_root;
} FTB;
-int FTB_WORD_cmp(void *v __attribute__((unused)), FTB_WORD *a, FTB_WORD *b)
+static int FTB_WORD_cmp(my_off_t *v, FTB_WORD *a, FTB_WORD *b)
{
+ int i;
+
+ /* if a==curdoc, take it as a < b */
+ if (v && a->docid[0] == *v)
+ return -1;
+
/* ORDER BY docid, ndepth DESC */
- int i=CMP_NUM(a->docid[0], b->docid[0]);
+ i=CMP_NUM(a->docid[0], b->docid[0]);
if (!i)
i=CMP_NUM(b->ndepth,a->ndepth);
return i;
}
-int FTB_WORD_cmp_list(CHARSET_INFO *cs, FTB_WORD **a, FTB_WORD **b)
+static int FTB_WORD_cmp_list(CHARSET_INFO *cs, FTB_WORD **a, FTB_WORD **b)
{
/* ORDER BY word DESC, ndepth DESC */
int i= mi_compare_text(cs, (*b)->word+1,(*b)->len-1,
@@ -114,7 +125,7 @@ int FTB_WORD_cmp_list(CHARSET_INFO *cs, FTB_WORD **a, FTB_WORD **b)
return i;
}
-void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
+static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
FTB_EXPR *up, uint depth)
{
byte res;
@@ -176,12 +187,13 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
return;
}
-static int _ftb_no_dupes_cmp(void* not_used, const void *a,const void *b)
+static int _ftb_no_dupes_cmp(void* not_used __attribute__((unused)),
+ const void *a,const void *b)
{
return CMP_NUM((*((my_off_t*)a)), (*((my_off_t*)b)));
}
-void _ftb_init_index_search(FT_INFO *ftb)
+static void _ftb_init_index_search(FT_INFO *ftb)
{
int i, r;
FTB_WORD *ftbw;
@@ -200,21 +212,23 @@ void _ftb_init_index_search(FT_INFO *ftb)
{
ftbw=(FTB_WORD *)(ftb->queue.root[i]);
- if (ftbw->flags&FTB_FLAG_TRUNC)
- /* special treatment for truncation operator :((
- 1. +trunc* and there're other (not +trunc*) words
+ if (ftbw->flags & FTB_FLAG_TRUNC)
+ {
+ /*
+ special treatment for truncation operator :((
+ 1. +trunc* and there're other (not +trunc*) words
| no need to search in the index, it can never ADD new rows
| to the result, and to remove half-matched rows we do scan anyway
- 2. -trunc*
+ 2. -trunc*
| same as 1.
- 3. trunc*
+ 3. trunc*
| We have to index-search for this prefix.
| It may cause duplicates, as in the index (sorted by <word,docid>)
| <aaaa,row1>
| <aabb,row2>
| <aacc,row1>
| Searching for "aa*" will find row1 twice...
- */
+ */
if ( test(ftbw->flags&FTB_FLAG_NO) || /* 2 */
(test(ftbw->flags&FTB_FLAG_YES) && /* 1 */
ftbw->up->ythresh - ftbw->up->yweaks >1)) /* 1 */
@@ -231,7 +245,7 @@ void _ftb_init_index_search(FT_INFO *ftb)
_ftb_no_dupes_cmp,0,0,0);
}
}
-
+ }
r=_mi_search(info, keyinfo, (uchar*) ftbw->word, ftbw->len,
SEARCH_FIND | SEARCH_BIGGER, keyroot);
if (!r)
@@ -246,8 +260,11 @@ void _ftb_init_index_search(FT_INFO *ftb)
if (r) /* not found */
{
if (ftbw->flags&FTB_FLAG_YES && ftbw->up->up==0)
- { /* this word MUST BE present in every document returned,
- so we can abort the search right now */
+ {
+ /*
+ This word MUST BE present in every document returned,
+ so we can abort the search right now
+ */
ftb->state=INDEX_DONE;
return;
}
@@ -261,8 +278,10 @@ void _ftb_init_index_search(FT_INFO *ftb)
queue_fix(& ftb->queue);
}
+
FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
- uint query_len, my_bool presort __attribute__((unused)))
+ uint query_len,
+ my_bool presort __attribute__((unused)))
{
FTB *ftb;
FTB_EXPR *ftbe;
@@ -282,13 +301,14 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
init_alloc_root(&ftb->mem_root, 1024, 1024);
- /* hack: instead of init_queue, we'll use reinit queue to be able
- * to alloc queue with alloc_root()
- */
+ /*
+ Hack: instead of init_queue, we'll use reinit queue to be able
+ to alloc queue with alloc_root()
+ */
res=ftb->queue.max_elements=1+query_len/(ft_min_word_len+1);
ftb->queue.root=(byte **)alloc_root(&ftb->mem_root, (res+1)*sizeof(void*));
reinit_queue(& ftb->queue, res, 0, 0,
- (int (*)(void*,byte*,byte*))FTB_WORD_cmp, ftb);
+ (int (*)(void*,byte*,byte*))FTB_WORD_cmp, 0);
ftbe=(FTB_EXPR *)alloc_root(&ftb->mem_root, sizeof(FTB_EXPR));
ftbe->weight=1;
ftbe->flags=FTB_FLAG_YES;
@@ -309,8 +329,9 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
return ftb;
}
+
/* returns 1 if str0 contain str1 */
-int _ftb_strstr(const byte *s0, const byte *e0,
+static int _ftb_strstr(const byte *s0, const byte *e0,
const byte *s1, const byte *e1,
CHARSET_INFO *cs)
{
@@ -333,7 +354,8 @@ int _ftb_strstr(const byte *s0, const byte *e0,
return 0;
}
-void _ftb_climb_the_tree(FTB *ftb, FTB_WORD *ftbw, FT_SEG_ITERATOR *ftsi_orig)
+
+static void _ftb_climb_the_tree(FTB *ftb, FTB_WORD *ftbw, FT_SEG_ITERATOR *ftsi_orig)
{
FT_SEG_ITERATOR ftsi;
FTB_EXPR *ftbe;
@@ -381,28 +403,31 @@ void _ftb_climb_the_tree(FTB *ftb, FTB_WORD *ftbw, FT_SEG_ITERATOR *ftsi_orig)
else
if (yn & FTB_FLAG_NO)
{
- /* NOTE: special sort function of queue assures that all
- * (yn & FTB_FLAG_NO) != 0
- * events for every particular subexpression will
- * "auto-magically" happen BEFORE all the
- * (yn & FTB_FLAG_YES) != 0 events. So no
- * already matched expression can become not-matched again.
+ /*
+ NOTE: special sort function of queue assures that all
+ (yn & FTB_FLAG_NO) != 0
+ events for every particular subexpression will
+ "auto-magically" happen BEFORE all the
+ (yn & FTB_FLAG_YES) != 0 events. So no
+ already matched expression can become not-matched again.
*/
++ftbe->nos;
break;
}
else
{
- if (ftbe->ythresh) weight/=3;
+ if (ftbe->ythresh)
+ weight/=3;
ftbe->cur_weight += weight;
if (ftbe->yesses < ythresh)
break;
yn= (ftbe->yesses++ == ythresh) ? ftbe->flags : 0 ;
- weight*=ftbe->weight;
+ weight*= ftbe->weight;
}
}
}
+
int ft_boolean_read_next(FT_INFO *ftb, char *record)
{
FTB_EXPR *ftbe;
@@ -426,8 +451,11 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
if (!ftb->queue.elements)
return my_errno=HA_ERR_END_OF_FILE;
+ /* Attention!!! Address of a local variable is used here! See err: label */
+ ftb->queue.first_cmp_arg=(void *)&curdoc;
+
while (ftb->state == INDEX_SEARCH &&
- (curdoc=((FTB_WORD *)queue_top(& ftb->queue))->docid[0]) !=
+ (curdoc=((FTB_WORD *)queue_top(& ftb->queue))->docid[0]) !=
HA_POS_ERROR)
{
while (curdoc == (ftbw=(FTB_WORD *)queue_top(& ftb->queue))->docid[0])
@@ -450,8 +478,11 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
{
ftbw->docid[0]=HA_POS_ERROR;
if (ftbw->flags&FTB_FLAG_YES && ftbw->up->up==0)
- { /* this word MUST BE present in every document returned,
- so we can stop the search right now */
+ {
+ /*
+ This word MUST BE present in every document returned,
+ so we can stop the search right now
+ */
ftb->state=INDEX_DONE;
}
}
@@ -483,15 +514,20 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
info->update|= HA_STATE_AKTIV; /* Record is read */
if (ftb->with_scan && ft_boolean_find_relevance(ftb,record,0)==0)
continue; /* no match */
- return 0;
+ my_errno=0;
+ goto err;
}
- return my_errno;
+ goto err;
}
}
ftb->state=INDEX_DONE;
- return my_errno=HA_ERR_END_OF_FILE;
+ my_errno=HA_ERR_END_OF_FILE;
+err:
+ ftb->queue.first_cmp_arg=(void *)0;
+ return my_errno;
}
+
float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
{
FT_WORD word;
@@ -558,6 +594,7 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
}
}
+
void ft_boolean_close_search(FT_INFO *ftb)
{
if (is_tree_inited(& ftb->no_dupes))
@@ -568,11 +605,13 @@ void ft_boolean_close_search(FT_INFO *ftb)
my_free((gptr)ftb,MYF(0));
}
+
float ft_boolean_get_relevance(FT_INFO *ftb)
{
return ftb->root->cur_weight;
}
+
void ft_boolean_reinit_search(FT_INFO *ftb)
{
_ftb_init_index_search(ftb);
diff --git a/myisam/ft_dump.c b/myisam/ft_dump.c
index 25de17d5db4..d430b611836 100644
--- a/myisam/ft_dump.c
+++ b/myisam/ft_dump.c
@@ -20,7 +20,7 @@
#include "ftdefs.h"
#include <my_getopt.h>
-static void get_options(int argc,char *argv[]);
+static void get_options(int *argc,char **argv[]);
static void usage();
static void complain(int val);
@@ -66,7 +66,7 @@ int main(int argc,char *argv[])
struct { MI_INFO *info; } aio0, *aio=&aio0; /* for GWS_IN_USE */
MY_INIT(argv[0]);
- get_options(argc,argv);
+ get_options(&argc, &argv);
if (count || dump)
verbose=0;
if (!count && !dump && !lstats && !query)
@@ -75,17 +75,18 @@ int main(int argc,char *argv[])
if (verbose)
setbuf(stdout,NULL);
- if (argc-optind < 2)
+ if (argc < 2)
usage();
- if (!(info=mi_open(argv[optind],2,HA_OPEN_ABORT_IF_LOCKED)))
+ if (!(info=mi_open(argv[0],2,HA_OPEN_ABORT_IF_LOCKED)))
goto err;
- inx=atoi(argv[optind+1]);
+ inx=atoi(argv[1]);
*buf2=0;
aio->info=info;
- if ((inx >= info->s->base.keys) || !(info->s->keyinfo[inx].flag & HA_FULLTEXT))
+ if ((inx >= info->s->base.keys) ||
+ !(info->s->keyinfo[inx].flag & HA_FULLTEXT))
{
printf("Key %d in table %s is not a FULLTEXT key\n", inx, info->filename);
goto err;
@@ -148,16 +149,16 @@ int main(int argc,char *argv[])
if (maxlen<keylen2)
{
maxlen=keylen2;
- strcpy(buf_maxlen, buf2);
+ strmov(buf_maxlen, buf2);
}
if (max_doc_cnt < doc_cnt)
{
max_doc_cnt=doc_cnt;
- strcpy(buf_min_gws, buf2);
+ strmov(buf_min_gws, buf2);
min_gws=gws;
}
}
- strcpy(buf2, buf);
+ strmov(buf2, buf);
keylen2=keylen;
doc_cnt=0;
}
@@ -240,11 +241,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
return 0;
}
-static void get_options(int argc, char *argv[])
+
+static void get_options(int *argc, char **argv[])
{
int ho_error;
- if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
+ if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
} /* get options */
diff --git a/myisam/ft_eval.c b/myisam/ft_eval.c
index e196121d7af..34248c69f20 100644
--- a/myisam/ft_eval.c
+++ b/myisam/ft_eval.c
@@ -79,7 +79,7 @@ int main(int argc, char *argv[])
my_errno=0;
i=0;
- while(create_record(record,df))
+ while (create_record(record,df))
{
error=mi_write(file,record);
if (error)
@@ -94,24 +94,28 @@ int main(int argc, char *argv[])
if (!(file=mi_open(filename,2,0))) goto err;
if (!silent)
printf("- Reading rows with key\n");
- for(i=1;create_record(record,qf);i++) {
+ for (i=1;create_record(record,qf);i++)
+ {
FT_DOCLIST *result;
double w;
int t, err;
result=ft_nlq_init_search(file,0,blob_record,(uint) strlen(blob_record),1);
- if(!result) {
+ if (!result)
+ {
printf("Query %d failed with errno %3d\n",i,my_errno);
goto err;
}
if (!silent)
printf("Query %d. Found: %d.\n",i,result->ndocs);
- for(j=0;(err=ft_nlq_read_next(result, read_record))==0;j++) {
+ for (j=0;(err=ft_nlq_read_next(result, read_record))==0;j++)
+ {
t=uint2korr(read_record);
w=ft_nlq_get_relevance(result);
printf("%d %.*s %f\n",i,t,read_record+2,w);
- }
- if(err != HA_ERR_END_OF_FILE) {
+ }
+ if (err != HA_ERR_END_OF_FILE)
+ {
printf("ft_read_next %d failed with errno %3d\n",j,my_errno);
goto err;
}
@@ -134,24 +138,28 @@ static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
- switch(optid) {
+ switch (optid) {
case 's':
- if(stopwordlist && stopwordlist!=ft_precompiled_stopwords) break;
+ if (stopwordlist && stopwordlist != ft_precompiled_stopwords)
+ break;
{
FILE *f; char s[HA_FT_MAXLEN]; int i=0,n=SWL_INIT;
- if(!(stopwordlist=(const char**) malloc(n*sizeof(char *))))
+ if (!(stopwordlist=(const char**) malloc(n*sizeof(char *))))
print_error(1,"malloc(%d)",n*sizeof(char *));
- if(!(f=fopen(argument,"r")))
+ if (!(f=fopen(argument,"r")))
print_error(1,"fopen(%s)",argument);
- while(!feof(f)) {
- if(!(fgets(s,HA_FT_MAXLEN,f)))
+ while (!feof(f))
+ {
+ if (!(fgets(s,HA_FT_MAXLEN,f)))
print_error(1,"fgets(s,%d,%s)",HA_FT_MAXLEN,argument);
- if(!(stopwordlist[i++]=strdup(s)))
+ if (!(stopwordlist[i++]=strdup(s)))
print_error(1,"strdup(%s)",s);
- if(i>=n) {
+ if (i >= n)
+ {
n+=SWL_PLUS;
- if(!(stopwordlist=(const char**) realloc((char*) stopwordlist,n*sizeof(char *))))
+ if (!(stopwordlist=(const char**) realloc((char*) stopwordlist,
+ n*sizeof(char *))))
print_error(1,"realloc(%d)",n*sizeof(char *));
}
}
@@ -160,7 +168,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
}
case 'q': silent=1; break;
- case 'S': if(stopwordlist==ft_precompiled_stopwords) stopwordlist=NULL; break;
+ case 'S': if (stopwordlist==ft_precompiled_stopwords) stopwordlist=NULL; break;
case '#':
DEBUGGER_ON;
DBUG_PUSH (argument);
@@ -174,6 +182,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
return 0;
}
+
static void get_options(int argc, char *argv[])
{
int ho_error;
@@ -181,24 +190,29 @@ static void get_options(int argc, char *argv[])
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(ho_error);
- if(!(d_file=argv[optind])) print_error(1,"No d_file");
- if(!(df=fopen(d_file,"r")))
+ if (!(d_file=argv[optind])) print_error(1,"No d_file");
+ if (!(df=fopen(d_file,"r")))
print_error(1,"fopen(%s)",d_file);
- if(!(q_file=argv[optind+1])) print_error(1,"No q_file");
- if(!(qf=fopen(q_file,"r")))
+ if (!(q_file=argv[optind+1])) print_error(1,"No q_file");
+ if (!(qf=fopen(q_file,"r")))
print_error(1,"fopen(%s)",q_file);
return;
} /* get options */
+
static int create_record(char *pos, FILE *file)
-{ uint tmp; char *ptr;
+{
+ uint tmp; char *ptr;
bzero((char *)pos,MAX_REC_LENGTH);
/* column 1 - VARCHAR */
- if(!(fgets(pos+2,MAX_REC_LENGTH-32,file)))
+ if (!(fgets(pos+2,MAX_REC_LENGTH-32,file)))
{
- if(feof(file)) return 0; else print_error(1,"fgets(docid) - 1");
+ if (feof(file))
+ return 0;
+ else
+ print_error(1,"fgets(docid) - 1");
}
tmp=(uint) strlen(pos+2)-1;
int2store(pos,tmp);
@@ -206,7 +220,7 @@ static int create_record(char *pos, FILE *file)
/* column 2 - BLOB */
- if(!(fgets(blob_record,MAX_BLOB_LENGTH,file)))
+ if (!(fgets(blob_record,MAX_BLOB_LENGTH,file)))
print_error(1,"fgets(docid) - 2");
tmp=(uint) strlen(blob_record);
int4store(pos,tmp);
diff --git a/myisam/ft_nlq_search.c b/myisam/ft_nlq_search.c
index d9730110677..f3fa8865bc6 100644
--- a/myisam/ft_nlq_search.c
+++ b/myisam/ft_nlq_search.c
@@ -21,12 +21,14 @@
/* search with natural language queries */
-typedef struct ft_doc_rec {
+typedef struct ft_doc_rec
+{
my_off_t dpos;
double weight;
} FT_DOC;
-struct st_ft_info {
+struct st_ft_info
+{
struct _ft_vft *please;
MI_INFO *info;
int ndocs;
@@ -34,7 +36,8 @@ struct st_ft_info {
FT_DOC doc[1];
};
-typedef struct st_all_in_one {
+typedef struct st_all_in_one
+{
MI_INFO *info;
uint keynr;
CHARSET_INFO *charset;
@@ -44,7 +47,8 @@ typedef struct st_all_in_one {
TREE dtree;
} ALL_IN_ONE;
-typedef struct st_ft_superdoc {
+typedef struct st_ft_superdoc
+{
FT_DOC doc;
FT_WORD *word_ptr;
double tmp_weight;
@@ -92,7 +96,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
r=_mi_search(aio->info, aio->keyinfo, aio->keybuff, keylen,
SEARCH_FIND | SEARCH_PREFIX, aio->key_root);
- while(!r)
+ while (!r)
{
if (mi_compare_text(aio->charset,
aio->info->lastkey,keylen,
@@ -117,11 +121,12 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
sdoc.doc.dpos=aio->info->lastpos;
/* saving document matched into dtree */
- if(!(selem=tree_insert(&aio->dtree, &sdoc, 0, aio->dtree.custom_arg))) return 1;
+ if (!(selem=tree_insert(&aio->dtree, &sdoc, 0, aio->dtree.custom_arg)))
+ return 1;
sptr=(FT_SUPERDOC *)ELEMENT_KEY((&aio->dtree), selem);
- if(selem->count==1) /* document's first match */
+ if (selem->count==1) /* document's first match */
sptr->doc.weight=0;
else
sptr->doc.weight+=sptr->tmp_weight*sptr->word_ptr->weight;
@@ -145,31 +150,35 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
aio->info->lastkey_length, SEARCH_BIGGER,
aio->key_root);
}
- if(doc_cnt) {
+ if (doc_cnt)
+ {
word->weight*=GWS_IN_USE;
- if(word->weight < 0) word->weight=0;
+ if (word->weight < 0)
+ word->weight=0;
}
-
return 0;
}
+
static int walk_and_copy(FT_SUPERDOC *from,
uint32 count __attribute__((unused)), FT_DOC **to)
{
- from->doc.weight+=from->tmp_weight*from->word_ptr->weight;
- (*to)->dpos=from->doc.dpos;
- (*to)->weight=from->doc.weight;
- (*to)++;
- return 0;
+ from->doc.weight+=from->tmp_weight*from->word_ptr->weight;
+ (*to)->dpos=from->doc.dpos;
+ (*to)->weight=from->doc.weight;
+ (*to)++;
+ return 0;
}
+
static int FT_DOC_cmp(FT_DOC *a, FT_DOC *b)
{
- return sgn(b->weight - a->weight);
+ return sgn(b->weight - a->weight);
}
+
FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, byte *query,
- uint query_len, my_bool presort)
+ uint query_len, my_bool presort)
{
TREE allocated_wtree, *wtree=&allocated_wtree;
ALL_IN_ONE aio;
@@ -197,15 +206,16 @@ FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, byte *query,
NULL, NULL);
ft_parse_init(&allocated_wtree, aio.charset);
- if(ft_parse(&allocated_wtree,query,query_len))
+ if (ft_parse(&allocated_wtree,query,query_len))
goto err;
- if(tree_walk(wtree, (tree_walk_action)&walk_and_match, &aio,
- left_root_right))
+ if (tree_walk(wtree, (tree_walk_action)&walk_and_match, &aio,
+ left_root_right))
goto err2;
dlist=(FT_INFO *)my_malloc(sizeof(FT_INFO)+
- sizeof(FT_DOC)*(aio.dtree.elements_in_tree-1),MYF(0));
+ sizeof(FT_DOC)*(aio.dtree.elements_in_tree-1),
+ MYF(0));
if(!dlist)
goto err2;
@@ -215,10 +225,10 @@ FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, byte *query,
dlist->info=aio.info;
dptr=dlist->doc;
- tree_walk(&aio.dtree, (tree_walk_action)&walk_and_copy,
- &dptr, left_root_right);
+ tree_walk(&aio.dtree, (tree_walk_action) &walk_and_copy,
+ &dptr, left_root_right);
- if(presort)
+ if (presort)
qsort(dlist->doc, dlist->ndocs, sizeof(FT_DOC), (qsort_cmp)&FT_DOC_cmp);
err2:
@@ -230,6 +240,7 @@ err:
return dlist;
}
+
int ft_nlq_read_next(FT_INFO *handler, char *record)
{
MI_INFO *info= (MI_INFO *) handler->info;
@@ -251,6 +262,7 @@ int ft_nlq_read_next(FT_INFO *handler, char *record)
return my_errno;
}
+
float ft_nlq_find_relevance(FT_INFO *handler,
byte *record __attribute__((unused)),
uint length __attribute__((unused)))
@@ -277,16 +289,19 @@ float ft_nlq_find_relevance(FT_INFO *handler,
return 0.0;
}
+
void ft_nlq_close_search(FT_INFO *handler)
{
my_free((gptr)handler,MYF(0));
}
+
float ft_nlq_get_relevance(FT_INFO *handler)
{
return (float) handler->doc[handler->curdoc].weight;
}
+
void ft_nlq_reinit_search(FT_INFO *handler)
{
handler->curdoc=-1;
diff --git a/myisam/ft_parser.c b/myisam/ft_parser.c
index 15a17ed6f3b..583518089ba 100644
--- a/myisam/ft_parser.c
+++ b/myisam/ft_parser.c
@@ -125,7 +125,7 @@ byte ft_get_word(byte **start, byte *end, FT_WORD *word, FTB_PARAM *param)
byte *doc=*start;
int mwc;
- param->yesno=(FTB_YES==' ')?1:0;
+ param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0);
param->plusminus=param->pmsign=0;
while (doc<end)
@@ -160,7 +160,7 @@ byte ft_get_word(byte **start, byte *end, FT_WORD *word, FTB_PARAM *param)
if (*doc == FTB_NEG ) { param->pmsign=!param->pmsign; continue; }
}
param->prev=*doc;
- param->yesno=(param->quot != 0);
+ param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0);
param->plusminus=param->pmsign=0;
}
diff --git a/myisam/ft_static.c b/myisam/ft_static.c
index 640b754afa9..0b22d296206 100644
--- a/myisam/ft_static.c
+++ b/myisam/ft_static.c
@@ -76,7 +76,6 @@ const char *ft_precompiled_stopwords[] = {
it was slightly modified to my taste, though
*/
- "a",
"a's",
"able",
"about",
@@ -130,7 +129,6 @@ const char *ft_precompiled_stopwords[] = {
"available",
"away",
"awfully",
- "b",
"be",
"became",
"because",
@@ -154,7 +152,6 @@ const char *ft_precompiled_stopwords[] = {
"brief",
"but",
"by",
- "c",
"c'mon",
"c's",
"came",
@@ -184,7 +181,6 @@ const char *ft_precompiled_stopwords[] = {
"couldn't",
"course",
"currently",
- "d",
"definitely",
"described",
"despite",
@@ -200,7 +196,6 @@ const char *ft_precompiled_stopwords[] = {
"down",
"downwards",
"during",
- "e",
"each",
"edu",
"eg",
@@ -224,7 +219,6 @@ const char *ft_precompiled_stopwords[] = {
"exactly",
"example",
"except",
- "f",
"far",
"few",
"fifth",
@@ -241,7 +235,6 @@ const char *ft_precompiled_stopwords[] = {
"from",
"further",
"furthermore",
- "g",
"get",
"gets",
"getting",
@@ -254,7 +247,6 @@ const char *ft_precompiled_stopwords[] = {
"got",
"gotten",
"greetings",
- "h",
"had",
"hadn't",
"happens",
@@ -287,7 +279,6 @@ const char *ft_precompiled_stopwords[] = {
"how",
"howbeit",
"however",
- "i",
"i'd",
"i'll",
"i'm",
@@ -316,16 +307,13 @@ const char *ft_precompiled_stopwords[] = {
"it's",
"its",
"itself",
- "j",
"just",
- "k",
"keep",
"keeps",
"kept",
"know",
"knows",
"known",
- "l",
"last",
"lately",
"later",
@@ -344,7 +332,6 @@ const char *ft_precompiled_stopwords[] = {
"looking",
"looks",
"ltd",
- "m",
"mainly",
"many",
"may",
@@ -362,7 +349,6 @@ const char *ft_precompiled_stopwords[] = {
"must",
"my",
"myself",
- "n",
"name",
"namely",
"nd",
@@ -389,7 +375,6 @@ const char *ft_precompiled_stopwords[] = {
"novel",
"now",
"nowhere",
- "o",
"obviously",
"of",
"off",
@@ -417,7 +402,6 @@ const char *ft_precompiled_stopwords[] = {
"over",
"overall",
"own",
- "p",
"particular",
"particularly",
"per",
@@ -429,11 +413,9 @@ const char *ft_precompiled_stopwords[] = {
"presumably",
"probably",
"provides",
- "q",
"que",
"quite",
"qv",
- "r",
"rather",
"rd",
"re",
@@ -445,7 +427,6 @@ const char *ft_precompiled_stopwords[] = {
"relatively",
"respectively",
"right",
- "s",
"said",
"same",
"saw",
@@ -495,7 +476,6 @@ const char *ft_precompiled_stopwords[] = {
"such",
"sup",
"sure",
- "t",
"t's",
"take",
"taken",
@@ -555,7 +535,6 @@ const char *ft_precompiled_stopwords[] = {
"trying",
"twice",
"two",
- "u",
"un",
"under",
"unfortunately",
@@ -572,14 +551,12 @@ const char *ft_precompiled_stopwords[] = {
"uses",
"using",
"usually",
- "v",
"value",
"various",
"very",
"via",
"viz",
"vs",
- "w",
"want",
"wants",
"was",
@@ -631,8 +608,6 @@ const char *ft_precompiled_stopwords[] = {
"would",
"would",
"wouldn't",
- "x",
- "y",
"yes",
"yet",
"you",
@@ -644,7 +619,6 @@ const char *ft_precompiled_stopwords[] = {
"yours",
"yourself",
"yourselves",
- "z",
"zero",
#endif
diff --git a/myisam/ft_test1.c b/myisam/ft_test1.c
index 6b2493918ff..f4884f8ca39 100644
--- a/myisam/ft_test1.c
+++ b/myisam/ft_test1.c
@@ -205,7 +205,7 @@ void create_record(char *pos, int n)
{
uint tmp;
char *ptr;
- strncpy(blob_key,data[n].f0,keyinfo[0].seg[0].length);
+ strnmov(blob_key,data[n].f0,keyinfo[0].seg[0].length);
tmp=strlen(blob_key);
int4store(pos,tmp);
ptr=blob_key;
@@ -215,21 +215,21 @@ void create_record(char *pos, int n)
else if (recinfo[0].type == FIELD_VARCHAR)
{
uint tmp;
- strncpy(pos+2,data[n].f0,keyinfo[0].seg[0].length);
+ strnmov(pos+2,data[n].f0,keyinfo[0].seg[0].length);
tmp=strlen(pos+2);
int2store(pos,tmp);
pos+=recinfo[0].length;
}
else
{
- strncpy(pos,data[n].f0,keyinfo[0].seg[0].length);
+ strnmov(pos,data[n].f0,keyinfo[0].seg[0].length);
pos+=recinfo[0].length;
}
if (recinfo[1].type == FIELD_BLOB)
{
uint tmp;
char *ptr;
- strncpy(blob_key,data[n].f2,keyinfo[0].seg[0].length);
+ strnmov(blob_key,data[n].f2,keyinfo[0].seg[0].length);
tmp=strlen(blob_key);
int4store(pos,tmp);
ptr=blob_key;
@@ -239,14 +239,14 @@ void create_record(char *pos, int n)
else if (recinfo[1].type == FIELD_VARCHAR)
{
uint tmp;
- strncpy(pos+2,data[n].f2,keyinfo[0].seg[0].length);
+ strnmov(pos+2,data[n].f2,keyinfo[0].seg[0].length);
tmp=strlen(pos+2);
int2store(pos,tmp);
pos+=recinfo[1].length;
}
else
{
- strncpy(pos,data[n].f2,keyinfo[0].seg[0].length);
+ strnmov(pos,data[n].f2,keyinfo[0].seg[0].length);
pos+=recinfo[1].length;
}
}
diff --git a/myisam/ft_update.c b/myisam/ft_update.c
index 3c9b31207c0..41876028104 100644
--- a/myisam/ft_update.c
+++ b/myisam/ft_update.c
@@ -29,7 +29,7 @@
/**************************************************************/
void _mi_ft_segiterator_init(MI_INFO *info, uint keynr, const byte *record,
- FT_SEG_ITERATOR *ftsi)
+ FT_SEG_ITERATOR *ftsi)
{
ftsi->num=info->s->keyinfo[keynr].keysegs-FT_SEGS;
ftsi->seg=info->s->keyinfo[keynr].seg;
@@ -37,7 +37,7 @@ void _mi_ft_segiterator_init(MI_INFO *info, uint keynr, const byte *record,
}
void _mi_ft_segiterator_dummy_init(const byte *record, uint len,
- FT_SEG_ITERATOR *ftsi)
+ FT_SEG_ITERATOR *ftsi)
{
ftsi->num=1;
ftsi->seg=0;
@@ -45,12 +45,13 @@ void _mi_ft_segiterator_dummy_init(const byte *record, uint len,
ftsi->len=len;
}
-/* This function breaks convention "return 0 in success"
- but it's easier to use like this
+/*
+ This function breaks convention "return 0 in success"
+ but it's easier to use like this
- while(_mi_ft_segiterator())
+ while(_mi_ft_segiterator())
- so "1" means "OK", "0" means "EOF"
+ so "1" means "OK", "0" means "EOF"
*/
uint _mi_ft_segiterator(register FT_SEG_ITERATOR *ftsi)
@@ -68,7 +69,7 @@ uint _mi_ft_segiterator(register FT_SEG_ITERATOR *ftsi)
if (ftsi->seg->flag & HA_VAR_LENGTH)
{
ftsi->len=uint2korr(ftsi->pos);
- ftsi->pos+=2; /* Skip VARCHAR length */
+ ftsi->pos+=2; /* Skip VARCHAR length */
set_if_smaller(ftsi->len,ftsi->seg->length);
return 1;
}
@@ -84,7 +85,9 @@ uint _mi_ft_segiterator(register FT_SEG_ITERATOR *ftsi)
return 1;
}
+
/* parses a document i.e. calls ft_parse for every keyseg */
+
uint _mi_ft_parse(TREE *parsed, MI_INFO *info, uint keynr, const byte *record)
{
FT_SEG_ITERATOR ftsi;
@@ -92,10 +95,11 @@ uint _mi_ft_parse(TREE *parsed, MI_INFO *info, uint keynr, const byte *record)
ft_parse_init(parsed, info->s->keyinfo[keynr].seg->charset);
while (_mi_ft_segiterator(&ftsi))
+ {
if (ftsi.pos)
if (ft_parse(parsed, (byte *)ftsi.pos, ftsi.len))
return 1;
-
+ }
return 0;
}
@@ -117,32 +121,33 @@ static int _mi_ft_store(MI_INFO *info, uint keynr, byte *keybuf,
{
uint key_length;
- while(wlist->pos)
+ for (; wlist->pos; wlist++)
{
key_length=_ft_make_key(info,keynr,keybuf,wlist,filepos);
if (_mi_ck_write(info,keynr,(uchar*) keybuf,key_length))
return 1;
- wlist++;
}
return 0;
}
-static int _mi_ft_erase(MI_INFO *info, uint keynr, byte *keybuf, FT_WORD *wlist, my_off_t filepos)
+static int _mi_ft_erase(MI_INFO *info, uint keynr, byte *keybuf,
+ FT_WORD *wlist, my_off_t filepos)
{
uint key_length, err=0;
- while(wlist->pos)
+ for (; wlist->pos; wlist++)
{
key_length=_ft_make_key(info,keynr,keybuf,wlist,filepos);
if (_mi_ck_delete(info,keynr,(uchar*) keybuf,key_length))
err=1;
- wlist++;
}
return err;
}
-/* compares an appropriate parts of two WORD_KEY keys directly out of records */
-/* returns 1 if they are different */
+/*
+ Compares an appropriate parts of two WORD_KEY keys directly out of records
+ returns 1 if they are different
+*/
#define THOSE_TWO_DAMN_KEYS_ARE_REALLY_DIFFERENT 1
#define GEE_THEY_ARE_ABSOLUTELY_IDENTICAL 0
@@ -154,7 +159,7 @@ int _mi_ft_cmp(MI_INFO *info, uint keynr, const byte *rec1, const byte *rec2)
_mi_ft_segiterator_init(info, keynr, rec1, &ftsi1);
_mi_ft_segiterator_init(info, keynr, rec2, &ftsi2);
- while(_mi_ft_segiterator(&ftsi1) && _mi_ft_segiterator(&ftsi2))
+ while (_mi_ft_segiterator(&ftsi1) && _mi_ft_segiterator(&ftsi2))
{
if ((ftsi1.pos != ftsi2.pos) &&
(!ftsi1.pos || !ftsi2.pos ||
@@ -165,7 +170,9 @@ int _mi_ft_cmp(MI_INFO *info, uint keynr, const byte *rec1, const byte *rec2)
return GEE_THEY_ARE_ABSOLUTELY_IDENTICAL;
}
+
/* update a document entry */
+
int _mi_ft_update(MI_INFO *info, uint keynr, byte *keybuf,
const byte *oldrec, const byte *newrec, my_off_t pos)
{
@@ -215,7 +222,9 @@ err0:
return error;
}
+
/* adds a document to the collection */
+
int _mi_ft_add(MI_INFO *info, uint keynr, byte *keybuf, const byte *record,
my_off_t pos)
{
@@ -230,7 +239,9 @@ int _mi_ft_add(MI_INFO *info, uint keynr, byte *keybuf, const byte *record,
return error;
}
+
/* removes a document from the collection */
+
int _mi_ft_del(MI_INFO *info, uint keynr, byte *keybuf, const byte *record,
my_off_t pos)
{
diff --git a/myisam/mi_cache.c b/myisam/mi_cache.c
index 55f85fb99d1..462e48b3532 100644
--- a/myisam/mi_cache.c
+++ b/myisam/mi_cache.c
@@ -14,14 +14,26 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* Functions for read record cacheing with myisam */
-/* Used instead of my_b_read() to allow for no-cacheed seeks */
+/*
+ Functions for read record cacheing with myisam
+ Used for reading dynamic/compressed records from datafile.
-#include "myisamdef.h"
+ Can fetch data directly from file (outside cache),
+ if reading a small chunk straight before the cached part (with possible
+ overlap).
+
+ Can be explicitly asked not to use cache (by not setting READING_NEXT in
+ flag) - useful for occasional out-of-cache reads, when the next read is
+ expected to hit the cache again.
+
+ Allows "partial read" errors in the record header (when READING_HEADER flag
+ is set) - unread part is bzero'ed
+
+ Note: out-of-cache reads are disabled for shared IO_CACHE's
+*/
- /* Copy block from cache if it`s in it. If re_read_if_possibly is */
- /* set read to cache (if after current file-position) else read to */
- /* buff */
+
+#include "myisamdef.h"
int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
int flag)
@@ -31,7 +43,7 @@ int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
char *in_buff_pos;
DBUG_ENTER("_mi_read_cache");
- if (pos < info->pos_in_file)
+ if (pos < info->pos_in_file && ! info->share)
{
read_length=length;
if ((my_off_t) read_length > (my_off_t) (info->pos_in_file-pos))
@@ -44,7 +56,8 @@ int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
pos+=read_length;
buff+=read_length;
}
- if ((offset= (my_off_t) (pos - info->pos_in_file)) <
+ if (pos >= info->pos_in_file &&
+ (offset= (my_off_t) (pos - info->pos_in_file)) <
(my_off_t) (info->read_end - info->request_pos))
{
in_buff_pos=info->request_pos+(uint) offset;
@@ -57,10 +70,10 @@ int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
}
else
in_buff_length=0;
- if (flag & READING_NEXT)
+ if (flag & READING_NEXT || info->share)
{
- if (pos != ((info)->pos_in_file +
- (uint) ((info)->read_end - (info)->request_pos)))
+ if (pos != (info->pos_in_file +
+ (uint) (info->read_end - info->request_pos)))
{
info->pos_in_file=pos; /* Force start here */
info->read_pos=info->read_end=info->request_pos; /* Everything used */
@@ -70,34 +83,25 @@ int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
info->read_pos=info->read_end; /* All block used */
if (!(*info->read_function)(info,buff,length))
DBUG_RETURN(0);
- if (!(flag & READING_HEADER) || info->error == -1 ||
- (uint) info->error+in_buff_length < 3)
- {
- DBUG_PRINT("error",
- ("Error %d reading next-multi-part block (Got %d bytes)",
- my_errno, info->error));
- if (!my_errno || my_errno == -1)
- my_errno=HA_ERR_WRONG_IN_RECORD;
- DBUG_RETURN(1);
- }
- bzero(buff+info->error,MI_BLOCK_INFO_HEADER_LENGTH - in_buff_length -
- (uint) info->error);
- DBUG_RETURN(0);
+ read_length=info->error;
+ }
+ else
+ {
+ info->seek_not_done=1;
+ if ((read_length=my_pread(info->file,buff,length,pos,MYF(0))) == length)
+ DBUG_RETURN(0);
}
- info->seek_not_done=1;
- if ((read_length=my_pread(info->file,buff,length,pos,MYF(0))) == length)
- DBUG_RETURN(0);
if (!(flag & READING_HEADER) || (int) read_length == -1 ||
read_length+in_buff_length < 3)
{
DBUG_PRINT("error",
- ("Error %d reading new block (Got %d bytes)",
- my_errno, (int) read_length));
+ ("Error %d reading next-multi-part block (Got %d bytes)",
+ my_errno, (int) read_length));
if (!my_errno || my_errno == -1)
my_errno=HA_ERR_WRONG_IN_RECORD;
DBUG_RETURN(1);
}
bzero(buff+read_length,MI_BLOCK_INFO_HEADER_LENGTH - in_buff_length -
- read_length);
+ read_length);
DBUG_RETURN(0);
} /* _mi_read_cache */
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index 212659f5828..49f6f31f96e 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* Descript, check and repair of MyISAM tables */
+/* Describe, check and repair of MyISAM tables */
#include "ftdefs.h"
#include <m_ctype.h>
@@ -45,26 +45,22 @@ static int writekeys(MI_CHECK *param, MI_INFO *info,byte *buff,
my_off_t filepos);
static int sort_one_index(MI_CHECK *param, MI_INFO *info,MI_KEYDEF *keyinfo,
my_off_t pagepos, File new_file);
-static int sort_key_read(SORT_INFO *sort_info,void *key);
-static int sort_ft_key_read(SORT_INFO *sort_info,void *key);
-static int sort_get_next_record(SORT_INFO *sort_info);
-static int sort_key_cmp(SORT_INFO *sort_info, const void *a,const void *b);
-static int sort_key_write(SORT_INFO *sort_info, const void *a);
+static int sort_key_read(MI_SORT_PARAM *sort_param,void *key);
+static int sort_ft_key_read(MI_SORT_PARAM *sort_param,void *key);
+static int sort_get_next_record(MI_SORT_PARAM *sort_param);
+static int sort_key_cmp(MI_SORT_PARAM *sort_param, const void *a,const void *b);
+static int sort_key_write(MI_SORT_PARAM *sort_param, const void *a);
static my_off_t get_record_for_key(MI_INFO *info,MI_KEYDEF *keyinfo,
uchar *key);
-static int sort_insert_key(MI_CHECK *param, reg1 SORT_KEY_BLOCKS *key_block,
+static int sort_insert_key(MI_SORT_PARAM *sort_param,
+ reg1 SORT_KEY_BLOCKS *key_block,
uchar *key, my_off_t prev_block);
-static int sort_delete_record(MI_CHECK *param);
+static int sort_delete_record(MI_SORT_PARAM *sort_param);
/*static int flush_pending_blocks(MI_CHECK *param);*/
static SORT_KEY_BLOCKS *alloc_key_blocks(MI_CHECK *param, uint blocks,
uint buffer_length);
-static void update_key_parts(MI_KEYDEF *keyinfo,
- ulong *rec_per_key_part,
- ulonglong *unique,
- ulonglong records);
static ha_checksum mi_byte_checksum(const byte *buf, uint length);
-static void set_data_file_type(MI_CHECK *param, SORT_INFO *info,
- MYISAM_SHARE *share);
+static void set_data_file_type(SORT_INFO *sort_info, MYISAM_SHARE *share);
#ifdef __WIN__
static double ulonglong2double(ulonglong value)
@@ -80,7 +76,7 @@ static double ulonglong2double(ulonglong value)
#else
#define my_off_t2double(A) ((double) (A))
#endif /* SIZEOF_OFF_T > 4 */
-#endif
+#endif /* __WIN__ */
void myisamchk_init(MI_CHECK *param)
{
@@ -96,7 +92,6 @@ void myisamchk_init(MI_CHECK *param)
param->sort_key_blocks=BUFFERS_WHEN_SORTING;
param->tmpfile_createflag=O_RDWR | O_TRUNC | O_EXCL;
param->myf_rw=MYF(MY_NABP | MY_WME | MY_WAIT_IF_FULL);
- param->sort_info.param=param;
param->start_check_pos=0;
}
@@ -460,7 +455,7 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
info->s->state.auto_increment=save_auto_value;
/* Check that there isn't a row with auto_increment = 0 in the table */
- mi_extra(info,HA_EXTRA_KEYREAD);
+ mi_extra(info,HA_EXTRA_KEYREAD,0);
bzero(info->lastkey,keyinfo->seg->length);
if (!mi_rkey(info, info->rec_buff, key, (const byte*) info->lastkey,
keyinfo->seg->length, HA_READ_KEY_EXACT))
@@ -471,7 +466,7 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
"Found row where the auto_increment column has the value 0");
param->warning_printed=save;
}
- mi_extra(info,HA_EXTRA_NO_KEYREAD);
+ mi_extra(info,HA_EXTRA_NO_KEYREAD,0);
}
length=(my_off_t) isam_key_length(info,keyinfo)*keys + param->key_blocks*2;
@@ -589,7 +584,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
}
if ((*keys)++ &&
(flag=ha_key_cmp(keyinfo->seg,info->lastkey,key,key_length,
- comp_flag, &not_used)) >=0)
+ comp_flag, &not_used)) >=0)
{
DBUG_DUMP("old",(byte*) info->lastkey, info->lastkey_length);
DBUG_DUMP("new",(byte*) key, key_length);
@@ -607,7 +602,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
{
uint diff;
ha_key_cmp(keyinfo->seg,info->lastkey,key,USE_WHOLE_KEY,SEARCH_FIND,
- &diff);
+ &diff);
param->unique_count[diff-1]++;
}
}
@@ -845,7 +840,8 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
}
if (info->s->base.blobs)
{
- if (!(to=mi_fix_rec_buff_for_blob(info,block_info.rec_len)))
+ if (!(to= mi_alloc_rec_buff(info, block_info.rec_len,
+ &info->rec_buff)))
{
mi_check_print_error(param,"Not enough memory for blob at %s",
llstr(start_recpos,llbuff));
@@ -903,7 +899,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
info->checksum=mi_checksum(info,record);
if (param->testflag & (T_EXTEND | T_MEDIUM | T_VERBOSE))
{
- if (_mi_rec_check(info,record))
+ if (_mi_rec_check(info,record, info->rec_buff))
{
mi_check_print_error(param,"Found wrong packed record at %s",
llstr(start_recpos,llbuff));
@@ -1070,7 +1066,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
if (used != 0 && ! param->error_printed)
{
printf("Records:%18s M.recordlength:%9lu Packed:%14.0f%%\n",
- llstr(records,llbuff), (long)((used-link_used)/records),
+ llstr(records,llbuff), (long)((used-link_used)/records),
(info->s->base.blobs ? 0.0 :
(ulonglong2double((ulonglong) info->s->base.reclength*records)-
my_off_t2double(used))/
@@ -1112,27 +1108,28 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
File new_file;
MYISAM_SHARE *share=info->s;
char llbuff[22],llbuff2[22];
- SORT_INFO *sort_info= &param->sort_info;
+ SORT_INFO sort_info;
+ MI_SORT_PARAM sort_param;
DBUG_ENTER("mi_repair");
- sort_info->buff=sort_info->record=0;
+ bzero((char *)&sort_info, sizeof(sort_info));
+ bzero((char *)&sort_param, sizeof(sort_param));
start_records=info->state->records;
new_header_length=(param->testflag & T_UNPACK) ? 0L :
share->pack.header_length;
got_error=1;
new_file= -1;
- sort_info->buff=0;
- sort_info->buff_length=0;
- sort_info->record=0;
+ sort_param.sort_info=&sort_info;
if (!(param->testflag & T_SILENT))
{
printf("- recovering (with keycache) MyISAM-table '%s'\n",name);
printf("Data records: %s\n", llstr(info->state->records,llbuff));
}
+ param->testflag|=T_REP; /* for easy checking */
if (!param->using_global_keycache)
- VOID(init_key_cache(param->use_buffers,NEED_MEM));
+ VOID(init_key_cache(param->use_buffers));
if (init_io_cache(&param->read_cache,info->dfile,
(uint) param->read_buffer_length,
@@ -1147,9 +1144,9 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
MYF(MY_WME | MY_WAIT_IF_FULL)))
goto err;
info->opt_flag|=WRITE_CACHE_USED;
- sort_info->start_recpos=0;
- if (!(sort_info->record=(byte*) my_malloc((uint) share->base.pack_reclength,
- MYF(0))))
+ if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
+ MYF(0))) ||
+ !mi_alloc_rec_buff(info, -1, &sort_param.rec_buff))
{
mi_check_print_error(param,"Not enough memory for extra record");
goto err;
@@ -1161,8 +1158,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
fn_format(param->temp_filename,name,"", MI_NAME_DEXT,2+4+32);
if ((new_file=my_raid_create(fn_format(param->temp_filename,
param->temp_filename,"",
- DATA_TMP_EXT,
- 2+4),
+ DATA_TMP_EXT, 2+4),
0,param->tmpfile_createflag,
share->base.raid_type,
share->base.raid_chunks,
@@ -1184,16 +1180,19 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
mi_int2store(share->state.header.options,share->options);
}
}
- sort_info->info=info;
- sort_info->pos=sort_info->max_pos=share->pack.header_length;
- sort_info->filepos=new_header_length;
- param->read_cache.end_of_file=sort_info->filelength=
+ sort_info.info=info;
+ sort_info.param = param;
+ sort_param.read_cache=param->read_cache;
+ sort_param.pos=sort_param.max_pos=share->pack.header_length;
+ sort_param.filepos=new_header_length;
+ param->read_cache.end_of_file=sort_info.filelength=
my_seek(info->dfile,0L,MY_SEEK_END,MYF(0));
- sort_info->dupp=0;
- sort_info->fix_datafile= (my_bool) (! rep_quick);
- sort_info->max_records= ~(ha_rows) 0;
+ sort_info.dupp=0;
+ sort_param.fix_datafile= (my_bool) (! rep_quick);
+ sort_param.master=1;
+ sort_info.max_records= ~(ha_rows) 0;
- set_data_file_type(param, sort_info, share);
+ set_data_file_type(&sort_info, share);
del=info->state->del;
info->state->records=info->state->del=share->state.split=0;
info->state->empty=0;
@@ -1207,10 +1206,11 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
for (i=0 ; i < share->state.header.max_block_size ; i++)
share->state.key_del[i]= HA_OFFSET_ERROR;
- /* I think mi_repair and mi_repair_by_sort should do the same
- (according, e.g. to ha_myisam::repair), but as mi_repair doesn't
- touch key_map it cannot be used to T_CREATE_MISSING_KEYS.
- That is the next line for... (serg)
+ /*
+ I think mi_repair and mi_repair_by_sort should do the same
+ (according, e.g. to ha_myisam::repair), but as mi_repair doesn't
+ touch key_map it cannot be used to T_CREATE_MISSING_KEYS.
+ That is what the next line is for... (serg)
*/
share->state.key_map= ((((ulonglong) 1L << share->base.keys)-1) &
@@ -1219,25 +1219,25 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
info->state->key_file_length=share->base.keystart;
lock_memory(param); /* Everything is alloced */
- while (!(error=sort_get_next_record(sort_info)))
+ while (!(error=sort_get_next_record(&sort_param)))
{
- if (writekeys(param, info,(byte*) sort_info->record,sort_info->filepos))
+ if (writekeys(param,info,(byte*)sort_param.record,sort_param.filepos))
{
if (my_errno != HA_ERR_FOUND_DUPP_KEY)
goto err;
- DBUG_DUMP("record",(byte*) sort_info->record,share->base.pack_reclength);
+ DBUG_DUMP("record",(byte*) sort_param.record,share->base.pack_reclength);
mi_check_print_info(param,"Duplicate key %2d for record at %10s against new record at %10s",
info->errkey+1,
- llstr(sort_info->start_recpos,llbuff),
+ llstr(sort_param.start_recpos,llbuff),
llstr(info->dupp_key_pos,llbuff2));
if (param->testflag & T_VERBOSE)
{
VOID(_mi_make_key(info,(uint) info->errkey,info->lastkey,
- sort_info->record,0L));
+ sort_param.record,0L));
_mi_print_key(stdout,share->keyinfo[info->errkey].seg,info->lastkey,
USE_WHOLE_KEY);
}
- sort_info->dupp++;
+ sort_info.dupp++;
if (!(rep_quick & T_FORCE_UNIQUENESS))
{
param->testflag|=T_RETRY_WITHOUT_QUICK;
@@ -1246,10 +1246,10 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
}
continue;
}
- if (sort_write_record(sort_info))
+ if (sort_write_record(&sort_param))
goto err;
}
- if (error > 0 || write_data_suffix(param,info) ||
+ if (error > 0 || write_data_suffix(&sort_info, (my_bool)!rep_quick) ||
flush_io_cache(&info->rec_cache) || param->read_cache.error < 0)
goto err;
@@ -1257,7 +1257,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
{
VOID(fputs(" \r",stdout)); VOID(fflush(stdout));
}
- if (my_chsize(share->kfile,info->state->key_file_length,MYF(0)))
+ if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0)))
{
mi_check_print_warning(param,
"Can't change size of indexfile, error: %d",
@@ -1265,7 +1265,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
goto err;
}
- if (rep_quick && del+sort_info->dupp != info->state->del)
+ if (rep_quick && del+sort_info.dupp != info->state->del)
{
mi_check_print_error(param,"Couldn't fix table with quick recovery: Found wrong number of deleted records");
mi_check_print_error(param,"Run recovery again without -q");
@@ -1289,12 +1289,12 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
{
my_close(info->dfile,MYF(0));
info->dfile=new_file;
- info->state->data_file_length=sort_info->filepos;
+ info->state->data_file_length=sort_param.filepos;
share->state.version=(ulong) time((time_t*) 0); /* Force reopen */
}
else
{
- info->state->data_file_length=sort_info->max_pos;
+ info->state->data_file_length=sort_param.max_pos;
}
if (param->testflag & T_CALC_CHECKSUM)
share->state.checksum=param->glob_crc;
@@ -1303,10 +1303,10 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
{
if (start_records != info->state->records)
printf("Data records: %s\n", llstr(info->state->records,llbuff));
- if (sort_info->dupp)
+ if (sort_info.dupp)
mi_check_print_warning(param,
"%s records have been removed",
- llstr(sort_info->dupp,llbuff));
+ llstr(sort_info.dupp,llbuff));
}
got_error=0;
@@ -1334,7 +1334,7 @@ err:
{
if (! param->error_printed)
mi_check_print_error(param,"%d for record at pos %s",my_errno,
- llstr(sort_info->start_recpos,llbuff));
+ llstr(sort_param.start_recpos,llbuff));
if (new_file >= 0)
{
VOID(my_close(new_file,MYF(0)));
@@ -1343,8 +1343,10 @@ err:
}
mi_mark_crashed_on_repair(info);
}
- my_free(sort_info->record,MYF(MY_ALLOW_ZERO_PTR));
- my_free(sort_info->buff,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff),
+ MYF(MY_ALLOW_ZERO_PTR));
+ my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
VOID(end_io_cache(&param->read_cache));
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
VOID(end_io_cache(&info->rec_cache));
@@ -1353,7 +1355,7 @@ err:
{
share->state.header.options[0]&= (uchar) ~HA_OPTION_COMPRESS_RECORD;
share->pack.header_length=0;
- share->data_file_type=sort_info->new_data_file_type;
+ share->data_file_type=sort_info.new_data_file_type;
}
share->state.changed|= (STATE_NOT_OPTIMIZED_KEYS | STATE_NOT_SORTED_PAGES |
STATE_NOT_ANALYZED);
@@ -1551,7 +1553,7 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name)
old_state=share->state; /* save state if not stored */
r_locks=share->r_locks; w_locks=share->w_locks;
/* Put same locks as old file */
- share->r_locks=share->w_locks=0;
+ share->r_locks= share->w_locks= share->tot_locks= 0;
(void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
VOID(my_close(share->kfile,MYF(MY_WME)));
share->kfile = -1;
@@ -1564,6 +1566,7 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name)
_mi_readinfo(info,F_WRLCK,0); /* Will lock the table */
info->lock_type=F_WRLCK;
share->r_locks=r_locks; share->w_locks=w_locks;
+ share->tot_locks= r_locks+w_locks;
share->state=old_state; /* Restore old state */
info->state->key_file_length=param->new_file_pos;
@@ -1741,8 +1744,21 @@ err:
DBUG_RETURN(1);
}
- /* Fix table or given index using sorting */
- /* saves new table in temp_filename */
+
+/*
+ Repair table or given index using sorting
+
+ SYNOPSIS
+ mi_repair_by_sort()
+ param Repair parameters
+ info MyISAM handler to repair
+ name Name of table (for warnings)
+ rep_quick set to <> 0 if we should not change data file
+
+ RESULT
+ 0 ok
+ <>0 Error
+*/
int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
const char * name, int rep_quick)
@@ -1755,9 +1771,10 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
File new_file;
MI_SORT_PARAM sort_param;
MYISAM_SHARE *share=info->s;
+ MI_KEYSEG *keyseg;
ulong *rec_per_key_part;
char llbuff[22];
- SORT_INFO *sort_info= &param->sort_info;
+ SORT_INFO sort_info;
ulonglong key_map=share->state.key_map;
DBUG_ENTER("mi_repair_by_sort");
@@ -1771,9 +1788,11 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
printf("- recovering (with sort) MyISAM-table '%s'\n",name);
printf("Data records: %s\n", llstr(start_records,llbuff));
}
+ param->testflag|=T_REP; /* for easy checking */
- bzero((char*) sort_info,sizeof(*sort_info));
- if (!(sort_info->key_block=
+ bzero((char*)&sort_info,sizeof(sort_info));
+ bzero((char *)&sort_param, sizeof(sort_param));
+ if (!(sort_info.key_block=
alloc_key_blocks(param,
(uint) param->sort_key_blocks,
share->base.max_key_block_length))
@@ -1786,12 +1805,13 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
WRITE_CACHE,new_header_length,1,
MYF(MY_WME | MY_WAIT_IF_FULL) & param->myf_rw)))
goto err;
- sort_info->key_block_end=sort_info->key_block+param->sort_key_blocks;
+ sort_info.key_block_end=sort_info.key_block+param->sort_key_blocks;
info->opt_flag|=WRITE_CACHE_USED;
info->rec_cache.file=info->dfile; /* for sort_delete_record */
- if (!(sort_info->record=(byte*) my_malloc((uint) share->base.pack_reclength,
- MYF(0))))
+ if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
+ MYF(0))) ||
+ !mi_alloc_rec_buff(info, -1, &sort_param.rec_buff))
{
mi_check_print_error(param,"Not enough memory for extra record");
goto err;
@@ -1848,17 +1868,17 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
key_map= ~key_map; /* Create the missing keys */
}
- sort_info->info=info;
- sort_info->param = param;
+ sort_info.info=info;
+ sort_info.param = param;
- set_data_file_type(param, sort_info, share);
- sort_info->filepos=new_header_length;
- sort_info->dupp=0;
- sort_info->buff=0;
- param->read_cache.end_of_file=sort_info->filelength=
+ set_data_file_type(&sort_info, share);
+ sort_param.filepos=new_header_length;
+ sort_info.dupp=0;
+ sort_info.buff=0;
+ param->read_cache.end_of_file=sort_info.filelength=
my_seek(param->read_cache.file,0L,MY_SEEK_END,MYF(0));
- sort_info->wordlist=NULL;
+ sort_param.wordlist=NULL;
if (share->data_file_type == DYNAMIC_RECORD)
length=max(share->base.min_pack_length+1,share->base.min_block_length);
@@ -1866,15 +1886,16 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
length=share->base.min_block_length;
else
length=share->base.pack_reclength;
- sort_param.max_records=sort_info->max_records=
- ((param->testflag & T_TRUST_HEADER) ? info->state->records :
- (ha_rows) (sort_info->filelength/length+1));
+ sort_info.max_records=
+ ((param->testflag & T_CREATE_MISSING_KEYS) ? info->state->records :
+ (ha_rows) (sort_info.filelength/length+1));
sort_param.key_cmp=sort_key_cmp;
sort_param.key_write=sort_key_write;
sort_param.lock_in_memory=lock_memory;
sort_param.tmpdir=param->tmpdir;
- sort_param.myf_rw=param->myf_rw;
- sort_param.sort_info=sort_info;
+ sort_param.sort_info=&sort_info;
+ sort_param.fix_datafile= (my_bool) (! rep_quick);
+ sort_param.master =1;
del=info->state->del;
param->glob_crc=0;
@@ -1882,47 +1903,47 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
param->calc_checksum=1;
rec_per_key_part= param->rec_per_key_part;
- for (sort_info->key=0 ; sort_info->key < share->base.keys ;
- rec_per_key_part+=sort_info->keyinfo->keysegs, sort_info->key++)
+ for (sort_param.key=0 ; sort_param.key < share->base.keys ;
+ rec_per_key_part+=sort_param.keyinfo->keysegs, sort_param.key++)
{
- sort_info->keyinfo=share->keyinfo+sort_info->key;
- if (!(((ulonglong) 1 << sort_info->key) & key_map))
+ sort_param.read_cache=param->read_cache;
+ sort_param.keyinfo=share->keyinfo+sort_param.key;
+ if (!(((ulonglong) 1 << sort_param.key) & key_map))
{
/* Remember old statistics for key */
memcpy((char*) rec_per_key_part,
(char*) share->state.rec_per_key_part+
(uint) (rec_per_key_part - param->rec_per_key_part),
- sort_info->keyinfo->keysegs*sizeof(*rec_per_key_part));
+ sort_param.keyinfo->keysegs*sizeof(*rec_per_key_part));
continue;
}
if ((!(param->testflag & T_SILENT)))
- printf ("- Fixing index %d\n",sort_info->key+1);
- sort_info->max_pos=sort_info->pos=share->pack.header_length;
- sort_info->keyseg=sort_info->keyinfo->seg;
- sort_info->fix_datafile= (my_bool) (sort_info->key == 0 && ! rep_quick);
- bzero((char*) sort_info->unique,sizeof(sort_info->unique));
+ printf ("- Fixing index %d\n",sort_param.key+1);
+ sort_param.max_pos=sort_param.pos=share->pack.header_length;
+ keyseg=sort_param.keyinfo->seg;
+ bzero((char*) sort_param.unique,sizeof(sort_param.unique));
sort_param.key_length=share->rec_reflength;
- for (i=0 ; sort_info->keyseg[i].type != HA_KEYTYPE_END; i++)
+ for (i=0 ; keyseg[i].type != HA_KEYTYPE_END; i++)
{
- sort_param.key_length+=sort_info->keyseg[i].length;
- if (sort_info->keyseg[i].flag & HA_SPACE_PACK)
- sort_param.key_length+=get_pack_length(sort_info->keyseg[i].length);
- if (sort_info->keyseg[i].flag & (HA_BLOB_PART | HA_VAR_LENGTH))
- sort_param.key_length+=2 + test(sort_info->keyseg[i].length >= 127);
- if (sort_info->keyseg[i].flag & HA_NULL_PART)
+ sort_param.key_length+=keyseg[i].length;
+ if (keyseg[i].flag & HA_SPACE_PACK)
+ sort_param.key_length+=get_pack_length(keyseg[i].length);
+ if (keyseg[i].flag & (HA_BLOB_PART | HA_VAR_LENGTH))
+ sort_param.key_length+=2 + test(keyseg[i].length >= 127);
+ if (keyseg[i].flag & HA_NULL_PART)
sort_param.key_length++;
}
info->state->records=info->state->del=share->state.split=0;
info->state->empty=0;
- if (sort_info->keyinfo->flag & HA_FULLTEXT)
+ if (sort_param.keyinfo->flag & HA_FULLTEXT)
{
- sort_param.max_records=sort_info->max_records=
- (ha_rows) (sort_info->filelength/ft_max_word_len_for_sort+1);
+ sort_info.max_records=
+ (ha_rows) (sort_info.filelength/ft_max_word_len_for_sort+1);
sort_param.key_read=sort_ft_key_read;
- sort_param.key_length+=ft_max_word_len_for_sort-ft_max_word_len;
+ sort_param.key_length+=ft_max_word_len_for_sort-HA_FT_MAXLEN;
}
else
sort_param.key_read=sort_key_read;
@@ -1937,18 +1958,17 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
param->calc_checksum=0; /* No need to calc glob_crc */
/* Set for next loop */
- sort_param.max_records=sort_info->max_records=
- (ha_rows) info->state->records;
+ sort_info.max_records= (ha_rows) info->state->records;
if (param->testflag & T_STATISTICS)
- update_key_parts(sort_info->keyinfo, rec_per_key_part, sort_info->unique,
+ update_key_parts(sort_param.keyinfo, rec_per_key_part, sort_param.unique,
(ulonglong) info->state->records);
- share->state.key_map|=(ulonglong) 1 << sort_info->key;
+ share->state.key_map|=(ulonglong) 1 << sort_param.key;
- if (sort_info->fix_datafile)
+ if (sort_param.fix_datafile)
{
- param->read_cache.end_of_file=sort_info->filepos;
- if (write_data_suffix(param,info) || end_io_cache(&info->rec_cache))
+ param->read_cache.end_of_file=sort_param.filepos;
+ if (write_data_suffix(&sort_info,1) || end_io_cache(&info->rec_cache))
goto err;
if (param->testflag & T_SAFE_REPAIR)
{
@@ -1959,24 +1979,25 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
goto err;
}
}
- share->state.state.data_file_length = info->state->data_file_length
- = sort_info->filepos;
+ share->state.state.data_file_length = info->state->data_file_length=
+ sort_param.filepos;
/* Only whole records */
share->state.version=(ulong) time((time_t*) 0);
my_close(info->dfile,MYF(0));
info->dfile=new_file;
- share->data_file_type=sort_info->new_data_file_type;
+ share->data_file_type=sort_info.new_data_file_type;
share->pack.header_length=(ulong) new_header_length;
+ sort_param.fix_datafile=0;
}
else
- info->state->data_file_length=sort_info->max_pos;
+ info->state->data_file_length=sort_param.max_pos;
/*if (flush_pending_blocks(param))
goto err;*/
param->read_cache.file=info->dfile; /* re-init read cache */
- reinit_io_cache(&param->read_cache,READ_CACHE,share->pack.header_length,1,
- 1);
+ reinit_io_cache(&param->read_cache,READ_CACHE,share->pack.header_length,
+ 1,1);
}
if (param->testflag & T_WRITE_LOOP)
@@ -1984,7 +2005,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
VOID(fputs(" \r",stdout)); VOID(fflush(stdout));
}
- if (rep_quick && del+sort_info->dupp != info->state->del)
+ if (rep_quick && del+sort_info.dupp != info->state->del)
{
mi_check_print_error(param,"Couldn't fix table with quick recovery: Found wrong number of deleted records");
mi_check_print_error(param,"Run recovery again without -q");
@@ -2004,8 +2025,8 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
skr < share->base.reloc*share->base.min_pack_length)
skr=share->base.reloc*share->base.min_pack_length;
#endif
- if (skr != sort_info->filelength && !info->s->base.raid_type)
- if (my_chsize(info->dfile,skr,MYF(0)))
+ if (skr != sort_info.filelength && !info->s->base.raid_type)
+ if (my_chsize(info->dfile,skr,0,MYF(0)))
mi_check_print_warning(param,
"Can't change size of datafile, error: %d",
my_errno);
@@ -2013,7 +2034,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
if (param->testflag & T_CALC_CHECKSUM)
share->state.checksum=param->glob_crc;
- if (my_chsize(share->kfile,info->state->key_file_length,MYF(0)))
+ if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0)))
mi_check_print_warning(param,
"Can't change size of indexfile, error: %d",
my_errno);
@@ -2022,10 +2043,10 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
{
if (start_records != info->state->records)
printf("Data records: %s\n", llstr(info->state->records,llbuff));
- if (sort_info->dupp)
+ if (sort_info.dupp)
mi_check_print_warning(param,
"%s records have been removed",
- llstr(sort_info->dupp,llbuff));
+ llstr(sort_info.dupp,llbuff));
}
got_error=0;
@@ -2068,9 +2089,11 @@ err:
share->state.changed&= ~STATE_NOT_OPTIMIZED_KEYS;
share->state.changed|=STATE_NOT_SORTED_PAGES;
- my_free((gptr) sort_info->key_block,MYF(MY_ALLOW_ZERO_PTR));
- my_free(sort_info->record,MYF(MY_ALLOW_ZERO_PTR));
- my_free(sort_info->buff,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff),
+ MYF(MY_ALLOW_ZERO_PTR));
+ my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
+ my_free((gptr) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
VOID(end_io_cache(&param->read_cache));
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
if (!got_error && (param->testflag & T_UNPACK))
@@ -2081,122 +2104,516 @@ err:
DBUG_RETURN(got_error);
}
+/*
+ Threaded repair of table using sorting
+
+ SYNOPSIS
+ mi_repair_by_sort_r()
+ param Repair parameters
+ info MyISAM handler to repair
+ name Name of table (for warnings)
+ rep_quick set to <> 0 if we should not change data file
+
+ DESCRIPTION
+ Same as mi_repair_by_sort but do it multithreaded
+ Each key is handled by a separate thread.
+ TODO: make a number of threads a parameter
+
+ RESULT
+ 0 ok
+ <>0 Error
+*/
+
+int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
+ const char * name, int rep_quick)
+{
+ int got_error;
+ uint i,key, total_key_length;
+ ulong rec_length;
+ ha_rows start_records;
+ my_off_t new_header_length,del;
+ File new_file;
+ MI_SORT_PARAM *sort_param=0;
+ MYISAM_SHARE *share=info->s;
+ ulong *rec_per_key_part;
+ MI_KEYSEG *keyseg;
+ char llbuff[22];
+ IO_CACHE_SHARE io_share;
+ SORT_INFO sort_info;
+ ulonglong key_map=share->state.key_map;
+ pthread_attr_t thr_attr;
+ DBUG_ENTER("mi_repair_parallel");
+
+ start_records=info->state->records;
+ got_error=1;
+ new_file= -1;
+ new_header_length=(param->testflag & T_UNPACK) ? 0 :
+ share->pack.header_length;
+ if (!(param->testflag & T_SILENT))
+ {
+ printf("- parallel recovering (with sort) MyISAM-table '%s'\n",name);
+ printf("Data records: %s\n", llstr(start_records,llbuff));
+ }
+ param->testflag|=T_REP; /* for easy checking */
+
+ bzero((char*)&sort_info,sizeof(sort_info));
+ if (!(sort_info.key_block=
+ alloc_key_blocks(param,
+ (uint) param->sort_key_blocks,
+ share->base.max_key_block_length))
+ || init_io_cache(&param->read_cache,info->dfile,
+ (uint) param->read_buffer_length,
+ READ_CACHE,share->pack.header_length,1,MYF(MY_WME)) ||
+ (! rep_quick &&
+ init_io_cache(&info->rec_cache,info->dfile,
+ (uint) param->write_buffer_length,
+ WRITE_CACHE,new_header_length,1,
+ MYF(MY_WME | MY_WAIT_IF_FULL) & param->myf_rw)))
+ goto err;
+ sort_info.key_block_end=sort_info.key_block+param->sort_key_blocks;
+ info->opt_flag|=WRITE_CACHE_USED;
+ info->rec_cache.file=info->dfile; /* for sort_delete_record */
+
+ if (!rep_quick)
+ {
+ /* Get real path for data file */
+ fn_format(param->temp_filename,name,"", MI_NAME_DEXT,2+4+32);
+ if ((new_file=my_raid_create(fn_format(param->temp_filename,
+ param->temp_filename, "",
+ DATA_TMP_EXT,
+ 2+4),
+ 0,param->tmpfile_createflag,
+ share->base.raid_type,
+ share->base.raid_chunks,
+ share->base.raid_chunksize,
+ MYF(0))) < 0)
+ {
+ mi_check_print_error(param,"Can't create new tempfile: '%s'",
+ param->temp_filename);
+ goto err;
+ }
+ if (filecopy(param, new_file,info->dfile,0L,new_header_length,
+ "datafile-header"))
+ goto err;
+ if (param->testflag & T_UNPACK)
+ {
+ share->options&= ~HA_OPTION_COMPRESS_RECORD;
+ mi_int2store(share->state.header.options,share->options);
+ }
+ share->state.dellink= HA_OFFSET_ERROR;
+ info->rec_cache.file=new_file;
+ }
+
+ info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
+ if (!(param->testflag & T_CREATE_MISSING_KEYS))
+ {
+ /*
+ Flush key cache for this file if we are calling this outside
+ myisamchk
+ */
+ flush_key_blocks(share->kfile, FLUSH_IGNORE_CHANGED);
+ /* Clear the pointers to the given rows */
+ for (i=0 ; i < share->base.keys ; i++)
+ share->state.key_root[i]= HA_OFFSET_ERROR;
+ for (i=0 ; i < share->state.header.max_block_size ; i++)
+ share->state.key_del[i]= HA_OFFSET_ERROR;
+ info->state->key_file_length=share->base.keystart;
+ }
+ else
+ {
+ if (flush_key_blocks(share->kfile, FLUSH_FORCE_WRITE))
+ goto err;
+ key_map= ~key_map; /* Create the missing keys */
+ }
+
+ sort_info.info=info;
+ sort_info.param = param;
+
+ set_data_file_type(&sort_info, share);
+ sort_info.dupp=0;
+ sort_info.buff=0;
+ param->read_cache.end_of_file=sort_info.filelength=
+ my_seek(param->read_cache.file,0L,MY_SEEK_END,MYF(0));
+
+ if (share->data_file_type == DYNAMIC_RECORD)
+ rec_length=max(share->base.min_pack_length+1,share->base.min_block_length);
+ else if (share->data_file_type == COMPRESSED_RECORD)
+ rec_length=share->base.min_block_length;
+ else
+ rec_length=share->base.pack_reclength;
+ sort_info.max_records=
+ ((param->testflag & T_CREATE_MISSING_KEYS) ? info->state->records :
+ (ha_rows) (sort_info.filelength/rec_length+1));
+
+ del=info->state->del;
+ param->glob_crc=0;
+ if (param->testflag & T_CALC_CHECKSUM)
+ param->calc_checksum=1;
+
+ if (!(sort_param=(MI_SORT_PARAM *)
+ my_malloc((uint) share->base.keys *
+ (sizeof(MI_SORT_PARAM) + share->base.pack_reclength),
+ MYF(MY_ZEROFILL))))
+ {
+ mi_check_print_error(param,"Not enough memory!");
+ goto err;
+ }
+ total_key_length=0;
+ rec_per_key_part= param->rec_per_key_part;
+ info->state->records=info->state->del=share->state.split=0;
+ info->state->empty=0;
+
+ for (i=key=0 ; key < share->base.keys ;
+ rec_per_key_part+=sort_param[i].keyinfo->keysegs, i++, key++)
+ {
+ sort_param[i].key=key;
+ sort_param[i].keyinfo=share->keyinfo+key;
+ if (!(((ulonglong) 1 << key) & key_map))
+ {
+ /* Remember old statistics for key */
+ memcpy((char*) rec_per_key_part,
+ (char*) share->state.rec_per_key_part+
+ (uint) (rec_per_key_part - param->rec_per_key_part),
+ sort_param[i].keyinfo->keysegs*sizeof(*rec_per_key_part));
+ i--;
+ continue;
+ }
+ if ((!(param->testflag & T_SILENT)))
+ printf ("- Fixing index %d\n",key+1);
+ sort_param[i].key_read= ((sort_param[i].keyinfo->flag & HA_FULLTEXT) ?
+ sort_ft_key_read : sort_key_read);
+ sort_param[i].key_cmp=sort_key_cmp;
+ sort_param[i].key_write=sort_key_write;
+ sort_param[i].lock_in_memory=lock_memory;
+ sort_param[i].tmpdir=param->tmpdir;
+ sort_param[i].sort_info=&sort_info;
+ sort_param[i].master=0;
+ sort_param[i].fix_datafile=0;
+
+ sort_param[i].filepos=new_header_length;
+ sort_param[i].max_pos=sort_param[i].pos=share->pack.header_length;
+
+ sort_param[i].record= (((char *)(sort_param+share->base.keys))+
+ (share->base.pack_reclength * i));
+
+ sort_param[i].key_length=share->rec_reflength;
+ for (keyseg=sort_param[i].keyinfo->seg; keyseg->type != HA_KEYTYPE_END;
+ keyseg++)
+ {
+ sort_param[i].key_length+=keyseg->length;
+ if (keyseg->flag & HA_SPACE_PACK)
+ sort_param[i].key_length+=get_pack_length(keyseg->length);
+ if (keyseg->flag & (HA_BLOB_PART | HA_VAR_LENGTH))
+ sort_param[i].key_length+=2 + test(keyseg->length >= 127);
+ if (keyseg->flag & HA_NULL_PART)
+ sort_param[i].key_length++;
+ }
+ total_key_length+=sort_param[i].key_length;
+
+ if (sort_param[i].keyinfo->flag & HA_FULLTEXT)
+ sort_param[i].key_length+=ft_max_word_len_for_sort-ft_max_word_len;
+ }
+ sort_info.total_keys=i;
+ sort_param[0].master= 1;
+ sort_param[0].fix_datafile= (my_bool)(! rep_quick);
+
+ sort_info.got_error=0;
+ pthread_mutex_init(&sort_info.mutex, MY_MUTEX_INIT_FAST);
+ pthread_cond_init(&sort_info.cond, 0);
+ pthread_mutex_lock(&sort_info.mutex);
+
+ init_io_cache_share(&param->read_cache, &io_share, i);
+ (void) pthread_attr_init(&thr_attr);
+ (void) pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
+
+ for (i=0 ; i < sort_info.total_keys ; i++)
+ {
+ sort_param[i].read_cache=param->read_cache;
+ sort_param[i].sortbuff_size=
+ /*
+ two approaches: the same amount of memory for each thread
+ or the memory for the same number of keys for each thread...
+ In the second one all the threads will fill their sort_buffers
+ (and call write_keys) at the same time, putting more stress on i/o.
+ */
+#ifndef USING_SECOND_APPROACH
+ param->sort_buffer_length/sort_info.total_keys;
+#else
+ param->sort_buffer_length*sort_param[i].key_length/total_key_length;
+#endif
+ if (pthread_create(&sort_param[i].thr, &thr_attr,
+ thr_find_all_keys,
+ (void *) (sort_param+i)))
+ {
+ mi_check_print_error(param,"Cannot start a repair thread");
+ remove_io_thread(&param->read_cache);
+ sort_info.got_error=1;
+ }
+ else
+ sort_info.threads_running++;
+ }
+ (void) pthread_attr_destroy(&thr_attr);
+
+ /* waiting for all threads to finish */
+ while (sort_info.threads_running)
+ pthread_cond_wait(&sort_info.cond, &sort_info.mutex);
+ pthread_mutex_unlock(&sort_info.mutex);
+
+ if ((got_error= thr_write_keys(sort_param)))
+ {
+ param->retry_repair=1;
+ goto err;
+ }
+ got_error=1; /* Assume the following may go wrong */
+
+ if (sort_param[0].fix_datafile)
+ {
+ if (write_data_suffix(&sort_info,1) || end_io_cache(&info->rec_cache))
+ goto err;
+ if (param->testflag & T_SAFE_REPAIR)
+ {
+ /* Don't repair if we loosed more than one row */
+ if (info->state->records+1 < start_records)
+ {
+ info->state->records=start_records;
+ goto err;
+ }
+ }
+ share->state.state.data_file_length= info->state->data_file_length=
+ sort_param->filepos;
+ /* Only whole records */
+ share->state.version=(ulong) time((time_t*) 0);
+ my_close(info->dfile,MYF(0));
+ info->dfile=new_file;
+ share->data_file_type=sort_info.new_data_file_type;
+ share->pack.header_length=(ulong) new_header_length;
+ }
+ else
+ info->state->data_file_length=sort_param->max_pos;
+
+ if (rep_quick && del+sort_info.dupp != info->state->del)
+ {
+ mi_check_print_error(param,"Couldn't fix table with quick recovery: Found wrong number of deleted records");
+ mi_check_print_error(param,"Run recovery again without -q");
+ param->retry_repair=1;
+ param->testflag|=T_RETRY_WITHOUT_QUICK;
+ goto err;
+ }
+
+ if (rep_quick & T_FORCE_UNIQUENESS)
+ {
+ my_off_t skr=info->state->data_file_length+
+ (share->options & HA_OPTION_COMPRESS_RECORD ?
+ MEMMAP_EXTRA_MARGIN : 0);
+#ifdef USE_RELOC
+ if (share->data_file_type == STATIC_RECORD &&
+ skr < share->base.reloc*share->base.min_pack_length)
+ skr=share->base.reloc*share->base.min_pack_length;
+#endif
+ if (skr != sort_info.filelength && !info->s->base.raid_type)
+ if (my_chsize(info->dfile,skr,0,MYF(0)))
+ mi_check_print_warning(param,
+ "Can't change size of datafile, error: %d",
+ my_errno);
+ }
+ if (param->testflag & T_CALC_CHECKSUM)
+ share->state.checksum=param->glob_crc;
+
+ if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0)))
+ mi_check_print_warning(param,
+ "Can't change size of indexfile, error: %d", my_errno);
+
+ if (!(param->testflag & T_SILENT))
+ {
+ if (start_records != info->state->records)
+ printf("Data records: %s\n", llstr(info->state->records,llbuff));
+ if (sort_info.dupp)
+ mi_check_print_warning(param,
+ "%s records have been removed",
+ llstr(sort_info.dupp,llbuff));
+ }
+ got_error=0;
+
+ if (&share->state.state != info->state)
+ memcpy( &share->state.state, info->state, sizeof(*info->state));
+
+err:
+ got_error|= flush_blocks(param,share->kfile);
+ VOID(end_io_cache(&info->rec_cache));
+ if (!got_error)
+ {
+ /* Replace the actual file with the temporary file */
+ if (new_file >= 0)
+ {
+ my_close(new_file,MYF(0));
+ info->dfile=new_file= -1;
+ if (change_to_newfile(share->data_file_name,MI_NAME_DEXT,
+ DATA_TMP_EXT, share->base.raid_chunks,
+ (param->testflag & T_BACKUP_DATA ?
+ MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
+ mi_open_datafile(info,share,-1))
+ got_error=1;
+ }
+ }
+ if (got_error)
+ {
+ if (! param->error_printed)
+ mi_check_print_error(param,"%d when fixing table",my_errno);
+ if (new_file >= 0)
+ {
+ VOID(my_close(new_file,MYF(0)));
+ VOID(my_raid_delete(param->temp_filename,share->base.raid_chunks,
+ MYF(MY_WME)));
+ if (info->dfile == new_file)
+ info->dfile= -1;
+ }
+ mi_mark_crashed_on_repair(info);
+ }
+ else if (key_map == share->state.key_map)
+ share->state.changed&= ~STATE_NOT_OPTIMIZED_KEYS;
+ share->state.changed|=STATE_NOT_SORTED_PAGES;
+
+ pthread_cond_destroy (&sort_info.cond);
+ pthread_mutex_destroy(&sort_info.mutex);
+
+ my_free((gptr) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR));
+ my_free((gptr) sort_param,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
+ VOID(end_io_cache(&param->read_cache));
+ info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
+ if (!got_error && (param->testflag & T_UNPACK))
+ {
+ share->state.header.options[0]&= (uchar) ~HA_OPTION_COMPRESS_RECORD;
+ share->pack.header_length=0;
+ }
+ DBUG_RETURN(got_error);
+}
/* Read next record and return next key */
-static int sort_key_read(SORT_INFO *sort_info, void *key)
+static int sort_key_read(MI_SORT_PARAM *sort_param, void *key)
{
int error;
- MI_INFO *info;
+ SORT_INFO *sort_info=sort_param->sort_info;
+ MI_INFO *info=sort_info->info;
DBUG_ENTER("sort_key_read");
- info=sort_info->info;
-
- if ((error=sort_get_next_record(sort_info)))
+ if ((error=sort_get_next_record(sort_param)))
DBUG_RETURN(error);
if (info->state->records == sort_info->max_records)
{
mi_check_print_error(sort_info->param,
- "Found too many records; Can`t continue");
+ "Key %d - Found too many records; Can't continue",
+ sort_param->key+1);
DBUG_RETURN(1);
}
- sort_info->real_key_length=(info->s->rec_reflength+
- _mi_make_key(info, sort_info->key,
- (uchar*) key, sort_info->record,
- sort_info->filepos));
- DBUG_RETURN(sort_write_record(sort_info));
+ sort_param->real_key_length=
+ (info->s->rec_reflength+
+ _mi_make_key(info, sort_param->key, (uchar*) key,
+ sort_param->record, sort_param->filepos));
+#ifdef HAVE_purify
+ bzero(key+sort_param->real_key_length,
+ (sort_param->key_length-sort_param->real_key_length));
+#endif
+ DBUG_RETURN(sort_write_record(sort_param));
} /* sort_key_read */
-static int sort_ft_key_read(SORT_INFO *sort_info, void *key)
+static int sort_ft_key_read(MI_SORT_PARAM *sort_param, void *key)
{
int error;
- MI_INFO *info;
+ SORT_INFO *sort_info=sort_param->sort_info;
+ MI_INFO *info=sort_info->info;
FT_WORD *wptr=0;
DBUG_ENTER("sort_ft_key_read");
- info=sort_info->info;
-
- if (!sort_info->wordlist)
+ if (!sort_param->wordlist)
{
do
{
my_free((char*) wptr, MYF(MY_ALLOW_ZERO_PTR));
- if ((error=sort_get_next_record(sort_info)))
+ if ((error=sort_get_next_record(sort_param)))
DBUG_RETURN(error);
- if (!(wptr=_mi_ft_parserecord(info,sort_info->key,key,sort_info->record)))
+ if (!(wptr=_mi_ft_parserecord(info,sort_param->key,
+ key,sort_param->record)))
DBUG_RETURN(1);
- error=sort_write_record(sort_info);
+ error=sort_write_record(sort_param);
}
while (!wptr->pos);
- sort_info->wordptr=sort_info->wordlist=wptr;
+ sort_param->wordptr=sort_param->wordlist=wptr;
}
else
{
error=0;
- wptr=(FT_WORD*)(sort_info->wordptr);
+ wptr=(FT_WORD*)(sort_param->wordptr);
}
- sort_info->real_key_length=info->s->rec_reflength+_ft_make_key(info,
- sort_info->key,key,wptr++,sort_info->filepos);
+ sort_param->real_key_length=(info->s->rec_reflength+
+ _ft_make_key(info, sort_param->key,
+ key, wptr++, sort_param->filepos));
+#ifdef HAVE_purify
+ if (sort_param->key_length > sort_param->real_key_length)
+ bzero(key+sort_param->real_key_length,
+ (sort_param->key_length-sort_param->real_key_length));
+#endif
if (!wptr->pos)
{
- my_free((char*) sort_info->wordlist, MYF(0));
- sort_info->wordlist=0;
+ my_free((char*) sort_param->wordlist, MYF(0));
+ sort_param->wordlist=0;
}
else
- sort_info->wordptr=(void*)wptr;
-
+ sort_param->wordptr=(void*)wptr;
DBUG_RETURN(error);
} /* sort_ft_key_read */
+
/* Read next record from file using parameters in sort_info */
/* Return -1 if end of file, 0 if ok and > 0 if error */
-static int sort_get_next_record(SORT_INFO *sort_info)
+static int sort_get_next_record(MI_SORT_PARAM *sort_param)
{
int searching;
uint found_record,b_type,left_length;
my_off_t pos;
byte *to;
MI_BLOCK_INFO block_info;
- MI_INFO *info;
- MYISAM_SHARE *share;
+ SORT_INFO *sort_info=sort_param->sort_info;
MI_CHECK *param=sort_info->param;
+ MI_INFO *info=sort_info->info;
+ MYISAM_SHARE *share=info->s;
char llbuff[22],llbuff2[22];
DBUG_ENTER("sort_get_next_record");
- info=sort_info->info;
- share=info->s;
switch (share->data_file_type) {
case STATIC_RECORD:
for (;;)
{
- if (my_b_read(&param->read_cache,sort_info->record,
+ if (my_b_read(&sort_param->read_cache,sort_param->record,
share->base.pack_reclength))
{
- if (param->read_cache.error)
+ if (sort_param->read_cache.error)
param->out_flag |= O_DATA_LOST;
param->retry_repair=1;
param->testflag|=T_RETRY_WITHOUT_QUICK;
DBUG_RETURN(-1);
}
- sort_info->start_recpos=sort_info->pos;
- if (!sort_info->fix_datafile)
+ sort_param->start_recpos=sort_param->pos;
+ if (!sort_param->fix_datafile)
{
- sort_info->filepos=sort_info->pos;
- share->state.split++;
+ sort_param->filepos=sort_param->pos;
+ if (sort_param->master)
+ share->state.split++;
}
- sort_info->max_pos=(sort_info->pos+=share->base.pack_reclength);
- if (*sort_info->record)
+ sort_param->max_pos=(sort_param->pos+=share->base.pack_reclength);
+ if (*sort_param->record)
{
if (param->calc_checksum)
param->glob_crc+= (info->checksum=
- mi_static_checksum(info,sort_info->record));
+ mi_static_checksum(info,sort_param->record));
DBUG_RETURN(0);
}
- if (!sort_info->fix_datafile)
+ if (!sort_param->fix_datafile && sort_param->master)
{
info->state->del++;
info->state->empty+=share->base.pack_reclength;
@@ -2204,8 +2621,8 @@ static int sort_get_next_record(SORT_INFO *sort_info)
}
case DYNAMIC_RECORD:
LINT_INIT(to);
- pos=sort_info->pos;
- searching=(sort_info->fix_datafile && (param->testflag & T_EXTEND));
+ pos=sort_param->pos;
+ searching=(sort_param->fix_datafile && (param->testflag & T_EXTEND));
for (;;)
{
found_record=block_info.second_read= 0;
@@ -2214,12 +2631,12 @@ static int sort_get_next_record(SORT_INFO *sort_info)
{
pos=MY_ALIGN(pos,MI_DYN_ALIGN_SIZE);
param->testflag|=T_RETRY_WITHOUT_QUICK;
- sort_info->start_recpos=pos;
+ sort_param->start_recpos=pos;
}
do
{
- if (pos > sort_info->max_pos)
- sort_info->max_pos=pos;
+ if (pos > sort_param->max_pos)
+ sort_param->max_pos=pos;
if (pos & (MI_DYN_ALIGN_SIZE-1))
{
if ((param->testflag & T_VERBOSE) || searching == 0)
@@ -2231,8 +2648,9 @@ static int sort_get_next_record(SORT_INFO *sort_info)
if (found_record && pos == param->search_after_block)
mi_check_print_info(param,"Block: %s used by record at %s",
llstr(param->search_after_block,llbuff),
- llstr(sort_info->start_recpos,llbuff2));
- if (_mi_read_cache(&param->read_cache,(byte*) block_info.header,pos,
+ llstr(sort_param->start_recpos,llbuff2));
+ if (_mi_read_cache(&sort_param->read_cache,
+ (byte*) block_info.header,pos,
MI_BLOCK_INFO_HEADER_LENGTH,
(! found_record ? READING_NEXT : 0) |
READING_HEADER))
@@ -2241,21 +2659,21 @@ static int sort_get_next_record(SORT_INFO *sort_info)
{
mi_check_print_info(param,
"Can't read whole record at %s (errno: %d)",
- llstr(sort_info->start_recpos,llbuff),errno);
+ llstr(sort_param->start_recpos,llbuff),errno);
goto try_next;
}
DBUG_RETURN(-1);
}
- if (searching && ! sort_info->fix_datafile)
+ if (searching && ! sort_param->fix_datafile)
{
param->error_printed=1;
param->retry_repair=1;
param->testflag|=T_RETRY_WITHOUT_QUICK;
DBUG_RETURN(1); /* Something wrong with data */
}
- if (((b_type=_mi_get_block_info(&block_info,-1,pos)) &
- (BLOCK_ERROR | BLOCK_FATAL_ERROR)) ||
- ((b_type & BLOCK_FIRST) &&
+ b_type=_mi_get_block_info(&block_info,-1,pos);
+ if ((b_type & (BLOCK_ERROR | BLOCK_FATAL_ERROR)) ||
+ ((b_type & BLOCK_FIRST) &&
(block_info.rec_len < (uint) share->base.min_pack_length ||
block_info.rec_len > (uint) share->base.max_pack_length)))
{
@@ -2277,7 +2695,7 @@ static int sort_get_next_record(SORT_INFO *sort_info)
block_info.header[i] <= MI_MAX_DYN_HEADER_BYTE)
break;
pos+=(ulong) i;
- sort_info->start_recpos=pos;
+ sort_param->start_recpos=pos;
continue;
}
if (b_type & BLOCK_DELETED)
@@ -2313,7 +2731,7 @@ static int sort_get_next_record(SORT_INFO *sort_info)
goto try_next;
searching=1;
pos+= MI_DYN_ALIGN_SIZE;
- sort_info->start_recpos=pos;
+ sort_param->start_recpos=pos;
block_info.second_read=0;
continue;
}
@@ -2334,14 +2752,15 @@ static int sort_get_next_record(SORT_INFO *sort_info)
goto try_next;
searching=1;
pos+= MI_DYN_ALIGN_SIZE;
- sort_info->start_recpos=pos;
+ sort_param->start_recpos=pos;
block_info.second_read=0;
continue;
}
}
if (b_type & (BLOCK_DELETED | BLOCK_SYNC_ERROR))
{
- if (!sort_info->fix_datafile && (b_type & BLOCK_DELETED))
+ if (!sort_param->fix_datafile && sort_param->master &&
+ (b_type & BLOCK_DELETED))
{
info->state->empty+=block_info.block_len;
info->state->del++;
@@ -2352,7 +2771,7 @@ static int sort_get_next_record(SORT_INFO *sort_info)
if (searching)
{
pos+=MI_DYN_ALIGN_SIZE;
- sort_info->start_recpos=pos;
+ sort_param->start_recpos=pos;
}
else
pos=block_info.filepos+block_info.block_len;
@@ -2360,44 +2779,45 @@ static int sort_get_next_record(SORT_INFO *sort_info)
continue;
}
- if (!sort_info->fix_datafile)
+ if (!sort_param->fix_datafile && sort_param->master)
share->state.split++;
if (! found_record++)
{
- sort_info->find_length=left_length=block_info.rec_len;
- sort_info->start_recpos=pos;
- if (!sort_info->fix_datafile)
- sort_info->filepos=sort_info->start_recpos;
- if (sort_info->fix_datafile && (param->testflag & T_EXTEND))
- sort_info->pos=block_info.filepos+1;
+ sort_param->find_length=left_length=block_info.rec_len;
+ sort_param->start_recpos=pos;
+ if (!sort_param->fix_datafile)
+ sort_param->filepos=sort_param->start_recpos;
+ if (sort_param->fix_datafile && (param->testflag & T_EXTEND))
+ sort_param->pos=block_info.filepos+1;
else
- sort_info->pos=block_info.filepos+block_info.block_len;
+ sort_param->pos=block_info.filepos+block_info.block_len;
if (share->base.blobs)
{
- if (!(to=mi_fix_rec_buff_for_blob(info,block_info.rec_len)))
+ if (!(to=mi_alloc_rec_buff(info,block_info.rec_len,
+ &(sort_param->rec_buff))))
{
mi_check_print_error(param,"Not enough memory for blob at %s",
- llstr(sort_info->start_recpos,llbuff));
+ llstr(sort_param->start_recpos,llbuff));
DBUG_RETURN(1);
}
}
else
- to= info->rec_buff;
+ to= sort_param->rec_buff;
}
if (left_length < block_info.data_len || ! block_info.data_len)
{
mi_check_print_info(param,"Found block with too small length at %s; Skipped",
- llstr(sort_info->start_recpos,llbuff));
+ llstr(sort_param->start_recpos,llbuff));
goto try_next;
}
if (block_info.filepos + block_info.data_len >
- param->read_cache.end_of_file)
+ sort_param->read_cache.end_of_file)
{
mi_check_print_info(param,"Found block that points outside data file at %s",
- llstr(sort_info->start_recpos,llbuff));
+ llstr(sort_param->start_recpos,llbuff));
goto try_next;
}
- if (_mi_read_cache(&param->read_cache,to,block_info.filepos,
+ if (_mi_read_cache(&sort_param->read_cache,to,block_info.filepos,
block_info.data_len,
(found_record == 1 ? READING_NEXT : 0)))
{
@@ -2412,31 +2832,31 @@ static int sort_get_next_record(SORT_INFO *sort_info)
if (pos == HA_OFFSET_ERROR && left_length)
{
mi_check_print_info(param,"Wrong block with wrong total length starting at %s",
- llstr(sort_info->start_recpos,llbuff));
+ llstr(sort_param->start_recpos,llbuff));
goto try_next;
}
- if (pos + MI_BLOCK_INFO_HEADER_LENGTH > param->read_cache.end_of_file)
+ if (pos + MI_BLOCK_INFO_HEADER_LENGTH > sort_param->read_cache.end_of_file)
{
mi_check_print_info(param,"Found link that points at %s (outside data file) at %s",
llstr(pos,llbuff2),
- llstr(sort_info->start_recpos,llbuff));
+ llstr(sort_param->start_recpos,llbuff));
goto try_next;
}
} while (left_length);
- if (_mi_rec_unpack(info,sort_info->record,info->rec_buff,
- sort_info->find_length) != MY_FILE_ERROR)
+ if (_mi_rec_unpack(info,sort_param->record,sort_param->rec_buff,
+ sort_param->find_length) != MY_FILE_ERROR)
{
- if (param->read_cache.error < 0)
+ if (sort_param->read_cache.error < 0)
DBUG_RETURN(1);
if (info->s->calc_checksum)
- info->checksum=mi_checksum(info,sort_info->record);
+ info->checksum=mi_checksum(info,sort_param->record);
if ((param->testflag & (T_EXTEND | T_REP)) || searching)
{
- if (_mi_rec_check(info, sort_info->record))
+ if (_mi_rec_check(info, sort_param->record, sort_param->rec_buff))
{
mi_check_print_info(param,"Found wrong packed record at %s",
- llstr(sort_info->start_recpos,llbuff));
+ llstr(sort_param->start_recpos,llbuff));
goto try_next;
}
}
@@ -2445,32 +2865,33 @@ static int sort_get_next_record(SORT_INFO *sort_info)
DBUG_RETURN(0);
}
if (!searching)
- mi_check_print_info(param,"Found wrong stored record at %s",
- llstr(sort_info->start_recpos,llbuff));
+ mi_check_print_info(param,"Key %d - Found wrong stored record at %s",
+ sort_param->key+1,
+ llstr(sort_param->start_recpos,llbuff));
try_next:
- pos=(sort_info->start_recpos+=MI_DYN_ALIGN_SIZE);
+ pos=(sort_param->start_recpos+=MI_DYN_ALIGN_SIZE);
searching=1;
}
case COMPRESSED_RECORD:
- for (searching=0 ;; searching=1, sort_info->pos++)
+ for (searching=0 ;; searching=1, sort_param->pos++)
{
- if (_mi_read_cache(&param->read_cache,(byte*) block_info.header,
- sort_info->pos,
+ if (_mi_read_cache(&sort_param->read_cache,(byte*) block_info.header,
+ sort_param->pos,
share->pack.ref_length,READING_NEXT))
DBUG_RETURN(-1);
- if (searching && ! sort_info->fix_datafile)
+ if (searching && ! sort_param->fix_datafile)
{
param->error_printed=1;
param->retry_repair=1;
param->testflag|=T_RETRY_WITHOUT_QUICK;
DBUG_RETURN(1); /* Something wrong with data */
}
- sort_info->start_recpos=sort_info->pos;
- if (_mi_pack_get_block_info(info,&block_info,-1,sort_info->pos, NullS))
+ sort_param->start_recpos=sort_param->pos;
+ if (_mi_pack_get_block_info(info,&block_info,-1,sort_param->pos, NullS))
DBUG_RETURN(-1);
if (!block_info.rec_len &&
- sort_info->pos + MEMMAP_EXTRA_MARGIN ==
- param->read_cache.end_of_file)
+ sort_param->pos + MEMMAP_EXTRA_MARGIN ==
+ sort_param->read_cache.end_of_file)
DBUG_RETURN(-1);
if (block_info.rec_len < (uint) share->min_pack_length ||
block_info.rec_len > (uint) share->max_pack_length)
@@ -2478,33 +2899,34 @@ static int sort_get_next_record(SORT_INFO *sort_info)
if (! searching)
mi_check_print_info(param,"Found block with wrong recordlength: %d at %s\n",
block_info.rec_len,
- llstr(sort_info->pos,llbuff));
+ llstr(sort_param->pos,llbuff));
continue;
}
- if (_mi_read_cache(&param->read_cache,(byte*) info->rec_buff,
+ if (_mi_read_cache(&sort_param->read_cache,(byte*) sort_param->rec_buff,
block_info.filepos, block_info.rec_len,
READING_NEXT))
{
if (! searching)
mi_check_print_info(param,"Couldn't read whole record from %s",
- llstr(sort_info->pos,llbuff));
+ llstr(sort_param->pos,llbuff));
continue;
}
- if (_mi_pack_rec_unpack(info,sort_info->record,info->rec_buff,
+ if (_mi_pack_rec_unpack(info,sort_param->record,sort_param->rec_buff,
block_info.rec_len))
{
if (! searching)
mi_check_print_info(param,"Found wrong record at %s",
- llstr(sort_info->pos,llbuff));
+ llstr(sort_param->pos,llbuff));
continue;
}
- info->checksum=mi_checksum(info,sort_info->record);
- if (!sort_info->fix_datafile)
+ info->checksum=mi_checksum(info,sort_param->record);
+ if (!sort_param->fix_datafile)
{
- sort_info->filepos=sort_info->pos;
- share->state.split++;
+ sort_param->filepos=sort_param->pos;
+ if (sort_param->master)
+ share->state.split++;
}
- sort_info->max_pos=(sort_info->pos=block_info.filepos+
+ sort_param->max_pos=(sort_param->pos=block_info.filepos+
block_info.rec_len);
info->packed_length=block_info.rec_len;
if (param->calc_checksum)
@@ -2518,7 +2940,7 @@ static int sort_get_next_record(SORT_INFO *sort_info)
/* Write record to new file */
-int sort_write_record(SORT_INFO *sort_info)
+int sort_write_record(MI_SORT_PARAM *sort_param)
{
int flag;
uint length;
@@ -2526,34 +2948,35 @@ int sort_write_record(SORT_INFO *sort_info)
byte *from;
byte block_buff[8];
MI_INFO *info;
+ SORT_INFO *sort_info=sort_param->sort_info;
MYISAM_SHARE *share;
MI_CHECK *param=sort_info->param;
DBUG_ENTER("sort_write_record");
info=sort_info->info;
share=info->s;
- if (sort_info->fix_datafile)
+ if (sort_param->fix_datafile)
{
switch (sort_info->new_data_file_type) {
case STATIC_RECORD:
- if (my_b_write(&info->rec_cache,sort_info->record,
+ if (my_b_write(&info->rec_cache,sort_param->record,
share->base.pack_reclength))
{
mi_check_print_error(param,"%d when writing to datafile",my_errno);
DBUG_RETURN(1);
}
- sort_info->filepos+=share->base.pack_reclength;
+ sort_param->filepos+=share->base.pack_reclength;
info->s->state.split++;
- /* sort_info->param->glob_crc+=mi_static_checksum(info, sort_info->record); */
+ /* sort_info->param->glob_crc+=mi_static_checksum(info, sort_param->record); */
break;
case DYNAMIC_RECORD:
if (! info->blobs)
- from=info->rec_buff;
+ from=sort_param->rec_buff;
else
{
/* must be sure that local buffer is big enough */
reclength=info->s->base.pack_reclength+
- _my_calc_total_blob_length(info,sort_info->record)+
+ _my_calc_total_blob_length(info,sort_param->record)+
ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+
MI_DYN_DELETE_BLOCK_HEADER;
if (sort_info->buff_length < reclength)
@@ -2566,8 +2989,8 @@ int sort_write_record(SORT_INFO *sort_info)
}
from=sort_info->buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER);
}
- info->checksum=mi_checksum(info,sort_info->record);
- reclength=_mi_rec_pack(info,from,sort_info->record);
+ info->checksum=mi_checksum(info,sort_param->record);
+ reclength=_mi_rec_pack(info,from,sort_param->record);
flag=0;
/* sort_info->param->glob_crc+=info->checksum; */
@@ -2581,13 +3004,13 @@ int sort_write_record(SORT_INFO *sort_info)
if (block_length > MI_MAX_BLOCK_LENGTH)
block_length=MI_MAX_BLOCK_LENGTH;
if (_mi_write_part_record(info,0L,block_length,
- sort_info->filepos+block_length,
+ sort_param->filepos+block_length,
&from,&reclength,&flag))
{
mi_check_print_error(param,"%d when writing to datafile",my_errno);
DBUG_RETURN(1);
}
- sort_info->filepos+=block_length;
+ sort_param->filepos+=block_length;
info->s->state.split++;
} while (reclength);
/* sort_info->param->glob_crc+=info->checksum; */
@@ -2598,23 +3021,26 @@ int sort_write_record(SORT_INFO *sort_info)
if (info->s->base.blobs)
length+=save_pack_length(block_buff+length,info->blob_length);
if (my_b_write(&info->rec_cache,block_buff,length) ||
- my_b_write(&info->rec_cache,(byte*) info->rec_buff,reclength))
+ my_b_write(&info->rec_cache,(byte*) sort_param->rec_buff,reclength))
{
mi_check_print_error(param,"%d when writing to datafile",my_errno);
DBUG_RETURN(1);
}
/* sort_info->param->glob_crc+=info->checksum; */
- sort_info->filepos+=reclength+length;
+ sort_param->filepos+=reclength+length;
info->s->state.split++;
break;
}
}
- info->state->records++;
- if ((param->testflag & T_WRITE_LOOP) &&
- (info->state->records % WRITE_COUNT) == 0)
+ if (sort_param->master)
{
- char llbuff[22];
- printf("%s\r", llstr(info->state->records,llbuff)); VOID(fflush(stdout));
+ info->state->records++;
+ if ((param->testflag & T_WRITE_LOOP) &&
+ (info->state->records % WRITE_COUNT) == 0)
+ {
+ char llbuff[22];
+ printf("%s\r", llstr(info->state->records,llbuff)); VOID(fflush(stdout));
+ }
}
DBUG_RETURN(0);
} /* sort_write_record */
@@ -2622,49 +3048,52 @@ int sort_write_record(SORT_INFO *sort_info)
/* Compare two keys from _create_index_by_sort */
-static int sort_key_cmp(SORT_INFO *sort_info, const void *a, const void *b)
+static int sort_key_cmp(MI_SORT_PARAM *sort_param, const void *a,
+ const void *b)
{
uint not_used;
- return (ha_key_cmp(sort_info->keyseg,*((uchar**) a),*((uchar**) b),
- USE_WHOLE_KEY, SEARCH_SAME,&not_used));
+ return (ha_key_cmp(sort_param->keyinfo->seg, *((uchar**) a), *((uchar**) b),
+ USE_WHOLE_KEY, SEARCH_SAME,&not_used));
} /* sort_key_cmp */
-static int sort_key_write(SORT_INFO *sort_info, const void *a)
+static int sort_key_write(MI_SORT_PARAM *sort_param, const void *a)
{
uint diff_pos;
char llbuff[22],llbuff2[22];
+ SORT_INFO *sort_info=sort_param->sort_info;
MI_CHECK *param= sort_info->param;
int cmp;
if (sort_info->key_block->inited)
{
- cmp=ha_key_cmp(sort_info->keyseg,sort_info->key_block->lastkey,(uchar*) a,
- USE_WHOLE_KEY,SEARCH_FIND | SEARCH_UPDATE ,&diff_pos);
- sort_info->unique[diff_pos-1]++;
+ cmp=ha_key_cmp(sort_param->keyinfo->seg,sort_info->key_block->lastkey,
+ (uchar*) a, USE_WHOLE_KEY,SEARCH_FIND | SEARCH_UPDATE,
+ &diff_pos);
+ sort_param->unique[diff_pos-1]++;
}
else
{
cmp= -1;
}
- if ((sort_info->keyinfo->flag & HA_NOSAME) && cmp == 0)
+ if ((sort_param->keyinfo->flag & HA_NOSAME) && cmp == 0)
{
sort_info->dupp++;
sort_info->info->lastpos=get_record_for_key(sort_info->info,
- sort_info->keyinfo,
- (uchar*) a);
+ sort_parm->keyinfo,
+ (uchar*) a);
mi_check_print_warning(param,
"Duplicate key for record at %10s against record at %10s",
llstr(sort_info->info->lastpos,llbuff),
llstr(get_record_for_key(sort_info->info,
- sort_info->keyinfo,
+ sort_param->keyinfo,
sort_info->key_block->
lastkey),
llbuff2));
param->testflag|=T_RETRY_WITHOUT_QUICK;
if (sort_info->param->testflag & T_VERBOSE)
- _mi_print_key(stdout,sort_info->keyseg,(uchar*) a, USE_WHOLE_KEY);
- return (sort_delete_record(param));
+ _mi_print_key(stdout,sort_param->keyinfo->seg,(uchar*) a, USE_WHOLE_KEY);
+ return (sort_delete_record(sort_param));
}
#ifndef DBUG_OFF
if (cmp > 0)
@@ -2674,8 +3103,8 @@ static int sort_key_write(SORT_INFO *sort_info, const void *a)
return(1);
}
#endif
- return (sort_insert_key(param,sort_info->key_block,(uchar*) a,
- HA_OFFSET_ERROR));
+ return (sort_insert_key(sort_param,sort_info->key_block,
+ (uchar*) a, HA_OFFSET_ERROR));
} /* sort_key_write */
@@ -2690,7 +3119,7 @@ static my_off_t get_record_for_key(MI_INFO *info, MI_KEYDEF *keyinfo,
/* Insert a key in sort-key-blocks */
-static int sort_insert_key(MI_CHECK *param,
+static int sort_insert_key(MI_SORT_PARAM *sort_param,
register SORT_KEY_BLOCKS *key_block, uchar *key,
my_off_t prev_block)
{
@@ -2699,14 +3128,16 @@ static int sort_insert_key(MI_CHECK *param,
uchar *anc_buff,*lastkey;
MI_KEY_PARAM s_temp;
MI_INFO *info;
- SORT_INFO *sort_info= &param->sort_info;
+ MI_KEYDEF *keyinfo=sort_param->keyinfo;
+ SORT_INFO *sort_info= sort_param->sort_info;
+ MI_CHECK *param=sort_info->param;
DBUG_ENTER("sort_insert_key");
anc_buff=key_block->buff;
info=sort_info->info;
lastkey=key_block->lastkey;
nod_flag= (key_block == sort_info->key_block ? 0 :
- sort_info->info->s->base.key_reflength);
+ info->s->base.key_reflength);
if (!key_block->inited)
{
@@ -2727,17 +3158,16 @@ static int sort_insert_key(MI_CHECK *param,
if (nod_flag)
_mi_kpointer(info,key_block->end_pos,prev_block);
- t_length=(*sort_info->keyinfo->pack_key)(sort_info->keyinfo,nod_flag,
- (uchar*) 0,lastkey,lastkey,key,
- &s_temp);
- (*sort_info->keyinfo->store_key)(sort_info->keyinfo,
- key_block->end_pos+nod_flag,&s_temp);
+ t_length=(*keyinfo->pack_key)(keyinfo,nod_flag,
+ (uchar*) 0,lastkey,lastkey,key,
+ &s_temp);
+ (*keyinfo->store_key)(keyinfo, key_block->end_pos+nod_flag,&s_temp);
a_length+=t_length;
mi_putint(anc_buff,a_length,nod_flag);
key_block->end_pos+=t_length;
- if (a_length <= sort_info->keyinfo->block_length)
+ if (a_length <= keyinfo->block_length)
{
- VOID(_mi_move_key(sort_info->keyinfo,key_block->lastkey,key));
+ VOID(_mi_move_key(keyinfo,key_block->lastkey,key));
key_block->last_length=a_length-t_length;
DBUG_RETURN(0);
}
@@ -2745,43 +3175,42 @@ static int sort_insert_key(MI_CHECK *param,
/* Fill block with end-zero and write filled block */
mi_putint(anc_buff,key_block->last_length,nod_flag);
bzero((byte*) anc_buff+key_block->last_length,
- sort_info->keyinfo->block_length- key_block->last_length);
+ keyinfo->block_length- key_block->last_length);
key_file_length=info->state->key_file_length;
- if ((filepos=_mi_new(info,sort_info->keyinfo)) == HA_OFFSET_ERROR)
+ if ((filepos=_mi_new(info,keyinfo)) == HA_OFFSET_ERROR)
DBUG_RETURN(1);
/* If we read the page from the key cache, we have to write it back to it */
if (key_file_length == info->state->key_file_length)
{
- if (_mi_write_keypage(info, sort_info->keyinfo, filepos,
- anc_buff))
+ if (_mi_write_keypage(info, keyinfo, filepos, anc_buff))
DBUG_RETURN(1);
}
else if (my_pwrite(info->s->kfile,(byte*) anc_buff,
- (uint) sort_info->keyinfo->block_length,filepos,
- param->myf_rw))
+ (uint) keyinfo->block_length,filepos, param->myf_rw))
DBUG_RETURN(1);
DBUG_DUMP("buff",(byte*) anc_buff,mi_getint(anc_buff));
/* Write separator-key to block in next level */
- if (sort_insert_key(param,key_block+1,key_block->lastkey,filepos))
+ if (sort_insert_key(sort_param,key_block+1,key_block->lastkey,filepos))
DBUG_RETURN(1);
/* clear old block and write new key in it */
key_block->inited=0;
- DBUG_RETURN(sort_insert_key(param, key_block,key,prev_block));
+ DBUG_RETURN(sort_insert_key(sort_param, key_block,key,prev_block));
} /* sort_insert_key */
/* Delete record when we found a duplicated key */
-static int sort_delete_record(MI_CHECK *param)
+static int sort_delete_record(MI_SORT_PARAM *sort_param)
{
uint i;
int old_file,error;
uchar *key;
- MI_INFO *info;
- SORT_INFO *sort_info= &param->sort_info;
+ SORT_INFO *sort_info=sort_param->sort_info;
+ MI_CHECK *param=sort_info->param;
+ MI_INFO *info=sort_info->info;
DBUG_ENTER("sort_delete_record");
if (!(param->testflag & T_FORCE_UNIQUENESS))
@@ -2790,7 +3219,6 @@ static int sort_delete_record(MI_CHECK *param)
"Quick-recover aborted; Run recovery without switch -q or with switch -qq");
DBUG_RETURN(1);
}
- info=sort_info->info;
if (info->s->options & HA_OPTION_COMPRESS_RECORD)
{
mi_check_print_error(param,
@@ -2800,10 +3228,10 @@ static int sort_delete_record(MI_CHECK *param)
old_file=info->dfile;
info->dfile=info->rec_cache.file;
- if (sort_info->key)
+ if (sort_info->current_key)
{
key=info->lastkey+info->s->base.max_key_length;
- if ((error=(*info->s->read_rnd)(info,sort_info->record,info->lastpos,0)) &&
+ if ((error=(*info->s->read_rnd)(info,sort_param->record,info->lastpos,0)) &&
error != HA_ERR_RECORD_DELETED)
{
mi_check_print_error(param,"Can't read record to be removed");
@@ -2811,9 +3239,9 @@ static int sort_delete_record(MI_CHECK *param)
DBUG_RETURN(1);
}
- for (i=0 ; i < sort_info->key ; i++)
+ for (i=0 ; i < sort_info->current_key ; i++)
{
- uint key_length=_mi_make_key(info,i,key,sort_info->record,info->lastpos);
+ uint key_length=_mi_make_key(info,i,key,sort_param->record,info->lastpos);
if (_mi_ck_delete(info,i,key,key_length))
{
mi_check_print_error(param,"Can't delete key %d from record to be removed",i+1);
@@ -2822,8 +3250,7 @@ static int sort_delete_record(MI_CHECK *param)
}
}
if (param->calc_checksum)
- param->glob_crc-=(*info->s->calc_checksum)(info,
- sort_info->record);
+ param->glob_crc-=(*info->s->calc_checksum)(info, sort_param->record);
}
error=flush_io_cache(&info->rec_cache) || (*info->s->delete_record)(info);
info->dfile=old_file; /* restore actual value */
@@ -2831,20 +3258,20 @@ static int sort_delete_record(MI_CHECK *param)
DBUG_RETURN(error);
} /* sort_delete_record */
-
/* Fix all pending blocks and flush everything to disk */
-int flush_pending_blocks(MI_CHECK *param)
+int flush_pending_blocks(MI_SORT_PARAM *sort_param)
{
uint nod_flag,length;
my_off_t filepos,key_file_length;
- MI_INFO *info;
SORT_KEY_BLOCKS *key_block;
- SORT_INFO *sort_info= &param->sort_info;
+ SORT_INFO *sort_info= sort_param->sort_info;
+ MI_CHECK *param=sort_info->param;
+ MI_INFO *info=sort_info->info;
+ MI_KEYDEF *keyinfo=sort_param->keyinfo;
DBUG_ENTER("flush_pending_blocks");
filepos= HA_OFFSET_ERROR; /* if empty file */
- info=sort_info->info;
nod_flag=0;
for (key_block=sort_info->key_block ; key_block->inited ; key_block++)
{
@@ -2853,30 +3280,26 @@ int flush_pending_blocks(MI_CHECK *param)
if (nod_flag)
_mi_kpointer(info,key_block->end_pos,filepos);
key_file_length=info->state->key_file_length;
- bzero((byte*) key_block->buff+length,
- sort_info->keyinfo->block_length-length);
- if ((filepos=_mi_new(info,sort_info->keyinfo)) == HA_OFFSET_ERROR)
+ bzero((byte*) key_block->buff+length, keyinfo->block_length-length);
+ if ((filepos=_mi_new(info,keyinfo)) == HA_OFFSET_ERROR)
DBUG_RETURN(1);
/* If we read the page from the key cache, we have to write it back */
if (key_file_length == info->state->key_file_length)
{
- if (_mi_write_keypage(info, sort_info->keyinfo, filepos,
- key_block->buff))
+ if (_mi_write_keypage(info, keyinfo, filepos, key_block->buff))
DBUG_RETURN(1);
}
else if (my_pwrite(info->s->kfile,(byte*) key_block->buff,
- (uint) sort_info->keyinfo->block_length,filepos,
- param->myf_rw))
+ (uint) keyinfo->block_length,filepos, param->myf_rw))
DBUG_RETURN(1);
DBUG_DUMP("buff",(byte*) key_block->buff,length);
nod_flag=1;
}
- info->s->state.key_root[sort_info->key]=filepos; /* Last is root for tree */
+ info->s->state.key_root[sort_param->key]=filepos; /* Last is root for tree */
DBUG_RETURN(0);
} /* flush_pending_blocks */
-
/* alloc space and pointers for key_blocks */
static SORT_KEY_BLOCKS *alloc_key_blocks(MI_CHECK *param, uint blocks,
@@ -3086,24 +3509,25 @@ end:
/* write suffix to data file if neaded */
-int write_data_suffix(MI_CHECK *param, MI_INFO *info)
+int write_data_suffix(SORT_INFO *sort_info, my_bool fix_datafile)
{
- if (info->s->options & HA_OPTION_COMPRESS_RECORD &&
- param->sort_info.fix_datafile)
+ MI_INFO *info=sort_info->info;
+
+ if (info->s->options & HA_OPTION_COMPRESS_RECORD && fix_datafile)
{
char buff[MEMMAP_EXTRA_MARGIN];
bzero(buff,sizeof(buff));
if (my_b_write(&info->rec_cache,buff,sizeof(buff)))
{
- mi_check_print_error(param,"%d when writing to datafile",my_errno);
+ mi_check_print_error(sort_info->param,
+ "%d when writing to datafile",my_errno);
return 1;
}
- param->read_cache.end_of_file+=sizeof(buff);
+ sort_info->param->read_cache.end_of_file+=sizeof(buff);
}
return 0;
}
-
/* Update state and myisamchk_time of indexfile */
int update_state_info(MI_CHECK *param, MI_INFO *info,uint update)
@@ -3139,9 +3563,11 @@ int update_state_info(MI_CHECK *param, MI_INFO *info,uint update)
{ /* Force update of status */
int error;
uint r_locks=share->r_locks,w_locks=share->w_locks;
- share->r_locks=share->w_locks=0;
+ share->r_locks= share->w_locks= share->tot_locks= 0;
error=_mi_writeinfo(info,WRITEINFO_NO_UNLOCK);
- share->r_locks=r_locks; share->w_locks=w_locks;
+ share->r_locks=r_locks;
+ share->w_locks=w_locks;
+ share->tot_locks=r_locks+w_locks;
if (!error)
return 0;
}
@@ -3177,15 +3603,15 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
return;
}
if (!(param->testflag & T_SILENT) &&
- !(param->testflag & (T_REP | T_REP_BY_SORT)))
+ !(param->testflag & T_REP))
printf("Updating MyISAM file: %s\n", param->isam_file_name);
/* We have to use keyread here as a normal read uses info->rec_buff */
- mi_extra(info,HA_EXTRA_KEYREAD);
+ mi_extra(info,HA_EXTRA_KEYREAD,0);
if (mi_rlast(info,info->rec_buff, info->s->base.auto_key-1))
{
if (my_errno != HA_ERR_END_OF_FILE)
{
- mi_extra(info,HA_EXTRA_NO_KEYREAD);
+ mi_extra(info,HA_EXTRA_NO_KEYREAD,0);
mi_check_print_error(param,"%d when reading last record",my_errno);
return;
}
@@ -3200,17 +3626,15 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
update_auto_increment(info,info->rec_buff);
set_if_bigger(info->s->state.auto_increment,auto_increment);
}
- mi_extra(info,HA_EXTRA_NO_KEYREAD);
+ mi_extra(info,HA_EXTRA_NO_KEYREAD,0);
update_state_info(param, info, UPDATE_AUTO_INC);
return;
}
/* calculate unique keys for each part key */
-static void update_key_parts(MI_KEYDEF *keyinfo,
- ulong *rec_per_key_part,
- ulonglong *unique,
- ulonglong records)
+void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part,
+ ulonglong *unique, ulonglong records)
{
ulonglong count=0,tmp;
uint parts;
@@ -3250,12 +3674,15 @@ ha_checksum mi_byte_checksum(const byte *buf, uint length)
static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows)
{
+ uint key_maxlength=key->maxlength;
+ if (key->flag & HA_FULLTEXT)
+ key_maxlength+=ft_max_word_len_for_sort-HA_FT_MAXLEN;
return (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) &&
- ((ulonglong) rows * key->maxlength >
+ ((ulonglong) rows * key_maxlength >
(ulonglong) myisam_max_temp_length ||
- (ulonglong) rows * (key->maxlength - key->minlength) / 2 >
+ (ulonglong) rows * (key_maxlength - key->minlength) / 2 >
myisam_max_extra_temp_length ||
- (rows == 0 && (key->maxlength / key->minlength) > 2)));
+ (rows == 0 && (key_maxlength / key->minlength) > 2)));
}
@@ -3285,16 +3712,15 @@ void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows)
even if the temporary file would be quite big!
*/
-my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows,
- ulonglong key_map,
- my_bool force)
+my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows,
+ ulonglong key_map, my_bool force)
{
MYISAM_SHARE *share=info->s;
MI_KEYDEF *key=share->keyinfo;
uint i;
/*
- repair_by_sort only works if we have at least one key. If we don't
+ mi_repair_by_sort only works if we have at least one key. If we don't
have any keys, we should use the normal repair.
*/
if (!key_map)
@@ -3309,10 +3735,10 @@ my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows,
static void
-set_data_file_type(MI_CHECK *param, SORT_INFO *sort_info, MYISAM_SHARE *share)
+set_data_file_type(SORT_INFO *sort_info, MYISAM_SHARE *share)
{
if ((sort_info->new_data_file_type=share->data_file_type) ==
- COMPRESSED_RECORD && param->testflag & T_UNPACK)
+ COMPRESSED_RECORD && sort_info->param->testflag & T_UNPACK)
{
MYISAM_SHARE tmp;
diff --git a/myisam/mi_close.c b/myisam/mi_close.c
index bd8b9aff727..dbaaebb1143 100644
--- a/myisam/mi_close.c
+++ b/myisam/mi_close.c
@@ -29,8 +29,7 @@ int mi_close(register MI_INFO *info)
MYISAM_SHARE *share=info->s;
DBUG_ENTER("mi_close");
DBUG_PRINT("enter",("base: %lx reopen: %u locks: %u",
- info,(uint) share->reopen,
- (uint) (share->w_locks+share->r_locks)));
+ info,(uint) share->reopen, (uint) share->tot_locks));
pthread_mutex_lock(&THR_LOCK_myisam);
if (info->lock_type == F_EXTRA_LCK)
@@ -47,7 +46,10 @@ int mi_close(register MI_INFO *info)
pthread_mutex_lock(&share->intern_lock);
if (share->options & HA_OPTION_READ_ONLY_DATA)
+ {
share->r_locks--;
+ share->tot_locks--;
+ }
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
{
if (end_io_cache(&info->rec_cache))
@@ -58,6 +60,7 @@ int mi_close(register MI_INFO *info)
myisam_open_list=list_delete(myisam_open_list,&info->open_list);
pthread_mutex_unlock(&share->intern_lock);
+ my_free(mi_get_rec_buff_ptr(info, info->rec_buff), MYF(MY_ALLOW_ZERO_PTR));
if (flag)
{
if (share->kfile >= 0 &&
@@ -99,7 +102,6 @@ int mi_close(register MI_INFO *info)
error = my_errno;
myisam_log_command(MI_LOG_CLOSE,info,NULL,0,error);
- my_free((gptr) info->rec_alloc,MYF(MY_ALLOW_ZERO_PTR));
my_free((gptr) info,MYF(0));
if (error)
diff --git a/myisam/mi_create.c b/myisam/mi_create.c
index 13d9443c099..ea26ed373d3 100644
--- a/myisam/mi_create.c
+++ b/myisam/mi_create.c
@@ -230,7 +230,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
if (uniques)
{
max_key_block_length= myisam_block_size;
- max_key_length= MI_UNIQUE_HASH_LENGTH;
+ max_key_length= MI_UNIQUE_HASH_LENGTH;
}
for (i=0, keydef=keydefs ; i < keys ; i++ , keydef++)
@@ -429,6 +429,9 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
uniquedef->key=keys+i;
unique_key_parts+=uniquedef->keysegs;
share.state.key_root[keys+i]= HA_OFFSET_ERROR;
+ tot_length+= (max_rows/(ulong) (((uint) myisam_block_size-5)/
+ ((MI_UNIQUE_HASH_LENGTH + pointer)*2)))*
+ (ulong) myisam_block_size;
}
keys+=uniques; /* Each unique has 1 key */
key_segs+=uniques; /* Each unique has 1 key seg */
@@ -628,8 +631,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
tmp_keydef.block_length= myisam_block_size;
tmp_keydef.keylength= MI_UNIQUE_HASH_LENGTH + pointer;
tmp_keydef.minlength=tmp_keydef.maxlength=tmp_keydef.keylength;
- tmp_keyseg.type= MI_UNIQUE_HASH_TYPE;
- tmp_keyseg.length= MI_UNIQUE_HASH_LENGTH;
+ tmp_keyseg.type= MI_UNIQUE_HASH_TYPE;
+ tmp_keyseg.length= MI_UNIQUE_HASH_LENGTH;
tmp_keyseg.start= offset;
offset+= MI_UNIQUE_HASH_LENGTH;
if (mi_keydef_write(file,&tmp_keydef) ||
@@ -662,13 +665,13 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
#endif
/* Enlarge files */
- if (my_chsize(file,(ulong) share.base.keystart,MYF(0)))
+ if (my_chsize(file,(ulong) share.base.keystart,0,MYF(0)))
goto err;
if (! (flags & HA_DONT_TOUCH_DATA))
{
#ifdef USE_RELOC
- if (my_chsize(dfile,share.base.min_pack_length*ci->reloc_rows,MYF(0)))
+ if (my_chsize(dfile,share.base.min_pack_length*ci->reloc_rows,0,MYF(0)))
goto err;
#endif
errpos=2;
diff --git a/myisam/mi_delete_all.c b/myisam/mi_delete_all.c
index 82cf9e7a406..58f885b63f0 100644
--- a/myisam/mi_delete_all.c
+++ b/myisam/mi_delete_all.c
@@ -50,7 +50,7 @@ int mi_delete_all_rows(MI_INFO *info)
myisam_log_command(MI_LOG_DELETE_ALL,info,(byte*) 0,0,0);
VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
- if (my_chsize(info->dfile, 0, MYF(MY_WME)))
+ if (my_chsize(info->dfile, 0, 0, MYF(MY_WME)))
goto err;
allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(0);
diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c
index b5f5ca7fd33..60e6fc0519a 100644
--- a/myisam/mi_dynrec.c
+++ b/myisam/mi_dynrec.c
@@ -60,10 +60,10 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record)
int error;
ulong reclength,extra;
- extra=ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+
- MI_DYN_DELETE_BLOCK_HEADER+1;
- reclength=info->s->base.pack_reclength+
- _my_calc_total_blob_length(info,record)+ extra;
+ extra= (ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+
+ MI_DYN_DELETE_BLOCK_HEADER+1);
+ reclength= (info->s->base.pack_reclength+
+ _my_calc_total_blob_length(info,record)+ extra);
#ifdef NOT_USED /* We now support big rows */
if (reclength > MI_DYN_MAX_ROW_LENGTH)
{
@@ -91,10 +91,10 @@ int _mi_update_blob_record(MI_INFO *info, my_off_t pos, const byte *record)
int error;
ulong reclength,extra;
- extra=ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+
- MI_DYN_DELETE_BLOCK_HEADER;
- reclength=info->s->base.pack_reclength+
- _my_calc_total_blob_length(info,record)+ extra;
+ extra= (ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+
+ MI_DYN_DELETE_BLOCK_HEADER);
+ reclength= (info->s->base.pack_reclength+
+ _my_calc_total_blob_length(info,record)+ extra);
#ifdef NOT_USED /* We now support big rows */
if (reclength > MI_DYN_MAX_ROW_LENGTH)
{
@@ -724,11 +724,11 @@ uint _mi_rec_pack(MI_INFO *info, register byte *to, register const byte *from)
/*
-** Check if a record was correctly packed. Used only by isamchk
-** Returns 0 if record is ok.
+ Check if a record was correctly packed. Used only by myisamchk
+ Returns 0 if record is ok.
*/
-my_bool _mi_rec_check(MI_INFO *info,const char *record)
+my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff)
{
uint length,new_length,flag,bit,i;
char *pos,*end,*packpos,*to;
@@ -736,7 +736,7 @@ my_bool _mi_rec_check(MI_INFO *info,const char *record)
reg3 MI_COLUMNDEF *rec;
DBUG_ENTER("_mi_rec_check");
- packpos=info->rec_buff; to= info->rec_buff+info->s->base.pack_bits;
+ packpos=rec_buff; to= rec_buff+info->s->base.pack_bits;
rec=info->s->rec;
flag= *packpos; bit=1;
@@ -820,7 +820,7 @@ my_bool _mi_rec_check(MI_INFO *info,const char *record)
to+=length;
}
}
- if (info->packed_length != (uint) (to - info->rec_buff)
+ if (info->packed_length != (uint) (to - rec_buff)
+ test(info->s->calc_checksum) ||
(bit != 1 && (flag & ~(bit - 1))))
goto err;
@@ -1059,7 +1059,8 @@ int _mi_read_dynamic_record(MI_INFO *info, my_off_t filepos, byte *buf)
goto panic;
if (info->s->base.blobs)
{
- if (!(to=mi_fix_rec_buff_for_blob(info,block_info.rec_len)))
+ if (!(to=mi_alloc_rec_buff(info, block_info.rec_len,
+ &info->rec_buff)))
goto err;
}
else
@@ -1090,33 +1091,12 @@ err:
DBUG_RETURN(-1);
}
-
-byte *mi_fix_rec_buff_for_blob(MI_INFO *info, ulong length)
-{
- uint extra;
- if (! info->rec_buff || length > info->alloced_rec_buff_length)
- {
- byte *newptr;
- extra=ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+
- MI_DYN_DELETE_BLOCK_HEADER;
- if (!(newptr=(byte*) my_realloc((gptr) info->rec_alloc,length+extra,
- MYF(MY_ALLOW_ZERO_PTR))))
- return newptr;
- info->rec_alloc=newptr;
- info->rec_buff=newptr+ALIGN_SIZE(MI_DYN_DELETE_BLOCK_HEADER);
- info->alloced_rec_buff_length=length;
- }
- return info->rec_buff;
-}
-
-
/* compare unique constraint between stored rows */
int _mi_cmp_dynamic_unique(MI_INFO *info, MI_UNIQUEDEF *def,
const byte *record, my_off_t pos)
{
- byte *rec_buff,*rec_alloc,*old_record;
- uint alloced_rec_buff_length;
+ byte *rec_buff,*old_record;
int error;
DBUG_ENTER("_mi_cmp_dynamic_unique");
@@ -1125,23 +1105,15 @@ int _mi_cmp_dynamic_unique(MI_INFO *info, MI_UNIQUEDEF *def,
/* Don't let the compare destroy blobs that may be in use */
rec_buff=info->rec_buff;
- rec_alloc=info->rec_alloc;
- alloced_rec_buff_length=info->alloced_rec_buff_length;
if (info->s->base.blobs)
- {
info->rec_buff=0;
- info->rec_alloc=0;
- info->alloced_rec_buff_length=0;
- }
error=_mi_read_dynamic_record(info,pos,old_record);
if (!error)
error=mi_unique_comp(def, record, old_record, def->null_are_equal);
if (info->s->base.blobs)
{
- my_free(info->rec_alloc,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(mi_get_rec_buff_ptr(info, info->rec_buff), MYF(MY_ALLOW_ZERO_PTR));
info->rec_buff=rec_buff;
- info->rec_alloc=rec_alloc;
- info->alloced_rec_buff_length=alloced_rec_buff_length;
}
my_afree(old_record);
DBUG_RETURN(error);
@@ -1275,7 +1247,7 @@ int _mi_read_rnd_dynamic_record(MI_INFO *info, byte *buf,
if (info->lock_type == F_UNLCK)
{
#ifndef UNSAFE_LOCKING
- if (share->r_locks == 0 && share->w_locks == 0)
+ if (share->tot_locks == 0)
{
if (my_lock(share->kfile,F_RDLCK,0L,F_TO_EOF,
MYF(MY_SEEK_NOT_DONE) | info->lock_wait))
@@ -1351,7 +1323,8 @@ int _mi_read_rnd_dynamic_record(MI_INFO *info, byte *buf,
info->lastpos=filepos;
if (share->base.blobs)
{
- if (!(to=mi_fix_rec_buff_for_blob(info,block_info.rec_len)))
+ if (!(to= mi_alloc_rec_buff(info, block_info.rec_len,
+ &info->rec_buff)))
goto err;
}
else
diff --git a/myisam/mi_extra.c b/myisam/mi_extra.c
index 21cd9919ada..519cc5bc2b8 100644
--- a/myisam/mi_extra.c
+++ b/myisam/mi_extra.c
@@ -14,11 +14,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* Extra functions we want to do with a database */
-/* - Set flags for quicker databasehandler */
-/* - Set databasehandler to normal */
-/* - Reset recordpointers as after open database */
-
#include "myisamdef.h"
#ifdef HAVE_MMAP
#include <sys/mman.h>
@@ -27,11 +22,28 @@
#include <errno.h>
#endif
- /* set extra flags for database */
+/*
+ Set options and buffers to optimize table handling
+
+ SYNOPSIS
+ mi_extra()
+ info open table
+ function operation
+ extra_arg Pointer to extra argument (normally pointer to ulong)
+ Used when function is one of:
+ HA_EXTRA_WRITE_CACHE
+ HA_EXTRA_CACHE
+ HA_EXTRA_BULK_INSERT_BEGIN
+ If extra_arg is 0, then the default cache size is used.
+ RETURN VALUES
+ 0 ok
+*/
+
-int mi_extra(MI_INFO *info, enum ha_extra_function function)
+int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
{
int error=0;
+ ulong cache_size;
MYISAM_SHARE *share=info->s;
DBUG_ENTER("mi_extra");
DBUG_PRINT("enter",("function: %d",(int) function));
@@ -103,11 +115,13 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function)
if (!(info->opt_flag &
(READ_CACHE_USED | WRITE_CACHE_USED | MEMMAP_USED)))
{
+ cache_size= (extra_arg ? *(ulong*) extra_arg :
+ my_default_record_cache_size);
if (!(init_io_cache(&info->rec_cache,info->dfile,
(uint) min(info->state->data_file_length+1,
- my_default_record_cache_size),
- READ_CACHE,0L,(pbool) (info->lock_type != F_UNLCK),
- MYF(share->write_flag & MY_WAIT_IF_FULL))))
+ cache_size),
+ READ_CACHE,0L,(pbool) (info->lock_type != F_UNLCK),
+ MYF(share->write_flag & MY_WAIT_IF_FULL))))
{
info->opt_flag|=READ_CACHE_USED;
info->update&= ~HA_STATE_ROW_CHANGED;
@@ -133,10 +147,12 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function)
error=1; /* Not possibly if not locked */
break;
}
+ cache_size= (extra_arg ? *(ulong*) extra_arg :
+ my_default_record_cache_size);
if (!(info->opt_flag &
(READ_CACHE_USED | WRITE_CACHE_USED | OPT_NO_ROWS)) &&
!share->state.header.uniques)
- if (!(init_io_cache(&info->rec_cache,info->dfile,0,
+ if (!(init_io_cache(&info->rec_cache,info->dfile, cache_size,
WRITE_CACHE,info->state->data_file_length,
(pbool) (info->lock_type != F_UNLCK),
MYF(share->write_flag & MY_WAIT_IF_FULL))))
@@ -328,11 +344,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function)
}
}
if (share->base.blobs)
- {
- my_free(info->rec_alloc,MYF(MY_ALLOW_ZERO_PTR));
- info->rec_alloc=info->rec_buff=0;
- mi_fix_rec_buff_for_blob(info,info->s->base.pack_reclength);
- }
+ mi_alloc_rec_buff(info, -1, &info->rec_buff);
break;
case HA_EXTRA_NORMAL: /* Theese isn't in use */
info->quick_mode=0;
@@ -341,7 +353,8 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function)
info->quick_mode=1;
break;
case HA_EXTRA_BULK_INSERT_BEGIN:
- error=_mi_init_bulk_insert(info);
+ error=_mi_init_bulk_insert(info, (extra_arg ? *(ulong*) extra_arg :
+ myisam_bulk_insert_tree_size));
break;
case HA_EXTRA_BULK_INSERT_END:
if (info->bulk_insert)
diff --git a/myisam/mi_key.c b/myisam/mi_key.c
index 067556a3222..00a64bca269 100644
--- a/myisam/mi_key.c
+++ b/myisam/mi_key.c
@@ -259,7 +259,8 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
if (info->blobs && info->s->keyinfo[keynr].flag & HA_VAR_LENGTH_KEY)
{
if (!(blob_ptr=
- mi_fix_rec_buff_for_blob(info, info->s->keyinfo[keynr].keylength)))
+ mi_alloc_rec_buff(info, info->s->keyinfo[keynr].keylength,
+ &info->rec_buff)))
goto err;
}
key=(byte*) info->lastkey;
diff --git a/myisam/mi_locking.c b/myisam/mi_locking.c
index ea4966b05c5..cbde05d31f5 100644
--- a/myisam/mi_locking.c
+++ b/myisam/mi_locking.c
@@ -219,7 +219,7 @@ int mi_lock_database(MI_INFO *info, int lock_type)
/****************************************************************************
-** The following functions are called by thr_lock() in threaded applications
+ The following functions are called by thr_lock() in threaded applications
****************************************************************************/
void mi_get_status(void* param)
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index 458d2d53dfc..b05a8175a6e 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -68,7 +68,7 @@ static MI_INFO *test_if_reopen(char *filename)
MI_INFO *mi_open(const char *name, int mode, uint open_flags)
{
int lock_error,kfile,open_mode,save_errno,have_rtree=0;
- uint i,j,len,errpos,head_length,base_pos,offset,info_length,extra,keys,
+ uint i,j,len,errpos,head_length,base_pos,offset,info_length,keys,
key_parts,unique_key_parts,tmp_length,uniques;
char name_buff[FN_REFLEN], org_name [FN_REFLEN], index_name[FN_REFLEN],
data_name[FN_REFLEN];
@@ -500,6 +500,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
{
info.lock_type=F_RDLCK;
share->r_locks++;
+ share->tot_locks++;
}
if ((open_flags & HA_OPEN_TMP_TABLE) ||
(share->options & HA_OPTION_TMP_TABLE))
@@ -507,6 +508,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
share->temporary=share->delay_key_write=1;
share->write_flag=MYF(MY_NABP);
share->w_locks++; /* We don't have to update status */
+ share->tot_locks++;
info.lock_type=F_WRLCK;
}
if (((open_flags & HA_OPEN_DELAY_KEY_WRITE) ||
@@ -518,20 +520,10 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
/* Allocate buffer for one record */
- extra=0;
- if (share->options & HA_OPTION_PACK_RECORD)
- extra=ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+
- MI_DYN_DELETE_BLOCK_HEADER;
-
- tmp_length=max(share->base.pack_reclength,share->base.max_key_length);
- info.alloced_rec_buff_length=tmp_length;
- if (!(info.rec_alloc=(byte*) my_malloc(tmp_length+extra+8,
- MYF(MY_WME | MY_ZEROFILL))))
+ /* prerequisites: bzero(info) && info->s=share; are met. */
+ if (!mi_alloc_rec_buff(&info, -1, &info.rec_buff))
goto err;
- if (extra)
- info.rec_buff=info.rec_alloc+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER);
- else
- info.rec_buff=info.rec_alloc;
+ bzero(info.rec_buff, mi_get_rec_buff_len(&info, info.rec_buff));
*m_info=info;
#ifdef THREAD
@@ -581,6 +573,32 @@ err:
DBUG_RETURN (NULL);
} /* mi_open */
+byte *mi_alloc_rec_buff(MI_INFO *info, ulong length, byte **buf)
+{
+ uint extra;
+
+ if (! *buf || length > mi_get_rec_buff_len(info, *buf))
+ {
+ byte *newptr = *buf;
+
+ /* to simplify initial init of info->rec_buf in mi_open and mi_extra */
+ if (length == (ulong) -1)
+ length= max(info->s->base.pack_reclength,info->s->base.max_key_length);
+
+ extra= ((info->s->options & HA_OPTION_PACK_RECORD) ?
+ ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+
+ MI_REC_BUFF_OFFSET : 0);
+ if (extra && newptr)
+ newptr-=MI_REC_BUFF_OFFSET;
+ if (!(newptr=(byte*) my_realloc((gptr)newptr, length+extra+8,
+ MYF(MY_ALLOW_ZERO_PTR))))
+ return newptr;
+ *((uint *)newptr)=length;
+ *buf= newptr+(extra ? MI_REC_BUFF_OFFSET : 0);
+ }
+ return *buf;
+}
+
ulonglong mi_safe_mul(ulonglong a, ulonglong b)
{
diff --git a/myisam/mi_packrec.c b/myisam/mi_packrec.c
index d067fdc0fc5..818788a5e74 100644
--- a/myisam/mi_packrec.c
+++ b/myisam/mi_packrec.c
@@ -1057,7 +1057,8 @@ uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BLOCK_INFO *info, File file,
info->blob_len=uint3korr(header+head_length+1);
head_length+=4;
}
- if (!(mi_fix_rec_buff_for_blob(myisam,info->rec_len + info->blob_len)))
+ if (!(mi_alloc_rec_buff(myisam,info->rec_len + info->blob_len,
+ &myisam->rec_buff)))
return BLOCK_FATAL_ERROR; /* not enough memory */
myisam->bit_buff.blob_pos=(uchar*) myisam->rec_buff+info->rec_len;
myisam->blob_length=info->blob_len;
@@ -1231,8 +1232,9 @@ static uchar *_mi_mempack_get_block_info(MI_INFO *myisam,MI_BLOCK_INFO *info,
info->blob_len=uint3korr(header+1);
header+=4;
}
- /* mi_fix_rec_buff_for_blob sets my_errno on error */
- if (!(mi_fix_rec_buff_for_blob(myisam,info->blob_len)))
+ /* mi_alloc_rec_buff sets my_errno on error */
+ if (!(mi_alloc_rec_buff(myisam, info->blob_len,
+ &myisam->rec_buff)))
return 0; /* not enough memory */
myisam->bit_buff.blob_pos=(uchar*) myisam->rec_buff;
}
diff --git a/myisam/mi_static.c b/myisam/mi_static.c
index 660898f4b91..57683a36920 100644
--- a/myisam/mi_static.c
+++ b/myisam/mi_static.c
@@ -42,8 +42,10 @@ my_off_t myisam_max_extra_temp_length= MI_MAX_TEMP_LENGTH;
my_off_t myisam_max_temp_length= MAX_FILE_SIZE;
ulong myisam_bulk_insert_tree_size=8192*1024;
-/* read_vec[] is used for converting between P_READ_KEY.. and SEARCH_ */
-/* Position is , == , >= , <= , > , < */
+/*
+ read_vec[] is used for converting between P_READ_KEY.. and SEARCH_
+ Position is , == , >= , <= , > , <
+*/
uint NEAR myisam_read_vec[]=
{
diff --git a/myisam/mi_statrec.c b/myisam/mi_statrec.c
index ad00b6d2595..9afebce2ae6 100644
--- a/myisam/mi_statrec.c
+++ b/myisam/mi_statrec.c
@@ -239,7 +239,7 @@ int _mi_read_rnd_static_record(MI_INFO *info, byte *buf,
{ /* We don't nead new info */
#ifndef UNSAFE_LOCKING
if ((! cache_read || share->base.reclength > cache_length) &&
- share->r_locks == 0 && share->w_locks == 0)
+ share->tot_locks == 0)
{ /* record not in cache */
if (my_lock(share->kfile,F_RDLCK,0L,F_TO_EOF,
MYF(MY_SEEK_NOT_DONE) | info->lock_wait))
diff --git a/myisam/mi_test1.c b/myisam/mi_test1.c
index 88cbbb39663..1c2b3f13baa 100644
--- a/myisam/mi_test1.c
+++ b/myisam/mi_test1.c
@@ -50,7 +50,7 @@ int main(int argc,char *argv[])
MY_INIT(argv[0]);
my_init();
if (key_cacheing)
- init_key_cache(IO_SIZE*16,(uint) IO_SIZE*4*10);
+ init_key_cache(IO_SIZE*16);
get_options(argc,argv);
exit(run_test("test1"));
diff --git a/myisam/mi_test2.c b/myisam/mi_test2.c
index a4c813b718b..b5da87355c6 100644
--- a/myisam/mi_test2.c
+++ b/myisam/mi_test2.c
@@ -214,13 +214,13 @@ int main(int argc, char *argv[])
if (!silent)
printf("- Writing key:s\n");
if (key_cacheing)
- init_key_cache(key_cache_size,(uint) IO_SIZE*4*10); /* Use a small cache */
+ init_key_cache(key_cache_size); /* Use a small cache */
if (locking)
mi_lock_database(file,F_WRLCK);
if (write_cacheing)
- mi_extra(file,HA_EXTRA_WRITE_CACHE);
+ mi_extra(file,HA_EXTRA_WRITE_CACHE,0);
if (opt_quick_mode)
- mi_extra(file,HA_EXTRA_QUICK);
+ mi_extra(file,HA_EXTRA_QUICK,0);
for (i=0 ; i < recant ; i++)
{
@@ -267,11 +267,15 @@ int main(int argc, char *argv[])
if (testflag==1) goto end;
if (write_cacheing)
- if (mi_extra(file,HA_EXTRA_NO_CACHE))
+ {
+ if (mi_extra(file,HA_EXTRA_NO_CACHE,0))
{
puts("got error from mi_extra(HA_EXTRA_NO_CACHE)");
goto end;
}
+ if (key_cacheing)
+ resize_key_cache(key_cache_size*2);
+ }
if (!silent)
printf("- Delete\n");
@@ -347,13 +351,19 @@ int main(int argc, char *argv[])
}
}
}
- if (testflag==3) goto end;
+ if (testflag == 3)
+ goto end;
for (i=999, dupp_keys=j=0 ; i>0 ; i--)
{
- if (key1[i] > dupp_keys) { dupp_keys=key1[i]; j=i; }
+ if (key1[i] > dupp_keys)
+ {
+ dupp_keys=key1[i]; j=i;
+ }
}
sprintf(key,"%6d",j);
+ start=keyinfo[0].seg[0].start;
+ length=keyinfo[0].seg[0].length;
if (dupp_keys)
{
if (!silent)
@@ -361,8 +371,10 @@ int main(int argc, char *argv[])
DBUG_PRINT("progpos",("first - next -> last - prev -> first"));
if (verbose) printf(" Using key: \"%s\" Keys: %d\n",key,dupp_keys);
- if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT)) goto err;
- if (mi_rsame(file,read_record2,-1)) goto err;
+ if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT))
+ goto err;
+ if (mi_rsame(file,read_record2,-1))
+ goto err;
if (memcmp(read_record,read_record2,reclength) != 0)
{
printf("mi_rsame didn't find same record\n");
@@ -387,7 +399,6 @@ int main(int argc, char *argv[])
}
}
ant=1;
- start=keyinfo[0].seg[0].start; length=keyinfo[0].seg[0].length;
while (mi_rnext(file,read_record2,0) == 0 &&
memcmp(read_record2+start,key,length) == 0) ant++;
if (ant != dupp_keys)
@@ -676,7 +687,7 @@ int main(int argc, char *argv[])
if (!silent)
printf("- mi_extra(CACHE) + mi_rrnd.... + mi_extra(NO_CACHE)\n");
- if (mi_extra(file,HA_EXTRA_RESET) || mi_extra(file,HA_EXTRA_CACHE))
+ if (mi_extra(file,HA_EXTRA_RESET,0) || mi_extra(file,HA_EXTRA_CACHE,0))
{
if (locking || (!use_blob && !pack_fields))
{
@@ -694,7 +705,7 @@ int main(int argc, char *argv[])
ant,write_count-opt_delete);
goto end;
}
- if (mi_extra(file,HA_EXTRA_NO_CACHE))
+ if (mi_extra(file,HA_EXTRA_NO_CACHE,0))
{
puts("got error from mi_extra(HA_EXTRA_NO_CACHE)");
goto end;
@@ -719,7 +730,7 @@ int main(int argc, char *argv[])
DBUG_PRINT("progpos",("Removing keys"));
lastpos = HA_OFFSET_ERROR;
/* DBUG_POP(); */
- mi_extra(file,HA_EXTRA_RESET);
+ mi_extra(file,HA_EXTRA_RESET,0);
found_parts=0;
while ((error=mi_rrnd(file,read_record,HA_OFFSET_ERROR)) !=
HA_ERR_END_OF_FILE)
@@ -790,8 +801,10 @@ end:
printf("myisam_block_size: %u\n", myisam_block_size);
if (key_cacheing)
{
- puts("Key cacheing used");
+ puts("Key cache used");
printf("key_cache_block_size: %u\n", key_cache_block_size);
+ if (write_cacheing)
+ puts("Key cache resized");
}
if (write_cacheing)
puts("Write cacheing used");
diff --git a/myisam/mi_test3.c b/myisam/mi_test3.c
index 405345259cb..c2cee12978e 100644
--- a/myisam/mi_test3.c
+++ b/myisam/mi_test3.c
@@ -175,7 +175,7 @@ void start_test(int id)
exit(1);
}
if (key_cacheing && rnd(2) == 0)
- init_key_cache(65536L,(uint) IO_SIZE*4*10);
+ init_key_cache(65536L);
printf("Process %d, pid: %d\n",id,getpid()); fflush(stdout);
for (error=i=0 ; i < tests && !error; i++)
@@ -304,7 +304,7 @@ int test_rrnd(MI_INFO *file,int id)
return 1;
}
if (rnd(2) == 0)
- mi_extra(file,HA_EXTRA_CACHE);
+ mi_extra(file,HA_EXTRA_CACHE,0);
}
count=0;
@@ -325,7 +325,7 @@ int test_rrnd(MI_INFO *file,int id)
end:
if (lock)
{
- mi_extra(file,HA_EXTRA_NO_CACHE);
+ mi_extra(file,HA_EXTRA_NO_CACHE,0);
if (mi_lock_database(file,F_UNLCK))
{
fprintf(stderr,"%2d: Can't unlock table\n",id);
@@ -357,7 +357,7 @@ int test_write(MI_INFO *file,int id,int lock_type)
return 1;
}
if (rnd(2) == 0)
- mi_extra(file,HA_EXTRA_WRITE_CACHE);
+ mi_extra(file,HA_EXTRA_WRITE_CACHE,0);
}
sprintf(record.id,"%7d",getpid());
@@ -382,7 +382,7 @@ int test_write(MI_INFO *file,int id,int lock_type)
}
if (lock)
{
- mi_extra(file,HA_EXTRA_NO_CACHE);
+ mi_extra(file,HA_EXTRA_NO_CACHE,0);
if (mi_lock_database(file,F_UNLCK))
{
fprintf(stderr,"%2d: Can't unlock table\n",id);
diff --git a/myisam/mi_unique.c b/myisam/mi_unique.c
index 7afaabfe75b..2101c656324 100644
--- a/myisam/mi_unique.c
+++ b/myisam/mi_unique.c
@@ -179,27 +179,19 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const byte *a, const byte *b,
memcpy_fixed((byte*) &pos_a,pos_a+keyseg->bit_start,sizeof(char*));
memcpy_fixed((byte*) &pos_b,pos_b+keyseg->bit_start,sizeof(char*));
}
- end= pos_a+length;
if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT)
{
- if (use_strcoll(keyseg->charset))
- {
- if (my_strnncoll(keyseg->charset,pos_a,length,pos_b,length))
+ if (mi_compare_text(keyseg->charset, (uchar *) pos_a, length,
+ (uchar *) pos_b, length, 0))
return 1;
- }
- else
- {
- uchar *sort_order=keyseg->charset->sort_order;
- while (pos_a != end)
- if (sort_order[*(uchar*) pos_a++] !=
- sort_order[*(uchar*) pos_b++])
- return 1;
- }
}
else
+ {
+ end= pos_a+length;
while (pos_a != end)
if (*pos_a++ != *pos_b++)
return 1;
+ }
}
return 0;
}
diff --git a/myisam/mi_update.c b/myisam/mi_update.c
index ebf45316eb6..81142ecabac 100644
--- a/myisam/mi_update.c
+++ b/myisam/mi_update.c
@@ -86,8 +86,6 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
/* Check which keys changed from the original row */
new_key=info->lastkey2;
- key_changed=HA_STATE_KEY_CHANGED; /* We changed current database */
- /* Remove key that didn't change */
changed=0;
for (i=0 ; i < share->base.keys ; i++)
{
@@ -96,7 +94,7 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
/* The following code block is for text searching by SerG */
if (share->keyinfo[i].flag & HA_FULLTEXT )
{
- if(_mi_ft_cmp(info,i,oldrec, newrec))
+ if (_mi_ft_cmp(info,i,oldrec, newrec))
{
if ((int) i == info->lastinx)
key_changed|=HA_STATE_WRITTEN;
@@ -124,11 +122,28 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
}
}
}
+ /*
+ If we are running with external locking, we must update the index file
+ that something has changed
+ */
+ if (changed || !my_disable_locking)
+ key_changed|= HA_STATE_KEY_CHANGED;
if (share->calc_checksum)
+ {
info->checksum=(*share->calc_checksum)(info,newrec);
- if ((*share->update_record)(info,pos,newrec))
- goto err;
+ key_changed|= HA_STATE_KEY_CHANGED; /* Must update index file */
+ }
+ {
+ /* Don't update index file if data file is not extended */
+ MI_STATUS_INFO state;
+ memcpy((char*) &state, (char*) info->state, sizeof(state));
+ if ((*share->update_record)(info,pos,newrec))
+ goto err;
+ if (!key_changed &&
+ memcmp((char*) &state, (char*) info->state, sizeof(state)))
+ key_changed|= HA_STATE_KEY_CHANGED; /* Must update index file */
+ }
if (auto_key_changed)
update_auto_increment(info,newrec);
if (share->calc_checksum)
@@ -150,6 +165,8 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
err:
DBUG_PRINT("error",("key: %d errno: %d",i,my_errno));
save_errno=my_errno;
+ if (changed)
+ key_changed|= HA_STATE_KEY_CHANGED;
if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL)
{
info->errkey= (int) i;
diff --git a/myisam/mi_write.c b/myisam/mi_write.c
index d78a5a1425a..5d22ebfe5b5 100644
--- a/myisam/mi_write.c
+++ b/myisam/mi_write.c
@@ -105,7 +105,7 @@ int mi_write(MI_INFO *info, byte *record)
{
bool local_lock_tree= (lock_tree &&
!(info->bulk_insert &&
- is_tree_inited(& info->bulk_insert[i])));
+ is_tree_inited(&info->bulk_insert[i])));
if (local_lock_tree)
{
rw_wrlock(&share->key_root_lock[i]);
@@ -170,9 +170,9 @@ err:
uint j;
for (j=0 ; j < share->base.keys ; j++)
{
- if (is_tree_inited(& info->bulk_insert[j]))
+ if (is_tree_inited(&info->bulk_insert[j]))
{
- reset_tree(& info->bulk_insert[j]);
+ reset_tree(&info->bulk_insert[j]);
}
}
}
@@ -183,7 +183,7 @@ err:
{
bool local_lock_tree= (lock_tree &&
!(info->bulk_insert &&
- is_tree_inited(& info->bulk_insert[i])));
+ is_tree_inited(&info->bulk_insert[i])));
if (local_lock_tree)
rw_wrlock(&share->key_root_lock[i]);
if (share->keyinfo[i].flag & HA_FULLTEXT)
@@ -229,7 +229,7 @@ int _mi_ck_write(MI_INFO *info, uint keynr, uchar *key, uint key_length)
{
DBUG_ENTER("_mi_ck_write");
- if (info->bulk_insert && is_tree_inited(& info->bulk_insert[keynr]))
+ if (info->bulk_insert && is_tree_inited(&info->bulk_insert[keynr]))
{
DBUG_RETURN(_mi_ck_write_tree(info, keynr, key, key_length));
}
@@ -752,7 +752,7 @@ int _mi_ck_write_tree(register MI_INFO *info, uint keynr, uchar *key,
int error;
DBUG_ENTER("_mi_ck_write_tree");
- error= tree_insert(& info->bulk_insert[keynr], key,
+ error= tree_insert(&info->bulk_insert[keynr], key,
key_length + info->s->rec_reflength,
info->bulk_insert[keynr].custom_arg) ? 0 : HA_ERR_OUT_OF_MEM ;
@@ -804,7 +804,7 @@ static int keys_free(uchar *key, TREE_FREE mode, bulk_insert_param *param)
}
-int _mi_init_bulk_insert(MI_INFO *info)
+int _mi_init_bulk_insert(MI_INFO *info, ulong cache_size)
{
MYISAM_SHARE *share=info->s;
MI_KEYDEF *key=share->keyinfo;
@@ -812,6 +812,7 @@ int _mi_init_bulk_insert(MI_INFO *info)
uint i, num_keys;
ulonglong key_map=0;
DBUG_ENTER("_mi_init_bulk_insert");
+ DBUG_PRINT("enter",("cache_size: %lu", cache_size));
if (info->bulk_insert)
DBUG_RETURN(0);
@@ -826,7 +827,8 @@ int _mi_init_bulk_insert(MI_INFO *info)
}
}
- if (num_keys==0 || num_keys > myisam_bulk_insert_tree_size)
+ if (num_keys==0 ||
+ num_keys * MI_MIN_SIZE_BULK_INSERT_TREE > cache_size)
DBUG_RETURN(0);
info->bulk_insert=(TREE *)
@@ -844,8 +846,8 @@ int _mi_init_bulk_insert(MI_INFO *info)
params->info=info;
params->keynr=i;
init_tree(&info->bulk_insert[i],
- myisam_bulk_insert_tree_size / num_keys / 4 + 10,
- myisam_bulk_insert_tree_size / num_keys, 0,
+ cache_size / num_keys / 4 + 10,
+ cache_size / num_keys, 0,
(qsort_cmp2)keys_compare, 0,
(tree_element_free) keys_free, (void *)params++);
}
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index ca0ec824cda..8cefd0d5ac1 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -14,14 +14,13 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* Descript, check and repair of ISAM tables */
+/* Describe, check and repair of MyISAM tables */
#include "fulltext.h"
#include <m_ctype.h>
#include <stdarg.h>
#include <my_getopt.h>
-#include <assert.h>
#ifdef HAVE_SYS_VADVICE_H
#include <sys/vadvise.h>
#endif
@@ -70,12 +69,11 @@ static void print_version(void);
static void usage(void);
static int myisamchk(MI_CHECK *param, char *filename);
static void descript(MI_CHECK *param, register MI_INFO *info, my_string name);
-static int mi_sort_records(MI_CHECK *param,
- register MI_INFO *info, my_string name,
- uint sort_key,
- my_bool write_info,
- my_bool update_index);
-static int sort_record_index(MI_CHECK *param,MI_INFO *info,MI_KEYDEF *keyinfo,
+static int mi_sort_records(MI_CHECK *param, register MI_INFO *info,
+ my_string name, uint sort_key,
+ my_bool write_info, my_bool update_index);
+static int sort_record_index(MI_SORT_PARAM *sort_param,MI_INFO *info,
+ MI_KEYDEF *keyinfo,
my_off_t page,uchar *buff,uint sortkey,
File new_file, my_bool update_index);
@@ -101,12 +99,13 @@ int main(int argc, char **argv)
while (--argc >= 0)
{
int new_error=myisamchk(&check_param, *(argv++));
+ if ((check_param.testflag & T_REP_ANY) != T_REP)
+ check_param.testflag&= ~T_REP;
VOID(fflush(stdout));
VOID(fflush(stderr));
if ((check_param.error_printed | check_param.warning_printed) &&
(check_param.testflag & T_FORCE_CREATE) &&
- (!(check_param.testflag & (T_REP | T_REP_BY_SORT | T_SORT_RECORDS |
- T_SORT_INDEX))))
+ (!(check_param.testflag & (T_REP | T_SORT_RECORDS | T_SORT_INDEX))))
{
uint old_testflag=check_param.testflag;
if (!(check_param.testflag & T_REP))
@@ -153,124 +152,151 @@ enum options {
static struct my_option my_long_options[] =
{
{"analyze", 'a',
- "Analyze distribution of keys. Will make some joins in MySQL faster. You can check the calculated distribution.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
- 0, 0, 0, 0},
- {"block-search", 'b', "No help available.", 0, 0, 0, GET_ULONG, REQUIRED_ARG,
- 0, 0, 0, 0, 0, 0},
- {"backup", 'B', "Make a backup of the .MYD file as 'filename-time.BAK'", 0,
- 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ "Analyze distribution of keys. Will make some joins in MySQL faster. You can check the calculated distribution.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"block-search", 'b',
+ "No help available.",
+ 0, 0, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"backup", 'B',
+ "Make a backup of the .MYD file as 'filename-time.BAK'",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (gptr*) &set_charset_name, 0, 0,
- GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"check", 'c', "Check table for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
- 0, 0, 0, 0},
+ "Directory where character sets are.",
+ (gptr*) &set_charset_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"check", 'c',
+ "Check table for errors.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"check-only-changed", 'C',
- "Check only tables that have changed since last check.", 0, 0, 0, GET_NO_ARG,
- NO_ARG, 0, 0, 0, 0, 0, 0},
+ "Check only tables that have changed since last check.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"correct-checksum", OPT_CORRECT_CHECKSUM,
- "Correct checksum information for table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
- 0, 0, 0, 0, 0},
+ "Correct checksum information for table.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DBUG_OFF
- {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0,
- GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug", '#',
+ "Output debug log. Often this is 'd:t:o,filename'.",
+ 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"description", 'd', "Prints some information about table.", 0, 0, 0,
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"description", 'd',
+ "Prints some information about table.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"data-file-length", 'D',
"Max length of data file (when recreating data-file when it's full).",
(gptr*) &check_param.max_data_file_length,
- (gptr*) &check_param.max_data_file_length, 0, GET_LL, REQUIRED_ARG,
- 0, 0, 0, 0, 0, 0},
+ (gptr*) &check_param.max_data_file_length,
+ 0, GET_LL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"extend-check", 'e',
- "Try to recover every possible row from the data file. Normally this will also find a lot of garbage rows; Don't use this option if you are not totally desperate.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"fast", 'F', "Check only tables that haven't been closed properly.", 0, 0, 0,
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ "Try to recover every possible row from the data file. Normally this will also find a lot of garbage rows; Don't use this option if you are not totally desperate.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"fast", 'F',
+ "Check only tables that haven't been closed properly.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"force", 'f',
- "Restart with -r if there are any errors in the table. States will be updated as with --update-state.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0,
- 0},
- {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
- 0, 0, 0, 0, 0},
+ "Restart with -r if there are any errors in the table. States will be updated as with --update-state.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"HELP", 'H',
+ "Display this help and exit.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"help", '?',
+ "Display this help and exit.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"information", 'i',
- "Print statistics information about table that is checked.", 0, 0, 0,
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ "Print statistics information about table that is checked.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"keys-used", 'k',
"Tell MyISAM to update only some specific keys. # is a bit mask of which keys to use. This can be used to get faster inserts!",
- (gptr*) &check_param.keys_in_use, (gptr*) &check_param.keys_in_use, 0,
- GET_ULL, REQUIRED_ARG, -1, 0, 0, 0, 0, 0},
+ (gptr*) &check_param.keys_in_use,
+ (gptr*) &check_param.keys_in_use,
+ 0, GET_ULL, REQUIRED_ARG, -1, 0, 0, 0, 0, 0},
{"medium-check", 'm',
- "Faster than extended-check, but only finds 99.99% of all errors. Should be good enough for most cases.",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"quick", 'q', "Faster repair by not modifying the data file.", 0, 0, 0,
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"read-only", 'T', "Don't mark table as checked.", 0, 0, 0, GET_NO_ARG,
- NO_ARG, 0, 0, 0, 0, 0, 0},
+ "Faster than extend-check, but only finds 99.99% of all errors. Should be good enough for most cases.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"quick", 'q', "Faster repair by not modifying the data file.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"read-only", 'T',
+ "Don't mark table as checked.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"recover", 'r',
- "Can fix almost anything except unique keys that aren't unique.", 0, 0, 0,
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ "Can fix almost anything except unique keys that aren't unique.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"parallel-recover", 'p',
+ "Same as '-r' but creates all the keys in parallel",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"safe-recover", 'o',
- "Uses old recovery method; Slower than '-r' but can handle a couple of cases where '-r' reports that it can't fix the data file.", 0, 0, 0, GET_NO_ARG,
- NO_ARG, 0, 0, 0, 0, 0, 0},
- {"start-check-pos", OPT_START_CHECK_POS, "No help available.", 0, 0, 0,
- GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Uses old recovery method; Slower than '-r' but can handle a couple of cases where '-r' reports that it can't fix the data file.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"sort-recover", 'n',
+ "Force recovering with sorting even if the temporary file was very big.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+#ifdef DEBUG
+ {"start-check-pos", OPT_START_CHECK_POS,
+ "No help available.",
+ 0, 0, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+#endif
{"set-auto-increment", 'A',
- "Force auto_increment to start at this or higher value. If no value is given, then sets the next auto_increment value to the highest used value for the auto key + 1.", (gptr*) &check_param.auto_increment_value,
- (gptr*) &check_param.auto_increment_value, 0, GET_ULL, OPT_ARG, 0, 0, 0,
- 0, 0, 0},
+ "Force auto_increment to start at this or higher value. If no value is given, then sets the next auto_increment value to the highest used value for the auto key + 1.",
+ (gptr*) &check_param.auto_increment_value,
+ (gptr*) &check_param.auto_increment_value,
+ 0, GET_ULL, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"set-character-set", OPT_SET_CHARSET,
- "Change the character set used by the index", 0, 0, 0, GET_STR,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Change the character set used by the index",
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"set-variable", 'O',
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"silent", 's',
- "Only print errors. One can use two -s to make myisamchk very silent.", 0,
- 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ "Only print errors. One can use two -s to make myisamchk very silent.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"sort-index", 'S',
- "Sort index blocks. This speeds up 'read-next' in applications.", 0, 0, 0,
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ "Sort index blocks. This speeds up 'read-next' in applications.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"sort-records", 'R',
"Sort records according to an index. This makes your data much more localized and may speed up things. (It may be VERY slow to do a sort the first time!)",
- (gptr*) &check_param.opt_sort_key, (gptr*) &check_param.opt_sort_key, 0,
- GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"sort-recover", 'n',
- "Force recovering with sorting even if the temporary file was very big.",
+ (gptr*) &check_param.opt_sort_key,
+ (gptr*) &check_param.opt_sort_key,
+ 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"tmpdir", 't',
+ "Path for temporary files.",
+ (gptr*) &check_param.tmpdir,
+ 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"update-state", 'U',
+ "Mark tables as crashed if any errors were found.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"unpack", 'u',
+ "Unpack file packed with myisampack.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"tmpdir", 't', "Path for temporary files.",
- (gptr*) &check_param.tmpdir, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"update-state", 'U', "Mark tables as crashed if any errors were found.", 0,
- 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"unpack", 'u', "Unpack file packed with myisampack.", 0, 0, 0, GET_NO_ARG,
- NO_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v',
- "Print more information. This can be used with --describe and --check. Use many -v for more verbosity!", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0,
- 0},
- {"version", 'V', "Print version and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
- 0, 0, 0, 0, 0},
- {"wait", 'w', "Wait if table is locked.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
- 0, 0, 0, 0},
+ "Print more information. This can be used with --description and --check. Use many -v for more verbosity!",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"version", 'V',
+ "Print version and exit.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"wait", 'w',
+ "Wait if table is locked.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{ "key_buffer_size", OPT_KEY_BUFFER_SIZE, "",
(gptr*) &check_param.use_buffers, (gptr*) &check_param.use_buffers, 0,
GET_ULONG, REQUIRED_ARG, (long) USE_BUFFER_INIT, (long) MALLOC_OVERHEAD,
- (long) ~0L, (long) MALLOC_OVERHEAD, (long) IO_SIZE, 0},
+ (long) ~0L, (long) MALLOC_OVERHEAD, (long) IO_SIZE, 0},
{ "myisam_block_size", OPT_MYISAM_BLOCK_SIZE, "",
(gptr*) &opt_myisam_block_size, (gptr*) &opt_myisam_block_size, 0,
- GET_LONG, REQUIRED_ARG, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH,
- MI_MAX_KEY_BLOCK_LENGTH, 0, MI_MIN_KEY_BLOCK_LENGTH, 0},
+ GET_LONG, REQUIRED_ARG, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH,
+ MI_MAX_KEY_BLOCK_LENGTH, 0, MI_MIN_KEY_BLOCK_LENGTH, 0},
{ "read_buffer_size", OPT_READ_BUFFER_SIZE, "",
(gptr*) &check_param.read_buffer_length,
(gptr*) &check_param.read_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
(long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD,
- (long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
+ (long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
{ "write_buffer_size", OPT_WRITE_BUFFER_SIZE, "",
(gptr*) &check_param.write_buffer_length,
- (gptr*) &check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
+ (gptr*) &check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
(long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD,
- (long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
+ (long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
{ "sort_buffer_size", OPT_SORT_BUFFER_SIZE, "",
- (gptr*) &check_param.sort_buffer_length,
+ (gptr*) &check_param.sort_buffer_length,
(gptr*) &check_param.sort_buffer_length, 0, GET_ULONG, REQUIRED_ARG,
(long) SORT_BUFFER_INIT, (long) (MIN_SORT_BUFFER + MALLOC_OVERHEAD),
- (long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
+ (long) ~0L, (long) MALLOC_OVERHEAD, (long) 1L, 0},
{ "sort_key_blocks", OPT_SORT_KEY_BLOCKS, "",
(gptr*) &check_param.sort_key_blocks,
(gptr*) &check_param.sort_key_blocks, 0, GET_ULONG, REQUIRED_ARG,
@@ -306,16 +332,22 @@ static void usage(void)
puts("Used without options all tables on the command will be checked for errors");
printf("Usage: %s [OPTIONS] tables[.MYI]\n", my_progname);
puts("\nGlobal options:\n\
- -#, --debug=... Output debug log. Often this is 'd:t:o,filename`\n\
+ -#, --debug=... Output debug log. Often this is 'd:t:o,filename'\n\
-?, --help Display this help and exit.\n\
-O, --set-variable var=option\n\
- Change the value of a variable.\n\
+ Change the value of a variable. Please note that\n\
+ this option is deprecated; you can set variables\n\
+ directly with '--variable-name=value'.\n\
+ -t, --tmpdir=path Path for temporary files\n\
-s, --silent Only print errors. One can use two -s to make\n\
myisamchk very silent\n\
-v, --verbose Print more information. This can be used with\n\
- --describe and --check. Use many -v for more verbosity!\n\
+ --description and --check. Use many -v for more verbosity!\n\
-V, --version Print version and exit.\n\
-w, --wait Wait if table is locked.\n");
+#ifdef DEBUG
+ puts(" --start-check-pos=# Start reading file at given offset.\n");
+#endif
puts("Check options (check is the default action for myisamchk):\n\
-c, --check Check table for errors\n\
@@ -325,15 +357,15 @@ static void usage(void)
-F, --fast Check only tables that haven't been closed properly\n\
-C, --check-only-changed\n\
Check only tables that have changed since last check\n\
- -f, --force Restart with -r if there are any errors in the table.\n\
- States will be updated as with --update-state\n\
+ -f, --force Restart with '-r' if there are any errors in the table.\n\
+ States will be updated as with '--update-state'\n\
-i, --information Print statistics information about table that is checked\n\
- -m, --medium-check Faster than extended-check, but only finds 99.99% of\n\
+ -m, --medium-check Faster than extend-check, but only finds 99.99% of\n\
all errors. Should be good enough for most cases\n\
-U --update-state Mark tables as crashed if you find any errors\n\
-T, --read-only Don't mark table as checked\n");
- puts("Repair options (When using -r or -o) \n\
+ puts("Repair options (When using '-r' or '-o') \n\
-B, --backup Make a backup of the .MYD file as 'filename-time.BAK'\n\
--correct-checksum Correct checksum information for table.\n\
-D, --data-file-length=# Max length of data file (when recreating data\n\
@@ -347,8 +379,12 @@ static void usage(void)
get faster inserts!\n\
-r, --recover Can fix almost anything except unique keys that aren't\n\
unique.\n\
- -n, --sort-recover Force recovering with sorting even if the temporary\n\
+ -n, --sort-recover Forces recovering with sorting even if the temporary\n\
file would be very big.\n\
+ -p, --parallel-recover\n\
+ Uses the same technique as '-r' and '-n', but creates\n\
+ all the keys in parallel, in different threads.\n\
+ THIS IS ALPHA CODE. USE AT YOUR OWN RISK!\n\
-o, --safe-recover Uses old recovery method; Slower than '-r' but can\n\
handle a couple of cases where '-r' reports that it\n\
can't fix the data file.\n\
@@ -356,7 +392,6 @@ static void usage(void)
Directory where character sets are\n\
--set-character-set=name\n\
Change the character set used by the index\n\
- -t, --tmpdir=path Path for temporary files\n\
-q, --quick Faster repair by not modifying the data file.\n\
One can give a second '-q' to force myisamchk to\n\
modify the original datafile in case of duplicate keys\n\
@@ -366,7 +401,7 @@ static void usage(void)
puts("Other actions:\n\
-a, --analyze Analyze distribution of keys. Will make some joins in\n\
MySQL faster. You can check the calculated distribution\n\
- by using '--describe --verbose table_name'.\n\
+ by using '--description --verbose table_name'.\n\
-d, --description Prints some information about table.\n\
-A, --set-auto-increment[=value]\n\
Force auto_increment to start at this or higher value\n\
@@ -377,7 +412,9 @@ static void usage(void)
-R, --sort-records=#\n\
Sort records according to an index. This makes your\n\
data much more localized and may speed up things\n\
- (It may be VERY slow to do a sort the first time!)");
+ (It may be VERY slow to do a sort the first time!)\n\
+ -b, --block-search=#\n\
+ Find a record, a block at given offset belongs to.");
print_defaults("my", load_default_groups);
my_print_variables(my_long_options);
@@ -393,7 +430,7 @@ get_one_option(int optid,
{
switch (optid) {
case 'a':
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~T_STATISTICS;
else
check_param.testflag|= T_STATISTICS;
@@ -409,19 +446,19 @@ get_one_option(int optid,
check_param.search_after_block= strtoul(argument, NULL, 10);
break;
case 'B':
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~T_BACKUP_DATA;
else
check_param.testflag|= T_BACKUP_DATA;
break;
case 'c':
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~T_CHECK;
else
check_param.testflag|= T_CHECK;
break;
case 'C':
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~(T_CHECK | T_CHECK_ONLY_CHANGED);
else
check_param.testflag|= T_CHECK | T_CHECK_ONLY_CHANGED;
@@ -430,7 +467,7 @@ get_one_option(int optid,
check_param.max_data_file_length=strtoll(argument, NULL, 10);
break;
case 's': /* silent */
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~(T_SILENT | T_VERY_SILENT);
else
{
@@ -441,31 +478,31 @@ get_one_option(int optid,
}
break;
case 'w':
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~T_WAIT_FOREVER;
else
check_param.testflag|= T_WAIT_FOREVER;
break;
case 'd': /* description if isam-file */
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~T_DESCRIPT;
else
check_param.testflag|= T_DESCRIPT;
break;
case 'e': /* extend check */
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~T_EXTEND;
else
check_param.testflag|= T_EXTEND;
break;
case 'i':
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~T_INFO;
else
check_param.testflag|= T_INFO;
break;
case 'f':
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
{
check_param.tmpfile_createflag= O_RDWR | O_TRUNC | O_EXCL;
check_param.testflag&= ~(T_FORCE_CREATE | T_UPDATE_STATE);
@@ -477,7 +514,7 @@ get_one_option(int optid,
}
break;
case 'F':
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~T_FAST;
else
check_param.testflag|= T_FAST;
@@ -486,44 +523,42 @@ get_one_option(int optid,
check_param.keys_in_use= (ulonglong) strtoll(argument, NULL, 10);
break;
case 'm':
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~T_MEDIUM;
else
check_param.testflag|= T_MEDIUM; /* Medium check */
break;
case 'r': /* Repair table */
- if (argument && *argument == '0')
- check_param.testflag&= ~(T_REP | T_REP_BY_SORT);
- else
- check_param.testflag= (check_param.testflag & ~T_REP) | T_REP_BY_SORT;
+ check_param.testflag&= ~T_REP_ANY;
+ if (argument != disabled_my_option)
+ check_param.testflag|= T_REP_BY_SORT;
+ break;
+ case 'p':
+ check_param.testflag&= ~T_REP_ANY;
+ if (argument != disabled_my_option)
+ check_param.testflag|= T_REP_PARALLEL;
break;
case 'o':
- if (argument && *argument == '0')
+ check_param.testflag&= ~T_REP_ANY;
+ check_param.force_sort= 0;
+ if (argument != disabled_my_option)
{
- check_param.testflag&= ~(T_REP | T_REP_BY_SORT);
- check_param.force_sort= 0;
- }
- else
- {
- check_param.testflag= (check_param.testflag & ~T_REP_BY_SORT) | T_REP;
- check_param.force_sort= 0;
+ check_param.testflag|= T_REP;
my_disable_async_io= 1; /* More safety */
}
break;
case 'n':
- if (argument && *argument == '0')
- {
- check_param.testflag&= ~(T_REP | T_REP_BY_SORT);
+ check_param.testflag&= ~T_REP_ANY;
+ if (argument == disabled_my_option)
check_param.force_sort= 0;
- }
else
{
- check_param.testflag= (check_param.testflag & ~T_REP) | T_REP_BY_SORT;
+ check_param.testflag|= T_REP_BY_SORT;
check_param.force_sort= 1;
}
break;
case 'q':
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~(T_QUICK | T_FORCE_UNIQUENESS);
else
check_param.testflag|=
@@ -536,7 +571,7 @@ get_one_option(int optid,
check_param.testflag|= T_UNPACK | T_REP_BY_SORT;
break;
case 'v': /* Verbose */
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
{
check_param.testflag&= ~T_VERBOSE;
check_param.verbose=0;
@@ -548,7 +583,7 @@ get_one_option(int optid,
}
break;
case 'R': /* Sort records */
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~T_SORT_RECORDS;
else
{
@@ -564,25 +599,25 @@ get_one_option(int optid,
}
break;
case 'S': /* Sort index */
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~T_SORT_INDEX;
else
check_param.testflag|= T_SORT_INDEX;
break;
case 'T':
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~T_READONLY;
else
check_param.testflag|= T_READONLY;
break;
case 'U':
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~T_UPDATE_STATE;
else
check_param.testflag|= T_UPDATE_STATE;
break;
case '#':
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
{
DBUG_POP();
}
@@ -595,7 +630,7 @@ get_one_option(int optid,
print_version();
exit(0);
case OPT_CORRECT_CHECKSUM:
- if (argument && *argument == '0')
+ if (argument == disabled_my_option)
check_param.testflag&= ~T_CALC_CHECKSUM;
else
check_param.testflag|= T_CALC_CHECKSUM;
@@ -605,6 +640,9 @@ get_one_option(int optid,
check_param.start_check_pos= strtoull(argument, NULL, 0);
break;
#endif
+ case 'H':
+ my_print_help(my_long_options);
+ exit(0);
case '?':
usage();
exit(0);
@@ -627,7 +665,7 @@ static void get_options(register int *argc,register char ***argv)
/* If using repair, then update checksum if one uses --update-state */
if ((check_param.testflag & T_UPDATE_STATE) &&
- (check_param.testflag & (T_REP | T_REP_BY_SORT)))
+ (check_param.testflag & T_REP_ANY))
check_param.testflag|= T_CALC_CHECKSUM;
if (*argc == 0)
@@ -646,7 +684,7 @@ static void get_options(register int *argc,register char ***argv)
}
if ((check_param.testflag & T_READONLY) &&
(check_param.testflag &
- (T_REP_BY_SORT | T_REP | T_STATISTICS | T_AUTO_INC |
+ (T_REP_ANY | T_STATISTICS | T_AUTO_INC |
T_SORT_RECORDS | T_SORT_INDEX | T_FORCE_CREATE)))
{
VOID(fprintf(stderr,
@@ -730,6 +768,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
}
share=info->s;
share->options&= ~HA_OPTION_READ_ONLY_DATA; /* We are modifing it */
+ share->tot_locks-= share->r_locks;
share->r_locks=0;
raid_chunks=share->base.raid_chunks;
@@ -742,7 +781,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
{
my_bool need_to_check= mi_is_crashed(info) || share->state.open_count != 0;
- if ((param->testflag & (T_REP_BY_SORT | T_REP | T_SORT_RECORDS)) &&
+ if ((param->testflag & (T_REP_ANY | T_SORT_RECORDS)) &&
((share->state.changed & (STATE_CHANGED | STATE_CRASHED |
STATE_CRASHED_ON_REPAIR) ||
!(param->testflag & T_CHECK_ONLY_CHANGED))))
@@ -774,7 +813,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
DBUG_RETURN(0);
}
}
- if ((param->testflag & (T_REP_BY_SORT | T_REP | T_STATISTICS |
+ if ((param->testflag & (T_REP_ANY | T_STATISTICS |
T_SORT_RECORDS | T_SORT_INDEX)) &&
(((param->testflag & T_UNPACK) &&
share->data_file_type == COMPRESSED_RECORD) ||
@@ -790,8 +829,8 @@ static int myisamchk(MI_CHECK *param, my_string filename)
myisam_block_size != MI_KEY_BLOCK_LENGTH))
{
if (set_charset)
- check_param.language=set_charset->number;
- if (recreate_table(&check_param, &info,filename))
+ param->language=set_charset->number;
+ if (recreate_table(param, &info,filename))
{
VOID(fprintf(stderr,
"MyISAM-table '%s' is not fixed because of errors\n",
@@ -799,7 +838,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
return(-1);
}
recreate=1;
- if (!(param->testflag & (T_REP | T_REP_BY_SORT)))
+ if (!(param->testflag & T_REP_ANY))
{
param->testflag|=T_REP_BY_SORT; /* if only STATISTICS */
if (!(param->testflag & T_SILENT))
@@ -807,6 +846,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
rep_quick|=T_QUICK;
}
share=info->s;
+ share->tot_locks-= share->r_locks;
share->r_locks=0;
}
@@ -815,7 +855,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
param->total_files++;
param->total_records+=info->state->records;
param->total_deleted+=info->state->del;
- descript(&check_param, info, filename);
+ descript(param, info, filename);
}
else
{
@@ -836,13 +876,14 @@ static int myisamchk(MI_CHECK *param, my_string filename)
goto end2;
}
share->w_locks++; /* Mark for writeinfo */
+ share->tot_locks++;
info->lock_type= F_EXTRA_LCK; /* Simulate as locked */
info->tmp_lock_type=lock_type;
datafile=info->dfile;
- if (param->testflag & (T_REP+T_REP_BY_SORT+T_SORT_RECORDS+T_SORT_INDEX))
+ if (param->testflag & (T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX))
{
- if (param->testflag & (T_REP+T_REP_BY_SORT))
+ if (param->testflag & T_REP_ANY)
{
ulonglong tmp=share->state.key_map;
share->state.key_map= (((ulonglong) 1 << share->base.keys)-1)
@@ -850,8 +891,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
if (tmp != share->state.key_map)
info->update|=HA_STATE_CHANGED;
}
- if (rep_quick && chk_del(&check_param, info,
- param->testflag & ~T_VERBOSE))
+ if (rep_quick && chk_del(param, info, param->testflag & ~T_VERBOSE))
{
if (param->testflag & T_FORCE_CREATE)
{
@@ -867,18 +907,21 @@ static int myisamchk(MI_CHECK *param, my_string filename)
}
if (!error)
{
- if ((param->testflag & T_REP_BY_SORT) &&
+ if ((param->testflag & (T_REP_BY_SORT | T_REP_PARALLEL)) &&
(share->state.key_map ||
(rep_quick && !param->keys_in_use && !recreate)) &&
mi_test_if_sort_rep(info, info->state->records,
info->s->state.key_map,
- check_param.force_sort))
+ param->force_sort))
{
- error=mi_repair_by_sort(&check_param,info,filename,rep_quick);
+ if (param->testflag & T_REP_BY_SORT)
+ error=mi_repair_by_sort(param,info,filename,rep_quick);
+ else
+ error=mi_repair_parallel(param,info,filename,rep_quick);
state_updated=1;
}
- else if (param->testflag & (T_REP | T_REP_BY_SORT))
- error=mi_repair(&check_param, info,filename,rep_quick);
+ else if (param->testflag & T_REP_ANY)
+ error=mi_repair(param, info,filename,rep_quick);
}
if (!error && param->testflag & T_SORT_RECORDS)
{
@@ -912,14 +955,15 @@ static int myisamchk(MI_CHECK *param, my_string filename)
update_index=0;
error=mi_sort_records(param,info,filename,param->opt_sort_key,
+ /* what is the following parameter for ? */
(my_bool) !(param->testflag & T_REP),
update_index);
datafile=info->dfile; /* This is now locked */
if (!error && !update_index)
{
- if (check_param.verbose)
+ if (param->verbose)
puts("Table had a compressed index; We must now recreate the index");
- error=mi_repair_by_sort(&check_param,info,filename,1);
+ error=mi_repair_by_sort(param,info,filename,1);
}
}
}
@@ -959,7 +1003,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
!(param->testflag & (T_FAST | T_FORCE_CREATE)))
{
if (param->testflag & (T_EXTEND | T_MEDIUM))
- VOID(init_key_cache(param->use_buffers,(uint) NEED_MEM));
+ VOID(init_key_cache(param->use_buffers));
VOID(init_io_cache(&param->read_cache,datafile,
(uint) param->read_buffer_length,
READ_CACHE,
@@ -993,8 +1037,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
}
}
if ((param->testflag & T_AUTO_INC) ||
- ((param->testflag & (T_REP | T_REP_BY_SORT)) &&
- info->s->base.auto_key))
+ ((param->testflag & T_REP_ANY) && info->s->base.auto_key))
update_auto_increment_key(param, info,
(my_bool) !test(param->testflag & T_AUTO_INC));
@@ -1003,7 +1046,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
if (info->update & HA_STATE_CHANGED && ! (param->testflag & T_READONLY))
error|=update_state_info(param, info,
UPDATE_OPEN_COUNT |
- (((param->testflag & (T_REP | T_REP_BY_SORT)) ?
+ (((param->testflag & T_REP_ANY) ?
UPDATE_TIME : 0) |
(state_updated ? UPDATE_STAT : 0) |
((param->testflag & T_SORT_RECORDS) ?
@@ -1012,6 +1055,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
info->update&= ~HA_STATE_CHANGED;
}
share->w_locks--;
+ share->tot_locks--;
end2:
if (mi_close(info))
{
@@ -1032,12 +1076,12 @@ end2:
VOID(fflush(stdout)); VOID(fflush(stderr));
if (param->error_printed)
{
- if (param->testflag & (T_REP+T_REP_BY_SORT+T_SORT_RECORDS+T_SORT_INDEX))
+ if (param->testflag & (T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX))
{
VOID(fprintf(stderr,
"MyISAM-table '%s' is not fixed because of errors\n",
filename));
- if (check_param.testflag & (T_REP_BY_SORT | T_REP))
+ if (param->testflag & T_REP_ANY)
VOID(fprintf(stderr,
"Try fixing it by using the --safe-recover (-o) or the --force (-f) option\n"));
}
@@ -1048,7 +1092,7 @@ end2:
filename));
}
else if (param->warning_printed &&
- ! (param->testflag & (T_REP+T_REP_BY_SORT+T_SORT_RECORDS+T_SORT_INDEX+
+ ! (param->testflag & (T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX |
T_FORCE_CREATE)))
VOID(fprintf(stderr, "MyISAM-table '%s' is usable but should be fixed\n",
filename));
@@ -1328,7 +1372,7 @@ static int mi_sort_records(MI_CHECK *param,
register MI_INFO *info, my_string name,
uint sort_key,
my_bool write_info,
- my_bool update_index)
+ my_bool update_index)
{
int got_error;
uint key;
@@ -1338,11 +1382,14 @@ static int mi_sort_records(MI_CHECK *param,
ha_rows old_record_count;
MYISAM_SHARE *share=info->s;
char llbuff[22],llbuff2[22];
- SORT_INFO *sort_info= &param->sort_info;
+ SORT_INFO sort_info;
+ MI_SORT_PARAM sort_param;
DBUG_ENTER("sort_records");
- bzero((char*) sort_info,sizeof(*sort_info));
- sort_info->param=param;
+ bzero((char*)&sort_info,sizeof(sort_info));
+ bzero((char*)&sort_param,sizeof(sort_param));
+ sort_param.sort_info=&sort_info;
+ sort_info.param=param;
keyinfo= &share->keyinfo[sort_key];
got_error=1;
temp_buff=0;
@@ -1366,7 +1413,7 @@ static int mi_sort_records(MI_CHECK *param,
if (share->state.key_root[sort_key] == HA_OFFSET_ERROR)
DBUG_RETURN(0); /* Nothing to do */
- init_key_cache(param->use_buffers,NEED_MEM);
+ init_key_cache(param->use_buffers);
if (init_io_cache(&info->rec_cache,-1,(uint) param->write_buffer_length,
WRITE_CACHE,share->pack.header_length,1,
MYF(MY_WME | MY_WAIT_IF_FULL)))
@@ -1378,7 +1425,7 @@ static int mi_sort_records(MI_CHECK *param,
mi_check_print_error(param,"Not enough memory for key block");
goto err;
}
- if (!(sort_info->record=(byte*) my_malloc((uint) share->base.pack_reclength,
+ if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
MYF(0))))
{
mi_check_print_error(param,"Not enough memory for record");
@@ -1420,18 +1467,18 @@ static int mi_sort_records(MI_CHECK *param,
}
/* Setup param for sort_write_record */
- sort_info->info=info;
- sort_info->new_data_file_type=share->data_file_type;
- sort_info->fix_datafile=1;
- sort_info->filepos=share->pack.header_length;
+ sort_info.info=info;
+ sort_info.new_data_file_type=share->data_file_type;
+ sort_param.fix_datafile=1;
+ sort_param.filepos=share->pack.header_length;
old_record_count=info->state->records;
info->state->records=0;
- if (sort_info->new_data_file_type != COMPRESSED_RECORD)
+ if (sort_info.new_data_file_type != COMPRESSED_RECORD)
share->state.checksum=0;
- if (sort_record_index(param, info,keyinfo,share->state.key_root[sort_key],
+ if (sort_record_index(&sort_param,info,keyinfo,share->state.key_root[sort_key],
temp_buff, sort_key,new_file,update_index) ||
- write_data_suffix(param, info) ||
+ write_data_suffix(&sort_info,1) ||
flush_io_cache(&info->rec_cache))
goto err;
@@ -1449,7 +1496,7 @@ static int mi_sort_records(MI_CHECK *param,
info->state->del=0;
info->state->empty=0;
share->state.dellink= HA_OFFSET_ERROR;
- info->state->data_file_length=sort_info->filepos;
+ info->state->data_file_length=sort_param.filepos;
share->state.split=info->state->records; /* Only hole records */
share->state.version=(ulong) time((time_t*) 0);
@@ -1473,11 +1520,11 @@ err:
{
my_afree((gptr) temp_buff);
}
- my_free(sort_info->record,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
VOID(end_io_cache(&info->rec_cache));
- my_free(sort_info->buff,MYF(MY_ALLOW_ZERO_PTR));
- sort_info->buff=0;
+ my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
+ sort_info.buff=0;
share->state.sortkey=sort_key;
DBUG_RETURN(flush_blocks(param, share->kfile) | got_error);
} /* sort_records */
@@ -1485,7 +1532,8 @@ err:
/* Sort records recursive using one index */
-static int sort_record_index(MI_CHECK *param,MI_INFO *info, MI_KEYDEF *keyinfo,
+static int sort_record_index(MI_SORT_PARAM *sort_param,MI_INFO *info,
+ MI_KEYDEF *keyinfo,
my_off_t page, uchar *buff, uint sort_key,
File new_file,my_bool update_index)
{
@@ -1494,7 +1542,8 @@ static int sort_record_index(MI_CHECK *param,MI_INFO *info, MI_KEYDEF *keyinfo,
my_off_t next_page,rec_pos;
uchar lastkey[MI_MAX_KEY_BUFF];
char llbuff[22];
- SORT_INFO *sort_info= &param->sort_info;
+ SORT_INFO *sort_info= sort_param->sort_info;
+ MI_CHECK *param=sort_info->param;
DBUG_ENTER("sort_record_index");
nod_flag=mi_test_if_nod(buff);
@@ -1525,7 +1574,7 @@ static int sort_record_index(MI_CHECK *param,MI_INFO *info, MI_KEYDEF *keyinfo,
llstr(next_page,llbuff));
goto err;
}
- if (sort_record_index(param, info,keyinfo,next_page,temp_buff,sort_key,
+ if (sort_record_index(sort_param, info,keyinfo,next_page,temp_buff,sort_key,
new_file, update_index))
goto err;
}
@@ -1536,23 +1585,23 @@ static int sort_record_index(MI_CHECK *param,MI_INFO *info, MI_KEYDEF *keyinfo,
break;
rec_pos= _mi_dpos(info,0,lastkey+key_length);
- if ((*info->s->read_rnd)(info,sort_info->record,rec_pos,0))
+ if ((*info->s->read_rnd)(info,sort_param->record,rec_pos,0))
{
mi_check_print_error(param,"%d when reading datafile",my_errno);
goto err;
}
- if (rec_pos != sort_info->filepos && update_index)
+ if (rec_pos != sort_param->filepos && update_index)
{
_mi_dpointer(info,keypos-nod_flag-info->s->rec_reflength,
- sort_info->filepos);
- if (movepoint(info,sort_info->record,rec_pos,sort_info->filepos,
+ sort_param->filepos);
+ if (movepoint(info,sort_param->record,rec_pos,sort_param->filepos,
sort_key))
{
mi_check_print_error(param,"%d when updating key-pointers",my_errno);
goto err;
}
}
- if (sort_write_record(sort_info))
+ if (sort_write_record(sort_param))
goto err;
}
/* Clear end of block to get better compression if the table is backuped */
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h
index 7617d0e7c1d..7f8b6dc41fd 100644
--- a/myisam/myisamdef.h
+++ b/myisam/myisamdef.h
@@ -222,12 +222,11 @@ struct st_myisam_info {
MI_BLOB *blobs; /* Pointer to blobs */
MI_BIT_BUFF bit_buff;
/* accumulate indexfile changes between write's */
- TREE *bulk_insert;
+ TREE *bulk_insert;
char *filename; /* parameter to open filename */
uchar *buff, /* Temp area for key */
*lastkey,*lastkey2; /* Last used search key */
- byte *rec_buff, /* Tempbuff for recordpack */
- *rec_alloc; /* Malloced area for record */
+ byte *rec_buff; /* Tempbuff for recordpack */
uchar *int_keypos, /* Save position for next/previous */
*int_maxpos; /* -""- */
int (*read_record)(struct st_myisam_info*, my_off_t, byte*);
@@ -248,8 +247,7 @@ struct st_myisam_info {
int dfile; /* The datafile */
uint opt_flag; /* Optim. for space/speed */
uint update; /* If file changed since open */
- uint alloced_rec_buff_length; /* Max recordlength malloced */
- uint int_nod_flag; /* -""- */
+ uint int_nod_flag; /* -""- */
int lastinx; /* Last used index */
uint lastkey_length; /* Length of key in lastkey */
uint last_rkey_length; /* Last length in mi_rkey() */
@@ -349,6 +347,7 @@ struct st_myisam_info {
#define MI_DYN_ALIGN_SIZE 4 /* Align blocks on this */
#define MI_MAX_DYN_HEADER_BYTE 13 /* max header byte for dynamic rows */
#define MI_MAX_BLOCK_LENGTH ((((ulong) 1 << 24)-1) & (~ (ulong) (MI_DYN_ALIGN_SIZE-1)))
+#define MI_REC_BUFF_OFFSET ALIGN_SIZE(MI_DYN_DELETE_BLOCK_HEADER+sizeof(uint))
#define MEMMAP_EXTRA_MARGIN 7 /* Write this as a suffix for file */
@@ -359,8 +358,10 @@ struct st_myisam_info {
#define MI_MAX_KEY_BLOCK_SIZE (MI_MAX_KEY_BLOCK_LENGTH/MI_MIN_KEY_BLOCK_LENGTH)
#define MI_BLOCK_SIZE(key_length,data_pointer,key_pointer) ((((key_length+data_pointer+key_pointer)*4+key_pointer+2)/myisam_block_size+1)*myisam_block_size)
-#define MI_MAX_KEYPTR_SIZE 5 /* For calculating block lengths */
-#define MI_MIN_KEYBLOCK_LENGTH 50 /* When to split delete blocks */
+#define MI_MAX_KEYPTR_SIZE 5 /* For calculating block lengths */
+#define MI_MIN_KEYBLOCK_LENGTH 50 /* When to split delete blocks */
+
+#define MI_MIN_SIZE_BULK_INSERT_TREE 16384 /* this is per key */
/* The UNIQUE check is done with a hashed long key */
@@ -508,10 +509,17 @@ extern int _mi_read_key_record(MI_INFO *info,my_off_t filepos,byte *buf);
extern int _mi_read_cache(IO_CACHE *info,byte *buff,my_off_t pos,
uint length,int re_read_if_possibly);
extern void update_auto_increment(MI_INFO *info,const byte *record);
-extern byte *mi_fix_rec_buff_for_blob(MI_INFO *info,ulong blob_length);
+
+extern byte *mi_alloc_rec_buff(MI_INFO *,ulong, byte**);
+#define mi_get_rec_buff_ptr(info,buf) \
+ ((((info)->s->options & HA_OPTION_PACK_RECORD) && (buf)) ? \
+ (buf) - MI_REC_BUFF_OFFSET : (buf))
+#define mi_get_rec_buff_len(info,buf) \
+ (*((uint *)(mi_get_rec_buff_ptr(info,buf))))
+
extern ulong _mi_rec_unpack(MI_INFO *info,byte *to,byte *from,
ulong reclength);
-extern my_bool _mi_rec_check(MI_INFO *info,const char *from);
+extern my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *packpos);
extern int _mi_write_part_record(MI_INFO *info,my_off_t filepos,ulong length,
my_off_t next_filepos,byte **record,
ulong *reclength,int *flag);
@@ -637,13 +645,17 @@ int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup);
int mi_open_keyfile(MYISAM_SHARE *share);
void mi_setup_functions(register MYISAM_SHARE *share);
-int _mi_init_bulk_insert(MI_INFO *info);
+int _mi_init_bulk_insert(MI_INFO *info, ulong cache_size);
/* Functions needed by mi_check */
void mi_check_print_error _VARARGS((MI_CHECK *param, const char *fmt,...));
void mi_check_print_warning _VARARGS((MI_CHECK *param, const char *fmt,...));
void mi_check_print_info _VARARGS((MI_CHECK *param, const char *fmt,...));
-int flush_pending_blocks(MI_CHECK *param);
+int flush_pending_blocks(MI_SORT_PARAM *param);
+int thr_write_keys(MI_SORT_PARAM *sort_param);
+#ifdef THREAD
+pthread_handler_decl(thr_find_all_keys,arg);
+#endif
#ifdef __cplusplus
}
diff --git a/myisam/myisamlog.c b/myisam/myisamlog.c
index df375556c25..d7fb3f24b85 100644
--- a/myisam/myisamlog.c
+++ b/myisam/myisamlog.c
@@ -333,7 +333,7 @@ static int examine_log(my_string file_name, char **table_names)
bzero((gptr) com_count,sizeof(com_count));
init_tree(&tree,0,0,sizeof(file_info),(qsort_cmp2) file_info_compare,1,
(tree_element_free) file_info_free, NULL);
- VOID(init_key_cache(KEY_CACHE_SIZE,(uint) (10*4*(IO_SIZE+MALLOC_OVERHEAD))));
+ VOID(init_key_cache(KEY_CACHE_SIZE));
files_open=0; access_time=0;
while (access_time++ != number_of_commands &&
@@ -485,7 +485,7 @@ static int examine_log(my_string file_name, char **table_names)
command_name[command], (int) extra_command,result);
if (update && curr_file_info && !curr_file_info->closed)
{
- if (mi_extra(curr_file_info->isam, extra_command) != (int) result)
+ if (mi_extra(curr_file_info->isam, extra_command, 0) != (int) result)
{
fflush(stdout);
VOID(fprintf(stderr,
diff --git a/myisam/myisampack.c b/myisam/myisampack.c
index e463978bc10..a299e4eb00d 100644
--- a/myisam/myisampack.c
+++ b/myisam/myisampack.c
@@ -275,7 +275,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts("Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB");
+ puts("Copyright (C) 2002 MySQL AB");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
puts("and you are welcome to modify and redistribute it under the GPL license\n");
@@ -2048,7 +2048,7 @@ static int save_state(MI_INFO *isam_file,PACK_MRG_INFO *mrg,my_off_t new_length,
share->changed=1; /* Force write of header */
share->state.open_count=0;
share->global_changed=0;
- VOID(my_chsize(share->kfile,share->state.state.key_file_length,
+ VOID(my_chsize(share->kfile, share->state.state.key_file_length, 0,
MYF(0)));
if (share->base.keys)
isamchk_neaded=1;
@@ -2090,7 +2090,7 @@ static void mrg_reset(PACK_MRG_INFO *mrg)
{
if (mrg->current)
{
- mi_extra(*mrg->current,HA_EXTRA_NO_CACHE);
+ mi_extra(*mrg->current, HA_EXTRA_NO_CACHE, 0);
mrg->current=0;
}
}
@@ -2105,8 +2105,8 @@ static int mrg_rrnd(PACK_MRG_INFO *info,byte *buf)
{
isam_info= *(info->current=info->file);
info->end=info->current+info->count;
- mi_extra(isam_info,HA_EXTRA_RESET);
- mi_extra(isam_info,HA_EXTRA_CACHE);
+ mi_extra(isam_info, HA_EXTRA_RESET, 0);
+ mi_extra(isam_info, HA_EXTRA_CACHE, 0);
filepos=isam_info->s->pack.header_length;
}
else
@@ -2122,14 +2122,14 @@ static int mrg_rrnd(PACK_MRG_INFO *info,byte *buf)
filepos, 1)) ||
error != HA_ERR_END_OF_FILE)
return (error);
- mi_extra(isam_info,HA_EXTRA_NO_CACHE);
+ mi_extra(isam_info,HA_EXTRA_NO_CACHE, 0);
if (info->current+1 == info->end)
return(HA_ERR_END_OF_FILE);
info->current++;
isam_info= *info->current;
filepos=isam_info->s->pack.header_length;
- mi_extra(isam_info,HA_EXTRA_RESET);
- mi_extra(isam_info,HA_EXTRA_CACHE);
+ mi_extra(isam_info,HA_EXTRA_RESET, 0);
+ mi_extra(isam_info,HA_EXTRA_CACHE, 0);
}
}
diff --git a/myisam/sort.c b/myisam/sort.c
index bec77b231b8..79d31147bfc 100644
--- a/myisam/sort.c
+++ b/myisam/sort.c
@@ -27,7 +27,8 @@
#endif
#include <queues.h>
- /* static variabels */
+/* static variables */
+
#undef MIN_SORT_MEMORY
#undef MYF_RW
#undef DISK_BUFFER_SIZE
@@ -35,46 +36,59 @@
#define MERGEBUFF 15
#define MERGEBUFF2 31
#define MIN_SORT_MEMORY (4096-MALLOC_OVERHEAD)
-#define MYF_RW MYF(MY_NABP | MY_WME | MY_WAIT_IF_FULL)
+#define MYF_RW MYF(MY_NABP | MY_WME | MY_WAIT_IF_FULL)
#define DISK_BUFFER_SIZE (IO_SIZE*16)
typedef struct st_buffpek {
- my_off_t file_pos; /* Where we are in the sort file */
- uchar *base,*key; /* Key pointers */
- ha_rows count; /* Number of rows in table */
- ulong mem_count; /* numbers of keys in memory */
- ulong max_keys; /* Max keys in buffert */
+ my_off_t file_pos; /* Where we are in the sort file */
+ uchar *base,*key; /* Key pointers */
+ ha_rows count; /* Number of rows in table */
+ ulong mem_count; /* numbers of keys in memory */
+ ulong max_keys; /* Max keys in buffert */
} BUFFPEK;
extern void print_error _VARARGS((const char *fmt,...));
- /* functions defined in this file */
+/* Functions defined in this file */
static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info,uint keys,
- uchar **sort_keys,
- DYNAMIC_ARRAY *buffpek,int *maxbuffer,
- IO_CACHE *tempfile,
- IO_CACHE *tempfile_for_exceptions);
+ uchar **sort_keys,
+ DYNAMIC_ARRAY *buffpek,int *maxbuffer,
+ IO_CACHE *tempfile,
+ IO_CACHE *tempfile_for_exceptions);
static int NEAR_F write_keys(MI_SORT_PARAM *info,uchar * *sort_keys,
- uint count, BUFFPEK *buffpek,IO_CACHE *tempfile);
-static int NEAR_F write_key(MI_SORT_PARAM *info, uchar *key, IO_CACHE *tempfile);
+ uint count, BUFFPEK *buffpek,IO_CACHE *tempfile);
+static int NEAR_F write_key(MI_SORT_PARAM *info, uchar *key,
+ IO_CACHE *tempfile);
static int NEAR_F write_index(MI_SORT_PARAM *info,uchar * *sort_keys,
- uint count);
+ uint count);
static int NEAR_F merge_many_buff(MI_SORT_PARAM *info,uint keys,
- uchar * *sort_keys,
- BUFFPEK *buffpek,int *maxbuffer,
- IO_CACHE *t_file);
+ uchar * *sort_keys,
+ BUFFPEK *buffpek,int *maxbuffer,
+ IO_CACHE *t_file);
static uint NEAR_F read_to_buffer(IO_CACHE *fromfile,BUFFPEK *buffpek,
- uint sort_length);
+ uint sort_length);
static int NEAR_F merge_buffers(MI_SORT_PARAM *info,uint keys,
- IO_CACHE *from_file, IO_CACHE *to_file,
- uchar * *sort_keys, BUFFPEK *lastbuff,
- BUFFPEK *Fb, BUFFPEK *Tb);
+ IO_CACHE *from_file, IO_CACHE *to_file,
+ uchar * *sort_keys, BUFFPEK *lastbuff,
+ BUFFPEK *Fb, BUFFPEK *Tb);
static int NEAR_F merge_index(MI_SORT_PARAM *,uint,uchar **,BUFFPEK *, int,
- IO_CACHE *);
+ IO_CACHE *);
+
+
+/*
+ Creates a index of sorted keys
- /* Creates a index of sorted keys */
- /* Returns 0 if everything went ok */
+ SYNOPSIS
+ _create_index_by_sort()
+ info Sort parameters
+ no_messages Set to 1 if no output
+ sortbuff_size Size if sortbuffer to allocate
+
+ RESULT
+ 0 ok
+ <> 0 Error
+*/
int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
ulong sortbuff_size)
@@ -95,7 +109,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
maxbuffer=1;
memavl=max(sortbuff_size,MIN_SORT_MEMORY);
- records= info->max_records;
+ records= info->sort_info->max_records;
sort_length= info->key_length;
LINT_INIT(keys);
@@ -168,19 +182,19 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
reinit_io_cache(&tempfile,READ_CACHE,0L,0,0))
goto err; /* purecov: inspected */
if (!no_messages)
- puts(" - Last merge and dumping keys"); /* purecov: tested */
+ puts(" - Last merge and dumping keys\n"); /* purecov: tested */
if (merge_index(info,keys,sort_keys,dynamic_element(&buffpek,0,BUFFPEK *),
maxbuffer,&tempfile))
goto err; /* purecov: inspected */
}
- if (flush_pending_blocks(info->sort_info->param))
+ if (flush_pending_blocks(info))
goto err;
if (my_b_inited(&tempfile_for_exceptions))
{
MI_INFO *index=info->sort_info->info;
- uint keyno=info->sort_info->key;
+ uint keyno=info->key;
uint key_length, ref_length=index->s->rec_reflength;
if (flush_io_cache(&tempfile_for_exceptions) ||
@@ -210,7 +224,7 @@ err:
} /* _create_index_by_sort */
- /* Search after all keys and place them in a temp. file */
+/* Search after all keys and place them in a temp. file */
static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys,
uchar **sort_keys, DYNAMIC_ARRAY *buffpek,
@@ -224,9 +238,9 @@ static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys,
idx=error=0;
sort_keys[0]=(uchar*) (sort_keys+keys);
- while(!(error=(*info->key_read)(info->sort_info,sort_keys[idx])))
+ while (!(error=(*info->key_read)(info,sort_keys[idx])))
{
- if (info->sort_info->real_key_length > info->key_length)
+ if (info->real_key_length > info->key_length)
{
if (write_key(info,sort_keys[idx],tempfile_for_exceptions))
DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */
@@ -249,7 +263,8 @@ static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys,
DBUG_RETURN(HA_POS_ERROR); /* Aborted by get_key */ /* purecov: inspected */
if (buffpek->elements)
{
- if (write_keys(info,sort_keys,idx,(BUFFPEK *)alloc_dynamic(buffpek),tempfile))
+ if (write_keys(info,sort_keys,idx,(BUFFPEK *)alloc_dynamic(buffpek),
+ tempfile))
DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */
*maxbuffer=buffpek->elements-1;
}
@@ -259,41 +274,310 @@ static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys,
DBUG_RETURN((*maxbuffer)*(keys-1)+idx);
} /* find_all_keys */
- /* Write all keys in memory to file for later merge */
+
+/* Search after all keys and place them in a temp. file */
+
+pthread_handler_decl(thr_find_all_keys,arg)
+{
+ MI_SORT_PARAM *info= (MI_SORT_PARAM*) arg;
+ int error;
+ uint memavl,old_memavl,keys,sort_length;
+ uint idx, maxbuffer;
+ uchar **sort_keys=0;
+
+ error=1;
+
+ if (my_thread_init())
+ goto err;
+ if (info->sort_info->got_error)
+ goto err;
+
+ my_b_clear(&info->tempfile);
+ my_b_clear(&info->tempfile_for_exceptions);
+ bzero((char*) &info->buffpek,sizeof(info->buffpek));
+ bzero((char*) &info->unique, sizeof(info->unique));
+ sort_keys= (uchar **) NULL;
+
+ memavl=max(info->sortbuff_size, MIN_SORT_MEMORY);
+ idx= info->sort_info->max_records;
+ sort_length= info->key_length;
+ maxbuffer= 1;
+
+ while (memavl >= MIN_SORT_MEMORY)
+ {
+ if ((my_off_t) (idx+1)*(sort_length+sizeof(char*)) <=
+ (my_off_t) memavl)
+ keys= idx+1;
+ else
+ {
+ uint skr;
+ do
+ {
+ skr=maxbuffer;
+ if (memavl < sizeof(BUFFPEK)*maxbuffer ||
+ (keys=(memavl-sizeof(BUFFPEK)*maxbuffer)/
+ (sort_length+sizeof(char*))) <= 1)
+ {
+ mi_check_print_error(info->sort_info->param,
+ "sort_buffer_size is to small");
+ goto err;
+ }
+ }
+ while ((maxbuffer= (int) (idx/(keys-1)+1)) != skr);
+ }
+ if ((sort_keys=(uchar **)my_malloc(keys*(sort_length+sizeof(char*))+
+ ((info->keyinfo->flag & HA_FULLTEXT) ?
+ HA_FT_MAXLEN : 0), MYF(0))))
+ {
+ if (my_init_dynamic_array(&info->buffpek, sizeof(BUFFPEK),
+ maxbuffer, maxbuffer/2))
+ my_free((gptr) sort_keys,MYF(0));
+ else
+ break;
+ }
+ old_memavl=memavl;
+ if ((memavl=memavl/4*3) < MIN_SORT_MEMORY && old_memavl > MIN_SORT_MEMORY)
+ memavl=MIN_SORT_MEMORY;
+ }
+ if (memavl < MIN_SORT_MEMORY)
+ {
+ mi_check_print_error(info->sort_info->param,"Sort buffer to small"); /* purecov: tested */
+ goto err; /* purecov: tested */
+ }
+// (*info->lock_in_memory)(info->sort_info->param);/* Everything is allocated */
+
+ if (info->sort_info->param->testflag & T_VERBOSE)
+ printf("Key %d - Allocating buffer for %d keys\n",info->key+1,keys);
+ info->sort_keys=sort_keys;
+
+ idx=error=0;
+ sort_keys[0]=(uchar*) (sort_keys+keys);
+
+ while (!(error=info->sort_info->got_error) &&
+ !(error=(*info->key_read)(info,sort_keys[idx])))
+ {
+ if (info->real_key_length > info->key_length)
+ {
+ if (write_key(info,sort_keys[idx], &info->tempfile_for_exceptions))
+ goto err;
+ continue;
+ }
+
+ if (++idx == keys)
+ {
+ if (write_keys(info,sort_keys,idx-1,
+ (BUFFPEK *)alloc_dynamic(&info->buffpek),
+ &info->tempfile))
+ goto err;
+ sort_keys[0]=(uchar*) (sort_keys+keys);
+ memcpy(sort_keys[0],sort_keys[idx-1],(size_t) info->key_length);
+ idx=1;
+ }
+ sort_keys[idx]=sort_keys[idx-1]+info->key_length;
+ }
+ if (error > 0)
+ goto err;
+ if (info->buffpek.elements)
+ {
+ if (write_keys(info,sort_keys, idx,
+ (BUFFPEK *) alloc_dynamic(&info->buffpek), &info->tempfile))
+ goto err;
+ info->keys=(info->buffpek.elements-1)*(keys-1)+idx;
+ }
+ else
+ info->keys=idx;
+
+ info->sort_keys_length=keys;
+ goto ok;
+
+err:
+ info->sort_info->got_error=1; /* no need to protect this with a mutex */
+ if (sort_keys)
+ my_free((gptr) sort_keys,MYF(0));
+ info->sort_keys=0;
+ delete_dynamic(& info->buffpek);
+ close_cached_file(&info->tempfile);
+ close_cached_file(&info->tempfile_for_exceptions);
+
+ok:
+ remove_io_thread(&info->read_cache);
+ pthread_mutex_lock(&info->sort_info->mutex);
+ info->sort_info->threads_running--;
+ pthread_cond_signal(&info->sort_info->cond);
+ pthread_mutex_unlock(&info->sort_info->mutex);
+ my_thread_end();
+ return NULL;
+}
+
+
+int thr_write_keys(MI_SORT_PARAM *sort_param)
+{
+ SORT_INFO *sort_info=sort_param->sort_info;
+ MI_CHECK *param=sort_info->param;
+ ulong length, keys;
+ ulong *rec_per_key_part=param->rec_per_key_part;
+ int got_error=sort_info->got_error;
+ uint i;
+ MI_INFO *info=sort_info->info;
+ MYISAM_SHARE *share=info->s;
+ MI_SORT_PARAM *sinfo;
+ byte *mergebuf=0;
+ LINT_INIT(length);
+
+ for (i=0, sinfo=sort_param ; i<sort_info->total_keys ; i++,
+ rec_per_key_part+=sinfo->keyinfo->keysegs,
+ sinfo++)
+ {
+ if (!sinfo->sort_keys)
+ {
+ got_error=1;
+ continue;
+ }
+ if (!got_error)
+ {
+ share->state.key_map|=(ulonglong) 1 << sinfo->key;
+ if (param->testflag & T_STATISTICS)
+ update_key_parts(sinfo->keyinfo, rec_per_key_part,
+ sinfo->unique, (ulonglong) info->state->records);
+ if (!sinfo->buffpek.elements)
+ {
+ if (param->testflag & T_VERBOSE)
+ {
+ printf("Key %d - Dumping %u keys\n",sinfo->key+1, sinfo->keys);
+ fflush(stdout);
+ }
+ if (write_index(sinfo, sinfo->sort_keys, sinfo->keys) ||
+ flush_pending_blocks(sinfo))
+ got_error=1;
+ }
+ }
+ my_free((gptr) sinfo->sort_keys,MYF(0));
+ my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff), MYF(MY_ALLOW_ZERO_PTR));
+ sinfo->sort_keys=0;
+ }
+
+ for (i=0, sinfo=sort_param ; i<sort_info->total_keys ; i++,
+ delete_dynamic(&sinfo->buffpek),
+ close_cached_file(&sinfo->tempfile),
+ close_cached_file(&sinfo->tempfile_for_exceptions),
+ sinfo++)
+ {
+ if (got_error)
+ continue;
+ if (sinfo->buffpek.elements)
+ {
+ uint maxbuffer=sinfo->buffpek.elements-1;
+ if (!mergebuf)
+ {
+ length=param->sort_buffer_length;
+ while (length >= MIN_SORT_MEMORY && !mergebuf)
+ {
+ mergebuf=my_malloc(length, MYF(0));
+ length=length*3/4;
+ }
+ if (!mergebuf)
+ {
+ got_error=1;
+ continue;
+ }
+ }
+ keys=length/sinfo->key_length;
+ if (maxbuffer >= MERGEBUFF2)
+ {
+ if (param->testflag & T_VERBOSE)
+ printf("Key %d - Merging %u keys\n",sinfo->key+1, sinfo->keys);
+ if (merge_many_buff(sinfo, keys, (uchar **)mergebuf,
+ dynamic_element(&sinfo->buffpek, 0, BUFFPEK *),
+ &maxbuffer, &sinfo->tempfile))
+ {
+ got_error=1;
+ continue;
+ }
+ }
+ if (flush_io_cache(&sinfo->tempfile) ||
+ reinit_io_cache(&sinfo->tempfile,READ_CACHE,0L,0,0))
+ {
+ got_error=1;
+ continue;
+ }
+ if (param->testflag & T_VERBOSE)
+ printf("Key %d - Last merge and dumping keys\n", sinfo->key+1);
+ if (merge_index(sinfo, keys, (uchar **)mergebuf,
+ dynamic_element(&sinfo->buffpek,0,BUFFPEK *),
+ maxbuffer,&sinfo->tempfile) ||
+ flush_pending_blocks(sinfo))
+ {
+ got_error=1;
+ continue;
+ }
+ }
+ if (my_b_inited(&sinfo->tempfile_for_exceptions))
+ {
+ uint key_length;
+
+ if (param->testflag & T_VERBOSE)
+ printf("Key %d - Dumping 'long' keys\n", sinfo->key+1);
+
+ if (flush_io_cache(&sinfo->tempfile_for_exceptions) ||
+ reinit_io_cache(&sinfo->tempfile_for_exceptions,READ_CACHE,0L,0,0))
+ {
+ got_error=1;
+ continue;
+ }
+
+ while (!got_error &&
+ !my_b_read(&sinfo->tempfile_for_exceptions,(byte*)&key_length,
+ sizeof(key_length)) &&
+ !my_b_read(&sinfo->tempfile_for_exceptions,(byte*)mergebuf,
+ (uint) key_length))
+ {
+ if (_mi_ck_write(info,sinfo->key,(uchar*) mergebuf,
+ key_length - info->s->rec_reflength))
+ got_error=1;
+ }
+ }
+ }
+ my_free((gptr) mergebuf,MYF(MY_ALLOW_ZERO_PTR));
+ return got_error;
+}
+
+ /* Write all keys in memory to file for later merge */
static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys,
- uint count, BUFFPEK *buffpek,
- IO_CACHE *tempfile)
+ uint count, BUFFPEK *buffpek, IO_CACHE *tempfile)
{
uchar **end;
uint sort_length=info->key_length;
DBUG_ENTER("write_keys");
qsort2((byte*) sort_keys,count,sizeof(byte*),(qsort2_cmp) info->key_cmp,
- info->sort_info);
+ info);
if (!my_b_inited(tempfile) &&
open_cached_file(tempfile, info->tmpdir, "ST", DISK_BUFFER_SIZE,
- info->myf_rw))
+ info->sort_info->param->myf_rw))
DBUG_RETURN(1); /* purecov: inspected */
buffpek->file_pos=my_b_tell(tempfile);
buffpek->count=count;
for (end=sort_keys+count ; sort_keys != end ; sort_keys++)
+ {
if (my_b_write(tempfile,(byte*) *sort_keys,(uint) sort_length))
DBUG_RETURN(1); /* purecov: inspected */
+ }
DBUG_RETURN(0);
} /* write_keys */
-static int NEAR_F write_key(MI_SORT_PARAM *info, uchar *key, IO_CACHE *tempfile)
+static int NEAR_F write_key(MI_SORT_PARAM *info, uchar *key,
+ IO_CACHE *tempfile)
{
- uint key_length=info->sort_info->real_key_length;
+ uint key_length=info->real_key_length;
DBUG_ENTER("write_key");
if (!my_b_inited(tempfile) &&
open_cached_file(tempfile, info->tmpdir, "ST", DISK_BUFFER_SIZE,
- info->myf_rw))
+ info->sort_info->param->myf_rw))
DBUG_RETURN(1);
if (my_b_write(tempfile,(byte*)&key_length,sizeof(key_length)) ||
@@ -302,27 +586,30 @@ static int NEAR_F write_key(MI_SORT_PARAM *info, uchar *key, IO_CACHE *tempfile)
DBUG_RETURN(0);
} /* write_key */
- /* Write index */
+
+/* Write index */
static int NEAR_F write_index(MI_SORT_PARAM *info, register uchar **sort_keys,
- register uint count)
+ register uint count)
{
DBUG_ENTER("write_index");
qsort2((gptr) sort_keys,(size_t) count,sizeof(byte*),
- (qsort2_cmp) info->key_cmp,info->sort_info);
+ (qsort2_cmp) info->key_cmp,info);
while (count--)
- if ((*info->key_write)(info->sort_info,*sort_keys++))
+ {
+ if ((*info->key_write)(info,*sort_keys++))
DBUG_RETURN(-1); /* purecov: inspected */
+ }
DBUG_RETURN(0);
} /* write_index */
- /* Merge buffers to make < MERGEBUFF2 buffers */
+ /* Merge buffers to make < MERGEBUFF2 buffers */
static int NEAR_F merge_many_buff(MI_SORT_PARAM *info, uint keys,
- uchar **sort_keys, BUFFPEK *buffpek,
- int *maxbuffer, IO_CACHE *t_file)
+ uchar **sort_keys, BUFFPEK *buffpek,
+ int *maxbuffer, IO_CACHE *t_file)
{
register int i;
IO_CACHE t_file2, *from_file, *to_file, *temp;
@@ -330,11 +617,11 @@ static int NEAR_F merge_many_buff(MI_SORT_PARAM *info, uint keys,
DBUG_ENTER("merge_many_buff");
if (*maxbuffer < MERGEBUFF2)
- DBUG_RETURN(0); /* purecov: inspected */
+ DBUG_RETURN(0); /* purecov: inspected */
if (flush_io_cache(t_file) ||
open_cached_file(&t_file2,info->tmpdir,"ST",DISK_BUFFER_SIZE,
- info->myf_rw))
- DBUG_RETURN(1); /* purecov: inspected */
+ info->sort_info->param->myf_rw))
+ DBUG_RETURN(1); /* purecov: inspected */
from_file= t_file ; to_file= &t_file2;
while (*maxbuffer >= MERGEBUFF2)
@@ -345,30 +632,40 @@ static int NEAR_F merge_many_buff(MI_SORT_PARAM *info, uint keys,
for (i=0 ; i <= *maxbuffer-MERGEBUFF*3/2 ; i+=MERGEBUFF)
{
if (merge_buffers(info,keys,from_file,to_file,sort_keys,lastbuff++,
- buffpek+i,buffpek+i+MERGEBUFF-1))
- break; /* purecov: inspected */
+ buffpek+i,buffpek+i+MERGEBUFF-1))
+ break; /* purecov: inspected */
}
if (merge_buffers(info,keys,from_file,to_file,sort_keys,lastbuff++,
- buffpek+i,buffpek+ *maxbuffer))
+ buffpek+i,buffpek+ *maxbuffer))
break; /* purecov: inspected */
if (flush_io_cache(to_file))
- break; /* purecov: inspected */
+ break; /* purecov: inspected */
temp=from_file; from_file=to_file; to_file=temp;
*maxbuffer= (int) (lastbuff-buffpek)-1;
}
- close_cached_file(to_file); /* This holds old result */
+ close_cached_file(to_file); /* This holds old result */
if (to_file == t_file)
- *t_file=t_file2; /* Copy result file */
+ *t_file=t_file2; /* Copy result file */
- DBUG_RETURN(*maxbuffer >= MERGEBUFF2); /* Return 1 if interrupted */
+ DBUG_RETURN(*maxbuffer >= MERGEBUFF2); /* Return 1 if interrupted */
} /* merge_many_buff */
- /* Read data to buffer */
- /* This returns (uint) -1 if something goes wrong */
+/*
+ Read data to buffer
+
+ SYNOPSIS
+ read_to_buffer()
+ fromfile File to read from
+ buffpek Where to read from
+ sort_length max length to read
+ RESULT
+ > 0 Ammount of bytes read
+ -1 Error
+*/
static uint NEAR_F read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek,
- uint sort_length)
+ uint sort_length)
{
register uint count;
uint length;
@@ -376,24 +673,26 @@ static uint NEAR_F read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek,
if ((count=(uint) min((ha_rows) buffpek->max_keys,buffpek->count)))
{
if (my_pread(fromfile->file,(byte*) buffpek->base,
- (length= sort_length*count),buffpek->file_pos,MYF_RW))
- return((uint) -1); /* purecov: inspected */
+ (length= sort_length*count),buffpek->file_pos,MYF_RW))
+ return((uint) -1); /* purecov: inspected */
buffpek->key=buffpek->base;
- buffpek->file_pos+= length; /* New filepos */
- buffpek->count-= count;
+ buffpek->file_pos+= length; /* New filepos */
+ buffpek->count-= count;
buffpek->mem_count= count;
}
return (count*sort_length);
} /* read_to_buffer */
- /* Merge buffers to one buffer */
- /* If to_file == 0 then use info->key_write */
+/*
+ Merge buffers to one buffer
+ If to_file == 0 then use info->key_write
+*/
static int NEAR_F
merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
- IO_CACHE *to_file, uchar **sort_keys, BUFFPEK *lastbuff,
- BUFFPEK *Fb, BUFFPEK *Tb)
+ IO_CACHE *to_file, uchar **sort_keys, BUFFPEK *lastbuff,
+ BUFFPEK *Fb, BUFFPEK *Tb)
{
int error;
uint sort_length,maxcount;
@@ -413,8 +712,8 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
sort_length=info->key_length;
if (init_queue(&queue,(uint) (Tb-Fb)+1,offsetof(BUFFPEK,key),0,
- (int (*)(void*, byte *,byte*)) info->key_cmp,
- (void*) info->sort_info))
+ (int (*)(void*, byte *,byte*)) info->key_cmp,
+ (void*) info))
DBUG_RETURN(1); /* purecov: inspected */
for (buffpek= Fb ; buffpek <= Tb ; buffpek++)
@@ -423,7 +722,7 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
buffpek->base= strpos;
buffpek->max_keys=maxcount;
strpos+= (uint) (error=(int) read_to_buffer(from_file,buffpek,
- sort_length));
+ sort_length));
if (error == -1)
goto err; /* purecov: inspected */
queue_insert(&queue,(char*) buffpek);
@@ -436,52 +735,52 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
buffpek=(BUFFPEK*) queue_top(&queue);
if (to_file)
{
- if (my_b_write(to_file,(byte*) buffpek->key,(uint) sort_length))
- {
- error=1; goto err; /* purecov: inspected */
- }
+ if (my_b_write(to_file,(byte*) buffpek->key,(uint) sort_length))
+ {
+ error=1; goto err; /* purecov: inspected */
+ }
}
else
{
- if ((*info->key_write)(info->sort_info,(void*) buffpek->key))
- {
- error=1; goto err; /* purecov: inspected */
- }
+ if ((*info->key_write)(info,(void*) buffpek->key))
+ {
+ error=1; goto err; /* purecov: inspected */
+ }
}
buffpek->key+=sort_length;
if (! --buffpek->mem_count)
{
- if (!(error=(int) read_to_buffer(from_file,buffpek,sort_length)))
- {
- uchar *base=buffpek->base;
- uint max_keys=buffpek->max_keys;
-
- VOID(queue_remove(&queue,0));
-
- /* Put room used by buffer to use in other buffer */
- for (refpek= (BUFFPEK**) &queue_top(&queue);
- refpek <= (BUFFPEK**) &queue_end(&queue);
- refpek++)
- {
- buffpek= *refpek;
- if (buffpek->base+buffpek->max_keys*sort_length == base)
- {
- buffpek->max_keys+=max_keys;
- break;
- }
- else if (base+max_keys*sort_length == buffpek->base)
- {
- buffpek->base=base;
- buffpek->max_keys+=max_keys;
- break;
- }
- }
- break; /* One buffer have been removed */
- }
+ if (!(error=(int) read_to_buffer(from_file,buffpek,sort_length)))
+ {
+ uchar *base=buffpek->base;
+ uint max_keys=buffpek->max_keys;
+
+ VOID(queue_remove(&queue,0));
+
+ /* Put room used by buffer to use in other buffer */
+ for (refpek= (BUFFPEK**) &queue_top(&queue);
+ refpek <= (BUFFPEK**) &queue_end(&queue);
+ refpek++)
+ {
+ buffpek= *refpek;
+ if (buffpek->base+buffpek->max_keys*sort_length == base)
+ {
+ buffpek->max_keys+=max_keys;
+ break;
+ }
+ else if (base+max_keys*sort_length == buffpek->base)
+ {
+ buffpek->base=base;
+ buffpek->max_keys+=max_keys;
+ break;
+ }
+ }
+ break; /* One buffer have been removed */
+ }
}
else if (error == -1)
- goto err; /* purecov: inspected */
- queue_replaced(&queue); /* Top element has been replaced */
+ goto err; /* purecov: inspected */
+ queue_replaced(&queue); /* Top element has been replaced */
}
}
buffpek=(BUFFPEK*) queue_top(&queue);
@@ -492,9 +791,9 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
if (to_file)
{
if (my_b_write(to_file,(byte*) buffpek->key,
- (sort_length*buffpek->mem_count)))
+ (sort_length*buffpek->mem_count)))
{
- error=1; goto err; /* purecov: inspected */
+ error=1; goto err; /* purecov: inspected */
}
}
else
@@ -502,18 +801,18 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
register uchar *end;
strpos= buffpek->key;
for (end=strpos+buffpek->mem_count*sort_length;
- strpos != end ;
- strpos+=sort_length)
+ strpos != end ;
+ strpos+=sort_length)
{
- if ((*info->key_write)(info->sort_info,(void*) strpos))
- {
- error=1; goto err; /* purecov: inspected */
- }
+ if ((*info->key_write)(info,(void*) strpos))
+ {
+ error=1; goto err; /* purecov: inspected */
+ }
}
}
}
while ((error=(int) read_to_buffer(from_file,buffpek,sort_length)) != -1 &&
- error != 0);
+ error != 0);
lastbuff->count=count;
if (to_file)
@@ -524,15 +823,15 @@ err:
} /* merge_buffers */
- /* Do a merge to output-file (save only positions) */
+ /* Do a merge to output-file (save only positions) */
static int NEAR_F
merge_index(MI_SORT_PARAM *info, uint keys, uchar **sort_keys,
- BUFFPEK *buffpek, int maxbuffer, IO_CACHE *tempfile)
+ BUFFPEK *buffpek, int maxbuffer, IO_CACHE *tempfile)
{
DBUG_ENTER("merge_index");
if (merge_buffers(info,keys,tempfile,(IO_CACHE*) 0,sort_keys,buffpek,buffpek,
- buffpek+maxbuffer))
+ buffpek+maxbuffer))
DBUG_RETURN(1); /* purecov: inspected */
DBUG_RETURN(0);
} /* merge_index */
diff --git a/myisammrg/myrg_delete.c b/myisammrg/myrg_delete.c
index 94fa9835d3d..8b89ed62ac1 100644
--- a/myisammrg/myrg_delete.c
+++ b/myisammrg/myrg_delete.c
@@ -18,13 +18,10 @@
#include "myrg_def.h"
-int myrg_delete(
-MYRG_INFO *info,
-const byte *record)
+int myrg_delete(MYRG_INFO *info, const byte *record)
{
if (!info->current_table)
- {
- return(my_errno=HA_ERR_NO_ACTIVE_RECORD);
- }
+ return (my_errno= HA_ERR_NO_ACTIVE_RECORD);
+
return mi_delete(info->current_table->table,record);
}
diff --git a/myisammrg/myrg_extra.c b/myisammrg/myrg_extra.c
index 5434d30a50e..ad17b0f82f2 100644
--- a/myisammrg/myrg_extra.c
+++ b/myisammrg/myrg_extra.c
@@ -22,7 +22,8 @@
#include "myrg_def.h"
-int myrg_extra(MYRG_INFO *info,enum ha_extra_function function)
+int myrg_extra(MYRG_INFO *info,enum ha_extra_function function,
+ void *extra_arg)
{
int error,save_error=0;
MYRG_TABLE *file;
@@ -30,7 +31,11 @@ int myrg_extra(MYRG_INFO *info,enum ha_extra_function function)
DBUG_PRINT("info",("function: %d",(ulong) function));
if (function == HA_EXTRA_CACHE)
+ {
info->cache_in_use=1;
+ info->cache_size= (extra_arg ? *(long*) extra_arg :
+ my_default_record_cache_size);
+ }
else
{
if (function == HA_EXTRA_NO_CACHE || function == HA_EXTRA_RESET)
@@ -41,12 +46,15 @@ int myrg_extra(MYRG_INFO *info,enum ha_extra_function function)
info->last_used_table=info->open_tables;
}
for (file=info->open_tables ; file != info->end_table ; file++)
- if ((error=mi_extra(file->table,function)))
+ {
+ if ((error=mi_extra(file->table, function, extra_arg)))
save_error=error;
+ }
}
DBUG_RETURN(save_error);
}
+
void myrg_extrafunc(MYRG_INFO *info, invalidator_by_filename inv)
{
MYRG_TABLE *file;
diff --git a/myisammrg/myrg_locking.c b/myisammrg/myrg_locking.c
index 41c972f72c0..e5a8d3f3d9d 100644
--- a/myisammrg/myrg_locking.c
+++ b/myisammrg/myrg_locking.c
@@ -20,9 +20,7 @@
#include "myrg_def.h"
-int myrg_lock_database(
-MYRG_INFO *info,
-int lock_type)
+int myrg_lock_database(MYRG_INFO *info, int lock_type)
{
int error,new_error;
MYRG_TABLE *file;
diff --git a/myisammrg/myrg_open.c b/myisammrg/myrg_open.c
index 668744442a6..9360f582958 100644
--- a/myisammrg/myrg_open.c
+++ b/myisammrg/myrg_open.c
@@ -23,10 +23,10 @@
#include "mrg_static.c"
#endif
-/*
+/*
open a MyISAM MERGE table
- if handle_locking is 0 then exit with error if some database is locked
- if handle_locking is 1 then wait if database is locked
+ if handle_locking is 0 then exit with error if some table is locked
+ if handle_locking is 1 then wait if table is locked
*/
@@ -78,7 +78,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
sizeof(name_buff)-1-dir_length));
VOID(cleanup_dirname(buff,name_buff));
}
- if (!(isam=mi_open(buff,mode,test(handle_locking))))
+ if (!(isam=mi_open(buff,mode,(handle_locking?HA_OPEN_WAIT_IF_LOCKED:0))))
goto err;
files++;
last_isam=isam;
diff --git a/myisammrg/myrg_rnext.c b/myisammrg/myrg_rnext.c
index abb9ef95e44..6d657b5926c 100644
--- a/myisammrg/myrg_rnext.c
+++ b/myisammrg/myrg_rnext.c
@@ -25,6 +25,9 @@ int myrg_rnext(MYRG_INFO *info, byte *buf, int inx)
int err;
MI_INFO *mi;
+ if (!info->current_table)
+ return (HA_ERR_KEY_NOT_FOUND);
+
/* at first, do rnext for the table found before */
if ((err=mi_rnext(info->current_table->table,NULL,inx)))
{
diff --git a/myisammrg/myrg_rprev.c b/myisammrg/myrg_rprev.c
index bd7e6a1f6d2..c21ca06dacd 100644
--- a/myisammrg/myrg_rprev.c
+++ b/myisammrg/myrg_rprev.c
@@ -25,6 +25,9 @@ int myrg_rprev(MYRG_INFO *info, byte *buf, int inx)
int err;
MI_INFO *mi;
+ if (!info->current_table)
+ return (HA_ERR_KEY_NOT_FOUND);
+
/* at first, do rprev for the table found before */
if ((err=mi_rprev(info->current_table->table,NULL,inx)))
{
diff --git a/myisammrg/myrg_rrnd.c b/myisammrg/myrg_rrnd.c
index d50d077e6ba..d623ea8ea9c 100644
--- a/myisammrg/myrg_rrnd.c
+++ b/myisammrg/myrg_rrnd.c
@@ -24,7 +24,7 @@
static MYRG_TABLE *find_table(MYRG_TABLE *start,MYRG_TABLE *end,ulonglong pos);
/*
- If filepos == HA_OFFSET_ERROR, read next
+ If filepos == HA_OFFSET_ERROR, read next
Returns same as mi_rrnd:
0 = Ok.
HA_ERR_RECORD_DELETED = Record is deleted.
@@ -48,7 +48,7 @@ int myrg_rrnd(MYRG_INFO *info,byte *buf,ulonglong filepos)
}
isam_info=(info->current_table=info->open_tables)->table;
if (info->cache_in_use)
- mi_extra(isam_info,HA_EXTRA_CACHE);
+ mi_extra(isam_info,HA_EXTRA_CACHE,(byte*) &info->cache_size);
filepos=isam_info->s->pack.header_length;
isam_info->lastinx= (uint) -1; /* Can't forward or backward */
}
@@ -66,13 +66,15 @@ int myrg_rrnd(MYRG_INFO *info,byte *buf,ulonglong filepos)
HA_ERR_END_OF_FILE)
DBUG_RETURN(error);
if (info->cache_in_use)
- mi_extra(info->current_table->table,HA_EXTRA_NO_CACHE);
+ mi_extra(info->current_table->table, HA_EXTRA_NO_CACHE,
+ (byte*) &info->cache_size);
if (info->current_table+1 == info->end_table)
DBUG_RETURN(HA_ERR_END_OF_FILE);
info->current_table++;
info->last_used_table=info->current_table;
if (info->cache_in_use)
- mi_extra(info->current_table->table,HA_EXTRA_CACHE);
+ mi_extra(info->current_table->table, HA_EXTRA_CACHE,
+ (byte*) &info->cache_size);
info->current_table->file_offset=
info->current_table[-1].file_offset+
info->current_table[-1].table->state->data_file_length;
diff --git a/myisammrg/myrg_rsame.c b/myisammrg/myrg_rsame.c
index ddc77f85913..f6b2164dc21 100644
--- a/myisammrg/myrg_rsame.c
+++ b/myisammrg/myrg_rsame.c
@@ -19,12 +19,10 @@
int myrg_rsame(MYRG_INFO *info,byte *record,int inx)
{
if (inx) /* not yet used, should be 0 */
- {
- return(my_errno=HA_ERR_WRONG_INDEX);
- }
+ return (my_errno=HA_ERR_WRONG_INDEX);
+
if (!info->current_table)
- {
- return(my_errno=HA_ERR_NO_ACTIVE_RECORD);
- }
+ return (my_errno=HA_ERR_NO_ACTIVE_RECORD);
+
return mi_rsame(info->current_table->table,record,inx);
}
diff --git a/myisammrg/myrg_update.c b/myisammrg/myrg_update.c
index cb1b0b51ef9..7b9f614b965 100644
--- a/myisammrg/myrg_update.c
+++ b/myisammrg/myrg_update.c
@@ -21,6 +21,7 @@
int myrg_update(register MYRG_INFO *info,const byte *oldrec, byte *newrec)
{
if (!info->current_table)
- return(my_errno=HA_ERR_NO_ACTIVE_RECORD);
+ return (my_errno=HA_ERR_NO_ACTIVE_RECORD);
+
return mi_update(info->current_table->table,oldrec,newrec);
}
diff --git a/myisammrg/myrg_write.c b/myisammrg/myrg_write.c
index 4e597005503..0f191edc23c 100644
--- a/myisammrg/myrg_write.c
+++ b/myisammrg/myrg_write.c
@@ -26,5 +26,5 @@ int myrg_write(register MYRG_INFO *info, byte *rec)
else if (info->merge_insert_method == MERGE_INSERT_TO_LAST)
return mi_write(info->end_table[-1].table,rec);
else /* unsupported insertion method */
- return (my_errno=HA_ERR_WRONG_COMMAND);
+ return (my_errno= HA_ERR_WRONG_COMMAND);
}
diff --git a/mysql-test/include/master-slave.inc b/mysql-test/include/master-slave.inc
index 23392690239..474b1357e9e 100644
--- a/mysql-test/include/master-slave.inc
+++ b/mysql-test/include/master-slave.inc
@@ -7,6 +7,7 @@ connection slave;
!slave stop;
@r/slave-stopped.result show status like 'Slave_running';
connection master;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
connection slave;
reset slave;
@@ -14,3 +15,6 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
@r/slave-running.result show status like 'Slave_running';
+
+# Set the default connection to 'master'
+connection master;
diff --git a/mysql-test/install_test_db.sh b/mysql-test/install_test_db.sh
index b105609693c..104242cc3b1 100644
--- a/mysql-test/install_test_db.sh
+++ b/mysql-test/install_test_db.sh
@@ -117,9 +117,9 @@ fi
if test ! -f $mdata/user.frm
then
c_u="$c_u CREATE TABLE user ("
- c_u="$c_u Host char(60) DEFAULT '' NOT NULL,"
- c_u="$c_u User char(16) DEFAULT '' NOT NULL,"
- c_u="$c_u Password char(16) DEFAULT '' NOT NULL,"
+ c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL,"
+ c_u="$c_u User char(16) binary DEFAULT '' NOT NULL,"
+ c_u="$c_u Password char(16) binary DEFAULT '' NOT NULL,"
c_u="$c_u Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u="$c_u Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u="$c_u Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
@@ -134,20 +134,29 @@ then
c_u="$c_u References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u="$c_u Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u="$c_u Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- c_u="$c_u ssl_type enum('NONE','ANY', 'X509', 'SPECIFIED') NOT NULL,"
- c_u="$c_u ssl_cipher char(60) NULL,"
- c_u="$c_u x509_issuer blob NULL,"
- c_u="$c_u x509_subject blob NULL,"
+ c_u="$c_u Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ c_u="$c_u Super_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ c_u="$c_u Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ c_u="$c_u Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ c_u="$c_u Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ c_u="$c_u Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ c_u="$c_u Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL,"
+ c_u="$c_u ssl_cipher BLOB NOT NULL,"
+ c_u="$c_u x509_issuer BLOB NOT NULL,"
+ c_u="$c_u x509_subject BLOB NOT NULL,"
+ c_u="$c_u max_questions int(11) unsigned DEFAULT 0 NOT NULL,"
+ c_u="$c_u max_updates int(11) unsigned DEFAULT 0 NOT NULL,"
+ c_u="$c_u max_connections int(11) unsigned DEFAULT 0 NOT NULL,"
c_u="$c_u PRIMARY KEY Host (Host,User)"
c_u="$c_u )"
c_u="$c_u comment='Users and global privileges';"
- i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','none',NULL,NULL,NULL);
- INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','none',NULL,NULL,NULL);
- REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','none',NULL,NULL,NULL);
-
- INSERT INTO user VALUES ('localhost','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','none',NULL,NULL,NULL);
- INSERT INTO user VALUES ('$hostname','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','none',NULL,NULL,NULL);"
+ i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
+ INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
+ REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
+ INSERT INTO user (host,user) values ('localhost','');
+ INSERT INTO user (host,user) values ('$hostname','');"
fi
if test ! -f $mdata/func.frm
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index 7ae89c96169..a26b597f8db 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -19,7 +19,7 @@ TZ=GMT-3; export TZ # for UNIX_TIMESTAMP tests to work
# Program Definitions
#--
-PATH=/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin
+PATH=/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11
MASTER_40_ARGS="--rpl-recovery-rank=1 --init-rpl-role=master"
# Standard functions
@@ -93,7 +93,7 @@ FIND=find
GCOV=`which gcov | $SED q`
PRINTF=printf
RM=rm
-TIME=time
+TIME=`which time | $SED q`
TR=tr
XARGS=`which xargs | $SED q`
@@ -234,6 +234,10 @@ while test $# -gt 0; do
--skip-rpl) NO_SLAVE=1 ;;
--skip-test=*) SKIP_TEST=`$ECHO "$1" | $SED -e "s;--skip-test=;;"`;;
--do-test=*) DO_TEST=`$ECHO "$1" | $SED -e "s;--do-test=;;"`;;
+ --warnings | --log-warnings)
+ EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --log-warnings"
+ EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --log-warnings"
+ ;;
--wait-timeout=*)
START_WAIT_TIMEOUT=`$ECHO "$1" | $SED -e "s;--wait-timeout=;;"`
STOP_WAIT_TIMEOUT=$START_WAIT_TIMEOUT;;
@@ -339,6 +343,7 @@ SLAVE_MYPID="$MYRUN_DIR/slave.pid"
SLAVE_MYLOG="$MYSQL_TEST_DIR/var/log/slave.log"
SLAVE_MYERR="$MYSQL_TEST_DIR/var/log/slave.err"
+CURRENT_TEST="$MYSQL_TEST_DIR/var/log/current_test"
SMALL_SERVER="-O key_buffer_size=1M -O sort_buffer=256K -O max_heap_table_size=1M"
export MASTER_MYPORT
@@ -387,7 +392,12 @@ if [ x$SOURCE_DIST = x1 ] ; then
CHARSETSDIR="$BASEDIR/sql/share/charsets"
INSTALL_DB="./install_test_db"
else
- MYSQLD="$BASEDIR/bin/mysqld"
+ if test -x "$BASEDIR/libexec/mysqld"
+ then
+ MYSQLD="$BASEDIR/libexec/mysqld"
+ else
+ MYSQLD="$BASEDIR/bin/mysqld"
+ fi
MYSQL_TEST="$BASEDIR/bin/mysqltest"
MYSQLADMIN="$BASEDIR/bin/mysqladmin"
MYSQL_MANAGER="$BASEDIR/bin/mysqlmanager"
@@ -456,10 +466,6 @@ XTERM=`which xterm`
#++
# Function Definitions
#--
-wait_for_server_start ()
-{
- $MYSQLADMIN --no-defaults -u $DBUSER --silent -O connect_timeout=10 -w2 --host=$hostname --port=$1 ping >/dev/null 2>&1
-}
prompt_user ()
{
@@ -530,6 +536,18 @@ total_inc () {
TOT_TEST=`$EXPR $TOT_TEST + 1`
}
+
+skip_test() {
+ USERT=" ...."
+ SYST=" ...."
+ REALT=" ...."
+ timestr="$USERT $SYST $REALT"
+ pname=`$ECHO "$1 "|$CUT -c 1-24`
+ RES="$pname $timestr"
+ skip_inc
+ $ECHO "$RES$RES_SPACE [ skipped ]"
+}
+
report_stats () {
if [ $TOT_FAIL = 0 ]; then
$ECHO "All $TOT_TEST tests were successful."
@@ -567,7 +585,7 @@ mysql_install_db () {
for slave_num in 1 2 ;
do
- $RM -rf var/slave$slave_num-data/
+ $RM -rf var/slave$slave_num-data
mkdir -p var/slave$slave_num-data/mysql
mkdir -p var/slave$slave_num-data/test
cp var/slave-data/mysql/* var/slave$slave_num-data/mysql
@@ -675,9 +693,9 @@ manager_launch()
ident=$1
shift
if [ $USE_MANAGER = 0 ] ; then
- $@ >$CUR_MYERR 2>&1 &
- sleep 2 #hack
- return
+ $@ >$CUR_MYERR 2>&1 &
+ sleep 2 #hack
+ return
fi
$MYSQL_MANAGER_CLIENT $MANAGER_QUIET_OPT --user=$MYSQL_MANAGER_USER \
--password=$MYSQL_MANAGER_PW --port=$MYSQL_MANAGER_PORT <<EOF
@@ -687,7 +705,7 @@ set_exec_stderr $ident $CUR_MYERR
set_exec_con $ident root localhost $CUR_MYSOCK
start_exec $ident $START_WAIT_TIMEOUT
EOF
- abort_if_failed "Could not execute manager command"
+ abort_if_failed "Could not execute manager command"
}
manager_term()
@@ -845,7 +863,7 @@ start_slave()
master_info="--master-user=root \
--master-connect-retry=1 \
--master-host=127.0.0.1 \
- --master-password= \
+ --master-password="" \
--master-port=$MASTER_MYPORT \
--server-id=$slave_server_id --rpl-recovery-rank=$slave_rpl_rank"
else
@@ -873,7 +891,7 @@ start_slave()
--slave-load-tmpdir=$SLAVE_LOAD_TMPDIR \
--report-host=127.0.0.1 --report-user=root \
--report-port=$slave_port \
- --master-retry-count=5 \
+ --master-retry-count=10 \
-O slave_net_timeout=10 \
$SMALL_SERVER \
$EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT"
@@ -887,13 +905,23 @@ start_slave()
"gdb -x $GDB_SLAVE_INIT" $SLAVE_MYSQLD
elif [ x$DO_GDB = x1 ]
then
- $ECHO "set args $slave_args" > $GDB_SLAVE_INIT
if [ x$MANUAL_GDB = x1 ]
then
+ $ECHO "set args $slave_args" > $GDB_SLAVE_INIT
echo "To start gdb for the slave, type in another window:"
echo "cd $CWD ; gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD"
wait_for_slave=1500
else
+ ( $ECHO set args $slave_args;
+ if [ $USE_MANAGER = 0 ] ; then
+ cat <<EOF
+b mysql_parse
+commands 1
+disa 1
+end
+r
+EOF
+ fi ) > $GDB_SLAVE_INIT
manager_launch $slave_ident $XTERM -display $DISPLAY -title "Slave" -e \
gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD
fi
@@ -1007,6 +1035,7 @@ run_testcase ()
master_init_script=$TESTDIR/$tname-master.sh
slave_init_script=$TESTDIR/$tname-slave.sh
slave_master_info_file=$TESTDIR/$tname-slave-master-info.opt
+ echo $tname > $CURRENT_TEST
SKIP_SLAVE=`$EXPR \( $tname : rpl \) = 0`
if [ $USE_MANAGER = 1 ] ; then
many_slaves=`$EXPR \( $tname : rpl_failsafe \) != 0`
@@ -1016,7 +1045,8 @@ run_testcase ()
SKIP_THIS_TEST=`$EXPR \( $tname : "$SKIP_TEST" \) != 0`
if [ x$SKIP_THIS_TEST = x1 ] ;
then
- return;
+ skip_test $tname;
+ return;
fi
fi
@@ -1024,21 +1054,15 @@ run_testcase ()
DO_THIS_TEST=`$EXPR \( $tname : "$DO_TEST" \) != 0`
if [ x$DO_THIS_TEST = x0 ] ;
then
- return;
+ skip_test $tname;
+ return;
fi
fi
if [ x${NO_SLAVE}x$SKIP_SLAVE = x1x0 ] ;
then
- USERT=" ...."
- SYST=" ...."
- REALT=" ...."
- timestr="$USERT $SYST $REALT"
- pname=`$ECHO "$tname "|$CUT -c 1-24`
- RES="$pname $timestr"
- skip_inc
- $ECHO "$RES$RES_SPACE [ skipped ]"
+ skip_test $tname;
return
fi
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result
index f2cb6437f8f..f666c5311b8 100644
--- a/mysql-test/r/bigint.result
+++ b/mysql-test/r/bigint.result
@@ -17,9 +17,6 @@ a
select * from t1 where a=18446744073709551615;
a
18446744073709551615
-select * from t1 where a='18446744073709551615';
-a
-18446744073709551615
delete from t1 where a=18446744073709551615;
select * from t1;
a
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index f9a3ef487f0..39bd1caee0c 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -152,3 +152,5 @@ t1 CREATE TABLE `t1` (
KEY `b_31` (`b`)
) TYPE=MyISAM
drop table t1;
+create table t1 select if(1,'1','0'), month("2002-08-02");
+drop table t1;
diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result
index 58ed0dfdbf3..e5ae6f249ee 100644
--- a/mysql-test/r/ctype_latin1_de.result
+++ b/mysql-test/r/ctype_latin1_de.result
@@ -192,7 +192,7 @@ strcmp('ßa','ss') strcmp('ssa','ß') strcmp('sssb','sßa') strcmp('ß','s')
select strcmp('u','öa'),strcmp('u','ö');
strcmp('u','öa') strcmp('u','ö')
1 1
-create table t1 (a varchar(10), key(a));
+create table t1 (a varchar(10), key(a), fulltext (a));
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
select * from t1 where a like "abc%";
a
@@ -204,4 +204,7 @@ test
select * from t1 where a like "te_t";
a
test
+select * from t1 where match a against ("te*" in boolean mode)+0;
+a
+test
drop table t1;
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result
index e347a95b037..312e7893949 100644
--- a/mysql-test/r/distinct.result
+++ b/mysql-test/r/distinct.result
@@ -349,3 +349,33 @@ select distinct a from t1 where a >= '1' order by a desc;
a
1
drop table t1;
+CREATE TABLE t1 (email varchar(50), infoID BIGINT, dateentered
+DATETIME);
+CREATE TABLE t2 (infoID BIGINT, shipcode varchar(10));
+INSERT INTO t1 (email, infoID, dateentered) VALUES
+('test1@testdomain.com', 1, '2002-07-30 22:56:38'),
+('test1@testdomain.com', 1, '2002-07-27 22:58:16'),
+('test2@testdomain.com', 1, '2002-06-19 15:22:19'),
+('test2@testdomain.com', 2, '2002-06-18 14:23:47'),
+('test3@testdomain.com', 1, '2002-05-19 22:17:32');
+INSERT INTO t2(infoID, shipcode) VALUES
+(1, 'Z001'),
+(2, 'R002');
+SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID;
+email shipcode
+test1@testdomain.com Z001
+test2@testdomain.com Z001
+test3@testdomain.com Z001
+test2@testdomain.com R002
+SELECT DISTINCTROW email FROM t1 ORDER BY dateentered DESC;
+email
+test1@testdomain.com
+test2@testdomain.com
+test3@testdomain.com
+SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID ORDER BY dateentered DESC;
+email shipcode
+test1@testdomain.com Z001
+test2@testdomain.com Z001
+test2@testdomain.com R002
+test3@testdomain.com Z001
+drop table t1,t2;
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index e6598ca9ca4..e71190130ed 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -70,6 +70,8 @@ Full-text search in MySQL implements vector space model 0
select * from t1 where MATCH a,b AGAINST ("+call* +coll*" IN BOOLEAN MODE);
a b
Full-text indexes are called collections
+select * from t1 where MATCH a,b AGAINST ('"support now"' IN BOOLEAN MODE);
+a b
select * from t1 where MATCH a,b AGAINST ('"Now sUPPort"' IN BOOLEAN MODE);
a b
MySQL has now support for full-text search
@@ -192,3 +194,12 @@ a b
2 fullaaa fullzzz
1 I wonder why the fulltext index doesnt work?
drop table t1;
+CREATE TABLE t1 ( id int(11) NOT NULL auto_increment primary key, mytext text NOT NULL, FULLTEXT KEY mytext (mytext)) TYPE=MyISAM;
+INSERT INTO t1 VALUES (1,'my small mouse'),(2,'la-la-la'),(3,'It is so funny'),(4,'MySQL Tutorial');
+select 8 from t1;
+8
+8
+8
+8
+8
+drop table t1;
diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result
index 16fb0358d51..0ab41258091 100644
--- a/mysql-test/r/func_if.result
+++ b/mysql-test/r/func_if.result
@@ -46,3 +46,9 @@ select sum(if(num is null,0.00,num)) from t1;
sum(if(num is null,0.00,num))
144.54
drop table t1;
+create table t1 (x int, y int);
+insert into t1 values (0,6),(10,16),(20,26),(30,10),(40,46),(50,56);
+select min(if(y -x > 5,y,NULL)), max(if(y - x > 5,y,NULL)) from t1;
+min(if(y -x > 5,y,NULL)) max(if(y - x > 5,y,NULL))
+6 56
+drop table t1;
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index f067d1f651e..f1c0de2f88a 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -16,9 +16,18 @@ round(5.64,1) round(5.64,2) round(5.64,-1) round(5.64,-2)
select abs(-10), sign(-5), sign(5), sign(0);
abs(-10) sign(-5) sign(5) sign(0)
10 -1 1 0
-select log(exp(10)),exp(log(sqrt(10))*2);
-log(exp(10)) exp(log(sqrt(10))*2)
-10.000000 10.000000
+select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2);
+log(exp(10)) exp(log(sqrt(10))*2) log(-1) log(NULL) log(1,1) log(3,9) log(-1,2) log(NULL,2)
+10.000000 10.000000 NULL NULL NULL 2.000000 NULL NULL
+select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
+ln(exp(10)) exp(ln(sqrt(10))*2) ln(-1) ln(0) ln(NULL)
+10.000000 10.000000 NULL NULL NULL
+select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
+log2(8) log2(15) log2(-2) log2(0) log2(NULL)
+3.000000 3.906891 NULL NULL NULL
+select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
+log10(100) log10(18) log10(-4) log10(0) log10(NULL)
+2.000000 1.255273 NULL NULL NULL
select pow(10,log10(10)),power(2,4);
pow(10,log10(10)) power(2,4)
10.000000 16.000000
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index a58f3c57169..dd5e5191536 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -83,6 +83,36 @@ soundex('') soundex('he') soundex('hello all folks')
select md5('hello');
md5('hello')
5d41402abc4b2a76b9719d911017c592
+select sha('abc');
+sha('abc')
+a9993e364706816aba3e25717850c26c9cd0d89d
+select sha1('abc');
+sha1('abc')
+a9993e364706816aba3e25717850c26c9cd0d89d
+select aes_decrypt(aes_encrypt('abc','1'),'1');
+aes_decrypt(aes_encrypt('abc','1'),'1')
+abc
+select aes_decrypt(aes_encrypt('abc','1'),1);
+aes_decrypt(aes_encrypt('abc','1'),1)
+abc
+select aes_encrypt(NULL,"a");
+aes_encrypt(NULL,"a")
+NULL
+select aes_encrypt("a",NULL);
+aes_encrypt("a",NULL)
+NULL
+select aes_decrypt(NULL,"a");
+aes_decrypt(NULL,"a")
+NULL
+select aes_decrypt("a",NULL);
+aes_decrypt("a",NULL)
+NULL
+select aes_decrypt("a","a");
+aes_decrypt("a","a")
+NULL
+select aes_decrypt(aes_encrypt("","a"),"a");
+aes_decrypt(aes_encrypt("","a"),"a")
+
select repeat('monty',5),concat('*',space(5),'*');
repeat('monty',5) concat('*',space(5),'*')
montymontymontymontymonty * *
@@ -116,6 +146,15 @@ decode(encode(repeat("a",100000),"monty"),"monty")=repeat("a",100000)
select decode(encode("abcdef","monty"),"monty")="abcdef";
decode(encode("abcdef","monty"),"monty")="abcdef"
1
+select quote('\'\"\\test');
+quote('\'\"\\test')
+'\'"\\test'
+select quote(concat('abc\'', '\\cba'));
+quote(concat('abc\'', '\\cba'))
+'abc\'\\cba'
+select quote(1/0), quote('\0\Z');
+quote(1/0) quote('\0\Z')
+NULL '\0\Z'
select reverse("");
reverse("")
diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result
index deea5b8bb8b..8cfae44b9dd 100644
--- a/mysql-test/r/func_test.result
+++ b/mysql-test/r/func_test.result
@@ -40,6 +40,12 @@ select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,
select -1.49 or -1.49,0.6 or 0.6;
-1.49 or -1.49 0.6 or 0.6
1 1
+select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
+3 ^ 11 1 ^ 1 1 ^ 0 1 ^ NULL NULL ^ 1
+8 0 1 NULL NULL
+select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
+1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL
+0 1 1 0 NULL NULL NULL
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
0 1
diff --git a/mysql-test/r/grant_cache.result b/mysql-test/r/grant_cache.result
index d236c26d71a..3892765f587 100644
--- a/mysql-test/r/grant_cache.result
+++ b/mysql-test/r/grant_cache.result
@@ -104,11 +104,11 @@ a
1
2
select c from t1;
-select command denied to user: 'mysqltest_3@localhost' for column 'c' in table 't1'
+SELECT command denied to user: 'mysqltest_3@localhost' for column 'c' in table 't1'
select * from t2;
select command denied to user: 'mysqltest_3@localhost' for table 't2'
select mysqltest.t1.c from test.t1,mysqltest.t1;
-select command denied to user: 'mysqltest_3@localhost' for column 'c' in table 't1'
+SELECT command denied to user: 'mysqltest_3@localhost' for column 'c' in table 't1'
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 6
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index aaa03f2668a..fd0248d5ee6 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -375,21 +375,45 @@ hijklm 2
DROP TABLE t1;
drop table if exists t1;
create table t1 (One int unsigned, Two int unsigned, Three int unsigned, Four int unsigned);
-insert into t1 values (1,2,1,4);
-insert into t1 values (1,2,2,4);
-insert into t1 values (1,2,3,4);
-insert into t1 values (1,2,4,4);
-insert into t1 values (1,1,1,4);
-insert into t1 values (1,1,2,4);
-insert into t1 values (1,1,3,4);
-insert into t1 values (1,1,4,4);
-insert into t1 values (1,3,1,4);
-insert into t1 values (1,3,2,4);
-insert into t1 values (1,3,3,4);
-insert into t1 values (1,3,4,4);
+insert into t1 values (1,2,1,4),(1,2,2,4),(1,2,3,4),(1,2,4,4),(1,1,1,4),(1,1,2,4),(1,1,3,4),(1,1,4,4),(1,3,1,4),(1,3,2,4),(1,3,3,4),(1,3,4,4);
select One, Two, sum(Four) from t1 group by One,Two;
One Two sum(Four)
1 1 16
1 2 16
1 3 16
-drop table if exists t1;
+drop table t1;
+create table t1 (id integer primary key not null auto_increment, gender char(1));
+insert into t1 values (NULL, 'M'), (NULL, 'F'),(NULL, 'F'),(NULL, 'F'),(NULL, 'M');
+create table t2 (user_id integer not null, date date);
+insert into t2 values (1, '2002-06-09'),(2, '2002-06-09'),(1, '2002-06-09'),(3, '2002-06-09'),(4, '2002-06-09'),(4, '2002-06-09');
+select u.gender as gender, count(distinct u.id) as dist_count, (count(distinct u.id)/5*100) as percentage from t1 u, t2 l where l.user_id = u.id group by u.gender;
+gender dist_count percentage
+F 3 60.00
+M 1 20.00
+select u.gender as gender, count(distinct u.id) as dist_count, (count(distinct u.id)/5*100) as percentage from t1 u, t2 l where l.user_id = u.id group by u.gender order by percentage;
+gender dist_count percentage
+M 1 20.00
+F 3 60.00
+drop table t1,t2;
+CREATE TABLE t1 (ID1 int, ID2 int, ID int NOT NULL AUTO_INCREMENT,PRIMARY KEY(ID
+));
+insert into t1 values (1,244,NULL),(2,243,NULL),(134,223,NULL),(185,186,NULL);
+select S.ID as xID, S.ID1 as xID1 from t1 as S left join t1 as yS on S.ID1 between yS.ID1 and yS.ID2;
+xID xID1
+1 1
+2 2
+2 2
+3 134
+3 134
+3 134
+4 185
+4 185
+4 185
+4 185
+select S.ID as xID, S.ID1 as xID1, repeat('*',count(distinct yS.ID)) as Level from t1 as S left join t1 as yS on S.ID1 between yS.ID1 and yS.ID2 group by xID order by xID1;
+xID xID1 Level
+1 1 *
+2 2 **
+3 134 ***
+4 185 ****
+drop table t1;
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index b75248b5d5a..a233645fef5 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -920,12 +920,6 @@ create table t1 (t int not null default 1, key (t)) type=innodb;
desc t1;
Field Type Null Key Default Extra
t int(11) MUL 1
-handler t1 open t1;
-Table handler for 't1' doesn't have this option
-handler t1 read t first;
-Unknown table 't1' in HANDLER
-handler t1 close;
-Unknown table 't1' in HANDLER
drop table t1;
CREATE TABLE t1 (
number bigint(20) NOT NULL default '0',
@@ -989,3 +983,41 @@ select * from t2;
number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
333 tubs 99 2 20020109113453 501 20020109113453 500 3 10 0
drop table t1,t2;
+create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=innodb;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+SELECT @@tx_isolation,@@global.tx_isolation;
+@@tx_isolation @@tx_isolation
+SERIALIZABLE READ-COMMITTED
+insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David');
+select id, code, name from t1 order by id;
+id code name
+1 1 Tim
+2 1 Monty
+3 2 David
+COMMIT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+insert into t1 (code, name) values (2, 'Erik'), (3, 'Sasha');
+select id, code, name from t1 order by id;
+id code name
+1 1 Tim
+2 1 Monty
+3 2 David
+4 2 Erik
+5 3 Sasha
+COMMIT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt');
+select id, code, name from t1 order by id;
+id code name
+1 1 Tim
+2 1 Monty
+3 2 David
+4 2 Erik
+5 3 Sasha
+6 3 Jeremy
+7 4 Matt
+COMMIT;
+DROP TABLE t1;
diff --git a/mysql-test/r/innodb_handler.result b/mysql-test/r/innodb_handler.result
new file mode 100644
index 00000000000..73368c932af
--- /dev/null
+++ b/mysql-test/r/innodb_handler.result
@@ -0,0 +1,139 @@
+drop table if exists t1;
+create table t1 (a int, b char(10), key a(a), key b(a,b)) type=innodb;
+insert into t1 values
+(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
+(14,"aaa"),(15,"bbb"),(16,"ccc"),(16,"xxx"),
+(20,"ggg"),(21,"hhh"),(22,"iii");
+handler t1 open as t2;
+handler t2 read a first;
+a b
+14 aaa
+handler t2 read a next;
+a b
+15 bbb
+handler t2 read a next;
+a b
+16 ccc
+handler t2 read a prev;
+a b
+15 bbb
+handler t2 read a last;
+a b
+22 iii
+handler t2 read a prev;
+a b
+21 hhh
+handler t2 read a prev;
+a b
+20 ggg
+handler t2 read a first;
+a b
+14 aaa
+handler t2 read a prev;
+a b
+handler t2 read a last;
+a b
+22 iii
+handler t2 read a prev;
+a b
+21 hhh
+handler t2 read a next;
+a b
+22 iii
+handler t2 read a next;
+a b
+handler t2 read a=(15);
+a b
+15 bbb
+handler t2 read a=(16);
+a b
+16 ccc
+handler t2 read a=(19,"fff");
+Too many key parts specified. Max 1 parts allowed
+handler t2 read b=(19,"fff");
+a b
+19 fff
+handler t2 read b=(19,"yyy");
+a b
+19 yyy
+handler t2 read b=(19);
+a b
+19 fff
+handler t1 read a last;
+Unknown table 't1' in HANDLER
+handler t2 read a=(11);
+a b
+handler t2 read a>=(11);
+a b
+14 aaa
+handler t2 read a=(18);
+a b
+18 eee
+handler t2 read a>=(18);
+a b
+18 eee
+handler t2 read a>(18);
+a b
+19 fff
+handler t2 read a<=(18);
+a b
+18 eee
+handler t2 read a<(18);
+a b
+17 ddd
+handler t2 read a first limit 5;
+a b
+14 aaa
+15 bbb
+16 ccc
+16 xxx
+17 ddd
+handler t2 read a next limit 3;
+a b
+18 eee
+19 fff
+19 yyy
+handler t2 read a prev limit 10;
+a b
+19 fff
+18 eee
+17 ddd
+16 xxx
+16 ccc
+15 bbb
+14 aaa
+handler t2 read a>=(16) limit 4;
+a b
+16 ccc
+16 xxx
+17 ddd
+18 eee
+handler t2 read a>=(16) limit 2,2;
+a b
+17 ddd
+18 eee
+handler t2 read a last limit 3;
+a b
+22 iii
+21 hhh
+20 ggg
+handler t2 read a=(19);
+a b
+19 fff
+handler t2 read a=(19) where b="yyy";
+a b
+19 yyy
+handler t2 read first;
+a b
+17 ddd
+handler t2 read next;
+a b
+18 eee
+alter table t1 type=innodb;
+handler t2 read next;
+a b
+19 fff
+handler t2 read last;
+You have an error in your SQL syntax near '' at line 1
+handler t2 close;
+drop table if exists t1;
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index f57efa33020..b27cbb46210 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -19,3 +19,31 @@ insert into t1 values (0,"mysql a");
insert into t1 values (0,"r1manic");
insert into t1 values (0,"r1man");
drop table t1;
+create table t1 (a int not null auto_increment, primary key (a), t timestamp, c char(10) default "hello", i int);
+insert into t1 values (default,default,default,default), (default,default,default,default), (4,0,"a",5),(default,default,default,default);
+select a,t>0,c,i from t1;
+a t>0 c i
+1 1 hello NULL
+2 1 hello NULL
+4 0 a 5
+5 1 hello NULL
+truncate table t1;
+insert into t1 set a=default,t=default,c=default;
+insert into t1 set a=default,t=default,c=default,i=default;
+insert into t1 set a=4,t=0,c="a",i=5;
+insert into t1 set a=5,t=0,c="a",i=null;
+insert into t1 set a=default,t=default,c=default,i=default;
+select a,t>0,c,i from t1;
+a t>0 c i
+1 1 hello NULL
+2 1 hello NULL
+4 0 a 5
+5 0 a NULL
+6 1 hello NULL
+drop table t1;
+drop database if exists foo;
+create database foo;
+use foo;
+create table t1 (c int);
+insert into foo.t1 set foo.t1.c = '1';
+drop database foo;
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index d61b6c67030..e24c3179a0c 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -61,7 +61,7 @@ SELECT 1618,icone,contenu,pseudo,date,signature,ip FROM crash2
WHERE numeropost=9 ORDER BY numreponse ASC;
show variables like '%bulk%';
Variable_name Value
-myisam_bulk_insert_tree_size 8388608
+bulk_insert_buffer_size 8388608
INSERT INTO crash1 (numeropost,icone,contenu,pseudo,date,signature,ip)
SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM crash2
WHERE numeropost=9 ORDER BY numreponse ASC;
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index 6dfe0809e7f..1cd9c9dfe79 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -147,3 +147,34 @@ t1 0 e 1 e A 0 NULL NULL BTREE
t1 0 b 1 b A NULL NULL NULL YES BTREE
t1 1 c 1 c A NULL NULL NULL YES BTREE
drop table t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT,
+UNIQUE (c,i));
+INSERT INTO t1 (c) VALUES (NULL),(NULL);
+SELECT * FROM t1;
+c i
+ 1
+ 2
+INSERT INTO t1 (c) VALUES ('a'),('a');
+SELECT * FROM t1;
+c i
+ 1
+ 2
+a 1
+a 2
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c CHAR(10) NULL, i INT NOT NULL AUTO_INCREMENT,
+UNIQUE (c,i));
+INSERT INTO t1 (c) VALUES (NULL),(NULL);
+SELECT * FROM t1;
+c i
+NULL 1
+NULL 2
+INSERT INTO t1 (c) VALUES ('a'),('a');
+SELECT * FROM t1;
+c i
+NULL 1
+NULL 2
+a 1
+a 2
+drop table t1;
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 6de77f7bdaa..8b617a328a8 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -275,12 +275,12 @@ a b
1 2
drop table t3,t1,t2;
drop table if exists t6, t5, t4, t3, t2, t1;
-create table t1 (a int not null, b int not null, key(a,b));
-create table t2 (a int not null, b int not null, key(a,b));
+create table t1 (a int not null, b int not null auto_increment, primary key(a,b));
+create table t2 (a int not null, b int not null auto_increment, primary key(a,b));
create table t3 (a int not null, b int not null, key(a,b)) UNION=(t1,t2) INSERT_METHOD=NO;
create table t4 (a int not null, b int not null, key(a,b)) TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=NO;
-create table t5 (a int not null, b int not null, key(a,b)) TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST;
-create table t6 (a int not null, b int not null, key(a,b)) TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;
+create table t5 (a int not null, b int not null auto_increment, primary key(a,b)) TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST;
+create table t6 (a int not null, b int not null auto_increment, primary key(a,b)) TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
@@ -299,18 +299,18 @@ show create table t5;
Table Create Table
t5 CREATE TABLE `t5` (
`a` int(11) NOT NULL default '0',
- `b` int(11) NOT NULL default '0',
- KEY `a` (`a`,`b`)
+ `b` int(11) NOT NULL auto_increment,
+ PRIMARY KEY (`a`,`b`)
) TYPE=MRG_MyISAM INSERT_METHOD=FIRST UNION=(t1,t2)
show create table t6;
Table Create Table
t6 CREATE TABLE `t6` (
`a` int(11) NOT NULL default '0',
- `b` int(11) NOT NULL default '0',
- KEY `a` (`a`,`b`)
+ `b` int(11) NOT NULL auto_increment,
+ PRIMARY KEY (`a`,`b`)
) TYPE=MRG_MyISAM INSERT_METHOD=LAST UNION=(t1,t2)
-insert into t1 values (1,1),(1,2),(1,3),(1,4);
-insert into t2 values (2,1),(2,2),(2,3),(2,4);
+insert into t1 values (1,NULL),(1,NULL),(1,NULL),(1,NULL);
+insert into t2 values (2,NULL),(2,NULL),(2,NULL),(2,NULL);
select * from t3 order by b,a limit 3;
a b
select * from t4 order by b,a limit 3;
@@ -461,4 +461,83 @@ a b
5 2
6 1
6 2
+select 1;
+1
+1
+insert into t5 values (1,NULL),(5,NULL);
+insert into t6 values (2,NULL),(6,NULL);
+select * from t1 order by a,b;
+a b
+1 1
+1 2
+1 3
+1 4
+1 5
+4 1
+4 2
+5 1
+5 2
+5 3
+select * from t2 order by a,b;
+a b
+2 1
+2 2
+2 3
+2 4
+2 5
+6 1
+6 2
+6 3
+select * from t5 order by a,b;
+a b
+1 1
+1 2
+1 3
+1 4
+1 5
+2 1
+2 2
+2 3
+2 4
+2 5
+4 1
+4 2
+5 1
+5 2
+5 3
+6 1
+6 2
+6 3
+select * from t6 order by a,b;
+a b
+1 1
+1 2
+1 3
+1 4
+1 5
+2 1
+2 2
+2 3
+2 4
+2 5
+4 1
+4 2
+5 1
+5 2
+5 3
+6 1
+6 2
+6 3
drop table if exists t6, t5, t4, t3, t2, t1;
+CREATE TABLE t1 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) TYPE=MyISAM;
+INSERT INTO t1 VALUES (1,1), (2,1);
+CREATE TABLE t2 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) TYPE=MyISAM;
+INSERT INTO t2 VALUES (1,2), (2,2);
+CREATE TABLE t ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', KEY a (a,b)) TYPE=MRG_MyISAM UNION=(t1,t2);
+select max(b) from t where a = 2;
+max(b)
+NULL
+select max(b) from t1 where a = 2;
+max(b)
+1
+drop table if exists t,t1,t2;
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index 85819d9571d..328eb9b394e 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -66,3 +66,72 @@ select count(*) from t3 where id3;
count(*)
0
drop table t1,t2,t3;
+create table t1(id1 int not null primary key, t varchar(100)) pack_keys = 1;
+create table t2(id2 int not null, t varchar(100), index(id2)) pack_keys = 1;
+delete t1 from t1,t2 where t1.id1 = t2.id2 and t1.id1 > 500;
+drop table t1,t2;
+DROP TABLE IF EXISTS a,b,c;
+CREATE TABLE a (
+id int(11) NOT NULL default '0',
+name varchar(10) default NULL,
+PRIMARY KEY (id)
+) TYPE=MyISAM;
+INSERT INTO a VALUES (1,'aaa'),(2,'aaa'),(3,'aaa');
+CREATE TABLE b (
+id int(11) NOT NULL default '0',
+name varchar(10) default NULL,
+PRIMARY KEY (id)
+) TYPE=MyISAM;
+INSERT INTO b VALUES (2,'bbb'),(3,'bbb'),(4,'bbb');
+CREATE TABLE c (
+id int(11) NOT NULL default '0',
+mydate datetime default NULL,
+PRIMARY KEY (id)
+) TYPE=MyISAM;
+INSERT INTO c VALUES (1,'2002-02-04 00:00:00'),(3,'2002-05-12 00:00:00'),(5,'2002-05-12 00:00:00'),(6,'2002-06-22
+00:00:00'),(7,'2002-07-22 00:00:00');
+delete a,b,c from a,b,c
+where to_days(now())-to_days(c.mydate)>=30
+and c.id=a.id and c.id=b.id;
+select * from c;
+id mydate
+1 2002-02-04 00:00:00
+5 2002-05-12 00:00:00
+6 2002-06-22 00:00:00
+7 2002-07-22 00:00:00
+DROP TABLE IF EXISTS a,b,c;
+drop table if exists parent, child;
+CREATE TABLE IF NOT EXISTS `parent` (
+`id` int(11) NOT NULL auto_increment,
+`tst` text,
+`tst1` text,
+PRIMARY KEY (`id`)
+) TYPE=MyISAM;
+CREATE TABLE IF NOT EXISTS `child` (
+`ID` int(11) NOT NULL auto_increment,
+`ParId` int(11) default NULL,
+`tst` text,
+`tst1` text,
+PRIMARY KEY (`ID`),
+KEY `IX_ParId_child` (`ParId`),
+FOREIGN KEY (`ParId`) REFERENCES `test.parent` (`id`)
+) TYPE=MyISAM;
+INSERT INTO parent(tst,tst1)
+VALUES("MySQL","MySQL AB"), ("MSSQL","Microsoft"), ("ORACLE","ORACLE");
+INSERT INTO child(ParId)
+VALUES(1), (2), (3);
+select * from child;
+ID ParId tst tst1
+1 1 NULL NULL
+2 2 NULL NULL
+3 3 NULL NULL
+UPDATE child, parent
+SET child.tst = parent.tst,
+child.tst1 = parent.tst1
+WHERE child.ParId = parent.Id;
+select * from child;
+ID ParId tst tst1
+1 1 MySQL MySQL AB
+2 2 MSSQL Microsoft
+3 3 ORACLE ORACLE
+drop table parent, child;
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index fb18841ac3f..d1de03712ba 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -75,3 +75,28 @@ explain select a,b,c from t1;
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 4
drop table t1;
+CREATE TABLE `t1` (
+`post_id` mediumint(8) unsigned NOT NULL auto_increment,
+`topic_id` mediumint(8) unsigned NOT NULL default '0',
+`post_time` datetime NOT NULL default '0000-00-00 00:00:00',
+`post_text` text NOT NULL,
+`icon_url` varchar(10) NOT NULL default '',
+`sign` tinyint(1) unsigned NOT NULL default '0',
+`post_edit` varchar(150) NOT NULL default '',
+`poster_login` varchar(35) NOT NULL default '',
+`ip` varchar(15) NOT NULL default '',
+PRIMARY KEY (`post_id`),
+KEY `post_time` (`post_time`),
+KEY `ip` (`ip`),
+KEY `poster_login` (`poster_login`),
+KEY `topic_id` (`topic_id`),
+FULLTEXT KEY `post_text` (`post_text`)
+) TYPE=MyISAM;
+INSERT INTO t1 (post_text) VALUES ('ceci est un test'),('ceci est un test'),('ceci est un test'),('ceci est un test'),('ceci est un test');
+REPAIR TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
new file mode 100644
index 00000000000..52bd83df5ed
--- /dev/null
+++ b/mysql-test/r/olap.result
@@ -0,0 +1,27 @@
+drop table if exists sales;
+create table sales ( product varchar(32), country varchar(32), year int, profit int);
+insert into sales values ( 'Computer', 'India',2000, 1200),
+( 'TV', 'United States', 1999, 150),
+( 'Calculator', 'United States', 1999,50),
+( 'Computer', 'United States', 1999,1500),
+( 'Computer', 'United States', 2000,1500),
+( 'TV', 'United States', 2000, 150),
+( 'TV', 'India', 2000, 100),
+( 'TV', 'India', 2000, 100),
+( 'Calculator', 'United States', 2000,75),
+( 'Calculator', 'India', 2000,75),
+( 'TV', 'India', 1999, 100),
+( 'Computer', 'India', 1999,1200),
+( 'Computer', 'United States', 2000,1500),
+( 'Calculator', 'United States', 2000,75);
+select product, country , year, sum(profit) from sales group by product, country, year with cube;
+This version of MySQL doesn't yet support 'CUBE'
+explain select product, country , year, sum(profit) from sales group by product, country, year with cube;
+This version of MySQL doesn't yet support 'CUBE'
+select product, country , year, sum(profit) from sales group by product, country, year with rollup;
+This version of MySQL doesn't yet support 'ROLLUP'
+explain select product, country , year, sum(profit) from sales group by product, country, year with rollup;
+This version of MySQL doesn't yet support 'ROLLUP'
+select product, country , year, sum(profit) from sales group by product, country, year with cube union all select product, country , year, sum(profit) from sales group by product, country, year with rollup;
+This version of MySQL doesn't yet support 'CUBE'
+drop table sales;
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index af14575a812..7c53074b6da 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -226,7 +226,7 @@ show status like "Qcache_free_blocks";
Variable_name Value
Qcache_free_blocks 1
drop table t1, t2, t3, t11, t21;
-set sql_query_cache_type=demand;
+set query_cache_type=demand;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
select * from t1;
@@ -242,7 +242,7 @@ a
1
2
3
-set sql_query_cache_type=2;
+set query_cache_type=2;
select sql_cache * from t1;
a
1
@@ -254,7 +254,7 @@ Qcache_hits 4
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
-set sql_query_cache_type=on;
+set query_cache_type=on;
reset query cache;
show status like "Qcache_queries_in_cache";
Variable_name Value
@@ -490,3 +490,39 @@ drop table t1;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
+set GLOBAL query_cache_size=1000;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 0
+set GLOBAL query_cache_size=1100;
+set GLOBAL query_cache_size=1200;
+set GLOBAL query_cache_size=1300;
+set GLOBAL query_cache_size=1400;
+set GLOBAL query_cache_size=1500;
+set GLOBAL query_cache_size=1600;
+set GLOBAL query_cache_size=1700;
+set GLOBAL query_cache_size=1800;
+set GLOBAL query_cache_size=1900;
+show global variables like "query_cache_size";
+Variable_name Value
+query_cache_size 1024
+set GLOBAL query_cache_size=1048576;
+create table t1 (i int not null);
+create table t2 (i int not null);
+select * from t1;
+i
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+create temporary table t3 (i int not null);
+select * from t2;
+i
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+select * from t3;
+i
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+drop table t1, t2, t3;
diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result
index 60a5db1de3a..2dc21e86152 100644
--- a/mysql-test/r/rpl000001.result
+++ b/mysql-test/r/rpl000001.result
@@ -1,10 +1,10 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
-use test;
-drop table if exists t1,t3;
+drop table if exists t1,t2,t3;
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
load data local infile 'MYSQL_TEST_DIR/std_data/words.dat' into table t1;
@@ -30,11 +30,12 @@ abandoned
abandoning
abandonment
abandons
+slave stop;
set password for root@"localhost" = password('foo');
+slave start;
set password for root@"localhost" = password('');
create table t3(n int);
insert into t3 values(1),(2);
-use test;
select * from t3;
n
1
@@ -46,7 +47,6 @@ drop table t1,t3;
reset master;
slave stop;
reset slave;
-drop table if exists t1,t2;
create table t1(n int);
select get_lock("hold_slave",10);
get_lock("hold_slave",10)
@@ -58,8 +58,8 @@ release_lock("hold_slave")
unlock tables;
create table t2(id int);
insert into t2 values(connection_id());
-create temporary table t1_temp(n int);
-insert into t1_temp select get_lock('crash_lock%20C', 1) from t2;
+create temporary table t3(n int);
+insert into t3 select get_lock('crash_lock%20C', 1) from t2;
update t1 set n = n + get_lock('crash_lock%20C', 2);
select (@id := id) - id from t2;
(@id := id) - id
@@ -67,7 +67,7 @@ select (@id := id) - id from t2;
kill @id;
drop table t2;
Server shutdown in progress
-set sql_slave_skip_counter=1;
+set global sql_slave_skip_counter=1;
slave start;
select count(*) from t1;
count(*)
@@ -75,17 +75,15 @@ count(*)
drop table t1;
create table t1 (n int);
insert into t1 values(3456);
-use mysql;
-insert into user (Host, User, Password)
+insert into mysql.user (Host, User, Password)
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
select select_priv,user from mysql.user where user = 'blafasel2';
select_priv user
N blafasel2
-update user set Select_priv = "Y" where User="blafasel2";
+update mysql.user set Select_priv = "Y" where User="blafasel2";
select select_priv,user from mysql.user where user = 'blafasel2';
select_priv user
Y blafasel2
-use test;
select n from t1;
n
3456
diff --git a/mysql-test/r/rpl000002.result b/mysql-test/r/rpl000002.result
index 88228321897..4c2b3bdfde6 100644
--- a/mysql-test/r/rpl000002.result
+++ b/mysql-test/r/rpl000002.result
@@ -1,14 +1,13 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
-use test;
drop table if exists t1;
create table t1 (n int auto_increment primary key);
set insert_id = 2000;
insert into t1 values (NULL),(NULL),(NULL);
-use test;
select * from t1;
n
2000
@@ -16,7 +15,7 @@ n
2002
show slave hosts;
Server_id Host Port Rpl_recovery_rank Master_id
-2 127.0.0.1 $SLAVE_MYPORT 2 1
+2 127.0.0.1 9999 2 1
drop table t1;
slave stop;
drop table if exists t2;
diff --git a/mysql-test/r/rpl000003.result b/mysql-test/r/rpl000003.result
index eb64d1855b1..b123b3d98c5 100644
--- a/mysql-test/r/rpl000003.result
+++ b/mysql-test/r/rpl000003.result
@@ -1,4 +1,5 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/r/rpl000004.result b/mysql-test/r/rpl000004.result
index e5dee880f73..82b208d0b58 100644
--- a/mysql-test/r/rpl000004.result
+++ b/mysql-test/r/rpl000004.result
@@ -1,9 +1,9 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
-use test;
set SQL_LOG_BIN=0;
drop table if exists t1;
create table t1 (word char(20) not null, index(word));
@@ -12,7 +12,6 @@ drop table if exists t2;
create table t2 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t2;
create table t3 (word char(20) not null primary key);
-use test;
drop table if exists t1;
load table t1 from master;
drop table if exists t2;
diff --git a/mysql-test/r/rpl000005.result b/mysql-test/r/rpl000005.result
index 0c91f984db1..3e9028bf2cf 100644
--- a/mysql-test/r/rpl000005.result
+++ b/mysql-test/r/rpl000005.result
@@ -1,4 +1,5 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/r/rpl000006.result b/mysql-test/r/rpl000006.result
index f4e965236af..e7fc5151ac4 100644
--- a/mysql-test/r/rpl000006.result
+++ b/mysql-test/r/rpl000006.result
@@ -1,4 +1,5 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/r/rpl000007.result b/mysql-test/r/rpl000007.result
index 7b2b9939228..c2823bf1203 100644
--- a/mysql-test/r/rpl000007.result
+++ b/mysql-test/r/rpl000007.result
@@ -1,13 +1,12 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
-use test;
drop table if exists foo;
create table foo (n int);
insert into foo values(4);
-use test;
drop table if exists foo;
create table foo (s char(20));
load data infile '../../std_data/words.dat' into table foo;
diff --git a/mysql-test/r/rpl000008.result b/mysql-test/r/rpl000008.result
index 5ca156fecf0..a0230d55702 100644
--- a/mysql-test/r/rpl000008.result
+++ b/mysql-test/r/rpl000008.result
@@ -1,4 +1,5 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/r/rpl000009.result b/mysql-test/r/rpl000009.result
index 5246dadc06b..afd566c366c 100644
--- a/mysql-test/r/rpl000009.result
+++ b/mysql-test/r/rpl000009.result
@@ -1,4 +1,5 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/r/rpl000010.result b/mysql-test/r/rpl000010.result
index 95792a72a6d..49538ed148e 100644
--- a/mysql-test/r/rpl000010.result
+++ b/mysql-test/r/rpl000010.result
@@ -1,4 +1,5 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/r/rpl000011.result b/mysql-test/r/rpl000011.result
index 1a46f479677..5d22c29bdba 100644
--- a/mysql-test/r/rpl000011.result
+++ b/mysql-test/r/rpl000011.result
@@ -1,9 +1,9 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
-use test;
drop table if exists t1;
create table t1 (n int);
insert into t1 values(1);
diff --git a/mysql-test/r/rpl000012.result b/mysql-test/r/rpl000012.result
index c7f3ab8f578..45de6502bbd 100644
--- a/mysql-test/r/rpl000012.result
+++ b/mysql-test/r/rpl000012.result
@@ -1,4 +1,5 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/r/rpl000013.result b/mysql-test/r/rpl000013.result
index 5e4b4159e3a..9e802da59c5 100644
--- a/mysql-test/r/rpl000013.result
+++ b/mysql-test/r/rpl000013.result
@@ -1,4 +1,5 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/r/rpl000015.result b/mysql-test/r/rpl000015.result
index a35004298e0..7010349e5ff 100644
--- a/mysql-test/r/rpl000015.result
+++ b/mysql-test/r/rpl000015.result
@@ -5,7 +5,6 @@ master-bin.001 79
reset slave;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
- 0 0 0 0 No No 0 0 0 0
change master to master_host='127.0.0.1';
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
diff --git a/mysql-test/r/rpl000017.result b/mysql-test/r/rpl000017.result
index e2c3c089378..bac0573165d 100644
--- a/mysql-test/r/rpl000017.result
+++ b/mysql-test/r/rpl000017.result
@@ -1,6 +1,6 @@
reset master;
-grant file on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
-grant file on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
+grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
+grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
slave start;
drop table if exists t1;
create table t1(n int);
diff --git a/mysql-test/r/rpl_alter.result b/mysql-test/r/rpl_alter.result
new file mode 100644
index 00000000000..1dc73c6524a
--- /dev/null
+++ b/mysql-test/r/rpl_alter.result
@@ -0,0 +1,21 @@
+slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+slave start;
+drop database if exists d1;
+create database d1;
+create table d1.t1 ( n int);
+alter table d1.t1 add m int;
+insert into d1.t1 values (1,2);
+create table d1.t2 (n int);
+insert into d1.t2 values (45);
+rename table d1.t2 to d1.t3, d1.t1 to d1.t2;
+select * from d1.t2;
+n m
+1 2
+select * from d1.t3;
+n
+45
+drop database d1;
diff --git a/mysql-test/r/rpl_compat.result b/mysql-test/r/rpl_compat.result
deleted file mode 100644
index 5e497791771..00000000000
--- a/mysql-test/r/rpl_compat.result
+++ /dev/null
@@ -1,77 +0,0 @@
-slave stop;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-slave start;
-use test;
-drop table if exists t1,t3;
-create table t1 (word char(20) not null);
-load data infile '../../std_data/words.dat' into table t1;
-select * from t1;
-word
-Aarhus
-Aaron
-Ababa
-aback
-abaft
-abandon
-abandoned
-abandoning
-abandonment
-abandons
-set password for root@"localhost" = password('foo');
-set password for root@"localhost" = password('');
-create table t3(n int);
-insert into t3 values(1),(2);
-use test;
-select * from t3;
-n
-1
-2
-select sum(length(word)) from t1;
-sum(length(word))
-71
-drop table t1,t3;
-reset master;
-slave stop;
-reset slave;
-create table t1(n int);
-insert into t1 values (1),(2),(3);
-create table t2(id int);
-insert into t2 values(connection_id());
-create temporary table t1_temp(n int);
-insert into t1_temp select get_lock('crash_lock%20C', 1) from t2;
- update t1 set n = n + get_lock('crash_lock%20C', 2);
-select (@id := id) - id from t2;
-(@id := id) - id
-0
-kill @id;
-drop table t2;
-Server shutdown in progress
-slave start;
-set sql_slave_skip_counter=1;
-slave start;
-select count(*) from t1;
-count(*)
-3
-drop table t1;
-create table t1 (n int);
-insert into t1 values(3456);
-use mysql;
-insert into user (Host, User, Password)
-VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
-select select_priv,user from mysql.user where user = 'blafasel2';
-select_priv user
-N blafasel2
-update user set Select_priv = "Y" where User="blafasel2";
-select select_priv,user from mysql.user where user = 'blafasel2';
-select_priv user
-Y blafasel2
-use test;
-select n from t1;
-n
-3456
-select select_priv,user from mysql.user where user = 'blafasel2';
-select_priv user
-Y blafasel2
-drop table t1;
diff --git a/mysql-test/r/rpl_empty_master_crash.result b/mysql-test/r/rpl_empty_master_crash.result
index 6ae5d15031b..19e2bf28dcd 100644
--- a/mysql-test/r/rpl_empty_master_crash.result
+++ b/mysql-test/r/rpl_empty_master_crash.result
@@ -1,12 +1,13 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
-use test;
drop table if exists t1;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
- 0 0 0 0 No No 0 0 0 0
load table t1 from master;
-Error in fetch_master_table
+Error connecting to master: Master is not configured
+load table t1 from master;
+Error from master: 'Table 'test.t1' doesn't exist'
diff --git a/mysql-test/r/rpl_get_lock.result b/mysql-test/r/rpl_get_lock.result
index c86b8f830a5..a8e602be03f 100644
--- a/mysql-test/r/rpl_get_lock.result
+++ b/mysql-test/r/rpl_get_lock.result
@@ -1,4 +1,5 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
@@ -17,4 +18,13 @@ get_lock("lock",3)
select * from t1;
n
1
+select is_free_lock("lock");
+is_free_lock("lock")
+0
+select is_free_lock("lock2");
+is_free_lock("lock2")
+1
+select is_free_lock(NULL);
+is_free_lock(NULL)
+NULL
drop table t1;
diff --git a/mysql-test/r/rpl_log.result b/mysql-test/r/rpl_log.result
index f5885085dee..8948460e1bd 100644
--- a/mysql-test/r/rpl_log.result
+++ b/mysql-test/r/rpl_log.result
@@ -1,4 +1,5 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
@@ -75,7 +76,7 @@ slave-bin.002 115 Query 1 62 use test; insert into t1 values (1)
slave-bin.002 175 Query 1 122 use test; drop table t1
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root MASTER_PORT 1 master-bin.002 170 slave-relay-bin.002 916 master-bin.002 Yes Yes 0 0 170 924
+127.0.0.1 root MASTER_PORT 1 master-bin.002 170 slave-relay-bin.002 916 master-bin.002 Yes Yes 0 0 170 920
show new master for slave with master_log_file='master-bin.001' and
master_log_pos=4 and master_server_id=1;
Log_name Log_pos
diff --git a/mysql-test/r/rpl000014.result b/mysql-test/r/rpl_log_pos.result
index c9926c92a4f..6883da76180 100644
--- a/mysql-test/r/rpl000014.result
+++ b/mysql-test/r/rpl_log_pos.result
@@ -1,4 +1,5 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
@@ -8,7 +9,7 @@ File Position Binlog_do_db Binlog_ignore_db
master-bin.001 79
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 128
+127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 124
change master to master_log_pos=73;
slave stop;
change master to master_log_pos=73;
@@ -18,22 +19,24 @@ Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Lo
slave start;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root MASTER_PORT 1 master-bin.001 73 slave-relay-bin.001 4 master-bin.001 Yes Yes 0 0 73 4
+127.0.0.1 root MASTER_PORT 1 master-bin.001 73 slave-relay-bin.001 4 master-bin.001 No Yes 0 0 73 4
change master to master_log_pos=173;
+slave start;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root MASTER_PORT 1 master-bin.001 173 slave-relay-bin.001 4 master-bin.001 Yes Yes 0 0 173 4
+127.0.0.1 root MASTER_PORT 1 master-bin.001 173 slave-relay-bin.001 4 master-bin.001 No Yes 0 0 173 4
show master status;
File Position Binlog_do_db Binlog_ignore_db
master-bin.001 79
-create table if not exists foo(n int);
-drop table if exists foo;
-create table foo (n int);
-insert into foo values (1),(2),(3);
+create table if not exists t1 (n int);
+drop table if exists t1;
+create table t1 (n int);
+insert into t1 values (1),(2),(3);
change master to master_log_pos=79;
-select * from foo;
+slave start;
+select * from t1;
n
1
2
3
-drop table foo;
+drop table t1;
diff --git a/mysql-test/r/rpl_magic.result b/mysql-test/r/rpl_magic.result
index b30d40d04eb..743bef4a053 100644
--- a/mysql-test/r/rpl_magic.result
+++ b/mysql-test/r/rpl_magic.result
@@ -1,4 +1,5 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/r/rpl_mystery22.result b/mysql-test/r/rpl_mystery22.result
index e798d774380..5dd665fe9d5 100644
--- a/mysql-test/r/rpl_mystery22.result
+++ b/mysql-test/r/rpl_mystery22.result
@@ -1,5 +1,5 @@
-drop table if exists t1;
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/r/rpl000016.result b/mysql-test/r/rpl_rotate_logs.result
index 9d6ba071200..d440e157ed4 100644
--- a/mysql-test/r/rpl000016.result
+++ b/mysql-test/r/rpl_rotate_logs.result
@@ -10,12 +10,14 @@ change master to master_host='127.0.0.1',master_port=MASTER_PORT,
master_user='root';
reset master;
slave start;
-drop table if exists t1;
+drop table if exists t1, t2, t3, t4;
+create temporary table temp_table (a char(80) not null);
+insert into temp_table values ("testing temporary tables");
create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard');
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root MASTER_PORT 60 master-bin.001 234 slave-relay-bin.001 275 master-bin.001 Yes Yes 0 0 234 275
+127.0.0.1 root MASTER_PORT 60 master-bin.001 417 slave-relay-bin.001 458 master-bin.001 Yes Yes 0 0 417 458
select * from t1;
s
Could not break slave
@@ -30,10 +32,15 @@ Log_name
master-bin.001
master-bin.002
master-bin.003
+create table t3 select * from temp_table;
+select * from t3;
+a
+testing temporary tables
+drop table temp_table, t3;
insert into t2 values(1234);
set insert_id=1234;
insert into t2 values(NULL);
-set sql_slave_skip_counter=1;
+set global sql_slave_skip_counter=1;
slave start;
purge master logs to 'master-bin.003';
show master logs;
@@ -42,7 +49,7 @@ master-bin.003
insert into t2 values (65);
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root MASTER_PORT 60 master-bin.003 155 slave-relay-bin.001 755 master-bin.003 Yes Yes 0 0 155 755
+127.0.0.1 root MASTER_PORT 60 master-bin.003 290 slave-relay-bin.001 1073 master-bin.003 Yes Yes 0 0 290 1073
select * from t2;
m
34
@@ -50,8 +57,11 @@ m
67
123
1234
+create temporary table temp_table (a char(80) not null);
+insert into temp_table values ("testing temporary tables part 2");
drop table if exists t3;
create table t3 (n int);
+create table t4 select * from temp_table;
show master logs;
Log_name
master-bin.003
@@ -60,12 +70,13 @@ master-bin.005
master-bin.006
show master status;
File Position Binlog_do_db Binlog_ignore_db
-master-bin.006 445
-slave stop;
-slave start;
+master-bin.006 838
+select * from t4;
+a
+testing temporary tables part 2
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root MASTER_PORT 60 master-bin.006 445 slave-relay-bin.004 1229 master-bin.006 Yes Yes 0 0 445 1229
+127.0.0.1 root MASTER_PORT 60 master-bin.006 838 slave-relay-bin.001 8034 master-bin.006 Yes Yes 0 0 838 8034
lock tables t3 read;
select count(*) from t3 where n >= 4;
count(*)
diff --git a/mysql-test/r/rpl_skip_error.result b/mysql-test/r/rpl_skip_error.result
index 9fe92292178..946d64ad7c5 100644
--- a/mysql-test/r/rpl_skip_error.result
+++ b/mysql-test/r/rpl_skip_error.result
@@ -1,4 +1,5 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
diff --git a/mysql-test/r/rpl_sporadic_master.result b/mysql-test/r/rpl_sporadic_master.result
index ca74904889b..a6a58515f0a 100644
--- a/mysql-test/r/rpl_sporadic_master.result
+++ b/mysql-test/r/rpl_sporadic_master.result
@@ -1,9 +1,9 @@
slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
-drop table if exists t1,t2;
create table t2(n int);
create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL),(NULL);
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 49ce0608fc5..bdef42aa5a8 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -3229,6 +3229,28 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par
t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE
t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE
t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
+drop table t4, t3, t2, t1;
DO 1;
DO benchmark(100,1+1),1,1;
-drop table t4, t3,t2, t1;
+CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp(14) NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) TYPE=MyISAM;
+INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL);
+CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) TYPE=MyISAM;
+INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35);
+SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'NULL' AND b.sampletime < 'NULL' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid;
+gvid the_success the_fail the_size the_time
+DROP TABLE t1,t2;
+create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0');
+INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093);
+select wss_type from t1 where wss_type ='102935229216544106';
+wss_type
+select wss_type from t1 where wss_type ='102935229216544105';
+wss_type
+select wss_type from t1 where wss_type ='102935229216544104';
+wss_type
+select wss_type from t1 where wss_type ='102935229216544093';
+wss_type
+102935229216544093
+select wss_type from t1 where wss_type =102935229216544093;
+wss_type
+102935229216544093
+drop table t1;
diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result
index 3d2f2154b37..1c2cd7da894 100644
--- a/mysql-test/r/select_found.result
+++ b/mysql-test/r/select_found.result
@@ -66,7 +66,7 @@ a
2
select FOUND_ROWS();
FOUND_ROWS()
-5
+3
drop table t1;
CREATE TABLE t1 (
`id` smallint(5) unsigned NOT NULL auto_increment,
@@ -153,3 +153,19 @@ SELECT FOUND_ROWS();
FOUND_ROWS()
199
drop table t1,t2;
+CREATE TABLE `t1` (
+`titre` char(80) NOT NULL default '',
+`numeropost` mediumint(8) unsigned NOT NULL auto_increment,
+`maxnumrep` int(10) unsigned NOT NULL default '0',
+PRIMARY KEY (`numeropost`),
+KEY `maxnumrep` (`maxnumrep`)
+) TYPE=MyISAM ROW_FORMAT=FIXED;
+INSERT INTO t1 (titre,maxnumrep) VALUES
+('test1','1'),('test2','2'),('test3','3');
+SELECT SQL_CALC_FOUND_ROWS titre,numeropost,maxnumrep FROM t1 WHERE numeropost IN (1,2) ORDER BY maxnumrep DESC LIMIT 0, 1;
+titre numeropost maxnumrep
+test2 2 2
+SELECT FOUND_ROWS();
+FOUND_ROWS()
+2
+drop table t1;
diff --git a/mysql-test/r/truncate.result b/mysql-test/r/truncate.result
index e02797cc8e5..44dacdd9bf1 100644
--- a/mysql-test/r/truncate.result
+++ b/mysql-test/r/truncate.result
@@ -20,3 +20,5 @@ truncate table t1;
select * from t1;
n
drop table t1;
+truncate non_existing_table;
+Table 'test.non_existing_table' doesn't exist
diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result
index f4dfc3c2891..6550e981f5e 100644
--- a/mysql-test/r/type_decimal.result
+++ b/mysql-test/r/type_decimal.result
@@ -156,6 +156,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
+insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
+insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
select * from t1;
a
0.00
@@ -176,6 +178,14 @@ a
-99999999.99
999999999.99
999999999.99
+999999999.99
+0.00
+-99999999.99
+123.40
+12340.00
+1.23
+1230.00
+123.00
drop table t1;
create table t1 (a decimal(10,2) unsigned);
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
@@ -183,19 +193,21 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
+insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
+insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
select * from t1;
a
0.00
0.00
-0.00
-01.00
++0.00
01.00
++01.00
0.00
0.00
-0.10
++0.10
0.10
00000001.00
-00000001.00
++0000001.00
0.00
99999999.99
99999999.99
@@ -203,6 +215,14 @@ a
0.00
99999999.99
99999999.99
+99999999.99
+0.00
+0.00
+123.40
+12340.00
+1.23
+1230.00
+123.00
drop table t1;
create table t1 (a decimal(10,2) zerofill);
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
@@ -210,6 +230,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
+insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
+insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
select * from t1;
a
00000000.00
@@ -230,6 +252,14 @@ a
00000000.00
99999999.99
99999999.99
+99999999.99
+00000000.00
+00000000.00
+00000123.40
+00012340.00
+00000001.23
+00001230.00
+00000123.00
drop table t1;
create table t1 (a decimal(10,2));
insert into t1 values (0.0),("-0.0"),(+0.0),(01.0),(+01.0),(-01.0);
@@ -237,6 +267,8 @@ insert into t1 values (-.1),(+.1),(.1);
insert into t1 values (00000000000001),(+0000000000001),(-0000000000001);
insert into t1 values (+111111111.11),(111111111.11),(-11111111.11);
insert into t1 values (-111111111.11),(+1111111111.11),(1111111111.11);
+insert into t1 values (1e+100),(1e-100),(-1e+100);
+insert into t1 values (123.4e0),(123.4e+2),(123.4e-2),(123e1),(123e+0);
select * from t1;
a
0.00
@@ -257,6 +289,14 @@ a
-99999999.99
999999999.99
999999999.99
+999999999.99
+0.00
+-99999999.99
+123.40
+12340.00
+1.23
+1230.00
+123.00
drop table t1;
create table t1 (a decimal);
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+12345678901'),(99999999999999);
@@ -276,9 +316,9 @@ select * from t1;
a
0
0
-1
++1
01
-0000000001
++000000001
1234567890
9999999999
drop table t1;
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 29b925b6746..ec30db36cd4 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -128,6 +128,8 @@ select * from t1 union select a from t2;
The used SELECT statements have a different number of columns
select a from t1 union select * from t2;
The used SELECT statements have a different number of columns
+select * from t1 union select SQL_BUFFER_RESULT * from t2;
+Wrong usage/placement of 'SQL_BUFFER_RESULT'
create table t3 select a,b from t1 union all select a,b from t2;
insert into t3 select a,b from t1 union all select a,b from t2;
replace into t3 select a,b as c from t1 union all select a,b from t2;
@@ -193,9 +195,9 @@ a
1
2
set SQL_SELECT_LIMIT=2;
-(select * from t1 limit 2) union (select * from t2 limit 3);
+(select * from t1 limit 1) union (select * from t2 limit 3);
a
1
-2
+11
set SQL_SELECT_LIMIT=DEFAULT;
drop table t1,t2;
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index 5c8b4581c5c..5643900182e 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -1,5 +1,5 @@
set @a := foo;
-You may only use constant expressions with SET
+Unknown column 'foo' in 'field list'
set @a := connection_id() + 3;
select @a - connection_id();
@a - connection_id()
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 52c2c026bd3..516204028fe 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -44,17 +44,292 @@ c_id c_name c_country
1 Bozo USA
4 Mr. Floppy GB
drop table t1;
+set max_join_size=100;
+show variables like 'max_join_size';
+Variable_name Value
+max_join_size 100
+show global variables like 'max_join_size';
+Variable_name Value
+max_join_size 4294967295
+set GLOBAL max_join_size=2000;
+show global variables like 'max_join_size';
+Variable_name Value
+max_join_size 2000
+set max_join_size=DEFAULT;
+show variables like 'max_join_size';
+Variable_name Value
+max_join_size 2000
+set GLOBAL max_join_size=DEFAULT;
+show global variables like 'max_join_size';
+Variable_name Value
+max_join_size 4294967295
+set @@max_join_size=1000, @@global.max_join_size=2000;
+select @@local.max_join_size, @@global.max_join_size;
+@@max_join_size @@max_join_size
+1000 2000
+select @@identity, length(@@version)>0;
+@@identity length(@@version)>0
+0 1
select @@VERSION=version();
@@VERSION=version()
1
select last_insert_id(345);
last_insert_id(345)
345
-select @@IDENTITY,last_insert_id();
-@@IDENTITY last_insert_id()
-345 345
-select @@identity;
-@@IDENTITY
-345
-select @@unknown_variable;
+select @@IDENTITY,last_insert_id(), @@identity;
+@@identity last_insert_id() @@identity
+345 345 345
+set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON";
+set global concurrent_insert=ON;
+show variables like 'concurrent_insert';
+Variable_name Value
+concurrent_insert ON
+set global concurrent_insert=1;
+show variables like 'concurrent_insert';
+Variable_name Value
+concurrent_insert ON
+set global concurrent_insert=0;
+show variables like 'concurrent_insert';
+Variable_name Value
+concurrent_insert OFF
+set global concurrent_insert=OFF;
+show variables like 'concurrent_insert';
+Variable_name Value
+concurrent_insert OFF
+set global concurrent_insert=DEFAULT;
+show variables like 'concurrent_insert';
+Variable_name Value
+concurrent_insert ON
+set table_type=MYISAM, table_type="HEAP", global table_type="INNODB";
+show local variables like 'table_type';
+Variable_name Value
+table_type HEAP
+show global variables like 'table_type';
+Variable_name Value
+table_type INNODB
+set GLOBAL query_cache_size=100000;
+set GLOBAL safe_show_database=0;
+set myisam_max_sort_file_size=10000, GLOBAL myisam_max_sort_file_size=20000;
+show variables like 'myisam_max_sort_file_size';
+Variable_name Value
+myisam_max_sort_file_size 10000
+show global variables like 'myisam_max_sort_file_size';
+Variable_name Value
+myisam_max_sort_file_size 20000
+set myisam_max_sort_file_size=default;
+show variables like 'myisam_max_sort_file_size';
+Variable_name Value
+myisam_max_sort_file_size 20000
+set global net_retry_count=10, session net_retry_count=10;
+set global net_buffer_length=1024, net_write_timeout=200, net_read_timeout=300;
+set session net_buffer_length=2048, net_write_timeout=500, net_read_timeout=600;
+show global variables like 'net_%';
+Variable_name Value
+net_buffer_length 1024
+net_read_timeout 300
+net_retry_count 10
+net_write_timeout 200
+show session variables like 'net_%';
+Variable_name Value
+net_buffer_length 2048
+net_read_timeout 600
+net_retry_count 10
+net_write_timeout 500
+set session net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
+show global variables like 'net_%';
+Variable_name Value
+net_buffer_length 1024
+net_read_timeout 900
+net_retry_count 10
+net_write_timeout 1000
+show session variables like 'net_%';
+Variable_name Value
+net_buffer_length 7168
+net_read_timeout 600
+net_retry_count 10
+net_write_timeout 500
+set net_buffer_length=1;
+show variables like 'net_buffer_length';
+Variable_name Value
+net_buffer_length 1024
+set net_buffer_length=2000000000;
+show variables like 'net_buffer_length';
+Variable_name Value
+net_buffer_length 1048576
+set GLOBAL character set cp1251_koi8;
+show global variables like "convert_character_set";
+Variable_name Value
+convert_character_set cp1251_koi8
+set character set cp1251_koi8;
+show variables like "convert_character_set";
+Variable_name Value
+convert_character_set cp1251_koi8
+set global character set default, session character set default;
+show variables like "convert_character_set";
+Variable_name Value
+convert_character_set cp1251_koi8
+select @@timestamp>0;
+@@timestamp>0
+1
+set big_tables=OFFF;
+Variable 'big_tables' can't be set to the value of 'OFFF'
+set big_tables="OFFF";
+Variable 'big_tables' can't be set to the value of 'OFFF'
+set unknown_variable=1;
Unknown system variable 'unknown_variable'
+set max_join_size="hello";
+Wrong argument type to variable 'max_join_size'
+set table_type=UNKNOWN_TABLE_TYPE;
+Variable 'table_type' can't be set to the value of 'UNKNOWN_TABLE_TYPE'
+set table_type=INNODB, big_tables=2;
+Variable 'big_tables' can't be set to the value of '2'
+show local variables like 'table_type';
+Variable_name Value
+table_type HEAP
+set SESSION query_cache_size=10000;
+Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+set GLOBAL table_type=DEFAULT;
+Variable 'table_type' doesn't have a default value
+set convert_character_set=UNKNOWN_CHARACTER_SET;
+Unknown character set: 'UNKNOWN_CHARACTER_SET'
+set character set unknown;
+Unknown character set: 'unknown'
+set character set 0;
+Wrong argument type to variable 'convert_character_set'
+set global autocommit=1;
+Variable 'autocommit' is a LOCAL variable and can't be used with SET GLOBAL
+select @@global.timestamp;
+Variable 'timestamp' is a LOCAL variable and can't be used with SET GLOBAL
+set @@version='';
+Unknown system variable 'version'
+set @@concurrent_insert=1;
+Variable 'concurrent_insert' is a GLOBAL variable and should be set with SET GLOBAL
+set @@global.sql_auto_is_null=1;
+Variable 'sql_auto_is_null' is a LOCAL variable and can't be used with SET GLOBAL
+select @@global.sql_auto_is_null;
+Variable 'sql_auto_is_null' is a LOCAL variable and can't be used with SET GLOBAL
+set autocommit=1;
+set big_tables=1;
+select @@autocommit, @@big_tables;
+@@autocommit @@big_tables
+1 1
+set global binlog_cache_size=100;
+set bulk_insert_buffer_size=100;
+set convert_character_set=cp1251_koi8;
+set convert_character_set=default;
+set @@global.concurrent_insert=1;
+set global connect_timeout=100;
+select @@delay_key_write;
+@@delay_key_write
+ON
+set global delay_key_write="OFF";
+select @@delay_key_write;
+@@delay_key_write
+OFF
+set global delay_key_write=ALL;
+select @@delay_key_write;
+@@delay_key_write
+ALL
+set global delay_key_write=1;
+select @@delay_key_write;
+@@delay_key_write
+ON
+set global delayed_insert_limit=100;
+set global delayed_insert_timeout=100;
+set global delayed_queue_size=100;
+set global flush=1;
+set global flush_time=100;
+set insert_id=1;
+set interactive_timeout=100;
+set join_buffer_size=100;
+set last_insert_id=1;
+set global local_infile=1;
+set long_query_time=100;
+set low_priority_updates=1;
+set max_allowed_packet=100;
+set global max_binlog_cache_size=100;
+set global max_binlog_size=100;
+set global max_connect_errors=100;
+set global max_connections=100;
+set global max_delayed_threads=100;
+set max_heap_table_size=100;
+set max_join_size=100;
+set max_sort_length=100;
+set max_tmp_tables=100;
+set global max_user_connections=100;
+select @@max_user_connections;
+@@max_user_connections
+100
+set global max_write_lock_count=100;
+set myisam_max_extra_sort_file_size=100;
+select @@myisam_max_extra_sort_file_size;
+@@myisam_max_extra_sort_file_size
+100
+set myisam_max_sort_file_size=100;
+set myisam_sort_buffer_size=100;
+set net_buffer_length=100;
+set net_read_timeout=100;
+set net_write_timeout=100;
+set global query_cache_limit=100;
+set global query_cache_size=100;
+set global query_cache_type=demand;
+set read_buffer_size=100;
+set read_rnd_buffer_size=100;
+set global rpl_recovery_rank=100;
+set global safe_show_database=1;
+set global server_id=100;
+set global slave_net_timeout=100;
+set global slow_launch_time=100;
+set sort_buffer_size=100;
+set sql_auto_is_null=1;
+select @@sql_auto_is_null;
+@@sql_auto_is_null
+1
+set @@sql_auto_is_null=0;
+select @@sql_auto_is_null;
+@@sql_auto_is_null
+0
+set sql_big_selects=1;
+set sql_big_tables=1;
+set sql_buffer_result=1;
+set sql_log_bin=1;
+set sql_log_off=1;
+set sql_log_update=1;
+set sql_low_priority_updates=1;
+set sql_max_join_size=200;
+select @@sql_max_join_size,@@max_join_size;
+@@sql_max_join_size @@max_join_size
+200 200
+set sql_quote_show_create=1;
+set sql_safe_updates=1;
+set sql_select_limit=1;
+set global sql_slave_skip_counter=100;
+set sql_warnings=1;
+set global table_cache=100;
+set table_type=myisam;
+set global thread_cache_size=100;
+set timestamp=1, timestamp=default;
+set tmp_table_size=100;
+set tx_isolation="READ-COMMITTED";
+set wait_timeout=100;
+set log_warnings=1;
+DROP TABLE IF EXISTS t1,t2;
+create table t1 (a int not null auto_increment, primary key(a));
+create table t2 (a int not null auto_increment, primary key(a));
+insert into t1 values(null),(null),(null);
+insert into t2 values(null),(null),(null);
+set global key_buffer_size=100000;
+select @@key_buffer_size;
+@@key_buffer_size
+98304
+select * from t1 where a=2;
+a
+2
+select * from t2 where a=3;
+a
+3
+check table t1,t2;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+test.t2 check status OK
+drop table t1,t2;
diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test
index cec3e1ca45c..15b35ac7c87 100644
--- a/mysql-test/t/bigint.test
+++ b/mysql-test/t/bigint.test
@@ -5,12 +5,18 @@ select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
select 9223372036854775807,-009223372036854775808;
select +9999999999999999999,-9999999999999999999;
+#
+# In 3.23 we have to disable the test of column to bigint as
+# this fails on AIX powerpc (the resolution for double is not good enough)
+# This will work on 4.0 as we then have internal handling of bigint variables.
+#
+
drop table if exists t1;
create table t1 (a bigint unsigned not null, primary key(a));
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
select * from t1;
select * from t1 where a=18446744073709551615;
-select * from t1 where a='18446744073709551615';
+# select * from t1 where a='18446744073709551615';
delete from t1 where a=18446744073709551615;
select * from t1;
drop table t1;
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index ac2f9cd5879..0beb71aac48 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -105,3 +105,5 @@ drop table if exists t1,t2;
create table t1 (a int not null, b int, primary key(a), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b));
show create table t1;
drop table t1;
+create table t1 select if(1,'1','0'), month("2002-08-02");
+drop table t1;
diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test
index d39d7f6e5dd..e829005a229 100644
--- a/mysql-test/t/ctype_latin1_de.test
+++ b/mysql-test/t/ctype_latin1_de.test
@@ -38,9 +38,10 @@ select strcmp('u','öa'),strcmp('u','ö');
# Some other simple tests with the current character set
#
-create table t1 (a varchar(10), key(a));
+create table t1 (a varchar(10), key(a), fulltext (a));
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
select * from t1 where a like "abc%";
select * from t1 where a like "test%";
select * from t1 where a like "te_t";
+select * from t1 where match a against ("te*" in boolean mode)+0;
drop table t1;
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test
index b850ec5d562..e4503b0cf72 100644
--- a/mysql-test/t/distinct.test
+++ b/mysql-test/t/distinct.test
@@ -218,3 +218,27 @@ select * from t1 where a >= '1';
select distinct a from t1 order by a desc;
select distinct a from t1 where a >= '1' order by a desc;
drop table t1;
+
+#
+# Test when using a not previously used column in ORDER BY
+#
+
+CREATE TABLE t1 (email varchar(50), infoID BIGINT, dateentered
+DATETIME);
+CREATE TABLE t2 (infoID BIGINT, shipcode varchar(10));
+
+INSERT INTO t1 (email, infoID, dateentered) VALUES
+ ('test1@testdomain.com', 1, '2002-07-30 22:56:38'),
+ ('test1@testdomain.com', 1, '2002-07-27 22:58:16'),
+ ('test2@testdomain.com', 1, '2002-06-19 15:22:19'),
+ ('test2@testdomain.com', 2, '2002-06-18 14:23:47'),
+ ('test3@testdomain.com', 1, '2002-05-19 22:17:32');
+
+INSERT INTO t2(infoID, shipcode) VALUES
+ (1, 'Z001'),
+ (2, 'R002');
+
+SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID;
+SELECT DISTINCTROW email FROM t1 ORDER BY dateentered DESC;
+SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID ORDER BY dateentered DESC;
+drop table t1,t2;
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 238705c8e3e..65d5381d725 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -35,6 +35,7 @@ select *, MATCH(a,b) AGAINST("collections support" IN BOOLEAN MODE) as x from t1
select * from t1 where MATCH a,b AGAINST ("+call* +coll*" IN BOOLEAN MODE);
+select * from t1 where MATCH a,b AGAINST ('"support now"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"Now sUPPort"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"text search" "now support"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"text search" -"now support"' IN BOOLEAN MODE);
@@ -154,4 +155,8 @@ insert into t1 values (2,"fullaaa fullzzz");
select * from t1 where match b against ('full*' in boolean mode);
drop table t1;
+CREATE TABLE t1 ( id int(11) NOT NULL auto_increment primary key, mytext text NOT NULL, FULLTEXT KEY mytext (mytext)) TYPE=MyISAM;
+INSERT INTO t1 VALUES (1,'my small mouse'),(2,'la-la-la'),(3,'It is so funny'),(4,'MySQL Tutorial');
+select 8 from t1;
+drop table t1;
diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test
index c5cc73ecd1f..85553d1a2fd 100644
--- a/mysql-test/t/func_if.test
+++ b/mysql-test/t/func_if.test
@@ -28,3 +28,7 @@ create table t1 (num double(12,2));
insert into t1 values (144.54);
select sum(if(num is null,0.00,num)) from t1;
drop table t1;
+create table t1 (x int, y int);
+insert into t1 values (0,6),(10,16),(20,26),(30,10),(40,46),(50,56);
+select min(if(y -x > 5,y,NULL)), max(if(y - x > 5,y,NULL)) from t1;
+drop table t1;
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index 5299897d0f0..74e8a5ce092 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -8,7 +8,10 @@ select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),truncate(52.64,-2)
select round(5.5),round(-5.5);
select round(5.64,1),round(5.64,2),round(5.64,-1),round(5.64,-2);
select abs(-10), sign(-5), sign(5), sign(0);
-select log(exp(10)),exp(log(sqrt(10))*2);
+select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2);
+select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
+select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
+select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
select pow(10,log10(10)),power(2,4);
select rand(999999),rand();
select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(1),acos(0),atan(1);
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 26272fba03f..daf5587b450 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -37,6 +37,16 @@ select replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb')
select replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL') ;
select soundex(''),soundex('he'),soundex('hello all folks');
select md5('hello');
+select sha('abc');
+select sha1('abc');
+select aes_decrypt(aes_encrypt('abc','1'),'1');
+select aes_decrypt(aes_encrypt('abc','1'),1);
+select aes_encrypt(NULL,"a");
+select aes_encrypt("a",NULL);
+select aes_decrypt(NULL,"a");
+select aes_decrypt("a",NULL);
+select aes_decrypt("a","a");
+select aes_decrypt(aes_encrypt("","a"),"a");
select repeat('monty',5),concat('*',space(5),'*');
select reverse('abc'),reverse('abcd');
select rpad('a',4,'1'),rpad('a',4,'12'),rpad('abcd',3,'12');
@@ -51,6 +61,10 @@ select least(1,2,3) | greatest(16,32,8), least(5,4)*1,greatest(-1.0,1.0)*1,least
select decode(encode(repeat("a",100000),"monty"),"monty")=repeat("a",100000);
select decode(encode("abcdef","monty"),"monty")="abcdef";
+select quote('\'\"\\test');
+select quote(concat('abc\'', '\\cba'));
+select quote(1/0), quote('\0\Z');
+
#
# Wrong usage of functions
#
diff --git a/mysql-test/t/func_test.test b/mysql-test/t/func_test.test
index ec44009b1a6..f5ad2e21c73 100644
--- a/mysql-test/t/func_test.test
+++ b/mysql-test/t/func_test.test
@@ -15,6 +15,8 @@ select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between
select 'b' between 'a' and 'c', 'B' between 'a' and 'c';
select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,1.0);
select -1.49 or -1.49,0.6 or 0.6;
+select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
+select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
#
# Wrong usage of functions
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 171b5510227..072a1830f57 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -284,18 +284,31 @@ INSERT INTO t1 values ('hij','klm');
SELECT CONCAT(a, b),count(*) FROM t1 GROUP BY 1;
DROP TABLE t1;
drop table if exists t1;
+
+#
+# Test problem with ORDER BY on a SUM() column
+#
+
create table t1 (One int unsigned, Two int unsigned, Three int unsigned, Four int unsigned);
-insert into t1 values (1,2,1,4);
-insert into t1 values (1,2,2,4);
-insert into t1 values (1,2,3,4);
-insert into t1 values (1,2,4,4);
-insert into t1 values (1,1,1,4);
-insert into t1 values (1,1,2,4);
-insert into t1 values (1,1,3,4);
-insert into t1 values (1,1,4,4);
-insert into t1 values (1,3,1,4);
-insert into t1 values (1,3,2,4);
-insert into t1 values (1,3,3,4);
-insert into t1 values (1,3,4,4);
+insert into t1 values (1,2,1,4),(1,2,2,4),(1,2,3,4),(1,2,4,4),(1,1,1,4),(1,1,2,4),(1,1,3,4),(1,1,4,4),(1,3,1,4),(1,3,2,4),(1,3,3,4),(1,3,4,4);
select One, Two, sum(Four) from t1 group by One,Two;
-drop table if exists t1;
+drop table t1;
+
+create table t1 (id integer primary key not null auto_increment, gender char(1));
+insert into t1 values (NULL, 'M'), (NULL, 'F'),(NULL, 'F'),(NULL, 'F'),(NULL, 'M');
+create table t2 (user_id integer not null, date date);
+insert into t2 values (1, '2002-06-09'),(2, '2002-06-09'),(1, '2002-06-09'),(3, '2002-06-09'),(4, '2002-06-09'),(4, '2002-06-09');
+select u.gender as gender, count(distinct u.id) as dist_count, (count(distinct u.id)/5*100) as percentage from t1 u, t2 l where l.user_id = u.id group by u.gender;
+select u.gender as gender, count(distinct u.id) as dist_count, (count(distinct u.id)/5*100) as percentage from t1 u, t2 l where l.user_id = u.id group by u.gender order by percentage;
+drop table t1,t2;
+
+#
+# The GROUP BY returned rows in wrong order in 3.23.51
+#
+
+CREATE TABLE t1 (ID1 int, ID2 int, ID int NOT NULL AUTO_INCREMENT,PRIMARY KEY(ID
+));
+insert into t1 values (1,244,NULL),(2,243,NULL),(134,223,NULL),(185,186,NULL);
+select S.ID as xID, S.ID1 as xID1 from t1 as S left join t1 as yS on S.ID1 between yS.ID1 and yS.ID2;
+select S.ID as xID, S.ID1 as xID1, repeat('*',count(distinct yS.ID)) as Level from t1 as S left join t1 as yS on S.ID1 between yS.ID1 and yS.ID2 group by xID order by xID1;
+drop table t1;
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 1b7ee99e15a..e6d57899082 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -578,17 +578,11 @@ explain select a,b,c from t1;
drop table t1;
#
-# Check describe & handler
+# Check describe
#
create table t1 (t int not null default 1, key (t)) type=innodb;
desc t1;
---error 1031
-handler t1 open t1;
---error 1109
-handler t1 read t first;
---error 1109
-handler t1 close;
drop table t1;
#
@@ -638,3 +632,31 @@ select * from t1;
select * from t2;
select * from t2;
drop table t1,t2;
+
+#
+# A simple test with some isolation levels
+# TODO: Make this into a test using replication to really test how
+# this works.
+#
+
+create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=innodb;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+SELECT @@tx_isolation,@@global.tx_isolation;
+insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David');
+select id, code, name from t1 order by id;
+COMMIT;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+insert into t1 (code, name) values (2, 'Erik'), (3, 'Sasha');
+select id, code, name from t1 order by id;
+COMMIT;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt');
+select id, code, name from t1 order by id;
+COMMIT;
+DROP TABLE t1;
diff --git a/mysql-test/t/innodb_handler.test b/mysql-test/t/innodb_handler.test
new file mode 100644
index 00000000000..6b85be9c7ab
--- /dev/null
+++ b/mysql-test/t/innodb_handler.test
@@ -0,0 +1,76 @@
+-- source include/have_innodb.inc
+
+#
+# test of HANDLER ...
+#
+
+drop table if exists t1;
+create table t1 (a int, b char(10), key a(a), key b(a,b)) type=innodb;
+insert into t1 values
+(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
+(14,"aaa"),(15,"bbb"),(16,"ccc"),(16,"xxx"),
+(20,"ggg"),(21,"hhh"),(22,"iii");
+handler t1 open as t2;
+handler t2 read a first;
+handler t2 read a next;
+handler t2 read a next;
+handler t2 read a prev;
+handler t2 read a last;
+handler t2 read a prev;
+handler t2 read a prev;
+
+handler t2 read a first;
+handler t2 read a prev;
+
+handler t2 read a last;
+handler t2 read a prev;
+handler t2 read a next;
+handler t2 read a next;
+
+handler t2 read a=(15);
+handler t2 read a=(16);
+
+--error 1070
+handler t2 read a=(19,"fff");
+
+handler t2 read b=(19,"fff");
+handler t2 read b=(19,"yyy");
+handler t2 read b=(19);
+
+--error 1109
+handler t1 read a last;
+
+handler t2 read a=(11);
+handler t2 read a>=(11);
+
+handler t2 read a=(18);
+handler t2 read a>=(18);
+handler t2 read a>(18);
+handler t2 read a<=(18);
+handler t2 read a<(18);
+
+handler t2 read a first limit 5;
+handler t2 read a next limit 3;
+handler t2 read a prev limit 10;
+
+handler t2 read a>=(16) limit 4;
+handler t2 read a>=(16) limit 2,2;
+handler t2 read a last limit 3;
+
+handler t2 read a=(19);
+handler t2 read a=(19) where b="yyy";
+
+handler t2 read first;
+handler t2 read next;
+#
+# We alter the table even if it's still in use by to test the Innodb
+# delayed-drop code. This will generate a warning in the master.err log.
+#
+alter table t1 type=innodb;
+handler t2 read next;
+--error 1064
+handler t2 read last;
+
+handler t2 close;
+drop table if exists t1;
+
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index 270b1cd4c79..2c912d94c70 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -22,3 +22,30 @@ insert into t1 values (0,"mysql a");
insert into t1 values (0,"r1manic");
insert into t1 values (0,"r1man");
drop table t1;
+
+#
+# Test insert syntax
+#
+
+create table t1 (a int not null auto_increment, primary key (a), t timestamp, c char(10) default "hello", i int);
+insert into t1 values (default,default,default,default), (default,default,default,default), (4,0,"a",5),(default,default,default,default);
+select a,t>0,c,i from t1;
+truncate table t1;
+insert into t1 set a=default,t=default,c=default;
+insert into t1 set a=default,t=default,c=default,i=default;
+insert into t1 set a=4,t=0,c="a",i=5;
+insert into t1 set a=5,t=0,c="a",i=null;
+insert into t1 set a=default,t=default,c=default,i=default;
+select a,t>0,c,i from t1;
+drop table t1;
+
+#
+# Test of mysqld crash with fully qualified column names
+#
+
+drop database if exists foo;
+create database foo;
+use foo;
+create table t1 (c int);
+insert into foo.t1 set foo.t1.c = '1';
+drop database foo;
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test
index 6fc975a1cb3..1996c793880 100644
--- a/mysql-test/t/key.test
+++ b/mysql-test/t/key.test
@@ -168,3 +168,23 @@ drop table t1;
create table t1 (a int not null unique, b int unique, c int, d int not null primary key, key(c), e int not null unique);
show keys from t1;
drop table t1;
+
+#
+# Problem with UNIQUE() with NULL parts and auto increment
+#
+
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT,
+UNIQUE (c,i));
+INSERT INTO t1 (c) VALUES (NULL),(NULL);
+SELECT * FROM t1;
+INSERT INTO t1 (c) VALUES ('a'),('a');
+SELECT * FROM t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c CHAR(10) NULL, i INT NOT NULL AUTO_INCREMENT,
+UNIQUE (c,i));
+INSERT INTO t1 (c) VALUES (NULL),(NULL);
+SELECT * FROM t1;
+INSERT INTO t1 (c) VALUES ('a'),('a');
+SELECT * FROM t1;
+drop table t1;
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 5bd78769a05..86e787db0a3 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -129,18 +129,18 @@ drop table t3,t1,t2;
drop table if exists t6, t5, t4, t3, t2, t1;
# first testing of common stuff with new parameters
-create table t1 (a int not null, b int not null, key(a,b));
-create table t2 (a int not null, b int not null, key(a,b));
+create table t1 (a int not null, b int not null auto_increment, primary key(a,b));
+create table t2 (a int not null, b int not null auto_increment, primary key(a,b));
create table t3 (a int not null, b int not null, key(a,b)) UNION=(t1,t2) INSERT_METHOD=NO;
create table t4 (a int not null, b int not null, key(a,b)) TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=NO;
-create table t5 (a int not null, b int not null, key(a,b)) TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST;
-create table t6 (a int not null, b int not null, key(a,b)) TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;
+create table t5 (a int not null, b int not null auto_increment, primary key(a,b)) TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=FIRST;
+create table t6 (a int not null, b int not null auto_increment, primary key(a,b)) TYPE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;
show create table t3;
show create table t4;
show create table t5;
show create table t6;
-insert into t1 values (1,1),(1,2),(1,3),(1,4);
-insert into t2 values (2,1),(2,2),(2,3),(2,4);
+insert into t1 values (1,NULL),(1,NULL),(1,NULL),(1,NULL);
+insert into t2 values (2,NULL),(2,NULL),(2,NULL),(2,NULL);
select * from t3 order by b,a limit 3;
select * from t4 order by b,a limit 3;
select * from t5 order by b,a limit 3,3;
@@ -167,4 +167,21 @@ select * from t2 order by a,b;
select * from t3 order by a,b;
select * from t4 order by a,b;
select * from t5 order by a,b;
+# auto_increment
+select 1;
+insert into t5 values (1,NULL),(5,NULL);
+insert into t6 values (2,NULL),(6,NULL);
+select * from t1 order by a,b;
+select * from t2 order by a,b;
+select * from t5 order by a,b;
+select * from t6 order by a,b;
drop table if exists t6, t5, t4, t3, t2, t1;
+
+CREATE TABLE t1 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) TYPE=MyISAM;
+INSERT INTO t1 VALUES (1,1), (2,1);
+CREATE TABLE t2 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) TYPE=MyISAM;
+INSERT INTO t2 VALUES (1,2), (2,2);
+CREATE TABLE t ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', KEY a (a,b)) TYPE=MRG_MyISAM UNION=(t1,t2);
+select max(b) from t where a = 2;
+select max(b) from t1 where a = 2;
+drop table if exists t,t1,t2;
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index c16189168d2..205dbb10ccf 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -62,3 +62,81 @@ select count(*) from t2 where id2;
select count(*) from t3 where id3;
drop table t1,t2,t3;
+create table t1(id1 int not null primary key, t varchar(100)) pack_keys = 1;
+create table t2(id2 int not null, t varchar(100), index(id2)) pack_keys = 1;
+disable_query_log;
+let $1 = 1000;
+while ($1)
+ {
+ let $2 = 5;
+ eval insert into t1 values ($1,'aaaaaaaaaaaaaaaaaaaa');
+ while ($2)
+ {
+ eval insert into t2(id2,t) values ($1,'bbbbbbbbbbbbbbbbb');
+ dec $2;
+ }
+ dec $1;
+ }
+enable_query_log;
+delete t1 from t1,t2 where t1.id1 = t2.id2 and t1.id1 > 500;
+drop table t1,t2;
+DROP TABLE IF EXISTS a,b,c;
+CREATE TABLE a (
+ id int(11) NOT NULL default '0',
+ name varchar(10) default NULL,
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
+INSERT INTO a VALUES (1,'aaa'),(2,'aaa'),(3,'aaa');
+CREATE TABLE b (
+ id int(11) NOT NULL default '0',
+ name varchar(10) default NULL,
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
+INSERT INTO b VALUES (2,'bbb'),(3,'bbb'),(4,'bbb');
+CREATE TABLE c (
+ id int(11) NOT NULL default '0',
+ mydate datetime default NULL,
+ PRIMARY KEY (id)
+) TYPE=MyISAM;
+INSERT INTO c VALUES (1,'2002-02-04 00:00:00'),(3,'2002-05-12 00:00:00'),(5,'2002-05-12 00:00:00'),(6,'2002-06-22
+00:00:00'),(7,'2002-07-22 00:00:00');
+delete a,b,c from a,b,c
+where to_days(now())-to_days(c.mydate)>=30
+and c.id=a.id and c.id=b.id;
+select * from c;
+DROP TABLE IF EXISTS a,b,c;
+drop table if exists parent, child;
+CREATE TABLE IF NOT EXISTS `parent` (
+ `id` int(11) NOT NULL auto_increment,
+ `tst` text,
+ `tst1` text,
+ PRIMARY KEY (`id`)
+) TYPE=MyISAM;
+
+CREATE TABLE IF NOT EXISTS `child` (
+ `ID` int(11) NOT NULL auto_increment,
+ `ParId` int(11) default NULL,
+ `tst` text,
+ `tst1` text,
+ PRIMARY KEY (`ID`),
+ KEY `IX_ParId_child` (`ParId`),
+ FOREIGN KEY (`ParId`) REFERENCES `test.parent` (`id`)
+) TYPE=MyISAM;
+
+INSERT INTO parent(tst,tst1)
+VALUES("MySQL","MySQL AB"), ("MSSQL","Microsoft"), ("ORACLE","ORACLE");
+
+INSERT INTO child(ParId)
+VALUES(1), (2), (3);
+
+select * from child;
+
+UPDATE child, parent
+SET child.tst = parent.tst,
+child.tst1 = parent.tst1
+WHERE child.ParId = parent.Id;
+
+select * from child;
+
+
+drop table parent, child; \ No newline at end of file
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 42d1dd6d553..2479a68fc09 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -66,3 +66,30 @@ explain select a,b from t1 order by b;
explain select a,b from t1;
explain select a,b,c from t1;
drop table t1;
+
+#
+# Test of REPAIR that once failed
+#
+CREATE TABLE `t1` (
+ `post_id` mediumint(8) unsigned NOT NULL auto_increment,
+ `topic_id` mediumint(8) unsigned NOT NULL default '0',
+ `post_time` datetime NOT NULL default '0000-00-00 00:00:00',
+ `post_text` text NOT NULL,
+ `icon_url` varchar(10) NOT NULL default '',
+ `sign` tinyint(1) unsigned NOT NULL default '0',
+ `post_edit` varchar(150) NOT NULL default '',
+ `poster_login` varchar(35) NOT NULL default '',
+ `ip` varchar(15) NOT NULL default '',
+ PRIMARY KEY (`post_id`),
+ KEY `post_time` (`post_time`),
+ KEY `ip` (`ip`),
+ KEY `poster_login` (`poster_login`),
+ KEY `topic_id` (`topic_id`),
+ FULLTEXT KEY `post_text` (`post_text`)
+) TYPE=MyISAM;
+
+INSERT INTO t1 (post_text) VALUES ('ceci est un test'),('ceci est un test'),('ceci est un test'),('ceci est un test'),('ceci est un test');
+
+REPAIR TABLE t1;
+CHECK TABLE t1;
+drop table t1;
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test
new file mode 100644
index 00000000000..8fe547db615
--- /dev/null
+++ b/mysql-test/t/olap.test
@@ -0,0 +1,27 @@
+drop table if exists sales;
+create table sales ( product varchar(32), country varchar(32), year int, profit int);
+insert into sales values ( 'Computer', 'India',2000, 1200),
+( 'TV', 'United States', 1999, 150),
+( 'Calculator', 'United States', 1999,50),
+( 'Computer', 'United States', 1999,1500),
+( 'Computer', 'United States', 2000,1500),
+( 'TV', 'United States', 2000, 150),
+( 'TV', 'India', 2000, 100),
+( 'TV', 'India', 2000, 100),
+( 'Calculator', 'United States', 2000,75),
+( 'Calculator', 'India', 2000,75),
+( 'TV', 'India', 1999, 100),
+( 'Computer', 'India', 1999,1200),
+( 'Computer', 'United States', 2000,1500),
+( 'Calculator', 'United States', 2000,75);
+--error 1235
+select product, country , year, sum(profit) from sales group by product, country, year with cube;
+--error 1235
+explain select product, country , year, sum(profit) from sales group by product, country, year with cube;
+--error 1235
+select product, country , year, sum(profit) from sales group by product, country, year with rollup;
+--error 1235
+explain select product, country , year, sum(profit) from sales group by product, country, year with rollup;
+--error 1235
+select product, country , year, sum(profit) from sales group by product, country, year with cube union all select product, country , year, sum(profit) from sales group by product, country, year with rollup;
+drop table sales;
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index a3227a5db1d..5dc6d1047f4 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -139,17 +139,17 @@ drop table t1, t2, t3, t11, t21;
#
# SELECT SQL_CACHE ...
#
-set sql_query_cache_type=demand;
+set query_cache_type=demand;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
select * from t1;
show status like "Qcache_queries_in_cache";
select sql_cache * from t1;
-set sql_query_cache_type=2;
+set query_cache_type=2;
select sql_cache * from t1;
show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
-set sql_query_cache_type=on;
+set query_cache_type=on;
#
# RESET QUERY CACHE
#
@@ -336,3 +336,34 @@ select a from t1;
show status like "Qcache_queries_in_cache";
drop table t1;
show status like "Qcache_queries_in_cache";
+
+#
+# Test of query cache resizing
+#
+set GLOBAL query_cache_size=1000;
+show global variables like "query_cache_size";
+set GLOBAL query_cache_size=1100;
+set GLOBAL query_cache_size=1200;
+set GLOBAL query_cache_size=1300;
+set GLOBAL query_cache_size=1400;
+set GLOBAL query_cache_size=1500;
+set GLOBAL query_cache_size=1600;
+set GLOBAL query_cache_size=1700;
+set GLOBAL query_cache_size=1800;
+set GLOBAL query_cache_size=1900;
+show global variables like "query_cache_size";
+
+#
+# Temporary tables
+#
+set GLOBAL query_cache_size=1048576;
+create table t1 (i int not null);
+create table t2 (i int not null);
+select * from t1;
+show status like "Qcache_queries_in_cache";
+create temporary table t3 (i int not null);
+select * from t2;
+show status like "Qcache_queries_in_cache";
+select * from t3;
+show status like "Qcache_queries_in_cache";
+drop table t1, t2, t3;
diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test
index a5496d505f0..0f195c65fb0 100644
--- a/mysql-test/t/rpl000001.test
+++ b/mysql-test/t/rpl000001.test
@@ -1,21 +1,36 @@
-eval_result;
source include/master-slave.inc;
-connection master;
-use test;
-drop table if exists t1,t3;
+drop table if exists t1,t2,t3;
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
select * from t1;
+
+#
+# Test slave with wrong password
+#
+save_master_pos;
+connection slave;
+sync_with_master;
+slave stop;
+connection master;
set password for root@"localhost" = password('foo');
+connection slave;
+slave start;
+connection master;
+#
+# Give slave time to do at last one failed connect retry
+# This one must be short so that the slave will not stop retrying
+real_sleep 2;
set password for root@"localhost" = password('');
+# Give slave time to connect (will retry every second)
+sleep 2;
+
create table t3(n int);
insert into t3 values(1),(2);
save_master_pos;
connection slave;
sync_with_master;
-use test;
select * from t3;
select sum(length(word)) from t1;
connection master;
@@ -32,7 +47,6 @@ slave stop;
reset slave;
connection master;
-drop table if exists t1,t2;
create table t1(n int);
#we want the log to exceed 16K to test deal with the log that is bigger than
#IO_SIZE
@@ -45,12 +59,12 @@ while ($1)
}
enable_query_log;
-#try to cause a large relay log lag on the slave
+# Try to cause a large relay log lag on the slave
connection slave;
select get_lock("hold_slave",10);
slave start;
#hope this is long enough for I/O thread to fetch over 16K relay log data
-sleep 1;
+sleep 3;
select release_lock("hold_slave");
unlock tables;
@@ -59,24 +73,24 @@ create table t2(id int);
insert into t2 values(connection_id());
save_master_pos;
-
connection master1;
-#avoid generating result
-create temporary table t1_temp(n int);
-insert into t1_temp select get_lock('crash_lock%20C', 1) from t2;
+# Avoid generating result
+create temporary table t3(n int);
+insert into t3 select get_lock('crash_lock%20C', 1) from t2;
connection master;
send update t1 set n = n + get_lock('crash_lock%20C', 2);
connection master1;
-sleep 2;
+sleep 3;
select (@id := id) - id from t2;
kill @id;
+# We don't drop t3 as this is a temporary table
drop table t2;
connection master;
--error 1053;
reap;
connection slave;
-sync_with_master ;
+sync_with_master;
#give the slave a chance to exit
wait_for_slave_to_stop;
@@ -85,20 +99,18 @@ wait_for_slave_to_stop;
# --replace_result 9306 9999 3334 9999 3335 9999
# show slave status;
-set sql_slave_skip_counter=1;
+set global sql_slave_skip_counter=1;
slave start;
select count(*) from t1;
connection master1;
drop table t1;
create table t1 (n int);
insert into t1 values(3456);
-use mysql;
-insert into user (Host, User, Password)
+insert into mysql.user (Host, User, Password)
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
select select_priv,user from mysql.user where user = 'blafasel2';
-update user set Select_priv = "Y" where User="blafasel2";
+update mysql.user set Select_priv = "Y" where User="blafasel2";
select select_priv,user from mysql.user where user = 'blafasel2';
-use test;
save_master_pos;
connection slave;
sync_with_master;
@@ -109,5 +121,3 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
-
-
diff --git a/mysql-test/t/rpl000002.test b/mysql-test/t/rpl000002.test
index 420ae27a337..caf0b4ef6d8 100644
--- a/mysql-test/t/rpl000002.test
+++ b/mysql-test/t/rpl000002.test
@@ -1,17 +1,14 @@
source include/master-slave.inc;
-eval_result;
-connection master;
-use test;
drop table if exists t1;
create table t1 (n int auto_increment primary key);
set insert_id = 2000;
insert into t1 values (NULL),(NULL),(NULL);
save_master_pos;
connection slave;
-use test;
sync_with_master;
select * from t1;
connection master;
+--replace_result $SLAVE_MYPORT 9999
show slave hosts;
drop table t1;
save_master_pos;
diff --git a/mysql-test/t/rpl000003.test b/mysql-test/t/rpl000003.test
index c4b120d31b0..f994ed94371 100644
--- a/mysql-test/t/rpl000003.test
+++ b/mysql-test/t/rpl000003.test
@@ -1,5 +1,4 @@
source include/master-slave.inc;
-connection master;
drop table if exists t1;
create table t1(n int primary key);
!insert into t1 values (1),(2),(2);
diff --git a/mysql-test/t/rpl000004.test b/mysql-test/t/rpl000004.test
index 5b2c41293a2..705e0d51b7b 100644
--- a/mysql-test/t/rpl000004.test
+++ b/mysql-test/t/rpl000004.test
@@ -1,6 +1,4 @@
source include/master-slave.inc;
-connection master;
-use test;
set SQL_LOG_BIN=0;
drop table if exists t1;
create table t1 (word char(20) not null, index(word));
@@ -10,7 +8,6 @@ create table t2 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t2;
create table t3 (word char(20) not null primary key);
connection slave;
-use test;
drop table if exists t1;
load table t1 from master;
drop table if exists t2;
diff --git a/mysql-test/t/rpl000005.test b/mysql-test/t/rpl000005.test
index 92d954a6182..1cfea242b69 100644
--- a/mysql-test/t/rpl000005.test
+++ b/mysql-test/t/rpl000005.test
@@ -1,5 +1,4 @@
source include/master-slave.inc;
-connection master;
drop table if exists t1;
CREATE TABLE t1 (name varchar(64), age smallint(3));
INSERT INTO t1 SET name='Andy', age=31;
diff --git a/mysql-test/t/rpl000006.test b/mysql-test/t/rpl000006.test
index 495f34bd5e7..ad8622c2a81 100644
--- a/mysql-test/t/rpl000006.test
+++ b/mysql-test/t/rpl000006.test
@@ -2,7 +2,6 @@
# Test forced timestamp
#
source include/master-slave.inc;
-connection master;
# Don't log table creating to the slave as we want to test LOAD TABLE
set SQL_LOG_BIN=0,timestamp=200006;
diff --git a/mysql-test/t/rpl000007.test b/mysql-test/t/rpl000007.test
index 4425a5725e8..8ff1e1782cc 100644
--- a/mysql-test/t/rpl000007.test
+++ b/mysql-test/t/rpl000007.test
@@ -2,12 +2,10 @@
#the ones on bar
source include/master-slave.inc;
connection slave;
-use test;
drop table if exists foo;
create table foo (n int);
insert into foo values(4);
connection master;
-use test;
drop table if exists foo;
create table foo (s char(20));
load data infile '../../std_data/words.dat' into table foo;
diff --git a/mysql-test/t/rpl000009.test b/mysql-test/t/rpl000009.test
index 208e6f0b037..3d0827718ec 100644
--- a/mysql-test/t/rpl000009.test
+++ b/mysql-test/t/rpl000009.test
@@ -1,7 +1,7 @@
-#this one assumes we are ignoring updates on tables in database foo, but doing
-#the ones in database bar
+# This one assumes we are ignoring updates on tables in database foo, but doing
+# the ones in database bar
+
source include/master-slave.inc;
-connection master;
drop database if exists foo;
create database foo;
drop database if exists bar;
@@ -32,9 +32,10 @@ sync_with_master;
drop database if exists bar;
drop database if exists foo;
-#now let's test load data from master
+# Now let's test load data from master
+
+# First create some databases and tables on the master
-#first create some databases and tables on the master
connection master;
set sql_log_bin = 0;
create database foo;
@@ -55,11 +56,11 @@ save_master_pos;
connection slave;
sync_with_master;
-#this should show that the slave is empty at this point
+# This should show that the slave is empty at this point
show databases;
load data from master;
-#now let's check if we have the right tables and the right data in them
+# Now let's check if we have the right tables and the right data in them
show databases;
use foo;
show tables;
@@ -68,7 +69,7 @@ show tables;
select * from bar.t1;
select * from bar.t2;
-#now let's see if replication works
+# Now let's see if replication works
connection master;
insert into bar.t1 values (4, 'four bar');
save_master_pos;
@@ -76,7 +77,7 @@ connection slave;
sync_with_master;
select * from bar.t1;
-#now time for cleanup
+# Now time for cleanup
connection master;
drop database bar;
drop database foo;
diff --git a/mysql-test/t/rpl000011.test b/mysql-test/t/rpl000011.test
index 7d99222b3c7..d75937e3f81 100644
--- a/mysql-test/t/rpl000011.test
+++ b/mysql-test/t/rpl000011.test
@@ -1,6 +1,4 @@
source include/master-slave.inc;
-connection master;
-use test;
drop table if exists t1;
create table t1 (n int);
insert into t1 values(1);
diff --git a/mysql-test/t/rpl000013.test b/mysql-test/t/rpl000013.test
index a190d5324ae..14619796e01 100644
--- a/mysql-test/t/rpl000013.test
+++ b/mysql-test/t/rpl000013.test
@@ -1,5 +1,4 @@
source include/master-slave.inc;
-connection master;
save_master_pos;
connection slave;
sync_with_master;
diff --git a/mysql-test/t/rpl000017.test b/mysql-test/t/rpl000017.test
index 011b6507e49..f346ca39ca0 100644
--- a/mysql-test/t/rpl000017.test
+++ b/mysql-test/t/rpl000017.test
@@ -2,8 +2,8 @@ connect (master,localhost,root,,test,0,master.sock);
connect (slave,localhost,root,,test,0,slave.sock);
connection master;
reset master;
-grant file on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
-grant file on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
+grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
+grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
connection slave;
slave start;
connection master;
diff --git a/mysql-test/t/rpl000018.test b/mysql-test/t/rpl000018.test
index 30d601bb375..291b482b912 100644
--- a/mysql-test/t/rpl000018.test
+++ b/mysql-test/t/rpl000018.test
@@ -1,3 +1,8 @@
+#
+# Running test with abort-slave-event-count=1
+# This will force slave to reconnect after every event
+#
+
require_manager;
connect (master,localhost,root,,test,0,master.sock);
connect (slave,localhost,root,,test,0,slave.sock);
diff --git a/mysql-test/t/rpl_alter.test b/mysql-test/t/rpl_alter.test
new file mode 100644
index 00000000000..710dd2d09d6
--- /dev/null
+++ b/mysql-test/t/rpl_alter.test
@@ -0,0 +1,19 @@
+source include/master-slave.inc;
+drop database if exists d1;
+create database d1;
+create table d1.t1 ( n int);
+alter table d1.t1 add m int;
+insert into d1.t1 values (1,2);
+create table d1.t2 (n int);
+insert into d1.t2 values (45);
+rename table d1.t2 to d1.t3, d1.t1 to d1.t2;
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from d1.t2;
+select * from d1.t3;
+connection master;
+drop database d1;
+save_master_pos;
+connection slave;
+sync_with_master;
diff --git a/mysql-test/t/rpl_compat.test b/mysql-test/t/rpl_compat.test
deleted file mode 100644
index c9455c1e2d2..00000000000
--- a/mysql-test/t/rpl_compat.test
+++ /dev/null
@@ -1,86 +0,0 @@
-eval_result;
-source include/master-slave.inc;
-connection master;
-require_version 3.23;
-use test;
-drop table if exists t1,t3;
-create table t1 (word char(20) not null);
-load data infile '../../std_data/words.dat' into table t1;
-select * from t1;
-set password for root@"localhost" = password('foo');
-set password for root@"localhost" = password('');
-create table t3(n int);
-insert into t3 values(1),(2);
-save_master_pos;
-connection slave;
-sync_with_master;
-use test;
-select * from t3;
-select sum(length(word)) from t1;
-connection master;
-drop table t1,t3;
-save_master_pos;
-connection slave;
-sync_with_master;
-
-#test handling of aborted connection in the middle of update
-connection master;
-reset master;
-connection slave;
-slave stop;
-reset slave;
-
-connection master;
-create table t1(n int);
-insert into t1 values (1),(2),(3);
-create table t2(id int);
-insert into t2 values(connection_id());
-save_master_pos;
-
-connection master1;
-#avoid generating result
-create temporary table t1_temp(n int);
-insert into t1_temp select get_lock('crash_lock%20C', 1) from t2;
-
-connection master;
-send update t1 set n = n + get_lock('crash_lock%20C', 2);
-connection master1;
-sleep 2;
-select (@id := id) - id from t2;
-kill @id;
-drop table t2;
-connection master;
---error 1053;
-reap;
-connection slave;
-slave start;
-sync_with_master ;
-#now slave will hit an error
-wait_for_slave_to_stop;
-
-set sql_slave_skip_counter=1;
-slave start;
-select count(*) from t1;
-connection master1;
-drop table t1;
-create table t1 (n int);
-insert into t1 values(3456);
-use mysql;
-insert into user (Host, User, Password)
- VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
-select select_priv,user from mysql.user where user = 'blafasel2';
-update user set Select_priv = "Y" where User="blafasel2";
-select select_priv,user from mysql.user where user = 'blafasel2';
-use test;
-save_master_pos;
-connection slave;
-sync_with_master;
-select n from t1;
-select select_priv,user from mysql.user where user = 'blafasel2';
-connection master1;
-drop table t1;
-save_master_pos;
-connection slave;
-sync_with_master;
-
-
diff --git a/mysql-test/t/rpl_empty_master_crash.test b/mysql-test/t/rpl_empty_master_crash.test
index 158b59169ee..afa76ce10bb 100644
--- a/mysql-test/t/rpl_empty_master_crash.test
+++ b/mysql-test/t/rpl_empty_master_crash.test
@@ -1,7 +1,11 @@
source include/master-slave.inc;
-connection master;
-use test;
drop table if exists t1;
show slave status;
+#
+# Load table should not succeed on the master as this is not a slave
+#
--error 1218
load table t1 from master;
+connection slave;
+--error 1188
+load table t1 from master;
diff --git a/mysql-test/t/rpl_get_lock.test b/mysql-test/t/rpl_get_lock.test
index 3fe45eecf46..e93268e6074 100644
--- a/mysql-test/t/rpl_get_lock.test
+++ b/mysql-test/t/rpl_get_lock.test
@@ -1,5 +1,5 @@
source include/master-slave.inc;
-connection master;
+
create table t1(n int);
insert into t1 values(get_lock("lock",2));
dirty_close master;
@@ -21,6 +21,10 @@ connection slave;
sync_with_master;
select get_lock("lock",3);
select * from t1;
+select is_free_lock("lock");
+# Check lock functions
+select is_free_lock("lock2");
+select is_free_lock(NULL);
connection master1;
drop table t1;
save_master_pos;
diff --git a/mysql-test/t/rpl000014.test b/mysql-test/t/rpl_log_pos.test
index df15fa6e600..f585fa233c5 100644
--- a/mysql-test/t/rpl000014.test
+++ b/mysql-test/t/rpl_log_pos.test
@@ -1,5 +1,7 @@
+#
+# Testing of setting slave to wrong log position with master_log_pos
+#
source include/master-slave.inc;
-connection master;
show master status;
save_master_pos;
connection slave;
@@ -7,30 +9,35 @@ sync_with_master;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status;
change master to master_log_pos=73;
+sleep 5;
slave stop;
change master to master_log_pos=73;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status;
slave start;
+sleep 5;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status;
change master to master_log_pos=173;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
+slave start;
+sleep 2;
show slave status;
connection master;
show master status;
-create table if not exists foo(n int);
-drop table if exists foo;
-create table foo (n int);
-insert into foo values (1),(2),(3);
+create table if not exists t1 (n int);
+drop table if exists t1;
+create table t1 (n int);
+insert into t1 values (1),(2),(3);
save_master_pos;
connection slave;
change master to master_log_pos=79;
+slave start;
sync_with_master;
-select * from foo;
+select * from t1;
connection master;
-drop table foo;
+drop table t1;
save_master_pos;
connection slave;
sync_with_master;
diff --git a/mysql-test/t/rpl_magic.test b/mysql-test/t/rpl_magic.test
index 376edc301d7..c93add93d9d 100644
--- a/mysql-test/t/rpl_magic.test
+++ b/mysql-test/t/rpl_magic.test
@@ -1,7 +1,6 @@
source include/master-slave.inc;
#first, make sure the slave has had enough time to register
-connection master;
save_master_pos;
connection slave;
sync_with_master;
diff --git a/mysql-test/t/rpl_mystery22.test b/mysql-test/t/rpl_mystery22.test
index e987074697b..371c5ba21ed 100644
--- a/mysql-test/t/rpl_mystery22.test
+++ b/mysql-test/t/rpl_mystery22.test
@@ -1,8 +1,7 @@
# test case to make slave thread get ahead by 22 bytes
-drop table if exists t1;
source include/master-slave.inc;
-connection master;
+
# first, cause a duplicate key problem on the slave
create table t1(n int auto_increment primary key);
save_master_pos;
diff --git a/mysql-test/t/rpl000016-master.opt b/mysql-test/t/rpl_rotate_logs-master.opt
index f27601e0d7d..f27601e0d7d 100644
--- a/mysql-test/t/rpl000016-master.opt
+++ b/mysql-test/t/rpl_rotate_logs-master.opt
diff --git a/mysql-test/t/rpl000016-slave-master-info.opt b/mysql-test/t/rpl_rotate_logs-slave-master-info.opt
index 80190bf6d29..80190bf6d29 100644
--- a/mysql-test/t/rpl000016-slave-master-info.opt
+++ b/mysql-test/t/rpl_rotate_logs-slave-master-info.opt
diff --git a/mysql-test/t/rpl000016-slave.sh b/mysql-test/t/rpl_rotate_logs-slave.sh
index 9259f593e54..9259f593e54 100755
--- a/mysql-test/t/rpl000016-slave.sh
+++ b/mysql-test/t/rpl_rotate_logs-slave.sh
diff --git a/mysql-test/t/rpl000016.test b/mysql-test/t/rpl_rotate_logs.test
index 7559b2d3515..cea2f9008dc 100644
--- a/mysql-test/t/rpl000016.test
+++ b/mysql-test/t/rpl_rotate_logs.test
@@ -1,11 +1,24 @@
+#
+# Test are run with max_binlog_size=2048 to force automatic rotation of the
+# binary log
+# Tests done:
+# - Check that slaves reports correct failures if master.info has strange
+# modes/information
+# - Automatic binary log rotation
+# - Ensure that temporary tables works over flush logs and binary log
+# changes
+# - Test creating a duplicate key error and recover from it
+#
connect (master,localhost,root,,test,0,master.sock);
connect (slave,localhost,root,,test,0,slave.sock);
system cat /dev/null > var/slave-data/master.info;
system chmod 000 var/slave-data/master.info;
connection slave;
-!slave start;
+--error 1201
+slave start;
system chmod 600 var/slave-data/master.info;
-!slave start;
+--error 1201
+slave start;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
!eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT,
master_user='root';
@@ -18,7 +31,14 @@ reset master;
connection slave;
slave start;
connection master;
-drop table if exists t1;
+
+drop table if exists t1, t2, t3, t4;
+
+#
+# Test FLUSH LOGS
+#
+create temporary table temp_table (a char(80) not null);
+insert into temp_table values ("testing temporary tables");
create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard');
save_master_pos;
@@ -32,15 +52,24 @@ flush logs;
drop table if exists t2;
create table t2(m int not null auto_increment primary key);
insert into t2 values (34),(67),(123);
-save_master_pos;
flush logs;
show master logs;
+create table t3 select * from temp_table;
-#now lets make some duplicate key mess and see if we can recover from it
-
-#first insert a value on the slave
+save_master_pos;
connection slave;
sync_with_master;
+
+select * from t3;
+connection master;
+drop table temp_table, t3;
+
+#
+# Now lets make some duplicate key mess and see if we can recover from it
+#
+
+# First insert a value on the slave
+connection slave;
insert into t2 values(1234);
#same value on the master
@@ -54,7 +83,7 @@ sync_with_master;
wait_for_slave_to_stop;
#restart slave skipping one event
-set sql_slave_skip_counter=1;
+set global sql_slave_skip_counter=1;
slave start;
connection master;
@@ -73,7 +102,14 @@ sync_with_master;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status;
select * from t2;
+
+#
+# Test forcing the replication log to rotate
+#
+
connection master;
+create temporary table temp_table (a char(80) not null);
+insert into temp_table values ("testing temporary tables part 2");
let $1=100;
drop table if exists t3;
create table t3 (n int);
@@ -85,13 +121,16 @@ while ($1)
dec $1;
}
enable_query_log;
+create table t4 select * from temp_table;
show master logs;
show master status;
save_master_pos;
connection slave;
-slave stop;
-slave start;
+#slave stop;
+#slave start;
sync_with_master;
+select * from t4;
+
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status;
# because of concurrent insert, the table may not be up to date
diff --git a/mysql-test/t/rpl_skip_error.test b/mysql-test/t/rpl_skip_error.test
index 3303b45c1ca..d43c59ef024 100644
--- a/mysql-test/t/rpl_skip_error.test
+++ b/mysql-test/t/rpl_skip_error.test
@@ -1,6 +1,6 @@
source include/master-slave.inc;
-connection master;
drop table if exists t1;
+
create table t1 (n int not null primary key);
save_master_pos;
connection slave;
diff --git a/mysql-test/t/rpl_sporadic_master.test b/mysql-test/t/rpl_sporadic_master.test
index 0487f868436..e59b93b4475 100644
--- a/mysql-test/t/rpl_sporadic_master.test
+++ b/mysql-test/t/rpl_sporadic_master.test
@@ -2,8 +2,7 @@
# COM_BINLOG_DUMP and additionally limits the number of events per dump
source include/master-slave.inc;
-connection master;
-drop table if exists t1,t2;
+
create table t2(n int);
create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL),(NULL);
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index ab4251fe536..4dd833616d5 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -1712,6 +1712,8 @@ show full columns from t2 from test like 'f%';
show full columns from t2 from test like 's%';
show keys from t2;
+drop table t4, t3, t2, t1;
+
#
# Test of DO
@@ -1719,7 +1721,25 @@ DO 1;
DO benchmark(100,1+1),1,1;
#
-# Drop the test tables
+# Test of bug with SUM(CASE...)
+#
+
+CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp(14) NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) TYPE=MyISAM;
+INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL);
+CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) TYPE=MyISAM;
+INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35);
+SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'NULL' AND b.sampletime < 'NULL' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid;
+DROP TABLE t1,t2;
+
+#
+# Test of bigint comparision
#
-drop table t4, t3,t2, t1;
+create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0');
+INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093);
+select wss_type from t1 where wss_type ='102935229216544106';
+select wss_type from t1 where wss_type ='102935229216544105';
+select wss_type from t1 where wss_type ='102935229216544104';
+select wss_type from t1 where wss_type ='102935229216544093';
+select wss_type from t1 where wss_type =102935229216544093;
+drop table t1;
diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test
index c95d46b166c..0a483c860cb 100644
--- a/mysql-test/t/select_found.test
+++ b/mysql-test/t/select_found.test
@@ -68,3 +68,20 @@ SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id W
SELECT FOUND_ROWS();
drop table t1,t2;
+
+#
+# Test bug when using range optimization
+#
+
+CREATE TABLE `t1` (
+ `titre` char(80) NOT NULL default '',
+ `numeropost` mediumint(8) unsigned NOT NULL auto_increment,
+ `maxnumrep` int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (`numeropost`),
+ KEY `maxnumrep` (`maxnumrep`)
+) TYPE=MyISAM ROW_FORMAT=FIXED;
+INSERT INTO t1 (titre,maxnumrep) VALUES
+('test1','1'),('test2','2'),('test3','3');
+SELECT SQL_CALC_FOUND_ROWS titre,numeropost,maxnumrep FROM t1 WHERE numeropost IN (1,2) ORDER BY maxnumrep DESC LIMIT 0, 1;
+SELECT FOUND_ROWS();
+drop table t1;
diff --git a/mysql-test/t/truncate.test b/mysql-test/t/truncate.test
index 1729ddc586a..841ce06351e 100644
--- a/mysql-test/t/truncate.test
+++ b/mysql-test/t/truncate.test
@@ -18,3 +18,5 @@ insert into t1 values (1),(2),(3);
truncate table t1;
select * from t1;
drop table t1;
+--error 1146
+truncate non_existing_table;
diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test
index 21e06c0dbe9..95420539611 100644
--- a/mysql-test/t/type_decimal.test
+++ b/mysql-test/t/type_decimal.test
@@ -160,6 +160,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
+insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
+insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
select * from t1;
drop table t1;
@@ -169,6 +171,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
+insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
+insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
select * from t1;
drop table t1;
@@ -178,6 +182,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
+insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
+insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
select * from t1;
drop table t1;
@@ -189,6 +195,8 @@ insert into t1 values (-.1),(+.1),(.1);
insert into t1 values (00000000000001),(+0000000000001),(-0000000000001);
insert into t1 values (+111111111.11),(111111111.11),(-11111111.11);
insert into t1 values (-111111111.11),(+1111111111.11),(1111111111.11);
+insert into t1 values (1e+100),(1e-100),(-1e+100);
+insert into t1 values (123.4e0),(123.4e+2),(123.4e-2),(123e1),(123e+0);
select * from t1;
drop table t1;
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index f5a92b05e0d..6e6b43ebe3b 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -23,7 +23,11 @@ select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 g
explain (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
(select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
select found_rows();
+
+#
# Test some error conditions with UNION
+#
+
explain select a,b from t1 union all select a,b from t2;
--error 1054
@@ -53,6 +57,9 @@ select * from t1 union select a from t2;
--error 1222
select a from t1 union select * from t2;
+--error 1234
+select * from t1 union select SQL_BUFFER_RESULT * from t2;
+
# Test CREATE, INSERT and REPLACE
create table t3 select a,b from t1 union all select a,b from t2;
insert into t3 select a,b from t1 union all select a,b from t2;
@@ -88,6 +95,6 @@ insert into t2 values (11),(12),(13),(14),(15);
(select * from t1 limit 2) union (select * from t2 limit 3);
(select * from t1 limit 2) union (select * from t2 limit 20,3);
set SQL_SELECT_LIMIT=2;
-(select * from t1 limit 2) union (select * from t2 limit 3);
+(select * from t1 limit 1) union (select * from t2 limit 3);
set SQL_SELECT_LIMIT=DEFAULT;
drop table t1,t2;
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index 70283446fb3..bb1a9b59611 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -1,4 +1,4 @@
-error 1204;
+error 1054;
set @a := foo;
set @a := connection_id() + 3;
select @a - connection_id();
diff --git a/mysql-test/t/variables-master.opt b/mysql-test/t/variables-master.opt
new file mode 100644
index 00000000000..5851d32ec31
--- /dev/null
+++ b/mysql-test/t/variables-master.opt
@@ -0,0 +1 @@
+max_join_size=10
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index b3127402238..7a1d01c2cb5 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -32,9 +32,207 @@ drop table t1;
# Test system variables
#
+set max_join_size=100;
+show variables like 'max_join_size';
+show global variables like 'max_join_size';
+set GLOBAL max_join_size=2000;
+show global variables like 'max_join_size';
+set max_join_size=DEFAULT;
+show variables like 'max_join_size';
+set GLOBAL max_join_size=DEFAULT;
+show global variables like 'max_join_size';
+set @@max_join_size=1000, @@global.max_join_size=2000;
+select @@local.max_join_size, @@global.max_join_size;
+select @@identity, length(@@version)>0;
select @@VERSION=version();
select last_insert_id(345);
-select @@IDENTITY,last_insert_id();
-select @@identity;
+select @@IDENTITY,last_insert_id(), @@identity;
+
+set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON";
+
+set global concurrent_insert=ON;
+show variables like 'concurrent_insert';
+set global concurrent_insert=1;
+show variables like 'concurrent_insert';
+set global concurrent_insert=0;
+show variables like 'concurrent_insert';
+set global concurrent_insert=OFF;
+show variables like 'concurrent_insert';
+set global concurrent_insert=DEFAULT;
+show variables like 'concurrent_insert';
+
+set table_type=MYISAM, table_type="HEAP", global table_type="INNODB";
+show local variables like 'table_type';
+show global variables like 'table_type';
+set GLOBAL query_cache_size=100000;
+set GLOBAL safe_show_database=0;
+
+set myisam_max_sort_file_size=10000, GLOBAL myisam_max_sort_file_size=20000;
+show variables like 'myisam_max_sort_file_size';
+show global variables like 'myisam_max_sort_file_size';
+set myisam_max_sort_file_size=default;
+show variables like 'myisam_max_sort_file_size';
+
+set global net_retry_count=10, session net_retry_count=10;
+set global net_buffer_length=1024, net_write_timeout=200, net_read_timeout=300;
+set session net_buffer_length=2048, net_write_timeout=500, net_read_timeout=600;
+show global variables like 'net_%';
+show session variables like 'net_%';
+set session net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
+show global variables like 'net_%';
+show session variables like 'net_%';
+set net_buffer_length=1;
+show variables like 'net_buffer_length';
+set net_buffer_length=2000000000;
+show variables like 'net_buffer_length';
+
+set GLOBAL character set cp1251_koi8;
+show global variables like "convert_character_set";
+set character set cp1251_koi8;
+show variables like "convert_character_set";
+set global character set default, session character set default;
+show variables like "convert_character_set";
+select @@timestamp>0;
+
+# The following should give errors
+
+--error 1231
+set big_tables=OFFF;
+--error 1231
+set big_tables="OFFF";
--error 1193
-select @@unknown_variable;
+set unknown_variable=1;
+--error 1232
+set max_join_size="hello";
+--error 1231
+set table_type=UNKNOWN_TABLE_TYPE;
+--error 1231
+set table_type=INNODB, big_tables=2;
+show local variables like 'table_type';
+--error 1229
+set SESSION query_cache_size=10000;
+--error 1230
+set GLOBAL table_type=DEFAULT;
+--error 1115
+set convert_character_set=UNKNOWN_CHARACTER_SET;
+--error 1115
+set character set unknown;
+--error 1232
+set character set 0;
+--error 1228
+set global autocommit=1;
+--error 1228
+select @@global.timestamp;
+--error 1193
+set @@version='';
+--error 1229
+set @@concurrent_insert=1;
+--error 1228
+set @@global.sql_auto_is_null=1;
+--error 1228
+select @@global.sql_auto_is_null;
+
+# Test setting all variables
+
+set autocommit=1;
+set big_tables=1;
+select @@autocommit, @@big_tables;
+set global binlog_cache_size=100;
+set bulk_insert_buffer_size=100;
+set convert_character_set=cp1251_koi8;
+set convert_character_set=default;
+set @@global.concurrent_insert=1;
+set global connect_timeout=100;
+select @@delay_key_write;
+set global delay_key_write="OFF";
+select @@delay_key_write;
+set global delay_key_write=ALL;
+select @@delay_key_write;
+set global delay_key_write=1;
+select @@delay_key_write;
+set global delayed_insert_limit=100;
+set global delayed_insert_timeout=100;
+set global delayed_queue_size=100;
+set global flush=1;
+set global flush_time=100;
+set insert_id=1;
+set interactive_timeout=100;
+set join_buffer_size=100;
+set last_insert_id=1;
+set global local_infile=1;
+set long_query_time=100;
+set low_priority_updates=1;
+set max_allowed_packet=100;
+set global max_binlog_cache_size=100;
+set global max_binlog_size=100;
+set global max_connect_errors=100;
+set global max_connections=100;
+set global max_delayed_threads=100;
+set max_heap_table_size=100;
+set max_join_size=100;
+set max_sort_length=100;
+set max_tmp_tables=100;
+set global max_user_connections=100;
+select @@max_user_connections;
+set global max_write_lock_count=100;
+set myisam_max_extra_sort_file_size=100;
+select @@myisam_max_extra_sort_file_size;
+set myisam_max_sort_file_size=100;
+set myisam_sort_buffer_size=100;
+set net_buffer_length=100;
+set net_read_timeout=100;
+set net_write_timeout=100;
+set global query_cache_limit=100;
+set global query_cache_size=100;
+set global query_cache_type=demand;
+set read_buffer_size=100;
+set read_rnd_buffer_size=100;
+set global rpl_recovery_rank=100;
+set global safe_show_database=1;
+set global server_id=100;
+set global slave_net_timeout=100;
+set global slow_launch_time=100;
+set sort_buffer_size=100;
+set sql_auto_is_null=1;
+select @@sql_auto_is_null;
+set @@sql_auto_is_null=0;
+select @@sql_auto_is_null;
+set sql_big_selects=1;
+set sql_big_tables=1;
+set sql_buffer_result=1;
+set sql_log_bin=1;
+set sql_log_off=1;
+set sql_log_update=1;
+set sql_low_priority_updates=1;
+set sql_max_join_size=200;
+select @@sql_max_join_size,@@max_join_size;
+set sql_quote_show_create=1;
+set sql_safe_updates=1;
+set sql_select_limit=1;
+set global sql_slave_skip_counter=100;
+set sql_warnings=1;
+set global table_cache=100;
+set table_type=myisam;
+set global thread_cache_size=100;
+set timestamp=1, timestamp=default;
+set tmp_table_size=100;
+set tx_isolation="READ-COMMITTED";
+set wait_timeout=100;
+set log_warnings=1;
+
+#
+# key buffer
+#
+
+DROP TABLE IF EXISTS t1,t2;
+create table t1 (a int not null auto_increment, primary key(a));
+create table t2 (a int not null auto_increment, primary key(a));
+insert into t1 values(null),(null),(null);
+insert into t2 values(null),(null),(null);
+set global key_buffer_size=100000;
+select @@key_buffer_size;
+select * from t1 where a=2;
+select * from t2 where a=3;
+check table t1,t2;
+drop table t1,t2;
+
diff --git a/mysys/Makefile.am b/mysys/Makefile.am
index 4386a0cac76..8da25ad101a 100644
--- a/mysys/Makefile.am
+++ b/mysys/Makefile.am
@@ -21,7 +21,10 @@ INCLUDES = @MT_INCLUDES@ -I$(srcdir)/../include -I../include -I.. -I$(srcdir)
pkglib_LIBRARIES = libmysys.a
LDADD = libmysys.a ../dbug/libdbug.a \
../strings/libmystrings.a
-noinst_HEADERS = mysys_priv.h my_static.h
+noinst_HEADERS = mysys_priv.h my_static.h \
+ my_os2cond.c my_os2dirsrch.c my_os2dirsrch.h \
+ my_os2dlfcn.c my_os2file64.c my_os2mutex.c \
+ my_os2thread.c my_os2tls.c
libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c\
mf_path.c mf_loadpath.c\
my_open.c my_create.c my_dup.c my_seek.c my_read.c \
@@ -44,11 +47,12 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c\
my_delete.c my_rename.c my_redel.c my_tempnam.c \
my_chsize.c my_lread.c my_lwrite.c my_clock.c \
my_quick.c my_lockmem.c my_static.c \
- my_getopt.c getvar.c my_mkdir.c \
+ my_getopt.c my_mkdir.c \
default.c my_compress.c checksum.c raid.cc \
- my_net.c \
+ my_net.c my_semaphore.c my_port.c \
my_vsnprintf.c charset.c my_bitmap.c my_bit.c md5.c \
- my_gethostbyname.c my_handler.c
+ my_gethostbyname.c rijndael.c my_aes.c sha1.c \
+ my_handler.c
EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
thr_mutex.c thr_rwlock.c
libmysys_a_LIBADD = @THREAD_LOBJECTS@
diff --git a/mysys/array.c b/mysys/array.c
index 2a0723fbd69..6d00585f24d 100644
--- a/mysys/array.c
+++ b/mysys/array.c
@@ -24,8 +24,23 @@
#include "m_string.h"
/*
- Initiate array and alloc space for init_alloc elements. Array is usable
- even if space allocation failed
+ Initiate dynamic array
+
+ SYNOPSIS
+ init_dynamic_array()
+ array Pointer to an array
+ element_size Size of element
+ init_alloc Number of initial elements
+ alloc_increment Increment for adding new elements
+
+ DESCRIPTION
+ init_dynamic_array() initiates array and allocate space for
+ init_alloc eilements.
+ Array is usable even if space allocation failed.
+
+ RETURN VALUE
+ TRUE my_malloc_ci() failed
+ FALSE Ok
*/
my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
@@ -52,8 +67,20 @@ my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
DBUG_RETURN(TRUE);
}
DBUG_RETURN(FALSE);
-}
+}
+/*
+ Insert element at the end of array. Allocate memory if needed.
+
+ SYNOPSIS
+ insert_dynamic()
+ array
+ element
+
+ RETURN VALUE
+ TRUE Insert failed
+ FALSE Ok
+*/
my_bool insert_dynamic(DYNAMIC_ARRAY *array, gptr element)
{
@@ -73,7 +100,22 @@ my_bool insert_dynamic(DYNAMIC_ARRAY *array, gptr element)
}
- /* Alloc room for one element */
+/*
+ Alloc space for next element(s)
+
+ SYNOPSIS
+ alloc_dynamic()
+ array
+
+ DESCRIPTION
+ alloc_dynamic() checks if there is empty space for at least
+ one element if not tries to allocate space for alloc_increment
+ elements at the end of array.
+
+ RETURN VALUE
+ pointer Pointer to empty space for element
+ 0 Error
+*/
byte *alloc_dynamic(DYNAMIC_ARRAY *array)
{
@@ -92,7 +134,17 @@ byte *alloc_dynamic(DYNAMIC_ARRAY *array)
}
- /* remove last element from array and return it */
+/*
+ Pop last element from array.
+
+ SYNOPSIS
+ pop_dynamic()
+ array
+
+ RETURN VALUE
+ pointer Ok
+ 0 Array is empty
+*/
byte *pop_dynamic(DYNAMIC_ARRAY *array)
{
@@ -101,6 +153,23 @@ byte *pop_dynamic(DYNAMIC_ARRAY *array)
return 0;
}
+/*
+ Replace elemnent in array with given element and index
+
+ SYNOPSIS
+ set_dynamic()
+ array
+ element Element to be inserted
+ idx Index where element is to be inserted
+
+ DESCRIPTION
+ set_dynamic() replaces element in array.
+ If idx > max_element insert new element. Allocate memory if needed.
+
+ RETURN VALUE
+ TRUE Idx was out of range and allocation of new memory failed
+ FALSE Ok
+*/
my_bool set_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx)
{
@@ -128,6 +197,15 @@ my_bool set_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx)
return FALSE;
}
+/*
+ Get an element from array by given index
+
+ SYNOPSIS
+ get_dynamic()
+ array
+ gptr Element to be returned. If idx > elements contain zeroes.
+ idx Index of element wanted.
+*/
void get_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx)
{
@@ -143,6 +221,14 @@ void get_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx)
}
+/*
+ Empty array by freeing all memory
+
+ SYNOPSIS
+ delete_dynamic()
+ array Array to be deleted
+*/
+
void delete_dynamic(DYNAMIC_ARRAY *array)
{
if (array->buffer)
@@ -153,6 +239,14 @@ void delete_dynamic(DYNAMIC_ARRAY *array)
}
}
+/*
+ Delete element by given index
+
+ SYNOPSIS
+ delete_dynamic_element()
+ array
+ idx Index of element to be deleted
+*/
void delete_dynamic_element(DYNAMIC_ARRAY *array, uint idx)
{
@@ -163,6 +257,15 @@ void delete_dynamic_element(DYNAMIC_ARRAY *array, uint idx)
}
+/*
+ Free unused memory
+
+ SYNOPSIS
+ freeze_size()
+ array Array to be freed
+
+*/
+
void freeze_size(DYNAMIC_ARRAY *array)
{
uint elements=max(array->elements,1);
diff --git a/mysys/checksum.c b/mysys/checksum.c
index e09de7d5969..1dd135c7ad9 100644
--- a/mysys/checksum.c
+++ b/mysys/checksum.c
@@ -14,16 +14,24 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* Calculate a long checksum for a memoryblock. Used to verify pack_isam */
#include <my_global.h>
#include "my_sys.h"
+/*
+ Calculate a long checksum for a memoryblock. Used to verify pack_isam
+
+ SYNOPSIS
+ checksum()
+ mem Pointer to memory block
+ count Count of bytes
+*/
+
ulong checksum(const byte *mem, uint count)
{
ulong crc;
- for (crc=0; count-- ; mem++)
- crc=((crc << 1) + *((uchar*) mem)) +
+ for (crc= 0; count-- ; mem++)
+ crc= ((crc << 1) + *((uchar*) mem)) +
test(crc & ((ulong) 1L << (8*sizeof(ulong)-1)));
return crc;
}
diff --git a/mysys/default.c b/mysys/default.c
index d270aa8673a..f5ada19dd78 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -82,7 +82,7 @@ void load_defaults(const char *conf_file, const char **groups,
char *ptr,**res;
DBUG_ENTER("load_defaults");
- init_alloc_root(&alloc,128,0);
+ init_alloc_root(&alloc,512,0);
if (*argc >= 2 && !strcmp(argv[0][1],"--no-defaults"))
{
/* remove the --no-defaults argument and return only the other arguments */
diff --git a/mysys/getvar.c b/mysys/getvar.c
deleted file mode 100644
index b5cc123f4b4..00000000000
--- a/mysys/getvar.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Copyright (C) 2000 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* Allow use of the -O variable= option to set long variables */
-
-#include "mysys_priv.h"
-#include <m_string.h>
-#include <m_ctype.h>
-#include <my_getopt.h>
- /* set all changeable variables */
-
-void set_all_changeable_vars(CHANGEABLE_VAR *vars)
-{
- for ( ; vars->name ; vars++)
- *vars->varptr= vars->def_value;
-}
-
-
-my_bool set_changeable_varval(const char* var, ulong val,
- CHANGEABLE_VAR *vars)
-{
- char buffer[256];
- sprintf( buffer, "%s=%lu", var, (unsigned long) val );
- return set_changeable_var( buffer, vars );
-}
-
-
-my_bool set_changeable_var(my_string str,CHANGEABLE_VAR *vars)
-{
- char endchar;
- my_string end;
- DBUG_ENTER("set_changeable_var");
- DBUG_PRINT("enter",("%s",str));
-
- if (str)
- {
- if (!(end=strchr(str,'=')))
- fprintf(stderr,"Can't find '=' in expression '%s' to option -O\n",str);
- else
- {
- uint length,found_count=0;
- CHANGEABLE_VAR *var,*found;
- my_string var_end;
- const char *name;
- longlong num;
-
- /* Skip end space from variable */
- for (var_end=end ; end > str && my_isspace(system_charset_info, var_end[-1]) ; var_end--) ;
- length=(uint) (var_end-str);
- /* Skip start space from argument */
- for (end++ ; my_isspace(system_charset_info, *end) ; end++) ;
-
- for (var=vars,found=0 ; (name=var->name) ; var++)
- {
- /* BAR TODO: remove system_charset_info */
- if (!my_strncasecmp(system_charset_info,name,str,length))
- {
- found=var; found_count++;
- if (!name[length])
- {
- found_count=1;
- break;
- }
- }
- }
- if (found_count == 0)
- {
- fprintf(stderr,"No variable match for: -O '%s'\n",str);
- DBUG_RETURN(1);
- }
- if (found_count > 1)
- {
- fprintf(stderr,"Variable prefix '%*s' is not unique\n",length,str);
- DBUG_RETURN(1);
- }
-
- num=strtoll(end, (char **)NULL, 10); endchar=strend(end)[-1];
- if (endchar == 'k' || endchar == 'K')
- num*=1024;
- else if (endchar == 'm' || endchar == 'M')
- num*=1024L*1024L;
- else if (endchar == 'g' || endchar == 'G')
- num*=1024L*1024L*1024L;
- else if (!my_isdigit(system_charset_info, endchar))
- {
- fprintf(stderr,"Unknown prefix used for variable value '%s'\n",str);
- DBUG_RETURN(1);
- }
- if (num < (longlong) found->min_value)
- num=(longlong) found->min_value;
- else if (num > 0 && (ulonglong) num > (ulonglong) (ulong) found->max_value)
- num=(longlong) (ulong) found->max_value;
- num=((num- (longlong) found->sub_size) / (ulonglong) found->block_size);
- (*found->varptr)= (long) (num*(ulonglong) found->block_size);
- DBUG_RETURN(0);
- }
- }
- DBUG_RETURN(1);
-}
diff --git a/mysys/mf_fn_ext.c b/mysys/mf_fn_ext.c
index fb3fd8870aa..3a11f1a247e 100644
--- a/mysys/mf_fn_ext.c
+++ b/mysys/mf_fn_ext.c
@@ -14,16 +14,16 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* Returnerar en pekare till filnamnets extension. */
#include "mysys_priv.h"
#include <m_string.h>
- /* Return a pointerto the extension of the filename
- The pointer points at the extension character (normally '.'))
- If there isn't any extension, the pointer points at the end
- NULL of the filename
- */
+/*
+ Return a pointerto the extension of the filename
+ The pointer points at the extension character (normally '.'))
+ If there isn't any extension, the pointer points at the end
+ ASCII(0) of the filename.
+*/
my_string fn_ext(const char *name)
{
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index a0247003a81..43b3d30915f 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -68,16 +68,20 @@ static void my_aiowait(my_aio_result *result);
#define unlock_append_buffer(info)
#endif
+#define IO_ROUND_UP(X) (((X)+IO_SIZE-1) & ~(IO_SIZE-1))
+#define IO_ROUND_DN(X) ( (X) & ~(IO_SIZE-1))
+
static void
init_functions(IO_CACHE* info, enum cache_type type)
{
switch (type) {
case READ_NET:
- /* must be initialized by the caller. The problem is that
- _my_b_net_read has to be defined in sql directory because of
- the dependency on THD, and therefore cannot be visible to
- programs that link against mysys but know nothing about THD, such
- as myisamchk
+ /*
+ Must be initialized by the caller. The problem is that
+ _my_b_net_read has to be defined in sql directory because of
+ the dependency on THD, and therefore cannot be visible to
+ programs that link against mysys but know nothing about THD, such
+ as myisamchk
*/
break;
case SEQ_READ_APPEND:
@@ -85,7 +89,11 @@ init_functions(IO_CACHE* info, enum cache_type type)
info->write_function = 0; /* Force a core if used */
break;
default:
- info->read_function = _my_b_read;
+ info->read_function =
+#ifdef THREAD
+ info->share ? _my_b_read_r :
+#endif
+ _my_b_read;
info->write_function = _my_b_write;
}
@@ -115,18 +123,20 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize,
uint min_cache;
my_off_t end_of_file= ~(my_off_t) 0;
DBUG_ENTER("init_io_cache");
- DBUG_PRINT("enter",("type: %d pos: %ld",(int) type, (ulong) seek_offset));
+ DBUG_PRINT("enter",("cache: %lx type: %d pos: %ld",
+ (ulong) info, (int) type, (ulong) seek_offset));
info->file= file;
info->type=type;
info->pos_in_file= seek_offset;
info->pre_close = info->pre_read = info->post_read = 0;
info->arg = 0;
- info->init_count++; /* we assume the user had set it to 0 prior to
- first call */
info->alloced_buffer = 0;
info->buffer=0;
info->seek_not_done= test(file >= 0);
+#ifdef THREAD
+ info->share=0;
+#endif
if (!cachesize)
if (! (cachesize= my_default_record_cache_size))
@@ -214,7 +224,6 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize,
DBUG_RETURN(0);
} /* init_io_cache */
-
/* Wait until current request is ready */
#ifdef HAVE_AIOWAIT
@@ -256,8 +265,9 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
pbool clear_cache)
{
DBUG_ENTER("reinit_io_cache");
- DBUG_PRINT("enter",("type: %d seek_offset: %lu clear_cache: %d",
- type, (ulong) seek_offset, (int) clear_cache));
+ DBUG_PRINT("enter",("cache: %lx type: %d seek_offset: %lu clear_cache: %d",
+ (ulong) info, type, (ulong) seek_offset,
+ (int) clear_cache));
/* One can't do reinit with the following types */
DBUG_ASSERT(type != READ_NET && info->type != READ_NET &&
@@ -275,11 +285,15 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
{
info->read_end=info->write_pos;
info->end_of_file=my_b_tell(info);
+ info->seek_not_done=1;
}
else if (type == WRITE_CACHE)
{
if (info->type == READ_CACHE)
+ {
info->write_end=info->write_buffer+info->buffer_length;
+ info->seek_not_done=1;
+ }
info->end_of_file = ~(my_off_t) 0;
}
pos=info->request_pos+(seek_offset-info->pos_in_file);
@@ -378,8 +392,8 @@ int _my_b_read(register IO_CACHE *info, byte *Buffer, uint Count)
if ((read_length=my_read(info->file,Buffer,(uint) length,info->myflags))
!= (uint) length)
{
- info->error= read_length == (uint) -1 ? -1 :
- (int) (read_length+left_length);
+ info->error= (read_length == (uint) -1 ? -1 :
+ (int) (read_length+left_length));
DBUG_RETURN(1);
}
Count-=length;
@@ -408,6 +422,7 @@ int _my_b_read(register IO_CACHE *info, byte *Buffer, uint Count)
{
if (length != (uint) -1)
memcpy(Buffer,info->buffer,(size_t) length);
+ info->pos_in_file= pos_in_file;
info->error= length == (uint) -1 ? -1 : (int) (length+left_length);
info->read_pos=info->read_end=info->buffer;
DBUG_RETURN(1);
@@ -419,6 +434,139 @@ int _my_b_read(register IO_CACHE *info, byte *Buffer, uint Count)
DBUG_RETURN(0);
}
+#ifdef THREAD
+/* Prepare IO_CACHE for shared use */
+void init_io_cache_share(IO_CACHE *info, IO_CACHE_SHARE *s, uint num_threads)
+{
+ DBUG_ASSERT(info->type == READ_CACHE);
+ pthread_mutex_init(&s->mutex, MY_MUTEX_INIT_FAST);
+ pthread_cond_init (&s->cond, 0);
+ s->count=num_threads-1;
+ s->active=0; /* to catch errors */
+ info->share=s;
+ info->read_function=_my_b_read_r;
+}
+
+/*
+ Remove a thread from shared access to IO_CACHE
+ Every thread should do that on exit for not
+ to deadlock other threads
+*/
+void remove_io_thread(IO_CACHE *info)
+{
+ pthread_mutex_lock(&info->share->mutex);
+ if (! info->share->count--)
+ pthread_cond_signal(&info->share->cond);
+ pthread_mutex_unlock(&info->share->mutex);
+}
+
+static int lock_io_cache(IO_CACHE *info)
+{
+ pthread_mutex_lock(&info->share->mutex);
+ if (!info->share->count)
+ return 1;
+
+ --(info->share->count);
+ pthread_cond_wait(&info->share->cond, &info->share->mutex);
+ /*
+ count can be -1 here, if one thread was removed (remove_io_thread)
+ while all others were locked (lock_io_cache).
+ If this is the case, this thread behaves as if count was 0 from the
+ very beginning, that is returns 1 and does not unlock the mutex.
+ */
+ if (++(info->share->count))
+ {
+ pthread_mutex_unlock(&info->share->mutex);
+ return 0;
+ }
+ return 1;
+}
+
+static void unlock_io_cache(IO_CACHE *info)
+{
+ pthread_cond_broadcast(&info->share->cond);
+ pthread_mutex_unlock(&info->share->mutex);
+}
+
+
+/*
+ Read from IO_CACHE when it is shared between several threads.
+ It works as follows: when a thread tries to read from a file
+ (that is, after using all the data from the (shared) buffer),
+ it just hangs on lock_io_cache(), wating for other threads.
+ When the very last thread attempts a read, lock_io_cache()
+ returns 1, the thread does actual IO and unlock_io_cache(),
+ which signals all the waiting threads that data is in the buffer.
+*/
+
+int _my_b_read_r(register IO_CACHE *info, byte *Buffer, uint Count)
+{
+ my_off_t pos_in_file;
+ uint length,diff_length,read_len;
+ DBUG_ENTER("_my_b_read_r");
+
+ if ((read_len=(uint) (info->read_end-info->read_pos)))
+ {
+ DBUG_ASSERT(Count >= read_len); /* User is not using my_b_read() */
+ memcpy(Buffer,info->read_pos, (size_t) (read_len));
+ Buffer+=read_len;
+ Count-=read_len;
+ }
+ while (Count)
+ {
+ int cnt, len;
+
+ pos_in_file= info->pos_in_file + (uint)(info->read_end - info->buffer);
+ diff_length= (uint) (pos_in_file & (IO_SIZE-1));
+ length=IO_ROUND_UP(Count+diff_length)-diff_length;
+ length=(length <= info->read_length) ?
+ length + IO_ROUND_DN(info->read_length - length) :
+ length - IO_ROUND_UP(length - info->read_length) ;
+ if (info->type != READ_FIFO &&
+ (length > (uint) (info->end_of_file - pos_in_file)))
+ length= (uint) (info->end_of_file - pos_in_file);
+ if (length == 0)
+ {
+ info->error=(int) read_len;
+ DBUG_RETURN(1);
+ }
+ if (lock_io_cache(info))
+ {
+ info->share->active=info;
+ if (info->seek_not_done) /* File touched, do seek */
+ VOID(my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)));
+ len=(int)my_read(info->file,info->buffer, length, info->myflags);
+ info->read_end=info->buffer + (len == -1 ? 0 : len);
+ info->error=(len == (int)length ? 0 : len);
+ info->pos_in_file=pos_in_file;
+ unlock_io_cache(info);
+ }
+ else
+ {
+ info->error= info->share->active->error;
+ info->read_end= info->share->active->read_end;
+ info->pos_in_file= info->share->active->pos_in_file;
+ len= (info->error == -1 ? -1 : info->read_end-info->buffer);
+ }
+ info->read_pos=info->buffer;
+ info->seek_not_done=0;
+ if (len <= 0)
+ {
+ info->error=(int) read_len;
+ DBUG_RETURN(1);
+ }
+ cnt=((uint) len > Count) ? (int) Count : len;
+ memcpy(Buffer,info->read_pos, (size_t)cnt);
+ Count -=cnt;
+ Buffer+=cnt;
+ read_len+=cnt;
+ info->read_pos+=cnt;
+ }
+ DBUG_RETURN(0);
+}
+#endif
+
+
/*
Do sequential read from the SEQ_READ_APPEND cache
we do this in three stages:
@@ -454,7 +602,7 @@ int _my_b_seq_read(register IO_CACHE *info, byte *Buffer, uint Count)
*/
VOID(my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)));
info->seek_not_done=0;
-
+
diff_length=(uint) (pos_in_file & (IO_SIZE-1));
/* now the second stage begins - read from file descriptor */
@@ -510,7 +658,7 @@ int _my_b_seq_read(register IO_CACHE *info, byte *Buffer, uint Count)
memcpy(Buffer,info->buffer,(size_t) length);
Count -= length;
Buffer += length;
-
+
/*
added the line below to make
DBUG_ASSERT(pos_in_file==info->end_of_file) pass.
@@ -544,7 +692,7 @@ read_append_buffer:
/*
TODO: figure out if the assert below is needed or correct.
*/
- DBUG_ASSERT(pos_in_file == info->end_of_file);
+ DBUG_ASSERT(pos_in_file == info->end_of_file);
copy_len=min(Count, len_in_buff);
memcpy(Buffer, info->append_read_pos, copy_len);
info->append_read_pos += copy_len;
@@ -910,7 +1058,7 @@ int _flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
if (!(append_cache = (info->type == SEQ_READ_APPEND)))
need_append_buffer_lock=0;
-
+
if (info->type == WRITE_CACHE || append_cache)
{
if (info->file == -1)
@@ -919,12 +1067,13 @@ int _flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
DBUG_RETURN((info->error= -1));
}
LOCK_APPEND_BUFFER;
-
+
if ((length=(uint) (info->write_pos - info->write_buffer)))
{
pos_in_file=info->pos_in_file;
- /* if we have append cache, we always open the file with
- O_APPEND which moves the pos to EOF automatically on every write
+ /*
+ If we have append cache, we always open the file with
+ O_APPEND which moves the pos to EOF automatically on every write
*/
if (!append_cache && info->seek_not_done)
{ /* File touched, do seek */
@@ -956,7 +1105,7 @@ int _flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
info->end_of_file+=(info->write_pos-info->append_read_pos);
DBUG_ASSERT(info->end_of_file == my_tell(info->file,MYF(0)));
}
-
+
info->append_read_pos=info->write_pos=info->write_buffer;
UNLOCK_APPEND_BUFFER;
DBUG_RETURN(info->error);
@@ -980,6 +1129,24 @@ int end_io_cache(IO_CACHE *info)
IO_CACHE_CALLBACK pre_close;
DBUG_ENTER("end_io_cache");
+#ifdef THREAD
+ if (info->share)
+ {
+#ifdef SAFE_MUTEX
+ /* simple protection against multi-close: destroying share first */
+ if (pthread_cond_destroy (&info->share->cond) |
+ pthread_mutex_destroy(&info->share->mutex))
+ {
+ DBUG_RETURN(1);
+ }
+#else
+ pthread_cond_destroy (&info->share->cond);
+ pthread_mutex_destroy(&info->share->mutex);
+#endif
+ info->share=0;
+ }
+#endif
+
if ((pre_close=info->pre_close))
(*pre_close)(info);
if (info->alloced_buffer)
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index 8d4bcd15c24..8a7dfc7be09 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -27,32 +27,36 @@
my_off_t my_b_append_tell(IO_CACHE* info)
{
- /* prevent optimizer from putting res in a register when debugging
- we need this to be able to see the value of res when the assert fails
+ /*
+ Prevent optimizer from putting res in a register when debugging
+ we need this to be able to see the value of res when the assert fails
*/
dbug_volatile my_off_t res;
-/* we need to lock the append buffer mutex to keep flush_io_cache()
- from messing with the variables that we need in order to provide the
- answer to the question.
-*/
+
+ /*
+ We need to lock the append buffer mutex to keep flush_io_cache()
+ from messing with the variables that we need in order to provide the
+ answer to the question.
+ */
#ifdef THREAD
pthread_mutex_lock(&info->append_buffer_lock);
#endif
- /* save the value of my_tell in res so we can see it when studying
- coredump
- */
#ifndef DBUG_OFF
- /* make sure EOF is where we think it is. Note that we cannot just use
- my_tell() because we have a reader thread that could have left the
- file offset in a non-EOF location
- */
+ /*
+ Make sure EOF is where we think it is. Note that we cannot just use
+ my_tell() because we have a reader thread that could have left the
+ file offset in a non-EOF location
+ */
{
- volatile my_off_t save_pos;
- save_pos = my_tell(info->file,MYF(0));
- my_seek(info->file,(my_off_t)0,MY_SEEK_END,MYF(0));
- DBUG_ASSERT(info->end_of_file - (info->append_read_pos-info->write_buffer)
- == (res=my_tell(info->file,MYF(0))));
- my_seek(info->file,save_pos,MY_SEEK_SET,MYF(0));
+ volatile my_off_t save_pos;
+ save_pos = my_tell(info->file,MYF(0));
+ my_seek(info->file,(my_off_t)0,MY_SEEK_END,MYF(0));
+ /*
+ Save the value of my_tell in res so we can see it when studying coredump
+ */
+ DBUG_ASSERT(info->end_of_file - (info->append_read_pos-info->write_buffer)
+ == (res=my_tell(info->file,MYF(0))));
+ my_seek(info->file,save_pos,MY_SEEK_SET,MYF(0));
}
#endif
res = info->end_of_file + (info->write_pos-info->append_read_pos);
@@ -74,10 +78,9 @@ void my_b_seek(IO_CACHE *info,my_off_t pos)
DBUG_PRINT("enter",("pos: %lu", (ulong) pos));
/*
- TODO: verify that it is OK to do seek in the non-append
- area in SEQ_READ_APPEND cache
- */
- /* TODO:
+ TODO:
+ Verify that it is OK to do seek in the non-append
+ area in SEQ_READ_APPEND cache
a) see if this always works
b) see if there is a better way to make it work
*/
@@ -209,6 +212,20 @@ uint my_b_gets(IO_CACHE *info, char *to, uint max_length)
}
+my_off_t my_b_filelength(IO_CACHE *info)
+{
+ if (info->type == WRITE_CACHE)
+ {
+ return my_b_tell(info);
+ }
+ else
+ {
+ info->seek_not_done=1;
+ return my_seek(info->file,0L,MY_SEEK_END,MYF(0));
+ }
+}
+
+
/*
Simple printf version. Supports '%s', '%d', '%u', "%ld" and "%lu"
Used for logging in MySQL
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 2ddf13bfa1f..5a573bff0f7 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -53,6 +53,7 @@ typedef struct sec_link {
static SEC_LINK *find_key_block(int file,my_off_t filepos,int *error);
+static int flush_all_key_blocks();
/* static variables in this file */
static SEC_LINK *_my_block_root,**_my_hash_root,
@@ -76,11 +77,9 @@ static my_bool _my_printed;
/* Returns blocks in use */
/* ARGSUSED */
-int init_key_cache(ulong use_mem,
- ulong leave_this_much_mem __attribute__((unused)))
+int init_key_cache(ulong use_mem)
{
uint blocks,length;
- byte *extra_mem=0;
DBUG_ENTER("init_key_cache");
if (key_cache_inited && _my_disk_blocks > 0)
@@ -105,10 +104,6 @@ int init_key_cache(ulong use_mem,
/* No use to have very few blocks */
if (blocks >= 8 && _my_disk_blocks < 0)
{
-#if !defined(HAVE_ALLOCA) && !defined(THREAD)
- if ((extra_mem=my_malloc((uint) leave_this_much_mem,MYF(0))) == 0)
- goto err;
-#endif
for (;;)
{
/* Set my_hash_blocks to the next bigger 2 power */
@@ -138,21 +133,48 @@ int init_key_cache(ulong use_mem,
DBUG_PRINT("exit",("disk_blocks: %d block_root: %lx _my_hash_blocks: %d hash_root: %lx",
_my_disk_blocks,_my_block_root,_my_hash_blocks,
_my_hash_root));
-#if !defined(HAVE_ALLOCA) && !defined(THREAD)
- my_free(extra_mem,MYF(0));
-#endif
}
bzero((gptr) changed_blocks,sizeof(changed_blocks[0])*CHANGED_BLOCKS_HASH);
bzero((gptr) file_blocks,sizeof(file_blocks[0])*CHANGED_BLOCKS_HASH);
DBUG_RETURN((int) blocks);
+
err:
- if (extra_mem) /* purecov: inspected */
- my_free(extra_mem,MYF(0));
my_errno=ENOMEM;
DBUG_RETURN(0);
} /* init_key_cache */
+/*
+ Resize the key cache
+
+ SYNOPSIS
+ resize_key_cache()
+ use_mem Bytes to use for new key cache
+
+ RETURN VALUES
+ 0 Error
+ # number of blocks in key cache
+*/
+
+
+int resize_key_cache(ulong use_mem)
+{
+ int block;
+ pthread_mutex_lock(&THR_LOCK_keycache);
+ if (flush_all_key_blocks())
+ {
+ /* TODO: If this happens, we should write a warning in the log file ! */
+ pthread_mutex_unlock(&THR_LOCK_keycache);
+ return 0;
+ }
+ end_key_cache();
+ /* The following will work even if memory is 0 */
+ block=init_key_cache(use_mem);
+ pthread_mutex_unlock(&THR_LOCK_keycache);
+ return block;
+}
+
+
/* Remove key_cache from memory */
void end_key_cache(void)
@@ -264,6 +286,11 @@ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length,
byte *start=buff;
uint read_length;
pthread_mutex_lock(&THR_LOCK_keycache);
+ if (_my_disk_blocks <= 0) /* Resize failed */
+ {
+ pthread_mutex_unlock(&THR_LOCK_keycache);
+ goto no_key_cache;
+ }
do
{
_my_cache_r_requests++;
@@ -300,6 +327,8 @@ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length,
pthread_mutex_unlock(&THR_LOCK_keycache);
DBUG_RETURN(start);
}
+
+no_key_cache:
_my_cache_r_requests++;
_my_cache_read++;
if (my_pread(file,(byte*) buff,length,filepos,MYF(MY_NABP)))
@@ -336,6 +365,12 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length,
{ /* We have key_cacheing */
uint read_length;
pthread_mutex_lock(&THR_LOCK_keycache);
+ if (_my_disk_blocks <= 0) /* If resize failed */
+ {
+ pthread_mutex_unlock(&THR_LOCK_keycache);
+ goto no_key_cache;
+ }
+
_my_cache_w_requests++;
do
{
@@ -359,8 +394,11 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length,
} while ((length-= read_length));
error=0;
pthread_mutex_unlock(&THR_LOCK_keycache);
+ goto end;
}
- else if (dont_write)
+
+no_key_cache:
+ if (dont_write)
{ /* We must write, no cache */
_my_cache_w_requests++;
_my_cache_write++;
@@ -368,6 +406,7 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length,
MYF(MY_NABP | MY_WAIT_IF_FULL)))
error=1;
}
+
end:
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
DBUG_EXECUTE("check_keycache",test_key_cache("end of key_cache_write",1););
@@ -507,6 +546,7 @@ static int cmp_sec_link(SEC_LINK **a, SEC_LINK **b)
((*a)->diskpos > (*b)->diskpos) ? 1 : 0);
}
+
static int flush_cached_blocks(File file, SEC_LINK **cache, uint count)
{
uint last_errno=0;
@@ -525,25 +565,23 @@ static int flush_cached_blocks(File file, SEC_LINK **cache, uint count)
}
-int flush_key_blocks(File file, enum flush_type type)
+static int flush_key_blocks_int(File file, enum flush_type type)
{
int error=0,last_errno=0;
uint count=0;
SEC_LINK *cache_buff[FLUSH_CACHE],**cache,**pos,**end;
SEC_LINK *used,*next;
- DBUG_ENTER("flush_key_blocks");
+ DBUG_ENTER("flush_key_blocks_int");
DBUG_PRINT("enter",("file: %d blocks_used: %d blocks_changed: %d",
file,_my_blocks_used,_my_blocks_changed));
- pthread_mutex_lock(&THR_LOCK_keycache);
-
-#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
- DBUG_EXECUTE("check_keycache",test_key_cache("start of flush_key_blocks",0););
-#endif
cache=cache_buff; /* If no key cache */
if (_my_disk_blocks > 0 &&
(!my_disable_flush_key_blocks || type != FLUSH_KEEP))
{
+#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
+ DBUG_EXECUTE("check_keycache",test_key_cache("start of flush_key_blocks",0););
+#endif
if (type != FLUSH_IGNORE_CHANGED)
{
/* Count how many key blocks we have to cache to be able to
@@ -614,22 +652,69 @@ int flush_key_blocks(File file, enum flush_type type)
free_block(used);
}
}
- }
#ifndef DBUG_OFF
- DBUG_EXECUTE("check_keycache",test_key_cache("end of flush_key_blocks",0););
+ DBUG_EXECUTE("check_keycache",test_key_cache("end of flush_key_blocks",0););
#endif
- pthread_mutex_unlock(&THR_LOCK_keycache);
+ }
if (cache != cache_buff)
my_free((gptr) cache,MYF(0));
if (last_errno)
errno=last_errno; /* Return first error */
DBUG_RETURN(last_errno != 0);
-} /* flush_key_blocks */
+}
+
+
+/*
+ Flush all blocks for a specific file to disk
+
+ SYNOPSIS
+ flush_all_key_blocks()
+ file File descriptor
+ type Type of flush operation
+
+ RETURN VALUES
+ 0 Ok
+ 1 Error
+*/
+
+int flush_key_blocks(File file, enum flush_type type)
+{
+ int res;
+ pthread_mutex_lock(&THR_LOCK_keycache);
+ res=flush_key_blocks_int(file, type);
+ pthread_mutex_unlock(&THR_LOCK_keycache);
+ return res;
+}
+
+
+/*
+ Flush all blocks in the key cache to disk
+
+ SYNOPSIS
+ flush_all_key_blocks()
+
+ NOTE
+ We must have a lock on THR_LOCK_keycache before calling this function
+
+ RETURN VALUES
+ 0 Ok
+ 1 Error
+*/
+
+
+static int flush_all_key_blocks()
+{
+ int error=0;
+ while (_my_blocks_changed > 0)
+ if (flush_key_blocks_int(_my_used_first->file, FLUSH_RELEASE))
+ error=1;
+ return error;
+}
#ifndef DBUG_OFF
- /* Test if disk-cachee is ok */
+ /* Test if disk-cache is ok */
static void test_key_cache(const char *where, my_bool lock)
{
@@ -638,7 +723,14 @@ static void test_key_cache(const char *where, my_bool lock)
SEC_LINK *pos,**prev;
if (lock)
+ {
pthread_mutex_lock(&THR_LOCK_keycache);
+ if (_my_disk_blocks <= 0) /* No active key cache */
+ {
+ pthread_mutex_unlock(&THR_LOCK_keycache);
+ return;
+ }
+ }
found=error=0;
for (i= 0 ; i < _my_hash_blocks ; i++)
{
diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c
index 86e43e5b6fc..09fde27afd6 100644
--- a/mysys/mf_tempfile.c
+++ b/mysys/mf_tempfile.c
@@ -122,10 +122,10 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
dir=to;
}
#ifdef OS2
- // changing environ variable doesn't work with VACPP
+ /* changing environ variable doesn't work with VACPP */
char buffer[256];
sprintf( buffer, "TMP=%s", dir);
- // remove ending backslash
+ /* remove ending backslash */
if (buffer[strlen(buffer)-1] == '\\')
buffer[strlen(buffer)-1] = '\0';
putenv( buffer);
diff --git a/mysys/mulalloc.c b/mysys/mulalloc.c
index a2960aec4b5..6b025bca699 100644
--- a/mysys/mulalloc.c
+++ b/mysys/mulalloc.c
@@ -14,12 +14,22 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
- /* Malloc many pointers at the same time */
- /* format myFlags,ptr,length,ptr,length ... until null ptr */
-
#include "mysys_priv.h"
#include <stdarg.h>
+/*
+ Malloc many pointers at the same time
+
+ SYNOPSIS
+ my_multi_malloc()
+ myFlags Flags
+ ... Multiple arguments terminated by null ptr
+
+ ptr, length
+ ptr, length
+ NULL
+*/
+
gptr my_multi_malloc(myf myFlags, ...)
{
va_list args;
diff --git a/mysys/my_aes.c b/mysys/my_aes.c
new file mode 100644
index 00000000000..10ef62ae0a5
--- /dev/null
+++ b/mysys/my_aes.c
@@ -0,0 +1,225 @@
+/* Copyright (C) 2002 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
+/*
+ Implementation of AES Encryption for MySQL
+ Initial version by Peter Zaitsev June 2002
+*/
+
+
+#include <my_global.h>
+#include <m_string.h>
+#include "my_aes.h"
+
+enum encrypt_dir { AES_ENCRYPT, AES_DECRYPT };
+
+#define AES_BLOCK_SIZE 16 /* Block size in bytes */
+
+#define AES_BAD_DATA -1 /* If bad data discovered during decoding */
+
+
+/* The structure for key information */
+typedef struct {
+ int nr; /* Number of rounds */
+ uint32 rk[4*(AES_MAXNR + 1)]; /* key schedule */
+} KEYINSTANCE;
+
+
+/*
+ This is internal function just keeps joint code of Key generation
+
+ SYNOPSIS
+ my_aes_create_key()
+ aes_key Address of Key Instance to be created
+ direction Direction (are we encoding or decoding)
+ key Key to use for real key creation
+ key_length Length of the key
+
+ DESCRIPTION
+
+ RESULT
+ 0 ok
+ -1 Error Note: The current impementation never returns this
+*/
+
+static int my_aes_create_key(KEYINSTANCE *aes_key,
+ enum encrypt_dir direction, const char *key,
+ int key_length)
+{
+ char rkey[AES_KEY_LENGTH/8]; /* The real key to be used for encryption */
+ char *rkey_end=rkey+AES_KEY_LENGTH/8; /* Real key boundary */
+ char *ptr; /* Start of the real key*/
+ const char *sptr; /* Start of the working key */
+ const char *key_end=key+key_length; /* Working key boundary*/
+
+ bzero(rkey,AES_KEY_LENGTH/8); /* Set initial key */
+
+ for (ptr= rkey, sptr= key; sptr < key_end; ptr++,sptr++)
+ {
+ if (ptr == rkey_end)
+ ptr= rkey; /* Just loop over tmp_key until we used all key */
+ *ptr^= *sptr;
+ }
+#ifdef AES_USE_KEY_BITS
+ /*
+ This block is intended to allow more weak encryption if application
+ build with libmysqld needs to correspond to export regulations
+ It should be never used in normal distribution as does not give
+ any speed improvement.
+ To get worse security define AES_USE_KEY_BITS to number of bits
+ you want key to be. It should be divisible by 8
+
+ WARNING: Changing this value results in changing of enryption for
+ all key lengths so altering this value will result in impossibility
+ to decrypt data encrypted with previous value
+ */
+#define AES_USE_KEY_BYTES (AES_USE_KEY_BITS/8)
+ /*
+ To get weaker key we use first AES_USE_KEY_BYTES bytes of created key
+ and cyclically copy them until we created all required key length
+ */
+ for (ptr= rkey+AES_USE_KEY_BYTES, sptr=rkey ; ptr < rkey_end;
+ ptr++,sptr++)
+ {
+ if (sptr == rkey+AES_USE_KEY_BYTES)
+ sptr=rkey;
+ *ptr=*sptr;
+ }
+#endif
+ if (direction == AES_DECRYPT)
+ aes_key->nr = rijndaelKeySetupDec(aes_key->rk, rkey, AES_KEY_LENGTH);
+ else
+ aes_key->nr = rijndaelKeySetupEnc(aes_key->rk, rkey, AES_KEY_LENGTH);
+ return 0;
+}
+
+
+/*
+ Crypt buffer with AES encryption algorithm.
+
+ SYNOPSIS
+ my_aes_encrypt()
+ source Pointer to data for encryption
+ source_length Size of encryption data
+ dest Buffer to place encrypted data (must be large enough)
+ key Key to be used for encryption
+ key_length Length of the key. Will handle keys of any length
+
+ RETURN
+ >= 0 Size of encrypted data
+ < 0 Error
+*/
+
+int my_aes_encrypt(const char* source, int source_length, char* dest,
+ const char* key, int key_length)
+{
+ KEYINSTANCE aes_key;
+ char block[AES_BLOCK_SIZE]; /* 128 bit block used for padding */
+ int rc; /* result codes */
+ int num_blocks; /* number of complete blocks */
+ char pad_len; /* pad size for the last block */
+ int i;
+
+ if ((rc= my_aes_create_key(&aes_key,AES_ENCRYPT,key,key_length)))
+ return rc;
+
+ num_blocks = source_length/AES_BLOCK_SIZE;
+
+ for (i = num_blocks; i > 0; i--) /* Encode complete blocks */
+ {
+ rijndaelEncrypt(aes_key.rk, aes_key.nr, source, dest);
+ source+= AES_BLOCK_SIZE;
+ dest+= AES_BLOCK_SIZE;
+ }
+
+ /* Encode the rest. We always have incomplete block */
+ pad_len = AES_BLOCK_SIZE - (source_length - AES_BLOCK_SIZE*num_blocks);
+ memcpy(block, source, 16 - pad_len);
+ bfill(block + AES_BLOCK_SIZE - pad_len, pad_len, pad_len);
+ rijndaelEncrypt(aes_key.rk, aes_key.nr, block, dest);
+ return AES_BLOCK_SIZE*(num_blocks + 1);
+}
+
+
+/*
+ DeCrypt buffer with AES encryption algorithm.
+
+ SYNOPSIS
+ my_aes_decrypt()
+ source Pointer to data for decryption
+ source_length Size of encrypted data
+ dest Buffer to place decrypted data (must be large enough)
+ key Key to be used for decryption
+ key_length Length of the key. Will handle keys of any length
+
+ RETURN
+ >= 0 Size of encrypted data
+ < 0 Error
+*/
+
+int my_aes_decrypt(const char *source, int source_length, char *dest,
+ const char *key, int key_length)
+{
+ KEYINSTANCE aes_key;
+ char block[AES_BLOCK_SIZE]; /* 128 bit block used for padding */
+ int rc; /* Result codes */
+ int num_blocks; /* Number of complete blocks */
+ char pad_len; /* Pad size for the last block */
+ int i;
+
+ if ((rc=my_aes_create_key(&aes_key,AES_DECRYPT,key,key_length)))
+ return rc;
+
+ num_blocks = source_length/AES_BLOCK_SIZE;
+
+ if ((source_length != num_blocks*AES_BLOCK_SIZE) || num_blocks ==0 )
+ return AES_BAD_DATA; /* Input size has to be even and at least one block */
+
+ for (i = num_blocks-1; i > 0; i--) /* Decode all but last blocks */
+ {
+ rijndaelDecrypt(aes_key.rk, aes_key.nr, source, dest);
+ source+= AES_BLOCK_SIZE;
+ dest+= AES_BLOCK_SIZE;
+ }
+
+ rijndaelDecrypt(aes_key.rk, aes_key.nr, source, block);
+ pad_len = block[AES_BLOCK_SIZE-1]; /* Use last char in the block as size */
+
+ if (pad_len > AES_BLOCK_SIZE)
+ return AES_BAD_DATA;
+ /* We could also check whole padding but we do not really need this */
+
+ memcpy(dest, block, AES_BLOCK_SIZE - pad_len);
+ return AES_BLOCK_SIZE*num_blocks - pad_len;
+}
+
+
+/*
+ Get size of buffer which will be large enough for encrypted data
+
+ SYNOPSIS
+ my_aes_get_size()
+ source_length Length of data to be encrypted
+
+ RETURN
+ Size of buffer required to store encrypted data
+*/
+
+int my_aes_get_size(int source_length)
+{
+ return AES_BLOCK_SIZE*(source_length/AES_BLOCK_SIZE)+AES_BLOCK_SIZE;
+}
diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c
index 5a6afe2fac9..f494cce8dbe 100644
--- a/mysys/my_alloc.c
+++ b/mysys/my_alloc.c
@@ -25,21 +25,22 @@
void init_alloc_root(MEM_ROOT *mem_root, uint block_size,
uint pre_alloc_size __attribute__((unused)))
{
- mem_root->free=mem_root->used=0;
- mem_root->min_malloc=32;
- mem_root->block_size=block_size-MALLOC_OVERHEAD-sizeof(USED_MEM)-8;
- mem_root->error_handler=0;
+ mem_root->free= mem_root->used= 0;
+ mem_root->min_malloc= 32;
+ mem_root->block_size= block_size-MALLOC_OVERHEAD-sizeof(USED_MEM)-8;
+ mem_root->error_handler= 0;
mem_root->block_num= 0;
+ mem_root->first_block_usage= 0;
#if !(defined(HAVE_purify) && defined(EXTRA_DEBUG))
if (pre_alloc_size)
{
- if ((mem_root->free = mem_root->pre_alloc=
+ if ((mem_root->free= mem_root->pre_alloc=
(USED_MEM*) my_malloc(pre_alloc_size+ ALIGN_SIZE(sizeof(USED_MEM)),
MYF(0))))
{
- mem_root->free->size=pre_alloc_size+ALIGN_SIZE(sizeof(USED_MEM));
- mem_root->free->left=pre_alloc_size;
- mem_root->free->next=0;
+ mem_root->free->size= pre_alloc_size+ALIGN_SIZE(sizeof(USED_MEM));
+ mem_root->free->left= pre_alloc_size;
+ mem_root->free->next= 0;
}
}
#endif
@@ -57,20 +58,31 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
(*mem_root->error_handler)();
return((gptr) 0); /* purecov: inspected */
}
- next->next=mem_root->used;
+ next->next= mem_root->used;
next->size= Size;
- mem_root->used=next;
+ mem_root->used= next;
return (gptr) (((char*) next)+ALIGN_SIZE(sizeof(USED_MEM)));
#else
uint get_size, block_size;
gptr point;
- reg1 USED_MEM *next;
+ reg1 USED_MEM *next= 0;
reg2 USED_MEM **prev;
Size= ALIGN_SIZE(Size);
- prev= &mem_root->free;
- for (next= *prev ; next && next->left < Size ; next= next->next)
- prev= &next->next;
+ if ( (*(prev= &mem_root->free)) != NULL )
+ {
+ if( (*prev)->left < Size &&
+ mem_root->first_block_usage++ >= MAX_BLOCK_USAGE_BEFORE_DROP )
+ {
+ next= *prev;
+ *prev= next->next; /* Remove block from list */
+ next->next= mem_root->used;
+ mem_root->used= next;
+ mem_root->first_block_usage= 0;
+ }
+ for (next= *prev ; next && next->left < Size ; next= next->next)
+ prev= &next->next;
+ }
if (! next)
{ /* Time to alloc new block */
block_size= mem_root->block_size*((mem_root->block_num>>2)+1);
@@ -89,12 +101,15 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
next->left= get_size-ALIGN_SIZE(sizeof(USED_MEM));
*prev=next;
}
+
point= (gptr) ((char*) next+ (next->size-next->left));
+ /*TODO: next part may be unneded due to mem_root->first_block_usage counter*/
if ((next->left-= Size) < mem_root->min_malloc)
{ /* Full block */
- *prev=next->next; /* Remove block from list */
- next->next=mem_root->used;
- mem_root->used=next;
+ *prev= next->next; /* Remove block from list */
+ next->next= mem_root->used;
+ mem_root->used= next;
+ mem_root->first_block_usage= 0;
}
return(point);
#endif
@@ -166,6 +181,7 @@ void free_root(MEM_ROOT *root, myf MyFlags)
}
else
root->block_num= 0;
+ root->first_block_usage= 0;
DBUG_VOID_RETURN;
}
diff --git a/mysys/my_chsize.c b/mysys/my_chsize.c
index aeab9e47ee2..06e8f159f4a 100644
--- a/mysys/my_chsize.c
+++ b/mysys/my_chsize.c
@@ -18,10 +18,26 @@
#include "mysys_err.h"
#include "m_string.h"
- /* Change size of file. Truncate file if shorter, */
- /* else expand with zero. */
+/*
+ Change size of file.
-int my_chsize(File fd, my_off_t newlength, myf MyFlags)
+ SYNOPSIS
+ my_chsize()
+ fd File descriptor
+ new_length New file size
+ filler If we don't have truncate, fill up all bytes after
+ new_length with this character
+ MyFlags Flags
+
+ DESCRIPTION
+ my_chsize() truncates file if shorter, else fill with the filler character
+
+ RETURN VALUE
+ 0 Ok
+ 1 Error
+*/
+
+int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
{
DBUG_ENTER("my_chsize");
DBUG_PRINT("my",("fd: %d length: %lu MyFlags: %d",fd,(ulong) newlength,
@@ -67,7 +83,7 @@ int my_chsize(File fd, my_off_t newlength, myf MyFlags)
}
#endif
/* Full file with 0 until it's as big as requested */
- bzero(buff,IO_SIZE);
+ bfill(buff, IO_SIZE, filler);
while (newlength-oldsize > IO_SIZE)
{
if (my_write(fd,(byte*) buff,IO_SIZE,MYF(MY_NABP)))
diff --git a/mysys/my_div.c b/mysys/my_div.c
index e47589a087c..777ffe403d7 100644
--- a/mysys/my_div.c
+++ b/mysys/my_div.c
@@ -16,6 +16,14 @@
#include "mysys_priv.h"
+/*
+ Get filename of file
+
+ SYNOPSIS
+ my_filename()
+ fd File descriptor
+*/
+
my_string my_filename(File fd)
{
DBUG_ENTER("my_filename");
diff --git a/mysys/my_error.c b/mysys/my_error.c
index fd0cdcc2289..eaa126a31c1 100644
--- a/mysys/my_error.c
+++ b/mysys/my_error.c
@@ -25,8 +25,15 @@
const char ** NEAR my_errmsg[MAXMAPS]={0,0,0,0};
char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE];
-/* Error message to user */
-/*VARARGS2*/
+/*
+ Error message to user
+
+ SYNOPSIS
+ my_error()
+ nr Errno
+ MyFlags Flags
+ ... variable list
+*/
int my_error(int nr,myf MyFlags, ...)
{
@@ -102,7 +109,16 @@ int my_error(int nr,myf MyFlags, ...)
DBUG_RETURN((*error_handler_hook)(nr, ebuff, MyFlags));
}
- /* Error as printf */
+/*
+ Error as printf
+
+ SYNOPSIS
+ my_printf_error()
+ error Errno
+ format Format string
+ MyFlags Flags
+ ... variable list
+*/
int my_printf_error (uint error, const char *format, myf MyFlags, ...)
{
@@ -115,7 +131,15 @@ int my_printf_error (uint error, const char *format, myf MyFlags, ...)
return (*error_handler_hook)(error, ebuff, MyFlags);
}
- /* Give message using error_handler_hook */
+/*
+ Give message using error_handler_hook
+
+ SYNOPSIS
+ my_message()
+ error Errno
+ str Error message
+ MyFlags Flags
+*/
int my_message(uint error, const char *str, register myf MyFlags)
{
diff --git a/mysys/my_gethostbyname.c b/mysys/my_gethostbyname.c
index 1380257f660..5044a505054 100644
--- a/mysys/my_gethostbyname.c
+++ b/mysys/my_gethostbyname.c
@@ -18,9 +18,6 @@
/* Thread safe version of gethostbyname_r() */
#include "mysys_priv.h"
-#ifdef THREAD
-#include "my_pthread.h"
-#endif
#include <assert.h>
#if !defined(MSDOS) && !defined(__WIN__)
#include <netdb.h>
@@ -56,7 +53,6 @@ struct hostent *my_gethostbyname_r(const char *name,
struct hostent *result, char *buffer,
int buflen, int *h_errnop)
{
- DBUG_ASSERT(buflen >= sizeof(struct hostent_data));
if (gethostbyname_r(name,result,(struct hostent_data *) buffer) == -1)
{
*h_errnop= errno;
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 12af811a0c8..5b86fddbbdb 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -22,30 +22,37 @@
#include <my_sys.h>
#include <mysys_err.h>
-static int findopt (char *optpat, uint length,
- const struct my_option **opt_res,
- char **ffname);
-static my_bool compare_strings (register const char *s, register const char *t,
- uint length);
-static longlong getopt_ll (char *arg, const struct my_option *optp, int *err);
-static ulonglong getopt_ull (char *arg, const struct my_option *optp,
- int *err);
+static int findopt(char *optpat, uint length,
+ const struct my_option **opt_res,
+ char **ffname);
+my_bool getopt_compare_strings(const char *s,
+ const char *t,
+ uint length);
+static longlong getopt_ll(char *arg, const struct my_option *optp, int *err);
+static ulonglong getopt_ull(char *arg, const struct my_option *optp,
+ int *err);
static void init_variables(const struct my_option *options);
-static int setval (const struct my_option *opts, char *argument,
- my_bool set_maximum_value);
-
-#define DISABLE_OPTION_COUNT 2 /* currently 'skip' and 'disable' below */
+static int setval(const struct my_option *opts, char *argument,
+ my_bool set_maximum_value);
-/* 'disable'-option prefixes must be in the beginning, DISABLE_OPTION_COUNT
- is the number of disabling prefixes */
+/*
+ The following three variables belong to same group and the number and
+ order of their arguments must correspond to each other.
+*/
static const char *special_opt_prefix[]=
{"skip", "disable", "enable", "maximum", "loose", 0};
+static const uint special_opt_prefix_lengths[]=
+{ 4, 7, 6, 7, 5, 0};
+enum enum_special_opt
+{ OPT_SKIP, OPT_DISABLE, OPT_ENABLE, OPT_MAXIMUM, OPT_LOOSE};
char *disabled_my_option= (char*) "0";
-/* This is a flag that can be set in client programs. 0 means that
+/*
+ This is a flag that can be set in client programs. 0 means that
my_getopt will not print error messages, but the client should do
- it by itself */
+ it by itself
+*/
my_bool my_getopt_print_errors= 1;
@@ -66,10 +73,10 @@ int handle_options(int *argc, char ***argv,
const struct my_option *,
char *))
{
- uint opt_found, argvpos= 0, length, spec_len, i;
+ uint opt_found, argvpos= 0, length, i;
my_bool end_of_options= 0, must_be_var, set_maximum_value, special_used,
- option_is_loose, option_used= 0;
- char *progname= *(*argv), **pos, *optend, *prev_found;
+ option_is_loose;
+ char *progname= *(*argv), **pos, **pos_end, *optend, *prev_found;
const struct my_option *optp;
int error;
@@ -78,13 +85,12 @@ int handle_options(int *argc, char ***argv,
(*argv)++; /* --- || ---- */
init_variables(longopts);
- for (pos= *argv; *pos; pos++)
+ for (pos= *argv, pos_end=pos+ *argc; pos != pos_end ; pos++)
{
char *cur_arg= *pos;
if (cur_arg[0] == '-' && cur_arg[1] && !end_of_options) /* must be opt */
{
char *argument= 0;
- option_used= 1;
must_be_var= 0;
set_maximum_value= 0;
special_used= 0;
@@ -111,15 +117,9 @@ int handle_options(int *argc, char ***argv,
(*argc)--;
}
}
- else if (!compare_strings(cur_arg, "-set-variable", 13) ||
- !compare_strings(cur_arg, "-loose-set-variable", 19))
+ else if (!getopt_compare_strings(cur_arg, "-set-variable", 13))
{
must_be_var= 1;
- if (cur_arg[1] == 'l')
- {
- option_is_loose= 1;
- cur_arg+= 6;
- }
if (cur_arg[13] == '=')
{
cur_arg+= 14;
@@ -183,18 +183,19 @@ int handle_options(int *argc, char ***argv,
must_be_var= 1; /* option is followed by an argument */
for (i= 0; special_opt_prefix[i]; i++)
{
- spec_len= strlen(special_opt_prefix[i]);
- if (!compare_strings(special_opt_prefix[i], cur_arg, spec_len) &&
- cur_arg[spec_len] == '-')
+ if (!getopt_compare_strings(special_opt_prefix[i], cur_arg,
+ special_opt_prefix_lengths[i]) &&
+ cur_arg[special_opt_prefix_lengths[i]] == '-')
{
/*
We were called with a special prefix, we can reuse opt_found
*/
special_used= 1;
- cur_arg+= (spec_len + 1);
- if (!compare_strings(special_opt_prefix[i], "loose", 5))
+ cur_arg+= (special_opt_prefix_lengths[i] + 1);
+ if (i == OPT_LOOSE)
option_is_loose= 1;
- if ((opt_found= findopt(cur_arg, length - (spec_len + 1),
+ if ((opt_found= findopt(cur_arg, length -
+ (special_opt_prefix_lengths[i] + 1),
&optp, &prev_found)))
{
if (opt_found > 1)
@@ -206,14 +207,18 @@ int handle_options(int *argc, char ***argv,
special_opt_prefix[i], prev_found);
return EXIT_AMBIGUOUS_OPTION;
}
- if (i < DISABLE_OPTION_COUNT)
+ switch (i) {
+ case OPT_SKIP:
+ case OPT_DISABLE: /* fall through */
optend= disabled_my_option;
- else if (!compare_strings(special_opt_prefix[i],"enable",6))
+ break;
+ case OPT_ENABLE:
optend= (char*) "1";
- else if (!compare_strings(special_opt_prefix[i],"maximum",7))
- {
+ break;
+ case OPT_MAXIMUM:
set_maximum_value= 1;
must_be_var= 1;
+ break;
}
break; /* break from the inner loop, main loop continues */
}
@@ -264,7 +269,7 @@ int handle_options(int *argc, char ***argv,
return EXIT_AMBIGUOUS_OPTION;
}
}
- if (must_be_var && (!optp->value || optp->var_type == GET_BOOL))
+ if (must_be_var && !optp->value)
{
if (my_getopt_print_errors)
fprintf(stderr, "%s: option '%s' cannot take an argument\n",
@@ -273,7 +278,7 @@ int handle_options(int *argc, char ***argv,
}
if (optp->arg_type == NO_ARG)
{
- if (optend && !special_used)
+ if (optend && special_used)
{
if (my_getopt_print_errors)
fprintf(stderr, "%s: option '--%s' cannot take an argument\n",
@@ -289,7 +294,7 @@ int handle_options(int *argc, char ***argv,
*/
*((my_bool*) optp->value)= (my_bool) (!optend || *optend == '1');
(*argc)--;
- continue; // For GET_BOOL get_one_option() shouldn't be called
+ continue; /* For GET_BOOL get_one_option() shouldn't be called */
}
argument= optend;
}
@@ -337,16 +342,16 @@ int handle_options(int *argc, char ***argv,
if (optp->var_type == GET_BOOL && optp->arg_type == NO_ARG)
{
*((my_bool*) optp->value)= (my_bool) 1;
- continue; // For GET_BOOL get_one_option() shouldn't be called
+ continue; /* For GET_BOOL get_one_option() shouldn't be called */
}
else if (optp->arg_type == REQUIRED_ARG ||
optp->arg_type == OPT_ARG)
{
if (*(optend + 1))
{
- // The rest of the option is option argument
+ /* The rest of the option is option argument */
argument= optend + 1;
- // This is in effect a jump out of the outer loop
+ /* This is in effect a jump out of the outer loop */
optend= (char*) " ";
}
else if (optp->arg_type == REQUIRED_ARG)
@@ -401,12 +406,13 @@ int handle_options(int *argc, char ***argv,
else /* non-option found */
(*argv)[argvpos++]= cur_arg;
}
- /* Destroy the first, already handled option, so that programs that look
- for arguments in 'argv', without checking 'argc', know when to stop.
- Items in argv, before the destroyed one, are all non-option -arguments
- to the program, yet to be (possibly) handled. */
- if (option_used)
- (*argv)[argvpos]= 0;
+ /*
+ Destroy the first, already handled option, so that programs that look
+ for arguments in 'argv', without checking 'argc', know when to stop.
+ Items in argv, before the destroyed one, are all non-option -arguments
+ to the program, yet to be (possibly) handled.
+ */
+ (*argv)[argvpos]= 0;
return 0;
}
@@ -424,8 +430,8 @@ static int setval (const struct my_option *opts, char *argument,
if (opts->value && argument)
{
- gptr *result_pos= (set_maximum_value) ?
- opts->u_max_value : opts->value;
+ gptr *result_pos= ((set_maximum_value) ?
+ opts->u_max_value : opts->value);
if (!result_pos)
return EXIT_NO_PTR_TO_VARIABLE;
@@ -476,21 +482,21 @@ static int setval (const struct my_option *opts, char *argument,
the name in ffname argument
*/
-static int findopt (char *optpat, uint length,
- const struct my_option **opt_res,
- char **ffname)
+static int findopt(char *optpat, uint length,
+ const struct my_option **opt_res,
+ char **ffname)
{
int count;
struct my_option *opt= (struct my_option *) *opt_res;
for (count= 0; opt->name; opt++)
{
- if (!compare_strings(opt->name, optpat, length)) /* match found */
+ if (!getopt_compare_strings(opt->name, optpat, length)) /* match found */
{
(*opt_res)= opt;
if (!count)
- *ffname= (char *) opt->name; /* we only need to know one prev */
- if (length == strlen(opt->name)) /* exact match */
+ *ffname= (char *) opt->name; /* We only need to know one prev */
+ if (!opt->name[length]) /* Exact match */
return 1;
count++;
}
@@ -506,7 +512,7 @@ static int findopt (char *optpat, uint length,
2.) Returns -1 if strings differ, 0 if they are equal
*/
-static my_bool compare_strings(register const char *s, register const char *t,
+my_bool getopt_compare_strings(register const char *s, register const char *t,
uint length)
{
char const *end= s + length;
@@ -560,7 +566,7 @@ static longlong eval_num_suffix (char *argument, int *error, char *option_name)
In case of an error, set error value in *err.
*/
-static longlong getopt_ll (char *arg, const struct my_option *optp, int *err)
+longlong getopt_ll (char *arg, const struct my_option *optp, int *err)
{
longlong num;
@@ -568,7 +574,7 @@ static longlong getopt_ll (char *arg, const struct my_option *optp, int *err)
if (num < (longlong) optp->min_value)
num= (longlong) optp->min_value;
else if (num > 0 && (ulonglong) num > (ulonglong) (ulong) optp->max_value
- && optp->max_value) // if max value is not set -> no upper limit
+ && optp->max_value) /* if max value is not set -> no upper limit */
num= (longlong) (ulong) optp->max_value;
num= ((num - (longlong) optp->sub_size) / (optp->block_size ?
(ulonglong) optp->block_size :
@@ -589,16 +595,23 @@ static ulonglong getopt_ull (char *arg, const struct my_option *optp, int *err)
ulonglong num;
num= eval_num_suffix(arg, err, (char*) optp->name);
+ return getopt_ull_limit_value(num, optp);
+}
+
+
+ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp)
+{
+ if ((ulonglong) num > (ulonglong) (ulong) optp->max_value &&
+ optp->max_value) /* if max value is not set -> no upper limit */
+ num= (ulonglong) (ulong) optp->max_value;
+ if (optp->block_size > 1)
+ {
+ num/= (ulonglong) optp->block_size;
+ num*= (ulonglong) optp->block_size;
+ }
if (num < (ulonglong) optp->min_value)
num= (ulonglong) optp->min_value;
- else if (num > 0 && (ulonglong) num > (ulonglong) (ulong) optp->max_value
- && optp->max_value) // if max value is not set -> no upper limit
- num= (ulonglong) (ulong) optp->max_value;
- num= ((num - (ulonglong) optp->sub_size) / (optp->block_size ?
- (ulonglong) optp->block_size :
- 1L));
- return (ulonglong) (num * (optp->block_size ? (ulonglong) optp->block_size :
- 1L));
+ return num;
}
/*
@@ -615,32 +628,32 @@ static void init_variables(const struct my_option *options)
{
switch (options->var_type) {
case GET_BOOL:
- *((my_bool*) options->u_max_value)= *((my_bool*) options->value)=
- (my_bool) options->def_value;
+ *((my_bool*) options->u_max_value)= (my_bool) options->max_value;
+ *((my_bool*) options->value)= (my_bool) options->def_value;
break;
case GET_INT:
- *((int*) options->u_max_value)= *((int*) options->value)=
- (int) options->def_value;
+ *((int*) options->u_max_value)= (int) options->max_value;
+ *((int*) options->value)= (int) options->def_value;
break;
case GET_UINT:
- *((uint*) options->u_max_value)= *((uint*) options->value)=
- (uint) options->def_value;
+ *((uint*) options->u_max_value)= (uint) options->max_value;
+ *((uint*) options->value)= (uint) options->def_value;
break;
case GET_LONG:
- *((long*) options->u_max_value)= *((long*) options->value)=
- (long) options->def_value;
+ *((long*) options->u_max_value)= (long) options->max_value;
+ *((long*) options->value)= (long) options->def_value;
break;
case GET_ULONG:
- *((ulong*) options->u_max_value)= *((ulong*) options->value)=
- (ulong) options->def_value;
+ *((ulong*) options->u_max_value)= (ulong) options->max_value;
+ *((ulong*) options->value)= (ulong) options->def_value;
break;
case GET_LL:
- *((longlong*) options->u_max_value)= *((longlong*) options->value)=
- (longlong) options->def_value;
+ *((longlong*) options->u_max_value)= (longlong) options->max_value;
+ *((longlong*) options->value)= (longlong) options->def_value;
break;
case GET_ULL:
- *((ulonglong*) options->u_max_value)= *((ulonglong*) options->value)=
- (ulonglong) options->def_value;
+ *((ulonglong*) options->u_max_value)= (ulonglong) options->max_value;
+ *((ulonglong*) options->value)= (ulonglong) options->def_value;
break;
default: /* dummy default to avoid compiler warnings */
break;
@@ -712,7 +725,7 @@ void my_print_help(const struct my_option *options)
for (line_end= comment + comment_space; *line_end != ' '; line_end--);
for (; comment != line_end; comment++)
putchar(*comment);
- comment++; // skip the space, as a newline will take it's place now
+ comment++; /* skip the space, as a newline will take it's place now */
putchar('\n');
for (col= 0; col < name_space; col++)
putchar(' ');
diff --git a/mysys/my_init.c b/mysys/my_init.c
index faf4e7f83f0..ee39f7201ca 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -19,9 +19,6 @@
#include "mysys_err.h"
#include <m_string.h>
#include <m_ctype.h>
-#ifdef THREAD
-#include <my_pthread.h>
-#endif
#ifdef HAVE_GETRUSAGE
#include <sys/resource.h>
/* extern int getrusage(int, struct rusage *); */
diff --git a/mysys/my_net.c b/mysys/my_net.c
index a4a842ac15e..be92adae353 100644
--- a/mysys/my_net.c
+++ b/mysys/my_net.c
@@ -33,11 +33,6 @@
#endif
#endif /* !defined(MSDOS) && !defined(__WIN__) */
-#ifndef THREAD
-#define pthread_mutex_lock(A)
-#define pthread_mutex_unlock(A)
-#endif
-
void my_inet_ntoa(struct in_addr in, char *buf)
{
char *ptr;
diff --git a/mysys/my_once.c b/mysys/my_once.c
index 3358112551f..1250ce24994 100644
--- a/mysys/my_once.c
+++ b/mysys/my_once.c
@@ -24,8 +24,17 @@
#include "my_static.h"
#include "mysys_err.h"
- /* alloc for things we don't nead to free */
- /* No DBUG_ENTER... here to get smaller dbug-startup */
+/*
+ Alloc for things we don't nead to free
+
+ SYNOPSIS
+ my_once_alloc()
+ Size
+ MyFlags
+
+ NOTES
+ No DBUG_ENTER... here to get smaller dbug-startup
+*/
gptr my_once_alloc(unsigned int Size, myf MyFlags)
{
@@ -69,7 +78,12 @@ gptr my_once_alloc(unsigned int Size, myf MyFlags)
} /* my_once_alloc */
- /* deallocate everything used by my_once_alloc */
+/*
+ Deallocate everything used by my_once_alloc
+
+ SYNOPSIS
+ my_once_free()
+*/
void my_once_free(void)
{
diff --git a/mysys/my_open.c b/mysys/my_open.c
index a0a802b8a2e..97f21724e1c 100644
--- a/mysys/my_open.c
+++ b/mysys/my_open.c
@@ -23,7 +23,18 @@
#include <share.h>
#endif
- /* Open a file */
+/*
+ Open a file
+
+ SYNOPSIS
+ my_open()
+ FileName Fully qualified file name
+ Flags Read | write
+ MyFlags Special flags
+
+ RETURN VALUE
+ File descriptor
+*/
File my_open(const char *FileName, int Flags, myf MyFlags)
/* Path-name of file */
@@ -51,7 +62,15 @@ File my_open(const char *FileName, int Flags, myf MyFlags)
} /* my_open */
- /* Close a file */
+/*
+ Close a file
+
+ SYNOPSIS
+ my_close()
+ fd File sescriptor
+ myf Special Flags
+
+*/
int my_close(File fd, myf MyFlags)
{
@@ -81,6 +100,16 @@ int my_close(File fd, myf MyFlags)
} /* my_close */
+/*
+ Register file in my_file_info[]
+
+ SYNOPSIS
+ my_register_filename()
+ fd
+ FileName
+ type_file_type
+*/
+
File my_register_filename(File fd, const char *FileName, enum file_type
type_of_file, uint error_message_number, myf MyFlags)
{
diff --git a/mysys/my_os2cond.c b/mysys/my_os2cond.c
index c436ad9a0e9..d930aadb2d1 100644
--- a/mysys/my_os2cond.c
+++ b/mysys/my_os2cond.c
@@ -32,8 +32,8 @@
int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
{
- APIRET rc = 0;
- HEV event;
+ APIRET rc = 0;
+ HEV event;
cond->waiting=0;
/* Warp3 FP29 or Warp4 FP4 or better required */
rc = DosCreateEventSem( NULL, &cond->semaphore, 0x0800, 0);
@@ -61,7 +61,7 @@ int pthread_cond_destroy(pthread_cond_t *cond)
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
{
APIRET rc;
- int rval;
+ int rval;
rval = 0;
cond->waiting++;
@@ -80,13 +80,13 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
}
int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
- struct timespec *abstime)
+ struct timespec *abstime)
{
struct timeb curtime;
int result;
long timeout;
APIRET rc;
- int rval;
+ int rval;
_ftime(&curtime);
timeout= ((long) (abstime->ts_sec - curtime.time)*1000L +
@@ -123,13 +123,13 @@ int pthread_cond_signal(pthread_cond_t *cond)
int pthread_cond_broadcast(pthread_cond_t *cond)
{
- int i;
+ int i;
APIRET rc;
- /*
- * Enter a loop to bring all threads off the
- * condition queue:
- */
+ /*
+ * Enter a loop to bring all threads off the
+ * condition queue:
+ */
i = cond->waiting;
while (i--) rc = DosPostEventSem(cond->semaphore);
@@ -176,9 +176,9 @@ struct tm *localtime_r(const time_t *timep,struct tm *tmp)
else
{
struct tm *res=localtime(timep);
- if (!res) /* Wrong date */
+ if (!res) /* Wrong date */
{
- bzero(tmp,sizeof(*tmp)); /* Keep things safe */
+ bzero(tmp,sizeof(*tmp)); /* Keep things safe */
return 0;
}
*tmp= *res;
diff --git a/mysys/my_os2dirsrch.c b/mysys/my_os2dirsrch.c
index 36f56d3ed2e..773d6800d1e 100644
--- a/mysys/my_os2dirsrch.c
+++ b/mysys/my_os2dirsrch.c
@@ -26,10 +26,10 @@
long _findfirst( char* path, struct _finddata_t* dos_file)
{
- HDIR hdir = HDIR_CREATE;
- APIRET rc;
+ HDIR hdir = HDIR_CREATE;
+ APIRET rc;
FILEFINDBUF3 buf3;
- ULONG entries = 1;
+ ULONG entries = 1;
#ifdef _DEBUG
printf( "_findfirst path %s\n", path);
@@ -37,13 +37,13 @@ long _findfirst( char* path, struct _finddata_t* dos_file)
memset( &buf3, 0, sizeof( buf3));
rc = DosFindFirst(
- path, /* Address of the ASCIIZ path name of the file or subdirectory to be found. */
- &hdir, /* Address of the handle associated with this DosFindFirst request. */
- FILE_NORMAL | FILE_DIRECTORY, /* Attribute value that determines the file objects to be searched for. */
- &buf3, /* Result buffer. */
- sizeof( buf3), /* The length, in bytes, of pfindbuf. */
- &entries, /* Pointer to the number of entries: */
- FIL_STANDARD); /* The level of file information required. */
+ path, /* Address of the ASCIIZ path name of the file or subdirectory to be found. */
+ &hdir, /* Address of the handle associated with this DosFindFirst request. */
+ FILE_NORMAL | FILE_DIRECTORY, /* Attribute value that determines the file objects to be searched for. */
+ &buf3, /* Result buffer. */
+ sizeof( buf3), /* The length, in bytes, of pfindbuf. */
+ &entries, /* Pointer to the number of entries: */
+ FIL_STANDARD); /* The level of file information required. */
#ifdef _DEBUG
printf( "_findfirst rc=%d hdir=%d entries=%d->%s\n", rc, hdir, entries, buf3.achName);
@@ -64,16 +64,16 @@ long _findfirst( char* path, struct _finddata_t* dos_file)
long _findnext( long hdir, struct _finddata_t* dos_file)
{
- APIRET rc;
+ APIRET rc;
FILEFINDBUF3 buf3;
- ULONG entries = 1;
+ ULONG entries = 1;
memset( &buf3, 0, sizeof( buf3));
rc = DosFindNext(
- hdir,
- &buf3, /* Result buffer. */
- sizeof( buf3), /* The length, in bytes, of pfindbuf. */
- &entries); /* Pointer to the number of entries: */
+ hdir,
+ &buf3, /* Result buffer. */
+ sizeof( buf3), /* The length, in bytes, of pfindbuf. */
+ &entries); /* Pointer to the number of entries: */
#ifdef _DEBUG
printf( "_findnext rc=%d hdir=%d entries=%d->%s\n", rc, hdir, entries, buf3.achName);
@@ -93,7 +93,7 @@ long _findnext( long hdir, struct _finddata_t* dos_file)
void _findclose( long hdir)
{
- APIRET rc;
+ APIRET rc;
rc = DosFindClose( hdir);
#ifdef _DEBUG
@@ -105,8 +105,8 @@ DIR* opendir( char* path)
{
DIR* dir = (DIR*) calloc( 1, sizeof( DIR));
char buffer[260];
- APIRET rc;
- ULONG entries = 1;
+ APIRET rc;
+ ULONG entries = 1;
strcpy( buffer, path);
strcat( buffer, "*.*");
@@ -118,13 +118,13 @@ DIR* opendir( char* path)
dir->hdir = HDIR_CREATE;
memset( &dir->buf3, 0, sizeof( dir->buf3));
rc = DosFindFirst(
- buffer, /* Address of the ASCIIZ path name of the file or subdirectory to be found. */
- &dir->hdir, /* Address of the handle associated with this DosFindFirst request. */
- FILE_NORMAL | FILE_DIRECTORY, /* Attribute value that determines the file objects to be searched for. */
- &dir->buf3, /* Result buffer. */
- sizeof( dir->buf3), /* The length, in bytes, of pfindbuf. */
- &entries, /* Pointer to the number of entries: */
- FIL_STANDARD); /* The level of file information required. */
+ buffer, /* Address of the ASCIIZ path name of the file or subdirectory to be found. */
+ &dir->hdir, /* Address of the handle associated with this DosFindFirst request. */
+ FILE_NORMAL | FILE_DIRECTORY, /* Attribute value that determines the file objects to be searched for. */
+ &dir->buf3, /* Result buffer. */
+ sizeof( dir->buf3), /* The length, in bytes, of pfindbuf. */
+ &entries, /* Pointer to the number of entries: */
+ FIL_STANDARD); /* The level of file information required. */
#ifdef _DEBUG
printf( "opendir rc=%d hdir=%d entries=%d->%s\n", rc, dir->hdir, entries, dir->buf3.achName);
@@ -138,9 +138,9 @@ DIR* opendir( char* path)
struct dirent* readdir( DIR* dir)
{
- APIRET rc;
+ APIRET rc;
//FILEFINDBUF3 buf3;
- ULONG entries = 1;
+ ULONG entries = 1;
if (!dir->buf3.achName[0]) // file not found on previous query
return NULL;
@@ -151,10 +151,10 @@ struct dirent* readdir( DIR* dir)
// query next file
memset( &dir->buf3, 0, sizeof( dir->buf3));
rc = DosFindNext(
- dir->hdir,
- &dir->buf3, /* Result buffer. */
- sizeof( dir->buf3), /* The length, in bytes, of pfindbuf. */
- &entries); /* Pointer to the number of entries: */
+ dir->hdir,
+ &dir->buf3, /* Result buffer. */
+ sizeof( dir->buf3), /* The length, in bytes, of pfindbuf. */
+ &entries); /* Pointer to the number of entries: */
#ifdef _DEBUG
printf( "_findnext rc=%d hdir=%d entries=%d->%s\n", rc, dir->hdir, entries, dir->buf3.achName);
@@ -168,7 +168,7 @@ struct dirent* readdir( DIR* dir)
int closedir (DIR *dir)
{
- APIRET rc;
+ APIRET rc;
rc = DosFindClose( dir->hdir);
#ifdef _DEBUG
diff --git a/mysys/my_os2dirsrch.h b/mysys/my_os2dirsrch.h
index 2afe0f609f1..e894d27b576 100644
--- a/mysys/my_os2dirsrch.h
+++ b/mysys/my_os2dirsrch.h
@@ -30,9 +30,9 @@ extern "C" {
struct _finddata_t
{
unsigned attrib;
- //unsigned long time_create; /* -1 for FAT file systems */
- //unsigned long time_access; /* -1 for FAT file systems */
- //unsigned long time_write;
+ //unsigned long time_create; /* -1 for FAT file systems */
+ //unsigned long time_access; /* -1 for FAT file systems */
+ //unsigned long time_write;
unsigned long size;
char name[260];
//uint16 wr_date;
@@ -42,10 +42,10 @@ struct _finddata_t
struct dirent
{
//unsigned attrib;
- //unsigned long time_create; /* -1 for FAT file systems */
- //unsigned long time_access; /* -1 for FAT file systems */
- //unsigned long time_write;
- //unsigned long size;
+ //unsigned long time_create; /* -1 for FAT file systems */
+ //unsigned long time_access; /* -1 for FAT file systems */
+ //unsigned long time_write;
+ //unsigned long size;
char d_name[260];
//uint16 wr_date;
//uint16 wr_time;
@@ -66,9 +66,9 @@ int closedir (DIR *);
//#define _A_SUBDIR FILE_DIRECTORY
//#define _A_RDONLY FILE_READONLY
-//long _findfirst( char*, struct _finddata_t*);
-//long _findnext( long, struct _finddata_t*);
-//void _findclose( long);
+//long _findfirst( char*, struct _finddata_t*);
+//long _findnext( long, struct _finddata_t*);
+//void _findclose( long);
#ifdef __cplusplus_00
}
diff --git a/mysys/my_os2dlfcn.c b/mysys/my_os2dlfcn.c
index 0b0b5518eff..9c9a6061e8d 100644
--- a/mysys/my_os2dlfcn.c
+++ b/mysys/my_os2dlfcn.c
@@ -34,7 +34,7 @@ char* dlerror( void);
void* dlsym( void* hmod, char* fn);
void dlclose( void* hmod);
-char fail[ 256];
+char fail[ 256];
void* dlopen( char* path, int flag)
{
@@ -56,7 +56,7 @@ char* dlerror( void)
void* dlsym( void* hmod, char* fn)
{
APIRET rc;
- PFN addr;
+ PFN addr;
rc = DosQueryProcAddr( (HMODULE) hmod, 0l, fn, &addr);
if (rc)
diff --git a/mysys/my_os2file64.c b/mysys/my_os2file64.c
index b7ee40d292e..bc24c92b87f 100644
--- a/mysys/my_os2file64.c
+++ b/mysys/my_os2file64.c
@@ -18,10 +18,11 @@
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
-void _OS2errno( APIRET rc);
+void _OS2errno( APIRET rc);
longlong _lseek64( int fd, longlong offset, int seektype);
-int _lock64( int fd, int locktype, my_off_t start,
- my_off_t length, myf MyFlags);
+int _lock64( int fd, int locktype, my_off_t start,
+ my_off_t length, myf MyFlags);
+int _sopen64( const char *name, int oflag, int shflag, int mask);
//
// this class is used to define a global c++ variable, that
@@ -33,52 +34,52 @@ class File64bit
File64bit(); /* default constructor */
} initFile64bit;
-static APIRET (* APIENTRY _DosOpenL)(PCSZ pszFileName,
- PHFILE phf,
- PULONG pulAction,
- LONGLONG cbFile,
- ULONG ulAttribute,
- ULONG fsOpenFlags,
- ULONG fsOpenMode,
- PEAOP2 peaop2);
-static APIRET (* APIENTRY _DosSetFilePtrL)(HFILE hFile,
- LONGLONG ib,
- ULONG method,
- PLONGLONG ibActual);
-static APIRET (* APIENTRY _DosSetFileLocksL)(HFILE hFile,
- PFILELOCKL pflUnlock,
- PFILELOCKL pflLock,
- ULONG timeout,
- ULONG flags);
-
-#define EIO EINVAL
+static APIRET (* APIENTRY _DosOpenL)(PCSZ pszFileName,
+ PHFILE phf,
+ PULONG pulAction,
+ LONGLONG cbFile,
+ ULONG ulAttribute,
+ ULONG fsOpenFlags,
+ ULONG fsOpenMode,
+ PEAOP2 peaop2);
+static APIRET (* APIENTRY _DosSetFilePtrL)(HFILE hFile,
+ LONGLONG ib,
+ ULONG method,
+ PLONGLONG ibActual);
+static APIRET (* APIENTRY _DosSetFileLocksL)(HFILE hFile,
+ PFILELOCKL pflUnlock,
+ PFILELOCKL pflLock,
+ ULONG timeout,
+ ULONG flags);
+
+#define EIO EINVAL
#define ESPIPE EBADSEEK
static unsigned char const errno_tab[] =
{
- 0 , EINVAL, ENOENT, ENOENT, EMFILE, /* 0..4 */
- EACCES, EBADF, EIO, ENOMEM, EIO, /* 5..9 */
+ 0 , EINVAL, ENOENT, ENOENT, EMFILE, /* 0..4 */
+ EACCES, EBADF, EIO, ENOMEM, EIO, /* 5..9 */
EINVAL, ENOEXEC,EINVAL, EINVAL, EINVAL, /* 10..14 */
ENOENT, EBUSY, EXDEV, ENOENT, EROFS, /* 15..19 */
- EIO, EIO, EIO, EIO, EIO, /* 20..24 */
- EIO, EIO, EIO, ENOSPC, EIO, /* 25..29 */
- EIO, EIO, EACCES, EACCES, EIO, /* 30..34 */
- EIO, EIO, EIO, EIO, ENOSPC, /* 35..39 */
- EIO, EIO, EIO, EIO, EIO, /* 40..44 */
- EIO, EIO, EIO, EIO, EIO, /* 45..49 */
- EIO, EIO, EIO, EIO, EBUSY, /* 50..54 */
- EIO, EIO, EIO, EIO, EIO, /* 55..59 */
- EIO, ENOSPC, ENOSPC, EIO, EIO, /* 60..64 */
- EACCES, EIO, EIO, EIO, EIO, /* 65..69 */
- EIO, EIO, EIO, EROFS, EIO, /* 70..74 */
- EIO, EIO, EIO, EIO, EIO, /* 75..79 */
- EEXIST, EIO, ENOENT, EIO, EIO, /* 80..84 */
- EIO, EIO, EINVAL, EIO, EAGAIN, /* 85..89 */
- EIO, EIO, EIO, EIO, EIO, /* 90..94 */
- EINTR, EIO, EIO, EIO, EACCES, /* 95..99 */
+ EIO, EIO, EIO, EIO, EIO, /* 20..24 */
+ EIO, EIO, EIO, ENOSPC, EIO, /* 25..29 */
+ EIO, EIO, EACCES, EACCES, EIO, /* 30..34 */
+ EIO, EIO, EIO, EIO, ENOSPC, /* 35..39 */
+ EIO, EIO, EIO, EIO, EIO, /* 40..44 */
+ EIO, EIO, EIO, EIO, EIO, /* 45..49 */
+ EIO, EIO, EIO, EIO, EBUSY, /* 50..54 */
+ EIO, EIO, EIO, EIO, EIO, /* 55..59 */
+ EIO, ENOSPC, ENOSPC, EIO, EIO, /* 60..64 */
+ EACCES, EIO, EIO, EIO, EIO, /* 65..69 */
+ EIO, EIO, EIO, EROFS, EIO, /* 70..74 */
+ EIO, EIO, EIO, EIO, EIO, /* 75..79 */
+ EEXIST, EIO, ENOENT, EIO, EIO, /* 80..84 */
+ EIO, EIO, EINVAL, EIO, EAGAIN, /* 85..89 */
+ EIO, EIO, EIO, EIO, EIO, /* 90..94 */
+ EINTR, EIO, EIO, EIO, EACCES, /* 95..99 */
ENOMEM, EINVAL, EINVAL, ENOMEM, EINVAL, /* 100..104 */
- EINVAL, ENOMEM, EIO, EACCES, EPIPE, /* 105..109 */
+ EINVAL, ENOMEM, EIO, EACCES, EPIPE, /* 105..109 */
ENOENT, E2BIG, ENOSPC, ENOMEM, EBADF, /* 110..114 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 115..119 */
EINVAL, EINVAL, EINVAL, ENOENT, EINVAL, /* 120..124 */
@@ -120,16 +121,16 @@ static unsigned char const errno_tab[] =
EINVAL, EBUSY, EINVAL, ESRCH, EINVAL, /* 300..304 */
ESRCH, EINVAL, EINVAL, EINVAL, ESRCH, /* 305..309 */
EINVAL, ENOMEM, EINVAL, EINVAL, EINVAL, /* 310..314 */
- EINVAL, E2BIG, ENOENT, EIO, EIO, /* 315..319 */
+ EINVAL, E2BIG, ENOENT, EIO, EIO, /* 315..319 */
EINVAL, EINVAL, EINVAL, EINVAL, EAGAIN, /* 320..324 */
- EINVAL, EINVAL, EINVAL, EIO, ENOENT, /* 325..329 */
+ EINVAL, EINVAL, EINVAL, EIO, ENOENT, /* 325..329 */
EACCES, EACCES, EACCES, ENOENT, ENOMEM /* 330..334 */
};
/*
* Initialize 64bit file access: dynamic load of WSeB API
*/
- File64bit :: File64bit()
+ File64bit :: File64bit()
{
HMODULE hDoscalls;
@@ -155,7 +156,7 @@ static unsigned char const errno_tab[] =
#endif
}
-void _OS2errno( APIRET rc)
+void _OS2errno( APIRET rc)
{
if (rc >= sizeof (errno_tab))
errno = EINVAL;
@@ -186,21 +187,30 @@ longlong _lseek64( int fd, longlong offset, int seektype)
}
inline _SetFileLocksL(HFILE hFile,
- PFILELOCKL pflUnlock,
- PFILELOCKL pflLock,
- ULONG timeout,
- ULONG flags)
+ PFILELOCKL pflUnlock,
+ PFILELOCKL pflLock,
+ ULONG timeout,
+ ULONG flags)
{
- if (_DosSetFileLocksL)
- return _DosSetFileLocksL( hFile, pflUnlock, pflLock, timeout, flags);
+ if (_DosSetFileLocksL) {
+ APIRET rc;
+ rc = _DosSetFileLocksL( hFile, pflUnlock, pflLock, timeout, flags);
+
+ // on FAT/HPFS/LAN a INVALID_PARAMETER is returned, seems that
+ // only JFS can handle >2GB ranges.
+ if (rc != 87)
+ return rc;
+
+ // got INVALID_PARAMETER, fallback to standard call
+ }
FILELOCK flUnlock = { pflUnlock->lOffset, pflUnlock->lRange };
FILELOCK flLock = { pflLock->lOffset, pflLock->lRange };
return DosSetFileLocks( hFile, &flUnlock, &flLock, timeout, flags);
}
-int _lock64( int fd, int locktype, my_off_t start,
- my_off_t length, myf MyFlags)
+int _lock64( int fd, int locktype, my_off_t start,
+ my_off_t length, myf MyFlags)
{
FILELOCKL LockArea = {0,0}, UnlockArea = {0,0};
ULONG readonly = 0;
@@ -231,16 +241,16 @@ int _lock64( int fd, int locktype, my_off_t start,
//printf( "fd %d, locktype %d, rc %d (dont_wait)\n", fd, locktype, rc);
if (rc == 33) { /* Lock Violation */
- DBUG_PRINT("info",("Was locked, trying with timeout"));
- rc = _SetFileLocksL( fd, &UnlockArea, &LockArea, 1 * 1000, readonly);
- //printf( "fd %d, locktype %d, rc %d (dont_wait with timeout)\n", fd, locktype, rc);
+ DBUG_PRINT("info",("Was locked, trying with timeout"));
+ rc = _SetFileLocksL( fd, &UnlockArea, &LockArea, 1 * 1000, readonly);
+ //printf( "fd %d, locktype %d, rc %d (dont_wait with timeout)\n", fd, locktype, rc);
}
} else {
while( rc = _SetFileLocksL( fd, &UnlockArea, &LockArea, 0, readonly) && (rc == 33)) {
- printf(".");
- DosSleep(1 * 1000);
+ printf(".");
+ DosSleep(1 * 1000);
}
//printf( "fd %d, locktype %d, rc %d (wait2)\n", fd, locktype, rc);
}
@@ -254,9 +264,9 @@ int _lock64( int fd, int locktype, my_off_t start,
return(-1);
}
-int _sopen( const char *name, int oflag, int shflag, int mask)
+int sopen( const char *name, int oflag, int shflag, int mask)
{
- int fail_errno;
+ int fail_errno;
APIRET rc = 0;
HFILE hf = 0;
ULONG ulAction = 0;
@@ -279,18 +289,18 @@ int _sopen( const char *name, int oflag, int shflag, int mask)
{
if (oflag & O_EXCL)
{
- fsOpenFlags = OPEN_ACTION_FAIL_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
- fail_errno = EEXIST;
+ fsOpenFlags = OPEN_ACTION_FAIL_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
+ fail_errno = EEXIST;
}
else if (oflag & O_TRUNC)
- fsOpenFlags = OPEN_ACTION_REPLACE_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
+ fsOpenFlags = OPEN_ACTION_REPLACE_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
else
- fsOpenFlags = OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
+ fsOpenFlags = OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
if (mask & S_IWRITE)
- ulAttribute = FILE_NORMAL;
+ ulAttribute = FILE_NORMAL;
else
- ulAttribute = FILE_READONLY;
+ ulAttribute = FILE_READONLY;
}
else if (oflag & O_TRUNC)
@@ -301,10 +311,10 @@ int _sopen( const char *name, int oflag, int shflag, int mask)
/* Try to open the file and handle errors. */
if (_DosOpenL)
rc = _DosOpenL( name, &hf, &ulAction, cbFile,
- ulAttribute, fsOpenFlags, fsOpenMode, NULL);
+ ulAttribute, fsOpenFlags, fsOpenMode, NULL);
else
rc = DosOpen( name, &hf, &ulAction, (LONG) cbFile,
- ulAttribute, fsOpenFlags, fsOpenMode, NULL);
+ ulAttribute, fsOpenFlags, fsOpenMode, NULL);
if (rc == ERROR_OPEN_FAILED)
{
@@ -324,7 +334,7 @@ int _sopen( const char *name, int oflag, int shflag, int mask)
return hf;
}
-int read( int fd, void *buffer, unsigned int count)
+int read( int fd, void *buffer, unsigned int count)
{
APIRET rc;
ULONG actual;
@@ -340,7 +350,7 @@ int read( int fd, void *buffer, unsigned int count)
return(-1);
}
-int write( int fd, const void *buffer, unsigned int count)
+int write( int fd, const void *buffer, unsigned int count)
{
APIRET rc;
ULONG actual;
@@ -356,7 +366,7 @@ int write( int fd, const void *buffer, unsigned int count)
return(-1);
}
-int close( int fd)
+int close( int fd)
{
APIRET rc;
ULONG actual;
diff --git a/mysys/my_os2mutex.c b/mysys/my_os2mutex.c
index 0ae6ae86d8c..718aa9f2932 100644
--- a/mysys/my_os2mutex.c
+++ b/mysys/my_os2mutex.c
@@ -72,8 +72,8 @@ pthread_mutex_destroy(pthread_mutex_t * mutex)
int
pthread_mutex_lock(pthread_mutex_t * mutex)
{
- int ret = 0;
- int status = 0;
+ int ret = 0;
+ int status = 0;
APIRET rc = 0;
rc = DosRequestMutexSem(*mutex,SEM_INDEFINITE_WAIT);
@@ -86,9 +86,9 @@ pthread_mutex_lock(pthread_mutex_t * mutex)
int
pthread_mutex_unlock(pthread_mutex_t * mutex)
{
- int ret = 0;
+ int ret = 0;
APIRET rc = 0;
- int status;
+ int status;
rc = DosReleaseMutexSem(*mutex);
diff --git a/mysys/my_os2thread.c b/mysys/my_os2thread.c
index 017ba7f316b..6f196f43d75 100644
--- a/mysys/my_os2thread.c
+++ b/mysys/my_os2thread.c
@@ -31,9 +31,9 @@ static pthread_mutex_t THR_LOCK_thread;
struct pthread_map
{
- HANDLE pthreadself;
+ HANDLE pthreadself;
pthread_handler func;
- void * param;
+ void * param;
};
void win_pthread_init(void)
@@ -53,15 +53,18 @@ void win_pthread_init(void)
static pthread_handler_decl(pthread_start,param)
{
+ DBUG_ENTER("pthread_start");
pthread_handler func=((struct pthread_map *) param)->func;
void *func_param=((struct pthread_map *) param)->param;
my_thread_init(); /* Will always succeed in windows */
- pthread_mutex_lock(&THR_LOCK_thread); /* Wait for beginthread to return */
+ pthread_mutex_lock(&THR_LOCK_thread); /* Wait for beginthread to return */
win_pthread_self=((struct pthread_map *) param)->pthreadself;
pthread_mutex_unlock(&THR_LOCK_thread);
free((char*) param); /* Free param from create */
- pthread_exit((void*) (*func)(func_param));
- return 0; /* Safety */
+ //pthread_exit((void*) (*func)(func_param));
+ (*func)(func_param);
+ DBUG_RETURN(0);
+ //return 0; /* Safety */
}
diff --git a/mysys/my_os2tls.c b/mysys/my_os2tls.c
index 25d543d0768..1598fa34e2b 100644
--- a/mysys/my_os2tls.c
+++ b/mysys/my_os2tls.c
@@ -18,23 +18,23 @@
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
-DWORD TlsAlloc( void);
-BOOL TlsFree( DWORD);
-PVOID TlsGetValue( DWORD);
-BOOL TlsSetValue( DWORD, PVOID);
+DWORD TlsAlloc( void);
+BOOL TlsFree( DWORD);
+PVOID TlsGetValue( DWORD);
+BOOL TlsSetValue( DWORD, PVOID);
-#define TLS_MINIMUM_AVAILABLE 64
+#define TLS_MINIMUM_AVAILABLE 64
-PULONG tls_storage; /* TLS local storage */
-DWORD tls_bits[2]; /* TLS in-use bits */
-pthread_mutex_t tls_mutex; /* TLS mutex for in-use bits */
+PULONG tls_storage; /* TLS local storage */
+DWORD tls_bits[2]; /* TLS in-use bits */
+pthread_mutex_t tls_mutex; /* TLS mutex for in-use bits */
-DWORD TlsAlloc( void)
+DWORD TlsAlloc( void)
{
DWORD index = -1;
DWORD mask, tibidx;
- int i;
+ int i;
if (tls_storage == NULL) {
@@ -43,12 +43,12 @@ DWORD TlsAlloc( void)
// allocate memory for TLS storage
rc = DosAllocThreadLocalMemory( 1, &tls_storage);
if (rc) {
- fprintf( stderr, "DosAllocThreadLocalMemory error: return code = %u\n", rc);
+ fprintf( stderr, "DosAllocThreadLocalMemory error: return code = %u\n", rc);
}
// create a mutex
if (pthread_mutex_init( &tls_mutex, NULL))
- fprintf( stderr, "Failed to init TLS mutex\n");
+ fprintf( stderr, "Failed to init TLS mutex\n");
}
pthread_mutex_lock( &tls_mutex);
@@ -56,18 +56,18 @@ DWORD TlsAlloc( void)
tibidx = 0;
if (tls_bits[0] == 0xFFFFFFFF) {
if (tls_bits[1] == 0xFFFFFFFF) {
- fprintf( stderr, "tid#%d, no more TLS bits available\n", _threadid);
- pthread_mutex_unlock( &tls_mutex);
- return -1;
+ fprintf( stderr, "tid#%d, no more TLS bits available\n", _threadid);
+ pthread_mutex_unlock( &tls_mutex);
+ return -1;
}
tibidx = 1;
}
for( i=0; i<32; i++) {
mask = (1 << i);
if ((tls_bits[ tibidx] & mask) == 0) {
- tls_bits[ tibidx] |= mask;
- index = (tibidx*32) + i;
- break;
+ tls_bits[ tibidx] |= mask;
+ index = (tibidx*32) + i;
+ break;
}
}
tls_storage[index] = 0;
@@ -79,9 +79,9 @@ DWORD TlsAlloc( void)
return index;
}
-BOOL TlsFree( DWORD index)
+BOOL TlsFree( DWORD index)
{
- int tlsidx;
+ int tlsidx;
DWORD mask;
if (index >= TLS_MINIMUM_AVAILABLE)
@@ -106,7 +106,7 @@ BOOL TlsFree( DWORD index)
}
-PVOID TlsGetValue( DWORD index)
+PVOID TlsGetValue( DWORD index)
{
if (index >= TLS_MINIMUM_AVAILABLE)
return NULL;
@@ -122,7 +122,7 @@ PVOID TlsGetValue( DWORD index)
return (PVOID) tls_array[ index];
}
-BOOL TlsSetValue( DWORD index, PVOID val)
+BOOL TlsSetValue( DWORD index, PVOID val)
{
// verify if memory has been allocated for this thread
diff --git a/mysys/my_port.c b/mysys/my_port.c
new file mode 100644
index 00000000000..bf5dbcbace1
--- /dev/null
+++ b/mysys/my_port.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ 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., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA */
+
+/*
+ Small functions to make code portable
+*/
+
+#include "mysys_priv.h"
+
+#ifdef _AIX
+
+/*
+ On AIX, at least with gcc 3.1, the expression
+ '(double) (ulonglong) var' doesn't always work for big unsigned
+ integers like '18446744073709551615'. The end result is that the
+ high bit is simply dropped. (probably bug in gcc optimizations)
+ Handling the conversion in a sub function seems to work.
+*/
+
+
+
+double my_ulonglong2double(unsigned long long nr)
+{
+ return (double) nr;
+}
+#endif /* _AIX */
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index e1345b96627..54a5c71c695 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -17,6 +17,7 @@
/* Functions to get threads more portable */
#define DONT_REMAP_PTHREAD_FUNCTIONS
+
#include "mysys_priv.h"
#ifdef THREAD
#include <signal.h>
@@ -372,16 +373,32 @@ int pthread_signal(int sig, void (*func)())
sigaction(sig, &sact, (struct sigaction*) 0);
return 0;
}
-
#endif
+/****************************************************************************
+ The following functions fixes that all pthread functions should work
+ according to latest posix standard
+****************************************************************************/
+
+/* Undefined wrappers set my_pthread.h so that we call os functions */
+#undef pthread_mutex_init
+#undef pthread_mutex_lock
+#undef pthread_mutex_unlock
+#undef pthread_mutex_destroy
+#undef pthread_mutex_wait
+#undef pthread_mutex_timedwait
+#undef pthread_mutex_trylock
+#undef pthread_mutex_t
+#undef pthread_cond_init
+#undef pthread_cond_wait
+#undef pthread_cond_timedwait
+#undef pthread_cond_t
+
/*****************************************************************************
** Patches for AIX and DEC OSF/1 3.2
*****************************************************************************/
#if (defined(HAVE_NONPOSIX_PTHREAD_MUTEX_INIT) && !defined(HAVE_UNIXWARE7_THREADS)) || defined(HAVE_DEC_3_2_THREADS)
-#undef pthread_mutex_init
-#undef pthread_cond_init
#include <netdb.h>
@@ -419,33 +436,64 @@ int my_pthread_cond_init(pthread_cond_t *mp, const pthread_condattr_t *attr)
****************************************************************************/
#if defined(HPUX) || defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT)
-#undef pthread_cond_timedwait
int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
struct timespec *abstime)
{
int error=pthread_cond_timedwait(cond, mutex, abstime);
if (error == -1) /* Safety if the lib is fixed */
- error=errno;
+ {
+ if (!(error=errno))
+ error= ETIMEDOUT; /* Can happen on HPUX */
+ }
if (error == EAGAIN) /* Correct errno to Posix */
- error=ETIMEDOUT;
+ error= ETIMEDOUT;
return error;
}
#endif
-#ifdef HPUX
+#ifdef HAVE_POSIX1003_4a_MUTEX
+/*
+ In HP-UX-10.20 and other old Posix 1003.4a Draft 4 implementations
+ pthread_mutex_trylock returns 1 on success, not 0 like
+ pthread_mutex_lock
+
+ From the HP-UX-10.20 man page:
+ RETURN VALUES
+ If the function fails, errno may be set to one of the following
+ values:
+ Return | Error | Description
+ _______|__________|_________________________________________
+ 1 | | Successful completion.
+ 0 | | The mutex is locked; therefore, it was
+ | | not acquired.
+ -1 | [EINVAL] | The value specified by mutex is invalid.
+
+*/
+
+/*
+ Convert pthread_mutex_trylock to return values according to latest POSIX
+
+ RETURN VALUES
+ 0 If we are able successfully lock the mutex.
+ EBUSY Mutex was locked by another thread
+ # Other error number returned by pthread_mutex_trylock()
+ (Not likely)
+*/
+
int my_pthread_mutex_trylock(pthread_mutex_t *mutex)
{
- int error=pthread_mutex_trylock(mutex);
- if (error == 1) /* Safety if the lib is fixed */
- return 0; /* Mutex was locked */
+ int error= pthread_mutex_trylock(mutex);
+ if (error == 1)
+ return 0; /* Got lock on mutex */
+ if (error == 0) /* Someon else is locking mutex */
+ return EBUSY;
if (error == -1) /* Safety if the lib is fixed */
- error=errno;
+ error= errno; /* Probably invalid parameter */
return error;
}
-
-#endif
+#endif /* HAVE_POSIX1003_4a_MUTEX */
/* Some help functions */
diff --git a/mysys/my_read.c b/mysys/my_read.c
index 0c8962e91a9..b7621ac99eb 100644
--- a/mysys/my_read.c
+++ b/mysys/my_read.c
@@ -19,13 +19,22 @@
#include <errno.h>
- /* Read a chunk of bytes from a file */
+/*
+ Read a chunk of bytes from a file with retry's if needed
+
+ The parameters are:
+ File descriptor
+ Buffer to hold at least Count bytes
+ Bytes to read
+ Flags on what to do on error
+
+ Return:
+ -1 on error
+ 0 if flag has bits MY_NABP or MY_FNABP set
+ N number of bytes read.
+*/
uint my_read(File Filedes, byte *Buffer, uint Count, myf MyFlags)
- /* File descriptor */
- /* Buffer must be at least count bytes */
- /* Max number of bytes returnd */
- /* Flags on what to do on error */
{
uint readbytes,save_count;
DBUG_ENTER("my_read");
diff --git a/mysys/my_semaphore.c b/mysys/my_semaphore.c
new file mode 100644
index 00000000000..2dd224cd99e
--- /dev/null
+++ b/mysys/my_semaphore.c
@@ -0,0 +1,104 @@
+/* Copyright (C) 2002 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
+ Simple implementation of semaphores, needed to compile MySQL on systems
+ that doesn't support semaphores.
+*/
+
+#include <my_global.h>
+#include <my_semaphore.h>
+#include <errno.h>
+
+#if !defined(__WIN__) && !defined(HAVE_SEMAPHORE_H)
+
+int sem_init(sem_t * sem, int pshared, uint value)
+{
+ sem->count=value;
+ pthread_cond_init(&sem->cond, 0);
+ pthread_mutex_init(&sem->mutex, 0);
+ return 0;
+}
+
+int sem_destroy(sem_t * sem)
+{
+ int err1,err2;
+ err1=pthread_cond_destroy(&sem->cond);
+ err2=pthread_mutex_destroy(&sem->mutex);
+ if (err1 || err2)
+ {
+ errno=err1 ? err1 : err2;
+ return -1;
+ }
+ return 0;
+}
+
+int sem_wait(sem_t * sem)
+{
+ if ((errno=pthread_mutex_lock(&sem->mutex)))
+ return -1;
+ while (!sem->count)
+ pthread_cond_wait(&sem->cond, &sem->mutex);
+ if (errno)
+ return -1;
+ sem->count--; /* mutex is locked here */
+ pthread_mutex_unlock(&sem->mutex);
+ return 0;
+}
+
+int sem_trywait(sem_t * sem)
+{
+ if ((errno=pthread_mutex_lock(&sem->mutex)))
+ return -1;
+ if (sem->count)
+ sem->count--;
+ else
+ errno=EAGAIN;
+ pthread_mutex_unlock(&sem->mutex);
+ return errno ? -1 : 0;
+}
+
+
+int sem_post(sem_t * sem)
+{
+ if ((errno=pthread_mutex_lock(&sem->mutex)))
+ return -1;
+ sem->count++;
+ pthread_mutex_unlock(&sem->mutex); /* does it really matter what to do */
+ pthread_cond_signal(&sem->cond); /* first: x_unlock or x_signal ? */
+ return 0;
+}
+
+int sem_post_multiple(sem_t * sem, uint count)
+{
+ if ((errno=pthread_mutex_lock(&sem->mutex)))
+ return -1;
+ sem->count+=count;
+ pthread_mutex_unlock(&sem->mutex); /* does it really matter what to do */
+ pthread_cond_broadcast(&sem->cond); /* first: x_unlock or x_broadcast ? */
+ return 0;
+}
+
+int sem_getvalue(sem_t * sem, uint *sval)
+{
+ if ((errno=pthread_mutex_lock(&sem->mutex)))
+ return -1;
+ *sval=sem->count;
+ pthread_mutex_unlock(&sem->mutex);
+ return 0;
+}
+
+#endif /* !defined(__WIN__) && !defined(HAVE_SEMAPHORE_H) */
diff --git a/mysys/my_static.h b/mysys/my_static.h
index 8360728b057..10b2e0fc2d2 100644
--- a/mysys/my_static.h
+++ b/mysys/my_static.h
@@ -32,16 +32,22 @@ struct st_remember {
sig_handler (*func)(int number);
};
-struct irem {
- struct remember *_pNext; /* Linked list of structures */
- struct remember *_pPrev; /* Other link */
- my_string _sFileName; /* File in which memory was new'ed */
- uint _uLineNum; /* Line number in above file */
- uint _uDataSize; /* Size requested */
-#ifdef THREAD
- pthread_t thread_id;
+/*
+ The size of the following structure MUST be dividable by 8 to not cause
+ alignment problems on some cpu's
+*/
+
+struct irem
+{
+ struct remember *_pNext; /* Linked list of structures */
+ struct remember *_pPrev; /* Other link */
+ char *_sFileName; /* File in which memory was new'ed */
+ uint32 _uLineNum; /* Line number in above file */
+ uint32 _uDataSize; /* Size requested */
+#if SIZEOF_CHARP == 8
+ long _filler; /* For alignment */
#endif
- long _lSpecialValue; /* Underrun marker value */
+ long _lSpecialValue; /* Underrun marker value */
};
struct remember {
@@ -59,14 +65,6 @@ extern const char *soundex_map;
extern USED_MEM* my_once_root_block;
extern uint my_once_extra;
-#ifdef THREAD
-/*
- These threads are exempt from safemalloc leak scrutiny unless
- PEDANTIC_SAFEMALLOC is defined
-*/
-extern pthread_t signal_th, kill_th, main_th;
-#endif
-
#ifndef HAVE_TEMPNAM
extern int _my_tempnam_used;
#endif
diff --git a/mysys/my_tempnam.c b/mysys/my_tempnam.c
index da0692b46c5..6c17aa5b165 100644
--- a/mysys/my_tempnam.c
+++ b/mysys/my_tempnam.c
@@ -109,13 +109,13 @@ my_string my_tempnam(const char *dir, const char *pfx,
old_env=(char**)environ;
if (dir)
{ /* Don't use TMPDIR if dir is given */
- environ=(const char**)temp_env; /* May give warning */
+ ((char**) environ)=(char**) temp_env;
temp_env[0]=0;
}
#endif
res=tempnam((char*) dir,(my_string) pfx); /* Use stand. dir with prefix */
#ifndef OS2
- environ=(const char**)old_env; /* May give warning */
+ ((char**) environ)=(char**) old_env;
#endif
if (!res)
DBUG_PRINT("error",("Got error: %d from tempnam",errno));
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index f62b8d5cb1a..45c10e5a7b6 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
-** Functions to handle initializating and allocationg of all mysys & debug
-** thread variables.
+ Functions to handle initializating and allocationg of all mysys & debug
+ thread variables.
*/
#include "mysys_priv.h"
@@ -44,10 +44,6 @@ pthread_mutexattr_t my_fast_mutexattr;
pthread_mutexattr_t my_errchk_mutexattr;
#endif
-/* FIXME Note. TlsAlloc does not set an auto destructor, so
- the function my_thread_global_free must be called from
- somewhere before final exit of the library */
-
my_bool my_thread_global_init(void)
{
if (pthread_key_create(&THR_KEY_mysys,free))
@@ -59,7 +55,7 @@ my_bool my_thread_global_init(void)
pthread_mutexattr_init(&my_fast_mutexattr);
pthread_mutexattr_setkind_np(&my_fast_mutexattr,PTHREAD_MUTEX_ADAPTIVE_NP);
#endif
-#ifdef PPTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
pthread_mutexattr_init(&my_errchk_mutexattr);
pthread_mutexattr_setkind_np(&my_errchk_mutexattr,
PTHREAD_MUTEX_ERRORCHECK_NP);
@@ -86,6 +82,7 @@ my_bool my_thread_global_init(void)
return my_thread_init();
}
+
void my_thread_global_end(void)
{
#if defined(USE_TLS)
@@ -126,7 +123,7 @@ my_bool my_thread_init(void)
#if !defined(__WIN__) || defined(USE_TLS)
if (my_pthread_getspecific(struct st_my_thread_var *,THR_KEY_mysys))
{
-#ifdef EXTRA_DEBUG
+#ifdef EXTRA_DEBUG_THREADS
fprintf(stderr,"my_thread_init() called more than once in thread %ld\n",
pthread_self());
#endif
@@ -158,6 +155,7 @@ end:
return error;
}
+
void my_thread_end(void)
{
struct st_my_thread_var *tmp=my_thread_var;
@@ -204,8 +202,9 @@ struct st_my_thread_var *_my_thread_var(void)
return tmp;
}
+
/****************************************************************************
-** Get name of current thread.
+ Get name of current thread.
****************************************************************************/
#define UNKNOWN_THREAD -1
diff --git a/mysys/my_winsem.c b/mysys/my_winsem.c
index 268a05a0b21..e2713d189b2 100644
--- a/mysys/my_winsem.c
+++ b/mysys/my_winsem.c
@@ -375,7 +375,7 @@ sem_post (sem_t * sem)
*/
int
-sem_post_multiple (sem_t * sem, int count )
+sem_post_multiple (sem_t * sem, unsigned int count)
{
#ifdef EXTRA_DEBUG
if (sem == NULL || *sem == NULL || count <= 0)
@@ -397,7 +397,7 @@ sem_post_multiple (sem_t * sem, int count )
}
int
-sem_getvalue (sem_t *sem, int *sval)
+sem_getvalue (sem_t *sem, unsigned int *sval)
{
errno = ENOSYS;
return -1;
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h
index ba16e8820fe..75d77ed9987 100644
--- a/mysys/mysys_priv.h
+++ b/mysys/mysys_priv.h
@@ -22,10 +22,10 @@
#endif
#ifdef THREAD
+#include <my_pthread.h>
extern pthread_mutex_t THR_LOCK_malloc,THR_LOCK_open,THR_LOCK_keycache,
THR_LOCK_lock,THR_LOCK_isam,THR_LOCK_net,THR_LOCK_charset;
extern pthread_mutex_t LOCK_bitmap;
-#else /* THREAD */
-#define pthread_mutex_lock(A)
-#define pthread_mutex_unlock(A)
+#else
+#include <my_no_pthread.h>
#endif
diff --git a/mysys/queues.c b/mysys/queues.c
index 50ef3944a3f..c458c96e998 100644
--- a/mysys/queues.c
+++ b/mysys/queues.c
@@ -173,11 +173,13 @@ static int queue_fix_cmp(QUEUE *queue, void **a, void **b)
(char*) (*b)+queue->offset_to_key);
}
-/* Fix heap when every element was changed
- actually, it can be done in linear time,
- not in n*log(n), but some code (myisam/ft_boolean_search.c)
- requires a strict order here, not just a queue property
+/*
+ Fix heap when every element was changed
+ actually, it can be done in linear time,
+ not in n*log(n), but some code (myisam/ft_boolean_search.c)
+ requires a strict order here, not just a queue property
*/
+
void queue_fix(QUEUE *queue)
{
qsort2(queue->root+1,queue->elements, sizeof(void *),
diff --git a/mysys/raid.cc b/mysys/raid.cc
index 6196e1f1aa6..d6359dc0f93 100644
--- a/mysys/raid.cc
+++ b/mysys/raid.cc
@@ -75,7 +75,7 @@
#endif
#include "mysys_priv.h"
-#include "my_dir.h"
+#include <my_dir.h>
#include <m_string.h>
#include <assert.h>
@@ -281,7 +281,7 @@ extern "C" {
DBUG_RETURN(my_close(fd, MyFlags));
}
- int my_raid_chsize(File fd, my_off_t newlength, myf MyFlags)
+ int my_raid_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
{
DBUG_ENTER("my_raid_chsize");
DBUG_PRINT("enter",("Fd: %d newlength: %u MyFlags: %d",
@@ -289,10 +289,10 @@ extern "C" {
if (is_raid(fd))
{
RaidFd *raid= (*dynamic_element(&RaidFd::_raid_map,fd,RaidFd**));
- DBUG_RETURN(raid->Chsize(fd, newlength, MyFlags));
+ DBUG_RETURN(raid->Chsize(fd, newlength, filler, MyFlags));
}
else
- DBUG_RETURN(my_chsize(fd, newlength, MyFlags));
+ DBUG_RETURN(my_chsize(fd, newlength, filler, MyFlags));
}
int my_raid_rename(const char *from, const char *to,
@@ -738,7 +738,7 @@ Tell(myf MyFlags)
}
int RaidFd::
-Chsize(File fd, my_off_t newlength, myf MyFlags)
+Chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
{
DBUG_ENTER("RaidFd::Chsize");
DBUG_PRINT("enter",("Fd: %d, newlength: %d, MyFlags: %d",
@@ -752,17 +752,16 @@ Chsize(File fd, my_off_t newlength, myf MyFlags)
if ( i < _this_block )
newpos = my_chsize(_fd_vector[i],
_this_block * _raid_chunksize + (_rounds + 1) *
- _raid_chunksize,
- MyFlags);
+ _raid_chunksize, filler, MyFlags);
else if ( i == _this_block )
newpos = my_chsize(_fd_vector[i],
_this_block * _raid_chunksize + _rounds *
_raid_chunksize + (newlength % _raid_chunksize),
- MyFlags);
+ filler, MyFlags);
else // this means: i > _this_block
newpos = my_chsize(_fd_vector[i],
_this_block * _raid_chunksize + _rounds *
- _raid_chunksize, MyFlags);
+ _raid_chunksize, filler, MyFlags);
if (newpos)
DBUG_RETURN(1);
}
diff --git a/mysys/rijndael.c b/mysys/rijndael.c
new file mode 100644
index 00000000000..dd0c45445d5
--- /dev/null
+++ b/mysys/rijndael.c
@@ -0,0 +1,1397 @@
+/* Copyright (C) 2002 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
+/*
+ Based on version 3.0 (December 2000)
+
+ Optimised ANSI C code for the Rijndael cipher (now AES)
+
+ author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
+ author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
+ author Paulo Barreto <paulo.barreto@terra.com.br>
+*/
+
+#include <my_global.h>
+#include <assert.h>
+#include "rijndael.h"
+
+/*
+ Define the following to use fastest and much larger code (~10K extra code)
+ #define FULL_UNROLL
+*/
+
+
+#ifdef NOT_USED
+Te0[x] = S [x].[02, 01, 01, 03];
+Te1[x] = S [x].[03, 02, 01, 01];
+Te2[x] = S [x].[01, 03, 02, 01];
+Te3[x] = S [x].[01, 01, 03, 02];
+Te4[x] = S [x].[01, 01, 01, 01];
+
+Td0[x] = Si[x].[0e, 09, 0d, 0b];
+Td1[x] = Si[x].[0b, 0e, 09, 0d];
+Td2[x] = Si[x].[0d, 0b, 0e, 09];
+Td3[x] = Si[x].[09, 0d, 0b, 0e];
+Td4[x] = Si[x].[01, 01, 01, 01];
+#endif
+
+
+static const uint32 Te0[256]=
+{
+ 0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
+ 0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,
+ 0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU,
+ 0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU,
+ 0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U,
+ 0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU,
+ 0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU,
+ 0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU,
+ 0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU,
+ 0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU,
+ 0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U,
+ 0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU,
+ 0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU,
+ 0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U,
+ 0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU,
+ 0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU,
+ 0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU,
+ 0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU,
+ 0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU,
+ 0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U,
+ 0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU,
+ 0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU,
+ 0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU,
+ 0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU,
+ 0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U,
+ 0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U,
+ 0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U,
+ 0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U,
+ 0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU,
+ 0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U,
+ 0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U,
+ 0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU,
+ 0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU,
+ 0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U,
+ 0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U,
+ 0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U,
+ 0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU,
+ 0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U,
+ 0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU,
+ 0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U,
+ 0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU,
+ 0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U,
+ 0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U,
+ 0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU,
+ 0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U,
+ 0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U,
+ 0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U,
+ 0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U,
+ 0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U,
+ 0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U,
+ 0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U,
+ 0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U,
+ 0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU,
+ 0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U,
+ 0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U,
+ 0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U,
+ 0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U,
+ 0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U,
+ 0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U,
+ 0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU,
+ 0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U,
+ 0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U,
+ 0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U,
+ 0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU,
+};
+
+static const uint32 Te1[256]=
+{
+ 0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU,
+ 0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U,
+ 0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU,
+ 0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U,
+ 0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU,
+ 0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U,
+ 0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU,
+ 0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U,
+ 0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U,
+ 0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU,
+ 0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U,
+ 0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U,
+ 0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U,
+ 0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU,
+ 0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U,
+ 0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U,
+ 0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU,
+ 0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U,
+ 0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U,
+ 0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U,
+ 0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU,
+ 0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU,
+ 0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U,
+ 0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU,
+ 0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU,
+ 0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U,
+ 0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU,
+ 0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U,
+ 0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU,
+ 0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U,
+ 0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U,
+ 0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U,
+ 0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU,
+ 0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U,
+ 0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU,
+ 0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U,
+ 0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU,
+ 0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U,
+ 0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U,
+ 0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU,
+ 0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU,
+ 0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU,
+ 0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U,
+ 0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U,
+ 0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU,
+ 0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U,
+ 0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU,
+ 0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U,
+ 0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU,
+ 0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U,
+ 0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU,
+ 0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU,
+ 0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U,
+ 0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU,
+ 0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U,
+ 0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU,
+ 0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U,
+ 0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U,
+ 0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U,
+ 0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU,
+ 0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU,
+ 0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U,
+ 0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU,
+ 0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U,
+};
+
+static const uint32 Te2[256]=
+{
+ 0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU,
+ 0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U,
+ 0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU,
+ 0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U,
+ 0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU,
+ 0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U,
+ 0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU,
+ 0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U,
+ 0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U,
+ 0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU,
+ 0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U,
+ 0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U,
+ 0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U,
+ 0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU,
+ 0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U,
+ 0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U,
+ 0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU,
+ 0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U,
+ 0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U,
+ 0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U,
+ 0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU,
+ 0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU,
+ 0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U,
+ 0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU,
+ 0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU,
+ 0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U,
+ 0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU,
+ 0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U,
+ 0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU,
+ 0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U,
+ 0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U,
+ 0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U,
+ 0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU,
+ 0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U,
+ 0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU,
+ 0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U,
+ 0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU,
+ 0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U,
+ 0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U,
+ 0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU,
+ 0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU,
+ 0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU,
+ 0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U,
+ 0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U,
+ 0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU,
+ 0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U,
+ 0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU,
+ 0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U,
+ 0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU,
+ 0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U,
+ 0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU,
+ 0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU,
+ 0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U,
+ 0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU,
+ 0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U,
+ 0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU,
+ 0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U,
+ 0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U,
+ 0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U,
+ 0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU,
+ 0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU,
+ 0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U,
+ 0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU,
+ 0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U,
+};
+
+static const uint32 Te3[256]=
+{
+ 0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U,
+ 0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U,
+ 0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U,
+ 0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU,
+ 0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU,
+ 0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU,
+ 0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U,
+ 0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU,
+ 0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU,
+ 0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U,
+ 0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U,
+ 0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU,
+ 0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU,
+ 0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU,
+ 0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU,
+ 0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU,
+ 0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U,
+ 0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU,
+ 0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU,
+ 0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U,
+ 0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U,
+ 0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U,
+ 0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U,
+ 0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U,
+ 0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU,
+ 0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U,
+ 0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU,
+ 0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU,
+ 0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U,
+ 0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U,
+ 0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U,
+ 0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU,
+ 0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U,
+ 0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU,
+ 0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU,
+ 0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U,
+ 0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U,
+ 0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU,
+ 0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U,
+ 0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU,
+ 0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U,
+ 0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U,
+ 0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U,
+ 0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U,
+ 0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU,
+ 0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U,
+ 0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU,
+ 0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U,
+ 0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU,
+ 0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U,
+ 0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU,
+ 0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU,
+ 0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU,
+ 0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU,
+ 0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U,
+ 0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U,
+ 0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U,
+ 0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U,
+ 0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U,
+ 0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U,
+ 0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU,
+ 0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U,
+ 0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU,
+ 0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU,
+};
+
+static const uint32 Te4[256]=
+{
+ 0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU,
+ 0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U,
+ 0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU,
+ 0xfefefefeU, 0xd7d7d7d7U, 0xababababU, 0x76767676U,
+ 0xcacacacaU, 0x82828282U, 0xc9c9c9c9U, 0x7d7d7d7dU,
+ 0xfafafafaU, 0x59595959U, 0x47474747U, 0xf0f0f0f0U,
+ 0xadadadadU, 0xd4d4d4d4U, 0xa2a2a2a2U, 0xafafafafU,
+ 0x9c9c9c9cU, 0xa4a4a4a4U, 0x72727272U, 0xc0c0c0c0U,
+ 0xb7b7b7b7U, 0xfdfdfdfdU, 0x93939393U, 0x26262626U,
+ 0x36363636U, 0x3f3f3f3fU, 0xf7f7f7f7U, 0xccccccccU,
+ 0x34343434U, 0xa5a5a5a5U, 0xe5e5e5e5U, 0xf1f1f1f1U,
+ 0x71717171U, 0xd8d8d8d8U, 0x31313131U, 0x15151515U,
+ 0x04040404U, 0xc7c7c7c7U, 0x23232323U, 0xc3c3c3c3U,
+ 0x18181818U, 0x96969696U, 0x05050505U, 0x9a9a9a9aU,
+ 0x07070707U, 0x12121212U, 0x80808080U, 0xe2e2e2e2U,
+ 0xebebebebU, 0x27272727U, 0xb2b2b2b2U, 0x75757575U,
+ 0x09090909U, 0x83838383U, 0x2c2c2c2cU, 0x1a1a1a1aU,
+ 0x1b1b1b1bU, 0x6e6e6e6eU, 0x5a5a5a5aU, 0xa0a0a0a0U,
+ 0x52525252U, 0x3b3b3b3bU, 0xd6d6d6d6U, 0xb3b3b3b3U,
+ 0x29292929U, 0xe3e3e3e3U, 0x2f2f2f2fU, 0x84848484U,
+ 0x53535353U, 0xd1d1d1d1U, 0x00000000U, 0xededededU,
+ 0x20202020U, 0xfcfcfcfcU, 0xb1b1b1b1U, 0x5b5b5b5bU,
+ 0x6a6a6a6aU, 0xcbcbcbcbU, 0xbebebebeU, 0x39393939U,
+ 0x4a4a4a4aU, 0x4c4c4c4cU, 0x58585858U, 0xcfcfcfcfU,
+ 0xd0d0d0d0U, 0xefefefefU, 0xaaaaaaaaU, 0xfbfbfbfbU,
+ 0x43434343U, 0x4d4d4d4dU, 0x33333333U, 0x85858585U,
+ 0x45454545U, 0xf9f9f9f9U, 0x02020202U, 0x7f7f7f7fU,
+ 0x50505050U, 0x3c3c3c3cU, 0x9f9f9f9fU, 0xa8a8a8a8U,
+ 0x51515151U, 0xa3a3a3a3U, 0x40404040U, 0x8f8f8f8fU,
+ 0x92929292U, 0x9d9d9d9dU, 0x38383838U, 0xf5f5f5f5U,
+ 0xbcbcbcbcU, 0xb6b6b6b6U, 0xdadadadaU, 0x21212121U,
+ 0x10101010U, 0xffffffffU, 0xf3f3f3f3U, 0xd2d2d2d2U,
+ 0xcdcdcdcdU, 0x0c0c0c0cU, 0x13131313U, 0xececececU,
+ 0x5f5f5f5fU, 0x97979797U, 0x44444444U, 0x17171717U,
+ 0xc4c4c4c4U, 0xa7a7a7a7U, 0x7e7e7e7eU, 0x3d3d3d3dU,
+ 0x64646464U, 0x5d5d5d5dU, 0x19191919U, 0x73737373U,
+ 0x60606060U, 0x81818181U, 0x4f4f4f4fU, 0xdcdcdcdcU,
+ 0x22222222U, 0x2a2a2a2aU, 0x90909090U, 0x88888888U,
+ 0x46464646U, 0xeeeeeeeeU, 0xb8b8b8b8U, 0x14141414U,
+ 0xdedededeU, 0x5e5e5e5eU, 0x0b0b0b0bU, 0xdbdbdbdbU,
+ 0xe0e0e0e0U, 0x32323232U, 0x3a3a3a3aU, 0x0a0a0a0aU,
+ 0x49494949U, 0x06060606U, 0x24242424U, 0x5c5c5c5cU,
+ 0xc2c2c2c2U, 0xd3d3d3d3U, 0xacacacacU, 0x62626262U,
+ 0x91919191U, 0x95959595U, 0xe4e4e4e4U, 0x79797979U,
+ 0xe7e7e7e7U, 0xc8c8c8c8U, 0x37373737U, 0x6d6d6d6dU,
+ 0x8d8d8d8dU, 0xd5d5d5d5U, 0x4e4e4e4eU, 0xa9a9a9a9U,
+ 0x6c6c6c6cU, 0x56565656U, 0xf4f4f4f4U, 0xeaeaeaeaU,
+ 0x65656565U, 0x7a7a7a7aU, 0xaeaeaeaeU, 0x08080808U,
+ 0xbabababaU, 0x78787878U, 0x25252525U, 0x2e2e2e2eU,
+ 0x1c1c1c1cU, 0xa6a6a6a6U, 0xb4b4b4b4U, 0xc6c6c6c6U,
+ 0xe8e8e8e8U, 0xddddddddU, 0x74747474U, 0x1f1f1f1fU,
+ 0x4b4b4b4bU, 0xbdbdbdbdU, 0x8b8b8b8bU, 0x8a8a8a8aU,
+ 0x70707070U, 0x3e3e3e3eU, 0xb5b5b5b5U, 0x66666666U,
+ 0x48484848U, 0x03030303U, 0xf6f6f6f6U, 0x0e0e0e0eU,
+ 0x61616161U, 0x35353535U, 0x57575757U, 0xb9b9b9b9U,
+ 0x86868686U, 0xc1c1c1c1U, 0x1d1d1d1dU, 0x9e9e9e9eU,
+ 0xe1e1e1e1U, 0xf8f8f8f8U, 0x98989898U, 0x11111111U,
+ 0x69696969U, 0xd9d9d9d9U, 0x8e8e8e8eU, 0x94949494U,
+ 0x9b9b9b9bU, 0x1e1e1e1eU, 0x87878787U, 0xe9e9e9e9U,
+ 0xcecececeU, 0x55555555U, 0x28282828U, 0xdfdfdfdfU,
+ 0x8c8c8c8cU, 0xa1a1a1a1U, 0x89898989U, 0x0d0d0d0dU,
+ 0xbfbfbfbfU, 0xe6e6e6e6U, 0x42424242U, 0x68686868U,
+ 0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU,
+ 0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U,
+};
+
+static const uint32 Td0[256]=
+{
+ 0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
+ 0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,
+ 0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U,
+ 0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU,
+ 0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U,
+ 0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U,
+ 0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU,
+ 0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U,
+ 0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU,
+ 0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U,
+ 0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U,
+ 0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U,
+ 0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U,
+ 0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU,
+ 0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U,
+ 0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU,
+ 0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U,
+ 0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU,
+ 0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U,
+ 0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U,
+ 0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U,
+ 0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU,
+ 0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U,
+ 0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU,
+ 0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U,
+ 0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU,
+ 0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U,
+ 0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU,
+ 0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU,
+ 0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U,
+ 0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU,
+ 0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U,
+ 0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU,
+ 0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U,
+ 0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U,
+ 0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U,
+ 0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU,
+ 0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U,
+ 0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U,
+ 0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU,
+ 0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U,
+ 0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U,
+ 0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U,
+ 0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U,
+ 0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U,
+ 0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU,
+ 0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U,
+ 0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U,
+ 0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U,
+ 0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U,
+ 0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U,
+ 0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU,
+ 0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU,
+ 0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU,
+ 0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU,
+ 0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U,
+ 0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U,
+ 0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU,
+ 0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU,
+ 0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U,
+ 0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU,
+ 0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U,
+ 0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U,
+ 0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U,
+};
+
+static const uint32 Td1[256]=
+{
+ 0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU,
+ 0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U,
+ 0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU,
+ 0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U,
+ 0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U,
+ 0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U,
+ 0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U,
+ 0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U,
+ 0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U,
+ 0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU,
+ 0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU,
+ 0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU,
+ 0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U,
+ 0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU,
+ 0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U,
+ 0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U,
+ 0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U,
+ 0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU,
+ 0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU,
+ 0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U,
+ 0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU,
+ 0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U,
+ 0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU,
+ 0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU,
+ 0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U,
+ 0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U,
+ 0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U,
+ 0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU,
+ 0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U,
+ 0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU,
+ 0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U,
+ 0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U,
+ 0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U,
+ 0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU,
+ 0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U,
+ 0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U,
+ 0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U,
+ 0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U,
+ 0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U,
+ 0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U,
+ 0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU,
+ 0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU,
+ 0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U,
+ 0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU,
+ 0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U,
+ 0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU,
+ 0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU,
+ 0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U,
+ 0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU,
+ 0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U,
+ 0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U,
+ 0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U,
+ 0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U,
+ 0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U,
+ 0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U,
+ 0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U,
+ 0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU,
+ 0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U,
+ 0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U,
+ 0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU,
+ 0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U,
+ 0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U,
+ 0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U,
+ 0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U,
+};
+
+static const uint32 Td2[256]=
+{
+ 0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U,
+ 0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U,
+ 0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U,
+ 0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U,
+ 0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU,
+ 0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U,
+ 0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U,
+ 0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U,
+ 0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U,
+ 0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU,
+ 0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U,
+ 0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U,
+ 0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU,
+ 0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U,
+ 0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U,
+ 0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U,
+ 0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U,
+ 0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U,
+ 0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U,
+ 0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU,
+
+ 0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U,
+ 0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U,
+ 0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U,
+ 0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U,
+ 0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U,
+ 0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU,
+ 0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU,
+ 0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U,
+ 0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU,
+ 0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U,
+ 0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU,
+ 0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU,
+ 0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU,
+ 0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU,
+ 0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U,
+ 0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U,
+ 0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U,
+ 0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U,
+ 0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U,
+ 0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U,
+ 0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U,
+ 0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU,
+ 0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU,
+ 0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U,
+ 0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U,
+ 0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU,
+ 0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU,
+ 0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U,
+ 0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U,
+ 0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U,
+ 0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U,
+ 0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U,
+ 0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U,
+ 0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U,
+ 0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU,
+ 0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U,
+ 0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U,
+ 0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U,
+ 0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U,
+ 0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U,
+ 0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U,
+ 0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU,
+ 0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U,
+ 0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U,
+};
+
+static const uint32 Td3[256]=
+{
+ 0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU,
+ 0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU,
+ 0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U,
+ 0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U,
+ 0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU,
+ 0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU,
+ 0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U,
+ 0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU,
+ 0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U,
+ 0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU,
+ 0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U,
+ 0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U,
+ 0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U,
+ 0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U,
+ 0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U,
+ 0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU,
+ 0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU,
+ 0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U,
+ 0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U,
+ 0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU,
+ 0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU,
+ 0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U,
+ 0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U,
+ 0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U,
+ 0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U,
+ 0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU,
+ 0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U,
+ 0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U,
+ 0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU,
+ 0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU,
+ 0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U,
+ 0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U,
+ 0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U,
+ 0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU,
+ 0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U,
+ 0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U,
+ 0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U,
+ 0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U,
+ 0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U,
+ 0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U,
+ 0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U,
+ 0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU,
+ 0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U,
+ 0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U,
+ 0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU,
+ 0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU,
+ 0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U,
+ 0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU,
+ 0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U,
+ 0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U,
+ 0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U,
+ 0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U,
+ 0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U,
+ 0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U,
+ 0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU,
+ 0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU,
+ 0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU,
+ 0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU,
+ 0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U,
+ 0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U,
+ 0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U,
+ 0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU,
+ 0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,
+ 0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
+};
+
+static const uint32 Td4[256]=
+{
+ 0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U,
+ 0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U,
+ 0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU,
+ 0x81818181U, 0xf3f3f3f3U, 0xd7d7d7d7U, 0xfbfbfbfbU,
+ 0x7c7c7c7cU, 0xe3e3e3e3U, 0x39393939U, 0x82828282U,
+ 0x9b9b9b9bU, 0x2f2f2f2fU, 0xffffffffU, 0x87878787U,
+ 0x34343434U, 0x8e8e8e8eU, 0x43434343U, 0x44444444U,
+ 0xc4c4c4c4U, 0xdedededeU, 0xe9e9e9e9U, 0xcbcbcbcbU,
+ 0x54545454U, 0x7b7b7b7bU, 0x94949494U, 0x32323232U,
+ 0xa6a6a6a6U, 0xc2c2c2c2U, 0x23232323U, 0x3d3d3d3dU,
+ 0xeeeeeeeeU, 0x4c4c4c4cU, 0x95959595U, 0x0b0b0b0bU,
+ 0x42424242U, 0xfafafafaU, 0xc3c3c3c3U, 0x4e4e4e4eU,
+ 0x08080808U, 0x2e2e2e2eU, 0xa1a1a1a1U, 0x66666666U,
+ 0x28282828U, 0xd9d9d9d9U, 0x24242424U, 0xb2b2b2b2U,
+ 0x76767676U, 0x5b5b5b5bU, 0xa2a2a2a2U, 0x49494949U,
+ 0x6d6d6d6dU, 0x8b8b8b8bU, 0xd1d1d1d1U, 0x25252525U,
+ 0x72727272U, 0xf8f8f8f8U, 0xf6f6f6f6U, 0x64646464U,
+ 0x86868686U, 0x68686868U, 0x98989898U, 0x16161616U,
+ 0xd4d4d4d4U, 0xa4a4a4a4U, 0x5c5c5c5cU, 0xccccccccU,
+ 0x5d5d5d5dU, 0x65656565U, 0xb6b6b6b6U, 0x92929292U,
+ 0x6c6c6c6cU, 0x70707070U, 0x48484848U, 0x50505050U,
+ 0xfdfdfdfdU, 0xededededU, 0xb9b9b9b9U, 0xdadadadaU,
+ 0x5e5e5e5eU, 0x15151515U, 0x46464646U, 0x57575757U,
+ 0xa7a7a7a7U, 0x8d8d8d8dU, 0x9d9d9d9dU, 0x84848484U,
+ 0x90909090U, 0xd8d8d8d8U, 0xababababU, 0x00000000U,
+ 0x8c8c8c8cU, 0xbcbcbcbcU, 0xd3d3d3d3U, 0x0a0a0a0aU,
+ 0xf7f7f7f7U, 0xe4e4e4e4U, 0x58585858U, 0x05050505U,
+ 0xb8b8b8b8U, 0xb3b3b3b3U, 0x45454545U, 0x06060606U,
+ 0xd0d0d0d0U, 0x2c2c2c2cU, 0x1e1e1e1eU, 0x8f8f8f8fU,
+ 0xcacacacaU, 0x3f3f3f3fU, 0x0f0f0f0fU, 0x02020202U,
+ 0xc1c1c1c1U, 0xafafafafU, 0xbdbdbdbdU, 0x03030303U,
+ 0x01010101U, 0x13131313U, 0x8a8a8a8aU, 0x6b6b6b6bU,
+ 0x3a3a3a3aU, 0x91919191U, 0x11111111U, 0x41414141U,
+ 0x4f4f4f4fU, 0x67676767U, 0xdcdcdcdcU, 0xeaeaeaeaU,
+ 0x97979797U, 0xf2f2f2f2U, 0xcfcfcfcfU, 0xcecececeU,
+ 0xf0f0f0f0U, 0xb4b4b4b4U, 0xe6e6e6e6U, 0x73737373U,
+ 0x96969696U, 0xacacacacU, 0x74747474U, 0x22222222U,
+ 0xe7e7e7e7U, 0xadadadadU, 0x35353535U, 0x85858585U,
+ 0xe2e2e2e2U, 0xf9f9f9f9U, 0x37373737U, 0xe8e8e8e8U,
+ 0x1c1c1c1cU, 0x75757575U, 0xdfdfdfdfU, 0x6e6e6e6eU,
+ 0x47474747U, 0xf1f1f1f1U, 0x1a1a1a1aU, 0x71717171U,
+ 0x1d1d1d1dU, 0x29292929U, 0xc5c5c5c5U, 0x89898989U,
+ 0x6f6f6f6fU, 0xb7b7b7b7U, 0x62626262U, 0x0e0e0e0eU,
+ 0xaaaaaaaaU, 0x18181818U, 0xbebebebeU, 0x1b1b1b1bU,
+ 0xfcfcfcfcU, 0x56565656U, 0x3e3e3e3eU, 0x4b4b4b4bU,
+ 0xc6c6c6c6U, 0xd2d2d2d2U, 0x79797979U, 0x20202020U,
+ 0x9a9a9a9aU, 0xdbdbdbdbU, 0xc0c0c0c0U, 0xfefefefeU,
+ 0x78787878U, 0xcdcdcdcdU, 0x5a5a5a5aU, 0xf4f4f4f4U,
+ 0x1f1f1f1fU, 0xddddddddU, 0xa8a8a8a8U, 0x33333333U,
+ 0x88888888U, 0x07070707U, 0xc7c7c7c7U, 0x31313131U,
+ 0xb1b1b1b1U, 0x12121212U, 0x10101010U, 0x59595959U,
+ 0x27272727U, 0x80808080U, 0xececececU, 0x5f5f5f5fU,
+ 0x60606060U, 0x51515151U, 0x7f7f7f7fU, 0xa9a9a9a9U,
+ 0x19191919U, 0xb5b5b5b5U, 0x4a4a4a4aU, 0x0d0d0d0dU,
+ 0x2d2d2d2dU, 0xe5e5e5e5U, 0x7a7a7a7aU, 0x9f9f9f9fU,
+ 0x93939393U, 0xc9c9c9c9U, 0x9c9c9c9cU, 0xefefefefU,
+ 0xa0a0a0a0U, 0xe0e0e0e0U, 0x3b3b3b3bU, 0x4d4d4d4dU,
+ 0xaeaeaeaeU, 0x2a2a2a2aU, 0xf5f5f5f5U, 0xb0b0b0b0U,
+ 0xc8c8c8c8U, 0xebebebebU, 0xbbbbbbbbU, 0x3c3c3c3cU,
+ 0x83838383U, 0x53535353U, 0x99999999U, 0x61616161U,
+ 0x17171717U, 0x2b2b2b2bU, 0x04040404U, 0x7e7e7e7eU,
+ 0xbabababaU, 0x77777777U, 0xd6d6d6d6U, 0x26262626U,
+ 0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U,
+ 0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU,
+};
+
+
+/* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
+static const uint32 rcon[]=
+{
+ 0x01000000, 0x02000000, 0x04000000, 0x08000000,
+ 0x10000000, 0x20000000, 0x40000000, 0x80000000,
+ 0x1B000000, 0x36000000,
+};
+
+#if defined(_MSC_VER) && defined(__i386__)
+
+#define RJ_SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00)
+#define GETuint32(p) RJ_SWAP(*((uint32 *)(p)))
+#define PUTuint32(ct, st) { *((uint32 *)(ct)) = RJ_SWAP((st)); }
+
+#else
+
+#define GETuint32(pt) (((uint32)(pt)[0] << 24) ^ ((uint32)(pt)[1] << 16)\
+ ^ ((uint32)(pt)[2] << 8) ^ ((uint32)(pt)[3]))
+#define PUTuint32(ct, st) { (ct)[0] = (uint8)((st) >> 24); (ct)[1]\
+= (uint8)((st) >> 16); (ct)[2] = (uint8)((st) >> 8); (ct)[3] = (uint8)(st); }
+
+#endif /* defined(_MSC_VER) && defined(__i386__) */
+
+
+/*
+ Expand the cipher key into the encryption key schedule.
+
+ RETURN
+ The number of rounds for the given cipher key size.
+*/
+
+int rijndaelKeySetupEnc(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[],
+ int keyBits)
+{
+ int i = 0;
+ uint32 temp;
+
+ rk[0] = GETuint32(cipherKey );
+ rk[1] = GETuint32(cipherKey + 4);
+ rk[2] = GETuint32(cipherKey + 8);
+ rk[3] = GETuint32(cipherKey + 12);
+ if (keyBits == 128)
+ {
+ for (;;)
+ {
+ temp = rk[3];
+ rk[4] = (rk[0] ^
+ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^
+ (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^
+ (Te4[(temp ) & 0xff] & 0x0000ff00) ^
+ (Te4[(temp >> 24) ] & 0x000000ff) ^
+ rcon[i]);
+ rk[5] = rk[1] ^ rk[4];
+ rk[6] = rk[2] ^ rk[5];
+ rk[7] = rk[3] ^ rk[6];
+ if (++i == 10)
+ return 10;
+ rk += 4;
+ }
+ }
+ rk[4] = GETuint32(cipherKey + 16);
+ rk[5] = GETuint32(cipherKey + 20);
+ if (keyBits == 192)
+ {
+ for (;;)
+ {
+ temp = rk[ 5];
+ rk[ 6] = (rk[ 0] ^
+ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^
+ (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^
+ (Te4[(temp ) & 0xff] & 0x0000ff00) ^
+ (Te4[(temp >> 24) ] & 0x000000ff) ^
+ rcon[i]);
+ rk[ 7] = rk[ 1] ^ rk[ 6];
+ rk[ 8] = rk[ 2] ^ rk[ 7];
+ rk[ 9] = rk[ 3] ^ rk[ 8];
+ if (++i == 8)
+ {
+ return 12;
+ }
+ rk[10] = rk[ 4] ^ rk[ 9];
+ rk[11] = rk[ 5] ^ rk[10];
+ rk += 6;
+ }
+ }
+ rk[6] = GETuint32(cipherKey + 24);
+ rk[7] = GETuint32(cipherKey + 28);
+ if (keyBits == 256)
+ {
+ for (;;)
+ {
+ temp = rk[ 7];
+ rk[ 8] = (rk[ 0] ^
+ (Te4[(temp >> 16) & 0xff] & 0xff000000) ^
+ (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^
+ (Te4[(temp ) & 0xff] & 0x0000ff00) ^
+ (Te4[(temp >> 24) ] & 0x000000ff) ^
+ rcon[i]);
+ rk[ 9] = rk[ 1] ^ rk[ 8];
+ rk[10] = rk[ 2] ^ rk[ 9];
+ rk[11] = rk[ 3] ^ rk[10];
+ if (++i == 7)
+ {
+ return 14;
+ }
+ temp = rk[11];
+ rk[12] = (rk[ 4] ^
+ (Te4[(temp >> 24) ] & 0xff000000) ^
+ (Te4[(temp >> 16) & 0xff] & 0x00ff0000) ^
+ (Te4[(temp >> 8) & 0xff] & 0x0000ff00) ^
+ (Te4[(temp ) & 0xff] & 0x000000ff));
+ rk[13] = rk[ 5] ^ rk[12];
+ rk[14] = rk[ 6] ^ rk[13];
+ rk[15] = rk[ 7] ^ rk[14];
+ rk += 8;
+ }
+ }
+ return 0;
+}
+
+
+/*
+ Expand the cipher key into the decryption key schedule.
+
+ RETURN
+ The number of rounds for the given cipher key size.
+*/
+
+int rijndaelKeySetupDec(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[],
+ int keyBits)
+{
+ int nr, i, j;
+ uint32 temp;
+
+ /* expand the cipher key: */
+ nr = rijndaelKeySetupEnc(rk, cipherKey, keyBits);
+ /* invert the order of the round keys: */
+ for (i = 0, j = 4*nr; i < j; i += 4, j -= 4)
+ {
+ temp = rk[i ]; rk[i ] = rk[j ]; rk[j ] = temp;
+ temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp;
+ temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp;
+ temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp;
+ }
+ /*
+ Apply the inverse MixColumn transform to all round keys but the first
+ and the last:
+ */
+ for (i = 1; i < nr; i++)
+ {
+ rk += 4;
+
+ rk[0]= (
+ Td0[Te4[(rk[0] >> 24) ] & 0xff] ^
+ Td1[Te4[(rk[0] >> 16) & 0xff] & 0xff] ^
+ Td2[Te4[(rk[0] >> 8) & 0xff] & 0xff] ^
+ Td3[Te4[(rk[0] ) & 0xff] & 0xff]);
+
+ rk[1]= (Td0[Te4[(rk[1] >> 24) ] & 0xff] ^
+ Td1[Te4[(rk[1] >> 16) & 0xff] & 0xff] ^
+ Td2[Te4[(rk[1] >> 8) & 0xff] & 0xff] ^
+ Td3[Te4[(rk[1] ) & 0xff] & 0xff]);
+
+ rk[2]= (Td0[Te4[(rk[2] >> 24) ] & 0xff] ^
+ Td1[Te4[(rk[2] >> 16) & 0xff] & 0xff] ^
+ Td2[Te4[(rk[2] >> 8) & 0xff] & 0xff] ^
+ Td3[Te4[(rk[2] ) & 0xff] & 0xff]);
+
+ rk[3]= (Td0[Te4[(rk[3] >> 24) ] & 0xff] ^
+ Td1[Te4[(rk[3] >> 16) & 0xff] & 0xff] ^
+ Td2[Te4[(rk[3] >> 8) & 0xff] & 0xff] ^
+ Td3[Te4[(rk[3] ) & 0xff] & 0xff]);
+ }
+ return nr;
+}
+
+
+void rijndaelEncrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr,
+ const uint8 pt[16], uint8 ct[16])
+{
+ uint32 s0, s1, s2, s3, t0, t1, t2, t3;
+#ifndef FULL_UNROLL
+ int r;
+#endif /* FULL_UNROLL */
+
+ /* map byte array block to cipher state and add initial round key: */
+ s0 = GETuint32(pt ) ^ rk[0];
+ s1 = GETuint32(pt + 4) ^ rk[1];
+ s2 = GETuint32(pt + 8) ^ rk[2];
+ s3 = GETuint32(pt + 12) ^ rk[3];
+
+#ifdef FULL_UNROLL
+ /* round 1: */
+ t0= (Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff]
+ ^ Te3[s3 & 0xff] ^ rk[ 4]);
+ t1= (Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff]
+ ^ Te3[s0 & 0xff] ^ rk[ 5]);
+ t2= (Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff]
+ ^ Te3[s1 & 0xff] ^ rk[ 6]);
+ t3= (Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff]
+ ^ Te3[s2 & 0xff] ^ rk[ 7]);
+
+ /* round 2: */
+ s0= (Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff]
+ ^ Te3[t3 & 0xff] ^ rk[ 8]);
+ s1= (Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff]
+ ^ Te3[t0 & 0xff] ^ rk[ 9]);
+ s2= (Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff]
+ ^ Te3[t1 & 0xff] ^ rk[10]);
+ s3= (Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff]
+ ^ Te3[t2 & 0xff] ^ rk[11]);
+
+ /* round 3: */
+ t0= (Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff]
+ ^ Te3[s3 & 0xff] ^ rk[12]);
+ t1= (Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff]
+ ^ Te3[s0 & 0xff] ^ rk[13]);
+ t2= (Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff]
+ ^ Te3[s1 & 0xff] ^ rk[14]);
+ t3= (Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff]
+ ^ Te3[s2 & 0xff] ^ rk[15]);
+
+ /* round 4: */
+ s0= (Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff]
+ ^ Te3[t3 & 0xff] ^ rk[16]);
+ s1= (Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff]
+ ^ Te3[t0 & 0xff] ^ rk[17]);
+ s2= (Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff]
+ ^ Te3[t1 & 0xff] ^ rk[18]);
+ s3= (Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff]
+ ^ Te3[t2 & 0xff] ^ rk[19]);
+
+ /* round 5: */
+ t0= (Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff]
+ ^ Te3[s3 & 0xff] ^ rk[20]);
+ t1= (Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff]
+ ^ Te3[s0 & 0xff] ^ rk[21]);
+ t2= (Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff]
+ ^ Te3[s1 & 0xff] ^ rk[22]);
+ t3= (Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff]
+ ^ Te3[s2 & 0xff] ^ rk[23]);
+
+ /* round 6: */
+ s0= (Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff]
+ ^ Te3[t3 & 0xff] ^ rk[24]);
+ s1= (Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff]
+ ^ Te3[t0 & 0xff] ^ rk[25]);
+ s2= (Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff]
+ ^ Te3[t1 & 0xff] ^ rk[26]);
+ s3= (Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff]
+ ^ Te3[t2 & 0xff] ^ rk[27]);
+
+ /* round 7: */
+ t0= (Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff]
+ ^ Te3[s3 & 0xff] ^ rk[28]);
+ t1= (Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff]
+ ^ Te3[s0 & 0xff] ^ rk[29]);
+ t2= (Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff]
+ ^ Te3[s1 & 0xff] ^ rk[30]);
+ t3= (Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff]
+ ^ Te3[s2 & 0xff] ^ rk[31]);
+
+ /* round 8: */
+ s0= (Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff]
+ ^ Te3[t3 & 0xff] ^ rk[32]);
+ s1= (Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff]
+ ^ Te3[t0 & 0xff] ^ rk[33]);
+ s2= (Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff]
+ ^ Te3[t1 & 0xff] ^ rk[34]);
+ s3= (Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff]
+ ^ Te3[t2 & 0xff] ^ rk[35]);
+
+ /* round 9: */
+ t0= (Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff]
+ ^ Te3[s3 & 0xff] ^ rk[36]);
+ t1= (Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff]
+ ^ Te3[s0 & 0xff] ^ rk[37]);
+ t2= (Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff]
+ ^ Te3[s1 & 0xff] ^ rk[38]);
+ t3= (Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff]
+ ^ Te3[s2 & 0xff] ^ rk[39]);
+
+ if (Nr > 10)
+ {
+ /* round 10: */
+ s0= (Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff]
+ ^ Te3[t3 & 0xff] ^ rk[40]);
+ s1= (Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff]
+ ^ Te3[t0 & 0xff] ^ rk[41]);
+ s2= (Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff]
+ ^ Te3[t1 & 0xff] ^ rk[42]);
+ s3= (Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff]
+ ^ Te3[t2 & 0xff] ^ rk[43]);
+
+ /* round 11: */
+ t0= (Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff]
+ ^ Te3[s3 & 0xff] ^ rk[44]);
+ t1= (Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff]
+ ^ Te3[s0 & 0xff] ^ rk[45]);
+ t2= (Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff]
+ ^ Te3[s1 & 0xff] ^ rk[46]);
+ t3= (Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff]
+ ^ Te3[s2 & 0xff] ^ rk[47]);
+
+ if (Nr > 12)
+ {
+ /* round 12: */
+ s0= (Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff]
+ ^ Te3[t3 & 0xff] ^ rk[48]);
+ s1= (Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff]
+ ^ Te3[t0 & 0xff] ^ rk[49]);
+ s2= (Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff]
+ ^ Te3[t1 & 0xff] ^ rk[50]);
+ s3= (Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff]
+ ^ Te3[t2 & 0xff] ^ rk[51]);
+
+ /* round 13: */
+ t0= (Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff]
+ ^ Te3[s3 & 0xff] ^ rk[52]);
+ t1= (Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff]
+ ^ Te3[s0 & 0xff] ^ rk[53]);
+ t2= (Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff]
+ ^ Te3[s1 & 0xff] ^ rk[54]);
+ t3= (Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff]
+ ^ Te3[s2 & 0xff] ^ rk[55]);
+ }
+ }
+ rk += Nr << 2;
+#else /* !FULL_UNROLL */
+
+ /* Nr - 1 full rounds: */
+
+ r = Nr >> 1;
+ for (;;)
+ {
+ t0= (Te0[(s0 >> 24) ] ^
+ Te1[(s1 >> 16) & 0xff] ^
+ Te2[(s2 >> 8) & 0xff] ^
+ Te3[(s3 ) & 0xff] ^
+ rk[4]);
+
+ t1= (Te0[(s1 >> 24) ] ^
+ Te1[(s2 >> 16) & 0xff] ^
+ Te2[(s3 >> 8) & 0xff] ^
+ Te3[(s0 ) & 0xff] ^
+ rk[5]);
+
+ t2= (Te0[(s2 >> 24) ] ^
+ Te1[(s3 >> 16) & 0xff] ^
+ Te2[(s0 >> 8) & 0xff] ^
+ Te3[(s1 ) & 0xff] ^
+ rk[6]);
+
+ t3= (Te0[(s3 >> 24) ] ^
+ Te1[(s0 >> 16) & 0xff] ^
+ Te2[(s1 >> 8) & 0xff] ^
+ Te3[(s2 ) & 0xff] ^
+ rk[7]);
+
+ rk+= 8;
+ if (--r == 0)
+ break;
+
+ s0= (Te0[(t0 >> 24) ] ^
+ Te1[(t1 >> 16) & 0xff] ^
+ Te2[(t2 >> 8) & 0xff] ^
+ Te3[(t3 ) & 0xff] ^
+ rk[0]);
+
+ s1= (Te0[(t1 >> 24) ] ^
+ Te1[(t2 >> 16) & 0xff] ^
+ Te2[(t3 >> 8) & 0xff] ^
+ Te3[(t0 ) & 0xff] ^
+ rk[1]);
+
+ s2= (Te0[(t2 >> 24) ] ^
+ Te1[(t3 >> 16) & 0xff] ^
+ Te2[(t0 >> 8) & 0xff] ^
+ Te3[(t1 ) & 0xff] ^
+ rk[2]);
+
+ s3= (Te0[(t3 >> 24) ] ^
+ Te1[(t0 >> 16) & 0xff] ^
+ Te2[(t1 >> 8) & 0xff] ^
+ Te3[(t2 ) & 0xff] ^
+ rk[3]);
+ }
+#endif /* FULL_UNROLL */
+
+ /* Apply last round and map cipher state to byte array block: */
+ s0= ((Te4[(t0 >> 24) ] & 0xff000000) ^
+ (Te4[(t1 >> 16) & 0xff] & 0x00ff0000) ^
+ (Te4[(t2 >> 8) & 0xff] & 0x0000ff00) ^
+ (Te4[(t3 ) & 0xff] & 0x000000ff) ^
+ rk[0]);
+ PUTuint32(ct , s0);
+
+ s1= ((Te4[(t1 >> 24) ] & 0xff000000) ^
+ (Te4[(t2 >> 16) & 0xff] & 0x00ff0000) ^
+ (Te4[(t3 >> 8) & 0xff] & 0x0000ff00) ^
+ (Te4[(t0 ) & 0xff] & 0x000000ff) ^
+ rk[1]);
+ PUTuint32(ct + 4, s1);
+
+ s2= ((Te4[(t2 >> 24) ] & 0xff000000) ^
+ (Te4[(t3 >> 16) & 0xff] & 0x00ff0000) ^
+ (Te4[(t0 >> 8) & 0xff] & 0x0000ff00) ^
+ (Te4[(t1 ) & 0xff] & 0x000000ff) ^
+ rk[2]);
+ PUTuint32(ct + 8, s2);
+
+ s3= ((Te4[(t3 >> 24) ] & 0xff000000) ^
+ (Te4[(t0 >> 16) & 0xff] & 0x00ff0000) ^
+ (Te4[(t1 >> 8) & 0xff] & 0x0000ff00) ^
+ (Te4[(t2 ) & 0xff] & 0x000000ff) ^
+ rk[3]);
+ PUTuint32(ct + 12, s3);
+}
+
+
+void rijndaelDecrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr,
+ const uint8 ct[16], uint8 pt[16])
+{
+ uint32 s0, s1, s2, s3, t0, t1, t2, t3;
+#ifndef FULL_UNROLL
+ int r;
+#endif /* FULL_UNROLL */
+
+ /* Map byte array block to cipher state and add initial round key: */
+
+ s0 = GETuint32(ct ) ^ rk[0];
+ s1 = GETuint32(ct + 4) ^ rk[1];
+ s2 = GETuint32(ct + 8) ^ rk[2];
+ s3 = GETuint32(ct + 12) ^ rk[3];
+
+#ifdef FULL_UNROLL
+ /* round 1: */
+ t0= (Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff]
+ ^ Td3[s1 & 0xff] ^ rk[ 4]);
+ t1= (Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff]
+ ^ Td3[s2 & 0xff] ^ rk[ 5]);
+ t2= (Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff]
+ ^ Td3[s3 & 0xff] ^ rk[ 6]);
+ t3= (Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff]
+ ^ Td3[s0 & 0xff] ^ rk[ 7]);
+
+ /* round 2: */
+ s0= (Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff]
+ ^ Td3[t1 & 0xff] ^ rk[ 8]);
+ s1= (Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff]
+ ^ Td3[t2 & 0xff] ^ rk[ 9]);
+ s2= (Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff]
+ ^ Td3[t3 & 0xff] ^ rk[10]);
+ s3= (Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff]
+ ^ Td3[t0 & 0xff] ^ rk[11]);
+
+ /* round 3: */
+ t0= (Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff]
+ ^ Td3[s1 & 0xff] ^ rk[12]);
+ t1= (Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff]
+ ^ Td3[s2 & 0xff] ^ rk[13]);
+ t2= (Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff]
+ ^ Td3[s3 & 0xff] ^ rk[14]);
+ t3= (Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff]
+ ^ Td3[s0 & 0xff] ^ rk[15]);
+
+ /* round 4: */
+ s0= (Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff]
+ ^ Td3[t1 & 0xff] ^ rk[16]);
+ s1= (Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff]
+ ^ Td3[t2 & 0xff] ^ rk[17]);
+ s2= (Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff]
+ ^ Td3[t3 & 0xff] ^ rk[18]);
+ s3= (Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff]
+ ^ Td3[t0 & 0xff] ^ rk[19]);
+
+ /* round 5: */
+ t0= (Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff]
+ ^ Td3[s1 & 0xff] ^ rk[20]);
+ t1= (Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff]
+ ^ Td3[s2 & 0xff] ^ rk[21]);
+ t2= (Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff]
+ ^ Td3[s3 & 0xff] ^ rk[22]);
+ t3= (Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff]
+ ^ Td3[s0 & 0xff] ^ rk[23]);
+
+ /* round 6: */
+ s0= (Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff]
+ ^ Td3[t1 & 0xff] ^ rk[24]);
+ s1= (Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff]
+ ^ Td3[t2 & 0xff] ^ rk[25]);
+ s2= (Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff]
+ ^ Td3[t3 & 0xff] ^ rk[26]);
+ s3= (Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff]
+ ^ Td3[t0 & 0xff] ^ rk[27]);
+
+ /* round 7: */
+ t0= (Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff]
+ ^ Td3[s1 & 0xff] ^ rk[28]);
+ t1= (Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff]
+ ^ Td3[s2 & 0xff] ^ rk[29]);
+ t2= (Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff]
+ ^ Td3[s3 & 0xff] ^ rk[30]);
+ t3= (Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff]
+ ^ Td3[s0 & 0xff] ^ rk[31]);
+
+ /* round 8: */
+ s0= (Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff]
+ ^ Td3[t1 & 0xff] ^ rk[32]);
+ s1= (Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff]
+ ^ Td3[t2 & 0xff] ^ rk[33]);
+ s2= (Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff]
+ ^ Td3[t3 & 0xff] ^ rk[34]);
+ s3= (Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff]
+ ^ Td3[t0 & 0xff] ^ rk[35]);
+
+ /* round 9: */
+ t0= (Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff]
+ ^ Td3[s1 & 0xff] ^ rk[36]);
+ t1= (Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff]
+ ^ Td3[s2 & 0xff] ^ rk[37]);
+ t2= (Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff]
+ ^ Td3[s3 & 0xff] ^ rk[38]);
+ t3= (Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff]
+ ^ Td3[s0 & 0xff] ^ rk[39]);
+
+ if (Nr > 10)
+ {
+ /* round 10: */
+ s0= (Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff]
+ ^ Td3[t1 & 0xff] ^ rk[40]);
+ s1= (Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff]
+ ^ Td3[t2 & 0xff] ^ rk[41]);
+ s2= (Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff]
+ ^ Td3[t3 & 0xff] ^ rk[42]);
+ s3= (Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff]
+ ^ Td3[t0 & 0xff] ^ rk[43]);
+
+ /* round 11: */
+ t0= (Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff]
+ ^ Td3[s1 & 0xff] ^ rk[44]);
+ t1= (Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff]
+ ^ Td3[s2 & 0xff] ^ rk[45]);
+ t2= (Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff]
+ ^ Td3[s3 & 0xff] ^ rk[46]);
+ t3= (Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff]
+ ^ Td3[s0 & 0xff] ^ rk[47]);
+
+ if (Nr > 12)
+ {
+ /* round 12: */
+ s0= (Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff]
+ ^ Td3[t1 & 0xff] ^ rk[48]);
+ s1= (Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff]
+ ^ Td3[t2 & 0xff] ^ rk[49]);
+ s2= (Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff]
+ ^ Td3[t3 & 0xff] ^ rk[50]);
+ s3= (Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff]
+ ^ Td3[t0 & 0xff] ^ rk[51]);
+
+ /* round 13: */
+ t0= (Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff]
+ ^ Td3[s1 & 0xff] ^ rk[52]);
+ t1= (Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff]
+ ^ Td3[s2 & 0xff] ^ rk[53]);
+ t2= (Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff]
+ ^ Td3[s3 & 0xff] ^ rk[54]);
+ t3= (Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff]
+ ^ Td3[s0 & 0xff] ^ rk[55]);
+ }
+ }
+ rk += Nr << 2;
+#else /* !FULL_UNROLL */
+
+ /* Nr - 1 full rounds: */
+ r= (Nr >> 1);
+ for (;;)
+ {
+ t0= (Td0[(s0 >> 24) ] ^
+ Td1[(s3 >> 16) & 0xff] ^
+ Td2[(s2 >> 8) & 0xff] ^
+ Td3[(s1 ) & 0xff] ^
+ rk[4]);
+
+ t1= (Td0[(s1 >> 24) ] ^
+ Td1[(s0 >> 16) & 0xff] ^
+ Td2[(s3 >> 8) & 0xff] ^
+ Td3[(s2 ) & 0xff] ^
+ rk[5]);
+
+ t2= (Td0[(s2 >> 24) ] ^
+ Td1[(s1 >> 16) & 0xff] ^
+ Td2[(s0 >> 8) & 0xff] ^
+ Td3[(s3 ) & 0xff] ^
+ rk[6]);
+
+ t3= (Td0[(s3 >> 24) ] ^
+ Td1[(s2 >> 16) & 0xff] ^
+ Td2[(s1 >> 8) & 0xff] ^
+ Td3[(s0 ) & 0xff] ^
+ rk[7]);
+
+ rk+= 8;
+ if (--r == 0)
+ break;
+
+ s0= (Td0[(t0 >> 24) ] ^
+ Td1[(t3 >> 16) & 0xff] ^
+ Td2[(t2 >> 8) & 0xff] ^
+ Td3[(t1 ) & 0xff] ^
+ rk[0]);
+
+ s1= (Td0[(t1 >> 24) ] ^
+ Td1[(t0 >> 16) & 0xff] ^
+ Td2[(t3 >> 8) & 0xff] ^
+ Td3[(t2 ) & 0xff] ^
+ rk[1]);
+
+ s2= (Td0[(t2 >> 24) ] ^
+ Td1[(t1 >> 16) & 0xff] ^
+ Td2[(t0 >> 8) & 0xff] ^
+ Td3[(t3 ) & 0xff] ^
+ rk[2]);
+
+ s3= (Td0[(t3 >> 24) ] ^
+ Td1[(t2 >> 16) & 0xff] ^
+ Td2[(t1 >> 8) & 0xff] ^
+ Td3[(t0 ) & 0xff] ^
+ rk[3]);
+ }
+
+#endif /* FULL_UNROLL */
+
+ /* Apply last round and map cipher state to byte array block: */
+
+ s0= ((Td4[(t0 >> 24) ] & 0xff000000) ^
+ (Td4[(t3 >> 16) & 0xff] & 0x00ff0000) ^
+ (Td4[(t2 >> 8) & 0xff] & 0x0000ff00) ^
+ (Td4[(t1 ) & 0xff] & 0x000000ff) ^
+ rk[0]);
+ PUTuint32(pt , s0);
+
+ s1= ((Td4[(t1 >> 24) ] & 0xff000000) ^
+ (Td4[(t0 >> 16) & 0xff] & 0x00ff0000) ^
+ (Td4[(t3 >> 8) & 0xff] & 0x0000ff00) ^
+ (Td4[(t2 ) & 0xff] & 0x000000ff) ^
+ rk[1]);
+ PUTuint32(pt + 4, s1);
+
+ s2= ((Td4[(t2 >> 24) ] & 0xff000000) ^
+ (Td4[(t1 >> 16) & 0xff] & 0x00ff0000) ^
+ (Td4[(t0 >> 8) & 0xff] & 0x0000ff00) ^
+ (Td4[(t3 ) & 0xff] & 0x000000ff) ^
+ rk[2]);
+ PUTuint32(pt + 8, s2);
+
+ s3= ((Td4[(t3 >> 24) ] & 0xff000000) ^
+ (Td4[(t2 >> 16) & 0xff] & 0x00ff0000) ^
+ (Td4[(t1 >> 8) & 0xff] & 0x0000ff00) ^
+ (Td4[(t0 ) & 0xff] & 0x000000ff) ^
+ rk[3]);
+ PUTuint32(pt + 12, s3);
+}
diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c
index 074afe27500..9615126f237 100644
--- a/mysys/safemalloc.c
+++ b/mysys/safemalloc.c
@@ -15,53 +15,50 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
- * [This posting refers to an article entitled "oops, corrupted memory
- * again!" in net.lang.c. I am posting it here because it is source.]
- *
- * My tool for approaching this problem is to build another level of data
- * abstraction on top of malloc() and free() that implements some checking.
- * This does a number of things for you:
- * - Checks for overruns and underruns on allocated data
- * - Keeps track of where in the program the memory was malloc'ed
- * - Reports on pieces of memory that were not free'ed
- * - Records some statistics such as maximum memory used
- * - Marks newly malloc'ed and newly free'ed memory with special values
- * You can use this scheme to:
- * - Find bugs such as overrun, underrun, etc because you know where
- * a piece of data was malloc'ed and where it was free'ed
- * - Find bugs where memory was not free'ed
- * - Find bugs where newly malloc'ed memory is used without initializing
- * - Find bugs where newly free'ed memory is still used
- * - Determine how much memory your program really uses
- * - and other things
- */
-
-/*
- * To implement my scheme you must have a C compiler that has __LINE__ and
- * __FILE__ macros. If your compiler doesn't have these then (a) buy another:
- * compilers that do are available on UNIX 4.2bsd based systems and the PC,
- * and probably on other machines; or (b) change my scheme somehow. I have
- * recomendations on both these points if you would like them (e-mail please).
- *
- * There are 4 functions in my package:
- * char *NEW( uSize ) Allocate memory of uSize bytes
- * (equivalent to malloc())
- * char *REA( pPtr, uSize) Allocate memory of uSize bytes, move data and
- * free pPtr.
- * (equivalent to realloc())
- * FREE( pPtr ) Free memory allocated by NEW
- * (equivalent to free())
- * TERMINATE(file) End system, report errors and stats on file
- * I personally use two more functions, but have not included them here:
- * char *STRSAVE( sPtr ) Save a copy of the string in dynamic memory
- * char *RENEW( pPtr, uSize )
- * (equivalent to realloc())
- */
-
-/*
* Memory sub-system, written by Bjorn Benson
Fixed to use my_sys scheme by Michael Widenius
- */
+
+ [This posting refers to an article entitled "oops, corrupted memory
+ again!" in net.lang.c. I am posting it here because it is source.]
+
+ My tool for approaching this problem is to build another level of data
+ abstraction on top of malloc() and free() that implements some checking.
+ This does a number of things for you:
+ - Checks for overruns and underruns on allocated data
+ - Keeps track of where in the program the memory was malloc'ed
+ - Reports on pieces of memory that were not free'ed
+ - Records some statistics such as maximum memory used
+ - Marks newly malloc'ed and newly free'ed memory with special values
+ You can use this scheme to:
+ - Find bugs such as overrun, underrun, etc because you know where
+ a piece of data was malloc'ed and where it was free'ed
+ - Find bugs where memory was not free'ed
+ - Find bugs where newly malloc'ed memory is used without initializing
+ - Find bugs where newly free'ed memory is still used
+ - Determine how much memory your program really uses
+ - and other things
+
+ To implement my scheme you must have a C compiler that has __LINE__ and
+ __FILE__ macros. If your compiler doesn't have these then (a) buy another:
+ compilers that do are available on UNIX 4.2bsd based systems and the PC,
+ and probably on other machines; or (b) change my scheme somehow. I have
+ recomendations on both these points if you would like them (e-mail please).
+
+ There are 4 functions in my package:
+ char *NEW( uSize ) Allocate memory of uSize bytes
+ (equivalent to malloc())
+ char *REA( pPtr, uSize) Allocate memory of uSize bytes, move data and
+ free pPtr.
+ (equivalent to realloc())
+ FREE( pPtr ) Free memory allocated by NEW
+ (equivalent to free())
+ TERMINATE(file) End system, report errors and stats on file
+ I personally use two more functions, but have not included them here:
+ char *STRSAVE( sPtr ) Save a copy of the string in dynamic memory
+ char *RENEW( pPtr, uSize )
+ (equivalent to realloc())
+
+*/
#ifndef SAFEMALLOC
#define SAFEMALLOC /* Get protos from my_sys */
@@ -74,24 +71,20 @@
ulonglong safemalloc_mem_limit = ~(ulonglong)0;
-#ifdef THREAD
-pthread_t shutdown_th,main_th,signal_th;
-#endif
-
#define pNext tInt._pNext
#define pPrev tInt._pPrev
#define sFileName tInt._sFileName
#define uLineNum tInt._uLineNum
#define uDataSize tInt._uDataSize
-#define thread_id tInt.thread_id
#define lSpecialValue tInt._lSpecialValue
#ifndef PEDANTIC_SAFEMALLOC
-static int sf_malloc_tampered = 0; /* set to 1 after TERMINATE() if we had
- to fiddle with cNewCount and the linked
- list of blocks so that _sanity() will
- not fuss when it is not supposed to
- */
+/*
+ Set to 1 after TERMINATE() if we had to fiddle with cNewCount and
+ the linked list of blocks so that _sanity() will not fuss when it
+ is not supposed to
+*/
+static int sf_malloc_tampered = 0;
#endif
@@ -102,37 +95,37 @@ static int check_ptr(const char *where, byte *ptr, const char *sFile,
static int _checkchunk(struct remember *pRec, const char *sFile, uint uLine);
/*
- * Note: both these refer to the NEW'ed
- * data only. They do not include
- * malloc() roundoff or the extra
- * space required by the remember
- * structures.
- */
-
-#define ALLOC_VAL (uchar) 0xA5 /* NEW'ed memory is filled with this */
- /* value so that references to it will */
- /* end up being very strange. */
-#define FREE_VAL (uchar) 0x8F /* FREE'ed memory is filled with this */
- /* value so that references to it will */
- /* also end up being strange. */
+ Note: both these refer to the NEW'ed data only. They do not include
+ malloc() roundoff or the extra space required by the remember
+ structures.
+*/
+/*
+ NEW'ed memory is filled with this value so that references to it will
+ end up being very strange.
+*/
+#define ALLOC_VAL (uchar) 0xA5
+/*
+ FEEE'ed memory is filled with this value so that references to it will
+ end up being very strange.
+*/
+#define FREE_VAL (uchar) 0x8F
#define MAGICKEY 0x14235296 /* A magic value for underrun key */
+
+/*
+ Warning: do not change the MAGICEND? values to something with the
+ high bit set. Various C compilers (like the 4.2bsd one) do not do
+ the sign extension right later on in this code and you will get
+ erroneous errors.
+*/
+
#define MAGICEND0 0x68 /* Magic values for overrun keys */
#define MAGICEND1 0x34 /* " */
#define MAGICEND2 0x7A /* " */
#define MAGICEND3 0x15 /* " */
- /* Warning: do not change the MAGICEND? values to */
- /* something with the high bit set. Various C */
- /* compilers (like the 4.2bsd one) do not do the */
- /* sign extension right later on in this code and */
- /* you will get erroneous errors. */
-
-/*
- * gptr _mymalloc( uint uSize, my_string sFile, uint uLine, MyFlags )
- * Allocate some memory.
- */
+/* Allocate some memory. */
gptr _mymalloc (uint uSize, const char *sFile, uint uLine, myf MyFlags)
{
@@ -144,18 +137,19 @@ gptr _mymalloc (uint uSize, const char *sFile, uint uLine, myf MyFlags)
if (!sf_malloc_quick)
(void) _sanity (sFile, uLine);
- if(uSize + lCurMemory > safemalloc_mem_limit)
+ if (uSize + lCurMemory > safemalloc_mem_limit)
pTmp = 0;
else
+ {
/* Allocate the physical memory */
pTmp = (struct remember *) malloc (
- sizeof (struct irem) /* remember data */
+ ALIGN_SIZE(sizeof(struct irem)) /* remember data */
+ sf_malloc_prehunc
+ uSize /* size requested */
+ 4 /* overrun mark */
+ sf_malloc_endhunc
);
-
+ }
/* Check if there isn't anymore memory avaiable */
if (pTmp == NULL)
{
@@ -188,9 +182,6 @@ gptr _mymalloc (uint uSize, const char *sFile, uint uLine, myf MyFlags)
pTmp -> sFileName = (my_string) sFile;
pTmp -> uLineNum = uLine;
pTmp -> uDataSize = uSize;
-#ifdef THREAD
- pTmp->thread_id = pthread_self();
-#endif
pTmp -> pPrev = NULL;
/* Add this remember structure to the linked list */
@@ -225,9 +216,9 @@ gptr _mymalloc (uint uSize, const char *sFile, uint uLine, myf MyFlags)
}
/*
- * Allocate some new memory and move old memoryblock there.
- * Free then old memoryblock
- */
+ Allocate some new memory and move old memoryblock there.
+ Free then old memoryblock
+*/
gptr _myrealloc (register gptr pPtr, register uint uSize,
const char *sFile, uint uLine, myf MyFlags)
@@ -245,7 +236,7 @@ gptr _myrealloc (register gptr pPtr, register uint uSize,
if (check_ptr("Reallocating",(byte*) pPtr,sFile,uLine))
DBUG_RETURN((gptr) NULL);
- pRec = (struct remember *) ((char*) pPtr - sizeof (struct irem)-
+ pRec = (struct remember *) ((char*) pPtr - ALIGN_SIZE(sizeof(struct irem))-
sf_malloc_prehunc);
if (*((long*) ((char*) &pRec -> lSpecialValue+sf_malloc_prehunc))
!= MAGICKEY)
@@ -258,7 +249,7 @@ gptr _myrealloc (register gptr pPtr, register uint uSize,
DBUG_RETURN((gptr) NULL);
}
- if ((ptr=_mymalloc(uSize,sFile,uLine,MyFlags))) /* Allocate new area */
+ if ((ptr=_mymalloc(uSize,sFile,uLine,MyFlags))) /* Allocate new area */
{
uSize=min(uSize,pRec-> uDataSize); /* Move as much as possibly */
memcpy((byte*) ptr,pPtr,(size_t) uSize); /* Copy old data */
@@ -275,10 +266,7 @@ gptr _myrealloc (register gptr pPtr, register uint uSize,
} /* _myrealloc */
-/*
- * void _myfree( my_string pPtr, my_string sFile, uint uLine, myf myflags)
- * Deallocate some memory.
- */
+/* Deallocate some memory. */
void _myfree (gptr pPtr, const char *sFile, uint uLine, myf myflags)
{
@@ -294,15 +282,17 @@ void _myfree (gptr pPtr, const char *sFile, uint uLine, myf myflags)
DBUG_VOID_RETURN;
/* Calculate the address of the remember structure */
- pRec = (struct remember *) ((byte*) pPtr-sizeof(struct irem)-
+ pRec = (struct remember *) ((byte*) pPtr- ALIGN_SIZE(sizeof(struct irem))-
sf_malloc_prehunc);
- /* Check to make sure that we have a real remember structure */
- /* Note: this test could fail for four reasons: */
- /* (1) The memory was already free'ed */
- /* (2) The memory was never new'ed */
- /* (3) There was an underrun */
- /* (4) A stray pointer hit this location */
+ /*
+ Check to make sure that we have a real remember structure.
+ Note: this test could fail for four reasons:
+ (1) The memory was already free'ed
+ (2) The memory was never new'ed
+ (3) There was an underrun
+ (4) A stray pointer hit this location
+ */
if (*((long*) ((char*) &pRec -> lSpecialValue+sf_malloc_prehunc))
!= MAGICKEY)
@@ -354,7 +344,7 @@ static int check_ptr(const char *where, byte *ptr, const char *sFile,
return 1;
}
#ifndef _MSC_VER
- if ((long) ptr & (MY_ALIGN(1,sizeof(char *))-1))
+ if ((long) ptr & (ALIGN_SIZE(1)-1))
{
fprintf (stderr, "%s wrong aligned pointer at line %d, '%s'\n",
where,uLine, sFile);
@@ -376,24 +366,11 @@ static int check_ptr(const char *where, byte *ptr, const char *sFile,
return 0;
}
-#ifdef THREAD
-static int legal_leak(struct remember* pPtr)
-{
- return pthread_self() == pPtr->thread_id || main_th == pPtr->thread_id
- || shutdown_th == pPtr->thread_id
- || signal_th == pPtr->thread_id;
-}
-#else
-static int legal_leak(struct remember* pPtr)
-{
- return 1;
-}
-#endif
/*
- * TERMINATE(FILE *file)
- * Report on all the memory pieces that have not been
- * free'ed as well as the statistics.
+ TERMINATE(FILE *file)
+ Report on all the memory pieces that have not been
+ free'ed as well as the statistics.
*/
void TERMINATE (FILE *file)
@@ -408,48 +385,6 @@ void TERMINATE (FILE *file)
NEWs than FREEs. <0, etc.
*/
-#if !defined(PEDANTIC_SAFEMALLOC) && defined(THREAD)
- /*
- Avoid false alarms for blocks that we cannot free before my_end()
- This does miss some positives, but that is ok. This will only miss
- failures to free things allocated in the main thread which
- performs only one-time allocations. If you really need to
- debug memory allocations in the main thread,
- #define PEDANTIC_SAFEMALLOC
- */
- if ((pPtr=pRememberRoot))
- {
- while (pPtr)
- {
- if (legal_leak(pPtr))
- {
- sf_malloc_tampered=1;
- cNewCount--;
- lCurMemory -= pPtr->uDataSize;
- if (pPtr->pPrev)
- {
- struct remember* tmp;
- tmp = pPtr->pPrev->pNext = pPtr->pNext;
- if (tmp)
- tmp->pPrev = pPtr->pPrev;
- pPtr->pNext = pPtr->pPrev = 0;
- pPtr = tmp;
- }
- else
- {
- pRememberRoot = pPtr->pNext;
- pPtr->pNext = pPtr->pPrev = 0;
- pPtr = pRememberRoot;
- if (pPtr)
- pPtr->pPrev=0;
- }
- }
- else
- pPtr = pPtr->pNext;
- }
- }
-#endif
-
if (cNewCount)
{
if (file)
@@ -460,8 +395,10 @@ void TERMINATE (FILE *file)
DBUG_PRINT("safe",("cNewCount: %d",cNewCount));
}
- /* Report on all the memory that was allocated with NEW */
- /* but not free'ed with FREE. */
+ /*
+ Report on all the memory that was allocated with NEW
+ but not free'ed with FREE.
+ */
if ((pPtr=pRememberRoot))
{
@@ -480,9 +417,6 @@ void TERMINATE (FILE *file)
pPtr -> uDataSize,
(ulong) &(pPtr -> aData[sf_malloc_prehunc]),
pPtr -> uLineNum, pPtr -> sFileName);
-#ifdef THREAD
- fprintf(file, " in thread %ld", pPtr->thread_id);
-#endif
fprintf(file, "\n");
(void) fflush(file);
}
diff --git a/mysys/sha1.c b/mysys/sha1.c
new file mode 100644
index 00000000000..5271b369b6c
--- /dev/null
+++ b/mysys/sha1.c
@@ -0,0 +1,392 @@
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
+ Original Source from: http://www.faqs.org/rfcs/rfc3174.html
+
+ DESCRIPTION
+ This file implements the Secure Hashing Algorithm 1 as
+ defined in FIPS PUB 180-1 published April 17, 1995.
+
+ The SHA-1, produces a 160-bit message digest for a given data
+ stream. It should take about 2**n steps to find a message with the
+ same digest as a given message and 2**(n/2) to find any two
+ messages with the same digest, when n is the digest size in bits.
+ Therefore, this algorithm can serve as a means of providing a
+ "fingerprint" for a message.
+
+ PORTABILITY ISSUES
+ SHA-1 is defined in terms of 32-bit "words". This code uses
+ <stdint.h> (included via "sha1.h" to define 32 and 8 bit unsigned
+ integer types. If your C compiler does not support 32 bit unsigned
+ integers, this code is not appropriate.
+
+ CAVEATS
+ SHA-1 is designed to work with messages less than 2^64 bits long.
+ Although SHA-1 allows a message digest to be generated for messages
+ of any number of bits less than 2^64, this implementation only
+ works with messages with a length that is a multiple of the size of
+ an 8-bit character.
+
+ CHANGES
+ 2002 by Peter Zaitsev to
+ - fit to new prototypes according to MySQL standard
+ - Some optimizations
+ - All checking is now done in debug only mode
+ - More comments
+*/
+
+#include "my_global.h"
+#include "m_string.h"
+#include "sha1.h"
+
+/*
+ Define the SHA1 circular left shift macro
+*/
+
+#define SHA1CircularShift(bits,word) \
+ (((word) << (bits)) | ((word) >> (32-(bits))))
+
+/* Local Function Prototyptes */
+static void SHA1PadMessage(SHA1_CONTEXT*);
+static void SHA1ProcessMessageBlock(SHA1_CONTEXT*);
+
+
+/*
+ Initialize SHA1Context
+
+ SYNOPSIS
+ sha1_reset()
+ context [in/out] The context to reset.
+
+ DESCRIPTION
+ This function will initialize the SHA1Context in preparation
+ for computing a new SHA1 message digest.
+
+ RETURN
+ SHA_SUCCESS ok
+ != SHA_SUCCESS sha Error Code.
+*/
+
+
+const uint32 sha_const_key[5]=
+{
+ 0x67452301,
+ 0xEFCDAB89,
+ 0x98BADCFE,
+ 0x10325476,
+ 0xC3D2E1F0
+};
+
+
+int sha1_reset(SHA1_CONTEXT *context)
+{
+#ifndef DBUG_OFF
+ if (!context)
+ return SHA_NULL;
+#endif
+
+ context->Length = 0;
+ context->Message_Block_Index = 0;
+
+ context->Intermediate_Hash[0] = sha_const_key[0];
+ context->Intermediate_Hash[1] = sha_const_key[1];
+ context->Intermediate_Hash[2] = sha_const_key[2];
+ context->Intermediate_Hash[3] = sha_const_key[3];
+ context->Intermediate_Hash[4] = sha_const_key[4];
+
+ context->Computed = 0;
+ context->Corrupted = 0;
+
+ return SHA_SUCCESS;
+}
+
+
+/*
+ Return the 160-bit message digest into the array provided by the caller
+
+ SYNOPSIS
+ sha1_result()
+ context [in/out] The context to use to calculate the SHA-1 hash.
+ Message_Digest: [out] Where the digest is returned.
+
+ DESCRIPTION
+ NOTE: The first octet of hash is stored in the 0th element,
+ the last octet of hash in the 19th element.
+
+ RETURN
+ SHA_SUCCESS ok
+ != SHA_SUCCESS sha Error Code.
+*/
+
+int sha1_result(SHA1_CONTEXT *context,
+ uint8 Message_Digest[SHA1_HASH_SIZE])
+{
+ int i;
+
+#ifndef DBUG_OFF
+ if (!context || !Message_Digest)
+ return SHA_NULL;
+
+ if (context->Corrupted)
+ return context->Corrupted;
+#endif
+
+ if (!context->Computed)
+ {
+ SHA1PadMessage(context);
+ /* message may be sensitive, clear it out */
+ bzero((char*) context->Message_Block,64);
+ context->Length = 0; /* and clear length */
+ context->Computed = 1;
+ }
+
+ for (i = 0; i < SHA1_HASH_SIZE; i++)
+ Message_Digest[i] = (int8)((context->Intermediate_Hash[i>>2] >> 8
+ * ( 3 - ( i & 0x03 ) )));
+ return SHA_SUCCESS;
+}
+
+
+/*
+ Accepts an array of octets as the next portion of the message.
+
+ SYNOPSIS
+ sha1_input()
+ context [in/out] The SHA context to update
+ message_array An array of characters representing the next portion
+ of the message.
+ length The length of the message in message_array
+
+ RETURN
+ SHA_SUCCESS ok
+ != SHA_SUCCESS sha Error Code.
+*/
+
+int sha1_input(SHA1_CONTEXT *context, const uint8 *message_array,
+ unsigned length)
+{
+ if (!length)
+ return SHA_SUCCESS;
+
+#ifndef DBUG_OFF
+ /* We assume client konows what it is doing in non-debug mode */
+ if (!context || !message_array)
+ return SHA_NULL;
+ if (context->Computed)
+ return (context->Corrupted= SHA_STATE_ERROR);
+ if (context->Corrupted)
+ return context->Corrupted;
+#endif
+
+ while (length--)
+ {
+ context->Message_Block[context->Message_Block_Index++]=
+ (*message_array & 0xFF);
+ context->Length += 8; /* Length is in bits */
+
+#ifndef DBUG_OFF
+ /*
+ Then we're not debugging we assume we never will get message longer
+ 2^64 bits.
+ */
+ if (context->Length == 0)
+ return (context->Corrupted= 1); /* Message is too long */
+#endif
+
+ if (context->Message_Block_Index == 64)
+ {
+ SHA1ProcessMessageBlock(context);
+ }
+ message_array++;
+ }
+ return SHA_SUCCESS;
+}
+
+
+/*
+ Process the next 512 bits of the message stored in the Message_Block array.
+
+ SYNOPSIS
+ SHA1ProcessMessageBlock()
+
+ DESCRIPTION
+ Many of the variable names in this code, especially the single
+ character names, were used because those were the names used in
+ the publication.
+*/
+
+/* Constants defined in SHA-1 */
+static const uint32 K[]=
+{
+ 0x5A827999,
+ 0x6ED9EBA1,
+ 0x8F1BBCDC,
+ 0xCA62C1D6
+};
+
+
+static void SHA1ProcessMessageBlock(SHA1_CONTEXT *context)
+{
+ int t; /* Loop counter */
+ uint32 temp; /* Temporary word value */
+ uint32 W[80]; /* Word sequence */
+ uint32 A, B, C, D, E; /* Word buffers */
+ int index;
+
+ /*
+ Initialize the first 16 words in the array W
+ */
+
+ for (t = 0; t < 16; t++)
+ {
+ index=t*4;
+ W[t] = context->Message_Block[index] << 24;
+ W[t] |= context->Message_Block[index + 1] << 16;
+ W[t] |= context->Message_Block[index + 2] << 8;
+ W[t] |= context->Message_Block[index + 3];
+ }
+
+
+ for (t = 16; t < 80; t++)
+ {
+ W[t] = SHA1CircularShift(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]);
+ }
+
+ A = context->Intermediate_Hash[0];
+ B = context->Intermediate_Hash[1];
+ C = context->Intermediate_Hash[2];
+ D = context->Intermediate_Hash[3];
+ E = context->Intermediate_Hash[4];
+
+ for (t = 0; t < 20; t++)
+ {
+ temp= SHA1CircularShift(5,A) + ((B & C) | ((~B) & D)) + E + W[t] + K[0];
+ E = D;
+ D = C;
+ C = SHA1CircularShift(30,B);
+ B = A;
+ A = temp;
+ }
+
+ for (t = 20; t < 40; t++)
+ {
+ temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[1];
+ E = D;
+ D = C;
+ C = SHA1CircularShift(30,B);
+ B = A;
+ A = temp;
+ }
+
+ for (t = 40; t < 60; t++)
+ {
+ temp= (SHA1CircularShift(5,A) + ((B & C) | (B & D) | (C & D)) + E + W[t] +
+ K[2]);
+ E = D;
+ D = C;
+ C = SHA1CircularShift(30,B);
+ B = A;
+ A = temp;
+ }
+
+ for (t = 60; t < 80; t++)
+ {
+ temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[3];
+ E = D;
+ D = C;
+ C = SHA1CircularShift(30,B);
+ B = A;
+ A = temp;
+ }
+
+ context->Intermediate_Hash[0] += A;
+ context->Intermediate_Hash[1] += B;
+ context->Intermediate_Hash[2] += C;
+ context->Intermediate_Hash[3] += D;
+ context->Intermediate_Hash[4] += E;
+
+ context->Message_Block_Index = 0;
+}
+
+
+/*
+ Pad message
+
+ SYNOPSIS
+ SHA1PadMessage()
+ context: [in/out] The context to pad
+
+ DESCRIPTION
+ According to the standard, the message must be padded to an even
+ 512 bits. The first padding bit must be a '1'. The last 64 bits
+ represent the length of the original message. All bits in between
+ should be 0. This function will pad the message according to
+ those rules by filling the Message_Block array accordingly. It
+ will also call the ProcessMessageBlock function provided
+ appropriately. When it returns, it can be assumed that the message
+ digest has been computed.
+
+*/
+
+void SHA1PadMessage(SHA1_CONTEXT *context)
+{
+ /*
+ Check to see if the current message block is too small to hold
+ the initial padding bits and length. If so, we will pad the
+ block, process it, and then continue padding into a second
+ block.
+ */
+
+ int i=context->Message_Block_Index;
+
+ if (i > 55)
+ {
+ context->Message_Block[i++] = 0x80;
+ bzero((char*) &context->Message_Block[i],
+ sizeof(context->Message_Block[0])*(64-i));
+ context->Message_Block_Index=64;
+
+ /* This function sets context->Message_Block_Index to zero */
+ SHA1ProcessMessageBlock(context);
+
+ bzero((char*) &context->Message_Block[0],
+ sizeof(context->Message_Block[0])*56);
+ context->Message_Block_Index=56;
+ }
+ else
+ {
+ context->Message_Block[i++] = 0x80;
+ bzero((char*) &context->Message_Block[i],
+ sizeof(context->Message_Block[0])*(56-i));
+ context->Message_Block_Index=56;
+ }
+
+ /*
+ Store the message length as the last 8 octets
+ */
+
+ context->Message_Block[56] = (int8) (context->Length >> 56);
+ context->Message_Block[57] = (int8) (context->Length >> 48);
+ context->Message_Block[58] = (int8) (context->Length >> 40);
+ context->Message_Block[59] = (int8) (context->Length >> 32);
+ context->Message_Block[60] = (int8) (context->Length >> 24);
+ context->Message_Block[61] = (int8) (context->Length >> 16);
+ context->Message_Block[62] = (int8) (context->Length >> 8);
+ context->Message_Block[63] = (int8) (context->Length);
+
+ SHA1ProcessMessageBlock(context);
+}
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index ef514efe39e..11e6fa97ab6 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -39,11 +39,14 @@
static my_bool alarm_aborted=1;
my_bool thr_alarm_inited=0;
+static sig_handler process_alarm_part2(int sig);
+
#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2)
static pthread_mutex_t LOCK_alarm;
static sigset_t full_signal_set;
static QUEUE alarm_queue;
+static uint max_used_alarms=0;
pthread_t alarm_thread;
#ifdef USE_ALARM_THREAD
@@ -116,10 +119,10 @@ void init_thr_alarm(uint max_alarms)
}
/*
-** Request alarm after sec seconds.
-** A pointer is returned with points to a non-zero int when the alarm has been
-** given. This can't be called from the alarm-handling thread.
-** Returns 0 if no more alarms are allowed (aborted by process)
+ Request alarm after sec seconds.
+ A pointer is returned with points to a non-zero int when the alarm has been
+ given. This can't be called from the alarm-handling thread.
+ Returns 0 if no more alarms are allowed (aborted by process)
*/
bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
@@ -140,13 +143,17 @@ bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
DBUG_RETURN(1);
}
- if (alarm_queue.elements == alarm_queue.max_elements)
+ if (alarm_queue.elements >= max_used_alarms)
{
- DBUG_PRINT("info", ("alarm queue full"));
- fprintf(stderr,"Warning: thr_alarm queue is full\n");
- pthread_mutex_unlock(&LOCK_alarm);
- pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
- DBUG_RETURN(1);
+ if (alarm_queue.elements == alarm_queue.max_elements)
+ {
+ DBUG_PRINT("info", ("alarm queue full"));
+ fprintf(stderr,"Warning: thr_alarm queue is full\n");
+ pthread_mutex_unlock(&LOCK_alarm);
+ pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
+ DBUG_RETURN(1);
+ }
+ max_used_alarms=alarm_queue.elements+1;
}
reschedule= (!alarm_queue.elements ||
(int) (((ALARM*) queue_top(&alarm_queue))->expire_time - now) >
@@ -186,7 +193,7 @@ bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
/*
-** Remove alarm from list of alarms
+ Remove alarm from list of alarms
*/
void thr_end_alarm(thr_alarm_t *alarmed)
@@ -218,7 +225,8 @@ void thr_end_alarm(thr_alarm_t *alarmed)
printf("Warning: Didn't find alarm %lx in queue of %d alarms\n",
(long) *alarmed, alarm_queue.elements);
#endif
- DBUG_PRINT("warning",("Didn't find alarm %lx in queue\n",*alarmed));
+ DBUG_PRINT("warning",("Didn't find alarm %lx in queue\n",
+ (long) *alarmed));
}
if (alarm_aborted && !alarm_queue.elements)
delete_queue(&alarm_queue);
@@ -227,20 +235,20 @@ void thr_end_alarm(thr_alarm_t *alarmed)
DBUG_VOID_RETURN;
}
- /*
- Come here when some alarm in queue is due.
- Mark all alarms with are finnished in list.
- Shedule alarms to be sent again after 1-10 sec (many alarms at once)
- If alarm_aborted is set then all alarms are given and resent
- every second.
- */
+/*
+ Come here when some alarm in queue is due.
+ Mark all alarms with are finnished in list.
+ Shedule alarms to be sent again after 1-10 sec (many alarms at once)
+ If alarm_aborted is set then all alarms are given and resent
+ every second.
+*/
sig_handler process_alarm(int sig __attribute__((unused)))
{
sigset_t old_mask;
- ALARM *alarm_data;
- DBUG_ENTER("process_alarm");
- DBUG_PRINT("info",("sig: %d active alarms: %d",sig,alarm_queue.elements));
+/*
+ This must be first as we can't call DBUG inside an alarm for a normal thread
+*/
#if THR_SERVER_ALARM == THR_CLIENT_ALARM
if (!pthread_equal(pthread_self(),alarm_thread))
@@ -251,17 +259,42 @@ sig_handler process_alarm(int sig __attribute__((unused)))
#ifdef DONT_REMEMBER_SIGNAL
sigset(THR_CLIENT_ALARM,process_alarm); /* int. thread system calls */
#endif
- DBUG_VOID_RETURN;
+ return;
}
#endif
-#if defined(MAIN) && !defined(__bsdi__)
- printf("process_alarm\n"); fflush(stdout);
-#endif
+ /*
+ We have to do do the handling of the alarm in a sub function,
+ because otherwise we would get problems with two threads calling
+ DBUG_... functions at the same time (as two threads may call
+ process_alarm() at the same time
+ */
+
#ifndef USE_ALARM_THREAD
pthread_sigmask(SIG_SETMASK,&full_signal_set,&old_mask);
pthread_mutex_lock(&LOCK_alarm);
#endif
+ process_alarm_part2(sig);
+#ifndef USE_ALARM_THREAD
+#if defined(DONT_REMEMBER_SIGNAL) && !defined(USE_ONE_SIGNAL_HAND)
+ sigset(THR_SERVER_ALARM,process_alarm);
+#endif
+ pthread_mutex_unlock(&LOCK_alarm);
+ pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
+#endif
+ return;
+}
+
+
+static sig_handler process_alarm_part2(int sig __attribute__((unused)))
+{
+ ALARM *alarm_data;
+ DBUG_ENTER("process_alarm");
+ DBUG_PRINT("info",("sig: %d active alarms: %d",sig,alarm_queue.elements));
+
+#if defined(MAIN) && !defined(__bsdi__)
+ printf("process_alarm\n"); fflush(stdout);
+#endif
if (alarm_queue.elements)
{
if (alarm_aborted)
@@ -322,20 +355,13 @@ sig_handler process_alarm(int sig __attribute__((unused)))
#endif
}
}
-#ifndef USE_ALARM_THREAD
-#if defined(DONT_REMEMBER_SIGNAL) && !defined(USE_ONE_SIGNAL_HAND)
- sigset(THR_SERVER_ALARM,process_alarm);
-#endif
- pthread_mutex_unlock(&LOCK_alarm);
- pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
-#endif
DBUG_VOID_RETURN;
}
/*
-** Shedule all alarms now.
-** When all alarms are given, Free alarm memory and don't allow more alarms.
+ Shedule all alarms now.
+ When all alarms are given, Free alarm memory and don't allow more alarms.
*/
void end_thr_alarm(void)
@@ -359,7 +385,7 @@ void end_thr_alarm(void)
/*
-** Remove another thread from the alarm
+ Remove another thread from the alarm
*/
void thr_alarm_kill(pthread_t thread_id)
@@ -382,9 +408,25 @@ void thr_alarm_kill(pthread_t thread_id)
}
+void thr_alarm_info(ALARM_INFO *info)
+{
+ pthread_mutex_lock(&LOCK_alarm);
+ info->next_alarm_time= 0;
+ info->max_used_alarms= max_used_alarms;
+ if ((info->active_alarms= alarm_queue.elements))
+ {
+ ulong now=(ulong) time((time_t*) 0);
+ long time_diff;
+ ALARM *alarm_data= (ALARM*) queue_top(&alarm_queue);
+ time_diff= (long) (alarm_data->expire_time - now);
+ info->next_alarm_time= (ulong) (time_diff < 0 ? 0 : time_diff);
+ }
+ pthread_mutex_unlock(&LOCK_alarm);
+}
+
/*
-** This is here for thread to get interruptet from read/write/fcntl
-** ARGSUSED
+ This is here for thread to get interruptet from read/write/fcntl
+ ARGSUSED
*/
#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD)
@@ -459,7 +501,7 @@ static void *alarm_handler(void *arg __attribute__((unused)))
#endif /* USE_ALARM_THREAD */
/*****************************************************************************
-** thr_alarm for OS/2
+ thr_alarm for OS/2
*****************************************************************************/
#elif defined(__EMX__) || defined(OS2)
@@ -490,7 +532,7 @@ sig_handler process_alarm(int sig __attribute__((unused)))
/*
-** Remove another thread from the alarm
+ Remove another thread from the alarm
*/
void thr_alarm_kill(pthread_t thread_id)
@@ -588,8 +630,14 @@ void init_thr_alarm(uint max_alarm)
DBUG_VOID_RETURN;
}
+void thr_alarm_info(ALARM_INFO *info)
+{
+ bzero((char*) info, sizeof(*info));
+}
+
+
/*****************************************************************************
-** thr_alarm for win95
+ thr_alarm for win95
*****************************************************************************/
#else /* __WIN__ */
@@ -661,13 +709,18 @@ void init_thr_alarm(uint max_alarm)
DBUG_VOID_RETURN;
}
+void thr_alarm_info(ALARM_INFO *info)
+{
+ bzero((char*) info, sizeof(*info));
+}
+
#endif /* __WIN__ */
#endif /* THREAD */
/****************************************************************************
-** Handling of MAIN
+ Handling of test case (when compiled with -DMAIN)
***************************************************************************/
#ifdef MAIN
@@ -867,6 +920,7 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
pthread_attr_t thr_attr;
int i,*param,error;
sigset_t set;
+ ALARM_INFO alarm_info;
MY_INIT(argv[0]);
if (argc > 1 && argv[1][0] == '-' && argv[1][1] == '#')
@@ -927,6 +981,10 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
pthread_attr_destroy(&thr_attr);
pthread_mutex_lock(&LOCK_thread_count);
+ thr_alarm_info(&alarm_info);
+ printf("Main_thread: Alarms: %u max_alarms: %u next_alarm_time: %lu\n",
+ alarm_info.active_alarms, alarm_info.max_used_alarms,
+ alarm_info.next_alarm_time);
while (thread_count)
{
VOID(pthread_cond_wait(&COND_thread_count,&LOCK_thread_count));
@@ -937,6 +995,10 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
}
}
pthread_mutex_unlock(&LOCK_thread_count);
+ thr_alarm_info(&alarm_info);
+ printf("Main_thread: Alarms: %u max_alarms: %u next_alarm_time: %lu\n",
+ alarm_info.active_alarms, alarm_info.max_used_alarms,
+ alarm_info.next_alarm_time);
printf("Test succeeded\n");
return 0;
}
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index 4493c54069f..6de96f0a24a 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -53,8 +53,8 @@ int safe_mutex_lock(safe_mutex_t *mp,const char *file, uint line)
pthread_mutex_lock(&mp->global);
if (mp->count > 0 && pthread_equal(pthread_self(),mp->thread))
{
- fprintf(stderr,"safe_mutex: Trying to lock mutex at %s, line %d, when the mutex was already locked at %s, line %d\n",
- file,line,mp->file,mp->line);
+ fprintf(stderr,"safe_mutex: Trying to lock mutex at %s, line %d, when the mutex was already locked at %s, line %d in thread %s\n",
+ file,line,mp->file, mp->line, my_thread_name());
fflush(stderr);
abort();
}
diff --git a/mysys/thr_rwlock.c b/mysys/thr_rwlock.c
index 4e2cf3554b7..29db2b997a0 100644
--- a/mysys/thr_rwlock.c
+++ b/mysys/thr_rwlock.c
@@ -17,13 +17,14 @@
/* Synchronization - readers / writer thread locks */
#include "mysys_priv.h"
-#include <my_pthread.h>
#if defined(THREAD) && !defined(HAVE_PTHREAD_RWLOCK_RDLOCK) && !defined(HAVE_RWLOCK_INIT)
+#include <errno.h>
/*
- * Source base from Sun Microsystems SPILT, simplified
- * for MySQL use -- Joshua Chamas
- */
+ Source base from Sun Microsystems SPILT, simplified for MySQL use
+ -- Joshua Chamas
+ Some cleanup and additional code by Monty
+*/
/*
* Multithreaded Demo Source
@@ -58,7 +59,7 @@
* Mountain View, California 94043
*/
-int my_rwlock_init( rw_lock_t *rwp, void *arg __attribute__((unused)))
+int my_rwlock_init(rw_lock_t *rwp, void *arg __attribute__((unused)))
{
pthread_condattr_t cond_attr;
@@ -71,64 +72,101 @@ int my_rwlock_init( rw_lock_t *rwp, void *arg __attribute__((unused)))
rwp->state = 0;
rwp->waiters = 0;
- return( 0 );
+ return(0);
}
-int my_rwlock_destroy( rw_lock_t *rwp ) {
+
+int my_rwlock_destroy(rw_lock_t *rwp)
+{
pthread_mutex_destroy( &rwp->lock );
pthread_cond_destroy( &rwp->readers );
pthread_cond_destroy( &rwp->writers );
-
- return( 0 );
+ return(0);
}
-int my_rw_rdlock( rw_lock_t *rwp ) {
+
+int my_rw_rdlock(rw_lock_t *rwp)
+{
pthread_mutex_lock(&rwp->lock);
- /* active or queued writers */
- while ( ( rwp->state < 0 ) || rwp->waiters )
+ /* active or queued writers */
+ while (( rwp->state < 0 ) || rwp->waiters)
pthread_cond_wait( &rwp->readers, &rwp->lock);
rwp->state++;
pthread_mutex_unlock(&rwp->lock);
+ return(0);
+}
- return( 0 );
+int my_rw_tryrdlock(rw_lock_t *rwp)
+{
+ int res;
+ pthread_mutex_lock(&rwp->lock);
+ if ((rwp->state < 0 ) || rwp->waiters)
+ res= EBUSY; /* Can't get lock */
+ else
+ {
+ res=0;
+ rwp->state++;
+ }
+ pthread_mutex_unlock(&rwp->lock);
+ return(res);
}
-int my_rw_wrlock( rw_lock_t *rwp ) {
+int my_rw_wrlock(rw_lock_t *rwp)
+{
pthread_mutex_lock(&rwp->lock);
- rwp->waiters++; /* another writer queued */
+ rwp->waiters++; /* another writer queued */
- while ( rwp->state )
- pthread_cond_wait( &rwp->writers, &rwp->lock);
+ while (rwp->state)
+ pthread_cond_wait(&rwp->writers, &rwp->lock);
rwp->state = -1;
- --rwp->waiters;
- pthread_mutex_unlock( &rwp->lock );
+ rwp->waiters--;
+ pthread_mutex_unlock(&rwp->lock);
+ return(0);
+}
- return( 0 );
+
+int my_rw_trywrlock(rw_lock_t *rwp)
+{
+ int res;
+ pthread_mutex_lock(&rwp->lock);
+ if (rwp->state)
+ res= EBUSY; /* Can't get lock */
+ else
+ {
+ res=0;
+ rwp->state = -1;
+ }
+ pthread_mutex_unlock(&rwp->lock);
+ return(res);
}
-int my_rw_unlock( rw_lock_t *rwp ) {
+
+int my_rw_unlock(rw_lock_t *rwp)
+{
DBUG_PRINT("rw_unlock",
("state: %d waiters: %d", rwp->state, rwp->waiters));
pthread_mutex_lock(&rwp->lock);
- if ( rwp->state == -1 ) { /* writer releasing */
- rwp->state = 0; /* mark as available */
+ if (rwp->state == -1) /* writer releasing */
+ {
+ rwp->state= 0; /* mark as available */
- if ( rwp->waiters ) /* writers queued */
+ if ( rwp->waiters ) /* writers queued */
pthread_cond_signal( &rwp->writers );
else
pthread_cond_broadcast( &rwp->readers );
- } else {
- if ( --rwp->state == 0 ) /* no more readers */
+ }
+ else
+ {
+ if ( --rwp->state == 0 ) /* no more readers */
pthread_cond_signal( &rwp->writers );
}
pthread_mutex_unlock( &rwp->lock );
-
- return( 0 );
+ return(0);
}
#endif
diff --git a/os2/BldLevel.RES b/os2/BldLevel.RES
new file mode 100644
index 00000000000..302d9fc875e
--- /dev/null
+++ b/os2/BldLevel.RES
Binary files differ
diff --git a/os2/BldLevel.cmd b/os2/BldLevel.cmd
index 2bc85a06abb..d98d8c9dfb9 100644
--- a/os2/BldLevel.cmd
+++ b/os2/BldLevel.cmd
@@ -4,7 +4,7 @@ REM I'm using resources for BLDLEVEL info, because VA4 linker has the bad
REM feature of using versionstring content for padding files.
REM To set fixpak level: -P"fixpak level"
-SET MYSQL_VERSION=3.23.42
-SET MYSQL_BUILD=1
+SET MYSQL_VERSION=3.23.50
+SET MYSQL_BUILD=B1
BldLevelInf -V%MYSQL_VERSION% -N"MySQL AB, Yuri Dario" -D"MySQL %MYSQL_VERSION% for OS/2 - Build %MYSQL_BUILD%" -Len BldLevel.rc
diff --git a/os2/BldLevel.rc b/os2/BldLevel.rc
index fe266a25c3c..ac028379892 100644
--- a/os2/BldLevel.rc
+++ b/os2/BldLevel.rc
@@ -1 +1 @@
-RCDATA 1 { "@#MySQL AB, Yuri Dario:3.23.42#@##1## 10 Sep 2001 11:57:17 paperino::en::::@@MySQL 3.23.42 for OS/2 - Build 1" }
+RCDATA 1 { "@#MySQL AB, Yuri Dario:3.23.50#@##1## 24 Jun 2002 22:42:20 paperino::en::::@@MySQL 3.23.50 for OS/2 - Build B1" }
diff --git a/os2/ChangeLog.os2 b/os2/ChangeLog.os2
index 8f2604c0453..7957906ad7d 100644
--- a/os2/ChangeLog.os2
+++ b/os2/ChangeLog.os2
@@ -1,4 +1,25 @@
+
+2002/05/02
+ - now libinit is automatically called on client dll startup
+
+2002/01/27
+ - fixed console output for get_password
+
+2002/01/20
+ - back-ported fix for fulltext indexes (wrong report by myisamchk)
+
+2001/11/21
+ - MySQL 3.32.42 build 3 released.
+
+2001/11/19
+ - got GNU Readline to compile with VAC++, now console has a working
+ history.
+
+2001/11/10
+ - fixed file locking on non-JFS disks; DosSetFileLocksL does not
+ support ranges > 2GB on non-JFS disks.
+
2001/09/16
- fixed creation directory of temporary files
- enabled cached list file for deleting temp open files
@@ -30,4 +51,3 @@
2001/05/19
- new TLS code, fixed parser crashes and many other problems.
- fixed pthread_cond_timedwait, now handle manager expires
-
diff --git a/os2/Makefile.am b/os2/Makefile.am
index 7e626e45cf8..9feab6d1b2c 100644
--- a/os2/Makefile.am
+++ b/os2/Makefile.am
@@ -16,14 +16,13 @@
## Process this file with automake to create Makefile.in
-EXTRA_DIST = BldLevel.cmd BldLevel.rc BldLevelInf.cmd ChangeLog.os2 \
- MySQL-All.icc MySQL-Client.icc MySQL-Client.irs \
- MySQL-Lib.icc MySQL-Opt.icc MySQL-ReadLine.icc \
- MySQL-Source.icc MySQL-Sql.icc MySQL-Util.icc MySQL-Util.irs \
- MySQL-binlog.icc MySQL-binlog.irs MySQL-sql.irs ReadMe.txt \
- build-all.cmd build-all.log mysql-inf.wis mysql.base \
- mysql.ih mysql.wis mysqlalt.wis readme.os2 rint.cmd rint.obj \
- rint.s
+EXTRA_DIST = BldLevel.RES BldLevel.cmd BldLevel.rc \
+ BldLevelInf.cmd ChangeLog.os2 MySQL-Client.icc \
+ MySQL-Opt.icc MySQL-Source.icc MySQL-Sql.icc \
+ MySQL-Sql.irs MySQL-Util.icc MySQL-Util.irs \
+ ReadMe.txt build-all.cmd mysql-inf.wis \
+ mysql.wis mysqlalt.wis rint.cmd rint.obj rint.s
+SUBDIRS = include
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/os2/MySQL-All.icc b/os2/MySQL-All.icc
deleted file mode 100644
index 1bd8a1dd89f..00000000000
--- a/os2/MySQL-All.icc
+++ /dev/null
@@ -1,13 +0,0 @@
-
-// create directories
-for dir in "..\\bin", "..\\lib", "..\\obj", "..\\obj\\zlib", "..\\obj\\readline" {
- run "if not exist "dir" mkdir "dir
-}
-
-// build sequence
-run "vacbld MySQL-Lib.icc -showprogress=10 -showwarning"
-run "vacbld MySQL-Client.icc -showprogress=10 -showwarning"
-run "vacbld MySQL-Sql.icc -showprogress=10 -showwarning"
-
-// need only for utilities and test applications
-run "vacbld MySQL-Util.icc -showprogress=10 -showwarning"
diff --git a/os2/MySQL-Client.icc b/os2/MySQL-Client.icc
index 7a41567f983..bc614c1c723 100644
--- a/os2/MySQL-Client.icc
+++ b/os2/MySQL-Client.icc
@@ -43,11 +43,13 @@ option ProjectOptions = MySQLOptions
// target source files
source type('cpp') "..\\client\\mysql.cc"
source BldLevelInfo
+ option define("HAVE_STRING_H", ), define("HAVE_CONFIG_H", )
+ {
+ source GnuReadline
+ }
}
}
- option file(genobject, "..\\OBJ\\READLINE\\")
- {
target "..\\bin\\mysqladmin.exe"
{
// optimized precompiled headers
@@ -59,7 +61,6 @@ option ProjectOptions = MySQLOptions
source type('cpp') "..\\client\\mysqladmin.c"
source BldLevelInfo
}
- }
target "..\\bin\\mysqldump.exe"
{
diff --git a/os2/MySQL-Client.irs b/os2/MySQL-Client.irs
deleted file mode 100644
index 4b5a9e3475a..00000000000
--- a/os2/MySQL-Client.irs
+++ /dev/null
@@ -1,2335 +0,0 @@
-31 Run Specifications: Version 1.1
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-39 E:\rd\mysql\vacpp-3.23.40\bin\mysql.exe
-1
-0
-0
-5 Local
-0
-44 E:\rd\mysql\vacpp-3.23.40\bin\mysqladmin.exe
-1
-0
-0
-5 Local
-0
-43 E:\rd\mysql\vacpp-3.23.40\bin\mysqldump.exe
-1
-0
-0
-5 Local
-0
-43 E:\rd\mysql\vacpp-3.23.40\bin\mysqlshow.exe
-1
-0
-0
-5 Local
-0
-45 E:\rd\mysql\vacpp-3.23.40\bin\mysqlimport.exe
-1
-0
-0
-5 Local
-0
-43 E:\rd\mysql\vacpp-3.23.40\bin\mysqltest.exe
-1
-0
-0
-5 Local
-0
diff --git a/os2/MySQL-Lib.icc b/os2/MySQL-Lib.icc
deleted file mode 100644
index 51f55ed8302..00000000000
--- a/os2/MySQL-Lib.icc
+++ /dev/null
@@ -1,72 +0,0 @@
-// disable code inlining when building static libs
-InlineCode = "no"
-
-// include common options
-include "MySQL-Opt.icc"
-include "MySQL-Source.icc"
-
-option ProjectOptions = MySQLOptions
-{
-
- option file(genobject, "..\\OBJ\\ZLIB\\")
- {
- target "..\\lib\\common.lib"
- {
- // optimized precompiled headers
- option macros('global', 'yes')
- {
- source type('cpp') client_pch //, 'sql_string.h'
- }
- // target source files
- source zlib
- if debug_build {
- source type('cpp') dbug
- }
- source type('cpp') heap
- //source type('cpp') merge
- source type('cpp') my_sys
- source type('cpp') my_sys_cli
- source type('cpp') my_sys_sql
- source type('cpp') strings
- }
- }
-
-/*
- option file(genobject, "..\\OBJ\\READLINE\\")
- {
- target "..\\lib\\readline.lib"
- {
- // optimized precompiled headers
- option macros('global', 'yes')
- {
- source type('cpp') client_pch //, 'sql_string.h'
- }
- // target source files
- source readline
- }
- }
-*/
-
- target "..\\lib\\myisam.lib"
- {
- // optimized precompiled headers
- option macros('global', 'yes')
- {
- source type('cpp') client_pch //, 'sql_string.h'
- }
- // target source files
- source type('cpp') myisam
- }
-
- target "..\\lib\\isam.lib"
- {
- // optimized precompiled headers
- option macros('global', 'yes')
- {
- source type('cpp') client_pch //, 'sql_string.h'
- }
- // target source files
- source type('cpp') isam
- }
-
-}
diff --git a/os2/MySQL-Opt.icc b/os2/MySQL-Opt.icc
index 7045f111d9b..56e89057862 100644
--- a/os2/MySQL-Opt.icc
+++ b/os2/MySQL-Opt.icc
@@ -1,6 +1,9 @@
// set to 1 to enable debug code
debug_build = 0
+// set to zlib relative directory name
+zlib_dir = '../../zlib-1.1.4'
+
// common options
option BaseOptions = link(defaultlibsname, "tcpip32.lib")
, link(libsearchpath, "..\\lib\\")
@@ -9,6 +12,7 @@ option BaseOptions = link(defaultlibsname, "tcpip32.lib")
, link(padding, no)
, link(linkwithmultithreadlib, "yes")
, link(linkwithsharedlib, "no")
+ , link(stack, 131072, 131072)
, gen(initauto, "yes")
, define("__MT__", )
, define("HAVE_BSD_SIGNALS", )
@@ -19,11 +23,12 @@ option BaseOptions = link(defaultlibsname, "tcpip32.lib")
, define("USE_TLS", )
, lang(signedchars, yes)
, incl(searchpath, "..")
+ , incl(searchpath, "include")
, incl(searchpath, "..\\include")
, incl(searchpath, "..\\my_sys")
, incl(searchpath, "..\\regex")
, incl(searchpath, "..\\sql")
- , incl(searchpath, "..\\..\\zlib-1.1.3")
+ , incl(searchpath, zlib_dir)
, incl(searchpath, "..\\..\\ufc")
, incl(searchpath, "..\\os2")
diff --git a/os2/MySQL-ReadLine.icc b/os2/MySQL-ReadLine.icc
deleted file mode 100644
index 3f63b0815e6..00000000000
--- a/os2/MySQL-ReadLine.icc
+++ /dev/null
@@ -1,27 +0,0 @@
-// disable code inlining when building static libs
-InlineCode = "no"
-
-// include common options
-include "MySQL-Opt.icc"
-include "MySQL-Source.icc"
-
-option ProjectOptions = MySQLOptions
-{
-
-
-
- option file(genobject, "..\\OBJ\\READLINE\\")
- {
- target "..\\lib\\readline.lib"
- {
- // optimized precompiled headers
- option macros('global', 'yes')
- {
- source type('cpp') client_pch //, 'sql_string.h'
- }
- // target source files
- source readline
- }
- }
-
-}
diff --git a/os2/MySQL-Source.icc b/os2/MySQL-Source.icc
index 134a64dc9b0..f4ac881c90e 100644
--- a/os2/MySQL-Source.icc
+++ b/os2/MySQL-Source.icc
@@ -30,7 +30,7 @@ group server_global_pch =
'm_string.h', 'm_ctype.h',
'myisam.h', 'myisampack.h', '.\myisam\myisamdef.h',
'sql_string.h', 'item.h', 'unireg.h',
- 'field.h', 'sql_lex.h', 'sql_list.h',
+ 'field.h', 'sql_lex.h', 'sql_list.h', 'sql_repl.h',
'md5.h', 'sql_acl.h', 'slave.h',
'ha_myisam.h', 'procedure.h', 'sql_select.h',
'errmsg.h', 't_ctype.h', 'direct.h',
@@ -57,12 +57,20 @@ group mysqlclientlib =
"..\\libmysql\\violite.c"
group zlib =
- "..\\..\\zlib-1.1.3\\compress.c", "..\\..\\zlib-1.1.3\\crc32.c",
- "..\\..\\zlib-1.1.3\\deflate.c", "..\\..\\zlib-1.1.3\\gzio.c", "..\\..\\zlib-1.1.3\\infblock.c",
- "..\\..\\zlib-1.1.3\\infcodes.c", "..\\..\\zlib-1.1.3\\inffast.c",
- "..\\..\\zlib-1.1.3\\inflate.c", "..\\..\\zlib-1.1.3\\inftrees.c",
- "..\\..\\zlib-1.1.3\\infutil.c", "..\\..\\zlib-1.1.3\\trees.c", "..\\..\\zlib-1.1.3\\uncompr.c",
- "..\\..\\zlib-1.1.3\\zutil.c", "..\\..\\zlib-1.1.3\\adler32.c"
+ zlib_dir "/compress.c",
+ zlib_dir "/crc32.c",
+ zlib_dir "/deflate.c",
+ zlib_dir "/gzio.c",
+ zlib_dir "/infblock.c",
+ zlib_dir "/infcodes.c",
+ zlib_dir "/inffast.c",
+ zlib_dir "/inflate.c",
+ zlib_dir "/inftrees.c",
+ zlib_dir "/infutil.c",
+ zlib_dir "/trees.c",
+ zlib_dir "/uncompr.c",
+ zlib_dir "/zutil.c",
+ zlib_dir "/adler32.c"
group ufc =
"..\\..\\ufc\\crypt.c",
@@ -118,6 +126,7 @@ group sql =
"..\\sql\\sql_class.cc",
"..\\sql\\sql_crypt.cc",
"..\\sql\\sql_db.cc",
+ "..\\sql\\sql_do.cc",
"..\\sql\\sql_delete.cc",
"..\\sql\\sql_insert.cc",
"..\\sql\\sql_lex.cc",
@@ -308,24 +317,32 @@ group strings =
group dbug = "..\\dbug\\dbug.c", "..\\dbug\\factorial.c", "..\\dbug\\sanity.c"
- group readline = "..\\readline\\bind.c", "..\\readline\\callback.c",
- "..\\readline\\complete.c", "..\\readline\\display.c",
- //"..\\readline\\emacs_keymap.c",
- "..\\readline\\funmap.c", "..\\readline\\histexpand.c",
- "..\\readline\\histfile.c", "..\\readline\\history.c",
- "..\\readline\\histsearch.c", "..\\readline\\input.c",
- "..\\readline\\isearch.c", "..\\readline\\keymaps.c",
- "..\\readline\\kill.c", "..\\readline\\macro.c",
- "..\\readline\\nls.c", "..\\readline\\parens.c",
- "..\\readline\\readline.c", "..\\readline\\rltty.c",
- "..\\readline\\search.c", "..\\readline\\shell.c",
- "..\\readline\\signals.c", "..\\readline\\terminal.c",
- "..\\readline\\tilde.c", "..\\readline\\undo.c",
- "..\\readline\\util.c",
- //"..\\readline\\vi_keymap.c",
- "..\\readline\\vi_mode.c", "..\\readline\\xmalloc.c"
-
group regex = "..\\regex\\regcomp.c", "..\\regex\\regerror.c",
"..\\regex\\regexec.c", "..\\regex\\regfree.c", "..\\regex\\reginit.c"
group BldLevelInfo = 'os2\BldLevel.rc'
+
+ group GnuReadline =
+ "..\\readline\\bind.c",
+ "..\\readline\\callback.c",
+ "..\\readline\\complete.c",
+ "..\\readline\\display.c",
+ "..\\readline\\funmap.c",
+ "..\\readline\\histexpand.c", "..\\readline\\histfile.c",
+ "..\\readline\\history.c", "..\\readline\\histsearch.c",
+ "..\\readline\\input.c", "..\\readline\\isearch.c",
+ "..\\readline\\keymaps.c",
+ "..\\readline\\kill.c",
+ "..\\readline\\macro.c",
+ "..\\readline\\nls.c", "..\\readline\\parens.c",
+ "..\\readline\\readline.c",
+ "..\\readline\\rltty.c",
+ "..\\readline\\search.c",
+ "..\\readline\\shell.c",
+ "..\\readline\\signals.c",
+ "..\\readline\\terminal.c",
+ "..\\readline\\tilde.c",
+ "..\\readline\\undo.c",
+ "..\\readline\\util.c",
+ "..\\readline\\vi_mode.c",
+ "..\\readline\\xmalloc.c"
diff --git a/os2/MySQL-binlog.irs b/os2/MySQL-Sql.irs
index 8d094544f1c..b651a678c91 100644
--- a/os2/MySQL-binlog.irs
+++ b/os2/MySQL-Sql.irs
@@ -1,5 +1,5 @@
31 Run Specifications: Version 1.1
-45 E:\rd\mysql\vacpp-3.23.40\bin\mysqlbinlog.exe
+40 E:\rd\MySQL\vacpp-3.23.50\bin\mysqld.exe
1
0
0
diff --git a/os2/MySQL-Util.icc b/os2/MySQL-Util.icc
index 5a7ae2959b9..36fd499e520 100644
--- a/os2/MySQL-Util.icc
+++ b/os2/MySQL-Util.icc
@@ -153,6 +153,7 @@ option ProjectOptions = MySQLOptions
}
}
*/
+
target "..\\bin\\test\\insert_test.exe"
{
// optimized precompiled headers
@@ -179,4 +180,4 @@ option ProjectOptions = MySQLOptions
}
run after sources('..\bin\gen_lex_hash.exe') targets('..\sql\lex_hash.h')
- '..\bin\gen_lex_has.exe > ..\sql\lex_hash.h'
+ 'cd ..\bin & ..\bin\gen_lex_hash.exe > ..\sql\lex_hash.h'
diff --git a/os2/MySQL-Util.irs b/os2/MySQL-Util.irs
index 01a1f62a483..183aa13ba27 100644
--- a/os2/MySQL-Util.irs
+++ b/os2/MySQL-Util.irs
@@ -1,3065 +1,3269 @@
31 Run Specifications: Version 1.1
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamchk.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-43 E:\rd\mysql\vacpp-3.23.40\bin\myisamlog.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-44 E:\rd\mysql\vacpp-3.23.40\bin\myisampack.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-47 E:\rd\mysql\vacpp-3.23.40\bin\test\is_test1.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-47 E:\rd\mysql\vacpp-3.23.40\bin\test\is_test2.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-47 E:\rd\mysql\vacpp-3.23.40\bin\test\mi_test1.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-47 E:\rd\mysql\vacpp-3.23.40\bin\test\mi_test2.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-46 E:\rd\mysql\vacpp-3.23.40\bin\test\ft_eval.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-47 E:\rd\mysql\vacpp-3.23.40\bin\test\ft_test1.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-51 E:\rd\mysql\vacpp-3.23.40\bin\test\test_charset.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-47 E:\rd\mysql\vacpp-3.23.40\bin\test\hp_test1.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-47 E:\rd\mysql\vacpp-3.23.40\bin\test\hp_test2.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-47 E:\rd\mysql\vacpp-3.23.40\bin\test\thr_lock.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-50 E:\rd\mysql\vacpp-3.23.40\bin\test\insert_test.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-50 E:\rd\mysql\vacpp-3.23.40\bin\test\select_test.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
1
0
0
5 Local
0
-50 E:\rd\mysql\vacpp-3.23.40\bin\test\thread_test.exe
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamchk.exe
+1
+0
+0
+5 Local
+0
+43 E:\rd\MySQL\vacpp-3.23.50\bin\myisamlog.exe
+1
+0
+0
+5 Local
+0
+44 E:\rd\MySQL\vacpp-3.23.50\bin\myisampack.exe
+1
+0
+0
+5 Local
+0
+47 E:\rd\MySQL\vacpp-3.23.50\bin\test\comp_err.exe
+1
+0
+0
+5 Local
+0
+46 E:\rd\MySQL\vacpp-3.23.50\bin\gen_lex_hash.exe
+1
+0
+0
+5 Local
+0
+47 E:\rd\MySQL\vacpp-3.23.50\bin\test\is_test1.exe
+1
+0
+0
+5 Local
+0
+47 E:\rd\MySQL\vacpp-3.23.50\bin\test\is_test2.exe
+1
+0
+0
+5 Local
+0
+47 E:\rd\MySQL\vacpp-3.23.50\bin\test\mi_test1.exe
+1
+0
+0
+5 Local
+0
+47 E:\rd\MySQL\vacpp-3.23.50\bin\test\mi_test2.exe
+1
+0
+0
+5 Local
+0
+46 E:\rd\MySQL\vacpp-3.23.50\bin\test\ft_eval.exe
+1
+0
+0
+5 Local
+0
+47 E:\rd\MySQL\vacpp-3.23.50\bin\test\ft_test1.exe
+1
+0
+0
+5 Local
+0
+51 E:\rd\MySQL\vacpp-3.23.50\bin\test\test_charset.exe
+1
+0
+0
+5 Local
+0
+47 E:\rd\MySQL\vacpp-3.23.50\bin\test\hp_test1.exe
+1
+0
+0
+5 Local
+0
+47 E:\rd\MySQL\vacpp-3.23.50\bin\test\hp_test2.exe
+1
+0
+0
+5 Local
+0
+50 E:\rd\MySQL\vacpp-3.23.50\bin\test\insert_test.exe
+1
+0
+0
+5 Local
+0
+50 E:\rd\MySQL\vacpp-3.23.50\bin\test\select_test.exe
+1
+0
+0
+5 Local
+0
+50 E:\rd\MySQL\vacpp-3.23.50\bin\test\thread_test.exe
1
0
0
diff --git a/os2/MySQL-binlog.icc b/os2/MySQL-binlog.icc
deleted file mode 100644
index d441198f5e0..00000000000
--- a/os2/MySQL-binlog.icc
+++ /dev/null
@@ -1,68 +0,0 @@
-// disable code inlining when building static libs
-InlineCode = "no"
-
-// include common options
-include "MySQL-Opt.icc"
-include "MySQL-Source.icc"
-
-option ProjectOptions = MySQLOptions
- , define( "MYSQL_SERVER", "")
- , link(defaultlibsname, "common.lib")
- , link(defaultlibsname, "myisam.lib")
- , link(defaultlibsname, "isam.lib")
- , link(defaultlibsname, "mysql.lib")
-{
- option define( "MYSQL_SERVER", "")
- {
- target "..\\bin\\mysqlbinlog.exe"
- {
- // optimized precompiled headers
- option macros('global', 'yes')
- {
- source type('cpp') 'os2.h'
- source type('cpp') 'errno.h', 'nerrno.h'
- source type('cpp') 'config-os2.h', 'mysql_com.h'
-/*
- source type('cpp')
- 'global.h', 'my_base.h', 'config-os2.h',
- 'my_dir.h', 'my_sys.h', 'mysql.h',
- 'my_bitmap.h', 'violite.h',
- 'mysql_priv.h',
- 'm_string.h'
-*/
- }
- // target source files
- source type('cpp')
- "..\\sql\\mysqlbinlog.cc"
- option macros('global', 'yes')
- {
- source type('cpp') 'sys/stat.h'
- }
- source type('cpp') "..\\sql\\mini_client.cc"
- option macros('global', 'yes')
- {
- source type('cpp') 'os2.h'
- source type('cpp') 'math.h'
- source type('cpp') 'stdio.h'
- source type('cpp') 'stdlib.h'
- source type('cpp') 'stddef.h'
- source type('cpp') 'limits.h'
- source type('cpp') 'sys/types.h'
- source type('cpp') 'sys/time.h'
- source type('cpp') 'types.h'
- source type('cpp') 'stdarg.h'
- source type('cpp') 'string.h'
- }
- source type('cpp') "..\\sql\\net_serv.cc",
- "..\\sql\\mini_client_errors.c"
- option macros('global', 'yes')
- {
- source type('cpp') 'assert.h'
- }
- source type('cpp') "..\\sql\\violite.c",
- "..\\sql\\password.c"
- //"..\\sql\\thr_malloc.cc"
- }
- }
-
-}
diff --git a/os2/MySQL-sql.irs b/os2/MySQL-sql.irs
deleted file mode 100644
index dc0b016d8d4..00000000000
--- a/os2/MySQL-sql.irs
+++ /dev/null
@@ -1,13 +0,0 @@
-31 Run Specifications: Version 1.1
-40 E:\rd\mysql\vacpp-3.23.40\bin\mysqld.exe
-1
-0
-0
-5 Local
-0
-40 E:\rd\mysql\vacpp-3.23.40\bin\mysqld.exe
-1
-0
-0
-5 Local
-0
diff --git a/os2/ReadMe.txt b/os2/ReadMe.txt
index 1a8158df4bf..073c65290c0 100644
--- a/os2/ReadMe.txt
+++ b/os2/ReadMe.txt
@@ -6,7 +6,6 @@ Welcome to the latest port of MySQL for OS/2 and eComStation.
Modules included in this build:
- protocol data compression
- - transaction support
- perl BDB/BDI support (not in this package)
- Library and header files for C/CPP developers included
@@ -24,7 +23,7 @@ some files may be in the public domain.
The latest information about MySQL can be found at: http://www.mysql.com
To get the latest information about this port please subscribe to our
-newsgroup/mailinglist mysql2 at www.egroups.com.
+newsgroup/mailinglist mysql2 at groups.yahoo.com.
To see what MySQL can do, take a look at the features section in the
manual. For future plans see the TODO appendix in the manual.
@@ -58,7 +57,7 @@ Prerequisite:
OS/2 Warp Server for e-Business,
eComStation 1.0 (prev 1/2 OK)
- TCPIP 4.x installed (requires 32-bit tcpip stack)
-- WarpIN installer 0.9.14 (ftp://ftp.os2.org/xworkplace/warpin-0-9-14.exe)
+- WarpIN installer 0.9.16 (ftp://ftp.os2.org/xworkplace/warpin-0-9-16.exe)
Note: probably some fixpak level is required on both Warp3&Warp4 to
support >2GB file sizes.
@@ -67,7 +66,7 @@ Save the installation archives into a temporary folder and double click
on the main package; otherwise you can drop the mysql package in your
WarpIN object or type
- WARPIN MYSQL-3-23-??-BLD1.WPI
+ WARPIN MYSQL-3-23-??-B1.WPI
from the command line.
The configuration file for MySQL is named my.cnf and it is placed into
@@ -75,9 +74,9 @@ your %ETC% directory. Usually it located into the boot driver under
x:\MPTN\ETC
-If the installation detect an existing configuration file, this will be
-renamed to my.cnf.bak; your current settings aren't migrated to current
-installation. This file is not deleted by uninstall process.
+If the installation detect an existing configuration file, it will not be
+overwritten, keeping you settings; see x:\...\mysql\data\my.cnf.sample
+for new settings. This file is not deleted by uninstall process.
Startup options for MySQL daemon could be added there.
As default, client connections uses data compression: if you don't like it,
@@ -93,6 +92,19 @@ default into mysql\bin together with client applications. Copy it to your
x:\OS2\DLL or another directory in your LIBPATH to run command line
utilities from every place.
+See documentation for manuals installation.
+
+
+New features
+------------
+With build 4, the sql daemon supports a new option
+
+ --preload-client-dll
+
+that enables preloading of mysql.dll and mysqlu.dll directly by the
+server. This way, client programs doesn't need to have the dll's in
+the current libpath.
+
Documentation
-------------
@@ -102,7 +114,7 @@ INF documentation (requires OS/2 view or NewView).
The PDF documentation is found in
- MYSQL-3-23-42-PDF.WPI
+ MYSQL-3-23-??-PDF.WPI
and the INF documentation is found in
@@ -115,6 +127,9 @@ The INF documentation could contain errors because of semi-automatic
translation from texi original. Also it is not updated as the latest PDF
manual (sorry, but conversion from texi to ipf requires quite a lot of
work).
+To install the manuals, their WPI must be placed in the same directory
+of the main WPI package: once the main package installation is started,
+new install options will be available (inf or pdf manual).
Support
@@ -136,6 +151,7 @@ Since this software is ported for free, donations are welcome!
You can get also an extended support, which is not free and subject to
custom rates.
Ask in the mailing list for details.
+At least, a post card is welcome!
Know problems
@@ -161,8 +177,20 @@ All questions that are specific to the OS2/eComStation version should
be posted to this list! Please remember to include all relevant
information that may help solve your problem.
+
Building MySQL (VAC++ 4)
------------------------
+Place zlib-1.1.4 at the same level of mysql-3.23.50
+Place ufc lib at the same level of mysql-3.23.50
+
+Add the following files:
+ include\config-os2.h
+ include\mysql_version.h
+ mysys\my_os2*.*
+Get the following files from Windows source distribution:
+ strings\ctype_extra_sources.c
+ libmysql\dll.c
+
Apply file and patches found in the src\ directory (if exists).
Create the following subdirectories
diff --git a/os2/build-all.cmd b/os2/build-all.cmd
index 9cb9ef6ea44..23558946c79 100644
--- a/os2/build-all.cmd
+++ b/os2/build-all.cmd
@@ -5,7 +5,6 @@ mkdir ..\lib
mkdir ..\obj
mkdir ..\obj\zlib
-vacbld MySQL-Lib.icc -showprogress=10 -showwarning >> build-all.log
vacbld MySQL-Client.icc -showprogress=10 -showwarning >> build-all.log
vacbld MySQL-Sql.icc -showprogress=10 -showwarning >> build-all.log
vacbld MySQL-Util.icc -showprogress=10 -showwarning >> build-all.log
diff --git a/os2/build-all.log b/os2/build-all.log
deleted file mode 100644
index a5a64db316f..00000000000
--- a/os2/build-all.log
+++ /dev/null
@@ -1,39 +0,0 @@
-Item 237 of 47475 (0%) ... source file ..\mysys\list.c
-Item 4357 of 29226 (15%) ... source region "extern int _Optlink _spawnve(int, const char *, const char ..."
-Item 10021 of 16290 (62%) ... initializer [0x7319920] for uchar to_upper_latin1[]
-Item 11487 of 15248 (75%) ... kernel-provided extension source file \rd\mysql\zlib-1.1.3\crc32.c
-Item 12920 of 15380 (84%) ... body of function [0x6dca980] int my_strcoll_czech(const uchar *, const uchar *)
-Item 13952 of 16411 (85%) ... output object file E:\rd\mysql\vacpp-3.23.33\os2\ft_search.obj
-Item 14083 of 16542 (85%) ... publish library or executable marker
-Item 1278 of 16668 (8%) ... source region "typedef STARTDATA *PSTARTDATA;"
-Item 6013 of 8617 (70%) ... kernel-provided extension source file \rd\mysql\zlib-1.1.3\trees.c
-Item 6962 of 8581 (81%) ... initializer [0x229bf00] for const char @485 (static target)[23] "Failed in mysql_init()"
-Item 7519 of 9019 (83%) ... initializer [0x2337bc0] for const char @630 (static target)[20] "No query specified
-"
-Item 8502 of 10001 (85%) ... publish library or executable marker
-Item 182 of 49201 (0%) ... source file ..\myisam\mi_statrec.c
-Item 2136 of 46089 (5%) ... source region "class Item_sum_udf_float :public Item_udf_sum { public: Item_sum_udf_float ..."
-Item 11112 of 25912 (43%) ... source region "extern uint _nisam_get_key(N_KEYDEF *keyinfo ..."
-Item 13919 of 24304 (57%) ... initializer [0x1ec6f10] for const short yypgoto[]
-Item 15179 of 23800 (64%) ... kernel-provided extension source file \rd\mysql\zlib-1.1.3\trees.c
-Item 17342 of 24056 (72%) ... initializer [0x29d1180] for __vftType __vft10Field_date5Field[46]
-Item 17912 of 24406 (73%) ... body of function [0x1d1df40] void Item_func_case::print(String *)
-Item 18247 of 24721 (74%) ... template instantiation (0x2b9dd20) of declaration of class I_List<thread_info> (2b9dc20)
-Item 18775 of 25165 (75%) ... initializer [0x2c45600] for __vftType __vft18Item_func_get_lock4Item[34]
-Item 19066 of 25369 (75%) ... initializer [0x2c800d0] for const char @2105 (static target)[22] "parser stack overflow"
-Item 19395 of 25535 (76%) ... body of function [0x171eef0] db_type ha_checktype(db_type)
-Item 19682 of 25654 (77%) ... body of function [0x17f1860] void kill_mysql()
-Item 20070 of 25717 (78%) ... body of function [0x183e570] Item *create_func_date_format(Item *, Item *)
-Item 20541 of 25764 (80%) ... body of function [0x1802b40] uint acl_get(const char *, const char *, const char *, const char *, const char *)
-Item 21017 of 25874 (81%) ... body of function [0x2c55180] String *field_str::get_max_arg(String *)
-Item 21406 of 25988 (82%) ... initializer [0x372d950] for const char @2567 (static target)[7] "%s(%d)"
-Item 22411 of 25867 (87%) ... body of function [0x161b160] Item_func_udf_int::Item_func_udf_int(udf_func *)
-Item 23345 of 25805 (90%) ... initializer [0x3447840] for const char @2709 (static target)[27] "waiting for handler insert"
-Item 23783 of 26226 (91%) ... initializer [0x39a95b0] for const char @2766 (static target)[25] "Creating delayed handler"
-Item 24887 of 27330 (91%) ... body of function [0x2b075a0] Item_load_file::~Item_load_file()
-Item 25018 of 27461 (91%) ... body of function [0x2cf5e50] Item_sum::Item_sum()
-Item 25267 of 27710 (91%) ... body of function [0x1c93d80] bool select_export::send_data(List<Item> &)
-Item 25484 of 27927 (91%) ... body of function [0x116e840] Item *create_func_ascii(Item *)
-Item 3212 of 9073 (35%) ... source region "extern int _mi_cmp_static_record(MI_INFO *info,const byte ..."
-Item 7171 of 8564 (84%) ... code csect _test_handle from library E:\bin\IBMCPP40\LIB\CPPRMS40.LIB
-Item 8345 of 9738 (86%) ... target E:\rd\mysql\vacpp-3.23.33\os2\..\bin\test\testhash.exe
diff --git a/os2/include/Makefile.am b/os2/include/Makefile.am
new file mode 100644
index 00000000000..b0478e7c470
--- /dev/null
+++ b/os2/include/Makefile.am
@@ -0,0 +1,23 @@
+# Copyright (C) 2002 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to create Makefile.in
+
+EXTRA_DIST = config.h pwd.h sgtty.h termio.h
+SUBDIRS = sys
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/os2/include/config.h b/os2/include/config.h
new file mode 100644
index 00000000000..bb1e3d9bb0f
--- /dev/null
+++ b/os2/include/config.h
@@ -0,0 +1,13 @@
+#include <config-os2.h>
+#include <types.h>
+
+#undef HAVE_POSIX_SIGNALS
+#undef HAVE_BSD_SIGNALS
+#define TERMIO_TTY_DRIVER
+
+#define ScreenCols() 80
+#define ScreenRows() 25
+
+#define tputs(a,b,c) puts(a)
+#define kbhit _kbhit
+//#define _read_kbd(a, b, c) _kbhit()
diff --git a/os2/include/pwd.h b/os2/include/pwd.h
new file mode 100644
index 00000000000..ec283586db2
--- /dev/null
+++ b/os2/include/pwd.h
@@ -0,0 +1 @@
+/* dummy */
diff --git a/os2/include/sgtty.h b/os2/include/sgtty.h
new file mode 100644
index 00000000000..ec283586db2
--- /dev/null
+++ b/os2/include/sgtty.h
@@ -0,0 +1 @@
+/* dummy */
diff --git a/os2/include/sys/Makefile.am b/os2/include/sys/Makefile.am
new file mode 100644
index 00000000000..b68f968aafe
--- /dev/null
+++ b/os2/include/sys/Makefile.am
@@ -0,0 +1,22 @@
+# Copyright (C) 2002 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+## Process this file with automake to create Makefile.in
+
+EXTRA_DIST = file.h
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%
diff --git a/os2/include/sys/file.h b/os2/include/sys/file.h
new file mode 100644
index 00000000000..ec283586db2
--- /dev/null
+++ b/os2/include/sys/file.h
@@ -0,0 +1 @@
+/* dummy */
diff --git a/os2/include/termio.h b/os2/include/termio.h
new file mode 100644
index 00000000000..cad88caccf9
--- /dev/null
+++ b/os2/include/termio.h
@@ -0,0 +1,156 @@
+/* sys/termio.h (emx+gcc) */
+
+#ifndef _SYS_TERMIO_H
+#define _SYS_TERMIO_H
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+/* Request codes */
+
+#if !defined (TCGETA)
+#define TCGETA 1
+#define TCSETA 2
+#define TCSETAW 3
+#define TCSETAF 4
+#define TCFLSH 5
+#define TCSBRK 6
+#define TCXONC 7
+#endif
+
+/* c_cc indexes */
+
+#if !defined (VINTR) /* Symbols common to termio.h and termios.h */
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VEOL 5
+#define VMIN 6
+#define VTIME 7
+#endif
+
+#define NCC 8 /* Number of the above */
+
+/* c_iflag, emx ignores most of the following bits */
+
+#if !defined (IGNBRK) /* Symbols common to termio.h and termios.h */
+#define IGNBRK 0x0001
+#define BRKINT 0x0002
+#define IGNPAR 0x0004
+#define PARMRK 0x0008
+#define INPCK 0x0010
+#define ISTRIP 0x0020
+#define INLCR 0x0040
+#define IGNCR 0x0080
+#define ICRNL 0x0100
+#define IUCLC 0x0200
+#define IXON 0x0400
+#define IXANY 0x0800
+#define IXOFF 0x1000
+#define IDELETE 0x8000 /* Extension (emx) */
+#endif
+
+/* c_oflag, emx ignores all of the following bits */
+
+#if !defined (OPOST) /* Symbols common to termio.h and termios.h */
+#define OPOST 0x0001
+#endif
+#define OLCUC 0x0002
+#define ONLCR 0x0004
+#define OCRNL 0x0008
+#define ONOCR 0x0010
+#define ONLRET 0x0020
+#define OFILL 0x0040
+#define OFDEL 0x0080
+#define NLDLY 0x0100 /* Mask */
+#define NL0 0x0000
+#define NL1 0x0100
+#define CRDLY 0x0600 /* Mask */
+#define CR0 0x0000
+#define CR1 0x0200
+#define CR2 0x0400
+#define CR3 0x0600
+#define TABDLY 0x1800 /* Mask */
+#define TAB0 0x0000
+#define TAB1 0x0800
+#define TAB2 0x1000
+#define TAB3 0x1800
+#define BSDLY 0x2000 /* Mask */
+#define BS0 0x0000
+#define BS1 0x2000
+#define VTDLY 0x4000 /* Mask */
+#define VT0 0x0000
+#define VT1 0x4000
+#define FFDLY 0x8000 /* Mask */
+#define FF0 0x0000
+#define FF1 0x8000
+
+/* c_cflag, emx ignores all of the following bits */
+
+#if !defined (CBAUD)
+#define CBAUD 0x000f /* Mask */
+#endif
+#if !defined (B0) /* Symbols common to termio.h and termios.h */
+#define B0 0x0000
+#define B50 0x0001
+#define B75 0x0002
+#define B110 0x0003
+#define B134 0x0004
+#define B150 0x0005
+#define B200 0x0006
+#define B300 0x0007
+#define B600 0x0008
+#define B1200 0x0009
+#define B1800 0x000a
+#define B2400 0x000b
+#define B4800 0x000c
+#define B9600 0x000d
+#define B19200 0x000e
+#define B38400 0x000f
+#define CSIZE 0x0030 /* Mask */
+#define CS5 0x0000
+#define CS6 0x0010
+#define CS7 0x0020
+#define CS8 0x0030
+#define CSTOPB 0x0040
+#define CREAD 0x0080
+#define PARENB 0x0100
+#define PARODD 0x0200
+#define HUPCL 0x0400
+#define CLOCAL 0x0800
+#define LOBLK 0x1000
+#endif
+
+/* c_lflag, emx ignores some of the following bits */
+
+#if !defined (ISIG) /* Symbols common to termio.h and termios.h */
+#define ISIG 0x0001
+#define ICANON 0x0002
+#define XCASE 0x0004
+#define ECHO 0x0008
+#define ECHOE 0x0010
+#define ECHOK 0x0020
+#define ECHONL 0x0040
+#define NOFLSH 0x0080
+#define IDEFAULT 0x8000 /* Extension (emx) */
+#endif
+
+
+struct termio
+{
+ unsigned int c_iflag;
+ unsigned int c_oflag;
+ unsigned int c_cflag;
+ unsigned int c_lflag;
+ unsigned int c_line;
+ unsigned char c_cc[NCC];
+};
+
+#if defined (__cplusplus)
+}
+#endif
+
+#endif /* not _SYS_TERMIO_H */
diff --git a/os2/mysql.base b/os2/mysql.base
deleted file mode 100644
index 4f0886e0697..00000000000
--- a/os2/mysql.base
+++ /dev/null
@@ -1,127 +0,0 @@
-#include "mysql.ih"
-
-<WARPIN VERSION <$WARPIN_VERSION>>
-<HEAD>
-
-<PCK INDEX=1
- PACKAGEID="TCX Datakonsult AB\MySQL for OS/2\SQL Database Engine\<$MySQL\Ver>"
- TARGET="?:\usr\local\mysql" BASE
- TITLE="SQL Database Engine"
- EXECUTE="$(1)\bootstrap.cmd [bootstrap]"
- CONFIG.SYS="SET EMXOPT=-h1024 | UNIQUE(-h)"
- CREATEOBJECT="WPFolder|MySQL <$MySQL.Ver>|<WP_DESKTOP>|OBJECTID=<MYSQL_<$MySQL.Major>_<$MySQL.Minor>_FOLDER>"
- CREATEOBJECT="WPProgram|Console|<MYSQL_<$MySQL.Major>_<$MySQL.Minor>_FOLDER>|EXENAME=$(1)\bin\mysql.exe;STARTUPDIR=$(1)\bin;ICONFILE=$(1)\bin\icons\mysql-client.ico;OBJECTID=<MYSQL_<$MySQL.Major>_<$MySQL.Minor>_CONSOLE>;"
- CREATEOBJECT="WPProgram|Start server|<MYSQL_<$MySQL.Major>_<$MySQL.Minor>_FOLDER>|EXENAME=$(1)\bin\mysqld.exe;ICONFILE=$(1)\bin\icons\mysql-startserver.ico;OBJECTID=<MYSQL_<$MySQL.Major>_<$MySQL.Minor>_START>;"
- CREATEOBJECT="WPProgram|Shutdown server|<MYSQL_<$MySQL.Major>_<$MySQL.Minor>_FOLDER>|EXENAME=$(1)\bin\mysqladmin.exe;STARTUPDIR=$(1)\bin;PARAMETERS=-u root shutdown;ICONFILE=$(1)\bin\icons\mysql-shutdownserver.ico;OBJECTID=<MYSQL_<$MySQL.Major>_<$MySQL.Minor>_SHUTDOWN>;"
- CREATEOBJECT="WPProgram|Readme first|<MYSQL_<$MySQL.Major>_<$MySQL.Minor>_FOLDER>|EXENAME=e.exe;PARAMETERS=$(1)\readme.os2;OBJECTID=<MYSQL_<$MySQL.Major>_<$MySQL.Minor>_README>;"
- SELECT
- >This package will install MySQL for OS/2 SQL engine
-</PCK>
-
-<PCK INDEX=2
- PACKAGEID="TCX Datakonsult AB\MySQL for OS/2\Developement Kit\<$MySQL\Ver>"
- TARGET="?:\usr\local\mysql"
- TITLE="Developement Kit"
- SELECT
- >This package will install MySQL for OS/2 sdk
-</PCK>
-
-<PCK INDEX=3
- PACKAGEID="TCX Datakonsult AB\MySQL for OS/2\PDF manual\<$MySQL\Ver>"
- TARGET="?:\usr\local\mysql"
- TITLE="PDF manual"
- EXTERNAL="mysql-3-23-28-gamma-pdf.wpi"
- CREATEOBJECT="WPShadow|PDF Manual|<MYSQL_<$MySQL.Major>_<$MySQL.Minor>_FOLDER>|SHADOWID=$(1)\docs\manual.pdf"
- SELECT
- >This package will install MySQL for OS/2 documentation
-</PCK>
-
-<PCK INDEX=4
- PACKAGEID="TCX Datakonsult AB\MySQL for OS/2\INF manual\<$MySQL\Ver>"
- TARGET="?:\usr\local\mysql"
- TITLE="INF manual"
- EXTERNAL="mysql-3-23-28-gamma-inf.wpi"
- CREATEOBJECT="WPProgram|MySQL Manual|<MYSQL_<$MySQL.Major>_<$MySQL.Minor>_FOLDER>|EXENAME=view.exe;PARAMETERS=$(1)\docs\manual.inf;ICONFILE=$(1)\bin\icons\mysql-manual.ico;OBJECTID=<MYSQL_<$MySQL.Major>_<$MySQL.Minor>_INFMANUAL>;"
- SELECT
- >This package will install MySQL for OS/2 documentation
-</PCK>
-
-<PCK INDEX=5
- PACKAGEID="TCX Datakonsult AB\MySQL for OS/2\Test suite\<$MySQL\Ver>"
- TARGET="?:\usr\local\mysql"
- TITLE="Test suite"
- EXTERNAL="mysql-<$MySQL-Ver>-test.wpi"
- CREATEOBJECT="WPProgram|Run MySQL Test Suite|<MYSQL_<$MySQL.Major>_<$MySQL.Minor>_FOLDER>|EXENAME=$(5)\mysql-test\mysql-test.cmd;PARAMETERS=$(1)\docs\manual.inf;ICONFILE=$(1)\bin\icons\mysql-manual.ico;OBJECTID=<MYSQL_<$MySQL.Major>_<$MySQL.Minor>_TESTSUITE>;"
- SELECT
- >This package will install MySQL for OS/2 test suite
-</PCK>
-
-</HEAD>
-
-<!-- Here come the different pages. They are linked by
- the <NEXTBUTTON> tags, which must have a target.
- Each page must have a TYPE= attribute, which tells
- WarpIn what will be visible on that page. -->
-
-<BODY>
-
-<!-- page1: introduction ->>
-<PAGE INDEX=1 TYPE=README>
-<TEXT>
-</TEXT>
-<NEXTBUTTON TARGET=2>~Next</NEXTBUTTON>
-<README FORMAT=HTML>
-
-<P>Welcome to the latest port of MySQL for <B>OS/2 and eComStation</B>.
-
-<P>You are about to install <B>MySQL <$MySQL.Ver></B>
-
-<BR>
-<BR>
-<P>Select "Next" to continue.
-
-<P>Select "Cancel" to abort installation.
-</README>
-</PAGE>
-
-<!-- show readme.os2 -->
-<PAGE INDEX=2 TYPE=README>
-<NEXTBUTTON TARGET=3>~Next</NEXTBUTTON>
-<TEXT>
-</TEXT>
-<README FORMAT=PLAIN EXTRACTFROMPCK="1">readme.os2</README>
-</PAGE>
-
-<!-- show GPL license -->
-<PAGE INDEX=3 TYPE=README>
-<NEXTBUTTON TARGET=4>~I agree</NEXTBUTTON>
-<TEXT>
-By pressing the "I agree" button, you agree to all terms and conditions to the below licence agreement.
-</TEXT>
-<README FORMAT=HTML EXTRACTFROMPCK="1">license.htm</README>
-</PAGE>
-
-
-<!-- The TYPE=CONTAINER will list the packages which can be installed. -->
-
-<PAGE INDEX=4 TYPE=CONTAINER>
-<NEXTBUTTON TARGET=5>~Next</NEXTBUTTON>
-<TEXT>
-Please select the packages which are to be installed. You may change the target paths for the packages.
-</TEXT>
-</PAGE>
-
-<!-- Here's another TYPE=TEXT page before we install.
- The special target "0" indicates that after this page we
- should start installation.
- Note that the TYPE=INSTALL page (which we had in Alpha #3)
- is no longer supported. -->
-
-<PAGE INDEX=5 TYPE=TEXT>
-<NEXTBUTTON TARGET=0>I~nstall</NEXTBUTTON>
-<TEXT>
-Press "Install" to begin installing this archive.</TEXT>
-</PAGE>
-
-</BODY>
-</WARPIN>
diff --git a/os2/mysql.ih b/os2/mysql.ih
deleted file mode 100644
index 71978c4135a..00000000000
--- a/os2/mysql.ih
+++ /dev/null
@@ -1,7 +0,0 @@
-#define WARPIN_VERSION "0.9.12"
-#define MySQL.Major 3
-#define MySQL.Minor 23
-#define MySQL.Rev 40
-#define MySQL\VER 3\23\40
-#define MySQL.VER 3.23.40
-#define MySQL-VER 3-23-40
diff --git a/os2/readme.os2 b/os2/readme.os2
deleted file mode 100644
index 9936dd15369..00000000000
--- a/os2/readme.os2
+++ /dev/null
@@ -1,190 +0,0 @@
-MySQL 3.23.40 for OS/2 Warp build 1
-====================================================
-
-Contents
---------
-Welcome to the latest port of MySQL for OS/2 and eComStation.
-
-Modules included in this build:
- - protocol data compression
- - transaction support
- - perl BDB/BDI support (not in this package)
- - Library and header files for C/CPP developers included
-
-This package has been built using IBM VAC++ 4.0
-
-The MySQL server is distributed under the GPL license. Please refer to
-the file COPYING for the license information.
-
-The MySQL client library is distributed under the LGPL license.
-Please refer to the file COPYING for the license information.
-
-Most of the MySQL clients are distributed under the GPL license, but
-some files may be in the public domain.
-
-The latest information about MySQL can be found at: http://www.mysql.com
-
-To get the latest information about this port please subscribe to our
-newsgroup/mailinglist mysql2 at www.egroups.com.
-
-To see what MySQL can do, take a look at the features section in the
-manual. For future plans see the TODO appendix in the manual.
-
-New features/bug fixes history is in the news appendix in the manual.
-
-For the currently known bugs/misfeatures (known errors) see the bugs
-appendix in the manual. The OS/2 section contains notes that are
-specific to the MySQL OS/2 and eComStation version.
-
-Please note that MySQL is a constantly moving target. New builds for
-Linux are made available every week. This port may therefore be a few
-minor versions after the latest Linux/Win32 builds but its generally
-more stable than the "latest and greates" port.
-
-MySQL is brought to you by: TcX DataKonsult AB & MySQL Finland AB
-
-This port is brought to you by:
-
-Yuri Dario <mc6530@mclink.it>, development, porting
-Timo Maier <tam@gmx.de>, documentation, testing
-John M Alfredsson <jma@jmast.se>, documentation, testing
-
-
-Installation
-------------
-Prerequisite:
-
-- OS/2 Warp 3 with FP ?? or later,
- OS/2 Warp 4 with FP ?? or later,
- OS/2 Warp Server for e-Business,
- eComStation 1.0 (prev 1/2 OK)
-- TCPIP 4.x installed (requires 32-bit tcpip stack)
-- WarpIN installer 0.9.12 (ftp://ftp.os2.org/xworkplace/warpin-0-9-12.zip)
-
-Note: probably some fixpak level is required on both Warp3&Warp4 to
- support >2GB file sizes.
-
-Save the installation archives into a temporary folder and double click
-on the main package; otherwise you can drop the mysql package in your
-WarpIN object or type
-
- WARPIN MYSQL-3-23-??-B1.WPI
-
-from the command line.
-The configuration file for MySQL is named my.cnf and it is placed into
-your %ETC% directory. Usually it located into the boot driver under
-
- x:\MPTN\ETC
-
-If the installation detect an existing configuration file, this will be
-renamed to my.cnf.bak; your current settings aren't migrated to current
-installation. This file is not deleted by uninstall process.
-Startup options for MySQL daemon could be added there.
-
-As default, client connections uses data compression: if you don't like it,
-remove the following from your %ETC%\my.cnf
-
- [client]
- compress
-
-The server switches automatically compression mode on client request.
-
-SMP systems: while my developement system is a SMP one, and here MySQL seems
-to run fine with two processors enabled, keep in mind that both EMX runtime
-and current thread model are not SMP safe.
-
-This release comes with DLL client library MYSQL.DLL: it is installed by
-default into mysql\bin together with client applications. Copy it to your
-x:\OS2\DLL or another directory in your LIBPATH to run command line
-utilities from every place.
-
-
-Documentation
--------------
-Documentation is provided in separate files. You can use either
-the PDF documentation (requires Adobe Acrobat Reader) or the
-INF documentation (requires OS/2 view or NewView).
-
-The PDF documentation is found in MYSQL-3-23-28-PDF.WPI and
-the INF documentation is found in MYSQL-3-23-28-INF.WPI
-
-The latest documentation can always be downloaded from
-http://www.mysql.com. However this documentation may
-no fully apply to this port.
-The INF documentation could contain errors because of semi-automatic
-translation from texi original.
-
-Support
--------
-Since MySQL is a OpenSource freeware product there are no
-formal support options available.
-
-Please subscribe to mysql2 at www.egroups.com to get in contact
-with other users using this port.
-
-http://www.egroups.com/group/mysql2
-
-This newsgroup/mailinglist is the official "home" of this port.
-
-
-Know problems
--------------
-alter_table.test and show_check are failing, reporting a different status
-message: actually seems only a different text, no bugs in table checking.
-
-
-Apache/2 + PHP
---------------
-To avoid problems with different socket when you use PHP and Apache
-webserver, get the PHP4 module from the Apache Server for OS/2 homepage
-http://silk.apana.org.au/apache/
-
-
-Developing MySQL
-----------------
-If you want to help us develop MySQL for OS2/eComStation please join
-the mysql2 mailinglist at www.egroups.com and ask for help to set up
-your environment!
-
-All questions that are specific to the OS2/eComStation version should
-be posted to this list! Please remember to include all relevant
-information that may help solve your problem.
-
-
-Building MySQL (EMX)
---------------------
-NOTE: these instructions are outdated
-
-db-3.2.x: before compiling MySQL, you need to setup Berkeley DB. Untar
-the distribution, enter dist directory and run
-
-attrib -r * /s
-sh -c s_config
-
-to create proper aclocal macros and configure headers.
-
-In the src directory you will find patches used to build this release
-of MySQL.
-You can run 'sh -c config.status' to create current makefiles without
-running autoconf & configure.
-
-apply previous patches (if not already included)
-sh -c autoconf (upgrade scripts)
-sh -c configure.os2 (config system)
-edit config.status:
- s%@MYSQL_UNIX_ADDR@%\\socket\\MySQL%g
- s%@LN_CP_F@%cp.exe%g
- replace -O2 -m486 with -mpentiumpro
-sh -c config.status (upgrade makefiles again)
-edit libmysql\Makefile
- remove all occurences of -Zexe
- replace libmysqlclient with libmysql (case sensitive search)
-edit client\Makefile
- replace libmysqlclient with libmysql (case sensitive search)
-make
-
-After config.status, you have to edit include\mysql_version.h and correct
-the socket definition (\\socket\\MySQL is correct).
-If you go with configure, you have to change LN_CP_F macro from 'ln -s' to
-'cp' and correct all makefiles (sh -c config.status will do it).
-
diff --git a/os2/rint.obj b/os2/rint.obj
index 41c766c6661..1231f093327 100644
--- a/os2/rint.obj
+++ b/os2/rint.obj
Binary files differ
diff --git a/readline/display.c b/readline/display.c
index e21af1f472d..df9e212ac0c 100644
--- a/readline/display.c
+++ b/readline/display.c
@@ -623,7 +623,7 @@ rl_redisplay ()
_rl_move_vert (linenum);
_rl_move_cursor_relative (0, tt);
_rl_clear_to_eol
- ((linenum == _rl_vis_botlin) ? strlen (tt) : screenwidth);
+ ((linenum == _rl_vis_botlin) ? (int) strlen (tt) : screenwidth);
}
}
_rl_vis_botlin = inv_botlin;
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 1c3b8083347..1469f3f2f2d 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -22,6 +22,7 @@ bin_SCRIPTS = @server_scripts@ \
mysql_fix_privilege_tables \
mysql_fix_extensions \
mysql_setpermission \
+ mysql_secure_installation \
mysql_zap \
mysqlaccess \
mysqlbug \
@@ -30,6 +31,7 @@ bin_SCRIPTS = @server_scripts@ \
mysqlhotcopy \
mysqldumpslow \
mysql_explain_log \
+ mysql_tableinfo \
mysqld_multi
EXTRA_SCRIPTS = make_binary_distribution.sh \
@@ -39,6 +41,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \
mysql_fix_extensions.sh \
mysql_install_db.sh \
mysql_setpermission.sh \
+ mysql_secure_installation.sh \
mysql_zap.sh \
mysqlaccess.sh \
mysqlbug.sh \
@@ -48,6 +51,7 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \
mysqldumpslow.sh \
mysql_explain_log.sh \
mysqld_multi.sh \
+ mysql_tableinfo.sh \
mysqld_safe.sh
EXTRA_DIST = $(EXTRA_SCRIPTS) \
@@ -65,6 +69,7 @@ CLEANFILES = @server_scripts@ \
mysql_fix_privilege_tables \
mysql_fix_extensions \
mysql_setpermission \
+ mysql_secure_installation \
mysql_zap \
mysqlaccess \
mysql_convert_table_format \
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index 44dc9d44322..2617a7971dc 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -120,11 +120,15 @@ $CP scripts/* $BASE/bin
rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh
$BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db
-$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server
+$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server
$BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe
+# Make safe_mysqld a symlink to mysqld_safe for backwards portability
+# To be removed in MySQL 4.1
+(cd $BASE/bin ; ln -s mysqld_safe safe_mysqld )
+
mv $BASE/support-files/binary-configure $BASE/configure
-chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/configure
+chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure
$CP -r sql-bench/* $BASE/sql-bench
rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la
diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh
index 7226840b475..a492066235b 100644
--- a/scripts/mysql_fix_privilege_tables.sh
+++ b/scripts/mysql_fix_privilege_tables.sh
@@ -12,6 +12,17 @@ echo "and give the MySQL root user password as a argument!"
root_password="$1"
host="localhost"
+echo "Converting all privilege tables to MyISAM format"
+@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
+ALTER TABLE user type=MyISAM;
+ALTER TABLE db type=MyISAM;
+ALTER TABLE host type=MyISAM;
+ALTER TABLE func type=MyISAM;
+ALTER TABLE columns_priv type=MyISAM;
+ALTER TABLE tables_priv type=MyISAM;
+END_OF_DATA
+
+
# Fix old password format, add File_priv and func table
echo ""
echo "If your tables are already up to date or partially up to date you will"
@@ -56,10 +67,18 @@ END_OF_DATA
echo ""
fi
+#
+# The second alter changes ssl_type to new 4.0.2 format
+
echo "Adding columns needed by GRANT .. REQUIRE (openssl)"
echo "You can ignore any Duplicate column errors"
-@bindir@/mysql --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
-ALTER TABLE user ADD ssl_type enum('NONE','ANY','X509', 'SPECIFIED') DEFAULT 'NONE' NOT NULL, ADD ssl_cipher BLOB NOT NULL, ADD x509_issuer BLOB NOT NULL, ADD x509_subject BLOB NOT NULL
+@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
+ALTER TABLE user
+ADD ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL,
+ADD ssl_cipher BLOB NOT NULL,
+ADD x509_issuer BLOB NOT NULL,
+ADD x509_subject BLOB NOT NULL;
+ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL;
END_OF_DATA
echo ""
@@ -98,7 +117,7 @@ END_OF_DATA
#
echo "Changing name of columns_priv.Type -> columns_priv.Column_priv"
-echo "You can ignore any errors from this"
+echo "You can ignore any Unknown column errors from this"
@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL;
@@ -117,12 +136,41 @@ alter table func add type enum ('function','aggregate') NOT NULL;
EOF
echo ""
-echo "Converting all privilege tables to MyISAM format"
-@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
-ALTER TABLE user type=MyISAM;
-ALTER TABLE db type=MyISAM;
-ALTER TABLE host type=MyISAM;
-ALTER TABLE func type=MyISAM;
-ALTER TABLE columns_priv type=MyISAM;
-ALTER TABLE tables_priv type=MyISAM;
+#
+# Change the user table to MySQL 4.0 format
+#
+
+echo "Adding new fields used by MySQL 4.0.2 to the privilege tables"
+echo "You can ignore any Duplicate column errors"
+
+@bindir@/mysql --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
+alter table user
+add Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER alter_priv,
+add Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv,
+add Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv,
+add Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv,
+add Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv,
+add Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv,
+add Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv;
+END_OF_DATA
+
+if test $? -eq "0"
+then
+ # Convert privileges so that users have similar privileges as before
+ echo ""
+ echo "Updating new privileges in MySQL 4.0.2 from old ones"
+ @bindir@/mysql --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
+ update user set show_db_priv= select_priv, super_priv=process_priv, execute_priv=process_priv, create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=file_priv;
+END_OF_DATA
+ echo ""
+fi
+
+# Add fields that can be used to limit number of questions and connections
+# for some users.
+
+@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
+alter table user
+add max_questions int(11) NOT NULL AFTER x509_subject,
+add max_updates int(11) unsigned NOT NULL AFTER max_questions,
+add max_connections int(11) unsigned NOT NULL AFTER max_updates;
END_OF_DATA
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 473b182de25..6ac54256124 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 1997, 1998, 1999 TCX DataKonsult AB & Monty Program KB & Detron HB
+# Copyright (C) 2002 MySQL AB
# For a more info consult the file COPYRIGHT distributed with this file.
# This scripts creates the privilege tables db, host, user, tables_priv,
@@ -224,7 +224,14 @@ then
c_u="$c_u References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u="$c_u Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
c_u="$c_u Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
- c_u="$c_u ssl_type enum('NONE','ANY','X509', 'SPECIFIED') DEFAULT 'NONE' NOT NULL,"
+ c_u="$c_u Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ c_u="$c_u Super_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ c_u="$c_u Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ c_u="$c_u Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ c_u="$c_u Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ c_u="$c_u Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ c_u="$c_u Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
+ c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL,"
c_u="$c_u ssl_cipher BLOB NOT NULL,"
c_u="$c_u x509_issuer BLOB NOT NULL,"
c_u="$c_u x509_subject BLOB NOT NULL,"
@@ -235,14 +242,14 @@ then
c_u="$c_u )"
c_u="$c_u comment='Users and global privileges';"
- i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','','',0,0,0);
- INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','','',0,0,0);
+ i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
+ INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
- REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','','',0,0,0);
- REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','NONE','','','',0,0,0);
+ REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
+ REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
- INSERT INTO user VALUES ('localhost','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE','','','',0,0,0);
- INSERT INTO user VALUES ('$hostname','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','NONE','','','',0,0,0);"
+ INSERT INTO user (host,user) values ('localhost','');
+ INSERT INTO user (host,user) values ('$hostname','');"
fi
if test ! -f $mdata/func.frm
@@ -343,7 +350,7 @@ then
echo "cd @prefix@ ; $bindir/mysqld_safe &"
echo
echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:"
- echo "cd sql-bench ; run-all-tests"
+ echo "cd sql-bench ; perl run-all-tests"
echo
fi
echo "Please report any problems with the @scriptdir@/mysqlbug script!"
diff --git a/scripts/mysql_new_fix_privilege_tables.sh b/scripts/mysql_new_fix_privilege_tables.sh
deleted file mode 100644
index ce10ed0b412..00000000000
--- a/scripts/mysql_new_fix_privilege_tables.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-echo "This scripts updates the mysql.user, mysql.db, mysql.host and the"
-echo "mysql.func table to MySQL 3.22.14 and above."
-echo ""
-echo "This is needed if you want to use the new GRANT functions,"
-echo "CREATE AGGREAGATE FUNCTION or want to use the more secure passwords in 3.23"
-echo ""
-echo "If you get Access denied errors, you should run this script again"
-echo "and give the MySQL root user password as a argument!"
-
-root_password="$1"
-host="localhost"
-
-# Fix old password format, add File_priv and func table
-echo ""
-echo "If your tables are already up to date or partially up to date you will"
-echo "get some warnings about 'Duplicated column name'. You can safely ignore these!"
-
-# Add fields that can be used to limit number of questions and connections
-# for some users.
-
-@bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql <<END_OF_DATA
-alter table user add max_questions int(11) NOT NULL, add max_updates int(11) unsigned NOT NULL, add max_connections int(11) unsigned NOT NULL;
-END_OF_DATA
diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh
new file mode 100644
index 00000000000..d6392c57731
--- /dev/null
+++ b/scripts/mysql_secure_installation.sh
@@ -0,0 +1,308 @@
+#!/bin/sh
+
+# Copyright (C) 2002 MySQL AB and Jeremy Cole
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+config=".my.cnf.$$"
+command=".mysql.$$"
+
+trap "interrupt" 2
+
+rootpass=""
+
+prepare() {
+ touch $config $command
+ chmod 600 $config $command
+}
+
+do_query() {
+ echo $1 >$command
+ mysql --defaults-file=$config <$command
+ return $?
+}
+
+make_config() {
+ echo "# mysql_secure_installation config file" >$config
+ echo "[mysql]" >>$config
+ echo "user=root" >>$config
+ echo "password=$rootpass" >>$config
+}
+
+get_root_password() {
+ status=1
+ while [ $status -eq 1 ]; do
+ stty -echo
+ echo -n "Enter current password for root (enter for none): "
+ read password
+ echo
+ stty echo
+ if [ "x$password" = "x" ]; then
+ hadpass=0
+ else
+ hadpass=1
+ fi
+ rootpass=$password
+ make_config
+ do_query ""
+ status=$?
+ done
+ echo "OK, successfully used password, moving on..."
+ echo
+}
+
+set_root_password() {
+ stty -echo
+ echo -n "New password: "
+ read password1
+ echo
+ echo -n "Re-enter new password: "
+ read password2
+ echo
+ stty echo
+
+ if [ "$password1" != "$password2" ]; then
+ echo "Sorry, passwords do not match."
+ echo
+ return 1
+ fi
+
+ if [ "$password1" = "" ]; then
+ echo "Sorry, you can't use an empty password here."
+ echo
+ return 1
+ fi
+
+ do_query "SET PASSWORD FOR root=PASSWORD('$password1');"
+ if [ $? -eq 0 ]; then
+ echo "Password updated successfully!"
+ echo
+ rootpass=$password1
+ make_config
+ else
+ echo "Password update failed!"
+ exit 1
+ fi
+
+ return 0
+}
+
+remove_anonymous_users() {
+ do_query "DELETE FROM mysql.user WHERE User='';"
+ if [ $? -eq 0 ]; then
+ echo " ... Success!"
+ else
+ echo " ... Failed!"
+ exit 1
+ fi
+
+ return 0
+}
+
+remove_remote_root() {
+ do_query "DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';"
+ if [ $? -eq 0 ]; then
+ echo " ... Success!"
+ else
+ echo " ... Failed!"
+ fi
+}
+
+remove_test_database() {
+ echo " - Dropping test database..."
+ do_query "DROP DATABASE test;"
+ if [ $? -eq 0 ]; then
+ echo " ... Success!"
+ else
+ echo " ... Failed! Not critical, keep moving..."
+ fi
+
+ echo " - Removing privileges on test database..."
+ do_query "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'"
+ if [ $? -eq 0 ]; then
+ echo " ... Success!"
+ else
+ echo " ... Failed! Not critical, keep moving..."
+ fi
+
+ return 0
+}
+
+reload_privilege_tables() {
+ do_query "FLUSH PRIVILEGES;"
+ if [ $? -eq 0 ]; then
+ echo " ... Success!"
+ else
+ echo " ... Failed!"
+ fi
+
+ return 0
+}
+
+interrupt() {
+ echo
+ echo "Aborting!"
+ echo
+ cleanup
+ stty echo
+ exit 1
+}
+
+cleanup() {
+ echo "Cleaning up..."
+ rm -f $config $command
+}
+
+
+# The actual script starts here
+
+prepare
+
+echo
+echo
+echo
+echo
+echo "NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL"
+echo " SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!"
+echo
+echo
+
+echo "In order to log into MySQL to secure it, we'll need the current"
+echo "password for the root user. If you've just installed MySQL, and"
+echo "you haven't set the root password yet, the password will be blank,"
+echo "so you should just press enter here."
+echo
+
+get_root_password
+
+
+#
+# Set the root password
+#
+
+echo "Setting the root password ensures that nobody can log into the MySQL"
+echo "root user without the proper authorisation."
+echo
+
+if [ $hadpass -eq 0 ]; then
+ echo -n "Set root password? [Y/n] "
+else
+ echo "You already have a root password set, so you can safely answer 'n'."
+ echo
+ echo -n "Change the root password? [Y/n] "
+fi
+
+read reply
+if [ "$reply" = "n" ]; then
+ echo " ... skipping."
+else
+ status=1
+ while [ $status -eq 1 ]; do
+ set_root_password
+ status=$?
+ done
+fi
+echo
+
+
+#
+# Remove anonymous users
+#
+
+echo "By default, a MySQL installation has an anonymous user, allowing anyone"
+echo "to log into MySQL without having to have a user account created for"
+echo "them. This is intended only for testing, and to make the installation"
+echo "go a bit smoother. You should remove them before moving into a"
+echo "production environment."
+echo
+
+echo -n "Remove anonymous users? [Y/n] "
+
+read reply
+if [ "$reply" = "n" ]; then
+ echo " ... skipping."
+else
+ remove_anonymous_users
+fi
+echo
+
+
+#
+# Disallow remote root login
+#
+
+echo "Normally, root should only be allowed to connect from 'localhost'. This"
+echo "ensures that someone cannot guess at the root password from the network."
+echo
+
+echo -n "Disallow root login remotely? [Y/n] "
+read reply
+if [ "$reply" = "n" ]; then
+ echo " ... skipping."
+else
+ remove_remote_root
+fi
+echo
+
+
+#
+# Remove test database
+#
+
+echo "By default, MySQL comes with a database named 'test' that anyone can"
+echo "access. This is also intended only for testing, and should be removed"
+echo "before moving into a production environment."
+echo
+
+echo -n "Remove test database and access to it? [Y/n] "
+read reply
+if [ "$reply" = "n" ]; then
+ echo " ... skipping."
+else
+ remove_test_database
+fi
+echo
+
+
+#
+# Reload privilege tables
+#
+
+echo "Reloading the privilege tables will ensure that all changes made so far"
+echo "will take effect immediately."
+echo
+
+echo -n "Reload privilege tables now? [Y/n] "
+read reply
+if [ "$reply" = "n" ]; then
+ echo " ... skipping."
+else
+ reload_privilege_tables
+fi
+echo
+
+cleanup
+
+echo
+echo
+echo
+echo "All done! If you've completed all of the above steps, your MySQL"
+echo "installation should now be secure."
+echo
+echo "Thanks for using MySQL!"
+echo
+echo
+
+
diff --git a/scripts/mysql_tableinfo.sh b/scripts/mysql_tableinfo.sh
new file mode 100644
index 00000000000..bfe9be377c7
--- /dev/null
+++ b/scripts/mysql_tableinfo.sh
@@ -0,0 +1,478 @@
+#!@PERL@ -w
+
+use strict;
+use Getopt::Long;
+use DBI;
+
+=head1 NAME
+
+mysql_tableinfo - creates and populates information tables with
+the output of SHOW DATABASES, SHOW TABLES (or SHOW TABLE STATUS),
+SHOW COLUMNS and SHOW INDEX.
+
+This is version 1.0.
+
+=head1 SYNOPSIS
+
+ mysql_tableinfo [OPTIONS] database_to_write [database_like_wild] [table_like_wild]
+
+ Do not backquote (``) database_to_write,
+ and do not quote ('') database_like_wild or table_like_wild
+
+ Examples:
+
+ mysql_tableinfo info
+
+ mysql_tableinfo info this_db
+
+ mysql_tableinfo info %a% b%
+
+ mysql_tableinfo info --clear-only
+
+ mysql_tableinfo info --col --idx --table-status
+
+=cut
+
+# Documentation continued at end of file
+
+
+sub usage {
+ die @_,"\nExecute 'perldoc $0' for documentation\n";
+}
+
+my %opt = (
+ 'user' => scalar getpwuid($>),
+ 'host' => "localhost",
+ 'prefix' => "", #to avoid 'use of uninitialized value...'
+);
+Getopt::Long::Configure(qw(no_ignore_case)); # disambuguate -p and -P
+GetOptions( \%opt,
+ "help",
+ "user|u=s",
+ "password|p=s",
+ "host|h=s",
+ "port|P=s",
+ "socket|S=s",
+ "tbl-status",
+ "col",
+ "idx",
+ "clear",
+ "clear-only",
+ "prefix=s",
+ "quiet|q",
+) or usage("Invalid option");
+
+if ($opt{help}) {usage();}
+
+my ($db_to_write,$db_like_wild,$tbl_like_wild);
+if (@ARGV==0)
+{
+ usage("Not enough arguments");
+}
+$db_to_write="`$ARGV[0]`"; shift @ARGV;
+$db_like_wild=($ARGV[0])?$ARGV[0]:"%"; shift @ARGV;
+$tbl_like_wild=($ARGV[0])?$ARGV[0]:"%"; shift @ARGV;
+if (@ARGV>0) { usage("Too many arguments"); }
+
+my $info_db="`".$opt{'prefix'}."db`";
+my $info_tbl="`".$opt{'prefix'}."tbl".
+ (($opt{'tbl-status'})?"_status":"")."`";
+my $info_col="`".$opt{'prefix'}."col`";
+my $info_idx="`".$opt{'prefix'}."idx`";
+
+
+# --- connect to the database ---
+
+my $dsn = ";host=$opt{'host'}";
+$dsn .= ";port=$opt{port}" if $opt{port};
+$dsn .= ";mysql_socket=$opt{socket}" if $opt{socket};
+
+my $dbh = DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=perl",
+ $opt{user}, $opt{password},
+{
+ RaiseError => 1,
+ PrintError => 0,
+ AutoCommit => 1,
+});
+
+$db_like_wild=$dbh->quote($db_like_wild);
+$tbl_like_wild=$dbh->quote($tbl_like_wild);
+
+#Ask
+
+if (!$opt{'quiet'})
+{
+ print "\n!! This program is doing to do:\n\n";
+ print "**DROP** TABLE ...\n" if ($opt{'clear'} or $opt{'clear-only'});
+ print "**DELETE** FROM ... WHERE `Database LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild
+**INSERT** INTO ...
+
+on the following tables :\n";
+ my $i;
+ foreach $i (($info_db, $info_tbl),
+ (($opt{'col'})?$info_col:()),
+ (($opt{'idx'})?$info_idx:()))
+ {
+ print(" $db_to_write.$i\n");
+ }
+ print "\nContinue (you can skip this confirmation step with --quiet) ? (y|n) [n]";
+ my $answer=<STDIN>;
+ unless ($answer =~ /^\s*y\s*$/i)
+ {
+ print "Nothing done!\n";exit;
+ }
+}
+
+if ($opt{'clear'} or $opt{'clear-only'})
+{
+#do not drop the $db_to_write database !
+ my $i;
+ foreach $i (($info_db, $info_tbl),
+ (($opt{'col'})?$info_col:()),
+ (($opt{'idx'})?$info_idx:()))
+ {
+ $dbh->do("DROP TABLE IF EXISTS $db_to_write.$i");
+ }
+ if ($opt{'clear-only'})
+ {
+ print "Wrote to database $db_to_write .\n" unless ($opt{'quiet'});
+ exit();
+ }
+}
+
+
+my %sth;
+my %extra_col_desc;
+my %row;
+my %done_create_table;
+
+#create the $db_to_write database
+$dbh->do("CREATE DATABASE IF NOT EXISTS $db_to_write");
+$dbh->do("USE $db_to_write");
+
+#get databases
+$sth{db}=$dbh->prepare("SHOW DATABASES LIKE $db_like_wild");
+$sth{db}->execute;
+
+#create $info_db which will receive info about databases.
+#Ensure that the first column to be called "Database" (as SHOW DATABASES LIKE
+#returns a varying
+#column name (of the form "Database (%...)") which is not suitable)
+$extra_col_desc{db}=do_create_table("db",$info_db,undef,"`Database`");
+#we'll remember the type of the `Database` column (as returned by
+#SHOW DATABASES), which we will need when creating the next tables.
+
+#clear out-of-date info from this table
+$dbh->do("DELETE FROM $info_db WHERE `Database` LIKE $db_like_wild");
+
+
+while (@{$row{db}}=$sth{db}->fetchrow_array) #go through all databases
+{
+
+#insert the database name
+ $dbh->do("INSERT INTO $info_db VALUES("
+ .join_quote(@{$row{db}}).")");
+
+#for each database, get tables
+
+ $sth{tbl}=$dbh->prepare("SHOW TABLE"
+ .( ($opt{'tbl-status'}) ?
+ " STATUS"
+ : "S" )
+ ." from `${$row{db}}[0]` LIKE $tbl_like_wild");
+ $sth{tbl}->execute;
+ unless ($done_create_table{$info_tbl})
+
+#tables must be created only once, and out-of-date info must be
+#cleared once
+ {
+ $done_create_table{$info_tbl}=1;
+ $extra_col_desc{table}=
+ do_create_table("tbl",$info_tbl,
+#add an extra column (database name) at the left
+#and ensure that the table name will be called "Table"
+#(this is unncessesary with
+#SHOW TABLE STATUS, but necessary with SHOW TABLES (which returns a column
+#named "Tables_in_..."))
+ "`Database` ".$extra_col_desc{db},"`Table`");
+ $dbh->do("DELETE FROM $info_tbl WHERE `Database` LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild");
+ }
+
+ while (@{$row{tbl}}=$sth{tbl}->fetchrow_array)
+ {
+ $dbh->do("INSERT INTO $info_tbl VALUES("
+ .$dbh->quote(${$row{db}}[0]).",".join_quote(@{$row{tbl}}).")");
+
+#for each table, get columns...
+
+ if ($opt{'col'})
+ {
+ $sth{col}=$dbh->prepare("SHOW COLUMNS FROM `${$row{tbl}}[0]` FROM `${$row{db}}[0]`");
+ $sth{col}->execute;
+ unless ($done_create_table{$info_col})
+ {
+ $done_create_table{$info_col}=1;
+ do_create_table("col",$info_col,
+ "`Database` ".$extra_col_desc{db}.","
+ ."`Table` ".$extra_col_desc{table}.","
+ ."`Seq_in_table` BIGINT(3)");
+#We need to add a sequence number (1 for the first column of the table,
+#2 for the second etc) so that users are able to retrieve columns in order
+#if they want. This is not needed for INDEX
+#(where there is already Seq_in_index)
+ $dbh->do("DELETE FROM $info_col WHERE `Database`
+ LIKE $db_like_wild
+ AND `Table` LIKE $tbl_like_wild");
+ }
+ my $col_number=0;
+ while (@{$row{col}}=$sth{col}->fetchrow_array)
+ {
+ $dbh->do("INSERT INTO $info_col VALUES("
+ .$dbh->quote(${$row{db}}[0]).","
+ .$dbh->quote(${$row{tbl}}[0]).","
+ .++$col_number.","
+ .join_quote(@{$row{col}}).")");
+ }
+ }
+
+#and get index.
+
+ if ($opt{'idx'})
+ {
+ $sth{idx}=$dbh->prepare("SHOW INDEX FROM `${$row{tbl}}[0]` FROM `${$row{db}}[0]`");
+ $sth{idx}->execute;
+ unless ($done_create_table{$info_idx})
+ {
+ $done_create_table{$info_idx}=1;
+ do_create_table("idx",$info_idx,
+ "`Database` ".$extra_col_desc{db});
+ $dbh->do("DELETE FROM $info_idx WHERE `Database`
+ LIKE $db_like_wild
+ AND `Table` LIKE $tbl_like_wild");
+ }
+ while (@{$row{idx}}=$sth{idx}->fetchrow_array)
+ {
+ $dbh->do("INSERT INTO $info_idx VALUES("
+ .$dbh->quote(${$row{db}}[0]).","
+ .join_quote(@{$row{idx}}).")");
+ }
+ }
+ }
+}
+
+print "Wrote to database $db_to_write .\n" unless ($opt{'quiet'});
+exit;
+
+sub join_quote
+{
+ my (@list)=@_; my $i;
+ foreach $i (@list) { $i=$dbh->quote($i); }
+ return (join ',',@list);
+}
+
+sub do_create_table
+{
+ my ($sth_key,$target_tbl,$extra_col_desc,$first_col_name)=@_;
+ my $create_table_query=$extra_col_desc;
+ my ($i,$type,$first_col_desc,$col_desc);
+
+ for ($i=0;$i<$sth{$sth_key}->{NUM_OF_FIELDS};$i++)
+ {
+ if ($create_table_query) { $create_table_query.=", "; }
+ $type=$sth{$sth_key}->{mysql_type_name}->[$i];
+ $col_desc=$type;
+ if ($type =~ /char|int/i)
+ {
+ $col_desc.="($sth{$sth_key}->{PRECISION}->[$i])";
+ }
+ elsif ($type =~ /decimal|numeric/i) #(never seen that)
+ {
+ $col_desc.=
+ "($sth{$sth_key}->{PRECISION}->[$i],$sth{$sth_key}->{SCALE}->[$i])";
+ }
+ elsif ($type !~ /date/i) #date and datetime are OK,
+ #no precision or scale for them
+ {
+ warn "unexpected column type '$type'
+(neither 'char','int','decimal|numeric')
+when creating $target_tbl, hope table creation will go OK\n";
+ }
+ if ($i==0) {$first_col_desc=$col_desc};
+ $create_table_query.=
+ ( ($i==0 and $first_col_name) ?
+ "$first_col_name " :"`$sth{$sth_key}->{NAME}->[$i]` " )
+ .$col_desc;
+ }
+if ($create_table_query)
+{
+ $dbh->do("CREATE TABLE IF NOT EXISTS $target_tbl ($create_table_query)");
+}
+return $first_col_desc;
+}
+
+__END__
+
+
+=head1 DESCRIPTION
+
+mysql_tableinfo asks a MySQL server information about its
+databases, tables, table columns and index, and stores this
+in tables called `db`, `tbl` (or `tbl_status`), `col`, `idx`
+(with an optional prefix specified with --prefix).
+After that, you can query these information tables, for example
+to build your admin scripts with SQL queries, like
+
+SELECT CONCAT("CHECK TABLE ",`database`,".",`table`," EXTENDED;")
+FROM info.tbl WHERE ... ;
+
+as people usually do with some other RDBMS
+(note: to increase the speed of your queries on the info tables,
+you may add some index on them).
+
+The database_like_wild and table_like_wild instructs the program
+to gather information only about databases and tables
+whose names match these patterns. If the info
+tables already exist, their rows matching the patterns are simply
+deleted and replaced by the new ones. That is,
+old rows not matching the patterns are not touched.
+If the database_like_wild and table_like_wild arguments
+are not specified on the command-line they default to "%".
+
+The program :
+
+- does CREATE DATABASE IF NOT EXISTS database_to_write
+where database_to_write is the database name specified on the command-line.
+
+- does CREATE TABLE IF NOT EXISTS database_to_write.`db`
+
+- fills database_to_write.`db` with the output of
+SHOW DATABASES LIKE database_like_wild
+
+- does CREATE TABLE IF NOT EXISTS database_to_write.`tbl`
+(respectively database_to_write.`tbl_status`
+if the --tbl-status option is on)
+
+- for every found database,
+fills database_to_write.`tbl` (respectively database_to_write.`tbl_status`)
+with the output of
+SHOW TABLES FROM found_db LIKE table_like_wild
+(respectively SHOW TABLE STATUS FROM found_db LIKE table_like_wild)
+
+- if the --col option is on,
+ * does CREATE TABLE IF NOT EXISTS database_to_write.`col`
+ * for every found table,
+ fills database_to_write.`col` with the output of
+ SHOW COLUMNS FROM found_tbl FROM found_db
+
+- if the --idx option is on,
+ * does CREATE TABLE IF NOT EXISTS database_to_write.`idx`
+ * for every found table,
+ fills database_to_write.`idx` with the output of
+ SHOW INDEX FROM found_tbl FROM found_db
+
+Some options may modify this general scheme (see below).
+
+As mentioned, the contents of the info tables are the output of
+SHOW commands. In fact the contents are slightly more complete :
+
+- the `tbl` (or `tbl_status`) info table
+ has an extra column which contains the database name,
+
+- the `col` info table
+ has an extra column which contains the table name,
+ and an extra column which contains, for each described column,
+ the number of this column in the table owning it (this extra column
+ is called `Seq_in_table`). `Seq_in_table` makes it possible for you
+ to retrieve your columns in sorted order, when you are querying
+ the `col` table.
+
+- the `index` info table
+ has an extra column which contains the database name.
+
+Caution: info tables contain certain columns (e.g.
+Database, Table, Null...) whose names, as they are MySQL reserved words,
+need to be backquoted (`...`) when used in SQL statements.
+
+=head1 OPTIONS
+
+=over 4
+
+=item --clear
+
+Does DROP TABLE on the info tables (only those that the program is
+going to fill, for example if you do not use --col it won't drop
+the `col` table) and processes normally. Does not drop database_to_write.
+
+=item --clear-only
+
+Same as --clear but exits after the DROPs.
+
+=item --col
+
+Adds columns information (into table `col`).
+
+=item --idx
+
+Adds index information (into table `idx`).
+
+=item --prefix prefix
+
+The info tables are named from the concatenation of prefix and,
+respectively, db, tbl (or tbl_status), col, idx. Do not quote ('')
+or backquote (``) prefix.
+
+=item -q, --quiet
+
+Does not warn you about what the script is going to do (DROP TABLE etc)
+and does not ask for a confirmation before starting.
+
+=item --tbl-status
+
+Instead of using SHOW TABLES, uses SHOW TABLE STATUS
+(much more complete information, but slower).
+
+=item --help
+
+Display helpscreen and exit
+
+=item -u, --user=#
+
+user for database login if not current user. Give a user
+who has sufficient privileges (CREATE, ...).
+
+=item -p, --password=#
+
+password to use when connecting to server
+
+=item -h, --host=#
+
+host to connect to
+
+=item -P, --port=#
+
+port to use when connecting to server
+
+=item -S, --socket=#
+
+UNIX domain socket to use when connecting to server
+
+=head1 WARRANTY
+
+This software is free and comes without warranty of any kind. You
+should never trust backup software without studying the code yourself.
+Study the code inside this script and only rely on it if I<you> believe
+that it does the right thing for you.
+
+Patches adding bug fixes, documentation and new features are welcome.
+
+=head1 TO DO
+
+Use extended inserts to be faster (for servers with many databases
+or tables). But to do that, must care about net-buffer-length.
+
+=head1 AUTHOR
+
+2002-06-18 Guilhem Bichot (guilhem.bichot@mines-paris.org)
+
+And all the authors of mysqlhotcopy, which served as a model for
+the structure of the program.
diff --git a/scripts/mysql_zap.sh b/scripts/mysql_zap.sh
index 312d15e34d6..f485d164282 100644
--- a/scripts/mysql_zap.sh
+++ b/scripts/mysql_zap.sh
@@ -12,7 +12,7 @@ $opt_f= 0;
$opt_t= 0;
$opt_a = "";
-$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4";
+$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4" || $^O eq 'darwin';
$LINUX = $^O eq 'linux';
$pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef";
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index 83d12239472..1366a9ea713 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -605,10 +605,11 @@ Options:
make sure you have mysqld in your PATH or fix mysqld_safe.
Using: $mysqld
Please note: Since mysqld_multi version 2.3 you can also
- give this option in groups [mysqld#]! This will be
- recognized as a special option and will not be passed
- to the mysqld. This will allow one to start different
- mysqld versions with mysqld_multi.
+ give this option inside groups [mysqld#] in ~/.my.cnf,
+ where '#' stands for an integer (number) of the group in
+ question. This will be recognized as a special option and
+ will not be passed to the mysqld. This will allow one to
+ start different mysqld versions with mysqld_multi.
--no-log Print to stdout instead of the log file. By default the log
file is turned on.
--password=... Password for user for mysqladmin.
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index 45f1f1ed24a..1aad5c95c25 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -50,7 +50,8 @@ Usage: $0 db_name[./table_regex/] [new_db_name | directory]
-?, --help display this helpscreen and exit
-u, --user=# user for database login if not current user
-p, --password=# password to use when connecting to server
- -P, --port=# port to use when connecting to local server
+ -h, --host=# Hostname for local server when connecting over TCP/IP
+ -P, --port=# port to use when connecting to local server with TCP/IP
-S, --socket=# socket to use when connecting to local server
--allowold don\'t abort if target already exists (rename it _old)
@@ -155,7 +156,8 @@ $opt{quiet} = 0 if $opt{debug};
$opt{allowold} = 1 if $opt{keepold};
# --- connect to the database ---
-my $dsn = ";host=localhost";
+my $dsn;
+$dsn = ";host=" . (defined($opt{host}) ? $opt{host} : "localhost");
$dsn .= ";port=$opt{port}" if $opt{port};
$dsn .= ";mysql_socket=$opt{socket}" if $opt{socket};
@@ -890,9 +892,15 @@ user for database login if not current user
password to use when connecting to server
+=item -h, -h, --host=#
+
+Hostname for local server when connecting over TCP/IP. By specifying this
+different from 'localhost' will trigger mysqlhotcopy to use TCP/IP connection.
+
=item -P, --port=#
-port to use when connecting to local server
+port to use when connecting to MySQL server with TCP/IP. This is only used
+when using the --host option.
=item -S, --socket=#
diff --git a/sql-bench/Makefile.am b/sql-bench/Makefile.am
index 4bfa9868428..ab6be7269e3 100644
--- a/sql-bench/Makefile.am
+++ b/sql-bench/Makefile.am
@@ -24,7 +24,9 @@ bench_SCRIPTS = test-ATIS test-connect test-create test-insert \
test-alter-table test-transactions \
graph-compare-results \
bench-init.pl compare-results run-all-tests \
- server-cfg crash-me copy-db bench-count-distinct
+ server-cfg crash-me copy-db innotest1 innotest1a \
+ innotest1b innotest2 innotest2a innotest2b \
+ bench-count-distinct
CLEANFILES = $(bench_SCRIPTS)
EXTRA_SCRIPTS = test-ATIS.sh test-connect.sh test-create.sh \
test-insert.sh test-big-tables.sh test-select.sh \
@@ -32,7 +34,9 @@ EXTRA_SCRIPTS = test-ATIS.sh test-connect.sh test-create.sh \
test-transactions.sh \
bench-init.pl.sh compare-results.sh server-cfg.sh \
run-all-tests.sh crash-me.sh copy-db.sh \
- bench-count-distinct.sh graph-compare-results.sh
+ graph-compare-results.sh innotest1.sh innotest1a.sh \
+ innotest1b.sh innotest2.sh innotest2a.sh innotest2b.sh \
+ bench-count-distinct.sh
EXTRA_DIST = $(EXTRA_SCRIPTS)
dist-hook:
diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh
index 9572143ae53..d66e8f47d6a 100644
--- a/sql-bench/crash-me.sh
+++ b/sql-bench/crash-me.sh
@@ -38,7 +38,7 @@
# as such, and clarify ones such as "mediumint" with comments such as
# "3-byte int" or "same as xxx".
-$version="1.57";
+$version="1.58";
use DBI;
use Getopt::Long;
@@ -2186,20 +2186,20 @@ EOF
print <<EOF;
Some of the tests you are about to execute may require a lot of
-memory. Your tests WILL adversely affect system performance. It's
+memory. Your tests WILL adversely affect system performance. It\'s
not uncommon that either this crash-me test program, or the actual
database back-end, will DIE with an out-of-memory error. So might
any other program on your system if it requests more memory at the
wrong time.
Note also that while crash-me tries to find limits for the database server
-it will make a lot of queries that can't be categorized as 'normal'. It's
+it will make a lot of queries that can\'t be categorized as \'normal\'. It\'s
not unlikely that crash-me finds some limit bug in your server so if you
run this test you have to be prepared that your server may die during it!
We, the creators of this utility, are not responsible in any way if your
database server unexpectedly crashes while this program tries to find the
-limitations of your server. By accepting the following question with 'yes',
+limitations of your server. By accepting the following question with \'yes\',
you agree to the above!
You have been warned!
@@ -2468,7 +2468,6 @@ sub report
print "$prompt: ";
if (!defined($limits{$limit}))
{
- save_config_data($limit,"incompleted",$prompt);
save_config_data($limit,safe_query(\@queries) ? "yes" : "no",$prompt);
}
print "$limits{$limit}\n";
@@ -2481,7 +2480,6 @@ sub report_fail
print "$prompt: ";
if (!defined($limits{$limit}))
{
- save_config_data($limit,"incompleted",$prompt);
save_config_data($limit,safe_query(\@queries) ? "no" : "yes",$prompt);
}
print "$limits{$limit}\n";
@@ -2498,7 +2496,7 @@ sub report_one
print "$prompt: ";
if (!defined($limits{$limit}))
{
- save_config_data($limit,"incompleted",$prompt);
+ save_incomplete($limit,$prompt);
$result="no";
foreach $query (@$queries)
{
@@ -2524,7 +2522,7 @@ sub report_result
print "$prompt: ";
if (!defined($limits{$limit}))
{
- save_config_data($limit,"incompleted",$prompt);
+ save_incomplete($limit,$prompt);
$error=safe_query_result($query,"1",2);
save_config_data($limit,$error ? "not supported" : $last_result,$prompt);
}
@@ -2537,7 +2535,7 @@ sub report_trans
my ($limit,$queries,$check,$clear)=@_;
if (!defined($limits{$limit}))
{
- save_config_data($limit,"incompleted",$prompt);
+ save_incomplete($limit,$prompt);
eval {undef($dbh->{AutoCommit})};
if (!$@)
{
@@ -2579,7 +2577,7 @@ sub check_and_report
print "$prompt: " if (!defined($skip_prompt));
if (!defined($limits{$limit}))
{
- save_config_data($limit,"incompleted",$prompt);
+ save_incomplete($limit,$prompt);
$tmp=1-safe_query(\@$pre);
$tmp=safe_query_result($query,$answer,$string_type) if (!$tmp);
safe_query(\@$post);
@@ -2615,7 +2613,7 @@ sub try_and_report
if (!defined($limits{$limit}))
{
- save_config_data($limit,"incompleted",$prompt);
+ save_incomplete($limit,$prompt);
$type="no"; # Not supported
foreach $test (@tests)
{
@@ -2695,7 +2693,8 @@ sub safe_query_result
$sth->finish;
return ($result_type == 8) ? 0 : 1;
}
- if($result_type == 8) {
+ if ($result_type == 8)
+ {
$sth->finish;
return 1;
}
@@ -2787,7 +2786,7 @@ sub find_limit()
print "$end (cache)\n";
return $end;
}
- save_config_data($limit,"incompleted",$prompt);
+ save_incomplete($limit,$prompt);
if (defined($query->{'init'}) && !defined($end=$limits{'restart'}{'tohigh'}))
{
@@ -2961,6 +2960,16 @@ sub save_all_config_data
close CONFIG_FILE;
}
+#
+# Save 'incomplete' in the limits file to be able to continue if
+# crash-me dies because of a bug in perl/DBI
+
+sub save_incomplete
+{
+ my ($limit,$prompt)= @_;
+ save_config_data($limit,"incompleted",$prompt) if ($opt_restart);
+}
+
sub check_repeat
{
diff --git a/sql-bench/innotest1.sh b/sql-bench/innotest1.sh
new file mode 100644
index 00000000000..b875a431040
--- /dev/null
+++ b/sql-bench/innotest1.sh
@@ -0,0 +1,141 @@
+#!@PERL@
+############################################################################
+# Stress test for MySQL/InnoDB combined database
+# (c) 2002 Innobase Oy & MySQL AB
+#
+############################################################################
+
+use DBI;
+use Benchmark;
+
+$opt_loop_count = 100000;
+
+chomp($pwd = `pwd`); $pwd = "." if ($pwd eq '');
+require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
+
+print "Innotest1: MySQL/InnoDB stress test in Perl\n";
+print "-------------------------------------------\n";
+print "This is a randomized stress test for concurrent inserts,\n";
+print "updates, deletes, commits and rollbacks. The test will generate\n";
+print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
+print "\n";
+print "You should run innotest1, innotest1a, and innotest1b concurrently.\n";
+print "The thing to watch is that the server does not crash or does not\n";
+print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
+print "warnings about MySQL lock reservations can appear in the .err log.\n";
+print "The test will run very long, even several hours. You can kill\n";
+print "the perl processes running this test at any time and do CHECK\n";
+print "TABLE on table innotest1 in the 'test' database.\n";
+print "\n";
+print "Some of these stress tests will print a lot of SQL errors\n";
+print "to the standard output. That is not to be worried about.\n";
+print "You can direct the output to a file like this:\n";
+print "perl innotest1 > out1\n\n";
+
+print "Generating random keys\n";
+$random[$opt_loop_count] = 0;
+$rnd_str[$opt_loop_count] = "a";
+
+for ($i = 0; $i < $opt_loop_count; $i++) {
+
+ $random[$i] = ($i * 63857) % $opt_loop_count;
+
+ if (0 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "kjgclgrtfuylfluyfyufyulfulfyyulofuyolfyufyufuyfyufyufyufyufyyufujhfghd";
+ } else { if (1 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "khd";
+ } else { if (2 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "kh";
+ }}}
+
+ for ($j = 0; $j < (($i * 764877) % 20); $j++) {
+ $rnd_str[$i] = $rnd_str[$i]."k";
+ }
+}
+
+####
+#### Connect
+####
+
+$dbh = $server->connect()
+|| die $dbh->errstr;
+
+$dbh->do("set autocommit = 0");
+
+$n = 0;
+
+for ($i = 0; $i < 1; $i++) {
+
+ print "Dropping table innotest1\n";
+
+ $dbh->do("drop table innotest1");
+
+ print "Creating table innotest1\n";
+
+ $dbh->do(
+ "create table innotest1 (A INT NOT NULL AUTO_INCREMENT, D INT NOT NULL, B VARCHAR(200) NOT NULL, C VARCHAR(175), E TIMESTAMP, F TIMESTAMP, G DATETIME, PRIMARY KEY (A, D), INDEX
+(B, C), INDEX (C), INDEX (D), INDEX(E), INDEX(G)) TYPE = INNODB")
+ || die $dbh->errstr;
+
+ for ($j = 2; $j < $opt_loop_count - 10; $j = $j + 2) {
+
+ if ($j % 10 == 0) {
+ $dbh->do(
+ "insert into innotest1 (D, B, C, F, G) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."', NULL, NULL)");
+ } else {
+ $dbh->do(
+ "insert into innotest1 (D, B, C, F, G) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."', NOW(), NOW())");
+ }
+
+ $dbh->do("update innotest1 set B = '".$rnd_str[$j + 7]."' where A = ".$random[$j + 5]);
+
+ $dbh->do("update innotest1 SET D = D + 1 where A =".($j / 2 - 500));
+
+ $dbh->do("update innotest1 set B = '".$rnd_str[$j + 1]."' where A =".($j / 2 - 505));
+
+ $dbh->do("delete from innotest1 where A = ".$random[$random[$j]]);
+
+ fetch_all_rows($dbh, "select b, c from innotest1 where a > ".$random[$j]." and a < ".($random[$j] + 7));
+
+ if (0 == ($j % 10)) {
+ $dbh->do("commit");
+ }
+
+ if (0 == ($j % 97)) {
+ fetch_all_rows($dbh, "select c, e, f, g from innotest1 where c = '".$rnd_str[$j - 68]."'");
+ fetch_all_rows($dbh, "select b, e, f, g from innotest1 where b = '".$rnd_str[$j - 677]."'");
+ fetch_all_rows($dbh, "select b, c, e, f, g from innotest1 where c = '".$rnd_str[$j - 68]."'");
+ fetch_all_rows($dbh, "select b, c, g from innotest1 where b = '".$rnd_str[$j - 677]."'");
+ fetch_all_rows($dbh, "select a, b, c, e, f, g from innotest1 where c = '".$rnd_str[$j - 68]."'");
+ fetch_all_rows($dbh, "select a, b, c, e, f, g from innotest1 where b = '".$rnd_str[$j - 677]."'");
+ fetch_all_rows($dbh, "select d, b, c from innotest1 where c = '".$rnd_str[$j - 68]."'");
+ fetch_all_rows($dbh, "select d, b, c, g from innotest1 where b = '".$rnd_str[$j - 677]."'");
+
+ $dbh->do("rollback");
+ }
+
+ for ($k = 1; $k < 10; $k++) {
+
+ $n += fetch_all_rows($dbh,
+"SELECT a, d from innotest1 where a = ".(($k * 1764767) % $j));
+
+ $n += fetch_all_rows($dbh,
+"SELECT * from innotest1 where a = ".(($k * 187567) % $j));
+
+ }
+
+ if (0 == ($j % 1000)) {
+ print "round $j, $n rows fetched\n";
+ }
+
+ if (0 == ($j % 20000)) {
+ print "Checking table innotest1...\n";
+ $dbh->do("check table innotest1");
+ print "Table checked.\n";
+ }
+ }
+
+ $dbh->do("commit");
+}
+
+$dbh->disconnect; # close connection
diff --git a/sql-bench/innotest1a.sh b/sql-bench/innotest1a.sh
new file mode 100644
index 00000000000..d78357427bc
--- /dev/null
+++ b/sql-bench/innotest1a.sh
@@ -0,0 +1,107 @@
+#!@PERL@
+############################################################################
+# Stress test for MySQL/InnoDB combined database
+# (c) 2002 Innobase Oy & MySQL AB
+#
+############################################################################
+
+use DBI;
+use Benchmark;
+
+$opt_loop_count = 200000;
+
+chomp($pwd = `pwd`); $pwd = "." if ($pwd eq '');
+require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
+
+print "Innotest1a: MySQL/InnoDB stress test in Perl\n";
+print "-------------------------------------------\n";
+print "This is a randomized stress test for concurrent inserts,\n";
+print "updates, deletes, commits and rollbacks. The test will generate\n";
+print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
+print "\n";
+print "You should run innotest1, innotest1a, and innotest1b concurrently.\n";
+print "The thing to watch is that the server does not crash or does not\n";
+print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
+print "warnings about MySQL lock reservations can appear in the .err log.\n";
+print "The test will run very long, even several hours. You can kill\n";
+print "the perl processes running this test at any time and do CHECK\n";
+print "TABLE on table innotest1 in the 'test' database.\n";
+print "\n";
+print "Some of these stress tests will print a lot of SQL errors\n";
+print "to the standard output. That is not to be worried about.\n";
+print "You can direct the output to a file like this:\n";
+print "perl innotest1 > out1\n\n";
+
+print "Generating random keys\n";
+$random[$opt_loop_count] = 0;
+$rnd_str[$opt_loop_count] = "a";
+
+for ($i = 0; $i < $opt_loop_count; $i++) {
+
+ $random[$i] = ($i * 63857) % $opt_loop_count;
+
+ if (0 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "kjgclgrtfuylfluyfyufyulfulfyyulofuyolfyufyufuyfyufyufyufyufyyufujhfghd";
+ } else { if (1 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "khd";
+ } else { if (2 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "kh";
+ }}}
+
+ for ($j = 0; $j < (($i * 764877) % 20); $j++) {
+ $rnd_str[$i] = $rnd_str[$i]."k";
+ }
+}
+
+####
+#### Connect
+####
+
+$dbh = $server->connect()
+|| die $dbh->errstr;
+
+
+$dbh->do("set autocommit = 0");
+
+for ($i = 0; $i < 1; $i++) {
+ print "loop $i\n";
+
+ for ($j = 1; $j < $opt_loop_count - 10; $j = $j + 2) {
+ $dbh->do(
+ "insert into innotest1 (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')");
+ $dbh->do("update innotest1 set B = '".$rnd_str[$j + 2]."' where A = ".$random[$j + 5]);
+ $dbh->do("update innotest1 SET D = D + 1 where A =".(($j - 1) / 2 - 777));
+ $dbh->do("update innotest1 set B = '".$rnd_str[$j + 8]."' where A =".(($j - 1) / 2 - 770));
+ $dbh->do("delete from innotest1 where A = ".$random[$random[$j]]);
+
+ fetch_all_rows($dbh, "select b, c from innotest1 where a > ".$random[$j]." and a < ".($random[$j] + 7));
+
+ if (0 == ($j % 37)) {
+ $dbh->do("commit");
+ }
+
+ if (0 == ($j % 533)) {
+ $dbh->do("rollback");
+ }
+
+ if (0 == ($j % 537)) {
+ print fetch_all_rows($dbh, "select c from innotest1 where c = '".$rnd_str[$j - 67]."'");
+ print fetch_all_rows($dbh, "select b from innotest1 where b = '".$rnd_str[$j - 688]."'");
+ print fetch_all_rows($dbh, "select b, c from innotest1 where c = '".$rnd_str[$j - 67]."'");
+ print fetch_all_rows($dbh, "select b, c from innotest1 where b = '".$rnd_str[$j - 622]."'");
+ print fetch_all_rows($dbh, "select a, b, c from innotest1 where c = '".$rnd_str[$j - 68]."'");
+ print fetch_all_rows($dbh, "select a, b, c from innotest1 where b = '".$rnd_str[$j - 644]."'");
+ print fetch_all_rows($dbh, "select d, b, c from innotest1 where c = '".$rnd_str[$j - 68]."'");
+ print fetch_all_rows($dbh, "select d, b, c from innotest1 where b = '".$rnd_str[$j - 677]."'");
+ print "\n";
+ }
+
+ if (0 == (($j - 1) % 1000)) {
+ print "round $j\n";
+ }
+ }
+
+ $dbh->do("commit");
+}
+
+$dbh->disconnect; # close connection
diff --git a/sql-bench/innotest1b.sh b/sql-bench/innotest1b.sh
new file mode 100644
index 00000000000..d83fce00efc
--- /dev/null
+++ b/sql-bench/innotest1b.sh
@@ -0,0 +1,100 @@
+#!@PERL@
+############################################################################
+# Stress test for MySQL/InnoDB combined database
+# (c) 2002 Innobase Oy & MySQL AB
+#
+############################################################################
+
+use DBI;
+use Benchmark;
+
+$opt_loop_count = 200000;
+
+chomp($pwd = `pwd`); $pwd = "." if ($pwd eq '');
+require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
+
+print "Innotest1b: MySQL/InnoDB stress test in Perl\n";
+print "-------------------------------------------\n";
+print "This is a randomized stress test for concurrent inserts,\n";
+print "updates, deletes, commits and rollbacks. The test will generate\n";
+print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
+print "\n";
+print "You should run innotest1, innotest1a, and innotest1b concurrently.\n";
+print "The thing to watch is that the server does not crash or does not\n";
+print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
+print "warnings about MySQL lock reservations can appear in the .err log.\n";
+print "The test will run very long, even several hours. You can kill\n";
+print "the perl processes running this test at any time and do CHECK\n";
+print "TABLE on table innotest1 in the 'test' database.\n";
+print "\n";
+print "Some of these stress tests will print a lot of SQL errors\n";
+print "to the standard output. That is not to be worried about.\n";
+print "You can direct the output to a file like this:\n";
+print "perl innotest1 > out1\n\n";
+
+print "Generating random keys\n";
+$random[$opt_loop_count] = 0;
+$rnd_str[$opt_loop_count] = "a";
+
+for ($i = 0; $i < $opt_loop_count; $i++) {
+
+ $random[$i] = ($i * 63857) % $opt_loop_count;
+
+ if (0 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "kjgclgrtfuylfluyfyufyulfulfyyulofuyolfyufyufuyfyufyufyufyufyyufujhfghd";
+ } else { if (1 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "khd";
+ } else { if (2 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "kh";
+ }}}
+
+ for ($j = 0; $j < (($i * 764877) % 20); $j++) {
+ $rnd_str[$i] = $rnd_str[$i]."k";
+ }
+}
+
+####
+#### Connect
+####
+
+$dbh = $server->connect()
+|| die $dbh->errstr;
+
+$dbh->do("set autocommit = 0");
+
+for ($i = 0; $i < 5; $i++) {
+ print "loop $i\n";
+
+ for ($j = 1; $j < $opt_loop_count - 10; $j = $j + 2) {
+
+ fetch_all_rows($dbh, "select b, c from innotest1 where a > ".$random[$j]." and a < ".($random[$j] + 7));
+
+ if (0 == ($j % 37)) {
+ $dbh->do("commit");
+ }
+
+ if (0 == ($j % 533)) {
+ $dbh->do("rollback");
+ }
+
+ if (0 == ($j % 537)) {
+ print fetch_all_rows($dbh, "select c from innotest1 where c = '".$rnd_str[$j - 67]."'");
+ print fetch_all_rows($dbh, "select b from innotest1 where b = '".$rnd_str[$j - 688]."'");
+ print fetch_all_rows($dbh, "select b, c from innotest1 where c = '".$rnd_str[$j - 67]."'");
+ print fetch_all_rows($dbh, "select b, c from innotest1 where b = '".$rnd_str[$j - 622]."'");
+ print fetch_all_rows($dbh, "select a, b, c from innotest1 where c = '".$rnd_str[$j - 68]."'");
+ print fetch_all_rows($dbh, "select a, b, c from innotest1 where b = '".$rnd_str[$j - 644]."'");
+ print fetch_all_rows($dbh, "select d, b, c from innotest1 where c = '".$rnd_str[$j - 68]."'");
+ print fetch_all_rows($dbh, "select d, b, c from innotest1 where b = '".$rnd_str[$j - 677]."'");
+ print "\n";
+ }
+
+ if (0 == (($j - 1) % 1000)) {
+ print "round $j\n";
+ }
+ }
+
+ $dbh->do("commit");
+}
+
+$dbh->disconnect; # close connection
diff --git a/sql-bench/innotest2.sh b/sql-bench/innotest2.sh
new file mode 100644
index 00000000000..05c21098249
--- /dev/null
+++ b/sql-bench/innotest2.sh
@@ -0,0 +1,149 @@
+#!@PERL@
+############################################################################
+# Stress test for MySQL/InnoDB combined database
+# (c) 2002 Innobase Oy & MySQL AB
+#
+############################################################################
+
+use DBI;
+use Benchmark;
+
+$opt_loop_count = 100000;
+
+chomp($pwd = `pwd`); $pwd = "." if ($pwd eq '');
+require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
+
+print "Innotest2: MySQL/InnoDB stress test in Perl for FOREIGN keys\n";
+print "------------------------------------------------------------\n";
+print "This is a randomized stress test for concurrent inserts,\n";
+print "updates, deletes, commits and rollbacks with foreign keys with\n";
+print "the ON DELETE ... clause. The test will generate\n";
+print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
+print "\n";
+print "You should run innotest2, innotest2a, and innotest2b concurrently.\n";
+print "The thing to watch is that the server does not crash or does not\n";
+print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
+print "warnings about MySQL lock reservations can appear in the .err log.\n";
+print "The test will run very long, even several hours. You can kill\n";
+print "the perl processes running this test at any time and do CHECK\n";
+print "TABLE on tables innotest2a, b, c, d in the 'test' database.\n";
+print "\n";
+print "Some of these stress tests will print a lot of SQL errors\n";
+print "to the standard output. That is not to be worried about.\n";
+print "You can direct the output to a file like this:\n";
+print "perl innotest2 > out2\n\n";
+
+print "Generating random keys\n";
+$random[$opt_loop_count] = 0;
+$rnd_str[$opt_loop_count] = "a";
+
+for ($i = 0; $i < $opt_loop_count; $i++) {
+
+ $random[$i] = ($i * 63857) % $opt_loop_count;
+
+ if (0 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "khD";
+ } else { if (1 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "khd";
+ } else { if (2 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "kHd";
+ }}}
+
+ for ($j = 0; $j < (($i * 764877) % 10); $j++) {
+ $rnd_str[$i] = $rnd_str[$i]."k";
+ }
+}
+
+####
+#### Connect
+####
+
+$dbh = $server->connect()
+|| die $dbh->errstr;
+
+$dbh->do("set autocommit = 0");
+
+for ($i = 0; $i < 1; $i++) {
+ print "loop $i\n";
+
+ print "dropping table innotest2a\n";
+ $dbh->do("drop table innotest2a");
+
+ print "dropping table innotest2b\n";
+ $dbh->do("drop table innotest2b");
+
+ print "dropping table innotest2c\n";
+ $dbh->do("drop table innotest2c");
+
+ print "dropping table innotest2d\n";
+ $dbh->do("drop table innotest2d");
+
+ print "creating table innotest2b\n";
+ $dbh->do(
+ "create table innotest2b (A INT NOT NULL AUTO_INCREMENT, D INT NOT NULL, B VARCHAR(200) NOT NULL, C VARCHAR(175), PRIMARY KEY (A, D, B), INDEX (B, C), INDEX (C)) TYPE = INNODB")
+ || die $dbh->errstr;
+
+ print "creating table innotest2a\n";
+
+ $dbh->do(
+ "create table innotest2a (A INT NOT NULL AUTO_INCREMENT, D INT NOT NULL, B VARCHAR(200) NOT NULL, C VARCHAR(175), PRIMARY KEY (A, D, B), INDEX (B, C), INDEX (C), FOREIGN KEY (A, D) REFERENCES innotest2b (A, D) ON DELETE CASCADE) TYPE = INNODB")
+ || die $dbh->errstr;
+
+ print "creating table innotest2c\n";
+
+ $dbh->do(
+ "create table innotest2c (A INT NOT NULL AUTO_INCREMENT, D INT NOT NULL, B VARCHAR(200) NOT NULL, C VARCHAR(175), PRIMARY KEY (A, D, B), INDEX (B, C), INDEX (C), FOREIGN KEY (A, D) REFERENCES innotest2a (A, D) ON DELETE CASCADE, FOREIGN KEY (B, C) REFERENCES innotest2a (B, C) ON DELETE CASCADE) TYPE = INNODB")
+ || die $dbh->errstr;
+
+ print "creating table innotest2d\n";
+
+ $dbh->do(
+ "create table innotest2d (A INT AUTO_INCREMENT, D INT, B VARCHAR(200), C VARCHAR(175), UNIQUE KEY (A, D, B), INDEX (B, C), INDEX (C), FOREIGN KEY (C) REFERENCES innotest2c (C) ON DELETE SET NULL, FOREIGN KEY (B, C) REFERENCES innotest2c (B, C) ON DELETE SET NULL) TYPE = INNODB")
+ || die $dbh->errstr;
+ print "created\n";
+
+ for ($j = 0; $j < $opt_loop_count - 10; $j = $j + 2) {
+ $dbh->do(
+ "insert into innotest2b (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')")
+ || print $dbh->errstr;
+
+ $dbh->do(
+ "insert into innotest2a (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')")
+ || print $dbh->errstr;
+
+ $dbh->do(
+ "insert into innotest2c (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')")
+ || print $dbh->errstr;
+
+ $dbh->do(
+ "insert into innotest2d (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')")
+ || print $dbh->errstr;
+
+ $dbh->do("delete from innotest2b where A = ".$random[$random[$j]])
+ || print $dbh->errstr;
+
+ if (0 == ($j % 10)) {
+ $dbh->do("commit");
+ }
+
+ if (0 == ($j % 39)) {
+ $dbh->do("rollback");
+ }
+
+ if (0 == ($j % 1000)) {
+ print "round $j\n";
+ }
+ if (0 == ($j % 20000)) {
+ print "Checking tables...\n";
+ $dbh->do("check table innotest2a");
+ $dbh->do("check table innotest2b");
+ $dbh->do("check table innotest2c");
+ $dbh->do("check table innotest2d");
+ print "Tables checked.\n";
+ }
+ }
+
+ $dbh->do("commit");
+}
+
+$dbh->disconnect; # close connection
diff --git a/sql-bench/innotest2a.sh b/sql-bench/innotest2a.sh
new file mode 100644
index 00000000000..e0fe2001d24
--- /dev/null
+++ b/sql-bench/innotest2a.sh
@@ -0,0 +1,93 @@
+#!@PERL@
+############################################################################
+# Stress test for MySQL/Innobase combined database
+# (c) 2000 Innobase Oy & MySQL AB
+#
+############################################################################
+
+use DBI;
+use Benchmark;
+
+$opt_loop_count = 100000;
+
+chomp($pwd = `pwd`); $pwd = "." if ($pwd eq '');
+require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
+
+print "Innotest2a: MySQL/InnoDB stress test in Perl for FOREIGN keys\n";
+print "------------------------------------------------------------\n";
+print "This is a randomized stress test for concurrent inserts,\n";
+print "updates, deletes, commits and rollbacks with foreign keys with\n";
+print "the ON DELETE ... clause. The test will generate\n";
+print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
+print "\n";
+print "You should run innotest2, innotest2a, and innotest2b concurrently.\n";
+print "The thing to watch is that the server does not crash or does not\n";
+print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
+print "warnings about MySQL lock reservations can appear in the .err log.\n";
+print "The test will run very long, even several hours. You can kill\n";
+print "the perl processes running this test at any time and do CHECK\n";
+print "TABLE on tables innotest2a, b, c, d in the 'test' database.\n";
+print "\n";
+print "Some of these stress tests will print a lot of SQL errors\n";
+print "to the standard output. That is not to be worried about.\n";
+print "You can direct the output to a file like this:\n";
+print "perl innotest2 > out2\n\n";
+
+print "Generating random keys\n";
+$random[$opt_loop_count] = 0;
+$rnd_str[$opt_loop_count] = "a";
+
+for ($i = 0; $i < $opt_loop_count; $i++) {
+
+ $random[$i] = ($i * 63857) % $opt_loop_count;
+
+ if (0 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "khD";
+ } else { if (1 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "kHd";
+ } else { if (2 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "khd";
+ }}}
+
+ for ($j = 0; $j < (($i * 764877) % 20); $j++) {
+ $rnd_str[$i] = $rnd_str[$i]."k";
+ }
+}
+
+####
+#### Connect
+####
+
+$dbh = $server->connect()
+|| die $dbh->errstr;
+
+$dbh->do("set autocommit = 0");
+
+for ($i = 0; $i < 5; $i++) {
+ print "loop $i\n";
+
+ for ($j = 0; $j < $opt_loop_count - 10; $j = $j + 1) {
+
+ $dbh->do("update innotest2a set B = '".$rnd_str[$j + 1]."' where A = ".$random[$j + 5])
+ || print $dbh->errstr;
+
+ $dbh->do("delete from innotest2a where A = ".$random[$random[$j]])
+ || print $dbh->errstr;
+
+ if (0 == ($j % 10)) {
+ $dbh->do("commit");
+ }
+
+ if (0 == ($j % 39)) {
+ $dbh->do("rollback");
+ }
+
+ if (0 == ($j % 1000)) {
+ print "round $j\n";
+ }
+ }
+
+ $dbh->do("commit");
+}
+
+$dbh->disconnect; # close connection
diff --git a/sql-bench/innotest2b.sh b/sql-bench/innotest2b.sh
new file mode 100644
index 00000000000..83f48cf5352
--- /dev/null
+++ b/sql-bench/innotest2b.sh
@@ -0,0 +1,103 @@
+#!@PERL@
+############################################################################
+# Stress test for MySQL/Innobase combined database
+# (c) 2000 Innobase Oy & MySQL AB
+#
+############################################################################
+
+use DBI;
+use Benchmark;
+
+$opt_loop_count = 100000;
+
+chomp($pwd = `pwd`); $pwd = "." if ($pwd eq '');
+require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
+
+print "Innotest2b: MySQL/InnoDB stress test in Perl for FOREIGN keys\n";
+print "------------------------------------------------------------\n";
+print "This is a randomized stress test for concurrent inserts,\n";
+print "updates, deletes, commits and rollbacks with foreign keys with\n";
+print "the ON DELETE ... clause. The test will generate\n";
+print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
+print "\n";
+print "You should run innotest2, innotest2a, and innotest2b concurrently.\n";
+print "The thing to watch is that the server does not crash or does not\n";
+print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
+print "warnings about MySQL lock reservations can appear in the .err log.\n";
+print "The test will run very long, even several hours. You can kill\n";
+print "the perl processes running this test at any time and do CHECK\n";
+print "TABLE on tables innotest2a, b, c, d in the 'test' database.\n";
+print "\n";
+print "Some of these stress tests will print a lot of SQL errors\n";
+print "to the standard output. That is not to be worried about.\n";
+print "You can direct the output to a file like this:\n";
+print "perl innotest2 > out2\n\n";
+
+print "Generating random keys\n";
+$random[$opt_loop_count] = 0;
+$rnd_str[$opt_loop_count] = "a";
+
+for ($i = 0; $i < $opt_loop_count; $i++) {
+
+ $random[$i] = ($i * 98641) % $opt_loop_count;
+
+ if (0 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "khD";
+ } else { if (1 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "khd";
+ } else { if (2 == ($random[$i] % 3)) {
+ $rnd_str[$i] = "kHd";
+ }}}
+
+ for ($j = 0; $j < (($i * 764877) % 10); $j++) {
+ $rnd_str[$i] = $rnd_str[$i]."k";
+ }
+}
+
+####
+#### Connect
+####
+
+$dbh = $server->connect();
+
+$dbh->do("set autocommit = 0");
+
+for ($i = 0; $i < 1; $i++) {
+ print "loop $i\n";
+
+ for ($j = 0; $j < $opt_loop_count - 10; $j = $j + 2) {
+ $dbh->do(
+ "insert into innotest2b (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')")
+ || print $dbh->errstr;
+
+ $dbh->do(
+ "insert into innotest2a (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')")
+ || print $dbh->errstr;
+
+ $dbh->do(
+ "insert into innotest2c (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')")
+ || print $dbh->errstr;
+
+ $dbh->do("delete from innotest2b where A = ".$random[$random[$j]])
+ || print $dbh->errstr;
+
+ $dbh->do("update innotest2b set A = A + 1 where A = ".$random[$j])
+ || print $dbh->errstr;
+
+ if (0 == ($j % 10)) {
+ $dbh->do("commit");
+ }
+
+ if (0 == ($j % 39)) {
+ $dbh->do("rollback");
+ }
+
+ if (0 == ($j % 1000)) {
+ print "round $j\n";
+ }
+ }
+
+ $dbh->do("commit");
+}
+
+$dbh->disconnect; # close connection
diff --git a/sql-bench/limits/mysql.cfg b/sql-bench/limits/mysql.cfg
index cd4aea7dcf5..306ce2d7b33 100644
--- a/sql-bench/limits/mysql.cfg
+++ b/sql-bench/limits/mysql.cfg
@@ -1,4 +1,4 @@
-#This file is automaticly generated by crash-me 1.57
+#This file is automaticly generated by crash-me 1.58
NEG=yes # update of column= -column
Need_cast_for_null=no # Need to cast NULL for arithmetic
@@ -36,7 +36,7 @@ constraint_check=no # Column constraints
constraint_check_table=no # Table constraints
constraint_null=yes # NULL constraint (SyBase style)
crash_me_safe=yes # crash me safe
-crash_me_version=1.57 # crash me version
+crash_me_version=1.58 # crash me version
create_default=yes # default value for column
create_default_func=no # default value function for column
create_if_not_exists=yes # create table if not exists
@@ -333,7 +333,7 @@ max_char_size=255 # max char() size
max_column_name=64 # column name length
max_columns=3398 # Columns in table
max_conditions=85660 # OR and AND in WHERE
-max_expressions=856 # simple expressions
+max_expressions=686 # simple expressions
max_index=32 # max index
max_index_length=500 # index length
max_index_name=64 # index name length
@@ -343,7 +343,7 @@ max_index_varchar_part_length=255 # index varchar part length
max_row_length=65534 # max table row length (without blobs)
max_row_length_with_null=65502 # table row length with nulls (without blobs)
max_select_alias_name=+512 # select alias name length
-max_stack_expression=856 # stacked expressions
+max_stack_expression=490 # stacked expressions
max_table_alias_name=+512 # table alias name length
max_table_name=64 # table name length
max_text_size=1048543 # max text or blob size
@@ -396,7 +396,7 @@ select_limit2=yes # SELECT with LIMIT #,#
select_string_size=1048565 # constant string size in SELECT
select_table_update=no # Update with sub select
select_without_from=yes # SELECT without FROM
-server_version=MySQL 4.0.2 alpha debug # server version
+server_version=MySQL 4.0.2 alpha # server version
simple_joins=yes # ANSI SQL simple joins
storage_of_float=round # Storage of float values
subqueries=no # subqueries
diff --git a/sql-bench/server-cfg.sh b/sql-bench/server-cfg.sh
index e82fd5d5907..ea1697fb4c3 100644
--- a/sql-bench/server-cfg.sh
+++ b/sql-bench/server-cfg.sh
@@ -176,7 +176,6 @@ sub new
if (defined($main::opt_create_options) &&
$main::opt_create_options =~ /type=innodb/i)
{
- $limits{'max_text_size'} = 8000; # Limit in Innobase
$self->{'transactions'} = 1; # Transactions enabled
}
if (defined($main::opt_create_options) &&
@@ -3019,7 +3018,6 @@ sub new
$limits{'order_by_unused'} = 1;
$limits{'working_all_fields'} = 1;
-
return $self;
}
diff --git a/sql/Makefile.am b/sql/Makefile.am
index 9cfdf4c4d9b..5527c345078 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -55,8 +55,9 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
opt_range.h opt_ft.h \
sql_select.h structs.h table.h sql_udf.h hash_filo.h\
lex.h lex_symbol.h sql_acl.h sql_crypt.h \
- log_event.h mini_client.h sql_repl.h slave.h \
- stacktrace.h sql_sort.h sql_cache.h spatial.h gstream.h
+ log_event.h mini_client.h sql_repl.h slave.h \
+ stacktrace.h sql_sort.h sql_cache.h set_var.h \
+ spatial.h gstream.h
mysqld_SOURCES = sql_lex.cc sql_handler.cc \
item.cc item_sum.cc item_buff.cc item_func.cc \
item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \
@@ -65,7 +66,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \
net_serv.cc net_pkg.cc lock.cc my_lock.c \
sql_string.cc sql_manager.cc sql_map.cc \
mysqld.cc password.c hash_filo.cc hostname.cc \
- convert.cc sql_parse.cc sql_yacc.yy \
+ convert.cc set_var.cc sql_parse.cc sql_yacc.yy \
sql_base.cc table.cc sql_select.cc sql_insert.cc \
sql_prepare.cc sql_error.cc \
sql_update.cc sql_delete.cc uniques.cc sql_do.cc \
@@ -82,7 +83,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \
sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
slave.cc sql_repl.cc sql_union.cc sql_derived.cc \
mini_client.cc mini_client_errors.c \
- stacktrace.c repl_failsafe.h repl_failsafe.cc \
+ stacktrace.c repl_failsafe.h repl_failsafe.cc sql_olap.cc\
gstream.cc spatial.cc
gen_lex_hash_SOURCES = gen_lex_hash.cc
gen_lex_hash_LDADD = $(LDADD) $(CXXLDFLAGS)
diff --git a/sql/convert.cc b/sql/convert.cc
index c2868cac848..13a6dfe0392 100644
--- a/sql/convert.cc
+++ b/sql/convert.cc
@@ -27,7 +27,7 @@
#include "mysql_priv.h"
/****************************************************************************
-** Convert tables
+ Convert tables
****************************************************************************/
/* Windows cp1251->koi8 and reverse conversion by Timur I. Bakeyev <translate@bat.ru> */
diff --git a/sql/field.cc b/sql/field.cc
index 462088d26a6..c9669c93c04 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -42,7 +42,7 @@
#endif
/*****************************************************************************
-** Instansiate templates and static variables
+ Instansiate templates and static variables
*****************************************************************************/
#ifdef __GNUC__
@@ -50,70 +50,13 @@ template class List<create_field>;
template class List_iterator<create_field>;
#endif
-struct st_decstr {
- uint nr_length,nr_dec,sign,extra;
- char sign_char;
-};
-
uchar Field_null::null[1]={1};
const char field_separator=',';
/*****************************************************************************
-** Static help functions
+ Static help functions
*****************************************************************************/
- /*
- Calculate length of number and its parts
- Increment cuted_fields if wrong number
- */
-
-static bool
-number_dec(CHARSET_INFO *cs, struct st_decstr *sdec,
- const char *str, const char *end)
-{
- sdec->sign=sdec->extra=0;
- if (str == end)
- {
- current_thd->cuted_fields++;
- sdec->nr_length=sdec->nr_dec=sdec->sign=0;
- sdec->extra=1; // We must put one 0 before .
- return 1;
- }
-
- if (*str == '-' || *str == '+') /* sign */
- {
- sdec->sign_char= *str;
- sdec->sign=1;
- str++;
- }
- const char *start=str;
- while (str != end && my_isdigit(cs,*str))
- str++;
- if (!(sdec->nr_length=(uint) (str-start)))
- sdec->extra=1; // We must put one 0 before .
- start=str;
- if (str != end && *str == '.')
- {
- str++;
- start=str;
- while (str != end && my_isdigit(cs,*str))
- str++;
- }
- sdec->nr_dec=(uint) (str-start);
- if (current_thd->count_cuted_fields)
- {
- while (str != end && my_isspace(cs,*str))
- str++; /* purecov: inspected */
- if (str != end)
- {
- current_thd->cuted_fields++;
- return 1;
- }
- }
- return 0;
-}
-
-
void Field_num::prepend_zeros(String *value)
{
int diff;
@@ -128,8 +71,8 @@ void Field_num::prepend_zeros(String *value)
}
/*
-** Test if given number is a int (or a fixed format float with .000)
-** This is only used to give warnings in ALTER TABLE or LOAD DATA...
+ Test if given number is a int (or a fixed format float with .000)
+ This is only used to give warnings in ALTER TABLE or LOAD DATA...
*/
bool test_if_int(const char *str,int length)
@@ -143,7 +86,7 @@ bool test_if_int(const char *str,int length)
str++;
if (str == end)
return 0; // Error: Empty string
- for ( ; str != end ; str++)
+ for (; str != end ; str++)
{
if (!my_isdigit(system_charset_info,*str))
{
@@ -207,7 +150,7 @@ static bool test_if_real(const char *str,int length)
length--; str++;
}
}
- for ( ; length ; length--, str++)
+ for (; length ; length--, str++)
{ // Allow end space
if (!my_isspace(system_charset_info,*str))
return 0;
@@ -262,7 +205,7 @@ bool Field::send(THD *thd, String *packet)
String tmp(buff,sizeof(buff),default_charset_info);
val_str(&tmp,&tmp);
CONVERT *convert;
- if ((convert=thd->convert_set))
+ if ((convert=thd->variables.convert_set))
return convert->store(packet,tmp.ptr(),tmp.length());
return net_store_data(packet,tmp.ptr(),tmp.length());
}
@@ -279,6 +222,7 @@ void Field_num::add_zerofill_and_unsigned(String &res) const
void Field_num::make_field(Send_field *field)
{
+ /* table_cache_key is not set for temp tables */
field->db_name=table->table_cache_key ? table->table_cache_key : "";
field->org_table_name=table->real_name;
field->table_name=table_name;
@@ -292,6 +236,7 @@ void Field_num::make_field(Send_field *field)
void Field_str::make_field(Send_field *field)
{
+ /* table_cache_key is not set for temp tables */
field->db_name=table->table_cache_key ? table->table_cache_key : "";
field->org_table_name=table->real_name;
field->table_name=table_name;
@@ -363,9 +308,10 @@ void Field::store_time(TIME *ltime,timestamp_type type)
store(buff,19,default_charset_info);
break;
case TIMESTAMP_TIME:
- sprintf(buff, "%02d:%02d:%02d",
- ltime->hour,ltime->minute,ltime->second);
- store(buff,(uint) strlen(buff),default_charset_info);
+ {
+ ulong length= my_sprintf(buff, (buff, "%02d:%02d:%02d",
+ ltime->hour,ltime->minute,ltime->second));
+ store(buff,(uint) length, default_charset_info);
break;
}
}
@@ -377,8 +323,8 @@ bool Field::optimize_range(uint idx)
}
/****************************************************************************
-** Functions for the Field_decimal class
-** This is an unpacked number.
+ Functions for the Field_decimal class
+ This is an number stored as a pre-space (or pre-zero) string
****************************************************************************/
void
@@ -391,6 +337,8 @@ void Field_decimal::overflow(bool negative)
{
uint len=field_length;
char *to=ptr, filler= '9';
+
+ current_thd->cuted_fields++;
if (negative)
{
if (!unsigned_flag)
@@ -424,114 +372,362 @@ void Field_decimal::overflow(bool negative)
}
-int Field_decimal::store(const char *from,uint len,CHARSET_INFO *cs)
+int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
{
- reg3 int i;
- uint tmp_dec;
- char fyllchar;
- const char *end=from+len;
- struct st_decstr decstr;
- bool error;
+ const char *end= from+len;
+ /* The pointer where the field value starts (i.e., "where to write") */
+ char *to=ptr;
+ uint tmp_dec, tmp_uint;
+ /*
+ The sign of the number : will be 0 (means positive but sign not
+ specified), '+' or '-'
+ */
+ char sign_char=0;
+ /* The pointers where prezeros start and stop */
+ const char *pre_zeros_from, *pre_zeros_end;
+ /* The pointers where digits at the left of '.' start and stop */
+ const char *int_digits_from, *int_digits_end;
+ /* The pointers where digits at the right of '.' start and stop */
+ const char *frac_digits_from, *frac_digits_end;
+ /* The sign of the exponent : will be 0 (means no exponent), '+' or '-' */
+ char expo_sign_char=0;
+ uint exponent=0; // value of the exponent
+ /*
+ Pointers used when digits move from the left of the '.' to the
+ right of the '.' (explained below)
+ */
+ const char *int_digits_tail_from;
+ /* Number of 0 that need to be added at the left of the '.' (1E3: 3 zeros) */
+ uint int_digits_added_zeros;
+ /*
+ Pointer used when digits move from the right of the '.' to the left
+ of the '.'
+ */
+ const char *frac_digits_head_end;
+ /* Number of 0 that need to be added at the right of the '.' (for 1E-3) */
+ uint frac_digits_added_zeros;
+ char *pos,*tmp_left_pos,*tmp_right_pos;
+ /* Pointers that are used as limits (begin and end of the field buffer) */
+ char *left_wall,*right_wall;
+ char tmp_char;
+ /*
+ To remember if current_thd->cuted_fields has already been incremented,
+ to do that only once
+ */
+ bool is_cuted_fields_incr=0;
+
+ LINT_INIT(int_digits_tail_from);
+ LINT_INIT(int_digits_added_zeros);
+ LINT_INIT(frac_digits_head_end);
+ LINT_INIT(frac_digits_added_zeros);
+
+ /*
+ There are three steps in this function :
+ - parse the input string
+ - modify the position of digits around the decimal dot '.'
+ according to the exponent value (if specified)
+ - write the formatted number
+ */
+
+ if ((tmp_dec=dec))
+ tmp_dec++;
- if ((tmp_dec= dec))
- tmp_dec++; // Calculate pos of '.'
+ /* skip pre-space */
while (from != end && my_isspace(system_charset_info,*from))
from++;
- if (zerofill)
- {
- fyllchar = '0';
- if (from != end)
- while (*from == '0' && from != end-1) // Skip prezero
- from++;
- }
- else
- fyllchar=' ';
- error=number_dec(system_charset_info,&decstr,from,end);
- if (decstr.sign)
+ if (from == end)
{
- from++;
- if (unsigned_flag) // No sign with zerofill
- {
- if (decstr.sign_char == '+') // just remove "+"
- decstr.sign= 0;
- else
+ current_thd->cuted_fields++;
+ is_cuted_fields_incr=1;
+ }
+ else if (*from == '+' || *from == '-') // Found some sign ?
+ {
+ sign_char= *from++;
+ /*
+ We allow "+" for unsigned decimal unless defined different
+ Both options allowed as one may wish not to have "+" for unsigned numbers
+ because of data processing issues
+ */
+ if (unsigned_flag)
+ {
+ if (sign_char=='-')
{
- if (!error)
- current_thd->cuted_fields++;
- Field_decimal::overflow(1);
- return 1;
+ Field_decimal::overflow(1);
+ return 1;
}
+ /*
+ Defining this will not store "+" for unsigned decimal type even if
+ it is passed in numeric string. This will make some tests to fail
+ */
+#ifdef DONT_ALLOW_UNSIGNED_PLUS
+ else
+ sign_char=0;
+#endif
}
}
+
+ pre_zeros_from= from;
+ for (; from!=end && *from == '0'; from++) ; // Read prezeros
+ pre_zeros_end=int_digits_from=from;
+ /* Read non zero digits at the left of '.'*/
+ for (; from != end && my_isdigit(system_charset_info, *from) ; from++) ;
+ int_digits_end=from;
+ if (from!=end && *from == '.') // Some '.' ?
+ from++;
+ frac_digits_from= from;
+ /* Read digits at the right of '.' */
+ for (;from!=end && my_isdigit(system_charset_info, (*from); from++) ;
+ frac_digits_end=from;
+ // Some exponentiation symbol ?
+ if (from != end && (*from == 'e' || *from == 'E'))
+ {
+ from++;
+ if (from != end && (*from == '+' || *from == '-')) // Some exponent sign ?
+ expo_sign_char= *from++;
+ else
+ expo_sign_char= '+';
+ /*
+ Read digits of the exponent and compute its value
+ 'exponent' overflow (e.g. if 1E10000000000000000) is not a problem
+ (the value of the field will be overflow anyway, or 0 anyway,
+ it does not change anything if the exponent is 2^32 or more
+ */
+ for (;from!=end && my_isdigit(system_charset_info, (*from)); from++)
+ exponent=10*exponent+(*from-'0');
+ }
+
/*
- ** Remove pre-zeros if too big number
+ We only have to generate warnings if count_cuted_fields is set.
+ This is to avoid extra checks of the number when they are not needed.
+ Even if this flag is not set, it's ok to increment warnings, if
+ it makes the code easer to read.
*/
- for (i= (int) (decstr.nr_length+decstr.extra -(field_length-tmp_dec)+
- decstr.sign) ;
- i > 0 ;
- i--)
+
+ if (current_thd->count_cuted_fields)
{
- if (*from == '0')
+ for (;from != end && isspace(*from); from++) ; // Read end spaces
+ if (from != end) // If still something left, warn
{
- from++;
- decstr.nr_length--;
- continue;
+ current_thd->cuted_fields++;
+ is_cuted_fields_incr=1;
}
- if (decstr.sign && decstr.sign_char == '+' && i == 1)
- { // Remove pre '+'
- decstr.sign=0;
- break;
+ }
+
+ /*
+ Now "move" digits around the decimal dot according to the exponent value,
+ and add necessary zeros.
+ Examples :
+ - 1E+3 : needs 3 more zeros at the left of '.' (int_digits_added_zeros=3)
+ - 1E-3 : '1' moves at the right of '.', and 2 more zeros are needed
+ between '.' and '1'
+ - 1234.5E-3 : '234' moves at the right of '.'
+ These moves are implemented with pointers which point at the begin
+ and end of each moved segment. Examples :
+ - 1234.5E-3 : before the code below is executed, the int_digits part is
+ from '1' to '4' and the frac_digits part from '5' to '5'. After the code
+ below, the int_digits part is from '1' to '1', the frac_digits_head
+ part is from '2' to '4', and the frac_digits part from '5' to '5'.
+ - 1234.5E3 : before the code below is executed, the int_digits part is
+ from '1' to '4' and the frac_digits part from '5' to '5'. After the code
+ below, the int_digits part is from '1' to '4', the int_digits_tail
+ part is from '5' to '5', the frac_digits part is empty, and
+ int_digits_added_zeros=2 (to make 1234500).
+ */
+
+ if (!expo_sign_char)
+ tmp_uint=tmp_dec+(uint)(int_digits_end-int_digits_from);
+ else if (expo_sign_char == '-')
+ {
+ tmp_uint=min(exponent,(uint)(int_digits_end-int_digits_from));
+ frac_digits_added_zeros=exponent-tmp_uint;
+ int_digits_end -= tmp_uint;
+ frac_digits_head_end=int_digits_end+tmp_uint;
+ tmp_uint=tmp_dec+(uint)(int_digits_end-int_digits_from);
+ }
+ else // (expo_sign_char=='+')
+ {
+ tmp_uint=min(exponent,(uint)(frac_digits_end-frac_digits_from));
+ int_digits_added_zeros=exponent-tmp_uint;
+ int_digits_tail_from=frac_digits_from;
+ frac_digits_from=frac_digits_from+tmp_uint;
+ /*
+ We "eat" the heading zeros of the
+ int_digits.int_digits_tail.int_digits_added_zeros concatenation
+ (for example 0.003e3 must become 3 and not 0003)
+ */
+ if (int_digits_from == int_digits_end)
+ {
+ /*
+ There was nothing in the int_digits part, so continue
+ eating int_digits_tail zeros
+ */
+ for (; int_digits_tail_from != frac_digits_from &&
+ *int_digits_tail_from == '0'; int_digits_tail_from++) ;
+ if (int_digits_tail_from == frac_digits_from)
+ {
+ // there were only zeros in int_digits_tail too
+ int_digits_added_zeros=0;
+ }
}
- current_thd->cuted_fields++;
+ tmp_uint=(tmp_dec+(uint)(int_digits_end-int_digits_from)
+ +(uint)(frac_digits_from-int_digits_tail_from)+
+ int_digits_added_zeros);
+ }
+
+ /*
+ Now write the formated number
+
+ First the digits of the int_% parts.
+ Do we have enough room to write these digits ?
+ If the sign is defined and '-', we need one position for it
+ */
+
+ if (field_length < tmp_uint + (int) (sign_char == '-'))
+ {
// too big number, change to max or min number
- Field_decimal::overflow(decstr.sign && decstr.sign_char == '-');
+ Field_decimal::overflow(sign_char == '-');
return 1;
}
- char *to=ptr;
- for (i=(int) (field_length-tmp_dec-decstr.nr_length-decstr.extra - decstr.sign) ;
- i-- > 0 ;)
- *to++ = fyllchar;
- if (decstr.sign)
- *to++= decstr.sign_char;
- if (decstr.extra)
- *to++ = '0';
- for (i=(int) decstr.nr_length ; i-- > 0 ; )
- *to++ = *from++;
- if (tmp_dec--)
- {
- *to++ ='.';
- if (decstr.nr_dec) from++; // Skip '.'
- for (i=(int) min(decstr.nr_dec,tmp_dec) ; i-- > 0 ; ) *to++ = *from++;
- for (i=(int) (tmp_dec-min(decstr.nr_dec,tmp_dec)) ; i-- > 0 ; ) *to++ = '0';
+
+ /*
+ Tmp_left_pos is the position where the leftmost digit of
+ the int_% parts will be written
+ */
+ tmp_left_pos=pos=to+(uint)(field_length-tmp_uint);
+
+ // Write all digits of the int_% parts
+ while (int_digits_from != int_digits_end)
+ *pos++ = *int_digits_from++ ;
+
+ if (expo_sign_char == '+')
+ {
+ while (int_digits_tail_from != frac_digits_from)
+ *pos++= *int_digits_tail_from++;
+ while (int_digits_added_zeros-- >0)
+ *pos++= '0';
}
+ /*
+ Note the position where the rightmost digit of the int_% parts has been
+ written (this is to later check if the int_% parts contained nothing,
+ meaning an extra 0 is needed).
+ */
+ tmp_right_pos=pos;
/*
- ** Check for incorrect string if in batch mode (ALTER TABLE/LOAD DATA...)
+ Step back to the position of the leftmost digit of the int_% parts,
+ to write sign and fill with zeros or blanks or prezeros.
*/
- if (!error && current_thd->count_cuted_fields && from != end)
- { // Check if number was cuted
- for (; from != end ; from++)
+ pos=tmp_left_pos-1;
+ if (zerofill)
+ {
+ left_wall=to-1;
+ while (pos != left_wall) // Fill with zeros
+ *pos--='0';
+ }
+ else
+ {
+ left_wall=to+(sign_char != 0)-1;
+ if (!expo_sign_char) // If exponent was specified, ignore prezeros
+ {
+ for (;pos != left_wall && pre_zeros_from !=pre_zeros_end;
+ pre_zeros_from++)
+ *pos--= '0';
+ }
+ if (pos == tmp_right_pos-1)
+ *pos--= '0'; // no 0 has ever been written, so write one
+ left_wall= to-1;
+ if (sign_char && pos != left_wall)
+ {
+ /* Write sign if possible (it is if sign is '-') */
+ *pos--= sign_char;
+ }
+ while (pos != left_wall)
+ *pos--=' '; //fill with blanks
+ }
+
+ if (tmp_dec) // This field has decimals
+ {
+ /*
+ Write digits of the frac_% parts ;
+ Depending on current_thd->count_cutted_fields, we may also want
+ to know if some non-zero tail of these parts will
+ be truncated (for example, 0.002->0.00 will generate a warning,
+ while 0.000->0.00 will not)
+ (and 0E1000000000 will not, while 1E-1000000000 will)
+ */
+
+ pos=to+(uint)(field_length-tmp_dec); // Calculate post to '.'
+ *pos++='.';
+ right_wall=to+field_length;
+
+ if (expo_sign_char == '-')
{
- if (*from != '0')
+ while (frac_digits_added_zeros-- > 0)
{
- if (!my_isspace(system_charset_info,*from)) // Space is ok
- current_thd->cuted_fields++;
- break;
+ if (pos == right_wall)
+ {
+ if (current_thd->count_cuted_fields && !is_cuted_fields_incr)
+ break; // Go on below to see if we lose non zero digits
+ return 0;
+ }
+ *pos++='0';
+ }
+ while (int_digits_end != frac_digits_head_end)
+ {
+ tmp_char= *int_digits_end++;
+ if (pos == right_wall)
+ {
+ if (tmp_char != '0') // Losing a non zero digit ?
+ {
+ if (!is_cuted_fields_incr)
+ current_thd->cuted_fields++;
+ return 0;
+ }
+ continue;
+ }
+ *pos++= tmp_char;
+ }
+ }
+
+ for (;frac_digits_from!=frac_digits_end;)
+ {
+ tmp_char= *frac_digits_from++;
+ if (pos == right_wall)
+ {
+ if (tmp_char != '0') // Losing a non zero digit ?
+ {
+ if (!is_cuted_fields_incr)
+ current_thd->cuted_fields++;
+ return 0;
+ }
+ continue;
}
+ *pos++= tmp_char;
}
+
+ while (pos != right_wall)
+ *pos++='0'; // Fill with zeros at right of '.'
}
- return (error) ? 1 : 0;
+ return 0;
}
-int Field_decimal::store(double nr)
+int Field_decimal::store(double nr)
{
if (unsigned_flag && nr < 0)
{
overflow(1);
- current_thd->cuted_fields++;
return 1;
}
+
+#ifdef HAVE_FINITE
+ if (!finite(nr)) // Handle infinity as special case
+ {
+ overflow(nr < 0.0);
+ return 1;
+ }
+#endif
+
reg4 uint i,length;
char fyllchar,*to;
char buff[320];
@@ -548,7 +744,6 @@ int Field_decimal::store(double nr)
if (length > field_length)
{
overflow(nr < 0.0);
- current_thd->cuted_fields++;
return 1;
}
else
@@ -562,12 +757,11 @@ int Field_decimal::store(double nr)
}
-int Field_decimal::store(longlong nr)
+int Field_decimal::store(longlong nr)
{
if (unsigned_flag && nr < 0)
{
overflow(1);
- current_thd->cuted_fields++;
return 1;
}
char buff[22];
@@ -577,7 +771,6 @@ int Field_decimal::store(longlong nr)
if (length > int_part)
{
overflow(test(nr < 0L)); /* purecov: inspected */
- current_thd->cuted_fields++; /* purecov: inspected */
return 1;
}
else
@@ -673,8 +866,8 @@ void Field_decimal::sort_string(char *to,uint length)
char *str,*end;
for (str=ptr,end=ptr+length;
str != end &&
- ((my_isspace(system_charset_info,*str) || *str == '+' || *str == '0')) ;
-
+ ((my_isspace(system_charset_info,*str) || *str == '+' ||
+ *str == '0')) ;
str++)
*to++=' ';
if (str == end)
@@ -693,6 +886,7 @@ void Field_decimal::sort_string(char *to,uint length)
else memcpy(to,str,(uint) (end-str));
}
+
void Field_decimal::sql_type(String &res) const
{
uint tmp=field_length;
@@ -709,11 +903,11 @@ void Field_decimal::sql_type(String &res) const
** tiny int
****************************************************************************/
-int Field_tiny::store(const char *from,uint len,CHARSET_INFO *cs)
+int Field_tiny::store(const char *from,uint len,CHARSET_INFO *cs)
{
String tmp_str(from,len,default_charset_info);
long tmp= strtol(tmp_str.c_ptr(),NULL,10);
- int error=0;
+ int error= 0;
if (unsigned_flag)
{
@@ -721,18 +915,18 @@ int Field_tiny::store(const char *from,uint len,CHARSET_INFO *cs)
{
tmp=0; /* purecov: inspected */
current_thd->cuted_fields++; /* purecov: inspected */
- error = 1;
+ error= 1;
}
else if (tmp > 255)
{
tmp= 255;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (current_thd->count_cuted_fields && !test_if_int(from,len))
{
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
}
else
@@ -741,18 +935,18 @@ int Field_tiny::store(const char *from,uint len,CHARSET_INFO *cs)
{
tmp= -128;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (tmp >= 128)
{
tmp= 127;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (current_thd->count_cuted_fields && !test_if_int(from,len))
{
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
}
ptr[0]= (char) tmp;
@@ -760,9 +954,9 @@ int Field_tiny::store(const char *from,uint len,CHARSET_INFO *cs)
}
-int Field_tiny::store(double nr)
+int Field_tiny::store(double nr)
{
- int error=0;
+ int error= 0;
nr=rint(nr);
if (unsigned_flag)
{
@@ -770,13 +964,13 @@ int Field_tiny::store(double nr)
{
*ptr=0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr > 255.0)
{
*ptr=(char) 255;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
*ptr=(char) nr;
@@ -787,13 +981,13 @@ int Field_tiny::store(double nr)
{
*ptr= (char) -128;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr > 127.0)
{
*ptr=127;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
*ptr=(char) nr;
@@ -801,22 +995,22 @@ int Field_tiny::store(double nr)
return error;
}
-int Field_tiny::store(longlong nr)
+int Field_tiny::store(longlong nr)
{
- int error=0;
+ int error= 0;
if (unsigned_flag)
{
if (nr < 0L)
{
*ptr=0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr > 255L)
{
*ptr= (char) 255;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
*ptr=(char) nr;
@@ -827,13 +1021,13 @@ int Field_tiny::store(longlong nr)
{
*ptr= (char) -128;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr > 127L)
{
*ptr=127;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
*ptr=(char) nr;
@@ -904,29 +1098,29 @@ void Field_tiny::sql_type(String &res) const
// Note: Sometimes this should be fixed to use one strtol() to use
// len and check for garbage after number.
-int Field_short::store(const char *from,uint len,CHARSET_INFO *cs)
+int Field_short::store(const char *from,uint len,CHARSET_INFO *cs)
{
String tmp_str(from,len,default_charset_info);
long tmp= strtol(tmp_str.c_ptr(),NULL,10);
- int error=0;
+ int error= 0;
if (unsigned_flag)
{
if (tmp < 0)
{
tmp=0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (tmp > (uint16) ~0)
{
tmp=(uint16) ~0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (current_thd->count_cuted_fields && !test_if_int(from,len))
{
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
}
else
@@ -935,18 +1129,18 @@ int Field_short::store(const char *from,uint len,CHARSET_INFO *cs)
{
tmp= INT_MIN16;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (tmp > INT_MAX16)
{
tmp=INT_MAX16;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (current_thd->count_cuted_fields && !test_if_int(from,len))
{
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
}
#ifdef WORDS_BIGENDIAN
@@ -961,9 +1155,9 @@ int Field_short::store(const char *from,uint len,CHARSET_INFO *cs)
}
-int Field_short::store(double nr)
+int Field_short::store(double nr)
{
- int error=0;
+ int error= 0;
int16 res;
nr=rint(nr);
if (unsigned_flag)
@@ -972,13 +1166,13 @@ int Field_short::store(double nr)
{
res=0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr > (double) (uint16) ~0)
{
res=(int16) (uint16) ~0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
res=(int16) (uint16) nr;
@@ -989,13 +1183,13 @@ int Field_short::store(double nr)
{
res=INT_MIN16;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr > (double) INT_MAX16)
{
res=INT_MAX16;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
res=(int16) nr;
@@ -1011,9 +1205,9 @@ int Field_short::store(double nr)
return error;
}
-int Field_short::store(longlong nr)
+int Field_short::store(longlong nr)
{
- int error=0;
+ int error= 0;
int16 res;
if (unsigned_flag)
{
@@ -1021,13 +1215,13 @@ int Field_short::store(longlong nr)
{
res=0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr > (longlong) (uint16) ~0)
{
res=(int16) (uint16) ~0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
res=(int16) (uint16) nr;
@@ -1038,13 +1232,13 @@ int Field_short::store(longlong nr)
{
res=INT_MIN16;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr > INT_MAX16)
{
res=INT_MAX16;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
res=(int16) nr;
@@ -1168,11 +1362,11 @@ void Field_short::sql_type(String &res) const
// Note: Sometimes this should be fixed to use one strtol() to use
// len and check for garbage after number.
-int Field_medium::store(const char *from,uint len,CHARSET_INFO *cs)
+int Field_medium::store(const char *from,uint len,CHARSET_INFO *cs)
{
String tmp_str(from,len,default_charset_info);
long tmp= strtol(tmp_str.c_ptr(),NULL,10);
- int error=0;
+ int error= 0;
if (unsigned_flag)
{
@@ -1180,18 +1374,18 @@ int Field_medium::store(const char *from,uint len,CHARSET_INFO *cs)
{
tmp=0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (tmp >= (long) (1L << 24))
{
tmp=(long) (1L << 24)-1L;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (current_thd->count_cuted_fields && !test_if_int(from,len))
{
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
}
else
@@ -1200,18 +1394,18 @@ int Field_medium::store(const char *from,uint len,CHARSET_INFO *cs)
{
tmp= INT_MIN24;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (tmp > INT_MAX24)
{
tmp=INT_MAX24;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (current_thd->count_cuted_fields && !test_if_int(from,len))
{
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
}
@@ -1220,9 +1414,9 @@ int Field_medium::store(const char *from,uint len,CHARSET_INFO *cs)
}
-int Field_medium::store(double nr)
+int Field_medium::store(double nr)
{
- int error=0;
+ int error= 0;
nr=rint(nr);
if (unsigned_flag)
{
@@ -1230,14 +1424,14 @@ int Field_medium::store(double nr)
{
int3store(ptr,0);
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr >= (double) (long) (1L << 24))
{
uint32 tmp=(uint32) (1L << 24)-1L;
int3store(ptr,tmp);
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
int3store(ptr,(uint32) nr);
@@ -1249,14 +1443,14 @@ int Field_medium::store(double nr)
long tmp=(long) INT_MIN24;
int3store(ptr,tmp);
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr > (double) INT_MAX24)
{
long tmp=(long) INT_MAX24;
int3store(ptr,tmp);
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
int3store(ptr,(long) nr);
@@ -1264,23 +1458,23 @@ int Field_medium::store(double nr)
return error;
}
-int Field_medium::store(longlong nr)
+int Field_medium::store(longlong nr)
{
- int error=0;
+ int error= 0;
if (unsigned_flag)
{
if (nr < 0L)
{
int3store(ptr,0);
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr >= (longlong) (long) (1L << 24))
{
long tmp=(long) (1L << 24)-1L;;
int3store(ptr,tmp);
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
int3store(ptr,(uint32) nr);
@@ -1292,14 +1486,14 @@ int Field_medium::store(longlong nr)
long tmp=(long) INT_MIN24;
int3store(ptr,tmp);
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr > (longlong) INT_MAX24)
{
long tmp=(long) INT_MAX24;
int3store(ptr,tmp);
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
int3store(ptr,(long) nr);
@@ -1377,14 +1571,14 @@ void Field_medium::sql_type(String &res) const
// Note: Sometimes this should be fixed to use one strtol() to use
// len and check for garbage after number.
-int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
+int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
{
while (len && my_isspace(system_charset_info,*from))
{
len--; from++;
}
long tmp;
- int error=0;
+ int error= 0;
String tmp_str(from,len,default_charset_info);
errno=0;
if (unsigned_flag)
@@ -1393,7 +1587,7 @@ int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
{
tmp=0; // Set negative to 0
errno=ERANGE;
- error = 1;
+ error= 1;
}
else
tmp=(long) strtoul(tmp_str.c_ptr(),NULL,10);
@@ -1403,7 +1597,7 @@ int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
if (errno || current_thd->count_cuted_fields && !test_if_int(from,len))
{
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
@@ -1417,9 +1611,9 @@ int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
}
-int Field_long::store(double nr)
+int Field_long::store(double nr)
{
- int error=0;
+ int error= 0;
int32 res;
nr=rint(nr);
if (unsigned_flag)
@@ -1428,13 +1622,13 @@ int Field_long::store(double nr)
{
res=0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr > (double) (ulong) ~0L)
{
res=(int32) (uint32) ~0L;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
res=(int32) (ulong) nr;
@@ -1445,13 +1639,13 @@ int Field_long::store(double nr)
{
res=(int32) INT_MIN32;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr > (double) INT_MAX32)
{
res=(int32) INT_MAX32;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
res=(int32) nr;
@@ -1468,9 +1662,9 @@ int Field_long::store(double nr)
}
-int Field_long::store(longlong nr)
+int Field_long::store(longlong nr)
{
- int error=0;
+ int error= 0;
int32 res;
if (unsigned_flag)
{
@@ -1478,13 +1672,13 @@ int Field_long::store(longlong nr)
{
res=0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr >= (LL(1) << 32))
{
res=(int32) (uint32) ~0L;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
res=(int32) (uint32) nr;
@@ -1495,13 +1689,13 @@ int Field_long::store(longlong nr)
{
res=(int32) INT_MIN32;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr > (longlong) INT_MAX32)
{
res=(int32) INT_MAX32;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
res=(int32) nr;
@@ -1623,7 +1817,7 @@ void Field_long::sql_type(String &res) const
** longlong int
****************************************************************************/
-int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs)
+int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs)
{
while (len && my_isspace(system_charset_info,*from))
{ // For easy error check
@@ -1631,7 +1825,7 @@ int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs)
}
longlong tmp;
String tmp_str(from,len,default_charset_info);
- int error=0;
+ int error= 0;
errno=0;
if (unsigned_flag)
{
@@ -1639,7 +1833,7 @@ int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs)
{
tmp=0; // Set negative to 0
errno=ERANGE;
- error = 1;
+ error= 1;
}
else
tmp=(longlong) strtoull(tmp_str.c_ptr(),NULL,10);
@@ -1649,7 +1843,7 @@ int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs)
if (errno || current_thd->count_cuted_fields && !test_if_int(from,len))
{
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
@@ -1663,9 +1857,9 @@ int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs)
}
-int Field_longlong::store(double nr)
+int Field_longlong::store(double nr)
{
- int error=0;
+ int error= 0;
longlong res;
nr=rint(nr);
if (unsigned_flag)
@@ -1674,13 +1868,13 @@ int Field_longlong::store(double nr)
{
res=0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr >= (double) ~ (ulonglong) 0)
{
res= ~(longlong) 0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
res=(longlong) (ulonglong) nr;
@@ -1691,13 +1885,13 @@ int Field_longlong::store(double nr)
{
res=(longlong) LONGLONG_MIN;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr >= (double) LONGLONG_MAX)
{
res=(longlong) LONGLONG_MAX;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
res=(longlong) nr;
@@ -1714,7 +1908,7 @@ int Field_longlong::store(double nr)
}
-int Field_longlong::store(longlong nr)
+int Field_longlong::store(longlong nr)
{
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
@@ -1843,7 +2037,7 @@ void Field_longlong::sql_type(String &res) const
** single precision float
****************************************************************************/
-int Field_float::store(const char *from,uint len,CHARSET_INFO *cs)
+int Field_float::store(const char *from,uint len,CHARSET_INFO *cs)
{
String tmp_str(from,len,default_charset_info);
errno=0;
@@ -1857,29 +2051,29 @@ int Field_float::store(const char *from,uint len,CHARSET_INFO *cs)
}
-int Field_float::store(double nr)
+int Field_float::store(double nr)
{
float j;
- int error=0;
+ int error= 0;
if (dec < NOT_FIXED_DEC)
nr=floor(nr*log_10[dec]+0.5)/log_10[dec]; // To fixed point
if (unsigned_flag && nr < 0)
{
current_thd->cuted_fields++;
nr=0;
- error = 1;
+ error= 1;
}
if (nr < -FLT_MAX)
{
j= -FLT_MAX;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr > FLT_MAX)
{
j=FLT_MAX;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
j= (float) nr;
@@ -1895,15 +2089,15 @@ int Field_float::store(double nr)
}
-int Field_float::store(longlong nr)
+int Field_float::store(longlong nr)
{
- int error=0;
+ int error= 0;
float j= (float) nr;
if (unsigned_flag && j < 0)
{
current_thd->cuted_fields++;
j=0;
- error = 1;
+ error= 1;
}
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
@@ -2105,22 +2299,22 @@ void Field_float::sql_type(String &res) const
** double precision floating point numbers
****************************************************************************/
-int Field_double::store(const char *from,uint len,CHARSET_INFO *cs)
+int Field_double::store(const char *from,uint len,CHARSET_INFO *cs)
{
String tmp_str(from,len,default_charset_info);
errno=0;
- int error=0;
+ int error= 0;
double j= atof(tmp_str.c_ptr());
if (errno || current_thd->count_cuted_fields && !test_if_real(from,len))
{
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
if (unsigned_flag && j < 0)
{
current_thd->cuted_fields++;
j=0;
- error = 1;
+ error= 1;
}
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
@@ -2134,16 +2328,16 @@ int Field_double::store(const char *from,uint len,CHARSET_INFO *cs)
}
-int Field_double::store(double nr)
+int Field_double::store(double nr)
{
- int error=0;
+ int error= 0;
if (dec < NOT_FIXED_DEC)
nr=floor(nr*log_10[dec]+0.5)/log_10[dec]; // To fixed point
if (unsigned_flag && nr < 0)
{
current_thd->cuted_fields++;
nr=0;
- error = 1;
+ error= 1;
}
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
@@ -2157,14 +2351,14 @@ int Field_double::store(double nr)
}
-int Field_double::store(longlong nr)
+int Field_double::store(longlong nr)
{
double j= (double) nr;
- int error=0;
+ int error= 0;
if (unsigned_flag && j < 0)
{
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
j=0;
}
#ifdef WORDS_BIGENDIAN
@@ -2373,7 +2567,7 @@ Field_timestamp::Field_timestamp(char *ptr_arg, uint32 len_arg,
}
-int Field_timestamp::store(const char *from,uint len,CHARSET_INFO *cs)
+int Field_timestamp::store(const char *from,uint len,CHARSET_INFO *cs)
{
long tmp=(long) str_to_timestamp(from,len);
#ifdef WORDS_BIGENDIAN
@@ -2387,7 +2581,7 @@ int Field_timestamp::store(const char *from,uint len,CHARSET_INFO *cs)
return 0;
}
-void Field_timestamp::fill_and_store(char *from,uint len)
+void Field_timestamp::fill_and_store(char *from,uint len)
{
uint res_length;
if (len <= field_length)
@@ -2416,16 +2610,16 @@ void Field_timestamp::fill_and_store(char *from,uint len)
}
-int Field_timestamp::store(double nr)
+int Field_timestamp::store(double nr)
{
- int error=0;
+ int error= 0;
if (nr < 0 || nr > 99991231235959.0)
{
- nr=0; // Avoid overflow on buff
+ nr= 0; // Avoid overflow on buff
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
- error |= Field_timestamp::store((longlong) rint(nr));
+ error|= Field_timestamp::store((longlong) rint(nr));
return error;
}
@@ -2467,7 +2661,7 @@ static longlong fix_datetime(longlong nr)
}
-int Field_timestamp::store(longlong nr)
+int Field_timestamp::store(longlong nr)
{
TIME l_time;
time_t timestamp;
@@ -2717,15 +2911,15 @@ void Field_timestamp::set_time()
** Stored as a 3 byte unsigned int
****************************************************************************/
-int Field_time::store(const char *from,uint len,CHARSET_INFO *cs)
+int Field_time::store(const char *from,uint len,CHARSET_INFO *cs)
{
TIME ltime;
long tmp;
- int error=0;
+ int error= 0;
if (str_to_time(from,len,&ltime))
{
tmp=0L;
- error = 1;
+ error= 1;
}
else
{
@@ -2736,7 +2930,7 @@ int Field_time::store(const char *from,uint len,CHARSET_INFO *cs)
{
tmp=8385959;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
}
if (ltime.neg)
@@ -2746,21 +2940,21 @@ int Field_time::store(const char *from,uint len,CHARSET_INFO *cs)
}
-int Field_time::store(double nr)
+int Field_time::store(double nr)
{
long tmp;
- int error=0;
+ int error= 0;
if (nr > 8385959.0)
{
tmp=8385959L;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr < -8385959.0)
{
tmp= -8385959L;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
{
@@ -2771,7 +2965,7 @@ int Field_time::store(double nr)
{
tmp=0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
}
int3store(ptr,tmp);
@@ -2779,21 +2973,21 @@ int Field_time::store(double nr)
}
-int Field_time::store(longlong nr)
+int Field_time::store(longlong nr)
{
long tmp;
- int error=0;
+ int error= 0;
if (nr > (longlong) 8385959L)
{
tmp=8385959L;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else if (nr < (longlong) -8385959L)
{
tmp= -8385959L;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
{
@@ -2802,7 +2996,7 @@ int Field_time::store(longlong nr)
{
tmp=0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
}
int3store(ptr,tmp);
@@ -2882,7 +3076,7 @@ void Field_time::sql_type(String &res) const
** Can handle 2 byte or 4 byte years!
****************************************************************************/
-int Field_year::store(const char *from, uint len,CHARSET_INFO *cs)
+int Field_year::store(const char *from, uint len,CHARSET_INFO *cs)
{
String tmp_str(from,len,default_charset_info);
long nr= strtol(tmp_str.c_ptr(),NULL,10);
@@ -2906,7 +3100,7 @@ int Field_year::store(const char *from, uint len,CHARSET_INFO *cs)
return 0;
}
-int Field_year::store(double nr)
+int Field_year::store(double nr)
{
if (nr < 0.0 || nr >= 2155.0)
{
@@ -2917,7 +3111,7 @@ int Field_year::store(double nr)
return Field_year::store((longlong) nr);
}
-int Field_year::store(longlong nr)
+int Field_year::store(longlong nr)
{
if (nr < 0 || nr >= 100 && nr <= 1900 || nr > 2155)
{
@@ -2976,15 +3170,15 @@ void Field_year::sql_type(String &res) const
** Stored as a 4 byte unsigned int
****************************************************************************/
-int Field_date::store(const char *from, uint len,CHARSET_INFO *cs)
+int Field_date::store(const char *from, uint len,CHARSET_INFO *cs)
{
TIME l_time;
uint32 tmp;
- int error=0;
+ int error= 0;
if (str_to_TIME(from,len,&l_time,1) == TIMESTAMP_NONE)
{
tmp=0;
- error = 1;
+ error= 1;
}
else
tmp=(uint32) l_time.year*10000L + (uint32) (l_time.month*100+l_time.day);
@@ -3000,17 +3194,17 @@ int Field_date::store(const char *from, uint len,CHARSET_INFO *cs)
}
-int Field_date::store(double nr)
+int Field_date::store(double nr)
{
long tmp;
- int error=0;
+ int error= 0;
if (nr >= 19000000000000.0 && nr <= 99991231235959.0)
nr=floor(nr/1000000.0); // Timestamp to date
if (nr < 0.0 || nr > 99991231.0)
{
tmp=0L;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
tmp=(long) rint(nr);
@@ -3026,17 +3220,17 @@ int Field_date::store(double nr)
}
-int Field_date::store(longlong nr)
+int Field_date::store(longlong nr)
{
long tmp;
- int error=0;
+ int error= 0;
if (nr >= LL(19000000000000) && nr < LL(99991231235959))
nr=nr/LL(1000000); // Timestamp to date
if (nr < 0 || nr > LL(99991231))
{
tmp=0L;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
tmp=(long) nr;
@@ -3144,15 +3338,15 @@ void Field_date::sql_type(String &res) const
** In number context: YYYYMMDD
****************************************************************************/
-int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs)
+int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs)
{
TIME l_time;
long tmp;
- int error=0;
+ int error= 0;
if (str_to_TIME(from,len,&l_time,1) == TIMESTAMP_NONE)
{
tmp=0L;
- error = 1;
+ error= 1;
}
else
tmp= l_time.day + l_time.month*32 + l_time.year*16*32;
@@ -3160,7 +3354,7 @@ int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs)
return error;
}
-int Field_newdate::store(double nr)
+int Field_newdate::store(double nr)
{
if (nr < 0.0 || nr > 99991231235959.0)
{
@@ -3172,17 +3366,17 @@ int Field_newdate::store(double nr)
}
-int Field_newdate::store(longlong nr)
+int Field_newdate::store(longlong nr)
{
int32 tmp;
- int error=0;
+ int error= 0;
if (nr >= LL(100000000) && nr <= LL(99991231235959))
nr=nr/LL(1000000); // Timestamp to date
if (nr < 0L || nr > 99991231L)
{
tmp=0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
{
@@ -3200,7 +3394,7 @@ int Field_newdate::store(longlong nr)
{
tmp=0L; // Don't allow date to change
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
tmp= day + month*32 + (tmp/10000)*16*32;
@@ -3309,7 +3503,7 @@ void Field_newdate::sql_type(String &res) const
** Stored as a 8 byte unsigned int. Should sometimes be change to a 6 byte int.
****************************************************************************/
-int Field_datetime::store(const char *from,uint len,CHARSET_INFO *cs)
+int Field_datetime::store(const char *from,uint len,CHARSET_INFO *cs)
{
longlong tmp=str_to_datetime(from,len,1);
#ifdef WORDS_BIGENDIAN
@@ -3324,28 +3518,28 @@ int Field_datetime::store(const char *from,uint len,CHARSET_INFO *cs)
}
-int Field_datetime::store(double nr)
+int Field_datetime::store(double nr)
{
- int error=0;
+ int error= 0;
if (nr < 0.0 || nr > 99991231235959.0)
{
nr=0.0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
error |= Field_datetime::store((longlong) rint(nr));
return error;
}
-int Field_datetime::store(longlong nr)
+int Field_datetime::store(longlong nr)
{
- int error=0;
+ int error= 0;
if (nr < 0 || nr > LL(99991231235959))
{
nr=0;
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
else
nr=fix_datetime(nr);
@@ -3532,14 +3726,14 @@ void Field_datetime::sql_type(String &res) const
/* Copy a string and fill with space */
-int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
+int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
{
field_charset=cs;
- int error=0;
+ int error= 0;
#ifdef USE_TIS620
- if(!binary_flag) {
+ if (!binary_flag) {
ThNormalize((uchar *)ptr, field_length, (uchar *)from, length);
- if(length < field_length) {
+ if (length < field_length) {
bfill(ptr + length, field_length - length, ' ');
}
}
@@ -3572,7 +3766,7 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
}
-int Field_string::store(double nr)
+int Field_string::store(double nr)
{
char buff[MAX_FIELD_WIDTH],*end;
int width=min(field_length,DBL_DIG+5);
@@ -3582,7 +3776,7 @@ int Field_string::store(double nr)
}
-int Field_string::store(longlong nr)
+int Field_string::store(longlong nr)
{
char buff[22];
char *end=longlong10_to_str(nr,buff,-10);
@@ -3745,12 +3939,12 @@ uint Field_string::max_packed_col_length(uint max_length)
****************************************************************************/
-int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
+int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
{
- int error=0;
+ int error= 0;
field_charset=cs;
#ifdef USE_TIS620
- if(!binary_flag)
+ if (!binary_flag)
{
ThNormalize((uchar *) ptr+2, field_length, (uchar *) from, length);
}
@@ -3764,7 +3958,7 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
length=field_length;
memcpy(ptr+2,from,field_length);
current_thd->cuted_fields++;
- error = 1;
+ error= 1;
}
#endif /* USE_TIS620 */
int2store(ptr,length);
@@ -3772,7 +3966,7 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
}
-int Field_varstring::store(double nr)
+int Field_varstring::store(double nr)
{
char buff[MAX_FIELD_WIDTH],*end;
int width=min(field_length,DBL_DIG+5);
@@ -3782,7 +3976,7 @@ int Field_varstring::store(double nr)
}
-int Field_varstring::store(longlong nr)
+int Field_varstring::store(longlong nr)
{
char buff[22];
char *end=longlong10_to_str(nr,buff,-10);
@@ -4071,7 +4265,7 @@ uint32 Field_blob::get_length(const char *pos)
}
-int Field_blob::store(const char *from,uint len,CHARSET_INFO *cs)
+int Field_blob::store(const char *from,uint len,CHARSET_INFO *cs)
{
field_charset=cs;
if (!len)
@@ -4087,7 +4281,7 @@ int Field_blob::store(const char *from,uint len,CHARSET_INFO *cs)
if (table->copy_blobs || len <= MAX_FIELD_WIDTH)
{ // Must make a copy
#ifdef USE_TIS620
- if(!binary_flag)
+ if (!binary_flag)
{
/* If there isn't enough memory, use original string */
if ((th_ptr=(char * ) my_malloc(sizeof(char) * len,MYF(0))))
@@ -4109,17 +4303,19 @@ int Field_blob::store(const char *from,uint len,CHARSET_INFO *cs)
}
-int Field_blob::store(double nr)
+int Field_blob::store(double nr)
{
value.set(nr);
- return Field_blob::store(value.ptr(),(uint) value.length(), default_charset_info);
+ return Field_blob::store(value.ptr(),(uint) value.length(),
+ default_charset_info);
}
-int Field_blob::store(longlong nr)
+int Field_blob::store(longlong nr)
{
value.set(nr);
- return Field_blob::store(value.ptr(), (uint) value.length(), default_charset_info);
+ return Field_blob::store(value.ptr(), (uint) value.length(),
+ default_charset_info);
}
@@ -4226,16 +4422,15 @@ int Field_blob::cmp_binary(const char *a_ptr, const char *b_ptr,
void Field_blob::get_key_image(char *buff,uint length, imagetype type)
{
- if(type == itMBR)
+ length-= HA_KEY_BLOB_LENGTH;
+ uint32 blob_length= get_length(ptr);
+ char *blob;
+
+ if (type == itMBR)
{
- length-=HA_KEY_BLOB_LENGTH;
- ulong blob_length=get_length(ptr);
- char *blob;
- get_ptr(&blob);
- if(!blob_length)
- {
+ if (!blob_length)
return;
- }
+ get_ptr(&blob);
MBR mbr;
Geometry gobj;
@@ -4249,8 +4444,6 @@ void Field_blob::get_key_image(char *buff,uint length, imagetype type)
}
length-=HA_KEY_BLOB_LENGTH;
- uint32 blob_length=get_length(ptr);
- char *blob;
if ((uint32) length > blob_length)
{
#ifdef HAVE_purify
@@ -4269,6 +4462,7 @@ void Field_blob::set_key_image(char *buff,uint length)
(void) Field_blob::store(buff+2,length, default_charset_info);
}
+
void Field_geom::get_key_image(char *buff,uint length, imagetype type)
{
length-=HA_KEY_BLOB_LENGTH;
@@ -4293,7 +4487,6 @@ void Field_geom::set_key_image(char *buff,uint length)
}
-
int Field_blob::key_cmp(const byte *key_ptr, uint max_key_length)
{
char *blob1;
@@ -4587,9 +4780,9 @@ uint find_enum(TYPELIB *lib,const char *x, uint length)
** (if there isn't a empty value in the enum)
*/
-int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
+int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
{
- int error=0;
+ int error= 0;
uint tmp=find_enum(typelib,from,length);
if (!tmp)
{
@@ -4620,15 +4813,15 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
}
-int Field_enum::store(double nr)
+int Field_enum::store(double nr)
{
return Field_enum::store((longlong) nr);
}
-int Field_enum::store(longlong nr)
+int Field_enum::store(longlong nr)
{
- int error=0;
+ int error= 0;
if ((uint) nr > typelib->count || nr == 0)
{
current_thd->cuted_fields++;
@@ -4763,11 +4956,11 @@ ulonglong find_set(TYPELIB *lib,const char *x,uint length)
if (x != end)
{
const char *start=x;
- bool error=0;
+ bool error= 0;
for (;;)
{
const char *pos=start;
- for ( ; pos != end && *pos != field_separator ; pos++) ;
+ for (; pos != end && *pos != field_separator ; pos++) ;
uint find=find_enum(lib,start,(uint) (pos-start));
if (!find)
error=1;
@@ -4784,9 +4977,9 @@ ulonglong find_set(TYPELIB *lib,const char *x,uint length)
}
-int Field_set::store(const char *from,uint length,CHARSET_INFO *cs)
+int Field_set::store(const char *from,uint length,CHARSET_INFO *cs)
{
- int error=0;
+ int error= 0;
ulonglong tmp=find_set(typelib,from,length);
if (!tmp && length && length < 22)
{
@@ -4814,9 +5007,9 @@ int Field_set::store(const char *from,uint length,CHARSET_INFO *cs)
}
-int Field_set::store(longlong nr)
+int Field_set::store(longlong nr)
{
- int error=0;
+ int error= 0;
if ((ulonglong) nr > (ulonglong) (((longlong) 1 << typelib->count) -
(longlong) 1))
{
@@ -4914,7 +5107,7 @@ bool Field_num::eq_def(Field *field)
*****************************************************************************/
/*
-** Make a field from the .frm file info
+ Make a field from the .frm file info
*/
uint32 calc_pack_length(enum_field_types type,uint32 length)
@@ -5116,7 +5309,8 @@ create_field::create_field(Field *old_field,Field *orig_field)
orig_field)
{
char buff[MAX_FIELD_WIDTH],*pos;
- String tmp(buff,sizeof(buff),default_charset_info);
+ CHARSET_INFO *field_charset= charset ? charset : default_charset_info;
+ String tmp(buff,sizeof(buff),field_charset);
/* Get the value from record[2] (the default value row) */
my_ptrdiff_t diff= (my_ptrdiff_t) (orig_field->table->rec_buff_length*2);
@@ -5128,7 +5322,7 @@ create_field::create_field(Field *old_field,Field *orig_field)
{
pos= (char*) sql_memdup(tmp.ptr(),tmp.length()+1);
pos[tmp.length()]=0;
- def=new Item_string(pos,tmp.length(),default_charset_info);
+ def=new Item_string(pos,tmp.length(),field_charset);
}
}
}
diff --git a/sql/field.h b/sql/field.h
index 88187b2b7aa..551619abc6f 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -43,7 +43,7 @@ public:
const char *table_name,*field_name;
LEX_STRING comment;
ulong query_id; // For quick test of used fields
- // Field is part of the following keys
+ /* Field is part of the following keys */
key_map key_start,part_of_key,part_of_sortkey;
enum utype { NONE,DATE,SHIELD,NOEMPTY,CASEUP,PNR,BGNR,PGNR,YES,NO,REL,
CHECK,EMPTY,UNKNOWN_FIELD,CASEDN,NEXT_NUMBER,INTERVAL_FIELD,
@@ -74,6 +74,13 @@ public:
virtual uint32 pack_length() const { return (uint32) field_length; }
virtual void reset(void) { bzero(ptr,pack_length()); }
virtual void reset_fields() {}
+ virtual void set_default()
+ {
+ memcpy(ptr, ptr + table->rec_buff_length, pack_length());
+ if (null_ptr)
+ *null_ptr= ((*null_ptr & (uchar) ~null_bit) |
+ null_ptr[table->rec_buff_length] & null_bit);
+ }
virtual bool binary() const { return 1; }
virtual bool zero_pack() const { return 1; }
virtual enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
@@ -93,12 +100,13 @@ public:
virtual int key_cmp(const byte *str, uint length)
{ return cmp(ptr,(char*) str); }
virtual uint decimals() const { return 0; }
+ /*
+ Caller beware: sql_type can change str.Ptr, so check
+ ptr() to see if it changed if you are using your own buffer
+ in str and restore it with set() if needed
+ */
virtual void sql_type(String &str) const =0;
- // Caller beware: sql_type can change str.Ptr, so check
- // ptr() to see if it changed if you are using your own buffer
- // in str and restore it with set() if needed
-
- virtual uint size_of() const =0; // For new field
+ virtual uint size_of() const =0; // For new field
inline bool is_null(uint row_offset=0)
{ return null_ptr ? (null_ptr[row_offset] & null_bit ? 1 : 0) : table->null_row; }
inline bool is_real_null(uint row_offset=0)
@@ -185,7 +193,7 @@ public:
{ return cmp(a,b); }
virtual int pack_cmp(const char *b, uint key_length_arg)
{ return cmp(ptr,b); }
- uint offset(); // Should be inline ...
+ uint offset(); // Should be inline ...
void copy_from_tmp(int offset);
uint fill_cache_field(struct st_cache_field *copy);
virtual bool get_date(TIME *ltime,bool fuzzydate);
@@ -211,7 +219,7 @@ public:
class Field_num :public Field {
public:
const uint8 dec;
- bool zerofill,unsigned_flag; // Purify cannot handle bit fields
+ bool zerofill,unsigned_flag; // Purify cannot handle bit fields
Field_num(char *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, utype unireg_check_arg,
const char *field_name_arg,
@@ -449,6 +457,7 @@ public:
void sort_string(char *buff,uint length);
uint32 pack_length() const { return 8; }
void sql_type(String &str) const;
+ bool store_for_compare() { return 1; }
};
#endif
@@ -561,6 +570,10 @@ public:
bool store_for_compare() { return 1; }
bool zero_pack() const { return 0; }
void set_time();
+ virtual void set_default()
+ {
+ set_time();
+ }
inline long get_timestamp()
{
#ifdef WORDS_BIGENDIAN
@@ -835,7 +848,7 @@ public:
class Field_blob :public Field_str {
uint packlength;
- String value; // For temporaries
+ String value; // For temporaries
bool binary_flag;
bool geom_flag;
public:
@@ -956,9 +969,9 @@ public:
:Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, table_arg, default_charset_info),
packlength(packlength_arg),typelib(typelib_arg)
- {
+ {
flags|=ENUM_FLAG;
- }
+ }
enum_field_types type() const { return FIELD_TYPE_STRING; }
enum Item_result cmp_type () const { return INT_RESULT; }
enum ha_base_keytype key_type() const;
@@ -1008,25 +1021,24 @@ public:
/*
-** Create field class for CREATE TABLE
+ Create field class for CREATE TABLE
*/
class create_field :public Sql_alloc {
public:
const char *field_name;
- const char *change; // If done with alter table
- const char *after; // Put column after this one
- LEX_STRING comment; // Comment for field
- Item *def; // Default value
+ const char *change; // If done with alter table
+ const char *after; // Put column after this one
+ LEX_STRING comment; // Comment for field
+ Item *def; // Default value
enum enum_field_types sql_type;
uint32 length;
uint decimals,flags,pack_length;
Field::utype unireg_check;
- TYPELIB *interval; // Which interval to use
- Field *field; // For alter table
- CHARSET_INFO *charset;
+ TYPELIB *interval; // Which interval to use
+ Field *field; // For alter table
- uint8 row,col,sc_length,interval_id; // For rea_create_table
+ uint8 row,col,sc_length,interval_id; // For rea_create_table
uint offset,pack_flag;
create_field() :after(0) {}
create_field(Field *field, Field *orig_field);
@@ -1034,7 +1046,7 @@ public:
/*
-** A class for sending info to the client
+ A class for sending info to the client
*/
class Send_field {
@@ -1049,7 +1061,7 @@ class Send_field {
/*
-** A class for quick copying data to fields
+ A class for quick copying data to fields
*/
class Copy_field :public Sql_alloc {
@@ -1065,7 +1077,7 @@ public:
Copy_field() {}
~Copy_field() {}
- void set(Field *to,Field *from,bool save); // Field to field
+ void set(Field *to,Field *from,bool save); // Field to field
void set(char *to,Field *from); // Field to string
void (*do_copy)(Copy_field *);
void (*do_copy2)(Copy_field *); // Used to handle null values
@@ -1086,11 +1098,11 @@ ulonglong find_set(TYPELIB *typelib,const char *x, uint length);
bool test_if_int(const char *str,int length);
/*
-** The following are for the interface with the .frm file
+ The following are for the interface with the .frm file
*/
#define FIELDFLAG_DECIMAL 1
-#define FIELDFLAG_BINARY 1 // Shares same flag
+#define FIELDFLAG_BINARY 1 // Shares same flag
#define FIELDFLAG_NUMBER 2
#define FIELDFLAG_ZEROFILL 4
#define FIELDFLAG_PACK 120 // Bits used for packing
diff --git a/sql/filesort.cc b/sql/filesort.cc
index b7745ccb8ca..398ba4875d3 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -75,6 +75,8 @@ ha_rows filesort(TABLE *table, SORT_FIELD *sortorder, uint s_length,
uchar **sort_keys;
IO_CACHE tempfile, buffpek_pointers, *selected_records_file, *outfile;
SORTPARAM param;
+ THD *thd= current_thd;
+
DBUG_ENTER("filesort");
DBUG_EXECUTE("info",TEST_filesort(sortorder,s_length,special););
CHARSET_INFO *charset=table->table_charset;
@@ -143,7 +145,7 @@ ha_rows filesort(TABLE *table, SORT_FIELD *sortorder, uint s_length,
goto err;
#endif
- memavl=sortbuff_size;
+ memavl= thd->variables.sortbuff_size;
while (memavl >= MIN_SORT_MEMORY)
{
ulong old_memavl;
@@ -158,7 +160,8 @@ ha_rows filesort(TABLE *table, SORT_FIELD *sortorder, uint s_length,
}
if (memavl < MIN_SORT_MEMORY)
{
- my_error(ER_OUTOFMEMORY,MYF(ME_ERROR+ME_WAITTANG),sortbuff_size);
+ my_error(ER_OUTOFMEMORY,MYF(ME_ERROR+ME_WAITTANG),
+ thd->variables.sortbuff_size);
goto err;
}
if (open_cached_file(&buffpek_pointers,mysql_tmpdir,TEMP_PREFIX,
@@ -324,7 +327,8 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
file->extra(HA_EXTRA_KEYREAD); // QQ is removed
next_pos=(byte*) 0; /* Find records in sequence */
file->rnd_init();
- file->extra(HA_EXTRA_CACHE); /* Quicker reads */
+ file->extra_opt(HA_EXTRA_CACHE,
+ current_thd->variables.read_buff_size);
}
for (;;)
@@ -917,6 +921,7 @@ static uint
sortlength(SORT_FIELD *sortorder, uint s_length)
{
reg2 uint length;
+ THD *thd= current_thd;
length=0;
for (; s_length-- ; sortorder++)
@@ -924,7 +929,7 @@ sortlength(SORT_FIELD *sortorder, uint s_length)
if (sortorder->field)
{
if (sortorder->field->type() == FIELD_TYPE_BLOB)
- sortorder->length=max_item_sort_length;
+ sortorder->length= thd->variables.max_sort_length;
else
{
sortorder->length=sortorder->field->pack_length();
@@ -971,7 +976,7 @@ sortlength(SORT_FIELD *sortorder, uint s_length)
if (sortorder->item->maybe_null)
length++; // Place for NULL marker
}
- set_if_smaller(sortorder->length,max_item_sort_length);
+ set_if_smaller(sortorder->length, thd->variables.max_sort_length);
length+=sortorder->length;
}
sortorder->field= (Field*) 0; // end marker
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc
index 6cec0b160b7..4da5496c201 100644
--- a/sql/gen_lex_hash.cc
+++ b/sql/gen_lex_hash.cc
@@ -73,15 +73,6 @@ static struct my_option my_long_options[] =
0, 0, 0},
{"version", 'V', "Output version information and exit",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"rnd1", 'r', "Set 1 part of rnd value for hash generator",
- (gptr*) &best_t1, (gptr*) &best_t1, 0, GET_ULONG, REQUIRED_ARG, 6657025L,
- 0, 0, 0, 0, 0},
- {"rnd2", 'R', "Set 2 part of rnd value for hash generator",
- (gptr*) &best_t2, (gptr*) &best_t2, 0, GET_ULONG, REQUIRED_ARG, 6114496L,
- 0, 0, 0, 0, 0},
- {"type", 't', "Set type of char table to generate",
- (gptr*) &best_type, (gptr*) &best_type, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0,
- 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -373,7 +364,7 @@ static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument __attribute__((unused)))
{
- switch(optid) {
+ switch (optid) {
case 'v':
opt_verbose++;
break;
@@ -398,8 +389,9 @@ static int get_options(int argc, char **argv)
if (argc >= 1)
{
+ fprintf(stderr,"%s: Too many arguments\n", my_progname);
usage(0);
- exit(1);
+ exit(1);
}
return(0);
}
@@ -477,8 +469,7 @@ int main(int argc,char **argv)
int error;
MY_INIT(argv[0]);
-
- start_value=1109118L; /* mode=4903 add=3 type: 0 */
+ start_value=2925024L; best_t1=654916L; best_t2=1723390L; best_type=3; /* mode=4943 add=1 type: 0 */
if (get_options(argc,(char **) argv))
exit(1);
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index 58a090a8aed..131e38a6bc3 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -358,7 +358,7 @@ berkeley_cmp_packed_key(DB *file, const DBT *new_key, const DBT *saved_key)
KEY_PART_INFO *key_part= key->key_part, *end=key_part+key->key_parts;
uint key_length=new_key->size;
- for ( ; key_part != end && (int) key_length > 0; key_part++)
+ for (; key_part != end && (int) key_length > 0; key_part++)
{
int cmp;
if (key_part->null_bit)
@@ -396,7 +396,7 @@ berkeley_cmp_fix_length_key(DB *file, const DBT *new_key, const DBT *saved_key)
KEY_PART_INFO *key_part= key->key_part, *end=key_part+key->key_parts;
uint key_length=new_key->size;
- for ( ; key_part != end && (int) key_length > 0 ; key_part++)
+ for (; key_part != end && (int) key_length > 0 ; key_part++)
{
int cmp;
if ((cmp=key_part->field->pack_cmp(new_key_ptr,saved_key_ptr,0)))
@@ -417,7 +417,7 @@ berkeley_key_cmp(TABLE *table, KEY *key_info, const char *key, uint key_length)
KEY_PART_INFO *key_part= key_info->key_part,
*end=key_part+key_info->key_parts;
- for ( ; key_part != end && (int) key_length > 0; key_part++)
+ for (; key_part != end && (int) key_length > 0; key_part++)
{
int cmp;
if (key_part->null_bit)
@@ -561,7 +561,7 @@ int ha_berkeley::open(const char *name, int mode, uint test_if_locked)
ref_length=0;
KEY_PART_INFO *key_part= table->key_info[primary_key].key_part;
KEY_PART_INFO *end=key_part+table->key_info[primary_key].key_parts;
- for ( ; key_part != end ; key_part++)
+ for (; key_part != end ; key_part++)
ref_length+= key_part->field->max_packed_col_length(key_part->length);
share->fixed_length_primary_key=
(ref_length == table->key_info[primary_key].key_length);
@@ -701,7 +701,7 @@ void ha_berkeley::unpack_key(char *record, DBT *key, uint index)
*end=key_part+key_info->key_parts;
char *pos=(char*) key->data;
- for ( ; key_part != end; key_part++)
+ for (; key_part != end; key_part++)
{
if (key_part->null_bit)
{
@@ -747,7 +747,7 @@ DBT *ha_berkeley::create_key(DBT *key, uint keynr, char *buff,
key->data=buff;
key->app_private= key_info;
- for ( ; key_part != end && key_length > 0; key_part++)
+ for (; key_part != end && key_length > 0; key_part++)
{
if (key_part->null_bit)
{
@@ -925,7 +925,7 @@ int ha_berkeley::key_cmp(uint keynr, const byte * old_row,
KEY_PART_INFO *key_part=table->key_info[keynr].key_part;
KEY_PART_INFO *end=key_part+table->key_info[keynr].key_parts;
- for ( ; key_part != end ; key_part++)
+ for (; key_part != end ; key_part++)
{
if (key_part->null_bit)
{
@@ -1584,7 +1584,7 @@ DBT *ha_berkeley::get_pos(DBT *to, byte *pos)
KEY_PART_INFO *key_part=table->key_info[primary_key].key_part;
KEY_PART_INFO *end=key_part+table->key_info[primary_key].key_parts;
- for ( ; key_part != end ; key_part++)
+ for (; key_part != end ; key_part++)
pos+=key_part->field->packed_col_length((char*) pos,key_part->length);
to->size= (uint) (pos- (byte*) to->data);
}
@@ -1701,7 +1701,7 @@ int ha_berkeley::external_lock(THD *thd, int lock_type)
DBUG_ASSERT(thd->transaction.stmt.bdb_tid == 0);
transaction=0; // Safety
/* First table lock, start transaction */
- if ((thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN |
+ if ((thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN |
OPTION_TABLE_LOCK)) &&
!thd->transaction.all.bdb_tid)
{
diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h
index f56ee5ef1a9..198664d0c06 100644
--- a/sql/ha_berkeley.h
+++ b/sql/ha_berkeley.h
@@ -88,8 +88,7 @@ class ha_berkeley: public handler
ha_berkeley(TABLE *table): handler(table), alloc_ptr(0),rec_buff(0), file(0),
int_table_flags(HA_REC_NOT_IN_SEQ |
HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER |
- HA_NULL_KEY | HA_HAVE_KEY_READ_ONLY |
- HA_BLOB_KEY | HA_NOT_EXACT_COUNT |
+ HA_NULL_KEY | HA_BLOB_KEY | HA_NOT_EXACT_COUNT |
HA_PRIMARY_KEY_IN_READ_INDEX | HA_DROP_BEFORE_CREATE |
HA_AUTO_PART_KEY | HA_TABLE_SCAN_ON_INDEX),
changed_rows(0),last_dup_key((uint) -1),version(0),using_ignore(0)
@@ -168,7 +167,6 @@ class ha_berkeley: public handler
};
extern bool berkeley_skip, berkeley_shared_data;
-extern SHOW_COMP_OPTION have_berkeley_db;
extern u_int32_t berkeley_init_flags,berkeley_env_flags, berkeley_lock_type,
berkeley_lock_types[];
extern ulong berkeley_cache_size, berkeley_max_lock, berkeley_log_buffer_size;
diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc
index f56bfe74265..271f00428a5 100644
--- a/sql/ha_heap.cc
+++ b/sql/ha_heap.cc
@@ -220,7 +220,8 @@ ha_rows ha_heap::records_in_range(int inx,
if (pos->algorithm == HA_KEY_ALG_BTREE)
{
return hp_rb_records_in_range(file, inx, start_key, start_key_len,
- start_search_flag, end_key, end_key_len, end_search_flag);
+ start_search_flag, end_key, end_key_len,
+ end_search_flag);
}
else
{
@@ -233,7 +234,9 @@ ha_rows ha_heap::records_in_range(int inx,
}
}
-int ha_heap::create(const char *name, TABLE *table, HA_CREATE_INFO *create_info)
+
+int ha_heap::create(const char *name, TABLE *table,
+ HA_CREATE_INFO *create_info)
{
uint key, parts, mem_per_row= 0;
ulong max_rows;
@@ -250,7 +253,8 @@ int ha_heap::create(const char *name, TABLE *table, HA_CREATE_INFO *create_info)
}
if (!(keydef= (HP_KEYDEF*) my_malloc(table->keys * sizeof(HP_KEYDEF) +
- parts * sizeof(HA_KEYSEG), MYF(MY_WME))))
+ parts * sizeof(HA_KEYSEG),
+ MYF(MY_WME))))
return my_errno;
seg= my_reinterpret_cast(HA_KEYSEG*) (keydef + table->keys);
for (key= 0; key < table->keys; key++)
@@ -264,17 +268,15 @@ int ha_heap::create(const char *name, TABLE *table, HA_CREATE_INFO *create_info)
keydef[key].keysegs= (uint) pos->key_parts;
keydef[key].flag= (pos->flags & (HA_NOSAME | HA_NULL_ARE_EQUAL));
keydef[key].seg= seg;
- keydef[key].algorithm= pos->algorithm == HA_KEY_ALG_UNDEF ?
- HA_KEY_ALG_HASH : pos->algorithm;
+ keydef[key].algorithm= ((pos->algorithm == HA_KEY_ALG_UNDEF) ?
+ HA_KEY_ALG_HASH : pos->algorithm);
for (; key_part != key_part_end; key_part++, seg++)
{
uint flag= key_part->key_type;
Field *field= key_part->field;
if (pos->algorithm == HA_KEY_ALG_BTREE)
- {
seg->type= field->key_type();
- }
else
{
if (!f_is_packed(flag) &&
@@ -310,7 +312,8 @@ int ha_heap::create(const char *name, TABLE *table, HA_CREATE_INFO *create_info)
}
}
mem_per_row+= MY_ALIGN(table->reclength + 1, sizeof(char*));
- max_rows= (ulong) (max_heap_table_size / mem_per_row);
+ max_rows = (ulong) (current_thd->variables.max_heap_table_size /
+ mem_per_row);
error= heap_create(fn_format(buff,name,"","",4+2),
table->keys,keydef, table->reclength,
((table->max_rows < max_rows && table->max_rows) ?
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 455d890758f..d42311b43b6 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & InnoDB Oy
+/* Copyright (C) 2000 MySQL AB & Innobase Oy
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
/* TODO list for the InnoDB handler:
- Ask Monty if strings of different languages can exist in the same
- database. Answer: in near future yes, but not yet.
+ database. Answer: in 4.1 yes.
*/
#ifdef __GNUC__
@@ -27,6 +27,7 @@
#endif
#include "mysql_priv.h"
+#include "slave.h"
#ifdef HAVE_INNOBASE_DB
#include <m_ctype.h>
#include <assert.h>
@@ -53,10 +54,13 @@ typedef byte mysql_byte;
/* Include necessary InnoDB headers */
extern "C" {
#include "../innobase/include/univ.i"
+#include "../innobase/include/os0file.h"
+#include "../innobase/include/os0thread.h"
#include "../innobase/include/srv0start.h"
#include "../innobase/include/srv0srv.h"
#include "../innobase/include/trx0roll.h"
#include "../innobase/include/trx0trx.h"
+#include "../innobase/include/trx0sys.h"
#include "../innobase/include/row0ins.h"
#include "../innobase/include/row0mysql.h"
#include "../innobase/include/row0sel.h"
@@ -107,8 +111,6 @@ my_bool innobase_fast_shutdown = TRUE;
specify any startup options.
*/
-/* innobase_data_file_path=ibdata:15,idata2:1,... */
-
char *innobase_data_file_path= (char*) "ibdata1:10M:autoextend";
static char *internal_innobase_data_file_path=0;
@@ -135,8 +137,9 @@ static void innobase_print_error(const char* db_errpfx, char* buffer);
/* General functions */
/**********************************************************************
-Releases possible search latch, auto inc lock, and InnoDB thread FIFO ticket.
-These should be released at each SQL statement end. */
+Releases possible search latch and InnoDB thread FIFO ticket. These should
+be released at each SQL statement end. It does no harm to release these
+also in the middle of an SQL statement. */
static
void
innobase_release_stat_resources(
@@ -147,16 +150,6 @@ innobase_release_stat_resources(
trx_search_latch_release_if_reserved(trx);
}
- if (trx->auto_inc_lock) {
-
- /* If we had reserved the auto-inc lock for
- some table in this SQL statement, we release it now */
-
- srv_conc_enter_innodb(trx);
- row_unlock_table_autoinc_for_mysql(trx);
- srv_conc_exit_innodb(trx);
- }
-
if (trx->declared_to_be_inside_innodb) {
/* Release our possible ticket in the FIFO */
@@ -188,7 +181,8 @@ int
convert_error_code_to_mysql(
/*========================*/
/* out: MySQL error code */
- int error) /* in: InnoDB error code */
+ int error, /* in: InnoDB error code */
+ THD* thd) /* in: user thread handle or NULL */
{
if (error == DB_SUCCESS) {
@@ -207,11 +201,27 @@ convert_error_code_to_mysql(
return(HA_ERR_NO_ACTIVE_RECORD);
} else if (error == (int) DB_DEADLOCK) {
+ /* Since we roll back the whole transaction, we must
+ tell it also to MySQL so that MySQL knows to empty the
+ cached binlog for this transaction */
+
+ if (thd) {
+ ha_rollback(thd);
+ }
return(HA_ERR_LOCK_DEADLOCK);
} else if (error == (int) DB_LOCK_WAIT_TIMEOUT) {
+ /* Since we roll back the whole transaction, we must
+ tell it also to MySQL so that MySQL knows to empty the
+ cached binlog for this transaction */
+
+
+ if (thd) {
+ ha_rollback(thd);
+ }
+
return(HA_ERR_LOCK_WAIT_TIMEOUT);
} else if (error == (int) DB_NO_REFERENCED_ROW) {
@@ -242,8 +252,6 @@ convert_error_code_to_mysql(
return(HA_ERR_TO_BIG_ROW);
} else {
- DBUG_ASSERT(0);
-
return(-1); // Unknown error
}
}
@@ -251,41 +259,66 @@ convert_error_code_to_mysql(
extern "C" {
/*****************************************************************
Prints info of a THD object (== user session thread) to the
-standard output. NOTE that mysql/innobase/trx/trx0trx.c must contain
+standard output. NOTE that /mysql/innobase/trx/trx0trx.c must contain
the prototype for this function! */
void
innobase_mysql_print_thd(
/*=====================*/
- void* input_thd)/* in: pointer to a MySQL THD object */
+ char* buf, /* in/out: buffer where to print, must be at least
+ 400 bytes */
+ void* input_thd)/* in: pointer to a MySQL THD object */
{
- THD* thd;
+ THD* thd;
+ char* old_buf = buf;
+
+ thd = (THD*) input_thd;
- thd = (THD*) input_thd;
+ /* We cannot use the return value of normal sprintf() as this is
+ not portable to some old non-Posix Unixes, e.g., some old SCO
+ Unixes */
- printf("MySQL thread id %lu, query id %lu",
- thd->thread_id, thd->query_id);
+ buf += my_sprintf(buf,
+ (buf, "MySQL thread id %lu, query id %lu",
+ thd->thread_id, thd->query_id));
if (thd->host) {
- printf(" %s", thd->host);
+ *buf = ' ';
+ buf++;
+ buf = strnmov(buf, thd->host, 30);
}
if (thd->ip) {
- printf(" %s", thd->ip);
+ *buf = ' ';
+ buf++;
+ buf=strnmov(buf, thd->ip, 20);
}
if (thd->user) {
- printf(" %s", thd->user);
+ *buf = ' ';
+ buf++;
+ buf=strnmov(buf, thd->user, 20);
}
if (thd->proc_info) {
- printf(" %s", thd->proc_info);
+ *buf = ' ';
+ buf++;
+ buf=strnmov(buf, thd->proc_info, 50);
}
if (thd->query) {
- printf("\n%-.100s", thd->query);
+ *buf = '\n';
+ buf++;
+ buf=strnmov(buf, thd->query, 150);
}
- printf("\n");
+ buf[0] = '\n';
+ buf[1] = '\0'; /* Note that we must put a null character here to end
+ the printed string */
+
+ /* We test the printed length did not overrun the buffer length of
+ 400 bytes */
+
+ ut_a(strlen(old_buf) < 400);
}
}
@@ -302,6 +335,8 @@ check_trx_exists(
{
trx_t* trx;
+ ut_a(thd == current_thd);
+
trx = (trx_t*) thd->transaction.all.innobase_tid;
if (trx == NULL) {
@@ -321,7 +356,23 @@ check_trx_exists(
thd->transaction.stmt.innobase_tid =
(void*)&innodb_dummy_stmt_trx_handle;
} else {
- ut_a(trx->magic_n == TRX_MAGIC_N);
+ if (trx->magic_n != TRX_MAGIC_N) {
+ mem_analyze_corruption((byte*)trx);
+
+ ut_a(0);
+ }
+ }
+
+ if (thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) {
+ trx->check_foreigns = FALSE;
+ } else {
+ trx->check_foreigns = TRUE;
+ }
+
+ if (thd->options & OPTION_RELAXED_UNIQUE_CHECKS) {
+ trx->check_unique_secondary = FALSE;
+ } else {
+ trx->check_unique_secondary = TRUE;
}
return(trx);
@@ -340,7 +391,7 @@ ha_innobase::update_thd(
{
row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt;
trx_t* trx;
-
+
trx = check_trx_exists(thd);
if (prebuilt->trx != trx) {
@@ -353,6 +404,61 @@ ha_innobase::update_thd(
return(0);
}
+/* The code here appears for documentational purposes only. Not used
+or tested yet. Will be used in 4.1. */
+/*********************************************************************
+Call this when you have opened a new table handle in HANDLER, before you
+call index_read_idx() etc. Actually, we can let the cursor stay open even
+over a transaction commit! Then you should call this before every operation,
+fecth next etc. This function inits the necessary things even after a
+transaction commit. */
+
+void
+ha_innobase::init_table_handle_for_HANDLER(void)
+/*============================================*/
+{
+ row_prebuilt_t* prebuilt;
+
+ /* If current thd does not yet have a trx struct, create one.
+ If the current handle does not yet have a prebuilt struct, create
+ one. Update the trx pointers in the prebuilt struct. Normally
+ this operation is done in external_lock. */
+
+ update_thd(current_thd);
+
+ /* Initialize the prebuilt struct much like it would be inited in
+ external_lock */
+
+ prebuilt = (row_prebuilt_t*)innobase_prebuilt;
+
+ /* If the transaction is not started yet, start it */
+
+ trx_start_if_not_started_noninline(prebuilt->trx);
+
+ /* Assign a read view if the transaction does not have it yet */
+
+ trx_assign_read_view(prebuilt->trx);
+
+ /* We did the necessary inits in this function, no need to repeat them
+ in row_search_for_mysql */
+
+ prebuilt->sql_stat_start = FALSE;
+
+ /* We let HANDLER always to do the reads as consistent reads, even
+ if the trx isolation level would have been specified as SERIALIZABLE */
+
+ prebuilt->select_lock_type = LOCK_NONE;
+
+ /* Always fetch all columns in the index record */
+
+ prebuilt->hint_no_need_to_fetch_extra_cols = FALSE;
+
+ /* We want always to fetch all columns in the whole row? Or do
+ we???? */
+
+ prebuilt->read_just_key = FALSE;
+}
+
/*************************************************************************
Opens an InnoDB database. */
@@ -361,12 +467,15 @@ innobase_init(void)
/*===============*/
/* out: TRUE if error */
{
+ static char current_dir[3]; // Set if using current lib
int err;
bool ret;
- char current_lib[3], *default_path;
+ char *default_path;
DBUG_ENTER("innobase_init");
+ os_innodb_umask = (ulint)my_umask;
+
/*
When using the embedded server, the datadirectory is not
in the current directory.
@@ -376,10 +485,10 @@ innobase_init(void)
else
{
/* It's better to use current lib, to keep path's short */
- current_lib[0] = FN_CURLIB;
- current_lib[1] = FN_LIBCHAR;
- current_lib[2] = 0;
- default_path=current_lib;
+ current_dir[0] = FN_CURLIB;
+ current_dir[1] = FN_LIBCHAR;
+ current_dir[2] = 0;
+ default_path=current_dir;
}
if (specialflag & SPECIAL_NO_PRIOR) {
@@ -440,11 +549,12 @@ innobase_init(void)
srv_log_archive_on = (ulint) innobase_log_archive;
srv_log_buffer_size = (ulint) innobase_log_buffer_size;
- srv_flush_log_at_trx_commit = (ibool) innobase_flush_log_at_trx_commit;
+ srv_flush_log_at_trx_commit = (ulint) innobase_flush_log_at_trx_commit;
srv_use_native_aio = 0;
srv_pool_size = (ulint) innobase_buffer_pool_size;
+
srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size;
srv_n_file_io_threads = (ulint) innobase_file_io_threads;
@@ -475,6 +585,22 @@ innobase_init(void)
(void) hash_init(&innobase_open_tables,system_charset_info,32,0,0,
(hash_get_key) innobase_get_key,0,0);
pthread_mutex_init(&innobase_mutex,MY_MUTEX_INIT_FAST);
+
+ /* If this is a replication slave and we needed to do a crash recovery,
+ set the master binlog position to what InnoDB internally knew about
+ how far we got transactions durable inside InnoDB. There is a
+ problem here: if the user used also MyISAM tables, InnoDB might not
+ know the right position for them.
+
+ THIS DOES NOT WORK CURRENTLY because replication seems to initialize
+ glob_mi also after innobase_init. */
+
+/* if (trx_sys_mysql_master_log_pos != -1) {
+ ut_memcpy(glob_mi.log_file_name, trx_sys_mysql_master_log_name,
+ 1 + ut_strlen(trx_sys_mysql_master_log_name));
+ glob_mi.pos = trx_sys_mysql_master_log_pos;
+ }
+*/
DBUG_RETURN(0);
}
@@ -534,6 +660,30 @@ innobase_get_free_space(void)
/*********************************************************************
Commits a transaction in an InnoDB database. */
+void
+innobase_commit_low(
+/*================*/
+ trx_t* trx) /* in: transaction handle */
+{
+ if (current_thd->slave_thread)
+ {
+ /* Update the replication position info inside InnoDB */
+#ifdef NEED_TO_BE_FIXED
+ trx->mysql_relay_log_file_name= active_mi->rli.log_file_name;
+ trx->mysql_relay_log_pos= active_mi->rli.relay_log_pos;
+#endif
+ trx->mysql_master_log_file_name= active_mi->rli.master_log_name;
+ trx->mysql_master_log_pos= ((ib_longlong)
+ (active_mi->rli.master_log_pos +
+ active_mi->rli.event_len +
+ active_mi->rli.pending));
+ }
+ trx_commit_for_mysql(trx);
+}
+
+/*********************************************************************
+Commits a transaction in an InnoDB database. */
+
int
innobase_commit(
/*============*/
@@ -552,9 +702,18 @@ innobase_commit(
trx = check_trx_exists(thd);
- if (trx_handle != (void*)&innodb_dummy_stmt_trx_handle) {
+ if (trx->auto_inc_lock) {
+
+ /* If we had reserved the auto-inc lock for
+ some table in this SQL statement, we release it now */
+
+ srv_conc_enter_innodb(trx);
+ row_unlock_table_autoinc_for_mysql(trx);
+ srv_conc_exit_innodb(trx);
+ }
- trx_commit_for_mysql(trx);
+ if (trx_handle != (void*)&innodb_dummy_stmt_trx_handle) {
+ innobase_commit_low(trx);
}
/* Release possible statement level resources */
@@ -594,6 +753,8 @@ innobase_report_binlog_offset_and_commit(
trx = (trx_t*)trx_handle;
+ ut_a(trx != NULL);
+
trx->mysql_log_file_name = log_file_name;
trx->mysql_log_offset = (ib_longlong)end_offset;
@@ -619,6 +780,16 @@ innobase_rollback(
trx = check_trx_exists(thd);
+ if (trx->auto_inc_lock) {
+
+ /* If we had reserved the auto-inc lock for
+ some table in this SQL statement, we release it now */
+
+ srv_conc_enter_innodb(trx);
+ row_unlock_table_autoinc_for_mysql(trx);
+ srv_conc_exit_innodb(trx);
+ }
+
srv_conc_enter_innodb(trx);
if (trx_handle != (void*)&innodb_dummy_stmt_trx_handle) {
@@ -634,7 +805,7 @@ innobase_rollback(
trx_mark_sql_stat_end(trx);
- DBUG_RETURN(convert_error_code_to_mysql(error));
+ DBUG_RETURN(convert_error_code_to_mysql(error, NULL));
}
/*********************************************************************
@@ -747,7 +918,7 @@ normalize_table_name(
}
/*********************************************************************
-Creates and opens a handle to a table which already exists in an Innobase
+Creates and opens a handle to a table which already exists in an InnoDB
database. */
int
@@ -796,7 +967,6 @@ ha_innobase::open(
ib_table = dict_table_get_and_increment_handle_count(
norm_name, NULL);
-
if (NULL == ib_table) {
sql_print_error("InnoDB error:\n\
@@ -819,13 +989,13 @@ have moved .frm files to another database?",
primary_key = MAX_KEY;
- if (!row_table_got_default_clust_index(ib_table)) {
+ /* Allocate a buffer for a 'row reference'. A row reference is
+ a string of bytes of length ref_length which uniquely specifies
+ a row in our table. Note that MySQL may also compare two row
+ references for equality by doing a simple memcmp on the strings
+ of length ref_length! */
- /* If we automatically created the clustered index,
- then MySQL does not know about it and it must not be aware
- of the index used on scan, to avoid checking if we update
- the column of the index. The column is the row id in
- the automatical case, and it will not be updated. */
+ if (!row_table_got_default_clust_index(ib_table)) {
((row_prebuilt_t*)innobase_prebuilt)
->clust_index_was_generated = FALSE;
@@ -834,13 +1004,13 @@ have moved .frm files to another database?",
key_used_on_scan = 0;
/*
- MySQL allocates the buffer for ref.
- This includes all keys + one byte for each column
- that may be NULL.
- The ref_length must be exact as possible as
- all reference buffers are allocated based on this.
+ MySQL allocates the buffer for ref. key_info->key_length
+ includes space for all key columns + one byte for each column
+ that may be NULL. ref_length must be as exact as possible to
+ save space, because all row reference buffers are allocated
+ based on ref_length.
*/
-
+
ref_length = table->key_info->key_length;
} else {
((row_prebuilt_t*)innobase_prebuilt)
@@ -848,11 +1018,23 @@ have moved .frm files to another database?",
ref_length = DATA_ROW_ID_LEN;
+ /*
+ If we automatically created the clustered index, then
+ MySQL does not know about it, and MySQL must NOT be aware
+ of the index used on scan, to make it avoid checking if we
+ update the column of the index. That is why we assert below
+ that key_used_on_scan is the undefined value MAX_KEY.
+ The column is the row id in the automatical generation case,
+ and it will never be updated anyway.
+ */
DBUG_ASSERT(key_used_on_scan == MAX_KEY);
}
auto_inc_counter_for_this_stat = 0;
+ block_size = 16 * 1024; /* Index block size in InnoDB: used by MySQL
+ in query optimization */
+
/* Init table lock structure */
thr_lock_data_init(&share->lock,&lock,(void*) 0);
@@ -1094,7 +1276,8 @@ get_innobase_type_from_mysql_type(
}
/***********************************************************************
-Stores a key value for a row to a buffer. */
+Stores a key value for a row to a buffer. This must currently only be used
+to store a row reference to the 'ref' buffer of this table handle! */
uint
ha_innobase::store_key_val_for_row(
@@ -1102,7 +1285,8 @@ ha_innobase::store_key_val_for_row(
/* out: key value length as stored in buff */
uint keynr, /* in: key number */
char* buff, /* in/out: buffer for the key value (in MySQL
- format) */
+ format); currently this MUST be the 'ref'
+ buffer! */
const mysql_byte* record)/* in: row in MySQL format */
{
KEY* key_info = table->key_info + keynr;
@@ -1131,11 +1315,12 @@ ha_innobase::store_key_val_for_row(
}
/*
- We have to zero-fill the buffer to be able to compare two
- keys to see if they are equal
+ We have to zero-fill the 'ref' buffer so that MySQL is able to
+ use a simple memcmp to compare two key values to determine if they
+ are equal
*/
bzero(buff, (ref_length- (uint) (buff - buff_start)));
- return ref_length;
+ DBUG_RETURN(ref_length);
}
/******************************************************************
@@ -1310,9 +1495,13 @@ ha_innobase::write_row(
row_prebuilt_t* prebuilt = (row_prebuilt_t*)innobase_prebuilt;
int error;
longlong auto_inc;
+ longlong dummy;
DBUG_ENTER("ha_innobase::write_row");
+ ut_a(prebuilt->trx ==
+ (trx_t*) current_thd->transaction.all.innobase_tid);
+
statistic_increment(ha_write_count, &LOCK_status);
if (table->time_stamp) {
@@ -1329,7 +1518,31 @@ ha_innobase::write_row(
if (table->next_number_field && record == table->record[0]) {
/* This is the case where the table has an
auto-increment column */
-
+
+ /* Initialize the auto-inc counter if it has not been
+ initialized yet */
+
+ if (0 == dict_table_autoinc_peek(prebuilt->table)) {
+
+ /* This call initializes the counter */
+ error = innobase_read_and_init_auto_inc(&dummy);
+
+ if (error) {
+ /* Deadlock or lock wait timeout */
+
+ goto func_exit;
+ }
+
+ /* We have to set sql_stat_start to TRUE because
+ the above call probably has called a select, and
+ has reset that flag; row_insert_for_mysql has to
+ know to set the IX intention lock on the table,
+ something it only does at the start of each
+ statement */
+
+ prebuilt->sql_stat_start = TRUE;
+ }
+
/* Fetch the value the user possibly has set in the
autoincrement field */
@@ -1362,10 +1575,9 @@ ha_innobase::write_row(
}
if (auto_inc != 0) {
- /* This call will calculate the max of the
- current value and the value supplied by the user, if
- the auto_inc counter is already initialized
- for the table */
+ /* This call will calculate the max of the current
+ value and the value supplied by the user and
+ update the counter accordingly */
/* We have to use the transactional lock mechanism
on the auto-inc counter of the table to ensure
@@ -1380,7 +1592,8 @@ ha_innobase::write_row(
if (error != DB_SUCCESS) {
- error = convert_error_code_to_mysql(error);
+ error = convert_error_code_to_mysql(error,
+ user_thd);
goto func_exit;
}
@@ -1396,7 +1609,7 @@ ha_innobase::write_row(
srv_conc_exit_innodb(prebuilt->trx);
error = convert_error_code_to_mysql(
- error);
+ error, user_thd);
goto func_exit;
}
}
@@ -1404,45 +1617,18 @@ ha_innobase::write_row(
auto_inc = dict_table_autoinc_get(prebuilt->table);
srv_conc_exit_innodb(prebuilt->trx);
- /* If auto_inc is now != 0 the autoinc counter
- was already initialized for the table: we can give
- the new value for MySQL to place in the field */
+ /* We can give the new value for MySQL to place in
+ the field */
- if (auto_inc != 0) {
- user_thd->next_insert_id = auto_inc;
- }
- }
-
- update_auto_increment();
-
- if (auto_inc == 0) {
- /* The autoinc counter for our table was not yet
- initialized, initialize it now */
-
- auto_inc = table->next_number_field->val_int();
-
- srv_conc_enter_innodb(prebuilt->trx);
- error = row_lock_table_autoinc_for_mysql(prebuilt);
- srv_conc_exit_innodb(prebuilt->trx);
-
- if (error != DB_SUCCESS) {
-
- error = convert_error_code_to_mysql(error);
- goto func_exit;
- }
-
- dict_table_autoinc_initialize(prebuilt->table,
- auto_inc);
+ user_thd->next_insert_id = auto_inc;
}
- /* We have to set sql_stat_start to TRUE because
- update_auto_increment may have called a select, and
- has reset that flag; row_insert_for_mysql has to
- know to set the IX intention lock on the table, something
- it only does at the start of each statement */
+ /* This call of a handler.cc function places
+ user_thd->next_insert_id to the column value, if the column
+ value was not set by the user */
- prebuilt->sql_stat_start = TRUE;
- }
+ update_auto_increment();
+ }
if (prebuilt->mysql_template == NULL
|| prebuilt->template_type != ROW_MYSQL_WHOLE_ROW) {
@@ -1467,7 +1653,7 @@ ha_innobase::write_row(
prebuilt->trx->ignore_duplicates_in_insert = FALSE;
- error = convert_error_code_to_mysql(error);
+ error = convert_error_code_to_mysql(error, user_thd);
/* Tell InnoDB server that there might be work for
utility threads: */
@@ -1651,6 +1837,9 @@ ha_innobase::update_row(
DBUG_ENTER("ha_innobase::update_row");
+ ut_a(prebuilt->trx ==
+ (trx_t*) current_thd->transaction.all.innobase_tid);
+
if (table->time_stamp) {
update_timestamp(new_row + table->time_stamp - 1);
}
@@ -1684,7 +1873,7 @@ ha_innobase::update_row(
srv_conc_exit_innodb(prebuilt->trx);
- error = convert_error_code_to_mysql(error);
+ error = convert_error_code_to_mysql(error, user_thd);
/* Tell InnoDB server that there might be work for
utility threads: */
@@ -1708,6 +1897,9 @@ ha_innobase::delete_row(
DBUG_ENTER("ha_innobase::delete_row");
+ ut_a(prebuilt->trx ==
+ (trx_t*) current_thd->transaction.all.innobase_tid);
+
if (last_query_id != user_thd->query_id) {
prebuilt->sql_stat_start = TRUE;
last_query_id = user_thd->query_id;
@@ -1729,7 +1921,7 @@ ha_innobase::delete_row(
srv_conc_exit_innodb(prebuilt->trx);
- error = convert_error_code_to_mysql(error);
+ error = convert_error_code_to_mysql(error, user_thd);
/* Tell the InnoDB server that there might be work for
utility threads: */
@@ -1796,6 +1988,55 @@ convert_search_mode_to_innobase(
return(0);
}
+/*
+ BACKGROUND INFO: HOW A SELECT SQL QUERY IS EXECUTED
+ ---------------------------------------------------
+The following does not cover all the details, but explains how we determine
+the start of a new SQL statement, and what is associated with it.
+
+For each table in the database the MySQL interpreter may have several
+table handle instances in use, also in a single SQL query. For each table
+handle instance there is an InnoDB 'prebuilt' struct which contains most
+of the InnoDB data associated with this table handle instance.
+
+ A) if the user has not explicitly set any MySQL table level locks:
+
+ 1) MySQL calls ::external_lock to set an 'intention' table level lock on
+the table of the handle instance. There we set
+prebuilt->sql_stat_start = TRUE. The flag sql_stat_start should be set
+true if we are taking this table handle instance to use in a new SQL
+statement issued by the user. We also increment trx->n_mysql_tables_in_use.
+
+ 2) If prebuilt->sql_stat_start == TRUE we 'pre-compile' the MySQL search
+instructions to prebuilt->template of the table handle instance in
+::index_read. The template is used to save CPU time in large joins.
+
+ 3) In row_search_for_mysql, if prebuilt->sql_stat_start is true, we
+allocate a new consistent read view for the trx if it does not yet have one,
+or in the case of a locking read, set an InnoDB 'intention' table level
+lock on the table.
+
+ 4) We do the SELECT. MySQL may repeatedly call ::index_read for the
+same table handle instance, if it is a join.
+
+ 5) When the SELECT ends, MySQL removes its intention table level locks
+in ::external_lock. When trx->n_mysql_tables_in_use drops to zero,
+ (a) we execute a COMMIT there if the autocommit is on,
+ (b) we also release possible 'SQL statement level resources' InnoDB may
+have for this SQL statement. The MySQL interpreter does NOT execute
+autocommit for pure read transactions, though it should. That is why the
+table handler in that case has to execute the COMMIT in ::external_lock.
+
+ B) If the user has explicitly set MySQL table level locks, then MySQL
+does NOT call ::external_lock at the start of the statement. To determine
+when we are at the start of a new SQL statement we at the start of
+::index_read also compare the query id to the latest query id where the
+table handle instance was used. If it has changed, we know we are at the
+start of a new SQL statement. Since the query id can theoretically
+overwrap, we use this test only as a secondary way of determining the
+start of a new SQL statement. */
+
+
/**************************************************************************
Positions an index cursor to the index specified in the handle. Fetches the
row if any. */
@@ -1809,7 +2050,10 @@ ha_innobase::index_read(
row */
const mysql_byte* key_ptr,/* in: key value; if this is NULL
we position the cursor at the
- start or end of index */
+ start or end of index; this can
+ also contain an InnoDB row id, in
+ which case key_len is the InnoDB
+ row id length */
uint key_len,/* in: key value length */
enum ha_rkey_function find_flag)/* in: search flags from my_base.h */
{
@@ -1821,6 +2065,10 @@ ha_innobase::index_read(
ulint ret;
DBUG_ENTER("index_read");
+
+ ut_a(prebuilt->trx ==
+ (trx_t*) current_thd->transaction.all.innobase_tid);
+
statistic_increment(ha_read_key_count, &LOCK_status);
if (last_query_id != user_thd->query_id) {
@@ -1832,10 +2080,8 @@ ha_innobase::index_read(
index = prebuilt->index;
- /* Note that if the select is used for an update, we always
- fetch the clustered index record: therefore the index for which the
- template is built is not necessarily prebuilt->index, but can also
- be the clustered index */
+ /* Note that if the index for which the search template is built is not
+ necessarily prebuilt->index, but can also be the clustered index */
if (prebuilt->sql_stat_start) {
build_template(prebuilt, user_thd, table,
@@ -1843,6 +2089,9 @@ ha_innobase::index_read(
}
if (key_ptr) {
+ /* Convert the search key value to InnoDB format into
+ prebuilt->search_tuple */
+
row_sel_convert_mysql_key_to_innobase(prebuilt->search_tuple,
(byte*) key_val_buff,
index,
@@ -1887,7 +2136,7 @@ ha_innobase::index_read(
error = HA_ERR_KEY_NOT_FOUND;
table->status = STATUS_NOT_FOUND;
} else {
- error = convert_error_code_to_mysql(ret);
+ error = convert_error_code_to_mysql(ret, user_thd);
table->status = STATUS_NOT_FOUND;
}
@@ -1925,7 +2174,6 @@ ha_innobase::change_active_index(
{
row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt;
KEY* key=0;
-
statistic_increment(ha_read_key_count, &LOCK_status);
DBUG_ENTER("change_active_index");
@@ -2010,6 +2258,9 @@ ha_innobase::general_fetch(
DBUG_ENTER("general_fetch");
+ ut_a(prebuilt->trx ==
+ (trx_t*) current_thd->transaction.all.innobase_tid);
+
srv_conc_enter_innodb(prebuilt->trx);
ret = row_search_for_mysql((byte*)buf, 0, prebuilt, match_mode,
@@ -2028,7 +2279,7 @@ ha_innobase::general_fetch(
error = HA_ERR_END_OF_FILE;
table->status = STATUS_NOT_FOUND;
} else {
- error = convert_error_code_to_mysql(ret);
+ error = convert_error_code_to_mysql(ret, user_thd);
table->status = STATUS_NOT_FOUND;
}
@@ -2202,8 +2453,7 @@ ha_innobase::rnd_next(
}
/**************************************************************************
-Fetches a row from the table based on a reference. TODO: currently we use
-'ref_stored_len' of the handle as the key length. This may change. */
+Fetches a row from the table based on a row reference. */
int
ha_innobase::rnd_pos(
@@ -2211,21 +2461,28 @@ ha_innobase::rnd_pos(
/* out: 0, HA_ERR_KEY_NOT_FOUND,
or error code */
mysql_byte* buf, /* in/out: buffer for the row */
- mysql_byte* pos) /* in: primary key value in MySQL format */
+ mysql_byte* pos) /* in: primary key value of the row in the
+ MySQL format, or the row id if the clustered
+ index was internally generated by InnoDB;
+ the length of data in pos has to be
+ ref_length */
{
row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt;
int error;
uint keynr = active_index;
DBUG_ENTER("rnd_pos");
- DBUG_DUMP("key", (char*) pos, ref_stored_len);
+ DBUG_DUMP("key", (char*) pos, ref_length);
statistic_increment(ha_read_rnd_count, &LOCK_status);
+ ut_a(prebuilt->trx ==
+ (trx_t*) current_thd->transaction.all.innobase_tid);
+
if (prebuilt->clust_index_was_generated) {
/* No primary key was defined for the table and we
generated the clustered index from the row id: the
row reference is the row id, not any key value
- that MySQL knows */
+ that MySQL knows of */
error = change_active_index(MAX_KEY);
} else {
@@ -2237,7 +2494,10 @@ ha_innobase::rnd_pos(
DBUG_RETURN(error);
}
- error = index_read(buf, pos, ref_stored_len, HA_READ_KEY_EXACT);
+ /* Note that we assume the length of the row reference is fixed
+ for the table, and it is == ref_length */
+
+ error = index_read(buf, pos, ref_length, HA_READ_KEY_EXACT);
if (error)
{
DBUG_PRINT("error",("Got error: %ld",error));
@@ -2249,7 +2509,8 @@ ha_innobase::rnd_pos(
/*************************************************************************
Stores a reference to the current row to 'ref' field of the handle. Note
-that the function parameter is illogical: we must assume that 'record'
+that in the case where we have generated the clustered index for the
+table, the function parameter is illogical: we MUST ASSUME that 'record'
is the current 'position' of the handle, because if row ref is actually
the row id internally generated in InnoDB, then 'record' does not contain
it. We just guess that the row id must be for the record where the handle
@@ -2263,11 +2524,14 @@ ha_innobase::position(
row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt;
uint len;
+ ut_a(prebuilt->trx ==
+ (trx_t*) current_thd->transaction.all.innobase_tid);
+
if (prebuilt->clust_index_was_generated) {
/* No primary key was defined for the table and we
generated the clustered index from row id: the
row reference will be the row id, not any key value
- that MySQL knows */
+ that MySQL knows of */
len = DATA_ROW_ID_LEN;
@@ -2276,8 +2540,11 @@ ha_innobase::position(
len = store_key_val_for_row(primary_key, (char*) ref, record);
}
- DBUG_ASSERT(len == ref_length);
- ref_stored_len = len;
+ /* Since we do not store len to the buffer 'ref', we must assume
+ that len is always fixed for this table. The following assertion
+ checks this. */
+
+ ut_a(len == ref_length);
}
@@ -2335,7 +2602,7 @@ create_table_def(
error = row_create_table_for_mysql(table, trx);
- error = convert_error_code_to_mysql(error);
+ error = convert_error_code_to_mysql(error, NULL);
DBUG_RETURN(error);
}
@@ -2393,7 +2660,7 @@ create_index(
error = row_create_index_for_mysql(index, trx);
- error = convert_error_code_to_mysql(error);
+ error = convert_error_code_to_mysql(error, NULL);
DBUG_RETURN(error);
}
@@ -2419,7 +2686,7 @@ create_clustered_index_when_no_primary(
0, DICT_CLUSTERED, 0);
error = row_create_index_for_mysql(index, trx);
- error = convert_error_code_to_mysql(error);
+ error = convert_error_code_to_mysql(error, NULL);
return(error);
}
@@ -2445,22 +2712,41 @@ ha_innobase::create(
uint i;
char name2[FN_REFLEN];
char norm_name[FN_REFLEN];
+ THD *thd= current_thd;
DBUG_ENTER("ha_innobase::create");
+ DBUG_ASSERT(thd != NULL);
+
trx = trx_allocate_for_mysql();
+ if (thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) {
+ trx->check_foreigns = FALSE;
+ }
+
+ if (thd->options & OPTION_RELAXED_UNIQUE_CHECKS) {
+ trx->check_unique_secondary = FALSE;
+ }
+
+
fn_format(name2, name, "", "",2); // Remove the .frm extension
normalize_table_name(norm_name, name2);
- /* Create the table definition in InnoDB */
+ /* Latch the InnoDB data dictionary exclusive so that no deadlocks
+ or lock waits can happen in it during a table create operation.
+ (Drop table etc. do this latching in row0mysql.c.) */
+
+ row_mysql_lock_data_dictionary();
+
+ /* Create the table definition in InnoDB */
error = create_table_def(trx, form, norm_name);
if (error) {
+ innobase_commit_low(trx);
- trx_commit_for_mysql(trx);
+ row_mysql_unlock_data_dictionary();
trx_free_for_mysql(trx);
@@ -2476,7 +2762,7 @@ ha_innobase::create(
/* Our function row_get_mysql_key_number_for_index assumes
the primary key is always number 0, if it exists */
- assert(primary_key_no == -1 || primary_key_no == 0);
+ DBUG_ASSERT(primary_key_no == -1 || primary_key_no == 0);
/* Create the keys */
@@ -2488,7 +2774,9 @@ ha_innobase::create(
error = create_clustered_index_when_no_primary(trx,
norm_name);
if (error) {
- trx_commit_for_mysql(trx);
+ innobase_commit_low(trx);
+
+ row_mysql_unlock_data_dictionary();
trx_free_for_mysql(trx);
@@ -2501,7 +2789,9 @@ ha_innobase::create(
first */
if ((error = create_index(trx, form, norm_name,
(uint) primary_key_no))) {
- trx_commit_for_mysql(trx);
+ innobase_commit_low(trx);
+
+ row_mysql_unlock_data_dictionary();
trx_free_for_mysql(trx);
@@ -2515,7 +2805,9 @@ ha_innobase::create(
if ((error = create_index(trx, form, norm_name, i))) {
- trx_commit_for_mysql(trx);
+ innobase_commit_low(trx);
+
+ row_mysql_unlock_data_dictionary();
trx_free_for_mysql(trx);
@@ -2527,17 +2819,21 @@ ha_innobase::create(
error = row_table_add_foreign_constraints(trx,
create_info->create_statement, norm_name);
- error = convert_error_code_to_mysql(error);
+ error = convert_error_code_to_mysql(error, NULL);
if (error) {
- trx_commit_for_mysql(trx);
+ innobase_commit_low(trx);
+
+ row_mysql_unlock_data_dictionary();
trx_free_for_mysql(trx);
DBUG_RETURN(error);
}
- trx_commit_for_mysql(trx);
+ innobase_commit_low(trx);
+
+ row_mysql_unlock_data_dictionary();
/* Flush the log to reduce probability that the .frm files and
the InnoDB data dictionary get out-of-sync if the user runs
@@ -2547,7 +2843,7 @@ ha_innobase::create(
innobase_table = dict_table_get(norm_name, NULL);
- assert(innobase_table != 0);
+ DBUG_ASSERT(innobase_table != 0);
/* Tell the InnoDB server that there might be work for
utility threads: */
@@ -2605,11 +2901,11 @@ ha_innobase::delete_table(
srv_active_wake_master_thread();
- trx_commit_for_mysql(trx);
+ innobase_commit_low(trx);
trx_free_for_mysql(trx);
- error = convert_error_code_to_mysql(error);
+ error = convert_error_code_to_mysql(error, NULL);
DBUG_RETURN(error);
}
@@ -2662,10 +2958,10 @@ innobase_drop_database(
srv_active_wake_master_thread();
- trx_commit_for_mysql(trx);
+ innobase_commit_low(trx);
trx_free_for_mysql(trx);
- error = convert_error_code_to_mysql(error);
+ error = convert_error_code_to_mysql(error, NULL);
return(error);
}
@@ -2715,10 +3011,10 @@ ha_innobase::rename_table(
srv_active_wake_master_thread();
- trx_commit_for_mysql(trx);
+ innobase_commit_low(trx);
trx_free_for_mysql(trx);
- error = convert_error_code_to_mysql(error);
+ error = convert_error_code_to_mysql(error, NULL);
DBUG_RETURN(error);
}
@@ -2981,6 +3277,8 @@ ha_innobase::check(
ulint ret;
ut_a(prebuilt->trx && prebuilt->trx->magic_n == TRX_MAGIC_N);
+ ut_a(prebuilt->trx ==
+ (trx_t*) current_thd->transaction.all.innobase_tid);
if (prebuilt->mysql_template == NULL) {
/* Build the template; we will use a dummy template
@@ -3030,8 +3328,9 @@ ha_innobase::update_table_comment(
*pos++=' ';
}
- pos += sprintf(pos, "InnoDB free: %lu kB",
- (ulong) innobase_get_free_space());
+ pos += my_sprintf(pos,
+ (pos,"InnoDB free: %lu kB",
+ (ulong) innobase_get_free_space()));
/* We assume 450 - length bytes of space to print info */
@@ -3177,7 +3476,7 @@ ha_innobase::external_lock(
thd->transaction.all.innodb_active_trans = 1;
trx->n_mysql_tables_in_use++;
- if (thd->tx_isolation == ISO_SERIALIZABLE
+ if (thd->variables.tx_isolation == ISO_SERIALIZABLE
&& prebuilt->select_lock_type == LOCK_NONE) {
/* To get serializable execution we let InnoDB
@@ -3205,7 +3504,7 @@ ha_innobase::external_lock(
innobase_release_stat_resources(trx);
if (!(thd->options
- & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN))) {
+ & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) {
innobase_commit(thd, trx);
thd->transaction.all.innodb_active_trans=0;
@@ -3217,6 +3516,53 @@ ha_innobase::external_lock(
}
/****************************************************************************
+Implements the SHOW INNODB STATUS command. Send the output of the InnoDB
+Monitor to the client. */
+
+int
+innodb_show_status(
+/*===============*/
+ THD* thd) /* in: the MySQL query thread of the caller */
+{
+ String* packet = &thd->packet;
+ char* buf;
+
+ DBUG_ENTER("innodb_show_status");
+
+ /* We let the InnoDB Monitor to output at most 100 kB of text, add
+ a safety margin of 10 kB for buffer overruns */
+
+ buf = (char*)ut_malloc(110 * 1024);
+
+ srv_sprintf_innodb_monitor(buf, 100 * 1024);
+
+ List<Item> field_list;
+
+ field_list.push_back(new Item_empty_string("Status", strlen(buf)));
+
+ if(send_fields(thd, field_list, 1)) {
+ DBUG_RETURN(-1);
+ }
+
+ packet->length(0);
+
+ net_store_data(packet, buf);
+
+ if (my_net_write(&thd->net, (char*)thd->packet.ptr(),
+ packet->length())) {
+ ut_free(buf);
+
+ DBUG_RETURN(-1);
+ }
+
+ ut_free(buf);
+
+ send_eof(&thd->net);
+
+ DBUG_RETURN(0);
+}
+
+/****************************************************************************
Handling the shared INNOBASE_SHARE structure that is needed to provide table
locking.
****************************************************************************/
@@ -3325,34 +3671,53 @@ ha_innobase::store_lock(
}
/***********************************************************************
-Returns the next auto-increment column value for the table. write_row
-normally fetches the value from the cache in the data dictionary. This
-function in used by SHOW TABLE STATUS and when the first insert to the table
-is done after database startup. */
+This function initializes the auto-inc counter if it has not been
+initialized yet. This function does not change the value of the auto-inc
+counter if it already has been initialized. In parameter ret returns
+the value of the auto-inc counter. */
-longlong
-ha_innobase::get_auto_increment()
-/*=============================*/
- /* out: the next auto-increment column value */
+int
+ha_innobase::innobase_read_and_init_auto_inc(
+/*=========================================*/
+ /* out: 0 or error code: deadlock or
+ lock wait timeout */
+ longlong* ret) /* out: auto-inc value */
{
row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt;
- longlong nr;
+ longlong auto_inc;
int error;
- /* Also SHOW TABLE STATUS calls this function. Previously, when we did
- always read the max autoinc key value, setting x-locks, users were
- surprised that SHOW TABLE STATUS could end up in a deadlock with
- ordinary SQL queries. We avoid these deadlocks if the auto-inc
- counter for the table has been initialized by fetching the value
- from the table struct in dictionary cache. */
+ ut_a(prebuilt);
+ ut_a(prebuilt->trx ==
+ (trx_t*) current_thd->transaction.all.innobase_tid);
+ ut_a(prebuilt->table);
+
+ auto_inc = dict_table_autoinc_read(prebuilt->table);
- assert(prebuilt->table);
-
- nr = dict_table_autoinc_read(prebuilt->table);
+ if (auto_inc != 0) {
+ /* Already initialized */
+ *ret = auto_inc;
+
+ return(0);
+ }
+
+ srv_conc_enter_innodb(prebuilt->trx);
+ error = row_lock_table_autoinc_for_mysql(prebuilt);
+ srv_conc_exit_innodb(prebuilt->trx);
+
+ if (error != DB_SUCCESS) {
+ error = convert_error_code_to_mysql(error, user_thd);
- if (nr != 0) {
+ goto func_exit;
+ }
- return(nr + 1);
+ /* Check again if someone has initialized the counter meanwhile */
+ auto_inc = dict_table_autoinc_read(prebuilt->table);
+
+ if (auto_inc != 0) {
+ *ret = auto_inc;
+
+ return(0);
}
(void) extra(HA_EXTRA_KEYREAD);
@@ -3372,22 +3737,63 @@ ha_innobase::get_auto_increment()
prebuilt->hint_no_need_to_fetch_extra_cols = FALSE;
- prebuilt->trx->mysql_n_tables_locked += 1;
+ prebuilt->trx->mysql_n_tables_locked += 1;
- error = index_last(table->record[1]);
+ error = index_last(table->record[1]);
if (error) {
- nr = 1;
+ if (error == HA_ERR_END_OF_FILE) {
+ /* The table was empty, initialize to 1 */
+ auto_inc = 1;
+
+ error = 0;
+ } else {
+ /* Deadlock or a lock wait timeout */
+ auto_inc = -1;
+
+ goto func_exit;
+ }
} else {
- nr = (longlong) table->next_number_field->
+ /* Initialize to max(col) + 1 */
+ auto_inc = (longlong) table->next_number_field->
val_int_offset(table->rec_buff_length) + 1;
}
+ dict_table_autoinc_initialize(prebuilt->table, auto_inc);
+
+func_exit:
(void) extra(HA_EXTRA_NO_KEYREAD);
- index_end();
+ index_end();
+
+ *ret = auto_inc;
+
+ return(error);
+}
+
+/***********************************************************************
+This function initializes the auto-inc counter if it has not been
+initialized yet. This function does not change the value of the auto-inc
+counter if it already has been initialized. Returns the value of the
+auto-inc counter. */
+
+longlong
+ha_innobase::get_auto_increment()
+/*=============================*/
+ /* out: auto-increment column value, -1 if error
+ (deadlock or lock wait timeout) */
+{
+ longlong nr;
+ int error;
+
+ error = innobase_read_and_init_auto_inc(&nr);
+
+ if (error) {
+
+ return(-1);
+ }
- return(nr);
+ return(nr);
}
#endif /* HAVE_INNOBASE_DB */
diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h
index b2aa963f91a..2addd957c8c 100644
--- a/sql/ha_innodb.h
+++ b/sql/ha_innodb.h
@@ -52,8 +52,6 @@ class ha_innobase: public handler
byte* key_val_buff; /* buffer used in converting
search key values from MySQL format
to Innodb format */
- uint ref_stored_len; /* length of the key value stored to
- 'ref' buffer of the handle, if any */
ulong int_table_flags;
uint primary_key;
uint last_dup_key;
@@ -71,14 +69,14 @@ class ha_innobase: public handler
int update_thd(THD* thd);
int change_active_index(uint keynr);
int general_fetch(byte* buf, uint direction, uint match_mode);
+ int innobase_read_and_init_auto_inc(longlong* ret);
/* Init values for the class: */
public:
ha_innobase(TABLE *table): handler(table),
int_table_flags(HA_REC_NOT_IN_SEQ |
HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER |
- HA_HAVE_KEY_READ_ONLY |
- HA_NULL_KEY |
+ HA_NULL_KEY | HA_CAN_SQL_HANDLER |
HA_NOT_EXACT_COUNT |
HA_NO_WRITE_DELAYED |
HA_PRIMARY_KEY_IN_READ_INDEX |
@@ -98,7 +96,7 @@ class ha_innobase: public handler
ulong index_flags(uint idx) const
{
return (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER |
- HA_NOT_READ_PREFIX_LAST);
+ HA_NOT_READ_PREFIX_LAST | HA_KEY_READ_ONLY);
}
uint max_record_length() const { return HA_MAX_REC_LENGTH; }
uint max_keys() const { return MAX_KEY; }
@@ -166,11 +164,11 @@ class ha_innobase: public handler
void free_foreign_key_create_info(char* str);
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
enum thr_lock_type lock_type);
+ void init_table_handle_for_HANDLER();
longlong get_auto_increment();
};
extern bool innodb_skip;
-extern SHOW_COMP_OPTION have_innodb;
extern uint innobase_init_flags, innobase_lock_type;
extern ulong innobase_cache_size;
extern char *innobase_home, *innobase_tmpdir, *innobase_logdir;
@@ -203,4 +201,5 @@ int innobase_report_binlog_offset_and_commit(
int innobase_rollback(THD *thd, void* trx_handle);
int innobase_close_connection(THD *thd);
int innobase_drop_database(char *path);
+int innodb_show_status(THD* thd);
diff --git a/sql/ha_isam.h b/sql/ha_isam.h
index bae9700f149..82a243ef5c0 100644
--- a/sql/ha_isam.h
+++ b/sql/ha_isam.h
@@ -26,16 +26,16 @@
class ha_isam: public handler
{
N_INFO *file;
- uint int_table_flags;
+ /* We need this as table_flags() may change after open() */
+ ulong int_table_flags;
public:
- ha_isam(TABLE *table): handler(table), file(0),
- int_table_flags(HA_READ_RND_SAME |
- HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER |
- HA_HAVE_KEY_READ_ONLY |
+ ha_isam(TABLE *table)
+ :handler(table), file(0),
+ int_table_flags(HA_READ_RND_SAME | HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER |
HA_KEY_READ_WRONG_STR | HA_DUPP_POS |
HA_NOT_DELETE_WITH_CACHE)
- {}
+ {}
~ha_isam() {}
const char *table_type() const { return "ISAM"; }
const char *index_type(uint key_number) { return "BTREE"; }
@@ -80,5 +80,4 @@ class ha_isam: public handler
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
enum thr_lock_type lock_type);
-
};
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index e32656b44d3..e9ef5b4ce12 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -31,7 +31,6 @@
#include "../myisam/rt_index.h"
#endif
-ulong myisam_sort_buffer_size;
ulong myisam_recover_options= HA_RECOVER_NONE;
/* bits in myisam_recover_options */
@@ -46,6 +45,7 @@ TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names)-1,"",
*****************************************************************************/
// collect errors printed by mi_check routines
+
static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
const char *fmt, va_list args)
{
@@ -67,8 +67,7 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
sql_print_error(msgbuf);
return;
}
- if (param->testflag & (T_CREATE_MISSING_KEYS | T_SAFE_REPAIR |
- T_AUTO_REPAIR))
+ if (param->testflag & (T_CREATE_MISSING_KEYS | T_SAFE_REPAIR | T_AUTO_REPAIR))
{
my_message(ER_NOT_KEYFILE,msgbuf,MYF(MY_WME));
return;
@@ -139,7 +138,7 @@ int ha_myisam::net_read_dump(NET* net)
int error = 0;
my_seek(data_fd, 0L, MY_SEEK_SET, MYF(MY_WME));
- for(;;)
+ for (;;)
{
ulong packet_len = my_net_read(net);
if (!packet_len)
@@ -176,7 +175,7 @@ int ha_myisam::dump(THD* thd, int fd)
int error = 0;
my_seek(data_fd, 0L, MY_SEEK_SET, MYF(MY_WME));
- for(; bytes_to_read > 0;)
+ for (; bytes_to_read > 0;)
{
uint bytes = my_read(data_fd, buf, blocksize, MYF(MY_WME));
if (bytes == MY_FILE_ERROR)
@@ -223,10 +222,10 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked)
return (my_errno ? my_errno : -1);
if (test_if_locked & (HA_OPEN_IGNORE_IF_LOCKED | HA_OPEN_TMP_TABLE))
- VOID(mi_extra(file,HA_EXTRA_NO_WAIT_LOCK));
+ VOID(mi_extra(file, HA_EXTRA_NO_WAIT_LOCK, 0));
info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
if (!(test_if_locked & HA_OPEN_WAIT_IF_LOCKED))
- VOID(mi_extra(file,HA_EXTRA_WAIT_LOCK));
+ VOID(mi_extra(file, HA_EXTRA_WAIT_LOCK, 0));
if (!table->db_record_offset)
int_table_flags|=HA_REC_NOT_IN_SEQ;
return (0);
@@ -499,8 +498,8 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
while ((error=repair(thd,param,0)) && param.retry_repair)
{
param.retry_repair=0;
- if ((param.testflag & T_RETRY_WITHOUT_QUICK) &&
- (param.testflag & T_QUICK))
+ if (test_all_bits(param.testflag,
+ (uint) (T_RETRY_WITHOUT_QUICK | T_QUICK)))
{
param.testflag&= ~T_RETRY_WITHOUT_QUICK;
sql_print_error("Warning: Retrying repair of: '%s' without quick",
@@ -670,13 +669,16 @@ void ha_myisam::deactivate_non_unique_index(ha_rows rows)
if (share->state.key_map == ((ulonglong) 1L << share->base.keys)-1)
{
if (!(specialflag & SPECIAL_SAFE_MODE))
- if (rows==HA_POS_ERROR)
- mi_extra(file, HA_EXTRA_NO_KEYS);
+ {
+ if (rows == HA_POS_ERROR)
+ mi_extra(file, HA_EXTRA_NO_KEYS, 0);
else
{
mi_disable_non_unique_index(file,rows);
- mi_extra(file, HA_EXTRA_BULK_INSERT_BEGIN);
+ ha_myisam::extra_opt(HA_EXTRA_BULK_INSERT_BEGIN,
+ current_thd->variables.bulk_insert_buff_size);
}
+ }
enable_activate_all_index=1;
}
else
@@ -691,7 +693,7 @@ bool ha_myisam::activate_all_index(THD *thd)
MYISAM_SHARE* share = file->s;
DBUG_ENTER("activate_all_index");
- mi_extra(file, HA_EXTRA_BULK_INSERT_END);
+ mi_extra(file, HA_EXTRA_BULK_INSERT_END, 0);
if (enable_activate_all_index &&
share->state.key_map != set_bits(ulonglong, share->base.keys))
{
@@ -700,9 +702,9 @@ bool ha_myisam::activate_all_index(THD *thd)
myisamchk_init(&param);
param.op_name = (char*) "recreating_index";
param.testflag = (T_SILENT | T_REP_BY_SORT | T_QUICK |
- T_CREATE_MISSING_KEYS | T_TRUST_HEADER);
+ T_CREATE_MISSING_KEYS);
param.myf_rw&= ~MY_WAIT_IF_FULL;
- param.sort_buffer_length= myisam_sort_buffer_size;
+ param.sort_buffer_length= thd->variables.myisam_sort_buff_size;
param.tmpdir=mysql_tmpdir;
error=repair(thd,param,0) != HA_ADMIN_OK;
thd->proc_info=save_proc_info;
@@ -833,8 +835,7 @@ int ha_myisam::rnd_init(bool scan)
{
if (scan)
return mi_scan_init(file);
- else
- return mi_extra(file,HA_EXTRA_RESET);
+ return mi_extra(file, HA_EXTRA_RESET, 0);
}
int ha_myisam::rnd_next(byte *buf)
@@ -889,7 +890,8 @@ void ha_myisam::info(uint flag)
ref_length=info.reflength;
table->db_options_in_use = info.options;
block_size=myisam_block_size;
- table->keys_in_use &= info.key_map;
+ table->keys_in_use&= info.key_map;
+ table->keys_for_keyread&= info.key_map;
table->db_record_offset=info.record_offset;
if (table->key_parts)
memcpy((char*) table->key_info[0].rec_per_key,
@@ -925,17 +927,27 @@ void ha_myisam::info(uint flag)
int ha_myisam::extra(enum ha_extra_function operation)
{
- if (((specialflag & SPECIAL_SAFE_MODE) || (test_flags & TEST_NO_EXTRA)) &&
+ if ((specialflag & SPECIAL_SAFE_MODE) && operation == HA_EXTRA_KEYREAD)
+ return 0;
+ return mi_extra(file, operation, 0);
+}
+
+
+/* To be used with WRITE_CACHE, EXTRA_CACHE and BULK_INSERT_BEGIN */
+
+int ha_myisam::extra_opt(enum ha_extra_function operation, ulong cache_size)
+{
+ if ((specialflag & SPECIAL_SAFE_MODE) &
(operation == HA_EXTRA_WRITE_CACHE ||
- operation == HA_EXTRA_KEYREAD ||
operation == HA_EXTRA_BULK_INSERT_BEGIN))
return 0;
- return mi_extra(file,operation);
+ return mi_extra(file, operation, (void*) &cache_size);
}
+
int ha_myisam::reset(void)
{
- return mi_extra(file,HA_EXTRA_RESET);
+ return mi_extra(file, HA_EXTRA_RESET, 0);
}
int ha_myisam::delete_all_rows()
diff --git a/sql/ha_myisam.h b/sql/ha_myisam.h
index d304085fdd5..215608f8f0a 100644
--- a/sql/ha_myisam.h
+++ b/sql/ha_myisam.h
@@ -24,11 +24,11 @@
#include <myisam.h>
#include <ft_global.h>
-#define HA_RECOVER_NONE 0 // No automatic recover
-#define HA_RECOVER_DEFAULT 1 // Automatic recover active
-#define HA_RECOVER_BACKUP 2 // Make a backupfile on recover
-#define HA_RECOVER_FORCE 4 // Recover even if we loose rows
-#define HA_RECOVER_QUICK 8 // Don't check rows in data file
+#define HA_RECOVER_NONE 0 /* No automatic recover */
+#define HA_RECOVER_DEFAULT 1 /* Automatic recover active */
+#define HA_RECOVER_BACKUP 2 /* Make a backupfile on recover */
+#define HA_RECOVER_FORCE 4 /* Recover even if we loose rows */
+#define HA_RECOVER_QUICK 8 /* Don't check rows in data file */
extern ulong myisam_sort_buffer_size;
extern TYPELIB myisam_recover_typelib;
@@ -45,7 +45,6 @@ class ha_myisam: public handler
public:
ha_myisam(TABLE *table): handler(table), file(0),
int_table_flags(HA_READ_RND_SAME | HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER |
- HA_HAVE_KEY_READ_ONLY |
HA_NULL_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
HA_DUPP_POS | HA_BLOB_KEY | HA_AUTO_PART_KEY),
enable_activate_all_index(1)
@@ -55,6 +54,12 @@ class ha_myisam: public handler
const char *index_type(uint key_number);
const char **bas_ext() const;
ulong table_flags() const { return int_table_flags; }
+ ulong index_flags(uint inx) const
+ {
+ ulong flags=(HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER);
+ return (flags | ((table->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
+ 0 : HA_KEY_READ_ONLY));
+ }
uint max_record_length() const { return HA_MAX_REC_LENGTH; }
uint max_keys() const { return MI_MAX_KEY; }
uint max_key_parts() const { return MAX_REF_PARTS; }
@@ -95,6 +100,7 @@ class ha_myisam: public handler
my_off_t row_position() { return mi_position(file); }
void info(uint);
int extra(enum ha_extra_function operation);
+ int extra_opt(enum ha_extra_function operation, ulong cache_size);
int reset(void);
int external_lock(THD *thd, int lock_type);
int delete_all_rows(void);
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
index 4e09c87f341..ee72216baa5 100644
--- a/sql/ha_myisammrg.cc
+++ b/sql/ha_myisammrg.cc
@@ -49,10 +49,10 @@ int ha_myisammrg::open(const char *name, int mode, uint test_if_locked)
myrg_extrafunc(file, query_cache_invalidate_by_MyISAM_filename_ref);
if (!(test_if_locked == HA_OPEN_WAIT_IF_LOCKED ||
test_if_locked == HA_OPEN_ABORT_IF_LOCKED))
- myrg_extra(file,HA_EXTRA_NO_WAIT_LOCK);
+ myrg_extra(file,HA_EXTRA_NO_WAIT_LOCK,0);
info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
if (!(test_if_locked & HA_OPEN_WAIT_IF_LOCKED))
- myrg_extra(file,HA_EXTRA_WAIT_LOCK);
+ myrg_extra(file,HA_EXTRA_WAIT_LOCK,0);
if (table->reclength != mean_rec_length && mean_rec_length)
{
DBUG_PRINT("error",("reclength: %d mean_rec_length: %d",
@@ -75,8 +75,7 @@ int ha_myisammrg::write_row(byte * buf)
if (table->time_stamp)
update_timestamp(buf+table->time_stamp-1);
if (table->next_number_field && buf == table->record[0])
- return (my_errno=HA_ERR_WRONG_COMMAND);
- // update_auto_increment(); - [phi] have to check this before allowing it
+ update_auto_increment();
return myrg_write(file,buf);
}
@@ -155,7 +154,7 @@ int ha_myisammrg::index_last(byte * buf)
int ha_myisammrg::rnd_init(bool scan)
{
- return myrg_extra(file,HA_EXTRA_RESET);
+ return myrg_extra(file,HA_EXTRA_RESET,0);
}
int ha_myisammrg::rnd_next(byte *buf)
@@ -210,12 +209,25 @@ int ha_myisammrg::extra(enum ha_extra_function operation)
if (operation == HA_EXTRA_FORCE_REOPEN ||
operation == HA_EXTRA_PREPARE_FOR_DELETE)
return 0;
- return myrg_extra(file,operation);
+ return myrg_extra(file,operation,0);
}
+
+/* To be used with WRITE_CACHE, EXTRA_CACHE and BULK_INSERT_BEGIN */
+
+int ha_myisammrg::extra_opt(enum ha_extra_function operation, ulong cache_size)
+{
+ if ((specialflag & SPECIAL_SAFE_MODE) &
+ (operation == HA_EXTRA_WRITE_CACHE ||
+ operation == HA_EXTRA_BULK_INSERT_BEGIN))
+ return 0;
+ return myrg_extra(file, operation, (void*) &cache_size);
+}
+
+
int ha_myisammrg::reset(void)
{
- return myrg_extra(file,HA_EXTRA_RESET);
+ return myrg_extra(file,HA_EXTRA_RESET,0);
}
int ha_myisammrg::external_lock(THD *thd, int lock_type)
diff --git a/sql/ha_myisammrg.h b/sql/ha_myisammrg.h
index ed2817f3ca6..b75d5360097 100644
--- a/sql/ha_myisammrg.h
+++ b/sql/ha_myisammrg.h
@@ -34,11 +34,16 @@ class ha_myisammrg: public handler
const char **bas_ext() const;
ulong table_flags() const
{
- return (HA_REC_NOT_IN_SEQ | HA_READ_RND_SAME |
- HA_HAVE_KEY_READ_ONLY | HA_KEYPOS_TO_RNDPOS |
- HA_LASTKEY_ORDER |
+ return (HA_REC_NOT_IN_SEQ | HA_READ_RND_SAME | HA_AUTO_PART_KEY |
+ HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER |
HA_NULL_KEY | HA_BLOB_KEY);
}
+ ulong index_flags(uint inx) const
+ {
+ ulong flags=(HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER);
+ return (flags | ((table->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
+ 0 : HA_KEY_READ_ONLY));
+ }
uint max_record_length() const { return HA_MAX_REC_LENGTH; }
uint max_keys() const { return MI_MAX_KEY; }
uint max_key_parts() const { return MAX_REF_PARTS; }
@@ -67,6 +72,7 @@ class ha_myisammrg: public handler
my_off_t row_position() { return myrg_position(file); }
void info(uint);
int extra(enum ha_extra_function operation);
+ int extra_opt(enum ha_extra_function operation, ulong cache_size);
int reset(void);
int external_lock(THD *thd, int lock_type);
uint lock_count(void) const;
diff --git a/sql/handler.cc b/sql/handler.cc
index 47c59be0166..f60c3449075 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -53,8 +53,10 @@ const char *ha_table_type[] = {
"MRG_ISAM","MYISAM", "MRG_MYISAM", "BDB", "INNODB", "GEMINI", "?", "?",NullS
};
-TYPELIB ha_table_typelib= {array_elements(ha_table_type)-4,"",
- ha_table_type+1};
+TYPELIB ha_table_typelib=
+{
+ array_elements(ha_table_type)-3, "", ha_table_type
+};
const char *ha_row_type[] = {
"", "FIXED", "DYNAMIC", "COMPRESSED","?","?","?"
@@ -216,7 +218,8 @@ int ha_autocommit_or_rollback(THD *thd, int error)
}
else
(void) ha_rollback_stmt(thd);
- thd->tx_isolation=thd->session_tx_isolation;
+
+ thd->variables.tx_isolation=thd->session_tx_isolation;
}
#endif
DBUG_RETURN(error);
@@ -272,6 +275,7 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
{
bool operation_done= 0;
bool transaction_commited= 0;
+
/* Update the binary log if we have cached some queries */
if (trans == &thd->transaction.all && mysql_bin_log.is_open() &&
my_b_tell(&thd->transaction.trans_log))
@@ -314,9 +318,12 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
#endif /*HAVE_QUERY_CACHE*/
if (error && trans == &thd->transaction.all && mysql_bin_log.is_open())
sql_print_error("Error: Got error during commit; Binlog is not up to date!");
- thd->tx_isolation=thd->session_tx_isolation;
+ thd->variables.tx_isolation=thd->session_tx_isolation;
if (operation_done)
+ {
statistic_increment(ha_commit_count,&LOCK_status);
+ thd->transaction.cleanup();
+ }
}
#endif // using transactions
DBUG_RETURN(error);
@@ -359,9 +366,12 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
reinit_io_cache(&thd->transaction.trans_log,
WRITE_CACHE, (my_off_t) 0, 0, 1);
thd->transaction.trans_log.end_of_file= max_binlog_cache_size;
- thd->tx_isolation=thd->session_tx_isolation;
+ thd->variables.tx_isolation=thd->session_tx_isolation;
if (operation_done)
+ {
statistic_increment(ha_rollback_count,&LOCK_status);
+ thd->transaction.cleanup();
+ }
}
#endif /* USING_TRANSACTIONS */
DBUG_RETURN(error);
@@ -622,16 +632,29 @@ longlong handler::get_auto_increment()
{
longlong nr;
int error;
+
(void) extra(HA_EXTRA_KEYREAD);
index_init(table->next_number_index);
- error=index_last(table->record[1]);
+ if (!table->next_number_key_offset)
+ { // Autoincrement at key-start
+ error=index_last(table->record[1]);
+ }
+ else
+ {
+ byte key[MAX_KEY_LENGTH];
+ key_copy(key,table,table->next_number_index,
+ table->next_number_key_offset);
+ error=index_read(table->record[1], key, table->next_number_key_offset,
+ HA_READ_PREFIX_LAST);
+ }
+
if (error)
nr=1;
else
nr=(longlong) table->next_number_field->
val_int_offset(table->rec_buff_length)+1;
- (void) extra(HA_EXTRA_NO_KEYREAD);
index_end();
+ (void) extra(HA_EXTRA_NO_KEYREAD);
return nr;
}
@@ -859,8 +882,14 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
void ha_key_cache(void)
{
if (keybuff_size)
- (void) init_key_cache(keybuff_size,0);
-} /* ha_key_cache */
+ (void) init_key_cache(keybuff_size);
+}
+
+
+void ha_resize_key_cache(void)
+{
+ (void) resize_key_cache(keybuff_size);
+}
static int NEAR_F delete_file(const char *name,const char *ext,int extflag)
@@ -869,3 +898,9 @@ static int NEAR_F delete_file(const char *name,const char *ext,int extflag)
VOID(fn_format(buff,name,"",ext,extflag | 4));
return(my_delete_with_symlink(buff,MYF(MY_WME)));
}
+
+void st_ha_check_opt::init()
+{
+ flags= sql_flags= 0;
+ sort_buffer_size = current_thd->variables.myisam_sort_buff_size;
+}
diff --git a/sql/handler.h b/sql/handler.h
index 7260e8f2f8c..adbfff8c55c 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -48,7 +48,6 @@
#define HA_TABLE_SCAN_ON_INDEX 4 /* No separate data/index file */
#define HA_REC_NOT_IN_SEQ 8 /* ha_info don't return recnumber;
It returns a position to ha_r_rnd */
-#define HA_HAVE_KEY_READ_ONLY 16 /* Can read only keys (no record) */
#define HA_NO_INDEX 32 /* No index needed for next/prev */
#define HA_KEY_READ_WRONG_STR 64 /* keyread returns converted strings */
#define HA_NULL_KEY 128 /* One can have keys with NULL */
@@ -83,6 +82,7 @@
#define HA_READ_ORDER 8 /* Read through record-keys in order */
#define HA_ONLY_WHOLE_INDEX 16 /* Can't use part key searches */
#define HA_NOT_READ_PREFIX_LAST 32
+#define HA_KEY_READ_ONLY 64 /* Support HA_EXTRA_KEYREAD */
/*
Parameters for open() (in register form->filestat)
@@ -174,18 +174,13 @@ typedef struct st_ha_create_information
struct st_table;
typedef struct st_table TABLE;
-extern ulong myisam_sort_buffer_size;
typedef struct st_ha_check_opt
{
ulong sort_buffer_size;
uint flags; /* isam layer flags (e.g. for myisamchk) */
uint sql_flags; /* sql layer flags - for something myisamchk cannot do */
- inline void init()
- {
- flags= sql_flags= 0;
- sort_buffer_size = myisam_sort_buffer_size;
- }
+ void init();
} HA_CHECK_OPT;
class handler :public Sql_alloc
@@ -287,6 +282,10 @@ public:
virtual my_off_t row_position() { return HA_OFFSET_ERROR; }
virtual void info(uint)=0;
virtual int extra(enum ha_extra_function operation)=0;
+ virtual int extra_opt(enum ha_extra_function operation, ulong cache_size)
+ {
+ return extra(operation);
+ }
virtual int reset()=0;
virtual int external_lock(THD *thd, int lock_type)=0;
virtual void unlock_row() {}
@@ -316,6 +315,8 @@ public:
virtual void append_create_info(String *packet) {}
virtual char* get_foreign_key_create_info()
{ return(NULL);} /* gets foreign key create string from InnoDB */
+ virtual void init_table_handle_for_HANDLER()
+ { return; } /* prepare InnoDB for HANDLER */
virtual void free_foreign_key_create_info(char* str) {}
/* The following can be called without an open handler */
virtual const char *table_type() const =0;
@@ -323,7 +324,7 @@ public:
virtual ulong table_flags(void) const =0;
virtual ulong index_flags(uint idx) const
{
- return (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER);
+ return (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_KEY_READ_ONLY);
}
virtual uint max_record_length() const =0;
virtual uint max_keys() const =0;
@@ -369,6 +370,7 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
int ha_delete_table(enum db_type db_type, const char *path);
void ha_drop_database(char* path);
void ha_key_cache(void);
+void ha_resize_key_cache(void);
int ha_start_stmt(THD *thd);
int ha_report_binlog_offset_and_commit(THD *thd, char *log_file_name,
my_off_t end_offset);
diff --git a/sql/hostname.cc b/sql/hostname.cc
index bcc8ea87281..3da752f3b64 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -57,8 +57,8 @@ void hostname_cache_refresh()
bool hostname_cache_init()
{
- host_entry *tmp;
- uint offset= (uint) ((char*) (&tmp->ip) - (char*) tmp);
+ host_entry tmp;
+ uint offset= (uint) ((char*) (&tmp.ip) - (char*) &tmp);
(void) pthread_mutex_init(&LOCK_hostname,MY_MUTEX_INIT_SLOW);
if (!(hostname_cache=new hash_filo(HOST_CACHE_SIZE, offset,
diff --git a/sql/item.cc b/sql/item.cc
index f717b78f4bf..7693ef428c6 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -568,12 +568,14 @@ void Item_datetime::make_field(Send_field *tmp_field)
init_make_field(tmp_field,FIELD_TYPE_DATETIME);
}
+
void Item_null::make_field(Send_field *tmp_field)
{
init_make_field(tmp_field,FIELD_TYPE_NULL);
tmp_field->length=4;
}
+
void Item_func::make_field(Send_field *tmp_field)
{
init_make_field(tmp_field, ((result_type() == STRING_RESULT) ?
@@ -780,7 +782,7 @@ bool Item::send(THD *thd, String *packet)
String s(buff,sizeof(buff),packet->charset()),*res;
if (!(res=val_str(&s)))
return net_store_null(packet);
- if ((convert=thd->convert_set))
+ if ((convert=thd->variables.convert_set))
return convert->store(packet,res->ptr(),res->length());
return net_store_data(packet,res->ptr(),res->length());
}
diff --git a/sql/item.h b/sql/item.h
index a0b637b6030..206d7b5bd78 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -31,7 +31,7 @@ public:
enum Type {FIELD_ITEM,FUNC_ITEM,SUM_FUNC_ITEM,STRING_ITEM,
INT_ITEM,REAL_ITEM,NULL_ITEM,VARBIN_ITEM,
- COPY_STR_ITEM,FIELD_AVG_ITEM,
+ COPY_STR_ITEM,FIELD_AVG_ITEM, DEFAULT_ITEM,
PROC_ITEM,COND_ITEM,REF_ITEM,FIELD_STD_ITEM, CONST_ITEM,
SUBSELECT_ITEM};
enum cond_result { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE };
@@ -82,6 +82,7 @@ public:
virtual bool get_date(TIME *ltime,bool fuzzydate);
virtual bool get_time(TIME *ltime);
virtual bool is_null() { return 0; }
+ virtual unsigned int size_of()= 0;
};
@@ -99,8 +100,10 @@ public:
field_name(field_name_par), depended_from(0)
{ name = (char*) field_name_par; }
const char *full_name() const;
+ unsigned int size_of() { return sizeof(*this);}
};
+
class Item_field :public Item_ident
{
void set_field(Field *field);
@@ -121,7 +124,10 @@ public:
double val_result();
longlong val_int_result();
String *str_result(String* tmp);
- bool send(THD *thd, String *str_arg) { return result_field->send(thd,str_arg); }
+ bool send(THD *thd, String *str_arg)
+ {
+ return result_field->send(thd,str_arg);
+ }
void make_field(Send_field *field);
bool fix_fields(THD *, struct st_table_list *, Item **);
int save_in_field(Field *field);
@@ -135,6 +141,7 @@ public:
bool get_date(TIME *ltime,bool fuzzydate);
bool get_time(TIME *ltime);
bool is_null() { return field->is_null(); }
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -156,6 +163,7 @@ public:
bool basic_const_item() const { return 1; }
Item *new_item() { return new Item_null(name); }
bool is_null() { return 1; }
+ unsigned int size_of() { return sizeof(*this);}
};
class Item_param :public Item
@@ -219,6 +227,7 @@ public:
bool basic_const_item() const { return 1; }
Item *new_item() { return new Item_int(name,value,max_length); }
void print(String *str);
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -227,11 +236,13 @@ class Item_uint :public Item_int
public:
Item_uint(const char *str_arg, uint length) :
Item_int(str_arg, (longlong) strtoull(str_arg,(char**) 0,10), length) {}
+ Item_uint(uint32 i) :Item_int((longlong) i, 10) {}
double val() { return ulonglong2double(value); }
String *val_str(String*);
void make_field(Send_field *field);
Item *new_item() { return new Item_uint(name,max_length); }
void print(String *str);
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -262,6 +273,7 @@ public:
void make_field(Send_field *field);
bool basic_const_item() const { return 1; }
Item *new_item() { return new Item_real(name,value,decimals,max_length); }
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -273,6 +285,7 @@ public:
decimals=NOT_FIXED_DEC;
max_length=DBL_DIG+8;
}
+ unsigned int size_of() { return sizeof(*this);}
};
class Item_string :public Item
@@ -306,8 +319,31 @@ public:
String *const_string() { return &str_value; }
inline void append(char *str,uint length) { str_value.append(str,length); }
void print(String *str);
+ unsigned int size_of() { return sizeof(*this);}
+};
+
+
+/* For INSERT ... VALUES (DEFAULT) */
+
+class Item_default :public Item
+{
+public:
+ Item_default() { name= (char*) "DEFAULT"; }
+ enum Type type() const { return DEFAULT_ITEM; }
+ void make_field(Send_field *field) {}
+ bool save_in_field(Field *field)
+ {
+ field->set_default();
+ return 0;
+ }
+ virtual double val() { return 0.0; }
+ virtual longlong val_int() { return 0; }
+ virtual String *val_str(String *str) { return 0; }
+ bool basic_const_item() const { return 1; }
+ unsigned int size_of() { return sizeof(*this);}
};
+
/* for show tables */
class Item_datetime :public Item_string
@@ -316,6 +352,7 @@ public:
Item_datetime(const char *item_name): Item_string(item_name,"",0,default_charset_info)
{ max_length=19;}
void make_field(Send_field *field);
+ unsigned int size_of() { return sizeof(*this);}
};
class Item_empty_string :public Item_string
@@ -323,6 +360,7 @@ class Item_empty_string :public Item_string
public:
Item_empty_string(const char *header,uint length) :Item_string("",0,default_charset_info)
{ name=(char*) header; max_length=length;}
+ unsigned int size_of() { return sizeof(*this);}
};
class Item_varbinary :public Item
@@ -337,6 +375,7 @@ public:
int save_in_field(Field *field);
void make_field(Send_field *field);
enum Item_result result_type () const { return INT_RESULT; }
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -349,6 +388,7 @@ public:
Field *tmp_table_field(TABLE *t_arg=(TABLE *)0) { return result_field; }
table_map used_tables() const { return 1; }
virtual void fix_length_and_dec()=0;
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -398,6 +438,7 @@ public:
void save_org_in_field(Field *field) { (*ref)->save_org_in_field(field); }
enum Item_result result_type () const { return (*ref)->result_type(); }
table_map used_tables() const { return (*ref)->used_tables(); }
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -417,6 +458,7 @@ public:
{
return ref->save_in_field(field);
}
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -453,6 +495,7 @@ public:
table_map used_tables() const { return (table_map) 1L; }
bool const_item() const { return 0; }
bool is_null() { return null_value; }
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -463,6 +506,7 @@ public:
Item_buff() :null_value(0) {}
virtual bool cmp(void)=0;
virtual ~Item_buff(); /*line -e1509 */
+ unsigned int size_of() { return sizeof(*this);}
};
class Item_str_buff :public Item_buff
@@ -473,6 +517,7 @@ public:
Item_str_buff(Item *arg) :item(arg),value(arg->max_length) {}
bool cmp(void);
~Item_str_buff(); // Deallocate String:s
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -483,6 +528,7 @@ class Item_real_buff :public Item_buff
public:
Item_real_buff(Item *item_par) :item(item_par),value(0.0) {}
bool cmp(void);
+ unsigned int size_of() { return sizeof(*this);}
};
class Item_int_buff :public Item_buff
@@ -492,6 +538,7 @@ class Item_int_buff :public Item_buff
public:
Item_int_buff(Item *item_par) :item(item_par),value(0) {}
bool cmp(void);
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -508,11 +555,10 @@ public:
buff= (char*) sql_calloc(length=field->pack_length());
}
bool cmp(void);
+ unsigned int size_of() { return sizeof(*this);}
};
extern Item_buff *new_Item_buff(Item *item);
extern Item_result item_cmp_type(Item_result a,Item_result b);
extern Item *resolve_const_item(Item *item,Item *cmp_item);
extern bool field_is_equal_to_item(Field *field,Item *item);
-Item *get_system_var(LEX_STRING name);
-
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 084688f7d3d..10215f406c3 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -38,19 +38,27 @@ longlong Item_func_not::val_int()
return !null_value && value == 0 ? 1 : 0;
}
+/*
+ Convert a constant expression or string to an integer.
+ This is done when comparing DATE's of different formats and
+ also when comparing bigint to strings (in which case the string
+ is converted once to a bigint).
+
+ RESULT VALUES
+ 0 Can't convert item
+ 1 Item was replaced with an integer version of the item
+*/
static bool convert_constant_item(Field *field, Item **item)
{
- if ((*item)->const_item())
+ if ((*item)->const_item() && (*item)->type() != Item::INT_ITEM)
{
- if ((*item)->save_in_field(field))
- return 0;
- if (!((*item)->null_value))
+ if (!(*item)->save_in_field(field) && !((*item)->null_value))
{
Item *tmp=new Item_int_with_ref(field->val_int(), *item);
if (tmp)
*item=tmp;
- return 1;
+ return 1; // Item was replaced
}
}
return 0;
@@ -59,7 +67,7 @@ static bool convert_constant_item(Field *field, Item **item)
void Item_bool_func2::fix_length_and_dec()
{
- max_length=1;
+ max_length=1; // Function returns 0 or 1
/*
As some compare functions are generated after sql_yacc,
@@ -488,6 +496,7 @@ Item_func_ifnull::val_str(String *str)
return res;
}
+
void
Item_func_if::fix_length_and_dec()
{
@@ -496,16 +505,32 @@ Item_func_if::fix_length_and_dec()
decimals=max(args[1]->decimals,args[2]->decimals);
enum Item_result arg1_type=args[1]->result_type();
enum Item_result arg2_type=args[2]->result_type();
- binary=1;
- if (arg1_type == STRING_RESULT || arg2_type == STRING_RESULT)
+ bool null1=args[1]->null_value;
+ bool null2=args[2]->null_value;
+
+ if (null1)
+ {
+ cached_result_type= arg2_type;
+ binary= args[2]->binary;
+ }
+ else if (null2)
+ {
+ cached_result_type= arg1_type;
+ binary= args[1]->binary;
+ }
+ else if (arg1_type == STRING_RESULT || arg2_type == STRING_RESULT)
{
cached_result_type = STRING_RESULT;
binary=args[1]->binary | args[2]->binary;
}
- else if (arg1_type == REAL_RESULT || arg2_type == REAL_RESULT)
- cached_result_type = REAL_RESULT;
else
- cached_result_type=arg1_type; // Should be INT_RESULT
+ {
+ binary=1; // Number
+ if (arg1_type == REAL_RESULT || arg2_type == REAL_RESULT)
+ cached_result_type = REAL_RESULT;
+ else
+ cached_result_type=arg1_type; // Should be INT_RESULT
+ }
}
@@ -551,7 +576,7 @@ Item_func_nullif::fix_length_and_dec()
}
/*
- nullif() returns NULL if arguments are different, else it returns the
+ nullif () returns NULL if arguments are different, else it returns the
first argument.
Note that we have to evaluate the first argument twice as the compare
may have been done with a different type than return value
@@ -1301,7 +1326,7 @@ bool Item_func_like::fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref)
*last == wild_many)
{
const char* tmp = first + 1;
- for ( ; *tmp != wild_many && *tmp != wild_one && *tmp != escape; tmp++) ;
+ for (; *tmp != wild_many && *tmp != wild_one && *tmp != escape; tmp++) ;
canDoTurboBM = tmp == last;
}
@@ -1642,6 +1667,45 @@ bool Item_func_like::turboBM_matches(const char* text, int text_len) const
}
}
+
+/*
+ Make a logical XOR of the arguments.
+
+ SYNOPSIS
+ val_int()
+
+ DESCRIPTION
+ If either operator is NULL, return NULL.
+
+ NOTE
+ As we don't do any index optimization on XOR this is not going to be
+ very fast to use.
+
+ TODO (low priority)
+ Change this to be optimized as:
+ A XOR B -> (A) == 1 AND (B) <> 1) OR (A <> 1 AND (B) == 1)
+ To be able to do this, we would however first have to extend the MySQL
+ range optimizer to handle OR better.
+*/
+
+longlong Item_cond_xor::val_int()
+{
+ List_iterator<Item> li(list);
+ Item *item;
+ int result=0;
+ null_value=0;
+ while ((item=li++))
+ {
+ result^= (item->val_int() != 0);
+ if (item->null_value)
+ {
+ null_value=1;
+ return 0;
+ }
+ }
+ return (longlong) result;
+}
+
/****************************************************************
Classes and functions for spatial relations
*****************************************************************/
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 08c5a30c57c..c0dcc2bba8f 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -587,6 +587,17 @@ public:
};
+class Item_cond_xor :public Item_cond
+{
+public:
+ Item_cond_xor() :Item_cond() {}
+ Item_cond_xor(Item *i1,Item *i2) :Item_cond(i1,i2) {}
+ enum Functype functype() const { return COND_XOR_FUNC; }
+ longlong val_int();
+ const char *func_name() const { return "xor"; }
+};
+
+
/* Some usefull inline functions */
inline Item *and_conds(Item *a,Item *b)
@@ -601,7 +612,7 @@ inline Item *and_conds(Item *a,Item *b)
/**************************************************************
-Spatial relations
+ Spatial relations
***************************************************************/
class Item_func_spatial_rel :public Item_bool_func2
@@ -609,45 +620,43 @@ class Item_func_spatial_rel :public Item_bool_func2
enum Functype spatial_rel;
public:
Item_func_spatial_rel(Item *a,Item *b, enum Functype sp_rel) :
- Item_bool_func2(a,b) { spatial_rel = sp_rel; }
+ Item_bool_func2(a,b) { spatial_rel = sp_rel; }
longlong val_int();
enum Functype functype() const
{
- switch (spatial_rel)
- {
- case SP_CONTAINS_FUNC:
- return SP_WITHIN_FUNC;
- case SP_WITHIN_FUNC:
- return SP_CONTAINS_FUNC;
- default:
- return spatial_rel;
+ switch (spatial_rel) {
+ case SP_CONTAINS_FUNC:
+ return SP_WITHIN_FUNC;
+ case SP_WITHIN_FUNC:
+ return SP_CONTAINS_FUNC;
+ default:
+ return spatial_rel;
}
}
enum Functype rev_functype() const { return spatial_rel; }
const char *func_name() const
{
- switch (spatial_rel)
- {
- case SP_CONTAINS_FUNC:
- return "contains";
- case SP_WITHIN_FUNC:
- return "within";
- case SP_EQUALS_FUNC:
- return "equals";
- case SP_DISJOINT_FUNC:
- return "disjoint";
- case SP_INTERSECTS_FUNC:
- return "intersects";
- case SP_TOUCHES_FUNC:
- return "touches";
- case SP_CROSSES_FUNC:
- return "crosses";
- case SP_OVERLAPS_FUNC:
- return "overlaps";
- default:
- return "sp_unknown";
+ switch (spatial_rel) {
+ case SP_CONTAINS_FUNC:
+ return "contains";
+ case SP_WITHIN_FUNC:
+ return "within";
+ case SP_EQUALS_FUNC:
+ return "equals";
+ case SP_DISJOINT_FUNC:
+ return "disjoint";
+ case SP_INTERSECTS_FUNC:
+ return "intersects";
+ case SP_TOUCHES_FUNC:
+ return "touches";
+ case SP_CROSSES_FUNC:
+ return "crosses";
+ case SP_OVERLAPS_FUNC:
+ return "overlaps";
+ default:
+ return "sp_unknown";
+ }
}
- }
};
diff --git a/sql/item_create.cc b/sql/item_create.cc
index a41ba1cc526..e4c9a160686 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -32,6 +32,16 @@ Item *create_func_acos(Item* a)
return new Item_func_acos(a);
}
+Item *create_func_aes_encrypt(Item* a, Item* b)
+{
+ return new Item_func_aes_encrypt(a, b);
+}
+
+Item *create_func_aes_decrypt(Item* a, Item* b)
+{
+ return new Item_func_aes_decrypt(a, b);
+}
+
Item *create_func_ascii(Item* a)
{
return new Item_func_ascii(a);
@@ -215,9 +225,14 @@ Item *create_func_char_length(Item* a)
return new Item_func_char_length(a);
}
-Item *create_func_log(Item* a)
+Item *create_func_ln(Item* a)
{
- return new Item_func_log(a);
+ return new Item_func_ln(a);
+}
+
+Item *create_func_log2(Item* a)
+{
+ return new Item_func_log2(a);
}
Item *create_func_log10(Item* a)
@@ -332,6 +347,11 @@ Item *create_func_sin(Item* a)
return new Item_func_sin(a);
}
+Item *create_func_sha(Item* a)
+{
+ return new Item_func_sha(a);
+}
+
Item *create_func_space(Item *a)
{
return new Item_func_repeat(new Item_string(" ",1,default_charset_info),a);
@@ -421,6 +441,17 @@ Item *create_func_cast(Item *a, Item_cast cast_type)
return res;
}
+Item *create_func_is_free_lock(Item* a)
+{
+ current_thd->safe_to_cache_query=0;
+ return new Item_func_is_free_lock(a);
+}
+
+Item *create_func_quote(Item* a)
+{
+ return new Item_func_quote(a);
+}
+
Item *create_func_geometry_from_text(Item* a)
{
return new Item_func_geometry_from_text(a);
diff --git a/sql/item_create.h b/sql/item_create.h
index fd9a856f283..6d9cef04c13 100644
--- a/sql/item_create.h
+++ b/sql/item_create.h
@@ -18,6 +18,8 @@
Item *create_func_abs(Item* a);
Item *create_func_acos(Item* a);
+Item *create_func_aes_encrypt(Item* a, Item* b);
+Item *create_func_aes_decrypt(Item* a, Item* b);
Item *create_func_ascii(Item* a);
Item *create_func_asin(Item* a);
Item *create_func_bin(Item* a);
@@ -25,6 +27,7 @@ Item *create_func_bit_count(Item* a);
Item *create_func_bit_length(Item* a);
Item *create_func_ceiling(Item* a);
Item *create_func_char_length(Item* a);
+Item *create_func_cast(Item *a, Item_cast cast_type);
Item *create_func_connection_id(void);
Item *create_func_conv(Item* a, Item *b, Item *c);
Item *create_func_cos(Item* a);
@@ -51,8 +54,9 @@ Item *create_func_instr(Item* a, Item *b);
Item *create_func_isnull(Item* a);
Item *create_func_lcase(Item* a);
Item *create_func_length(Item* a);
+Item *create_func_ln(Item* a);
Item *create_func_locate(Item* a, Item *b);
-Item *create_func_log(Item* a);
+Item *create_func_log2(Item* a);
Item *create_func_log10(Item* a);
Item *create_func_lpad(Item* a, Item *b, Item *c);
Item *create_func_ltrim(Item* a);
@@ -76,6 +80,7 @@ Item *create_func_rtrim(Item* a);
Item *create_func_sec_to_time(Item* a);
Item *create_func_sign(Item* a);
Item *create_func_sin(Item* a);
+Item *create_func_sha(Item* a);
Item *create_func_soundex(Item* a);
Item *create_func_space(Item *);
Item *create_func_sqrt(Item* a);
@@ -89,6 +94,8 @@ Item *create_func_version(void);
Item *create_func_weekday(Item* a);
Item *create_load_file(Item* a);
Item *create_wait_for_master_pos(Item* a, Item* b);
+Item *create_func_is_free_lock(Item* a);
+Item *create_func_quote(Item* a);
Item *create_func_geometry_from_text(Item* a);
Item *create_func_as_text(Item* a);
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 8728187718c..bd811726b47 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -58,6 +58,41 @@ Item_func::Item_func(List<Item> &list)
list.empty(); // Fields are used
}
+
+/*
+ Resolve references to table column for a function and it's argument
+
+ SYNOPSIS:
+ fix_fields()
+ thd Thread object
+ tables List of all open tables involved in the query
+ ref Pointer to where this object is used. This reference
+ is used if we want to replace this object with another
+ one (for example in the summary functions).
+
+ DESCRIPTION
+ Call fix_fields() for all arguments to the function. The main intention
+ is to allow all Item_field() objects to setup pointers to the table fields.
+
+ Sets as a side effect the following class variables:
+ maybe_null Set if any argument may return NULL
+ binary Set if any of the arguments is binary
+ with_sum_func Set if any of the arguments contains a sum function
+ used_table_cache Set to union of the arguments used table
+
+ str_value.charset If this is a string function, set this to the
+ character set for the first argument.
+
+ If for any item any of the defaults are wrong, then this can
+ be fixed in the fix_length_and_dec() function that is called
+ after this one or by writing a specialized fix_fields() for the
+ item.
+
+ RETURN VALUES
+ 0 ok
+ 1 Got error. Stored with my_error().
+*/
+
bool
Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
@@ -79,21 +114,16 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
maybe_null=1;
if ((*arg)->binary)
binary=1;
- /*
- Change charset to arg charset if it is not equal to
- default_charset_info. This will work for many cases,
- but generally this should be done more carefull. Each string
- function should have it's own fix_fields() method to correctly
- setup it's result's character set taking in account arguments.
- For example: left(a,b) should take in account only first argument,
- but ignore the second one.
- */
- if ((*arg)->str_value.charset() != default_charset_info)
- str_value.set_charset((*arg)->str_value.charset());
with_sum_func= with_sum_func || (*arg)->with_sum_func;
used_tables_cache|=(*arg)->used_tables();
const_item_cache&= (*arg)->const_item();
}
+ /*
+ Set return character set to first argument if we are returning a
+ string.
+ */
+ if (result_type() == STRING_RESULT)
+ str_value.set_charset((*args)->str_value.charset());
}
fix_length_and_dec();
return 0;
@@ -180,6 +210,36 @@ bool Item_func::eq(const Item *item, bool binary_cmp) const
}
+Field *Item_func::tmp_table_field(TABLE *t_arg)
+{
+ Field *res;
+ LINT_INIT(res);
+
+ if (!t_arg)
+ return result_field;
+ switch (args[0]->result_type()) {
+ case INT_RESULT:
+ if (max_length > 11)
+ res= new Field_longlong(max_length, maybe_null, name, t_arg,
+ unsigned_flag);
+ else
+ res= new Field_long(max_length, maybe_null, name, t_arg,
+ unsigned_flag);
+ break;
+ case REAL_RESULT:
+ res= new Field_double(max_length, maybe_null, name, t_arg, decimals);
+ break;
+ case STRING_RESULT:
+ if (max_length > 255)
+ res= new Field_blob(max_length, maybe_null, name, t_arg, binary);
+ else
+ res= new Field_string(max_length, maybe_null, name, t_arg, binary);
+ break;
+ }
+ return res;
+}
+
+
String *Item_real_func::val_str(String *str)
{
double nr=val();
@@ -451,14 +511,43 @@ void Item_func_abs::fix_length_and_dec()
hybrid_type= args[0]->result_type() == INT_RESULT ? INT_RESULT : REAL_RESULT;
}
+/* Gateway to natural LOG function */
+double Item_func_ln::val()
+{
+ double value=args[0]->val();
+ if ((null_value=(args[0]->null_value || value <= 0.0)))
+ return 0.0;
+ return log(value);
+}
+
+/*
+ Extended but so slower LOG function
+ We have to check if all values are > zero and first one is not one
+ as these are the cases then result is not a number.
+*/
double Item_func_log::val()
{
double value=args[0]->val();
if ((null_value=(args[0]->null_value || value <= 0.0)))
- return 0.0; /* purecov: inspected */
+ return 0.0;
+ if (arg_count == 2)
+ {
+ double value2= args[1]->val();
+ if ((null_value=(args[1]->null_value || value2 <= 0.0 || value == 1.0)))
+ return 0.0;
+ return log(value2) / log(value);
+ }
return log(value);
}
+double Item_func_log2::val()
+{
+ double value=args[0]->val();
+ if ((null_value=(args[0]->null_value || value <= 0.0)))
+ return 0.0;
+ return log(value) / log(2.0);
+}
+
double Item_func_log10::val()
{
double value=args[0]->val();
@@ -891,7 +980,8 @@ longlong Item_func_locate::val_int()
return (longlong) start0+1;
}
skipp:
- if ((l=my_ismbchar(a->charset(),ptr,strend))) ptr+=l;
+ if ((l=my_ismbchar(a->charset(),ptr,strend)))
+ ptr+=l;
else ++ptr;
++start0;
}
@@ -946,7 +1036,8 @@ longlong Item_func_ord::val_int()
{
register const char *str=res->ptr();
register uint32 n=0, l=my_ismbchar(res->charset(),str,str+res->length());
- if (!l) return (longlong)((uchar) *str);
+ if (!l)
+ return (longlong)((uchar) *str);
while (l--)
n=(n<<8)|(uint32)((uchar) *str++);
return (longlong) n;
@@ -1006,6 +1097,7 @@ longlong Item_func_find_in_set::val_int()
null_value=0;
int diff;
+ CHARSET_INFO *charset= find->charset();
if ((diff=buffer->length() - find->length()) >= 0)
{
const char *f_pos=find->ptr();
@@ -1019,8 +1111,7 @@ longlong Item_func_find_in_set::val_int()
const char *pos= f_pos;
while (pos != f_end)
{
- if (my_toupper(find->charset(),*str) !=
- my_toupper(find->charset(),*pos))
+ if (my_toupper(charset,*str) != my_toupper(charset,*pos))
goto not_found;
str++;
pos++;
@@ -1464,20 +1555,15 @@ void item_user_lock_release(ULL *ull)
ull->locked=0;
if (mysql_bin_log.is_open())
{
- THD *thd = current_thd;
- uint save_query_length;
char buf[256];
- String tmp(buf,sizeof(buf), default_charset_info);
- tmp.length(0);
- tmp.append("DO RELEASE_LOCK(\"");
+ const char *command="DO RELEASE_LOCK(\"";
+ String tmp(buf,sizeof(buf), system_charset_info);
+ tmp.copy(command, strlen(command));
tmp.append(ull->key,ull->key_length);
tmp.append("\")");
- save_query_length=thd->query_length;
- thd->query_length=tmp.length();
- Query_log_event qev(thd,tmp.ptr());
+ Query_log_event qev(current_thd,tmp.ptr(), tmp.length());
qev.error_code=0; // this query is always safe to run on slave
mysql_bin_log.write(&qev);
- thd->query_length=save_query_length;
}
if (--ull->count)
pthread_cond_signal(&ull->cond);
@@ -1529,10 +1615,11 @@ void debug_sync_point(const char* lock_name, uint lock_timeout)
thd->ull=0;
}
- /* if the lock has not been aquired by some client, we do not want to
- create an entry for it, since we immediately release the lock. In
- this case, we will not be waiting, but rather, just waste CPU and
- memory on the whole deal
+ /*
+ If the lock has not been aquired by some client, we do not want to
+ create an entry for it, since we immediately release the lock. In
+ this case, we will not be waiting, but rather, just waste CPU and
+ memory on the whole deal
*/
if (!(ull= ((ULL*) hash_search(&hash_user_locks,lock_name,
lock_name_len))))
@@ -1542,8 +1629,10 @@ void debug_sync_point(const char* lock_name, uint lock_timeout)
}
ull->count++;
- /* structure is now initialized. Try to get the lock */
- /* Set up control struct to allow others to abort locks */
+ /*
+ Structure is now initialized. Try to get the lock.
+ Set up control struct to allow others to abort locks
+ */
thd->proc_info="User lock";
thd->mysys_var->current_mutex= &LOCK_user_locks;
thd->mysys_var->current_cond= &ull->cond;
@@ -1630,8 +1719,10 @@ longlong Item_func_get_lock::val_int()
}
ull->count++;
- /* structure is now initialized. Try to get the lock */
- /* Set up control struct to allow others to abort locks */
+ /*
+ Structure is now initialized. Try to get the lock.
+ Set up control struct to allow others to abort locks.
+ */
thd->proc_info="User lock";
thd->mysys_var->current_mutex= &LOCK_user_locks;
thd->mysys_var->current_cond= &ull->cond;
@@ -1672,10 +1763,11 @@ longlong Item_func_get_lock::val_int()
/*
-** Release a user level lock.
-** Returns 1 if lock released
-** 0 if lock wasn't held
-** NULL if no such lock
+ Release a user level lock.
+ Return:
+ 1 if lock released
+ 0 if lock wasn't held
+ (SQL) NULL if no such lock
*/
longlong Item_func_release_lock::val_int()
@@ -1744,6 +1836,7 @@ longlong Item_func_benchmark::val_int()
return 0;
}
+
#define extra_size sizeof(double)
static user_var_entry *get_variable(HASH *hash, LEX_STRING &name,
@@ -1782,7 +1875,7 @@ bool Item_func_set_user_var::fix_fields(THD *thd, TABLE_LIST *tables,
Item **ref)
{
if (!thd)
- thd=current_thd;
+ thd=current_thd; // Should never happen
if (Item_func::fix_fields(thd, tables, ref) ||
!(entry= get_variable(&thd->user_vars, name, 1)))
return 1;
@@ -2008,6 +2101,7 @@ void Item_func_get_user_var::print(String *str)
str->append(')');
}
+
bool Item_func_get_user_var::eq(const Item *item, bool binary_cmp) const
{
/* Assume we don't have rtti */
@@ -2067,6 +2161,7 @@ err:
return 0;
}
+
void Item_func_match::init_search(bool no_order)
{
if (ft_handler)
@@ -2086,14 +2181,14 @@ void Item_func_match::init_search(bool no_order)
return;
}
- String *ft_tmp=0;
+ String *ft_tmp= 0;
char tmp1[FT_QUERY_MAXLEN];
String tmp2(tmp1,sizeof(tmp1),default_charset_info);
// MATCH ... AGAINST (NULL) is meaningless, but possible
if (!(ft_tmp=key_item()->val_str(&tmp2)))
{
- ft_tmp=&tmp2;
+ ft_tmp= &tmp2;
tmp2.set("",0,default_charset_info);
}
@@ -2109,6 +2204,7 @@ void Item_func_match::init_search(bool no_order)
}
}
+
bool Item_func_match::fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref)
{
List_iterator<Item> li(fields);
@@ -2117,10 +2213,11 @@ bool Item_func_match::fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref)
maybe_null=1;
join_key=0;
- /* const_item is assumed in quite a bit of places, so it would be difficult
- to remove; If it would ever to be removed, this should include
- modifications to find_best and auto_close as complement to auto_init code
- above.
+ /*
+ const_item is assumed in quite a bit of places, so it would be difficult
+ to remove; If it would ever to be removed, this should include
+ modifications to find_best and auto_close as complement to auto_init code
+ above.
*/
if (Item_func::fix_fields(thd, tlist, ref) || !const_item())
{
@@ -2140,7 +2237,7 @@ bool Item_func_match::fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref)
}
/* check that all columns come from the same table */
if (count_bits(used_tables_cache) != 1)
- key=NO_SUCH_KEY;
+ key=NO_SUCH_KEY;
const_item_cache=0;
table=((Item_field *)fields.head())->field->table;
table->fulltext_searched=1;
@@ -2154,6 +2251,7 @@ bool Item_func_match::fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref)
return 0;
}
+
bool Item_func_match::fix_index()
{
List_iterator_fast<Item> li(fields);
@@ -2230,16 +2328,15 @@ err:
return 0;
}
my_printf_error(ER_FT_MATCHING_KEY_NOT_FOUND,
- ER(ER_FT_MATCHING_KEY_NOT_FOUND),MYF(0));
+ ER(ER_FT_MATCHING_KEY_NOT_FOUND),MYF(0));
return 1;
}
+
bool Item_func_match::eq(const Item *item, bool binary_cmp) const
{
- if (item->type() != FUNC_ITEM)
- return 0;
-
- if (func_name() != ((Item_func*)item)->func_name())
+ if (item->type() != FUNC_ITEM ||
+ func_name() != ((Item_func*)item)->func_name())
return 0;
Item_func_match *ifm=(Item_func_match*) item;
@@ -2251,6 +2348,7 @@ bool Item_func_match::eq(const Item *item, bool binary_cmp) const
return 0;
}
+
double Item_func_match::val()
{
if (ft_handler == NULL)
@@ -2260,14 +2358,13 @@ double Item_func_match::val()
{
if (table->file->ft_handler)
return ft_handler->please->get_relevance(ft_handler);
-
join_key=0;
}
if (key == NO_SUCH_KEY)
{
- String *a=concat->val_str(&value);
- if ((null_value= (a==0)))
+ String *a= concat->val_str(&value);
+ if ((null_value= (a == 0)))
return 0;
return ft_handler->please->find_relevance(ft_handler,
(byte *)a->ptr(), a->length());
@@ -2276,26 +2373,86 @@ double Item_func_match::val()
return ft_handler->please->find_relevance(ft_handler, record, 0);
}
+
+longlong Item_func_bit_xor::val_int()
+{
+ ulonglong arg1= (ulonglong) args[0]->val_int();
+ ulonglong arg2= (ulonglong) args[1]->val_int();
+ if ((null_value= (args[0]->null_value || args[1]->null_value)))
+ return 0;
+ return (longlong) (arg1 ^ arg2);
+}
+
+
/***************************************************************************
System variables
- This has to be recoded after we get more than 3 system variables
****************************************************************************/
-Item *get_system_var(LEX_STRING name)
+Item *get_system_var(enum_var_type var_type, LEX_STRING name)
{
- if (!my_strcasecmp(system_charset_info, name.str, "IDENTITY"))
- return new Item_int((char*) "@@IDENTITY",
- current_thd->insert_id(),21);
- if (!my_strcasecmp(system_charset_info, name.str, "VERSION"))
+ if (!my_strcasecmp(name.str,"VERSION"))
return new Item_string("@@VERSION",server_version,
- (uint) strlen(server_version), system_charset_info);
- net_printf(&current_thd->net, ER_UNKNOWN_SYSTEM_VARIABLE, name.str);
+ (uint) strlen(server_version));
+
+ THD *thd=current_thd;
+ Item *item;
+ sys_var *var;
+ char buff[MAX_SYS_VAR_LENGTH+3];
+
+ if (!(var= find_sys_var(name.str)))
+ {
+ net_printf(&thd->net, ER_UNKNOWN_SYSTEM_VARIABLE, name.str);
+ return 0;
+ }
+ if (!(item=var->item(thd, var_type)))
+ return 0; // Impossible
+ thd->safe_to_cache_query=0;
+ buff[0]='@';
+ buff[1]='@';
+ memcpy(buff+2, var->name, var->name_length+1);
+ item->set_name(buff,var->name_length+2); // Will allocate name
+ return item;
+}
+
+
+/*
+ Check a user level lock.
+
+ SYNOPSIS:
+ val_int()
+
+ RETURN VALUES
+ 1 Available
+ 0 Already taken
+ NULL Error
+*/
+
+longlong Item_func_is_free_lock::val_int()
+{
+ String *res=args[0]->val_str(&value);
+ THD *thd=current_thd;
+ ULL *ull;
+ int error=0;
+
+ null_value=0;
+ if (!res || !res->length())
+ {
+ null_value=1;
+ return 0;
+ }
+
+ pthread_mutex_lock(&LOCK_user_locks);
+ ull= (ULL*) hash_search(&hash_user_locks,(byte*) res->ptr(),
+ res->length());
+ pthread_mutex_unlock(&LOCK_user_locks);
+ if (!ull || !ull->locked)
+ return 1;
return 0;
}
/**************************************************************************
-Spatial functions
+ Spatial functions
***************************************************************************/
longlong Item_func_dimension::val_int()
@@ -2319,7 +2476,6 @@ longlong Item_func_numinteriorring::val_int()
Geometry geom;
null_value= (!wkb ||
- args[0]->null_value ||
geom.create_from_wkb(wkb->ptr(),wkb->length()) ||
!GEOM_METHOD_PRESENT(geom,num_interior_ring) ||
geom.num_interior_ring(&num));
@@ -2329,12 +2485,11 @@ longlong Item_func_numinteriorring::val_int()
longlong Item_func_numgeometries::val_int()
{
- uint32 num;
+ uint32 num=0;
String *wkb=args[0]->val_str(&value);
Geometry geom;
null_value= (!wkb ||
- args[0]->null_value ||
geom.create_from_wkb(wkb->ptr(),wkb->length()) ||
!GEOM_METHOD_PRESENT(geom,num_geometries) ||
geom.num_geometries(&num));
@@ -2344,7 +2499,7 @@ longlong Item_func_numgeometries::val_int()
longlong Item_func_numpoints::val_int()
{
- uint32 num;
+ uint32 num=0;
String *wkb=args[0]->val_str(&value);
Geometry geom;
@@ -2360,12 +2515,11 @@ longlong Item_func_numpoints::val_int()
double Item_func_x::val()
{
- double res;
+ double res=0;
String *wkb=args[0]->val_str(&value);
Geometry geom;
null_value= (!wkb ||
- args[0]->null_value ||
geom.create_from_wkb(wkb->ptr(),wkb->length()) ||
!GEOM_METHOD_PRESENT(geom,get_x) ||
geom.get_x(&res));
@@ -2376,12 +2530,11 @@ double Item_func_x::val()
double Item_func_y::val()
{
- double res;
+ double res=0;
String *wkb=args[0]->val_str(&value);
Geometry geom;
null_value= (!wkb ||
- args[0]->null_value ||
geom.create_from_wkb(wkb->ptr(),wkb->length()) ||
!GEOM_METHOD_PRESENT(geom,get_y) ||
geom.get_y(&res));
@@ -2392,12 +2545,11 @@ double Item_func_y::val()
double Item_func_area::val()
{
- double res;
+ double res=0;
String *wkb=args[0]->val_str(&value);
Geometry geom;
null_value= (!wkb ||
- args[0]->null_value ||
geom.create_from_wkb(wkb->ptr(),wkb->length()) ||
!GEOM_METHOD_PRESENT(geom,area) ||
geom.area(&res));
@@ -2408,12 +2560,11 @@ double Item_func_area::val()
double Item_func_glength::val()
{
- double res;
+ double res=0;
String *wkb=args[0]->val_str(&value);
Geometry geom;
null_value= (!wkb ||
- args[0]->null_value ||
geom.create_from_wkb(wkb->ptr(),wkb->length()) ||
!GEOM_METHOD_PRESENT(geom,length) ||
geom.length(&res));
diff --git a/sql/item_func.h b/sql/item_func.h
index 2e61ed87c3c..45427bec017 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -39,7 +39,8 @@ public:
enum Functype { UNKNOWN_FUNC,EQ_FUNC,EQUAL_FUNC,NE_FUNC,LT_FUNC,LE_FUNC,
GE_FUNC,GT_FUNC,FT_FUNC,
LIKE_FUNC,NOTLIKE_FUNC,ISNULL_FUNC,ISNOTNULL_FUNC,
- COND_AND_FUNC,COND_OR_FUNC,BETWEEN,IN_FUNC,INTERVAL_FUNC,
+ COND_AND_FUNC, COND_OR_FUNC, CONX_XOR_FUNC, BETWEEN, IN_FUNC,
+ INTERVAL_FUNC,
SP_EQUALS_FUNC, SP_DISJOINT_FUNC,SP_INTERSECTS_FUNC,
SP_TOUCHES_FUNC,SP_CROSSES_FUNC,SP_WITHIN_FUNC,
SP_CONTAINS_FUNC,SP_OVERLAPS_FUNC,
@@ -126,6 +127,7 @@ public:
}
bool is_null() { (void) val_int(); return null_value; }
friend class udf_handler;
+ Field *tmp_table_field(TABLE *t_arg);
};
@@ -140,13 +142,9 @@ public:
longlong val_int() { return (longlong) val(); }
enum Item_result result_type () const { return REAL_RESULT; }
void fix_length_and_dec() { decimals=NOT_FIXED_DEC; max_length=float_length(decimals); }
- Field *tmp_table_field(TABLE *t_arg)
- {
- if (!t_arg) return result_field;
- return new Field_double(max_length, maybe_null, name,t_arg,decimals);
- }
};
+
class Item_num_func :public Item_func
{
protected:
@@ -174,11 +172,6 @@ class Item_num_op :public Item_func
void fix_length_and_dec() { fix_num_length_and_dec(); find_num_type(); }
void find_num_type(void);
bool is_null() { (void) val(); return null_value; }
- Field *tmp_table_field(TABLE *t_arg)
- {
- if (!t_arg) return result_field;
- return args[0]->result_type() == INT_RESULT ? ((max_length > 11) ? (Field *)new Field_longlong(max_length,maybe_null,name, t_arg,unsigned_flag) : (Field *)new Field_long(max_length,maybe_null,name, t_arg,unsigned_flag)) : (Field *) new Field_double(max_length, maybe_null, name,t_arg,decimals);
- }
};
@@ -194,13 +187,9 @@ public:
String *val_str(String*str);
enum Item_result result_type () const { return INT_RESULT; }
void fix_length_and_dec() {}
- Field *tmp_table_field(TABLE *t_arg)
- {
- if (!t_arg) return result_field;
- return (max_length > 11) ? (Field *)new Field_longlong(max_length,maybe_null,name, t_arg,unsigned_flag) : (Field *)new Field_long(max_length,maybe_null,name, t_arg,unsigned_flag);
- }
};
+
class Item_func_signed :public Item_int_func
{
public:
@@ -211,6 +200,7 @@ public:
{ max_length=args[0]->max_length; unsigned_flag=0; }
};
+
class Item_func_unsigned :public Item_int_func
{
public:
@@ -330,15 +320,35 @@ public:
const char *func_name() const { return "exp"; }
};
+
+class Item_func_ln :public Item_dec_func
+{
+public:
+ Item_func_ln(Item *a) :Item_dec_func(a) {}
+ double val();
+ const char *func_name() const { return "ln"; }
+};
+
+
class Item_func_log :public Item_dec_func
{
public:
Item_func_log(Item *a) :Item_dec_func(a) {}
+ Item_func_log(Item *a,Item *b) :Item_dec_func(a,b) {}
double val();
const char *func_name() const { return "log"; }
};
+class Item_func_log2 :public Item_dec_func
+{
+public:
+ Item_func_log2(Item *a) :Item_dec_func(a) {}
+ double val();
+ const char *func_name() const { return "log2"; }
+};
+
+
class Item_func_log10 :public Item_dec_func
{
public:
@@ -937,7 +947,8 @@ public:
Item_func_match(List<Item> &a, Item *b): Item_real_func(b),
fields(a), table(0), master(0), ft_handler(0),
- concat(0), key(0), join_key(0) {}
+ concat(0), key(0), join_key(0)
+ {}
~Item_func_match()
{
if (!master && ft_handler)
@@ -948,7 +959,8 @@ public:
table->file->ft_handler=0;
table->fulltext_searched=0;
}
- if (concat) delete concat;
+ if (concat)
+ delete concat;
}
enum Functype functype() const { return FT_FUNC; }
void update_used_tables() {}
@@ -1003,6 +1015,7 @@ public:
void fix_length_and_dec() { max_length=10; }
};
+
class Item_func_numinteriorring :public Item_int_func
{
String value;
@@ -1013,6 +1026,7 @@ public:
void fix_length_and_dec() { max_length=10; }
};
+
class Item_func_numpoints :public Item_int_func
{
String value;
@@ -1023,6 +1037,7 @@ public:
void fix_length_and_dec() { max_length=10; }
};
+
class Item_func_area :public Item_real_func
{
String value;
@@ -1032,6 +1047,7 @@ public:
const char *func_name() const { return "area"; }
};
+
class Item_func_glength :public Item_real_func
{
String value;
@@ -1041,22 +1057,46 @@ public:
const char *func_name() const { return "glength"; }
};
+
class Item_func_match_nl :public Item_func_match
{
public:
- Item_func_match_nl(List<Item> &a, Item *b):
- Item_func_match(a,b) { mode=FT_NL; }
+ Item_func_match_nl(List<Item> &a, Item *b)
+ :Item_func_match(a,b)
+ { mode=FT_NL; }
const char *func_name() const { return "match_nl"; }
};
+
class Item_func_match_bool :public Item_func_match
{
public:
- Item_func_match_bool(List<Item> &a, Item *b):
- Item_func_match(a,b) { mode=FT_BOOL; }
+ Item_func_match_bool(List<Item> &a, Item *b)
+ :Item_func_match(a,b)
+ { mode=FT_BOOL; }
const char *func_name() const { return "match_bool"; }
};
+
+class Item_func_bit_xor : public Item_int_func
+{
+public:
+ Item_func_bit_xor(Item *a,Item *b) :Item_int_func(a,b) {}
+ longlong val_int();
+ const char *func_name() const { return "^"; }
+ void fix_length_xor_dec() { unsigned_flag=1; }
+};
+
+class Item_func_is_free_lock :public Item_int_func
+{
+ String value;
+public:
+ Item_func_is_free_lock(Item *a) :Item_int_func(a) {}
+ longlong val_int();
+ const char *func_name() const { return "check_lock"; }
+ void fix_length_and_dec() { decimals=0; max_length=1; maybe_null=1;}
+};
+
/* For type casts */
enum Item_cast
@@ -1064,5 +1104,3 @@ enum Item_cast
ITEM_CAST_BINARY, ITEM_CAST_SIGNED_INT, ITEM_CAST_UNSIGNED_INT,
ITEM_CAST_DATE, ITEM_CAST_TIME, ITEM_CAST_DATETIME
};
-
-Item *create_func_cast(Item *a, Item_cast cast_type);
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index dc9d57b1d9d..2bc9b170fc1 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -34,6 +34,8 @@
#include <openssl/des.h>
#endif /* HAVE_OPENSSL */
#include "md5.h"
+#include "sha1.h"
+#include "my_aes.h"
String empty_string("",default_charset_info);
@@ -42,7 +44,7 @@ uint nr_of_decimals(const char *str)
if ((str=strchr(str,'.')))
{
const char *start= ++str;
- for ( ; my_isdigit(system_charset_info,*str) ; str++) ;
+ for (; my_isdigit(system_charset_info,*str) ; str++) ;
return (uint) (str-start);
}
return 0;
@@ -99,10 +101,117 @@ void Item_func_md5::fix_length_and_dec()
max_length=32;
}
+
+String *Item_func_sha::val_str(String *str)
+{
+ String * sptr= args[0]->val_str(str);
+ if (sptr) /* If we got value different from NULL */
+ {
+ SHA1_CONTEXT context; /* Context used to generate SHA1 hash */
+ /* Temporary buffer to store 160bit digest */
+ uint8 digest[SHA1_HASH_SIZE];
+ sha1_reset(&context); /* We do not have to check for error here */
+ /* No need to check error as the only case would be too long message */
+ sha1_input(&context,(const unsigned char *) sptr->ptr(), sptr->length());
+ /* Ensure that memory is free and we got result */
+ if ( !( str->alloc(SHA1_HASH_SIZE*2) || (sha1_result(&context,digest)) ) )
+ {
+ sprintf((char *) str->ptr(),
+ "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\
+%02x%02x%02x%02x%02x%02x%02x%02x",
+ digest[0], digest[1], digest[2], digest[3],
+ digest[4], digest[5], digest[6], digest[7],
+ digest[8], digest[9], digest[10], digest[11],
+ digest[12], digest[13], digest[14], digest[15],
+ digest[16], digest[17], digest[18], digest[19]);
+
+ str->length((uint) SHA1_HASH_SIZE*2);
+ null_value=0;
+ return str;
+ }
+ }
+ null_value=1;
+ return 0;
+}
+
+void Item_func_sha::fix_length_and_dec()
+{
+ max_length=SHA1_HASH_SIZE*2; // size of hex representation of hash
+}
+
+
+/* Implementation of AES encryption routines */
+
+String *Item_func_aes_encrypt::val_str(String *str)
+{
+ String * sptr = args[0]->val_str(str); // String to encrypt
+ String tmp_value; // required to handle second parameter
+ String * key= args[1]->val_str(&tmp_value); // key
+ int aes_length;
+ if (sptr && key) // we need both arguments to be not NULL
+ {
+ null_value=0;
+ aes_length=my_aes_get_size(sptr->length()); // calculate result length
+
+ if (!str->alloc(aes_length)) // Ensure that memory is free
+ {
+ // finally encrypt directly to allocated buffer.
+ if (my_aes_encrypt(sptr->ptr(),sptr->length(), (char*) str->ptr(),
+ key->ptr(), key->length()) == aes_length)
+ {
+ // We got the expected result length
+ str->length((uint) aes_length);
+ return str;
+ }
+ }
+ }
+ null_value=1;
+ return 0;
+}
+
+
+void Item_func_aes_encrypt::fix_length_and_dec()
+{
+ max_length=my_aes_get_size(args[0]->max_length);
+}
+
+
+String *Item_func_aes_decrypt::val_str(String *str)
+{
+ String * sptr= args[0]->val_str(str); // String to decrypt
+ String tmp_value; // temporary string required for parsing
+ String * key= args[1]->val_str(&tmp_value); // key
+ int length; // original length after decrypt
+ if (sptr && key) // Need to have both arguments not NULL
+ {
+ null_value=0;
+ if (!str->alloc(sptr->length())) // Ensure that memory is free
+ {
+ // finally decrypt directly to allocated buffer.
+ length=my_aes_decrypt(sptr->ptr(), sptr->length(), (char*) str->ptr(),
+ key->ptr(), key->length());
+ if (length >= 0) // if we got correct data data
+ {
+ str->length((uint) length);
+ return str;
+ }
+ }
+ }
+ // Bad parameters. No memory or bad data will all go here
+ null_value=1;
+ return 0;
+}
+
+void Item_func_aes_decrypt::fix_length_and_dec()
+{
+ max_length=args[0]->max_length;
+}
+
+
/*
-** Concatinate args with the following premissess
-** If only one arg which is ok, return value of arg
-** Don't reallocate val_str() if not absolute necessary.
+ Concatenate args with the following premises:
+ If only one arg (which is ok), return value of arg
+ Don't reallocate val_str() if not absolute necessary.
*/
String *Item_func_concat::val_str(String *str)
@@ -127,7 +236,8 @@ String *Item_func_concat::val_str(String *str)
goto null;
if (res2->length() == 0)
continue;
- if (res->length()+res2->length() > max_allowed_packet)
+ if (res->length()+res2->length() >
+ current_thd->variables.max_allowed_packet)
goto null; // Error check
if (res->alloced_length() >= res->length()+res2->length())
{ // Use old buffer
@@ -208,8 +318,7 @@ void Item_func_concat::fix_length_and_dec()
/*
Function des_encrypt() by tonu@spam.ee & monty
Works only if compiled with OpenSSL library support.
- This returns a binary string where first character is
- CHAR(128 | key-number).
+ This returns a binary string where first character is CHAR(128 | key-number).
If one uses a string key key_number is 127.
Encryption result is longer than original by formula:
new_length= org_length + (8-(org_length % 8))+1
@@ -317,7 +426,7 @@ String *Item_func_des_decrypt::val_str(String *str)
{
uint key_number=(uint) (*res)[0] & 127;
// Check if automatic key and that we have privilege to uncompress using it
- if (!(current_thd->master_access & PROCESS_ACL) || key_number > 9)
+ if (!(current_thd->master_access & SUPER_ACL) || key_number > 9)
goto error;
VOID(pthread_mutex_lock(&LOCK_des_key_file));
keyschedule= des_keyschedule[key_number];
@@ -397,7 +506,7 @@ String *Item_func_concat_ws::val_str(String *str)
continue; // Skip NULL and empty string
if (res->length() + sep_str->length() + res2->length() >
- max_allowed_packet)
+ current_thd->variables.max_allowed_packet)
goto null; // Error check
if (res->alloced_length() >=
res->length() + sep_str->length() + res2->length())
@@ -609,7 +718,8 @@ redo:
while (j != search_end)
if (*i++ != *j++) goto skipp;
offset= (int) (ptr-res->ptr());
- if (res->length()-from_length + to_length > max_allowed_packet)
+ if (res->length()-from_length + to_length >
+ current_thd->variables.max_allowed_packet)
goto null;
if (!alloced)
{
@@ -629,7 +739,8 @@ skipp:
#endif /* USE_MB */
do
{
- if (res->length()-from_length + to_length > max_allowed_packet)
+ if (res->length()-from_length + to_length >
+ current_thd->variables.max_allowed_packet)
goto null;
if (!alloced)
{
@@ -689,7 +800,8 @@ String *Item_func_insert::val_str(String *str)
return res; // Wrong param; skip insert
if (length > res->length()-start)
length=res->length()-start;
- if (res->length() - length + res2->length() > max_allowed_packet)
+ if (res->length() - length + res2->length() >
+ current_thd->variables.max_allowed_packet)
goto null; // OOM check
res=copy_if_not_alloced(str,res,res->length());
res->replace(start,length,*res2);
@@ -1595,7 +1707,8 @@ String *Item_func_repeat::val_str(String *str)
if (count == 1) // To avoid reallocs
return res;
length=res->length();
- if (length > max_allowed_packet/count)// Safe length check
+ // Safe length check
+ if (length > current_thd->variables.max_allowed_packet/count)
goto err; // Probably an error
tot_length= length*(uint) count;
if (!(res= alloc_buffer(res,str,&tmp_value,tot_length)))
@@ -1653,7 +1766,8 @@ String *Item_func_rpad::val_str(String *str)
return (res);
}
length_pad= rpad->length();
- if ((ulong) count > max_allowed_packet || args[2]->null_value || !length_pad)
+ if ((ulong) count > current_thd->variables.max_allowed_packet ||
+ args[2]->null_value || !length_pad)
goto err;
if (!(res= alloc_buffer(res,str,&tmp_value,count)))
goto err;
@@ -1712,7 +1826,8 @@ String *Item_func_lpad::val_str(String *str)
return (res);
}
length_pad= lpad->length();
- if (count > max_allowed_packet || args[2]->null_value || !length_pad)
+ if (count > current_thd->variables.max_allowed_packet ||
+ args[2]->null_value || !length_pad)
goto err;
if (res->alloced_length() < count)
@@ -2055,7 +2170,7 @@ String *Item_load_file::val_str(String *str)
/* my_error(ER_TEXTFILE_NOT_READABLE, MYF(0), file_name->c_ptr()); */
goto err;
}
- if (stat_info.st_size > (long) max_allowed_packet)
+ if (stat_info.st_size > (long) current_thd->variables.max_allowed_packet)
{
/* my_error(ER_TOO_LONG_STRING, MYF(0), file_name->c_ptr()); */
goto err;
@@ -2129,7 +2244,7 @@ String* Item_func_export_set::val_str(String* str)
str->append(*yes);
else
str->append(*no);
- if(i != num_set_values - 1)
+ if (i != num_set_values - 1)
str->append(*sep);
}
return str;
@@ -2182,6 +2297,99 @@ String* Item_func_inet_ntoa::val_str(String* str)
return str;
}
+
+/*
+ QUOTE() function returns argument string in single quotes suitable for
+ using in a SQL statement.
+
+ DESCRIPTION
+ Adds a \ before all characters that needs to be escaped in a SQL string.
+ We also escape '^Z' (END-OF-FILE in windows) to avoid probelms when
+ running commands from a file in windows.
+
+ This function is very useful when you want to generate SQL statements
+
+ RETURN VALUES
+ str Quoted string
+ NULL Argument to QUOTE() was NULL or out of memory.
+*/
+
+#define get_esc_bit(mask, num) (1 & (*((mask) + ((num) >> 3))) >> ((num) & 7))
+
+String *Item_func_quote::val_str(String *str)
+{
+ /*
+ Bit mask that has 1 for set for the position of the following characters:
+ 0, \, ' and ^Z
+ */
+
+ static char escmask[32]=
+ {
+ 0x01, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ };
+
+ char *from, *to, *end, *start;
+ String *arg= args[0]->val_str(str);
+ uint arg_length, new_length;
+ if (!arg) // Null argument
+ goto null;
+ arg_length= arg->length();
+ new_length= arg_length+2; /* for beginning and ending ' signs */
+
+ for (from= (char*) arg->ptr(), end= from + arg_length; from < end; from++)
+ new_length+= get_esc_bit(escmask, *from);
+
+ /*
+ We have to use realloc() instead of alloc() as we want to keep the
+ old result in str
+ */
+ if (str->realloc(new_length))
+ goto null;
+
+ /*
+ As 'arg' and 'str' may be the same string, we must replace characters
+ from the end to the beginning
+ */
+ to= (char*) str->ptr() + new_length - 1;
+ *to--= '\'';
+ for (start= (char*) arg->ptr() ; end-- != start; to--)
+ {
+ /*
+ We can't use the bitmask here as we want to replace \O and ^Z with 0
+ and Z
+ */
+ switch (*end) {
+ case 0:
+ *to--= '0';
+ *to= '\\';
+ break;
+ case '\032':
+ *to--= 'Z';
+ *to= '\\';
+ break;
+ case '\'':
+ case '\\':
+ *to--= *end;
+ *to= '\\';
+ break;
+ default:
+ *to= *end;
+ break;
+ }
+ }
+ *to= '\'';
+ str->length(new_length);
+ return str;
+
+null:
+ null_value= 1;
+ return 0;
+}
+
+
/*******************************************************
General functions for spatial objects
********************************************************/
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 997d9c8d834..4ac1b118863 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -35,16 +35,6 @@ public:
double val();
enum Item_result result_type () const { return STRING_RESULT; }
void left_right_max_length();
- Field *tmp_table_field(TABLE *t_arg)
- {
- if (!t_arg)
- return result_field;
- return (max_length > 255) ?
- (Field *)new Field_blob(max_length,maybe_null, name,t_arg, binary,
- str_value.charset()) :
- (Field *) new Field_string(max_length,maybe_null, name,t_arg, binary,
- str_value.charset());
- }
};
class Item_func_md5 :public Item_str_func
@@ -57,6 +47,35 @@ public:
const char *func_name() const { return "md5"; }
};
+
+class Item_func_sha :public Item_str_func
+{
+public:
+ Item_func_sha(Item *a) :Item_str_func(a) {}
+ String *val_str(String *);
+ void fix_length_and_dec();
+ const char *func_name() const { return "sha"; }
+};
+
+class Item_func_aes_encrypt :public Item_str_func
+{
+public:
+ Item_func_aes_encrypt(Item *a, Item *b) :Item_str_func(a,b) {}
+ String *val_str(String *);
+ void fix_length_and_dec();
+ const char *func_name() const { return "aes_encrypt"; }
+};
+
+class Item_func_aes_decrypt :public Item_str_func
+{
+public:
+ Item_func_aes_decrypt(Item *a, Item *b) :Item_str_func(a,b) {}
+ String *val_str(String *);
+ void fix_length_and_dec();
+ const char *func_name() const { return "aes_decrypt"; }
+};
+
+
class Item_func_concat :public Item_str_func
{
String tmp_value;
@@ -483,6 +502,15 @@ public:
void fix_length_and_dec() { decimals = 0; max_length=3*8+7; }
};
+class Item_func_quote :public Item_str_func
+{
+public:
+ Item_func_quote(Item *a) :Item_str_func(a) {}
+ const char *func_name() const { return "quote"; }
+ String *val_str(String *);
+ void fix_length_and_dec() { max_length= args[0]->max_length * 2 + 2; }
+};
+
class Item_func_conv_charset :public Item_str_func
{
CHARSET_INFO *conv_charset;
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 809dd65d52b..93ced79005f 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1045,7 +1045,8 @@ bool Item_sum_count_distinct::setup(THD *thd)
}
}
- init_tree(&tree, min(max_heap_table_size, sortbuff_size/16), 0,
+ init_tree(&tree, min(thd->variables.max_heap_table_size,
+ thd->variables.sortbuff_size/16), 0,
key_length, compare_key, 0, NULL, cmp_arg);
use_tree = 1;
@@ -1055,8 +1056,8 @@ bool Item_sum_count_distinct::setup(THD *thd)
but this has to be handled - otherwise someone can crash
the server with a DoS attack
*/
- max_elements_in_tree = ((key_length) ? max_heap_table_size/key_length :
- 1);
+ max_elements_in_tree = ((key_length) ?
+ thd->variables.max_heap_table_size/key_length : 1);
}
return 0;
}
@@ -1107,7 +1108,7 @@ bool Item_sum_count_distinct::add()
*/
if (tree.elements_in_tree > max_elements_in_tree)
{
- if(tree_to_myisam())
+ if (tree_to_myisam())
return 1;
}
else if (!tree_insert(&tree, table->record[0] + rec_offset, 0, tree.custom_arg))
diff --git a/sql/item_sum.h b/sql/item_sum.h
index 3e67f1e3624..3c86370c189 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -70,6 +70,7 @@ public:
void print(String *str);
void fix_num_length_and_dec();
virtual bool setup(THD *thd) {return 0;}
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -84,6 +85,7 @@ public:
longlong val_int() { return (longlong) val(); } /* Real as default */
String *val_str(String*str);
void reset_field();
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -98,6 +100,7 @@ public:
double val() { return (double) val_int(); }
String *val_str(String*str);
enum Item_result result_type () const { return INT_RESULT; }
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -115,6 +118,7 @@ class Item_sum_sum :public Item_sum_num
void reset_field();
void update_field(int offset);
const char *func_name() const { return "sum"; }
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -137,6 +141,7 @@ class Item_sum_count :public Item_sum_int
void reset_field();
void update_field(int offset);
const char *func_name() const { return "count"; }
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -188,6 +193,7 @@ class Item_sum_count_distinct :public Item_sum_int
void update_field(int offset) { return ; } // Never called
const char *func_name() const { return "count_distinct"; }
bool setup(THD *thd);
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -207,6 +213,7 @@ public:
String *val_str(String*);
void make_field(Send_field *field);
void fix_length_and_dec() {}
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -228,6 +235,7 @@ class Item_sum_avg :public Item_sum_num
Item *result_item(Field *field)
{ return new Item_avg_field(this); }
const char *func_name() const { return "avg"; }
+ unsigned int size_of() { return sizeof(*this);}
};
class Item_sum_std;
@@ -244,6 +252,7 @@ public:
bool is_null() { (void) val_int(); return null_value; }
void make_field(Send_field *field);
void fix_length_and_dec() {}
+ unsigned int size_of() { return sizeof(*this);}
};
class Item_sum_std :public Item_sum_num
@@ -264,6 +273,7 @@ class Item_sum_std :public Item_sum_num
Item *result_item(Field *field)
{ return new Item_std_field(this); }
const char *func_name() const { return "std"; }
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -306,6 +316,7 @@ class Item_sum_hybrid :public Item_sum
void min_max_update_str_field(int offset);
void min_max_update_real_field(int offset);
void min_max_update_int_field(int offset);
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -317,6 +328,7 @@ public:
bool add();
const char *func_name() const { return "min"; }
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -328,6 +340,7 @@ public:
bool add();
const char *func_name() const { return "max"; }
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -343,6 +356,7 @@ class Item_sum_bit :public Item_sum_int
void reset();
longlong val_int();
void reset_field();
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -353,6 +367,7 @@ class Item_sum_or :public Item_sum_bit
bool add();
void update_field(int offset);
const char *func_name() const { return "bit_or"; }
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -363,6 +378,7 @@ class Item_sum_and :public Item_sum_bit
bool add();
void update_field(int offset);
const char *func_name() const { return "bit_and"; }
+ unsigned int size_of() { return sizeof(*this);}
};
/*
@@ -393,6 +409,7 @@ public:
bool add();
void reset_field() {};
void update_field(int offset_arg) {};
+ unsigned int size_of() { return sizeof(*this);}
};
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 297ff30bd9c..566097893a8 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -703,7 +703,7 @@ String *Item_func_date_format::val_str(String *str)
/* Create the result string */
const char *ptr=format->ptr();
const char *end=ptr+format->length();
- for ( ; ptr != end ; ptr++)
+ for (; ptr != end ; ptr++)
{
if (*ptr != '%' || ptr+1 == end)
str->append(*ptr);
@@ -711,7 +711,7 @@ String *Item_func_date_format::val_str(String *str)
{
switch (*++ptr) {
case 'M':
- if(!l_time.month)
+ if (!l_time.month)
{
null_value=1;
return 0;
@@ -719,7 +719,7 @@ String *Item_func_date_format::val_str(String *str)
str->append(month_names[l_time.month-1]);
break;
case 'b':
- if(!l_time.month)
+ if (!l_time.month)
{
null_value=1;
return 0;
@@ -727,7 +727,7 @@ String *Item_func_date_format::val_str(String *str)
str->append(month_names[l_time.month-1].ptr(),3);
break;
case 'W':
- if(date_or_time)
+ if (date_or_time)
{
null_value=1;
return 0;
@@ -736,7 +736,7 @@ String *Item_func_date_format::val_str(String *str)
str->append(day_names[weekday]);
break;
case 'a':
- if(date_or_time)
+ if (date_or_time)
{
null_value=1;
return 0;
@@ -745,7 +745,7 @@ String *Item_func_date_format::val_str(String *str)
str->append(day_names[weekday].ptr(),3);
break;
case 'D':
- if(date_or_time)
+ if (date_or_time)
{
null_value=1;
return 0;
@@ -811,7 +811,7 @@ String *Item_func_date_format::val_str(String *str)
str->append(intbuff);
break;
case 'j':
- if(date_or_time)
+ if (date_or_time)
{
null_value=1;
return 0;
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 6d016df6eb7..a45ea159014 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -73,6 +73,7 @@ public:
void fix_length_and_dec() { decimals=0; max_length=2; maybe_null=1; }
};
+
class Item_func_monthname :public Item_func_month
{
public:
@@ -175,6 +176,7 @@ public:
const char *func_name() const { return "weekday"; }
enum Item_result result_type () const { return INT_RESULT; }
void fix_length_and_dec() { decimals=0; max_length=1; maybe_null=1; }
+ unsigned int size_of() { return sizeof(*this);}
};
class Item_func_dayname :public Item_func_weekday
@@ -200,6 +202,7 @@ public:
{
decimals=0; max_length=10;
}
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -235,9 +238,9 @@ public:
}
Field *tmp_table_field(TABLE *t_arg)
{
- if (!t_arg) return result_field;
- return new Field_date(maybe_null, name, t_arg);
+ return (!t_arg) ? result_field : new Field_date(maybe_null, name, t_arg);
}
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -253,9 +256,10 @@ public:
}
Field *tmp_table_field(TABLE *t_arg)
{
- if (!t_arg) return result_field;
- return new Field_datetime(maybe_null, name, t_arg);
- }
+ return (!t_arg) ? result_field : new Field_datetime(maybe_null, name,
+ t_arg);
+ }
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -280,9 +284,9 @@ public:
}
Field *tmp_table_field(TABLE *t_arg)
{
- if (!t_arg) return result_field;
- return new Field_time(maybe_null, name, t_arg);
+ return (!t_arg) ? result_field : new Field_time(maybe_null, name, t_arg);
}
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -296,6 +300,7 @@ public:
const char *func_name() const { return "curdate"; }
void fix_length_and_dec(); /* Retrieves curtime */
bool get_date(TIME *res,bool fuzzy_date);
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -317,6 +322,7 @@ public:
const char *func_name() const { return "now"; }
void fix_length_and_dec();
bool get_date(TIME *res,bool fuzzy_date);
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -341,6 +347,7 @@ public:
const char *func_name() const { return "date_format"; }
void fix_length_and_dec();
uint format_length(const String *format);
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -373,11 +380,11 @@ public:
}
Field *tmp_table_field(TABLE *t_arg)
{
- if (!t_arg) return result_field;
- return new Field_time(maybe_null, name, t_arg);
- }
+ return (!t_arg) ? result_field : new Field_time(maybe_null, name, t_arg);
+ }
};
+
enum interval_type { INTERVAL_YEAR, INTERVAL_MONTH, INTERVAL_DAY,
INTERVAL_HOUR, INTERVAL_MINUTE, INTERVAL_SECOND,
INTERVAL_YEAR_MONTH, INTERVAL_DAY_HOUR,
@@ -400,6 +407,7 @@ public:
double val() { return (double) val_int(); }
longlong val_int();
bool get_date(TIME *res,bool fuzzy_date);
+ unsigned int size_of() { return sizeof(*this);}
};
class Item_extract :public Item_int_func
@@ -413,6 +421,7 @@ class Item_extract :public Item_int_func
longlong val_int();
const char *func_name() const { return "extract"; }
void fix_length_and_dec();
+ unsigned int size_of() { return sizeof(*this);}
};
class Item_typecast :public Item_str_func
@@ -437,8 +446,7 @@ public:
}
Field *tmp_table_field(TABLE *t_arg)
{
- if (!t_arg) return result_field;
- return new Field_date(maybe_null, name, t_arg);
+ return (!t_arg) ? result_field : new Field_date(maybe_null, name, t_arg);
}
};
@@ -453,9 +461,8 @@ public:
}
Field *tmp_table_field(TABLE *t_arg)
{
- if (!t_arg) return result_field;
- return new Field_time(maybe_null, name, t_arg);
- }
+ return (!t_arg) ? result_field : new Field_time(maybe_null, name, t_arg);
+ }
};
class Item_datetime_typecast :public Item_typecast
@@ -469,7 +476,7 @@ public:
}
Field *tmp_table_field(TABLE *t_arg)
{
- if (!t_arg) return result_field;
- return new Field_datetime(maybe_null, name, t_arg);
- }
+ return (!t_arg) ? result_field : new Field_datetime(maybe_null, name,
+ t_arg);
+ }
};
diff --git a/sql/item_uniq.h b/sql/item_uniq.h
index e56632e7289..6ab01d55e2f 100644
--- a/sql/item_uniq.h
+++ b/sql/item_uniq.h
@@ -29,6 +29,7 @@ public:
:Item_real_func(list) {}
double val() { return 0.0; }
void fix_length_and_dec() { decimals=0; max_length=6; }
+ unsigned int size_of() { return sizeof(*this);}
};
class Item_sum_unique_users :public Item_sum_num
diff --git a/sql/key.cc b/sql/key.cc
index a5d3d0a65b9..fa09a0a6d44 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -59,7 +59,7 @@ int find_ref_key(TABLE *table,Field *field, uint *key_length)
{
if (key_part->offset == fieldpos)
return(i); /* Use this key */
- *key_length+=key_part->length;
+ *key_length+=key_part->store_length;
}
}
return(-1); /* No key is ok */
diff --git a/sql/lex.h b/sql/lex.h
index cd25c3883fe..83890e75c20 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000-2002 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,9 +30,9 @@
#endif
/*
-** Symbols are breaked in to separated arrays to allow fieldnames with
-** same name as functions
-** Theese are kept sorted for human lookup (the symbols are hashed)
+ Symbols are broken into separated arrays to allow field names with
+ same name as functions.
+ These are kept sorted for human lookup (the symbols are hashed).
*/
static SYMBOL symbols[] = {
@@ -61,7 +61,6 @@ static SYMBOL symbols[] = {
{ "AVG", SYM(AVG_SYM),0,0},
{ "AVG_ROW_LENGTH", SYM(AVG_ROW_LENGTH),0,0},
{ "AUTO_INCREMENT", SYM(AUTO_INC),0,0},
- { "AUTOCOMMIT", SYM(AUTOCOMMIT),0,0},
{ "BACKUP", SYM(BACKUP_SYM),0,0},
{ "BEGIN", SYM(BEGIN_SYM),0,0},
{ "BERKELEYDB", SYM(BERKELEY_DB_SYM),0,0},
@@ -88,6 +87,7 @@ static SYMBOL symbols[] = {
{ "CHECK", SYM(CHECK_SYM),0,0},
{ "CHECKSUM", SYM(CHECKSUM_SYM),0,0},
{ "CIPHER", SYM(CIPHER_SYM),0,0},
+ { "CLIENT", SYM(CLIENT_SYM),0,0},
{ "CLOSE", SYM(CLOSE_SYM),0,0},
{ "COLLATE", SYM(COLLATE_SYM),0,0},
{ "COLUMN", SYM(COLUMN_SYM),0,0},
@@ -100,6 +100,7 @@ static SYMBOL symbols[] = {
{ "CONSTRAINT", SYM(CONSTRAINT),0,0},
{ "CREATE", SYM(CREATE),0,0},
{ "CROSS", SYM(CROSS),0,0},
+ { "CUBE", SYM(CUBE_SYM),0,0},
{ "CURRENT_DATE", SYM(CURDATE),0,0},
{ "CURRENT_TIME", SYM(CURTIME),0,0},
{ "CURRENT_TIMESTAMP", SYM(NOW_SYM),0,0},
@@ -119,7 +120,6 @@ static SYMBOL symbols[] = {
{ "DELAYED", SYM(DELAYED_SYM),0,0},
{ "DELAY_KEY_WRITE", SYM(DELAY_KEY_WRITE_SYM),0,0},
{ "DELETE", SYM(DELETE_SYM),0,0},
- { "DEMAND", SYM(DEMAND_SYM),0,0},
{ "DESC", SYM(DESC),0,0},
{ "DESCRIBE", SYM(DESCRIBE),0,0},
{ "DIRECTORY", SYM(DIRECTORY_SYM),0,0},
@@ -140,6 +140,7 @@ static SYMBOL symbols[] = {
{ "ENCLOSED", SYM(ENCLOSED),0,0},
{ "ENUM", SYM(ENUM),0,0},
{ "EVENTS", SYM(EVENTS_SYM),0,0},
+ { "EXECUTE", SYM(EXECUTE_SYM),0,0},
{ "EXPLAIN", SYM(DESCRIBE),0,0},
{ "EXISTS", SYM(EXISTS),0,0},
{ "EXTENDED", SYM(EXTENDED_SYM),0,0},
@@ -186,7 +187,6 @@ static SYMBOL symbols[] = {
{ "INNOBASE", SYM(INNOBASE_SYM),0,0},
{ "INNODB", SYM(INNOBASE_SYM),0,0},
{ "INSERT", SYM(INSERT),0,0},
- { "INSERT_ID", SYM(INSERT_ID),0,0},
{ "INSERT_METHOD", SYM(INSERT_METHOD),0,0},
{ "INT", SYM(INT_SYM),0,0},
{ "INTEGER", SYM(INT_SYM),0,0},
@@ -208,7 +208,6 @@ static SYMBOL symbols[] = {
{ "KEYS", SYM(KEYS),0,0},
{ "KILL", SYM(KILL_SYM),0,0},
{ "LAST", SYM(LAST_SYM),0,0},
- { "LAST_INSERT_ID", SYM(LAST_INSERT_ID),0,0},
{ "LEADING", SYM(LEADING),0,0},
{ "LEFT", SYM(LEFT),0,0},
{ "LEVEL", SYM(LEVEL_SYM),0,0},
@@ -261,7 +260,6 @@ static SYMBOL symbols[] = {
{ "NOT", SYM(NOT),0,0},
{ "NULL", SYM(NULL_SYM),0,0},
{ "NUMERIC", SYM(NUMERIC_SYM),0,0},
- { "OFF", SYM(OFF),0,0},
{ "ON", SYM(ON),0,0},
{ "OPEN", SYM(OPEN_SYM),0,0},
{ "OPTIMIZE", SYM(OPTIMIZE),0,0},
@@ -295,6 +293,7 @@ static SYMBOL symbols[] = {
{ "RENAME", SYM(RENAME),0,0},
{ "REPAIR", SYM(REPAIR),0,0},
{ "REPLACE", SYM(REPLACE),0,0},
+ { "REPLICATION", SYM(REPLICATION),0,0},
{ "REPEATABLE", SYM(REPEATABLE_SYM),0,0},
{ "REQUIRE", SYM(REQUIRE_SYM),0,0},
{ "RESET", SYM(RESET_SYM),0,0},
@@ -306,6 +305,7 @@ static SYMBOL symbols[] = {
{ "RIGHT", SYM(RIGHT),0,0},
{ "RLIKE", SYM(REGEXP),0,0}, /* Like in mSQL2 */
{ "ROLLBACK", SYM(ROLLBACK_SYM),0,0},
+ { "ROLLUP", SYM(ROLLUP_SYM),0,0},
{ "ROW", SYM(ROW_SYM),0,0},
{ "ROWS", SYM(ROWS_SYM),0,0},
{ "RTREE", SYM(RTREE_SYM),0,0},
@@ -323,28 +323,14 @@ static SYMBOL symbols[] = {
{ "SMALLINT", SYM(SMALLINT),0,0},
{ "SONAME", SYM(UDF_SONAME_SYM),0,0},
{ "SPATIAL", SYM(SPATIAL_SYM),0,0},
- { "SQL_AUTO_IS_NULL", SYM(SQL_AUTO_IS_NULL),0,0},
{ "SQL_BIG_RESULT", SYM(SQL_BIG_RESULT),0,0},
- { "SQL_BIG_SELECTS", SYM(SQL_BIG_SELECTS),0,0},
- { "SQL_BIG_TABLES", SYM(SQL_BIG_TABLES),0,0},
{ "SQL_BUFFER_RESULT", SYM(SQL_BUFFER_RESULT),0,0},
{ "SQL_CACHE", SYM(SQL_CACHE_SYM), 0, 0},
{ "SQL_CALC_FOUND_ROWS", SYM(SQL_CALC_FOUND_ROWS),0,0},
{ "SQL_ERROR_COUNT", SYM(SQL_ERROR_COUNT),0,0},
- { "SQL_LOG_BIN", SYM(SQL_LOG_BIN),0,0},
- { "SQL_LOG_OFF", SYM(SQL_LOG_OFF),0,0},
- { "SQL_LOG_UPDATE", SYM(SQL_LOG_UPDATE),0,0},
- { "SQL_LOW_PRIORITY_UPDATES", SYM(SQL_LOW_PRIORITY_UPDATES),0,0},
- { "SQL_MAX_JOIN_SIZE",SYM(SQL_MAX_JOIN_SIZE), 0, 0},
{ "SQL_NO_CACHE", SYM(SQL_NO_CACHE_SYM), 0, 0},
- { "SQL_QUERY_CACHE_TYPE",SYM(SQL_QUERY_CACHE_TYPE_SYM), 0, 0},
- { "SQL_QUOTE_SHOW_CREATE",SYM(SQL_QUOTE_SHOW_CREATE), 0, 0},
- { "SQL_SAFE_UPDATES", SYM(SQL_SAFE_UPDATES),0,0},
- { "SQL_SELECT_LIMIT", SYM(SQL_SELECT_LIMIT),0,0},
- { "SQL_SLAVE_SKIP_COUNTER", SYM(SQL_SLAVE_SKIP_COUNTER),0,0},
{ "SQL_SMALL_RESULT", SYM(SQL_SMALL_RESULT),0,0},
- { "SQL_THREAD", SYM(SQL_THREAD),0,0},
- { "SQL_WARNINGS", SYM(SQL_WARNINGS),0,0},
+ { "SQL_THREAD", SYM(SQL_THREAD),0,0},
{ "SSL", SYM(SSL_SYM),0,0},
{ "STRAIGHT_JOIN", SYM(STRAIGHT_JOIN),0,0},
{ "START", SYM(START_SYM),0,0},
@@ -354,6 +340,7 @@ static SYMBOL symbols[] = {
{ "STOP", SYM(STOP_SYM),0,0},
{ "STRIPED", SYM(RAID_STRIPED_SYM),0,0},
{ "SUBJECT", SYM(SUBJECT_SYM),0,0},
+ { "SUPER", SYM(SUPER_SYM),0,0},
{ "TABLE", SYM(TABLE_SYM),0,0},
{ "TABLES", SYM(TABLES),0,0},
{ "TEMPORARY", SYM(TEMPORARY),0,0},
@@ -392,6 +379,7 @@ static SYMBOL symbols[] = {
{ "WRITE", SYM(WRITE_SYM),0,0},
{ "WHEN", SYM(WHEN_SYM),0,0},
{ "WHERE", SYM(WHERE),0,0},
+ { "XOR", SYM(XOR),0,0},
{ "X509", SYM(X509_SYM),0,0},
{ "YEAR", SYM(YEAR_SYM),0,0},
{ "YEAR_MONTH", SYM(YEAR_MONTH_SYM),0,0},
@@ -404,6 +392,8 @@ static SYMBOL sql_functions[] = {
{ "ABS", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_abs)},
{ "ACOS", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_acos)},
{ "ADDDATE", SYM(DATE_ADD_INTERVAL),0,0},
+ { "AES_ENCRYPT", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_encrypt)},
+ { "AES_DECRYPT", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_decrypt)},
{ "AREA", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_area)},
{ "ASCII", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ascii)},
{ "ASIN", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_asin)},
@@ -484,15 +474,19 @@ static SYMBOL sql_functions[] = {
{ "ISCLOSED", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_isclosed)},
{ "ISEMPTY", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_isempty)},
{ "ISNULL", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_isnull)},
+ { "IS_FREE_LOCK", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_is_free_lock)},
+ { "LAST_INSERT_ID", SYM(LAST_INSERT_ID),0,0},
{ "ISSIMPLE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_issimple)},
{ "LCASE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_lcase)},
{ "LEAST", SYM(LEAST_SYM),0,0},
{ "LENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_length)},
+ { "LN", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ln)},
{ "LINEFROMTEXT", SYM(LINEFROMTEXT),0,0},
{ "LINESTRING", SYM(LINESTRING),0,0},
{ "LOAD_FILE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_load_file)},
{ "LOCATE", SYM(LOCATE),0,0},
- { "LOG", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_log)},
+ { "LOG", SYM(LOG_SYM),0,0},
+ { "LOG2", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_log2)},
{ "LOG10", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_log10)},
{ "LOWER", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_lcase)},
{ "LPAD", SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_lpad)},
@@ -533,6 +527,7 @@ static SYMBOL sql_functions[] = {
{ "POW", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)},
{ "POWER", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)},
{ "QUARTER", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_quarter)},
+ { "QUOTE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_quote)},
{ "RADIANS", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_radians)},
{ "RAND", SYM(RAND),0,0},
{ "RELEASE_LOCK", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_release_lock)},
@@ -546,6 +541,8 @@ static SYMBOL sql_functions[] = {
{ "SUBDATE", SYM(DATE_SUB_INTERVAL),0,0},
{ "SIGN", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sign)},
{ "SIN", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sin)},
+ { "SHA", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sha)},
+ { "SHA1", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sha)},
{ "SOUNDEX", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_soundex)},
{ "SPACE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_space)},
{ "SQRT", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sqrt)},
@@ -576,5 +573,4 @@ static SYMBOL sql_functions[] = {
{ "X", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_x)},
{ "Y", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_y)},
{ "YEARWEEK", SYM(YEARWEEK),0,0}
-
};
diff --git a/sql/lock.cc b/sql/lock.cc
index db849757741..056ed0fec8f 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -28,6 +28,7 @@ TODO:
#include "mysql_priv.h"
#include <hash.h>
+#include <assert.h>
extern HASH open_cache;
@@ -135,7 +136,7 @@ static int lock_external(TABLE **tables,uint count)
if ((error=(*tables)->file->external_lock(thd,lock_type)))
{
- for ( ; i-- ; tables--)
+ for (; i-- ; tables--)
{
(*tables)->file->external_lock(thd, F_UNLCK);
(*tables)->current_lock=F_UNLCK;
@@ -427,6 +428,7 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list)
char key[MAX_DBKEY_LENGTH];
uint key_length;
DBUG_ENTER("lock_table_name");
+ safe_mutex_assert_owner(&LOCK_open);
key_length=(uint) (strmov(strmov(key,table_list->db)+1,table_list->name)
-key)+ 1;
@@ -473,7 +475,7 @@ void unlock_table_name(THD *thd, TABLE_LIST *table_list)
static bool locked_named_table(THD *thd, TABLE_LIST *table_list)
{
- for ( ; table_list ; table_list=table_list->next)
+ for (; table_list ; table_list=table_list->next)
{
if (table_list->table && table_is_used(table_list->table,0))
return 1;
@@ -486,6 +488,7 @@ bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list)
{
bool result=0;
DBUG_ENTER("wait_for_locked_table_names");
+ safe_mutex_assert_owner(&LOCK_open);
while (locked_named_table(thd,table_list))
{
diff --git a/sql/log.cc b/sql/log.cc
index 02ebb4348ac..b3ce1226210 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -33,7 +33,6 @@
MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log;
extern I_List<i_string> binlog_do_db, binlog_ignore_db;
-extern ulong max_binlog_size;
static bool test_if_number(const char *str,
long *res, bool allow_wildcards);
@@ -80,10 +79,11 @@ static int find_uniq_filename(char *name)
DBUG_RETURN(0);
}
-MYSQL_LOG::MYSQL_LOG(): last_time(0), query_start(0),index_file(-1),
- name(0), log_type(LOG_CLOSED),write_error(0),
- inited(0), file_id(1),no_rotate(0),
- need_start_event(1),bytes_written(0)
+
+MYSQL_LOG::MYSQL_LOG()
+ :bytes_written(0), last_time(0), query_start(0), name(0),
+ file_id(1), open_count(1), log_type(LOG_CLOSED), write_error(0), inited(0),
+ no_rotate(0), need_start_event(1)
{
/*
We don't want to intialize LOCK_Log here as the thread system may
@@ -91,8 +91,10 @@ MYSQL_LOG::MYSQL_LOG(): last_time(0), query_start(0),index_file(-1),
*/
index_file_name[0] = 0;
bzero((char*) &log_file,sizeof(log_file));
+ bzero((char*) &index_file, sizeof(index_file));
}
+
MYSQL_LOG::~MYSQL_LOG()
{
if (inited)
@@ -103,15 +105,6 @@ MYSQL_LOG::~MYSQL_LOG()
}
}
-void MYSQL_LOG::set_index_file_name(const char* index_file_name)
-{
- if (index_file_name)
- fn_format(this->index_file_name,index_file_name,mysql_data_home,".index",
- 4);
- else
- this->index_file_name[0] = 0;
-}
-
int MYSQL_LOG::generate_new_name(char *new_name, const char *log_name)
{
@@ -132,12 +125,6 @@ int MYSQL_LOG::generate_new_name(char *new_name, const char *log_name)
return 0;
}
-bool MYSQL_LOG::open_index( int options)
-{
- return (index_file < 0 &&
- (index_file = my_open(index_file_name, options | O_BINARY ,
- MYF(MY_WME))) < 0);
-}
void MYSQL_LOG::init(enum_log_type log_type_arg,
enum cache_type io_cache_type_arg,
@@ -148,33 +135,44 @@ void MYSQL_LOG::init(enum_log_type log_type_arg,
no_auto_events = no_auto_events_arg;
if (!inited)
{
- inited=1;
+ inited= 1;
(void) pthread_mutex_init(&LOCK_log,MY_MUTEX_INIT_SLOW);
(void) pthread_mutex_init(&LOCK_index, MY_MUTEX_INIT_SLOW);
(void) pthread_cond_init(&update_cond, 0);
}
}
-void MYSQL_LOG::close_index()
-{
- if (index_file >= 0)
- {
- my_close(index_file, MYF(0));
- index_file = -1;
- }
-}
-void MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
- const char *new_name, enum cache_type io_cache_type_arg,
+/*
+ Open a (new) log file.
+
+ DESCRIPTION
+ - If binary logs, also open the index file and register the new
+ file name in it
+ - When calling this when the file is in use, you must have a locks
+ on LOCK_log and LOCK_index.
+
+ RETURN VALUES
+ 0 ok
+ 1 error
+*/
+
+bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
+ const char *new_name, const char *index_file_name_arg,
+ enum cache_type io_cache_type_arg,
bool no_auto_events_arg)
{
- MY_STAT tmp_stat;
char buff[512];
- File file= -1;
- bool do_magic;
+ File file= -1, index_file_nr= -1;
int open_flags = O_CREAT | O_APPEND | O_BINARY;
+ DBUG_ENTER("MYSQL_LOG::open");
+ DBUG_PRINT("enter",("log_type: %d",(int) log_type));
+
+ last_time=query_start=0;
+ write_error=0;
+
if (!inited && log_type_arg == LOG_BIN && *fn_ext(log_name))
- no_rotate = 1;
+ no_rotate = 1;
init(log_type_arg,io_cache_type_arg,no_auto_events_arg);
if (!(name=my_strdup(log_name,MYF(MY_WME))))
@@ -189,20 +187,16 @@ void MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
else
open_flags |= O_WRONLY;
- if (log_type == LOG_BIN && !index_file_name[0])
- fn_format(index_file_name, name, mysql_data_home, ".index", 6);
-
db[0]=0;
- do_magic = ((log_type == LOG_BIN) && !my_stat(log_file_name,
- &tmp_stat, MYF(0)));
-
+ open_count++;
if ((file=my_open(log_file_name,open_flags,
MYF(MY_WME | ME_WAITTANG))) < 0 ||
init_io_cache(&log_file, file, IO_SIZE, io_cache_type,
my_tell(file,MYF(MY_WME)), 0, MYF(MY_WME | MY_NABP)))
goto err;
- if (log_type == LOG_NORMAL)
+ switch (log_type) {
+ case LOG_NORMAL:
{
char *end;
#ifdef __NT__
@@ -214,8 +208,9 @@ void MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
if (my_b_write(&log_file, (byte*) buff,(uint) (end-buff)) ||
flush_io_cache(&log_file))
goto err;
+ break;
}
- else if (log_type == LOG_NEW)
+ case LOG_NEW:
{
time_t skr=time(NULL);
struct tm tm_tmp;
@@ -231,49 +226,98 @@ void MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
if (my_b_write(&log_file, (byte*) buff,(uint) strlen(buff)) ||
flush_io_cache(&log_file))
goto err;
+ break;
}
- else if (log_type == LOG_BIN)
+ case LOG_BIN:
{
- bool error;
- if (do_magic)
+ bool write_file_name_to_index_file=0;
+
+ myf opt= MY_UNPACK_FILENAME;
+ if (!index_file_name_arg)
+ {
+ index_file_name_arg= name; // Use same basename for index file
+ opt= MY_UNPACK_FILENAME | MY_REPLACE_EXT;
+ }
+
+ if (!my_b_filelength(&log_file))
{
- if (my_b_write(&log_file, (byte*) BINLOG_MAGIC, 4) ||
- open_index(O_APPEND | O_RDWR | O_CREAT))
+ /*
+ The binary log file was empty (probably newly created)
+ This is the normal case and happens when the user doesn't specify
+ an extension for the binary log files.
+ In this case we write a standard header to it.
+ */
+ if (my_b_write(&log_file, (byte*) BINLOG_MAGIC, BIN_LOG_HEADER_SIZE))
goto err;
- bytes_written += 4;
+ bytes_written += BIN_LOG_HEADER_SIZE;
+ write_file_name_to_index_file=1;
}
+ if (!my_b_inited(&index_file))
+ {
+ /*
+ First open of this class instance
+ Create an index file that will hold all file names uses for logging.
+ Add new entries to the end of it.
+ */
+ fn_format(index_file_name, index_file_name_arg, mysql_data_home,
+ ".index", opt);
+ if ((index_file_nr= my_open(index_file_name,
+ O_RDWR | O_CREAT | O_BINARY ,
+ MYF(MY_WME))) < 0 ||
+ init_io_cache(&index_file, index_file_nr,
+ IO_SIZE, WRITE_CACHE,
+ my_seek(index_file_nr,0L,MY_SEEK_END,MYF(0)),
+ 0, MYF(MY_WME)))
+ goto err;
+ }
+ else
+ {
+ safe_mutex_assert_owner(&LOCK_index);
+ reinit_io_cache(&index_file, WRITE_CACHE, my_b_filelength(&index_file),
+ 0, 0);
+ }
if (need_start_event && !no_auto_events)
{
+ need_start_event=0;
Start_log_event s;
s.set_log_pos(this);
s.write(&log_file);
- need_start_event=0;
}
- flush_io_cache(&log_file);
- pthread_mutex_lock(&LOCK_index);
- error=(my_write(index_file, (byte*) log_file_name, strlen(log_file_name),
- MYF(MY_NABP | MY_WME)) ||
- my_write(index_file, (byte*) "\n", 1, MYF(MY_NABP | MY_WME)));
- pthread_mutex_unlock(&LOCK_index);
- if (error)
- {
- close_index();
+ if (flush_io_cache(&log_file))
goto err;
+
+ if (write_file_name_to_index_file)
+ {
+ /* As this is a new log file, we write the file name to the index file */
+ if (my_b_write(&index_file, (byte*) log_file_name,
+ strlen(log_file_name)) ||
+ my_b_write(&index_file, (byte*) "\n", 1) ||
+ flush_io_cache(&index_file))
+ goto err;
}
+ break;
+ }
+ case LOG_CLOSED: // Impossible
+ DBUG_ASSERT(1);
+ break;
}
- return;
+ DBUG_RETURN(0);
err:
- sql_print_error("Could not use %s for logging (error %d)", log_name,errno);
+ sql_print_error("Could not use %s for logging (error %d)", log_name, errno);
if (file >= 0)
my_close(file,MYF(0));
+ if (index_file_nr >= 0)
+ my_close(index_file_nr,MYF(0));
end_io_cache(&log_file);
- x_free(name); name=0;
+ end_io_cache(&index_file);
+ safeFree(name);
log_type=LOG_CLOSED;
- return;
+ DBUG_RETURN(1);
}
+
int MYSQL_LOG::get_current_log(LOG_INFO* linfo)
{
pthread_mutex_lock(&LOCK_log);
@@ -283,480 +327,569 @@ int MYSQL_LOG::get_current_log(LOG_INFO* linfo)
return 0;
}
-// if log_name is "" we stop at the first entry
-int MYSQL_LOG::find_first_log(LOG_INFO* linfo, const char* log_name,
- bool need_mutex)
+
+/*
+ Move all data up in a file in an filename index file
+
+ SYNOPSIS
+ copy_up_file_and_fill()
+ index_file File to move
+ offset Move everything from here to beginning
+
+ NOTE
+ File will be truncated to be 'offset' shorter or filled up with
+ newlines
+
+ IMPLEMENTATION
+ We do the copy outside of the IO_CACHE as the cache buffers would just
+ make things slower and more complicated.
+ In most cases the copy loop should only do one read.
+
+ RETURN VALUES
+ 0 ok
+*/
+
+static bool copy_up_file_and_fill(IO_CACHE *index_file, my_off_t offset)
{
- if (index_file < 0)
- return LOG_INFO_INVALID;
- int error = 0;
- char* fname = linfo->log_file_name;
- uint log_name_len = (uint) strlen(log_name);
- IO_CACHE io_cache;
-
- // mutex needed because we need to make sure the file pointer does not move
- // from under our feet
- if (need_mutex)
- pthread_mutex_lock(&LOCK_index);
- if (init_io_cache(&io_cache, index_file, IO_SIZE, READ_CACHE, (my_off_t) 0,
- 0, MYF(MY_WME)))
+ int bytes_read;
+ my_off_t init_offset= offset;
+ File file= index_file->file;
+ byte io_buf[IO_SIZE*2];
+ DBUG_ENTER("copy_up_file_and_fill");
+
+ for (;; offset+= bytes_read)
{
- error = LOG_INFO_SEEK;
- goto err;
+ (void) my_seek(file, offset, MY_SEEK_SET, MYF(0));
+ if ((bytes_read= (int) my_read(file, io_buf, sizeof(io_buf), MYF(MY_WME)))
+ < 0)
+ goto err;
+ if (!bytes_read)
+ break; // end of file
+ (void) my_seek(file, offset-init_offset, MY_SEEK_SET, MYF(0));
+ if (my_write(file, (byte*) io_buf, bytes_read, MYF(MY_WME | MY_NABP)))
+ goto err;
}
- for(;;)
+ /* The following will either truncate the file or fill the end with \n' */
+ if (my_chsize(file, offset - init_offset, '\n', MYF(MY_WME)))
+ goto err;
+
+ /* Reset data in old index cache */
+ reinit_io_cache(index_file, READ_CACHE, (my_off_t) 0, 0, 1);
+ DBUG_RETURN(0);
+
+err:
+ DBUG_RETURN(1);
+}
+
+
+/*
+ Find the position in the log-index-file for the given log name
+
+ SYNOPSIS
+ find_log_pos()
+ linfo Store here the found log file name and position to
+ the NEXT log file name in the index file.
+ log_name Filename to find in the index file.
+ Is a null pointer if we want to read the first entry
+ need_mutex Set this to 1 if the parent doesn't already have a
+ lock on LOCK_index
+
+ NOTE
+ On systems without the truncate function the file will end with one ore
+ more empty lines
+
+ RETURN VALUES
+ 0 ok
+ LOG_INFO_EOF End of log-index-file found
+ LOG_INFO_IO Got IO error while reading file
+*/
+
+int MYSQL_LOG::find_log_pos(LOG_INFO *linfo, const char *log_name,
+ bool need_lock)
+{
+ int error= 0;
+ char *fname= linfo->log_file_name;
+ uint log_name_len= log_name ? (uint) strlen(log_name) : 0;
+ DBUG_ENTER("find_log_pos");
+ DBUG_PRINT("enter",("log_name: %s", log_name ? log_name : "NULL"));
+
+ /*
+ Mutex needed because we need to make sure the file pointer does not move
+ from under our feet
+ */
+ if (need_lock)
+ pthread_mutex_lock(&LOCK_index);
+ safe_mutex_assert_owner(&LOCK_index);
+
+ /* As the file is flushed, we can't get an error here */
+ (void) reinit_io_cache(&index_file, READ_CACHE, (my_off_t) 0, 0, 0);
+
+ for (;;)
{
uint length;
- if (!(length=my_b_gets(&io_cache, fname, FN_REFLEN-1)))
+ my_off_t offset= my_b_tell(&index_file);
+ /* If we get 0 or 1 characters, this is the end of the file */
+
+ if ((length= my_b_gets(&index_file, fname, FN_REFLEN)) <= 1)
{
- error = !io_cache.error ? LOG_INFO_EOF : LOG_INFO_IO;
- goto err;
+ /* Did not find the given entry; Return not found or error */
+ error= !index_file.error ? LOG_INFO_EOF : LOG_INFO_IO;
+ break;
}
- // if the log entry matches, empty string matching anything
- if (!log_name_len ||
+ // if the log entry matches, null string matching anything
+ if (!log_name ||
(log_name_len == length-1 && fname[log_name_len] == '\n' &&
!memcmp(fname, log_name, log_name_len)))
{
+ DBUG_PRINT("info",("Found log file entry"));
fname[length-1]=0; // remove last \n
- linfo->index_file_offset = my_b_tell(&io_cache);
+ linfo->index_file_start_offset= offset;
+ linfo->index_file_offset = my_b_tell(&index_file);
break;
}
}
- error = 0;
-err:
- if (need_mutex)
+ if (need_lock)
pthread_mutex_unlock(&LOCK_index);
- end_io_cache(&io_cache);
- return error;
-
+ DBUG_RETURN(error);
}
+/*
+ Find the position in the log-index-file for the given log name
+
+ SYNOPSIS
+ find_next_log()
+ linfo Store here the next log file name and position to
+ the file name after that.
+ need_lock Set this to 1 if the parent doesn't already have a
+ lock on LOCK_index
+
+ NOTE
+ - Before calling this function, one has to call find_log_pos()
+ to set up 'linfo'
+ - Mutex needed because we need to make sure the file pointer does not move
+ from under our feet
+
+ RETURN VALUES
+ 0 ok
+ LOG_INFO_EOF End of log-index-file found
+ LOG_INFO_SEEK Could not allocate IO cache
+ LOG_INFO_IO Got IO error while reading file
+*/
+
int MYSQL_LOG::find_next_log(LOG_INFO* linfo, bool need_lock)
{
- // mutex needed because we need to make sure the file pointer does not move
- // from under our feet
- if (index_file < 0) return LOG_INFO_INVALID;
- int error = 0;
- char* fname = linfo->log_file_name;
- IO_CACHE io_cache;
+ int error= 0;
uint length;
+ char *fname= linfo->log_file_name;
+
if (need_lock)
pthread_mutex_lock(&LOCK_index);
- if (init_io_cache(&io_cache, index_file, IO_SIZE,
- READ_CACHE, (my_off_t) linfo->index_file_offset, 0,
- MYF(MY_WME)))
- {
- error = LOG_INFO_SEEK;
- goto err;
- }
- if (!(length=my_b_gets(&io_cache, fname, FN_REFLEN)))
+ safe_mutex_assert_owner(&LOCK_index);
+
+ /* As the file is flushed, we can't get an error here */
+ (void) reinit_io_cache(&index_file, READ_CACHE, linfo->index_file_offset, 0,
+ 0);
+
+ linfo->index_file_start_offset= linfo->index_file_offset;
+ if ((length=my_b_gets(&index_file, fname, FN_REFLEN)) <= 1)
{
- error = !io_cache.error ? LOG_INFO_EOF : LOG_INFO_IO;
+ error = !index_file.error ? LOG_INFO_EOF : LOG_INFO_IO;
goto err;
}
fname[length-1]=0; // kill /n
- linfo->index_file_offset = my_b_tell(&io_cache);
- error = 0;
+ linfo->index_file_offset = my_b_tell(&index_file);
err:
if (need_lock)
pthread_mutex_unlock(&LOCK_index);
- end_io_cache(&io_cache);
return error;
}
-int MYSQL_LOG::reset_logs(THD* thd)
+/*
+ Delete all logs refered to in the index file
+ Start writing to a new log file. The new index file will only contain
+ this file.
+
+ SYNOPSIS
+ reset_logs()
+ thd Thread
+
+ NOTE
+ If not called from slave thread, write start event to new log
+
+
+ RETURN VALUES
+ 0 ok
+ 1 error
+*/
+
+bool MYSQL_LOG::reset_logs(THD* thd)
{
LOG_INFO linfo;
- int error=0;
+ bool error=0;
const char* save_name;
enum_log_type save_log_type;
+ DBUG_ENTER("reset_logs");
+
+ /*
+ We need to get both locks to be sure that no one is trying to
+ write to the index log file.
+ */
pthread_mutex_lock(&LOCK_log);
- if (find_first_log(&linfo,""))
+ pthread_mutex_lock(&LOCK_index);
+
+ /* Save variables so that we can reopen the log */
+ save_name=name;
+ name=0; // Protect against free
+ save_log_type=log_type;
+ close(0); // Don't close the index file
+
+ /* First delete all old log files */
+
+ if (find_log_pos(&linfo, NullS, 0))
{
error=1;
goto err;
}
- for(;;)
+ for (;;)
{
my_delete(linfo.log_file_name, MYF(MY_WME));
- if (find_next_log(&linfo))
+ if (find_next_log(&linfo, 0))
break;
}
- save_name=name;
- name=0;
- save_log_type=log_type;
- close(1);
- my_delete(index_file_name, MYF(MY_WME));
- if (thd && !thd->slave_thread)
+
+ /* Start logging with a new file */
+ close(1); // Close index file
+ my_delete(index_file_name, MYF(MY_WME)); // Reset (open will update)
+ if (!thd->slave_thread)
need_start_event=1;
- open(save_name,save_log_type,0,io_cache_type,no_auto_events);
- my_free((gptr)save_name,MYF(0));
+ open(save_name, save_log_type, 0, index_file_name,
+ io_cache_type, no_auto_events);
+ my_free((gptr) save_name, MYF(0));
+
err:
+ pthread_mutex_unlock(&LOCK_index);
pthread_mutex_unlock(&LOCK_log);
- return error;
+ DBUG_RETURN(error);
}
+/*
+ Delete the current log file, remove it from index file and start on next
+
+ SYNOPSIS
+ purge_first_log()
+ rli Relay log information
+
+ NOTE
+ - This is only called from the slave-execute thread when it has read
+ all commands from a log and want to switch to a new log.
+ - When this happens, we should never be in an active transaction as
+ a transaction is always written as a single block to the binary log.
+
+ IMPLEMENTATION
+ - Protects index file with LOCK_index
+ - Delete first log file,
+ - Copy all file names after this one to the front of the index file
+ - If the OS has truncate, truncate the file, else fill it with \n'
+ - Read the first file name from the index file and store in rli->linfo
+
+ RETURN VALUES
+ 0 ok
+ LOG_INFO_EOF End of log-index-file found
+ LOG_INFO_SEEK Could not allocate IO cache
+ LOG_INFO_IO Got IO error while reading file
+*/
+
int MYSQL_LOG::purge_first_log(struct st_relay_log_info* rli)
{
- // pre-conditions
- DBUG_ASSERT(is_open());
- DBUG_ASSERT(index_file >= 0);
- DBUG_ASSERT(rli->slave_running == 1);
- DBUG_ASSERT(!strcmp(rli->linfo.log_file_name,rli->relay_log_name));
+ int error;
+ DBUG_ENTER("purge_first_log");
+
/*
+ Test pre-conditions.
+
Assume that we have previously read the first log and
stored it in rli->relay_log_name
*/
+ DBUG_ASSERT(is_open());
+ DBUG_ASSERT(rli->slave_running == 1);
+ DBUG_ASSERT(!strcmp(rli->linfo.log_file_name,rli->relay_log_name));
DBUG_ASSERT(rli->linfo.index_file_offset ==
strlen(rli->relay_log_name) + 1);
- int tmp_fd;
- char* fname, *io_buf;
- int error = 0;
- if (!(fname= (char*) my_malloc(IO_SIZE+FN_REFLEN, MYF(MY_WME))))
- return 1;
+ /* We have already processed the relay log, so it's safe to delete it */
+ my_delete(rli->relay_log_name, MYF(0));
pthread_mutex_lock(&LOCK_index);
- my_seek(index_file,rli->linfo.index_file_offset,
- MY_SEEK_SET, MYF(MY_WME));
- io_buf = fname + FN_REFLEN;
- strxmov(fname,rli->relay_log_name,".tmp",NullS);
-
- if ((tmp_fd = my_open(fname,O_CREAT|O_BINARY|O_RDWR, MYF(MY_WME))) < 0)
+ if (copy_up_file_and_fill(&index_file, rli->linfo.index_file_offset))
{
- error = 1;
+ error= LOG_INFO_IO;
goto err;
}
- for (;;)
- {
- int bytes_read;
- bytes_read = my_read(index_file, (byte*) io_buf, IO_SIZE, MYF(0));
- if (bytes_read < 0) // error
- {
- error=1;
- goto err;
- }
- if (!bytes_read)
- break; // end of file
- // otherwise, we've read something and need to write it out
- if (my_write(tmp_fd, (byte*) io_buf, bytes_read, MYF(MY_WME|MY_NABP)))
- {
- error=1;
- goto err;
- }
- }
-err:
- if (tmp_fd)
- my_close(tmp_fd, MYF(MY_WME));
- if (error)
- my_delete(fname, MYF(0)); // do not report error if the file is not there
- else
- {
- MY_STAT s;
- my_close(index_file, MYF(MY_WME));
- if (!my_stat(rli->relay_log_name,&s,MYF(0)))
- {
- sql_print_error("The first log %s failed to stat during purge",
- rli->relay_log_name);
- error=1;
- goto err;
- }
- if (my_rename(fname,index_file_name,MYF(MY_WME)) ||
- (index_file=my_open(index_file_name,O_BINARY|O_RDWR|O_APPEND,
- MYF(MY_WME)))<0 ||
- my_delete(rli->relay_log_name, MYF(MY_WME)))
- error=1;
-
- pthread_mutex_lock(&rli->log_space_lock);
- rli->log_space_total -= s.st_size;
- pthread_mutex_unlock(&rli->log_space_lock);
- // ok to broadcast after the critical region as there is no risk of
- // the mutex being destroyed by this thread later - this helps save
- // context switches
- pthread_cond_broadcast(&rli->log_space_cond);
-
- if ((error=find_first_log(&rli->linfo,"",0/*no mutex*/)))
- {
- char buff[22];
- sql_print_error("next log error=%d,offset=%s,log=%s",error,
- llstr(rli->linfo.index_file_offset,buff),
- rli->linfo.log_file_name);
- goto err2;
- }
- rli->relay_log_pos = 4;
- strnmov(rli->relay_log_name,rli->linfo.log_file_name,
- sizeof(rli->relay_log_name));
- flush_relay_log_info(rli);
- }
/*
- No need to free io_buf because we allocated both fname and io_buf in
- one malloc()
+ Update the space counter used by all relay logs
+ Ok to broadcast after the critical region as there is no risk of
+ the mutex being destroyed by this thread later - this helps save
+ context switches
*/
+ pthread_mutex_lock(&rli->log_space_lock);
+ rli->log_space_total -= rli->relay_log_pos;
+ pthread_mutex_unlock(&rli->log_space_lock);
+ pthread_cond_broadcast(&rli->log_space_cond);
+
+ /*
+ Read the next log file name from the index file and pass it back to
+ the caller
+ */
+ if ((error=find_log_pos(&rli->linfo, NullS, 0 /*no mutex*/)))
+ {
+ char buff[22];
+ sql_print_error("next log error: %d offset: %s log: %s",
+ error,
+ llstr(rli->linfo.index_file_offset,buff),
+ rli->linfo.log_file_name);
+ goto err;
+ }
+ rli->relay_log_pos = BIN_LOG_HEADER_SIZE;
+ strmake(rli->relay_log_name,rli->linfo.log_file_name,
+ sizeof(rli->relay_log_name)-1);
+
+ /* Store where we are in the new file for the execution thread */
+ flush_relay_log_info(rli);
-err2:
+err:
pthread_mutex_unlock(&LOCK_index);
- my_free(fname, MYF(MY_WME));
- return error;
+ DBUG_RETURN(error);
}
+/*
+ Remove all logs before the given log from disk and from the index file.
+
+ SYNOPSIS
+ purge_logs()
+ thd Thread pointer
+ to_log Delete all log file name before this file. This file is not
+ deleted
+
+ NOTES
+ If any of the logs before the deleted one is in use,
+ only purge logs up to this one.
+
+ RETURN VALUES
+ 0 ok
+ LOG_INFO_PURGE_NO_ROTATE Binary file that can't be rotated
+ LOG_INFO_EOF to_log not found
+*/
+
int MYSQL_LOG::purge_logs(THD* thd, const char* to_log)
{
int error;
- char fname[FN_REFLEN];
- char *p;
- uint fname_len, i;
- bool logs_to_purge_inited = 0, logs_to_keep_inited = 0, found_log = 0;
- DYNAMIC_ARRAY logs_to_purge, logs_to_keep;
- my_off_t purge_offset ;
- LINT_INIT(purge_offset);
- IO_CACHE io_cache;
-
- if (index_file < 0)
- return LOG_INFO_INVALID;
+ LOG_INFO log_info;
+ DBUG_ENTER("purge_logs");
+
if (no_rotate)
- return LOG_INFO_PURGE_NO_ROTATE;
+ DBUG_RETURN(LOG_INFO_PURGE_NO_ROTATE);
+
pthread_mutex_lock(&LOCK_index);
-
- if (init_io_cache(&io_cache,index_file, IO_SIZE*2, READ_CACHE, (my_off_t) 0,
- 0, MYF(MY_WME)))
- {
- error = LOG_INFO_MEM;
+ if ((error=find_log_pos(&log_info, to_log, 0 /*no mutex*/)))
goto err;
- }
- if (my_init_dynamic_array(&logs_to_purge, sizeof(char*), 1024, 1024))
- {
- error = LOG_INFO_MEM;
- goto err;
- }
- logs_to_purge_inited = 1;
-
- if (my_init_dynamic_array(&logs_to_keep, sizeof(char*), 1024, 1024))
- {
- error = LOG_INFO_MEM;
- goto err;
- }
- logs_to_keep_inited = 1;
-
- for (;;)
- {
- my_off_t init_purge_offset= my_b_tell(&io_cache);
- if (!(fname_len=my_b_gets(&io_cache, fname, FN_REFLEN)))
- {
- if(!io_cache.error)
- break;
- error = LOG_INFO_IO;
- goto err;
- }
- fname[--fname_len]=0; // kill \n
- if (!memcmp(fname, to_log, fname_len + 1 ))
- {
- found_log = 1;
- purge_offset = init_purge_offset;
- }
-
- // if one of the logs before the target is in use
- if (!found_log && log_in_use(fname))
- {
- error = LOG_INFO_IN_USE;
- goto err;
- }
-
- if (!(p = sql_memdup(fname, fname_len+1)) ||
- insert_dynamic(found_log ? &logs_to_keep : &logs_to_purge,
- (gptr) &p))
- {
- error = LOG_INFO_MEM;
- goto err;
- }
- }
-
- end_io_cache(&io_cache);
- if (!found_log)
- {
- error = LOG_INFO_EOF;
+ /*
+ File name exists in index file; Delete until we find this file
+ or a file that is used.
+ */
+ if ((error=find_log_pos(&log_info, NullS, 0 /*no mutex*/)))
goto err;
- }
-
- for (i = 0; i < logs_to_purge.elements; i++)
+ while (strcmp(to_log,log_info.log_file_name) &&
+ !log_in_use(log_info.log_file_name))
{
- char* l;
- get_dynamic(&logs_to_purge, (gptr)&l, i);
- if (my_delete(l, MYF(MY_WME)))
- sql_print_error("Error deleting %s during purge", l);
+ /* It's not fatal even if we can't delete a log file */
+ my_delete(log_info.log_file_name, MYF(0));
+ if (find_next_log(&log_info, 0))
+ break;
}
-
+
/*
If we get killed -9 here, the sysadmin would have to edit
the log index file after restart - otherwise, this should be safe
*/
-#ifdef HAVE_FTRUNCATE
- if (ftruncate(index_file,0))
- {
- sql_print_error("Could not truncate the binlog index file \
-during log purge for write");
- error = LOG_INFO_FATAL;
- goto err;
- }
- my_seek(index_file, 0, MY_SEEK_CUR,MYF(MY_WME));
-#else
- my_close(index_file, MYF(MY_WME));
- my_delete(index_file_name, MYF(MY_WME));
- if ((index_file = my_open(index_file_name,
- O_CREAT | O_BINARY | O_RDWR | O_APPEND,
- MYF(MY_WME)))<0)
+
+ if (copy_up_file_and_fill(&index_file, log_info.index_file_start_offset))
{
- sql_print_error("Could not re-open the binlog index file \
-during log purge for write");
- error = LOG_INFO_FATAL;
+ error= LOG_INFO_IO;
goto err;
}
-#endif
-
- for (i = 0; i < logs_to_keep.elements; i++)
- {
- char* l;
- get_dynamic(&logs_to_keep, (gptr)&l, i);
- if (my_write(index_file, (byte*) l, strlen(l), MYF(MY_WME|MY_NABP)) ||
- my_write(index_file, (byte*) "\n", 1, MYF(MY_WME|MY_NABP)))
- {
- error = LOG_INFO_FATAL;
- goto err;
- }
- }
- // now update offsets
- adjust_linfo_offsets(purge_offset);
- error = 0;
+ // now update offsets in index file for running threads
+ adjust_linfo_offsets(log_info.index_file_start_offset);
err:
pthread_mutex_unlock(&LOCK_index);
- if (logs_to_purge_inited)
- delete_dynamic(&logs_to_purge);
- if (logs_to_keep_inited)
- delete_dynamic(&logs_to_keep);
- end_io_cache(&io_cache);
- return error;
+ DBUG_RETURN(error);
}
-// we assume that buf has at least FN_REFLEN bytes alloced
+
+/*
+ Create a new log file name
+
+ SYNOPSIS
+ make_log_name()
+ buf buf of at least FN_REFLEN where new name is stored
+
+ NOTE
+ If file name will be longer then FN_REFLEN it will be truncated
+*/
+
void MYSQL_LOG::make_log_name(char* buf, const char* log_ident)
{
- buf[0] = 0; // In case of error
- if (inited)
+ if (inited) // QQ When is this not true ?
{
- int dir_len = dirname_length(log_file_name);
- int ident_len = (uint) strlen(log_ident);
- if (dir_len + ident_len + 1 > FN_REFLEN)
- return; // protection agains malicious buffer overflow
-
- memcpy(buf, log_file_name, dir_len);
- // copy filename + end null
- memcpy(buf + dir_len, log_ident, ident_len + 1);
+ uint dir_len = dirname_length(log_file_name);
+ if (dir_len > FN_REFLEN)
+ dir_len=FN_REFLEN-1;
+ strnmov(buf, log_file_name, dir_len);
+ strmake(buf+dir_len, log_ident, FN_REFLEN - dir_len);
}
}
-bool MYSQL_LOG::is_active(const char* log_file_name)
+
+/*
+ Check if we are writing/reading to the given log file
+*/
+
+bool MYSQL_LOG::is_active(const char *log_file_name_arg)
{
- return inited && !strcmp(log_file_name, this->log_file_name);
+ return inited && !strcmp(log_file_name, log_file_name_arg);
}
-void MYSQL_LOG::new_file(bool inside_mutex)
+
+/*
+ Start writing to a new log file or reopen the old file
+
+ SYNOPSIS
+ new_file()
+ need_lock Set to 1 (default) if caller has not locked
+ LOCK_log and LOCK_index
+
+ NOTE
+ The new file name is stored last in the index file
+*/
+
+void MYSQL_LOG::new_file(bool need_lock)
{
- if (is_open())
+ char new_name[FN_REFLEN], *new_name_ptr, *old_name;
+ enum_log_type save_log_type;
+
+ if (!is_open())
+ return; // Should never happen
+
+ if (need_lock)
{
- char new_name[FN_REFLEN], *old_name=name;
- if (!inside_mutex)
- VOID(pthread_mutex_lock(&LOCK_log));
+ pthread_mutex_lock(&LOCK_log);
+ pthread_mutex_lock(&LOCK_index);
+ }
+ safe_mutex_assert_owner(&LOCK_log);
+ safe_mutex_assert_owner(&LOCK_index);
+
+ new_name_ptr= name; // Reuse old name if not binlog
- if (!no_rotate)
+ /*
+ Only rotate open logs that are marked non-rotatable
+ (binlog with constant name are non-rotatable)
+ */
+ if (!no_rotate)
+ {
+ if (log_type == LOG_BIN)
{
- /*
- only rotate open logs that are marked non-rotatable
- (binlog with constant name are non-rotatable)
- */
if (generate_new_name(new_name, name))
+ goto end; /* Error; Continue using old log file */
+
+ new_name_ptr=new_name;
+ if (!no_auto_events)
{
- if (!inside_mutex)
- VOID(pthread_mutex_unlock(&LOCK_log));
- return; // Something went wrong
- }
- if (log_type == LOG_BIN)
- {
- if (!no_auto_events)
- {
- /*
- We log the whole file name for log file as the user may decide
- to change base names at some point.
- */
- THD* thd = current_thd;
- Rotate_log_event r(thd,new_name+dirname_length(new_name));
- r.set_log_pos(this);
-
- /*
- This log rotation could have been initiated by a master of
- the slave running with log-bin we set the flag on rotate
- event to prevent inifinite log rotation loop
- */
- if (thd && thd->slave_thread)
- r.flags |= LOG_EVENT_FORCED_ROTATE_F;
- r.write(&log_file);
- bytes_written += r.get_event_len();
- }
- // update needs to be signaled even if there is no rotate event
- // log rotation should give the waiting thread a signal to
- // discover EOF and move on to the next log
- signal_update();
+ /*
+ We log the whole file name for log file as the user may decide
+ to change base names at some point.
+ */
+ THD* thd = current_thd;
+ Rotate_log_event r(thd,new_name+dirname_length(new_name));
+ r.set_log_pos(this);
+
+ /*
+ Becasue this log rotation could have been initiated by a master of
+ the slave running with log-bin, we set the flag on rotate
+ event to prevent inifinite log rotation loop
+ */
+ if (thd->slave_thread)
+ r.flags|= LOG_EVENT_FORCED_ROTATE_F;
+ r.write(&log_file);
+ bytes_written += r.get_event_len();
}
- else
- strmov(new_name, old_name); // Reopen old file name
+ /*
+ Update needs to be signaled even if there is no rotate event
+ log rotation should give the waiting thread a signal to
+ discover EOF and move on to the next log.
+ */
+ signal_update();
}
- name=0;
- close();
- open(old_name, log_type, new_name, io_cache_type, no_auto_events);
- my_free(old_name,MYF(0));
- last_time=query_start=0;
- write_error=0;
- if (!inside_mutex)
- VOID(pthread_mutex_unlock(&LOCK_log));
+ }
+ old_name=name;
+ save_log_type=log_type;
+ name=0; // Don't free name
+ close();
+ open(old_name, save_log_type, new_name_ptr, index_file_name, io_cache_type,
+ no_auto_events);
+ my_free(old_name,MYF(0));
+
+end:
+ if (need_lock)
+ {
+ pthread_mutex_unlock(&LOCK_index);
+ pthread_mutex_unlock(&LOCK_log);
}
}
+
bool MYSQL_LOG::append(Log_event* ev)
{
bool error = 0;
pthread_mutex_lock(&LOCK_log);
DBUG_ASSERT(log_file.type == SEQ_READ_APPEND);
- // Log_event::write() is smart enough to use my_b_write() or
- // my_b_append() depending on the kind of cache we have
+ /*
+ Log_event::write() is smart enough to use my_b_write() or
+ my_b_append() depending on the kind of cache we have.
+ */
if (ev->write(&log_file))
{
error=1;
goto err;
}
bytes_written += ev->get_event_len();
- if ((uint)my_b_append_tell(&log_file) > max_binlog_size)
+ if ((uint) my_b_append_tell(&log_file) > max_binlog_size)
{
- new_file(1);
+ pthread_mutex_lock(&LOCK_index);
+ new_file(0);
+ pthread_mutex_unlock(&LOCK_index);
}
- signal_update();
+
err:
pthread_mutex_unlock(&LOCK_log);
+ signal_update(); // Safe as we don't call close
return error;
}
+
bool MYSQL_LOG::appendv(const char* buf, uint len,...)
{
- bool error = 0;
+ bool error= 0;
va_list(args);
va_start(args,len);
@@ -767,24 +900,32 @@ bool MYSQL_LOG::appendv(const char* buf, uint len,...)
{
if (my_b_append(&log_file,(byte*) buf,len))
{
- error = 1;
- break;
+ error= 1;
+ goto err;
}
bytes_written += len;
} while ((buf=va_arg(args,const char*)) && (len=va_arg(args,uint)));
if ((uint) my_b_append_tell(&log_file) > max_binlog_size)
{
- new_file(1);
+ pthread_mutex_lock(&LOCK_index);
+ new_file(0);
+ pthread_mutex_unlock(&LOCK_index);
}
-
+
+err:
+ pthread_mutex_unlock(&LOCK_log);
if (!error)
signal_update();
- pthread_mutex_unlock(&LOCK_log);
return error;
}
+/*
+ Write to normal (not rotable) log
+ This is the format for the 'normal', 'slow' and 'update' logs.
+*/
+
bool MYSQL_LOG::write(THD *thd,enum enum_server_command command,
const char *format,...)
{
@@ -805,7 +946,7 @@ bool MYSQL_LOG::write(THD *thd,enum enum_server_command command,
if (thd)
{ // Normal thread
if ((thd->options & OPTION_LOG_OFF) &&
- (thd->master_access & PROCESS_ACL))
+ (thd->master_access & SUPER_ACL))
{
VOID(pthread_mutex_unlock(&LOCK_log));
return 0; // No logging
@@ -865,28 +1006,33 @@ bool MYSQL_LOG::write(THD *thd,enum enum_server_command command,
}
+/*
+ Write an event to the binary log
+*/
+
bool MYSQL_LOG::write(Log_event* event_info)
{
- /* In most cases this is only called if 'is_open()' is true */
bool error=0;
- bool should_rotate = 0;
if (!inited) // Can't use mutex if not init
return 0;
- VOID(pthread_mutex_lock(&LOCK_log));
+ pthread_mutex_lock(&LOCK_log);
+
+ /* In most cases this is only called if 'is_open()' is true */
if (is_open())
{
+ bool should_rotate = 0;
THD *thd=event_info->thd;
const char* db = event_info->get_db();
#ifdef USING_TRANSACTIONS
- IO_CACHE *file = ((event_info->get_cache_stmt() && thd) ?
+ IO_CACHE *file = ((event_info->get_cache_stmt()) ?
&thd->transaction.trans_log :
&log_file);
#else
IO_CACHE *file = &log_file;
#endif
if ((thd && !(thd->options & OPTION_BIN_LOG) &&
- (thd->master_access & PROCESS_ACL)) ||
+ (thd->master_access & SUPER_ACL)) ||
(db && !db_ok(db, binlog_do_db, binlog_ignore_db)))
{
VOID(pthread_mutex_unlock(&LOCK_log));
@@ -916,19 +1062,15 @@ bool MYSQL_LOG::write(Log_event* event_info)
if (e.write(file))
goto err;
}
- if (thd && thd->convert_set)
+ if (thd && thd->variables.convert_set)
{
char buf[1024] = "SET CHARACTER SET ";
char* p = strend(buf);
- p = strmov(p, thd->convert_set->name);
- int save_query_length = thd->query_length;
- // just in case somebody wants it later
- thd->query_length = (uint)(p - buf);
- Query_log_event e(thd, buf);
+ p = strmov(p, thd->variables.convert_set->name);
+ Query_log_event e(thd, buf, (ulong)(p - buf));
e.set_log_pos(this);
if (e.write(file))
goto err;
- thd->query_length = save_query_length; // clean up
}
event_info->set_log_pos(this);
if (event_info->write(file) ||
@@ -964,13 +1106,19 @@ err:
}
if (file == &log_file)
signal_update();
+ if (should_rotate)
+ {
+ pthread_mutex_lock(&LOCK_index);
+ new_file(0); // inside mutex
+ pthread_mutex_unlock(&LOCK_index);
+ }
}
- if (should_rotate)
- new_file(1); // inside mutex
- VOID(pthread_mutex_unlock(&LOCK_log));
+
+ pthread_mutex_unlock(&LOCK_log);
return error;
}
+
uint MYSQL_LOG::next_file_id()
{
uint res;
@@ -980,68 +1128,102 @@ uint MYSQL_LOG::next_file_id()
return res;
}
+
/*
Write a cached log entry to the binary log
- We only come here if there is something in the cache.
- 'cache' needs to be reinitialized after this functions returns.
+
+ NOTE
+ - We only come here if there is something in the cache.
+ - The thing in the cache is always a complete transcation
+ - 'cache' needs to be reinitialized after this functions returns.
+
+ IMPLEMENTATION
+ - To support transaction over replication, we wrap the transaction
+ with BEGIN/COMMIT in the binary log.
*/
bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache)
{
VOID(pthread_mutex_lock(&LOCK_log));
- bool error=1;
- if (is_open())
+ if (is_open()) // Should always be true
{
uint length;
- //QQ: this looks like a bug - why READ_CACHE?
- if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0))
+
+ /*
+ Add the "BEGIN" and "COMMIT" in the binlog around transactions
+ which may contain more than 1 SQL statement. If we run with
+ AUTOCOMMIT=1, then MySQL immediately writes each SQL statement to
+ the binlog when the statement has been completed. No need to add
+ "BEGIN" ... "COMMIT" around such statements. Otherwise, MySQL uses
+ thd->transaction.trans_log to cache the SQL statements until the
+ explicit commit, and at the commit writes the contents in .trans_log
+ to the binlog.
+
+ We write the "BEGIN" mark first in the buffer (.trans_log) where we
+ store the SQL statements for a transaction. At the transaction commit
+ we will add the "COMMIT mark and write the buffer to the binlog.
+ */
{
- sql_print_error(ER(ER_ERROR_ON_WRITE), cache->file_name, errno);
- goto err;
+ Query_log_event qinfo(thd, "BEGIN", 5, TRUE);
+ if (qinfo.write(&log_file))
+ goto err;
}
+ /* Read from the file used to cache the queries .*/
+ if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0))
+ goto err;
length=my_b_bytes_in_cache(cache);
do
{
+ /* Write data to the binary log file */
if (my_b_write(&log_file, cache->read_pos, length))
- {
- if (!write_error)
- sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno);
goto err;
- }
cache->read_pos=cache->read_end; // Mark buffer used up
} while ((length=my_b_fill(cache)));
- if (flush_io_cache(&log_file))
+
+ /*
+ We write the command "COMMIT" as the last SQL command in the
+ binlog segment cached for this transaction
+ */
+
{
- if (!write_error)
- sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno);
- goto err;
+ Query_log_event qinfo(thd, "COMMIT", 6, TRUE);
+ if (qinfo.write(&log_file) || flush_io_cache(&log_file))
+ goto err;
}
if (cache->error) // Error on read
{
sql_print_error(ER(ER_ERROR_ON_READ), cache->file_name, errno);
+ write_error=1; // Don't give more errors
goto err;
}
- error = ha_report_binlog_offset_and_commit(thd, log_file_name,
- log_file.pos_in_file);
- if (error)
+ if ((ha_report_binlog_offset_and_commit(thd, log_file_name,
+ log_file.pos_in_file)))
goto err;
+ signal_update();
}
- error=0;
+ VOID(pthread_mutex_unlock(&LOCK_log));
+ return 0;
err:
- if (error)
- write_error=1;
- else
- signal_update();
-
+ if (!write_error)
+ {
+ write_error= 1;
+ sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno);
+ }
VOID(pthread_mutex_unlock(&LOCK_log));
-
- return error;
+ return 1;
}
-/* Write update log in a format suitable for incremental backup */
+/*
+ Write update log in a format suitable for incremental backup
+
+ NOTE
+ - This code should be deleted in MySQL 5,0 as the binary log
+ is a full replacement for the update log.
+
+*/
bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length,
time_t query_start)
@@ -1057,7 +1239,7 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length,
char buff[80],*end;
end=buff;
if (!(thd->options & OPTION_UPDATE_LOG) &&
- (thd->master_access & PROCESS_ACL))
+ (thd->master_access & SUPER_ACL))
{
VOID(pthread_mutex_unlock(&LOCK_log));
return 0;
@@ -1133,16 +1315,16 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length,
if (end != buff)
{
*end++=';';
- *end++='\n';
- *end=0;
+ *end='\n';
if (my_b_write(&log_file, (byte*) "SET ",4) ||
- my_b_write(&log_file, (byte*) buff+1,(uint) (end-buff)-1))
+ my_b_write(&log_file, (byte*) buff+1,(uint) (end-buff)))
tmp_errno=errno;
}
if (!query)
{
- query="#adminstrator command";
- query_length=21;
+ end=strxmov(buff, "# administrator command: ",
+ command_name[thd->command], NullS);
+ query_length=(ulong) (end-buff);
}
if (my_b_write(&log_file, (byte*) query,query_length) ||
my_b_write(&log_file, (byte*) ";\n",2) ||
@@ -1163,26 +1345,50 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length,
return error;
}
+/*
+ Wait until we get a signal that the binary log has been updated
+
+ SYNOPSIS
+ wait_for_update()
+ thd Thread variable
+
+ NOTES
+ One must have a lock on LOCK_log before calling this function.
+ This lock will be freed before return!
+
+ The reason for the above is that for enter_cond() / exit_cond() to
+ work the mutex must be got before enter_cond() but releases before
+ exit_cond().
+ If you don't do it this way, you will get a deadlock in THD::awake()
+*/
+
+
void MYSQL_LOG:: wait_for_update(THD* thd)
{
+ safe_mutex_assert_owner(&LOCK_log);
const char* old_msg = thd->enter_cond(&update_cond, &LOCK_log,
"Slave: waiting for binlog update");
pthread_cond_wait(&update_cond, &LOCK_log);
- // this is not a bug - we unlock the mutex for the caller, and expect him
- // to lock it and then not unlock it upon return. This is a rather odd
- // way of doing things, but this is the cleanest way I could think of to
- // solve the race deadlock caused by THD::awake() first acquiring mysys_var
- // mutex and then the current mutex, while wait_for_update being called with
- // the current mutex already aquired and THD::exit_cond() trying to acquire
- // mysys_var mutex. We do need the mutex to be acquired prior to the
- // invocation of wait_for_update in all cases, so mutex acquisition inside
- // wait_for_update() is not an option
- pthread_mutex_unlock(&LOCK_log);
+ pthread_mutex_unlock(&LOCK_log); // See NOTES
thd->exit_cond(old_msg);
-}
+}
+
+
+/*
+ Close the log file
+
+ SYNOPSIS
+ close()
+ exiting Set to 1 if we should also close the index file
+ This can be set to 0 if we are going to do call open
+ at once after close, in which case we don't want to
+ close the index file.
+*/
void MYSQL_LOG::close(bool exiting)
{ // One can't set log_type here!
+ DBUG_ENTER("MYSQL_LOG::close");
+ DBUG_PRINT("enter",("exiting: %d", (int) exiting));
if (is_open())
{
if (log_type == LOG_BIN && !no_auto_events)
@@ -1196,25 +1402,47 @@ void MYSQL_LOG::close(bool exiting)
if (my_close(log_file.file,MYF(0)) < 0 && ! write_error)
{
write_error=1;
- sql_print_error(ER(ER_ERROR_ON_WRITE),name,errno);
+ sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno);
}
}
- if (exiting && index_file >= 0)
+
+ /*
+ The following test is needed even if is_open() is not set, as we may have
+ called a not complete close earlier and the index file is still open.
+ */
+
+ if (exiting && my_b_inited(&index_file))
{
- if (my_close(index_file,MYF(0)) < 0 && ! write_error)
+ end_io_cache(&index_file);
+ if (my_close(index_file.file, MYF(0)) < 0 && ! write_error)
{
- write_error=1;
- sql_print_error(ER(ER_ERROR_ON_WRITE),name,errno);
+ write_error= 1;
+ sql_print_error(ER(ER_ERROR_ON_WRITE), index_file_name, errno);
}
- index_file=-1;
- log_type=LOG_CLOSED;
}
+ log_type= LOG_CLOSED;
safeFree(name);
+ DBUG_VOID_RETURN;
}
- /* Check if a string is a valid number */
- /* Output: TRUE -> number */
+/*
+ Check if a string is a valid number
+
+ SYNOPSIS
+ test_if_number()
+ str String to test
+ res Store value here
+ allow_wildcards Set to 1 if we should ignore '%' and '_'
+
+ NOTE
+ For the moment the allow_wildcards argument is not used
+ Should be move to some other file.
+
+ RETURN VALUES
+ 1 String is a number
+ 0 Error
+*/
static bool test_if_number(register const char *str,
long *res, bool allow_wildcards)
@@ -1285,7 +1513,6 @@ void sql_print_error(const char *format,...)
}
-
void sql_perror(const char *message)
{
#ifdef HAVE_STRERROR
diff --git a/sql/log_event.cc b/sql/log_event.cc
index cd116f867c2..23622bc0141 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -31,9 +31,9 @@ inline int my_b_safe_write(IO_CACHE* file, const byte *buf,
{
/*
Sasha: We are not writing this with the ? operator to avoid hitting
- a possible compiler bug. At least gcc 2.95 cannot deal with
- several layers of ternary operators that evaluated comma(,) operator
- expressions inside - I do have a test case if somebody wants it
+ a possible compiler bug. At least gcc 2.95 cannot deal with
+ several layers of ternary operators that evaluated comma(,) operator
+ expressions inside - I do have a test case if somebody wants it
*/
if (file->type == SEQ_READ_APPEND)
return my_b_append(file, buf,len);
@@ -80,7 +80,7 @@ static void pretty_print_str(String* packet, char* str, int len)
while (str < end)
{
char c;
- switch((c=*str++)) {
+ switch ((c=*str++)) {
case '\n': packet->append( "\\n"); break;
case '\r': packet->append( "\\r"); break;
case '\\': packet->append( "\\\\"); break;
@@ -113,8 +113,7 @@ static inline char* slave_load_file_stem(char*buf, uint file_id,
const char* Log_event::get_type_str()
{
- switch(get_type_code())
- {
+ switch(get_type_code()) {
case START_EVENT: return "Start";
case STOP_EVENT: return "Stop";
case QUERY_EVENT: return "Query";
@@ -132,10 +131,9 @@ const char* Log_event::get_type_str()
}
#ifndef MYSQL_CLIENT
-Log_event::Log_event(THD* thd_arg, uint16 flags_arg):
- exec_time(0),
- flags(flags_arg),cached_event_len(0),
- temp_buf(0),thd(thd_arg)
+Log_event::Log_event(THD* thd_arg, uint16 flags_arg)
+ :exec_time(0), flags(flags_arg), cached_event_len(0),
+ temp_buf(0), thd(thd_arg)
{
if (thd)
{
@@ -151,6 +149,15 @@ Log_event::Log_event(THD* thd_arg, uint16 flags_arg):
}
}
+/*
+ Delete all temporary files used for SQL_LOAD.
+
+ TODO
+ - When we get a 'server start' event, we should only remove
+ the files associated with the server id that just started.
+ Easily fixable by adding server_id as a prefix to the log files.
+*/
+
static void cleanup_load_tmpdir()
{
MY_DIR *dirp;
@@ -159,11 +166,11 @@ static void cleanup_load_tmpdir()
if (!(dirp=my_dir(slave_load_tmpdir,MYF(MY_WME))))
return;
- for (i=0;i<(uint)dirp->number_off_files;i++)
+ for (i=0 ; i < (uint)dirp->number_off_files; i++)
{
file=dirp->dir_entry+i;
- if (!memcmp(file->name,"SQL_LOAD-",9))
- my_delete(file->name,MYF(MY_WME));
+ if (is_prefix(file->name,"SQL_LOAD-"))
+ my_delete(file->name, MYF(0));
}
my_dirend(dirp);
@@ -171,8 +178,8 @@ static void cleanup_load_tmpdir()
#endif
-Log_event::Log_event(const char* buf, bool old_format):
- cached_event_len(0),temp_buf(0)
+Log_event::Log_event(const char* buf, bool old_format)
+ :cached_event_len(0), temp_buf(0)
{
when = uint4korr(buf);
server_id = uint4korr(buf + SERVER_ID_OFFSET);
@@ -196,7 +203,7 @@ Log_event::Log_event(const char* buf, bool old_format):
int Log_event::exec_event(struct st_relay_log_info* rli)
{
- if (rli)
+ if (rli) // QQ When is this not true ?
{
rli->inc_pos(get_event_len(),log_pos);
DBUG_ASSERT(rli->sql_thd != 0);
@@ -217,9 +224,9 @@ void Query_log_event::pack_info(String* packet)
tmp.length(0);
if (db && db_len)
{
- tmp.append("use ");
+ tmp.append("use `", 5);
tmp.append(db, db_len);
- tmp.append("; ", 2);
+ tmp.append("`; ", 3);
}
if (query && q_len)
@@ -246,7 +253,7 @@ void Load_log_event::pack_info(String* packet)
char buf[256];
String tmp(buf, sizeof(buf), system_charset_info);
tmp.length(0);
- if(db && db_len)
+ if (db && db_len)
{
tmp.append("use ");
tmp.append(db, db_len);
@@ -256,9 +263,9 @@ void Load_log_event::pack_info(String* packet)
tmp.append("LOAD DATA INFILE '");
tmp.append(fname, fname_len);
tmp.append("' ", 2);
- if(sql_ex.opt_flags && REPLACE_FLAG )
+ if (sql_ex.opt_flags && REPLACE_FLAG )
tmp.append(" REPLACE ");
- else if(sql_ex.opt_flags && IGNORE_FLAG )
+ else if (sql_ex.opt_flags && IGNORE_FLAG )
tmp.append(" IGNORE ");
tmp.append("INTO TABLE ");
@@ -303,9 +310,9 @@ void Load_log_event::pack_info(String* packet)
uint i;
const char* field = fields;
tmp.append(" (");
- for(i = 0; i < num_fields; i++)
+ for (i = 0; i < num_fields; i++)
{
- if(i)
+ if (i)
tmp.append(" ,");
tmp.append( field);
@@ -319,24 +326,22 @@ void Load_log_event::pack_info(String* packet)
void Rotate_log_event::pack_info(String* packet)
{
- char buf1[256];
+ char buf1[256], buf[22];
String tmp(buf1, sizeof(buf1), system_charset_info);
tmp.length(0);
- char buf[22];
tmp.append(new_log_ident, ident_len);
tmp.append(";pos=");
tmp.append(llstr(pos,buf));
- if(flags & LOG_EVENT_FORCED_ROTATE_F)
+ if (flags & LOG_EVENT_FORCED_ROTATE_F)
tmp.append("; forced by master");
net_store_data(packet, tmp.ptr(), tmp.length());
}
void Intvar_log_event::pack_info(String* packet)
{
- char buf1[256];
+ char buf1[256], buf[22];
String tmp(buf1, sizeof(buf1), system_charset_info);
tmp.length(0);
- char buf[22];
tmp.append(get_var_type_name());
tmp.append('=');
tmp.append(llstr(val, buf));
@@ -345,14 +350,14 @@ void Intvar_log_event::pack_info(String* packet)
void Slave_log_event::pack_info(String* packet)
{
- char buf1[256];
+ char buf1[256], buf[22], *end;
String tmp(buf1, sizeof(buf1), system_charset_info);
tmp.length(0);
- char buf[22];
tmp.append("host=");
tmp.append(master_host);
tmp.append(",port=");
- tmp.append(llstr(master_port,buf));
+ end= int10_to_str((long) master_port, buf, 10);
+ tmp.append(buf, (uint32) (end-buf));
tmp.append(",log=");
tmp.append(master_log);
tmp.append(",pos=");
@@ -390,18 +395,21 @@ int Log_event::net_send(THD* thd, const char* log_name, my_off_t pos)
return my_net_write(&thd->net, (char*) packet->ptr(), packet->length());
}
-#endif
+#endif /* MYSQL_CLIENT */
+
int Query_log_event::write(IO_CACHE* file)
{
return query ? Log_event::write(file) : -1;
}
+
int Log_event::write(IO_CACHE* file)
{
return (write_header(file) || write_data(file)) ? -1 : 0;
}
+
int Log_event::write_header(IO_CACHE* file)
{
char buf[LOG_EVENT_HEADER_LEN];
@@ -427,54 +435,65 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet,
pthread_mutex_t* log_lock)
{
ulong data_len;
+ int result=0;
char buf[LOG_EVENT_HEADER_LEN];
+ DBUG_ENTER("read_log_event");
+
if (log_lock)
pthread_mutex_lock(log_lock);
if (my_b_read(file, (byte*) buf, sizeof(buf)))
{
- if (log_lock) pthread_mutex_unlock(log_lock);
- // if the read hits eof, we must report it as eof
- // so the caller will know it can go into cond_wait to be woken up
- // on the next update to the log
- if(!file->error) return LOG_READ_EOF;
- return file->error > 0 ? LOG_READ_TRUNC: LOG_READ_IO;
+ /*
+ If the read hits eof, we must report it as eof so the caller
+ will know it can go into cond_wait to be woken up on the next
+ update to the log.
+ */
+ DBUG_PRINT("error",("file->error: %d", file->error));
+ if (!file->error)
+ result= LOG_READ_EOF;
+ else
+ result= (file->error > 0 ? LOG_READ_TRUNC : LOG_READ_IO);
+ goto end;
}
- data_len = uint4korr(buf + EVENT_LEN_OFFSET);
- if (data_len < LOG_EVENT_HEADER_LEN || data_len > max_allowed_packet)
+ data_len= uint4korr(buf + EVENT_LEN_OFFSET);
+ if (data_len < LOG_EVENT_HEADER_LEN ||
+ data_len > current_thd->variables.max_allowed_packet)
{
- if (log_lock) pthread_mutex_unlock(log_lock);
- return (data_len < LOG_EVENT_HEADER_LEN) ? LOG_READ_BOGUS :
- LOG_READ_TOO_LARGE;
+ DBUG_PRINT("error",("data_len: %ld", data_len));
+ result= ((data_len < LOG_EVENT_HEADER_LEN) ? LOG_READ_BOGUS :
+ LOG_READ_TOO_LARGE);
+ goto end;
}
packet->append(buf, sizeof(buf));
- data_len -= LOG_EVENT_HEADER_LEN;
+ data_len-= LOG_EVENT_HEADER_LEN;
if (data_len)
{
if (packet->append(file, data_len))
{
- if(log_lock)
- pthread_mutex_unlock(log_lock);
- // here we should never hit eof in a non-error condtion
- // eof means we are reading the event partially, which should
- // never happen
- return file->error >= 0 ? LOG_READ_TRUNC: LOG_READ_IO;
+ /*
+ Here we should never hit EOF in a non-error condition.
+ EOF means we are reading the event partially, which should
+ never happen.
+ */
+ result= file->error >= 0 ? LOG_READ_TRUNC: LOG_READ_IO;
+ /* Implicit goto end; */
}
}
- if (log_lock) pthread_mutex_unlock(log_lock);
- return 0;
+
+end:
+ if (log_lock)
+ pthread_mutex_unlock(log_lock);
+ DBUG_RETURN(result);
}
#endif // MYSQL_CLIENT
#ifndef MYSQL_CLIENT
-#define UNLOCK_MUTEX if(log_lock) pthread_mutex_unlock(log_lock);
+#define UNLOCK_MUTEX if (log_lock) pthread_mutex_unlock(log_lock);
+#define LOCK_MUTEX if (log_lock) pthread_mutex_lock(log_lock);
+#define max_allowed_packet current_thd->variables.max_allowed_packet
#else
#define UNLOCK_MUTEX
-#endif
-
-#ifndef MYSQL_CLIENT
-#define LOCK_MUTEX if(log_lock) pthread_mutex_lock(log_lock);
-#else
#define LOCK_MUTEX
#endif
@@ -488,19 +507,19 @@ Log_event* Log_event::read_log_event(IO_CACHE* file, bool old_format)
#endif
{
char head[LOG_EVENT_HEADER_LEN];
- uint header_size = old_format ? OLD_HEADER_LEN :
- LOG_EVENT_HEADER_LEN;
+ uint header_size= old_format ? OLD_HEADER_LEN : LOG_EVENT_HEADER_LEN;
+
LOCK_MUTEX;
- if (my_b_read(file, (byte *) head, header_size ))
+ if (my_b_read(file, (byte *) head, header_size))
{
UNLOCK_MUTEX;
return 0;
}
uint data_len = uint4korr(head + EVENT_LEN_OFFSET);
- char* buf = 0;
- const char* error = 0;
- Log_event* res = 0;
+ char *buf= 0;
+ const char *error= 0;
+ Log_event *res= 0;
if (data_len > max_allowed_packet)
{
@@ -522,14 +541,14 @@ Log_event* Log_event::read_log_event(IO_CACHE* file, bool old_format)
}
buf[data_len] = 0;
memcpy(buf, head, header_size);
- if (my_b_read(file, (byte*) buf + header_size,
- data_len - header_size))
+ if (my_b_read(file, (byte*) buf + header_size, data_len - header_size))
{
error = "read error";
goto err;
}
if ((res = read_log_event(buf, data_len, &error, old_format)))
res->register_temp_buf(buf);
+
err:
UNLOCK_MUTEX;
if (error)
@@ -541,17 +560,20 @@ data_len=%d,event_type=%d",error,data_len,head[EVENT_TYPE_OFFSET]);
return res;
}
+
Log_event* Log_event::read_log_event(const char* buf, int event_len,
const char **error, bool old_format)
{
if (event_len < EVENT_LEN_OFFSET ||
- (uint)event_len != uint4korr(buf+EVENT_LEN_OFFSET))
+ (uint) event_len != uint4korr(buf+EVENT_LEN_OFFSET))
+ {
+ *error="Sanity check failed"; // Needed to free buffer
return NULL; // general sanity check - will fail on a partial read
+ }
Log_event* ev = NULL;
- switch(buf[EVENT_TYPE_OFFSET])
- {
+ switch(buf[EVENT_TYPE_OFFSET]) {
case QUERY_EVENT:
ev = new Query_log_event(buf, event_len, old_format);
break;
@@ -591,8 +613,7 @@ Log_event* Log_event::read_log_event(const char* buf, int event_len,
default:
break;
}
- if (!ev) return 0;
- if (!ev->is_valid())
+ if (!ev || !ev->is_valid())
{
*error= "Found invalid event in binary log";
delete ev;
@@ -602,27 +623,24 @@ Log_event* Log_event::read_log_event(const char* buf, int event_len,
return ev;
}
+
#ifdef MYSQL_CLIENT
void Log_event::print_header(FILE* file)
{
char llbuff[22];
fputc('#', file);
print_timestamp(file);
- fprintf(file, " server id %d log_pos %s ", server_id,
+ fprintf(file, " server id %d log_pos %s ", server_id,
llstr(log_pos,llbuff));
}
void Log_event::print_timestamp(FILE* file, time_t* ts)
{
-#ifdef MYSQL_SERVER
- struct tm tm_tmp;
-#endif
struct tm *res;
if (!ts)
- {
ts = &when;
- }
-#ifdef MYSQL_SERVER
+#ifdef MYSQL_SERVER // This is always false
+ struct tm tm_tmp;
localtime_r(ts,(res= &tm_tmp));
#else
res=localtime(ts);
@@ -672,14 +690,16 @@ void Rotate_log_event::print(FILE* file, bool short_form, char* last_db)
if (new_log_ident)
my_fwrite(file, (byte*) new_log_ident, (uint)ident_len,
MYF(MY_NABP | MY_WME));
- fprintf(file, "pos=%s\n", llstr(pos, buf));
+ fprintf(file, " pos: %s\n", llstr(pos, buf));
fflush(file);
}
#endif /* #ifdef MYSQL_CLIENT */
+
Start_log_event::Start_log_event(const char* buf,
- bool old_format) :Log_event(buf, old_format)
+ bool old_format)
+ :Log_event(buf, old_format)
{
buf += (old_format) ? OLD_HEADER_LEN : LOG_EVENT_HEADER_LEN;
binlog_version = uint2korr(buf+ST_BINLOG_VER_OFFSET);
@@ -697,15 +717,15 @@ int Start_log_event::write_data(IO_CACHE* file)
return (my_b_safe_write(file, (byte*) buff, sizeof(buff)) ? -1 : 0);
}
+
Rotate_log_event::Rotate_log_event(const char* buf, int event_len,
- bool old_format):
- Log_event(buf, old_format),new_log_ident(NULL),alloced(0)
+ bool old_format)
+ :Log_event(buf, old_format),new_log_ident(NULL),alloced(0)
{
- // the caller will ensure that event_len is what we have at
- // EVENT_LEN_OFFSET
+ // The caller will ensure that event_len is what we have at EVENT_LEN_OFFSET
int header_size = (old_format) ? OLD_HEADER_LEN : LOG_EVENT_HEADER_LEN;
uint ident_offset;
- if(event_len < header_size)
+ if (event_len < header_size)
return;
buf += header_size;
if (old_format)
@@ -727,34 +747,36 @@ Rotate_log_event::Rotate_log_event(const char* buf, int event_len,
alloced = 1;
}
+
int Rotate_log_event::write_data(IO_CACHE* file)
{
char buf[ROTATE_HEADER_LEN];
int8store(buf, pos + R_POS_OFFSET);
- return my_b_safe_write(file, (byte*)buf, ROTATE_HEADER_LEN) ||
- my_b_safe_write(file, (byte*)new_log_ident, (uint) ident_len);
+ return (my_b_safe_write(file, (byte*)buf, ROTATE_HEADER_LEN) ||
+ my_b_safe_write(file, (byte*)new_log_ident, (uint) ident_len));
}
+
#ifndef MYSQL_CLIENT
Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
- bool using_trans):
- Log_event(thd_arg), data_buf(0), query(query_arg), db(thd_arg->db),
- q_len(thd_arg->query_length),
- error_code(thd_arg->killed ? ER_SERVER_SHUTDOWN: thd_arg->net.last_errno),
- thread_id(thd_arg->thread_id),
- cache_stmt(using_trans &&
- (thd_arg->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN)))
- {
- time_t end_time;
- time(&end_time);
- exec_time = (ulong) (end_time - thd->start_time);
- db_len = (db) ? (uint32) strlen(db) : 0;
- }
+ ulong query_length, bool using_trans)
+ :Log_event(thd_arg), data_buf(0), query(query_arg), db(thd_arg->db),
+ q_len((uint32) query_length),
+ error_code(thd_arg->killed ? ER_SERVER_SHUTDOWN: thd_arg->net.last_errno),
+ thread_id(thd_arg->thread_id),
+ cache_stmt(using_trans &&
+ (thd_arg->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
+{
+ time_t end_time;
+ time(&end_time);
+ exec_time = (ulong) (end_time - thd->start_time);
+ db_len = (db) ? (uint32) strlen(db) : 0;
+}
#endif
Query_log_event::Query_log_event(const char* buf, int event_len,
- bool old_format):
- Log_event(buf, old_format),data_buf(0), query(NULL), db(NULL)
+ bool old_format)
+ :Log_event(buf, old_format),data_buf(0), query(NULL), db(NULL)
{
ulong data_len;
if (old_format)
@@ -787,6 +809,7 @@ Query_log_event::Query_log_event(const char* buf, int event_len,
*((char*)query+q_len) = 0;
}
+
#ifdef MYSQL_CLIENT
void Query_log_event::print(FILE* file, bool short_form, char* last_db)
@@ -801,11 +824,11 @@ void Query_log_event::print(FILE* file, bool short_form, char* last_db)
bool same_db = 0;
- if(db && last_db)
- {
- if(!(same_db = !memcmp(last_db, db, db_len + 1)))
- memcpy(last_db, db, db_len + 1);
- }
+ if (db && last_db)
+ {
+ if (!(same_db = !memcmp(last_db, db, db_len + 1)))
+ memcpy(last_db, db, db_len + 1);
+ }
if (db && db[0] && !same_db)
fprintf(file, "use %s;\n", db);
@@ -816,17 +839,18 @@ void Query_log_event::print(FILE* file, bool short_form, char* last_db)
my_fwrite(file, (byte*) query, q_len, MYF(MY_NABP | MY_WME));
fprintf(file, ";\n");
}
-
#endif
+
int Query_log_event::write_data(IO_CACHE* file)
{
- if (!query) return -1;
+ if (!query)
+ return -1;
char buf[QUERY_HEADER_LEN];
int4store(buf + Q_THREAD_ID_OFFSET, thread_id);
int4store(buf + Q_EXEC_TIME_OFFSET, exec_time);
- buf[Q_DB_LEN_OFFSET] = (char)db_len;
+ buf[Q_DB_LEN_OFFSET] = (char) db_len;
int2store(buf + Q_ERR_CODE_OFFSET, error_code);
return (my_b_safe_write(file, (byte*) buf, QUERY_HEADER_LEN) ||
@@ -834,8 +858,8 @@ int Query_log_event::write_data(IO_CACHE* file)
my_b_safe_write(file, (byte*) query, q_len)) ? -1 : 0;
}
-Intvar_log_event::Intvar_log_event(const char* buf, bool old_format):
- Log_event(buf, old_format)
+Intvar_log_event::Intvar_log_event(const char* buf, bool old_format)
+ :Log_event(buf, old_format)
{
buf += (old_format) ? OLD_HEADER_LEN : LOG_EVENT_HEADER_LEN;
type = buf[I_TYPE_OFFSET];
@@ -844,8 +868,7 @@ Intvar_log_event::Intvar_log_event(const char* buf, bool old_format):
const char* Intvar_log_event::get_var_type_name()
{
- switch(type)
- {
+ switch(type) {
case LAST_INSERT_ID_EVENT: return "LAST_INSERT_ID";
case INSERT_ID_EVENT: return "INSERT_ID";
default: /* impossible */ return "UNKNOWN";
@@ -864,28 +887,30 @@ int Intvar_log_event::write_data(IO_CACHE* file)
void Intvar_log_event::print(FILE* file, bool short_form, char* last_db)
{
char llbuff[22];
- if(!short_form)
+ const char *msg;
+ LINT_INIT(msg);
+
+ if (!short_form)
{
print_header(file);
fprintf(file, "\tIntvar\n");
}
fprintf(file, "SET ");
- switch(type)
- {
+ switch (type) {
case LAST_INSERT_ID_EVENT:
- fprintf(file, "LAST_INSERT_ID = ");
+ msg="LAST_INSERT_ID";
break;
case INSERT_ID_EVENT:
- fprintf(file, "INSERT_ID = ");
+ msg="INSERT_ID";
break;
}
- fprintf(file, "%s;\n", llstr(val,llbuff));
+ fprintf(file, "%s=%s;\n", msg, llstr(val,llbuff));
fflush(file);
-
}
#endif
+
int Load_log_event::write_data_header(IO_CACHE* file)
{
char buf[LOAD_HEADER_LEN];
@@ -900,7 +925,8 @@ int Load_log_event::write_data_header(IO_CACHE* file)
int Load_log_event::write_data_body(IO_CACHE* file)
{
- if (sql_ex.write_data(file)) return 1;
+ if (sql_ex.write_data(file))
+ return 1;
if (num_fields && fields && field_lens)
{
if (my_b_safe_write(file, (byte*)field_lens, num_fields) ||
@@ -913,12 +939,14 @@ int Load_log_event::write_data_body(IO_CACHE* file)
}
+
static bool write_str(IO_CACHE *file, char *str, byte length)
{
return (my_b_safe_write(file, &length, 1) ||
my_b_safe_write(file, (byte*) str, (int) length));
}
+
int sql_ex_info::write_data(IO_CACHE* file)
{
if (new_format())
@@ -944,6 +972,7 @@ int sql_ex_info::write_data(IO_CACHE* file)
}
}
+
static inline int read_str(char * &buf, char *buf_end, char * &str,
uint8 &len)
{
@@ -955,17 +984,19 @@ static inline int read_str(char * &buf, char *buf_end, char * &str,
return 0;
}
+
char* sql_ex_info::init(char* buf,char* buf_end,bool use_new_format)
{
cached_new_format = use_new_format;
if (use_new_format)
{
empty_flags=0;
- /* the code below assumes that buf will not disappear from
- under our feet during the lifetime of the event. This assumption
- holds true in the slave thread if the log is in new format, but is not
- the case when we have old format because we will be reusing net buffer
- to read the actual file before we write out the Create_file event
+ /*
+ The code below assumes that buf will not disappear from
+ under our feet during the lifetime of the event. This assumption
+ holds true in the slave thread if the log is in new format, but is not
+ the case when we have old format because we will be reusing net buffer
+ to read the actual file before we write out the Create_file event.
*/
if (read_str(buf, buf_end, field_term, field_term_len) ||
read_str(buf, buf_end, enclosed, enclosed_len) ||
@@ -978,13 +1009,13 @@ char* sql_ex_info::init(char* buf,char* buf_end,bool use_new_format)
else
{
field_term_len= enclosed_len= line_term_len= line_start_len= escaped_len=1;
- field_term = buf++;
- enclosed= buf++;
- line_term= buf++;
- line_start= buf++;
- escaped= buf++;
- opt_flags = *buf++;
- empty_flags=*buf++;
+ field_term = buf++; // Use first byte in string
+ enclosed= buf++;
+ line_term= buf++;
+ line_start= buf++;
+ escaped= buf++;
+ opt_flags = *buf++;
+ empty_flags= *buf++;
if (empty_flags & FIELD_TERM_EMPTY)
field_term_len=0;
if (empty_flags & ENCLOSED_EMPTY)
@@ -1003,81 +1034,83 @@ char* sql_ex_info::init(char* buf,char* buf_end,bool use_new_format)
#ifndef MYSQL_CLIENT
Load_log_event::Load_log_event(THD* thd, sql_exchange* ex,
const char* db_arg, const char* table_name_arg,
- List<Item>& fields_arg, enum enum_duplicates handle_dup):
- Log_event(thd),thread_id(thd->thread_id),
- num_fields(0),fields(0),field_lens(0),field_block_len(0),
- table_name(table_name_arg),
- db(db_arg),
- fname(ex->file_name)
- {
- time_t end_time;
- time(&end_time);
- exec_time = (ulong) (end_time - thd->start_time);
- db_len = (db) ? (uint32) strlen(db) : 0;
- table_name_len = (table_name) ? (uint32) strlen(table_name) : 0;
- fname_len = (fname) ? (uint) strlen(fname) : 0;
- sql_ex.field_term = (char*) ex->field_term->ptr();
- sql_ex.field_term_len = (uint8) ex->field_term->length();
- sql_ex.enclosed = (char*) ex->enclosed->ptr();
- sql_ex.enclosed_len = (uint8) ex->enclosed->length();
- sql_ex.line_term = (char*) ex->line_term->ptr();
- sql_ex.line_term_len = (uint8) ex->line_term->length();
- sql_ex.line_start = (char*) ex->line_start->ptr();
- sql_ex.line_start_len = (uint8) ex->line_start->length();
- sql_ex.escaped = (char*) ex->escaped->ptr();
- sql_ex.escaped_len = (uint8) ex->escaped->length();
- sql_ex.opt_flags = 0;
- sql_ex.cached_new_format = -1;
+ List<Item>& fields_arg,
+ enum enum_duplicates handle_dup)
+ :Log_event(thd),thread_id(thd->thread_id), num_fields(0),fields(0),
+ field_lens(0),field_block_len(0),
+ table_name(table_name_arg ? table_name_arg : ""),
+ db(db_arg), fname(ex->file_name)
+{
+ time_t end_time;
+ time(&end_time);
+ exec_time = (ulong) (end_time - thd->start_time);
+ /* db can never be a zero pointer in 4.0 */
+ db_len = (uint32) strlen(db);
+ table_name_len = (uint32) strlen(table_name);
+ fname_len = (fname) ? (uint) strlen(fname) : 0;
+ sql_ex.field_term = (char*) ex->field_term->ptr();
+ sql_ex.field_term_len = (uint8) ex->field_term->length();
+ sql_ex.enclosed = (char*) ex->enclosed->ptr();
+ sql_ex.enclosed_len = (uint8) ex->enclosed->length();
+ sql_ex.line_term = (char*) ex->line_term->ptr();
+ sql_ex.line_term_len = (uint8) ex->line_term->length();
+ sql_ex.line_start = (char*) ex->line_start->ptr();
+ sql_ex.line_start_len = (uint8) ex->line_start->length();
+ sql_ex.escaped = (char*) ex->escaped->ptr();
+ sql_ex.escaped_len = (uint8) ex->escaped->length();
+ sql_ex.opt_flags = 0;
+ sql_ex.cached_new_format = -1;
- if(ex->dumpfile)
- sql_ex.opt_flags |= DUMPFILE_FLAG;
- if(ex->opt_enclosed)
- sql_ex.opt_flags |= OPT_ENCLOSED_FLAG;
-
- sql_ex.empty_flags = 0;
-
- switch(handle_dup)
- {
- case DUP_IGNORE: sql_ex.opt_flags |= IGNORE_FLAG; break;
- case DUP_REPLACE: sql_ex.opt_flags |= REPLACE_FLAG; break;
- case DUP_ERROR: break;
- }
-
-
- if(!ex->field_term->length())
- sql_ex.empty_flags |= FIELD_TERM_EMPTY;
- if(!ex->enclosed->length())
- sql_ex.empty_flags |= ENCLOSED_EMPTY;
- if(!ex->line_term->length())
- sql_ex.empty_flags |= LINE_TERM_EMPTY;
- if(!ex->line_start->length())
- sql_ex.empty_flags |= LINE_START_EMPTY;
- if(!ex->escaped->length())
- sql_ex.empty_flags |= ESCAPED_EMPTY;
+ if (ex->dumpfile)
+ sql_ex.opt_flags |= DUMPFILE_FLAG;
+ if (ex->opt_enclosed)
+ sql_ex.opt_flags |= OPT_ENCLOSED_FLAG;
+
+ sql_ex.empty_flags = 0;
+
+ switch (handle_dup) {
+ case DUP_IGNORE: sql_ex.opt_flags |= IGNORE_FLAG; break;
+ case DUP_REPLACE: sql_ex.opt_flags |= REPLACE_FLAG; break;
+ case DUP_ERROR: break;
+ }
+
+ if (!ex->field_term->length())
+ sql_ex.empty_flags |= FIELD_TERM_EMPTY;
+ if (!ex->enclosed->length())
+ sql_ex.empty_flags |= ENCLOSED_EMPTY;
+ if (!ex->line_term->length())
+ sql_ex.empty_flags |= LINE_TERM_EMPTY;
+ if (!ex->line_start->length())
+ sql_ex.empty_flags |= LINE_START_EMPTY;
+ if (!ex->escaped->length())
+ sql_ex.empty_flags |= ESCAPED_EMPTY;
- skip_lines = ex->skip_lines;
-
- List_iterator<Item> li(fields_arg);
- field_lens_buf.length(0);
- fields_buf.length(0);
- Item* item;
- while((item = li++))
- {
- num_fields++;
- uchar len = (uchar) strlen(item->name);
- field_block_len += len + 1;
- fields_buf.append(item->name, len + 1);
- field_lens_buf.append((char*)&len, 1);
- }
+ skip_lines = ex->skip_lines;
- field_lens = (const uchar*)field_lens_buf.ptr();
- fields = fields_buf.ptr();
+ List_iterator<Item> li(fields_arg);
+ field_lens_buf.length(0);
+ fields_buf.length(0);
+ Item* item;
+ while ((item = li++))
+ {
+ num_fields++;
+ uchar len = (uchar) strlen(item->name);
+ field_block_len += len + 1;
+ fields_buf.append(item->name, len + 1);
+ field_lens_buf.append((char*)&len, 1);
}
+ field_lens = (const uchar*)field_lens_buf.ptr();
+ fields = fields_buf.ptr();
+}
+
#endif
-// the caller must do buf[event_len] = 0 before he starts using the
-// constructed event
+/*
+ The caller must do buf[event_len] = 0 before he starts using the
+ constructed event.
+*/
+
Load_log_event::Load_log_event(const char* buf, int event_len,
bool old_format):
Log_event(buf, old_format),num_fields(0),fields(0),
@@ -1095,7 +1128,7 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len,
uint data_len;
char* buf_end = (char*)buf + event_len;
const char* data_head = buf + ((old_format) ?
- OLD_HEADER_LEN : LOG_EVENT_HEADER_LEN);
+ OLD_HEADER_LEN : LOG_EVENT_HEADER_LEN);
thread_id = uint4korr(data_head + L_THREAD_ID_OFFSET);
exec_time = uint4korr(data_head + L_EXEC_TIME_OFFSET);
skip_lines = uint4korr(data_head + L_SKIP_LINES_OFFSET);
@@ -1103,13 +1136,16 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len,
db_len = (uint)data_head[L_DB_LEN_OFFSET];
num_fields = uint4korr(data_head + L_NUM_FIELDS_OFFSET);
- int body_offset = (buf[EVENT_TYPE_OFFSET] == LOAD_EVENT) ?
- LOAD_HEADER_LEN + OLD_HEADER_LEN : get_data_body_offset();
+ int body_offset = ((buf[EVENT_TYPE_OFFSET] == LOAD_EVENT) ?
+ LOAD_HEADER_LEN + OLD_HEADER_LEN :
+ get_data_body_offset());
if ((int) event_len < body_offset)
return 1;
- //sql_ex.init() on success returns the pointer to the first byte after
- //the sql_ex structure, which is the start of field lengths array
+ /*
+ Sql_ex.init() on success returns the pointer to the first byte after
+ the sql_ex structure, which is the start of field lengths array.
+ */
if (!(field_lens=(uchar*)sql_ex.init((char*)buf + body_offset,
buf_end,
buf[EVENT_TYPE_OFFSET] != LOAD_EVENT)))
@@ -1118,11 +1154,9 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len,
data_len = event_len - body_offset;
if (num_fields > data_len) // simple sanity check against corruption
return 1;
- uint i;
- for (i = 0; i < num_fields; i++)
- {
+ for (uint i = 0; i < num_fields; i++)
field_block_len += (uint)field_lens[i] + 1;
- }
+
fields = (char*)field_lens + num_fields;
table_name = fields + field_block_len;
db = table_name + table_name_len + 1;
@@ -1144,33 +1178,32 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db)
}
bool same_db = 0;
-
- if(db && last_db)
- {
- if(!(same_db = !memcmp(last_db, db, db_len + 1)))
- memcpy(last_db, db, db_len + 1);
- }
+ if (db && last_db)
+ {
+ if (!(same_db = !memcmp(last_db, db, db_len + 1)))
+ memcpy(last_db, db, db_len + 1);
+ }
- if(db && db[0] && !same_db)
+ if (db && db[0] && !same_db)
fprintf(file, "use %s;\n", db);
fprintf(file, "LOAD DATA INFILE '%-*s' ", fname_len, fname);
- if(sql_ex.opt_flags && REPLACE_FLAG )
+ if (sql_ex.opt_flags && REPLACE_FLAG )
fprintf(file," REPLACE ");
- else if(sql_ex.opt_flags && IGNORE_FLAG )
+ else if (sql_ex.opt_flags && IGNORE_FLAG )
fprintf(file," IGNORE ");
fprintf(file, "INTO TABLE %s ", table_name);
- if(sql_ex.field_term)
+ if (sql_ex.field_term)
{
fprintf(file, " FIELDS TERMINATED BY ");
pretty_print_str(file, sql_ex.field_term, sql_ex.field_term_len);
}
- if(sql_ex.enclosed)
+ if (sql_ex.enclosed)
{
- if(sql_ex.opt_flags && OPT_ENCLOSED_FLAG )
+ if (sql_ex.opt_flags && OPT_ENCLOSED_FLAG )
fprintf(file," OPTIONALLY ");
fprintf(file, " ENCLOSED BY ");
pretty_print_str(file, sql_ex.enclosed, sql_ex.enclosed_len);
@@ -1194,17 +1227,17 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db)
pretty_print_str(file, sql_ex.line_start, sql_ex.line_start_len);
}
- if((int)skip_lines > 0)
+ if ((int)skip_lines > 0)
fprintf(file, " IGNORE %ld LINES ", (long) skip_lines);
if (num_fields)
{
uint i;
const char* field = fields;
- fprintf( file, " (");
- for(i = 0; i < num_fields; i++)
+ fprintf(file, " (");
+ for (i = 0; i < num_fields; i++)
{
- if(i)
+ if (i)
fputc(',', file);
fprintf(file, field);
@@ -1221,10 +1254,11 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db)
#ifndef MYSQL_CLIENT
void Log_event::set_log_pos(MYSQL_LOG* log)
- {
- if (!log_pos)
- log_pos = my_b_tell(&log->log_file);
- }
+{
+ if (!log_pos)
+ log_pos = my_b_tell(&log->log_file);
+}
+
void Load_log_event::set_fields(List<Item> &fields)
{
@@ -1242,8 +1276,9 @@ Slave_log_event::Slave_log_event(THD* thd_arg,
struct st_relay_log_info* rli):
Log_event(thd_arg),mem_pool(0),master_host(0)
{
- if (!rli->inited)
- return;
+ DBUG_ENTER("Slave_log_event");
+ if (!rli->inited) // QQ When can this happen ?
+ DBUG_VOID_RETURN;
MASTER_INFO* mi = rli->mi;
// TODO: re-write this better without holding both locks at the same time
@@ -1261,15 +1296,17 @@ Slave_log_event::Slave_log_event(THD* thd_arg,
memcpy(master_log, rli->master_log_name, master_log_len + 1);
master_port = mi->port;
master_pos = rli->master_log_pos;
+ DBUG_PRINT("info", ("master_log: %s pos: %d", master_log,
+ (ulong) master_pos));
}
else
sql_print_error("Out of memory while recording slave event");
pthread_mutex_unlock(&rli->data_lock);
pthread_mutex_unlock(&mi->data_lock);
+ DBUG_VOID_RETURN;
}
-
-#endif
+#endif /* ! MYSQL_CLIENT */
Slave_log_event::~Slave_log_event()
@@ -1282,16 +1319,16 @@ Slave_log_event::~Slave_log_event()
void Slave_log_event::print(FILE* file, bool short_form, char* last_db)
{
char llbuff[22];
- if(short_form)
+ if (short_form)
return;
print_header(file);
fputc('\n', file);
- fprintf(file, "Slave: master_host='%s' master_port=%d \
- master_log=%s master_pos=%s\n",
+ fprintf(file, "Slave: master_host: '%s' master_port: %d \
+master_log: '%s' master_pos: %s\n",
master_host, master_port, master_log, llstr(master_pos, llbuff));
}
-#endif
+#endif /* MYSQL_CLIENT */
int Slave_log_event::get_data_size()
{
@@ -1306,6 +1343,7 @@ int Slave_log_event::write_data(IO_CACHE* file)
return my_b_safe_write(file, (byte*)mem_pool, get_data_size());
}
+
void Slave_log_event::init_from_mem_pool(int data_size)
{
master_pos = uint8korr(mem_pool + SL_MASTER_POS_OFFSET);
@@ -1314,7 +1352,7 @@ void Slave_log_event::init_from_mem_pool(int data_size)
master_host_len = strlen(master_host);
// safety
master_log = master_host + master_host_len + 1;
- if(master_log > mem_pool + data_size)
+ if (master_log > mem_pool + data_size)
{
master_host = 0;
return;
@@ -1322,13 +1360,13 @@ void Slave_log_event::init_from_mem_pool(int data_size)
master_log_len = strlen(master_log);
}
-Slave_log_event::Slave_log_event(const char* buf, int event_len):
- Log_event(buf,0),mem_pool(0),master_host(0)
+Slave_log_event::Slave_log_event(const char* buf, int event_len)
+ :Log_event(buf,0),mem_pool(0),master_host(0)
{
event_len -= LOG_EVENT_HEADER_LEN;
- if(event_len < 0)
+ if (event_len < 0)
return;
- if(!(mem_pool = (char*)my_malloc(event_len + 1, MYF(MY_WME))))
+ if (!(mem_pool = (char*) my_malloc(event_len + 1, MYF(MY_WME))))
return;
memcpy(mem_pool, buf + LOG_EVENT_HEADER_LEN, event_len);
mem_pool[event_len] = 0;
@@ -1339,10 +1377,10 @@ Slave_log_event::Slave_log_event(const char* buf, int event_len):
Create_file_log_event::Create_file_log_event(THD* thd_arg, sql_exchange* ex,
const char* db_arg, const char* table_name_arg,
List<Item>& fields_arg, enum enum_duplicates handle_dup,
- char* block_arg, uint block_len_arg):
- Load_log_event(thd_arg,ex,db_arg,table_name_arg,fields_arg,handle_dup),
- fake_base(0),block(block_arg),block_len(block_len_arg),
- file_id(thd_arg->file_id = mysql_bin_log.next_file_id())
+ char* block_arg, uint block_len_arg)
+ :Load_log_event(thd_arg,ex,db_arg,table_name_arg,fields_arg,handle_dup),
+ fake_base(0),block(block_arg),block_len(block_len_arg),
+ file_id(thd_arg->file_id = mysql_bin_log.next_file_id())
{
sql_ex.force_new_format();
}
@@ -1377,8 +1415,8 @@ int Create_file_log_event::write_base(IO_CACHE* file)
}
Create_file_log_event::Create_file_log_event(const char* buf, int len,
- bool old_format):
- Load_log_event(buf,0,old_format),fake_base(0),block(0),inited_from_old(0)
+ bool old_format)
+ :Load_log_event(buf,0,old_format),fake_base(0),block(0),inited_from_old(0)
{
int block_offset;
if (copy_log_event(buf,len,old_format))
@@ -1387,8 +1425,9 @@ Create_file_log_event::Create_file_log_event(const char* buf, int len,
{
file_id = uint4korr(buf + LOG_EVENT_HEADER_LEN +
+ LOAD_HEADER_LEN + CF_FILE_ID_OFFSET);
- block_offset = LOG_EVENT_HEADER_LEN + Load_log_event::get_data_size() +
- CREATE_FILE_HEADER_LEN + 1; // 1 for \0 terminating fname
+ // + 1 for \0 terminating fname
+ block_offset = (LOG_EVENT_HEADER_LEN + Load_log_event::get_data_size() +
+ CREATE_FILE_HEADER_LEN + 1);
if (len < block_offset)
return;
block = (char*)buf + block_offset;
@@ -1409,42 +1448,44 @@ void Create_file_log_event::print(FILE* file, bool short_form,
if (short_form)
return;
Load_log_event::print(file, 1, last_db);
- fprintf(file, " file_id=%d, block_len=%d\n", file_id, block_len);
+ fprintf(file, " file_id: %d block_len: %d\n", file_id, block_len);
}
#endif
#ifndef MYSQL_CLIENT
void Create_file_log_event::pack_info(String* packet)
{
- char buf1[256];
+ char buf1[256],buf[22], *end;
String tmp(buf1, sizeof(buf1), system_charset_info);
tmp.length(0);
- char buf[22];
tmp.append("db=");
tmp.append(db, db_len);
tmp.append(";table=");
tmp.append(table_name, table_name_len);
tmp.append(";file_id=");
- tmp.append(llstr(file_id,buf));
+ end= int10_to_str((long) file_id, buf, 10);
+ tmp.append(buf, (uint32) (end-buf));
tmp.append(";block_len=");
- tmp.append(llstr(block_len,buf));
- net_store_data(packet, (char*)tmp.ptr(), tmp.length());
+ end= int10_to_str((long) block_len, buf, 10);
+ tmp.append(buf, (uint32) (end-buf));
+ net_store_data(packet, (char*) tmp.ptr(), tmp.length());
}
#endif
#ifndef MYSQL_CLIENT
Append_block_log_event::Append_block_log_event(THD* thd_arg, char* block_arg,
- uint block_len_arg):
- Log_event(thd_arg), block(block_arg),block_len(block_len_arg),
- file_id(thd_arg->file_id)
+ uint block_len_arg)
+ :Log_event(thd_arg), block(block_arg),block_len(block_len_arg),
+ file_id(thd_arg->file_id)
{
}
#endif
+
-Append_block_log_event::Append_block_log_event(const char* buf, int len):
- Log_event(buf, 0),block(0)
+Append_block_log_event::Append_block_log_event(const char* buf, int len)
+ :Log_event(buf, 0),block(0)
{
- if((uint)len < APPEND_BLOCK_EVENT_OVERHEAD)
+ if ((uint)len < APPEND_BLOCK_EVENT_OVERHEAD)
return;
file_id = uint4korr(buf + LOG_EVENT_HEADER_LEN + AB_FILE_ID_OFFSET);
block = (char*)buf + APPEND_BLOCK_EVENT_OVERHEAD;
@@ -1467,40 +1508,36 @@ void Append_block_log_event::print(FILE* file, bool short_form,
return;
print_header(file);
fputc('\n', file);
- fprintf(file, "#Append_block: file_id=%d, block_len=%d\n",
+ fprintf(file, "#Append_block: file_id: %d block_len: %d\n",
file_id, block_len);
}
#endif
+
#ifndef MYSQL_CLIENT
void Append_block_log_event::pack_info(String* packet)
{
char buf1[256];
- String tmp(buf1, sizeof(buf1), system_charset_info);
- tmp.length(0);
- char buf[22];
- tmp.append(";file_id=");
- tmp.append(llstr(file_id,buf));
- tmp.append(";block_len=");
- tmp.append(llstr(block_len,buf));
- net_store_data(packet, (char*)tmp.ptr(), tmp.length());
+ sprintf(buf1, ";file_id=%u;block_len=%u", file_id, block_len);
+ net_store_data(packet, buf1);
}
-#endif
-#ifndef MYSQL_CLIENT
-Delete_file_log_event::Delete_file_log_event(THD* thd_arg):
- Log_event(thd_arg),file_id(thd_arg->file_id)
+
+Delete_file_log_event::Delete_file_log_event(THD* thd_arg)
+ :Log_event(thd_arg),file_id(thd_arg->file_id)
{
}
-#endif
+#endif
+
-Delete_file_log_event::Delete_file_log_event(const char* buf, int len):
- Log_event(buf, 0),file_id(0)
+Delete_file_log_event::Delete_file_log_event(const char* buf, int len)
+ :Log_event(buf, 0),file_id(0)
{
- if((uint)len < DELETE_FILE_EVENT_OVERHEAD)
+ if ((uint)len < DELETE_FILE_EVENT_OVERHEAD)
return;
file_id = uint4korr(buf + LOG_EVENT_HEADER_LEN + AB_FILE_ID_OFFSET);
}
+
int Delete_file_log_event::write_data(IO_CACHE* file)
{
byte buf[DELETE_FILE_HEADER_LEN];
@@ -1516,38 +1553,37 @@ void Delete_file_log_event::print(FILE* file, bool short_form,
return;
print_header(file);
fputc('\n', file);
- fprintf(file, "#Delete_file: file_id=%d\n",
- file_id);
+ fprintf(file, "#Delete_file: file_id=%u\n", file_id);
}
-#endif
+#endif
+
#ifndef MYSQL_CLIENT
void Delete_file_log_event::pack_info(String* packet)
{
- char buf1[256];
- String tmp(buf1, sizeof(buf1), system_charset_info);
- tmp.length(0);
- char buf[22];
- tmp.append(";file_id=");
- tmp.append(llstr(file_id,buf));
- net_store_data(packet, (char*)tmp.ptr(), tmp.length());
+ char buf1[64];
+ sprintf(buf1, ";file_id=%u", (uint) file_id);
+ net_store_data(packet, buf1);
}
#endif
+
#ifndef MYSQL_CLIENT
-Execute_load_log_event::Execute_load_log_event(THD* thd_arg):
- Log_event(thd_arg),file_id(thd_arg->file_id)
+Execute_load_log_event::Execute_load_log_event(THD* thd_arg)
+ :Log_event(thd_arg),file_id(thd_arg->file_id)
{
}
#endif
-Execute_load_log_event::Execute_load_log_event(const char* buf,int len):
- Log_event(buf, 0),file_id(0)
+
+Execute_load_log_event::Execute_load_log_event(const char* buf,int len)
+ :Log_event(buf, 0),file_id(0)
{
- if((uint)len < EXEC_LOAD_EVENT_OVERHEAD)
+ if ((uint)len < EXEC_LOAD_EVENT_OVERHEAD)
return;
file_id = uint4korr(buf + LOG_EVENT_HEADER_LEN + EL_FILE_ID_OFFSET);
}
+
int Execute_load_log_event::write_data(IO_CACHE* file)
{
byte buf[EXEC_LOAD_HEADER_LEN];
@@ -1570,13 +1606,9 @@ void Execute_load_log_event::print(FILE* file, bool short_form,
#ifndef MYSQL_CLIENT
void Execute_load_log_event::pack_info(String* packet)
{
- char buf1[256];
- String tmp(buf1, sizeof(buf1), system_charset_info);
- tmp.length(0);
- char buf[22];
- tmp.append(";file_id=");
- tmp.append(llstr(file_id,buf));
- net_store_data(packet, (char*)tmp.ptr(), tmp.length());
+ char buf[64];
+ sprintf(buf, ";file_id=%u", (uint) file_id);
+ net_store_data(packet, buf);
}
#endif
@@ -1587,6 +1619,14 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
init_sql_alloc(&thd->mem_root, 8192,0);
thd->db = rewrite_db((char*)db);
DBUG_ASSERT(q_len == strlen(query));
+
+ /*
+ InnoDB internally stores the master log position it has processed so far;
+ position to store is really pos + pending + event_len
+ since we must store the pos of the END of the current log event
+ */
+ rli->event_len= get_event_len();
+
if (db_ok(thd->db, replicate_do_db, replicate_ignore_db))
{
thd->query = (char*)query;
@@ -1598,16 +1638,18 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
thd->query_error = 0; // clear error
thd->net.last_errno = 0;
thd->net.last_error[0] = 0;
- thd->slave_proxy_id = thread_id; // for temp tables
+ thd->slave_proxy_id = thread_id; // for temp tables
- // sanity check to make sure the master did not get a really bad
- // error on the query
+ /*
+ Sanity check to make sure the master did not get a really bad
+ error on the query.
+ */
if (ignored_error_code((expected_error = error_code)) ||
!check_expected_error(thd,rli,expected_error))
{
mysql_parse(thd, thd->query, q_len);
- if (expected_error !=
- (actual_error = thd->net.last_errno) && expected_error &&
+ if ((expected_error != (actual_error = thd->net.last_errno)) &&
+ expected_error &&
!ignored_error_code(actual_error) &&
!ignored_error_code(expected_error))
{
@@ -1619,8 +1661,8 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
actual_error);
thd->query_error = 1;
}
- else if (expected_error == actual_error
- || ignored_error_code(actual_error))
+ else if (expected_error == actual_error ||
+ ignored_error_code(actual_error))
{
thd->query_error = 0;
*rli->last_slave_error = 0;
@@ -1631,23 +1673,23 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
{
// master could be inconsistent, abort and tell DBA to check/fix it
thd->db = thd->query = 0;
- thd->convert_set = 0;
+ thd->variables.convert_set = 0;
close_thread_tables(thd);
free_root(&thd->mem_root,0);
return 1;
}
}
- thd->db = 0; // prevent db from being freed
- thd->query = 0; // just to be sure
+ thd->db= 0; // prevent db from being freed
+ thd->query= 0; // just to be sure
// assume no convert for next query unless set explictly
- thd->convert_set = 0;
+ thd->variables.convert_set = 0;
close_thread_tables(thd);
if (thd->query_error || thd->fatal_error)
{
slave_print_error(rli,actual_error, "error '%s' on query '%s'",
- actual_error ? thd->net.last_error :
- "unexpected success or fatal error", query);
+ actual_error ? thd->net.last_error :
+ "unexpected success or fatal error", query);
free_root(&thd->mem_root,0);
return 1;
}
@@ -1655,6 +1697,7 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
return Log_event::exec_event(rli);
}
+
int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli)
{
init_sql_alloc(&thd->mem_root, 8192,0);
@@ -1662,7 +1705,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli)
thd->query = 0;
thd->query_error = 0;
- if(db_ok(thd->db, replicate_do_db, replicate_ignore_db))
+ if (db_ok(thd->db, replicate_do_db, replicate_ignore_db))
{
thd->set_time((time_t)when);
thd->current_tablenr = 0;
@@ -1676,7 +1719,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli)
tables.name = tables.real_name = (char*)table_name;
tables.lock_type = TL_WRITE;
// the table will be opened in mysql_load
- if(table_rules_on && !tables_ok(thd, &tables))
+ if (table_rules_on && !tables_ok(thd, &tables))
{
// TODO: this is a bug - this needs to be moved to the I/O thread
if (net)
@@ -1690,10 +1733,14 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli)
handle_dup = DUP_REPLACE;
sql_exchange ex((char*)fname, sql_ex.opt_flags &&
DUMPFILE_FLAG );
- String field_term(sql_ex.field_term,sql_ex.field_term_len, system_charset_info);
- String enclosed(sql_ex.enclosed,sql_ex.enclosed_len, system_charset_info);
- String line_term(sql_ex.line_term,sql_ex.line_term_len, system_charset_info);
- String line_start(sql_ex.line_start,sql_ex.line_start_len, system_charset_info);
+ String field_term(sql_ex.field_term,sql_ex.field_term_len,
+ system_charset_info);
+ String enclosed(sql_ex.enclosed,sql_ex.enclosed_len,
+ system_charset_info);
+ String line_term(sql_ex.line_term,sql_ex.line_term_len,
+ system_charset_info);
+ String line_start(sql_ex.line_start,sql_ex.line_start_len,
+ system_charset_info);
String escaped(sql_ex.escaped,sql_ex.escaped_len, system_charset_info);
ex.opt_enclosed = (sql_ex.opt_flags & OPT_ENCLOSED_FLAG);
@@ -1708,34 +1755,37 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli)
{
// mysql_load will use thd->net to read the file
thd->net.vio = net->vio;
- // make sure the client does not get confused
- // about the packet sequence
+ /*
+ Make sure the client does not get confused about the packet sequence
+ */
thd->net.pkt_nr = net->pkt_nr;
}
- if(mysql_load(thd, &ex, &tables, fields, handle_dup, net != 0,
- TL_WRITE))
+ if (mysql_load(thd, &ex, &tables, fields, handle_dup, net != 0,
+ TL_WRITE))
thd->query_error = 1;
- if(thd->cuted_fields)
+ if (thd->cuted_fields)
sql_print_error("Slave: load data infile at position %s in log \
'%s' produced %d warning(s)", llstr(rli->master_log_pos,llbuff), RPL_LOG_NAME,
thd->cuted_fields );
- if(net)
- net->pkt_nr = thd->net.pkt_nr;
+ if (net)
+ net->pkt_nr= thd->net.pkt_nr;
}
}
else
{
- // we will just ask the master to send us /dev/null if we do not
- // want to load the data
- // TODO: this a bug - needs to be done in I/O thread
+ /*
+ We will just ask the master to send us /dev/null if we do not
+ want to load the data.
+ TODO: this a bug - needs to be done in I/O thread
+ */
if (net)
skip_load_data_infile(net);
}
thd->net.vio = 0;
- thd->db = 0;// prevent db from being freed
+ thd->db= 0; // prevent db from being freed
close_thread_tables(thd);
- if(thd->query_error)
+ if (thd->query_error)
{
int sql_error = thd->net.last_errno;
if (!sql_error)
@@ -1743,13 +1793,13 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli)
slave_print_error(rli,sql_error,
"Slave: Error '%s' running load data infile ",
- ER_SAFE(sql_error));
+ ER_SAFE(sql_error));
free_root(&thd->mem_root,0);
return 1;
}
free_root(&thd->mem_root,0);
- if(thd->fatal_error)
+ if (thd->fatal_error)
{
sql_print_error("Slave: Fatal error running LOAD DATA INFILE ");
return 1;
@@ -1758,53 +1808,105 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli)
return Log_event::exec_event(rli);
}
+
+/*
+ The master started
+
+ IMPLEMENTATION
+ - To handle the case where the master died without a stop event,
+ we clean up all temporary tables + locks that we got.
+
+ TODO
+ - Remove all active user locks
+ - If we have an active transaction at this point, the master died
+ in the middle while writing the transaction to the binary log.
+ In this case we should stop the slave.
+*/
+
int Start_log_event::exec_event(struct st_relay_log_info* rli)
{
+ /* All temporary tables was deleted on the master */
close_temporary_tables(thd);
- // if we have old format, load_tmpdir is cleaned up by the I/O thread
- // TODO: cleanup_load_tmpdir() needs to remove only the files associated
- // with the server id that has just started
+ /*
+ If we have old format, load_tmpdir is cleaned up by the I/O thread
+ */
if (!rli->mi->old_format)
cleanup_load_tmpdir();
return Log_event::exec_event(rli);
}
+
+/*
+ The master stopped. Clean up all temporary tables + locks that the
+ master may have set.
+
+ TODO
+ - Remove all active user locks
+*/
+
int Stop_log_event::exec_event(struct st_relay_log_info* rli)
{
// do not clean up immediately after rotate event
- if (rli->master_log_pos > 4)
+ if (rli->master_log_pos > BIN_LOG_HEADER_SIZE)
{
close_temporary_tables(thd);
cleanup_load_tmpdir();
}
/*
We do not want to update master_log pos because we get a rotate event
- before stop, so by now master_log_name is set to the next log
- if we updated it, we will have incorrect master coordinates and this
+ before stop, so by now master_log_name is set to the next log.
+ If we updated it, we will have incorrect master coordinates and this
could give false triggers in MASTER_POS_WAIT() that we have reached
- the targed position when in fact we have not
+ the target position when in fact we have not.
*/
rli->inc_pos(get_event_len(), 0);
flush_relay_log_info(rli);
return 0;
}
+
+/*
+ Got a rotate log even from the master
+
+ IMPLEMENTATION
+ - Rotate the log file if the name of the log file changed
+ (In practice this should always be the case)
+
+ TODO
+ - Investigate/Test if we can't ignore all rotate log events
+ that we get from the master (and not even write it to the local
+ binary log).
+
+ RETURN VALUES
+ 0 ok
+ 1 Impossible new log file name (rotate log event is ignored)
+*/
+
+
int Rotate_log_event::exec_event(struct st_relay_log_info* rli)
{
bool rotate_binlog = 0, write_slave_event = 0;
char* log_name = rli->master_log_name;
+ DBUG_ENTER("Rotate_log_event::exec_event");
+
pthread_mutex_lock(&rli->data_lock);
- // TODO: probably needs re-write
- // rotate local binlog only if the name of remote has changed
- if (!*log_name || !(log_name[ident_len] == 0 &&
- !memcmp(log_name, new_log_ident, ident_len)))
+ /*
+ TODO: probably needs re-write
+ rotate local binlog only if the name of remote has changed
+ */
+ if (!*log_name || (memcmp(log_name, new_log_ident, ident_len) ||
+ log_name[ident_len] != 0))
{
- write_slave_event = (!(flags & LOG_EVENT_FORCED_ROTATE_F)
- && mysql_bin_log.is_open());
+ write_slave_event = (!(flags & LOG_EVENT_FORCED_ROTATE_F) &&
+ mysql_bin_log.is_open());
rotate_binlog = (*log_name && write_slave_event);
if (ident_len >= sizeof(rli->master_log_name))
- return 1;
- memcpy(log_name, new_log_ident,ident_len);
+ {
+ // This should be impossible
+ pthread_mutex_unlock(&rli->data_lock);
+ DBUG_RETURN(1);
+ }
+ memcpy(log_name, new_log_ident, ident_len);
log_name[ident_len] = 0;
}
rli->master_log_pos = pos;
@@ -1812,8 +1914,9 @@ int Rotate_log_event::exec_event(struct st_relay_log_info* rli)
if (rotate_binlog)
{
mysql_bin_log.new_file();
- rli->master_log_pos = 4;
+ rli->master_log_pos = BIN_LOG_HEADER_SIZE;
}
+ DBUG_PRINT("info", ("master_log_pos: %d", (ulong) rli->master_log_pos));
pthread_cond_broadcast(&rli->data_cond);
pthread_mutex_unlock(&rli->data_lock);
flush_relay_log_info(rli);
@@ -1828,13 +1931,12 @@ int Rotate_log_event::exec_event(struct st_relay_log_info* rli)
mysql_bin_log.write(&s);
}
}
- return 0;
+ DBUG_RETURN(0);
}
int Intvar_log_event::exec_event(struct st_relay_log_info* rli)
{
- switch (type)
- {
+ switch (type) {
case LAST_INSERT_ID_EVENT:
thd->last_insert_id_used = 1;
thd->last_insert_id = val;
@@ -1849,7 +1951,7 @@ int Intvar_log_event::exec_event(struct st_relay_log_info* rli)
int Slave_log_event::exec_event(struct st_relay_log_info* rli)
{
- if(mysql_bin_log.is_open())
+ if (mysql_bin_log.is_open())
mysql_bin_log.write(this);
return Log_event::exec_event(rli);
}
@@ -1901,7 +2003,8 @@ int Create_file_log_event::exec_event(struct st_relay_log_info* rli)
}
if (mysql_bin_log.is_open())
mysql_bin_log.write(this);
- error=0;
+ error=0; // Everything is ok
+
err:
if (error)
end_io_cache(&file);
@@ -1913,12 +2016,11 @@ err:
int Delete_file_log_event::exec_event(struct st_relay_log_info* rli)
{
char fname[FN_REFLEN+10];
- char* p;
- p = slave_load_file_stem(fname, file_id, server_id);
+ char *p= slave_load_file_stem(fname, file_id, server_id);
memcpy(p, ".data", 6);
- (void)my_delete(fname, MYF(MY_WME));
+ (void) my_delete(fname, MYF(MY_WME));
memcpy(p, ".info", 6);
- (void)my_delete(fname, MYF(MY_WME));
+ (void) my_delete(fname, MYF(MY_WME));
if (mysql_bin_log.is_open())
mysql_bin_log.write(this);
return Log_event::exec_event(rli);
@@ -1927,10 +2029,10 @@ int Delete_file_log_event::exec_event(struct st_relay_log_info* rli)
int Append_block_log_event::exec_event(struct st_relay_log_info* rli)
{
char fname[FN_REFLEN+10];
- char* p;
- int fd = -1;
+ char *p= slave_load_file_stem(fname, file_id, server_id);
+ int fd;
int error = 1;
- p = slave_load_file_stem(fname, file_id, server_id);
+
memcpy(p, ".data", 6);
if ((fd = my_open(fname, O_WRONLY|O_APPEND|O_BINARY, MYF(MY_WME))) < 0)
{
@@ -1945,6 +2047,7 @@ int Append_block_log_event::exec_event(struct st_relay_log_info* rli)
if (mysql_bin_log.is_open())
mysql_bin_log.write(this);
error=0;
+
err:
if (fd >= 0)
my_close(fd, MYF(0));
@@ -1954,15 +2057,14 @@ err:
int Execute_load_log_event::exec_event(struct st_relay_log_info* rli)
{
char fname[FN_REFLEN+10];
- char* p;
- int fd = -1;
+ char *p= slave_load_file_stem(fname, file_id, server_id);
+ int fd;
int error = 1;
ulong save_options;
IO_CACHE file;
Load_log_event* lev = 0;
- p = slave_load_file_stem(fname, file_id, server_id);
+
memcpy(p, ".info", 6);
- bzero((char*)&file, sizeof(file));
if ((fd = my_open(fname, O_RDONLY|O_BINARY, MYF(MY_WME))) < 0 ||
init_io_cache(&file, fd, IO_SIZE, READ_CACHE, (my_off_t)0, 0,
MYF(MY_WME|MY_NABP)))
@@ -1972,17 +2074,18 @@ int Execute_load_log_event::exec_event(struct st_relay_log_info* rli)
}
if (!(lev = (Load_log_event*)Log_event::read_log_event(&file,
(pthread_mutex_t*)0,
- (bool)0))
- || lev->get_type_code() != NEW_LOAD_EVENT)
+ (bool)0)) ||
+ lev->get_type_code() != NEW_LOAD_EVENT)
{
slave_print_error(rli,0, "File '%s' appears corrupted", fname);
goto err;
}
- // we want to disable binary logging in slave thread
- // because we need the file events to appear in the same order
- // as they do on the master relative to other events, so that we
- // can preserve ascending order of log sequence numbers - needed
- // to handle failover
+ /*
+ We want to disable binary logging in slave thread because we need the file
+ events to appear in the same order as they do on the master relative to
+ other events, so that we can preserve ascending order of log sequence
+ numbers - needed to handle failover .
+ */
save_options = thd->options;
thd->options &= ~ (ulong) (OPTION_BIN_LOG);
lev->thd = thd;
@@ -1993,19 +2096,21 @@ int Execute_load_log_event::exec_event(struct st_relay_log_info* rli)
goto err;
}
thd->options = save_options;
- (void)my_delete(fname, MYF(MY_WME));
+ (void) my_delete(fname, MYF(MY_WME));
memcpy(p, ".data", 6);
- (void)my_delete(fname, MYF(MY_WME));
+ (void) my_delete(fname, MYF(MY_WME));
if (mysql_bin_log.is_open())
mysql_bin_log.write(this);
error = 0;
+
err:
delete lev;
- end_io_cache(&file);
if (fd >= 0)
+ {
my_close(fd, MYF(0));
+ end_io_cache(&file);
+ }
return error ? error : Log_event::exec_event(rli);
}
-
-#endif
+#endif /* !MYSQL_CLIENT */
diff --git a/sql/log_event.h b/sql/log_event.h
index a29c3952d46..b69643c366a 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -15,8 +15,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifndef _LOG_EVENT_H
-#define _LOG_EVENT_H
+#ifndef _log_event_h
+#define _log_event_h
#ifdef __EMX__
#undef write // remove pthread.h macro definition, conflict with write() class member
@@ -36,74 +36,76 @@
#define LOG_EVENT_OFFSET 4
#define BINLOG_VERSION 3
-/* we could have used SERVER_VERSION_LENGTH, but this introduces an
- obscure dependency - if somebody decided to change SERVER_VERSION_LENGTH
- this would have broke the replication protocol
+/*
+ We could have used SERVER_VERSION_LENGTH, but this introduces an
+ obscure dependency - if somebody decided to change SERVER_VERSION_LENGTH
+ this would have broke the replication protocol
*/
#define ST_SERVER_VER_LEN 50
-#define DUMPFILE_FLAG 0x1
-#define OPT_ENCLOSED_FLAG 0x2
-#define REPLACE_FLAG 0x4
-#define IGNORE_FLAG 0x8
+#define DUMPFILE_FLAG 0x1
+#define OPT_ENCLOSED_FLAG 0x2
+#define REPLACE_FLAG 0x4
+#define IGNORE_FLAG 0x8
-#define FIELD_TERM_EMPTY 0x1
-#define ENCLOSED_EMPTY 0x2
-#define LINE_TERM_EMPTY 0x4
-#define LINE_START_EMPTY 0x8
-#define ESCAPED_EMPTY 0x10
+#define FIELD_TERM_EMPTY 0x1
+#define ENCLOSED_EMPTY 0x2
+#define LINE_TERM_EMPTY 0x4
+#define LINE_START_EMPTY 0x8
+#define ESCAPED_EMPTY 0x10
struct old_sql_ex
- {
- char field_term;
- char enclosed;
- char line_term;
- char line_start;
- char escaped;
- char opt_flags;
- char empty_flags;
- };
+{
+ char field_term;
+ char enclosed;
+ char line_term;
+ char line_start;
+ char escaped;
+ char opt_flags;
+ char empty_flags;
+};
#define NUM_LOAD_DELIM_STRS 5
-
struct sql_ex_info
- {
- char* field_term;
- char* enclosed;
- char* line_term;
- char* line_start;
- char* escaped;
- uint8 field_term_len,enclosed_len,line_term_len,line_start_len,
- escaped_len;
- char opt_flags;
- char empty_flags;
- int cached_new_format;
+{
+ char* field_term;
+ char* enclosed;
+ char* line_term;
+ char* line_start;
+ char* escaped;
+ int cached_new_format;
+ uint8 field_term_len,enclosed_len,line_term_len,line_start_len, escaped_len;
+ char opt_flags;
+ char empty_flags;
- // store in new format even if old is possible
- void force_new_format() { cached_new_format = 1;}
- int data_size() { return new_format() ?
- field_term_len + enclosed_len + line_term_len +
- line_start_len + escaped_len + 6 : 7;}
- int write_data(IO_CACHE* file);
- char* init(char* buf,char* buf_end,bool use_new_format);
- bool new_format()
- {
- return (cached_new_format != -1) ? cached_new_format :
- (cached_new_format=(field_term_len > 1 ||
- enclosed_len > 1 ||
- line_term_len > 1 || line_start_len > 1 ||
- escaped_len > 1));
- }
- } ;
-
-/* Binary log consists of events. Each event has a fixed length header,
- followed by possibly variable ( depending on the type of event) length
- data body. The data body consists of an optional fixed length segment
- (post-header), and an optional variable length segment. See #defines and
- comments below for the format specifics
-*/
+ // store in new format even if old is possible
+ void force_new_format() { cached_new_format = 1;}
+ int data_size()
+ {
+ return (new_format() ?
+ field_term_len + enclosed_len + line_term_len +
+ line_start_len + escaped_len + 6 : 7);
+ }
+ int write_data(IO_CACHE* file);
+ char* init(char* buf,char* buf_end,bool use_new_format);
+ bool new_format()
+ {
+ return ((cached_new_format != -1) ? cached_new_format :
+ (cached_new_format=(field_term_len > 1 ||
+ enclosed_len > 1 ||
+ line_term_len > 1 || line_start_len > 1 ||
+ escaped_len > 1)));
+ }
+};
+/*
+ Binary log consists of events. Each event has a fixed length header,
+ followed by possibly variable ( depending on the type of event) length
+ data body. The data body consists of an optional fixed length segment
+ (post-header), and an optional variable length segment. See #defines and
+ comments below for the format specifics
+*/
/* event-specific post-header sizes */
#define LOG_EVENT_HEADER_LEN 19
@@ -139,11 +141,11 @@ struct sql_ex_info
/* query event post-header */
-#define Q_THREAD_ID_OFFSET 0
-#define Q_EXEC_TIME_OFFSET 4
-#define Q_DB_LEN_OFFSET 8
-#define Q_ERR_CODE_OFFSET 9
-#define Q_DATA_OFFSET QUERY_HEADER_LEN
+#define Q_THREAD_ID_OFFSET 0
+#define Q_EXEC_TIME_OFFSET 4
+#define Q_DB_LEN_OFFSET 8
+#define Q_ERR_CODE_OFFSET 9
+#define Q_DATA_OFFSET QUERY_HEADER_LEN
/* Intvar event post-header */
@@ -159,7 +161,7 @@ struct sql_ex_info
#define L_DB_LEN_OFFSET 13
#define L_NUM_FIELDS_OFFSET 14
#define L_SQL_EX_OFFSET 18
-#define L_DATA_OFFSET LOAD_HEADER_LEN
+#define L_DATA_OFFSET LOAD_HEADER_LEN
/* Rotate event post-header */
@@ -176,10 +178,10 @@ struct sql_ex_info
#define DF_FILE_ID_OFFSET 0
-#define QUERY_EVENT_OVERHEAD (LOG_EVENT_HEADER_LEN+QUERY_HEADER_LEN)
-#define QUERY_DATA_OFFSET (LOG_EVENT_HEADER_LEN+QUERY_HEADER_LEN)
-#define ROTATE_EVENT_OVERHEAD (LOG_EVENT_HEADER_LEN+ROTATE_HEADER_LEN)
-#define LOAD_EVENT_OVERHEAD (LOG_EVENT_HEADER_LEN+LOAD_HEADER_LEN)
+#define QUERY_EVENT_OVERHEAD (LOG_EVENT_HEADER_LEN+QUERY_HEADER_LEN)
+#define QUERY_DATA_OFFSET (LOG_EVENT_HEADER_LEN+QUERY_HEADER_LEN)
+#define ROTATE_EVENT_OVERHEAD (LOG_EVENT_HEADER_LEN+ROTATE_HEADER_LEN)
+#define LOAD_EVENT_OVERHEAD (LOG_EVENT_HEADER_LEN+LOAD_HEADER_LEN)
#define CREATE_FILE_EVENT_OVERHEAD (LOG_EVENT_HEADER_LEN+\
+LOAD_HEADER_LEN+CREATE_FILE_HEADER_LEN)
#define DELETE_FILE_EVENT_OVERHEAD (LOG_EVENT_HEADER_LEN+DELETE_FILE_HEADER_LEN)
@@ -192,13 +194,19 @@ struct sql_ex_info
#define LOG_EVENT_TIME_F 0x1
#define LOG_EVENT_FORCED_ROTATE_F 0x2
-enum Log_event_type { START_EVENT = 1, QUERY_EVENT =2,
- STOP_EVENT=3, ROTATE_EVENT = 4, INTVAR_EVENT=5,
- LOAD_EVENT=6, SLAVE_EVENT=7, CREATE_FILE_EVENT=8,
- APPEND_BLOCK_EVENT=9, EXEC_LOAD_EVENT=10, DELETE_FILE_EVENT=11,
- NEW_LOAD_EVENT=12};
-enum Int_event_type { INVALID_INT_EVENT = 0, LAST_INSERT_ID_EVENT = 1, INSERT_ID_EVENT = 2
- };
+enum Log_event_type
+{
+ START_EVENT = 1, QUERY_EVENT =2, STOP_EVENT=3, ROTATE_EVENT = 4,
+ INTVAR_EVENT=5, LOAD_EVENT=6, SLAVE_EVENT=7, CREATE_FILE_EVENT=8,
+ APPEND_BLOCK_EVENT=9, EXEC_LOAD_EVENT=10, DELETE_FILE_EVENT=11,
+ NEW_LOAD_EVENT=12
+};
+
+enum Int_event_type
+{
+ INVALID_INT_EVENT = 0, LAST_INSERT_ID_EVENT = 1, INSERT_ID_EVENT = 2
+};
+
#ifndef MYSQL_CLIENT
class String;
@@ -206,8 +214,6 @@ class MYSQL_LOG;
class THD;
#endif
-extern uint32 server_id;
-
struct st_relay_log_info;
class Log_event
@@ -220,15 +226,38 @@ public:
uint16 flags;
int cached_event_len;
char* temp_buf;
-#ifndef MYSQL_CLIENT
+
+#ifndef MYSQL_CLIENT
THD* thd;
+
+ Log_event(THD* thd_arg, uint16 flags_arg = 0);
+ // if mutex is 0, the read will proceed without mutex
+ static Log_event* read_log_event(IO_CACHE* file,
+ pthread_mutex_t* log_lock,
+ bool old_format);
+ static int read_log_event(IO_CACHE* file, String* packet,
+ pthread_mutex_t* log_lock);
+ void set_log_pos(MYSQL_LOG* log);
+ virtual void pack_info(String* packet);
+ int net_send(THD* thd, const char* log_name, my_off_t pos);
+ static void init_show_field_list(List<Item>* field_list);
+ virtual int exec_event(struct st_relay_log_info* rli);
+ virtual const char* get_db()
+ {
+ return thd ? thd->db : 0;
+ }
+#else
+ // avoid having to link mysqlbinlog against libpthread
+ static Log_event* read_log_event(IO_CACHE* file, bool old_format);
+ virtual void print(FILE* file, bool short_form = 0, char* last_db = 0) = 0;
+ void print_timestamp(FILE* file, time_t *ts = 0);
+ void print_header(FILE* file);
#endif
static void *operator new(size_t size)
{
return (void*) my_malloc((uint)size, MYF(MY_WME|MY_FAE));
}
-
static void operator delete(void *ptr, size_t size)
{
my_free((gptr) ptr, MYF(MY_WME|MY_ALLOW_ZERO_PTR));
@@ -237,64 +266,35 @@ public:
int write(IO_CACHE* file);
int write_header(IO_CACHE* file);
virtual int write_data(IO_CACHE* file)
- { return write_data_header(file) || write_data_body(file); }
+ { return write_data_header(file) || write_data_body(file); }
virtual int write_data_header(IO_CACHE* file __attribute__((unused)))
- { return 0; }
+ { return 0; }
virtual int write_data_body(IO_CACHE* file __attribute__((unused)))
- { return 0; }
+ { return 0; }
virtual Log_event_type get_type_code() = 0;
virtual bool is_valid() = 0;
virtual bool get_cache_stmt() { return 0; }
Log_event(const char* buf, bool old_format);
-#ifndef MYSQL_CLIENT
- Log_event(THD* thd_arg, uint16 flags_arg = 0);
-#endif
virtual ~Log_event() { free_temp_buf();}
void register_temp_buf(char* buf) { temp_buf = buf; }
void free_temp_buf()
+ {
+ if (temp_buf)
{
- if (temp_buf)
- {
- my_free(temp_buf, MYF(0));
- temp_buf = 0;
- }
+ my_free(temp_buf, MYF(0));
+ temp_buf = 0;
}
+ }
virtual int get_data_size() { return 0;}
virtual int get_data_body_offset() { return 0; }
- int get_event_len() { return cached_event_len ? cached_event_len :
- (cached_event_len = LOG_EVENT_HEADER_LEN + get_data_size()); }
-#ifdef MYSQL_CLIENT
- virtual void print(FILE* file, bool short_form = 0, char* last_db = 0) = 0;
- void print_timestamp(FILE* file, time_t *ts = 0);
- void print_header(FILE* file);
-#endif
-
-#ifndef MYSQL_CLIENT
- // if mutex is 0, the read will proceed without mutex
- static Log_event* read_log_event(IO_CACHE* file,
- pthread_mutex_t* log_lock,
- bool old_format);
-#else // avoid having to link mysqlbinlog against libpthread
- static Log_event* read_log_event(IO_CACHE* file, bool old_format);
-#endif
+ int get_event_len()
+ {
+ return (cached_event_len ? cached_event_len :
+ (cached_event_len = LOG_EVENT_HEADER_LEN + get_data_size()));
+ }
static Log_event* read_log_event(const char* buf, int event_len,
const char **error, bool old_format);
const char* get_type_str();
-
-#ifndef MYSQL_CLIENT
- static int read_log_event(IO_CACHE* file, String* packet,
- pthread_mutex_t* log_lock);
- void set_log_pos(MYSQL_LOG* log);
- virtual void pack_info(String* packet);
- int net_send(THD* thd, const char* log_name, my_off_t pos);
- static void init_show_field_list(List<Item>* field_list);
- virtual int exec_event(struct st_relay_log_info* rli);
- virtual const char* get_db()
- {
- return thd ? thd->db : 0;
- }
-#endif
-
};
@@ -305,21 +305,26 @@ protected:
public:
const char* query;
const char* db;
- uint32 q_len; // if we already know the length of the query string
- // we pass it here, so we would not have to call strlen()
- // otherwise, set it to 0, in which case, we compute it with strlen()
+ /*
+ If we already know the length of the query string
+ we pass it with q_len, so we would not have to call strlen()
+ otherwise, set it to 0, in which case, we compute it with strlen()
+ */
+ uint32 q_len;
uint32 db_len;
uint16 error_code;
ulong thread_id;
-#if !defined(MYSQL_CLIENT)
+#ifndef MYSQL_CLIENT
bool cache_stmt;
- Query_log_event(THD* thd_arg, const char* query_arg,
- bool using_trans=0);
+ Query_log_event(THD* thd_arg, const char* query_arg, ulong query_length,
+ bool using_trans=0);
const char* get_db() { return db; }
void pack_info(String* packet);
int exec_event(struct st_relay_log_info* rli);
bool get_cache_stmt() { return cache_stmt; }
+#else
+ void print(FILE* file, bool short_form = 0, char* last_db = 0);
#endif
Query_log_event(const char* buf, int event_len, bool old_format);
@@ -336,17 +341,15 @@ public:
bool is_valid() { return query != 0; }
int get_data_size()
{
- return q_len + db_len + 2 +
- 4 // thread_id
- + 4 // exec_time
- + 2 // error_code
- ;
+ return (q_len + db_len + 2
+ + 4 // thread_id
+ + 4 // exec_time
+ + 2 // error_code
+ );
}
-#ifdef MYSQL_CLIENT
- void print(FILE* file, bool short_form = 0, char* last_db = 0);
-#endif
};
+
class Slave_log_event: public Log_event
{
protected:
@@ -364,18 +367,16 @@ public:
Slave_log_event(THD* thd_arg, struct st_relay_log_info* rli);
void pack_info(String* packet);
int exec_event(struct st_relay_log_info* rli);
-#endif
-
+#else
+ void print(FILE* file, bool short_form = 0, char* last_db = 0);
+#endif
+
Slave_log_event(const char* buf, int event_len);
~Slave_log_event();
int get_data_size();
bool is_valid() { return master_host != 0; }
Log_event_type get_type_code() { return SLAVE_EVENT; }
-#ifdef MYSQL_CLIENT
- void print(FILE* file, bool short_form = 0, char* last_db = 0);
-#endif
int write_data(IO_CACHE* file );
-
};
class Load_log_event: public Log_event
@@ -399,27 +400,28 @@ public:
uint32 skip_lines;
sql_ex_info sql_ex;
-#if !defined(MYSQL_CLIENT)
+#ifndef MYSQL_CLIENT
String field_lens_buf;
String fields_buf;
Load_log_event(THD* thd, sql_exchange* ex, const char* db_arg,
- const char* table_name_arg,
+ const char* table_name_arg,
List<Item>& fields_arg, enum enum_duplicates handle_dup);
void set_fields(List<Item> &fields_arg);
void pack_info(String* packet);
const char* get_db() { return db; }
int exec_event(struct st_relay_log_info* rli)
- {
- return exec_event(thd->slave_net,rli);
- }
+ {
+ return exec_event(thd->slave_net,rli);
+ }
int exec_event(NET* net, struct st_relay_log_info* rli);
+#else
+ void print(FILE* file, bool short_form = 0, char* last_db = 0);
#endif
Load_log_event(const char* buf, int event_len, bool old_format);
~Load_log_event()
- {
- }
+ {}
Log_event_type get_type_code() { return sql_ex.new_format() ?
NEW_LOAD_EVENT: LOAD_EVENT; }
int write_data_header(IO_CACHE* file);
@@ -427,18 +429,14 @@ public:
bool is_valid() { return table_name != 0; }
int get_data_size()
{
- return table_name_len + 2 + db_len + 2 + fname_len
- + 4 // thread_id
- + 4 // exec_time
- + 4 // skip_lines
- + 4 // field block len
- + sql_ex.data_size() + field_block_len + num_fields;
- ;
+ return (table_name_len + 2 + db_len + 2 + fname_len
+ + 4 // thread_id
+ + 4 // exec_time
+ + 4 // skip_lines
+ + 4 // field block len
+ + sql_ex.data_size() + field_block_len + num_fields);
}
int get_data_body_offset() { return LOAD_EVENT_OVERHEAD; }
-#ifdef MYSQL_CLIENT
- void print(FILE* file, bool short_form = 0, char* last_db = 0);
-#endif
};
extern char server_version[SERVER_VERSION_LENGTH];
@@ -449,13 +447,19 @@ public:
uint32 created;
uint16 binlog_version;
char server_version[ST_SERVER_VER_LEN];
-#ifndef MYSQL_CLIENT
+
+#ifndef MYSQL_CLIENT
Start_log_event() :Log_event((THD*)0),binlog_version(BINLOG_VERSION)
{
created = (uint32) when;
memcpy(server_version, ::server_version, ST_SERVER_VER_LEN);
}
+ void pack_info(String* packet);
+ int exec_event(struct st_relay_log_info* rli);
+#else
+ void print(FILE* file, bool short_form = 0, char* last_db = 0);
#endif
+
Start_log_event(const char* buf, bool old_format);
~Start_log_event() {}
Log_event_type get_type_code() { return START_EVENT;}
@@ -465,25 +469,25 @@ public:
{
return START_HEADER_LEN;
}
-#ifndef MYSQL_CLIENT
- void pack_info(String* packet);
- int exec_event(struct st_relay_log_info* rli);
-#endif
-#ifdef MYSQL_CLIENT
- void print(FILE* file, bool short_form = 0, char* last_db = 0);
-#endif
};
+
class Intvar_log_event: public Log_event
{
public:
ulonglong val;
uchar type;
+
#ifndef MYSQL_CLIENT
Intvar_log_event(THD* thd_arg,uchar type_arg, ulonglong val_arg)
:Log_event(thd_arg),val(val_arg),type(type_arg)
{}
-#endif
+ void pack_info(String* packet);
+ int exec_event(struct st_relay_log_info* rli);
+#else
+ void print(FILE* file, bool short_form = 0, char* last_db = 0);
+#endif
+
Intvar_log_event(const char* buf, bool old_format);
~Intvar_log_event() {}
Log_event_type get_type_code() { return INTVAR_EVENT;}
@@ -491,38 +495,29 @@ public:
int get_data_size() { return sizeof(type) + sizeof(val);}
int write_data(IO_CACHE* file);
bool is_valid() { return 1; }
-#ifndef MYSQL_CLIENT
- void pack_info(String* packet);
- int exec_event(struct st_relay_log_info* rli);
-#endif
-
-#ifdef MYSQL_CLIENT
- void print(FILE* file, bool short_form = 0, char* last_db = 0);
-#endif
};
+
class Stop_log_event: public Log_event
{
public:
#ifndef MYSQL_CLIENT
Stop_log_event() :Log_event((THD*)0)
{}
+ int exec_event(struct st_relay_log_info* rli);
+#else
+ void print(FILE* file, bool short_form = 0, char* last_db = 0);
#endif
- Stop_log_event(const char* buf, bool old_format):Log_event(buf,
- old_format)
- {
- }
+
+ Stop_log_event(const char* buf, bool old_format):
+ Log_event(buf, old_format)
+ {}
~Stop_log_event() {}
Log_event_type get_type_code() { return STOP_EVENT;}
bool is_valid() { return 1; }
-#ifdef MYSQL_CLIENT
- void print(FILE* file, bool short_form = 0, char* last_db = 0);
-#endif
-#ifndef MYSQL_CLIENT
- int exec_event(struct st_relay_log_info* rli);
-#endif
};
+
class Rotate_log_event: public Log_event
{
public:
@@ -532,14 +527,18 @@ public:
bool alloced;
#ifndef MYSQL_CLIENT
Rotate_log_event(THD* thd_arg, const char* new_log_ident_arg,
- uint ident_len_arg = 0,ulonglong pos_arg = 4) :
- Log_event(thd_arg),
- new_log_ident(new_log_ident_arg),
+ uint ident_len_arg = 0,ulonglong pos_arg = 4)
+ : Log_event(thd_arg), new_log_ident(new_log_ident_arg),
ident_len(ident_len_arg ? ident_len_arg :
(uint) strlen(new_log_ident_arg)), pos(pos_arg),
alloced(0)
{}
-#endif
+ void pack_info(String* packet);
+ int exec_event(struct st_relay_log_info* rli);
+#else
+ void print(FILE* file, bool short_form = 0, char* last_db = 0);
+#endif
+
Rotate_log_event(const char* buf, int event_len, bool old_format);
~Rotate_log_event()
{
@@ -550,13 +549,6 @@ public:
int get_data_size() { return ident_len + ROTATE_HEADER_LEN;}
bool is_valid() { return new_log_ident != 0; }
int write_data(IO_CACHE* file);
-#ifdef MYSQL_CLIENT
- void print(FILE* file, bool short_form = 0, char* last_db = 0);
-#endif
-#ifndef MYSQL_CLIENT
- void pack_info(String* packet);
- int exec_event(struct st_relay_log_info* rli);
-#endif
};
/* the classes below are for the new LOAD DATA INFILE logging */
@@ -564,51 +556,59 @@ public:
class Create_file_log_event: public Load_log_event
{
protected:
- // pretend we are Load event, so we can write out just
- // our Load part - used on the slave when writing event out to
- // SQL_LOAD-*.info file
+ /*
+ Pretend we are Load event, so we can write out just
+ our Load part - used on the slave when writing event out to
+ SQL_LOAD-*.info file
+ */
bool fake_base;
public:
char* block;
uint block_len;
uint file_id;
bool inited_from_old;
+
#ifndef MYSQL_CLIENT
Create_file_log_event(THD* thd, sql_exchange* ex, const char* db_arg,
const char* table_name_arg,
List<Item>& fields_arg,
enum enum_duplicates handle_dup,
char* block_arg, uint block_len_arg);
+ void pack_info(String* packet);
+ int exec_event(struct st_relay_log_info* rli);
+#else
+ void print(FILE* file, bool short_form = 0, char* last_db = 0);
#endif
Create_file_log_event(const char* buf, int event_len, bool old_format);
- ~Create_file_log_event()
+ ~Create_file_log_event() {}
+
+ Log_event_type get_type_code()
{
+ return fake_base ? Load_log_event::get_type_code() : CREATE_FILE_EVENT;
+ }
+ int get_data_size()
+ {
+ return (fake_base ? Load_log_event::get_data_size() :
+ Load_log_event::get_data_size() +
+ 4 + 1 + block_len);
+ }
+ int get_data_body_offset()
+ {
+ return (fake_base ? LOAD_EVENT_OVERHEAD:
+ LOAD_EVENT_OVERHEAD + CREATE_FILE_HEADER_LEN);
}
- Log_event_type get_type_code()
- {
- return fake_base ? Load_log_event::get_type_code() : CREATE_FILE_EVENT;
- }
- int get_data_size() { return fake_base ? Load_log_event::get_data_size() :
- Load_log_event::get_data_size() +
- 4 + 1 + block_len;}
- int get_data_body_offset() { return fake_base ? LOAD_EVENT_OVERHEAD:
- LOAD_EVENT_OVERHEAD + CREATE_FILE_HEADER_LEN; }
bool is_valid() { return inited_from_old || block != 0; }
int write_data_header(IO_CACHE* file);
int write_data_body(IO_CACHE* file);
- int write_base(IO_CACHE* file); // cut out Create_file extentions and
- // write it as Load event - used on the slave
-
-#ifdef MYSQL_CLIENT
- void print(FILE* file, bool short_form = 0, char* last_db = 0);
-#endif
-#ifndef MYSQL_CLIENT
- void pack_info(String* packet);
- int exec_event(struct st_relay_log_info* rli);
-#endif
+ /*
+ Cut out Create_file extentions and
+ write it as Load event - used on the slave
+ */
+ int write_base(IO_CACHE* file);
};
+
class Append_block_log_event: public Log_event
{
public:
@@ -618,27 +618,22 @@ public:
#ifndef MYSQL_CLIENT
Append_block_log_event(THD* thd, char* block_arg,
- uint block_len_arg);
+ uint block_len_arg);
int exec_event(struct st_relay_log_info* rli);
-#endif
+ void pack_info(String* packet);
+#else
+ void print(FILE* file, bool short_form = 0, char* last_db = 0);
+#endif
Append_block_log_event(const char* buf, int event_len);
- ~Append_block_log_event()
- {
- }
+ ~Append_block_log_event() {}
Log_event_type get_type_code() { return APPEND_BLOCK_EVENT;}
int get_data_size() { return block_len + APPEND_BLOCK_HEADER_LEN ;}
bool is_valid() { return block != 0; }
int write_data(IO_CACHE* file);
-
-#ifdef MYSQL_CLIENT
- void print(FILE* file, bool short_form = 0, char* last_db = 0);
-#endif
-#ifndef MYSQL_CLIENT
- void pack_info(String* packet);
-#endif
};
+
class Delete_file_log_event: public Log_event
{
public:
@@ -646,24 +641,18 @@ public:
#ifndef MYSQL_CLIENT
Delete_file_log_event(THD* thd);
+ void pack_info(String* packet);
+ int exec_event(struct st_relay_log_info* rli);
+#else
+ void print(FILE* file, bool short_form = 0, char* last_db = 0);
#endif
Delete_file_log_event(const char* buf, int event_len);
- ~Delete_file_log_event()
- {
- }
+ ~Delete_file_log_event() {}
Log_event_type get_type_code() { return DELETE_FILE_EVENT;}
int get_data_size() { return DELETE_FILE_HEADER_LEN ;}
bool is_valid() { return file_id != 0; }
int write_data(IO_CACHE* file);
-
-#ifdef MYSQL_CLIENT
- void print(FILE* file, bool short_form = 0, char* last_db = 0);
-#endif
-#ifndef MYSQL_CLIENT
- void pack_info(String* packet);
- int exec_event(struct st_relay_log_info* rli);
-#endif
};
class Execute_load_log_event: public Log_event
@@ -673,27 +662,18 @@ public:
#ifndef MYSQL_CLIENT
Execute_load_log_event(THD* thd);
+ void pack_info(String* packet);
+ int exec_event(struct st_relay_log_info* rli);
+#else
+ void print(FILE* file, bool short_form = 0, char* last_db = 0);
#endif
Execute_load_log_event(const char* buf, int event_len);
- ~Execute_load_log_event()
- {
- }
+ ~Execute_load_log_event() {}
Log_event_type get_type_code() { return EXEC_LOAD_EVENT;}
int get_data_size() { return EXEC_LOAD_HEADER_LEN ;}
bool is_valid() { return file_id != 0; }
int write_data(IO_CACHE* file);
-
-#ifdef MYSQL_CLIENT
- void print(FILE* file, bool short_form = 0, char* last_db = 0);
-#endif
-#ifndef MYSQL_CLIENT
- void pack_info(String* packet);
- int exec_event(struct st_relay_log_info* rli);
-#endif
};
-#endif
-
-
-
+#endif /* _log_event_h */
diff --git a/sql/mini_client.cc b/sql/mini_client.cc
index ffb5d659238..5bd88e9b09a 100644
--- a/sql/mini_client.cc
+++ b/sql/mini_client.cc
@@ -20,20 +20,14 @@
Note: all file-global symbols must begin with mc_ , even the static ones, just
in case we decide to make them external at some point
- */
-
-#ifdef EMBEDDED_LIBRARY
-#define net_read_timeout net_read_timeout1
-#define net_write_timeout net_write_timeout1
-#endif
-
-#if defined(__WIN__)
-#include <winsock.h>
-#include <odbcinst.h> /* QQ: Is this really needed ? */
-#define DONT_USE_THR_ALARM
-#endif
+*/
#include <my_global.h>
+/* my_pthread must be included early to be able to fix things */
+#if defined(THREAD)
+#include <my_pthread.h> /* because of signal() */
+#endif
+#include <thr_alarm.h>
#include <mysql_embed.h>
#include <mysql_com.h>
#include <violite.h>
@@ -52,8 +46,6 @@
#define ER CER
#endif
-extern ulong net_read_timeout;
-
extern "C" { // Because of SCO 3.2V4.2
#include <sys/stat.h>
#include <signal.h>
@@ -75,20 +67,12 @@ extern "C" { // Because of SCO 3.2V4.2
#ifdef HAVE_SYS_UN_H
# include <sys/un.h>
#endif
-#if defined(THREAD)
-#include <my_pthread.h> /* because of signal() */
-#endif
-#include <thr_alarm.h>
#ifndef INADDR_NONE
#define INADDR_NONE -1
#endif
}
static void mc_free_rows(MYSQL_DATA *cur);
-static MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
- my_bool default_value,
- my_bool long_flag_protocol);
-
void mc_end_server(MYSQL *mysql);
static int mc_sock_connect(File s, const struct sockaddr *name, uint namelen, uint to);
static void mc_free_old_query(MYSQL *mysql);
@@ -119,6 +103,8 @@ static my_bool is_NT(void)
}
#endif
+extern ulong slave_net_timeout;
+
/*
** Create a named pipe connection
*/
@@ -209,6 +195,7 @@ MYSQL *mc_mysql_init(MYSQL *mysql)
#ifdef __WIN__
mysql->options.connect_timeout=20;
#endif
+ mysql->net.read_timeout = slave_net_timeout;
return mysql;
}
@@ -354,7 +341,7 @@ mc_net_safe_read(MYSQL *mysql)
if (socket_errno != SOCKET_EINTR)
{
mc_end_server(mysql);
- if(net->last_errno != ER_NET_PACKET_TOO_LARGE)
+ if (net->last_errno != ER_NET_PACKET_TOO_LARGE)
{
net->last_errno=CR_SERVER_LOST;
strmov(net->last_error,ER(net->last_errno));
@@ -362,7 +349,7 @@ mc_net_safe_read(MYSQL *mysql)
else
strmov(net->last_error, "Packet too large - increase \
max_allowed_packet on this server");
- }
+ }
return(packet_error);
}
if (net->read_pos[0] == 255)
@@ -375,7 +362,7 @@ max_allowed_packet on this server");
net->last_errno=uint2korr(pos);
pos+=2;
len-=2;
- if(!net->last_errno)
+ if (!net->last_errno)
net->last_errno = CR_UNKNOWN_ERROR;
}
else
@@ -409,24 +396,28 @@ int mc_mysql_errno(MYSQL *mysql)
return (mysql)->net.last_errno;
}
-my_bool mc_mysql_reconnect(MYSQL *mysql)
+
+my_bool mc_mysql_reconnect(MYSQL *mysql)
{
MYSQL tmp_mysql;
DBUG_ENTER("mc_mysql_reconnect");
if (!mysql->reconnect)
+ {
+ mysql->net.last_errno=CR_SERVER_GONE_ERROR;
+ strmov(mysql->net.last_error, ER(mysql->net.last_errno));
DBUG_RETURN(1);
-
+ }
mc_mysql_init(&tmp_mysql);
tmp_mysql.options=mysql->options;
if (!mc_mysql_connect(&tmp_mysql,mysql->host,mysql->user,mysql->passwd,
- mysql->db, mysql->port, mysql->unix_socket,
- mysql->client_flag))
- {
- tmp_mysql.reconnect=0;
- mc_mysql_close(&tmp_mysql);
- DBUG_RETURN(1);
- }
+ mysql->db, mysql->port, mysql->unix_socket,
+ mysql->client_flag, mysql->net.read_timeout))
+ {
+ mysql->net.last_errno= tmp_mysql.net.last_errno;
+ strmov(mysql->net.last_error, tmp_mysql.net.last_error);
+ DBUG_RETURN(1);
+ }
tmp_mysql.free_me=mysql->free_me;
mysql->free_me=0;
bzero((char*) &mysql->options,sizeof(&mysql->options));
@@ -449,11 +440,7 @@ mc_simple_command(MYSQL *mysql,enum enum_server_command command,
if (mysql->net.vio == 0)
{ /* Do reconnect if possible */
if (mc_mysql_reconnect(mysql))
- {
- net->last_errno=CR_SERVER_GONE_ERROR;
- strmov(net->last_error,ER(net->last_errno));
goto end;
- }
}
if (mysql->status != MYSQL_STATUS_READY)
{
@@ -474,8 +461,9 @@ mc_simple_command(MYSQL *mysql,enum enum_server_command command,
{
DBUG_PRINT("error",("Can't send command to server. Error: %d",socket_errno));
mc_end_server(mysql);
- if (mc_mysql_reconnect(mysql) ||
- net_write_command(net,(uchar) command,arg,
+ if (mc_mysql_reconnect(mysql))
+ goto end;
+ if (net_write_command(net,(uchar) command,arg,
length ? length :(uint) strlen(arg)))
{
net->last_errno=CR_SERVER_GONE_ERROR;
@@ -494,17 +482,19 @@ mc_simple_command(MYSQL *mysql,enum enum_server_command command,
MYSQL *
mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
- const char *passwd, const char *db,
- uint port, const char *unix_socket,uint client_flag)
+ const char *passwd, const char *db,
+ uint port, const char *unix_socket,uint client_flag,
+ uint net_read_timeout)
{
- char buff[100],*end,*host_info;
+ char buff[NAME_LEN+USERNAME_LENGTH+100],*end,*host_info;
my_socket sock;
ulong ip_addr;
struct sockaddr_in sock_addr;
ulong pkt_length;
NET *net= &mysql->net;
thr_alarm_t alarmed;
- ALARM alarm_buff;
+ ALARM alarm_buff;
+ ulong max_allowed_packet;
#ifdef __WIN__
HANDLE hPipe=INVALID_HANDLE_VALUE;
@@ -513,15 +503,13 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
struct sockaddr_un UNIXaddr;
#endif
DBUG_ENTER("mc_mysql_connect");
-
- DBUG_PRINT("enter",("host: %s db: %s user: %s",
+ DBUG_PRINT("enter",("host: %s db: %s user: %s connect_time_out: %u read_timeout: %u",
host ? host : "(Null)",
db ? db : "(Null)",
- user ? user : "(Null)"));
- thr_alarm_init(&alarmed);
- thr_alarm(&alarmed,(uint) net_read_timeout,&alarm_buff);
+ user ? user : "(Null)",
+ net_read_timeout,
+ (uint) slave_net_timeout));
- bzero((char*) &mysql->options,sizeof(mysql->options));
net->vio = 0; /* If something goes wrong */
mysql->charset=default_charset_info; /* Set character set */
if (!port)
@@ -530,13 +518,16 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
unix_socket=MYSQL_UNIX_ADDR;
mysql->reconnect=1; /* Reconnect as default */
+ mysql->server_status=SERVER_STATUS_AUTOCOMMIT;
+ if (!mysql->options.connect_timeout)
+ mysql->options.connect_timeout= net_read_timeout;
/*
** Grab a socket and connect it to the server
*/
#if defined(HAVE_SYS_UN_H)
- if (!host || !strcmp(host,LOCAL_HOST))
+ if ((!host || !strcmp(host,LOCAL_HOST)) && unix_socket)
{
host=LOCAL_HOST;
host_info=(char*) ER(CR_LOCALHOST_CONNECTION);
@@ -601,7 +592,11 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
host=LOCAL_HOST;
sprintf(host_info=buff,ER(CR_TCP_CONNECTION),host);
DBUG_PRINT("info",("Server name: '%s'. TCP sock: %d", host,port));
- if ((sock = socket(AF_INET,SOCK_STREAM,0)) == SOCKET_ERROR)
+ thr_alarm_init(&alarmed);
+ thr_alarm(&alarmed, net_read_timeout, &alarm_buff);
+ sock = (my_socket) socket(AF_INET,SOCK_STREAM,0);
+ thr_end_alarm(&alarmed);
+ if (sock == SOCKET_ERROR)
{
net->last_errno=CR_IPSOCK_ERROR;
sprintf(net->last_error,ER(net->last_errno),socket_errno);
@@ -644,30 +639,33 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
socket_errno,host));
net->last_errno= CR_CONN_HOST_ERROR;
sprintf(net->last_error ,ER(CR_CONN_HOST_ERROR), host, socket_errno);
- if (thr_alarm_in_use(&alarmed))
- thr_end_alarm(&alarmed);
goto error;
}
- if (thr_alarm_in_use(&alarmed))
- thr_end_alarm(&alarmed);
}
if (!net->vio || my_net_init(net, net->vio))
{
vio_delete(net->vio);
- net->vio = 0; // safety
+ net->vio = 0;
net->last_errno=CR_OUT_OF_MEMORY;
strmov(net->last_error,ER(net->last_errno));
goto error;
}
vio_keepalive(net->vio,TRUE);
-
+ net->read_timeout=slave_net_timeout;
/* Get version info */
mysql->protocol_version= PROTOCOL_VERSION; /* Assume this */
+ if (mysql->options.connect_timeout &&
+ vio_poll_read(net->vio, mysql->options.connect_timeout))
+ {
+ net->last_errno= CR_SERVER_LOST;
+ strmov(net->last_error,ER(net->last_errno));
+ goto error;
+ }
if ((pkt_length=mc_net_safe_read(mysql)) == packet_error)
goto error;
- /* Check if version of protocoll matches current one */
+ /* Check if version of protocol matches current one */
mysql->protocol_version= net->read_pos[0];
DBUG_DUMP("packet",(char*) net->read_pos,10);
@@ -685,8 +683,15 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
mysql->thread_id=uint4korr(end+1);
end+=5;
strmake(mysql->scramble_buff,end,8);
- if (pkt_length > (uint) (end+9 - (char*) net->read_pos))
- mysql->server_capabilities=uint2korr(end+9);
+ end+=9;
+ if (pkt_length >= (uint) (end+1 - (char*) net->read_pos))
+ mysql->server_capabilities=uint2korr(end);
+ if (pkt_length >= (uint) (end+18 - (char*) net->read_pos))
+ {
+ /* New protocol with 16 bytes to describe server characteristics */
+ mysql->server_language=end[2];
+ mysql->server_status=uint2korr(end+3);
+ }
/* Save connection information */
if (!user) user="";
@@ -713,7 +718,7 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
mysql->unix_socket=0;
strmov(mysql->server_version,(char*) net->read_pos+1);
mysql->port=port;
- mysql->client_flag=client_flag | mysql->options.client_flag;
+ client_flag|=mysql->options.client_flag;
DBUG_PRINT("info",("Server version = '%s' capabilites: %ld",
mysql->server_version,mysql->server_capabilities));
@@ -721,6 +726,10 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
client_flag|=CLIENT_CAPABILITIES;
#ifdef HAVE_OPENSSL
+ if (mysql->options.ssl_key || mysql->options.ssl_cert ||
+ mysql->options.ssl_ca || mysql->options.ssl_capath ||
+ mysql->options.ssl_cipher)
+ mysql->options.use_ssl= 1;
if (mysql->options.use_ssl)
client_flag|=CLIENT_SSL;
#endif /* HAVE_OPENSSL */
@@ -728,8 +737,8 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
if (db)
client_flag|=CLIENT_CONNECT_WITH_DB;
#ifdef HAVE_COMPRESS
- if (mysql->server_capabilities & CLIENT_COMPRESS &&
- (mysql->options.compress || client_flag & CLIENT_COMPRESS))
+ if ((mysql->server_capabilities & CLIENT_COMPRESS) &&
+ (mysql->options.compress || (client_flag & CLIENT_COMPRESS)))
client_flag|=CLIENT_COMPRESS; /* We will use compression */
else
#endif
@@ -756,55 +765,54 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
mysql->client_flag=client_flag;
#ifdef HAVE_OPENSSL
- if ((mysql->server_capabilities & CLIENT_SSL) &&
- (mysql->options.use_ssl || (client_flag & CLIENT_SSL)))
- {
- DBUG_PRINT("info", ("Changing IO layer to SSL"));
- client_flag |= CLIENT_SSL;
- }
- else
- {
- if (client_flag & CLIENT_SSL)
- {
- DBUG_PRINT("info", ("Leaving IO layer intact because server doesn't support SSL"));
- }
- client_flag &= ~CLIENT_SSL;
- }
- /* Oops.. are we careful enough to not send ANY information */
- /* without encryption? */
+ /*
+ Oops.. are we careful enough to not send ANY information without
+ encryption?
+ */
if (client_flag & CLIENT_SSL)
{
if (my_net_write(net,buff,(uint) (2)) || net_flush(net))
+ {
+ net->last_errno= CR_SERVER_LOST;
+ strmov(net->last_error,ER(net->last_errno));
goto error;
+ }
/* Do the SSL layering. */
DBUG_PRINT("info", ("IO layer change in progress..."));
DBUG_PRINT("info", ("IO context %p",((struct st_VioSSLConnectorFd*)mysql->connector_fd)->ssl_context_));
- sslconnect((struct st_VioSSLConnectorFd*)(mysql->connector_fd),mysql->net.vio,60L);
+ sslconnect((struct st_VioSSLConnectorFd*)(mysql->connector_fd),mysql->net.vio, (long)(mysql->options.connect_timeout));
DBUG_PRINT("info", ("IO layer change done!"));
}
#endif /* HAVE_OPENSSL */
+ max_allowed_packet=mysql->net.max_packet_size;
int3store(buff+2,max_allowed_packet);
if (user && user[0])
strmake(buff+5,user,32);
else
- {
- user = getenv("USER");
- if(!user) user = "mysql";
- strmov((char*) buff+5, user );
- }
+ {
+ user = getenv("USER");
+ if (!user) user = "mysql";
+ strmov((char*) buff+5, user );
+ }
DBUG_PRINT("info",("user: %s",buff+5));
end=scramble(strend(buff+5)+1, mysql->scramble_buff, passwd,
(my_bool) (mysql->protocol_version == 9));
if (db)
{
- end=strmov(end+1,db);
+ end=strmake(end+1,db,NAME_LEN);
mysql->db=my_strdup(db,MYF(MY_WME));
+ db=0;
+ }
+ if (my_net_write(net,buff,(ulong) (end-buff)) || net_flush(net))
+ {
+ net->last_errno= CR_SERVER_LOST;
+ strmov(net->last_error,ER(net->last_errno));
+ goto error;
}
- if (my_net_write(net,buff,(uint) (end-buff)) || net_flush(net) ||
- mc_net_safe_read(mysql) == packet_error)
+ if (mc_net_safe_read(mysql) == packet_error)
goto error;
if (client_flag & CLIENT_COMPRESS) /* We will use compression */
net->compress=1;
@@ -839,10 +847,12 @@ mysql_ssl_clear(MYSQL *mysql)
my_free(mysql->options.ssl_cert, MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->options.ssl_ca, MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->options.ssl_capath, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(mysql->options.ssl_cipher, MYF(MY_ALLOW_ZERO_PTR));
mysql->options.ssl_key = 0;
mysql->options.ssl_cert = 0;
mysql->options.ssl_ca = 0;
mysql->options.ssl_capath = 0;
+ mysql->options.ssl_cipher= 0;
mysql->options.use_ssl = FALSE;
my_free(mysql->connector_fd,MYF(MY_ALLOW_ZERO_PTR));
mysql->connector_fd = 0;
@@ -876,7 +886,6 @@ mc_mysql_close(MYSQL *mysql)
/* Clear pointers for better safety */
mysql->host_info=mysql->user=mysql->passwd=mysql->db=0;
bzero((char*) &mysql->options,sizeof(mysql->options));
- mysql->net.vio = 0;
#ifdef HAVE_OPENSSL
mysql_ssl_clear(mysql);
#endif /* HAVE_OPENSSL */
@@ -964,13 +973,13 @@ mc_unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
DBUG_RETURN(result);
}
-int
-mc_mysql_send_query(MYSQL* mysql, const char* query, uint length)
+int mc_mysql_send_query(MYSQL* mysql, const char* query, uint length)
{
return mc_simple_command(mysql, COM_QUERY, query, length, 1);
}
-int mc_mysql_read_query_result(MYSQL *mysql)
+
+int mc_mysql_read_query_result(MYSQL *mysql)
{
uchar *pos;
ulong field_count;
diff --git a/sql/mini_client.h b/sql/mini_client.h
index 6721b072080..24c13646170 100644
--- a/sql/mini_client.h
+++ b/sql/mini_client.h
@@ -19,23 +19,18 @@
MYSQL* mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
- const char *passwd, const char *db,
- uint port, const char *unix_socket,uint client_flag);
-
-int mc_simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
- uint length, my_bool skipp_check);
+ const char *passwd, const char *db,
+ uint port, const char *unix_socket,uint client_flag,
+ uint net_read_timeout);
+int mc_simple_command(MYSQL *mysql,enum enum_server_command command,
+ const char *arg, uint length, my_bool skipp_check);
void mc_mysql_close(MYSQL *mysql);
-
-MYSQL * mc_mysql_init(MYSQL *mysql);
-
+MYSQL *mc_mysql_init(MYSQL *mysql);
void mc_mysql_debug(const char *debug);
-
ulong mc_net_safe_read(MYSQL *mysql);
-
-char * mc_mysql_error(MYSQL *mysql);
+char *mc_mysql_error(MYSQL *mysql);
int mc_mysql_errno(MYSQL *mysql);
my_bool mc_mysql_reconnect(MYSQL* mysql);
-
int mc_mysql_send_query(MYSQL* mysql, const char* query, uint length);
int mc_mysql_read_query_result(MYSQL *mysql);
int mc_mysql_query(MYSQL *mysql, const char *query, uint length);
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 9fff4880573..61973c5af91 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -14,14 +14,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifndef _MYSQL_PRIV_H
-#define _MYSQL_PRIV_H
-
#include <my_global.h>
-#include "mysql_embed.h"
+#include <mysql_version.h>
+#include <mysql_embed.h>
#include <my_sys.h>
#include <m_string.h>
-#include <mysql_version.h>
#include <hash.h>
#include <signal.h>
#include <thr_lock.h>
@@ -29,7 +26,7 @@
#include <my_bitmap.h>
#ifdef __EMX__
-#undef write // remove pthread.h macro definition for EMX
+#undef write /* remove pthread.h macro definition for EMX */
#endif
typedef ulong table_map; /* Used for table bits in join */
@@ -48,7 +45,7 @@ char *sql_strmake(const char *str,uint len);
gptr sql_memdup(const void * ptr,unsigned size);
void sql_element_free(void *ptr);
void kill_one_thread(THD *thd, ulong id);
-int net_request_file(NET* net, const char* fname);
+bool net_request_file(NET* net, const char* fname);
char* query_table_status(THD *thd,const char *db,const char *table_name);
#define x_free(A) { my_free((gptr) (A),MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); }
@@ -75,14 +72,14 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
#define MAX_FIELDS_BEFORE_HASH 32
#define USER_VARS_HASH_SIZE 16
#define STACK_MIN_SIZE 8192 // Abort if less stack during eval.
-#define STACK_BUFF_ALLOC 32 // For stack overrun checks
+#define STACK_BUFF_ALLOC 64 // For stack overrun checks
#ifndef MYSQLD_NET_RETRY_COUNT
#define MYSQLD_NET_RETRY_COUNT 10 // Abort read after this many int.
#endif
#define TEMP_POOL_SIZE 128
/*
The following parameters is to decide when to use an extra cache to
- optimise seeks when reading a big table in sorted order
+ optimise seeks when reading a big table in sorted order
*/
#define MIN_FILE_LENGTH_TO_USE_ROW_CACHE (16L*1024*1024)
#define MIN_ROWS_TO_USE_TABLE_CACHE 100
@@ -165,29 +162,34 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
#define OPTION_BIG_SELECTS 1024 /* for SQL OPTION */
#define OPTION_LOG_OFF 2048
#define OPTION_UPDATE_LOG 4096 /* update log flag */
-#define OPTION_LOW_PRIORITY_UPDATES 8192
+#define TMP_TABLE_ALL_COLUMNS 8192
#define OPTION_WARNINGS 16384
#define OPTION_AUTO_IS_NULL 32768
#define OPTION_FOUND_COMMENT 65536L
#define OPTION_SAFE_UPDATES OPTION_FOUND_COMMENT*2
#define OPTION_BUFFER_RESULT OPTION_SAFE_UPDATES*2
#define OPTION_BIN_LOG OPTION_BUFFER_RESULT*2
-#define OPTION_NOT_AUTO_COMMIT OPTION_BIN_LOG*2
-#define OPTION_BEGIN OPTION_NOT_AUTO_COMMIT*2
+#define OPTION_NOT_AUTOCOMMIT OPTION_BIN_LOG*2
+#define OPTION_BEGIN OPTION_NOT_AUTOCOMMIT*2
#define OPTION_TABLE_LOCK OPTION_BEGIN*2
#define OPTION_QUICK OPTION_TABLE_LOCK*2
#define OPTION_QUOTE_SHOW_CREATE OPTION_QUICK*2
#define OPTION_INTERNAL_SUBTRANSACTIONS OPTION_QUOTE_SHOW_CREATE*2
/* Set if we are updating a non-transaction safe table */
-#define OPTION_STATUS_NO_TRANS_UPDATE OPTION_INTERNAL_SUBTRANSACTIONS*2
+#define OPTION_STATUS_NO_TRANS_UPDATE OPTION_INTERNAL_SUBTRANSACTIONS*2
/* The following is set when parsing the query */
#define QUERY_NO_INDEX_USED OPTION_STATUS_NO_TRANS_UPDATE*2
#define QUERY_NO_GOOD_INDEX_USED QUERY_NO_INDEX_USED*2
-
-#define SELECT_NO_UNLOCK (QUERY_NO_GOOD_INDEX_USED*2)
-#define TMP_TABLE_ALL_COLUMNS (SELECT_NO_UNLOCK*2)
+/* The following can be set when importing tables in a 'wrong order'
+ to suppress foreign key checks */
+#define OPTION_NO_FOREIGN_KEY_CHECKS QUERY_NO_GOOD_INDEX_USED*2
+/* The following speeds up inserts to InnoDB tables by suppressing unique
+ key checks in some cases */
+#define OPTION_RELAXED_UNIQUE_CHECKS OPTION_NO_FOREIGN_KEY_CHECKS*2
+#define SELECT_NO_UNLOCK ((ulong) OPTION_RELAXED_UNIQUE_CHECKS*2)
+/* NOTE: we have now used up all 32 bits of the OPTION flag! */
/* Bits for different SQL modes modes (including ANSI mode) */
#define MODE_REAL_AS_FLOAT 1
@@ -200,18 +202,20 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
#define RAID_BLOCK_SIZE 1024
-// Sync points allow us to force the server to reach a certain line of code
-// and block there until the client tells the server it is ok to go on.
-// The client tells the server to block with SELECT GET_LOCK()
-// and unblocks it with SELECT RELEASE_LOCK(). Used for debugging difficult
-// concurrency problems
#ifdef EXTRA_DEBUG
+/*
+ Sync points allow us to force the server to reach a certain line of code
+ and block there until the client tells the server it is ok to go on.
+ The client tells the server to block with SELECT GET_LOCK()
+ and unblocks it with SELECT RELEASE_LOCK(). Used for debugging difficult
+ concurrency problems
+*/
#define DBUG_SYNC_POINT(lock_name,lock_timeout) \
debug_sync_point(lock_name,lock_timeout)
void debug_sync_point(const char* lock_name, uint lock_timeout);
#else
#define DBUG_SYNC_POINT(lock_name,lock_timeout)
-#endif
+#endif /* EXTRA_DEBUG */
/* BINLOG_DUMP options */
@@ -292,10 +296,13 @@ inline THD *_current_thd(void)
int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create, bool silent);
int mysql_alter_db(THD *thd, char *db, HA_CREATE_INFO *create, bool silent);
int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent);
-void mysql_binlog_send(THD* thd, char* log_ident, ulong pos, ushort flags);
+void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, ushort flags);
int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists);
int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
bool log_query);
+int mysql_rm_table_part2_with_lock(THD *thd, TABLE_LIST *tables,
+ bool if_exists,
+ bool log_query);
int quick_rm_table(enum db_type base,const char *db,
const char *table_name);
bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list);
@@ -322,11 +329,11 @@ void table_cache_free(void);
uint cached_tables(void);
void kill_mysql(void);
void close_connection(NET *net,uint errcode=0,bool lock=1);
-bool check_access(THD *thd,uint access,const char *db=0,uint *save_priv=0,
+bool check_access(THD *thd, ulong access, const char *db=0, ulong *save_priv=0,
bool no_grant=0, bool no_errors=0);
-bool check_table_access(THD *thd,uint want_access, TABLE_LIST *tables,
+bool check_table_access(THD *thd, ulong want_access, TABLE_LIST *tables,
bool no_errors=0);
-bool check_process_priv(THD *thd=0);
+bool check_global_access(THD *thd, ulong want_access);
int mysql_backup_table(THD* thd, TABLE_LIST* table_list);
int mysql_restore_table(THD* thd, TABLE_LIST* table_list);
@@ -339,6 +346,7 @@ int mysql_analyze_table(THD* thd, TABLE_LIST* table_list,
HA_CHECK_OPT* check_opt);
int mysql_optimize_table(THD* thd, TABLE_LIST* table_list,
HA_CHECK_OPT* check_opt);
+bool check_simple_select();
/* net_pkg.c */
void send_warning(NET *net, uint sql_errno, const char *err=0);
@@ -367,7 +375,8 @@ SORT_FIELD * make_unireg_sortorder(ORDER *order, uint *length);
int setup_order(THD *thd,TABLE_LIST *tables, List<Item> &fields,
List <Item> &all_fields, ORDER *order);
int setup_group(THD *thd,TABLE_LIST *tables,List<Item> &fields,
- List<Item> &all_fields, ORDER *order, bool *hidden_group_fields);
+ List<Item> &all_fields, ORDER *order,
+ bool *hidden_group_fields);
int handle_select(THD *thd, LEX *lex, select_result *result);
int mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &list,COND *conds,
@@ -382,14 +391,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
int mysql_create_table(THD *thd,const char *db, const char *table_name,
HA_CREATE_INFO *create_info,
List<create_field> &fields, List<Key> &keys,
- bool tmp_table, bool no_log, uint select_field_count);
-/*
- no_log is needed for the case of CREATE ... SELECT,
- as the logging will be done later in sql_insert.cc
- select_field_count is also used for CREATE ... SELECT,
- and must be zero for standart create of table
-*/
-
+ bool tmp_table, bool no_log);
TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
const char *db, const char *name,
List<create_field> *extra_fields,
@@ -481,7 +483,8 @@ int mysqld_show_create_db(THD *thd, const char *dbname);
void mysqld_list_processes(THD *thd,const char *user,bool verbose);
int mysqld_show_status(THD *thd);
int mysqld_show_variables(THD *thd,const char *wild);
-int mysqld_show(THD *thd, const char *wild, show_var_st *variables);
+int mysqld_show(THD *thd, const char *wild, show_var_st *variables,
+ enum enum_var_type value_type);
int mysqld_show_charsets(THD *thd,const char *wild);
int mysqld_show_table_types(THD *thd);
int mysqld_show_privileges(THD *thd);
@@ -492,8 +495,8 @@ void mysql_com_prepare(THD *thd,char*packet,uint packet_length);
void mysql_init_query(THD *thd);/* sql_parse. cc */
void mysql_com_execute(THD *thd);
void mysql_com_longdata(THD *thd);
-int check_insert_fields(THD *thd,TABLE *table,List<Item> &fields,
- List<Item> &values, ulong counter);
+int check_insert_fields(THD *thd,TABLE *table,List<Item> &fields,
+ List<Item> &values, ulong counter);
/* sql_error.cc */
void push_error(uint code, const char *msg);
@@ -584,8 +587,6 @@ int write_record(TABLE *table,COPY_INFO *info);
extern ulong volatile manager_status;
extern bool volatile manager_thread_in_use, mqh_used;
extern pthread_t manager_thread;
-extern pthread_mutex_t LOCK_manager;
-extern pthread_cond_t COND_manager;
pthread_handler_decl(handle_manager, arg);
/* sql_test.cc */
@@ -609,34 +610,75 @@ void sql_print_error(const char *format,...)
__attribute__ ((format (printf, 1, 2)));
bool fn_format_relative_to_data_home(my_string to, const char *name,
const char *dir, const char *extension);
-void open_log(MYSQL_LOG *log, const char *hostname,
- const char *opt_name, const char *extension,
+bool open_log(MYSQL_LOG *log, const char *hostname,
+ const char *opt_name, const char *extension,
+ const char *index_file_name,
enum_log_type type, bool read_append = 0,
bool no_auto_events = 0);
-extern uint32 server_id;
+/*
+ External variables
+*/
+
+extern time_t start_time;
extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],
- mysql_real_data_home[];
+ mysql_real_data_home[], *charsets_list;
extern my_string mysql_tmpdir;
+extern const char *command_name[];
extern const char *first_keyword, *localhost, *delayed_user;
-extern ulong refresh_version,flush_version, thread_id,query_id,opened_tables,
- created_tmp_tables, created_tmp_disk_tables,
- aborted_threads,aborted_connects,
- delayed_insert_timeout,
- delayed_insert_limit, delayed_queue_size,
- delayed_insert_threads, delayed_insert_writes,
- delayed_rows_in_use,delayed_insert_errors;
+extern const char **errmesg; /* Error messages */
+extern const char *myisam_recover_options_str;
+extern uchar *days_in_month;
+extern char language[LIBLEN],reg_ext[FN_EXTLEN];
+extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN];
+extern char pidfile_name[FN_REFLEN], time_zone[30], *opt_init_file;
+extern char blob_newline;
+extern double log_10[32];
+extern ulong refresh_version,flush_version, thread_id,query_id,opened_tables;
+extern ulong created_tmp_tables, created_tmp_disk_tables;
+extern ulong aborted_threads,aborted_connects;
+extern ulong delayed_insert_timeout;
+extern ulong delayed_insert_limit, delayed_queue_size;
+extern ulong delayed_insert_threads, delayed_insert_writes;
+extern ulong delayed_rows_in_use,delayed_insert_errors;
extern ulong filesort_rows, filesort_range_count, filesort_scan_count;
extern ulong filesort_merge_passes;
extern ulong select_range_check_count, select_range_count, select_scan_count;
-extern ulong select_full_range_join_count,select_full_join_count,
- slave_open_temp_tables;
-extern uint test_flags,select_errors,ha_open_options;
+extern ulong select_full_range_join_count,select_full_join_count;
+extern ulong slave_open_temp_tables, query_cache_size;
extern ulong thd_startup_options, slow_launch_threads, slow_launch_time;
-extern ulong query_cache_startup_type;
-extern time_t start_time;
-extern const char *command_name[];
-extern I_List<THD> threads;
+extern ulong server_id, concurrency;
+extern ulong ha_read_count, ha_write_count, ha_delete_count, ha_update_count;
+extern ulong ha_read_key_count, ha_read_next_count, ha_read_prev_count;
+extern ulong ha_read_first_count, ha_read_last_count;
+extern ulong ha_read_rnd_count, ha_read_rnd_next_count;
+extern ulong ha_commit_count, ha_rollback_count;
+extern ulong keybuff_size,table_cache_size;
+extern ulong max_connections,max_connect_errors, connect_timeout;
+extern ulong max_insert_delayed_threads, max_user_connections;
+extern ulong long_query_count, what_to_log,flush_time,opt_sql_mode;
+extern ulong query_buff_size, thread_stack,thread_stack_min;
+extern ulong binlog_cache_size, max_binlog_cache_size, open_files_limit;
+extern ulong max_binlog_size, rpl_recovery_rank, thread_cache_size;
+extern ulong com_stat[(uint) SQLCOM_END], com_other, back_log;
+extern ulong specialflag, current_pid;
+
+extern uint test_flags,select_errors,ha_open_options;
+extern uint protocol_version,dropping_tables;
+extern uint delay_key_write_options;
+extern bool opt_endinfo, using_udf_functions, locked_in_memory;
+extern bool opt_using_transactions, mysql_embedded;
+extern bool using_update_log, opt_large_files;
+extern bool opt_log, opt_update_log, opt_bin_log, opt_slow_log;
+extern bool opt_disable_networking, opt_skip_show_db;
+extern bool volatile abort_loop, shutdown_in_progress, grant_option;
+extern uint volatile thread_count, thread_running, global_read_lock;
+extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types;
+extern my_bool opt_safe_show_db, opt_local_infile, lower_case_table_names;
+extern my_bool opt_slave_compressed_protocol, use_temp_pool;
+extern my_bool opt_enable_named_pipe;
+extern char f_fyllchar;
+
extern MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log;
extern FILE *bootstrap_file;
extern pthread_key(MEM_ROOT*,THR_MALLOC);
@@ -645,59 +687,33 @@ extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open,
LOCK_thread_count,LOCK_mapped_file,LOCK_user_locks, LOCK_status,
LOCK_grant, LOCK_error_log, LOCK_delayed_insert,
LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
- LOCK_server_id, LOCK_slave_list, LOCK_active_mi;
-extern pthread_cond_t COND_refresh,COND_thread_count;
+ LOCK_slave_list, LOCK_active_mi, LOCK_manager,
+ LOCK_global_system_variables;
+extern pthread_cond_t COND_refresh, COND_thread_count, COND_manager;
extern pthread_attr_t connection_attrib;
-extern bool opt_endinfo, using_udf_functions, locked_in_memory,
- opt_using_transactions, use_temp_pool, mysql_embedded;
-extern my_bool opt_local_infile;
-extern char f_fyllchar;
-extern ulong ha_read_count, ha_write_count, ha_delete_count, ha_update_count,
- ha_read_key_count, ha_read_next_count, ha_read_prev_count,
- ha_read_first_count, ha_read_last_count,
- ha_read_rnd_count, ha_read_rnd_next_count,
- ha_commit_count, ha_rollback_count;
+extern I_List<THD> threads;
extern MY_BITMAP temp_pool;
-extern uchar *days_in_month;
extern DATE_FORMAT dayord;
-extern double log_10[32];
-extern uint protocol_version,dropping_tables;
-extern ulong keybuff_size,sortbuff_size,max_item_sort_length,table_cache_size,
- max_join_size,join_buff_size,tmp_table_size,
- max_connections,max_connect_errors,long_query_time,
- max_insert_delayed_threads, max_user_connections,
- long_query_count,net_wait_timeout,net_interactive_timeout,
- net_read_timeout,net_write_timeout,
- what_to_log,flush_time,opt_sql_mode,
- max_tmp_tables,max_heap_table_size,query_buff_size,
- lower_case_table_names,thread_stack,thread_stack_min,
- binlog_cache_size, max_binlog_cache_size, record_rnd_cache_size;
-extern ulong com_stat[(uint) SQLCOM_END], com_other;
-extern ulong specialflag, current_pid;
-extern bool low_priority_updates, using_update_log;
-extern bool opt_sql_bin_update, opt_safe_show_db, opt_warnings,
- opt_safe_user_create, opt_no_mix_types;
-extern char language[LIBLEN],reg_ext[FN_EXTLEN],blob_newline;
-extern const char **errmesg; /* Error messages */
-extern const char *default_tx_isolation_name;
extern String empty_string;
-extern struct show_var_st init_vars[];
-extern struct show_var_st status_vars[];
+extern SHOW_VAR init_vars[],status_vars[], internal_vars[];
extern struct show_table_type_st table_type_vars[];
extern SHOW_COMP_OPTION have_isam;
extern SHOW_COMP_OPTION have_innodb;
extern SHOW_COMP_OPTION have_berkeley_db;
-extern enum db_type default_table_type;
-extern enum enum_tx_isolation default_tx_isolation;
-extern char glob_hostname[FN_REFLEN];
+extern struct system_variables global_system_variables;
+extern struct system_variables max_system_variables;
+
+/* optional things, have_* variables */
+
+extern SHOW_COMP_OPTION have_isam, have_innodb, have_berkeley_db;
+extern SHOW_COMP_OPTION have_raid, have_openssl, have_symlink;
+extern SHOW_COMP_OPTION have_query_cache, have_berkeley_db, have_innodb;
+
#ifndef __WIN__
extern pthread_t signal_thread;
#endif
-extern bool volatile abort_loop, shutdown_in_progress, grant_option;
-extern uint volatile thread_count, thread_running, global_read_lock;
-
MYSQL_LOCK *mysql_lock_tables(THD *thd,TABLE **table,uint count);
void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock);
void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock);
@@ -795,11 +811,14 @@ void hostname_cache_free();
void hostname_cache_refresh(void);
bool get_interval_info(const char *str,uint length,uint count,
long *values);
-/* sql_cache */
+/* sql_cache.cc */
extern bool sql_cache_init();
extern void sql_cache_free();
extern int sql_cache_hit(THD *thd, char *inBuf, uint length);
+/* item.cc */
+Item *get_system_var(enum_var_type var_type, LEX_STRING name);
+
/* Some inline functions for more speed */
inline bool add_item_to_list(Item *item)
@@ -824,5 +843,3 @@ inline void mark_as_null_row(TABLE *table)
table->status|=STATUS_NULL_ROW;
bfill(table->null_flags,table->null_bytes,255);
}
-
-#endif
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 59630644e5a..89f1c07b2fe 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mysql_priv.h"
-#include <mysql.h>
#include <m_ctype.h>
#include <my_dir.h>
#include "sql_acl.h"
@@ -38,14 +37,14 @@
#define ONE_THREAD
#endif
-#ifdef SAFEMALLOC
-#define SHUTDOWN_THD shutdown_th=pthread_self();
-#define MAIN_THD main_th=pthread_self();
-#define SIGNAL_THD signal_th=pthread_self();
-#else
#define SHUTDOWN_THD
#define MAIN_THD
#define SIGNAL_THD
+
+#ifdef PURIFY
+#define IF_PURIFY(A,B) (A)
+#else
+#define IF_PURIFY(A,B) (B)
#endif
/* stack traces are only supported on linux intel */
@@ -102,14 +101,14 @@ extern "C" { // Because of SCO 3.2V4.2
int allow_severity = LOG_INFO;
int deny_severity = LOG_WARNING;
-#ifdef __linux__
-#define my_fromhost(A) fromhost()
-#define my_hosts_access(A) hosts_access()
-#define my_eval_client(A) eval_client()
-#else
+#ifdef __STDC__
#define my_fromhost(A) fromhost(A)
#define my_hosts_access(A) hosts_access(A)
#define my_eval_client(A) eval_client(A)
+#else
+#define my_fromhost(A) fromhost()
+#define my_hosts_access(A) hosts_access()
+#define my_eval_client(A) eval_client()
#endif
#endif /* HAVE_LIBWRAP */
@@ -182,10 +181,11 @@ static SECURITY_DESCRIPTOR sdPipeDescriptor;
static HANDLE hPipe = INVALID_HANDLE_VALUE;
static pthread_cond_t COND_handler_count;
static uint handler_count;
-static bool opt_enable_named_pipe = 0;
#endif
#ifdef __WIN__
-static bool opt_console=0,start_mode=0;
+static bool opt_console=0, start_mode=0, use_opt_args;
+static int opt_argc;
+static char **opt_argv;
#endif
/* Set prefix for windows binary */
@@ -229,37 +229,55 @@ SHOW_COMP_OPTION have_openssl=SHOW_OPTION_YES;
#else
SHOW_COMP_OPTION have_openssl=SHOW_OPTION_NO;
#endif
+#ifdef HAVE_BROKEN_REALPATH
+SHOW_COMP_OPTION have_symlink=SHOW_OPTION_NO;
+#else
SHOW_COMP_OPTION have_symlink=SHOW_OPTION_YES;
+#endif
#ifdef HAVE_QUERY_CACHE
SHOW_COMP_OPTION have_query_cache=SHOW_OPTION_YES;
#else
SHOW_COMP_OPTION have_query_cache=SHOW_OPTION_NO;
#endif
-bool opt_skip_slave_start = 0; // If set, slave is not autostarted
+bool opt_large_files= sizeof(my_off_t) > 4;
+
+/*
+ Variables to store startup options
+*/
+
+my_bool opt_skip_slave_start = 0; // If set, slave is not autostarted
+/*
+ If set, some standard measures to enforce slave data integrity will not
+ be performed
+*/
+my_bool opt_reckless_slave = 0;
+
+ulong back_log, connect_timeout, concurrency;
+char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], time_zone[30];
+bool opt_log, opt_update_log, opt_bin_log, opt_slow_log;
+bool opt_disable_networking=0, opt_skip_show_db=0;
+my_bool opt_enable_named_pipe= 0;
+my_bool opt_local_infile, opt_external_locking, opt_slave_compressed_protocol;
+uint delay_key_write_options= (uint) DELAY_KEY_WRITE_ON;
-/* if set, some standard measures to enforce
- slave data intergity will not be performed
- */
-bool opt_reckless_slave = 0;
static bool opt_do_pstack = 0;
static ulong opt_specialflag=SPECIAL_ENGLISH;
-static ulong back_log,connect_timeout,concurrency;
+
static ulong opt_myisam_block_size;
static my_socket unix_sock= INVALID_SOCKET,ip_sock= INVALID_SOCKET;
static my_string opt_logname=0,opt_update_logname=0,
opt_binlog_index_name = 0,opt_slow_logname=0;
-static char mysql_home[FN_REFLEN],pidfile_name[FN_REFLEN];
+
static char* mysql_home_ptr= mysql_home;
static char* pidfile_name_ptr= pidfile_name;
static pthread_t select_thread;
-static bool opt_log,opt_update_log,opt_bin_log,opt_slow_log,opt_noacl,
- opt_disable_networking=0, opt_bootstrap=0,opt_skip_show_db=0,
- opt_myisam_log=0,
- opt_large_files=sizeof(my_off_t) > 4;
-bool opt_sql_bin_update = 0, opt_log_slave_updates = 0, opt_safe_show_db=0,
- opt_show_slave_auth_info = 0, opt_old_rpl_compat = 0,
- opt_safe_user_create = 0, opt_no_mix_types = 0;
+static my_bool opt_noacl=0, opt_bootstrap=0, opt_myisam_log=0;
+my_bool opt_safe_user_create = 0, opt_no_mix_types = 0;
+my_bool opt_safe_show_db=0, lower_case_table_names, opt_old_rpl_compat;
+my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0;
+my_bool opt_log_slave_updates= 0;
+
volatile bool mqh_used = 0;
FILE *bootstrap_file=0;
int segfaulted = 0; // ensure we do not enter SIGSEGV handler twice
@@ -272,14 +290,13 @@ int segfaulted = 0; // ensure we do not enter SIGSEGV handler twice
static bool kill_in_progress=FALSE;
static struct rand_struct sql_rand;
static int cleanup_done;
-static char **defaults_argv,time_zone[30];
-static const char *default_table_type_name;
+static char **defaults_argv;
char glob_hostname[FN_REFLEN];
#include "sslopt-vars.h"
#ifdef HAVE_OPENSSL
char *des_key_file = 0;
-struct st_VioSSLAcceptorFd * ssl_acceptor_fd = 0;
+struct st_VioSSLAcceptorFd *ssl_acceptor_fd= 0;
#endif /* HAVE_OPENSSL */
I_List <i_string_pair> replicate_rewrite_db;
@@ -288,7 +305,7 @@ I_List<i_string> replicate_do_db, replicate_ignore_db;
I_List<i_string> binlog_do_db, binlog_ignore_db;
/* if we guessed server_id , we need to know about it */
-uint32 server_id = 0;
+ulong server_id= 0; // Must be long becasue of set_var.cc
bool server_id_supplied = 0;
uint mysql_port;
@@ -298,19 +315,21 @@ uint volatile thread_count=0, thread_running=0, kill_cached_threads=0,
ulong thd_startup_options=(OPTION_UPDATE_LOG | OPTION_AUTO_IS_NULL |
OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE );
uint protocol_version=PROTOCOL_VERSION;
-ulong keybuff_size,sortbuff_size,max_item_sort_length,table_cache_size,
- max_join_size,join_buff_size,tmp_table_size,thread_stack,
- thread_stack_min,net_wait_timeout,what_to_log= ~ (1L << (uint) COM_TIME),
- query_buff_size, lower_case_table_names, mysqld_net_retry_count,
- net_interactive_timeout, slow_launch_time = 2L,
- net_read_timeout,net_write_timeout,slave_open_temp_tables=0,
- open_files_limit=0, max_binlog_size, record_rnd_cache_size;
+struct system_variables global_system_variables;
+struct system_variables max_system_variables;
+ulong keybuff_size,table_cache_size,
+ thread_stack,
+ thread_stack_min,what_to_log= ~ (1L << (uint) COM_TIME),
+ query_buff_size,
+ slow_launch_time = 2L,
+ slave_open_temp_tables=0,
+ open_files_limit=0, max_binlog_size;
ulong com_stat[(uint) SQLCOM_END], com_other;
ulong slave_net_timeout;
ulong thread_cache_size=0, binlog_cache_size=0, max_binlog_cache_size=0;
ulong query_cache_size=0;
#ifdef HAVE_QUERY_CACHE
-ulong query_cache_limit=0, query_cache_startup_type=1;
+ulong query_cache_limit=0;
Query_cache query_cache;
#endif
@@ -329,16 +348,15 @@ uint master_port = MYSQL_PORT, master_connect_retry = 60;
uint report_port = MYSQL_PORT;
bool master_ssl = 0;
-ulong max_tmp_tables,max_heap_table_size,master_retry_count=0;
+ulong master_retry_count=0;
ulong bytes_sent = 0L, bytes_received = 0L;
-bool opt_endinfo,using_udf_functions,low_priority_updates, locked_in_memory;
-bool opt_using_transactions, using_update_log, opt_warnings=0;
-my_bool opt_local_infile=1;
+bool opt_endinfo,using_udf_functions, locked_in_memory;
+bool opt_using_transactions, using_update_log;
bool volatile abort_loop,select_thread_in_use,grant_option;
bool volatile ready_to_exit,shutdown_in_progress;
ulong refresh_version=1L,flush_version=1L; /* Increments on each reload */
-ulong query_id=1L,long_query_count,long_query_time,aborted_threads,
+ulong query_id=1L,long_query_count,aborted_threads,
aborted_connects,delayed_insert_timeout,delayed_insert_limit,
delayed_queue_size,delayed_insert_threads,delayed_insert_writes,
delayed_rows_in_use,delayed_insert_errors,flush_time, thread_created;
@@ -352,15 +370,13 @@ ulong max_connections,max_insert_delayed_threads,max_used_connections,
max_connect_errors, max_user_connections = 0;
ulong thread_id=1L,current_pid;
ulong slow_launch_threads = 0;
-ulong myisam_max_sort_file_size, myisam_max_extra_sort_file_size;
char mysql_real_data_home[FN_REFLEN],
language[LIBLEN],reg_ext[FN_EXTLEN],
- default_charset[LIBLEN],mysql_charsets_dir[FN_REFLEN], *charsets_list,
+ mysql_charsets_dir[FN_REFLEN], *charsets_list,
blob_newline,f_fyllchar,max_sort_char,*mysqld_user,*mysqld_chroot,
*opt_init_file;
char *language_ptr= language;
-char *default_charset_ptr= default_charset;
#ifndef EMBEDDED_LIBRARY
char mysql_data_home_buff[2], *mysql_data_home=mysql_data_home_buff;
bool mysql_embedded=0;
@@ -376,12 +392,9 @@ const char *first_keyword="first";
const char **errmesg; /* Error messages */
const char *myisam_recover_options_str="OFF";
const char *sql_mode_str="OFF";
-const char *default_tx_isolation_name;
-enum_tx_isolation default_tx_isolation=ISO_READ_COMMITTED;
+ulong rpl_recovery_rank=0;
-uint rpl_recovery_rank=0;
-
-my_string mysql_unix_port=NULL, mysql_tmpdir=NULL, allocated_mysql_tmpdir=NULL;
+my_string mysql_unix_port=NULL, opt_mysql_tmpdir=NULL, mysql_tmpdir=NULL;
ulong my_bind_addr; /* the address we bind to */
DATE_FORMAT dayord;
double log_10[32]; /* 10 potences */
@@ -396,7 +409,7 @@ TYPELIB sql_mode_typelib= {array_elements(sql_mode_names)-1,"",
sql_mode_names};
MY_BITMAP temp_pool;
-bool use_temp_pool=0;
+my_bool use_temp_pool=0;
pthread_key(MEM_ROOT*,THR_MALLOC);
pthread_key(THD*, THR_THD);
@@ -406,15 +419,14 @@ pthread_mutex_t LOCK_mysql_create_db, LOCK_Acl, LOCK_open, LOCK_thread_count,
LOCK_error_log,
LOCK_delayed_insert, LOCK_delayed_status, LOCK_delayed_create,
LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
- LOCK_server_id,
+ LOCK_global_system_variables,
LOCK_user_conn, LOCK_slave_list, LOCK_active_mi;
-pthread_cond_t COND_refresh,COND_thread_count,COND_binlog_update,
- COND_slave_stopped, COND_slave_start;
+pthread_cond_t COND_refresh,COND_thread_count, COND_slave_stopped,
+ COND_slave_start;
pthread_cond_t COND_thread_cache,COND_flush_thread_cache;
pthread_t signal_thread;
pthread_attr_t connection_attrib;
-enum db_type default_table_type=DB_TYPE_MYISAM;
#ifdef __WIN__
#undef getpid
@@ -582,9 +594,7 @@ static void close_connections(void)
(void) pthread_mutex_unlock(&LOCK_thread_count); // For unlink from list
if (thread_count)
- {
sleep(1); // Give threads time to die
- }
/* Force remaining threads to die by closing the connection to the client */
@@ -638,29 +648,45 @@ static void close_server_sock()
if (tmp_sock != INVALID_SOCKET)
{
ip_sock=INVALID_SOCKET;
- DBUG_PRINT("info",("closing TCP/IP socket"));
+ DBUG_PRINT("info",("calling shutdown on TCP/IP socket"));
VOID(shutdown(tmp_sock,2));
+#ifdef NOT_USED
+ /*
+ The following code is disabled as it causes MySQL to hang on
+ AIX 4.3 during shutdown
+ */
+ DBUG_PRINT("info",("calling closesocket on TCP/IP socket"));
VOID(closesocket(tmp_sock));
+#endif
}
tmp_sock=unix_sock;
if (tmp_sock != INVALID_SOCKET)
{
unix_sock=INVALID_SOCKET;
- DBUG_PRINT("info",("closing Unix socket"));
+ DBUG_PRINT("info",("calling shutdown on unix socket"));
VOID(shutdown(tmp_sock,2));
+#ifdef NOT_USED
+ /*
+ The following code is disabled as it may cause MySQL to hang on
+ AIX 4.3 during shutdown (not tested, but likely)
+ */
+ DBUG_PRINT("info",("calling closesocket on unix/IP socket"));
VOID(closesocket(tmp_sock));
+#endif
VOID(unlink(mysql_unix_port));
}
DBUG_VOID_RETURN;
#endif
}
+
void kill_mysql(void)
{
DBUG_ENTER("kill_mysql");
#ifdef SIGNALS_DONT_BREAK_READ
- close_server_sock(); /* force accept to wake up */
+ abort_loop=1; // Break connection loops
+ close_server_sock(); // Force accept to wake up
#endif
#if defined(__WIN__)
@@ -681,17 +707,17 @@ void kill_mysql(void)
#elif defined(OS2)
pthread_cond_signal( &eventShutdown); // post semaphore
#elif defined(HAVE_PTHREAD_KILL)
- if (pthread_kill(signal_thread,SIGTERM)) /* End everything nicely */
+ if (pthread_kill(signal_thread, MYSQL_KILL_SIGNAL))
{
DBUG_PRINT("error",("Got error %d from pthread_kill",errno)); /* purecov: inspected */
}
#elif !defined(SIGNALS_DONT_BREAK_READ)
- kill(current_pid,SIGTERM);
+ kill(current_pid, MYSQL_KILL_SIGNAL);
#endif
DBUG_PRINT("quit",("After pthread_kill"));
shutdown_in_progress=1; // Safety if kill didn't work
#ifdef SIGNALS_DONT_BREAK_READ
- if (!abort_loop)
+ if (!kill_in_progress)
{
pthread_t tmp;
abort_loop=1;
@@ -732,7 +758,6 @@ static void __cdecl kill_server(int sig_ptr)
sql_print_error(ER(ER_GOT_SIGNAL),my_progname,sig); /* purecov: inspected */
#if defined(USE_ONE_SIGNAL_HAND) && !defined(__WIN__) && !defined(OS2)
- SHUTDOWN_THD;
my_thread_init(); // If this is a new thread
#endif
close_connections();
@@ -763,9 +788,12 @@ static pthread_handler_decl(kill_server_thread,arg __attribute__((unused)))
static sig_handler print_signal_warning(int sig)
{
- if (opt_warnings)
- sql_print_error("Warning: Got signal %d from thread %d",
- sig,my_thread_id());
+ if (!DBUG_IN_USE)
+ {
+ if (global_system_variables.log_warnings)
+ sql_print_error("Warning: Got signal %d from thread %d",
+ sig,my_thread_id());
+ }
#ifdef DONT_REMEMBER_SIGNAL
sigset(sig,print_signal_warning); /* int. thread system calls */
#endif
@@ -810,6 +838,7 @@ void clean_up(bool print_message)
hostname_cache_free();
item_user_lock_free();
lex_free(); /* Free some memory */
+ set_var_free();
#ifdef HAVE_DLOPEN
if (!opt_noacl)
udf_free();
@@ -819,19 +848,10 @@ void clean_up(bool print_message)
#ifdef USE_RAID
end_raid();
#endif
-#ifdef HAVE_OPENSSL
- my_free(opt_ssl_key,MYF(MY_ALLOW_ZERO_PTR));
- my_free(opt_ssl_cert,MYF(MY_ALLOW_ZERO_PTR));
- my_free(opt_ssl_ca,MYF(MY_ALLOW_ZERO_PTR));
- my_free(opt_ssl_capath,MYF(MY_ALLOW_ZERO_PTR));
- my_free(opt_ssl_cipher,MYF(MY_ALLOW_ZERO_PTR));
- my_free((gptr) ssl_acceptor_fd, MYF(MY_ALLOW_ZERO_PTR));
- opt_ssl_key=opt_ssl_cert=opt_ssl_ca=opt_ssl_capath=0;
-#endif /* HAVE_OPENSSL */
-
- free_defaults(defaults_argv);
+ if (defaults_argv)
+ free_defaults(defaults_argv);
my_free(charsets_list, MYF(MY_ALLOW_ZERO_PTR));
- my_free(allocated_mysql_tmpdir,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(mysql_tmpdir,MYF(MY_ALLOW_ZERO_PTR));
my_free(slave_load_tmpdir,MYF(MY_ALLOW_ZERO_PTR));
x_free(opt_bin_logname);
x_free(opt_relay_logname);
@@ -1015,8 +1035,6 @@ static void server_init(void)
unireg_abort(1);
}
}
- if (mysqld_chroot)
- set_root(mysqld_chroot);
set_user(mysqld_user); // Works also with mysqld_user==NULL
#ifdef __NT__
@@ -1047,8 +1065,8 @@ static void server_init(void)
PIPE_READMODE_BYTE |
PIPE_WAIT,
PIPE_UNLIMITED_INSTANCES,
- (int) net_buffer_length,
- (int) net_buffer_length,
+ (int) global_system_variables.net_buffer_length,
+ (int) global_system_variables.net_buffer_length,
NMPWAIT_USE_DEFAULT_WAIT,
&saPipeSecurity )) == INVALID_HANDLE_VALUE)
{
@@ -1145,7 +1163,7 @@ sig_handler end_thread_signal(int sig __attribute__((unused)))
{
THD *thd=current_thd;
DBUG_ENTER("end_thread_signal");
- if (thd)
+ if (thd && ! thd->bootstrap)
end_thread(thd,0);
DBUG_VOID_RETURN; /* purecov: deadcode */
}
@@ -1185,9 +1203,8 @@ void end_thread(THD *thd, bool put_in_cache)
DBUG_PRINT("info", ("sending a broadcast"))
/* Tell main we are ready */
- // TODO: explain why we broadcast outside of the lock or
- // fix the bug - Sasha
(void) pthread_mutex_unlock(&LOCK_thread_count);
+ /* It's safe to broadcast outside a lock (COND... is not deleted here) */
(void) pthread_cond_broadcast(&COND_thread_count);
DBUG_PRINT("info", ("unlocked thread_count mutex"))
#ifdef ONE_THREAD
@@ -1226,11 +1243,11 @@ void flush_thread_cache()
}
- /*
- ** Aborts a thread nicely. Commes here on SIGPIPE
- ** TODO: One should have to fix that thr_alarm know about this
- ** thread too
- */
+/*
+ Aborts a thread nicely. Commes here on SIGPIPE
+ TODO: One should have to fix that thr_alarm know about this
+ thread too.
+*/
#ifdef THREAD_SPECIFIC_SIGPIPE
static sig_handler abort_thread(int sig __attribute__((unused)))
@@ -1244,9 +1261,9 @@ static sig_handler abort_thread(int sig __attribute__((unused)))
#endif
/******************************************************************************
-** Setup a signal thread with handles all signals
-** Because linux doesn't support scemas use a mutex to check that
-** the signal thread is ready before continuing
+ Setup a signal thread with handles all signals.
+ Because Linux doesn't support schemas use a mutex to check that
+ the signal thread is ready before continuing
******************************************************************************/
#if defined(__WIN__) || defined(OS2)
@@ -1269,13 +1286,14 @@ static void start_signal_handler(void)
#elif defined(__EMX__)
static void sig_reload(int signo)
{
- reload_acl_and_cache((THD*) 0,REFRESH_LOG, (TABLE_LIST*) 0); // Flush everything
+ // Flush everything
+ reload_acl_and_cache((THD*) 0,REFRESH_LOG, (TABLE_LIST*) 0);
signal(signo, SIG_ACK);
}
static void sig_kill(int signo)
{
- if (!abort_loop)
+ if (!kill_in_progress)
{
abort_loop=1; // mark abort for threads
kill_server((void*) signo);
@@ -1333,15 +1351,16 @@ We will try our best to scrape up some info that will hopefully help diagnose\n\
the problem, but since we have already crashed, something is definitely wrong\n\
and this may fail.\n\n");
fprintf(stderr, "key_buffer_size=%ld\n", keybuff_size);
- fprintf(stderr, "record_buffer=%ld\n", my_default_record_cache_size);
- fprintf(stderr, "sort_buffer=%ld\n", sortbuff_size);
+ fprintf(stderr, "read_buffer_size=%ld\n", global_system_variables.read_buff_size);
+ fprintf(stderr, "sort_buffer_size=%ld\n", thd->variables.sortbuff_size);
fprintf(stderr, "max_used_connections=%ld\n", max_used_connections);
fprintf(stderr, "max_connections=%ld\n", max_connections);
fprintf(stderr, "threads_connected=%d\n", thread_count);
fprintf(stderr, "It is possible that mysqld could use up to \n\
-key_buffer_size + (record_buffer + sort_buffer)*max_connections = %ld K\n\
-bytes of memory\n", (keybuff_size + (my_default_record_cache_size +
- sortbuff_size) * max_connections)/ 1024);
+key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = %ld K\n\
+bytes of memory\n", (keybuff_size + (global_system_variables.read_buff_size +
+ thd->variables.sortbuff_size) *
+ max_connections)/ 1024);
fprintf(stderr, "Hope that's ok; if not, decrease some variables in the equation.\n\n");
#if defined(HAVE_LINUXTHREADS)
@@ -1357,7 +1376,7 @@ the thread stack. Please read http://www.mysql.com/doc/L/i/Linux.html\n\n",
#endif /* HAVE_LINUXTHREADS */
#ifdef HAVE_STACKTRACE
- if(!(test_flags & TEST_NO_STACKTRACE))
+ if (!(test_flags & TEST_NO_STACKTRACE))
{
fprintf(stderr,"thd=%p\n",thd);
print_stacktrace(thd ? (gptr) thd->thread_stack : (gptr) 0,
@@ -1421,6 +1440,17 @@ static void init_signals(void)
sigaction(SIGILL, &sa, NULL);
sigaction(SIGFPE, &sa, NULL);
}
+
+#ifdef HAVE_GETRLIMIT
+ if (test_flags & TEST_CORE_ON_SIGNAL)
+ {
+ /* Change limits so that we will get a core file */
+ struct rlimit rl;
+ rl.rlim_cur = rl.rlim_max = RLIM_INFINITY;
+ if (setrlimit(RLIMIT_CORE, &rl))
+ sql_print_error("Warning: setrlimit could not change the size of core files to 'infinity'; We may not be able to generate a core file on signals");
+ }
+#endif
(void) sigemptyset(&set);
#ifdef THREAD_SPECIFIC_SIGPIPE
sigset(SIGPIPE,abort_thread);
@@ -1433,8 +1463,8 @@ static void init_signals(void)
sigaddset(&set,SIGQUIT);
sigaddset(&set,SIGTERM);
sigaddset(&set,SIGHUP);
- signal(SIGTERM,SIG_DFL); // If it's blocked by parent
- signal(SIGHUP,SIG_DFL); // If it's blocked by parent
+ sigset(SIGTERM, print_signal_warning); // If it's blocked by parent
+ sigset(SIGHUP, print_signal_warning); // If it's blocked by parent
#ifdef SIGTSTP
sigaddset(&set,SIGTSTP);
#endif
@@ -1476,9 +1506,7 @@ static void start_signal_handler(void)
}
-/*
-** This threads handles all signals and alarms
-*/
+/* This threads handles all signals and alarms */
/* ARGSUSED */
static void *signal_hand(void *arg __attribute__((unused)))
@@ -1526,17 +1554,24 @@ static void *signal_hand(void *arg __attribute__((unused)))
}
#endif /* HAVE_STACK_TRACE_ON_SEGV */
- // signal to start_signal_handler that we are ready
+ /*
+ signal to start_signal_handler that we are ready
+ This works by waiting for start_signal_handler to free mutex,
+ after which we signal it that we are ready.
+ At this pointer there is no other threads running, so there
+ should not be any other pthread_cond_signal() calls.
+ */
(void) pthread_mutex_lock(&LOCK_thread_count);
- (void) pthread_cond_signal(&COND_thread_count);
(void) pthread_mutex_unlock(&LOCK_thread_count);
+ (void) pthread_cond_broadcast(&COND_thread_count);
+ (void) pthread_sigmask(SIG_BLOCK,&set,NULL);
for (;;)
{
int error; // Used when debugging
if (shutdown_in_progress && !abort_loop)
{
- sig=SIGTERM;
+ sig= SIGTERM;
error=0;
}
else
@@ -1584,7 +1619,7 @@ static void *signal_hand(void *arg __attribute__((unused)))
#endif
default:
#ifdef EXTRA_DEBUG
- sql_print_error("Warning: Got signal: %d, error: %d",sig,error); /* purecov: tested */
+ sql_print_error("Warning: Got signal: %d error: %d",sig,error); /* purecov: tested */
#endif
break; /* purecov: tested */
}
@@ -1596,8 +1631,8 @@ static void *signal_hand(void *arg __attribute__((unused)))
/*
-** All global error messages are sent here where the first one is stored for
-** the client
+ All global error messages are sent here where the first one is stored for
+ the client
*/
@@ -1682,23 +1717,25 @@ pthread_handler_decl(handle_shutdown,arg)
abort_loop = 1;
// unblock select()
- so_cancel( ip_sock);
- so_cancel( unix_sock);
+ so_cancel(ip_sock);
+ so_cancel(unix_sock);
return 0;
}
#endif
+
const char *load_default_groups[]= { "mysqld","server",0 };
#ifdef HAVE_LIBWRAP
char *libwrapName=NULL;
#endif
-void open_log(MYSQL_LOG *log, const char *hostname,
- const char *opt_name, const char *extension,
- enum_log_type type, bool read_append,
- bool no_auto_events)
+bool open_log(MYSQL_LOG *log, const char *hostname,
+ const char *opt_name, const char *extension,
+ const char *index_file_name,
+ enum_log_type type, bool read_append,
+ bool no_auto_events)
{
char tmp[FN_REFLEN];
if (!opt_name || !opt_name[0])
@@ -1722,8 +1759,9 @@ void open_log(MYSQL_LOG *log, const char *hostname,
opt_name=tmp;
}
}
- log->open(opt_name,type,0,(read_append) ? SEQ_READ_APPEND : WRITE_CACHE,
- no_auto_events);
+ return log->open(opt_name, type, 0, index_file_name,
+ (read_append) ? SEQ_READ_APPEND : WRITE_CACHE,
+ no_auto_events);
}
@@ -1739,9 +1777,10 @@ int main(int argc, char **argv)
my_umask=0660; // Default umask for new files
my_umask_dir=0700; // Default umask for new directories
MAIN_THD;
- /* initialize signal_th and shutdown_th to main_th for default value
- as we need to initialize them to something safe. They are used
- when compiled with safemalloc
+ /*
+ Initialize signal_th and shutdown_th to main_th for default value
+ as we need to initialize them to something safe. They are used
+ when compiled with safemalloc.
*/
SIGNAL_THD;
SHUTDOWN_THD;
@@ -1789,17 +1828,19 @@ int main(int argc, char **argv)
exit( 1 );
}
#endif
- load_defaults("my",load_default_groups,&argc,&argv);
+ load_defaults(MYSQL_CONFIG_NAME,load_default_groups,&argc,&argv);
defaults_argv=argv;
- mysql_tmpdir=getenv("TMPDIR"); /* Use this if possible */
+
+ /* Get default temporary directory */
+ opt_mysql_tmpdir=getenv("TMPDIR"); /* Use this if possible */
#if defined( __WIN__) || defined(OS2)
- if (!mysql_tmpdir)
- mysql_tmpdir=getenv("TEMP");
- if (!mysql_tmpdir)
- mysql_tmpdir=getenv("TMP");
+ if (!opt_mysql_tmpdir)
+ opt_mysql_tmpdir=getenv("TEMP");
+ if (!opt_mysql_tmpdir)
+ opt_mysql_tmpdir=getenv("TMP");
#endif
- if (!mysql_tmpdir || !mysql_tmpdir[0])
- mysql_tmpdir=(char*) P_tmpdir; /* purecov: inspected */
+ if (!opt_mysql_tmpdir || !opt_mysql_tmpdir[0])
+ opt_mysql_tmpdir=(char*) P_tmpdir; /* purecov: inspected */
set_options();
get_options(argc,argv);
@@ -1826,10 +1867,10 @@ int main(int argc, char **argv)
(void) pthread_mutex_init(&LOCK_bytes_sent,MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_bytes_received,MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_timezone,MY_MUTEX_INIT_FAST);
- (void) pthread_mutex_init(&LOCK_server_id, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_user_conn, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_rpl_status, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_active_mi, MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_global_system_variables, MY_MUTEX_INIT_FAST);
(void) pthread_cond_init(&COND_thread_count,NULL);
(void) pthread_cond_init(&COND_refresh,NULL);
(void) pthread_cond_init(&COND_thread_cache,NULL);
@@ -1838,20 +1879,23 @@ int main(int argc, char **argv)
(void) pthread_cond_init(&COND_rpl_status, NULL);
init_signals();
- if (set_default_charset_by_name(default_charset, MYF(MY_WME)))
- exit( 1 );
- charsets_list = list_charsets(MYF(MY_CS_COMPILED|MY_CS_CONFIG));
+ if (set_default_charset_by_name(sys_charset.value, MYF(MY_WME)))
+ exit(1);
+ charsets_list= list_charsets(MYF(MY_CS_COMPILED | MY_CS_CONFIG));
#ifdef HAVE_OPENSSL
+ if (opt_ssl_key || opt_ssl_cert || opt_ssl_ca || opt_ssl_capath ||
+ opt_ssl_cipher)
+ opt_use_ssl= 1;
if (opt_use_ssl)
{
- ssl_acceptor_fd = new_VioSSLAcceptorFd(opt_ssl_key, opt_ssl_cert,
- opt_ssl_ca, opt_ssl_capath,
- opt_ssl_cipher);
- DBUG_PRINT("info",("ssl_acceptor_fd: %p",ssl_acceptor_fd));
+ /* having ssl_acceptor_fd != 0 signals the use of SSL */
+ ssl_acceptor_fd= new_VioSSLAcceptorFd(opt_ssl_key, opt_ssl_cert,
+ opt_ssl_ca, opt_ssl_capath,
+ opt_ssl_cipher);
+ DBUG_PRINT("info",("ssl_acceptor_fd: %lx", (long) ssl_acceptor_fd));
if (!ssl_acceptor_fd)
opt_use_ssl = 0;
- /* having ssl_acceptor_fd != 0 signals the use of SSL */
}
if (des_key_file)
load_des_key_file(des_key_file);
@@ -1897,6 +1941,7 @@ int main(int argc, char **argv)
init_errmessage(); /* Read error messages from file */
lex_init();
item_init();
+ set_var_init();
mysys_uses_curses=0;
#ifdef USE_REGEX
regex_init();
@@ -1907,7 +1952,7 @@ int main(int argc, char **argv)
unireg_abort(1);
/*
- ** We have enough space for fiddling with the argv, continue
+ We have enough space for fiddling with the argv, continue
*/
umask(((~my_umask) & 0666));
if (my_setwd(mysql_real_data_home,MYF(MY_WME)))
@@ -1928,17 +1973,18 @@ int main(int argc, char **argv)
/* Setup log files */
if (opt_log)
- open_log(&mysql_log, glob_hostname, opt_logname, ".log", LOG_NORMAL);
+ open_log(&mysql_log, glob_hostname, opt_logname, ".log", NullS,
+ LOG_NORMAL);
if (opt_update_log)
{
open_log(&mysql_update_log, glob_hostname, opt_update_logname, "",
- LOG_NEW);
+ NullS, LOG_NEW);
using_update_log=1;
}
if (opt_slow_log)
open_log(&mysql_slow_log, glob_hostname, opt_slow_logname, "-slow.log",
- LOG_NORMAL);
+ NullS, LOG_NORMAL);
#ifdef __WIN__
#define MYSQL_ERR_FILE "mysql.err"
if (!opt_console)
@@ -1990,6 +2036,7 @@ int main(int argc, char **argv)
start_signal_handler(); // Creates pidfile
if (acl_init(opt_noacl))
{
+ abort_loop=1;
select_thread_in_use=0;
(void) pthread_kill(signal_thread,MYSQL_KILL_SIGNAL);
#ifndef __WIN__
@@ -2040,9 +2087,8 @@ The server will not act as a slave.");
strmov(strcend(tmp,'.'),"-bin");
opt_bin_logname=my_strdup(tmp,MYF(MY_WME));
}
- mysql_bin_log.set_index_file_name(opt_binlog_index_name);
open_log(&mysql_bin_log, glob_hostname, opt_bin_logname, "-bin",
- LOG_BIN);
+ opt_binlog_index_name,LOG_BIN);
using_update_log=1;
}
@@ -2131,9 +2177,7 @@ The server will not act as a slave.");
}
}
while (handler_count > 0)
- {
pthread_cond_wait(&COND_handler_count,&LOCK_thread_count);
- }
}
pthread_mutex_unlock(&LOCK_thread_count);
}
@@ -2155,8 +2199,8 @@ The server will not act as a slave.");
(void) pthread_mutex_lock(&LOCK_thread_count);
DBUG_PRINT("quit", ("Got thread_count mutex"));
select_thread_in_use=0; // For close_connections
- (void) pthread_cond_broadcast(&COND_thread_count);
(void) pthread_mutex_unlock(&LOCK_thread_count);
+ (void) pthread_cond_broadcast(&COND_thread_count);
#ifdef EXTRA_DEBUG2
sql_print_error("After lock_thread_count");
#endif
@@ -2165,9 +2209,7 @@ The server will not act as a slave.");
/* Wait until cleanup is done */
(void) pthread_mutex_lock(&LOCK_thread_count);
while (!ready_to_exit)
- {
pthread_cond_wait(&COND_thread_count,&LOCK_thread_count);
- }
(void) pthread_mutex_unlock(&LOCK_thread_count);
#if defined(__WIN__) && !defined(EMBEDDED_LIBRARY)
@@ -2186,73 +2228,116 @@ The server will not act as a slave.");
}
+/****************************************************************************
+ Main and thread entry function for Win32
+ (all this is needed only to run mysqld as a service on WinNT)
+****************************************************************************/
+
#if defined(__WIN__) && !defined(EMBEDDED_LIBRARY)
-/* ------------------------------------------------------------------------
- main and thread entry function for Win32
- (all this is needed only to run mysqld as a service on WinNT)
- -------------------------------------------------------------------------- */
int mysql_service(void *p)
{
- win_main(Service.my_argc, Service.my_argv);
+ if (use_opt_args)
+ win_main(opt_argc, opt_argv);
+ else
+ win_main(Service.my_argc, Service.my_argv);
return 0;
}
+/*
+ Handle basic handling of services, like installation and removal
+
+ SYNOPSIS
+ default_service_handling()
+ argv Pointer to argument list
+ servicename Internal name of service
+ displayname Display name of service (in taskbar ?)
+ file_path Path to this program
+
+ RETURN VALUES
+ 0 option handled
+ 1 Could not handle option
+ */
+
+bool default_service_handling(char **argv,
+ const char *servicename,
+ const char *displayname,
+ const char *file_path)
+{
+ if (Service.got_service_option(argv, "install"))
+ {
+ Service.Install(1, servicename, displayname, file_path);
+ return 0;
+ }
+ if (Service.got_service_option(argv, "install-manual"))
+ {
+ Service.Install(0, servicename, displayname, file_path);
+ return 0;
+ }
+ if (Service.got_service_option(argv, "remove"))
+ {
+ Service.Remove(servicename);
+ return 0;
+ }
+ return 1;
+}
+
+
int main(int argc, char **argv)
{
if (Service.GetOS()) /* true NT family */
{
char file_path[FN_REFLEN];
- my_path(file_path, argv[0], ""); /* Find name in path */
- fn_format(file_path,argv[0],file_path,"",1+4+16); /* Force use of full path */
+ my_path(file_path, argv[0], ""); /* Find name in path */
+ fn_format(file_path,argv[0],file_path,"",1+4+16); /* Force full path */
if (argc == 2)
{
- if (Service.got_service_option(argv, "install"))
- {
- Service.Install(1, MYSQL_SERVICENAME, MYSQL_SERVICENAME, file_path);
- return 0;
- }
- else if (Service.got_service_option(argv, "install-manual"))
- {
- Service.Install(0, MYSQL_SERVICENAME, MYSQL_SERVICENAME, file_path);
- return 0;
- }
- else if (Service.got_service_option(argv, "remove"))
- {
- Service.Remove(MYSQL_SERVICENAME);
- return 0;
- }
- else if (Service.IsService(argv[1]))
+ if (!default_service_handling(argv,MYSQL_SERVICENAME, MYSQL_SERVICENAME,
+ file_path))
+ return 0;
+ if (Service.IsService(argv[1]))
{
/* start an optional service */
- load_default_groups[0]= argv[1];
- event_name= argv[1];
+ event_name= argv[1];
+ load_default_groups[0]= argv[1];
start_mode= 1;
- Service.Init(event_name, mysql_service );
+ Service.Init(event_name, mysql_service);
return 0;
}
}
else if (argc == 3) /* install or remove any optional service */
{
+ /* Add service name after filename */
uint length=strlen(file_path);
- file_path[sizeof(file_path)-1]=0;
- strxnmov(file_path + length, sizeof(file_path)-2, " ", argv[2], NullS);
- if (Service.got_service_option(argv, "install"))
- {
- Service.Install(1, argv[2], argv[2], file_path);
- return 0;
- }
- else if (Service.got_service_option(argv, "install-manual"))
- {
- Service.Install(0, argv[2], argv[2], file_path);
- return 0;
- }
- else if (Service.got_service_option(argv, "remove"))
+ *strxnmov(file_path + length, sizeof(file_path)-length-2, " ",
+ argv[2], NullS)= '\0';
+
+ if (!default_service_handling(argv, argv[2], argv[2], file_path))
+ return 0;
+ if (Service.IsService(argv[2]))
{
- Service.Remove(argv[2]);
- return 0;
+ /* start an optional service */
+ use_opt_args=1;
+ opt_argc=argc;
+ opt_argv=argv;
+ event_name= argv[2];
+ start_mode= 1;
+ Service.Init(event_name, mysql_service);
+ return 0;
}
}
+ else if (argc == 4)
+ {
+ /*
+ Install an optional service with optional config file
+ mysqld --install-manual mysqldopt --defaults-file=c:\miguel\my.ini
+ */
+ uint length=strlen(file_path);
+ *strxnmov(file_path + length, sizeof(file_path)-length-2, " ",
+ argv[3], " ", argv[2], NullS)= '\0';
+ if (!default_service_handling(argv, argv[2], argv[2], file_path))
+ return 0;
+ }
else if (argc == 1 && Service.IsService(MYSQL_SERVICENAME))
{
/* start the default service */
@@ -2268,18 +2353,24 @@ int main(int argc, char **argv)
mysql_service(NULL);
return 0;
}
-/* ------------------------------------------------------------------------ */
#endif
+/*
+ Execute all commands from a file. Used by the mysql_install_db script to
+ create MySQL privilege tables without having to start a full MySQL server.
+*/
+
static int bootstrap(FILE *file)
{
THD *thd= new THD;
int error;
+ DBUG_ENTER("bootstrap");
+
thd->bootstrap=1;
thd->client_capabilities=0;
my_net_init(&thd->net,(st_vio*) 0);
- thd->max_packet_length=thd->net.max_packet;
+ thd->max_client_packet_length= thd->net.max_packet;
thd->master_access= ~0;
thd->thread_id=thread_id++;
thread_count++;
@@ -2289,7 +2380,7 @@ static int bootstrap(FILE *file)
(void*) thd))
{
sql_print_error("Warning: Can't create thread to handle bootstrap");
- return -1;
+ DBUG_RETURN(-1);
}
/* Wait for thread to die */
(void) pthread_mutex_lock(&LOCK_thread_count);
@@ -2303,7 +2394,7 @@ static int bootstrap(FILE *file)
net_end(&thd->net);
thd->cleanup();
delete thd;
- return error;
+ DBUG_RETURN(error);
}
static bool read_init_file(char *file_name)
@@ -2324,7 +2415,7 @@ static void create_new_thread(THD *thd)
DBUG_ENTER("create_new_thread");
NET *net=&thd->net; // For easy ref
- net->timeout = (uint) connect_timeout; // Timeout for read
+ net->read_timeout = (uint) connect_timeout;
if (protocol_version > 9)
net->return_errno=1;
@@ -2336,20 +2427,22 @@ static void create_new_thread(THD *thd)
delete thd;
DBUG_VOID_RETURN;
}
- if (pthread_mutex_lock(&LOCK_thread_count))
- {
- DBUG_PRINT("error",("Can't lock LOCK_thread_count"));
- close_connection(net,ER_OUT_OF_RESOURCES);
- delete thd;
- DBUG_VOID_RETURN;
- }
+ pthread_mutex_lock(&LOCK_thread_count);
if (thread_count-delayed_insert_threads > max_used_connections)
max_used_connections=thread_count-delayed_insert_threads;
thd->thread_id=thread_id++;
for (uint i=0; i < 8 ; i++) // Generate password teststring
thd->scramble[i]= (char) (rnd(&sql_rand)*94+33);
thd->scramble[8]=0;
- thd->rand=sql_rand;
+ /*
+ We need good random number initialization for new thread
+ Just coping global one will not work
+ */
+ {
+ ulong tmp=(ulong) (rnd(&sql_rand) * 3000000);
+ randominit(&(thd->rand), tmp + (ulong) start_time,
+ tmp + (ulong) thread_id);
+ }
thd->real_id=pthread_self(); // Keep purify happy
/* Start a new thread to handle connection */
@@ -2407,7 +2500,8 @@ static void create_new_thread(THD *thd)
inline void kill_broken_server()
{
/* hack to get around signals ignored in syscalls for problem OS's */
- if (unix_sock == INVALID_SOCKET || (!opt_disable_networking && ip_sock ==INVALID_SOCKET))
+ if (unix_sock == INVALID_SOCKET ||
+ (!opt_disable_networking && ip_sock == INVALID_SOCKET))
{
select_thread_in_use = 0;
kill_server((void*)MYSQL_KILL_SIGNAL); /* never returns */
@@ -2476,10 +2570,8 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused)))
MAYBE_BROKEN_SYSCALL;
break;
}
- /*
- ** Is this a new connection request
- */
+ /* Is this a new connection request ? */
#ifdef HAVE_SYS_UN_H
if (FD_ISSET(unix_sock,&readFDs))
{
@@ -2656,8 +2748,8 @@ pthread_handler_decl(handle_connections_namedpipes,arg)
PIPE_READMODE_BYTE |
PIPE_WAIT,
PIPE_UNLIMITED_INSTANCES,
- (int) net_buffer_length,
- (int) net_buffer_length,
+ (int) global_system_variables.net_buffer_length,
+ (int) global_systenm_ariables.net_buffer_length,
NMPWAIT_USE_DEFAULT_WAIT,
&saPipeSecurity )) ==
INVALID_HANDLE_VALUE )
@@ -2674,8 +2766,8 @@ pthread_handler_decl(handle_connections_namedpipes,arg)
PIPE_READMODE_BYTE |
PIPE_WAIT,
PIPE_UNLIMITED_INSTANCES,
- (int) net_buffer_length,
- (int) net_buffer_length,
+ (int) global_system_variables.net_buffer_length,
+ (int) global_system_variables.net_buffer_length,
NMPWAIT_USE_DEFAULT_WAIT,
&saPipeSecurity)) ==
INVALID_HANDLE_VALUE)
@@ -2705,8 +2797,8 @@ pthread_handler_decl(handle_connections_namedpipes,arg)
pthread_mutex_lock(&LOCK_thread_count);
handler_count--;
- pthread_cond_signal(&COND_handler_count);
pthread_mutex_unlock(&LOCK_thread_count);
+ pthread_cond_signal(&COND_handler_count);
DBUG_RETURN(0);
}
#endif /* __NT__ */
@@ -2717,115 +2809,115 @@ pthread_handler_decl(handle_connections_namedpipes,arg)
******************************************************************************/
enum options {
- OPT_ISAM_LOG=256, OPT_SKIP_NEW,
- OPT_SKIP_GRANT, OPT_SKIP_LOCK,
- OPT_ENABLE_LOCK, OPT_USE_LOCKING,
- OPT_SOCKET, OPT_UPDATE_LOG,
- OPT_BIN_LOG, OPT_SKIP_RESOLVE,
- OPT_SKIP_NETWORKING, OPT_BIN_LOG_INDEX,
- OPT_BIND_ADDRESS, OPT_PID_FILE,
- OPT_SKIP_PRIOR, OPT_BIG_TABLES,
- OPT_STANDALONE, OPT_ONE_THREAD,
- OPT_CONSOLE, OPT_LOW_PRIORITY_UPDATES,
- OPT_SKIP_HOST_CACHE, OPT_LONG_FORMAT,
- OPT_FLUSH, OPT_SAFE,
- OPT_BOOTSTRAP, OPT_SKIP_SHOW_DB,
- OPT_TABLE_TYPE, OPT_INIT_FILE,
- OPT_DELAY_KEY_WRITE, OPT_SLOW_QUERY_LOG,
- OPT_USE_DELAY_KEY_WRITE, OPT_CHARSETS_DIR,
- OPT_BDB_HOME, OPT_BDB_LOG,
- OPT_BDB_TMP, OPT_BDB_NOSYNC,
- OPT_BDB_LOCK, OPT_BDB_SKIP,
- OPT_BDB_NO_RECOVER, OPT_BDB_SHARED,
- OPT_MASTER_HOST, OPT_MASTER_USER,
- OPT_MASTER_PASSWORD, OPT_MASTER_PORT,
- OPT_MASTER_INFO_FILE, OPT_MASTER_CONNECT_RETRY,
- OPT_MASTER_RETRY_COUNT,
- OPT_MASTER_SSL, OPT_MASTER_SSL_KEY,
- OPT_MASTER_SSL_CERT,
- OPT_SQL_BIN_UPDATE_SAME, OPT_REPLICATE_DO_DB,
- OPT_REPLICATE_IGNORE_DB, OPT_LOG_SLAVE_UPDATES,
- OPT_BINLOG_DO_DB, OPT_BINLOG_IGNORE_DB,
- OPT_WANT_CORE, OPT_CONCURRENT_INSERT,
- OPT_MEMLOCK, OPT_MYISAM_RECOVER,
- OPT_REPLICATE_REWRITE_DB, OPT_SERVER_ID,
- OPT_SKIP_SLAVE_START, OPT_SKIP_INNOBASE,
- OPT_SAFEMALLOC_MEM_LIMIT, OPT_REPLICATE_DO_TABLE,
- OPT_REPLICATE_IGNORE_TABLE, OPT_REPLICATE_WILD_DO_TABLE,
- OPT_REPLICATE_WILD_IGNORE_TABLE,
- OPT_DISCONNECT_SLAVE_EVENT_COUNT,
- OPT_ABORT_SLAVE_EVENT_COUNT,
- OPT_INNODB_DATA_HOME_DIR,
- OPT_INNODB_DATA_FILE_PATH,
- OPT_INNODB_LOG_GROUP_HOME_DIR,
- OPT_INNODB_LOG_ARCH_DIR,
- OPT_INNODB_LOG_ARCHIVE,
- OPT_INNODB_FLUSH_LOG_AT_TRX_COMMIT,
- OPT_INNODB_FLUSH_METHOD,
- OPT_INNODB_FAST_SHUTDOWN,
- OPT_SAFE_SHOW_DB,
- OPT_INNODB_SKIP, OPT_SKIP_SAFEMALLOC,
- OPT_TEMP_POOL, OPT_TX_ISOLATION,
- OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS,
- OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP_FAIL,
- OPT_SAFE_USER_CREATE, OPT_SQL_MODE,
- OPT_HAVE_NAMED_PIPE,
- OPT_DO_PSTACK, OPT_REPORT_HOST,
- OPT_REPORT_USER, OPT_REPORT_PASSWORD, OPT_REPORT_PORT,
- OPT_SHOW_SLAVE_AUTH_INFO, OPT_OLD_RPL_COMPAT,
- OPT_SLAVE_LOAD_TMPDIR, OPT_NO_MIX_TYPE,
- OPT_RPL_RECOVERY_RANK,OPT_INIT_RPL_ROLE,
- OPT_RELAY_LOG, OPT_RELAY_LOG_INDEX, OPT_RELAY_LOG_INFO_FILE,
- OPT_SLAVE_SKIP_ERRORS, OPT_DES_KEY_FILE, OPT_LOCAL_INFILE,
- OPT_RECKLESS_SLAVE,
- OPT_SSL_SSL, OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA,
- OPT_SSL_CAPATH, OPT_SSL_CIPHER,
- OPT_BACK_LOG, OPT_BINLOG_CACHE_SIZE,
- OPT_CONNECT_TIMEOUT, OPT_DELAYED_INSERT_TIMEOUT,
- OPT_DELAYED_INSERT_LIMIT, OPT_DELAYED_QUEUE_SIZE,
- OPT_FLUSH_TIME, OPT_FT_MIN_WORD_LEN,
- OPT_FT_MAX_WORD_LEN, OPT_FT_MAX_WORD_LEN_FOR_SORT,
- OPT_INTERACTIVE_TIMEOUT, OPT_JOIN_BUFF_SIZE,
- OPT_KEY_BUFFER_SIZE, OPT_LONG_QUERY_TIME,
- OPT_LOWER_CASE_TABLE_NAMES, OPT_MAX_ALLOWED_PACKET,
- OPT_MAX_BINLOG_CACHE_SIZE, OPT_MAX_BINLOG_SIZE,
- OPT_MAX_CONNECTIONS, OPT_MAX_CONNECT_ERRORS,
- OPT_MAX_DELAYED_THREADS, OPT_MAX_HEP_TABLE_SIZE,
- OPT_MAX_JOIN_SIZE, OPT_MAX_SORT_LENGTH,
- OPT_MAX_TMP_TABLES, OPT_MAX_USER_CONNECTIONS,
- OPT_MAX_WRITE_LOCK_COUNT, OPT_MYISAM_BULK_INSERT_TREE_SIZE,
- OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
- OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE,
- OPT_NET_BUFFER_LENGTH, OPT_NET_RETRY_COUNT,
- OPT_NET_READ_TIMEOUT, OPT_NET_WRITE_TIMEOUT,
- OPT_OPEN_FILES_LIMIT, OPT_QUERY_BUFFER_SIZE,
- OPT_QUERY_CACHE_LIMIT, OPT_QUERY_CACHE_SIZE,
- OPT_QUERY_CACHE_STARTUP_TYPE, OPT_RECORD_BUFFER,
- OPT_RECORD_RND_BUFFER, OPT_RELAY_LOG_SPACE_LIMIT,
- OPT_SLAVE_NET_TIMEOUT, OPT_SLOW_LAUNCH_TIME,
- OPT_SORT_BUFFER, OPT_TABLE_CACHE,
- OPT_THREAD_CONCURRENCY, OPT_THREAD_CACHE_SIZE,
- OPT_TMP_TABLE_SIZE, OPT_THREAD_STACK,
- OPT_WAIT_TIMEOUT,
- OPT_INNODB_MIRRORED_LOG_GROUPS,
- OPT_INNODB_LOG_FILES_IN_GROUP,
- OPT_INNODB_LOG_FILE_SIZE,
- OPT_INNODB_LOG_BUFFER_SIZE,
- OPT_INNODB_BUFFER_POOL_SIZE,
- OPT_INNODB_ADDITIONAL_MEM_POOL_SIZE,
- OPT_INNODB_FILE_IO_THREADS,
- OPT_INNODB_LOCK_WAIT_TIMEOUT,
- OPT_INNODB_THREAD_CONCURRENCY,
- OPT_INNODB_FORCE_RECOVERY,
- OPT_BDB_CACHE_SIZE,
- OPT_BDB_LOG_BUFFER_SIZE,
- OPT_BDB_MAX_LOCK
+ OPT_ISAM_LOG=256, OPT_SKIP_NEW,
+ OPT_SKIP_GRANT, OPT_SKIP_LOCK,
+ OPT_ENABLE_LOCK, OPT_USE_LOCKING,
+ OPT_SOCKET, OPT_UPDATE_LOG,
+ OPT_BIN_LOG, OPT_SKIP_RESOLVE,
+ OPT_SKIP_NETWORKING, OPT_BIN_LOG_INDEX,
+ OPT_BIND_ADDRESS, OPT_PID_FILE,
+ OPT_SKIP_PRIOR, OPT_BIG_TABLES,
+ OPT_STANDALONE, OPT_ONE_THREAD,
+ OPT_CONSOLE, OPT_LOW_PRIORITY_UPDATES,
+ OPT_SKIP_HOST_CACHE, OPT_LONG_FORMAT,
+ OPT_FLUSH, OPT_SAFE,
+ OPT_BOOTSTRAP, OPT_SKIP_SHOW_DB,
+ OPT_TABLE_TYPE, OPT_INIT_FILE,
+ OPT_DELAY_KEY_WRITE_ALL, OPT_SLOW_QUERY_LOG,
+ OPT_DELAY_KEY_WRITE, OPT_CHARSETS_DIR,
+ OPT_BDB_HOME, OPT_BDB_LOG,
+ OPT_BDB_TMP, OPT_BDB_NOSYNC,
+ OPT_BDB_LOCK, OPT_BDB_SKIP,
+ OPT_BDB_NO_RECOVER, OPT_BDB_SHARED,
+ OPT_MASTER_HOST, OPT_MASTER_USER,
+ OPT_MASTER_PASSWORD, OPT_MASTER_PORT,
+ OPT_MASTER_INFO_FILE, OPT_MASTER_CONNECT_RETRY,
+ OPT_MASTER_RETRY_COUNT,
+ OPT_MASTER_SSL, OPT_MASTER_SSL_KEY,
+ OPT_MASTER_SSL_CERT,
+ OPT_SQL_BIN_UPDATE_SAME, OPT_REPLICATE_DO_DB,
+ OPT_REPLICATE_IGNORE_DB, OPT_LOG_SLAVE_UPDATES,
+ OPT_BINLOG_DO_DB, OPT_BINLOG_IGNORE_DB,
+ OPT_WANT_CORE, OPT_CONCURRENT_INSERT,
+ OPT_MEMLOCK, OPT_MYISAM_RECOVER,
+ OPT_REPLICATE_REWRITE_DB, OPT_SERVER_ID,
+ OPT_SKIP_SLAVE_START, OPT_SKIP_INNOBASE,
+ OPT_SAFEMALLOC_MEM_LIMIT, OPT_REPLICATE_DO_TABLE,
+ OPT_REPLICATE_IGNORE_TABLE, OPT_REPLICATE_WILD_DO_TABLE,
+ OPT_REPLICATE_WILD_IGNORE_TABLE,
+ OPT_DISCONNECT_SLAVE_EVENT_COUNT,
+ OPT_ABORT_SLAVE_EVENT_COUNT,
+ OPT_INNODB_DATA_HOME_DIR,
+ OPT_INNODB_DATA_FILE_PATH,
+ OPT_INNODB_LOG_GROUP_HOME_DIR,
+ OPT_INNODB_LOG_ARCH_DIR,
+ OPT_INNODB_LOG_ARCHIVE,
+ OPT_INNODB_FLUSH_LOG_AT_TRX_COMMIT,
+ OPT_INNODB_FLUSH_METHOD,
+ OPT_INNODB_FAST_SHUTDOWN,
+ OPT_SAFE_SHOW_DB,
+ OPT_INNODB_SKIP, OPT_SKIP_SAFEMALLOC,
+ OPT_TEMP_POOL, OPT_TX_ISOLATION,
+ OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS,
+ OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP_FAIL,
+ OPT_SAFE_USER_CREATE, OPT_SQL_MODE,
+ OPT_HAVE_NAMED_PIPE,
+ OPT_DO_PSTACK, OPT_REPORT_HOST,
+ OPT_REPORT_USER, OPT_REPORT_PASSWORD, OPT_REPORT_PORT,
+ OPT_SHOW_SLAVE_AUTH_INFO, OPT_OLD_RPL_COMPAT,
+ OPT_SLAVE_LOAD_TMPDIR, OPT_NO_MIX_TYPE,
+ OPT_RPL_RECOVERY_RANK,OPT_INIT_RPL_ROLE,
+ OPT_RELAY_LOG, OPT_RELAY_LOG_INDEX, OPT_RELAY_LOG_INFO_FILE,
+ OPT_SLAVE_SKIP_ERRORS, OPT_DES_KEY_FILE, OPT_LOCAL_INFILE,
+ OPT_RECKLESS_SLAVE,
+ OPT_SSL_SSL, OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA,
+ OPT_SSL_CAPATH, OPT_SSL_CIPHER,
+ OPT_BACK_LOG, OPT_BINLOG_CACHE_SIZE,
+ OPT_CONNECT_TIMEOUT, OPT_DELAYED_INSERT_TIMEOUT,
+ OPT_DELAYED_INSERT_LIMIT, OPT_DELAYED_QUEUE_SIZE,
+ OPT_FLUSH_TIME, OPT_FT_MIN_WORD_LEN,
+ OPT_FT_MAX_WORD_LEN, OPT_FT_MAX_WORD_LEN_FOR_SORT,
+ OPT_INTERACTIVE_TIMEOUT, OPT_JOIN_BUFF_SIZE,
+ OPT_KEY_BUFFER_SIZE, OPT_LONG_QUERY_TIME,
+ OPT_LOWER_CASE_TABLE_NAMES, OPT_MAX_ALLOWED_PACKET,
+ OPT_MAX_BINLOG_CACHE_SIZE, OPT_MAX_BINLOG_SIZE,
+ OPT_MAX_CONNECTIONS, OPT_MAX_CONNECT_ERRORS,
+ OPT_MAX_DELAYED_THREADS, OPT_MAX_HEP_TABLE_SIZE,
+ OPT_MAX_JOIN_SIZE, OPT_MAX_SORT_LENGTH,
+ OPT_MAX_TMP_TABLES, OPT_MAX_USER_CONNECTIONS,
+ OPT_MAX_WRITE_LOCK_COUNT, OPT_BULK_INSERT_BUFFER_SIZE,
+ OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
+ OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE,
+ OPT_NET_BUFFER_LENGTH, OPT_NET_RETRY_COUNT,
+ OPT_NET_READ_TIMEOUT, OPT_NET_WRITE_TIMEOUT,
+ OPT_OPEN_FILES_LIMIT,
+ OPT_QUERY_CACHE_LIMIT, OPT_QUERY_CACHE_SIZE,
+ OPT_QUERY_CACHE_TYPE, OPT_RECORD_BUFFER,
+ OPT_RECORD_RND_BUFFER, OPT_RELAY_LOG_SPACE_LIMIT,
+ OPT_SLAVE_NET_TIMEOUT, OPT_SLAVE_COMPRESSED_PROTOCOL, OPT_SLOW_LAUNCH_TIME,
+ OPT_SORT_BUFFER, OPT_TABLE_CACHE,
+ OPT_THREAD_CONCURRENCY, OPT_THREAD_CACHE_SIZE,
+ OPT_TMP_TABLE_SIZE, OPT_THREAD_STACK,
+ OPT_WAIT_TIMEOUT,
+ OPT_INNODB_MIRRORED_LOG_GROUPS,
+ OPT_INNODB_LOG_FILES_IN_GROUP,
+ OPT_INNODB_LOG_FILE_SIZE,
+ OPT_INNODB_LOG_BUFFER_SIZE,
+ OPT_INNODB_BUFFER_POOL_SIZE,
+ OPT_INNODB_ADDITIONAL_MEM_POOL_SIZE,
+ OPT_INNODB_FILE_IO_THREADS,
+ OPT_INNODB_LOCK_WAIT_TIMEOUT,
+ OPT_INNODB_THREAD_CONCURRENCY,
+ OPT_INNODB_FORCE_RECOVERY,
+ OPT_BDB_CACHE_SIZE,
+ OPT_BDB_LOG_BUFFER_SIZE,
+ OPT_BDB_MAX_LOCK
};
#define LONG_TIMEOUT ((ulong) 3600L*24L*365L)
-static struct my_option my_long_options[] =
+struct my_option my_long_options[] =
{
{"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -2866,7 +2958,7 @@ static struct my_option my_long_options[] =
"Tells the master that updates to the given database should not be logged tothe binary log",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"bind-address", OPT_BIND_ADDRESS, "Ip address to bind to",
- (gptr*) &my_bind_addr, (gptr*) &my_bind_addr, 0, GET_ULONG, REQUIRED_ARG, 0,
+ (gptr*) &my_bind_addr, (gptr*) &my_bind_addr, 0, GET_STR, REQUIRED_ARG, 0,
0, 0, 0, 0, 0},
{"bootstrap", OPT_BOOTSTRAP, "Used by mysql installation scripts", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -2904,17 +2996,20 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0, 0},
#endif /* HAVE_OPENSSL */
{"default-character-set", 'C', "Set the default character set",
- (gptr*) &default_charset_ptr, (gptr*) &default_charset_ptr, 0, GET_STR,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (gptr*) &sys_charset.value, (gptr*) &sys_charset.value, 0, GET_STR,
+ REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{"default-table-type", OPT_TABLE_TYPE,
- "Set the default table type for tables", (gptr*) &default_table_type_name,
- (gptr*) &default_table_type_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0,
- 0},
- {"delay-key-write-for-all-tables", OPT_DELAY_KEY_WRITE,
- "Don't flush key buffers between writes for any MyISAM table", 0, 0, 0,
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"enable-locking", OPT_ENABLE_LOCK, "Enable system locking", 0, 0, 0,
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ "Set the default table type for tables", 0, 0,
+ 0, GET_NO_ARG, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"delay-key-write", OPT_DELAY_KEY_WRITE, "Type of DELAY_KEY_WRITE",
+ 0,0,0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"delay-key-write-for-all-tables", OPT_DELAY_KEY_WRITE_ALL,
+ "Don't flush key buffers between writes for any MyISAM table (Depricated option, use --delay-key-write=all instead)",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"enable-locking", OPT_ENABLE_LOCK,
+ "Depricated option, use --external-locking instead",
+ (gptr*) &opt_external_locking, (gptr*) &opt_external_locking,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef __NT__
{"enable-named-pipe", OPT_HAVE_NAMED_PIPE, "Enable the named pipe (NT)",
(gptr*) &opt_enable_named_pipe, (gptr*) &opt_enable_named_pipe, 0, GET_BOOL,
@@ -2950,8 +3045,10 @@ static struct my_option my_long_options[] =
"Set to 1 if you want to have logs archived", 0, 0, 0, GET_LONG, OPT_ARG,
0, 0, 0, 0, 0, 0},
{"innodb_flush_log_at_trx_commit", OPT_INNODB_FLUSH_LOG_AT_TRX_COMMIT,
- "Set to 0 if you don't want to flush logs", 0, 0, 0, GET_LONG, OPT_ARG,
- 0, 0, 0, 0, 0, 0},
+ "Set to 0 if you don't want to flush logs",
+ (gptr*) &innobase_flush_log_at_trx_commit,
+ (gptr*) &innobase_flush_log_at_trx_commit,
+ 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"innodb_flush_method", OPT_INNODB_FLUSH_METHOD,
"With which method to flush data", (gptr*) &innobase_unix_file_flush_method,
(gptr*) &innobase_unix_file_flush_method, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
@@ -2973,7 +3070,8 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0, 0},
{"local-infile", OPT_LOCAL_INFILE,
"Enable/disable LOAD DATA LOCAL INFILE (takes values 1|0)",
- (gptr*) &opt_local_infile, (gptr*) &opt_local_infile, 0, GET_BOOL, OPT_ARG,
+ (gptr*) &opt_local_infile,
+ (gptr*) &opt_local_infile, 0, GET_BOOL, OPT_ARG,
1, 0, 0, 0, 0, 0},
{"log-bin", OPT_BIN_LOG,
"Log queries in new binary format (for replication)",
@@ -2998,12 +3096,14 @@ static struct my_option my_long_options[] =
"Log some extra information to update log", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
{"log-slave-updates", OPT_LOG_SLAVE_UPDATES,
- "Tells the slave to log the updates from the slave thread to the binary log. Off by default. You will need to turn it on if you plan to daisy-chain the slaves.",
+ "Tells the slave to log the updates from the slave thread to the binary log. You will need to turn it on if you plan to daisy-chain the slaves.",
(gptr*) &opt_log_slave_updates, (gptr*) &opt_log_slave_updates, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"low-priority-updates", OPT_LOW_PRIORITY_UPDATES,
- "INSERT/DELETE/UPDATE has lower priority than selects", 0, 0, 0, GET_NO_ARG,
- NO_ARG, 0, 0, 0, 0, 0, 0},
+ "INSERT/DELETE/UPDATE has lower priority than selects",
+ (gptr*) &global_system_variables.low_priority_updates,
+ (gptr*) &max_system_variables.low_priority_updates,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"master-host", OPT_MASTER_HOST,
"Master hostname or IP address for replication. If not set, the slave thread will not be started. Note that the setting of master-host will be ignored if there exists a valid master.info file.",
(gptr*) &master_host, (gptr*) &master_host, 0, GET_STR, REQUIRED_ARG, 0, 0,
@@ -3026,7 +3126,7 @@ static struct my_option my_long_options[] =
{"master-retry-count", OPT_MASTER_RETRY_COUNT,
"The number of tries the slave will make to connect to the master before giving up.",
(gptr*) &master_retry_count, (gptr*) &master_retry_count, 0, GET_ULONG,
- REQUIRED_ARG, 60, 0, 0, 0, 0, 0},
+ REQUIRED_ARG, 3600*24, 0, 0, 0, 0, 0},
{"master-info-file", OPT_MASTER_INFO_FILE,
"The location of the file that remembers where we left off on the master during the replication process. The default is `master.info' in the data directory. You should not need to change this.",
(gptr*) &master_info_file, (gptr*) &master_info_file, 0, GET_STR,
@@ -3047,25 +3147,23 @@ static struct my_option my_long_options[] =
"Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP or FORCE.",
(gptr*) &myisam_recover_options_str, (gptr*) &myisam_recover_options_str, 0,
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- /*
- Option needs to be available for the test case to pass in non-debugging
- mode. is a no-op.
- */
{"memlock", OPT_MEMLOCK, "Lock mysqld in memory", (gptr*) &locked_in_memory,
(gptr*) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"disconnect-slave-event-count", OPT_DISCONNECT_SLAVE_EVENT_COUNT,
- "Undocumented: Meant for debugging and testing of replication",
+ "Option used by mysql-test for debugging and testing of replication",
(gptr*) &disconnect_slave_event_count,
(gptr*) &disconnect_slave_event_count, 0, GET_INT, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
{"abort-slave-event-count", OPT_ABORT_SLAVE_EVENT_COUNT,
- "Undocumented: Meant for debugging and testing of replication",
+ "Option used by mysql-test for debugging and testing of replication",
(gptr*) &abort_slave_event_count, (gptr*) &abort_slave_event_count,
0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"max-binlog-dump-events", OPT_MAX_BINLOG_DUMP_EVENTS, "Undocumented",
+ {"max-binlog-dump-events", OPT_MAX_BINLOG_DUMP_EVENTS,
+ "Option used by mysql-test for debugging and testing of replication",
(gptr*) &max_binlog_dump_events, (gptr*) &max_binlog_dump_events, 0,
GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"sporadic-binlog-dump-fail", OPT_SPORADIC_BINLOG_DUMP_FAIL, "Undocumented",
+ {"sporadic-binlog-dump-fail", OPT_SPORADIC_BINLOG_DUMP_FAIL,
+ "Option used by mysql-test for debugging and testing of replication",
(gptr*) &opt_sporadic_binlog_dump_fail,
(gptr*) &opt_sporadic_binlog_dump_fail, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
@@ -3075,14 +3173,15 @@ static struct my_option my_long_options[] =
{"new", 'n', "Use very new possible 'unsafe' functions", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef NOT_YET
- {"no-mix-table-types", OPT_NO_MIX_TYPE, "Undocumented",
+ {"no-mix-table-types", OPT_NO_MIX_TYPE, "Don't allow commands with uses two different table types",
(gptr*) &opt_no_mix_types, (gptr*) &opt_no_mix_types, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
#endif
- {"old-protocol", 'o', "Use the old (3.20) protocol",
+ {"old-protocol", 'o', "Use the old (3.20) protocol client/server protocol",
(gptr*) &protocol_version, (gptr*) &protocol_version, 0, GET_UINT, NO_ARG,
PROTOCOL_VERSION, 0, 0, 0, 0, 0},
- {"old-rpl-compat", OPT_OLD_RPL_COMPAT, "Undocumented",
+ {"old-rpl-compat", OPT_OLD_RPL_COMPAT,
+ "Use old LOAD DATA format in the binary log (don't save data in file)",
(gptr*) &opt_old_rpl_compat, (gptr*) &opt_old_rpl_compat, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef ONE_THREAD
@@ -3095,7 +3194,7 @@ static struct my_option my_long_options[] =
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection.", (gptr*) &mysql_port,
(gptr*) &mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"reckless-slave", OPT_RECKLESS_SLAVE, "Undocumented", 0, 0, 0, GET_NO_ARG,
+ {"reckless-slave", OPT_RECKLESS_SLAVE, "For debugging", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"replicate-do-db", OPT_REPLICATE_DO_DB,
"Tells the slave thread to restrict replication to the specified database. To specify more than one database, use the directive multiple times, once for each database. Note that this will only work if you do not use cross-database queries such as UPDATE some_db.some_table SET foo='bar' while having selected a different or no database. If you need cross database updates to work, make sure you have 3.23.28 or later, and use replicate-wild-do-table=db_name.%.",
@@ -3143,32 +3242,31 @@ static struct my_option my_long_options[] =
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"safe-mode", OPT_SAFE, "Skip some optimize stages (for testing).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+#ifndef TO_BE_DELETED
{"safe-show-database", OPT_SAFE_SHOW_DB,
- "Don't show databases for which the user has no privileges",
+ "Depricated option; One should use GRANT SHOW DATABASES instead...",
(gptr*) &opt_safe_show_db, (gptr*) &opt_safe_show_db, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
+#endif
{"safe-user-create", OPT_SAFE_USER_CREATE,
"Don't allow new user creation by the user who has no write privileges to the mysql.user table",
(gptr*) &opt_safe_user_create, (gptr*) &opt_safe_user_create, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"server-id", OPT_SERVER_ID,
"Uniquely identifies the server instance in the community of replication partners",
- (gptr*) &server_id, (gptr*) &server_id, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0,
+ (gptr*) &server_id, (gptr*) &server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
{"set-variable", 'O',
"Change the value of a variable. Please note that this option is deprecated;you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"show-slave-auth-info", OPT_SHOW_SLAVE_AUTH_INFO, "Undocumented",
+ {"show-slave-auth-info", OPT_SHOW_SLAVE_AUTH_INFO,
+ "Show user and password in SHOW SLAVE STATUS",
(gptr*) &opt_show_slave_auth_info, (gptr*) &opt_show_slave_auth_info, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"concurrent-insert", OPT_CONCURRENT_INSERT,
"Use concurrent insert with MyISAM. Disable with prefix --skip-",
(gptr*) &myisam_concurrent_insert, (gptr*) &myisam_concurrent_insert,
- 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"delay-key-write", OPT_USE_DELAY_KEY_WRITE,
- "Use delay_key_write option for all tables. Disable with prefix --skip-",
- (gptr*) &myisam_delay_key_write, (gptr*) &myisam_delay_key_write, 0,
- GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"skip-grant-tables", OPT_SKIP_GRANT,
"Start without grant tables. This gives all users FULL ACCESS to all tables!",
(gptr*) &opt_noacl, (gptr*) &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
@@ -3176,7 +3274,7 @@ static struct my_option my_long_options[] =
{"skip-innodb", OPT_INNODB_SKIP, "Don't use Innodb (will save memory)",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-locking", OPT_SKIP_LOCK,
- "Don't use system locking. To use isamchk one has to shut down the server.",
+ "Depricated option, use --skip-external-locking instead",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-host-cache", OPT_SKIP_HOST_CACHE, "Don't cache host names", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -3227,20 +3325,21 @@ static struct my_option my_long_options[] =
#endif
{"temp-pool", OPT_TEMP_POOL,
"Using this option will cause most temporary files created to use a small set of names, rather than a unique name for each new file.",
- (gptr*) &use_temp_pool, (gptr*) &use_temp_pool, 0, GET_BOOL, NO_ARG, 0, 0,
- 0, 0, 0, 0},
- {"tmpdir", 't', "Path for temporary files", (gptr*) &mysql_tmpdir,
- (gptr*) &mysql_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (gptr*) &use_temp_pool, (gptr*) &use_temp_pool, 0, GET_BOOL, NO_ARG, 1,
+ 0, 0, 0, 0, 0},
+ {"tmpdir", 't', "Path for temporary files", (gptr*) &opt_mysql_tmpdir,
+ (gptr*) &opt_mysql_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"transaction-isolation", OPT_TX_ISOLATION,
- "Default transaction isolation level", (gptr*) &default_tx_isolation_name,
- (gptr*) &default_tx_isolation_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
+ "Default transaction isolation level", 0, 0, 0, GET_NO_ARG, REQUIRED_ARG, 0,
+ 0, 0, 0,
0, 0},
- {"use-locking", OPT_USE_LOCKING, "Use system (external) locking",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"external-locking", OPT_USE_LOCKING, "Use system (external) locking. With this option enabled you can run myisamchk to test (not repair) tables while the MySQL server is running",
+ (gptr*) &opt_external_locking, (gptr*) &opt_external_locking,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef USE_SYMDIR
{"use-symbolic-links", 's', "Enable symbolic link support",
- (gptr*) &my_use_symdir, (gptr*) &my_use_symdir, 0, GET_BOOL, NO_ARG, 0, 0,
- 0, 0, 0, 0},
+ (gptr*) &my_use_symdir, (gptr*) &my_use_symdir, 0, GET_BOOL, NO_ARG,
+ USE_PURIFY(0,1), 0, 0, 0, 0, 0},
#endif
{"user", 'u', "Run mysqld daemon as user", (gptr*) &mysqld_user,
(gptr*) &mysqld_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -3248,8 +3347,13 @@ static struct my_option my_long_options[] =
NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'v', "Synonym for option -v", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
- {"warnings", 'W', "Log some not critical warnings to the log file",
- (gptr*) &opt_warnings, (gptr*) &opt_warnings, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ {"log-warnings", 'W', "Log some not critical warnings to the log file",
+ (gptr*) &global_system_variables.log_warnings,
+ (gptr*) &max_system_variables.log_warnings, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ 0, 0, 0},
+ {"warnings", 'W', "Deprecated ; Use --log-warnings instead",
+ (gptr*) &global_system_variables.log_warnings,
+ (gptr*) &max_system_variables.log_warnings, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{ "back_log", OPT_BACK_LOG,
"The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time.", (gptr*) &back_log, (gptr*) &back_log, 0, GET_ULONG,
@@ -3278,10 +3382,10 @@ static struct my_option my_long_options[] =
REQUIRED_ARG, 32*1024L, IO_SIZE, ~0L, 0, IO_SIZE, 0},
{"connect_timeout", OPT_CONNECT_TIMEOUT,
"The number of seconds the mysqld server is waiting for a connect packet before responding with Bad handshake",
- (gptr*) &connect_timeout, (gptr*) &connect_timeout, 0, GET_ULONG,
- REQUIRED_ARG, CONNECT_TIMEOUT, 2, LONG_TIMEOUT, 0, 1, 0 },
+ (gptr*) &connect_timeout, (gptr*) &connect_timeout,
+ 0, GET_ULONG, REQUIRED_ARG, CONNECT_TIMEOUT, 2, LONG_TIMEOUT, 0, 1, 0 },
{"delayed_insert_timeout", OPT_DELAYED_INSERT_TIMEOUT,
- "How long a INSERT DELAYED thread should wait for INSERT statements before terminating.",
+ "Ho wlong a INSERT DELAYED thread should wait for INSERT statements before terminating.",
(gptr*) &delayed_insert_timeout, (gptr*) &delayed_insert_timeout, 0,
GET_ULONG, REQUIRED_ARG, DELAYED_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
{"delayed_insert_limit", OPT_DELAYED_INSERT_LIMIT,
@@ -3299,7 +3403,7 @@ static struct my_option my_long_options[] =
{ "ft_min_word_len", OPT_FT_MIN_WORD_LEN,
"The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.",
(gptr*) &ft_min_word_len, (gptr*) &ft_min_word_len, 0, GET_ULONG,
- REQUIRED_ARG, 4, 1, HA_FT_MAXLEN, 0, 1, 0},
+ REQUIRED_ARG, 4, 2, HA_FT_MAXLEN, 0, 1, 0},
{ "ft_max_word_len", OPT_FT_MAX_WORD_LEN,
"The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.",
(gptr*) &ft_max_word_len, (gptr*) &ft_max_word_len, 0, GET_ULONG,
@@ -3354,11 +3458,13 @@ static struct my_option my_long_options[] =
#endif /* HAVE_INNOBASE_DB */
{"interactive_timeout", OPT_INTERACTIVE_TIMEOUT,
"The number of seconds the server waits for activity on an interactive connection before closing it.",
- (gptr*) &net_interactive_timeout, (gptr*) &net_interactive_timeout, 0,
+ (gptr*) &global_system_variables.net_interactive_timeout,
+ (gptr*) &max_system_variables.net_interactive_timeout, 0,
GET_ULONG, REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
{"join_buffer_size", OPT_JOIN_BUFF_SIZE,
"The size of the buffer that is used for full joins.",
- (gptr*) &join_buff_size, (gptr*) &join_buff_size, 0, GET_ULONG,
+ (gptr*) &global_system_variables.join_buff_size,
+ (gptr*) &max_system_variables.join_buff_size, 0, GET_ULONG,
REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD,
IO_SIZE, 0},
{"key_buffer_size", OPT_KEY_BUFFER_SIZE,
@@ -3367,15 +3473,18 @@ static struct my_option my_long_options[] =
KEY_CACHE_SIZE, MALLOC_OVERHEAD, (long) ~0, MALLOC_OVERHEAD, IO_SIZE, 0},
{"long_query_time", OPT_LONG_QUERY_TIME,
"Log all queries that have taken more than long_query_time seconds to execute to file.",
- (gptr*) &long_query_time, (gptr*) &long_query_time, 0, GET_ULONG,
+ (gptr*) &global_system_variables.long_query_time,
+ (gptr*) &max_system_variables.long_query_time, 0, GET_ULONG,
REQUIRED_ARG, 10, 1, LONG_TIMEOUT, 0, 1, 0},
{"lower_case_table_names", OPT_LOWER_CASE_TABLE_NAMES,
"If set to 1 table names are stored in lowercase on disk and table names will be case-insensitive.",
- (gptr*) &lower_case_table_names, (gptr*) &lower_case_table_names, 0,
- GET_ULONG, REQUIRED_ARG, IF_WIN(1,0), 0, 1, 0, 1, 0},
+ (gptr*) &lower_case_table_names,
+ (gptr*) &lower_case_table_names, 0,
+ GET_BOOL, NO_ARG, IF_WIN(1,0), 0, 1, 0, 1, 0},
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
"Max packetlength to send/receive from to server.",
- (gptr*) &max_allowed_packet, (gptr*) &max_allowed_packet, 0, GET_ULONG,
+ (gptr*) &global_system_variables.max_allowed_packet,
+ (gptr*) &max_system_variables.max_allowed_packet, 0, GET_ULONG,
REQUIRED_ARG, 1024*1024L, 80, 64*1024*1024L, MALLOC_OVERHEAD, 1024, 0},
{"max_binlog_cache_size", OPT_MAX_BINLOG_CACHE_SIZE,
"Can be used to restrict the total size used to cache a multi-transaction query.",
@@ -3399,19 +3508,23 @@ static struct my_option my_long_options[] =
0, GET_ULONG, REQUIRED_ARG, 20, 1, 16384, 0, 1, 0},
{"max_heap_table_size", OPT_MAX_HEP_TABLE_SIZE,
"Don't allow creation of heap tables bigger than this.",
- (gptr*) &max_heap_table_size, (gptr*) &max_heap_table_size, 0, GET_ULONG,
+ (gptr*) &global_system_variables.max_heap_table_size,
+ (gptr*) &max_system_variables.max_heap_table_size, 0, GET_ULONG,
REQUIRED_ARG, 16*1024*1024L, 16384, ~0L, MALLOC_OVERHEAD, 1024, 0},
{"max_join_size", OPT_MAX_JOIN_SIZE,
"Joins that are probably going to read more than max_join_size records return an error.",
- (gptr*) &max_join_size, (gptr*) &max_join_size, 0, GET_ULONG, REQUIRED_ARG,
+ (gptr*) &global_system_variables.max_join_size,
+ (gptr*) &max_system_variables.max_join_size, 0, GET_ULONG, REQUIRED_ARG,
~0L, 1, ~0L, 0, 1, 0},
{"max_sort_length", OPT_MAX_SORT_LENGTH,
"The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored).",
- (gptr*) &max_item_sort_length, (gptr*) &max_item_sort_length, 0, GET_ULONG,
+ (gptr*) &global_system_variables.max_sort_length,
+ (gptr*) &max_system_variables.max_sort_length, 0, GET_ULONG,
REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0},
{"max_tmp_tables", OPT_MAX_TMP_TABLES,
"Maximum number of temporary tables a client can keep open at a time.",
- (gptr*) &max_tmp_tables, (gptr*) &max_tmp_tables, 0, GET_ULONG,
+ (gptr*) &global_system_variables.max_tmp_tables,
+ (gptr*) &max_system_variables.max_tmp_tables, 0, GET_ULONG,
REQUIRED_ARG, 32, 1, ~0L, 0, 1, 0},
{"max_user_connections", OPT_MAX_USER_CONNECTIONS,
"The maximum number of active connections for a single user (0 = no limit).",
@@ -3421,83 +3534,100 @@ static struct my_option my_long_options[] =
"After this many write locks, allow some read locks to run in between.",
(gptr*) &max_write_lock_count, (gptr*) &max_write_lock_count, 0, GET_ULONG,
REQUIRED_ARG, ~0L, 1, ~0L, 0, 1, 0},
- {"myisam_bulk_insert_tree_size", OPT_MYISAM_BULK_INSERT_TREE_SIZE,
+ {"bulk_insert_buffer_size", OPT_BULK_INSERT_BUFFER_SIZE,
"Size of tree cache used in bulk insert optimisation. Note that this is a limit per thread!",
- (gptr*) &myisam_bulk_insert_tree_size,
- (gptr*) &myisam_bulk_insert_tree_size, 0, GET_ULONG, REQUIRED_ARG,
- 8192*1024, 0, ~0L, 0, 1, 0},
+ (gptr*) &global_system_variables.bulk_insert_buff_size,
+ (gptr*) &max_system_variables.bulk_insert_buff_size,
+ 0, GET_ULONG, REQUIRED_ARG, 8192*1024, 0, ~0L, 0, 1, 0},
{"myisam_block_size", OPT_MYISAM_BLOCK_SIZE,
- "Undocumented", (gptr*) &opt_myisam_block_size,
+ "Block size to be used for MyISAM index pages",
+ (gptr*) &opt_myisam_block_size,
(gptr*) &opt_myisam_block_size, 0, GET_ULONG, REQUIRED_ARG,
MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, MI_MAX_KEY_BLOCK_LENGTH,
0, MI_MIN_KEY_BLOCK_LENGTH, 0},
{"myisam_max_extra_sort_file_size", OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
- "Used to help MySQL to decide when to use the slow but safe key cache index create method. Note that this parameter is given in megabytes!",
- (gptr*) &myisam_max_extra_sort_file_size,
- (gptr*) &myisam_max_extra_sort_file_size, 0, GET_ULONG, REQUIRED_ARG,
- (long) (MI_MAX_TEMP_LENGTH/(1024L*1024L)), 0, ~0L, 0, 1, 0},
+ "Used to help MySQL to decide when to use the slow but safe key cache index create method",
+ (gptr*) &global_system_variables.myisam_max_extra_sort_file_size,
+ (gptr*) &max_system_variables.myisam_max_extra_sort_file_size,
+ 0, GET_ULL, REQUIRED_ARG, (ulonglong) MI_MAX_TEMP_LENGTH,
+ 0, ~0L, 0, 1, 0},
{"myisam_max_sort_file_size", OPT_MYISAM_MAX_SORT_FILE_SIZE,
- "Don't use the fast sort index method to created index if the temporary file would get bigger than this. Note that this paramter is given in megabytes!",
- (gptr*) &myisam_max_sort_file_size, (gptr*) &myisam_max_sort_file_size, 0,
- GET_ULONG, REQUIRED_ARG, (long) (LONG_MAX/(1024L*1024L)), 0, ~0L, 0, 1, 0},
+ "Don't use the fast sort index method to created index if the temporary file would get bigger than this!",
+ (gptr*) &global_system_variables.myisam_max_sort_file_size,
+ (gptr*) &max_system_variables.myisam_max_sort_file_size, 0,
+ GET_ULL, REQUIRED_ARG, (longlong) LONG_MAX, 0, ~0L, 0, 1024*1024, 0},
{"myisam_sort_buffer_size", OPT_MYISAM_SORT_BUFFER_SIZE,
"The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.",
- (gptr*) &myisam_sort_buffer_size, (gptr*) &myisam_sort_buffer_size, 0,
+ (gptr*) &global_system_variables.myisam_sort_buff_size,
+ (gptr*) &max_system_variables.myisam_sort_buff_size, 0,
GET_ULONG, REQUIRED_ARG, 8192*1024, 4, ~0L, 0, 1, 0},
{"net_buffer_length", OPT_NET_BUFFER_LENGTH,
- "Buffer for TCP/IP and socket communication.", (gptr*) &net_buffer_length,
- (gptr*) &net_buffer_length, 0, GET_ULONG, REQUIRED_ARG, 16384, 1024,
- 1024*1024L, MALLOC_OVERHEAD, 1024, 0},
+ "Buffer length for TCP/IP and socket communication.",
+ (gptr*) &global_system_variables.net_buffer_length,
+ (gptr*) &max_system_variables.net_buffer_length, 0, GET_ULONG,
+ REQUIRED_ARG, 16384, 1024, 1024*1024L, 0, 1024, 0},
{"net_retry_count", OPT_NET_RETRY_COUNT,
"If a read on a communication port is interrupted, retry this many times before giving up.",
- (gptr*) &mysqld_net_retry_count, (gptr*) &mysqld_net_retry_count, 0,
+ (gptr*) &global_system_variables.net_retry_count,
+ (gptr*) &max_system_variables.net_retry_count,0,
GET_ULONG, REQUIRED_ARG, MYSQLD_NET_RETRY_COUNT, 1, ~0L, 0, 1, 0},
{"net_read_timeout", OPT_NET_READ_TIMEOUT,
"Number of seconds to wait for more data from a connection before aborting the read.",
- (gptr*) &net_read_timeout, (gptr*) &net_read_timeout, 0, GET_ULONG,
+ (gptr*) &global_system_variables.net_read_timeout,
+ (gptr*) &max_system_variables.net_read_timeout, 0, GET_ULONG,
REQUIRED_ARG, NET_READ_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
{"net_write_timeout", OPT_NET_WRITE_TIMEOUT,
"Number of seconds to wait for a block to be written to a connection before aborting the write.",
- (gptr*) &net_write_timeout, (gptr*) &net_write_timeout, 0, GET_ULONG,
+ (gptr*) &global_system_variables.net_write_timeout,
+ (gptr*) &max_system_variables.net_write_timeout, 0, GET_ULONG,
REQUIRED_ARG, NET_WRITE_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
{"open_files_limit", OPT_OPEN_FILES_LIMIT,
"If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of files.",
(gptr*) &open_files_limit, (gptr*) &open_files_limit, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, 65535, 0, 1, 0},
- {"query_buffer_size", OPT_QUERY_BUFFER_SIZE,
- "The initial allocation of the query buffer.", (gptr*) &query_buff_size,
- (gptr*) &query_buff_size, 0, GET_ULONG, REQUIRED_ARG, 0, MALLOC_OVERHEAD,
- (long) ~0, MALLOC_OVERHEAD, IO_SIZE, 0},
#ifdef HAVE_QUERY_CACHE
{"query_cache_limit", OPT_QUERY_CACHE_LIMIT,
"Don't cache results that are bigger than this.",
(gptr*) &query_cache_limit, (gptr*) &query_cache_limit, 0, GET_ULONG,
- REQUIRED_ARG, 1024*1024L, 0, ULONG_MAX, 0, 1, 0},
+ REQUIRED_ARG, 1024*1024L, 0, (longlong) ULONG_MAX, 0, 1, 0},
#endif /*HAVE_QUERY_CACHE*/
{"query_cache_size", OPT_QUERY_CACHE_SIZE,
"The memory allocated to store results from old queries.",
(gptr*) &query_cache_size, (gptr*) &query_cache_size, 0, GET_ULONG,
- REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1, 0},
+ REQUIRED_ARG, 0, 0, (longlong) ULONG_MAX, 0, 1024, 0},
#ifdef HAVE_QUERY_CACHE
- {"query_cache_startup_type", OPT_QUERY_CACHE_STARTUP_TYPE,
+ {"query_cache_type", OPT_QUERY_CACHE_TYPE,
"0 = OFF = Don't cache or retrieve results. 1 = ON = Cache all results except SELECT SQL_NO_CACHE ... queries. 2 = DEMAND = Cache only SELECT SQL_CACHE ... queries.",
- (gptr*) &query_cache_startup_type, (gptr*) &query_cache_startup_type, 0,
- GET_ULONG, REQUIRED_ARG, 1, 0, 2, 0, 1, 0},
+ (gptr*) &global_system_variables.query_cache_type,
+ (gptr*) &max_system_variables.query_cache_type,
+ 0, GET_ULONG, REQUIRED_ARG, 1, 0, 2, 0, 1, 0},
#endif /*HAVE_QUERY_CACHE*/
- {"record_buffer", OPT_RECORD_BUFFER,
+ {"read_buffer_size", OPT_RECORD_BUFFER,
"Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value.",
- (gptr*) &my_default_record_cache_size,
- (gptr*) &my_default_record_cache_size, 0, GET_ULONG, REQUIRED_ARG,
+ (gptr*) &global_system_variables.read_buff_size,
+ (gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD, IO_SIZE, 0},
- {"record_rnd_buffer", OPT_RECORD_RND_BUFFER,
+ {"read_rnd_buffer_size", OPT_RECORD_RND_BUFFER,
"When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks. If not set, then it's set to the value of record_buffer.",
- (gptr*) &record_rnd_cache_size, (gptr*) &record_rnd_cache_size, 0,
- GET_ULONG, REQUIRED_ARG, 0, IO_SIZE*2+MALLOC_OVERHEAD,
+ (gptr*) &global_system_variables.read_rnd_buff_size,
+ (gptr*) &max_system_variables.read_rnd_buff_size, 0,
+ GET_ULONG, REQUIRED_ARG, 256*1024L, IO_SIZE*2+MALLOC_OVERHEAD,
~0L, MALLOC_OVERHEAD, IO_SIZE, 0},
+ {"record_buffer", OPT_RECORD_BUFFER,
+ "Alias for read_buffer_size",
+ (gptr*) &global_system_variables.read_buff_size,
+ (gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
+ 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD, IO_SIZE, 0},
{"relay_log_space_limit", OPT_RELAY_LOG_SPACE_LIMIT,
- "Undocumented", (gptr*) &relay_log_space_limit,
- (gptr*) &relay_log_space_limit, 0, GET_ULONG, REQUIRED_ARG, 0L, 0L,
- ULONG_MAX, 0, 1, 0},
+ "Max space to use for all relay logs",
+ (gptr*) &relay_log_space_limit,
+ (gptr*) &relay_log_space_limit, 0, GET_ULL, REQUIRED_ARG, 0L, 0L,
+ (longlong) ULONG_MAX, 0, 1, 0},
+ {"slave_compressed_protocol", OPT_SLAVE_COMPRESSED_PROTOCOL,
+ "Use compression on master/slave protocol",
+ (gptr*) &opt_slave_compressed_protocol,
+ (gptr*) &opt_slave_compressed_protocol,
+ 0, GET_BOOL, REQUIRED_ARG, 0, 0, 1, 0, 1, 0},
{"slave_net_timeout", OPT_SLAVE_NET_TIMEOUT,
"Number of seconds to wait for more data from a master/slave connection before aborting the read.",
(gptr*) &slave_net_timeout, (gptr*) &slave_net_timeout, 0,
@@ -3506,9 +3636,10 @@ static struct my_option my_long_options[] =
"If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented.",
(gptr*) &slow_launch_time, (gptr*) &slow_launch_time, 0, GET_ULONG,
REQUIRED_ARG, 2L, 0L, LONG_TIMEOUT, 0, 1, 0},
- {"sort_buffer", OPT_SORT_BUFFER,
+ {"sort_buffer_size", OPT_SORT_BUFFER,
"Each thread that needs to do a sort allocates a buffer of this size.",
- (gptr*) &sortbuff_size, (gptr*) &sortbuff_size, 0, GET_ULONG, REQUIRED_ARG,
+ (gptr*) &global_system_variables.sortbuff_size,
+ (gptr*) &max_system_variables.sortbuff_size, 0, GET_ULONG, REQUIRED_ARG,
MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, ~0L, MALLOC_OVERHEAD,
1, 0},
{"table_cache", OPT_TABLE_CACHE,
@@ -3525,7 +3656,8 @@ static struct my_option my_long_options[] =
REQUIRED_ARG, 0, 0, 16384, 0, 1, 0},
{"tmp_table_size", OPT_TMP_TABLE_SIZE,
"If an in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM table.",
- (gptr*) &tmp_table_size, (gptr*) &tmp_table_size, 0, GET_ULONG,
+ (gptr*) &global_system_variables.tmp_table_size,
+ (gptr*) &max_system_variables.tmp_table_size, 0, GET_ULONG,
REQUIRED_ARG, 32*1024*1024L, 1024, ~0L, 0, 1, 0},
{"thread_stack", OPT_THREAD_STACK,
"The stack size for each thread.", (gptr*) &thread_stack,
@@ -3533,149 +3665,12 @@ static struct my_option my_long_options[] =
1024*32, ~0L, 0, 1024, 0},
{"wait_timeout", OPT_WAIT_TIMEOUT,
"The number of seconds the server waits for activity on a connection before closing it",
- (gptr*) &net_wait_timeout, (gptr*) &net_wait_timeout, 0, GET_ULONG,
+ (gptr*) &global_system_variables.net_wait_timeout,
+ (gptr*) &max_system_variables.net_wait_timeout, 0, GET_ULONG,
REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
-struct show_var_st init_vars[]= {
- {"back_log", (char*) &back_log, SHOW_LONG},
- {"basedir", mysql_home, SHOW_CHAR},
-#ifdef HAVE_BERKELEY_DB
- {"bdb_cache_size", (char*) &berkeley_cache_size, SHOW_LONG},
- {"bdb_log_buffer_size", (char*) &berkeley_log_buffer_size, SHOW_LONG},
- {"bdb_home", (char*) &berkeley_home, SHOW_CHAR_PTR},
- {"bdb_max_lock", (char*) &berkeley_max_lock, SHOW_LONG},
- {"bdb_logdir", (char*) &berkeley_logdir, SHOW_CHAR_PTR},
- {"bdb_shared_data", (char*) &berkeley_shared_data, SHOW_BOOL},
- {"bdb_tmpdir", (char*) &berkeley_tmpdir, SHOW_CHAR_PTR},
- {"bdb_version", (char*) DB_VERSION_STRING, SHOW_CHAR},
-#endif
- {"binlog_cache_size", (char*) &binlog_cache_size, SHOW_LONG},
- {"character_set", default_charset, SHOW_CHAR},
- {"character_sets", (char*) &charsets_list, SHOW_CHAR_PTR},
- {"concurrent_insert", (char*) &myisam_concurrent_insert, SHOW_MY_BOOL},
- {"connect_timeout", (char*) &connect_timeout, SHOW_LONG},
- {"datadir", mysql_real_data_home, SHOW_CHAR},
- {"delay_key_write", (char*) &myisam_delay_key_write, SHOW_MY_BOOL},
- {"delayed_insert_limit", (char*) &delayed_insert_limit, SHOW_LONG},
- {"delayed_insert_timeout", (char*) &delayed_insert_timeout, SHOW_LONG},
- {"delayed_queue_size", (char*) &delayed_queue_size, SHOW_LONG},
- {"flush", (char*) &myisam_flush, SHOW_MY_BOOL},
- {"flush_time", (char*) &flush_time, SHOW_LONG},
- {"ft_min_word_len", (char*) &ft_min_word_len, SHOW_LONG},
- {"ft_max_word_len", (char*) &ft_max_word_len, SHOW_LONG},
- {"ft_max_word_len_for_sort",(char*) &ft_max_word_len_for_sort, SHOW_LONG},
- {"ft_boolean_syntax", (char*) ft_boolean_syntax, SHOW_CHAR},
- {"have_bdb", (char*) &have_berkeley_db, SHOW_HAVE},
- {"have_innodb", (char*) &have_innodb, SHOW_HAVE},
- {"have_isam", (char*) &have_isam, SHOW_HAVE},
- {"have_raid", (char*) &have_raid, SHOW_HAVE},
- {"have_symlink", (char*) &have_symlink, SHOW_HAVE},
- {"have_openssl", (char*) &have_openssl, SHOW_HAVE},
- {"have_query_cache", (char*) &have_query_cache, SHOW_HAVE},
- {"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR},
-#ifdef HAVE_INNOBASE_DB
- {"innodb_additional_mem_pool_size", (char*) &innobase_additional_mem_pool_size, SHOW_LONG },
- {"innodb_buffer_pool_size", (char*) &innobase_buffer_pool_size, SHOW_LONG },
- {"innodb_data_file_path", (char*) &innobase_data_file_path, SHOW_CHAR_PTR},
- {"innodb_data_home_dir", (char*) &innobase_data_home_dir, SHOW_CHAR_PTR},
- {"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG },
- {"innodb_force_recovery", (char*) &innobase_force_recovery, SHOW_LONG },
- {"innodb_thread_concurrency", (char*) &innobase_thread_concurrency, SHOW_LONG },
- {"innodb_flush_log_at_trx_commit", (char*) &innobase_flush_log_at_trx_commit, SHOW_MY_BOOL},
- {"innodb_fast_shutdown", (char*) &innobase_fast_shutdown, SHOW_MY_BOOL},
- {"innodb_flush_method", (char*) &innobase_unix_file_flush_method, SHOW_CHAR_PTR},
- {"innodb_lock_wait_timeout", (char*) &innobase_lock_wait_timeout, SHOW_LONG },
- {"innodb_log_arch_dir", (char*) &innobase_log_arch_dir, SHOW_CHAR_PTR},
- {"innodb_log_archive", (char*) &innobase_log_archive, SHOW_MY_BOOL},
- {"innodb_log_buffer_size", (char*) &innobase_log_buffer_size, SHOW_LONG },
- {"innodb_log_file_size", (char*) &innobase_log_file_size, SHOW_LONG},
- {"innodb_log_files_in_group", (char*) &innobase_log_files_in_group, SHOW_LONG},
- {"innodb_log_group_home_dir", (char*) &innobase_log_group_home_dir, SHOW_CHAR_PTR},
- {"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG},
-#endif
- {"interactive_timeout", (char*) &net_interactive_timeout, SHOW_LONG},
- {"join_buffer_size", (char*) &join_buff_size, SHOW_LONG},
- {"key_buffer_size", (char*) &keybuff_size, SHOW_LONG},
- {"language", language, SHOW_CHAR},
- {"large_files_support", (char*) &opt_large_files, SHOW_BOOL},
-#ifdef HAVE_MLOCKALL
- {"locked_in_memory", (char*) &locked_in_memory, SHOW_BOOL},
-#endif
- {"log", (char*) &opt_log, SHOW_BOOL},
- {"log_update", (char*) &opt_update_log, SHOW_BOOL},
- {"log_bin", (char*) &opt_bin_log, SHOW_BOOL},
- {"log_slave_updates", (char*) &opt_log_slave_updates, SHOW_BOOL},
- {"log_slow_queries", (char*) &opt_slow_log, SHOW_BOOL},
- {"long_query_time", (char*) &long_query_time, SHOW_LONG},
- {"low_priority_updates", (char*) &low_priority_updates, SHOW_BOOL},
- {"lower_case_table_names", (char*) &lower_case_table_names, SHOW_LONG},
- {"max_allowed_packet", (char*) &max_allowed_packet, SHOW_LONG},
- {"max_binlog_cache_size", (char*) &max_binlog_cache_size, SHOW_LONG},
- {"max_binlog_size", (char*) &max_binlog_size, SHOW_LONG},
- {"max_connections", (char*) &max_connections, SHOW_LONG},
- {"max_connect_errors", (char*) &max_connect_errors, SHOW_LONG},
- {"max_delayed_threads", (char*) &max_insert_delayed_threads, SHOW_LONG},
- {"max_heap_table_size", (char*) &max_heap_table_size, SHOW_LONG},
- {"max_join_size", (char*) &max_join_size, SHOW_LONG},
- {"max_sort_length", (char*) &max_item_sort_length, SHOW_LONG},
- {"max_user_connections", (char*) &max_user_connections, SHOW_LONG},
- {"max_tmp_tables", (char*) &max_tmp_tables, SHOW_LONG},
- {"max_write_lock_count", (char*) &max_write_lock_count, SHOW_LONG},
- {"myisam_bulk_insert_tree_size", (char*) &myisam_bulk_insert_tree_size, SHOW_INT},
- {"myisam_max_extra_sort_file_size", (char*) &myisam_max_extra_sort_file_size,
- SHOW_LONG},
- {"myisam_max_sort_file_size",(char*) &myisam_max_sort_file_size, SHOW_LONG},
- {"myisam_recover_options", (char*) &myisam_recover_options_str, SHOW_CHAR_PTR},
- {"myisam_sort_buffer_size", (char*) &myisam_sort_buffer_size, SHOW_LONG},
-#ifdef __NT__
- {"named_pipe", (char*) &opt_enable_named_pipe, SHOW_BOOL},
-#endif
- {"net_buffer_length", (char*) &net_buffer_length, SHOW_LONG},
- {"net_read_timeout", (char*) &net_read_timeout, SHOW_LONG},
- {"net_retry_count", (char*) &mysqld_net_retry_count, SHOW_LONG},
- {"net_write_timeout", (char*) &net_write_timeout, SHOW_LONG},
- {"open_files_limit", (char*) &open_files_limit, SHOW_LONG},
- {"pid_file", (char*) pidfile_name, SHOW_CHAR},
- {"port", (char*) &mysql_port, SHOW_INT},
- {"protocol_version", (char*) &protocol_version, SHOW_INT},
- {"record_buffer", (char*) &my_default_record_cache_size,SHOW_LONG},
- {"record_rnd_buffer", (char*) &record_rnd_cache_size, SHOW_LONG},
- {"rpl_recovery_rank", (char*) &rpl_recovery_rank, SHOW_LONG},
- {"query_buffer_size", (char*) &query_buff_size, SHOW_LONG},
-#ifdef HAVE_QUERY_CACHE
- {"query_cache_limit", (char*) &query_cache.query_cache_limit, SHOW_LONG},
- {"query_cache_size", (char*) &query_cache.query_cache_size, SHOW_LONG},
- {"query_cache_startup_type",(char*) &query_cache_startup_type, SHOW_LONG},
-#endif /*HAVE_QUERY_CACHE*/
- {"safe_show_database", (char*) &opt_safe_show_db, SHOW_BOOL},
- {"server_id", (char*) &server_id, SHOW_LONG},
- {"slave_net_timeout", (char*) &slave_net_timeout, SHOW_LONG},
- {"skip_locking", (char*) &my_disable_locking, SHOW_MY_BOOL},
- {"skip_networking", (char*) &opt_disable_networking, SHOW_BOOL},
- {"skip_show_database", (char*) &opt_skip_show_db, SHOW_BOOL},
- {"slow_launch_time", (char*) &slow_launch_time, SHOW_LONG},
- {"socket", (char*) &mysql_unix_port, SHOW_CHAR_PTR},
- {"sort_buffer", (char*) &sortbuff_size, SHOW_LONG},
- {"sql_mode", (char*) &opt_sql_mode, SHOW_LONG},
- {"table_cache", (char*) &table_cache_size, SHOW_LONG},
- {"table_type", (char*) &default_table_type_name, SHOW_CHAR_PTR},
- {"thread_cache_size", (char*) &thread_cache_size, SHOW_LONG},
-#ifdef HAVE_THR_SETCONCURRENCY
- {"thread_concurrency", (char*) &concurrency, SHOW_LONG},
-#endif
- {"thread_stack", (char*) &thread_stack, SHOW_LONG},
- {"transaction_isolation", (char*) &default_tx_isolation_name, SHOW_CHAR_PTR},
-#ifdef HAVE_TZNAME
- {"timezone", time_zone, SHOW_CHAR},
-#endif
- {"tmp_table_size", (char*) &tmp_table_size, SHOW_LONG},
- {"tmpdir", (char*) &mysql_tmpdir, SHOW_CHAR_PTR},
- {"version", server_version, SHOW_CHAR},
- {"wait_timeout", (char*) &net_wait_timeout, SHOW_LONG},
- {NullS, NullS, SHOW_LONG}
-};
struct show_var_st status_vars[]= {
{"Aborted_clients", (char*) &aborted_threads, SHOW_LONG},
@@ -3740,6 +3735,7 @@ struct show_var_st status_vars[]= {
{"Com_show_slave_hosts", (char*) (com_stat+(uint) SQLCOM_SHOW_SLAVE_HOSTS),SHOW_LONG},
{"Com_show_slave_status", (char*) (com_stat+(uint) SQLCOM_SHOW_SLAVE_STAT),SHOW_LONG},
{"Com_show_status", (char*) (com_stat+(uint) SQLCOM_SHOW_STATUS),SHOW_LONG},
+ {"Com_show_innodb_status", (char*) (com_stat+(uint) SQLCOM_SHOW_INNODB_STATUS),SHOW_LONG},
{"Com_show_tables", (char*) (com_stat+(uint) SQLCOM_SHOW_TABLES),SHOW_LONG},
{"Com_show_variables", (char*) (com_stat+(uint) SQLCOM_SHOW_VARIABLES),SHOW_LONG},
{"Com_slave_start", (char*) (com_stat+(uint) SQLCOM_SLAVE_START),SHOW_LONG},
@@ -3876,7 +3872,7 @@ Starts the MySQL server\n");
");
puts("");
#endif
- print_defaults("my",load_default_groups);
+ print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
fix_paths();
set_ports();
@@ -3884,38 +3880,9 @@ Starts the MySQL server\n");
my_print_help(my_long_options);
my_print_variables(my_long_options);
- printf("\
+ puts("\n\
To see what values a running MySQL server is using, type\n\
-'mysqladmin variables' instead of 'mysqld --help'.\n\
-The default values (after parsing the command line arguments) are:\n\n");
-
- printf("basedir: %s\n",mysql_home);
- printf("datadir: %s\n",mysql_real_data_home);
- printf("tmpdir: %s\n",mysql_tmpdir);
- printf("language: %s\n",language);
-#ifndef __WIN__
- printf("pid file: %s\n",pidfile_name);
-#endif
- if (opt_logname)
- printf("logfile: %s\n",opt_logname);
- if (opt_update_logname)
- printf("update log: %s\n",opt_update_logname);
- if (opt_bin_log)
- {
- printf("binary log: %s\n",opt_bin_logname ? opt_bin_logname : "");
- printf("binary log index: %s\n",
- opt_binlog_index_name ? opt_binlog_index_name : "");
- }
- if (opt_slow_logname)
- printf("update log: %s\n",opt_slow_logname);
- printf("TCP port: %d\n",mysql_port);
-#if defined(HAVE_SYS_UN_H)
- printf("Unix socket: %s\n",mysql_unix_port);
-#endif
- if (my_disable_locking)
- puts("\nsystem locking is not in use");
- if (opt_noacl)
- puts("\nGrant tables are not used. All users have full access rights");
+'mysqladmin variables' instead of 'mysqld --help'.");
}
@@ -3925,10 +3892,19 @@ static void set_options(void)
opt_specialflag |= SPECIAL_NO_PRIOR;
#endif
- (void) strmake(default_charset, MYSQL_CHARSET, sizeof(default_charset)-1);
+ sys_charset.value= (char*) MYSQL_CHARSET;
(void) strmake(language, LANGUAGE, sizeof(language)-1);
(void) strmake(mysql_real_data_home, get_relative_path(DATADIR),
- sizeof(mysql_real_data_home-1));
+ sizeof(mysql_real_data_home)-1);
+
+ /* Set default values for some variables */
+ global_system_variables.table_type=DB_TYPE_MYISAM;
+ global_system_variables.tx_isolation=ISO_READ_COMMITTED;
+ global_system_variables.select_limit= (ulong) HA_POS_ERROR;
+ max_system_variables.select_limit= (ulong) HA_POS_ERROR;
+ global_system_variables.max_join_size= (ulong) HA_POS_ERROR;
+ max_system_variables.max_join_size= (ulong) HA_POS_ERROR;
+
#ifdef __WIN__
/* Allow Win32 users to move MySQL anywhere */
{
@@ -3944,9 +3920,8 @@ static void set_options(void)
(void) strmake(mysql_home, tmpenv, sizeof(mysql_home)-1);
#endif
-#if defined( HAVE_mit_thread ) || defined( __WIN__ ) || defined( HAVE_LINUXTHREADS )
my_disable_locking=myisam_single_user= 1;
-#endif
+ opt_external_locking=0;
my_bind_addr = htonl( INADDR_ANY );
}
@@ -3966,7 +3941,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_sql_mode = (MODE_REAL_AS_FLOAT | MODE_PIPES_AS_CONCAT |
MODE_ANSI_QUOTES | MODE_IGNORE_SPACE | MODE_SERIALIZABLE
| MODE_ONLY_FULL_GROUP_BY);
- default_tx_isolation= ISO_SERIALIZABLE;
+ global_system_variables.tx_isolation= ISO_SERIALIZABLE;
break;
case 'b':
strmake(mysql_home,argument,sizeof(mysql_home)-1);
@@ -3994,6 +3969,14 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
safemalloc_mem_limit = atoi(argument);
#endif
break;
+#ifdef EMBEDDED_LIBRARY
+ case OPT_MAX_ALLOWED_PACKET:
+ max_allowed_packet= atoi(argument);
+ break;
+ case OPT_NET_BUFFER_LENGTH:
+ net_buffer_length= atoi(argument);
+ break;
+#endif
case 'v':
case 'V':
print_version();
@@ -4020,124 +4003,125 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_bin_log=1;
break;
case (int) OPT_INIT_RPL_ROLE:
+ {
+ int role;
+ if ((role=find_type(argument, &rpl_role_typelib, 2)) <= 0)
{
- int role;
- if ((role=find_type(argument, &rpl_role_typelib, 2)) <= 0)
- {
- fprintf(stderr, "Unknown replication role: %s\n", argument);
- exit(1);
- }
- rpl_status = (role == 1) ? RPL_AUTH_MASTER : RPL_IDLE_SLAVE;
- break;
+ fprintf(stderr, "Unknown replication role: %s\n", argument);
+ exit(1);
}
+ rpl_status = (role == 1) ? RPL_AUTH_MASTER : RPL_IDLE_SLAVE;
+ break;
+ }
case (int)OPT_REPLICATE_IGNORE_DB:
+ {
+ i_string *db = new i_string(argument);
+ replicate_ignore_db.push_back(db);
+ break;
+ }
+ case (int)OPT_REPLICATE_DO_DB:
+ {
+ i_string *db = new i_string(argument);
+ replicate_do_db.push_back(db);
+ break;
+ }
+ case (int)OPT_REPLICATE_REWRITE_DB:
+ {
+ char* key = argument,*p, *val;
+
+ if (!(p= strstr(argument, "->")))
{
- i_string *db = new i_string(argument);
- replicate_ignore_db.push_back(db);
- break;
+ fprintf(stderr,
+ "Bad syntax in replicate-rewrite-db - missing '->'!\n");
+ exit(1);
}
- case (int)OPT_REPLICATE_DO_DB:
+ val= p--;
+ while (my_isspace(system_charset_info, *p) && p > argument)
+ *p-- = 0;
+ if (p == argument)
{
- i_string *db = new i_string(argument);
- replicate_do_db.push_back(db);
- break;
+ fprintf(stderr,
+ "Bad syntax in replicate-rewrite-db - empty FROM db!\n");
+ exit(1);
}
- case (int)OPT_REPLICATE_REWRITE_DB:
+ *val= 0;
+ val+= 2;
+ while (*val && my_isspace(system_charset_info, *val))
+ *val++;
+ if (!*val)
{
- char* key = argument,*p, *val;
- p = strstr(argument, "->");
- if (!p)
- {
- fprintf(stderr,
- "Bad syntax in replicate-rewrite-db - missing '->'!\n");
- exit(1);
- }
- val = p--;
- while (my_isspace(system_charset_info, *p) && p > argument) *p-- = 0;
- if (p == argument)
- {
- fprintf(stderr,
- "Bad syntax in replicate-rewrite-db - empty FROM db!\n");
- exit(1);
- }
- *val = 0;
- val += 2;
- while (*val && my_isspace(system_charset_info, *val))
- *val++;
- if (!*val)
- {
- fprintf(stderr,
- "Bad syntax in replicate-rewrite-db - empty TO db!\n");
- exit(1);
- }
-
- i_string_pair* db_pair = new i_string_pair(key, val);
- replicate_rewrite_db.push_back(db_pair);
- break;
+ fprintf(stderr,
+ "Bad syntax in replicate-rewrite-db - empty TO db!\n");
+ exit(1);
}
+ i_string_pair *db_pair = new i_string_pair(key, val);
+ replicate_rewrite_db.push_back(db_pair);
+ break;
+ }
+
case (int)OPT_BINLOG_IGNORE_DB:
- {
- i_string *db = new i_string(argument);
- binlog_ignore_db.push_back(db);
- break;
- }
+ {
+ i_string *db = new i_string(argument);
+ binlog_ignore_db.push_back(db);
+ break;
+ }
case (int)OPT_BINLOG_DO_DB:
- {
- i_string *db = new i_string(argument);
- binlog_do_db.push_back(db);
- break;
- }
+ {
+ i_string *db = new i_string(argument);
+ binlog_do_db.push_back(db);
+ break;
+ }
case (int)OPT_REPLICATE_DO_TABLE:
+ {
+ if (!do_table_inited)
+ init_table_rule_hash(&replicate_do_table, &do_table_inited);
+ if (add_table_rule(&replicate_do_table, argument))
{
- if (!do_table_inited)
- init_table_rule_hash(&replicate_do_table, &do_table_inited);
- if(add_table_rule(&replicate_do_table, argument))
- {
- fprintf(stderr, "Could not add do table rule '%s'!\n", argument);
- exit(1);
- }
- table_rules_on = 1;
- break;
+ fprintf(stderr, "Could not add do table rule '%s'!\n", argument);
+ exit(1);
}
+ table_rules_on = 1;
+ break;
+ }
case (int)OPT_REPLICATE_WILD_DO_TABLE:
+ {
+ if (!wild_do_table_inited)
+ init_table_rule_array(&replicate_wild_do_table,
+ &wild_do_table_inited);
+ if (add_wild_table_rule(&replicate_wild_do_table, argument))
{
- if (!wild_do_table_inited)
- init_table_rule_array(&replicate_wild_do_table,
- &wild_do_table_inited);
- if(add_wild_table_rule(&replicate_wild_do_table, argument))
- {
- fprintf(stderr, "Could not add do table rule '%s'!\n", argument);
- exit(1);
- }
- table_rules_on = 1;
- break;
+ fprintf(stderr, "Could not add do table rule '%s'!\n", argument);
+ exit(1);
}
+ table_rules_on = 1;
+ break;
+ }
case (int)OPT_REPLICATE_WILD_IGNORE_TABLE:
+ {
+ if (!wild_ignore_table_inited)
+ init_table_rule_array(&replicate_wild_ignore_table,
+ &wild_ignore_table_inited);
+ if (add_wild_table_rule(&replicate_wild_ignore_table, argument))
{
- if (!wild_ignore_table_inited)
- init_table_rule_array(&replicate_wild_ignore_table,
- &wild_ignore_table_inited);
- if(add_wild_table_rule(&replicate_wild_ignore_table, argument))
- {
- fprintf(stderr, "Could not add ignore table rule '%s'!\n", argument);
- exit(1);
- }
- table_rules_on = 1;
- break;
+ fprintf(stderr, "Could not add ignore table rule '%s'!\n", argument);
+ exit(1);
}
+ table_rules_on = 1;
+ break;
+ }
case (int)OPT_REPLICATE_IGNORE_TABLE:
+ {
+ if (!ignore_table_inited)
+ init_table_rule_hash(&replicate_ignore_table, &ignore_table_inited);
+ if (add_table_rule(&replicate_ignore_table, argument))
{
- if (!ignore_table_inited)
- init_table_rule_hash(&replicate_ignore_table, &ignore_table_inited);
- if(add_table_rule(&replicate_ignore_table, argument))
- {
- fprintf(stderr, "Could not add ignore table rule '%s'!\n", argument);
- exit(1);
- }
- table_rules_on = 1;
- break;
+ fprintf(stderr, "Could not add ignore table rule '%s'!\n", argument);
+ exit(1);
}
+ table_rules_on = 1;
+ break;
+ }
case (int) OPT_SLOW_QUERY_LOG:
opt_slow_log=1;
break;
@@ -4147,38 +4131,32 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case (int) OPT_SKIP_NEW:
opt_specialflag|= SPECIAL_NO_NEW_FUNC;
- myisam_delay_key_write=0;
+ delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE;
myisam_concurrent_insert=0;
myisam_recover_options= HA_RECOVER_NONE;
my_disable_symlinks=1;
my_use_symdir=0;
have_symlink=SHOW_OPTION_DISABLED;
- ha_open_options&= ~HA_OPEN_ABORT_IF_CRASHED;
+ ha_open_options&= ~(HA_OPEN_ABORT_IF_CRASHED | HA_OPEN_DELAY_KEY_WRITE);
#ifdef HAVE_QUERY_CACHE
query_cache_size=0;
#endif
break;
case (int) OPT_SAFE:
opt_specialflag|= SPECIAL_SAFE_MODE;
- myisam_delay_key_write=0;
+ delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE;
myisam_recover_options= HA_RECOVER_NONE; // To be changed
- ha_open_options&= ~HA_OPEN_ABORT_IF_CRASHED;
+ ha_open_options&= ~(HA_OPEN_ABORT_IF_CRASHED | HA_OPEN_DELAY_KEY_WRITE);
break;
case (int) OPT_SKIP_PRIOR:
opt_specialflag|= SPECIAL_NO_PRIOR;
break;
case (int) OPT_SKIP_LOCK:
- my_disable_locking=myisam_single_user= 1;
+ opt_external_locking=0;
break;
case (int) OPT_SKIP_HOST_CACHE:
opt_specialflag|= SPECIAL_NO_HOST_CACHE;
break;
- case (int) OPT_ENABLE_LOCK:
- my_disable_locking=myisam_single_user=0;
- break;
- case (int) OPT_USE_LOCKING:
- my_disable_locking=0;
- break;
case (int) OPT_SKIP_RESOLVE:
opt_specialflag|=SPECIAL_NO_RESOLVE;
break;
@@ -4253,57 +4231,61 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
flush_time=0; // No auto flush
break;
case OPT_LOW_PRIORITY_UPDATES:
- thd_startup_options|=OPTION_LOW_PRIORITY_UPDATES;
thr_upgraded_concurrent_insert_lock= TL_WRITE_LOW_PRIORITY;
- low_priority_updates=1;
+ global_system_variables.low_priority_updates=1;
break;
case OPT_BOOTSTRAP:
opt_noacl=opt_bootstrap=1;
break;
case OPT_TABLE_TYPE:
+ {
+ int type;
+ if ((type=find_type(argument, &ha_table_typelib, 2)) <= 0)
{
- int type;
- if ((type=find_type(argument, &ha_table_typelib, 2)) <= 0)
- {
- fprintf(stderr,"Unknown table type: %s\n",argument);
- exit(1);
- }
- default_table_type= (enum db_type) type;
- break;
+ fprintf(stderr,"Unknown table type: %s\n",argument);
+ exit(1);
}
+ global_system_variables.table_type= type-1;
+ break;
+ }
case OPT_SERVER_ID:
server_id_supplied = 1;
break;
+ case OPT_DELAY_KEY_WRITE_ALL:
+ if (argument != disabled_my_option)
+ argument= (char*) "ALL";
+ /* Fall through */
case OPT_DELAY_KEY_WRITE:
- ha_open_options|=HA_OPEN_DELAY_KEY_WRITE;
- myisam_delay_key_write=1;
- break;
- case 'C':
- strmake(default_charset, argument, sizeof(default_charset)-1);
+ if (argument == disabled_my_option)
+ delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE;
+ else if (! argument)
+ delay_key_write_options= (uint) DELAY_KEY_WRITE_ON;
+ else
+ {
+ int type;
+ if ((type=find_type(argument, &delay_key_write_typelib, 2)) <= 0)
+ {
+ fprintf(stderr,"Unknown delay_key_write type: %s\n",argument);
+ exit(1);
+ }
+ delay_key_write_options= (uint) type-1;
+ }
break;
case OPT_CHARSETS_DIR:
strmake(mysql_charsets_dir, argument, sizeof(mysql_charsets_dir)-1);
charsets_dir = mysql_charsets_dir;
break;
-#ifdef HAVE_OPENSSL
-#include "sslopt-case.h"
-#endif
- case OPT_DES_KEY_FILE:
-#ifdef HAVE_OPENSSL
- des_key_file=argument;
-#endif
- break;
case OPT_TX_ISOLATION:
+ {
+ int type;
+ if ((type=find_type(argument, &tx_isolation_typelib, 2)) <= 0)
{
- int type;
- if ((type=find_type(argument, &tx_isolation_typelib, 2)) <= 0)
- {
- fprintf(stderr,"Unknown transaction isolation type: %s\n",argument);
- exit(1);
- }
- default_tx_isolation= (enum_tx_isolation) (type-1);
- break;
+ fprintf(stderr,"Unknown transaction isolation type: %s\n",argument);
+ exit(1);
}
+ global_system_variables.tx_isolation= (type-1);
+ break;
+ }
#ifdef HAVE_BERKELEY_DB
case OPT_BDB_NOSYNC:
berkeley_env_flags|=DB_TXN_NOSYNC;
@@ -4312,22 +4294,22 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
berkeley_init_flags&= ~(DB_RECOVER);
break;
case OPT_BDB_LOCK:
+ {
+ int type;
+ if ((type=find_type(argument, &berkeley_lock_typelib, 2)) > 0)
+ berkeley_lock_type=berkeley_lock_types[type-1];
+ else
{
- int type;
- if ((type=find_type(argument, &berkeley_lock_typelib, 2)) > 0)
- berkeley_lock_type=berkeley_lock_types[type-1];
+ if (test_if_int(argument,(uint) strlen(argument)))
+ berkeley_lock_scan_time=atoi(argument);
else
{
- if (test_if_int(argument,(uint) strlen(argument)))
- berkeley_lock_scan_time=atoi(argument);
- else
- {
- fprintf(stderr,"Unknown lock type: %s\n",argument);
- exit(1);
- }
+ fprintf(stderr,"Unknown lock type: %s\n",argument);
+ exit(1);
}
- break;
}
+ break;
+ }
case OPT_BDB_SHARED:
berkeley_init_flags&= ~(DB_PRIVATE);
berkeley_shared_data=1;
@@ -4354,47 +4336,44 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case OPT_INNODB_LOG_ARCHIVE:
innobase_log_archive= argument ? test(atoi(argument)) : 1;
break;
- case OPT_INNODB_FLUSH_LOG_AT_TRX_COMMIT:
- innobase_flush_log_at_trx_commit= argument ? test(atoi(argument)) : 1;
- break;
case OPT_INNODB_FAST_SHUTDOWN:
innobase_fast_shutdown= argument ? test(atoi(argument)) : 1;
break;
#endif /* HAVE_INNOBASE_DB */
case OPT_MYISAM_RECOVER:
+ {
+ if (!argument || !argument[0])
{
- if (!argument || !argument[0])
- {
- myisam_recover_options= HA_RECOVER_DEFAULT;
- myisam_recover_options_str= myisam_recover_typelib.type_names[0];
- }
- else
- {
- myisam_recover_options_str=argument;
- if ((myisam_recover_options=
- find_bit_type(argument, &myisam_recover_typelib)) == ~(ulong) 0)
- {
- fprintf(stderr, "Unknown option to myisam-recover: %s\n",argument);
- exit(1);
- }
- }
- ha_open_options|=HA_OPEN_ABORT_IF_CRASHED;
- break;
+ myisam_recover_options= HA_RECOVER_DEFAULT;
+ myisam_recover_options_str= myisam_recover_typelib.type_names[0];
}
- case OPT_SQL_MODE:
+ else
{
- sql_mode_str = argument;
- if ((opt_sql_mode =
- find_bit_type(argument, &sql_mode_typelib)) == ~(ulong) 0)
+ myisam_recover_options_str=argument;
+ if ((myisam_recover_options=
+ find_bit_type(argument, &myisam_recover_typelib)) == ~(ulong) 0)
{
- fprintf(stderr, "Unknown option to sql-mode: %s\n", argument);
+ fprintf(stderr, "Unknown option to myisam-recover: %s\n",argument);
exit(1);
}
- default_tx_isolation= ((opt_sql_mode & MODE_SERIALIZABLE) ?
- ISO_SERIALIZABLE :
- ISO_READ_COMMITTED);
- break;
}
+ ha_open_options|=HA_OPEN_ABORT_IF_CRASHED;
+ break;
+ }
+ case OPT_SQL_MODE:
+ {
+ sql_mode_str = argument;
+ if ((opt_sql_mode =
+ find_bit_type(argument, &sql_mode_typelib)) == ~(ulong) 0)
+ {
+ fprintf(stderr, "Unknown option to sql-mode: %s\n", argument);
+ exit(1);
+ }
+ global_system_variables.tx_isolation= ((opt_sql_mode & MODE_SERIALIZABLE) ?
+ ISO_SERIALIZABLE :
+ ISO_READ_COMMITTED);
+ break;
+ }
case OPT_MASTER_PASSWORD:
master_password=argument;
break;
@@ -4413,30 +4392,41 @@ static void get_options(int argc,char **argv)
{
int ho_error;
- myisam_delay_key_write=1; // Allow use of this
-#ifndef HAVE_purify
- my_use_symdir=1; // Use internal symbolic links
-#else
- /* Symlinks gives too many warnings with purify */
- my_disable_symlinks=1;
- my_use_symdir=0;
- have_symlink=SHOW_OPTION_DISABLED;
-#endif
-
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(ho_error);
- fix_paths();
- default_table_type_name=ha_table_typelib.type_names[default_table_type-1];
- default_tx_isolation_name=tx_isolation_typelib.type_names[default_tx_isolation];
- /* To be deleted in MySQL 4.0 */
- if (!record_rnd_cache_size)
- record_rnd_cache_size=my_default_record_cache_size;
+#ifdef HAVE_BROKEN_REALPATH
+ my_use_symdir=0;
+ my_disable_symlinks=1;
+ have_symlink=SHOW_OPTION_NO;
+#else
+ if (!my_use_symdir)
+ {
+ my_disable_symlinks=1;
+ have_symlink=SHOW_OPTION_DISABLED;
+ }
+#endif
+ /* Set global MyISAM variables from delay_key_write_options */
+ fix_delay_key_write((THD*) 0, OPT_GLOBAL);
- /* Fix variables that are base 1024*1024 */
- myisam_max_temp_length= (my_off_t) min(((ulonglong) myisam_max_sort_file_size)*1024*1024, (ulonglong) MAX_FILE_SIZE);
- myisam_max_extra_temp_length= (my_off_t) min(((ulonglong) myisam_max_extra_sort_file_size)*1024*1024, (ulonglong) MAX_FILE_SIZE);
+ if (mysqld_chroot)
+ set_root(mysqld_chroot);
+ fix_paths();
+ /*
+ Set some global variables from the global_system_variables
+ In most cases the global variables will not be used
+ */
+ my_disable_locking= myisam_single_user= test(opt_external_locking == 0);
+ my_default_record_cache_size=global_system_variables.read_buff_size;
+ myisam_max_temp_length=
+ (my_off_t) min(global_system_variables.myisam_max_sort_file_size,
+ (ulonglong) MAX_FILE_SIZE);
+ myisam_max_extra_temp_length=
+ (my_off_t) min(global_system_variables.myisam_max_extra_sort_file_size,
+ (ulonglong) MAX_FILE_SIZE);
+
+ /* Set global variables based on startup options */
myisam_block_size=(uint) 1 << my_bit_log2(opt_myisam_block_size);
}
@@ -4479,6 +4469,7 @@ fn_format_relative_to_data_home(my_string to, const char *name,
static void fix_paths(void)
{
+ char buff[FN_REFLEN];
(void) fn_format(mysql_home,mysql_home,"","",16); // Remove symlinks
convert_dirname(mysql_home,mysql_home,NullS);
convert_dirname(mysql_real_data_home,mysql_real_data_home,NullS);
@@ -4487,7 +4478,7 @@ static void fix_paths(void)
(void) my_load_path(mysql_real_data_home,mysql_real_data_home,mysql_home);
(void) my_load_path(pidfile_name,pidfile_name,mysql_real_data_home);
- char buff[FN_REFLEN],*sharedir=get_relative_path(SHAREDIR);
+ char *sharedir=get_relative_path(SHAREDIR);
if (test_if_hard_path(sharedir))
strmake(buff,sharedir,sizeof(buff)-1); /* purecov: tested */
else
@@ -4503,24 +4494,19 @@ static void fix_paths(void)
charsets_dir=mysql_charsets_dir;
}
- /* Add '/' to TMPDIR if needed */
- char *tmp= (char*) my_malloc(FN_REFLEN,MYF(MY_FAE));
- if (tmp)
- {
- char *end=convert_dirname(tmp, mysql_tmpdir, NullS);
-
- mysql_tmpdir=(char*) my_realloc(tmp,(uint) (end-tmp)+1,
- MYF(MY_HOLD_ON_ERROR));
- allocated_mysql_tmpdir=mysql_tmpdir;
- }
+ char *end=convert_dirname(buff, opt_mysql_tmpdir, NullS);
+ if (!(mysql_tmpdir= my_memdup((byte*) buff,(uint) (end-buff)+1,
+ MYF(MY_FAE))))
+ exit(1);
if (!slave_load_tmpdir)
{
- // no need to check return value, if we fail, my_malloc() never returns
- slave_load_tmpdir = (char*) my_strdup(mysql_tmpdir, MYF(MY_FAE));
+ if (!(slave_load_tmpdir = (char*) my_strdup(mysql_tmpdir, MYF(MY_FAE))))
+ exit(1);
}
}
+
#ifdef SET_RLIMIT_NOFILE
static uint set_maximum_open_files(uint max_file_limit)
{
@@ -4577,10 +4563,10 @@ static uint set_maximum_open_files(uint max_file_limit)
}
#endif
- /*
- Return a bitfield from a string of substrings separated by ','
- returns ~(ulong) 0 on error.
- */
+/*
+ Return a bitfield from a string of substrings separated by ','
+ returns ~(ulong) 0 on error.
+*/
static ulong find_bit_type(const char *x, TYPELIB *bit_lib)
{
@@ -4639,7 +4625,7 @@ skipp: ;
/*****************************************************************************
-** Instantiate templates
+ Instantiate templates
*****************************************************************************/
#ifdef __GNUC__
@@ -4648,4 +4634,6 @@ template class I_List<THD>;
template class I_List_iterator<THD>;
template class I_List<i_string>;
template class I_List<i_string_pair>;
+
+FIX_GCC_LINKING_PROBLEM
#endif
diff --git a/sql/net_pkg.cc b/sql/net_pkg.cc
index fa3abc68bfa..1e7536e3007 100644
--- a/sql/net_pkg.cc
+++ b/sql/net_pkg.cc
@@ -37,7 +37,7 @@ void send_error(NET *net, uint sql_errno, const char *err)
{
if (sql_errno)
err=ER(sql_errno);
- else if (!err)
+ else
{
if ((err=net->last_error)[0])
sql_errno=net->last_errno;
@@ -95,9 +95,10 @@ void send_warning(NET *net, uint sql_errno, const char *err)
DBUG_VOID_RETURN;
}
-/**
-** write error package and flush to client
-** It's a little too low level, but I don't want to allow another buffer
+
+/*
+ Write error package and flush to client
+ It's a little too low level, but I don't want to allow another buffer
*/
/* VARARGS3 */
@@ -348,9 +349,9 @@ bool net_store_data(String* packet, I_List<i_string>* str_list)
I_List_iterator<i_string> it(*str_list);
i_string* s;
- while((s=it++))
+ while ((s=it++))
{
- if(tmp.length())
+ if (tmp.length())
tmp.append(',');
tmp.append(s->ptr);
}
@@ -378,3 +379,19 @@ net_store_data(String *packet, CONVERT *convert, const char *from)
return convert->store(packet, from, length);
return net_store_data(packet,from,length);
}
+
+/*
+ Function called by my_net_init() to set some check variables
+*/
+
+extern "C" {
+void my_net_local_init(NET *net)
+{
+ net->max_packet= (uint) global_system_variables.net_buffer_length;
+ net->read_timeout= (uint) global_system_variables.net_read_timeout;
+ net->write_timeout=(uint) global_system_variables.net_write_timeout;
+ net->retry_count= (uint) global_system_variables.net_retry_count;
+ net->max_packet_size= max(global_system_variables.net_buffer_length,
+ global_system_variables.max_allowed_packet);
+}
+}
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 0d6e548a873..bb7100f31be 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -14,17 +14,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* Write and read of logical packets to/from socket
-** Writes are cached into net_buffer_length big packets.
-** Read packets are reallocated dynamicly when reading big packets.
-** Each logical packet has the following pre-info:
-** 3 byte length & 1 byte package-number.
-*/
+/*
+ Write and read of logical packets to/from socket
-#ifdef EMBEDDED_LIBRARY
-#define net_read_timeout net_read_timeout1
-#define net_write_timeout net_write_timeout1
-#endif
+ Writes are cached into net_buffer_length big packets.
+ Read packets are reallocated dynamicly when reading big packets.
+ Each logical packet has the following pre-info:
+ 3 byte length & 1 byte package-number.
+*/
#ifdef __WIN__
#include <winsock.h>
@@ -51,15 +48,10 @@
*/
#ifdef MYSQL_SERVER
-ulong max_allowed_packet=65536;
-extern ulong net_read_timeout,net_write_timeout;
-extern uint test_flags;
#define USE_QUERY_CACHE
+extern uint test_flags;
extern void query_cache_insert(NET *net, const char *packet, ulong length);
#else
-ulong max_allowed_packet=16*1024*1024L;
-ulong net_read_timeout= NET_READ_TIMEOUT;
-ulong net_write_timeout= NET_WRITE_TIMEOUT;
#endif
#if defined(__WIN__) || !defined(MYSQL_SERVER)
@@ -70,15 +62,12 @@ ulong net_write_timeout= NET_WRITE_TIMEOUT;
#ifndef NO_ALARM
#include "my_pthread.h"
void sql_print_error(const char *format,...);
-#define RETRY_COUNT mysqld_net_retry_count
-extern ulong mysqld_net_retry_count;
extern ulong bytes_sent, bytes_received;
extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received;
#else
#undef statistic_add
#define statistic_add(A,B,C)
#define DONT_USE_THR_ALARM
-#define RETRY_COUNT 1
#endif /* NO_ALARM */
#include "thr_alarm.h"
@@ -86,8 +75,6 @@ extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received;
#define TEST_BLOCKING 8
#define MAX_THREE_BYTES 255L*255L*255L
-ulong net_buffer_length=8192; /* Default length. Enlarged if necessary */
-
static int net_write_buff(NET *net,const char *packet,ulong len);
@@ -95,17 +82,16 @@ static int net_write_buff(NET *net,const char *packet,ulong len);
int my_net_init(NET *net, Vio* vio)
{
- if (!(net->buff=(uchar*) my_malloc((uint32) net_buffer_length+
+ DBUG_ENTER("my_net_init");
+ my_net_local_init(net); /* Set some limits */
+ if (!(net->buff=(uchar*) my_malloc((uint32) net->max_packet+
NET_HEADER_SIZE + COMP_HEADER_SIZE,
MYF(MY_WME))))
- return 1;
- if (net_buffer_length > max_allowed_packet)
- max_allowed_packet=net_buffer_length;
- net->buff_end=net->buff+(net->max_packet=net_buffer_length);
+ DBUG_RETURN(1);
+ net->buff_end=net->buff+net->max_packet;
net->vio = vio;
net->no_send_ok = 0;
net->error=0; net->return_errno=0; net->return_status=0;
- net->timeout=(uint) net_read_timeout; /* Timeout for read */
net->pkt_nr=net->compress_pkt_nr=0;
net->write_pos=net->read_pos = net->buff;
net->last_error[0]=0;
@@ -119,26 +105,33 @@ int my_net_init(NET *net, Vio* vio)
net->fd = vio_fd(vio); /* For perl DBI/DBD */
#if defined(MYSQL_SERVER) && !defined(___WIN__) && !defined(__EMX__) && !defined(OS2)
if (!(test_flags & TEST_BLOCKING))
- vio_blocking(vio, FALSE);
+ {
+ my_bool old_mode;
+ vio_blocking(vio, FALSE, &old_mode);
+ }
#endif
vio_fastsend(vio);
}
- return 0;
+ DBUG_RETURN(0);
}
+
void net_end(NET *net)
{
+ DBUG_ENTER("net_end");
my_free((gptr) net->buff,MYF(MY_ALLOW_ZERO_PTR));
net->buff=0;
+ DBUG_VOID_RETURN;
}
+
/* Realloc the packet buffer */
static my_bool net_realloc(NET *net, ulong length)
{
uchar *buff;
ulong pkt_length;
- if (length >= max_allowed_packet)
+ if (length >= net->max_packet_size)
{
DBUG_PRINT("error",("Packet too large (%lu)", length));
net->error=1;
@@ -146,8 +139,10 @@ static my_bool net_realloc(NET *net, ulong length)
return 1;
}
pkt_length = (length+IO_SIZE-1) & ~(IO_SIZE-1);
- /* We must allocate some extra bytes for the end 0 and to be able to
- read big compressed blocks */
+ /*
+ We must allocate some extra bytes for the end 0 and to be able to
+ read big compressed blocks
+ */
if (!(buff=(uchar*) my_realloc((char*) net->buff, (uint32) pkt_length +
NET_HEADER_SIZE + COMP_HEADER_SIZE,
MYF(MY_WME))))
@@ -167,23 +162,24 @@ static my_bool net_realloc(NET *net, ulong length)
void net_clear(NET *net)
{
+ DBUG_ENTER("net_clear");
#if !defined(EXTRA_DEBUG) && !defined(EMBEDDED_LIBRARY)
- int count; /* One may get 'unused' warn */
- bool is_blocking=vio_is_blocking(net->vio);
- if (is_blocking)
- vio_blocking(net->vio, FALSE);
- if (!vio_is_blocking(net->vio)) /* Safety if SSL */
{
- while ( (count = vio_read(net->vio, (char*) (net->buff),
- (uint32) net->max_packet)) > 0)
- DBUG_PRINT("info",("skipped %d bytes from file: %s",
- count,vio_description(net->vio)));
- if (is_blocking)
- vio_blocking(net->vio, TRUE);
+ int count; /* One may get 'unused' warn */
+ my_bool old_mode;
+ if (!vio_blocking(net->vio, FALSE, &old_mode))
+ {
+ while ((count = vio_read(net->vio, (char*) (net->buff),
+ (uint32) net->max_packet)) > 0)
+ DBUG_PRINT("info",("skipped %d bytes from file: %s",
+ count, vio_description(net->vio)));
+ vio_blocking(net->vio, TRUE, &old_mode);
+ }
}
#endif /* EXTRA_DEBUG */
net->pkt_nr=net->compress_pkt_nr=0; /* Ready for new command */
net->write_pos=net->buff;
+ DBUG_VOID_RETURN;
}
/* Flush write_buffer if not empty. */
@@ -374,7 +370,7 @@ net_real_write(NET *net,const char *packet,ulong len)
#ifndef NO_ALARM
thr_alarm_init(&alarmed);
if (net_blocking)
- thr_alarm(&alarmed,(uint) net_write_timeout,&alarm_buff);
+ thr_alarm(&alarmed,(uint) net->write_timeout,&alarm_buff);
#else
alarmed=0;
#endif /* NO_ALARM */
@@ -388,22 +384,23 @@ net_real_write(NET *net,const char *packet,ulong len)
#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2))
if ((interrupted || length==0) && !thr_alarm_in_use(&alarmed))
{
- if (!thr_alarm(&alarmed,(uint) net_write_timeout,&alarm_buff))
+ if (!thr_alarm(&alarmed,(uint) net->write_timeout,&alarm_buff))
{ /* Always true for client */
- if (!vio_is_blocking(net->vio))
+ my_bool old_mode;
+ while (vio_blocking(net->vio, TRUE, &old_mode) < 0)
{
- while (vio_blocking(net->vio, TRUE) < 0)
- {
- if (vio_should_retry(net->vio) && retry_count++ < RETRY_COUNT)
- continue;
+ if (vio_should_retry(net->vio) && retry_count++ < net->retry_count)
+ continue;
#ifdef EXTRA_DEBUG
- fprintf(stderr,
- "%s: my_net_write: fcntl returned error %d, aborting thread\n",
- my_progname,vio_errno(net->vio));
+ fprintf(stderr,
+ "%s: my_net_write: fcntl returned error %d, aborting thread\n",
+ my_progname,vio_errno(net->vio));
#endif /* EXTRA_DEBUG */
- net->error=2; /* Close socket */
- goto end;
- }
+#ifdef MYSQL_SERVER
+ net->last_errno=ER_NET_ERROR_ON_WRITE;
+#endif
+ net->error=2; /* Close socket */
+ goto end;
}
retry_count=0;
continue;
@@ -414,7 +411,7 @@ net_real_write(NET *net,const char *packet,ulong len)
if (thr_alarm_in_use(&alarmed) && !thr_got_alarm(&alarmed) &&
interrupted)
{
- if (retry_count++ < RETRY_COUNT)
+ if (retry_count++ < net->retry_count)
continue;
#ifdef EXTRA_DEBUG
fprintf(stderr, "%s: write looped, aborting thread\n",
@@ -447,8 +444,9 @@ net_real_write(NET *net,const char *packet,ulong len)
#endif
if (thr_alarm_in_use(&alarmed))
{
+ my_bool old_mode;
thr_end_alarm(&alarmed);
- vio_blocking(net->vio, net_blocking);
+ vio_blocking(net->vio, net_blocking, &old_mode);
}
net->reading_or_writing=0;
DBUG_RETURN(((int) (pos != end)));
@@ -469,10 +467,12 @@ static void my_net_skip_rest(NET *net, uint32 remain, thr_alarm_t *alarmed)
{
ALARM alarm_buff;
uint retry_count=0;
+ my_bool old_mode;
+
if (!thr_alarm_in_use(&alarmed))
{
- if (!thr_alarm(alarmed,net->timeout,&alarm_buff) ||
- (!vio_is_blocking(net->vio) && vio_blocking(net->vio,TRUE) < 0))
+ if (!thr_alarm(alarmed,net->read_timeout,&alarm_buff) ||
+ vio_blocking(net->vio, TRUE, &old_mode) < 0)
return; /* Can't setup, abort */
}
while (remain > 0)
@@ -483,7 +483,7 @@ static void my_net_skip_rest(NET *net, uint32 remain, thr_alarm_t *alarmed)
my_bool interrupted = vio_should_retry(net->vio);
if (!thr_got_alarm(&alarmed) && interrupted)
{ /* Probably in MIT threads */
- if (retry_count++ < RETRY_COUNT)
+ if (retry_count++ < net->retry_count)
continue;
}
return;
@@ -521,7 +521,7 @@ my_real_read(NET *net, ulong *complen)
thr_alarm_init(&alarmed);
#ifndef NO_ALARM
if (net_blocking)
- thr_alarm(&alarmed,net->timeout,&alarm_buff);
+ thr_alarm(&alarmed,net->read_timeout,&alarm_buff);
#endif /* NO_ALARM */
pos = net->buff + net->where_b; /* net->packet -4 */
@@ -544,31 +544,29 @@ my_real_read(NET *net, ulong *complen)
*/
if ((interrupted || length == 0) && !thr_alarm_in_use(&alarmed))
{
- if (!thr_alarm(&alarmed,net->timeout,&alarm_buff)) /* Don't wait too long */
+ if (!thr_alarm(&alarmed,net->read_timeout,&alarm_buff)) /* Don't wait too long */
{
- if (!vio_is_blocking(net->vio))
- {
- while (vio_blocking(net->vio,TRUE) < 0)
- {
- if (vio_should_retry(net->vio) &&
- retry_count++ < RETRY_COUNT)
- continue;
- DBUG_PRINT("error",
- ("fcntl returned error %d, aborting thread",
- vio_errno(net->vio)));
+ my_bool old_mode;
+ while (vio_blocking(net->vio, TRUE, &old_mode) < 0)
+ {
+ if (vio_should_retry(net->vio) &&
+ retry_count++ < net->retry_count)
+ continue;
+ DBUG_PRINT("error",
+ ("fcntl returned error %d, aborting thread",
+ vio_errno(net->vio)));
#ifdef EXTRA_DEBUG
- fprintf(stderr,
- "%s: read: fcntl returned error %d, aborting thread\n",
- my_progname,vio_errno(net->vio));
+ fprintf(stderr,
+ "%s: read: fcntl returned error %d, aborting thread\n",
+ my_progname,vio_errno(net->vio));
#endif /* EXTRA_DEBUG */
- len= packet_error;
- net->error=2; /* Close socket */
+ len= packet_error;
+ net->error=2; /* Close socket */
#ifdef MYSQL_SERVER
- net->last_errno=ER_NET_FCNTL_ERROR;
+ net->last_errno=ER_NET_FCNTL_ERROR;
#endif
- goto end;
- }
- }
+ goto end;
+ }
retry_count=0;
continue;
}
@@ -577,7 +575,7 @@ my_real_read(NET *net, ulong *complen)
if (thr_alarm_in_use(&alarmed) && !thr_got_alarm(&alarmed) &&
interrupted)
{ /* Probably in MIT threads */
- if (retry_count++ < RETRY_COUNT)
+ if (retry_count++ < net->retry_count)
continue;
#ifdef EXTRA_DEBUG
fprintf(stderr, "%s: read looped with error %d, aborting thread\n",
@@ -591,7 +589,9 @@ my_real_read(NET *net, ulong *complen)
continue;
}
#endif
- DBUG_PRINT("error",("Couldn't read packet: remain: %lu errno: %d length: %ld alarmed: %d", remain,vio_errno(net->vio),length,alarmed));
+ DBUG_PRINT("error",("Couldn't read packet: remain: %lu errno: %d length: %ld alarmed: %d",
+ remain,vio_errno(net->vio), length,
+ thr_got_alarm(&alarmed)));
len= packet_error;
net->error=2; /* Close socket */
#ifdef MYSQL_SERVER
@@ -661,8 +661,9 @@ my_real_read(NET *net, ulong *complen)
end:
if (thr_alarm_in_use(&alarmed))
{
+ my_bool old_mode;
thr_end_alarm(&alarmed);
- vio_blocking(net->vio, net_blocking);
+ vio_blocking(net->vio, net_blocking, &old_mode);
}
net->reading_or_writing=0;
return(len);
@@ -815,7 +816,7 @@ my_net_read(NET *net)
return len;
}
-int net_request_file(NET* net, const char* fname)
+bool net_request_file(NET* net, const char* fname)
{
char tmp [FN_REFLEN+1],*end;
DBUG_ENTER("net_request_file");
diff --git a/sql/nt_servc.cc b/sql/nt_servc.cc
index be2ceb9cb7a..129df9864e2 100644
--- a/sql/nt_servc.cc
+++ b/sql/nt_servc.cc
@@ -501,11 +501,9 @@ BOOL NTService::IsService(LPCSTR ServiceName)
-------------------------------------------------------------------------- */
BOOL NTService::got_service_option(char **argv, char *service_option)
{
- char *option = argv[1];
-
- while (*option)
- if (!strcmp(option++, service_option))
- return TRUE;
-
+ char *option;
+ for (option= argv[1]; *option; option++)
+ if (!strcmp(option, service_option))
+ return TRUE;
return FALSE;
}
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 3764ff2d55c..b0636869d68 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -67,7 +67,9 @@ public:
SEL_ARG(Field *field, uint8 part, char *min_value, char *max_value,
uint8 min_flag, uint8 max_flag, uint8 maybe_flag);
SEL_ARG(enum Type type_arg)
- :elements(1),use_count(1),left(0),next_key_part(0),type(type_arg) {}
+ :elements(1),use_count(1),left(0),next_key_part(0),color(BLACK),
+ type(type_arg)
+ {}
inline bool is_same(SEL_ARG *arg)
{
if (type != arg->type)
@@ -686,27 +688,27 @@ int SQL_SELECT::test_quick_select(key_map keys_to_use, table_map prev_tables,
{
ha_rows found_records;
double found_read_time;
-
if (*key)
{
+ uint keynr= param.real_keynr[idx];
if ((*key)->type == SEL_ARG::MAYBE_KEY ||
(*key)->maybe_flag)
- needed_reg|= (key_map) 1 << param.real_keynr[idx];
+ needed_reg|= (key_map) 1 << keynr;
- found_records=check_quick_select(&param,idx, *key);
+ found_records=check_quick_select(&param, idx, *key);
if (found_records != HA_POS_ERROR && found_records > 2 &&
- head->used_keys & ((table_map) 1 << param.real_keynr[idx]) &&
- (head->file->table_flags() & HA_HAVE_KEY_READ_ONLY))
+ head->used_keys & ((table_map) 1 << keynr) &&
+ (head->file->index_flags(keynr) & HA_KEY_READ_ONLY))
{
/*
- ** We can resolve this by only reading through this key
- ** Assume that we will read trough the whole key range
- ** and that all key blocks are half full (normally things are
- ** much better)
+ We can resolve this by only reading through this key.
+ Assume that we will read trough the whole key range
+ and that all key blocks are half full (normally things are
+ much better).
*/
- uint keys_per_block= head->file->block_size/2/
- (head->key_info[param.real_keynr[idx]].key_length+
- head->file->ref_length) + 1;
+ uint keys_per_block= (head->file->block_size/2/
+ (head->key_info[keynr].key_length+
+ head->file->ref_length) + 1);
found_read_time=((double) (found_records+keys_per_block-1)/
(double) keys_per_block);
}
@@ -889,7 +891,7 @@ get_mm_parts(PARAM *param,Field *field, Item_func::Functype type,Item *value,
if (value &&
value->used_tables() & ~(param->prev_tables | param->read_tables))
DBUG_RETURN(0);
- for ( ; key_part != end ; key_part++)
+ for (; key_part != end ; key_part++)
{
if (field->eq(key_part->field))
{
@@ -1030,6 +1032,7 @@ get_mm_leaf(PARAM *param, Field *field, KEY_PART *key_part,
if (value->save_in_field(field) == 1)
{
+ // TODO; Check if we can we remove the following block.
if (type == Item_func::EQUAL_FUNC)
{
/* convert column_name <=> NULL -> column_name IS NULL */
@@ -1332,7 +1335,8 @@ and_all_keys(SEL_ARG *key1,SEL_ARG *key2,uint clone_flag)
}
if (key1->type == SEL_ARG::MAYBE_KEY)
{
- key1->left= &null_element; key1->next=0;
+ key1->right= key1->left= &null_element;
+ key1->next= key1->prev= 0;
}
for (next=key1->first(); next ; next=next->next)
{
diff --git a/sql/opt_range.h b/sql/opt_range.h
index e9694b4820f..e96c3792f24 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -41,10 +41,14 @@ typedef struct st_key_part {
Field::imagetype image_type;
} KEY_PART;
+
class QUICK_RANGE :public Sql_alloc {
public:
char *min_key,*max_key;
uint16 min_length,max_length,flag;
+#ifdef HAVE_purify
+ uint16 dummy; /* Avoid warnings on 'flag' */
+#endif
QUICK_RANGE(); /* Full range */
QUICK_RANGE(const char *min_key_arg,uint min_length_arg,
const char *max_key_arg,uint max_length_arg,
@@ -54,7 +58,11 @@ class QUICK_RANGE :public Sql_alloc {
min_length((uint16) min_length_arg),
max_length((uint16) max_length_arg),
flag((uint16) flag_arg)
- {}
+ {
+#ifdef HAVE_purify
+ dummy=0;
+#endif
+ }
};
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index f399390da4b..38365dbb546 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -152,9 +152,9 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
error=table->file->index_last(table->record[0]) !=0;
else
{
- (void) table->file->index_read(table->record[0], key_buff,
- ref.key_length,
- HA_READ_AFTER_KEY);
+ (void)table->file->index_read(table->record[0], key_buff,
+ ref.key_length,
+ HA_READ_AFTER_KEY);
error=table->file->index_prev(table->record[0]) ||
key_cmp(table,key_buff,ref.key,ref.key_length);
}
diff --git a/sql/procedure.h b/sql/procedure.h
index db0e0b7f9e2..349908a8d84 100644
--- a/sql/procedure.h
+++ b/sql/procedure.h
@@ -43,6 +43,7 @@ public:
{
init_make_field(tmp_field,field_type());
}
+ unsigned int size_of() { return sizeof(*this);}
};
class Item_proc_real :public Item_proc
@@ -62,6 +63,7 @@ public:
double val() { return value; }
longlong val_int() { return (longlong) value; }
String *val_str(String *s) { s->set(value,decimals); return s; }
+ unsigned int size_of() { return sizeof(*this);}
};
class Item_proc_int :public Item_proc
@@ -79,6 +81,7 @@ public:
double val() { return (double) value; }
longlong val_int() { return value; }
String *val_str(String *s) { s->set(value); return s; }
+ unsigned int size_of() { return sizeof(*this);}
};
@@ -98,6 +101,7 @@ public:
{
return null_value ? (String*) 0 : (String*) &str_value;
}
+ unsigned int size_of() { return sizeof(*this);}
};
/* The procedure class definitions */
diff --git a/sql/records.cc b/sql/records.cc
index 29ace3cd652..7c3bd1110bb 100644
--- a/sql/records.cc
+++ b/sql/records.cc
@@ -61,7 +61,7 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
table->file->rnd_init(0);
if (! (specialflag & SPECIAL_SAFE_MODE) &&
- record_rnd_cache_size &&
+ thd->variables.read_rnd_buff_size &&
!table->file->fast_key_read() &&
(table->db_stat & HA_READ_ONLY ||
table->reginfo.lock_type <= TL_READ_NO_INSERT) &&
@@ -103,7 +103,8 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
!(table->db_options_in_use & HA_OPTION_PACK_RECORD) ||
(use_record_cache < 0 &&
!(table->file->table_flags() & HA_NOT_DELETE_WITH_CACHE)))
- VOID(table->file->extra(HA_EXTRA_CACHE)); // Cache reads
+ VOID(table->file->extra_opt(HA_EXTRA_CACHE,
+ thd->variables.read_buff_size));
}
DBUG_VOID_RETURN;
} /* init_read_record */
@@ -229,6 +230,8 @@ tryNext:
static int init_rr_cache(READ_RECORD *info)
{
uint rec_cache_size;
+ THD *thd= current_thd;
+
DBUG_ENTER("init_rr_cache");
info->struct_length=3+MAX_REFLENGTH;
@@ -237,7 +240,7 @@ static int init_rr_cache(READ_RECORD *info)
info->reclength=ALIGN_SIZE(info->struct_length);
info->error_offset=info->table->reclength;
- info->cache_records=record_rnd_cache_size/
+ info->cache_records= thd->variables.read_rnd_buff_size /
(info->reclength+info->struct_length);
rec_cache_size=info->cache_records*info->reclength;
info->rec_cache_size=info->cache_records*info->ref_length;
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 112642d0a5f..04f1ffce00e 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -24,7 +24,6 @@
#include "mini_client.h"
#include "log_event.h"
#include <mysql.h>
-#include <thr_alarm.h>
#define SLAVE_LIST_CHUNK 128
#define SLAVE_ERRMSG_SIZE (FN_REFLEN+64)
@@ -40,24 +39,28 @@ const char *rpl_role_type[] = {"MASTER","SLAVE",NullS};
TYPELIB rpl_role_typelib = {array_elements(rpl_role_type)-1,"",
rpl_role_type};
-const char* rpl_status_type[] = {"AUTH_MASTER","ACTIVE_SLAVE","IDLE_SLAVE",
- "LOST_SOLDIER","TROOP_SOLDIER",
- "RECOVERY_CAPTAIN","NULL",NullS};
+const char* rpl_status_type[]=
+{
+ "AUTH_MASTER","ACTIVE_SLAVE","IDLE_SLAVE", "LOST_SOLDIER","TROOP_SOLDIER",
+ "RECOVERY_CAPTAIN","NULL",NullS
+};
TYPELIB rpl_status_typelib= {array_elements(rpl_status_type)-1,"",
rpl_status_type};
+
static Slave_log_event* find_slave_event(IO_CACHE* log,
const char* log_file_name,
char* errmsg);
+
static int init_failsafe_rpl_thread(THD* thd)
{
DBUG_ENTER("init_failsafe_rpl_thread");
thd->system_thread = thd->bootstrap = 1;
thd->client_capabilities = 0;
my_net_init(&thd->net, 0);
- thd->net.timeout = slave_net_timeout;
- thd->max_packet_length=thd->net.max_packet;
+ thd->net.read_timeout = slave_net_timeout;
+ thd->max_client_packet_length=thd->net.max_packet;
thd->master_access= ~0;
thd->priv_user = 0;
thd->system_thread = 1;
@@ -65,10 +68,7 @@ static int init_failsafe_rpl_thread(THD* thd)
thd->thread_id = thread_id++;
pthread_mutex_unlock(&LOCK_thread_count);
- if (init_thr_lock() ||
- my_pthread_setspecific_ptr(THR_THD, thd) ||
- my_pthread_setspecific_ptr(THR_MALLOC, &thd->mem_root) ||
- my_pthread_setspecific_ptr(THR_NET, &thd->net))
+ if (init_thr_lock() || thd->store_globals())
{
close_connection(&thd->net,ER_OUT_OF_RESOURCES); // is this needed?
end_thread(thd,0);
@@ -84,8 +84,8 @@ static int init_failsafe_rpl_thread(THD* thd)
#endif
thd->mem_root.free=thd->mem_root.used=0;
- if (thd->max_join_size == (ulong) ~0L)
- thd->options |= OPTION_BIG_SELECTS;
+ if ((ulong) thd->variables.max_join_size == (ulong) HA_POS_ERROR)
+ thd->options|= OPTION_BIG_SELECTS;
thd->proc_info="Thread initialized";
thd->version=refresh_version;
@@ -93,6 +93,7 @@ static int init_failsafe_rpl_thread(THD* thd)
DBUG_RETURN(0);
}
+
void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status)
{
pthread_mutex_lock(&LOCK_rpl_status);
@@ -102,6 +103,7 @@ void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status)
pthread_mutex_unlock(&LOCK_rpl_status);
}
+
#define get_object(p, obj) \
{\
uint len = (uint)*p++; \
@@ -111,63 +113,81 @@ void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status)
p+= len; \
}\
+
static inline int cmp_master_pos(Slave_log_event* sev, LEX_MASTER_INFO* mi)
{
return cmp_master_pos(sev->master_log, sev->master_pos, mi->log_file_name,
mi->pos);
}
+
void unregister_slave(THD* thd, bool only_mine, bool need_mutex)
{
- if (need_mutex)
- pthread_mutex_lock(&LOCK_slave_list);
if (thd->server_id)
{
+ if (need_mutex)
+ pthread_mutex_lock(&LOCK_slave_list);
+
SLAVE_INFO* old_si;
if ((old_si = (SLAVE_INFO*)hash_search(&slave_list,
(byte*)&thd->server_id, 4)) &&
(!only_mine || old_si->thd == thd))
hash_delete(&slave_list, (byte*)old_si);
+
+ if (need_mutex)
+ pthread_mutex_unlock(&LOCK_slave_list);
}
- if (need_mutex)
- pthread_mutex_unlock(&LOCK_slave_list);
}
+
+/*
+ Register slave in 'slave_list' hash table
+
+ RETURN VALUES
+ 0 ok
+ 1 Error. Error message sent to client
+*/
+
int register_slave(THD* thd, uchar* packet, uint packet_length)
{
+ int res;
SLAVE_INFO *si;
- int res = 1;
- uchar* p = packet, *p_end = packet + packet_length;
+ uchar *p= packet, *p_end= packet + packet_length;
- if (check_access(thd, FILE_ACL, any_db))
+ if (check_access(thd, REPL_SLAVE_ACL, any_db))
return 1;
if (!(si = (SLAVE_INFO*)my_malloc(sizeof(SLAVE_INFO), MYF(MY_WME))))
- goto err;
+ goto err2;
- thd->server_id = si->server_id = uint4korr(p);
- p += 4;
+ thd->server_id= si->server_id= uint4korr(p);
+ p+= 4;
get_object(p,si->host);
get_object(p,si->user);
get_object(p,si->password);
- si->port = uint2korr(p);
+ if (p+10 > p_end)
+ goto err;
+ si->port= uint2korr(p);
p += 2;
- si->rpl_recovery_rank = uint4korr(p);
+ si->rpl_recovery_rank= uint4korr(p);
p += 4;
- if (!(si->master_id = uint4korr(p)))
- si->master_id = server_id;
- si->thd = thd;
- pthread_mutex_lock(&LOCK_slave_list);
+ if (!(si->master_id= uint4korr(p)))
+ si->master_id= server_id;
+ si->thd= thd;
+ pthread_mutex_lock(&LOCK_slave_list);
unregister_slave(thd,0,0);
- res = hash_insert(&slave_list, (byte*) si);
+ res= hash_insert(&slave_list, (byte*) si);
pthread_mutex_unlock(&LOCK_slave_list);
return res;
err:
- if (si)
- my_free((gptr) si, MYF(MY_WME));
- return res;
+ my_free((gptr) si, MYF(MY_WME));
+ my_message(ER_UNKNOWN_ERROR, "Wrong parameters to function register_slave",
+ MYF(0));
+err2:
+ send_error(&thd->net);
+ return 1;
}
static uint32* slave_list_key(SLAVE_INFO* si, uint* len,
@@ -199,16 +219,15 @@ void end_slave_list()
}
}
-static int find_target_pos(LEX_MASTER_INFO* mi, IO_CACHE* log, char* errmsg)
+static int find_target_pos(LEX_MASTER_INFO *mi, IO_CACHE *log, char *errmsg)
{
- uint32 log_pos = (uint32) mi->pos;
+ my_off_t log_pos = (my_off_t) mi->pos;
uint32 target_server_id = mi->server_id;
for (;;)
{
Log_event* ev;
- if (!(ev = Log_event::read_log_event(log, (pthread_mutex_t*)0,
- 0)))
+ if (!(ev = Log_event::read_log_event(log, (pthread_mutex_t*) 0, 0)))
{
if (log->error > 0)
strmov(errmsg, "Binary log truncated in the middle of event");
@@ -225,16 +244,16 @@ static int find_target_pos(LEX_MASTER_INFO* mi, IO_CACHE* log, char* errmsg)
mi->pos = my_b_tell(log);
return 0;
}
-
delete ev;
}
+ /* Impossible */
}
int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg)
{
LOG_INFO linfo;
- char search_file_name[FN_REFLEN],last_log_name[FN_REFLEN];
+ char last_log_name[FN_REFLEN];
IO_CACHE log;
File file = -1, last_file = -1;
pthread_mutex_t *log_lock;
@@ -257,12 +276,7 @@ int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg)
return 1;
}
- linfo.index_file_offset = 0;
-
-
- search_file_name[0] = 0;
-
- if (mysql_bin_log.find_first_log(&linfo, search_file_name))
+ if (mysql_bin_log.find_log_pos(&linfo, NullS, 1))
{
strmov(errmsg,"Could not find first log");
return 1;
@@ -316,7 +330,7 @@ int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg)
strmov(last_log_name, linfo.log_file_name);
last_pos = my_b_tell(&log);
- switch (mysql_bin_log.find_next_log(&linfo)) {
+ switch (mysql_bin_log.find_next_log(&linfo, 1)) {
case LOG_INFO_EOF:
if (last_file >= 0)
(void)my_close(last_file, MYF(MY_WME));
@@ -357,7 +371,11 @@ err:
return error;
}
-// caller must delete result when done
+
+/*
+ Caller must delete result when done
+*/
+
static Slave_log_event* find_slave_event(IO_CACHE* log,
const char* log_file_name,
char* errmsg)
@@ -431,6 +449,7 @@ int show_new_master(THD* thd)
}
}
+
int update_slave_list(MYSQL* mysql)
{
MYSQL_RES* res=0;
@@ -438,6 +457,7 @@ int update_slave_list(MYSQL* mysql)
const char* error=0;
bool have_auth_info;
int port_ind;
+ DBUG_ENTER("update_slave_list");
if (mc_mysql_query(mysql,"SHOW SLAVE HOSTS",0) ||
!(res = mc_mysql_store_result(mysql)))
@@ -446,8 +466,7 @@ int update_slave_list(MYSQL* mysql)
goto err;
}
- switch (mc_mysql_num_fields(res))
- {
+ switch (mc_mysql_num_fields(res)) {
case 5:
have_auth_info = 0;
port_ind=2;
@@ -463,13 +482,13 @@ int update_slave_list(MYSQL* mysql)
pthread_mutex_lock(&LOCK_slave_list);
- while ((row = mc_mysql_fetch_row(res)))
+ while ((row= mc_mysql_fetch_row(res)))
{
uint32 server_id;
SLAVE_INFO* si, *old_si;
server_id = atoi(row[0]);
- if ((old_si = (SLAVE_INFO*)hash_search(&slave_list,
- (byte*)&server_id,4)))
+ if ((old_si= (SLAVE_INFO*)hash_search(&slave_list,
+ (byte*)&server_id,4)))
si = old_si;
else
{
@@ -482,34 +501,36 @@ int update_slave_list(MYSQL* mysql)
si->server_id = server_id;
hash_insert(&slave_list, (byte*)si);
}
- strnmov(si->host, row[1], sizeof(si->host));
+ strmake(si->host, row[1], sizeof(si->host)-1);
si->port = atoi(row[port_ind]);
si->rpl_recovery_rank = atoi(row[port_ind+1]);
si->master_id = atoi(row[port_ind+2]);
if (have_auth_info)
{
- strnmov(si->user, row[2], sizeof(si->user));
- strnmov(si->password, row[3], sizeof(si->password));
+ strmake(si->user, row[2], sizeof(si->user)-1);
+ strmake(si->password, row[3], sizeof(si->password)-1);
}
}
pthread_mutex_unlock(&LOCK_slave_list);
+
err:
if (res)
mc_mysql_free_result(res);
if (error)
{
- sql_print_error("Error updating slave list:",error);
- return 1;
+ sql_print_error("Error updating slave list: %s",error);
+ DBUG_RETURN(1);
}
- return 0;
+ DBUG_RETURN(0);
}
+
int find_recovery_captain(THD* thd, MYSQL* mysql)
{
-
return 0;
}
+
pthread_handler_decl(handle_failsafe_rpl,arg)
{
DBUG_ENTER("handle_failsafe_rpl");
@@ -532,8 +553,7 @@ pthread_handler_decl(handle_failsafe_rpl,arg)
thd->proc_info="Processing request";
while (!break_req_chain)
{
- switch (rpl_status)
- {
+ switch (rpl_status) {
case RPL_LOST_SOLDIER:
if (find_recovery_captain(thd, recovery_captain))
rpl_status=RPL_TROOP_SOLDIER;
@@ -558,6 +578,7 @@ err:
DBUG_RETURN(0);
}
+
int show_slave_hosts(THD* thd)
{
List<Item> field_list;
@@ -606,26 +627,28 @@ int show_slave_hosts(THD* thd)
DBUG_RETURN(0);
}
+
int connect_to_master(THD *thd, MYSQL* mysql, MASTER_INFO* mi)
{
- if (!mi->host || !*mi->host) /* empty host */
- return 1;
+ DBUG_ENTER("connect_to_master");
- if (!mc_mysql_connect(mysql, mi->host, mi->user, mi->password, 0,
- mi->port, 0, 0))
+ if (!mi->host || !*mi->host) /* empty host */
{
- sql_print_error("Connection to master failed: %s",
- mc_mysql_error(mysql));
- return 1;
+ strmov(mysql->net.last_error, "Master is not configured");
+ DBUG_RETURN(1);
}
- return 0;
+ if (!mc_mysql_connect(mysql, mi->host, mi->user, mi->password, 0,
+ mi->port, 0, 0,
+ slave_net_timeout))
+ DBUG_RETURN(1);
+ DBUG_RETURN(0);
}
static inline void cleanup_mysql_results(MYSQL_RES* db_res,
- MYSQL_RES** cur, MYSQL_RES** start)
+ MYSQL_RES** cur, MYSQL_RES** start)
{
- for( ; cur >= start; --cur)
+ for (; cur >= start; --cur)
{
if (*cur)
mc_mysql_free_result(*cur);
@@ -634,44 +657,51 @@ static inline void cleanup_mysql_results(MYSQL_RES* db_res,
}
-static inline int fetch_db_tables(THD* thd, MYSQL* mysql, const char* db,
- MYSQL_RES* table_res, MASTER_INFO* mi)
+static int fetch_db_tables(THD *thd, MYSQL *mysql, const char *db,
+ MYSQL_RES *table_res, MASTER_INFO *mi)
{
MYSQL_ROW row;
- for( row = mc_mysql_fetch_row(table_res); row;
+ for (row = mc_mysql_fetch_row(table_res); row;
row = mc_mysql_fetch_row(table_res))
{
TABLE_LIST table;
- const char* table_name = row[0];
+ const char* table_name= row[0];
int error;
if (table_rules_on)
{
- table.next = 0;
- table.db = (char*)db;
- table.real_name = (char*)table_name;
- table.updating = 1;
+ table.next= 0;
+ table.db= (char*) db;
+ table.real_name= (char*) table_name;
+ table.updating= 1;
if (!tables_ok(thd, &table))
continue;
}
- if ((error = fetch_master_table(thd, db, table_name, mi, mysql)))
+ if ((error= fetch_master_table(thd, db, table_name, mi, mysql)))
return error;
}
return 0;
}
+/*
+ Load all MyISAM tables from master to this slave.
+
+ REQUIREMENTS
+ - No active transaction (flush_relay_log_info would not work in this case)
+*/
int load_master_data(THD* thd)
{
MYSQL mysql;
MYSQL_RES* master_status_res = 0;
- bool slave_was_running = 0;
int error = 0;
const char* errmsg=0;
int restart_thread_mask;
mc_mysql_init(&mysql);
- // we do not want anyone messing with the slave at all for the entire
- // duration of the data load;
+ /*
+ We do not want anyone messing with the slave at all for the entire
+ duration of the data load.
+ */
LOCK_ACTIVE_MI;
lock_slave_threads(active_mi);
init_thread_mask(&restart_thread_mask,active_mi,0 /*not inverse*/);
@@ -687,8 +717,8 @@ int load_master_data(THD* thd)
if (connect_to_master(thd, &mysql, active_mi))
{
- net_printf(&thd->net, error = ER_CONNECT_TO_MASTER,
- mc_mysql_error(&mysql));
+ net_printf(&thd->net, error= ER_CONNECT_TO_MASTER,
+ mc_mysql_error(&mysql));
goto err;
}
@@ -707,8 +737,10 @@ int load_master_data(THD* thd)
if (!(num_dbs = (uint) mc_mysql_num_rows(db_res)))
goto err;
- // in theory, the master could have no databases at all
- // and run with skip-grant
+ /*
+ In theory, the master could have no databases at all
+ and run with skip-grant
+ */
if (!(table_res = (MYSQL_RES**)thd->alloc(num_dbs * sizeof(MYSQL_RES*))))
{
@@ -716,10 +748,12 @@ int load_master_data(THD* thd)
goto err;
}
- // this is a temporary solution until we have online backup
- // capabilities - to be replaced once online backup is working
- // we wait to issue FLUSH TABLES WITH READ LOCK for as long as we
- // can to minimize the lock time
+ /*
+ This is a temporary solution until we have online backup
+ capabilities - to be replaced once online backup is working
+ we wait to issue FLUSH TABLES WITH READ LOCK for as long as we
+ can to minimize the lock time.
+ */
if (mc_mysql_query(&mysql, "FLUSH TABLES WITH READ LOCK", 0) ||
mc_mysql_query(&mysql, "SHOW MASTER STATUS",0) ||
!(master_status_res = mc_mysql_store_result(&mysql)))
@@ -729,13 +763,15 @@ int load_master_data(THD* thd)
goto err;
}
- // go through every table in every database, and if the replication
- // rules allow replicating it, get it
+ /*
+ Go through every table in every database, and if the replication
+ rules allow replicating it, get it
+ */
table_res_end = table_res + num_dbs;
- for(cur_table_res = table_res; cur_table_res < table_res_end;
- cur_table_res++)
+ for (cur_table_res = table_res; cur_table_res < table_res_end;
+ cur_table_res++)
{
// since we know how many rows we have, this can never be NULL
MYSQL_ROW row = mc_mysql_fetch_row(db_res);
@@ -753,7 +789,7 @@ int load_master_data(THD* thd)
*/
if (!db_ok(db, replicate_do_db, replicate_ignore_db) ||
- !strcmp(db,"mysql"))
+ !strcmp(db,"mysql"))
{
*cur_table_res = 0;
continue;
@@ -769,7 +805,7 @@ int load_master_data(THD* thd)
if (mc_mysql_select_db(&mysql, db) ||
mc_mysql_query(&mysql, "show tables", 0) ||
- !(*cur_table_res = mc_mysql_store_result(&mysql)))
+ !(*cur_table_res = mc_mysql_store_result(&mysql)))
{
net_printf(&thd->net, error = ER_QUERY_ON_MASTER,
mc_mysql_error(&mysql));
@@ -796,15 +832,16 @@ int load_master_data(THD* thd)
We need this check because the master may not be running with
log-bin, but it will still allow us to do all the steps
of LOAD DATA FROM MASTER - no reason to forbid it, really,
- although it does not make much sense for the user to do it
+ although it does not make much sense for the user to do it
*/
if (row[0] && row[1])
{
strmake(active_mi->master_log_name, row[0],
sizeof(active_mi->master_log_name));
active_mi->master_log_pos = strtoull(row[1], (char**) 0, 10);
- if (active_mi->master_log_pos < 4)
- active_mi->master_log_pos = 4; // don't hit the magic number
+ // don't hit the magic number
+ if (active_mi->master_log_pos < BIN_LOG_HEADER_SIZE)
+ active_mi->master_log_pos = BIN_LOG_HEADER_SIZE;
active_mi->rli.pending = 0;
flush_master_info(active_mi);
}
@@ -819,7 +856,8 @@ int load_master_data(THD* thd)
}
}
thd->proc_info="purging old relay logs";
- if (purge_relay_logs(&active_mi->rli,0 /* not only reset, but also reinit*/,
+ if (purge_relay_logs(&active_mi->rli,thd,
+ 0 /* not only reset, but also reinit */,
&errmsg))
{
send_error(&thd->net, 0, "Failed purging old relay logs");
@@ -829,18 +867,18 @@ int load_master_data(THD* thd)
}
pthread_mutex_lock(&active_mi->rli.data_lock);
active_mi->rli.master_log_pos = active_mi->master_log_pos;
- strnmov(active_mi->rli.master_log_name,active_mi->master_log_name,
- sizeof(active_mi->rli.master_log_name));
+ strmake(active_mi->rli.master_log_name,active_mi->master_log_name,
+ sizeof(active_mi->rli.master_log_name)-1);
flush_relay_log_info(&active_mi->rli);
pthread_cond_broadcast(&active_mi->rli.data_cond);
pthread_mutex_unlock(&active_mi->rli.data_lock);
thd->proc_info = "starting slave";
if (restart_thread_mask)
{
- error=start_slave_threads(0 /* mutex not needed*/,
- 1 /* wait for start*/,
- active_mi,master_info_file,relay_log_info_file,
- restart_thread_mask);
+ error=start_slave_threads(0 /* mutex not needed */,
+ 1 /* wait for start */,
+ active_mi,master_info_file,relay_log_info_file,
+ restart_thread_mask);
}
err:
diff --git a/sql/repl_failsafe.h b/sql/repl_failsafe.h
index 77bc03ce8c0..ef1dc1f8778 100644
--- a/sql/repl_failsafe.h
+++ b/sql/repl_failsafe.h
@@ -14,7 +14,6 @@ extern RPL_STATUS rpl_status;
extern pthread_mutex_t LOCK_rpl_status;
extern pthread_cond_t COND_rpl_status;
extern TYPELIB rpl_role_typelib, rpl_status_typelib;
-extern uint rpl_recovery_rank;
extern const char* rpl_role_type[], *rpl_status_type[];
pthread_handler_decl(handle_failsafe_rpl,arg);
diff --git a/sql/set_var.cc b/sql/set_var.cc
new file mode 100644
index 00000000000..3c71d1d32e3
--- /dev/null
+++ b/sql/set_var.cc
@@ -0,0 +1,1357 @@
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
+ Handling of MySQL SQL variables
+
+ To add a new variable, one has to do the following:
+
+ - If the variable is thread specific, add it to 'system_variables' struct.
+ If not, add it to mysqld.cc and an declaration in 'mysql_priv.h'
+ - Use one of the 'sys_var... classes from set_var.h or write a specific
+ one for the variable type.
+ - Define it in the 'variable definition list' in this file.
+ - If the variable should be changeable, it should be added to the
+ 'list of all variables' list in this file.
+ - If the variable should be changed from the command line, add a definition
+ of it in the my_option structure list in mysqld.dcc
+ - If the variable should show up in 'show variables' add it to the
+ init_vars[] struct in this file
+
+ TODO:
+ - Add full support for the variable character_set (for 4.1)
+
+ - When updating myisam_delay_key_write, we should do a 'flush tables'
+ of all MyISAM tables to ensure that they are reopen with the
+ new attribute.
+*/
+
+#ifdef __GNUC__
+#pragma implementation // gcc: Class implementation
+#endif
+
+#include "mysql_priv.h"
+#include "slave.h"
+#include "sql_acl.h"
+#include <my_getopt.h>
+#include <myisam.h>
+#ifdef HAVE_BERKELEY_DB
+#include "ha_berkeley.h"
+#endif
+#ifdef HAVE_INNOBASE_DB
+#include "ha_innodb.h"
+#endif
+
+static HASH system_variable_hash;
+const char *bool_type_names[]= { "OFF", "ON", NullS };
+TYPELIB bool_typelib=
+{
+ array_elements(bool_type_names)-1, "", bool_type_names
+};
+
+const char *delay_key_write_type_names[]= { "OFF", "ON", "ALL", NullS };
+TYPELIB delay_key_write_typelib=
+{
+ array_elements(delay_key_write_type_names)-1, "", delay_key_write_type_names
+};
+
+static bool sys_check_charset(THD *thd, set_var *var);
+static bool sys_update_charset(THD *thd, set_var *var);
+static void sys_set_default_charset(THD *thd, enum_var_type type);
+static bool set_option_bit(THD *thd, set_var *var);
+static bool set_option_autocommit(THD *thd, set_var *var);
+static bool set_log_update(THD *thd, set_var *var);
+static void fix_low_priority_updates(THD *thd, enum_var_type type);
+static void fix_tx_isolation(THD *thd, enum_var_type type);
+static void fix_net_read_timeout(THD *thd, enum_var_type type);
+static void fix_net_write_timeout(THD *thd, enum_var_type type);
+static void fix_net_retry_count(THD *thd, enum_var_type type);
+static void fix_max_join_size(THD *thd, enum_var_type type);
+static void fix_query_cache_size(THD *thd, enum_var_type type);
+static void fix_key_buffer_size(THD *thd, enum_var_type type);
+
+/*
+ Variable definition list
+
+ These are variables that can be set from the command line, in
+ alphabetic order
+*/
+
+sys_var_long_ptr sys_binlog_cache_size("binlog_cache_size",
+ &binlog_cache_size);
+sys_var_thd_ulong sys_bulk_insert_buff_size("bulk_insert_buffer_size",
+ &SV::bulk_insert_buff_size);
+sys_var_str sys_charset("character_set",
+ sys_check_charset,
+ sys_update_charset,
+ sys_set_default_charset);
+sys_var_thd_conv_charset sys_convert_charset("convert_character_set");
+sys_var_bool_ptr sys_concurrent_insert("concurrent_insert",
+ &myisam_concurrent_insert);
+sys_var_long_ptr sys_connect_timeout("connect_timeout",
+ &connect_timeout);
+sys_var_enum sys_delay_key_write("delay_key_write",
+ &delay_key_write_options,
+ &delay_key_write_typelib,
+ fix_delay_key_write);
+sys_var_long_ptr sys_delayed_insert_limit("delayed_insert_limit",
+ &delayed_insert_limit);
+sys_var_long_ptr sys_delayed_insert_timeout("delayed_insert_timeout",
+ &delayed_insert_timeout);
+sys_var_long_ptr sys_delayed_queue_size("delayed_queue_size",
+ &delayed_queue_size);
+sys_var_bool_ptr sys_flush("flush", &myisam_flush);
+sys_var_long_ptr sys_flush_time("flush_time", &flush_time);
+sys_var_thd_ulong sys_interactive_timeout("interactive_timeout",
+ &SV::net_interactive_timeout);
+sys_var_thd_ulong sys_join_buffer_size("join_buffer_size",
+ &SV::join_buff_size);
+sys_var_long_ptr sys_key_buffer_size("key_buffer_size",
+ &keybuff_size,
+ fix_key_buffer_size);
+sys_var_bool_ptr sys_local_infile("local_infile",
+ &opt_local_infile);
+sys_var_thd_bool sys_log_warnings("log_warnings", &SV::log_warnings);
+sys_var_thd_ulong sys_long_query_time("long_query_time",
+ &SV::long_query_time);
+sys_var_thd_bool sys_low_priority_updates("low_priority_updates",
+ &SV::low_priority_updates,
+ fix_low_priority_updates);
+#ifndef TO_BE_DELETED /* Alias for the low_priority_updates */
+sys_var_thd_bool sys_sql_low_priority_updates("sql_low_priority_updates",
+ &SV::low_priority_updates,
+ fix_low_priority_updates);
+#endif
+sys_var_thd_ulong sys_max_allowed_packet("max_allowed_packet",
+ &SV::max_allowed_packet);
+sys_var_long_ptr sys_max_binlog_cache_size("max_binlog_cache_size",
+ &max_binlog_cache_size);
+sys_var_long_ptr sys_max_binlog_size("max_binlog_size",
+ &max_binlog_size);
+sys_var_long_ptr sys_max_connections("max_connections",
+ &max_connections);
+sys_var_long_ptr sys_max_connect_errors("max_connect_errors",
+ &max_connect_errors);
+sys_var_long_ptr sys_max_delayed_threads("max_delayed_threads",
+ &max_insert_delayed_threads);
+sys_var_thd_ulong sys_max_heap_table_size("max_heap_table_size",
+ &SV::max_heap_table_size);
+sys_var_thd_ulong sys_max_join_size("max_join_size",
+ &SV::max_join_size,
+ fix_max_join_size);
+#ifndef TO_BE_DELETED /* Alias for max_join_size */
+sys_var_thd_ulong sys_sql_max_join_size("sql_max_join_size",
+ &SV::max_join_size,
+ fix_max_join_size);
+#endif
+sys_var_thd_ulong sys_max_sort_length("max_sort_length",
+ &SV::max_sort_length);
+sys_var_long_ptr sys_max_user_connections("max_user_connections",
+ &max_user_connections);
+sys_var_thd_ulong sys_max_tmp_tables("max_tmp_tables",
+ &SV::max_tmp_tables);
+sys_var_long_ptr sys_max_write_lock_count("max_write_lock_count",
+ &max_write_lock_count);
+sys_var_thd_ulonglong sys_myisam_max_extra_sort_file_size("myisam_max_extra_sort_file_size", &SV::myisam_max_extra_sort_file_size);
+sys_var_thd_ulonglong sys_myisam_max_sort_file_size("myisam_max_sort_file_size", &SV::myisam_max_sort_file_size);
+sys_var_thd_ulong sys_myisam_sort_buffer_size("myisam_sort_buffer_size", &SV::myisam_sort_buff_size);
+sys_var_thd_ulong sys_net_buffer_length("net_buffer_length",
+ &SV::net_buffer_length);
+sys_var_thd_ulong sys_net_read_timeout("net_read_timeout",
+ &SV::net_read_timeout,
+ fix_net_read_timeout);
+sys_var_thd_ulong sys_net_write_timeout("net_write_timeout",
+ &SV::net_write_timeout,
+ fix_net_write_timeout);
+sys_var_thd_ulong sys_net_retry_count("net_retry_count",
+ &SV::net_retry_count,
+ fix_net_retry_count);
+sys_var_thd_ulong sys_read_buff_size("read_buffer_size",
+ &SV::read_buff_size);
+sys_var_thd_ulong sys_read_rnd_buff_size("read_rnd_buffer_size",
+ &SV::read_rnd_buff_size);
+sys_var_long_ptr sys_rpl_recovery_rank("rpl_recovery_rank",
+ &rpl_recovery_rank);
+sys_var_long_ptr sys_query_cache_size("query_cache_size",
+ &query_cache_size,
+ fix_query_cache_size);
+#ifdef HAVE_QUERY_CACHE
+sys_var_long_ptr sys_query_cache_limit("query_cache_limit",
+ &query_cache.query_cache_limit);
+sys_var_thd_enum sys_query_cache_type("query_cache_type",
+ &SV::query_cache_type,
+ &query_cache_type_typelib);
+#endif /* HAVE_QUERY_CACHE */
+sys_var_bool_ptr sys_safe_show_db("safe_show_database",
+ &opt_safe_show_db);
+sys_var_long_ptr sys_server_id("server_id",&server_id);
+sys_var_bool_ptr sys_slave_compressed_protocol("slave_compressed_protocol",
+ &opt_slave_compressed_protocol);
+sys_var_long_ptr sys_slave_net_timeout("slave_net_timeout",
+ &slave_net_timeout);
+sys_var_long_ptr sys_slow_launch_time("slow_launch_time",
+ &slow_launch_time);
+sys_var_thd_ulong sys_sort_buffer("sort_buffer_size",
+ &SV::sortbuff_size);
+sys_var_thd_enum sys_table_type("table_type", &SV::table_type,
+ &ha_table_typelib);
+sys_var_long_ptr sys_table_cache_size("table_cache",
+ &table_cache_size);
+sys_var_long_ptr sys_thread_cache_size("thread_cache_size",
+ &thread_cache_size);
+sys_var_thd_enum sys_tx_isolation("tx_isolation",
+ &SV::tx_isolation,
+ &tx_isolation_typelib,
+ fix_tx_isolation);
+sys_var_thd_ulong sys_tmp_table_size("tmp_table_size",
+ &SV::tmp_table_size);
+sys_var_thd_ulong sys_net_wait_timeout("wait_timeout",
+ &SV::net_wait_timeout);
+
+
+/*
+ Variables that are bits in THD
+*/
+
+static sys_var_thd_bit sys_autocommit("autocommit",
+ set_option_autocommit,
+ OPTION_NOT_AUTOCOMMIT,
+ 1);
+static sys_var_thd_bit sys_big_tables("big_tables",
+ set_option_bit,
+ OPTION_BIG_TABLES);
+#ifndef TO_BE_DELETED /* Alias for big_tables */
+static sys_var_thd_bit sys_sql_big_tables("sql_big_tables",
+ set_option_bit,
+ OPTION_BIG_TABLES);
+#endif
+static sys_var_thd_bit sys_big_selects("sql_big_selects",
+ set_option_bit,
+ OPTION_BIG_TABLES);
+static sys_var_thd_bit sys_log_off("sql_log_off",
+ set_option_bit,
+ OPTION_LOG_OFF);
+static sys_var_thd_bit sys_log_update("sql_log_update",
+ set_log_update,
+ OPTION_UPDATE_LOG);
+static sys_var_thd_bit sys_log_binlog("sql_log_bin",
+ set_log_update,
+ OPTION_BIN_LOG);
+static sys_var_thd_bit sys_sql_warnings("sql_warnings",
+ set_option_bit,
+ OPTION_WARNINGS);
+static sys_var_thd_bit sys_auto_is_null("sql_auto_is_null",
+ set_option_bit,
+ OPTION_AUTO_IS_NULL);
+static sys_var_thd_bit sys_safe_updates("sql_safe_updates",
+ set_option_bit,
+ OPTION_SAFE_UPDATES);
+static sys_var_thd_bit sys_buffer_results("sql_buffer_result",
+ set_option_bit,
+ OPTION_BUFFER_RESULT);
+static sys_var_thd_bit sys_quote_show_create("sql_quote_show_create",
+ set_option_bit,
+ OPTION_QUOTE_SHOW_CREATE);
+static sys_var_thd_bit sys_foreign_key_checks("foreign_key_checks",
+ set_option_bit,
+ OPTION_NO_FOREIGN_KEY_CHECKS,
+ 1);
+static sys_var_thd_bit sys_unique_checks("unique_checks",
+ set_option_bit,
+ OPTION_RELAXED_UNIQUE_CHECKS,
+ 1);
+
+
+/* Local state variables */
+
+static sys_var_thd_ulong sys_select_limit("sql_select_limit",
+ &SV::select_limit);
+static sys_var_timestamp sys_timestamp("timestamp");
+static sys_var_last_insert_id sys_last_insert_id("last_insert_id");
+static sys_var_last_insert_id sys_identity("identity");
+static sys_var_insert_id sys_insert_id("insert_id");
+/* alias for last_insert_id() to be compatible with Sybase */
+static sys_var_slave_skip_counter sys_slave_skip_counter("sql_slave_skip_counter");
+
+
+/*
+ List of all variables for initialisation and storage in hash
+ This is sorted in alphabetical order to make it easy to add new variables
+
+ If the variable is not in this list, it can't be changed with
+ SET variable_name=
+*/
+
+sys_var *sys_variables[]=
+{
+ &sys_auto_is_null,
+ &sys_autocommit,
+ &sys_big_tables,
+ &sys_big_selects,
+ &sys_binlog_cache_size,
+ &sys_buffer_results,
+ &sys_bulk_insert_buff_size,
+ &sys_concurrent_insert,
+ &sys_connect_timeout,
+ &sys_convert_charset,
+ &sys_delay_key_write,
+ &sys_delayed_insert_limit,
+ &sys_delayed_insert_timeout,
+ &sys_delayed_queue_size,
+ &sys_flush,
+ &sys_flush_time,
+ &sys_foreign_key_checks,
+ &sys_identity,
+ &sys_insert_id,
+ &sys_interactive_timeout,
+ &sys_join_buffer_size,
+ &sys_key_buffer_size,
+ &sys_last_insert_id,
+ &sys_local_infile,
+ &sys_log_binlog,
+ &sys_log_off,
+ &sys_log_update,
+ &sys_log_warnings,
+ &sys_long_query_time,
+ &sys_low_priority_updates,
+ &sys_max_allowed_packet,
+ &sys_max_binlog_cache_size,
+ &sys_max_binlog_size,
+ &sys_max_connect_errors,
+ &sys_max_connections,
+ &sys_max_delayed_threads,
+ &sys_max_heap_table_size,
+ &sys_max_join_size,
+ &sys_max_sort_length,
+ &sys_max_tmp_tables,
+ &sys_max_user_connections,
+ &sys_max_write_lock_count,
+ &sys_myisam_max_extra_sort_file_size,
+ &sys_myisam_max_sort_file_size,
+ &sys_myisam_sort_buffer_size,
+ &sys_net_buffer_length,
+ &sys_net_read_timeout,
+ &sys_net_retry_count,
+ &sys_net_wait_timeout,
+ &sys_net_write_timeout,
+ &sys_query_cache_size,
+#ifdef HAVE_QUERY_CACHE
+ &sys_query_cache_limit,
+ &sys_query_cache_type,
+#endif /* HAVE_QUERY_CACHE */
+ &sys_quote_show_create,
+ &sys_read_buff_size,
+ &sys_read_rnd_buff_size,
+ &sys_rpl_recovery_rank,
+ &sys_safe_show_db,
+ &sys_safe_updates,
+ &sys_select_limit,
+ &sys_server_id,
+ &sys_slave_compressed_protocol,
+ &sys_slave_net_timeout,
+ &sys_slave_skip_counter,
+ &sys_slow_launch_time,
+ &sys_sort_buffer,
+ &sys_sql_big_tables,
+ &sys_sql_low_priority_updates,
+ &sys_sql_max_join_size,
+ &sys_sql_warnings,
+ &sys_table_cache_size,
+ &sys_table_type,
+ &sys_thread_cache_size,
+ &sys_timestamp,
+ &sys_tmp_table_size,
+ &sys_tx_isolation,
+ &sys_unique_checks
+};
+
+
+/*
+ Variables shown by SHOW variables in alphabetical order
+*/
+
+struct show_var_st init_vars[]= {
+ {"back_log", (char*) &back_log, SHOW_LONG},
+ {"basedir", mysql_home, SHOW_CHAR},
+#ifdef HAVE_BERKELEY_DB
+ {"bdb_cache_size", (char*) &berkeley_cache_size, SHOW_LONG},
+ {"bdb_log_buffer_size", (char*) &berkeley_log_buffer_size, SHOW_LONG},
+ {"bdb_home", (char*) &berkeley_home, SHOW_CHAR_PTR},
+ {"bdb_max_lock", (char*) &berkeley_max_lock, SHOW_LONG},
+ {"bdb_logdir", (char*) &berkeley_logdir, SHOW_CHAR_PTR},
+ {"bdb_shared_data", (char*) &berkeley_shared_data, SHOW_BOOL},
+ {"bdb_tmpdir", (char*) &berkeley_tmpdir, SHOW_CHAR_PTR},
+ {"bdb_version", (char*) DB_VERSION_STRING, SHOW_CHAR},
+#endif
+ {sys_binlog_cache_size.name,(char*) &sys_binlog_cache_size, SHOW_SYS},
+ {sys_bulk_insert_buff_size.name,(char*) &sys_bulk_insert_buff_size,SHOW_SYS},
+ {sys_charset.name, (char*) &sys_charset, SHOW_SYS},
+ {"character_sets", (char*) &charsets_list, SHOW_CHAR_PTR},
+ {sys_concurrent_insert.name,(char*) &sys_concurrent_insert, SHOW_SYS},
+ {sys_connect_timeout.name, (char*) &sys_connect_timeout, SHOW_SYS},
+ {sys_convert_charset.name, (char*) &sys_convert_charset, SHOW_SYS},
+ {"datadir", mysql_real_data_home, SHOW_CHAR},
+ {sys_delay_key_write.name, (char*) &sys_delay_key_write, SHOW_SYS},
+ {sys_delayed_insert_limit.name, (char*) &sys_delayed_insert_limit,SHOW_SYS},
+ {sys_delayed_insert_timeout.name, (char*) &sys_delayed_insert_timeout, SHOW_SYS},
+ {sys_delayed_queue_size.name,(char*) &sys_delayed_queue_size, SHOW_SYS},
+ {sys_flush.name, (char*) &sys_flush, SHOW_SYS},
+ {sys_flush_time.name, (char*) &sys_flush_time, SHOW_SYS},
+ {"ft_min_word_len", (char*) &ft_min_word_len, SHOW_LONG},
+ {"ft_max_word_len", (char*) &ft_max_word_len, SHOW_LONG},
+ {"ft_max_word_len_for_sort",(char*) &ft_max_word_len_for_sort, SHOW_LONG},
+ {"ft_boolean_syntax", (char*) ft_boolean_syntax, SHOW_CHAR},
+ {"have_bdb", (char*) &have_berkeley_db, SHOW_HAVE},
+ {"have_innodb", (char*) &have_innodb, SHOW_HAVE},
+ {"have_isam", (char*) &have_isam, SHOW_HAVE},
+ {"have_raid", (char*) &have_raid, SHOW_HAVE},
+ {"have_symlink", (char*) &have_symlink, SHOW_HAVE},
+ {"have_openssl", (char*) &have_openssl, SHOW_HAVE},
+ {"have_query_cache", (char*) &have_query_cache, SHOW_HAVE},
+ {"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR},
+#ifdef HAVE_INNOBASE_DB
+ {"innodb_additional_mem_pool_size", (char*) &innobase_additional_mem_pool_size, SHOW_LONG },
+ {"innodb_buffer_pool_size", (char*) &innobase_buffer_pool_size, SHOW_LONG },
+ {"innodb_data_file_path", (char*) &innobase_data_file_path, SHOW_CHAR_PTR},
+ {"innodb_data_home_dir", (char*) &innobase_data_home_dir, SHOW_CHAR_PTR},
+ {"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG },
+ {"innodb_force_recovery", (char*) &innobase_force_recovery, SHOW_LONG },
+ {"innodb_thread_concurrency", (char*) &innobase_thread_concurrency, SHOW_LONG },
+ {"innodb_flush_log_at_trx_commit", (char*) &innobase_flush_log_at_trx_commit, SHOW_LONG},
+ {"innodb_fast_shutdown", (char*) &innobase_fast_shutdown, SHOW_MY_BOOL},
+ {"innodb_flush_method", (char*) &innobase_unix_file_flush_method, SHOW_CHAR_PTR},
+ {"innodb_lock_wait_timeout", (char*) &innobase_lock_wait_timeout, SHOW_LONG },
+ {"innodb_log_arch_dir", (char*) &innobase_log_arch_dir, SHOW_CHAR_PTR},
+ {"innodb_log_archive", (char*) &innobase_log_archive, SHOW_MY_BOOL},
+ {"innodb_log_buffer_size", (char*) &innobase_log_buffer_size, SHOW_LONG },
+ {"innodb_log_file_size", (char*) &innobase_log_file_size, SHOW_LONG},
+ {"innodb_log_files_in_group", (char*) &innobase_log_files_in_group, SHOW_LONG},
+ {"innodb_log_group_home_dir", (char*) &innobase_log_group_home_dir, SHOW_CHAR_PTR},
+ {"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG},
+#endif
+ {sys_interactive_timeout.name,(char*) &sys_interactive_timeout, SHOW_SYS},
+ {sys_join_buffer_size.name, (char*) &sys_join_buffer_size, SHOW_SYS},
+ {sys_key_buffer_size.name, (char*) &sys_key_buffer_size, SHOW_SYS},
+ {"language", language, SHOW_CHAR},
+ {"large_files_support", (char*) &opt_large_files, SHOW_BOOL},
+ {sys_local_infile.name, (char*) &sys_local_infile, SHOW_SYS},
+#ifdef HAVE_MLOCKALL
+ {"locked_in_memory", (char*) &locked_in_memory, SHOW_BOOL},
+#endif
+ {"log", (char*) &opt_log, SHOW_BOOL},
+ {"log_update", (char*) &opt_update_log, SHOW_BOOL},
+ {"log_bin", (char*) &opt_bin_log, SHOW_BOOL},
+ {"log_slave_updates", (char*) &opt_log_slave_updates, SHOW_BOOL},
+ {"log_slow_queries", (char*) &opt_slow_log, SHOW_BOOL},
+ {sys_log_warnings.name, (char*) &sys_log_warnings, SHOW_SYS},
+ {sys_long_query_time.name, (char*) &sys_long_query_time, SHOW_SYS},
+ {sys_low_priority_updates.name, (char*) &sys_low_priority_updates, SHOW_SYS},
+ {"lower_case_table_names", (char*) &lower_case_table_names, SHOW_MY_BOOL},
+ {sys_max_allowed_packet.name,(char*) &sys_max_allowed_packet, SHOW_SYS},
+ {sys_max_binlog_cache_size.name,(char*) &sys_max_binlog_cache_size, SHOW_SYS},
+ {sys_max_binlog_size.name, (char*) &sys_max_binlog_size, SHOW_SYS},
+ {sys_max_connections.name, (char*) &sys_max_connections, SHOW_SYS},
+ {sys_max_connect_errors.name, (char*) &sys_max_connect_errors, SHOW_SYS},
+ {sys_max_delayed_threads.name,(char*) &sys_max_delayed_threads, SHOW_SYS},
+ {sys_max_heap_table_size.name,(char*) &sys_max_heap_table_size, SHOW_SYS},
+ {sys_max_join_size.name, (char*) &sys_max_join_size, SHOW_SYS},
+ {sys_max_sort_length.name, (char*) &sys_max_sort_length, SHOW_SYS},
+ {sys_max_user_connections.name,(char*) &sys_max_user_connections, SHOW_SYS},
+ {sys_max_tmp_tables.name, (char*) &sys_max_tmp_tables, SHOW_SYS},
+ {sys_max_write_lock_count.name, (char*) &sys_max_write_lock_count,SHOW_SYS},
+ {sys_myisam_max_extra_sort_file_size.name,
+ (char*) &sys_myisam_max_extra_sort_file_size,
+ SHOW_SYS},
+ {sys_myisam_max_sort_file_size.name,
+ (char*) &sys_myisam_max_sort_file_size,
+ SHOW_SYS},
+ {"myisam_recover_options", (char*) &myisam_recover_options_str, SHOW_CHAR_PTR},
+ {sys_myisam_sort_buffer_size.name, (char*) &sys_myisam_sort_buffer_size, SHOW_SYS},
+#ifdef __NT__
+ {"named_pipe", (char*) &opt_enable_named_pipe, SHOW_BOOL},
+#endif
+ {sys_net_buffer_length.name,(char*) &sys_net_buffer_length, SHOW_SYS},
+ {sys_net_read_timeout.name, (char*) &sys_net_read_timeout, SHOW_SYS},
+ {sys_net_retry_count.name, (char*) &sys_net_retry_count, SHOW_SYS},
+ {sys_net_write_timeout.name,(char*) &sys_net_write_timeout, SHOW_SYS},
+ {"open_files_limit", (char*) &open_files_limit, SHOW_LONG},
+ {"pid_file", (char*) pidfile_name, SHOW_CHAR},
+ {"port", (char*) &mysql_port, SHOW_INT},
+ {"protocol_version", (char*) &protocol_version, SHOW_INT},
+ {sys_read_buff_size.name, (char*) &sys_read_buff_size, SHOW_SYS},
+ {sys_read_rnd_buff_size.name,(char*) &sys_read_rnd_buff_size, SHOW_SYS},
+ {sys_rpl_recovery_rank.name,(char*) &sys_rpl_recovery_rank, SHOW_SYS},
+#ifdef HAVE_QUERY_CACHE
+ {sys_query_cache_limit.name,(char*) &sys_query_cache_limit, SHOW_SYS},
+ {sys_query_cache_size.name, (char*) &sys_query_cache_size, SHOW_SYS},
+ {sys_query_cache_type.name, (char*) &sys_query_cache_type, SHOW_SYS},
+#endif /* HAVE_QUERY_CACHE */
+ {sys_safe_show_db.name, (char*) &sys_safe_show_db, SHOW_SYS},
+ {sys_server_id.name, (char*) &sys_server_id, SHOW_SYS},
+ {sys_slave_net_timeout.name,(char*) &sys_slave_net_timeout, SHOW_SYS},
+ {"skip_external_locking", (char*) &my_disable_locking, SHOW_MY_BOOL},
+ {"skip_networking", (char*) &opt_disable_networking, SHOW_BOOL},
+ {"skip_show_database", (char*) &opt_skip_show_db, SHOW_BOOL},
+ {sys_slow_launch_time.name, (char*) &sys_slow_launch_time, SHOW_SYS},
+ {"socket", (char*) &mysql_unix_port, SHOW_CHAR_PTR},
+ {sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS},
+ {"sql_mode", (char*) &opt_sql_mode, SHOW_LONG},
+ {"table_cache", (char*) &table_cache_size, SHOW_LONG},
+ {sys_table_type.name, (char*) &sys_table_type, SHOW_SYS},
+ {sys_thread_cache_size.name,(char*) &sys_thread_cache_size, SHOW_SYS},
+#ifdef HAVE_THR_SETCONCURRENCY
+ {"thread_concurrency", (char*) &concurrency, SHOW_LONG},
+#endif
+ {"thread_stack", (char*) &thread_stack, SHOW_LONG},
+ {sys_tx_isolation.name, (char*) &sys_tx_isolation, SHOW_SYS},
+#ifdef HAVE_TZNAME
+ {"timezone", time_zone, SHOW_CHAR},
+#endif
+ {sys_tmp_table_size.name, (char*) &sys_tmp_table_size, SHOW_SYS},
+ {"tmpdir", (char*) &mysql_tmpdir, SHOW_CHAR_PTR},
+ {"version", server_version, SHOW_CHAR},
+ {sys_net_wait_timeout.name, (char*) &sys_net_wait_timeout, SHOW_SYS},
+ {NullS, NullS, SHOW_LONG}
+};
+
+/*
+ Functions to check and update variables
+*/
+
+/*
+ The following 3 functions need to be changed in 4.1 when we allow
+ one to change character sets
+*/
+
+static bool sys_check_charset(THD *thd, set_var *var)
+{
+ return 0;
+}
+
+
+static bool sys_update_charset(THD *thd, set_var *var)
+{
+ return 0;
+}
+
+
+static void sys_set_default_charset(THD *thd, enum_var_type type)
+{
+}
+
+
+/*
+ If one sets the LOW_PRIORIY UPDATES flag, we also must change the
+ used lock type
+*/
+
+static void fix_low_priority_updates(THD *thd, enum_var_type type)
+{
+ if (type != OPT_GLOBAL)
+ thd->update_lock_default= (thd->variables.low_priority_updates ?
+ TL_WRITE_LOW_PRIORITY : TL_WRITE);
+}
+
+
+/*
+ Set the OPTION_BIG_SELECTS flag if max_join_size == HA_POS_ERROR
+*/
+
+static void fix_max_join_size(THD *thd, enum_var_type type)
+{
+ if (type != OPT_GLOBAL)
+ {
+ if (thd->variables.max_join_size == (ulong) HA_POS_ERROR)
+ thd->options|= OPTION_BIG_SELECTS;
+ else
+ thd->options&= ~OPTION_BIG_SELECTS;
+ }
+}
+
+
+/*
+ If one doesn't use the SESSION modifier, the isolation level
+ is only active for the next command
+*/
+
+static void fix_tx_isolation(THD *thd, enum_var_type type)
+{
+ if (type == OPT_SESSION)
+ thd->session_tx_isolation= ((enum_tx_isolation)
+ thd->variables.tx_isolation);
+}
+
+
+/*
+ If we are changing the thread variable, we have to copy it to NET too
+*/
+
+static void fix_net_read_timeout(THD *thd, enum_var_type type)
+{
+ if (type != OPT_GLOBAL)
+ thd->net.read_timeout=thd->variables.net_read_timeout;
+}
+
+
+static void fix_net_write_timeout(THD *thd, enum_var_type type)
+{
+ if (type != OPT_GLOBAL)
+ thd->net.write_timeout=thd->variables.net_write_timeout;
+}
+
+static void fix_net_retry_count(THD *thd, enum_var_type type)
+{
+ if (type != OPT_GLOBAL)
+ thd->net.retry_count=thd->variables.net_retry_count;
+}
+
+
+static void fix_query_cache_size(THD *thd, enum_var_type type)
+{
+#ifdef HAVE_QUERY_CACHE
+ query_cache.resize(query_cache_size);
+#endif
+}
+
+
+static void fix_key_buffer_size(THD *thd, enum_var_type type)
+{
+ ha_resize_key_cache();
+}
+
+
+void fix_delay_key_write(THD *thd, enum_var_type type)
+{
+ switch ((enum_delay_key_write) delay_key_write_options) {
+ case DELAY_KEY_WRITE_NONE:
+ myisam_delay_key_write=0;
+ break;
+ case DELAY_KEY_WRITE_ON:
+ myisam_delay_key_write=1;
+ break;
+ case DELAY_KEY_WRITE_ALL:
+ myisam_delay_key_write=1;
+ ha_open_options|= HA_OPEN_DELAY_KEY_WRITE;
+ break;
+ }
+}
+
+
+bool sys_var_long_ptr::update(THD *thd, set_var *var)
+{
+ ulonglong tmp= var->value->val_int();
+ if (option_limits)
+ *value= (ulong) getopt_ull_limit_value(tmp, option_limits);
+ else
+ *value= (ulong) tmp;
+ return 0;
+}
+
+
+void sys_var_long_ptr::set_default(THD *thd, enum_var_type type)
+{
+ *value= (ulong) option_limits->def_value;
+}
+
+
+bool sys_var_bool_ptr::update(THD *thd, set_var *var)
+{
+ *value= (my_bool) var->save_result.ulong_value;
+ return 0;
+}
+
+
+void sys_var_bool_ptr::set_default(THD *thd, enum_var_type type)
+{
+ *value= (my_bool) option_limits->def_value;
+}
+
+
+bool sys_var_enum::update(THD *thd, set_var *var)
+{
+ *value= (uint) var->save_result.ulong_value;
+ return 0;
+}
+
+
+byte *sys_var_enum::value_ptr(THD *thd, enum_var_type type)
+{
+ return (byte*) enum_names->type_names[*value];
+}
+
+
+bool sys_var_thd_ulong::update(THD *thd, set_var *var)
+{
+ ulonglong tmp= var->value->val_int();
+
+ /* Don't use bigger value than given with --maximum-variable-name=.. */
+ if ((ulong) tmp > max_system_variables.*offset)
+ tmp= max_system_variables.*offset;
+
+ if (option_limits)
+ tmp= (ulong) getopt_ull_limit_value(tmp, option_limits);
+ if (var->type == OPT_GLOBAL)
+ {
+ /* Lock is needed to make things safe on 32 bit systems */
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ global_system_variables.*offset= (ulong) tmp;
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ }
+ else
+ thd->variables.*offset= (ulong) tmp;
+ return 0;
+}
+
+
+void sys_var_thd_ulong::set_default(THD *thd, enum_var_type type)
+{
+ if (type == OPT_GLOBAL)
+ {
+ /* We will not come here if option_limits is not set */
+ global_system_variables.*offset= (ulong) option_limits->def_value;
+ }
+ else
+ thd->variables.*offset= global_system_variables.*offset;
+}
+
+
+byte *sys_var_thd_ulong::value_ptr(THD *thd, enum_var_type type)
+{
+ if (type == OPT_GLOBAL)
+ return (byte*) &(global_system_variables.*offset);
+ return (byte*) &(thd->variables.*offset);
+}
+
+
+bool sys_var_thd_ulonglong::update(THD *thd, set_var *var)
+{
+ if (var->type == OPT_GLOBAL)
+ global_system_variables.*offset= var->value->val_int();
+ else
+ thd->variables.*offset= var->value->val_int();
+ return 0;
+}
+
+
+void sys_var_thd_ulonglong::set_default(THD *thd, enum_var_type type)
+{
+ if (type == OPT_GLOBAL)
+ global_system_variables.*offset= (ulong) option_limits->def_value;
+ else
+ thd->variables.*offset= global_system_variables.*offset;
+}
+
+
+byte *sys_var_thd_ulonglong::value_ptr(THD *thd, enum_var_type type)
+{
+ if (type == OPT_GLOBAL)
+ return (byte*) &(global_system_variables.*offset);
+ return (byte*) &(thd->variables.*offset);
+}
+
+
+bool sys_var_thd_bool::update(THD *thd, set_var *var)
+{
+ if (var->type == OPT_GLOBAL)
+ global_system_variables.*offset= (my_bool) var->save_result.ulong_value;
+ else
+ thd->variables.*offset= (my_bool) var->save_result.ulong_value;
+ return 0;
+}
+
+
+void sys_var_thd_bool::set_default(THD *thd, enum_var_type type)
+{
+ if (type == OPT_GLOBAL)
+ global_system_variables.*offset= (my_bool) option_limits->def_value;
+ else
+ thd->variables.*offset= global_system_variables.*offset;
+}
+
+
+byte *sys_var_thd_bool::value_ptr(THD *thd, enum_var_type type)
+{
+ if (type == OPT_GLOBAL)
+ return (byte*) &(global_system_variables.*offset);
+ return (byte*) &(thd->variables.*offset);
+}
+
+
+bool sys_var::check_enum(THD *thd, set_var *var, TYPELIB *enum_names)
+{
+ char buff[80], *value;
+ String str(buff,sizeof(buff)), *res;
+
+ if (var->value->result_type() == STRING_RESULT)
+ {
+ if (!(res=var->value->val_str(&str)) ||
+ ((long) (var->save_result.ulong_value=
+ (ulong) find_type(res->c_ptr(), enum_names, 3)-1))
+ < 0)
+ {
+ value=res->c_ptr();
+ goto err;
+ }
+ }
+ else
+ {
+ ulonglong tmp=var->value->val_int();
+ if (tmp >= enum_names->count)
+ {
+ llstr(tmp,buff);
+ value=buff; // Wrong value is here
+ goto err;
+ }
+ var->save_result.ulong_value= (ulong) tmp; // Save for update
+ }
+ return 0;
+
+err:
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, value);
+ return 1;
+}
+
+/*
+ Return an Item for a variable. Used with @@[global.]variable_name
+
+ If type is not given, return local value if exists, else global
+
+ We have to use netprintf() instead of my_error() here as this is
+ called on the parsing stage.
+*/
+
+Item *sys_var::item(THD *thd, enum_var_type var_type)
+{
+ if (check_type(var_type))
+ {
+ if (var_type != OPT_DEFAULT)
+ {
+ net_printf(&thd->net,
+ var_type == OPT_GLOBAL ? ER_LOCAL_VARIABLE :
+ ER_GLOBAL_VARIABLE, name);
+ return 0;
+ }
+ /* As there was no local variable, return the global value */
+ var_type= OPT_GLOBAL;
+ }
+ switch (type()) {
+ case SHOW_LONG:
+ return new Item_uint((int32) *(ulong*) value_ptr(thd, var_type));
+ case SHOW_LONGLONG:
+ return new Item_int(*(longlong*) value_ptr(thd, var_type));
+ case SHOW_MY_BOOL:
+ return new Item_int((int32) *(my_bool*) value_ptr(thd, var_type),1);
+ case SHOW_CHAR:
+ {
+ char *str= (char*) value_ptr(thd, var_type);
+ return new Item_string(str,strlen(str));
+ }
+ default:
+ net_printf(&thd->net, ER_VAR_CANT_BE_READ, name);
+ }
+ return 0;
+}
+
+
+bool sys_var_thd_enum::update(THD *thd, set_var *var)
+{
+ if (var->type == OPT_GLOBAL)
+ global_system_variables.*offset= var->save_result.ulong_value;
+ else
+ thd->variables.*offset= var->save_result.ulong_value;
+ return 0;
+}
+
+
+void sys_var_thd_enum::set_default(THD *thd, enum_var_type type)
+{
+ if (type == OPT_GLOBAL)
+ global_system_variables.*offset= (ulong) option_limits->def_value;
+ else
+ thd->variables.*offset= global_system_variables.*offset;
+}
+
+
+byte *sys_var_thd_enum::value_ptr(THD *thd, enum_var_type type)
+{
+ ulong tmp= ((type == OPT_GLOBAL) ?
+ global_system_variables.*offset :
+ thd->variables.*offset);
+ return (byte*) enum_names->type_names[tmp];
+}
+
+
+bool sys_var_thd_bit::update(THD *thd, set_var *var)
+{
+ bool res= (*update_func)(thd, var);
+ thd->lex.select_lex.options=thd->options;
+ return res;
+}
+
+
+byte *sys_var_thd_bit::value_ptr(THD *thd, enum_var_type type)
+{
+ /*
+ If reverse is 0 (default) return 1 if bit is set.
+ If reverse is 1, return 0 if bit is set
+ */
+ thd->sys_var_tmp.my_bool_value= ((thd->options & bit_flag) ?
+ !reverse : reverse);
+ return (byte*) &thd->sys_var_tmp.my_bool_value;
+}
+
+
+bool sys_var_thd_conv_charset::check(THD *thd, set_var *var)
+{
+ CONVERT *tmp;
+ char buff[80];
+ String str(buff,sizeof(buff)), *res;
+
+ if (!var->value) // Default value
+ {
+ var->save_result.convert= (var->type != OPT_GLOBAL ?
+ global_system_variables.convert_set
+ : (CONVERT*) 0);
+ return 0;
+ }
+ if (!(res=var->value->val_str(&str)))
+ res= &empty_string;
+
+ if (!(tmp=get_convert_set(res->c_ptr())))
+ {
+ my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), res->c_ptr());
+ return 1;
+ }
+ var->save_result.convert=tmp; // Save for update
+ return 0;
+}
+
+
+bool sys_var_thd_conv_charset::update(THD *thd, set_var *var)
+{
+ if (var->type == OPT_GLOBAL)
+ global_system_variables.convert_set= var->save_result.convert;
+ else
+ thd->lex.convert_set= thd->variables.convert_set=
+ var->save_result.convert;
+ return 0;
+}
+
+
+byte *sys_var_thd_conv_charset::value_ptr(THD *thd, enum_var_type type)
+{
+ CONVERT *conv= ((type == OPT_GLOBAL) ?
+ global_system_variables.convert_set :
+ thd->variables.convert_set);
+ return conv ? (byte*) conv->name : (byte*) "";
+}
+
+
+
+bool sys_var_timestamp::update(THD *thd, set_var *var)
+{
+ thd->set_time((time_t) var->value->val_int());
+ return 0;
+}
+
+
+void sys_var_timestamp::set_default(THD *thd, enum_var_type type)
+{
+ thd->user_time=0;
+}
+
+
+byte *sys_var_timestamp::value_ptr(THD *thd, enum_var_type type)
+{
+ thd->sys_var_tmp.long_value= (long) thd->start_time;
+ return (byte*) &thd->sys_var_tmp.long_value;
+}
+
+
+bool sys_var_last_insert_id::update(THD *thd, set_var *var)
+{
+ thd->insert_id(var->value->val_int());
+ return 0;
+}
+
+
+byte *sys_var_last_insert_id::value_ptr(THD *thd, enum_var_type type)
+{
+ thd->sys_var_tmp.long_value= (long) thd->insert_id();
+ return (byte*) &thd->last_insert_id;
+}
+
+
+bool sys_var_insert_id::update(THD *thd, set_var *var)
+{
+ thd->next_insert_id=var->value->val_int();
+ return 0;
+}
+
+
+byte *sys_var_insert_id::value_ptr(THD *thd, enum_var_type type)
+{
+ return (byte*) &thd->current_insert_id;
+}
+
+
+bool sys_var_slave_skip_counter::check(THD *thd, set_var *var)
+{
+ bool result=0;
+ LOCK_ACTIVE_MI;
+ pthread_mutex_lock(&active_mi->rli.run_lock);
+ if (active_mi->rli.slave_running)
+ {
+ my_error(ER_SLAVE_MUST_STOP, MYF(0));
+ result=1;
+ }
+ pthread_mutex_unlock(&active_mi->rli.run_lock);
+ UNLOCK_ACTIVE_MI;
+ return result;
+}
+
+
+bool sys_var_slave_skip_counter::update(THD *thd, set_var *var)
+{
+ LOCK_ACTIVE_MI;
+ pthread_mutex_lock(&active_mi->rli.run_lock);
+ /*
+ The following test should normally never be true as we test this
+ in the check function; To be safe against multiple
+ SQL_SLAVE_SKIP_COUNTER request, we do the check anyway
+ */
+ if (!active_mi->rli.slave_running)
+ {
+ pthread_mutex_lock(&active_mi->rli.data_lock);
+ active_mi->rli.slave_skip_counter= (ulong) var->value->val_int();
+ pthread_mutex_unlock(&active_mi->rli.data_lock);
+ }
+ pthread_mutex_unlock(&active_mi->rli.run_lock);
+ UNLOCK_ACTIVE_MI;
+ return 0;
+}
+
+
+/*
+ Functions to update thd->options bits
+*/
+
+static bool set_option_bit(THD *thd, set_var *var)
+{
+ sys_var_thd_bit *sys_var= ((sys_var_thd_bit*) var->var);
+ if ((var->save_result.ulong_value != 0) == sys_var->reverse)
+ thd->options&= ~sys_var->bit_flag;
+ else
+ thd->options|= sys_var->bit_flag;
+ return 0;
+}
+
+
+static bool set_option_autocommit(THD *thd, set_var *var)
+{
+ /* The test is negative as the flag we use is NOT autocommit */
+
+ ulong org_options=thd->options;
+
+ if (var->save_result.ulong_value != 0)
+ thd->options&= ~((sys_var_thd_bit*) var->var)->bit_flag;
+ else
+ thd->options|= ((sys_var_thd_bit*) var->var)->bit_flag;
+
+ if ((org_options ^ thd->options) & OPTION_NOT_AUTOCOMMIT)
+ {
+ if ((org_options & OPTION_NOT_AUTOCOMMIT))
+ {
+ /* We changed to auto_commit mode */
+ thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE);
+ thd->server_status|= SERVER_STATUS_AUTOCOMMIT;
+ if (ha_commit(thd))
+ return 1;
+ }
+ else
+ {
+ thd->options&= ~(ulong) (OPTION_STATUS_NO_TRANS_UPDATE);
+ thd->server_status&= ~SERVER_STATUS_AUTOCOMMIT;
+ }
+ }
+ return 0;
+}
+
+
+static bool set_log_update(THD *thd, set_var *var)
+{
+ if (opt_sql_bin_update)
+ ((sys_var_thd_bit*) var->var)->bit_flag|= (OPTION_BIN_LOG |
+ OPTION_UPDATE_LOG);
+ set_option_bit(thd, var);
+ return 0;
+}
+
+
+/****************************************************************************
+ Main handling of variables:
+ - Initialisation
+ - Searching during parsing
+ - Update loop
+****************************************************************************/
+
+/*
+ Find variable name in option my_getopt structure used for command line args
+
+ SYNOPSIS
+ find_option()
+ opt option structure array to search in
+ name variable name
+
+ RETURN VALUES
+ 0 Error
+ ptr pointer to option structure
+*/
+
+static struct my_option *find_option(struct my_option *opt, const char *name)
+{
+ uint length=strlen(name);
+ for (; opt->name; opt++)
+ {
+ if (!getopt_compare_strings(opt->name, name, length) &&
+ !opt->name[length])
+ {
+ /*
+ Only accept the option if one can set values through it.
+ If not, there is no default value or limits in the option.
+ */
+ return (opt->value) ? opt : 0;
+ }
+ }
+ return 0;
+}
+
+
+/*
+ Return variable name and length for hashing of variables
+*/
+
+static byte *get_sys_var_length(const sys_var *var, uint *length,
+ my_bool first)
+{
+ *length= var->name_length;
+ return (byte*) var->name;
+}
+
+
+/*
+ Initialises sys variables and put them in system_variable_hash
+*/
+
+
+void set_var_init()
+{
+ extern struct my_option my_long_options[]; // From mysqld
+
+ hash_init(&system_variable_hash,array_elements(sys_variables),0,0,
+ (hash_get_key) get_sys_var_length,0, HASH_CASE_INSENSITIVE);
+ sys_var **var, **end;
+ for (var= sys_variables, end= sys_variables+array_elements(sys_variables) ;
+ var < end;
+ var++)
+ {
+ (*var)->name_length= strlen((*var)->name);
+ (*var)->option_limits= find_option(my_long_options, (*var)->name);
+ hash_insert(&system_variable_hash, (byte*) *var);
+ }
+
+ /*
+ Special cases
+ Needed because MySQL can't find the limits for a variable it it has
+ a different name than the command line option.
+ As these variables are deprecated, this code will disappear soon...
+ */
+ sys_sql_max_join_size.option_limits= sys_max_join_size.option_limits;
+}
+
+
+void set_var_free()
+{
+ hash_free(&system_variable_hash);
+}
+
+
+/*
+ Find a user set-table variable
+
+ SYNOPSIS
+ find_sys_var()
+ str Name of system variable to find
+ length Length of variable. zero means that we should use strlen()
+ on the variable
+
+ NOTE
+ We have to use net_printf() as this is called during the parsing stage
+
+ RETURN VALUES
+ pointer pointer to variable definitions
+ 0 Unknown variable (error message is given)
+*/
+
+sys_var *find_sys_var(const char *str, uint length)
+{
+ sys_var *var= (sys_var*) hash_search(&system_variable_hash, str,
+ length ? length :
+ strlen(str));
+ if (!var)
+ net_printf(&current_thd->net, ER_UNKNOWN_SYSTEM_VARIABLE, (char*) str);
+ return var;
+}
+
+
+/*
+ Execute update of all variables
+
+ SYNOPSIS
+
+ sql_set
+ THD Thread id
+ set_var List of variables to update
+
+ DESCRIPTION
+ First run a check of all variables that all updates will go ok.
+ If yes, then execute all updates, returning an error if any one failed.
+
+ This should ensure that in all normal cases none all or variables are
+ updated
+
+ RETURN VALUE
+ 0 ok
+ 1 Something got wrong (normally no variables was updated)
+*/
+
+bool sql_set_variables(THD *thd, List<set_var_base> *var_list)
+{
+ bool error=0;
+ List_iterator<set_var_base> it(*var_list);
+
+ set_var_base *var;
+ while ((var=it++))
+ {
+ if (var->check(thd))
+ return 1;
+ }
+ it.rewind();
+ while ((var=it++))
+ {
+ if (var->update(thd))
+ error=1;
+ }
+ return error;
+}
+
+
+/*****************************************************************************
+ Functions to handle SET mysql_internal_variable=const_expr
+*****************************************************************************/
+
+bool set_var::check(THD *thd)
+{
+ if (var->check_type(type))
+ {
+ my_error(type == OPT_GLOBAL ? ER_LOCAL_VARIABLE : ER_GLOBAL_VARIABLE,
+ MYF(0),
+ var->name);
+ return 1;
+ }
+ if ((type == OPT_GLOBAL && check_global_access(thd, SUPER_ACL)))
+ return 1;
+
+ /* value is a NULL pointer if we are using SET ... = DEFAULT */
+ if (!value)
+ {
+ if (var->check_default(type))
+ {
+ my_error(ER_NO_DEFAULT, MYF(0), var->name);
+ return 1;
+ }
+ return 0;
+ }
+
+ if (value->fix_fields(thd,0))
+ return 1;
+ if (var->check_update_type(value->result_type()))
+ {
+ my_error(ER_WRONG_TYPE_FOR_VAR, MYF(0), var->name);
+ return 1;
+ }
+ return var->check(thd, this);
+}
+
+
+bool set_var::update(THD *thd)
+{
+ if (!value)
+ var->set_default(thd, type);
+ else if (var->update(thd, this))
+ return 1; // should never happen
+ if (var->after_update)
+ (*var->after_update)(thd, type);
+ return 0;
+}
+
+
+/*****************************************************************************
+ Functions to handle SET @user_variable=const_expr
+*****************************************************************************/
+
+bool set_var_user::check(THD *thd)
+{
+ return user_var_item->fix_fields(thd,0);
+}
+
+
+bool set_var_user::update(THD *thd)
+{
+ if (user_var_item->update())
+ {
+ /* Give an error if it's not given already */
+ send_error(&thd->net, ER_SET_CONSTANTS_ONLY);
+ return 1;
+ }
+ return 0;
+}
+
+
+/*****************************************************************************
+ Functions to handle SET PASSWORD
+*****************************************************************************/
+
+bool set_var_password::check(THD *thd)
+{
+ if (!user->host.str)
+ user->host.str= (char*) thd->host_or_ip;
+ return check_change_password(thd, user->host.str, user->user.str);
+}
+
+bool set_var_password::update(THD *thd)
+{
+ return change_password(thd, user->host.str, user->user.str, password);
+}
+
+/****************************************************************************
+ Used templates
+****************************************************************************/
+
+#ifdef __GNUC__
+template class List<set_var_base>;
+template class List_iterator<set_var_base>;
+#endif
diff --git a/sql/set_var.h b/sql/set_var.h
new file mode 100644
index 00000000000..cbe479b7902
--- /dev/null
+++ b/sql/set_var.h
@@ -0,0 +1,440 @@
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/* Classes to support the SET command */
+
+#ifdef __GNUC__
+#pragma interface /* gcc class implementation */
+#endif
+
+/****************************************************************************
+ Variables that are changable runtime are declared using the
+ following classes
+****************************************************************************/
+
+class sys_var;
+class set_var;
+typedef struct system_variables SV;
+extern TYPELIB bool_typelib, delay_key_write_typelib;
+
+enum enum_var_type
+{
+ OPT_DEFAULT, OPT_SESSION, OPT_GLOBAL
+};
+
+typedef bool (*sys_check_func)(THD *, set_var *);
+typedef bool (*sys_update_func)(THD *, set_var *);
+typedef void (*sys_after_update_func)(THD *,enum_var_type);
+typedef void (*sys_set_default_func)(THD *, enum_var_type);
+
+class sys_var
+{
+public:
+ struct my_option *option_limits; /* Updated by by set_var_init() */
+ uint name_length; /* Updated by by set_var_init() */
+ const char *name;
+ sys_after_update_func after_update;
+ sys_var(const char *name_arg) :name(name_arg),after_update(0)
+ {}
+ sys_var(const char *name_arg,sys_after_update_func func)
+ :name(name_arg),after_update(func)
+ {}
+ virtual ~sys_var() {}
+ virtual bool check(THD *thd, set_var *var) { return 0; }
+ bool check_enum(THD *thd, set_var *var, TYPELIB *enum_names);
+ virtual bool update(THD *thd, set_var *var)=0;
+ virtual void set_default(THD *thd, enum_var_type type) {}
+ virtual SHOW_TYPE type() { return SHOW_UNDEF; }
+ virtual byte *value_ptr(THD *thd, enum_var_type type) { return 0; }
+ virtual bool check_type(enum_var_type type)
+ { return type != OPT_GLOBAL; } /* Error if not GLOBAL */
+ virtual bool check_update_type(Item_result type)
+ { return type != INT_RESULT; } /* Assume INT */
+ virtual bool check_default(enum_var_type type)
+ { return option_limits == 0; }
+ Item *item(THD *thd, enum_var_type type);
+};
+
+
+class sys_var_long_ptr :public sys_var
+{
+public:
+ ulong *value;
+ sys_var_long_ptr(const char *name_arg, ulong *value_ptr)
+ :sys_var(name_arg),value(value_ptr) {}
+ sys_var_long_ptr(const char *name_arg, ulong *value_ptr,
+ sys_after_update_func func)
+ :sys_var(name_arg,func), value(value_ptr) {}
+ bool update(THD *thd, set_var *var);
+ void set_default(THD *thd, enum_var_type type);
+ SHOW_TYPE type() { return SHOW_LONG; }
+ byte *value_ptr(THD *thd, enum_var_type type) { return (byte*) value; }
+};
+
+
+class sys_var_bool_ptr :public sys_var
+{
+public:
+ my_bool *value;
+ sys_var_bool_ptr(const char *name_arg, my_bool *value_arg)
+ :sys_var(name_arg),value(value_arg)
+ {}
+ bool check(THD *thd, set_var *var)
+ {
+ return check_enum(thd, var, &bool_typelib);
+ }
+ bool update(THD *thd, set_var *var);
+ void set_default(THD *thd, enum_var_type type);
+ SHOW_TYPE type() { return SHOW_MY_BOOL; }
+ byte *value_ptr(THD *thd, enum_var_type type) { return (byte*) value; }
+ bool check_update_type(Item_result type) { return 0; }
+};
+
+
+class sys_var_str :public sys_var
+{
+public:
+ char *value; // Pointer to allocated string
+ sys_check_func check_func;
+ sys_update_func update_func;
+ sys_set_default_func set_default_func;
+ sys_var_str(const char *name_arg,
+ sys_check_func check_func_arg,
+ sys_update_func update_func_arg,
+ sys_set_default_func set_default_func_arg)
+ :sys_var(name_arg), check_func(check_func_arg),
+ update_func(update_func_arg),set_default_func(set_default_func_arg)
+ {}
+ bool check(THD *thd, set_var *var)
+ {
+ return check_func ? (*check_func)(thd, var) : 0;
+ }
+ bool update(THD *thd, set_var *var)
+ {
+ return (*update_func)(thd, var);
+ }
+ void set_default(THD *thd, enum_var_type type)
+ {
+ (*set_default_func)(thd, type);
+ }
+ SHOW_TYPE type() { return SHOW_CHAR; }
+ byte *value_ptr(THD *thd, enum_var_type type) { return (byte*) value; }
+ bool check_update_type(Item_result type)
+ {
+ return type != STRING_RESULT; /* Only accept strings */
+ }
+ bool check_default(enum_var_type type) { return 0; }
+};
+
+
+class sys_var_enum :public sys_var
+{
+ uint *value;
+ TYPELIB *enum_names;
+public:
+ sys_var_enum(const char *name_arg, uint *value_arg,
+ TYPELIB *typelib, sys_after_update_func func)
+ :sys_var(name_arg,func), value(value_arg), enum_names(typelib)
+ {}
+ bool check(THD *thd, set_var *var)
+ {
+ return check_enum(thd, var, enum_names);
+ }
+ bool update(THD *thd, set_var *var);
+ SHOW_TYPE type() { return SHOW_CHAR; }
+ byte *value_ptr(THD *thd, enum_var_type type);
+ bool check_update_type(Item_result type) { return 0; }
+};
+
+
+class sys_var_thd :public sys_var
+{
+public:
+ sys_var_thd(const char *name_arg)
+ :sys_var(name_arg)
+ {}
+ sys_var_thd(const char *name_arg, sys_after_update_func func)
+ :sys_var(name_arg,func)
+ {}
+ bool check_type(enum_var_type type) { return 0; }
+ bool check_default(enum_var_type type)
+ {
+ return type == OPT_GLOBAL && !option_limits;
+ }
+};
+
+
+class sys_var_thd_ulong :public sys_var_thd
+{
+public:
+ ulong SV::*offset;
+ sys_var_thd_ulong(const char *name_arg, ulong SV::*offset_arg)
+ :sys_var_thd(name_arg), offset(offset_arg)
+ {}
+ sys_var_thd_ulong(const char *name_arg, ulong SV::*offset_arg,
+ sys_after_update_func func)
+ :sys_var_thd(name_arg,func), offset(offset_arg)
+ {}
+ bool update(THD *thd, set_var *var);
+ void set_default(THD *thd, enum_var_type type);
+ SHOW_TYPE type() { return SHOW_LONG; }
+ byte *value_ptr(THD *thd, enum_var_type type);
+};
+
+
+class sys_var_thd_ulonglong :public sys_var_thd
+{
+public:
+ ulonglong SV::*offset;
+ sys_var_thd_ulonglong(const char *name_arg, ulonglong SV::*offset_arg)
+ :sys_var_thd(name_arg), offset(offset_arg)
+ {}
+ bool update(THD *thd, set_var *var);
+ void set_default(THD *thd, enum_var_type type);
+ SHOW_TYPE type() { return SHOW_LONGLONG; }
+ byte *value_ptr(THD *thd, enum_var_type type);
+};
+
+
+class sys_var_thd_bool :public sys_var_thd
+{
+public:
+ my_bool SV::*offset;
+ sys_var_thd_bool(const char *name_arg, my_bool SV::*offset_arg)
+ :sys_var_thd(name_arg), offset(offset_arg)
+ {}
+ sys_var_thd_bool(const char *name_arg, my_bool SV::*offset_arg,
+ sys_after_update_func func)
+ :sys_var_thd(name_arg,func), offset(offset_arg)
+ {}
+ bool update(THD *thd, set_var *var);
+ void set_default(THD *thd, enum_var_type type);
+ SHOW_TYPE type() { return SHOW_MY_BOOL; }
+ byte *value_ptr(THD *thd, enum_var_type type);
+ bool check(THD *thd, set_var *var)
+ {
+ return check_enum(thd, var, &bool_typelib);
+ }
+ bool check_update_type(Item_result type) { return 0; }
+};
+
+
+class sys_var_thd_enum :public sys_var_thd
+{
+ ulong SV::*offset;
+ TYPELIB *enum_names;
+public:
+ sys_var_thd_enum(const char *name_arg, ulong SV::*offset_arg,
+ TYPELIB *typelib)
+ :sys_var_thd(name_arg), offset(offset_arg), enum_names(typelib)
+ {}
+ sys_var_thd_enum(const char *name_arg, ulong SV::*offset_arg,
+ TYPELIB *typelib,
+ sys_after_update_func func)
+ :sys_var_thd(name_arg,func), offset(offset_arg), enum_names(typelib)
+ {}
+ bool check(THD *thd, set_var *var)
+ {
+ return check_enum(thd, var, enum_names);
+ }
+ bool update(THD *thd, set_var *var);
+ void set_default(THD *thd, enum_var_type type);
+ SHOW_TYPE type() { return SHOW_CHAR; }
+ byte *value_ptr(THD *thd, enum_var_type type);
+ bool check_update_type(Item_result type) { return 0; }
+};
+
+
+class sys_var_thd_bit :public sys_var_thd
+{
+ sys_update_func update_func;
+public:
+ ulong bit_flag;
+ bool reverse;
+ sys_var_thd_bit(const char *name_arg, sys_update_func func, ulong bit,
+ bool reverse_arg=0)
+ :sys_var_thd(name_arg), update_func(func), bit_flag(bit),
+ reverse(reverse_arg)
+ {}
+ bool check(THD *thd, set_var *var)
+ {
+ return check_enum(thd, var, &bool_typelib);
+ }
+ bool update(THD *thd, set_var *var);
+ bool check_update_type(Item_result type) { return 0; }
+ bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
+ SHOW_TYPE type() { return SHOW_MY_BOOL; }
+ byte *value_ptr(THD *thd, enum_var_type type);
+};
+
+
+/* some variables that require special handling */
+
+class sys_var_timestamp :public sys_var
+{
+public:
+ sys_var_timestamp(const char *name_arg) :sys_var(name_arg) {}
+ bool update(THD *thd, set_var *var);
+ void set_default(THD *thd, enum_var_type type);
+ bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
+ bool check_default(enum_var_type type) { return 0; }
+ SHOW_TYPE type() { return SHOW_LONG; }
+ byte *value_ptr(THD *thd, enum_var_type type);
+};
+
+
+class sys_var_last_insert_id :public sys_var
+{
+public:
+ sys_var_last_insert_id(const char *name_arg) :sys_var(name_arg) {}
+ bool update(THD *thd, set_var *var);
+ bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
+ SHOW_TYPE type() { return SHOW_LONGLONG; }
+ byte *value_ptr(THD *thd, enum_var_type type);
+};
+
+
+class sys_var_insert_id :public sys_var
+{
+public:
+ sys_var_insert_id(const char *name_arg) :sys_var(name_arg) {}
+ bool update(THD *thd, set_var *var);
+ bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
+ SHOW_TYPE type() { return SHOW_LONGLONG; }
+ byte *value_ptr(THD *thd, enum_var_type type);
+};
+
+
+class sys_var_slave_skip_counter :public sys_var
+{
+public:
+ sys_var_slave_skip_counter(const char *name_arg) :sys_var(name_arg) {}
+ bool check(THD *thd, set_var *var);
+ bool update(THD *thd, set_var *var);
+ bool check_type(enum_var_type type) { return type != OPT_GLOBAL; }
+ /*
+ We can't retrieve the value of this, so we don't have to define
+ type() or value_ptr()
+ */
+};
+
+
+class sys_var_thd_conv_charset :public sys_var_thd
+{
+public:
+ sys_var_thd_conv_charset(const char *name_arg)
+ :sys_var_thd(name_arg)
+ {}
+ bool check(THD *thd, set_var *var);
+ bool update(THD *thd, set_var *var);
+ SHOW_TYPE type() { return SHOW_CHAR; }
+ byte *value_ptr(THD *thd, enum_var_type type);
+ bool check_update_type(Item_result type)
+ {
+ return type != STRING_RESULT; /* Only accept strings */
+ }
+ bool check_default(enum_var_type type) { return 0; }
+};
+
+
+/****************************************************************************
+ Classes for parsing of the SET command
+****************************************************************************/
+
+class set_var_base :public Sql_alloc
+{
+public:
+ set_var_base() {}
+ virtual ~set_var_base() {}
+ virtual bool check(THD *thd)=0; /* To check privileges etc. */
+ virtual bool update(THD *thd)=0; /* To set the value */
+};
+
+
+/* MySQL internal variables, like query_cache_size */
+
+class set_var :public set_var_base
+{
+public:
+ sys_var *var;
+ Item *value;
+ enum_var_type type;
+ union
+ {
+ CONVERT *convert;
+ ulong ulong_value;
+ } save_result;
+
+ set_var(enum_var_type type_arg, sys_var *var_arg, Item *value_arg)
+ :var(var_arg), type(type_arg)
+ {
+ /*
+ If the set value is a field, change it to a string to allow things like
+ SET table_type=MYISAM;
+ */
+ if (value_arg && value_arg->type() == Item::FIELD_ITEM)
+ {
+ Item_field *item= (Item_field*) value_arg;
+ if (!(value=new Item_string(item->field_name, strlen(item->field_name))))
+ value=value_arg; /* Give error message later */
+ }
+ else
+ value=value_arg;
+ }
+ bool check(THD *thd);
+ bool update(THD *thd);
+};
+
+
+/* User variables like @my_own_variable */
+
+class set_var_user: public set_var_base
+{
+ Item_func_set_user_var *user_var_item;
+public:
+ set_var_user(Item_func_set_user_var *item)
+ :user_var_item(item)
+ {}
+ bool check(THD *thd);
+ bool update(THD *thd);
+};
+
+/* For SET PASSWORD */
+
+class set_var_password: public set_var_base
+{
+ LEX_USER *user;
+ char *password;
+public:
+ set_var_password(LEX_USER *user_arg,char *password_arg)
+ :user(user_arg), password(password_arg)
+ {}
+ bool check(THD *thd);
+ bool update(THD *thd);
+};
+
+
+/*
+ Prototypes for helper functions
+*/
+
+void set_var_init();
+void set_var_free();
+sys_var *find_sys_var(const char *str, uint length=0);
+bool sql_set_variables(THD *thd, List<set_var_base> *var_list);
+void fix_delay_key_write(THD *thd, enum_var_type type);
+
+extern sys_var_str sys_charset;
diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt
index 9ce8875ceeb..e9f3b997a96 100644
--- a/sql/share/czech/errmsg.txt
+++ b/sql/share/czech/errmsg.txt
@@ -237,6 +237,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt
index 0babb8981a8..71785bb8ba2 100644
--- a/sql/share/danish/errmsg.txt
+++ b/sql/share/danish/errmsg.txt
@@ -231,6 +231,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt
index b2fab274db1..e129b1cc30e 100644
--- a/sql/share/dutch/errmsg.txt
+++ b/sql/share/dutch/errmsg.txt
@@ -6,6 +6,9 @@
Completed earlier partial translation; worked on consistency and spelling.
2002-01-29 - Arjen Lentz (arjen@mysql.com)
2002-04-11 - Arjen Lentz (arjen@mysql.com)
+ 2002-06-13 - Arjen Lentz (arjen@mysql.com)
+ 2002-08-08 - Arjen Lentz (arjen@mysql.com)
+ 2002-08-22 - Arjen Lentz (arjen@mysql.com)
Translated new error messages.
*/
@@ -236,6 +239,16 @@
"Het combineren van transactionele en niet-transactionele tabellen is uitgeschakeld.",
"Optie '%s' tweemaal gebruikt in opdracht",
"Gebruiker '%-.64s' heeft het maximale gebruik van de '%s' faciliteit overschreden (huidige waarde: %ld)",
+"Toegang geweigerd. U moet het %-.128s privilege hebben voor deze operatie",
+"Variabele '%-.64s' is LOCAL en kan niet worden gebruikt met SET GLOBAL",
+"Variabele '%-.64s' is GLOBAL en dient te worden gewijzigd met SET GLOBAL",
+"Variabele '%-.64s' heeft geen standaard waarde",
+"Variabele '%-.64s' kan niet worden gewijzigd naar de waarde '%-.64s'",
+"Foutief argumenttype voor variabele '%-.64s'",
+"Variabele '%-.64s' kan alleen worden gewijzigd, niet gelezen",
+"Foutieve toepassing/plaatsing van '%s'",
+"Deze versie van MySQL ondersteunt nog geen '%s'",
+"Kreeg fatale fout %d: '%-.128s' van master tijdens lezen van data uit binaire log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt
index 1a68a9dcb85..88ab604fbcf 100644
--- a/sql/share/english/errmsg.txt
+++ b/sql/share/english/errmsg.txt
@@ -228,6 +228,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt
index e52dfd72c5a..9f412bb1594 100644
--- a/sql/share/estonian/errmsg.txt
+++ b/sql/share/estonian/errmsg.txt
@@ -233,6 +233,16 @@
"Transaktsioone toetavate ning mittetoetavate tabelite kooskasutamine ei ole lubatud",
"Määrangut '%s' on lauses kasutatud topelt",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt
index 8d0e2505eb0..33cf1a9e377 100644
--- a/sql/share/french/errmsg.txt
+++ b/sql/share/french/errmsg.txt
@@ -147,7 +147,7 @@
"La commande '%-.16s' est interdite à l'utilisateur: '%-.32s@%-.64s' sur la colonne '%-.64s' de la table '%-.64s'",
"Commande GRANT/REVOKE incorrecte. Consultez le manuel.",
"L'hôte ou l'utilisateur donné en argument à GRANT est trop long",
-"La table '%-64s.%s' n'existe pas",
+"La table '%-.64s.%s' n'existe pas",
"Un tel droit n'est pas défini pour l'utilisateur '%-.32s' sur l'hôte '%-.64s' sur la table '%-.64s'",
"Cette commande n'existe pas dans cette version de MySQL",
"Erreur de syntaxe",
@@ -228,6 +228,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt
index afd727a19ea..1056dccba2b 100644
--- a/sql/share/german/errmsg.txt
+++ b/sql/share/german/errmsg.txt
@@ -231,6 +231,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt
index 171493458c9..a344ed2df9e 100644
--- a/sql/share/greek/errmsg.txt
+++ b/sql/share/greek/errmsg.txt
@@ -228,6 +228,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt
index f891f8a7e91..9e88f2c3e2c 100644
--- a/sql/share/hungarian/errmsg.txt
+++ b/sql/share/hungarian/errmsg.txt
@@ -230,6 +230,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt
index 9b8eb214215..c9275a70878 100644
--- a/sql/share/italian/errmsg.txt
+++ b/sql/share/italian/errmsg.txt
@@ -228,6 +228,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt
index 4016dd50189..07bdcd6bee5 100644
--- a/sql/share/japanese/errmsg.txt
+++ b/sql/share/japanese/errmsg.txt
@@ -230,6 +230,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt
index 93e9948d4fd..57f990fdc04 100644
--- a/sql/share/korean/errmsg.txt
+++ b/sql/share/korean/errmsg.txt
@@ -228,6 +228,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt
index 612757726c7..37f7f2fac01 100644
--- a/sql/share/norwegian-ny/errmsg.txt
+++ b/sql/share/norwegian-ny/errmsg.txt
@@ -230,6 +230,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt
index f0d884c330f..93f4090d697 100644
--- a/sql/share/norwegian/errmsg.txt
+++ b/sql/share/norwegian/errmsg.txt
@@ -230,6 +230,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt
index 22f7c331a98..3b43ce539c7 100644
--- a/sql/share/polish/errmsg.txt
+++ b/sql/share/polish/errmsg.txt
@@ -232,6 +232,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt
index a00dabc391b..fcdbf607807 100644
--- a/sql/share/portuguese/errmsg.txt
+++ b/sql/share/portuguese/errmsg.txt
@@ -1,28 +1,28 @@
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */
-/* Updated by Roberto de Martin Serqueira - martinsc@uol.com.br - 08.20.2001 */
+/* Updated by Thiago Delgado Pinto - thiagodp@ieg.com.br - 06.07.2002 */
"hashchk",
"isamchk",
-"não",
-"sim",
-"Não pode criar arquivo '%-.64s' (erro no. %d)",
-"Não pode criar tabela '%-.64s' (erro no. %d)",
-"Não pode criar banco de dados '%-.64s' (erro no. %d)",
-"Não pode criar banco de dados '%-.64s'. Banco de dados já existe",
-"Não pode eliminar banco de dados '%-.64s'. Banco de dados não existe",
+"NÃO",
+"SIM",
+"Não pode criar o arquivo '%-.64s' (erro no. %d)",
+"Não pode criar a tabela '%-.64s' (erro no. %d)",
+"Não pode criar o banco de dados '%-.64s' (erro no. %d)",
+"Não pode criar o banco de dados '%-.64s'. Este banco de dados já existe",
+"Não pode eliminar o banco de dados '%-.64s'. Este banco de dados não existe",
"Erro ao eliminar banco de dados (não pode eliminar '%-.64s' - erro no. %d)",
"Erro ao eliminar banco de dados (não pode remover diretório '%-.64s' - erro no. %d)",
-"Erro na deleção de '%-.64s' (erro no. %d)",
-"Não pode ler registro em tabela do sistema",
-"Não pode obter status de '%-.64s' (erro no. %d)",
-"Não pode obter diretório corrente (erro no. %d)",
-"Não pode travar arquivo (erro no. %d)",
-"Não pode abrir arquivo '%-.64s' (erro no. %d)",
-"Não pode encontrar arquivo '%-.64s' (erro no. %d)",
-"Não pode ler diretório de '%-.64s' (erro no. %d)",
+"Erro na remoção de '%-.64s' (erro no. %d)",
+"Não pode ler um registro numa tabela do sistema",
+"Não pode obter o status de '%-.64s' (erro no. %d)",
+"Não pode obter o diretório corrente (erro no. %d)",
+"Não pode travar o arquivo (erro no. %d)",
+"Não pode abrir o arquivo '%-.64s' (erro no. %d)",
+"Não pode encontrar o arquivo '%-.64s' (erro no. %d)",
+"Não pode ler o diretório de '%-.64s' (erro no. %d)",
"Não pode mudar para o diretório '%-.64s' (erro no. %d)",
"Registro alterado desde a última leitura da tabela '%-.64s'",
-"Disco cheio (%s). Aguardando alguém liberar algum espaço....",
+"Disco cheio (%s). Aguardando alguém liberar algum espaço...",
"Não pode gravar. Chave duplicada na tabela '%-.64s'",
"Erro ao fechar '%-.64s' (erro no. %d)",
"Erro ao ler arquivo '%-.64s' (erro no. %d)",
@@ -30,13 +30,13 @@
"Erro ao gravar arquivo '%-.64s' (erro no. %d)",
"'%-.64s' está com travamento contra alterações",
"Ordenação abortada",
-"'View' '%-.64s' não existe para '%-.64s'",
+"Visão '%-.64s' não existe para '%-.64s'",
"Obteve erro %d no manipulador de tabelas",
"Manipulador de tabela para '%-.64s' não tem esta opção",
"Não pode encontrar registro em '%-.64s'",
"Informação incorreta no arquivo '%-.64s'",
-"Arquivo de índice incorreto para tabela '%-.64s'. Tente reparar",
-"Arquivo chave desatualizado para tabela '%-.64s'. Repare-o!",
+"Arquivo de índice incorreto para tabela '%-.64s'. Tente repará-lo",
+"Arquivo de índice desatualizado para tabela '%-.64s'. Repare-o!",
"Tabela '%-.64s' é somente para leitura",
"Sem memória. Reinicie o programa e tente novamente (necessita de %d bytes)",
"Sem memória para ordenação. Aumente tamanho do 'buffer' de ordenação",
@@ -46,10 +46,10 @@
"Não pode obter nome do 'host' para seu endereço",
"Negociação de acesso falhou",
"Acesso negado para o usuário '%-.32s@%-.64s' ao banco de dados '%-.64s'",
-"Acesso negado para o usuário '%-.32s@%-.64s' (uso de senha: %s)",
+"Acesso negado para o usuário '%-.32s@%-.64s' (senha usada: %s)",
"Nenhum banco de dados foi selecionado",
"Comando desconhecido",
-"Coluna '%-.64s' não pode ter NULL",
+"Coluna '%-.64s' não pode ser vazia",
"Banco de dados '%-.64s' desconhecido",
"Tabela '%-.64s' já existe",
"Tabela '%-.64s' desconhecida",
@@ -66,9 +66,9 @@
"Entrada '%-.64s' duplicada para a chave %d",
"Especificador de coluna incorreto para a coluna '%-.64s'",
"%s próximo a '%-.80s' na linha %d",
-"'Query' estava vazia",
+"Consulta (query) estava vazia",
"Tabela/alias '%-.64s' não única",
-"Valor 'default' inválido para '%-.64s'",
+"Valor padrão (default) inválido para '%-.64s'",
"Definida mais de uma chave primária",
"Especificadas chaves demais. O máximo permitido são %d chaves",
"Especificadas partes de chave demais. O máximo permitido são %d partes",
@@ -82,50 +82,50 @@
"%s: Obteve sinal %d. Abortando!\n",
"%s: 'Shutdown' completo\n",
"%s: Forçando finalização da 'thread' %ld - usuário '%-.32s'\n",
-"Não pode criar 'IP socket'",
+"Não pode criar o soquete IP",
"Tabela '%-.64s' não possui um índice como o usado em CREATE INDEX. Recrie a tabela",
-"Argumento separador de campos não é o esperado. Confira no manual",
-"Você não pode usar comprimento de linha fixo com BLOBs. Favor usar 'fields terminated by'",
+"Argumento separador de campos não é o esperado. Cheque o manual",
+"Você não pode usar comprimento de linha fixo com BLOBs. Por favor, use campos com comprimento limitado.",
"Arquivo '%-.64s' tem que estar no diretório do banco de dados ou ter leitura possível para todos",
"Arquivo '%-.80s' já existe",
"Registros: %ld - Deletados: %ld - Ignorados: %ld - Avisos: %ld",
"Registros: %ld - Duplicados: %ld",
-"Parte de chave incorreta. A parte de chave usada não é um 'string' ou o comprimento usado é maior do que a parte de chave ou o manipulador de tabelas não aceita partes de chaves únicas",
+"Sub parte da chave incorreta. A parte da chave usada não é uma 'string' ou o comprimento usado é maior que parte da chave ou o manipulador de tabelas não suporta sub chaves únicas",
"Você não pode deletar todas as colunas com ALTER TABLE. Use DROP TABLE em seu lugar",
-"Não pode fazer DROP '%-.64s'. Confira se esta coluna/chave existe",
+"Não se pode fazer DROP '%-.64s'. Confira se esta coluna/chave existe",
"Registros: %ld - Duplicados: %ld - Avisos: %ld",
-"INSERT TABLE '%-.64s' não é permitido em lista de tabelas FROM",
+"INSERT TABLE '%-.64s' não é permitido na lista de tabelas contidas em FROM",
"'Id' de 'thread' %lu desconhecido",
"Você não é proprietário da 'thread' %lu",
"Nenhuma tabela usada",
"'Strings' demais para coluna '%-.64s' e SET",
"Não pode gerar um nome de arquivo de 'log' único '%-.64s'.(1-999)\n",
-"Tabela '%-.64s' foi travada com trava de READ e não pode ser atualizada",
+"Tabela '%-.64s' foi travada com trava de leitura e não pode ser atualizada",
"Tabela '%-.64s' não foi travada com LOCK TABLES",
-"Coluna BLOB '%-.64s' não pode ter um valor 'default'",
+"Coluna BLOB '%-.64s' não pode ter um valor padrão (default)",
"Nome de banco de dados '%-.100s' incorreto",
"Nome de tabela '%-.100s' incorreto",
-"O SELECT examinaria registros demais e provavelmente tomaria um tempo muito longo. Confira sua cláusula WHERE e use SET OPTION SQL_BIG_SELECTS=1, se o SELECT estiver correto",
+"O SELECT examinaria registros demais e provavelmente levaria muito tempo. Cheque sua cláusula WHERE e use SET OPTION SQL_BIG_SELECTS=1, se o SELECT estiver correto",
"Erro desconhecido",
"'Procedure' '%-.64s' desconhecida",
"Número de parâmetros incorreto para a 'procedure' '%-.64s'",
"Parâmetros incorretos para a 'procedure' '%-.64s'",
"Tabela '%-.64s' desconhecida em '%-.32s'",
"Coluna '%-.64s' especificada duas vezes",
-"Uso inválido de função de grupo",
+"Uso inválido de função de agrupamento (GROUP)",
"Tabela '%-.64s' usa uma extensão que não existe nesta versão do MySQL",
"Uma tabela tem que ter pelo menos uma (1) coluna",
"Tabela '%-.64s' está cheia",
"Conjunto de caracteres '%-.64s' desconhecido",
-"Tabelas demais. O MySQL pode usar somente %d tabelas em um JOIN",
+"Tabelas demais. O MySQL pode usar somente %d tabelas em uma junção (JOIN)",
"Colunas demais",
"Tamanho de linha grande demais. O máximo tamanho de linha, não contando BLOBs, é %d. Você tem que mudar alguns campos para BLOBs",
"Estouro da pilha do 'thread'. Usados %ld de uma pilha de %ld . Use 'mysqld -O thread_stack=#' para especificar uma pilha maior, se necessário",
-"Dependência cruzada encontrada em OUTER JOIN. Examine suas condições ON",
-"Coluna '%-.64s' é usada com UNIQUE ou INDEX, mas não está definida como NOT NULL",
+"Dependência cruzada encontrada em junção externa (OUTER JOIN). Examine as condições utilizadas nas cláusulas 'ON'",
+"Coluna '%-.64s' é usada com única (UNIQUE) ou índice (INDEX), mas não está definida como não-nula (NOT NULL)",
"Não pode carregar a função '%-.64s'",
"Não pode inicializar a função '%-.64s' - '%-.80s'",
-"Não é permitido caminho para biblioteca compartilhada",
+"Não há caminhos (paths) permitidos para biblioteca compartilhada",
"Função '%-.64s' já existe",
"Não pode abrir biblioteca compartilhada '%-.64s' (erro no. '%d' - '%-.64s')",
"Não pode encontrar a função '%-.64s' na biblioteca",
@@ -133,34 +133,34 @@
"'Host' '%-.64s' está bloqueado devido a muitos erros de conexão. Desbloqueie com 'mysqladmin flush-hosts'",
"'Host' '%-.64s' não tem permissão para se conectar com este servidor MySQL",
"Você está usando o MySQL como usuário anônimo e usuários anônimos não têm permissão para mudar senhas",
-"Você tem que ter o privilégio para atualizar tabelas no banco de dados mysql para ser capaz de mudar a senha de outros",
-"Não pode encontrar nenhuma linha que combine na tabela user",
+"Você deve ter privilégios para atualizar tabelas no banco de dados mysql para ser capaz de mudar a senha de outros",
+"Não pode encontrar nenhuma linha que combine na tabela usuário (user table)",
"Linhas que combinaram: %ld - Alteradas: %ld - Avisos: %ld",
"Não pode criar uma nova 'thread' (erro no. %d). Se você não estiver sem memória disponível, você pode consultar o manual sobre um possível 'bug' dependente do sistema operacional",
"Contagem de colunas não confere com a contagem de valores na linha %ld",
"Não pode reabrir a tabela '%-.64s',
"Uso inválido do valor NULL",
"Obteve erro '%-.64s' em regexp",
-"Mistura de colunas GROUP (MIN(),MAX(),COUNT()...) com colunas não GROUP é ilegal, se não existir cláusula GROUP BY",
-"Não existe tal 'grant' definido para o usuário '%-.32s' no 'host' '%-.64s'",
+"Mistura de colunas agrupadas (com MIN(), MAX(), COUNT(), ...) com colunas não agrupadas é ilegal, se não existir uma cláusula de agrupamento (cláusula GROUP BY)",
+"Não existe tal permissão (grant) definida para o usuário '%-.32s' no 'host' '%-.64s'",
"Comando '%-.16s' negado para o usuário '%-.32s@%-.64s' na tabela '%-.64s'",
"Comando '%-.16s' negado para o usuário '%-.32s@%-.64s' na coluna '%-.64s', na tabela '%-.64s'",
"Comando GRANT/REVOKE ilegal. Por favor consulte no manual quais privilégios podem ser usados.",
"Argumento de 'host' ou de usuário para o GRANT é longo demais",
"Tabela '%-.64s.%-.64s' não existe",
-"Não existe tal 'grant' definido para o usuário '%-.32s' no 'host' '%-.64s', na tabela '%-.64s'",
+"Não existe tal permissão (grant) definido para o usuário '%-.32s' no 'host' '%-.64s', na tabela '%-.64s'",
"Comando usado não é permitido para esta versão do MySQL",
"Você tem um erro de sintaxe no seu SQL",
-"'Thread' de inserção retardada ('delayed') não conseguiu obter trava solicitada para tabela '%-.64s'",
-"Excesso de 'threads' retardadas ('delayed') em uso",
+"'Thread' de inserção retardada (atrasada) pois não conseguiu obter a trava solicitada para tabela '%-.64s'",
+"Excesso de 'threads' retardadas (atrasadas) em uso",
"Conexão %ld abortou para o banco de dados '%-.64s' - usuário '%-.32s' (%-.64s)",
-"Obteve um pacote maior do que 'max_allowed_packet'",
+"Obteve um pacote maior do que a taxa máxima de pacotes definida (max_allowed_packet)",
"Obteve um erro de leitura no 'pipe' da conexão",
"Obteve um erro em fcntl()",
"Obteve pacotes fora de ordem",
"Não conseguiu descomprimir pacote de comunicação",
"Obteve um erro na leitura de pacotes de comunicação",
-"Obteve expiração de tempo ('timeout') na leitura de pacotes de comunicação",
+"Obteve expiração de tempo (timeout) na leitura de pacotes de comunicação",
"Obteve um erro na escrita de pacotes de comunicação",
"Obteve expiração de tempo ('timeout') na escrita de pacotes de comunicação",
"'String' resultante é mais longa do que 'max_allowed_packet'",
@@ -169,56 +169,56 @@
"INSERT DELAYED não pode ser usado com a tabela '%-.64s', porque ela está travada com LOCK TABLES",
"Nome de coluna '%-.100s' incorreto",
"O manipulador de tabela usado não pode indexar a coluna '%-.64s'",
-"Tabelas no MERGE não estão todas definidas identicamente",
+"Todas as tabelas contidas na tabela fundida (MERGE) não estão definidas identicamente",
"Não pode gravar, devido à restrição UNIQUE, na tabela '%-.64s'",
"Coluna BLOB '%-.64s' usada na especificação de chave sem o comprimento da chave",
-"Todas as partes de uma PRIMARY KEY têm que ser NOT NULL. Se você precisar de NULL em uma chave, use UNIQUE em seu lugar",
+"Todas as partes de uma chave primária devem ser não-nulas. Se você precisou usar um valor nulo (NULL) em uma chave, use a cláusula UNIQUE em seu lugar",
"O resultado consistiu em mais do que uma linha",
"Este tipo de tabela requer uma chave primária",
"Esta versão do MySQL não foi compilada com suporte a RAID",
-"Você está usando modo de atualização seguro e tentou atualizar uma tabela sem um WHERE que use uma coluna de KEY",
+"Você está usando modo de atualização seguro e tentou atualizar uma tabela sem uma cláusula WHERE que use uma coluna chave",
"Chave '%-.64s' não existe na tabela '%-.64s'",
"Não pode abrir a tabela",
-"O manipulador de tabela não suporta check/repair",
-"Não lhe é permitido executar este comando em uma 'transaction'",
+"O manipulador de tabela não suporta checagem/reparação (check/repair)",
+"Não lhe é permitido executar este comando em uma transação",
"Obteve erro %d durante COMMIT",
"Obteve erro %d durante ROLLBACK",
"Obteve erro %d durante FLUSH_LOGS",
"Obteve erro %d durante CHECKPOINT",
-"Conexão %ld abortada ao banco de dados '%-.64s' - usuário '%-.32s' - 'host' `%-.64s' ('%-.64s')",
-"O manipulador de tabela não suporta DUMP binário de tabela",
+"Conexão %ld abortada para banco de dados '%-.64s' - usuário '%-.32s' - 'host' `%-.64s' ('%-.64s')",
+"O manipulador de tabela não suporta 'dump' binário de tabela",
"Binlog fechado. Não pode fazer RESET MASTER",
-"Falhou na reconstrução do índice da tabela '%-.64s' 'dumped'",
+"Falhou na reconstrução do índice da tabela 'dumped' '%-.64s'",
"Erro no 'master' '%-.64s'",
-"Erro de rede na leitura do 'master'",
-"Erro de rede na gravação do 'master'",
-"Não pode encontrar índice FULLTEXT que combine com a lista de colunas",
-"Não pode executar o comando dado porque você tem tabelas ativas travadas ou uma 'transaction' ativa",
-"Variável de sistema '%-.64s' desconhecida",
+"Erro de rede lendo do 'master'",
+"Erro de rede gravando no 'master'",
+"Não pode encontrar um índice para o texto todo que combine com a lista de colunas",
+"Não pode executar o comando dado porque você tem tabelas ativas travadas ou uma transação ativa",
+"Variável de sistema '%-.64' desconhecida",
"Tabela '%-.64s' está marcada como danificada e deve ser reparada",
"Tabela '%-.64s' está marcada como danificada e a última reparação (automática?) falhou",
-"Aviso: Algumas tabelas não-transacionais alteradas não puderam ser reconstituídas ('rolled back')",
-"'Multi-statement transaction' requereu mais do que 'max_binlog_cache_size' bytes de armazenagem. Aumente o valor desta variável do mysqld e tente novamente',
+"Aviso: Algumas tabelas não-transacionais alteradas não puderam ser reconstituídas (rolled back)",
+"Transações multi-declaradas (multi-statement transactions) requeriram mais do que o valor limite (max_binlog_cache_size) de bytes para armazenagem. Aumente o valor desta variável do mysqld e tente novamente",
"Esta operação não pode ser realizada com um 'slave' em execução. Execute SLAVE STOP primeiro",
"Esta operação requer um 'slave' em execução. Configure o 'slave' e execute SLAVE START",
"O servidor não está configurado como 'slave'. Acerte o arquivo de configuração ou use CHANGE MASTER TO",
"Não pode inicializar a estrutura de informação do 'master'. Verifique as permissões em 'master.info'",
"Não conseguiu criar 'thread' de 'slave'. Verifique os recursos do sistema",
-"Usuário '%-.64s' já possui 'max_user_connections' conexões ativas",
-"Você pode usar apenas expressões de constante com SET",
-"Excedido tempo de espera (timeout) do travamento",
+"Usuário '%-.64s' já possui mais que o valor máximo de conexões (max_user_connections) ativas",
+"Você pode usar apenas expressões constantes com SET",
+"Tempo de espera (timeout) de travamento excedido. Tente reiniciar a transação.",
"O número total de travamentos excede o tamanho da tabela de travamentos",
-"Travamentos de atualização não podem ser obtidos durante uma transação de READ UNCOMMITTED",
+"Travamentos de atualização não podem ser obtidos durante uma transação de tipo READ UNCOMMITTED",
"DROP DATABASE não permitido enquanto uma 'thread' está mantendo um travamento global de leitura",
"CREATE DATABASE não permitido enquanto uma 'thread' está mantendo um travamento global de leitura",
"Argumentos errados para %s",
"Não é permitido a %-.32s@%-.64s criar novos usuários",
-"Incorrect table definition; All MERGE tables must be in the same database",
-"Deadlock found when trying to get lock; Try restarting transaction",
-"The used table type doesn't support FULLTEXT indexes",
-"Cannot add foreign key constraint",
-"Cannot add a child row: a foreign key constraint fails",
-"Cannot delete a parent row: a foreign key constraint fails",
+"Definição incorreta da tabela. Todas as tabelas contidas na junção devem estar no mesmo banco de dados.",
+"Encontrado um travamento fatal (deadlock) quando tentava obter uma trava. Tente reiniciar a transação.",
+"O tipo de tabela utilizado não suporta índices de texto completo (fulltext indexes)",
+"Não pode acrescentar uma restrição de chave estrangeira",
+"Não pode acrescentar uma linha filha: uma restrição de chave estrangeira falhou",
+"Não pode apagar uma linha pai: uma restrição de chave estrangeira falhou",
"Error connecting to master: %-.128s",
"Error running query on master: %-.128s",
"Error when executing command %s: %-.128s",
@@ -228,6 +228,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt
index 61ca19a598e..ce237d755d4 100644
--- a/sql/share/romanian/errmsg.txt
+++ b/sql/share/romanian/errmsg.txt
@@ -232,6 +232,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt
index 8ce3223ea7a..35b9c8080c2 100644
--- a/sql/share/russian/errmsg.txt
+++ b/sql/share/russian/errmsg.txt
@@ -231,6 +231,16 @@
"ïÄÎÏ×ÒÅÍÅÎÎÏÅ ÉÓÐÏÌØÚÏ×ÁÎÉÅ transactional É non-transactional ÔÁÂÌÉà ÏÔËÌÀÞÅÎÏ",
"ïÐÃÉÑ '%s' ÉÓÐÏÌØÚÏ×ÁÎÁ Ä×ÁÖÄÙ",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"ðÏÄÚÁÐÒÏÓ ×ÏÚ×ÒÁÝÁÅÔ ÂÏÌÅÅ ÏÄÎÏÇÏ ÐÏÌÑ",
diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt
index 9c0ecc8ca14..9912e4c9191 100644
--- a/sql/share/slovak/errmsg.txt
+++ b/sql/share/slovak/errmsg.txt
@@ -236,6 +236,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt
index 2eca37146e4..118970141bc 100644
--- a/sql/share/spanish/errmsg.txt
+++ b/sql/share/spanish/errmsg.txt
@@ -229,6 +229,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt
index 557c6e55394..f6553f247b6 100644
--- a/sql/share/swedish/errmsg.txt
+++ b/sql/share/swedish/errmsg.txt
@@ -228,6 +228,16 @@
"Blandning av transaktionella och icke-transaktionella tabeller är inaktiverat",
"Option '%s' användes två gånger",
"Användare '%-.64s' har överskridit '%s' (nuvarande värde: %ld)",
+"Du har inte privlegiet '%-.128s' som behövs för denna operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"Subselect return more than 1 field",
diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt
index 2fcb3405729..e37fae8f923 100644
--- a/sql/share/ukrainian/errmsg.txt
+++ b/sql/share/ukrainian/errmsg.txt
@@ -233,6 +233,16 @@
"Mixing of transactional and non-transactional tables is disabled",
"Option '%s' used twice in statement",
"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
+"Access denied. You need the %-.128s privilege for this operation",
+"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
+"Variable '%-.64s' doesn't have a default value",
+"Variable '%-.64s' can't be set to the value of '%-.64s'",
+"Wrong argument type to variable '%-.64s'",
+"Variable '%-.64s' can only be set, not read",
+"Wrong usage/placement of '%s'",
+"This version of MySQL doesn't yet support '%s'",
+"Got fatal error %d: '%-.128s' from master when reading data from binary log",
"Wrong foreign key definition for '%-.64s': %s",
"Key reference and table reference doesn't match",
"ðiÄÚÁÐÉÔ ÐÏ×ÅÒÔÁ¤ ÂiÌØÛ ÎiÖ 1 ÓÔÏ×ÂÅÃØ",
diff --git a/sql/slave.cc b/sql/slave.cc
index 2673644b65a..01f6233a2e0 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -41,63 +41,62 @@ DYNAMIC_ARRAY replicate_wild_do_table, replicate_wild_ignore_table;
bool do_table_inited = 0, ignore_table_inited = 0;
bool wild_do_table_inited = 0, wild_ignore_table_inited = 0;
bool table_rules_on = 0;
-static TABLE* save_temporary_tables = 0;
-ulong relay_log_space_limit = 0; /* TODO: fix variables to access ulonglong
- values and make it ulonglong */
-// when slave thread exits, we need to remember the temporary tables so we
-// can re-use them on slave start
+ulonglong relay_log_space_limit = 0;
+
+/*
+ When slave thread exits, we need to remember the temporary tables so we
+ can re-use them on slave start.
+
+ TODO: move the vars below under MASTER_INFO
+*/
-// TODO: move the vars below under MASTER_INFO
int disconnect_slave_event_count = 0, abort_slave_event_count = 0;
-static int events_till_disconnect = -1;
int events_till_abort = -1;
-static int stuck_count = 0;
+static int events_till_disconnect = -1;
typedef enum { SLAVE_THD_IO, SLAVE_THD_SQL} SLAVE_THD_TYPE;
void skip_load_data_infile(NET* net);
static int process_io_rotate(MASTER_INFO* mi, Rotate_log_event* rev);
static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev);
-static int queue_old_event(MASTER_INFO* mi, const char* buf,
- uint event_len);
static bool wait_for_relay_log_space(RELAY_LOG_INFO* rli);
static inline bool io_slave_killed(THD* thd,MASTER_INFO* mi);
static inline bool sql_slave_killed(THD* thd,RELAY_LOG_INFO* rli);
static int count_relay_log_space(RELAY_LOG_INFO* rli);
static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type);
static int safe_connect(THD* thd, MYSQL* mysql, MASTER_INFO* mi);
-static int safe_reconnect(THD* thd, MYSQL* mysql, MASTER_INFO* mi);
+static int safe_reconnect(THD* thd, MYSQL* mysql, MASTER_INFO* mi,
+ bool suppress_warnings);
static int connect_to_master(THD* thd, MYSQL* mysql, MASTER_INFO* mi,
- bool reconnect);
+ bool reconnect, bool suppress_warnings);
static int safe_sleep(THD* thd, int sec, CHECK_KILLED_FUNC thread_killed,
void* thread_killed_arg);
static int request_table_dump(MYSQL* mysql, const char* db, const char* table);
static int create_table_from_dump(THD* thd, NET* net, const char* db,
const char* table_name);
static int check_master_version(MYSQL* mysql, MASTER_INFO* mi);
-
char* rewrite_db(char* db);
+
+/*
+ Get a bit mask for which threads are running so that we later can
+ restart these threads
+*/
+
void init_thread_mask(int* mask,MASTER_INFO* mi,bool inverse)
{
bool set_io = mi->slave_running, set_sql = mi->rli.slave_running;
- if (inverse)
- {
- /* This makes me think of the Russian idiom "I am not I, and this is
- not my horse", which is used to deny reponsibility for
- one's actions.
- */
- set_io = !set_io;
- set_sql = !set_sql;
- }
register int tmp_mask=0;
if (set_io)
tmp_mask |= SLAVE_IO;
if (set_sql)
tmp_mask |= SLAVE_SQL;
+ if (inverse)
+ tmp_mask^= (SLAVE_IO | SLAVE_SQL);
*mask = tmp_mask;
}
+
void lock_slave_threads(MASTER_INFO* mi)
{
//TODO: see if we can do this without dual mutex
@@ -112,45 +111,50 @@ void unlock_slave_threads(MASTER_INFO* mi)
pthread_mutex_unlock(&mi->run_lock);
}
+
int init_slave()
{
- // TODO (multi-master): replace this with list initialization
+ DBUG_ENTER("init_slave");
+
+ /*
+ TODO: re-write this to interate through the list of files
+ for multi-master
+ */
active_mi = &main_mi;
- // TODO: the code below is a copy-paste mess - clean it up
+ /*
+ If master_host is not specified, try to read it from the master_info file.
+ If master_host is specified, create the master_info file if it doesn't
+ exists.
+ */
+ if (init_master_info(active_mi,master_info_file,relay_log_info_file,
+ !master_host))
+ {
+ sql_print_error("Warning: failed to initialized master info");
+ DBUG_RETURN(0);
+ }
+
/*
make sure slave thread gets started if server_id is set,
valid master.info is present, and master_host has not been specified
*/
- if (server_id && !master_host)
- {
- // TODO: re-write this to interate through the list of files
- // for multi-master
- char fname[FN_REFLEN+128];
- MY_STAT stat_area;
- fn_format(fname, master_info_file, mysql_data_home, "", 4+16+32);
- if (my_stat(fname, &stat_area, MYF(0)) &&
- !init_master_info(active_mi,master_info_file,relay_log_info_file))
- master_host = active_mi->host;
- }
- // slave thread
- if (master_host)
- {
- if (!opt_skip_slave_start && start_slave_threads(1 /* need mutex */,
- 0 /* no wait for start*/,
- active_mi,
- master_info_file,
- relay_log_info_file,
- SLAVE_IO|SLAVE_SQL
- ))
+ if (server_id && !master_host && active_mi->host[0])
+ master_host= active_mi->host;
+
+ if (master_host && !opt_skip_slave_start)
+ {
+ if (start_slave_threads(1 /* need mutex */,
+ 0 /* no wait for start*/,
+ active_mi,
+ master_info_file,
+ relay_log_info_file,
+ SLAVE_IO | SLAVE_SQL))
sql_print_error("Warning: Can't create threads to handle slave");
- else if (opt_skip_slave_start)
- if (init_master_info(active_mi, master_info_file, relay_log_info_file))
- sql_print_error("Warning: failed to initialized master info");
}
- return 0;
+ DBUG_RETURN(0);
}
+
static void free_table_ent(TABLE_RULE_ENT* e)
{
my_free((gptr) e, MYF(0));
@@ -163,19 +167,51 @@ static byte* get_table_key(TABLE_RULE_ENT* e, uint* len,
return (byte*)e->db;
}
-// TODO: check proper initialization of master_log_name/master_log_pos
+
+/*
+ Open the given relay log
+
+ SYNOPSIS
+ init_relay_log_pos()
+ rli Relay information (will be initialized)
+ log Name of relay log file to read from. NULL = First log
+ pos Position in relay log file
+ need_data_lock Set to 1 if this functions should do mutex locks
+ errmsg Store pointer to error message here
+
+ DESCRIPTION
+ - Close old open relay log files.
+ - If we are using the same relay log as the running IO-thread, then set
+ rli->cur_log to point to the same IO_CACHE entry.
+ - If not, open the 'log' binary file.
+
+ TODO
+ - check proper initialization of master_log_name/master_log_pos
+ - We may always want to delete all logs before 'log'.
+ Currently if we are not calling this with 'log' as NULL or the first
+ log we will never delete relay logs.
+ If we want this we should not set skip_log_purge to 1.
+
+ RETURN VALUES
+ 0 ok
+ 1 error. errmsg is set to point to the error message
+*/
+
int init_relay_log_pos(RELAY_LOG_INFO* rli,const char* log,
ulonglong pos, bool need_data_lock,
const char** errmsg)
{
+ DBUG_ENTER("init_relay_log_pos");
+
*errmsg=0;
- if (rli->log_pos_current)
- return 0;
+ if (rli->log_pos_current) // TODO: When can this happen ?
+ DBUG_RETURN(0);
pthread_mutex_t *log_lock=rli->relay_log.get_log_lock();
pthread_mutex_lock(log_lock);
if (need_data_lock)
pthread_mutex_lock(&rli->data_lock);
+ /* Close log file and free buffers if it's already open */
if (rli->cur_log_fd >= 0)
{
end_io_cache(&rli->cache_buf);
@@ -183,72 +219,70 @@ int init_relay_log_pos(RELAY_LOG_INFO* rli,const char* log,
rli->cur_log_fd = -1;
}
- if (!log)
- log = rli->relay_log_name; // already inited
- if (!pos)
- pos = rli->relay_log_pos; // already inited
- else
- rli->relay_log_pos = pos;
+ rli->relay_log_pos = pos;
- // test to see if the previous run was with the skip of purging
- // if yes, we do not purge when we restart
- if (rli->relay_log.find_first_log(&rli->linfo,""))
+ /*
+ Test to see if the previous run was with the skip of purging
+ If yes, we do not purge when we restart
+ */
+ if (rli->relay_log.find_log_pos(&rli->linfo, NullS, 1))
{
*errmsg="Could not find first log during relay log initialization";
goto err;
}
- if (strcmp(log,rli->linfo.log_file_name))
- rli->skip_log_purge=1;
-
- if (rli->relay_log.find_first_log(&rli->linfo,log))
+
+ if (log) // If not first log
{
- *errmsg="Could not find target log during relay log initialization";
- goto err;
+ if (strcmp(log, rli->linfo.log_file_name))
+ rli->skip_log_purge=1; // Different name; Don't purge
+ if (rli->relay_log.find_log_pos(&rli->linfo, log, 1))
+ {
+ *errmsg="Could not find target log during relay log initialization";
+ goto err;
+ }
}
- strnmov(rli->relay_log_name,rli->linfo.log_file_name,
- sizeof(rli->relay_log_name));
- // to make end_io_cache(&rli->cache_buf) safe in all cases
- if (!rli->inited)
- bzero((char*) &rli->cache_buf, sizeof(IO_CACHE));
+ strmake(rli->relay_log_name,rli->linfo.log_file_name,
+ sizeof(rli->relay_log_name)-1);
if (rli->relay_log.is_active(rli->linfo.log_file_name))
{
+ /*
+ The IO thread is using this log file.
+ In this case, we will use the same IO_CACHE pointer to
+ read data as the IO thread is using to write data.
+ */
if (my_b_tell((rli->cur_log=rli->relay_log.get_log_file())) == 0 &&
- check_binlog_magic(rli->cur_log,errmsg))
- {
+ check_binlog_magic(rli->cur_log,errmsg))
goto err;
- }
- rli->cur_log_init_count=rli->cur_log->init_count;
+ rli->cur_log_old_open_count=rli->relay_log.get_open_count();
}
else
{
- if (rli->inited)
- end_io_cache(&rli->cache_buf);
- if (rli->cur_log_fd>=0)
- my_close(rli->cur_log_fd,MYF(MY_WME));
+ /*
+ Open the relay log and set rli->cur_log to point at this one
+ */
if ((rli->cur_log_fd=open_binlog(&rli->cache_buf,
rli->linfo.log_file_name,errmsg)) < 0)
- {
goto err;
- }
rli->cur_log = &rli->cache_buf;
}
- if (pos > 4)
- my_b_seek(rli->cur_log,(off_t)pos);
- rli->log_pos_current=1;
+ if (pos > BIN_LOG_HEADER_SIZE)
+ my_b_seek(rli->cur_log,(off_t)pos);
+ rli->log_pos_current=1;
+
err:
- pthread_cond_broadcast(&rli->data_cond);
- if (need_data_lock)
- pthread_mutex_unlock(&rli->data_lock);
- pthread_mutex_unlock(log_lock);
- return (*errmsg) ? 1 : 0;
+ pthread_cond_broadcast(&rli->data_cond);
+ if (need_data_lock)
+ pthread_mutex_unlock(&rli->data_lock);
+ pthread_mutex_unlock(log_lock);
+ DBUG_RETURN ((*errmsg) ? 1 : 0);
}
+
/* called from get_options() in mysqld.cc on start-up */
void init_slave_skip_errors(const char* arg)
{
const char *p;
- my_bool last_was_digit = 0;
if (bitmap_init(&slave_error_mask,MAX_SLAVE_ERROR,0))
{
fprintf(stderr, "Badly out of memory, please check your system status\n");
@@ -274,48 +308,56 @@ void init_slave_skip_errors(const char* arg)
}
}
+
/*
- We assume we have a run lock on rli and that the both slave thread
+ We assume we have a run lock on rli and that both slave thread
are not running
*/
-int purge_relay_logs(RELAY_LOG_INFO* rli, bool just_reset, const char** errmsg)
+int purge_relay_logs(RELAY_LOG_INFO* rli, THD *thd, bool just_reset,
+ const char** errmsg)
{
+ int error=0;
DBUG_ENTER("purge_relay_logs");
if (!rli->inited)
DBUG_RETURN(0); /* successfully do nothing */
+
DBUG_ASSERT(rli->slave_running == 0);
DBUG_ASSERT(rli->mi->slave_running == 0);
- int error=0;
+
rli->slave_skip_counter=0;
pthread_mutex_lock(&rli->data_lock);
rli->pending=0;
rli->master_log_name[0]=0;
rli->master_log_pos=0; // 0 means uninitialized
- if (rli->relay_log.reset_logs(rli->sql_thd) ||
- rli->relay_log.find_first_log(&rli->linfo,""))
+ if (rli->relay_log.reset_logs(thd))
{
*errmsg = "Failed during log reset";
error=1;
goto err;
}
- strnmov(rli->relay_log_name,rli->linfo.log_file_name,
+ /* Save name of used relay log file */
+ strmake(rli->relay_log_name, rli->relay_log.get_log_fname(),
sizeof(rli->relay_log_name)-1);
- rli->log_space_total=4; //just first log with magic number and nothing else
- rli->relay_log_pos=4;
+ // Just first log with magic number and nothing else
+ rli->log_space_total= BIN_LOG_HEADER_SIZE;
+ rli->relay_log_pos= BIN_LOG_HEADER_SIZE;
rli->relay_log.reset_bytes_written();
rli->log_pos_current=0;
if (!just_reset)
- error = init_relay_log_pos(rli,0,0,0/*do not need data lock*/,errmsg);
+ error= init_relay_log_pos(rli, rli->relay_log_name, rli->relay_log_pos,
+ 0 /* do not need data lock */, errmsg);
+
err:
#ifndef DBUG_OFF
char buf[22];
#endif
- DBUG_PRINT("info",("log_space_total=%s",llstr(rli->log_space_total,buf)));
+ DBUG_PRINT("info",("log_space_total: %s",llstr(rli->log_space_total,buf)));
pthread_mutex_unlock(&rli->data_lock);
DBUG_RETURN(error);
}
+
int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock)
{
if (!mi->inited)
@@ -323,6 +365,7 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock)
int error,force_all = (thread_mask & SLAVE_FORCE_ALL);
pthread_mutex_t *sql_lock = &mi->rli.run_lock, *io_lock = &mi->run_lock;
pthread_mutex_t *sql_cond_lock,*io_cond_lock;
+ DBUG_ENTER("terminate_slave_threads");
sql_cond_lock=sql_lock;
io_cond_lock=io_lock;
@@ -339,7 +382,7 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock)
&mi->stop_cond,
&mi->slave_running)) &&
!force_all)
- return error;
+ DBUG_RETURN(error);
}
if ((thread_mask & (SLAVE_SQL|SLAVE_FORCE_ALL)) && mi->rli.slave_running)
{
@@ -350,11 +393,12 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock)
&mi->rli.stop_cond,
&mi->rli.slave_running)) &&
!force_all)
- return error;
+ DBUG_RETURN(error);
}
- return 0;
+ DBUG_RETURN(0);
}
+
int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
pthread_mutex_t *cond_lock,
pthread_cond_t* term_cond,
@@ -370,8 +414,9 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
}
}
DBUG_ASSERT(thd != 0);
- /* is is criticate to test if the slave is running. Otherwise, we might
- be referening freed memory trying to kick it
+ /*
+ Is is criticate to test if the slave is running. Otherwise, we might
+ be referening freed memory trying to kick it
*/
THD_CHECK_SENTRY(thd);
if (*slave_running)
@@ -380,23 +425,12 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
}
while (*slave_running)
{
- /* there is a small chance that slave thread might miss the first
- alarm. To protect againts it, resend the signal until it reacts
+ /*
+ There is a small chance that slave thread might miss the first
+ alarm. To protect againts it, resend the signal until it reacts
*/
struct timespec abstime;
-#ifdef HAVE_TIMESPEC_TS_SEC
- abstime.ts_sec=time(NULL)+2;
- abstime.ts_nsec=0;
-#elif defined(__WIN__)
- abstime.tv_sec=time((time_t*) 0)+2;
- abstime.tv_nsec=0;
-#else
- struct timeval tv;
- gettimeofday(&tv,0);
- abstime.tv_sec=tv.tv_sec+2;
- abstime.tv_nsec=tv.tv_usec*1000;
-#endif
- DBUG_ASSERT_LOCK(cond_lock);
+ set_timespec(abstime,2);
pthread_cond_timedwait(term_cond, cond_lock, &abstime);
if (*slave_running)
{
@@ -408,14 +442,19 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
return 0;
}
-int start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock,
+
+int start_slave_thread(pthread_handler h_func, pthread_mutex_t *start_lock,
pthread_mutex_t *cond_lock,
- pthread_cond_t* start_cond,
- volatile bool* slave_running,
+ pthread_cond_t *start_cond,
+ volatile bool *slave_running,
+ volatile ulong *slave_run_id,
MASTER_INFO* mi)
{
pthread_t th;
+ ulong start_id;
DBUG_ASSERT(mi->inited);
+ DBUG_ENTER("start_slave_thread");
+
if (start_lock)
pthread_mutex_lock(start_lock);
if (!server_id)
@@ -425,51 +464,54 @@ int start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock,
if (start_lock)
pthread_mutex_unlock(start_lock);
sql_print_error("Server id not set, will not start slave");
- return ER_BAD_SLAVE;
+ DBUG_RETURN(ER_BAD_SLAVE);
}
if (*slave_running)
- {
- if (start_cond)
- pthread_cond_broadcast(start_cond);
- if (start_lock)
- pthread_mutex_unlock(start_lock);
- return ER_SLAVE_MUST_STOP;
- }
+ {
+ if (start_cond)
+ pthread_cond_broadcast(start_cond);
+ if (start_lock)
+ pthread_mutex_unlock(start_lock);
+ DBUG_RETURN(ER_SLAVE_MUST_STOP);
+ }
+ start_id= *slave_run_id;
+ DBUG_PRINT("info",("Creating new slave thread"));
if (pthread_create(&th, &connection_attrib, h_func, (void*)mi))
{
if (start_lock)
pthread_mutex_unlock(start_lock);
- return ER_SLAVE_THREAD;
+ DBUG_RETURN(ER_SLAVE_THREAD);
}
if (start_cond && cond_lock)
{
THD* thd = current_thd;
- while (!*slave_running)
+ while (start_id == *slave_run_id)
{
+ DBUG_PRINT("sleep",("Waiting for slave thread to start"));
const char* old_msg = thd->enter_cond(start_cond,cond_lock,
- "Waiting for slave thread to start");
+ "Waiting for slave thread to start");
pthread_cond_wait(start_cond,cond_lock);
thd->exit_cond(old_msg);
- // TODO: in a very rare case of init_slave_thread failing, it is
- // possible that we can get stuck here since slave_running will not
- // be set. We need to change slave_running to int and have -1 as
- // error code
if (thd->killed)
{
pthread_mutex_unlock(cond_lock);
- return ER_SERVER_SHUTDOWN;
+ DBUG_RETURN(ER_SERVER_SHUTDOWN);
}
}
}
if (start_lock)
pthread_mutex_unlock(start_lock);
- return 0;
+ DBUG_RETURN(0);
}
-/* SLAVE_FORCE_ALL is not implemented here on purpose since it does not make
- sense to do that for starting a slave - we always care if it actually
- started the threads that were not previously running
+
+
+/*
+ SLAVE_FORCE_ALL is not implemented here on purpose since it does not make
+ sense to do that for starting a slave - we always care if it actually
+ started the threads that were not previously running
*/
+
int start_slave_threads(bool need_slave_mutex, bool wait_for_start,
MASTER_INFO* mi, const char* master_info_fname,
const char* slave_info_fname, int thread_mask)
@@ -477,6 +519,7 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start,
pthread_mutex_t *lock_io=0,*lock_sql=0,*lock_cond_io=0,*lock_cond_sql=0;
pthread_cond_t* cond_io=0,*cond_sql=0;
int error=0;
+ DBUG_ENTER("start_slave_threads");
if (need_slave_mutex)
{
@@ -490,22 +533,25 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start,
lock_cond_io = &mi->run_lock;
lock_cond_sql = &mi->rli.run_lock;
}
- if (init_master_info(mi,master_info_fname,slave_info_fname))
- return ER_MASTER_INFO;
-
- if ((thread_mask & SLAVE_IO) &&
- (error=start_slave_thread(handle_slave_io,lock_io,lock_cond_io,
- cond_io,&mi->slave_running,
- mi)))
- return error;
- if ((thread_mask & SLAVE_SQL) &&
- (error=start_slave_thread(handle_slave_sql,lock_sql,lock_cond_sql,
- cond_sql,
- &mi->rli.slave_running,mi)))
- return error;
- return 0;
+
+ if (thread_mask & SLAVE_IO)
+ error=start_slave_thread(handle_slave_io,lock_io,lock_cond_io,
+ cond_io,
+ &mi->slave_running, &mi->slave_run_id,
+ mi);
+ if (!error && (thread_mask & SLAVE_SQL))
+ {
+ error=start_slave_thread(handle_slave_sql,lock_sql,lock_cond_sql,
+ cond_sql,
+ &mi->rli.slave_running, &mi->rli.slave_run_id,
+ mi);
+ if (error)
+ terminate_slave_threads(mi, thread_mask & SLAVE_IO, 0);
+ }
+ DBUG_RETURN(error);
}
+
void init_table_rule_hash(HASH* h, bool* h_inited)
{
hash_init(h, system_charset_info,TABLE_RULE_HASH_SIZE,0,0,
@@ -568,9 +614,10 @@ int tables_ok(THD* thd, TABLE_LIST* tables)
return 0;
}
- // if no explicit rule found
- // and there was a do list, do not replicate. If there was
- // no do list, go ahead
+ /*
+ If no explicit rule found and there was a do list, do not replicate.
+ If there was no do list, go ahead
+ */
return !do_table_inited && !wild_do_table_inited;
}
@@ -578,12 +625,12 @@ int tables_ok(THD* thd, TABLE_LIST* tables)
int add_table_rule(HASH* h, const char* table_spec)
{
const char* dot = strchr(table_spec, '.');
- if(!dot) return 1;
+ if (!dot) return 1;
// len is always > 0 because we know the there exists a '.'
uint len = (uint)strlen(table_spec);
TABLE_RULE_ENT* e = (TABLE_RULE_ENT*)my_malloc(sizeof(TABLE_RULE_ENT)
+ len, MYF(MY_WME));
- if(!e) return 1;
+ if (!e) return 1;
e->db = (char*)e + sizeof(TABLE_RULE_ENT);
e->tbl_name = e->db + (dot - table_spec) + 1;
e->key_len = len;
@@ -595,11 +642,11 @@ int add_table_rule(HASH* h, const char* table_spec)
int add_wild_table_rule(DYNAMIC_ARRAY* a, const char* table_spec)
{
const char* dot = strchr(table_spec, '.');
- if(!dot) return 1;
+ if (!dot) return 1;
uint len = (uint)strlen(table_spec);
TABLE_RULE_ENT* e = (TABLE_RULE_ENT*)my_malloc(sizeof(TABLE_RULE_ENT)
+ len, MYF(MY_WME));
- if(!e) return 1;
+ if (!e) return 1;
e->db = (char*)e + sizeof(TABLE_RULE_ENT);
e->tbl_name = e->db + (dot - table_spec) + 1;
e->key_len = len;
@@ -611,7 +658,7 @@ int add_wild_table_rule(DYNAMIC_ARRAY* a, const char* table_spec)
static void free_string_array(DYNAMIC_ARRAY *a)
{
uint i;
- for(i = 0; i < a->elements; i++)
+ for (i = 0; i < a->elements; i++)
{
char* p;
get_dynamic(a, (gptr) &p, i);
@@ -620,17 +667,22 @@ static void free_string_array(DYNAMIC_ARRAY *a)
delete_dynamic(a);
}
+#ifdef NOT_USED_YET
+
static int end_slave_on_walk(MASTER_INFO* mi, gptr /*unused*/)
{
end_master_info(mi);
return 0;
}
+#endif
void end_slave()
{
- // TODO: replace the line below with
- // list_walk(&master_list, (list_walk_action)end_slave_on_walk,0);
- // once multi-master code is ready
+ /*
+ TODO: replace the line below with
+ list_walk(&master_list, (list_walk_action)end_slave_on_walk,0);
+ once multi-master code is ready.
+ */
terminate_slave_threads(active_mi,SLAVE_FORCE_ALL);
end_master_info(active_mi);
if (do_table_inited)
@@ -643,6 +695,7 @@ void end_slave()
free_string_array(&replicate_wild_ignore_table);
}
+
static bool io_slave_killed(THD* thd, MASTER_INFO* mi)
{
DBUG_ASSERT(mi->io_thd == thd);
@@ -650,6 +703,7 @@ static bool io_slave_killed(THD* thd, MASTER_INFO* mi)
return mi->abort_slave || abort_loop || thd->killed;
}
+
static bool sql_slave_killed(THD* thd, RELAY_LOG_INFO* rli)
{
DBUG_ASSERT(rli->sql_thd == thd);
@@ -657,6 +711,7 @@ static bool sql_slave_killed(THD* thd, RELAY_LOG_INFO* rli)
return rli->abort_slave || abort_loop || thd->killed;
}
+
void slave_print_error(RELAY_LOG_INFO* rli, int err_code, const char* msg, ...)
{
va_list args;
@@ -668,69 +723,74 @@ void slave_print_error(RELAY_LOG_INFO* rli, int err_code, const char* msg, ...)
rli->last_slave_errno = err_code;
}
+
void skip_load_data_infile(NET* net)
{
(void)my_net_write(net, "\xfb/dev/null", 10);
(void)net_flush(net);
- (void)my_net_read(net); // discard response
- send_ok(net); // the master expects it
+ (void)my_net_read(net); // discard response
+ send_ok(net); // the master expects it
}
+
char* rewrite_db(char* db)
{
- if(replicate_rewrite_db.is_empty() || !db) return db;
+ if (replicate_rewrite_db.is_empty() || !db)
+ return db;
I_List_iterator<i_string_pair> it(replicate_rewrite_db);
i_string_pair* tmp;
- while((tmp=it++))
- {
- if(!strcmp(tmp->key, db))
- return tmp->val;
- }
-
+ while ((tmp=it++))
+ {
+ if (!strcmp(tmp->key, db))
+ return tmp->val;
+ }
return db;
}
+
int db_ok(const char* db, I_List<i_string> &do_list,
I_List<i_string> &ignore_list )
{
if (do_list.is_empty() && ignore_list.is_empty())
return 1; // ok to replicate if the user puts no constraints
- // if the user has specified restrictions on which databases to replicate
- // and db was not selected, do not replicate
- if(!db)
+ /*
+ If the user has specified restrictions on which databases to replicate
+ and db was not selected, do not replicate.
+ */
+ if (!db)
return 0;
- if(!do_list.is_empty()) // if the do's are not empty
- {
- I_List_iterator<i_string> it(do_list);
- i_string* tmp;
+ if (!do_list.is_empty()) // if the do's are not empty
+ {
+ I_List_iterator<i_string> it(do_list);
+ i_string* tmp;
- while((tmp=it++))
- {
- if(!strcmp(tmp->ptr, db))
- return 1; // match
- }
- return 0;
+ while ((tmp=it++))
+ {
+ if (!strcmp(tmp->ptr, db))
+ return 1; // match
}
+ return 0;
+ }
else // there are some elements in the don't, otherwise we cannot get here
- {
- I_List_iterator<i_string> it(ignore_list);
- i_string* tmp;
+ {
+ I_List_iterator<i_string> it(ignore_list);
+ i_string* tmp;
- while((tmp=it++))
- {
- if(!strcmp(tmp->ptr, db))
- return 0; // match
- }
-
- return 1;
+ while ((tmp=it++))
+ {
+ if (!strcmp(tmp->ptr, db))
+ return 0; // match
}
+ return 1;
+ }
}
-static int init_strvar_from_file(char* var, int max_size, IO_CACHE* f,
- char* default_val)
+
+static int init_strvar_from_file(char *var, int max_size, IO_CACHE *f,
+ const char *default_val)
{
uint length;
if ((length=my_b_gets(f,var, max_size)))
@@ -740,10 +800,12 @@ static int init_strvar_from_file(char* var, int max_size, IO_CACHE* f,
*last_p = 0; // if we stopped on newline, kill it
else
{
- // if we truncated a line or stopped on last char, remove all chars
- // up to and including newline
+ /*
+ If we truncated a line or stopped on last char, remove all chars
+ up to and including newline.
+ */
int c;
- while( ((c=my_b_get(f)) != '\n' && c != my_b_EOF));
+ while (((c=my_b_get(f)) != '\n' && c != my_b_EOF));
}
return 0;
}
@@ -755,6 +817,7 @@ static int init_strvar_from_file(char* var, int max_size, IO_CACHE* f,
return 1;
}
+
static int init_intvar_from_file(int* var, IO_CACHE* f, int default_val)
{
char buf[32];
@@ -764,7 +827,7 @@ static int init_intvar_from_file(int* var, IO_CACHE* f, int default_val)
*var = atoi(buf);
return 0;
}
- else if(default_val)
+ else if (default_val)
{
*var = default_val;
return 0;
@@ -772,46 +835,24 @@ static int init_intvar_from_file(int* var, IO_CACHE* f, int default_val)
return 1;
}
+
static int check_master_version(MYSQL* mysql, MASTER_INFO* mi)
{
- MYSQL_RES* res;
- MYSQL_ROW row;
- const char* version;
- const char* errmsg = 0;
+ const char* errmsg= 0;
- if (mc_mysql_query(mysql, "SELECT VERSION()", 0)
- || !(res = mc_mysql_store_result(mysql)))
- {
- sql_print_error("Error checking master version: %s",
- mc_mysql_error(mysql));
- return 1;
- }
- if (!(row = mc_mysql_fetch_row(res)))
- {
- errmsg = "Master returned no rows for SELECT VERSION()";
- goto err;
- }
- if (!(version = row[0]))
- {
- errmsg = "Master reported NULL for the version";
- goto err;
- }
-
- switch (*version)
- {
+ switch (*mysql->server_version) {
case '3':
mi->old_format = 1;
break;
case '4':
+ case '5':
mi->old_format = 0;
break;
default:
errmsg = "Master reported unrecognized MySQL version";
- goto err;
+ break;
}
-err:
- if (res)
- mc_mysql_free_result(res);
+
if (errmsg)
{
sql_print_error(errmsg);
@@ -830,7 +871,7 @@ static int create_table_from_dump(THD* thd, NET* net, const char* db,
TABLE_LIST tables;
int error= 1;
handler *file;
- uint save_options;
+ ulong save_options;
if (packet_len == packet_error)
{
@@ -859,7 +900,7 @@ static int create_table_from_dump(THD* thd, NET* net, const char* db,
/* we do not want to log create table statement */
save_options = thd->options;
- thd->options &= ~OPTION_BIN_LOG;
+ thd->options &= ~(ulong) (OPTION_BIN_LOG);
thd->proc_info = "Creating table from master dump";
// save old db in case we are creating in a different database
char* save_db = thd->db;
@@ -896,9 +937,11 @@ static int create_table_from_dump(THD* thd, NET* net, const char* db,
check_opt.init();
check_opt.flags|= T_VERY_SILENT | T_CALC_CHECKSUM | T_QUICK;
thd->proc_info = "Rebuilding the index on master dump table";
- // we do not want repair() to spam us with messages
- // just send them to the error log, and report the failure in case of
- // problems
+ /*
+ We do not want repair() to spam us with messages
+ just send them to the error log, and report the failure in case of
+ problems.
+ */
save_vio = thd->net.vio;
thd->net.vio = 0;
error=file->repair(thd,&check_opt) != 0;
@@ -912,82 +955,84 @@ err:
return error;
}
-int fetch_master_table(THD* thd, const char* db_name, const char* table_name,
- MASTER_INFO* mi, MYSQL* mysql)
+int fetch_master_table(THD *thd, const char *db_name, const char *table_name,
+ MASTER_INFO *mi, MYSQL *mysql)
{
- int error = 1;
- int fetch_errno = 0;
- bool called_connected = (mysql != NULL);
- if (!called_connected && !(mysql = mc_mysql_init(NULL)))
- {
- sql_print_error("fetch_master_table: Error in mysql_init()");
- fetch_errno = ER_GET_ERRNO;
- goto err;
- }
+ int error= 1;
+ const char *errmsg=0;
+ bool called_connected= (mysql != NULL);
+ DBUG_ENTER("fetch_master_table");
+ DBUG_PRINT("enter", ("db_name: '%s' table_name: '%s'",
+ db_name,table_name));
if (!called_connected)
- {
+ {
+ if (!(mysql = mc_mysql_init(NULL)))
+ {
+ send_error(&thd->net); // EOM
+ DBUG_RETURN(1);
+ }
if (connect_to_master(thd, mysql, mi))
{
- sql_print_error("Could not connect to master while fetching table\
- '%-64s.%-64s'", db_name, table_name);
- fetch_errno = ER_CONNECT_TO_MASTER;
- goto err;
+ net_printf(&thd->net, ER_CONNECT_TO_MASTER, mc_mysql_error(mysql));
+ mc_mysql_close(mysql);
+ DBUG_RETURN(1);
}
+ if (thd->killed)
+ goto err;
}
- if (thd->killed)
- goto err;
if (request_table_dump(mysql, db_name, table_name))
{
- fetch_errno = ER_GET_ERRNO;
- sql_print_error("fetch_master_table: failed on table dump request ");
+ error= ER_UNKNOWN_ERROR;
+ errmsg= "Failed on table dump request";
goto err;
}
-
if (create_table_from_dump(thd, &mysql->net, db_name,
table_name))
- {
- // create_table_from_dump will have sent the error alread
- sql_print_error("fetch_master_table: failed on create table ");
- goto err;
- }
+ goto err; // create_table_from_dump will have sent the error already
error = 0;
+
err:
- if (mysql && !called_connected)
- mc_mysql_close(mysql);
- if (fetch_errno && thd->net.vio)
- send_error(&thd->net, fetch_errno, "Error in fetch_master_table");
thd->net.no_send_ok = 0; // Clear up garbage after create_table_from_dump
- return error;
+ if (!called_connected)
+ mc_mysql_close(mysql);
+ if (errmsg && thd->net.vio)
+ send_error(&thd->net, error, errmsg);
+ DBUG_RETURN(test(error)); // Return 1 on error
}
+
void end_master_info(MASTER_INFO* mi)
{
+ DBUG_ENTER("end_master_info");
+
if (!mi->inited)
- return;
+ DBUG_VOID_RETURN;
end_relay_log_info(&mi->rli);
if (mi->fd >= 0)
- {
- end_io_cache(&mi->file);
- (void)my_close(mi->fd, MYF(MY_WME));
- mi->fd = -1;
- }
+ {
+ end_io_cache(&mi->file);
+ (void)my_close(mi->fd, MYF(MY_WME));
+ mi->fd = -1;
+ }
mi->inited = 0;
+
+ DBUG_VOID_RETURN;
}
+
int init_relay_log_info(RELAY_LOG_INFO* rli, const char* info_fname)
{
- DBUG_ENTER("init_relay_log_info");
- if (rli->inited)
- DBUG_RETURN(0);
- MY_STAT stat_area;
char fname[FN_REFLEN+128];
int info_fd;
const char* msg = 0;
int error = 0;
- fn_format(fname, info_fname,
- mysql_data_home, "", 4+32);
+ DBUG_ENTER("init_relay_log_info");
+
+ if (rli->inited) // Set if this function called
+ DBUG_RETURN(0);
+ fn_format(fname, info_fname, mysql_data_home, "", 4+32);
pthread_mutex_lock(&rli->data_lock);
info_fd = rli->info_fd;
rli->pending = 0;
@@ -998,105 +1043,119 @@ int init_relay_log_info(RELAY_LOG_INFO* rli, const char* info_fname)
rli->skip_log_purge=0;
rli->log_space_limit = relay_log_space_limit;
rli->log_space_total = 0;
+
// TODO: make this work with multi-master
if (!opt_relay_logname)
{
char tmp[FN_REFLEN];
- /* TODO: The following should be using fn_format(); We just need to
- first change fn_format() to cut the file name if it's too long.
+ /*
+ TODO: The following should be using fn_format(); We just need to
+ first change fn_format() to cut the file name if it's too long.
*/
strmake(tmp,glob_hostname,FN_REFLEN-5);
strmov(strcend(tmp,'.'),"-relay-bin");
opt_relay_logname=my_strdup(tmp,MYF(MY_WME));
}
- rli->relay_log.set_index_file_name(opt_relaylog_index_name);
- open_log(&rli->relay_log, glob_hostname, opt_relay_logname, "-relay-bin",
- LOG_BIN, 1 /* read_append cache */,
- 1 /* no auto events*/);
-
+ if (open_log(&rli->relay_log, glob_hostname, opt_relay_logname,
+ "-relay-bin", opt_relaylog_index_name,
+ LOG_BIN, 1 /* read_append cache */,
+ 1 /* no auto events */))
+ DBUG_RETURN(1);
+
/* if file does not exist */
- if (!my_stat(fname, &stat_area, MYF(0)))
+ if (access(fname,F_OK))
{
- // if someone removed the file from underneath our feet, just close
- // the old descriptor and re-create the old file
+ /*
+ If someone removed the file from underneath our feet, just close
+ the old descriptor and re-create the old file
+ */
if (info_fd >= 0)
my_close(info_fd, MYF(MY_WME));
- if ((info_fd = my_open(fname, O_CREAT|O_RDWR|O_BINARY, MYF(MY_WME))) < 0
- || init_io_cache(&rli->info_file, info_fd, IO_SIZE*2, READ_CACHE, 0L,0,
- MYF(MY_WME)))
+ if ((info_fd = my_open(fname, O_CREAT|O_RDWR|O_BINARY, MYF(MY_WME))) < 0 ||
+ init_io_cache(&rli->info_file, info_fd, IO_SIZE*2, READ_CACHE, 0L,0,
+ MYF(MY_WME)))
{
- if(info_fd >= 0)
- my_close(info_fd, MYF(0));
- rli->info_fd=-1;
- pthread_mutex_unlock(&rli->data_lock);
- DBUG_RETURN(1);
+ msg= current_thd->net.last_error;
+ goto err;
}
- if (init_relay_log_pos(rli,"",4,0/*no data mutex*/,&msg))
+
+ /* Init relay log with first entry in the relay index file */
+ if (init_relay_log_pos(rli,NullS,BIN_LOG_HEADER_SIZE,0 /* no data lock */,
+ &msg))
goto err;
rli->master_log_pos = 0; // uninitialized
rli->info_fd = info_fd;
}
else // file exists
{
- if(info_fd >= 0)
+ if (info_fd >= 0)
reinit_io_cache(&rli->info_file, READ_CACHE, 0L,0,0);
- else if((info_fd = my_open(fname, O_RDWR|O_BINARY, MYF(MY_WME))) < 0
- || init_io_cache(&rli->info_file, info_fd,
- IO_SIZE*2, READ_CACHE, 0L,
- 0, MYF(MY_WME)))
+ else if ((info_fd = my_open(fname, O_RDWR|O_BINARY, MYF(MY_WME))) < 0 ||
+ init_io_cache(&rli->info_file, info_fd,
+ IO_SIZE*2, READ_CACHE, 0L, 0, MYF(MY_WME)))
{
if (info_fd >= 0)
my_close(info_fd, MYF(0));
- rli->info_fd=-1;
+ rli->info_fd= -1;
+ rli->relay_log.close(1);
pthread_mutex_unlock(&rli->data_lock);
DBUG_RETURN(1);
}
rli->info_fd = info_fd;
+ int relay_log_pos, master_log_pos;
if (init_strvar_from_file(rli->relay_log_name,
- sizeof(rli->relay_log_name), &rli->info_file,
- (char*)"") ||
- init_intvar_from_file((int*)&rli->relay_log_pos,
- &rli->info_file, 4) ||
+ sizeof(rli->relay_log_name), &rli->info_file,
+ "") ||
+ init_intvar_from_file(&relay_log_pos,
+ &rli->info_file, BIN_LOG_HEADER_SIZE) ||
init_strvar_from_file(rli->master_log_name,
sizeof(rli->master_log_name), &rli->info_file,
- (char*)"") ||
- init_intvar_from_file((int*)&rli->master_log_pos,
- &rli->info_file, 0))
+ "") ||
+ init_intvar_from_file(&master_log_pos, &rli->info_file, 0))
{
msg="Error reading slave log configuration";
goto err;
}
- if (init_relay_log_pos(rli,0 /*log already inited*/,
- 0 /*pos already inited*/,
+ rli->relay_log_pos= relay_log_pos;
+ rli->master_log_pos= master_log_pos;
+
+ if (init_relay_log_pos(rli,
+ rli->relay_log_name,
+ rli->relay_log_pos,
0 /* no data lock*/,
&msg))
- goto err;
+ goto err;
}
- DBUG_ASSERT(rli->relay_log_pos >= 4);
+ DBUG_ASSERT(rli->relay_log_pos >= BIN_LOG_HEADER_SIZE);
DBUG_ASSERT(my_b_tell(rli->cur_log) == rli->relay_log_pos);
- rli->inited = 1;
- // now change the cache from READ to WRITE - must do this
- // before flush_relay_log_info
+ /*
+ Now change the cache from READ to WRITE - must do this
+ before flush_relay_log_info
+ */
reinit_io_cache(&rli->info_file, WRITE_CACHE,0L,0,1);
- error=test(flush_relay_log_info(rli));
+ error= flush_relay_log_info(rli);
if (count_relay_log_space(rli))
{
msg="Error counting relay log space";
goto err;
}
+ rli->inited= 1;
pthread_mutex_unlock(&rli->data_lock);
DBUG_RETURN(error);
err:
sql_print_error(msg);
end_io_cache(&rli->info_file);
- my_close(info_fd, MYF(0));
- rli->info_fd=-1;
+ if (info_fd >= 0)
+ my_close(info_fd, MYF(0));
+ rli->info_fd= -1;
+ rli->relay_log.close(1);
pthread_mutex_unlock(&rli->data_lock);
DBUG_RETURN(1);
}
+
static inline int add_relay_log(RELAY_LOG_INFO* rli,LOG_INFO* linfo)
{
MY_STAT s;
@@ -1110,11 +1169,12 @@ static inline int add_relay_log(RELAY_LOG_INFO* rli,LOG_INFO* linfo)
rli->log_space_total += s.st_size;
#ifndef DBUG_OFF
char buf[22];
-#endif
DBUG_PRINT("info",("log_space_total: %s", llstr(rli->log_space_total,buf)));
+#endif
DBUG_RETURN(0);
}
+
static bool wait_for_relay_log_space(RELAY_LOG_INFO* rli)
{
bool slave_killed=0;
@@ -1138,41 +1198,39 @@ static bool wait_for_relay_log_space(RELAY_LOG_INFO* rli)
DBUG_RETURN(slave_killed);
}
+
static int count_relay_log_space(RELAY_LOG_INFO* rli)
{
LOG_INFO linfo;
DBUG_ENTER("count_relay_log_space");
rli->log_space_total = 0;
- if (rli->relay_log.find_first_log(&linfo,""))
+ if (rli->relay_log.find_log_pos(&linfo, NullS, 1))
{
sql_print_error("Could not find first log while counting relay log space");
DBUG_RETURN(1);
}
- if (add_relay_log(rli,&linfo))
- DBUG_RETURN(1);
- while (!rli->relay_log.find_next_log(&linfo))
+ do
{
if (add_relay_log(rli,&linfo))
DBUG_RETURN(1);
- }
+ } while (!rli->relay_log.find_next_log(&linfo, 1));
DBUG_RETURN(0);
}
+
int init_master_info(MASTER_INFO* mi, const char* master_info_fname,
- const char* slave_info_fname)
+ const char* slave_info_fname,
+ bool abort_if_no_master_info_file)
{
+ int fd,error;
+ char fname[FN_REFLEN+128];
+ DBUG_ENTER("init_master_info");
+
if (mi->inited)
- return 0;
- if (init_relay_log_info(&mi->rli, slave_info_fname))
- return 1;
- mi->rli.mi = mi;
+ DBUG_RETURN(0);
mi->mysql=0;
mi->file_id=1;
mi->ignore_stop_event=0;
- int fd,error;
- MY_STAT stat_area;
- char fname[FN_REFLEN+128];
- const char *msg;
fn_format(fname, master_info_fname, mysql_data_home, "", 4+32);
/*
@@ -1183,26 +1241,26 @@ int init_master_info(MASTER_INFO* mi, const char* master_info_fname,
pthread_mutex_lock(&mi->data_lock);
fd = mi->fd;
- // we do not want any messages if the file does not exist
- if (!my_stat(fname, &stat_area, MYF(0)))
+ if (access(fname,F_OK))
{
- // if someone removed the file from underneath our feet, just close
- // the old descriptor and re-create the old file
- if (fd >= 0)
- my_close(fd, MYF(MY_WME));
- if ((fd = my_open(fname, O_CREAT|O_RDWR|O_BINARY, MYF(MY_WME))) < 0
- || init_io_cache(&mi->file, fd, IO_SIZE*2, READ_CACHE, 0L,0,
- MYF(MY_WME)))
+ if (abort_if_no_master_info_file)
{
- if(fd >= 0)
- my_close(fd, MYF(0));
- mi->fd=-1;
- end_relay_log_info(&mi->rli);
pthread_mutex_unlock(&mi->data_lock);
- return 1;
+ DBUG_RETURN(0);
}
+ /*
+ if someone removed the file from underneath our feet, just close
+ the old descriptor and re-create the old file
+ */
+ if (fd >= 0)
+ my_close(fd, MYF(MY_WME));
+ if ((fd = my_open(fname, O_CREAT|O_RDWR|O_BINARY, MYF(MY_WME))) < 0 ||
+ init_io_cache(&mi->file, fd, IO_SIZE*2, READ_CACHE, 0L,0,
+ MYF(MY_WME)))
+ goto err;
+
mi->master_log_name[0] = 0;
- mi->master_log_pos = 4; // skip magic number
+ mi->master_log_pos = BIN_LOG_HEADER_SIZE; // skip magic number
mi->fd = fd;
if (master_host)
@@ -1216,58 +1274,68 @@ int init_master_info(MASTER_INFO* mi, const char* master_info_fname,
}
else // file exists
{
- if(fd >= 0)
+ if (fd >= 0)
reinit_io_cache(&mi->file, READ_CACHE, 0L,0,0);
- else if((fd = my_open(fname, O_RDWR|O_BINARY, MYF(MY_WME))) < 0
- || init_io_cache(&mi->file, fd, IO_SIZE*2, READ_CACHE, 0L,
- 0, MYF(MY_WME)))
- {
- if(fd >= 0)
- my_close(fd, MYF(0));
- mi->fd=-1;
- end_relay_log_info(&mi->rli);
- pthread_mutex_unlock(&mi->data_lock);
- return 1;
- }
+ else if ((fd = my_open(fname, O_RDWR|O_BINARY, MYF(MY_WME))) < 0 ||
+ init_io_cache(&mi->file, fd, IO_SIZE*2, READ_CACHE, 0L,
+ 0, MYF(MY_WME)))
+ goto err;
mi->fd = fd;
+ int port, connect_retry, master_log_pos;
+
if (init_strvar_from_file(mi->master_log_name,
sizeof(mi->master_log_name), &mi->file,
- (char*)"") ||
- init_intvar_from_file((int*)&mi->master_log_pos, &mi->file, 4) ||
+ "") ||
+ init_intvar_from_file(&master_log_pos, &mi->file, 4) ||
init_strvar_from_file(mi->host, sizeof(mi->host), &mi->file,
master_host) ||
init_strvar_from_file(mi->user, sizeof(mi->user), &mi->file,
master_user) ||
init_strvar_from_file(mi->password, HASH_PASSWORD_LENGTH+1, &mi->file,
master_password) ||
- init_intvar_from_file((int*)&mi->port, &mi->file, master_port) ||
- init_intvar_from_file((int*)&mi->connect_retry, &mi->file,
+ init_intvar_from_file(&port, &mi->file, master_port) ||
+ init_intvar_from_file(&connect_retry, &mi->file,
master_connect_retry))
{
- msg="Error reading master configuration";
+ sql_print_error("Error reading master configuration");
goto err;
}
+ /*
+ This has to be handled here as init_intvar_from_file can't handle
+ my_off_t types
+ */
+ mi->master_log_pos= (my_off_t) master_log_pos;
+ mi->port= (uint) port;
+ mi->connect_retry= (uint) connect_retry;
}
-
+ DBUG_PRINT("master_info",("log_file_name: %s position: %ld",
+ mi->master_log_name,
+ (ulong) mi->master_log_pos));
+
+ if (init_relay_log_info(&mi->rli, slave_info_fname))
+ goto err;
+ mi->rli.mi = mi;
+
mi->inited = 1;
// now change cache READ -> WRITE - must do this before flush_master_info
reinit_io_cache(&mi->file, WRITE_CACHE,0L,0,1);
error=test(flush_master_info(mi));
pthread_mutex_unlock(&mi->data_lock);
- return error;
+ DBUG_RETURN(error);
err:
- sql_print_error(msg);
- end_io_cache(&mi->file);
- end_relay_log_info(&mi->rli);
- DBUG_ASSERT(fd>=0);
- my_close(fd, MYF(0));
- mi->fd=-1;
+ if (fd >= 0)
+ {
+ my_close(fd, MYF(0));
+ end_io_cache(&mi->file);
+ }
+ mi->fd= -1;
pthread_mutex_unlock(&mi->data_lock);
- return 1;
+ DBUG_RETURN(1);
}
+
int register_slave_on_master(MYSQL* mysql)
{
String packet;
@@ -1285,7 +1353,7 @@ int register_slave_on_master(MYSQL* mysql)
else
packet.append((char)0);
- if(report_password)
+ if (report_password)
net_store_data(&packet, report_user);
else
packet.append((char)0);
@@ -1300,7 +1368,8 @@ int register_slave_on_master(MYSQL* mysql)
if (mc_simple_command(mysql, COM_REGISTER_SLAVE, (char*)packet.ptr(),
packet.length(), 0))
{
- sql_print_error("Error on COM_REGISTER_SLAVE: '%s'",
+ sql_print_error("Error on COM_REGISTER_SLAVE: %d '%s'",
+ mc_mysql_errno(mysql),
mc_mysql_error(mysql));
return 1;
}
@@ -1336,48 +1405,53 @@ int show_master_info(THD* thd, MASTER_INFO* mi)
field_list.push_back(new Item_empty_string("Skip_counter", 12));
field_list.push_back(new Item_empty_string("Exec_master_log_pos", 12));
field_list.push_back(new Item_empty_string("Relay_log_space", 12));
- if(send_fields(thd, field_list, 1))
+ if (send_fields(thd, field_list, 1))
DBUG_RETURN(-1);
- String* packet = &thd->packet;
- packet->length(0);
+ if (mi->host[0])
+ {
+ String *packet= &thd->packet;
+ packet->length(0);
- pthread_mutex_lock(&mi->data_lock);
- pthread_mutex_lock(&mi->rli.data_lock);
- net_store_data(packet, mi->host);
- net_store_data(packet, mi->user);
- net_store_data(packet, (uint32) mi->port);
- net_store_data(packet, (uint32) mi->connect_retry);
- net_store_data(packet, mi->master_log_name);
- net_store_data(packet, (longlong) mi->master_log_pos);
- net_store_data(packet, mi->rli.relay_log_name +
- dirname_length(mi->rli.relay_log_name));
- net_store_data(packet, (longlong) mi->rli.relay_log_pos);
- net_store_data(packet, mi->rli.master_log_name);
- net_store_data(packet, mi->slave_running ? "Yes":"No");
- net_store_data(packet, mi->rli.slave_running ? "Yes":"No");
- net_store_data(packet, &replicate_do_db);
- net_store_data(packet, &replicate_ignore_db);
- net_store_data(packet, (uint32)mi->rli.last_slave_errno);
- net_store_data(packet, mi->rli.last_slave_error);
- net_store_data(packet, mi->rli.slave_skip_counter);
- net_store_data(packet, (longlong) mi->rli.master_log_pos);
- net_store_data(packet, (longlong) mi->rli.log_space_total);
- pthread_mutex_unlock(&mi->rli.data_lock);
- pthread_mutex_unlock(&mi->data_lock);
+ pthread_mutex_lock(&mi->data_lock);
+ pthread_mutex_lock(&mi->rli.data_lock);
+ net_store_data(packet, mi->host);
+ net_store_data(packet, mi->user);
+ net_store_data(packet, (uint32) mi->port);
+ net_store_data(packet, (uint32) mi->connect_retry);
+ net_store_data(packet, mi->master_log_name);
+ net_store_data(packet, (longlong) mi->master_log_pos);
+ net_store_data(packet, mi->rli.relay_log_name +
+ dirname_length(mi->rli.relay_log_name));
+ net_store_data(packet, (longlong) mi->rli.relay_log_pos);
+ net_store_data(packet, mi->rli.master_log_name);
+ net_store_data(packet, mi->slave_running ? "Yes":"No");
+ net_store_data(packet, mi->rli.slave_running ? "Yes":"No");
+ net_store_data(packet, &replicate_do_db);
+ net_store_data(packet, &replicate_ignore_db);
+ net_store_data(packet, (uint32)mi->rli.last_slave_errno);
+ net_store_data(packet, mi->rli.last_slave_error);
+ net_store_data(packet, mi->rli.slave_skip_counter);
+ net_store_data(packet, (longlong) mi->rli.master_log_pos);
+ net_store_data(packet, (longlong) mi->rli.log_space_total);
+ pthread_mutex_unlock(&mi->rli.data_lock);
+ pthread_mutex_unlock(&mi->data_lock);
- if (my_net_write(&thd->net, (char*)thd->packet.ptr(), packet->length()))
- DBUG_RETURN(-1);
-
+ if (my_net_write(&thd->net, (char*)thd->packet.ptr(), packet->length()))
+ DBUG_RETURN(-1);
+ }
send_eof(&thd->net);
DBUG_RETURN(0);
}
-int flush_master_info(MASTER_INFO* mi)
+
+bool flush_master_info(MASTER_INFO* mi)
{
IO_CACHE* file = &mi->file;
char lbuf[22];
-
+ DBUG_ENTER("flush_master_info");
+ DBUG_PRINT("enter",("master_pos: %ld", (long) mi->master_log_pos));
+
my_b_seek(file, 0L);
my_b_printf(file, "%s\n%s\n%s\n%s\n%s\n%d\n%d\n%d\n",
mi->master_log_name, llstr(mi->master_log_pos, lbuf),
@@ -1385,43 +1459,43 @@ int flush_master_info(MASTER_INFO* mi)
mi->password, mi->port, mi->connect_retry
);
flush_io_cache(file);
- return 0;
+ DBUG_RETURN(0);
}
+
int st_relay_log_info::wait_for_pos(THD* thd, String* log_name,
ulonglong log_pos)
{
- if (!inited) return -1;
- bool pos_reached = 0;
+ if (!inited)
+ return -1;
int event_count = 0;
+ ulong init_abort_pos_wait;
+ DBUG_ENTER("wait_for_pos");
+
pthread_mutex_lock(&data_lock);
- abort_pos_wait=0; // abort only if master info changes during wait
- while (!thd->killed || !abort_pos_wait)
+ // abort only if master info changes during wait
+ init_abort_pos_wait= abort_pos_wait;
+
+ while (!thd->killed &&
+ init_abort_pos_wait == abort_pos_wait &&
+ mi->slave_running)
{
- int cmp_result;
- if (abort_pos_wait)
- {
- abort_pos_wait=0;
- pthread_mutex_unlock(&data_lock);
- return -1;
- }
+ bool pos_reached;
+ int cmp_result= 0;
DBUG_ASSERT(*master_log_name || master_log_pos == 0);
if (*master_log_name)
{
/*
- We should use dirname_length() here when we have a version of
- this that doesn't modify the argument */
- char *basename = strrchr(master_log_name, FN_LIBCHAR);
- if (basename)
- ++basename;
- else
- basename = master_log_name;
+ TODO:
+ Replace strncmp() with a comparison function that
+ can handle comparison of the following files:
+ mysqlbin.999
+ mysqlbin.1000
+ */
+ char *basename= master_log_name + dirname_length(master_log_name);
cmp_result = strncmp(basename, log_name->ptr(),
log_name->length());
}
- else
- cmp_result = 0;
-
pos_reached = ((!cmp_result && master_log_pos >= log_pos) ||
cmp_result > 0);
if (pos_reached || thd->killed)
@@ -1434,17 +1508,23 @@ int st_relay_log_info::wait_for_pos(THD* thd, String* log_name,
event_count++;
}
pthread_mutex_unlock(&data_lock);
- return thd->killed ? -1 : event_count;
+ DBUG_PRINT("exit",("killed: %d abort: %d slave_running: %d",
+ (int) thd->killed,
+ (int) (init_abort_pos_wait != abort_pos_wait),
+ (int) mi->slave_running));
+ DBUG_RETURN((thd->killed || init_abort_pos_wait != abort_pos_wait ||
+ !mi->slave_running) ?
+ -1 : event_count);
}
+
static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
{
DBUG_ENTER("init_slave_thread");
thd->system_thread = thd->bootstrap = 1;
thd->client_capabilities = 0;
my_net_init(&thd->net, 0);
- thd->net.timeout = slave_net_timeout;
- thd->max_packet_length=thd->net.max_packet;
+ thd->net.read_timeout = slave_net_timeout;
thd->master_access= ~0;
thd->priv_user = 0;
thd->slave_thread = 1;
@@ -1470,45 +1550,39 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals));
#endif
- if (thd->max_join_size == (ulong) ~0L)
+ if ((ulong) thd->variables.max_join_size == (ulong) HA_POS_ERROR)
thd->options |= OPTION_BIG_SELECTS;
if (thd_type == SLAVE_THD_SQL)
- {
- thd->proc_info = "Waiting for the next event in slave queue";
- }
+ thd->proc_info= "Waiting for the next event in slave queue";
else
- {
- thd->proc_info="Waiting for master update";
- }
+ thd->proc_info= "Waiting for master update";
thd->version=refresh_version;
thd->set_time();
DBUG_RETURN(0);
}
+
static int safe_sleep(THD* thd, int sec, CHECK_KILLED_FUNC thread_killed,
void* thread_killed_arg)
{
+ int nap_time;
thr_alarm_t alarmed;
thr_alarm_init(&alarmed);
time_t start_time= time((time_t*) 0);
time_t end_time= start_time+sec;
- ALARM alarm_buff;
- while (start_time < end_time)
+ while ((nap_time= (int) (end_time - start_time)) > 0)
{
- int nap_time = (int) (end_time - start_time);
+ ALARM alarm_buff;
/*
- the only reason we are asking for alarm is so that
+ The only reason we are asking for alarm is so that
we will be woken up in case of murder, so if we do not get killed,
set the alarm so it goes off after we wake up naturally
*/
- thr_alarm(&alarmed, 2 * nap_time,&alarm_buff);
+ thr_alarm(&alarmed, 2 * nap_time, &alarm_buff);
sleep(nap_time);
- // if we wake up before the alarm goes off, hit the button
- // so it will not wake up the wife and kids :-)
- if (thr_alarm_in_use(&alarmed))
- thr_end_alarm(&alarmed);
+ thr_end_alarm(&alarmed);
if ((*thread_killed)(thd,thread_killed_arg))
return 1;
@@ -1517,12 +1591,16 @@ static int safe_sleep(THD* thd, int sec, CHECK_KILLED_FUNC thread_killed,
return 0;
}
-static int request_dump(MYSQL* mysql, MASTER_INFO* mi)
+
+static int request_dump(MYSQL* mysql, MASTER_INFO* mi,
+ bool *suppress_warnings)
{
char buf[FN_REFLEN + 10];
int len;
int binlog_flags = 0; // for now
char* logname = mi->master_log_name;
+ DBUG_ENTER("request_dump");
+
// TODO if big log files: Change next to int8store()
int4store(buf, (longlong) mi->master_log_pos);
int2store(buf + 4, binlog_flags);
@@ -1531,28 +1609,35 @@ static int request_dump(MYSQL* mysql, MASTER_INFO* mi)
memcpy(buf + 10, logname,len);
if (mc_simple_command(mysql, COM_BINLOG_DUMP, buf, len + 10, 1))
{
- // something went wrong, so we will just reconnect and retry later
- // in the future, we should do a better error analysis, but for
- // now we just fill up the error log :-)
- sql_print_error("Error on COM_BINLOG_DUMP: %s, will retry in %d secs",
- mc_mysql_error(mysql), master_connect_retry);
- return 1;
+ /*
+ Something went wrong, so we will just reconnect and retry later
+ in the future, we should do a better error analysis, but for
+ now we just fill up the error log :-)
+ */
+ if (mc_mysql_errno(mysql) == ER_NET_READ_INTERRUPTED)
+ *suppress_warnings= 1; // Suppress reconnect warning
+ else
+ sql_print_error("Error on COM_BINLOG_DUMP: %d %s, will retry in %d secs",
+ mc_mysql_errno(mysql), mc_mysql_error(mysql),
+ master_connect_retry);
+ DBUG_RETURN(1);
}
- return 0;
+ DBUG_RETURN(0);
}
+
static int request_table_dump(MYSQL* mysql, const char* db, const char* table)
{
char buf[1024];
char * p = buf;
uint table_len = (uint) strlen(table);
uint db_len = (uint) strlen(db);
- if(table_len + db_len > sizeof(buf) - 2)
- {
- sql_print_error("request_table_dump: Buffer overrun");
- return 1;
- }
+ if (table_len + db_len > sizeof(buf) - 2)
+ {
+ sql_print_error("request_table_dump: Buffer overrun");
+ return 1;
+ }
*p++ = db_len;
memcpy(p, db, db_len);
@@ -1570,24 +1655,57 @@ command");
return 0;
}
-static ulong read_event(MYSQL* mysql, MASTER_INFO *mi)
+
+/*
+ read one event from the master
+
+ SYNOPSIS
+ read_event()
+ mysql MySQL connection
+ mi Master connection information
+ suppress_warnings TRUE when a normal net read timeout has caused us to
+ try a reconnect. We do not want to print anything to
+ the error log in this case because this a anormal
+ event in an idle server.
+
+ RETURN VALUES
+ 'packet_error' Error
+ number Length of packet
+
+*/
+
+static ulong read_event(MYSQL* mysql, MASTER_INFO *mi, bool* suppress_warnings)
{
- ulong len = packet_error;
+ ulong len;
+
+ *suppress_warnings= 0;
+ /*
+ my_real_read() will time us out
+ We check if we were told to die, and if not, try reading again
- // my_real_read() will time us out
- // we check if we were told to die, and if not, try reading again
+ TODO: Move 'events_till_disconnect' to the MASTER_INFO structure
+ */
#ifndef DBUG_OFF
if (disconnect_slave_event_count && !(events_till_disconnect--))
return packet_error;
#endif
len = mc_net_safe_read(mysql);
-
if (len == packet_error || (long) len < 1)
{
- sql_print_error("Error reading packet from server: %s (\
+ if (mc_mysql_errno(mysql) == ER_NET_READ_INTERRUPTED)
+ {
+ /*
+ We are trying a normal reconnect after a read timeout;
+ we suppress prints to .err file as long as the reconnect
+ happens without problems
+ */
+ *suppress_warnings= TRUE;
+ }
+ else
+ sql_print_error("Error reading packet from server: %s (\
server_errno=%d)",
- mc_mysql_error(mysql), mc_mysql_errno(mysql));
+ mc_mysql_error(mysql), mc_mysql_errno(mysql));
return packet_error;
}
@@ -1604,28 +1722,29 @@ server_errno=%d)",
return len - 1;
}
+
int check_expected_error(THD* thd, RELAY_LOG_INFO* rli, int expected_error)
{
- switch (expected_error)
- {
- case ER_NET_READ_ERROR:
- case ER_NET_ERROR_ON_WRITE:
- case ER_SERVER_SHUTDOWN:
- case ER_NEW_ABORTING_CONNECTION:
- my_snprintf(rli->last_slave_error, sizeof(rli->last_slave_error),
- "Slave: query '%s' partially completed on the master \
+ switch (expected_error) {
+ case ER_NET_READ_ERROR:
+ case ER_NET_ERROR_ON_WRITE:
+ case ER_SERVER_SHUTDOWN:
+ case ER_NEW_ABORTING_CONNECTION:
+ my_snprintf(rli->last_slave_error, sizeof(rli->last_slave_error),
+ "Slave: query '%s' partially completed on the master \
and was aborted. There is a chance that your master is inconsistent at this \
point. If you are sure that your master is ok, run this query manually on the\
slave and then restart the slave with SET SQL_SLAVE_SKIP_COUNTER=1;\
SLAVE START;", thd->query);
- rli->last_slave_errno = expected_error;
- sql_print_error("%s",rli->last_slave_error);
- return 1;
- default:
- return 0;
- }
+ rli->last_slave_errno = expected_error;
+ sql_print_error("%s",rli->last_slave_error);
+ return 1;
+ default:
+ return 0;
+ }
}
+
static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
{
DBUG_ASSERT(rli->sql_thd==thd);
@@ -1638,7 +1757,15 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
int type_code = ev->get_type_code();
int exec_res;
pthread_mutex_lock(&rli->data_lock);
- if (ev->server_id == ::server_id ||
+
+ /*
+ Skip queries originating from this server or number of
+ queries specified by the user in slave_skip_counter
+ We can't however skip event's that has something to do with the
+ log files themselves.
+ */
+
+ if (ev->server_id == (uint32) ::server_id ||
(rli->slave_skip_counter && type_code != ROTATE_EVENT))
{
/* TODO: I/O thread should not even log events with the same server id */
@@ -1646,12 +1773,14 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
type_code != STOP_EVENT ? ev->log_pos : LL(0),
1/* skip lock*/);
flush_relay_log_info(rli);
- if (rli->slave_skip_counter && /* protect against common user error of
- setting the counter to 1 instead of 2
- while recovering from an failed
- auto-increment insert */
- !((type_code == INTVAR_EVENT || type_code == STOP_EVENT) &&
- rli->slave_skip_counter == 1))
+
+ /*
+ Protect against common user error of setting the counter to 1
+ instead of 2 while recovering from an failed auto-increment insert
+ */
+ if (rli->slave_skip_counter &&
+ !((type_code == INTVAR_EVENT || type_code == STOP_EVENT) &&
+ rli->slave_skip_counter == 1))
--rli->slave_skip_counter;
pthread_mutex_unlock(&rli->data_lock);
delete ev;
@@ -1680,28 +1809,35 @@ This may also be a network problem, or just a bug in the master or slave code.\
}
}
+
/* slave I/O thread */
pthread_handler_decl(handle_slave_io,arg)
{
+ THD *thd; // needs to be first for thread_stack
+ MYSQL *mysql;
+ MASTER_INFO *mi = (MASTER_INFO*)arg;
+ char llbuff[22];
+ uint retry_count;
+
+ // needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff
+ my_thread_init();
+
#ifndef DBUG_OFF
slave_begin:
#endif
- THD *thd; // needs to be first for thread_stack
- MYSQL *mysql = NULL ;
- MASTER_INFO* mi = (MASTER_INFO*)arg;
- char llbuff[22];
- bool retried_once = 0;
- ulonglong last_failed_pos = 0; // TODO: see if last_failed_pos is needed
DBUG_ASSERT(mi->inited);
-
+ mysql= NULL ;
+ retry_count= 0;
+
pthread_mutex_lock(&mi->run_lock);
+ /* Inform waiting threads that slave has started */
+ mi->slave_run_id++;
+
#ifndef DBUG_OFF
mi->events_till_abort = abort_slave_event_count;
#endif
- // needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff
- my_thread_init();
- thd = new THD; // note that contructor of THD uses DBUG_ !
+ thd= new THD; // note that contructor of THD uses DBUG_ !
DBUG_ENTER("handle_slave_io");
THD_CHECK_SENTRY(thd);
@@ -1715,14 +1851,17 @@ slave_begin:
}
mi->io_thd = thd;
thd->thread_stack = (char*)&thd; // remember where our stack is
+ pthread_mutex_lock(&LOCK_thread_count);
threads.append(thd);
+ pthread_mutex_unlock(&LOCK_thread_count);
mi->slave_running = 1;
mi->abort_slave = 0;
- pthread_cond_broadcast(&mi->start_cond);
pthread_mutex_unlock(&mi->run_lock);
+ pthread_cond_broadcast(&mi->start_cond);
- DBUG_PRINT("info",("master info: log_file_name=%s, position=%s",
- mi->master_log_name, llstr(mi->master_log_pos,llbuff)));
+ DBUG_PRINT("master_info",("log_file_name: '%s' position: %s",
+ mi->master_log_name,
+ llstr(mi->master_log_pos,llbuff)));
if (!(mi->mysql = mysql = mc_mysql_init(NULL)))
{
@@ -1730,10 +1869,8 @@ slave_begin:
goto err;
}
+
thd->proc_info = "connecting to master";
-#ifndef DBUG_OFF
- sql_print_error("Slave I/O thread initialized");
-#endif
// we can get killed during safe_connect
if (!safe_connect(thd, mysql, mi))
sql_print_error("Slave I/O thread: connected to master '%s@%s:%d',\
@@ -1765,13 +1902,15 @@ connected:
goto err;
}
+ DBUG_PRINT("info",("Starting reading binary log from master"));
while (!io_slave_killed(thd,mi))
{
+ bool suppress_warnings= 0;
thd->proc_info = "Requesting binlog dump";
- if (request_dump(mysql, mi))
+ if (request_dump(mysql, mi, &suppress_warnings))
{
sql_print_error("Failed on request_dump()");
- if(io_slave_killed(thd,mi))
+ if (io_slave_killed(thd,mi))
{
sql_print_error("Slave I/O thread killed while requesting master \
dump");
@@ -1785,12 +1924,13 @@ dump");
right away - if first time fails, sleep between re-tries
hopefuly the admin can fix the problem sometime
*/
- if (retried_once)
+ if (retry_count++)
+ {
+ if (retry_count > master_retry_count)
+ goto err; // Don't retry forever
safe_sleep(thd,mi->connect_retry,(CHECK_KILLED_FUNC)io_slave_killed,
(void*)mi);
- else
- retried_once = 1;
-
+ }
if (io_slave_killed(thd,mi))
{
sql_print_error("Slave I/O thread killed while retrying master \
@@ -1799,10 +1939,12 @@ dump");
}
thd->proc_info = "Reconnecting after a failed dump request";
- sql_print_error("Slave I/O thread: failed dump request, \
+ if (!suppress_warnings)
+ sql_print_error("Slave I/O thread: failed dump request, \
reconnecting to try again, log '%s' at postion %s", IO_RPL_LOG_NAME,
- llstr(mi->master_log_pos,llbuff));
- if (safe_reconnect(thd, mysql, mi) || io_slave_killed(thd,mi))
+ llstr(mi->master_log_pos,llbuff));
+ if (safe_reconnect(thd, mysql, mi, suppress_warnings) ||
+ io_slave_killed(thd,mi))
{
sql_print_error("Slave I/O thread killed during or \
after reconnect");
@@ -1814,58 +1956,72 @@ after reconnect");
while (!io_slave_killed(thd,mi))
{
+ bool suppress_warnings= 0;
thd->proc_info = "Reading master update";
- ulong event_len = read_event(mysql, mi);
+ ulong event_len = read_event(mysql, mi, &suppress_warnings);
if (io_slave_killed(thd,mi))
{
- sql_print_error("Slave I/O thread killed while reading event");
+ if (global_system_variables.log_warnings)
+ sql_print_error("Slave I/O thread killed while reading event");
goto err;
}
if (event_len == packet_error)
{
- if (mc_mysql_errno(mysql) == ER_NET_PACKET_TOO_LARGE)
+ uint mysql_error_number= mc_mysql_errno(mysql);
+ if (mysql_error_number == ER_NET_PACKET_TOO_LARGE)
+ {
+ sql_print_error("\
+Log entry on master is longer than max_allowed_packet (%ld) on \
+slave. If the entry is correct, restart the server with a higher value of \
+max_allowed_packet",
+ thd->variables.max_allowed_packet);
+ goto err;
+ }
+ if (mysql_error_number == ER_MASTER_FATAL_ERROR_READING_BINLOG)
{
- sql_print_error("Log entry on master is longer than \
-max_allowed_packet (%ld) on slave. Slave thread will be aborted. If the entry \
-is correct, restart the server with a higher value of max_allowed_packet",
- max_allowed_packet);
+ sql_print_error(ER(mysql_error_number), mysql_error_number,
+ mc_mysql_error(mysql));
goto err;
}
-
thd->proc_info = "Waiting to reconnect after a failed read";
mc_end_server(mysql);
- if (retried_once) // punish repeat offender with sleep
+ if (retry_count++)
+ {
+ if (retry_count > master_retry_count)
+ goto err; // Don't retry forever
safe_sleep(thd,mi->connect_retry,(CHECK_KILLED_FUNC)io_slave_killed,
- (void*)mi);
- else
- retried_once = 1;
-
+ (void*) mi);
+ }
if (io_slave_killed(thd,mi))
{
- sql_print_error("Slave I/O thread killed while waiting to \
+ if (global_system_variables.log_warnings)
+ sql_print_error("Slave I/O thread killed while waiting to \
reconnect after a failed read");
goto err;
}
thd->proc_info = "Reconnecting after a failed read";
- sql_print_error("Slave I/O thread: Failed reading log event, \
+ if (!suppress_warnings)
+ sql_print_error("Slave I/O thread: Failed reading log event, \
reconnecting to retry, log '%s' position %s", IO_RPL_LOG_NAME,
- llstr(mi->master_log_pos, llbuff));
- if (safe_reconnect(thd, mysql, mi) || io_slave_killed(thd,mi))
+ llstr(mi->master_log_pos, llbuff));
+ if (safe_reconnect(thd, mysql, mi, suppress_warnings) ||
+ io_slave_killed(thd,mi))
{
- sql_print_error("Slave I/O thread killed during or after a \
+ if (global_system_variables.log_warnings)
+ sql_print_error("Slave I/O thread killed during or after a \
reconnect done to recover from failed read");
goto err;
}
goto connected;
- } // if(event_len == packet_error)
+ } // if (event_len == packet_error)
+ retry_count=0; // ok event, reset retry counter
thd->proc_info = "Queueing event from master";
if (queue_event(mi,(const char*)mysql->net.read_pos + 1,
event_len))
{
- sql_print_error("Slave I/O thread could not queue event \
-from master");
+ sql_print_error("Slave I/O thread could not queue event from master");
goto err;
}
flush_master_info(mi);
@@ -1884,9 +2040,9 @@ log space");
sql_print_error("Slave I/O thread: debugging abort");
goto err;
}
-#endif
+#endif
}
- }
+ }
// error = 0;
err:
@@ -1912,11 +2068,11 @@ err:
THD_CHECK_SENTRY(thd);
delete thd;
pthread_mutex_unlock(&LOCK_thread_count);
- my_thread_end(); // clean-up before broadcast
- pthread_cond_broadcast(&mi->stop_cond); // tell the world we are done
+ my_thread_end(); // clean-up before broadcast
+ pthread_cond_broadcast(&mi->stop_cond); // tell the world we are done
pthread_mutex_unlock(&mi->run_lock);
#ifndef DBUG_OFF
- if(abort_slave_event_count && !events_till_abort)
+ if (abort_slave_event_count && !events_till_abort)
goto slave_begin;
#endif
pthread_exit(0);
@@ -1928,30 +2084,32 @@ err:
pthread_handler_decl(handle_slave_sql,arg)
{
+ THD *thd; /* needs to be first for thread_stack */
+ char llbuff[22],llbuff1[22];
+ RELAY_LOG_INFO* rli = &((MASTER_INFO*)arg)->rli;
+ const char *errmsg;
+
+ // needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff
+ my_thread_init();
+
#ifndef DBUG_OFF
slave_begin:
#endif
- THD *thd; /* needs to be first for thread_stack */
- MYSQL *mysql = NULL ;
- bool retried_once = 0;
- ulonglong last_failed_pos = 0; // TODO: see if this can be removed
- char llbuff[22],llbuff1[22];
- RELAY_LOG_INFO* rli = &((MASTER_INFO*)arg)->rli;
- const char* errmsg=0;
+
DBUG_ASSERT(rli->inited);
pthread_mutex_lock(&rli->run_lock);
DBUG_ASSERT(!rli->slave_running);
+ errmsg= 0;
#ifndef DBUG_OFF
rli->events_till_abort = abort_slave_event_count;
#endif
-
-
- // needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff
- my_thread_init();
- thd = new THD; // note that contructor of THD uses DBUG_ !
DBUG_ENTER("handle_slave_sql");
+
+ thd = new THD; // note that contructor of THD uses DBUG_ !
THD_CHECK_SENTRY(thd);
-
+ /* Inform waiting threads that slave has started */
+ rli->slave_run_id++;
+
pthread_detach_this_thread();
if (init_slave_thread(thd, SLAVE_THD_SQL))
{
@@ -1964,33 +2122,43 @@ slave_begin:
sql_print_error("Failed during slave thread initialization");
goto err;
}
- THD_CHECK_SENTRY(thd);
- thd->thread_stack = (char*)&thd; // remember where our stack is
+ rli->sql_thd= thd;
thd->temporary_tables = rli->save_temporary_tables; // restore temp tables
+ thd->thread_stack = (char*)&thd; // remember where our stack is
+ pthread_mutex_lock(&LOCK_thread_count);
threads.append(thd);
- rli->sql_thd = thd;
+ pthread_mutex_unlock(&LOCK_thread_count);
rli->slave_running = 1;
rli->abort_slave = 0;
- pthread_cond_broadcast(&rli->start_cond);
pthread_mutex_unlock(&rli->run_lock);
- rli->pending = 0; //this should always be set to 0 when the slave thread
- // is started
- if (init_relay_log_pos(rli,0,0,1/*need data lock*/,&errmsg))
+ pthread_cond_broadcast(&rli->start_cond);
+ // This should always be set to 0 when the slave thread is started
+ rli->pending = 0;
+ if (init_relay_log_pos(rli,
+ rli->relay_log_name,
+ rli->relay_log_pos,
+ 1 /*need data lock*/, &errmsg))
{
sql_print_error("Error initializing relay log position: %s",
errmsg);
goto err;
}
- DBUG_ASSERT(rli->relay_log_pos >= 4);
+ THD_CHECK_SENTRY(thd);
+ DBUG_ASSERT(rli->relay_log_pos >= BIN_LOG_HEADER_SIZE);
DBUG_ASSERT(my_b_tell(rli->cur_log) == rli->relay_log_pos);
-
- DBUG_PRINT("info",("master info: log_file_name=%s, position=%s",
- rli->master_log_name, llstr(rli->master_log_pos,llbuff)));
DBUG_ASSERT(rli->sql_thd == thd);
- sql_print_error("Slave SQL thread initialized, starting replication in \
-log '%s' at position %s,relay log: name='%s',pos='%s'", RPL_LOG_NAME,
- llstr(rli->master_log_pos,llbuff),rli->relay_log_name,
- llstr(rli->relay_log_pos,llbuff1));
+
+ DBUG_PRINT("master_info",("log_file_name: %s position: %s",
+ rli->master_log_name,
+ llstr(rli->master_log_pos,llbuff)));
+ if (global_system_variables.log_warnings)
+ sql_print_error("Slave SQL thread initialized, starting replication in \
+log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
+ llstr(rli->master_log_pos,llbuff),rli->relay_log_name,
+ llstr(rli->relay_log_pos,llbuff1));
+
+ /* Read queries from the IO/THREAD until this thread is killed */
+
while (!sql_slave_killed(thd,rli))
{
thd->proc_info = "Processing master log event";
@@ -2007,14 +2175,14 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
RPL_LOG_NAME, llstr(rli->master_log_pos, llbuff));
goto err;
}
- } // while(!sql_slave_killed(thd,rli)) - read/exec loop
+ }
- // error = 0;
- err:
- // print the current replication position
+ /* Thread stopped. Print the current replication position to the log */
sql_print_error("Slave SQL thread exiting, replication stopped in log \
'%s' at position %s",
RPL_LOG_NAME, llstr(rli->master_log_pos,llbuff));
+
+ err:
thd->query = thd->db = 0; // extra safety
thd->proc_info = "Waiting for slave mutex on exit";
pthread_mutex_lock(&rli->run_lock);
@@ -2032,7 +2200,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
net_end(&thd->net); // destructor will not free it, because we are weird
DBUG_ASSERT(rli->sql_thd == thd);
THD_CHECK_SENTRY(thd);
- rli->sql_thd = 0;
+ rli->sql_thd= 0;
pthread_mutex_lock(&LOCK_thread_count);
THD_CHECK_SENTRY(thd);
delete thd;
@@ -2056,16 +2224,17 @@ static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev)
bool cev_not_written;
THD* thd;
NET* net = &mi->mysql->net;
+ DBUG_ENTER("process_io_create_file");
if (unlikely(!cev->is_valid()))
- return 1;
+ DBUG_RETURN(1);
/*
TODO: fix to honor table rules, not only db rules
*/
if (!db_ok(cev->db, replicate_do_db, replicate_ignore_db))
{
skip_load_data_infile(net);
- return 0;
+ DBUG_RETURN(0);
}
DBUG_ASSERT(cev->inited_from_old);
thd = mi->io_thd;
@@ -2140,19 +2309,25 @@ relay log");
}
error=0;
err:
- return error;
+ DBUG_RETURN(error);
}
-// We assume we already locked mi->data_lock
+/*
+ We assume we already locked mi->data_lock
+*/
+
static int process_io_rotate(MASTER_INFO* mi, Rotate_log_event* rev)
{
+ DBUG_ENTER("process_io_rotate");
+
if (unlikely(!rev->is_valid()))
- return 1;
- DBUG_ASSERT(rev->ident_len<sizeof(mi->master_log_name));
+ DBUG_RETURN(1);
+ DBUG_ASSERT(rev->ident_len < sizeof(mi->master_log_name));
memcpy(mi->master_log_name,rev->new_log_ident,
rev->ident_len);
mi->master_log_name[rev->ident_len] = 0;
mi->master_log_pos = rev->pos;
+ DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos));
#ifndef DBUG_OFF
/*
If we do not do this, we will be getting the first
@@ -2161,7 +2336,7 @@ static int process_io_rotate(MASTER_INFO* mi, Rotate_log_event* rev)
if (disconnect_slave_event_count)
events_till_disconnect++;
#endif
- return 0;
+ DBUG_RETURN(0);
}
/*
@@ -2178,6 +2353,8 @@ static int queue_old_event(MASTER_INFO *mi, const char *buf,
bool inc_pos = 1;
bool processed_stop_event = 0;
char* tmp_buf = 0;
+ DBUG_ENTER("queue_old_event");
+
/* if we get Load event, we need to pass a non-reusable buffer
to read_log_event, so we do a trick
*/
@@ -2186,7 +2363,7 @@ static int queue_old_event(MASTER_INFO *mi, const char *buf,
if (unlikely(!(tmp_buf=(char*)my_malloc(event_len+1,MYF(MY_WME)))))
{
sql_print_error("Slave I/O: out of memory for Load event");
- return 1;
+ DBUG_RETURN(1);
}
memcpy(tmp_buf,buf,event_len);
tmp_buf[event_len]=0; // Create_file constructor wants null-term buffer
@@ -2199,8 +2376,8 @@ static int queue_old_event(MASTER_INFO *mi, const char *buf,
sql_print_error("Read invalid event from master: '%s',\
master could be corrupt but a more likely cause of this is a bug",
errmsg);
- my_free((char*)tmp_buf, MYF(MY_ALLOW_ZERO_PTR));
- return 1;
+ my_free((char*) tmp_buf, MYF(MY_ALLOW_ZERO_PTR));
+ DBUG_RETURN(1);
}
pthread_mutex_lock(&mi->data_lock);
ev->log_pos = mi->master_log_pos;
@@ -2211,7 +2388,7 @@ static int queue_old_event(MASTER_INFO *mi, const char *buf,
delete ev;
pthread_mutex_unlock(&mi->data_lock);
DBUG_ASSERT(!tmp_buf);
- return 1;
+ DBUG_RETURN(1);
}
mi->ignore_stop_event=1;
inc_pos = 0;
@@ -2224,10 +2401,11 @@ static int queue_old_event(MASTER_INFO *mi, const char *buf,
int error = process_io_create_file(mi,(Create_file_log_event*)ev);
delete ev;
mi->master_log_pos += event_len;
+ DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos));
pthread_mutex_unlock(&mi->data_lock);
DBUG_ASSERT(tmp_buf);
my_free((char*)tmp_buf, MYF(0));
- return error;
+ DBUG_RETURN(error);
}
default:
mi->ignore_stop_event=0;
@@ -2240,18 +2418,19 @@ static int queue_old_event(MASTER_INFO *mi, const char *buf,
delete ev;
pthread_mutex_unlock(&mi->data_lock);
DBUG_ASSERT(!tmp_buf);
- return 1;
+ DBUG_RETURN(1);
}
mi->rli.relay_log.harvest_bytes_written(&mi->rli.log_space_total);
}
delete ev;
if (likely(inc_pos))
mi->master_log_pos += event_len;
+ DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos));
if (unlikely(processed_stop_event))
mi->ignore_stop_event=1;
pthread_mutex_unlock(&mi->data_lock);
DBUG_ASSERT(!tmp_buf);
- return 0;
+ DBUG_RETURN(0);
}
/*
@@ -2264,8 +2443,10 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
int error=0;
bool inc_pos = 1;
bool processed_stop_event = 0;
+ DBUG_ENTER("queue_event");
+
if (mi->old_format)
- return queue_old_event(mi,buf,event_len);
+ DBUG_RETURN(queue_old_event(mi,buf,event_len));
pthread_mutex_lock(&mi->data_lock);
@@ -2281,7 +2462,7 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
{
Rotate_log_event rev(buf,event_len,0);
if (unlikely(process_io_rotate(mi,&rev)))
- return 1;
+ DBUG_RETURN(1);
inc_pos=0;
mi->ignore_stop_event=1;
break;
@@ -2296,23 +2477,26 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
{
if (likely(inc_pos))
mi->master_log_pos += event_len;
+ DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos));
mi->rli.relay_log.harvest_bytes_written(&mi->rli.log_space_total);
}
if (unlikely(processed_stop_event))
mi->ignore_stop_event=1;
pthread_mutex_unlock(&mi->data_lock);
- return error;
+ DBUG_RETURN(error);
}
void end_relay_log_info(RELAY_LOG_INFO* rli)
{
+ DBUG_ENTER("end_relay_log_info");
+
if (!rli->inited)
- return;
+ DBUG_VOID_RETURN;
if (rli->info_fd >= 0)
{
end_io_cache(&rli->info_file);
- (void)my_close(rli->info_fd, MYF(MY_WME));
+ (void) my_close(rli->info_fd, MYF(MY_WME));
rli->info_fd = -1;
}
if (rli->cur_log_fd >= 0)
@@ -2324,12 +2508,13 @@ void end_relay_log_info(RELAY_LOG_INFO* rli)
rli->inited = 0;
rli->log_pos_current=0;
rli->relay_log.close(1);
+ DBUG_VOID_RETURN;
}
/* try to connect until successful or slave killed */
static int safe_connect(THD* thd, MYSQL* mysql, MASTER_INFO* mi)
{
- return connect_to_master(thd, mysql, mi, 0);
+ return connect_to_master(thd, mysql, mi, 0, 0);
}
@@ -2339,55 +2524,69 @@ static int safe_connect(THD* thd, MYSQL* mysql, MASTER_INFO* mi)
*/
static int connect_to_master(THD* thd, MYSQL* mysql, MASTER_INFO* mi,
- bool reconnect)
+ bool reconnect, bool suppress_warnings)
{
int slave_was_killed;
int last_errno= -2; // impossible error
ulong err_count=0;
char llbuff[22];
+ DBUG_ENTER("connect_to_master");
#ifndef DBUG_OFF
events_till_disconnect = disconnect_slave_event_count;
#endif
+ uint client_flag=0;
+ if (opt_slave_compressed_protocol)
+ client_flag=CLIENT_COMPRESS; /* We will use compression */
+
while (!(slave_was_killed = io_slave_killed(thd,mi)) &&
- (reconnect ? mc_mysql_reconnect(mysql) != 0 :
+ (reconnect ? mc_mysql_reconnect(mysql) != 0:
!mc_mysql_connect(mysql, mi->host, mi->user, mi->password, 0,
- mi->port, 0, 0)))
+ mi->port, 0, client_flag,
+ thd->variables.net_read_timeout)))
{
/* Don't repeat last error */
if (mc_mysql_errno(mysql) != last_errno)
{
- sql_print_error("Slave I/O thread: error connecting to master \
+ last_errno=mc_mysql_errno(mysql);
+ suppress_warnings= 0;
+ sql_print_error("Slave I/O thread: error %s to master \
'%s@%s:%d': \
-%s, last_errno=%d, retry in %d sec",mi->user,mi->host,mi->port,
- mc_mysql_error(mysql), last_errno=mc_mysql_errno(mysql),
- mi->connect_retry);
+Error: '%s' errno: %d retry-time: %d retries: %d",
+ (reconnect ? "reconnecting" : "connecting"),
+ mi->user,mi->host,mi->port,
+ mc_mysql_error(mysql), last_errno,
+ mi->connect_retry,
+ master_retry_count);
}
- safe_sleep(thd,mi->connect_retry,(CHECK_KILLED_FUNC)io_slave_killed,
- (void*)mi);
/*
By default we try forever. The reason is that failure will trigger
master election, so if the user did not set master_retry_count we
- do not want to have electioin triggered on the first failure to
+ do not want to have election triggered on the first failure to
connect
*/
- if (master_retry_count && err_count++ == master_retry_count)
+ if (++err_count == master_retry_count)
{
slave_was_killed=1;
if (reconnect)
change_rpl_status(RPL_ACTIVE_SLAVE,RPL_LOST_SOLDIER);
break;
}
+ safe_sleep(thd,mi->connect_retry,(CHECK_KILLED_FUNC)io_slave_killed,
+ (void*)mi);
}
if (!slave_was_killed)
{
if (reconnect)
- sql_print_error("Slave: connected to master '%s@%s:%d',\
+ {
+ if (!suppress_warnings && global_system_variables.log_warnings)
+ sql_print_error("Slave: connected to master '%s@%s:%d',\
replication resumed in log '%s' at position %s", mi->user,
- mi->host, mi->port,
- IO_RPL_LOG_NAME,
- llstr(mi->master_log_pos,llbuff));
+ mi->host, mi->port,
+ IO_RPL_LOG_NAME,
+ llstr(mi->master_log_pos,llbuff));
+ }
else
{
change_rpl_status(RPL_IDLE_SLAVE,RPL_ACTIVE_SLAVE);
@@ -2398,8 +2597,8 @@ replication resumed in log '%s' at position %s", mi->user,
thd->set_active_vio(mysql->net.vio);
#endif
}
-
- return slave_was_killed;
+ DBUG_PRINT("exit",("slave_was_killed: %d", slave_was_killed));
+ DBUG_RETURN(slave_was_killed);
}
@@ -2408,38 +2607,91 @@ replication resumed in log '%s' at position %s", mi->user,
master_retry_count times
*/
-static int safe_reconnect(THD* thd, MYSQL* mysql, MASTER_INFO* mi)
+static int safe_reconnect(THD* thd, MYSQL* mysql, MASTER_INFO* mi,
+ bool suppress_warnings)
{
- return connect_to_master(thd, mysql, mi, 1);
+ return connect_to_master(thd, mysql, mi, 1, suppress_warnings);
}
-int flush_relay_log_info(RELAY_LOG_INFO* rli)
+
+/*
+ Store the file and position where the execute-slave thread are in the
+ relay log.
+
+ SYNOPSIS
+ flush_relay_log_info()
+ rli Relay log information
+
+ NOTES
+ - As this is only called by the slave thread, we don't need to
+ have a lock on this.
+ - If there is an active transaction, then we don't update the position
+ in the relay log. This is to ensure that we re-execute statements
+ if we die in the middle of an transaction that was rolled back.
+ - As a transaction never spans binary logs, we don't have to handle the
+ case where we do a relay-log-rotation in the middle of the transaction.
+ If this would not be the case, we would have to ensure that we
+ don't delete the relay log file where the transaction started when
+ we switch to a new relay log file.
+
+ TODO
+ - Change the log file information to a binary format to avoid calling
+ longlong2str.
+
+ RETURN VALUES
+ 0 ok
+ 1 write error
+*/
+
+bool flush_relay_log_info(RELAY_LOG_INFO* rli)
{
- register IO_CACHE* file = &rli->info_file;
- char lbuf[22],lbuf1[22];
-
+ bool error=0;
+ IO_CACHE *file = &rli->info_file;
+ char buff[FN_REFLEN*2+22*2+4], *pos;
+
+ /* sql_thd is not set when calling from init_slave() */
+ if ((rli->sql_thd && rli->sql_thd->options & OPTION_BEGIN))
+ return 0; // Wait for COMMIT
+
my_b_seek(file, 0L);
- my_b_printf(file, "%s\n%s\n%s\n%s\n",
- rli->relay_log_name, llstr(rli->relay_log_pos, lbuf),
- rli->master_log_name, llstr(rli->master_log_pos, lbuf1)
- );
- flush_io_cache(file);
- flush_io_cache(rli->cur_log);
- return 0;
+ pos=strmov(buff, rli->relay_log_name);
+ *pos++='\n';
+ pos=longlong2str(rli->relay_log_pos, pos, 10);
+ *pos++='\n';
+ pos=strmov(pos, rli->master_log_name);
+ *pos++='\n';
+ pos=longlong2str(rli->master_log_pos, pos, 10);
+ *pos='\n';
+ if (my_b_write(file, (byte*) buff, (ulong) (pos-buff)+1))
+ error=1;
+ if (flush_io_cache(file))
+ error=1;
+ if (flush_io_cache(rli->cur_log)) // QQ Why this call ?
+ error=1;
+ return error;
}
-IO_CACHE* reopen_relay_log(RELAY_LOG_INFO* rli, const char** errmsg)
+
+/*
+ This function is called when we notice that the current "hot" log
+ got rotated under our feet.
+*/
+
+static IO_CACHE *reopen_relay_log(RELAY_LOG_INFO *rli, const char **errmsg)
{
DBUG_ASSERT(rli->cur_log != &rli->cache_buf);
- IO_CACHE* cur_log = rli->cur_log=&rli->cache_buf;
DBUG_ASSERT(rli->cur_log_fd == -1);
+ DBUG_ENTER("reopen_relay_log");
+
+ IO_CACHE *cur_log = rli->cur_log=&rli->cache_buf;
if ((rli->cur_log_fd=open_binlog(cur_log,rli->relay_log_name,
errmsg)) <0)
- return 0;
+ DBUG_RETURN(0);
my_b_seek(cur_log,rli->relay_log_pos);
- return cur_log;
+ DBUG_RETURN(cur_log);
}
+
Log_event* next_event(RELAY_LOG_INFO* rli)
{
Log_event* ev;
@@ -2448,6 +2700,7 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
const char* errmsg=0;
THD* thd = rli->sql_thd;
bool was_killed;
+ DBUG_ENTER("next_event");
DBUG_ASSERT(thd != 0);
/*
@@ -2459,16 +2712,18 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
*/
pthread_mutex_lock(&rli->data_lock);
- for (; !(was_killed=sql_slave_killed(thd,rli)) ;)
+ while (!sql_slave_killed(thd,rli))
{
/*
We can have two kinds of log reading:
- hot_log - rli->cur_log points at the IO_CACHE of relay_log, which
- is actively being updated by the I/O thread. We need to be careful
- in this case and make sure that we are not looking at a stale log that
- has already been rotated. If it has been, we reopen the log
- the other case is much simpler - we just have a read only log that
- nobody else will be updating.
+ hot_log:
+ rli->cur_log points at the IO_CACHE of relay_log, which
+ is actively being updated by the I/O thread. We need to be careful
+ in this case and make sure that we are not looking at a stale log that
+ has already been rotated. If it has been, we reopen the log.
+
+ The other case is much simpler:
+ We just have a read only log that nobody else will be updating.
*/
bool hot_log;
if ((hot_log = (cur_log != &rli->cache_buf)))
@@ -2477,43 +2732,43 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
pthread_mutex_lock(log_lock);
/*
- Reading cur_log->init_count here is safe because the log will only
+ Reading xxx_file_id is safe because the log will only
be rotated when we hold relay_log.LOCK_log
*/
- if (cur_log->init_count != rli->cur_log_init_count)
+ if (rli->relay_log.get_open_count() != rli->cur_log_old_open_count)
{
- if (!(cur_log=reopen_relay_log(rli,&errmsg)))
- {
- pthread_mutex_unlock(log_lock);
+ // The master has switched to a new log file; Reopen the old log file
+ cur_log=reopen_relay_log(rli, &errmsg);
+ pthread_mutex_unlock(log_lock);
+ if (!cur_log) // No more log files
goto err;
- }
- pthread_mutex_unlock(log_lock);
- hot_log=0;
+ hot_log=0; // Using old binary log
}
}
- DBUG_ASSERT(my_b_tell(cur_log) >= 4);
+ DBUG_ASSERT(my_b_tell(cur_log) >= BIN_LOG_HEADER_SIZE);
DBUG_ASSERT(my_b_tell(cur_log) == rli->relay_log_pos + rli->pending);
- /* relay log is always in new format - if the master is 3.23, the
- I/O thread will convert the format for us
+ /*
+ Relay log is always in new format - if the master is 3.23, the
+ I/O thread will convert the format for us
*/
- if ((ev=Log_event::read_log_event(cur_log,0,(bool)0/*new format*/)))
+ if ((ev=Log_event::read_log_event(cur_log,0,(bool)0 /* new format */)))
{
DBUG_ASSERT(thd==rli->sql_thd);
if (hot_log)
pthread_mutex_unlock(log_lock);
pthread_mutex_unlock(&rli->data_lock);
- return ev;
+ DBUG_RETURN(ev);
}
DBUG_ASSERT(thd==rli->sql_thd);
- if (opt_reckless_slave)
+ if (opt_reckless_slave) // For mysql-test
cur_log->error = 0;
- if ( cur_log->error < 0)
+ if (cur_log->error < 0)
{
errmsg = "slave SQL thread aborted because of I/O error";
+ if (hot_log)
+ pthread_mutex_unlock(log_lock);
goto err;
}
-
-
if (!cur_log->error) /* EOF */
{
/*
@@ -2523,119 +2778,121 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
*/
if (hot_log)
{
- DBUG_ASSERT(cur_log->init_count == rli->cur_log_init_count);
+ DBUG_ASSERT(rli->relay_log.get_open_count() == rli->cur_log_old_open_count);
/*
We can, and should release data_lock while we are waiting for
update. If we do not, show slave status will block
*/
pthread_mutex_unlock(&rli->data_lock);
-
- /*
- IMPORTANT: note that wait_for_update will unlock LOCK_log, but
- expects the caller to lock it
- */
+ /* Note that wait_for_update unlocks lock_log ! */
rli->relay_log.wait_for_update(rli->sql_thd);
// re-acquire data lock since we released it earlier
pthread_mutex_lock(&rli->data_lock);
continue;
}
+ /*
+ If the log was not hot, we need to move to the next log in
+ sequence. The next log could be hot or cold, we deal with both
+ cases separately after doing some common initialization
+ */
+ end_io_cache(cur_log);
+ DBUG_ASSERT(rli->cur_log_fd >= 0);
+ my_close(rli->cur_log_fd, MYF(MY_WME));
+ rli->cur_log_fd = -1;
+
+ /*
+ TODO: make skip_log_purge a start-up option. At this point this
+ is not critical priority
+ */
+ if (!rli->skip_log_purge)
+ {
+ // purge_first_log will properly set up relay log coordinates in rli
+ if (rli->relay_log.purge_first_log(rli))
+ {
+ errmsg = "Error purging processed log";
+ goto err;
+ }
+ }
else
{
/*
- If the log was not hot, we need to move to the next log in
- sequence. The next log could be hot or cold, we deal with both
- cases separately after doing some common initialization
+ If hot_log is set, then we already have a lock on
+ LOCK_log. If not, we have to get the lock.
+
+ According to Sasha, the only time this code will ever be executed
+ is if we are recovering from a bug.
*/
- end_io_cache(cur_log);
- DBUG_ASSERT(rli->cur_log_fd >= 0);
- my_close(rli->cur_log_fd, MYF(MY_WME));
- rli->cur_log_fd = -1;
-
- // TODO: make skip_log_purge a start-up option. At this point this
- // is not critical priority
- if (!rli->skip_log_purge)
- {
- // purge_first_log will properly set up relay log coordinates in rli
- if (rli->relay_log.purge_first_log(rli))
- {
- errmsg = "Error purging processed log";
- goto err;
- }
- }
- else
+ if (rli->relay_log.find_next_log(&rli->linfo, !hot_log))
{
- // TODO: verify that no lock is ok here. At this point, if we
- // get this wrong, this is actually no big deal - the only time
- // this code will ever be executed is if we are recovering from
- // a bug when a full reload of the slave is not feasible or
- // desirable.
- if (rli->relay_log.find_next_log(&rli->linfo,0/*no lock*/))
- {
- errmsg = "error switching to the next log";
- goto err;
- }
- rli->relay_log_pos = 4;
- rli->pending=0;
- strnmov(rli->relay_log_name,rli->linfo.log_file_name,
- sizeof(rli->relay_log_name));
- flush_relay_log_info(rli);
+ errmsg = "error switching to the next log";
+ goto err;
}
+ rli->relay_log_pos = BIN_LOG_HEADER_SIZE;
+ rli->pending=0;
+ strmake(rli->relay_log_name,rli->linfo.log_file_name,
+ sizeof(rli->relay_log_name)-1);
+ flush_relay_log_info(rli);
+ }
- // next log is hot
- if (rli->relay_log.is_active(rli->linfo.log_file_name))
- {
+ // next log is hot
+ if (rli->relay_log.is_active(rli->linfo.log_file_name))
+ {
#ifdef EXTRA_DEBUG
- sql_print_error("next log '%s' is currently active",
- rli->linfo.log_file_name);
+ sql_print_error("next log '%s' is currently active",
+ rli->linfo.log_file_name);
#endif
- rli->cur_log = cur_log = rli->relay_log.get_log_file();
- rli->cur_log_init_count = cur_log->init_count;
- DBUG_ASSERT(rli->cur_log_fd == -1);
+ rli->cur_log= cur_log= rli->relay_log.get_log_file();
+ rli->cur_log_old_open_count= rli->relay_log.get_open_count();
+ DBUG_ASSERT(rli->cur_log_fd == -1);
- /*
- Read pointer has to be at the start since we are the only
- reader
- */
- if (check_binlog_magic(cur_log,&errmsg))
- goto err;
- continue;
- }
/*
- if we get here, the log was not hot, so we will have to
- open it ourselves
+ Read pointer has to be at the start since we are the only
+ reader
*/
-#ifdef EXTRA_DEBUG
- sql_print_error("next log '%s' is not active",
- rli->linfo.log_file_name);
-#endif
- // open_binlog() will check the magic header
- if ((rli->cur_log_fd=open_binlog(cur_log,rli->linfo.log_file_name,
- &errmsg)) <0)
+ if (check_binlog_magic(cur_log,&errmsg))
goto err;
+ continue;
}
+ /*
+ if we get here, the log was not hot, so we will have to
+ open it ourselves
+ */
+#ifdef EXTRA_DEBUG
+ sql_print_error("next log '%s' is not active",
+ rli->linfo.log_file_name);
+#endif
+ // open_binlog() will check the magic header
+ if ((rli->cur_log_fd=open_binlog(cur_log,rli->linfo.log_file_name,
+ &errmsg)) <0)
+ goto err;
}
- else // read failed with a non-EOF error
+ else
{
- // TODO: come up with something better to handle this error
+ /*
+ Read failed with a non-EOF error.
+ TODO: come up with something better to handle this error
+ */
+ if (hot_log)
+ pthread_mutex_unlock(log_lock);
sql_print_error("Slave SQL thread: I/O error reading \
-event(errno=%d,cur_log->error=%d)",
+event(errno: %d cur_log->error: %d)",
my_errno,cur_log->error);
// set read position to the beginning of the event
my_b_seek(cur_log,rli->relay_log_pos+rli->pending);
/* otherwise, we have had a partial read */
- /* TODO; see if there is a way to do this without this goto */
errmsg = "Aborting slave SQL thread because of partial event read";
- goto err;
+ break; // To end of function
}
-
}
- if (!errmsg && was_killed)
+ if (!errmsg && global_system_variables.log_warnings)
errmsg = "slave SQL thread was killed";
+
err:
pthread_mutex_unlock(&rli->data_lock);
- sql_print_error("Error reading relay log event: %s", errmsg);
- return 0;
+ if (errmsg)
+ sql_print_error("Error reading relay log event: %s", errmsg);
+ DBUG_RETURN(0);
}
diff --git a/sql/slave.h b/sql/slave.h
index 16735891815..b527aceb432 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -30,8 +30,9 @@ extern bool use_slave_mask;
extern char* slave_load_tmpdir;
extern my_string master_info_file,relay_log_info_file;
extern my_string opt_relay_logname, opt_relaylog_index_name;
-extern bool opt_skip_slave_start, opt_reckless_slave;
-extern ulong relay_log_space_limit;
+extern my_bool opt_skip_slave_start, opt_reckless_slave;
+extern my_bool opt_log_slave_updates;
+extern ulonglong relay_log_space_limit;
struct st_master_info;
/*
@@ -70,39 +71,31 @@ struct st_master_info;
typedef struct st_relay_log_info
{
/*** The following variables can only be read when protect by data lock ****/
+
/*
info_fd - file descriptor of the info file. set only during
initialization or clean up - safe to read anytime
cur_log_fd - file descriptor of the current read relay log
*/
File info_fd,cur_log_fd;
- // name of current read relay log
+ /* name of current read relay log */
char relay_log_name[FN_REFLEN];
- // master log name corresponding to current read position
+ /* master log name corresponding to current read position */
char master_log_name[FN_REFLEN];
- // original log position of last processed event
+ /* original log position of last processed event */
volatile my_off_t master_log_pos;
/*
- current offset in the relay log.
- pending - in some cases we do not increment offset immediately after
- processing an event, because the following event needs to be processed
- atomically together with this one ( so far, there is only one type of
- such event - Intvar_event that sets auto_increment value). However, once
- both events have been processed, we need to increment by the cumulative
- offset. pending stored the extra offset to be added to the position.
+ Protected with internal locks.
+ Must get data_lock when resetting the logs.
*/
- ulonglong relay_log_pos, pending;
-
- // protected with internal locks
- // must get data_lock when resetting the logs
MYSQL_LOG relay_log;
LOG_INFO linfo;
IO_CACHE cache_buf,*cur_log;
- /*** The following variables are safe to read any time ***/
+ /* The following variables are safe to read any time */
- // IO_CACHE of the info file - set only during init or end
+ /* IO_CACHE of the info file - set only during init or end */
IO_CACHE info_file;
/*
@@ -125,19 +118,34 @@ typedef struct st_relay_log_info
*/
pthread_cond_t start_cond, stop_cond, data_cond;
- // if not set, the value of other members of the structure are undefined
- bool inited;
-
- // parent master info structure
+ /* parent master info structure */
struct st_master_info *mi;
/*
Needed to deal properly with cur_log getting closed and re-opened with
a different log under our feet
*/
- int cur_log_init_count;
+ uint32 cur_log_old_open_count;
- volatile bool abort_slave, slave_running;
+ /*
+ Current offset in the relay log.
+ pending - in some cases we do not increment offset immediately after
+ processing an event, because the following event needs to be processed
+ atomically together with this one ( so far, there is only one type of
+ such event - Intvar_event that sets auto_increment value). However, once
+ both events have been processed, we need to increment by the cumulative
+ offset. pending stored the extra offset to be added to the position.
+ */
+ ulonglong relay_log_pos, pending;
+ ulonglong log_space_limit,log_space_total;
+
+ /*
+ InnoDB internally stores the master log position it has processed
+ so far; the position to store is really the sum of
+ pos + pending + event_len here since we must store the pos of the
+ END of the current log event
+ */
+ int event_len;
/*
Needed for problems when slave stops and we want to restart it
@@ -145,50 +153,54 @@ typedef struct st_relay_log_info
errors, and have been manually applied by DBA already.
*/
volatile uint32 slave_skip_counter;
+ volatile ulong abort_pos_wait; /* Incremented on change master */
+ volatile ulong slave_run_id; /* Incremented on slave start */
+ pthread_mutex_t log_space_lock;
+ pthread_cond_t log_space_cond;
+ THD * sql_thd;
+ int last_slave_errno;
#ifndef DBUG_OFF
int events_till_abort;
#endif
- int last_slave_errno;
char last_slave_error[MAX_SLAVE_ERRMSG];
- THD* sql_thd;
+
+ /* if not set, the value of other members of the structure are undefined */
+ bool inited;
+ volatile bool abort_slave, slave_running;
bool log_pos_current;
- bool abort_pos_wait;
bool skip_log_purge;
- ulonglong log_space_limit,log_space_total;
- pthread_mutex_t log_space_lock;
- pthread_cond_t log_space_cond;
- st_relay_log_info():info_fd(-1),cur_log_fd(-1),inited(0),
- cur_log_init_count(0),
- abort_slave(0),slave_running(0),
- log_pos_current(0),abort_pos_wait(0),
- skip_log_purge(0)
- {
- relay_log_name[0] = master_log_name[0] = 0;
- bzero(&info_file,sizeof(info_file));
- pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST);
- pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST);
- pthread_mutex_init(&log_space_lock, MY_MUTEX_INIT_FAST);
- pthread_cond_init(&data_cond, NULL);
- pthread_cond_init(&start_cond, NULL);
- pthread_cond_init(&stop_cond, NULL);
- pthread_cond_init(&log_space_cond, NULL);
- }
+ st_relay_log_info()
+ :info_fd(-1),cur_log_fd(-1), cur_log_old_open_count(0), abort_pos_wait(0),
+ slave_run_id(0), inited(0), abort_slave(0), slave_running(0),
+ log_pos_current(0), skip_log_purge(0)
+ {
+ relay_log_name[0] = master_log_name[0] = 0;
+ bzero(&info_file,sizeof(info_file));
+ bzero(&cache_buf, sizeof(cache_buf));
+ pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST);
+ pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST);
+ pthread_mutex_init(&log_space_lock, MY_MUTEX_INIT_FAST);
+ pthread_cond_init(&data_cond, NULL);
+ pthread_cond_init(&start_cond, NULL);
+ pthread_cond_init(&stop_cond, NULL);
+ pthread_cond_init(&log_space_cond, NULL);
+ }
~st_relay_log_info()
- {
- pthread_mutex_destroy(&run_lock);
- pthread_mutex_destroy(&data_lock);
- pthread_mutex_destroy(&log_space_lock);
- pthread_cond_destroy(&data_cond);
- pthread_cond_destroy(&start_cond);
- pthread_cond_destroy(&stop_cond);
- pthread_cond_destroy(&log_space_cond);
- }
+ {
+ pthread_mutex_destroy(&run_lock);
+ pthread_mutex_destroy(&data_lock);
+ pthread_mutex_destroy(&log_space_lock);
+ pthread_cond_destroy(&data_cond);
+ pthread_cond_destroy(&start_cond);
+ pthread_cond_destroy(&stop_cond);
+ pthread_cond_destroy(&log_space_cond);
+ }
inline void inc_pending(ulonglong val)
{
pending += val;
}
- // TODO: this probably needs to be fixed
+ /* TODO: this probably needs to be fixed */
inline void inc_pos(ulonglong val, ulonglong log_pos, bool skip_lock=0)
{
if (!skip_lock)
@@ -203,7 +215,7 @@ typedef struct st_relay_log_info
}
/*
thread safe read of position - not needed if we are in the slave thread,
- but required otherwise
+ but required otherwise as var is a longlong
*/
inline void read_pos(ulonglong& var)
{
@@ -215,40 +227,34 @@ typedef struct st_relay_log_info
int wait_for_pos(THD* thd, String* log_name, ulonglong log_pos);
} RELAY_LOG_INFO;
-/*
- repopen_relay_log() is called when we notice that the current "hot" log
- got rotated under our feet
-*/
-IO_CACHE* reopen_relay_log(RELAY_LOG_INFO* rli, const char** errmsg);
Log_event* next_event(RELAY_LOG_INFO* rli);
-
/*
st_master_info contains information about how to connect to a master,
- current master log name, and current log offset, as well as misc
- control variables
+ current master log name, and current log offset, as well as misc
+ control variables
- st_master_info is initialized once from the master.info file if such
- exists. Otherwise, data members corresponding to master.info fields are
- initialized with defaults specified by master-* options. The initialization
- is done through init_master_info() call.
+ st_master_info is initialized once from the master.info file if such
+ exists. Otherwise, data members corresponding to master.info fields
+ are initialized with defaults specified by master-* options. The
+ initialization is done through init_master_info() call.
- The format of master.info file:
+ The format of master.info file:
- log_name
- log_pos
- master_host
- master_user
- master_pass
- master_port
- master_connect_retry
+ log_name
+ log_pos
+ master_host
+ master_user
+ master_pass
+ master_port
+ master_connect_retry
- To write out the contents of master.info file to disk ( needed every
- time we read and queue data from the master ), a call to
- flush_master_info() is required.
+ To write out the contents of master.info file to disk ( needed every
+ time we read and queue data from the master ), a call to
+ flush_master_info() is required.
- To clean up, call end_master_info()
+ To clean up, call end_master_info()
*/
@@ -257,10 +263,10 @@ typedef struct st_master_info
char master_log_name[FN_REFLEN];
my_off_t master_log_pos;
- File fd;
+ File fd; // we keep the file open, so we need to remember the file pointer
IO_CACHE file;
- // the variables below are needed because we can change masters on the fly
+ /* the variables below are needed because we can change masters on the fly */
char host[HOSTNAME_LENGTH+1];
char user[USERNAME_LENGTH+1];
char password[HASH_PASSWORD_LENGTH+1];
@@ -268,7 +274,7 @@ typedef struct st_master_info
pthread_cond_t data_cond,start_cond,stop_cond;
THD *io_thd;
MYSQL* mysql;
- uint32 file_id; // for 3.23 load data infile
+ uint32 file_id; /* for 3.23 load data infile */
RELAY_LOG_INFO rli;
uint port;
uint connect_retry;
@@ -276,16 +282,18 @@ typedef struct st_master_info
int events_till_abort;
#endif
bool inited;
- bool old_format; // master binlog is in 3.23 format
+ bool old_format; /* master binlog is in 3.23 format */
volatile bool abort_slave, slave_running;
+ volatile ulong slave_run_id;
bool ignore_stop_event;
- st_master_info():fd(-1), io_thd(0), inited(0), old_format(0),abort_slave(0),
- slave_running(0)
+ st_master_info()
+ :fd(-1), io_thd(0), inited(0), old_format(0),abort_slave(0),
+ slave_running(0), slave_run_id(0)
{
host[0] = 0; user[0] = 0; password[0] = 0;
- bzero(&file,sizeof(file));
+ bzero(&file, sizeof(file));
pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST);
pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST);
pthread_cond_init(&data_cond, NULL);
@@ -334,8 +342,8 @@ typedef struct st_table_rule_ent
int init_slave();
void init_slave_skip_errors(const char* arg);
-int flush_master_info(MASTER_INFO* mi);
-int flush_relay_log_info(RELAY_LOG_INFO* rli);
+bool flush_master_info(MASTER_INFO* mi);
+bool flush_relay_log_info(RELAY_LOG_INFO* rli);
int register_slave_on_master(MYSQL* mysql);
int terminate_slave_threads(MASTER_INFO* mi, int thread_mask,
bool skip_lock = 0);
@@ -355,21 +363,22 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start,
int start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock,
pthread_mutex_t *cond_lock,
pthread_cond_t* start_cond,
- volatile bool* slave_running,
+ volatile bool *slave_running,
+ volatile ulong *slave_run_id,
MASTER_INFO* mi);
-// If fd is -1, dump to NET
+/* If fd is -1, dump to NET */
int mysql_table_dump(THD* thd, const char* db,
const char* tbl_name, int fd = -1);
-// retrieve non-exitent table from master
+/* retrieve non-exitent table from master */
int fetch_master_table(THD* thd, const char* db_name, const char* table_name,
MASTER_INFO* mi, MYSQL* mysql);
int show_master_info(THD* thd, MASTER_INFO* mi);
int show_binlog_info(THD* thd);
-// See if the query uses any tables that should not be replicated
+/* See if the query uses any tables that should not be replicated */
int tables_ok(THD* thd, TABLE_LIST* tables);
/*
@@ -388,9 +397,10 @@ int check_expected_error(THD* thd, RELAY_LOG_INFO* rli, int error_code);
void skip_load_data_infile(NET* net);
void slave_print_error(RELAY_LOG_INFO* rli,int err_code, const char* msg, ...);
-void end_slave(); // clean up
+void end_slave(); /* clean up */
int init_master_info(MASTER_INFO* mi, const char* master_info_fname,
- const char* slave_info_fname);
+ const char* slave_info_fname,
+ bool abort_if_no_master_info_file);
void end_master_info(MASTER_INFO* mi);
int init_relay_log_info(RELAY_LOG_INFO* rli, const char* info_fname);
void end_relay_log_info(RELAY_LOG_INFO* rli);
@@ -400,13 +410,13 @@ void init_thread_mask(int* mask,MASTER_INFO* mi,bool inverse);
int init_relay_log_pos(RELAY_LOG_INFO* rli,const char* log,ulonglong pos,
bool need_data_lock, const char** errmsg);
-int purge_relay_logs(RELAY_LOG_INFO* rli,bool just_reset,const char** errmsg);
+int purge_relay_logs(RELAY_LOG_INFO* rli, THD *thd, bool just_reset,
+ const char** errmsg);
-extern bool opt_log_slave_updates ;
pthread_handler_decl(handle_slave_io,arg);
pthread_handler_decl(handle_slave_sql,arg);
extern bool volatile abort_loop;
-extern MASTER_INFO main_mi, *active_mi; // active_mi for multi-master
+extern MASTER_INFO main_mi, *active_mi; /* active_mi for multi-master */
extern volatile int active_mi_in_use;
extern LIST master_list;
extern HASH replicate_do_table, replicate_ignore_table;
@@ -417,7 +427,7 @@ extern bool table_rules_on;
extern int disconnect_slave_event_count, abort_slave_event_count ;
-// the master variables are defaults read from my.cnf or command line
+/* the master variables are defaults read from my.cnf or command line */
extern uint master_port, master_connect_retry, report_port;
extern my_string master_user, master_password, master_host,
master_info_file, relay_log_info_file, report_user, report_host,
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 724af69bdca..1069e779e86 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -29,24 +29,25 @@
#include "sql_acl.h"
#include "hash_filo.h"
#include <m_ctype.h>
+#include <assert.h>
#include <stdarg.h>
-/*
- ACL_HOST is used if no host is specified
- */
-
struct acl_host_and_ip
{
char *hostname;
long ip,ip_mask; // Used with masked ip:s
};
+
class ACL_ACCESS {
public:
ulong sort;
- uint access;
+ ulong access;
};
+
+/* ACL_HOST is used if no host is specified */
+
class ACL_HOST :public ACL_ACCESS
{
public:
@@ -54,6 +55,7 @@ public:
char *db;
};
+
class ACL_USER :public ACL_ACCESS
{
public:
@@ -68,6 +70,7 @@ public:
#endif /* HAVE_OPENSSL */
};
+
class ACL_DB :public ACL_ACCESS
{
public:
@@ -75,14 +78,16 @@ public:
char *user,*db;
};
+
class acl_entry :public hash_filo_element
{
public:
- uint access;
+ ulong access;
uint16 length;
char key[1]; // Key will be stored here
};
+
static byte* acl_entry_get_key(acl_entry *entry,uint *length,
my_bool not_used __attribute__((unused)))
{
@@ -100,7 +105,7 @@ static HASH acl_check_hosts, hash_tables;
static DYNAMIC_ARRAY acl_wild_hosts;
static hash_filo *acl_cache;
static uint grant_version=0;
-static uint get_access(TABLE *form,uint fieldnr);
+static ulong get_access(TABLE *form,uint fieldnr);
static int acl_compare(ACL_ACCESS *a,ACL_ACCESS *b);
static ulong get_sort(uint count,...);
static void init_check_host(void);
@@ -195,10 +200,10 @@ int acl_init(bool dont_read_acl_tables)
{
ACL_HOST host;
update_hostname(&host.host,get_field(&mem, table,0));
- host.db=get_field(&mem, table,1);
- host.access=get_access(table,2);
- host.access=fix_rights_for_db(host.access);
- host.sort=get_sort(2,host.host.hostname,host.db);
+ host.db= get_field(&mem, table,1);
+ host.access= get_access(table,2);
+ host.access= fix_rights_for_db(host.access);
+ host.sort= get_sort(2,host.host.hostname,host.db);
#ifndef TO_BE_REMOVED
if (table->fields == 8)
{ // Without grant
@@ -223,6 +228,7 @@ int acl_init(bool dont_read_acl_tables)
protocol_version=9; /* purecov: tested */
}
+ DBUG_PRINT("info",("user table fields: %d",table->fields));
allow_all_hosts=0;
while (!(read_record_info.read_record(&read_record_info)))
{
@@ -231,31 +237,11 @@ int acl_init(bool dont_read_acl_tables)
update_hostname(&user.host,get_field(&mem, table,0));
user.user=get_field(&mem, table,1);
user.password=get_field(&mem, table,2);
-#ifdef HAVE_OPENSSL
- DBUG_PRINT("info",("table->fields=%d",table->fields));
- if (table->fields >= 21) /* From 4.0.0 we have more fields */
- {
- char *ssl_type=get_field(&mem, table,17);
- if (!strcmp(ssl_type, "ANY"))
- user.ssl_type=SSL_TYPE_ANY;
- else if (!strcmp(ssl_type, "X509"))
- user.ssl_type=SSL_TYPE_X509;
- else if (!strcmp(ssl_type, "SPECIFIED"))
- user.ssl_type=SSL_TYPE_SPECIFIED;
- else
- user.ssl_type=SSL_TYPE_NONE;
- user.ssl_cipher=get_field(&mem, table, 18);
- user.x509_issuer=get_field(&mem, table, 19);
- user.x509_subject=get_field(&mem, table, 20);
- }
- else
- user.ssl_type=SSL_TYPE_NONE;
-#endif /* HAVE_OPENSSL */
if (user.password && (length=(uint) strlen(user.password)) == 8 &&
protocol_version == PROTOCOL_VERSION)
{
sql_print_error(
- "Found old style password for user '%s'. Ignoring user. (You may want to restart using --old-protocol)",
+ "Found old style password for user '%s'. Ignoring user. (You may want to restart mysqld using --old-protocol)",
user.user ? user.user : ""); /* purecov: tested */
}
else if (length % 8) // This holds true for passwords
@@ -264,33 +250,60 @@ int acl_init(bool dont_read_acl_tables)
"Found invalid password for user: '%s@%s'; Ignoring user",
user.user ? user.user : "",
user.host.hostname ? user.host.hostname : ""); /* purecov: tested */
- continue; /* purecov: tested */
+ continue; /* purecov: tested */
}
get_salt_from_password(user.salt,user.password);
- user.access=get_access(table,3);
+ user.access=get_access(table,3) & GLOBAL_ACLS;
user.sort=get_sort(2,user.host.hostname,user.user);
- user.hostname_length=user.host.hostname ? (uint) strlen(user.host.hostname) : 0;
- if (table->fields >=23)
+ user.hostname_length= (user.host.hostname ?
+ (uint) strlen(user.host.hostname) : 0);
+ if (table->fields >= 31) /* Starting from 4.0.2 we have more fields */
{
- /* Table has new MySQL usage limits */
- char *ptr = get_field(&mem, table, 21);
+#ifdef HAVE_OPENSSL
+ char *ssl_type=get_field(&mem, table, 24);
+ if (!ssl_type)
+ user.ssl_type=SSL_TYPE_NONE;
+ else if (!strcmp(ssl_type, "ANY"))
+ user.ssl_type=SSL_TYPE_ANY;
+ else if (!strcmp(ssl_type, "X509"))
+ user.ssl_type=SSL_TYPE_X509;
+ else /* !strcmp(ssl_type, "SPECIFIED") */
+ user.ssl_type=SSL_TYPE_SPECIFIED;
+
+ user.ssl_cipher= get_field(&mem, table, 25);
+ user.x509_issuer= get_field(&mem, table, 26);
+ user.x509_subject= get_field(&mem, table, 27);
+#endif
+ char *ptr = get_field(&mem, table, 28);
user.user_resource.questions=atoi(ptr);
- ptr = get_field(&mem, table, 22);
+ ptr = get_field(&mem, table, 29);
user.user_resource.updates=atoi(ptr);
- ptr = get_field(&mem, table, 23);
+ ptr = get_field(&mem, table, 30);
user.user_resource.connections=atoi(ptr);
- if (user.user_resource.questions || user.user_resource.updates || user.user_resource.connections)
+ if (user.user_resource.questions || user.user_resource.updates ||
+ user.user_resource.connections)
mqh_used=1;
}
else
+ {
+#ifdef HAVE_OPENSSL
+ user.ssl_type=SSL_TYPE_NONE;
+#endif
bzero(&(user.user_resource),sizeof(user.user_resource));
#ifndef TO_BE_REMOVED
- if (table->fields <= 13)
- { // Without grant
- if (user.access & CREATE_ACL)
- user.access|=REFERENCES_ACL | INDEX_ACL | ALTER_ACL;
- }
+ if (table->fields <= 13)
+ { // Without grant
+ if (user.access & CREATE_ACL)
+ user.access|=REFERENCES_ACL | INDEX_ACL | ALTER_ACL;
+ }
+ /* Convert old privileges */
+ user.access|= LOCK_TABLES_ACL | CREATE_TMP_ACL | SHOW_DB_ACL;
+ if (user.access & FILE_ACL)
+ user.access|= REPL_CLIENT_ACL | REPL_SLAVE_ACL;
+ if (user.access & PROCESS_ACL)
+ user.access|= SUPER_ACL | EXECUTE_ACL;
#endif
+ }
VOID(push_dynamic(&acl_users,(gptr) &user));
if (!user.host.hostname || user.host.hostname[0] == wild_many &&
!user.host.hostname[1])
@@ -308,6 +321,11 @@ int acl_init(bool dont_read_acl_tables)
ACL_DB db;
update_hostname(&db.host,get_field(&mem, table,0));
db.db=get_field(&mem, table,1);
+ if (!db.db)
+ {
+ sql_print_error("Found an entry in the 'db' table with empty database name; Skipped");
+ continue;
+ }
db.user=get_field(&mem, table,2);
db.access=get_access(table,3);
db.access=fix_rights_for_db(db.access);
@@ -401,31 +419,38 @@ void acl_reload(void)
}
-/* Get all access bits from table after fieldnr */
+/*
+ Get all access bits from table after fieldnr
+ We know that the access privileges ends when there is no more fields
+ or the field is not an enum with two elements.
+*/
-static uint get_access(TABLE *form,uint fieldnr)
+static ulong get_access(TABLE *form, uint fieldnr)
{
- uint access_bits=0,bit;
+ ulong access_bits=0,bit;
char buff[2];
String res(buff,sizeof(buff),default_charset_info);
Field **pos;
- for (pos=form->field+fieldnr,bit=1 ; *pos ; pos++ , bit<<=1)
+ for (pos=form->field+fieldnr, bit=1;
+ *pos && (*pos)->real_type() == FIELD_TYPE_ENUM &&
+ ((Field_enum*) (*pos))->typelib->count == 2 ;
+ pos++ , bit<<=1)
{
(*pos)->val_str(&res,&res);
if (my_toupper(system_charset_info, res[0]) == 'Y')
- access_bits|=bit;
+ access_bits|= bit;
}
return access_bits;
}
/*
- return a number which, if sorted 'desc', puts strings in this order:
- no wildcards
- wildcards
- empty string
- */
+ Return a number which, if sorted 'desc', puts strings in this order:
+ no wildcards
+ wildcards
+ empty string
+*/
static ulong get_sort(uint count,...)
{
@@ -470,17 +495,20 @@ static int acl_compare(ACL_ACCESS *a,ACL_ACCESS *b)
Required before connecting to MySQL
*/
-uint acl_getroot(THD *thd, const char *host, const char *ip, const char *user,
- const char *password,const char *message,char **priv_user,
- bool old_ver, USER_RESOURCES *mqh)
+ulong acl_getroot(THD *thd, const char *host, const char *ip, const char *user,
+ const char *password,const char *message,char **priv_user,
+ bool old_ver, USER_RESOURCES *mqh)
{
- uint user_access=NO_ACCESS;
+ ulong user_access=NO_ACCESS;
*priv_user=(char*) user;
- char *ptr=0;
+ DBUG_ENTER("acl_getroot");
bzero(mqh,sizeof(USER_RESOURCES));
if (!initialized)
- return (uint) ~NO_ACCESS; // If no data allow anything /* purecov: tested */
+ {
+ // If no data allow anything
+ DBUG_RETURN((ulong) ~NO_ACCESS); /* purecov: tested */
+ }
VOID(pthread_mutex_lock(&acl_cache->lock));
/*
@@ -507,7 +535,7 @@ uint acl_getroot(THD *thd, const char *host, const char *ip, const char *user,
we check if SSL is required, if user is using SSL and
if X509 certificate attributes are OK
*/
- switch(acl_user->ssl_type) {
+ switch (acl_user->ssl_type) {
case SSL_TYPE_NONE: /* SSL is not required to connect */
user_access=acl_user->access;
break;
@@ -549,40 +577,33 @@ uint acl_getroot(THD *thd, const char *host, const char *ip, const char *user,
if (acl_user->x509_issuer)
{
DBUG_PRINT("info",("checkpoint 3"));
- ptr = X509_NAME_oneline(X509_get_issuer_name(cert), 0, 0);
+ char *ptr = X509_NAME_oneline(X509_get_issuer_name(cert), 0, 0);
DBUG_PRINT("info",("comparing issuers: '%s' and '%s'",
acl_user->x509_issuer, ptr));
- if (!strcmp(acl_user->x509_issuer,ptr))
- user_access=acl_user->access;
- else
+ if (strcmp(acl_user->x509_issuer, ptr))
{
user_access=NO_ACCESS;
free(ptr);
break;
}
+ user_access=acl_user->access;
free(ptr);
}
DBUG_PRINT("info",("checkpoint 4"));
/* X509 subject is specified, we check it .. */
if (acl_user->x509_subject)
{
- ptr = X509_NAME_oneline(X509_get_subject_name(cert), 0, 0);
+ char *ptr= X509_NAME_oneline(X509_get_subject_name(cert), 0, 0);
DBUG_PRINT("info",("comparing subjects: '%s' and '%s'",
acl_user->x509_subject, ptr));
- if (!strcmp(acl_user->x509_subject,ptr))
- user_access=acl_user->access;
- else
- {
+ if (strcmp(acl_user->x509_subject,ptr))
user_access=NO_ACCESS;
- free(ptr);
- break;
- }
+ else
+ user_access=acl_user->access;
free(ptr);
}
- DBUG_PRINT("info",("checkpoint 5"));
break;
}
- DBUG_PRINT("info",("checkpoint 6"));
#else /* HAVE_OPENSSL */
user_access=acl_user->access;
#endif /* HAVE_OPENSSL */
@@ -598,7 +619,7 @@ uint acl_getroot(THD *thd, const char *host, const char *ip, const char *user,
}
}
VOID(pthread_mutex_unlock(&acl_cache->lock));
- return user_access;
+ DBUG_RETURN(user_access);
}
@@ -621,7 +642,7 @@ static void acl_update_user(const char *user, const char *host,
const char *x509_issuer,
const char *x509_subject,
USER_RESOURCES *mqh,
- uint privileges)
+ ulong privileges)
{
for (uint i=0 ; i < acl_users.elements ; i++)
{
@@ -634,7 +655,12 @@ static void acl_update_user(const char *user, const char *host,
acl_user->host.hostname && !strcmp(host,acl_user->host.hostname))
{
acl_user->access=privileges;
- acl_user->user_resource=*mqh;
+ if (mqh->bits & 1)
+ acl_user->user_resource.questions=mqh->questions;
+ if (mqh->bits & 2)
+ acl_user->user_resource.updates=mqh->updates;
+ if (mqh->bits & 4)
+ acl_user->user_resource.connections=mqh->connections;
#ifdef HAVE_OPENSSL
acl_user->ssl_type=ssl_type;
acl_user->ssl_cipher=ssl_cipher;
@@ -665,7 +691,7 @@ static void acl_insert_user(const char *user, const char *host,
const char *x509_issuer,
const char *x509_subject,
USER_RESOURCES *mqh,
- uint privileges)
+ ulong privileges)
{
ACL_USER acl_user;
acl_user.user=strdup_root(&mem,user);
@@ -702,7 +728,7 @@ static void acl_insert_user(const char *user, const char *host,
static void acl_update_db(const char *user, const char *host, const char *db,
- uint privileges)
+ ulong privileges)
{
for (uint i=0 ; i < acl_dbs.elements ; i++)
{
@@ -729,7 +755,7 @@ static void acl_update_db(const char *user, const char *host, const char *db,
static void acl_insert_db(const char *user, const char *host, const char *db,
- uint privileges)
+ ulong privileges)
{
ACL_DB acl_db;
/* The acl_cache mutex is locked by mysql_grant */
@@ -748,13 +774,15 @@ static void acl_insert_db(const char *user, const char *host, const char *db,
** Get privilege for a host, user and db combination
*****************************************************************************/
-uint acl_get(const char *host, const char *ip, const char *bin_ip,
+ulong acl_get(const char *host, const char *ip, const char *bin_ip,
const char *user, const char *db)
{
- uint host_access,db_access,i,key_length;
+ ulong host_access,db_access;
+ uint i,key_length;
db_access=0; host_access= ~0;
char key[ACL_KEY_LENGTH],*tmp_db,*end;
acl_entry *entry;
+ THD *thd= current_thd;
VOID(pthread_mutex_lock(&acl_cache->lock));
memcpy_fixed(&key,bin_ip,sizeof(struct in_addr));
@@ -829,7 +857,7 @@ int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr)
{
reg3 int flag;
DBUG_ENTER("wild_case_compare");
- DBUG_PRINT("enter",("str='%s', wildstr='%s'",str,wildstr));
+ DBUG_PRINT("enter",("str: '%s' wildstr: '%s'",str,wildstr));
while (*wildstr)
{
while (*wildstr && *wildstr != wild_many && *wildstr != wild_one)
@@ -947,40 +975,63 @@ bool acl_check_host(const char *host, const char *ip)
}
/*****************************************************************************
-** Change password for the user if it's not an anonymous user
-** Note: This should write the error directly to the client!
+ Change password for the user if it's not an anonymous user
+ Note: This should write the error directly to the client!
*****************************************************************************/
-bool change_password(THD *thd, const char *host, const char *user,
- char *new_password)
-{
- uint length=0;
- DBUG_ENTER("change_password");
- DBUG_PRINT("enter",("thd=%x, host='%s', user='%s', new_password='%s'",thd,host,user,new_password));
+/*
+ Check if the user is allowed to change password
+
+ SYNOPSIS:
+ check_change_password()
+ thd THD
+ host hostname for the user
+ user user name
+ RETURN VALUE
+ 0 OK
+ 1 ERROR ; In this case the error is sent to the client.
+*/
+
+bool check_change_password(THD *thd, const char *host, const char *user)
+{
if (!initialized)
{
send_error(&thd->net, ER_PASSWORD_NOT_ALLOWED); /* purecov: inspected */
- DBUG_RETURN(1); /* purecov: inspected */
+ return(1); /* purecov: inspected */
}
- if (!host)
- host=thd->ip; /* purecov: tested */
- /* password should always be 0 or 16 chars; simple hack to avoid cracking */
- length=(uint) strlen(new_password);
- new_password[length & 16]=0;
-
if (!thd->slave_thread &&
(strcmp(thd->user,user) ||
my_strcasecmp(system_charset_info, host,thd->host_or_ip)))
{
if (check_access(thd, UPDATE_ACL, "mysql",0,1))
- DBUG_RETURN(1);
+ return(1);
}
if (!thd->slave_thread && !thd->user[0])
{
send_error(&thd->net, ER_PASSWORD_ANONYMOUS_USER);
- DBUG_RETURN(1);
+ return(1);
}
+ return(0);
+}
+
+
+bool change_password(THD *thd, const char *host, const char *user,
+ char *new_password)
+{
+ uint length=0;
+ DBUG_ENTER("change_password");
+ DBUG_PRINT("enter",("host: '%s' user: '%s' new_password: '%s'",
+ host,user,new_password));
+ DBUG_ASSERT(host != 0); // Ensured by parent
+
+ if (check_change_password(thd, host, user))
+ DBUG_RETURN(1);
+
+ /* password should always be 0 or 16 chars; simple hack to avoid cracking */
+ length=(uint) strlen(new_password);
+ new_password[length & 16]=0;
+
VOID(pthread_mutex_lock(&acl_cache->lock));
ACL_USER *acl_user;
if (!(acl_user= find_acl_user(host,user)))
@@ -1007,15 +1058,14 @@ bool change_password(THD *thd, const char *host, const char *user,
VOID(pthread_mutex_unlock(&acl_cache->lock));
char buff[460];
-
- Query_log_event qinfo(thd, buff);
- qinfo.q_len =
+ ulong query_length=
my_sprintf(buff,
(buff,"SET PASSWORD FOR \"%-.120s\"@\"%-.120s\"=\"%-.120s\"",
acl_user->user ? acl_user->user : "",
acl_user->host.hostname ? acl_user->host.hostname : "",
new_password));
- mysql_update_log.write(thd,buff,qinfo.q_len);
+ mysql_update_log.write(thd, buff, query_length);
+ Query_log_event qinfo(thd, buff, query_length);
mysql_bin_log.write(&qinfo);
DBUG_RETURN(0);
}
@@ -1029,7 +1079,7 @@ static ACL_USER *
find_acl_user(const char *host, const char *user)
{
DBUG_ENTER("find_acl_user");
- DBUG_PRINT("enter",("host='%s', user='%s'",host,user));
+ DBUG_PRINT("enter",("host: '%s' user: '%s'",host,user));
for (uint i=0 ; i < acl_users.elements ; i++)
{
ACL_USER *acl_user=dynamic_element(&acl_users,i,ACL_USER*);
@@ -1104,7 +1154,7 @@ static bool compare_hostname(const acl_host_and_ip *host, const char *hostname,
/****************************************************************************
-** Code to update grants in the user and database privilege tables
+ Code to update grants in the user and database privilege tables
****************************************************************************/
static bool update_user_table(THD *thd, const char *host, const char *user,
@@ -1154,10 +1204,10 @@ static bool test_if_create_new_users(THD *thd)
if (opt_safe_user_create && !(thd->master_access & INSERT_ACL))
{
TABLE_LIST tl;
- uint db_access;
+ ulong db_access;
bzero((char*) &tl,sizeof(tl));
tl.db= (char*) "mysql";
- tl.real_name= (char*) "user";
+ tl.real_name= (char*) "user";
db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr,
thd->priv_user, tl.db);
if (!(db_access & INSERT_ACL))
@@ -1175,12 +1225,13 @@ static bool test_if_create_new_users(THD *thd)
****************************************************************************/
static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
- uint rights, char what, bool create_user)
+ ulong rights, bool revoke_grant,
+ bool create_user)
{
int error = -1;
- uint i,j;
bool old_row_exists=0;
char *password,empty_string[1];
+ char what= (revoke_grant) ? 'N' : 'Y';
DBUG_ENTER("replace_user_table");
password=empty_string;
@@ -1231,55 +1282,58 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
table->field[2]->store(password,(uint) strlen(password), system_charset_info);
}
- for (i = 3, j = SELECT_ACL; // starting from reload
- i < table->fields;
- i++, j <<= 1)
+ /* Update table columns with new privileges */
+
+ Field **tmp_field;
+ ulong priv;
+ for (tmp_field= table->field+3, priv = SELECT_ACL;
+ *tmp_field && (*tmp_field)->real_type() == FIELD_TYPE_ENUM &&
+ ((Field_enum*) (*tmp_field))->typelib->count == 2 ;
+ tmp_field++, priv <<= 1)
{
- if (j & rights) // set requested privileges
- table->field[i]->store(&what,1, system_charset_info);
+ if (priv & rights) // set requested privileges
+ (*tmp_field)->store(&what, 1, system_charset_info);
}
rights=get_access(table,3);
-#ifdef HAVE_OPENSSL
- /* We write down SSL related ACL stuff */
- DBUG_PRINT("info",("table->fields=%d",table->fields));
- if (table->fields >= 21) /* From 4.0.0 we have more fields */
+ DBUG_PRINT("info",("table->fields: %d",table->fields));
+ if (table->fields >= 31) /* From 4.0.0 we have more fields */
{
- table->field[18]->store("",0, system_charset_info);
- table->field[19]->store("",0, system_charset_info);
- table->field[20]->store("",0, system_charset_info);
+#ifdef HAVE_OPENSSL
+ /* We write down SSL related ACL stuff */
+ table->field[25]->store("", 0, system_charset_info);
+ table->field[26]->store("", 0, system_charset_info);
+ table->field[27]->store("", 0, system_charset_info);
switch (thd->lex.ssl_type) {
case SSL_TYPE_ANY:
- table->field[17]->store("ANY",3, system_charset_info);
+ table->field[24]->store("ANY",3, system_charset_info);
break;
case SSL_TYPE_X509:
- table->field[17]->store("X509",4, system_charset_info);
+ table->field[24]->store("X509",4, system_charset_info);
break;
case SSL_TYPE_SPECIFIED:
- table->field[17]->store("SPECIFIED",9, system_charset_info);
+ table->field[24]->store("SPECIFIED",9, system_charset_info);
if (thd->lex.ssl_cipher)
- table->field[18]->store(thd->lex.ssl_cipher,
+ table->field[25]->store(thd->lex.ssl_cipher,
strlen(thd->lex.ssl_cipher), system_charset_info);
if (thd->lex.x509_issuer)
- table->field[19]->store(thd->lex.x509_issuer,
+ table->field[26]->store(thd->lex.x509_issuer,
strlen(thd->lex.x509_issuer), system_charset_info);
if (thd->lex.x509_subject)
- table->field[20]->store(thd->lex.x509_subject,
+ table->field[27]->store(thd->lex.x509_subject,
strlen(thd->lex.x509_subject), system_charset_info);
break;
default:
- table->field[17]->store("NONE",4, system_charset_info);
+ table->field[24]->store("", 0, system_charset_info);
}
- }
#endif /* HAVE_OPENSSL */
- if (table->fields >= 23)
- {
+
USER_RESOURCES mqh = thd->lex.mqh;
- if (mqh.questions)
- table->field[21]->store((longlong) mqh.questions);
- if (mqh.updates)
- table->field[22]->store((longlong) mqh.updates);
- if (mqh.connections)
- table->field[23]->store((longlong) mqh.connections);
+ if (mqh.bits & 1)
+ table->field[28]->store((longlong) mqh.questions);
+ if (mqh.bits & 2)
+ table->field[29]->store((longlong) mqh.updates);
+ if (mqh.bits & 4)
+ table->field[30]->store((longlong) mqh.connections);
mqh_used = mqh_used || mqh.questions || mqh.updates || mqh.connections;
}
if (old_row_exists)
@@ -1337,16 +1391,18 @@ end:
/*
-** change grants in the mysql.db table
+ change grants in the mysql.db table
*/
static int replace_db_table(TABLE *table, const char *db,
const LEX_USER &combo,
- uint rights, char what)
+ ulong rights, bool revoke_grant)
{
- uint i,j,store_rights;
+ uint i;
+ ulong priv,store_rights;
bool old_row_exists=0;
int error;
+ char what= (revoke_grant) ? 'N' : 'Y';
DBUG_ENTER("replace_db_table");
// is there such a user in user table in memory ????
@@ -1382,9 +1438,9 @@ static int replace_db_table(TABLE *table, const char *db,
}
store_rights=get_rights_for_db(rights);
- for (i = 3, j = 1; i < table->fields; i++, j <<= 1)
+ for (i= 3, priv= 1; i < table->fields; i++, priv <<= 1)
{
- if (j & store_rights) // do it if priv is chosen
+ if (priv & store_rights) // do it if priv is chosen
table->field [i]->store(&what,1, system_charset_info);// set requested privileges
}
rights=get_access(table,3);
@@ -1432,13 +1488,15 @@ class GRANT_COLUMN :public Sql_alloc
{
public:
char *column;
- uint rights, key_length;
- GRANT_COLUMN(String &c, uint y) :rights (y)
+ ulong rights;
+ uint key_length;
+ GRANT_COLUMN(String &c, ulong y) :rights (y)
{
- column= memdup_root(&memex,c.ptr(),key_length=c.length());
+ column= memdup_root(&memex,c.ptr(), key_length=c.length());
}
};
+
static byte* get_key_column(GRANT_COLUMN *buff,uint *length,
my_bool not_used __attribute__((unused)))
{
@@ -1446,14 +1504,16 @@ static byte* get_key_column(GRANT_COLUMN *buff,uint *length,
return (byte*) buff->column;
}
+
class GRANT_TABLE :public Sql_alloc
{
public:
char *host,*db,*user,*tname, *hash_key;
- uint privs, cols, key_length;
+ ulong privs, cols;
+ uint key_length;
HASH hash_columns;
GRANT_TABLE (const char *h, const char *d,const char *u, const char *t,
- uint p,uint c)
+ ulong p, ulong c)
: privs(p), cols(c)
{
host = strdup_root(&memex,h);
@@ -1479,7 +1539,9 @@ public:
host = get_field(&memex,form,0);
db = get_field(&memex,form,1);
- user = get_field(&memex,form,2); if (!user) user=(char*) "";
+ user = get_field(&memex,form,2);
+ if (!user)
+ user=(char*) "";
tname = get_field(&memex,form,3);
if (!host || !db || !tname)
{
@@ -1496,8 +1558,8 @@ public:
(uint) strlen(tname) + 3);
hash_key = (char*) alloc_root(&memex,key_length);
strmov(strmov(strmov(hash_key,user)+1,db)+1,tname);
- privs = (uint) form->field[6]->val_int();
- cols = (uint) form->field[7]->val_int();
+ privs = (ulong) form->field[6]->val_int();
+ cols = (ulong) form->field[7]->val_int();
privs = fix_rights_for_table(privs);
cols = fix_rights_for_column(cols);
@@ -1531,7 +1593,7 @@ public:
GRANT_COLUMN *mem_check;
/* As column name is a string, we don't have to supply a buffer */
res=col_privs->field[4]->val_str(&column_name,&column_name);
- uint priv= (uint) col_privs->field[6]->val_int();
+ ulong priv= (ulong) col_privs->field[6]->val_int();
if (!(mem_check = new GRANT_COLUMN(*res,
fix_rights_for_column(priv))))
{
@@ -1547,6 +1609,7 @@ public:
bool ok() { return privs != 0 || cols != 0; }
};
+
static byte* get_grant_table(GRANT_TABLE *buff,uint *length,
my_bool not_used __attribute__((unused)))
{
@@ -1554,11 +1617,13 @@ static byte* get_grant_table(GRANT_TABLE *buff,uint *length,
return (byte*) buff->hash_key;
}
+
void free_grant_table(GRANT_TABLE *grant_table)
{
hash_free(&grant_table->hash_columns);
}
+
/* Search after a matching grant. Prefer exact grants before not exact ones */
static GRANT_TABLE *table_hash_search(const char *host,const char* ip,
@@ -1597,8 +1662,7 @@ static GRANT_TABLE *table_hash_search(const char *host,const char* ip,
inline GRANT_COLUMN *
-column_hash_search(GRANT_TABLE *t, const char *cname,
- uint length)
+column_hash_search(GRANT_TABLE *t, const char *cname, uint length)
{
return (GRANT_COLUMN*) hash_search(&t->hash_columns, (byte*) cname,length);
}
@@ -1608,7 +1672,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
TABLE *table, const LEX_USER &combo,
List <LEX_COLUMN> &columns,
const char *db, const char *table_name,
- uint rights, bool revoke_grant)
+ ulong rights, bool revoke_grant)
{
int error=0,result=0;
uint key_length;
@@ -1632,7 +1696,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
table->file->index_init(0);
while ((xx=iter++))
{
- uint privileges = xx->rights;
+ ulong privileges = xx->rights;
bool old_row_exists=0;
key_restore(table,key,0,key_length);
table->field[4]->store(xx->column.ptr(),xx->column.length(),system_charset_info);
@@ -1655,7 +1719,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
}
else
{
- uint tmp= (uint) table->field[6]->val_int();
+ ulong tmp= (ulong) table->field[6]->val_int();
tmp=fix_rights_for_column(tmp);
if (revoke_grant)
@@ -1715,7 +1779,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
// Scan trough all rows with the same host,db,user and table
do
{
- uint privileges = (uint) table->field[6]->val_int();
+ ulong privileges = (ulong) table->field[6]->val_int();
privileges=fix_rights_for_column(privileges);
store_record(table,1);
@@ -1771,18 +1835,21 @@ static int replace_column_table(GRANT_TABLE *g_t,
static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
TABLE *table, const LEX_USER &combo,
const char *db, const char *table_name,
- uint rights, uint kolone, bool revoke_grant)
+ ulong rights, ulong col_rights,
+ bool revoke_grant)
{
char grantor[HOSTNAME_LENGTH+1+USERNAME_LENGTH];
int old_row_exists = 1;
int error=0;
- uint store_table_rights,store_col_rights;
+ ulong store_table_rights, store_col_rights;
DBUG_ENTER("replace_table_table");
strxmov(grantor, thd->user, "@", thd->host_or_ip, NullS);
- // The following should always succeed as new users are created before
- // this function is called!
+ /*
+ The following should always succeed as new users are created before
+ this function is called!
+ */
if (!find_acl_user(combo.host.str,combo.user.str))
{
my_error(ER_PASSWORD_NO_MATCH,MYF(0)); /* purecov: deadcode */
@@ -1817,14 +1884,14 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
restore_record(table,1); // Get saved record
}
- store_table_rights=get_rights_for_table(rights);
- store_col_rights=get_rights_for_column(kolone);
+ store_table_rights= get_rights_for_table(rights);
+ store_col_rights= get_rights_for_column(col_rights);
if (old_row_exists)
{
- uint j,k;
+ ulong j,k;
store_record(table,1);
- j = (uint) table->field[6]->val_int();
- k = (uint) table->field[7]->val_int();
+ j = (ulong) table->field[6]->val_int();
+ k = (ulong) table->field[7]->val_int();
if (revoke_grant)
{
@@ -1833,8 +1900,8 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
}
else
{
- store_table_rights|=j;
- store_col_rights|=k;
+ store_table_rights|= j;
+ store_col_rights|= k;
}
}
@@ -1842,7 +1909,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
table->field[6]->store((longlong) store_table_rights);
table->field[7]->store((longlong) store_col_rights);
rights=fix_rights_for_table(store_table_rights);
- kolone=fix_rights_for_column(store_col_rights);
+ col_rights=fix_rights_for_column(store_col_rights);
if (old_row_exists)
{
@@ -1861,10 +1928,10 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
goto table_error; /* purecov: deadcode */
}
- if (rights | kolone)
+ if (rights | col_rights)
{
- grant_table->privs = rights;
- grant_table->cols = kolone;
+ grant_table->privs= rights;
+ grant_table->cols= col_rights;
}
else
{
@@ -1881,18 +1948,15 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
int mysql_table_grant (THD *thd, TABLE_LIST *table_list,
List <LEX_USER> &user_list,
- List <LEX_COLUMN> &columns, uint rights,
+ List <LEX_COLUMN> &columns, ulong rights,
bool revoke_grant)
{
- uint column_priv = 0;
+ ulong column_priv = 0;
List_iterator <LEX_USER> str_list (user_list);
LEX_USER *Str;
TABLE_LIST tables[3];
bool create_new_users=0;
DBUG_ENTER("mysql_table_grant");
- DBUG_PRINT("info",("ssl_cipher=%s",thd->lex.ssl_cipher));
- DBUG_PRINT("info",("x509_issuer=%s",thd->lex.x509_issuer));
- DBUG_PRINT("info",("x509_subject=%s",thd->lex.x509_subject));
if (!initialized)
{
@@ -1982,12 +2046,8 @@ int mysql_table_grant (THD *thd, TABLE_LIST *table_list,
continue;
}
/* Create user if needed */
- if (replace_user_table(thd,
- tables[0].table,
- *Str,
- 0,
- revoke_grant ? 'N' : 'Y',
- create_new_users))
+ if (replace_user_table(thd, tables[0].table, *Str,
+ 0, revoke_grant, create_new_users))
{
result= -1; // Remember error
continue; // Add next user
@@ -2083,12 +2143,12 @@ int mysql_table_grant (THD *thd, TABLE_LIST *table_list,
}
-int mysql_grant (THD *thd, const char *db, List <LEX_USER> &list, uint rights,
- bool revoke_grant)
+int mysql_grant (THD *thd, const char *db, List <LEX_USER> &list,
+ ulong rights, bool revoke_grant)
{
List_iterator <LEX_USER> str_list (list);
LEX_USER *Str;
- char what,tmp_db[NAME_LEN+1];
+ char tmp_db[NAME_LEN+1];
bool create_new_users=0;
TABLE_LIST tables[2];
DBUG_ENTER("mysql_grant");
@@ -2099,7 +2159,6 @@ int mysql_grant (THD *thd, const char *db, List <LEX_USER> &list, uint rights,
return 1; /* purecov: tested */
}
- what = (revoke_grant) ? 'N' : 'Y';
if (lower_case_table_names && db)
{
strmov(tmp_db,db);
@@ -2148,12 +2207,13 @@ int mysql_grant (THD *thd, const char *db, List <LEX_USER> &list, uint rights,
if ((replace_user_table(thd,
tables[0].table,
*Str,
- (!db ? rights : 0), what, create_new_users)))
+ (!db ? rights : 0), revoke_grant,
+ create_new_users)))
result= -1;
else
{
if (db && replace_db_table(tables[1].table, db, *Str, rights & DB_ACLS,
- what))
+ revoke_grant))
result= -1;
}
}
@@ -2166,7 +2226,8 @@ int mysql_grant (THD *thd, const char *db, List <LEX_USER> &list, uint rights,
DBUG_RETURN(result);
}
- /* Free grant array if possible */
+
+/* Free grant array if possible */
void grant_free(void)
{
@@ -2304,11 +2365,11 @@ void grant_reload(void)
/****************************************************************************
-** Check grants
-** All errors are written directly to the client if command name is given !
+ Check grants
+ All errors are written directly to the client if command name is given !
****************************************************************************/
-bool check_grant(THD *thd, uint want_access, TABLE_LIST *tables,
+bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
uint show_table, bool no_errors)
{
TABLE_LIST *table;
@@ -2394,7 +2455,7 @@ bool check_grant_column (THD *thd,TABLE *table, const char *name,
GRANT_TABLE *grant_table;
GRANT_COLUMN *grant_column;
- uint want_access=table->grant.want_privilege;
+ ulong want_access=table->grant.want_privilege;
if (!want_access)
return 0; // Already checked
@@ -2432,13 +2493,8 @@ bool check_grant_column (THD *thd,TABLE *table, const char *name,
pthread_mutex_unlock(&LOCK_grant);
if (!show_tables)
{
- const char *command="";
- if (want_access & SELECT_ACL)
- command ="select";
- else if (want_access & INSERT_ACL)
- command = "insert";
- else if (want_access & UPDATE_ACL)
- command = "update";
+ char command[128];
+ get_privilege_desc(command, sizeof(command), want_access);
my_printf_error(ER_COLUMNACCESS_DENIED_ERROR,
ER(ER_COLUMNACCESS_DENIED_ERROR),
MYF(0),
@@ -2452,7 +2508,7 @@ bool check_grant_column (THD *thd,TABLE *table, const char *name,
}
-bool check_grant_all_columns(THD *thd,uint want_access, TABLE *table)
+bool check_grant_all_columns(THD *thd, ulong want_access, TABLE *table)
{
GRANT_TABLE *grant_table;
GRANT_COLUMN *grant_column;
@@ -2510,9 +2566,9 @@ bool check_grant_all_columns(THD *thd,uint want_access, TABLE *table)
/****************************************************************************
-** Check if a user has the right to access a database
-** Access is accepted if he has a grant for any table in the database
-** Return 1 if access is denied
+ Check if a user has the right to access a database
+ Access is accepted if he has a grant for any table in the database
+ Return 1 if access is denied
****************************************************************************/
bool check_grant_db(THD *thd,const char *db)
@@ -2543,10 +2599,10 @@ bool check_grant_db(THD *thd,const char *db)
}
/*****************************************************************************
-** Functions to retrieve the grant for a table/column (for SHOW functions)
+ Functions to retrieve the grant for a table/column (for SHOW functions)
*****************************************************************************/
-uint get_table_grant(THD *thd, TABLE_LIST *table)
+ulong get_table_grant(THD *thd, TABLE_LIST *table)
{
char *user = thd->priv_user;
const char *db = table->db ? table->db : thd->db;
@@ -2564,11 +2620,11 @@ uint get_table_grant(THD *thd, TABLE_LIST *table)
}
-uint get_column_grant(THD *thd, TABLE_LIST *table, Field *field)
+ulong get_column_grant(THD *thd, TABLE_LIST *table, Field *field)
{
GRANT_TABLE *grant_table;
GRANT_COLUMN *grant_column;
- uint priv;
+ ulong priv;
pthread_mutex_lock(&LOCK_grant);
// reload table if someone has modified any grants
@@ -2598,20 +2654,28 @@ uint get_column_grant(THD *thd, TABLE_LIST *table, Field *field)
/*****************************************************************************
-** SHOW GRANTS : send to client grant-like strings depicting user@host
-** privileges
+ SHOW GRANTS : send to client grant-like strings depicting user@host
+ privileges
*****************************************************************************/
static const char *command_array[]=
-{"SELECT", "INSERT","UPDATE","DELETE","CREATE", "DROP","RELOAD","SHUTDOWN",
- "PROCESS","FILE","GRANT","REFERENCES","INDEX","ALTER"};
-static int command_lengths[]={6,6,6,6,6,4,6,8,7,4,5,10,5,5};
+{
+ "SELECT", "INSERT","UPDATE","DELETE","CREATE", "DROP", "RELOAD","SHUTDOWN",
+ "PROCESS","FILE","GRANT","REFERENCES","INDEX", "ALTER", "SHOW DATABASES",
+ "SUPER", "CREATE TEMPORARY TABLES", "LOCK TABLES", "EXECUTE",
+ "REPLICATION SLAVE", "REPLICATION CLIENT",
+};
+static uint command_lengths[]=
+{
+ 6,6,6,6,6,4,6,8,7,4,5,10,5,5,14,5,23,11,7,17,18
+};
+
int mysql_show_grants(THD *thd,LEX_USER *lex_user)
{
- uint counter, want_access,index;
+ ulong want_access;
+ uint counter,index;
int error = 0;
- int ssl_options = 0;
ACL_USER *acl_user; ACL_DB *acl_db;
char buff[1024];
DBUG_ENTER("mysql_show_grants");
@@ -2680,7 +2744,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
else
{
bool found=0;
- uint j,test_access= want_access & ~GRANT_ACL;
+ ulong j,test_access= want_access & ~GRANT_ACL;
for (counter=0, j = SELECT_ACL;j <= GLOBAL_ACLS;counter++,j <<= 1)
{
if (test_access & j)
@@ -2709,18 +2773,18 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
/* "show grants" SSL related stuff */
if (acl_user->ssl_type == SSL_TYPE_ANY)
global.append(" REQUIRE SSL",12);
- else if (acl_user->ssl_type==SSL_TYPE_X509)
+ else if (acl_user->ssl_type == SSL_TYPE_X509)
global.append(" REQUIRE X509",13);
- else if (acl_user->ssl_type==SSL_TYPE_SPECIFIED)
+ else if (acl_user->ssl_type == SSL_TYPE_SPECIFIED)
{
+ int ssl_options = 0;
global.append(" REQUIRE ",9);
if (acl_user->x509_issuer)
{
- if (ssl_options++)
- global.append(" AND ",5);
+ ssl_options++;
global.append("ISSUER \"",8);
global.append(acl_user->x509_issuer,strlen(acl_user->x509_issuer));
- global.append("\"",1);
+ global.append('\'');
}
if (acl_user->x509_subject)
{
@@ -2728,40 +2792,46 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
global.append(" AND ",5);
global.append("SUBJECT \"",9);
global.append(acl_user->x509_subject,strlen(acl_user->x509_subject));
- global.append("\"",1);
+ global.append('\'');
}
if (acl_user->ssl_cipher)
{
if (ssl_options++)
global.append(" AND ",5);
- global.append("CIPHER \"",8);
+ global.append("CIPHER '",8);
global.append(acl_user->ssl_cipher,strlen(acl_user->ssl_cipher));
- global.append("\"",1);
+ global.append('\'');
}
}
#endif /* HAVE_OPENSSL */
- if (want_access & GRANT_ACL)
- global.append(" WITH GRANT OPTION",18);
- if (acl_user->user_resource.questions)
+ if ((want_access & GRANT_ACL) ||
+ (acl_user->user_resource.questions | acl_user->user_resource.updates |
+ acl_user->user_resource.connections))
{
- char buff[65], *p; // just as in int2str
- global.append(" WITH MAX_QUERIES_PER_HOUR = ",29);
- p=int2str(acl_user->user_resource.questions,buff,10);
- global.append(buff,p-buff);
- }
- if (acl_user->user_resource.updates)
- {
- char buff[65], *p; // just as in int2str
- global.append(" WITH MAX_UPDATES_PER_HOUR = ",29);
- p=int2str(acl_user->user_resource.updates,buff,10);
- global.append(buff,p-buff);
- }
- if (acl_user->user_resource.connections)
- {
- char buff[65], *p; // just as in int2str
- global.append(" WITH MAX_CONNECTIONS_PER_HOUR = ",33);
- p=int2str(acl_user->user_resource.connections,buff,10);
- global.append(buff,p-buff);
+ global.append(" WITH",5);
+ if (want_access & GRANT_ACL)
+ global.append(" GRANT OPTION",13);
+ if (acl_user->user_resource.questions)
+ {
+ char buff[22], *p; // just as in int2str
+ global.append(" MAX_QUERIES_PER_HOUR ",22);
+ p=int10_to_str(acl_user->user_resource.questions,buff,10);
+ global.append(buff,p-buff);
+ }
+ if (acl_user->user_resource.updates)
+ {
+ char buff[22], *p; // just as in int2str
+ global.append(" MAX_UPDATES_PER_HOUR ",22);
+ p=int10_to_str(acl_user->user_resource.updates,buff,10);
+ global.append(buff,p-buff);
+ }
+ if (acl_user->user_resource.connections)
+ {
+ char buff[22], *p; // just as in int2str
+ global.append(" MAX_CONNECTIONS_PER_HOUR ",26);
+ p=int10_to_str(acl_user->user_resource.connections,buff,10);
+ global.append(buff,p-buff);
+ }
}
thd->packet.length(0);
net_store_data(&thd->packet,global.ptr(),global.length());
@@ -2798,7 +2868,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
else
{
int found=0, cnt;
- uint j,test_access= want_access & ~GRANT_ACL;
+ ulong j,test_access= want_access & ~GRANT_ACL;
for (cnt=0, j = SELECT_ACL; j <= DB_ACLS; cnt++,j <<= 1)
{
if (test_access & j)
@@ -2810,15 +2880,15 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
}
}
}
- db.append (" ON '",5);
+ db.append (" ON `",5);
db.append(acl_db->db);
- db.append ("'.* TO '",8);
+ db.append ("`.* TO '",8);
db.append(lex_user->user.str,lex_user->user.length);
db.append ("'@'",3);
db.append(lex_user->host.str, lex_user->host.length);
db.append ('\'');
if (want_access & GRANT_ACL)
- db.append(" WITH GRANT OPTION",18);
+ db.append(" WITH GRANT OPTION",18);
thd->packet.length(0);
net_store_data(&thd->packet,db.ptr(),db.length());
if (my_net_write(&thd->net,(char*) thd->packet.ptr(),
@@ -2857,7 +2927,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
else
{
int found=0;
- uint j,test_access= (want_access | grant_table->cols) & ~GRANT_ACL;
+ ulong j,test_access= (want_access | grant_table->cols) & ~GRANT_ACL;
for (counter=0, j = SELECT_ACL;j <= TABLE_ACLS; counter++,j <<= 1)
{
@@ -2925,6 +2995,34 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
}
+/*
+ Make a clear-text version of the requested privilege.
+*/
+
+void get_privilege_desc(char *to, uint max_length, ulong access)
+{
+ uint pos;
+ char *start=to;
+ DBUG_ASSERT(max_length >= 30); // For end ',' removal
+
+ if (access)
+ {
+ max_length--; // Reserve place for end-zero
+ for (pos=0 ; access ; pos++, access>>=1)
+ {
+ if ((access & 1) &&
+ command_lengths[pos] + (uint) (to-start) < max_length)
+ {
+ to= strmov(to, command_array[pos]);
+ *to++=',';
+ }
+ }
+ to--; // Remove end ','
+ }
+ *to=0;
+}
+
+
void get_mqh(const char *user, const char *host, USER_CONN *uc)
{
ACL_USER *acl_user;
@@ -2937,7 +3035,7 @@ void get_mqh(const char *user, const char *host, USER_CONN *uc)
/*****************************************************************************
-** Instantiate used templates
+ Instantiate used templates
*****************************************************************************/
#ifdef __GNUC__
diff --git a/sql/sql_acl.h b/sql/sql_acl.h
index 9ac3bc6ed74..d6cf320c978 100644
--- a/sql/sql_acl.h
+++ b/sql/sql_acl.h
@@ -15,33 +15,49 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#define SELECT_ACL 1
-#define INSERT_ACL 2
-#define UPDATE_ACL 4
-#define DELETE_ACL 8
-#define CREATE_ACL 16
-#define DROP_ACL 32
-#define RELOAD_ACL 64
-#define SHUTDOWN_ACL 128
-#define PROCESS_ACL 256
-#define FILE_ACL 512
-#define GRANT_ACL 1024
-#define REFERENCES_ACL 2048
-#define INDEX_ACL 4096
-#define ALTER_ACL 8192
-#define EXTRA_ACL 16384
-#define DB_ACLS (UPDATE_ACL | SELECT_ACL | INSERT_ACL | \
- DELETE_ACL | CREATE_ACL | DROP_ACL | GRANT_ACL | \
- REFERENCES_ACL | INDEX_ACL | ALTER_ACL)
-#define TABLE_ACLS (SELECT_ACL | INSERT_ACL | UPDATE_ACL | \
- DELETE_ACL | CREATE_ACL | DROP_ACL | GRANT_ACL | \
- REFERENCES_ACL | INDEX_ACL | ALTER_ACL)
-#define COL_ACLS (SELECT_ACL | INSERT_ACL | UPDATE_ACL | REFERENCES_ACL)
-#define GLOBAL_ACLS (SELECT_ACL | INSERT_ACL | UPDATE_ACL | DELETE_ACL |\
- CREATE_ACL | DROP_ACL | RELOAD_ACL | SHUTDOWN_ACL |\
- PROCESS_ACL | FILE_ACL | GRANT_ACL | REFERENCES_ACL |\
- INDEX_ACL | ALTER_ACL)
-#define NO_ACCESS 32768
+#define SELECT_ACL (1L << 0)
+#define INSERT_ACL (1L << 1)
+#define UPDATE_ACL (1L << 2)
+#define DELETE_ACL (1L << 3)
+#define CREATE_ACL (1L << 4)
+#define DROP_ACL (1L << 5)
+#define RELOAD_ACL (1L << 6)
+#define SHUTDOWN_ACL (1L << 7)
+#define PROCESS_ACL (1L << 8)
+#define FILE_ACL (1L << 9)
+#define GRANT_ACL (1L << 10)
+#define REFERENCES_ACL (1L << 11)
+#define INDEX_ACL (1L << 12)
+#define ALTER_ACL (1L << 13)
+#define SHOW_DB_ACL (1L << 14)
+#define SUPER_ACL (1L << 15)
+#define CREATE_TMP_ACL (1L << 16)
+#define LOCK_TABLES_ACL (1L << 17)
+#define EXECUTE_ACL (1L << 18)
+#define REPL_SLAVE_ACL (1L << 19)
+#define REPL_CLIENT_ACL (1L << 20)
+
+
+#define DB_ACLS \
+(UPDATE_ACL | SELECT_ACL | INSERT_ACL | DELETE_ACL | CREATE_ACL | DROP_ACL | \
+ GRANT_ACL | REFERENCES_ACL | INDEX_ACL | ALTER_ACL)
+
+#define TABLE_ACLS \
+(SELECT_ACL | INSERT_ACL | UPDATE_ACL | DELETE_ACL | CREATE_ACL | DROP_ACL | \
+ GRANT_ACL | REFERENCES_ACL | INDEX_ACL | ALTER_ACL)
+
+#define COL_ACLS \
+(SELECT_ACL | INSERT_ACL | UPDATE_ACL | REFERENCES_ACL)
+
+#define GLOBAL_ACLS \
+(SELECT_ACL | INSERT_ACL | UPDATE_ACL | DELETE_ACL | CREATE_ACL | DROP_ACL | \
+ RELOAD_ACL | SHUTDOWN_ACL | PROCESS_ACL | FILE_ACL | GRANT_ACL | \
+ REFERENCES_ACL | INDEX_ACL | ALTER_ACL | SHOW_DB_ACL | SUPER_ACL | \
+ CREATE_TMP_ACL | LOCK_TABLES_ACL | REPL_SLAVE_ACL | REPL_CLIENT_ACL | \
+ EXECUTE_ACL)
+
+#define EXTRA_ACL (1L << 29)
+#define NO_ACCESS (1L << 30)
/* defines to change the above bits to how things are stored in tables */
@@ -57,29 +73,31 @@
int acl_init(bool dont_read_acl_tables);
void acl_reload(void);
void acl_free(bool end=0);
-uint acl_get(const char *host, const char *ip, const char *bin_ip,
- const char *user, const char *db);
-uint acl_getroot(THD *thd, const char *host, const char *ip, const char *user,
- const char *password,const char *scramble,char **priv_user,
- bool old_ver, USER_RESOURCES *max);
+ulong acl_get(const char *host, const char *ip, const char *bin_ip,
+ const char *user, const char *db);
+ulong acl_getroot(THD *thd, const char *host, const char *ip, const char *user,
+ const char *password,const char *scramble,char **priv_user,
+ bool old_ver, USER_RESOURCES *max);
bool acl_check_host(const char *host, const char *ip);
+bool check_change_password(THD *thd, const char *host, const char *user);
bool change_password(THD *thd, const char *host, const char *user,
char *password);
int mysql_grant(THD *thd, const char *db, List <LEX_USER> &user_list,
- uint rights, bool revoke);
+ ulong rights, bool revoke);
int mysql_table_grant(THD *thd, TABLE_LIST *table, List <LEX_USER> &user_list,
- List <LEX_COLUMN> &column_list, uint rights,
+ List <LEX_COLUMN> &column_list, ulong rights,
bool revoke);
int grant_init(void);
void grant_free(void);
void grant_reload(void);
-bool check_grant(THD *thd, uint want_access, TABLE_LIST *tables,
+bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
uint show_command=0, bool dont_print_error=0);
-bool check_grant_column (THD *thd,TABLE *table, const char *name,uint length,
+bool check_grant_column (THD *thd,TABLE *table, const char *name, uint length,
uint show_command=0);
-bool check_grant_all_columns(THD *thd, uint want_access, TABLE *table);
+bool check_grant_all_columns(THD *thd, ulong want_access, TABLE *table);
bool check_grant_db(THD *thd,const char *db);
-uint get_table_grant(THD *thd, TABLE_LIST *table);
-uint get_column_grant(THD *thd, TABLE_LIST *table, Field *field);
+ulong get_table_grant(THD *thd, TABLE_LIST *table);
+ulong get_column_grant(THD *thd, TABLE_LIST *table, Field *field);
int mysql_show_grants(THD *thd, LEX_USER *user);
+void get_privilege_desc(char *to, uint max_length, ulong access);
void get_mqh(const char *user, const char *host, USER_CONN *uc);
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 6185b031c2e..a8115c15412 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -19,7 +19,6 @@
#include "mysql_priv.h"
#include "sql_acl.h"
-#include <thr_alarm.h>
#include <m_ctype.h>
#include <my_dir.h>
#include <hash.h>
@@ -33,7 +32,7 @@ TABLE *unused_tables; /* Used by mysql_test */
HASH open_cache; /* Used by mysql_test */
static int open_unireg_entry(THD *thd,TABLE *entry,const char *db,
- const char *name, const char *alias, bool locked);
+ const char *name, const char *alias);
static void free_cache_entry(TABLE *entry);
static void mysql_rm_tmp_tables(void);
static key_map get_key_map_from_key_list(TABLE *table,
@@ -110,10 +109,27 @@ static void check_unused(void)
#define check_unused()
#endif
+/*
+ Create a list for all open tables matching SQL expression
+
+ SYNOPSIS
+ list_open_tables()
+ thd Thread THD
+ wild SQL like expression
+
+ NOTES
+ One gets only a list of tables for which one has any kind of privilege.
+ db and table names are allocated in result struct, so one doesn't need
+ a lock on LOCK_open when traversing the return list.
+
+ RETURN VALUES
+ NULL Error (Probably OOM)
+ # Pointer to list of names of open tables.
+*/
+
OPEN_TABLE_LIST *list_open_tables(THD *thd, const char *wild)
{
int result = 0;
- uint col_access=thd->col_access;
OPEN_TABLE_LIST **start_list, *open_list;
TABLE_LIST table_list;
char name[NAME_LEN*2];
@@ -179,13 +195,25 @@ OPEN_TABLE_LIST *list_open_tables(THD *thd, const char *wild)
DBUG_RETURN(open_list);
}
+
/*
- Send name and type of result to client.
- Sum fields has table name empty and field_name.
- flag is a bit mask with the following functions:
- 1 send number of rows
- 2 send default values
- 4 Don't convert field names
+ Send name and type of result to client converted to a given char set
+
+ SYNOPSIS
+ send_convert_fields()
+ THD Thread data object
+ list List of items to send to client
+ convert object used to convertation to another character set
+ flag Bit mask with the following functions:
+ 2 send default values
+ 4 Don't convert field names
+
+ DESCRIPTION
+ Sum fields has table name empty and field_name.
+
+ RETURN VALUES
+ 0 ok
+ 1 Error (Note that in this case the error is not sent to the client)
*/
bool
@@ -194,16 +222,15 @@ send_convert_fields(THD *thd,List<Item> &list,CONVERT *convert,uint flag)
List_iterator_fast<Item> it(list);
Item *item;
char buff[80];
-
String tmp((char*) buff,sizeof(buff),default_charset_info);
String *res,*packet= &thd->packet;
-
+ DBUG_ENTER("send_fields");
+
while ((item=it++))
{
char *pos;
Send_field field;
item->make_field(&field);
-
packet->length(0);
if (thd->client_capabilities & CLIENT_PROTOCOL_41)
@@ -219,7 +246,7 @@ send_convert_fields(THD *thd,List<Item> &list,CONVERT *convert,uint flag)
convert->store(packet,field.org_col_name,
(uint) strlen(field.org_col_name)) ||
packet->realloc(packet->length()+10))
- return 1;
+ goto err;
}
else
{
@@ -228,9 +255,8 @@ send_convert_fields(THD *thd,List<Item> &list,CONVERT *convert,uint flag)
convert->store(packet,field.col_name,
(uint) strlen(field.col_name)) ||
packet->realloc(packet->length()+10))
- return 1;
+ goto err;
}
-
pos= (char*) packet->ptr()+packet->length();
if (!(thd->client_capabilities & CLIENT_LONG_FLAG))
@@ -252,24 +278,38 @@ send_convert_fields(THD *thd,List<Item> &list,CONVERT *convert,uint flag)
if (!(res=item->val_str(&tmp)))
{
if (net_store_null(packet))
- return 1;
+ goto err;
}
- else if (net_store_data(packet,res->ptr(),res->length()))
- return 1;
+ else if (convert->store(packet,res->ptr(),res->length()))
+ goto err;
}
if (my_net_write(&thd->net, (char*) packet->ptr(),packet->length()))
break; /* purecov: inspected */
}
return 0;
+
+err:
+ return 1;
}
+
/*
- Send name and type of result to client.
- Sum fields has table name empty and field_name
- flag is a bit mask with the following functios:
- 1 send number of rows
- 2 send default values
- 4 Don't convert field names
+ Send name and type of result to client.
+
+ SYNOPSIS
+ send_non_convert_fields()
+ THD Thread data object
+ list List of items to send to client
+ flag Bit mask with the following functions:
+ 2 send default values
+ 4 Don't convert field names
+
+ DESCRIPTION
+ Sum fields has table name empty and field_name.
+
+ RETURN VALUES
+ 0 ok
+ 1 Error
*/
bool
@@ -278,16 +318,15 @@ send_non_convert_fields(THD *thd,List<Item> &list,uint flag)
List_iterator_fast<Item> it(list);
Item *item;
char buff[80];
-
+
String tmp((char*) buff,sizeof(buff),default_charset_info);
String *res,*packet= &thd->packet;
-
+
while ((item=it++))
{
char *pos;
Send_field field;
item->make_field(&field);
-
packet->length(0);
if (thd->client_capabilities & CLIENT_PROTOCOL_41)
@@ -307,7 +346,7 @@ send_non_convert_fields(THD *thd,List<Item> &list,uint flag)
packet->realloc(packet->length()+10))
return 1;
}
-
+
pos= (char*) packet->ptr()+packet->length();
if (!(thd->client_capabilities & CLIENT_LONG_FLAG))
@@ -340,23 +379,35 @@ send_non_convert_fields(THD *thd,List<Item> &list,uint flag)
return 0;
}
-/******************************************************************************
-** Send name and type of result to client.
-** Sum fields has table name empty and field_name.
-** flag is a bit mask with the following functions:
-** 1 send number of rows
-** 2 send default values
-** 4 Don't convert field names
-******************************************************************************/
+
+/*
+ Send name and type of result to client.
+
+ SYNOPSIS
+ send_fields()
+ THD Thread data object
+ list List of items to send to client
+ convert object used to convertation to another character set
+ flag Bit mask with the following functions:
+ 1 send number of rows
+ 2 send default values
+ 4 Don't convert field names
+
+ DESCRIPTION
+ Sum fields has table name empty and field_name.
+ Uses send_fields_convert() and send_fields() depending on
+ if we have an active character set convert or not.
+
+ RETURN VALUES
+ 0 ok
+ 1 Error (Note that in this case the error is not sent to the client)
+*/
bool
-send_fields(THD *thd,List<Item> &list,uint flag)
+send_fields(THD *thd, List<Item> &list, uint flag)
{
- List_iterator_fast<Item> it(list);
- char buff[80];
CONVERT *convert= (flag & 4) ? (CONVERT*) 0 : thd->convert_set;
-
- String tmp((char*) buff,sizeof(buff),default_charset_info);
+ DBUG_ENTER("send_fields");
if (thd->fatal_error) // We have got an error
goto err;
@@ -367,20 +418,24 @@ send_fields(THD *thd,List<Item> &list,uint flag)
(void) my_net_write(&thd->net, buff,(uint) (pos-buff));
}
- /* Avoid check conditions on convert() for each field
- by having two diffrent functions
+ /*
+ Avoid check conditions on convert() for each field
+ by having two different functions
*/
- if (convert && send_convert_fields(thd,list,convert,flag))
- goto err;
-
- else if(send_non_convert_fields(thd,list,flag))
+ if (convert)
+ {
+ if (send_convert_fields(thd, list, convert, flag))
+ goto err;
+ }
+ else if (send_non_convert_fields(thd, list, flag))
goto err;
send_eof(&thd->net);
return 0;
+
err:
send_error(&thd->net,ER_OUT_OF_RESOURCES); /* purecov: inspected */
- return 1; /* purecov: inspected */
+ DBUG_RETURN(1); /* purecov: inspected */
}
@@ -396,10 +451,21 @@ void intern_close_table(TABLE *table)
VOID(closefrm(table)); // close file
}
+/*
+ Remove table from the open table cache
+
+ SYNOPSIS
+ free_cache_entry()
+ table Table to remove
+
+ NOTE
+ We need to have a lock on LOCK_open when calling this
+*/
static void free_cache_entry(TABLE *table)
{
DBUG_ENTER("free_cache_entry");
+ safe_mutex_assert_owner(&LOCK_open);
intern_close_table(table);
if (!table->in_use)
@@ -546,6 +612,7 @@ void close_thread_tables(THD *thd, bool locked)
/* VOID(pthread_sigmask(SIG_SETMASK,&thd->block_signals,NULL)); */
if (!locked)
VOID(pthread_mutex_lock(&LOCK_open));
+ safe_mutex_assert_owner(&LOCK_open);
DBUG_PRINT("info", ("thd->open_tables=%p", thd->open_tables));
@@ -671,12 +738,10 @@ void close_temporary_tables(THD *thd)
}
if (query && found_user_tables && mysql_bin_log.is_open())
{
- uint save_query_len = thd->query_length;
- *--end = 0; // Remove last ','
- thd->query_length = (uint)(end-query);
- Query_log_event qinfo(thd, query);
+ /* The -1 is to remove last ',' */
+ Query_log_event qinfo(thd, query, (ulong)(end-query)-1);
+ qinfo.error_code=0;
mysql_bin_log.write(&qinfo);
- thd->query_length = save_query_len;
}
thd->temporary_tables=0;
}
@@ -789,11 +854,13 @@ TABLE *unlink_open_table(THD *thd, TABLE *list, TABLE *find)
/*
When we call the following function we must have a lock on
- LOCK_OPEN ; This lock will be unlocked on return.
+ LOCK_open ; This lock will be unlocked on return.
*/
void wait_for_refresh(THD *thd)
{
+ safe_mutex_assert_owner(&LOCK_open);
+
/* Wait until the current table is up to date */
const char *proc_info;
thd->mysys_var->current_mutex= &LOCK_open;
@@ -811,6 +878,7 @@ void wait_for_refresh(THD *thd)
pthread_mutex_unlock(&thd->mysys_var->mutex);
}
+
TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
{
DBUG_ENTER("reopen_name_locked_table");
@@ -827,7 +895,7 @@ TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
key_length=(uint) (strmov(strmov(key,db)+1,table_name)-key)+1;
pthread_mutex_lock(&LOCK_open);
- if (open_unireg_entry(thd, table, db, table_name, table_name, 1) ||
+ if (open_unireg_entry(thd, table, db, table_name, table_name) ||
!(table->table_cache_key =memdup_root(&table->mem_root,(char*) key,
key_length)))
{
@@ -849,7 +917,8 @@ TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
table->const_table=0;
table->outer_join=table->null_row=table->maybe_null=0;
table->status=STATUS_NO_RECORD;
- table->keys_in_use_for_query=table->used_keys= table->keys_in_use;
+ table->keys_in_use_for_query= table->keys_in_use;
+ table->used_keys= table->keys_for_keyread;
DBUG_RETURN(table);
}
@@ -959,8 +1028,11 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name,
/* make a new table */
if (!(table=(TABLE*) my_malloc(sizeof(*table),MYF(MY_WME))))
+ {
+ VOID(pthread_mutex_unlock(&LOCK_open));
DBUG_RETURN(NULL);
- if (open_unireg_entry(thd, table,db,table_name,alias,1) ||
+ }
+ if (open_unireg_entry(thd, table,db,table_name,alias) ||
!(table->table_cache_key=memdup_root(&table->mem_root,(char*) key,
key_length)))
{
@@ -1003,7 +1075,8 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name,
table->const_table=0;
table->outer_join=table->null_row=table->maybe_null=0;
table->status=STATUS_NO_RECORD;
- table->keys_in_use_for_query=table->used_keys= table->keys_in_use;
+ table->keys_in_use_for_query= table->keys_in_use;
+ table->used_keys= table->keys_for_keyread;
DBUG_ASSERT(table->key_read == 0);
DBUG_RETURN(table);
}
@@ -1048,9 +1121,9 @@ bool reopen_table(TABLE *table,bool locked)
#endif
if (!locked)
VOID(pthread_mutex_lock(&LOCK_open));
+ safe_mutex_assert_owner(&LOCK_open);
- if (open_unireg_entry(current_thd,&tmp,db,table_name,table->table_name,
- locked))
+ if (open_unireg_entry(current_thd,&tmp,db,table_name,table->table_name))
goto end;
free_io_cache(table);
@@ -1069,7 +1142,8 @@ bool reopen_table(TABLE *table,bool locked)
tmp.null_row= table->null_row;
tmp.maybe_null= table->maybe_null;
tmp.status= table->status;
- tmp.keys_in_use_for_query=tmp.used_keys=tmp.keys_in_use;
+ tmp.keys_in_use_for_query= tmp.keys_in_use;
+ tmp.used_keys= tmp.keys_for_keyread;
/* Get state */
tmp.key_length= table->key_length;
@@ -1138,6 +1212,8 @@ bool close_data_tables(THD *thd,const char *db, const char *table_name)
bool reopen_tables(THD *thd,bool get_locks,bool in_refresh)
{
DBUG_ENTER("reopen_tables");
+ safe_mutex_assert_owner(&LOCK_open);
+
if (!thd->open_tables)
DBUG_RETURN(0);
@@ -1288,7 +1364,6 @@ bool wait_for_tables(THD *thd)
/* Now we can open all tables without any interference */
thd->proc_info="Reopen tables";
result=reopen_tables(thd,0,0);
-
}
pthread_mutex_unlock(&LOCK_open);
thd->proc_info=0;
@@ -1353,7 +1428,7 @@ void abort_locked_tables(THD *thd,const char *db, const char *table_name)
*/
static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
- const char *name, const char *alias, bool locked)
+ const char *name, const char *alias)
{
char path[FN_REFLEN];
int error;
@@ -1373,21 +1448,17 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
table_list.db=(char*) db;
table_list.name=(char*) name;
table_list.next=0;
- if (!locked)
- pthread_mutex_lock(&LOCK_open);
+ safe_mutex_assert_owner(&LOCK_open);
+
if ((error=lock_table_name(thd,&table_list)))
{
if (error < 0)
{
- if (!locked)
- pthread_mutex_unlock(&LOCK_open);
goto err;
}
if (wait_for_locked_table_names(thd,&table_list))
{
unlock_table_name(thd,&table_list);
- if (!locked)
- pthread_mutex_unlock(&LOCK_open);
goto err;
}
}
@@ -1417,9 +1488,9 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
thd->net.last_error[0]=0; // Clear error message
thd->net.last_errno=0;
}
- if (locked)
- pthread_mutex_lock(&LOCK_open); // Get back original lock
+ pthread_mutex_lock(&LOCK_open);
unlock_table_name(thd,&table_list);
+
if (error)
goto err;
}
@@ -1478,9 +1549,9 @@ int open_tables(THD *thd,TABLE_LIST *start)
}
}
*prev_table=0;
+ pthread_mutex_unlock(&LOCK_open);
if (found)
VOID(pthread_cond_broadcast(&COND_refresh)); // Signal to refresh
- pthread_mutex_unlock(&LOCK_open);
goto restart;
}
result= -1; // Fatal error
@@ -1698,7 +1769,7 @@ Field *find_field_in_table(THD *thd,TABLE *table,const char *name,uint length,
{
field->query_id=thd->query_id;
table->used_fields++;
- table->used_keys&=field->part_of_key;
+ table->used_keys&= field->part_of_key;
}
else
thd->dupp_field=field;
@@ -1905,7 +1976,8 @@ bool setup_tables(TABLE_LIST *tables)
table->const_table=0;
table->outer_join=table->null_row=0;
table->status=STATUS_NO_RECORD;
- table->keys_in_use_for_query=table->used_keys= table->keys_in_use;
+ table->keys_in_use_for_query= table->keys_in_use;
+ table->used_keys= table->keys_for_keyread;
table->maybe_null=test(table->outer_join=table_list->outer_join);
table->tablenr=tablenr;
table->map= (table_map) 1 << tablenr;
@@ -1995,7 +2067,7 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name,
if (field->query_id == thd->query_id)
thd->dupp_field=field;
field->query_id=thd->query_id;
- table->used_keys&=field->part_of_key;
+ table->used_keys&= field->part_of_key;
}
/* All fields are used */
table->used_fields=table->fields;
@@ -2184,6 +2256,7 @@ int mysql_create_index(THD *thd, TABLE_LIST *table_list, List<Key> &keys)
DBUG_ENTER("mysql_create_index");
bzero((char*) &create_info,sizeof(create_info));
create_info.db_type=DB_TYPE_DEFAULT;
+ /* TODO: Fix to use database character set */
create_info.table_charset=default_charset_info;
DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name,
&create_info, table_list,
@@ -2322,6 +2395,7 @@ int setup_ftfuncs(THD *thd)
return 0;
}
+
int init_ftfuncs(THD *thd, bool no_order)
{
if (thd->lex.select->ftfunc_list.elements)
@@ -2332,9 +2406,7 @@ int init_ftfuncs(THD *thd, bool no_order)
thd->proc_info="FULLTEXT initialization";
while ((ifm=li++))
- {
ifm->init_search(no_order);
- }
}
return 0;
}
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index c739b43debb..26fa0bb0481 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -299,11 +299,15 @@ TODO list:
pthread_mutex_lock(M);}
#define MUTEX_UNLOCK(M) {DBUG_PRINT("lock", ("mutex unlock 0x%lx",\
(ulong)(M))); pthread_mutex_unlock(M);}
-#define SEM_LOCK(M) { int val = 0; sem_getvalue (M, &val); \
- DBUG_PRINT("lock", ("sem lock 0x%lx (%d)", (ulong)(M), val)); \
- sem_wait(M); DBUG_PRINT("lock", ("sem lock ok")); }
-#define SEM_UNLOCK(M) {DBUG_PRINT("info", ("sem unlock 0x%lx", (ulong)(M))); \
- sem_post(M); DBUG_PRINT("info", ("sem unlock ok")); }
+#define RW_WLOCK(M) {DBUG_PRINT("lock", ("rwlock wlock 0x%lx",(ulong)(M))); \
+ if (!rw_wrlock(M)) DBUG_PRINT("lock", ("rwlock wlock ok")) \
+ else DBUG_PRINT("lock", ("rwlock wlock FAILED %d", errno)); }
+#define RW_RLOCK(M) {DBUG_PRINT("lock", ("rwlock rlock 0x%lx", (ulong)(M))); \
+ if (!rw_rdlock(M)) DBUG_PRINT("lock", ("rwlock rlock ok")) \
+ else DBUG_PRINT("lock", ("rwlock wlock FAILED %d", errno)); }
+#define RW_UNLOCK(M) {DBUG_PRINT("lock", ("rwlock unlock 0x%lx",(ulong)(M))); \
+ if (!rw_unlock(M)) DBUG_PRINT("lock", ("rwlock unlock ok")) \
+ else DBUG_PRINT("lock", ("rwlock unlock FAILED %d", errno)); }
#define STRUCT_LOCK(M) {DBUG_PRINT("lock", ("%d struct lock...",__LINE__)); \
pthread_mutex_lock(M);DBUG_PRINT("lock", ("struct lock OK"));}
#define STRUCT_UNLOCK(M) { \
@@ -326,8 +330,9 @@ TODO list:
#else
#define MUTEX_LOCK(M) pthread_mutex_lock(M)
#define MUTEX_UNLOCK(M) pthread_mutex_unlock(M)
-#define SEM_LOCK(M) sem_wait(M)
-#define SEM_UNLOCK(M) sem_post(M)
+#define RW_WLOCK(M) rw_wrlock(M)
+#define RW_RLOCK(M) rw_rdlock(M)
+#define RW_UNLOCK(M) rw_unlock(M)
#define STRUCT_LOCK(M) pthread_mutex_lock(M)
#define STRUCT_UNLOCK(M) pthread_mutex_unlock(M)
#define BLOCK_LOCK_WR(B) B->query()->lock_writing()
@@ -337,6 +342,12 @@ TODO list:
#define DUMP(C)
#endif
+const char *query_cache_type_names[]= { "OFF", "ON", "DEMAND",NullS };
+TYPELIB query_cache_type_typelib=
+{
+ array_elements(query_cache_type_names)-1,"", query_cache_type_names
+};
+
/*****************************************************************************
Query_cache_block_table method(s)
*****************************************************************************/
@@ -445,9 +456,7 @@ void Query_cache_query::init_n_lock()
{
DBUG_ENTER("Query_cache_query::init_n_lock");
res=0; wri = 0; len = 0;
- sem_init(&lock, 0, 1);
- pthread_mutex_init(&clients_guard,MY_MUTEX_INIT_FAST);
- clients = 0;
+ my_rwlock_init(&lock, NULL);
lock_writing();
DBUG_PRINT("qcache", ("inited & locked query for block 0x%lx",
((byte*) this)-ALIGN_SIZE(sizeof(Query_cache_block))));
@@ -465,8 +474,7 @@ void Query_cache_query::unlock_n_destroy()
active semaphore
*/
this->unlock_writing();
- sem_destroy(&lock);
- pthread_mutex_destroy(&clients_guard);
+ rwlock_destroy(&lock);
DBUG_VOID_RETURN;
}
@@ -479,9 +487,9 @@ void Query_cache_query::unlock_n_destroy()
Lock for read prevents only locking for write.
*/
-void Query_cache_query::lock_writing()
+inline void Query_cache_query::lock_writing()
{
- SEM_LOCK(&lock);
+ RW_WLOCK(&lock);
}
@@ -495,41 +503,31 @@ void Query_cache_query::lock_writing()
my_bool Query_cache_query::try_lock_writing()
{
DBUG_ENTER("Query_cache_block::try_lock_writing");
- if (sem_trywait(&lock)!=0 || clients != 0)
+ if (rw_trywrlock(&lock)!=0)
{
- DBUG_PRINT("info", ("can't lock semaphore"));
+ DBUG_PRINT("info", ("can't lock rwlock"));
DBUG_RETURN(0);
}
- DBUG_PRINT("info", ("mutex 'lock' 0x%lx locked", (ulong) &lock));
+ DBUG_PRINT("info", ("rwlock 0x%lx locked", (ulong) &lock));
DBUG_RETURN(1);
}
-void Query_cache_query::lock_reading()
+inline void Query_cache_query::lock_reading()
{
- MUTEX_LOCK(&clients_guard);
- if ( ++clients == 1 )
- SEM_LOCK(&lock);
- MUTEX_UNLOCK(&clients_guard);
+ RW_RLOCK(&lock);
}
-void Query_cache_query::unlock_writing()
+inline void Query_cache_query::unlock_writing()
{
- SEM_UNLOCK(&lock);
+ RW_UNLOCK(&lock);
}
-void Query_cache_query::unlock_reading()
+inline void Query_cache_query::unlock_reading()
{
- /*
- To avoid unlocking semaphore before unlocking mutex (that may cause
- destroying locked mutex), we use temporary boolean variable 'unlock'.
- */
- MUTEX_LOCK(&clients_guard);
- bool ulock = ((--clients) == 0);
- MUTEX_UNLOCK(&clients_guard);
- if (ulock) SEM_UNLOCK(&lock);
+ RW_UNLOCK(&lock);
}
extern "C"
@@ -704,28 +702,28 @@ Query_cache::Query_cache(ulong query_cache_limit,
query_cache_limit(query_cache_limit),
queries_in_cache(0), hits(0), inserts(0), refused(0),
total_blocks(0),
- min_allocation_unit(min_allocation_unit),
- min_result_data_size(min_result_data_size),
- def_query_hash_size(def_query_hash_size),
- def_table_hash_size(def_table_hash_size),
+ min_allocation_unit(ALIGN_SIZE(min_allocation_unit)),
+ min_result_data_size(ALIGN_SIZE(min_result_data_size)),
+ def_query_hash_size(ALIGN_SIZE(def_query_hash_size)),
+ def_table_hash_size(ALIGN_SIZE(def_table_hash_size)),
initialized(0)
{
ulong min_needed=(ALIGN_SIZE(sizeof(Query_cache_block)) +
ALIGN_SIZE(sizeof(Query_cache_block_table)) +
ALIGN_SIZE(sizeof(Query_cache_query)) + 3);
set_if_bigger(min_allocation_unit,min_needed);
- this->min_allocation_unit = min_allocation_unit;
+ this->min_allocation_unit = ALIGN_SIZE(min_allocation_unit);
set_if_bigger(this->min_result_data_size,min_allocation_unit);
}
-ulong Query_cache::resize(ulong query_cache_size)
+ulong Query_cache::resize(ulong query_cache_size_arg)
{
DBUG_ENTER("Query_cache::resize");
- DBUG_PRINT("qcache", ("from %lu to %lu",this->query_cache_size,
- query_cache_size));
+ DBUG_PRINT("qcache", ("from %lu to %lu",query_cache_size,
+ query_cache_size_arg));
free_cache(0);
- this->query_cache_size=query_cache_size;
+ query_cache_size=query_cache_size_arg;
DBUG_RETURN(init_cache());
}
@@ -765,10 +763,10 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
most significant bit - CLIENT_LONG_FLAG,
other - charset number (0 no charset convertion)
*/
- if (thd->convert_set != 0)
+ if (thd->variables.convert_set != 0)
{
- flags|= (byte) thd->convert_set->number();
- DBUG_ASSERT(thd->convert_set->number() < 128);
+ flags|= (byte) thd->variables.convert_set->number();
+ DBUG_ASSERT(thd->variables.convert_set->number() < 128);
}
tot_length=thd->query_length+thd->db_length+2;
thd->query[tot_length-1] = (char) flags;
@@ -872,13 +870,10 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
it is not possible to check has_transactions() function of handler
because tables not opened yet
*/
- (thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN)) ||
- thd->query_cache_type == 0)
+ (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) ||
+ thd->variables.query_cache_type == 0)
- {
- DBUG_PRINT("qcache", ("query cache disabled or not in autocommit mode"));
goto err;
- }
/* Check that we haven't forgot to reset the query cache variables */
DBUG_ASSERT(thd->net.query_cache_query == 0);
@@ -926,10 +921,10 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
Other - charset number (0 no charset convertion)
*/
flags = (thd->client_capabilities & CLIENT_LONG_FLAG ? 0x80 : 0);
- if (thd->convert_set != 0)
+ if (thd->variables.convert_set != 0)
{
- flags |= (byte) thd->convert_set->number();
- DBUG_ASSERT(thd->convert_set->number() < 128);
+ flags |= (byte) thd->variables.convert_set->number();
+ DBUG_ASSERT(thd->variables.convert_set->number() < 128);
}
sql[tot_length-1] = (char) flags;
query_block = (Query_cache_block *) hash_search(&queries, (byte*) sql,
@@ -962,7 +957,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
// Check access;
block_table= query_block->table(0);
block_table_end= block_table+query_block->n_tables;
- for ( ; block_table != block_table_end; block_table++)
+ for (; block_table != block_table_end; block_table++)
{
TABLE_LIST table_list;
bzero((char*) &table_list,sizeof(table_list));
@@ -1024,6 +1019,7 @@ err:
DBUG_RETURN(0); // Query was not cached
}
+
/*
Remove all cached queries that uses any of the tables in the list
*/
@@ -1040,8 +1036,8 @@ void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used,
DUMP(this);
using_transactions = using_transactions &&
- (thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN));
- for ( ; tables_used; tables_used=tables_used->next)
+ (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
+ for (; tables_used; tables_used=tables_used->next)
{
DBUG_ASSERT(!using_transactions || tables_used->table!=0);
if (using_transactions &&
@@ -1070,11 +1066,12 @@ void Query_cache::invalidate(CHANGED_TABLE_LIST *tables_used)
if (query_cache_size > 0)
{
DUMP(this);
- for ( ; tables_used; tables_used=tables_used->next)
+ for (; tables_used; tables_used=tables_used->next)
{
invalidate_table((byte*) tables_used->key, tables_used->key_length);
DBUG_PRINT("qcache", (" db %s, table %s", tables_used->key,
- tables_used->table_name));
+ tables_used->key+
+ strlen(tables_used->key)+1));
}
}
STRUCT_UNLOCK(&structure_guard_mutex);
@@ -1097,7 +1094,7 @@ void Query_cache::invalidate(THD *thd, TABLE *table,
if (query_cache_size > 0)
{
using_transactions = using_transactions &&
- (thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN));
+ (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
if (using_transactions && table->file->has_transactions())
thd->add_changed_table(table);
else
@@ -1188,15 +1185,17 @@ void Query_cache::pack(ulong join_limit, uint iteration_limit)
void Query_cache::destroy()
{
- if ( !initialized )
+ DBUG_ENTER("Query_cache::destroy");
+ if (!initialized)
{
DBUG_PRINT("qcache", ("Query Cache not initialized"));
- return;
}
- DBUG_ENTER("Query_cache::destroy");
- free_cache(1);
- pthread_mutex_destroy(&structure_guard_mutex);
- initialized = 0;
+ else
+ {
+ free_cache(1);
+ pthread_mutex_destroy(&structure_guard_mutex);
+ initialized = 0;
+ }
DBUG_VOID_RETURN;
}
@@ -1219,6 +1218,7 @@ ulong Query_cache::init_cache()
uint mem_bin_count, num, step;
ulong mem_bin_size, prev_size, inc;
ulong additional_data_size, max_mem_bin_size, approx_additional_data_size;
+ int align;
DBUG_ENTER("Query_cache::init_cache");
if (!initialized)
@@ -1229,7 +1229,13 @@ ulong Query_cache::init_cache()
if (query_cache_size < approx_additional_data_size)
goto err;
- query_cache_size -= approx_additional_data_size;
+ query_cache_size-= approx_additional_data_size;
+ align= query_cache_size % ALIGN_SIZE(1);
+ if (align)
+ {
+ query_cache_size-= align;
+ approx_additional_data_size+= align;
+ }
/*
Count memory bins number.
@@ -1269,10 +1275,11 @@ ulong Query_cache::init_cache()
query_cache_size -= additional_data_size;
STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size <= min_allocation_unit)
+ if (max_mem_bin_size <= min_allocation_unit)
{
DBUG_PRINT("qcache",
- (" query_cache_size <= min_allocation_unit => cache disabled"));
+ (" max bin size (%lu) <= min_allocation_unit => cache disabled",
+ max_mem_bin_size));
STRUCT_UNLOCK(&structure_guard_mutex);
goto err;
}
@@ -1543,10 +1550,12 @@ Query_cache::write_block_data(ulong data_len, gptr data,
ALIGN_SIZE(ntab*sizeof(Query_cache_block_table)) +
header_len);
ulong len = data_len + all_headers_len;
+ ulong align_len= ALIGN_SIZE(len);
DBUG_ENTER("Query_cache::write_block_data");
DBUG_PRINT("qcache", ("data: %ld, header: %ld, all header: %ld",
data_len, header_len, all_headers_len));
- Query_cache_block *block = allocate_block(max(len, min_allocation_unit),
+ Query_cache_block *block = allocate_block(max(align_len,
+ min_allocation_unit),
1, 0, under_guard);
if (block != 0)
{
@@ -1741,7 +1750,8 @@ my_bool Query_cache::allocate_data_chain(Query_cache_block **result_block,
{
ulong all_headers_len = (ALIGN_SIZE(sizeof(Query_cache_block)) +
ALIGN_SIZE(sizeof(Query_cache_result)));
- ulong len = data_len + all_headers_len;
+ ulong len= data_len + all_headers_len;
+ ulong align_len= ALIGN_SIZE(len);
DBUG_ENTER("Query_cache::allocate_data_chain");
DBUG_PRINT("qcache", ("data_len %lu, all_headers_len %lu",
data_len, all_headers_len));
@@ -1749,7 +1759,7 @@ my_bool Query_cache::allocate_data_chain(Query_cache_block **result_block,
ulong min_size = (first_block ?
get_min_first_result_data_size():
get_min_append_result_data_size());
- *result_block = allocate_block(max(min_size,len),
+ *result_block = allocate_block(max(min_size, align_len),
min_result_data_size == 0,
all_headers_len + min_result_data_size,
1);
@@ -1985,7 +1995,7 @@ Query_cache_block *
Query_cache::allocate_block(ulong len, my_bool not_less, ulong min,
my_bool under_guard)
{
- DBUG_ENTER("Query_cache::allocate_n_lock_block");
+ DBUG_ENTER("Query_cache::allocate_block");
DBUG_PRINT("qcache", ("len %lu, not less %d, min %lu, uder_guard %d",
len, not_less,min,under_guard));
@@ -2033,7 +2043,6 @@ Query_cache::get_free_block(ulong len, my_bool not_less, ulong min)
if (bins[start].number != 0)
{
Query_cache_block *list = bins[start].free_blocks;
- ulong max_len = list->prev->length;
if (list->prev->length >= len) // check block with max size
{
first = list;
@@ -2128,8 +2137,10 @@ void Query_cache::split_block(Query_cache_block *block, ulong len)
new_block->pnext->pprev = new_block;
if (block->type == Query_cache_block::FREE)
+ {
// if block was free then it already joined with all free neighbours
insert_into_free_memory_list(new_block);
+ }
else
free_memory_block(new_block);
@@ -2325,7 +2336,7 @@ Query_cache::double_linked_list_simple_include(Query_cache_block *point,
*list_pointer=point->next=point->prev=point;
else
{
- // insert to and of list
+ // insert to the end of list
point->next = (*list_pointer);
point->prev = (*list_pointer)->prev;
point->prev->next = point;
@@ -2382,17 +2393,16 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len,
DBUG_ENTER("Query_cache::is_cacheable");
if (lex->sql_command == SQLCOM_SELECT &&
- thd->temporary_tables == 0 &&
- (thd->query_cache_type == 1 ||
- (thd->query_cache_type == 2 && (lex->select->options &
- OPTION_TO_QUERY_CACHE))) &&
+ (thd->variables.query_cache_type == 1 ||
+ (thd->variables.query_cache_type == 2 && (lex->select->options &
+ OPTION_TO_QUERY_CACHE))) &&
thd->safe_to_cache_query)
{
my_bool has_transactions = 0;
DBUG_PRINT("qcache", ("options %lx %lx, type %u",
OPTION_TO_QUERY_CACHE,
lex->select->options,
- (int) thd->query_cache_type));
+ (int) thd->variables.query_cache_type));
for (; tables_used; tables_used=tables_used->next)
{
@@ -2403,9 +2413,11 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len,
has_transactions = (has_transactions ||
tables_used->table->file->has_transactions());
- if (tables_used->table->db_type == DB_TYPE_MRG_ISAM)
+ if (tables_used->table->db_type == DB_TYPE_MRG_ISAM ||
+ tables_used->table->tmp_table != NO_TMP_TABLE)
{
- DBUG_PRINT("qcache", ("select not cacheable: used MRG_ISAM table(s)"));
+ DBUG_PRINT("qcache",
+ ("select not cacheable: used MRG_ISAM or temporary table(s)"));
DBUG_RETURN(0);
}
if (tables_used->table->db_type == DB_TYPE_MRG_MYISAM)
@@ -2416,7 +2428,7 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len,
}
}
- if ((thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN)) &&
+ if ((thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) &&
has_transactions)
{
DBUG_PRINT("qcache", ("not in autocommin mode"));
@@ -2431,7 +2443,7 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len,
(int) lex->sql_command,
OPTION_TO_QUERY_CACHE,
lex->select->options,
- (int) thd->query_cache_type));
+ (int) thd->variables.query_cache_type));
DBUG_RETURN(0);
}
@@ -2620,8 +2632,7 @@ my_bool Query_cache::move_by_type(byte **border,
} while ( result_block != first_result_block );
}
Query_cache_query *new_query= ((Query_cache_query *) new_block->data());
- sem_init(&new_query->lock, 0, 1);
- pthread_mutex_init(&new_query->clients_guard,MY_MUTEX_INIT_FAST);
+ my_rwlock_init(&new_query->lock, NULL);
/*
If someone is writing to this block, inform the writer that the block
@@ -2670,14 +2681,17 @@ my_bool Query_cache::move_by_type(byte **border,
*border += len;
*before = new_block;
/* If result writing complete && we have free space in block */
- ulong free_space = new_block->length - new_block->used;
+ ulong free_space= new_block->length - new_block->used;
+ free_space-= free_space % ALIGN_SIZE(1);
if (query->result()->type == Query_cache_block::RESULT &&
new_block->length > new_block->used &&
*gap + free_space > min_allocation_unit &&
new_block->length - free_space > min_allocation_unit)
{
- *border -= free_space;
- *gap += free_space;
+ *border-= free_space;
+ *gap+= free_space;
+ DBUG_PRINT("qcache",
+ ("rest of result free space added to gap (%lu)", *gap));
new_block->length -= free_space;
}
BLOCK_UNLOCK_WR(query_block);
@@ -2738,7 +2752,7 @@ my_bool Query_cache::join_results(ulong join_limit)
header->length() > join_limit)
{
Query_cache_block *new_result_block =
- get_free_block(header->length() +
+ get_free_block(ALIGN_SIZE(header->length()) +
ALIGN_SIZE(sizeof(Query_cache_block)) +
ALIGN_SIZE(sizeof(Query_cache_result)), 1, 0);
if (new_result_block != 0)
@@ -2857,7 +2871,7 @@ void Query_cache::bins_dump()
{
uint i;
- if ( !initialized )
+ if (!initialized)
{
DBUG_PRINT("qcache", ("Query Cache not initialized"));
return;
@@ -2898,8 +2912,7 @@ void Query_cache::bins_dump()
void Query_cache::cache_dump()
{
-
- if ( !initialized )
+ if (!initialized)
{
DBUG_PRINT("qcache", ("Query Cache not initialized"));
return;
@@ -2926,7 +2939,7 @@ void Query_cache::cache_dump()
void Query_cache::queries_dump()
{
- if ( !initialized )
+ if (!initialized)
{
DBUG_PRINT("qcache", ("Query Cache not initialized"));
return;
@@ -2988,8 +3001,7 @@ void Query_cache::queries_dump()
void Query_cache::tables_dump()
{
-
- if ( !initialized )
+ if (!initialized)
{
DBUG_PRINT("qcache", ("Query Cache not initialized"));
return;
@@ -3047,11 +3059,20 @@ my_bool Query_cache::check_integrity(bool not_locked)
{
DBUG_PRINT("qcache", ("block 0x%lx, type %u...",
(ulong) block, (uint) block->type));
+ // Check allignment
+ if ((((long)block) % (long) ALIGN_SIZE(1)) !=
+ (((long)first_block) % (long)ALIGN_SIZE(1)))
+ {
+ DBUG_PRINT("error",
+ ("block 0x%lx do not aligned by %d", (ulong) block,
+ ALIGN_SIZE(1)));
+ result = 1;
+ }
// Check memory allocation
if (block->pnext == first_block) // Is it last block?
{
- if ( ((byte*)block) + block->length !=
- ((byte*)first_block) + query_cache_size )
+ if (((byte*)block) + block->length !=
+ ((byte*)first_block) + query_cache_size)
{
DBUG_PRINT("error",
("block 0x%lx, type %u, ended at 0x%lx, but cache ended at 0x%lx",
@@ -3071,16 +3092,16 @@ my_bool Query_cache::check_integrity(bool not_locked)
(ulong) ((byte*)block->pnext)));
}
if (block->type == Query_cache_block::FREE)
- free+=block->length;
+ free+= block->length;
else
- used+=block->length;
+ used+= block->length;
switch(block->type) {
case Query_cache_block::FREE:
{
Query_cache_memory_bin *bin = *((Query_cache_memory_bin **)
block->data());
//is it correct pointer?
- if ( ((byte*)bin) < ((byte*)bins) ||
+ if (((byte*)bin) < ((byte*)bins) ||
((byte*)bin) >= ((byte*)first_block))
{
DBUG_PRINT("error",
@@ -3131,7 +3152,7 @@ my_bool Query_cache::check_integrity(bool not_locked)
case Query_cache_block::RESULT:
{
Query_cache_block * query_block = block->result()->parent();
- if ( ((byte*)query_block) < ((byte*)first_block) ||
+ if (((byte*)query_block) < ((byte*)first_block) ||
((byte*)query_block) >= (((byte*)first_block) + query_cache_size))
{
DBUG_PRINT("error",
@@ -3283,7 +3304,7 @@ my_bool Query_cache::in_blocks(Query_cache_block * point)
(ulong) block->pprev->pnext,
(ulong) point));
//back trace
- for(; block != point; block = block->pnext)
+ for (; block != point; block = block->pnext)
DBUG_PRINT("error", ("back trace 0x%lx", (ulong) block));
result = 1;
goto err1;
@@ -3311,7 +3332,7 @@ err1:
(ulong) block->pnext->pprev,
(ulong) point));
//back trace
- for(; block != point; block = block->pprev)
+ for (; block != point; block = block->pprev)
DBUG_PRINT("error", ("back trace 0x%lx", (ulong) block));
result = 1;
goto err2;
@@ -3340,7 +3361,7 @@ my_bool Query_cache::in_list(Query_cache_block * root,
(ulong) block->prev->next,
(ulong) point));
//back trace
- for(; block != point; block = block->next)
+ for (; block != point; block = block->next)
DBUG_PRINT("error", ("back trace 0x%lx", (ulong) block));
result = 1;
goto err1;
@@ -3414,7 +3435,7 @@ my_bool Query_cache::in_table_list(Query_cache_block_table * root,
(ulong) table->prev->next->block(),
(ulong) point, (ulong) point->block()));
//back trace
- for(; table != point; table = table->next)
+ for (; table != point; table = table->next)
DBUG_PRINT("error", ("back trace 0x%lx(0x%lx)",
(ulong) table, (ulong) table->block()));
result = 1;
diff --git a/sql/sql_cache.h b/sql/sql_cache.h
index 81ea80669b8..3088331f19a 100644
--- a/sql/sql_cache.h
+++ b/sql/sql_cache.h
@@ -63,8 +63,6 @@
#define TABLE_COUNTER_TYPE uint8
-#include <my_semaphore.h>
-
struct Query_cache_block;
struct Query_cache_block_table;
struct Query_cache_table;
@@ -110,16 +108,13 @@ struct Query_cache_block
inline Query_cache_block_table *table(TABLE_COUNTER_TYPE n);
};
-
struct Query_cache_query
{
ulonglong limit_found_rows;
+ rw_lock_t lock;
Query_cache_block *res;
NET *wri;
ulong len;
- sem_t lock; // R/W lock of block
- pthread_mutex_t clients_guard;
- uint clients;
inline void init_n_lock();
void unlock_n_destroy();
@@ -194,10 +189,10 @@ struct Query_cache_memory_bin
uint number;
Query_cache_block *free_blocks;
- inline void init(ulong size)
+ inline void init(ulong size_arg)
{
#ifndef DBUG_OFF
- this->size = size;
+ size = size_arg;
#endif
number = 0;
free_blocks = 0;
@@ -209,11 +204,11 @@ struct Query_cache_memory_bin_step
ulong size;
ulong increment;
uint idx;
- inline void init(ulong size, uint idx, ulong increment)
+ inline void init(ulong size_arg, uint idx_arg, ulong increment_arg)
{
- this->size = size;
- this->idx = idx;
- this->increment = increment;
+ size = size_arg;
+ idx = idx_arg;
+ increment = increment_arg;
}
};
@@ -403,6 +398,7 @@ protected:
};
extern Query_cache query_cache;
+extern TYPELIB query_cache_type_typelib;
void query_cache_insert(NET *net, const char *packet, ulong length);
void query_cache_end_of_result(NET *net);
void query_cache_abort(NET *net);
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 9922eacdec1..41def4aa1b5 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -51,8 +51,6 @@ template class List<Alter_drop>;
template class List_iterator<Alter_drop>;
template class List<Alter_column>;
template class List_iterator<Alter_column>;
-template class List<Set_option>;
-template class List_iterator<Set_option>;
#endif
/****************************************************************************
@@ -87,6 +85,9 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0),
host_or_ip="unknown ip";
locked=killed=count_cuted_fields=some_tables_deleted=no_errors=password=
query_start_used=safe_to_cache_query=0;
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ variables= global_system_variables;
+ pthread_mutex_unlock(&LOCK_global_system_variables);
db_length=query_length=col_access=0;
query_error=0;
next_insert_id=last_insert_id=0;
@@ -102,7 +103,6 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0),
slave_proxy_id = 0;
file_id = 0;
cond_count=0;
- convert_set=0;
db_charset=default_charset_info;
mysys_var=0;
#ifndef DBUG_OFF
@@ -117,8 +117,8 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0),
#endif
#ifdef SIGNAL_WITH_VIO_CLOSE
active_vio = 0;
- pthread_mutex_init(&active_vio_lock, MY_MUTEX_INIT_FAST);
#endif
+ pthread_mutex_init(&LOCK_delete, MY_MUTEX_INIT_FAST);
/* Variables with default values */
proc_info="login";
@@ -127,23 +127,15 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0),
slave_net = 0;
log_pos = 0;
server_status= SERVER_STATUS_AUTOCOMMIT;
- update_lock_default= low_priority_updates ? TL_WRITE_LOW_PRIORITY : TL_WRITE;
+ update_lock_default= (variables.low_priority_updates ?
+ TL_WRITE_LOW_PRIORITY :
+ TL_WRITE);
options= thd_startup_options;
-#ifdef HAVE_QUERY_CACHE
- query_cache_type= (byte) query_cache_startup_type;
-#else
- query_cache_type= 0; //Safety
-#endif
sql_mode=(uint) opt_sql_mode;
- inactive_timeout=net_wait_timeout;
open_options=ha_open_options;
- tx_isolation=session_tx_isolation=default_tx_isolation;
+ session_tx_isolation= (enum_tx_isolation) variables.tx_isolation;
command=COM_CONNECT;
set_query_id=1;
- default_select_limit= HA_POS_ERROR;
- max_error_count=max_warning_count=MYSQL_DEFAULT_ERROR_COUNT;
- max_join_size= ((::max_join_size != ~ (ulong) 0L) ? ::max_join_size :
- HA_POS_ERROR);
db_access=NO_ACCESS;
/* Initialize sub structures */
@@ -199,6 +191,10 @@ THD::~THD()
{
THD_CHECK_SENTRY(this);
DBUG_ENTER("~THD()");
+ /* Ensure that no one is using THD */
+ pthread_mutex_lock(&LOCK_delete);
+ pthread_mutex_unlock(&LOCK_delete);
+
/* Close connection */
if (net.vio)
{
@@ -218,7 +214,6 @@ THD::~THD()
hash_free(&user_vars);
DBUG_PRINT("info", ("freeing host"));
-
if (host != localhost) // If not pointer to constant
safeFree(host);
if (user != delayed_user)
@@ -229,18 +224,19 @@ THD::~THD()
free_root(&con_root,MYF(0));
free_root(&transaction.mem_root,MYF(0));
mysys_var=0; // Safety (shouldn't be needed)
-#ifdef SIGNAL_WITH_VIO_CLOSE
- pthread_mutex_destroy(&active_vio_lock);
-#endif
+ pthread_mutex_destroy(&LOCK_delete);
#ifndef DBUG_OFF
dbug_sentry = THD_SENTRY_GONE;
#endif
DBUG_VOID_RETURN;
}
+
void THD::awake(bool prepare_to_die)
{
THD_CHECK_SENTRY(this);
+ safe_mutex_assert_owner(&LOCK_delete);
+
if (prepare_to_die)
killed = 1;
thr_alarm_kill(real_id);
@@ -248,26 +244,30 @@ void THD::awake(bool prepare_to_die)
close_active_vio();
#endif
if (mysys_var)
+ {
+ pthread_mutex_lock(&mysys_var->mutex);
+ if (!system_thread) // Don't abort locks
+ mysys_var->abort=1;
+ /*
+ This broadcast could be up in the air if the victim thread
+ exits the cond in the time between read and broadcast, but that is
+ ok since all we want to do is to make the victim thread get out
+ of waiting on current_cond.
+ */
+ if (mysys_var->current_cond)
{
- pthread_mutex_lock(&mysys_var->mutex);
- if (!system_thread) // Don't abort locks
- mysys_var->abort=1;
- // this broadcast could be up in the air if the victim thread
- // exits the cond in the time between read and broadcast, but that is
- // ok since all we want to do is to make the victim thread get out
- // of waiting on current_cond
- if (mysys_var->current_cond)
- {
- pthread_mutex_lock(mysys_var->current_mutex);
- pthread_cond_broadcast(mysys_var->current_cond);
- pthread_mutex_unlock(mysys_var->current_mutex);
- }
- pthread_mutex_unlock(&mysys_var->mutex);
+ pthread_mutex_lock(mysys_var->current_mutex);
+ pthread_cond_broadcast(mysys_var->current_cond);
+ pthread_mutex_unlock(mysys_var->current_mutex);
}
+ pthread_mutex_unlock(&mysys_var->mutex);
+ }
}
-// remember the location of thread info, the structure needed for
-// sql_alloc() and the structure for the net buffer
+/*
+ Remember the location of thread info, the structure needed for
+ sql_alloc() and the structure for the net buffer
+*/
bool THD::store_globals()
{
@@ -276,6 +276,7 @@ bool THD::store_globals()
my_pthread_setspecific_ptr(THR_NET, &net));
}
+
/* routings to adding tables to list of changed in transaction tables */
inline static void list_include(CHANGED_TABLE_LIST** prev,
@@ -290,17 +291,18 @@ inline static void list_include(CHANGED_TABLE_LIST** prev,
}
/* add table to list of changed in transaction tables */
+
void THD::add_changed_table(TABLE *table)
{
- DBUG_ENTER("THD::add_changed_table (table)");
+ DBUG_ENTER("THD::add_changed_table(table)");
- DBUG_ASSERT((options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN)) &&
- table->file->has_transactions());
+ DBUG_ASSERT((options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) &&
+ table->file->has_transactions());
CHANGED_TABLE_LIST** prev = &transaction.changed_tables;
CHANGED_TABLE_LIST* curr = transaction.changed_tables;
- for(; curr; prev = &(curr->next), curr = curr->next)
+ for (; curr; prev = &(curr->next), curr = curr->next)
{
int cmp = (long)curr->key_length - (long)table->key_length;
if (cmp < 0)
@@ -317,7 +319,8 @@ void THD::add_changed_table(TABLE *table)
{
list_include(prev, curr, changed_table_dup(table));
DBUG_PRINT("info",
- ("key_length %u %u", table->key_length, (*prev)->key_length));
+ ("key_length %u %u", table->key_length,
+ (*prev)->key_length));
DBUG_VOID_RETURN;
}
else if (cmp == 0)
@@ -328,10 +331,12 @@ void THD::add_changed_table(TABLE *table)
}
}
*prev = changed_table_dup(table);
- DBUG_PRINT("info", ("key_length %u %u", table->key_length, (*prev)->key_length));
+ DBUG_PRINT("info", ("key_length %u %u", table->key_length,
+ (*prev)->key_length));
DBUG_VOID_RETURN;
}
+
CHANGED_TABLE_LIST* THD::changed_table_dup(TABLE *table)
{
CHANGED_TABLE_LIST* new_table =
@@ -349,11 +354,7 @@ CHANGED_TABLE_LIST* THD::changed_table_dup(TABLE *table)
ALIGN_SIZE(sizeof(CHANGED_TABLE_LIST)));
new_table->next = 0;
new_table->key_length = table->key_length;
- uint32 db_len = ((new_table->table_name =
- ::strmake(new_table->key, table->table_cache_key,
- table->key_length) + 1) - new_table->key);
- ::memcpy(new_table->key + db_len, table->table_cache_key + db_len,
- table->key_length - db_len);
+ ::memcpy(new_table->key, table->table_cache_key, table->key_length);
return new_table;
}
@@ -614,7 +615,7 @@ bool select_export::send_data(List<Item> &items)
bfill(space,sizeof(space),' ');
}
uint length=item->max_length-used_length;
- for ( ; length > sizeof(space) ; length-=sizeof(space))
+ for (; length > sizeof(space) ; length-=sizeof(space))
{
if (my_b_write(&cache,(byte*) space,sizeof(space)))
goto err;
diff --git a/sql/sql_class.h b/sql/sql_class.h
index a6b7e45ab03..8b2e9400613 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -31,6 +31,8 @@ enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE };
enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY };
enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_IGNORE };
enum enum_log_type { LOG_CLOSED, LOG_NORMAL, LOG_NEW, LOG_BIN };
+enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON,
+ DELAY_KEY_WRITE_ALL };
// log info errors
#define LOG_INFO_EOF -1
@@ -47,7 +49,7 @@ struct st_relay_log_info;
typedef struct st_log_info
{
char log_file_name[FN_REFLEN];
- my_off_t index_file_offset;
+ my_off_t index_file_offset, index_file_start_offset;
my_off_t pos;
bool fatal; // if the purge happens to give us a negative offset
pthread_mutex_t lock;
@@ -60,63 +62,60 @@ class Log_event;
class MYSQL_LOG {
private:
pthread_mutex_t LOCK_log, LOCK_index;
+ pthread_cond_t update_cond;
+ ulonglong bytes_written;
time_t last_time,query_start;
IO_CACHE log_file;
- File index_file;
+ IO_CACHE index_file;
char *name;
- volatile enum_log_type log_type;
char time_buff[20],db[NAME_LEN+1];
char log_file_name[FN_REFLEN],index_file_name[FN_REFLEN];
+ // current file sequence number for load data infile binary logging
+ uint file_id;
+ uint open_count; // For replication
+ volatile enum_log_type log_type;
+ enum cache_type io_cache_type;
bool write_error,inited;
- uint file_id; // current file sequence number for load data infile
/*
- For binlog - if log name can never change
- we should not try to rotate it or write any rotation events
- the user should use FLUSH MASTER instead of FLUSH LOGS for
- purging
+ For binlog - if log name can never change we should not try to rotate it
+ or write any rotation events. The user should use FLUSH MASTER instead
+ of FLUSH LOGS for purging.
*/
bool no_rotate;
- enum cache_type io_cache_type;
bool need_start_event;
- pthread_cond_t update_cond;
bool no_auto_events; // for relay binlog
- ulonglong bytes_written;
friend class Log_event;
public:
MYSQL_LOG();
~MYSQL_LOG();
- pthread_mutex_t* get_log_lock() { return &LOCK_log; }
void reset_bytes_written()
- {
- bytes_written = 0;
- }
+ {
+ bytes_written = 0;
+ }
void harvest_bytes_written(ulonglong* counter)
- {
+ {
#ifndef DBUG_OFF
- char buf1[22],buf2[22];
+ char buf1[22],buf2[22];
#endif
- DBUG_ENTER("harvest_bytes_written");
- (*counter)+=bytes_written;
- DBUG_PRINT("info",("counter=%s,bytes_written=%s", llstr(*counter,buf1),
- llstr(bytes_written,buf2)));
- bytes_written=0;
- DBUG_VOID_RETURN;
- }
- IO_CACHE* get_log_file() { return &log_file; }
+ DBUG_ENTER("harvest_bytes_written");
+ (*counter)+=bytes_written;
+ DBUG_PRINT("info",("counter: %s bytes_written: %s", llstr(*counter,buf1),
+ llstr(bytes_written,buf2)));
+ bytes_written=0;
+ DBUG_VOID_RETURN;
+ }
void signal_update() { pthread_cond_broadcast(&update_cond);}
void wait_for_update(THD* thd);
void set_need_start_event() { need_start_event = 1; }
- void set_index_file_name(const char* index_file_name = 0);
void init(enum_log_type log_type_arg,
enum cache_type io_cache_type_arg = WRITE_CACHE,
bool no_auto_events_arg = 0);
- void open(const char *log_name,enum_log_type log_type,
- const char *new_name, enum cache_type io_cache_type_arg,
+ bool open(const char *log_name,enum_log_type log_type,
+ const char *new_name, const char *index_file_name_arg,
+ enum cache_type io_cache_type_arg,
bool no_auto_events_arg);
- void new_file(bool inside_mutex = 0);
- bool open_index(int options);
- void close_index();
+ void new_file(bool need_lock= 1);
bool write(THD *thd, enum enum_server_command command,
const char *format,...);
bool write(THD *thd, const char *query, uint query_length,
@@ -136,23 +135,27 @@ public:
bool is_active(const char* log_file_name);
int purge_logs(THD* thd, const char* to_log);
int purge_first_log(struct st_relay_log_info* rli);
- int reset_logs(THD* thd);
- void close(bool exiting = 0); // if we are exiting, we also want to close the
- // index file
+ bool reset_logs(THD* thd);
+ // if we are exiting, we also want to close the index file
+ void close(bool exiting = 0);
// iterating through the log index file
- int find_first_log(LOG_INFO* linfo, const char* log_name,
- bool need_mutex=1);
- int find_next_log(LOG_INFO* linfo, bool need_mutex=1);
+ int find_log_pos(LOG_INFO* linfo, const char* log_name,
+ bool need_mutex);
+ int find_next_log(LOG_INFO* linfo, bool need_mutex);
int get_current_log(LOG_INFO* linfo);
uint next_file_id();
inline bool is_open() { return log_type != LOG_CLOSED; }
- char* get_index_fname() { return index_file_name;}
- char* get_log_fname() { return log_file_name; }
- void lock_index() { pthread_mutex_lock(&LOCK_index);}
- void unlock_index() { pthread_mutex_unlock(&LOCK_index);}
- File get_index_file() { return index_file;}
+ inline char* get_index_fname() { return index_file_name;}
+ inline char* get_log_fname() { return log_file_name; }
+ inline pthread_mutex_t* get_log_lock() { return &LOCK_log; }
+ inline IO_CACHE* get_log_file() { return &log_file; }
+
+ inline void lock_index() { pthread_mutex_lock(&LOCK_index);}
+ inline void unlock_index() { pthread_mutex_unlock(&LOCK_index);}
+ inline IO_CACHE *get_index_file() { return &index_file;}
+ inline uint32 get_open_count() { return open_count; }
};
/* character conversion tables */
@@ -182,9 +185,9 @@ typedef struct st_copy_info {
ha_rows records;
ha_rows deleted;
ha_rows copied;
- ha_rows error;
+ ha_rows error_count;
enum enum_duplicates handle_duplicates;
- int escape_char, errorno;
+ int escape_char, last_errno;
} COPY_INFO;
@@ -321,28 +324,68 @@ class delayed_insert;
#define THD_CHECK_SENTRY(thd) DBUG_ASSERT(thd->dbug_sentry == THD_SENTRY_MAGIC)
+struct system_variables
+{
+ ulonglong myisam_max_extra_sort_file_size;
+ ulonglong myisam_max_sort_file_size;
+ ulong bulk_insert_buff_size;
+ ulong join_buff_size;
+ ulong long_query_time;
+ ulong max_allowed_packet;
+ ulong max_heap_table_size;
+ ulong max_sort_length;
+ ulong max_join_size;
+ ulong max_tmp_tables;
+ ulong max_error_count;
+ ulong max_warning_count;
+ ulong myisam_sort_buff_size;
+ ulong net_buffer_length;
+ ulong net_interactive_timeout;
+ ulong net_read_timeout;
+ ulong net_wait_timeout;
+ ulong net_write_timeout;
+ ulong net_retry_count;
+ ulong query_cache_type;
+ ulong read_buff_size;
+ ulong read_rnd_buff_size;
+ ulong select_limit;
+ ulong sortbuff_size;
+ ulong tmp_table_size;
+ ulong tx_isolation;
+ ulong table_type;
+
+ my_bool log_warnings;
+ my_bool low_priority_updates;
+
+ CONVERT *convert_set;
+};
+
+
/*
For each client connection we create a separate thread with THD serving as
- a thread/connection descriptor.
+ a thread/connection descriptor
*/
class THD :public ilink {
public:
NET net; // client connection descriptor
LEX lex; // parse tree descriptor
- MEM_ROOT mem_root; // 1 command-life memory
+ MEM_ROOT mem_root; // 1 command-life memory pool
MEM_ROOT con_root; // connection-life memory
- HASH user_vars; // hash for user variables
- String packet; // buffer used for network I/O
+ HASH user_vars; // hash for user variables
+ String packet; // dynamic buffer for network I/O
struct sockaddr_in remote; // client socket address
struct rand_struct rand; // used for authentication
-
+ struct system_variables variables; // Changeable local variables
+ pthread_mutex_t LOCK_delete; // Locked before thd is deleted
+
+ char *query; // Points to the current query,
/*
- Query points to the current query,
- thread_stack is a pointer to the stack frame of handle_one_connection(),
- which is called first in the thread for handling a client
+ A pointer to the stack frame of handle_one_connection(),
+ which is called first in the thread for handling a client
*/
- char *query,*thread_stack;
+ char *thread_stack;
+
/*
host - host of the client
user - user of the client, set to NULL until the user has been read from
@@ -353,35 +396,25 @@ public:
*/
char *host,*user,*priv_user,*db,*ip;
- /*
- Proc_info points to a string that will show in the Info column of
- SHOW PROCESSLIST output
- host_or_ip points to host if host is available, otherwise points to ip
- */
- const char *proc_info, *host_or_ip;
-
- /*
- client_capabilities has flags describing what the client can do
- sql_mode determines if certain non-standard SQL behaviour should be
- enabled
- max_packet_length - supposed to be maximum packet length the client
- can handle, but it currently appears to be assigned but never used
- except for one debugging statement
- */
- uint client_capabilities,sql_mode,max_packet_length;
+ /* Points to info-string that will show in SHOW PROCESSLIST */
+ const char *proc_info;
+ /* points to host if host is available, otherwise points to ip */
+ const char *host_or_ip;
+
+ uint client_capabilities; /* What the client supports */
+ /* Determines if which non-standard SQL behaviour should be enabled */
+ uint sql_mode;
+ uint max_client_packet_length;
+ ulong master_access; /* Global privileges from mysql.user */
+ ulong db_access; /* Privileges for current db */
- /*
- master_access - privillege descriptor mask for system threads
- db_access - privillege descriptor mask for regular threads
- */
- uint master_access,db_access;
/*
open_tables - list of regular tables in use by this thread
temporary_tables - list of temp tables in use by this thread
handler_tables - list of tables that were opened with HANDLER OPEN
and are still in use by this thread
- */
+ */
TABLE *open_tables,*temporary_tables, *handler_tables;
// TODO: document the variables below
MYSQL_LOCK *lock; /* Current locks */
@@ -392,7 +425,7 @@ public:
#endif
struct st_my_thread_var *mysys_var;
enum enum_server_command command;
- uint32 server_id;
+ uint32 server_id;
uint32 file_id; // for LOAD DATA INFILE
const char *where;
time_t start_time,time_after_lock,user_time;
@@ -419,30 +452,30 @@ public:
}
} transaction;
Item *free_list, *handler_items;
- CONVERT *convert_set;
Field *dupp_field;
#ifndef __WIN__
sigset_t signals,block_signals;
#endif
#ifdef SIGNAL_WITH_VIO_CLOSE
Vio* active_vio;
- pthread_mutex_t active_vio_lock;
#endif
ulonglong next_insert_id,last_insert_id,current_insert_id,
limit_found_rows;
- ha_rows default_select_limit,cuted_fields,
- max_join_size, sent_row_count, examined_row_count;
+ ha_rows select_limit, offset_limit, cuted_fields,
+ sent_row_count, examined_row_count;
table_map used_tables;
USER_CONN *user_connect;
- ulong query_id,version, inactive_timeout,options,thread_id,
- max_error_count, max_warning_count;
+ CHARSET_INFO *db_charset;
+ ulong query_id, version, options, thread_id, col_access;
+ ulong param_count,current_param_number;
long dbug_thread_id;
pthread_t real_id;
- uint current_tablenr,tmp_table,cond_count,col_access;
+ uint current_tablenr,tmp_table,cond_count;
uint server_status,open_options;
uint32 query_length;
uint32 db_length;
- enum_tx_isolation tx_isolation, session_tx_isolation;
+ /* variables.transaction_isolation is reset to this after each commit */
+ enum_tx_isolation session_tx_isolation;
char scramble[9];
uint8 query_cache_type; // type of query cache processing
bool slave_thread;
@@ -454,7 +487,6 @@ public:
bool safe_to_cache_query;
bool volatile killed;
bool prepare_command;
- ulong param_count,current_param_number;
Error<mysql_st_error> err_list;
Error<mysql_st_error> warn_list;
Item_param *current_param;
@@ -472,7 +504,12 @@ public:
ulong slave_proxy_id;
NET* slave_net; // network connection from slave -> m.
my_off_t log_pos;
- CHARSET_INFO *db_charset;
+ /* Used by the sys_var class to store temporary values */
+ union
+ {
+ my_bool my_bool_value;
+ long long_value;
+ } sys_var_tmp;
THD();
~THD();
@@ -481,25 +518,24 @@ public:
#ifdef SIGNAL_WITH_VIO_CLOSE
inline void set_active_vio(Vio* vio)
{
- pthread_mutex_lock(&active_vio_lock);
+ pthread_mutex_lock(&LOCK_delete);
active_vio = vio;
- pthread_mutex_unlock(&active_vio_lock);
+ pthread_mutex_unlock(&LOCK_delete);
}
inline void clear_active_vio()
{
- pthread_mutex_lock(&active_vio_lock);
+ pthread_mutex_lock(&LOCK_delete);
active_vio = 0;
- pthread_mutex_unlock(&active_vio_lock);
+ pthread_mutex_unlock(&LOCK_delete);
}
inline void close_active_vio()
{
- pthread_mutex_lock(&active_vio_lock);
- if(active_vio)
- {
- vio_close(active_vio);
- active_vio = 0;
- }
- pthread_mutex_unlock(&active_vio_lock);
+ safe_mutex_assert_owner(&LOCK_delete);
+ if (active_vio)
+ {
+ vio_close(active_vio);
+ active_vio = 0;
+ }
}
#endif
void awake(bool prepare_to_die);
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 7e82e1433b9..dee26aae4be 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -255,7 +255,7 @@ int mysql_alter_db(THD *thd, char *db, HA_CREATE_INFO *create_info, bool silent)
mysql_update_log.write(thd,thd->query, thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query);
+ Query_log_event qinfo(thd, thd->query, thd->query_length);
mysql_bin_log.write(&qinfo);
}
}
@@ -327,7 +327,9 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
send_ok(&thd->net,0);
goto exit;
}
+ pthread_mutex_lock(&LOCK_open);
remove_db_from_cache(db);
+ pthread_mutex_unlock(&LOCK_open);
error = -1;
if ((deleted=mysql_rm_known_files(thd, dirp, db, path,0)) >= 0 && thd)
@@ -345,7 +347,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
mysql_update_log.write(thd, thd->query, thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query);
+ Query_log_event qinfo(thd, thd->query, thd->query_length);
mysql_bin_log.write(&qinfo);
}
if (thd->query == path)
@@ -450,7 +452,8 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
}
my_dirend(dirp);
- if (thd->killed || (tot_list && mysql_rm_table_part2(thd, tot_list, 1, 1)))
+ if (thd->killed ||
+ (tot_list && mysql_rm_table_part2_with_lock(thd, tot_list, 1, 1)))
DBUG_RETURN(-1);
/*
@@ -522,6 +525,8 @@ bool mysql_change_db(THD *thd,const char *name)
x_free(dbname);
DBUG_RETURN(1);
}
+ if (lower_case_table_names)
+ casedn_str(dbname);
DBUG_PRINT("info",("Use database: %s", dbname));
if (test_all_bits(thd->master_access,DB_ACLS))
db_access=DB_ACLS;
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 3e9df1cfd29..fc98cfb90c5 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -78,7 +78,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order,
select=make_select(table,0,0,conds,&error);
if (error)
DBUG_RETURN(-1);
- if ((select && select->check_quick(test(thd->options & SQL_SAFE_UPDATES),
+ if ((select && select->check_quick(test(thd->options & OPTION_SAFE_UPDATES),
limit)) ||
!limit)
{
@@ -167,7 +167,8 @@ cleanup:
mysql_update_log.write(thd,thd->query, thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query, using_transactions);
+ Query_log_event qinfo(thd, thd->query, thd->query_length,
+ using_transactions);
if (mysql_bin_log.write(&qinfo) && using_transactions)
error=1;
}
@@ -198,10 +199,10 @@ cleanup:
/***************************************************************************
-** delete multiple tables from join
+ Delete multiple tables from join
***************************************************************************/
-#define MEM_STRIP_BUF_SIZE sortbuff_size
+#define MEM_STRIP_BUF_SIZE current_thd->variables.sortbuff_size
int refposcmp2(void* arg, const void *a,const void *b)
{
@@ -215,21 +216,8 @@ multi_delete::multi_delete(THD *thd_arg, TABLE_LIST *dt,
num_of_tables(num_of_tables_arg), error(0), lock_option(lock_option_arg),
do_delete(false)
{
- uint counter=0;
not_trans_safe=false;
tempfiles = (Unique **) sql_calloc(sizeof(Unique *) * (num_of_tables-1));
-
- /* Don't use key read with MULTI-TABLE-DELETE */
- dt->table->used_keys=0;
- for (dt=dt->next ; dt ; dt=dt->next,counter++)
- {
- TABLE *table=dt->table;
- table->used_keys=0;
- tempfiles[counter] = new Unique (refposcmp2,
- (void *) &table->file->ref_length,
- table->file->ref_length,
- MEM_STRIP_BUF_SIZE);
- }
}
@@ -261,6 +249,7 @@ multi_delete::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
void
multi_delete::initialize_tables(JOIN *join)
{
+ int counter=0;
TABLE_LIST *walk;
table_map tables_to_delete_from=0;
for (walk= delete_tables ; walk ; walk=walk->next)
@@ -274,14 +263,27 @@ multi_delete::initialize_tables(JOIN *join)
if (tab->table->map & tables_to_delete_from)
{
/* We are going to delete from this table */
- walk->table=tab->table;
+ TABLE *tbl=walk->table=tab->table;
+ /* Don't use KEYREAD optimization on this table */
+ tbl->no_keyread=1;
walk=walk->next;
- if (tab == join->join_tab)
- tab->table->no_keyread=1;
- if (!not_trans_safe && !tab->table->file->has_transactions())
+ if (!not_trans_safe && !tbl->file->has_transactions())
not_trans_safe=true;
}
}
+ walk= delete_tables;
+ walk->table->used_keys=0;
+ for (walk=walk->next ; walk ; walk=walk->next, counter++)
+ {
+ tables_to_delete_from|= walk->table->map;
+ TABLE *table=walk->table;
+ /* Don't use key read with MULTI-TABLE-DELETE */
+ table->used_keys=0;
+ tempfiles[counter] = new Unique (refposcmp2,
+ (void *) &table->file->ref_length,
+ table->file->ref_length,
+ MEM_STRIP_BUF_SIZE);
+ }
init_ftfuncs(thd,1);
}
@@ -358,7 +360,7 @@ void multi_delete::send_error(uint errcode,const char *err)
if (!deleted)
DBUG_VOID_RETURN;
- /* Somthing alredy deleted consequently we have to invalidate cache */
+ /* Something already deleted so we have to invalidate cache */
query_cache_invalidate3(thd, delete_tables, 1);
/* Below can happen when thread is killed early ... */
@@ -437,6 +439,8 @@ int multi_delete::do_deletes(bool from_send_error)
/*
+ Send ok to the client
+
return: 0 sucess
1 error
*/
@@ -467,7 +471,7 @@ bool multi_delete::send_eof()
mysql_update_log.write(thd,thd->query,thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query);
+ Query_log_event qinfo(thd, thd->query, thd->query_length);
if (mysql_bin_log.write(&qinfo) &&
!not_trans_safe)
error=1; // Log write failed: roll back the SQL statement
@@ -485,7 +489,7 @@ bool multi_delete::send_eof()
/***************************************************************************
-* TRUNCATE TABLE
+ TRUNCATE TABLE
****************************************************************************/
/*
@@ -530,9 +534,8 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
table_list->real_name, 1))))
(void) rm_temporary_table(table_type, path);
/*
- If we return here we will not have binloged the truncation and
- we will not send_ok() to the client. Yes, we do need better coverage
- testing, this bug has been here for a few months :-).
+ If we return here we will not have logged the truncation to the bin log
+ and we will not send_ok() to the client.
*/
goto end;
}
@@ -546,7 +549,8 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
db_type table_type;
if ((table_type=get_table_type(path)) == DB_TYPE_UNKNOWN)
{
- my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->real_name);
+ my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db,
+ table_list->real_name);
DBUG_RETURN(-1);
}
if (!ha_supports_generate(table_type))
@@ -573,14 +577,20 @@ end:
mysql_update_log.write(thd,thd->query,thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query);
+ Query_log_event qinfo(thd, thd->query, thd->query_length);
mysql_bin_log.write(&qinfo);
}
send_ok(&thd->net); // This should return record count
}
+ VOID(pthread_mutex_lock(&LOCK_open));
unlock_table_name(thd, table_list);
+ VOID(pthread_mutex_unlock(&LOCK_open));
}
else if (error)
+ {
+ VOID(pthread_mutex_lock(&LOCK_open));
unlock_table_name(thd, table_list);
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ }
DBUG_RETURN(error ? -1 : 0);
}
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 3668a817165..7fa24faf6c4 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -17,9 +17,9 @@
/* HANDLER ... commands - direct access to ISAM */
-#include <assert.h>
#include "mysql_priv.h"
#include "sql_select.h"
+#include <assert.h>
/* TODO:
HANDLER blabla OPEN [ AS foobar ] [ (column-list) ]
@@ -117,6 +117,7 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
keyname,tables->name);
return -1;
}
+ table->file->index_init(keyno);
}
List<Item> list;
@@ -127,7 +128,7 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
insert_fields(thd,tables,tables->db,tables->name,&it);
- table->file->index_init(keyno);
+ table->file->init_table_handle_for_HANDLER(); // Only InnoDB requires it
select_limit+=offset_limit;
send_fields(thd,list,1);
@@ -212,7 +213,7 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
if (cond)
{
err=err;
- if(!cond->val_int())
+ if (!cond->val_int())
continue;
}
if (num_rows>=offset_limit)
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index c3aeca1fff8..b02fd99e358 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -60,7 +60,7 @@ check_insert_fields(THD *thd,TABLE *table,List<Item> &fields,
if (grant_option &&
check_grant_all_columns(thd,INSERT_ACL,table))
return -1;
- table->time_stamp=0; // This should be saved
+ table->time_stamp=0; // This is saved by caller
}
else
{ // Part field list
@@ -73,6 +73,7 @@ check_insert_fields(THD *thd,TABLE *table,List<Item> &fields,
}
TABLE_LIST table_list;
bzero((char*) &table_list,sizeof(table_list));
+ table_list.db= table->table_cache_key;
table_list.name=table->table_name;
table_list.table=table;
table_list.grant=table->grant;
@@ -102,7 +103,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
{
int error;
bool log_on= ((thd->options & OPTION_UPDATE_LOG) ||
- !(thd->master_access & PROCESS_ACL));
+ !(thd->master_access & SUPER_ACL));
bool using_transactions, bulk_insert=0;
uint value_count;
uint save_time_stamp;
@@ -177,7 +178,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
}
its.rewind ();
/*
- ** Fill in the given fields and dump it to the table file
+ Fill in the given fields and dump it to the table file
*/
info.records=info.deleted=info.copied=0;
@@ -197,11 +198,13 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
lock_type != TL_WRITE_DELAYED &&
!(specialflag & SPECIAL_SAFE_MODE))))
{
- table->file->extra(HA_EXTRA_WRITE_CACHE);
- table->file->extra(HA_EXTRA_BULK_INSERT_BEGIN);
+ table->file->extra_opt(HA_EXTRA_WRITE_CACHE,
+ thd->variables.read_buff_size);
+ table->file->extra_opt(HA_EXTRA_BULK_INSERT_BEGIN,
+ thd->variables.bulk_insert_buff_size);
}
- while ((values = its++))
+ while ((values= its++))
{
if (fields.elements || !value_count)
{
@@ -263,7 +266,9 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
end_delayed_insert(thd);
}
if (info.copied || info.deleted)
+ {
query_cache_invalidate3(thd, table_list, 1);
+ }
}
else
{
@@ -296,7 +301,8 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
mysql_update_log.write(thd, thd->query, thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query, using_transactions);
+ Query_log_event qinfo(thd, thd->query, thd->query_length,
+ using_transactions);
if (mysql_bin_log.write(&qinfo) && using_transactions)
error=1;
}
@@ -332,12 +338,14 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
{
char buff[160];
if (duplic == DUP_IGNORE)
- sprintf(buff,ER(ER_INSERT_INFO),info.records,info.records-info.copied,
+ sprintf(buff,ER(ER_INSERT_INFO),info.records,
+ (lock_type == TL_WRITE_DELAYED) ? 0 :
+ info.records-info.copied,
thd->cuted_fields);
else
sprintf(buff,ER(ER_INSERT_INFO),info.records,info.deleted,
thd->cuted_fields);
- ::send_ok(&thd->net,info.copied+info.deleted,0L,buff);
+ ::send_ok(&thd->net,info.copied+info.deleted,(ulonglong)id,buff);
}
DBUG_RETURN(0);
@@ -360,7 +368,7 @@ static int last_uniq_key(TABLE *table,uint keynr)
/*
-** Write a record to table with optional deleting of conflicting records
+ Write a record to table with optional deleting of conflicting records
*/
@@ -447,16 +455,16 @@ int write_record(TABLE *table,COPY_INFO *info)
err:
if (key)
my_afree(key);
- info->errorno= error;
+ info->last_errno= error;
table->file->print_error(error,MYF(0));
return 1;
}
/******************************************************************************
- Check that all fields with arn't null_fields are used
- if DONT_USE_DEFAULT_FIELDS isn't defined use default value for not
- set fields.
+ Check that all fields with arn't null_fields are used
+ If DONT_USE_DEFAULT_FIELDS isn't defined use default value for not set
+ fields.
******************************************************************************/
static int check_null_fields(THD *thd __attribute__((unused)),
@@ -479,10 +487,8 @@ static int check_null_fields(THD *thd __attribute__((unused)),
}
/*****************************************************************************
-** Handling of delayed inserts
-**
-** A thread is created for each table that one uses with the DELAYED
-** attribute.
+ Handling of delayed inserts
+ A thread is created for each table that one uses with the DELAYED attribute.
*****************************************************************************/
class delayed_row :public ilink {
@@ -556,8 +562,8 @@ public:
thd.user=thd.host=0;
thread_count--;
delayed_insert_threads--;
- VOID(pthread_cond_broadcast(&COND_thread_count)); /* Tell main we are ready */
VOID(pthread_mutex_unlock(&LOCK_thread_count));
+ VOID(pthread_cond_broadcast(&COND_thread_count)); /* Tell main we are ready */
}
/* The following is for checking when we can delete ourselves */
@@ -929,9 +935,7 @@ static pthread_handler_decl(handle_delayed_insert,arg)
#endif
DBUG_ENTER("handle_delayed_insert");
- if (init_thr_lock() ||
- my_pthread_setspecific_ptr(THR_THD, thd) ||
- my_pthread_setspecific_ptr(THR_NET, &thd->net))
+ if (init_thr_lock() || thd->store_globals())
{
thd->fatal_error=1;
strmov(thd->net.last_error,ER(thd->net.last_errno=ER_OUT_OF_RESOURCES));
@@ -1179,7 +1183,7 @@ bool delayed_insert::handle_inserts(void)
thd.net.last_errno = 0; // reset error for binlog
if (write_record(table,&info))
{
- info.error++; // Ignore errors
+ info.error_count++; // Ignore errors
thread_safe_increment(delayed_insert_errors,&LOCK_delayed_status);
row->log_query = 0;
}
@@ -1193,8 +1197,7 @@ bool delayed_insert::handle_inserts(void)
mysql_update_log.write(&thd,row->query, row->query_length);
if (using_bin_log)
{
- thd.query_length = row->query_length;
- Query_log_event qinfo(&thd, row->query);
+ Query_log_event qinfo(&thd, row->query, row->query_length);
mysql_bin_log.write(&qinfo);
}
}
@@ -1267,7 +1270,7 @@ bool delayed_insert::handle_inserts(void)
/***************************************************************************
-** store records in INSERT ... SELECT *
+ Store records in INSERT ... SELECT *
***************************************************************************/
int
@@ -1375,7 +1378,7 @@ bool select_insert::send_eof()
mysql_update_log.write(thd,thd->query,thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query,
+ Query_log_event qinfo(thd, thd->query, thd->query_length,
table->file->has_transactions());
mysql_bin_log.write(&qinfo);
}
@@ -1385,7 +1388,7 @@ bool select_insert::send_eof()
/***************************************************************************
-** CREATE TABLE (SELECT) ...
+ CREATE TABLE (SELECT) ...
***************************************************************************/
int
@@ -1453,6 +1456,11 @@ bool select_create::send_eof()
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
VOID(pthread_mutex_lock(&LOCK_open));
mysql_unlock_tables(thd, lock);
+ /*
+ TODO:
+ Check if we can remove the following two rows.
+ We should be able to just keep the table in the table cache.
+ */
if (!table->tmp_table)
hash_delete(&open_cache,(byte*) table);
lock=0;
@@ -1484,7 +1492,7 @@ void select_create::abort()
/*****************************************************************************
-** Instansiate templates
+ Instansiate templates
*****************************************************************************/
#ifdef __GNUC__
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 9ae5cdeeb15..dc9019de2c8 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -147,10 +147,11 @@ LEX *lex_start(THD *thd, uchar *buf,uint length)
lex->select->in_sum_expr=0;
lex->select->expr_list.empty();
lex->select->ftfunc_list.empty();
- lex->convert_set=(lex->thd=thd)->convert_set;
+ lex->convert_set=(lex->thd=thd)->variables.convert_set;
lex->yacc_yyss=lex->yacc_yyvs=0;
lex->ignore_space=test(thd->sql_mode & MODE_IGNORE_SPACE);
lex->slave_thd_opt=0;
+ lex->sql_command=SQLCOM_END;
bzero(&lex->mi,sizeof(lex->mi));
return lex;
}
@@ -507,7 +508,7 @@ int yylex(void *arg)
length= (uint) (lex->ptr - lex->tok_start)-1;
if (lex->ignore_space)
{
- for ( ; state_map[c] == STATE_SKIP ; c= yyGet());
+ for (; state_map[c] == STATE_SKIP ; c= yyGet());
}
if (c == '.' && (state_map[yyPeek()] == STATE_IDENT ||
state_map[yyPeek()] == STATE_NUMBER_IDENT))
@@ -524,7 +525,7 @@ int yylex(void *arg)
}
yylval->lex_str=get_token(lex,length);
if (lex->convert_set)
- lex->convert_set->convert((char*) yylval->lex_str.str,lex->yytoklen);
+ lex->convert_set->convert((char*) yylval->lex_str.str,lex->yytoklen);
/*
Note: "SELECT _bla AS 'alias'"
@@ -866,14 +867,12 @@ int yylex(void *arg)
}
break;
case STATE_USER_END: // end '@' of user@hostname
- switch (state_map[yyPeek()])
- {
+ switch (state_map[yyPeek()]) {
case STATE_STRING:
case STATE_USER_VARIABLE_DELIMITER:
break;
case STATE_USER_END:
- lex->next_state=STATE_USER_END;
- yySkip();
+ lex->next_state=STATE_SYSTEM_VAR;
break;
default:
lex->next_state=STATE_HOSTNAME;
@@ -888,6 +887,33 @@ int yylex(void *arg)
c= yyGet()) ;
yylval->lex_str=get_token(lex,yyLength());
return(LEX_HOSTNAME);
+ case STATE_SYSTEM_VAR:
+ yylval->lex_str.str=(char*) lex->ptr;
+ yylval->lex_str.length=1;
+ lex->next_state=STATE_IDENT_OR_KEYWORD;
+ yySkip(); // Skip '@'
+ return((int) '@');
+ case STATE_IDENT_OR_KEYWORD:
+ /*
+ We come here when we have found two '@' in a row.
+ We should now be able to handle:
+ [(global | local | session) .]variable_name
+ */
+
+ while (state_map[c=yyGet()] == STATE_IDENT ||
+ state_map[c] == STATE_NUMBER_IDENT) ;
+ if (c == '.')
+ lex->next_state=STATE_IDENT_SEP;
+ length= (uint) (lex->ptr - lex->tok_start)-1;
+ if ((tokval= find_keyword(lex,length,0)))
+ {
+ yyUnget(); // Put back 'c'
+ return(tokval); // Was keyword
+ }
+ yylval->lex_str=get_token(lex,length);
+ if (lex->convert_set)
+ lex->convert_set->convert((char*) yylval->lex_str.str,lex->yytoklen);
+ return(IDENT);
}
}
}
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index af80b175cd3..6aef99886e9 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -22,8 +22,12 @@ class Table_ident;
class sql_exchange;
class LEX_COLUMN;
-// The following hack is needed because mysql_yacc.cc does not define
-// YYSTYPE before including this file
+/*
+ The following hack is needed because mysql_yacc.cc does not define
+ YYSTYPE before including this file
+*/
+
+#include "set_var.h"
#ifdef MYSQL_YACC
#define LEX_YYSTYPE void *
@@ -40,6 +44,7 @@ enum enum_sql_command {
SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS,
SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_LOGS, SQLCOM_SHOW_STATUS,
+ SQLCOM_SHOW_INNODB_STATUS,
SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT,
SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS,
SQLCOM_SHOW_CREATE_DB,
@@ -59,56 +64,47 @@ enum enum_sql_command {
SQLCOM_HA_OPEN, SQLCOM_HA_CLOSE, SQLCOM_HA_READ,
SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_DELETE_MULTI, SQLCOM_MULTI_UPDATE,
SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_SHOW_NEW_MASTER, SQLCOM_DO,
- SQLCOM_END, SQLCOM_SHOW_WARNS, SQLCOM_SHOW_WARNS_COUNT,
- SQLCOM_EMPTY_QUERY, SQLCOM_SHOW_ERRORS,
- SQLCOM_SHOW_ERRORS_COUNT, SQLCOM_SHOW_COLUMN_TYPES,
- SQLCOM_SHOW_TABLE_TYPES, SQLCOM_SHOW_PRIVILEGES
+ SQLCOM_SHOW_WARNS, SQLCOM_EMPTY_QUERY, SQLCOM_SHOW_ERRORS,
+ SQLCOM_SHOW_COLUMN_TYPES, SQLCOM_SHOW_TABLE_TYPES, SQLCOM_SHOW_PRIVILEGES,
+ SQLCOM_END
};
-enum lex_states { STATE_START, STATE_CHAR, STATE_IDENT,
- STATE_IDENT_SEP,
- STATE_IDENT_START,
- STATE_FOUND_IDENT,
- STATE_SIGNED_NUMBER,
- STATE_REAL,
- STATE_HEX_NUMBER,
- STATE_CMP_OP,
- STATE_LONG_CMP_OP,
- STATE_STRING,
- STATE_COMMENT,
- STATE_END,
- STATE_OPERATOR_OR_IDENT,
- STATE_NUMBER_IDENT,
- STATE_INT_OR_REAL,
- STATE_REAL_OR_POINT,
- STATE_BOOL,
- STATE_EOL,
- STATE_ESCAPE,
- STATE_LONG_COMMENT,
- STATE_END_LONG_COMMENT,
- STATE_COLON,
- STATE_SET_VAR,
- STATE_USER_END,
- STATE_HOSTNAME,
- STATE_SKIP,
- STATE_USER_VARIABLE_DELIMITER
+enum lex_states
+{
+ STATE_START, STATE_CHAR, STATE_IDENT, STATE_IDENT_SEP, STATE_IDENT_START,
+ STATE_FOUND_IDENT, STATE_SIGNED_NUMBER, STATE_REAL, STATE_HEX_NUMBER,
+ STATE_CMP_OP, STATE_LONG_CMP_OP, STATE_STRING, STATE_COMMENT, STATE_END,
+ STATE_OPERATOR_OR_IDENT, STATE_NUMBER_IDENT, STATE_INT_OR_REAL,
+ STATE_REAL_OR_POINT, STATE_BOOL, STATE_EOL, STATE_ESCAPE, STATE_LONG_COMMENT,
+ STATE_END_LONG_COMMENT, STATE_COLON, STATE_SET_VAR, STATE_USER_END,
+ STATE_HOSTNAME, STATE_SKIP, STATE_USER_VARIABLE_DELIMITER, STATE_SYSTEM_VAR,
+ STATE_IDENT_OR_KEYWORD
};
+
typedef List<Item> List_item;
typedef struct st_lex_master_info
{
- char* host, *user, *password,*log_file_name;
+ char *host, *user, *password, *log_file_name;
uint port, connect_retry;
ulonglong pos;
ulong server_id;
- char* relay_log_name;
+ char *relay_log_name;
ulong relay_log_pos;
} LEX_MASTER_INFO;
-enum sub_select_type {UNSPECIFIED_TYPE,UNION_TYPE, INTERSECT_TYPE,
- EXCEPT_TYPE, GLOBAL_OPTIONS_TYPE, DERIVED_TABLE_TYPE};
+enum sub_select_type
+{
+ UNSPECIFIED_TYPE,UNION_TYPE, INTERSECT_TYPE,
+ EXCEPT_TYPE, GLOBAL_OPTIONS_TYPE, DERIVED_TABLE_TYPE, OLAP_TYPE
+};
+
+enum olap_type
+{
+ UNSPECIFIED_OLAP_TYPE, CUBE_TYPE, ROLLUP_TYPE
+};
/*
The state of the lex parsing for selects
@@ -246,6 +242,7 @@ class st_select_lex: public st_select_lex_node {
public:
char *db, *db1, *table1, *db2, *table2; /* For outer join using .. */
Item *where, *having; /* WHERE & HAVING clauses */
+ enum olap_type olap;
List<List_item> expr_list;
List<List_item> when_list; /* WHEN clause */
SQL_LIST table_list, group_list; /* FROM & GROUP BY clauses */
@@ -255,11 +252,11 @@ public:
List<Item_func_match> ftfunc_list;
JOIN *join; /* after JOIN::prepare it is pointer to corresponding JOIN */
uint in_sum_expr;
- bool create_refs,
- braces, /* SELECT ... UNION (SELECT ... ) <- this braces */
- depended, /* depended from outer select subselect */
- /* TRUE when having fix field called in processing of this SELECT */
- having_fix_field;
+ bool create_refs;
+ bool braces; /* SELECT ... UNION (SELECT ... ) <- this braces */
+ bool depended; /* depended from outer select subselect */
+ /* TRUE when having fix field called in processing of this SELECT */
+ bool having_fix_field;
void init_query();
void init_select();
@@ -286,20 +283,11 @@ public:
};
typedef class st_select_lex SELECT_LEX;
-class Set_option :public Sql_alloc {
-public:
- const char *name;
- Item *item;
- uint name_length;
- bool type; /* 1 if global */
- Set_option(bool par_type, const char *par_name, uint length,
- Item *par_item)
- :name(par_name), item(par_item), name_length(length), type(par_type) {}
-};
/* The state of the lex parsing. This is saved in the THD struct */
-typedef struct st_lex {
+typedef struct st_lex
+{
uint yylineno,yytoklen; /* Simulate lex */
LEX_YYSTYPE yylval;
SELECT_LEX_UNIT unit; /* most upper unit */
@@ -320,19 +308,20 @@ typedef struct st_lex {
List<Alter_drop> drop_list;
List<Alter_column> alter_list;
List<String> interval_list;
- List<st_lex_user> users_list;
+ List<LEX_USER> users_list;
List<LEX_COLUMN> columns;
List<Key> key_list;
List<create_field> create_list;
List<Item> *insert_list,field_list,value_list;
List<List_item> many_values;
- List<Set_option> option_list;
+ List<set_var_base> var_list;
List<Item> param_list;
SQL_LIST proc_list, auxilliary_table_list;
TYPELIB *interval;
create_field *last_field;
Item *default_value, *comment;
CONVERT *convert_set;
+ CONVERT *thd_convert_set; // Set with SET CHAR SET
LEX_USER *grant_user;
gptr yacc_yyss,yacc_yyvs;
THD *thd;
@@ -350,10 +339,12 @@ typedef struct st_lex {
enum enum_ha_read_modes ha_read_mode;
enum ha_rkey_function ha_rkey_mode;
enum enum_enable_or_disable alter_keys_onoff;
+ enum enum_var_type option_type;
uint grant, grant_tot_col, which_columns, union_option;
uint fk_delete_opt, fk_update_opt, fk_match_option;
- bool drop_primary,drop_if_exists,local_file;
- bool in_comment,ignore_space,verbose,simple_alter, option_type, derived_tables;
+ bool drop_primary, drop_if_exists, local_file, olap;
+ bool in_comment, ignore_space, verbose, simple_alter;
+ bool derived_tables;
uint slave_thd_opt;
CHARSET_INFO *charset;
} LEX;
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index faeeaf2812e..ad25ef85e75 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -52,17 +52,21 @@ public:
char unescape(char chr);
int terminator(char *ptr,uint length);
bool find_start_of_fields();
- // we need to force cache close before destructor is invoked to log
- // the last read block
+ /*
+ We need to force cache close before destructor is invoked to log
+ the last read block
+ */
void end_io_cache()
{
::end_io_cache(&cache);
need_end_io_cache = 0;
}
- // either this method, or we need to make cache public
- // arg must be set from mysql_load() since constructor does not see
- // either the table or THD value
+ /*
+ Either this method, or we need to make cache public
+ Arg must be set from mysql_load() since constructor does not see
+ either the table or THD value
+ */
void set_io_cache_arg(void* arg) { cache.arg = arg; }
};
@@ -89,6 +93,10 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
bool using_transactions;
DBUG_ENTER("mysql_load");
+#ifdef EMBEDDED_LIBRARY
+ read_file_from_client = 0; //server is always in the same process
+#endif
+
if (escaped->length() > 1 || enclosed->length() > 1)
{
my_message(ER_WRONG_FIELD_TERMINATORS,ER(ER_WRONG_FIELD_TERMINATORS),
@@ -216,7 +224,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
lf_info.handle_dup = handle_duplicates;
lf_info.wrote_create_file = 0;
lf_info.last_pos_in_file = HA_POS_ERROR;
- read_info.set_io_cache_arg((void*)&lf_info);
+ read_info.set_io_cache_arg((void*) &lf_info);
}
restore_record(table,2);
@@ -238,8 +246,10 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
if (use_timestamp)
table->time_stamp=0;
table->next_number_field=table->found_next_number_field;
- VOID(table->file->extra(HA_EXTRA_WRITE_CACHE));
- VOID(table->file->extra(HA_EXTRA_BULK_INSERT_BEGIN));
+ VOID(table->file->extra_opt(HA_EXTRA_WRITE_CACHE,
+ thd->variables.read_buff_size));
+ VOID(table->file->extra_opt(HA_EXTRA_BULK_INSERT_BEGIN,
+ thd->variables.bulk_insert_buff_size));
if (handle_duplicates == DUP_IGNORE ||
handle_duplicates == DUP_REPLACE)
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
@@ -285,7 +295,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
info.records-info.copied,thd->cuted_fields);
send_ok(&thd->net,info.copied+info.deleted,0L,name);
// on the slave thd->query is never initialized
- if(!thd->slave_thread)
+ if (!thd->slave_thread)
mysql_update_log.write(thd,thd->query,thd->query_length);
if (!using_transactions)
@@ -420,7 +430,7 @@ read_sep_field(THD *thd,COPY_INFO &info,TABLE *table,
{
if (field->type() == FIELD_TYPE_TIMESTAMP)
((Field_timestamp*) field)->set_time();
- else
+ else if (field != table->next_number_field)
thd->cuted_fields++;
}
continue;
@@ -435,7 +445,7 @@ read_sep_field(THD *thd,COPY_INFO &info,TABLE *table,
{ // Last record
if (sql_field == (Item_field*) fields.head())
break;
- for ( ; sql_field ; sql_field=(Item_field*) it++)
+ for (; sql_field ; sql_field=(Item_field*) it++)
{
sql_field->field->set_null();
sql_field->field->reset();
@@ -475,8 +485,10 @@ READ_INFO::unescape(char chr)
}
- /* Read a line using buffering */
- /* If last line is empty (in line mode) then it isn't outputed */
+/*
+ Read a line using buffering
+ If last line is empty (in line mode) then it isn't outputed
+*/
READ_INFO::READ_INFO(File file_par, uint tot_length, String &field_term,
@@ -535,10 +547,11 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, String &field_term,
}
else
{
- /* init_io_cache() will not initialize read_function member
- if the cache is READ_NET. The reason is explained in
- mysys/mf_iocache.c. So we work around the problem with a
- manual assignment
+ /*
+ init_io_cache() will not initialize read_function member
+ if the cache is READ_NET. The reason is explained in
+ mysys/mf_iocache.c. So we work around the problem with a
+ manual assignment
*/
if (get_it_from_net)
cache.read_function = _my_b_net_read;
diff --git a/sql/sql_olap.cc b/sql/sql_olap.cc
new file mode 100644
index 00000000000..930e052ab90
--- /dev/null
+++ b/sql/sql_olap.cc
@@ -0,0 +1,194 @@
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
+/*
+ OLAP implementation by Sinisa Milivojevic <sinisa@mysql.com>
+ Inspired by code submitted by Srilakshmi <lakshmi@gdit.iiit.net>
+
+ The ROLLUP code in this file has to be complitely rewritten as it's
+ not good enough to satisfy the goals of MySQL.
+
+ In 4.1 we will replace this with a working, superior implementation
+ of ROLLUP.
+*/
+
+#ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1
+
+#ifdef __GNUC__
+#pragma implementation // gcc: Class implementation
+#endif
+
+#include "mysql_priv.h"
+#include "sql_select.h"
+
+
+/****************************************************************************
+ Functions that recursively actually creates new SELECT's
+ Returns 0 if OK, 1 if error, -1 if error already printed to client
+****************************************************************************/
+
+
+static int make_new_olap_select(LEX *lex, SELECT_LEX *select_lex, List<Item> new_fields)
+{
+ THD *thd=current_thd;
+ Item *item, *new_item;
+ Item_null *constant= new Item_null("ALL");
+
+ SELECT_LEX *new_select = (SELECT_LEX *) thd->memdup((char*) select_lex, sizeof(*select_lex));
+ if (!new_select)
+ return 1;
+ lex->last_selects->next=new_select;
+ new_select->linkage=OLAP_TYPE;
+ new_select->olap=NON_EXISTING_ONE;
+ new_select->group_list.elements=0;
+ new_select->group_list.first=(byte *)0;
+ new_select->group_list.next=(byte **)&new_select->group_list.first;
+ List<Item> privlist;
+
+ List_iterator<Item> list_it(select_lex->item_list);
+ List_iterator<Item> new_it(new_fields);
+
+ while((item=list_it++))
+ {
+ bool not_found=true;
+ if (item->type()==Item::FIELD_ITEM)
+ {
+ Item_field *iif = (Item_field *)item;
+ new_it.rewind();
+ while ((new_item=new_it++))
+ {
+ if (new_item->type()==Item::FIELD_ITEM &&
+ !strcmp(((Item_field*)new_item)->table_name,iif->table_name) &&
+ !strcmp(((Item_field*)new_item)->field_name,iif->field_name))
+ {
+ not_found=false;
+ ((Item_field*)new_item)->db_name=iif->db_name;
+ Item_field *new_one=new Item_field(iif->db_name, iif->table_name, iif->field_name);
+ privlist.push_back(new_one);
+ if (add_to_list(new_select->group_list,new_one,1))
+ return 1;
+ break;
+ }
+ }
+ }
+ if (not_found)
+ {
+ if (item->type() == Item::FIELD_ITEM)
+ privlist.push_back(constant);
+ else
+ privlist.push_back((Item*)thd->memdup((char *)item,item->size_of()));
+ }
+ }
+ new_select->item_list=privlist;
+
+ lex->last_selects = new_select;
+ return 0;
+}
+
+/****************************************************************************
+ Functions that recursively creates combinations of queries for OLAP
+ Returns 0 if OK, 1 if error, -1 if error already printed to client
+****************************************************************************/
+
+static int olap_combos(List<Item> old_fields, List<Item> new_fields, Item *item, LEX *lex,
+ SELECT_LEX *select_lex, int position, int selection, int num_fields,
+ int num_new_fields)
+{
+ int sl_return = 0;
+ if(position == num_new_fields)
+ {
+ if(item)
+ new_fields.push_front(item);
+ sl_return = make_new_olap_select(lex, select_lex, new_fields);
+ }
+ else
+ {
+ if(item)
+ new_fields.push_front(item);
+ while ((num_fields - num_new_fields >= selection - position) && !sl_return)
+ {
+ item = old_fields.pop();
+ sl_return = olap_combos(old_fields, new_fields, item, lex, select_lex, position+1, ++selection, num_fields, num_new_fields);
+ }
+ }
+ return sl_return;
+}
+
+
+/****************************************************************************
+ Top level function for converting OLAP clauses to multiple selects
+ This is also a place where clauses treatment depends on OLAP type
+ Returns 0 if OK, 1 if error, -1 if error already printed to client
+****************************************************************************/
+
+int handle_olaps(LEX *lex, SELECT_LEX *select_lex)
+{
+ List<Item> item_list_copy, new_item_list;
+ item_list_copy.empty();
+ new_item_list.empty();
+ int count=select_lex->group_list.elements;
+ int sl_return=0;
+
+// a fix for UNION's
+ for (TABLE_LIST *cursor= (TABLE_LIST *)select_lex->table_list.first;
+ cursor;
+ cursor=cursor->next)
+ {
+ if (cursor->do_redirect)
+ {
+ cursor->table= ((TABLE_LIST*) cursor->table)->table;
+ cursor->do_redirect=false;
+ }
+ }
+
+ lex->last_selects=select_lex;
+
+ for (ORDER *order=(ORDER *)select_lex->group_list.first ; order ; order=order->next)
+ item_list_copy.push_back(*(order->item));
+
+ List<Item> all_fields(select_lex->item_list);
+
+
+ if (setup_tables((TABLE_LIST *)select_lex->table_list.first) ||
+ setup_fields(lex->thd,(TABLE_LIST *)select_lex->table_list.first,select_lex->item_list,1,&all_fields,1) ||
+ setup_fields(lex->thd,(TABLE_LIST *)select_lex->table_list.first,item_list_copy,1,&all_fields,1))
+ return -1;
+
+ if (select_lex->olap == CUBE_TYPE)
+ {
+ for( int i=count-1; i>=0 && !sl_return; i--)
+ sl_return=olap_combos(item_list_copy, new_item_list, (Item *)0, lex, select_lex, 0, 0, count, i);
+ }
+ else if (select_lex->olap == ROLLUP_TYPE)
+ {
+ for( int i=count-1; i>=0 && !sl_return; i--)
+ {
+ Item *item;
+ item_list_copy.pop();
+ List_iterator<Item> it(item_list_copy);
+ new_item_list.empty();
+ while ((item = it++))
+ new_item_list.push_front(item);
+ sl_return=make_new_olap_select(lex, select_lex, new_item_list);
+ }
+ }
+ else
+ sl_return=1; // impossible
+ return sl_return;
+}
+
+#endif /* DISABLED_UNTIL_REWRITTEN_IN_4_1 */
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index fef022ff513..b889b9ee29f 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -14,21 +14,19 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifdef EMBEDDED_LIBRARY
-#define net_read_timeout net_read_timeout1
-#define net_write_timeout net_write_timeout1
-#endif
-
#include "mysql_priv.h"
#include "sql_acl.h"
#include "sql_repl.h"
#include "repl_failsafe.h"
#include <m_ctype.h>
-#include <thr_alarm.h>
#include <myisam.h>
#include <my_dir.h>
#include <assert.h>
+#ifdef HAVE_INNOBASE_DB
+#include "ha_innodb.h"
+#endif
+
#ifdef HAVE_OPENSSL
/*
Without SSL the handshake consists of one packet. This packet
@@ -40,11 +38,11 @@
Maybe it is better to accept flags other than CLIENT_SSL from the
second packet?
*/
-#define SSL_HANDSHAKE_SIZE 2
-#define NORMAL_HANDSHAKE_SIZE 6
-#define MIN_HANDSHAKE_SIZE 2
+#define SSL_HANDSHAKE_SIZE 2
+#define NORMAL_HANDSHAKE_SIZE 6
+#define MIN_HANDSHAKE_SIZE 2
#else
-#define MIN_HANDSHAKE_SIZE 6
+#define MIN_HANDSHAKE_SIZE 6
#endif /* HAVE_OPENSSL */
#define SCRAMBLE_LENGTH 8
@@ -60,7 +58,6 @@ extern "C" int gethostname(char *name, int namelen);
#endif
static int check_for_max_user_connections(USER_CONN *uc);
-static bool check_mqh(THD *thd);
static void decrease_user_connections(USER_CONN *uc);
static bool check_db_used(THD *thd,TABLE_LIST *tables);
static bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *tables);
@@ -100,7 +97,7 @@ static void test_signal(int sig_ptr)
static void init_signals(void)
{
int signals[7] = {SIGINT,SIGILL,SIGFPE,SIGSEGV,SIGTERM,SIGBREAK,SIGABRT } ;
- for(int i=0 ; i < 7 ; i++)
+ for (int i=0 ; i < 7 ; i++)
signal( signals[i], test_signal) ;
}
#endif
@@ -108,7 +105,7 @@ static void init_signals(void)
inline bool end_active_trans(THD *thd)
{
int error=0;
- if (thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN |
+ if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN |
OPTION_TABLE_LOCK))
{
thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE);
@@ -204,7 +201,7 @@ static bool check_user(THD *thd,enum_server_command command, const char *user,
CLIENT_LONG_PASSWORD),&ur);
DBUG_PRINT("info",
("Capabilities: %d packet_length: %d Host: '%s' User: '%s' Using password: %s Access: %u db: '%s'",
- thd->client_capabilities, thd->max_packet_length,
+ thd->client_capabilities, thd->max_client_packet_length,
thd->host_or_ip, thd->priv_user,
passwd[0] ? "yes": "no",
thd->master_access, thd->db ? thd->db : "*none*"));
@@ -224,7 +221,7 @@ static bool check_user(THD *thd,enum_server_command command, const char *user,
{
VOID(pthread_mutex_lock(&LOCK_thread_count));
bool tmp=(thread_count - delayed_insert_threads >= max_connections &&
- !(thd->master_access & PROCESS_ACL));
+ !(thd->master_access & SUPER_ACL));
VOID(pthread_mutex_unlock(&LOCK_thread_count));
if (tmp)
{ // Too many connections
@@ -291,16 +288,19 @@ static int check_for_max_user_connections(USER_CONN *uc)
int error=0;
DBUG_ENTER("check_for_max_user_connections");
- if (max_user_connections && ( max_user_connections <= (uint) uc->connections))
+ if (max_user_connections &&
+ (max_user_connections <= (uint) uc->connections))
{
net_printf(&(current_thd->net),ER_TOO_MANY_USER_CONNECTIONS, uc->user);
error=1;
goto end;
}
uc->connections++;
- if (uc->user_resources.connections && uc->conn_per_hour++ >= uc->user_resources.connections)
+ if (uc->user_resources.connections &&
+ uc->conn_per_hour++ >= uc->user_resources.connections)
{
- net_printf(&current_thd->net, ER_USER_LIMIT_REACHED, uc->user, "max_connections",
+ net_printf(&current_thd->net, ER_USER_LIMIT_REACHED, uc->user,
+ "max_connections",
(long) uc->user_resources.connections);
error=1;
goto end;
@@ -312,12 +312,8 @@ end:
static void decrease_user_connections(USER_CONN *uc)
{
-/* if (!max_user_connections)
- return;
-*/
-
DBUG_ENTER("decrease_user_connections");
- if (!mqh_used && uc->connections && !--uc->connections)
+ if ((uc->connections && !--uc->connections) && !mqh_used)
{
/* Last connection for user; Delete it */
(void) pthread_mutex_lock(&LOCK_user_conn);
@@ -338,26 +334,45 @@ void free_max_user_conn(void)
Check if maximum queries per hour limit has been reached
returns 0 if OK.
- In theory we would need a mutex in the USER_CONN structure for this to be 100 %
- safe, but as the worst scenario is that we would miss counting a couple of
- queries, this isn't critical.
+ In theory we would need a mutex in the USER_CONN structure for this to
+ be 100 % safe, but as the worst scenario is that we would miss counting
+ a couple of queries, this isn't critical.
*/
char uc_update_queries[SQLCOM_END];
-static bool check_mqh(THD *thd)
+static bool check_mqh(THD *thd, uint check_command)
{
bool error=0;
- DBUG_ENTER("check_mqh");
+ time_t check_time = thd->start_time ? thd->start_time : time(NULL);
USER_CONN *uc=thd->user_connect;
+ DBUG_ENTER("check_mqh");
DBUG_ASSERT(uc != 0);
- uint check_command = thd->lex.sql_command;
-
+ /* If more than a hour since last check, reset resource checking */
+ if (check_time - uc->intime >= 3600)
+ {
+ (void) pthread_mutex_lock(&LOCK_user_conn);
+ uc->questions=1;
+ uc->updates=0;
+ uc->conn_per_hour=0;
+ uc->intime=check_time;
+ (void) pthread_mutex_unlock(&LOCK_user_conn);
+ }
+ /* Check that we have not done too many questions / hour */
+ if (uc->user_resources.questions &&
+ uc->questions++ >= uc->user_resources.questions)
+ {
+ net_printf(&thd->net, ER_USER_LIMIT_REACHED, uc->user, "max_questions",
+ (long) uc->user_resources.questions);
+ error=1;
+ goto end;
+ }
if (check_command < (uint) SQLCOM_END)
{
- if (uc->user_resources.updates && uc_update_queries[check_command] &&
- ++(uc->updates) > uc->user_resources.updates)
+ /* Check that we have not done too many updates / hour */
+ if (uc->user_resources.updates && uc_update_queries[check_command] &&
+ uc->updates++ >= uc->user_resources.updates)
{
net_printf(&thd->net, ER_USER_LIMIT_REACHED, uc->user, "max_updates",
(long) uc->user_resources.updates);
@@ -365,34 +380,12 @@ static bool check_mqh(THD *thd)
goto end;
}
}
- else
- {
- bool my_start = thd->start_time != 0;
- time_t check_time = (my_start) ? thd->start_time : time(NULL);
-
- if (check_time - uc->intime >= 3600)
- {
- (void) pthread_mutex_lock(&LOCK_user_conn);
- uc->questions=1;
- uc->updates=0;
- uc->conn_per_hour=0;
- uc->intime=check_time;
- (void) pthread_mutex_unlock(&LOCK_user_conn);
- }
- else if (uc->user_resources.questions && ++(uc->questions) > uc->user_resources.questions)
- {
- net_printf(&thd->net, ER_USER_LIMIT_REACHED, uc->user, "max_questions",
- (long) uc->user_resources.questions);
- error=1;
- goto end;
- }
- }
end:
DBUG_RETURN(error);
}
-static void reset_mqh(THD *thd, LEX_USER *lu, USER_RESOURCES *mqh, bool get_them=false)
+static void reset_mqh(THD *thd, LEX_USER *lu, bool get_them=false)
{
(void) pthread_mutex_lock(&LOCK_user_conn);
@@ -406,10 +399,10 @@ static void reset_mqh(THD *thd, LEX_USER *lu, USER_RESOURCES *mqh, bool get_the
memcpy(temp_user+lu->user.length+1,lu->host.str,lu->host.length);
temp_user[lu->user.length]='\0'; temp_user[temp_len-1]=0;
if ((uc = (struct user_conn *) hash_search(&hash_user_connections,
- (byte*) temp_user, temp_len-1)))
+ (byte*) temp_user, temp_len)))
{
uc->questions=0;
- uc->user_resources=*mqh;
+ get_mqh(temp_user,&temp_user[lu->user.length+1],uc);
uc->updates=0;
uc->conn_per_hour=0;
}
@@ -522,7 +515,7 @@ check_connections(THD *thd)
#endif
if (connect_errors)
reset_host_errors(&thd->remote.sin_addr);
- if (thd->packet.alloc(net_buffer_length))
+ if (thd->packet.alloc(thd->variables.net_buffer_length))
return(ER_OUT_OF_RESOURCES);
thd->client_capabilities=uint2korr(net->read_pos);
@@ -534,7 +527,7 @@ check_connections(THD *thd)
{
/* Do the SSL layering. */
DBUG_PRINT("info", ("IO layer change in progress..."));
- sslaccept(ssl_acceptor_fd, net->vio, thd->inactive_timeout);
+ sslaccept(ssl_acceptor_fd, net->vio, thd->variables.net_wait_timeout);
DBUG_PRINT("info", ("Reading user information over SSL layer"));
if ((pkt_len=my_net_read(net)) == packet_error ||
pkt_len < NORMAL_HANDSHAKE_SIZE)
@@ -556,7 +549,7 @@ check_connections(THD *thd)
}
#endif
- thd->max_packet_length=uint3korr(net->read_pos+2);
+ thd->max_client_packet_length=uint3korr(net->read_pos+2);
char *user= (char*) net->read_pos+5;
char *passwd= strend(user)+1;
char *db=0;
@@ -565,11 +558,11 @@ check_connections(THD *thd)
if (thd->client_capabilities & CLIENT_CONNECT_WITH_DB)
db=strend(passwd)+1;
if (thd->client_capabilities & CLIENT_INTERACTIVE)
- thd->inactive_timeout=net_interactive_timeout;
+ thd->variables.net_wait_timeout= thd->variables.net_interactive_timeout;
if ((thd->client_capabilities & CLIENT_TRANSACTIONS) &&
opt_using_transactions)
thd->net.return_status= &thd->server_status;
- net->timeout=(uint) net_read_timeout;
+ net->read_timeout=(uint) thd->variables.net_read_timeout;
if (check_user(thd,COM_CONNECT, user, passwd, db, 1))
return (-1);
thd->password=test(passwd[0]);
@@ -592,7 +585,7 @@ pthread_handler_decl(handle_one_connection,arg)
if (!(test_flags & TEST_NO_THREADS) & my_thread_init())
{
close_connection(&thd->net,ER_OUT_OF_RESOURCES);
- statistic_increment(aborted_connects,&LOCK_thread_count);
+ statistic_increment(aborted_connects,&LOCK_status);
end_thread(thd,0);
return 0;
}
@@ -619,7 +612,7 @@ pthread_handler_decl(handle_one_connection,arg)
if (thd->store_globals())
{
close_connection(&thd->net,ER_OUT_OF_RESOURCES);
- statistic_increment(aborted_connects,&LOCK_thread_count);
+ statistic_increment(aborted_connects,&LOCK_status);
end_thread(thd,0);
return 0;
}
@@ -641,11 +634,11 @@ pthread_handler_decl(handle_one_connection,arg)
if (vio_type(net->vio) == VIO_TYPE_NAMEDPIPE)
sleep(1); /* must wait after eof() */
#endif
- statistic_increment(aborted_connects,&LOCK_thread_count);
+ statistic_increment(aborted_connects,&LOCK_status);
goto end_thread;
}
- if (thd->max_join_size == HA_POS_ERROR)
+ if ((ulong) thd->variables.max_join_size == (ulong) HA_POS_ERROR)
thd->options |= OPTION_BIG_SELECTS;
if (thd->client_capabilities & CLIENT_COMPRESS)
net->compress=1; // Use compression
@@ -667,7 +660,7 @@ pthread_handler_decl(handle_one_connection,arg)
free_root(&thd->mem_root,MYF(0));
if (net->error && net->vio != 0)
{
- if (!thd->killed && opt_warnings)
+ if (!thd->killed && thd->variables.log_warnings)
sql_print_error(ER(ER_NEW_ABORTING_CONNECTION),
thd->thread_id,(thd->db ? thd->db : "unconnected"),
thd->user ? thd->user : "unauthenticated",
@@ -675,7 +668,7 @@ pthread_handler_decl(handle_one_connection,arg)
(net->last_errno ? ER(net->last_errno) :
ER(ER_UNKNOWN_ERROR)));
send_error(net,net->last_errno,NullS);
- thread_safe_increment(aborted_threads,&LOCK_thread_count);
+ thread_safe_increment(aborted_threads,&LOCK_status);
}
end_thread:
@@ -719,14 +712,16 @@ pthread_handler_decl(handle_bootstrap,arg)
sigset_t set;
VOID(sigemptyset(&set)); // Get mask in use
VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals));
+
+
#endif
- if (thd->max_join_size == (ulong) ~0L)
+ if ((ulong) thd->variables.max_join_size == (ulong) HA_POS_ERROR)
thd->options |= OPTION_BIG_SELECTS;
thd->proc_info=0;
thd->version=refresh_version;
- thd->priv_user=thd->user=(char*)"boot";
+ thd->priv_user=thd->user=(char*) my_strdup("boot", MYF(MY_WME));
buff= (char*) thd->net.buff;
init_sql_alloc(&thd->mem_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC);
@@ -744,7 +739,7 @@ pthread_handler_decl(handle_bootstrap,arg)
thd->query= thd->memdup_w_gap(buff, length+1, thd->db_length+1);
thd->query[length] = '\0';
thd->query_id=query_id++;
- if (mqh_used && thd->user_connect && check_mqh(thd))
+ if (mqh_used && thd->user_connect && check_mqh(thd, SQLCOM_END))
{
thd->net.error = 0;
close_thread_tables(thd); // Free tables
@@ -758,14 +753,13 @@ pthread_handler_decl(handle_bootstrap,arg)
free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC));
free_root(&thd->transaction.mem_root,MYF(MY_KEEP_PREALLOC));
}
- thd->priv_user=thd->user=0;
/* thd->fatal_error should be set in case something went wrong */
end:
(void) pthread_mutex_lock(&LOCK_thread_count);
thread_count--;
- (void) pthread_cond_broadcast(&COND_thread_count);
(void) pthread_mutex_unlock(&LOCK_thread_count);
+ (void) pthread_cond_broadcast(&COND_thread_count);
my_thread_end();
pthread_exit(0);
DBUG_RETURN(0); // Never reached
@@ -840,8 +834,9 @@ bool do_command(THD *thd)
thd->current_tablenr=0;
packet=0;
- old_timeout=net->timeout;
- net->timeout=(uint) thd->inactive_timeout; // Wait max for 8 hours
+ old_timeout=net->read_timeout;
+ // Wait max for 8 hours
+ net->read_timeout=(uint) thd->variables.net_wait_timeout;
net->last_error[0]=0; // Clear error message
net->last_errno=0;
@@ -860,7 +855,7 @@ bool do_command(THD *thd)
vio_description(net->vio), command,
command_name[command]));
}
- net->timeout=old_timeout; // Timeout for writing
+ net->read_timeout=old_timeout; // restore it
DBUG_RETURN(dispatch_command(command,thd, packet+1, (uint) packet_length));
}
@@ -878,31 +873,30 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
DBUG_ENTER("dispatch_command");
thd->command=command;
+ thd->set_time();
VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query_id=query_id;
if (command != COM_STATISTICS && command != COM_PING)
query_id++;
thread_running++;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
- thd->set_time();
+
thd->lex.select_lex.options=0; // We store status here
switch (command) {
case COM_INIT_DB:
- thread_safe_increment(com_stat[SQLCOM_CHANGE_DB],&LOCK_thread_count);
+ thread_safe_increment(com_stat[SQLCOM_CHANGE_DB],&LOCK_status);
if (!mysql_change_db(thd,packet))
mysql_log.write(thd,command,"%s",thd->db);
break;
case COM_REGISTER_SLAVE:
{
- if (register_slave(thd, (uchar*)packet, packet_length))
- send_error(&thd->net);
- else
+ if (!register_slave(thd, (uchar*)packet, packet_length))
send_ok(&thd->net);
break;
}
case COM_TABLE_DUMP:
{
- thread_safe_increment(com_other,&LOCK_thread_count);
+ thread_safe_increment(com_other, &LOCK_status);
slow_command = TRUE;
uint db_len = *(uchar*)packet;
uint tbl_len = *(uchar*)(packet + db_len + 1);
@@ -919,7 +913,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
case COM_CHANGE_USER:
{
- thread_safe_increment(com_other,&LOCK_thread_count);
+ thread_safe_increment(com_other,&LOCK_status);
char *user= (char*) packet;
char *passwd= strend(user)+1;
char *db= strend(passwd)+1;
@@ -994,17 +988,11 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->db_length+2)))
break;
thd->query[packet_length]=0;
- thd->packet.shrink(net_buffer_length); // Reclaim some memory
+ thd->packet.shrink(thd->variables.net_buffer_length);// Reclaim some memory
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(),QUERY_PRIOR);
mysql_log.write(thd,command,"%s",thd->query);
DBUG_PRINT("query",("%s",thd->query));
- if (mqh_used && thd->user_connect && check_mqh(thd))
- {
- error = TRUE; // Abort client
- net->error = 0; // Don't give abort message
- break;
- }
/* thd->query_length is set by mysql_parse() */
mysql_parse(thd,thd->query,packet_length);
if (!(specialflag & SPECIAL_NO_PRIOR))
@@ -1020,7 +1008,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
{
char *fields;
TABLE_LIST table_list;
- thread_safe_increment(com_stat[SQLCOM_SHOW_FIELDS],&LOCK_thread_count);
+ thread_safe_increment(com_stat[SQLCOM_SHOW_FIELDS],&LOCK_status);
bzero((char*) &table_list,sizeof(table_list));
if (!(table_list.db=thd->db))
{
@@ -1055,7 +1043,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
case COM_CREATE_DB: // QQ: To be removed
{
- thread_safe_increment(com_stat[SQLCOM_CREATE_DB],&LOCK_thread_count);
+ thread_safe_increment(com_stat[SQLCOM_CREATE_DB],&LOCK_status);
char *db=thd->strdup(packet);
// null test to handle EOM
if (!db || !strip_sp(db) || check_db_name(db))
@@ -1063,6 +1051,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
net_printf(&thd->net,ER_WRONG_DB_NAME, db ? db : "NULL");
break;
}
+ if (lower_case_table_names)
+ casedn_str(db);
if (check_access(thd,CREATE_ACL,db,0,1))
break;
mysql_log.write(thd,command,packet);
@@ -1071,7 +1061,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
case COM_DROP_DB: // QQ: To be removed
{
- thread_safe_increment(com_stat[SQLCOM_DROP_DB],&LOCK_thread_count);
+ thread_safe_increment(com_stat[SQLCOM_DROP_DB],&LOCK_status);
char *db=thd->strdup(packet);
// null test to handle EOM
if (!db || !strip_sp(db) || check_db_name(db))
@@ -1079,6 +1069,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
net_printf(&thd->net,ER_WRONG_DB_NAME, db ? db : "NULL");
break;
}
+ if (lower_case_table_names)
+ casedn_str(db);
if (thd->locked_tables || thd->active_transaction())
{
send_error(&thd->net,ER_LOCK_OR_ACTIVE_TRANSACTION);
@@ -1090,23 +1082,22 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
case COM_BINLOG_DUMP:
{
- thread_safe_increment(com_other,&LOCK_thread_count);
+ thread_safe_increment(com_other,&LOCK_status);
slow_command = TRUE;
- if (check_access(thd, FILE_ACL, any_db))
+ if (check_global_access(thd, REPL_SLAVE_ACL))
break;
mysql_log.write(thd,command, 0);
ulong pos;
ushort flags;
uint32 slave_server_id;
+ /* TODO: The following has to be changed to an 8 byte integer */
pos = uint4korr(packet);
flags = uint2korr(packet + 4);
- pthread_mutex_lock(&LOCK_server_id);
thd->server_id=0; /* avoid suicide */
kill_zombie_dump_threads(slave_server_id = uint4korr(packet+6));
thd->server_id = slave_server_id;
- pthread_mutex_unlock(&LOCK_server_id);
- mysql_binlog_send(thd, thd->strdup(packet + 10), pos, flags);
+ mysql_binlog_send(thd, thd->strdup(packet + 10), (my_off_t) pos, flags);
unregister_slave(thd,1,1);
// fake COM_QUIT -- if we get here, the thread needs to terminate
error = TRUE;
@@ -1115,9 +1106,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
case COM_REFRESH:
{
- thread_safe_increment(com_stat[SQLCOM_FLUSH],&LOCK_thread_count);
+ thread_safe_increment(com_stat[SQLCOM_FLUSH],&LOCK_status);
ulong options= (ulong) (uchar) packet[0];
- if (check_access(thd,RELOAD_ACL,any_db))
+ if (check_global_access(thd,RELOAD_ACL))
break;
mysql_log.write(thd,command,NullS);
if (reload_acl_and_cache(thd, options, (TABLE_LIST*) 0))
@@ -1127,8 +1118,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break;
}
case COM_SHUTDOWN:
- thread_safe_increment(com_other,&LOCK_thread_count);
- if (check_access(thd,SHUTDOWN_ACL,any_db))
+ thread_safe_increment(com_other,&LOCK_status);
+ if (check_global_access(thd,SHUTDOWN_ACL))
break; /* purecov: inspected */
DBUG_PRINT("quit",("Got shutdown command"));
mysql_log.write(thd,command,NullS);
@@ -1150,7 +1141,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
case COM_STATISTICS:
{
mysql_log.write(thd,command,NullS);
- thread_safe_increment(com_stat[SQLCOM_SHOW_STATUS],&LOCK_thread_count);
+ thread_safe_increment(com_stat[SQLCOM_SHOW_STATUS],&LOCK_status);
char buff[200];
ulong uptime = (ulong) (thd->start_time - start_time);
sprintf((char*) buff,
@@ -1169,12 +1160,12 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break;
}
case COM_PING:
- thread_safe_increment(com_other,&LOCK_thread_count);
+ thread_safe_increment(com_other,&LOCK_status);
send_ok(net); // Tell client we are alive
break;
case COM_PROCESS_INFO:
- thread_safe_increment(com_stat[SQLCOM_SHOW_PROCESSLIST],&LOCK_thread_count);
- if (!thd->priv_user[0] && check_process_priv(thd))
+ thread_safe_increment(com_stat[SQLCOM_SHOW_PROCESSLIST],&LOCK_status);
+ if (!thd->priv_user[0] && check_global_access(thd,PROCESS_ACL))
break;
mysql_log.write(thd,command,NullS);
mysqld_list_processes(thd,thd->master_access & PROCESS_ACL ? NullS :
@@ -1182,14 +1173,14 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break;
case COM_PROCESS_KILL:
{
- thread_safe_increment(com_stat[SQLCOM_KILL],&LOCK_thread_count);
+ thread_safe_increment(com_stat[SQLCOM_KILL],&LOCK_status);
ulong id=(ulong) uint4korr(packet);
kill_one_thread(thd,id);
break;
}
case COM_DEBUG:
- thread_safe_increment(com_other,&LOCK_thread_count);
- if (check_process_priv(thd))
+ thread_safe_increment(com_other,&LOCK_status);
+ if (check_global_access(thd, SUPER_ACL))
break; /* purecov: inspected */
mysql_print_status(thd);
mysql_log.write(thd,command,NullS);
@@ -1220,7 +1211,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
{
thd->proc_info="logging slow query";
- if ((ulong) (thd->start_time - thd->time_after_lock) > long_query_time ||
+ if ((ulong) (thd->start_time - thd->time_after_lock) >
+ thd->variables.long_query_time ||
((thd->lex.select_lex.options &
(QUERY_NO_INDEX_USED | QUERY_NO_GOOD_INDEX_USED)) &&
(specialflag & SPECIAL_LONG_LOG_FORMAT)))
@@ -1236,7 +1228,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->query=0;
thread_running--;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
- thd->packet.shrink(net_buffer_length); // Reclaim some memory
+ thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory
free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC));
DBUG_RETURN(error);
}
@@ -1299,7 +1291,7 @@ mysql_execute_command(void)
!tables_ok(thd,tables)))
DBUG_VOID_RETURN;
- thread_safe_increment(com_stat[lex->sql_command],&LOCK_thread_count);
+ thread_safe_increment(com_stat[lex->sql_command],&LOCK_status);
switch (lex->sql_command) {
case SQLCOM_SELECT:
{
@@ -1389,26 +1381,16 @@ mysql_execute_command(void)
case SQLCOM_PURGE:
{
- if (check_process_priv(thd))
+ if (check_global_access(thd, SUPER_ACL))
goto error;
res = purge_master_logs(thd, lex->to_log);
break;
}
- case SQLCOM_SHOW_WARNS_COUNT:
- {
- res = mysqld_show_warnings_count(thd);
- break;
- }
case SQLCOM_SHOW_WARNS:
{
res = mysqld_show_warnings(thd);
break;
}
- case SQLCOM_SHOW_ERRORS_COUNT:
- {
- res = mysqld_show_errors_count(thd);
- break;
- }
case SQLCOM_SHOW_ERRORS:
{
res = mysqld_show_errors(thd);
@@ -1416,21 +1398,21 @@ mysql_execute_command(void)
}
case SQLCOM_SHOW_NEW_MASTER:
{
- if (check_access(thd, FILE_ACL, any_db))
+ if (check_global_access(thd, REPL_SLAVE_ACL))
goto error;
res = show_new_master(thd);
break;
}
case SQLCOM_SHOW_SLAVE_HOSTS:
{
- if (check_access(thd, FILE_ACL, any_db))
+ if (check_global_access(thd, REPL_SLAVE_ACL))
goto error;
res = show_slave_hosts(thd);
break;
}
case SQLCOM_SHOW_BINLOG_EVENTS:
{
- if (check_access(thd, FILE_ACL, any_db))
+ if (check_global_access(thd, REPL_SLAVE_ACL))
goto error;
res = show_binlog_events(thd);
break;
@@ -1439,7 +1421,7 @@ mysql_execute_command(void)
{
if (check_db_used(thd,tables) ||
check_table_access(thd,SELECT_ACL, tables) ||
- check_access(thd, FILE_ACL, any_db))
+ check_global_access(thd, FILE_ACL))
goto error; /* purecov: inspected */
res = mysql_backup_table(thd, tables);
@@ -1448,15 +1430,15 @@ mysql_execute_command(void)
case SQLCOM_RESTORE_TABLE:
{
if (check_db_used(thd,tables) ||
- check_table_access(thd,INSERT_ACL, tables) ||
- check_access(thd, FILE_ACL, any_db))
+ check_table_access(thd, INSERT_ACL, tables) ||
+ check_global_access(thd, FILE_ACL))
goto error; /* purecov: inspected */
res = mysql_restore_table(thd, tables);
break;
}
case SQLCOM_CHANGE_MASTER:
{
- if (check_access(thd, PROCESS_ACL, any_db))
+ if (check_global_access(thd, SUPER_ACL))
goto error;
LOCK_ACTIVE_MI;
res = change_master(thd,active_mi);
@@ -1465,7 +1447,7 @@ mysql_execute_command(void)
}
case SQLCOM_SHOW_SLAVE_STAT:
{
- if (check_process_priv(thd))
+ if (check_global_access(thd, SUPER_ACL))
goto error;
LOCK_ACTIVE_MI;
res = show_master_info(thd,active_mi);
@@ -1474,18 +1456,31 @@ mysql_execute_command(void)
}
case SQLCOM_SHOW_MASTER_STAT:
{
- if (check_process_priv(thd))
+ if (check_global_access(thd, SUPER_ACL))
goto error;
res = show_binlog_info(thd);
break;
}
case SQLCOM_LOAD_MASTER_DATA: // sync with master
- if (check_process_priv(thd))
+ if (check_global_access(thd, SUPER_ACL))
goto error;
- res = load_master_data(thd);
+ if (end_active_trans(thd))
+ res= -1;
+ else
+ res = load_master_data(thd);
break;
+#ifdef HAVE_INNOBASE_DB
+ case SQLCOM_SHOW_INNODB_STATUS:
+ {
+ if (check_global_access(thd, SUPER_ACL))
+ goto error;
+ res = innodb_show_status(thd);
+ break;
+ }
+#endif
+
case SQLCOM_LOAD_MASTER_TABLE:
{
if (!tables->db)
@@ -1518,19 +1513,22 @@ mysql_execute_command(void)
break;
}
case SQLCOM_CREATE_TABLE:
+ {
+ ulong want_priv= ((lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) ?
+ CREATE_TMP_ACL : CREATE_ACL);
if (!tables->db)
tables->db=thd->db;
- if (check_access(thd,CREATE_ACL,tables->db,&tables->grant.privilege) ||
+ if (check_access(thd,want_priv,tables->db,&tables->grant.privilege) ||
check_merge_table_access(thd, tables->db,
(TABLE_LIST *)
lex->create_info.merge_list.first))
goto error; /* purecov: inspected */
- if (grant_option)
+ if (grant_option && want_priv != CREATE_TMP_ACL)
{
/* Check that the first table has CREATE privilege */
TABLE_LIST *tmp_table_list=tables->next;
tables->next=0;
- bool error=check_grant(thd,CREATE_ACL,tables);
+ bool error=check_grant(thd, want_priv, tables);
tables->next=tmp_table_list;
if (error)
goto error;
@@ -1603,6 +1601,7 @@ mysql_execute_command(void)
send_ok(&thd->net);
}
break;
+ }
case SQLCOM_CREATE_INDEX:
if (!tables->db)
tables->db=thd->db;
@@ -1636,7 +1635,7 @@ mysql_execute_command(void)
break;
#else
{
- uint priv=0;
+ ulong priv=0;
if (lex->name && strlen(lex->name) > NAME_LEN)
{
net_printf(&thd->net,ER_WRONG_TABLE_NAME,lex->name);
@@ -1726,7 +1725,7 @@ mysql_execute_command(void)
DBUG_VOID_RETURN;
#else
{
- if (check_process_priv(thd))
+ if (check_global_access(thd, SUPER_ACL))
goto error;
res = show_binlogs(thd);
break;
@@ -1829,25 +1828,37 @@ mysql_execute_command(void)
multi_update *result;
uint table_count;
TABLE_LIST *auxi;
+ const char *msg=0;
+
lex->sql_command=SQLCOM_MULTI_UPDATE;
for (auxi=(TABLE_LIST*) tables, table_count=0 ; auxi ; auxi=auxi->next)
{
table_count++;
auxi->lock_type=TL_WRITE;
}
- if (select_lex->order_list.elements || (select_lex->select_limit && select_lex->select_limit < INT_MAX))
+
+ if (select_lex->order_list.elements)
+ msg="ORDER BY";
+ else if (select_lex->select_limit && select_lex->select_limit !=
+ HA_POS_ERROR)
+ msg="LIMIT";
+ if (msg)
{
- send_error(&thd->net,ER_NOT_ALLOWED_COMMAND); /// will have to come up with something better eventually
- DBUG_VOID_RETURN;
+ net_printf(&thd->net, ER_WRONG_USAGE, "UPDATE", msg);
+ res= 1;
+ break;
}
+
tables->grant.want_privilege=(SELECT_ACL & ~tables->grant.privilege);
if ((res=open_and_lock_tables(thd,tables)))
break;
unit->select_limit_cnt= HA_POS_ERROR;
if (!setup_fields(thd,tables,select_lex->item_list,1,0,0) &&
- !setup_fields(thd,tables,lex->value_list,0,0,0) && ! thd->fatal_error &&
- (result=new multi_update(thd,tables,select_lex->item_list,lex->duplicates,
- lex->lock_option, table_count)))
+ !setup_fields(thd,tables,lex->value_list,0,0,0) &&
+ !thd->fatal_error &&
+ (result=new multi_update(thd,tables,select_lex->item_list,
+ lex->duplicates, lex->lock_option,
+ table_count)))
{
List <Item> total_list;
List_iterator <Item> field_list(select_lex->item_list);
@@ -1897,11 +1908,13 @@ mysql_execute_command(void)
case SQLCOM_INSERT_SELECT:
{
- // Check that we have modify privileges for the first table and
- // select privileges for the rest
+ /*
+ Check that we have modify privileges for the first table and
+ select privileges for the rest
+ */
{
- uint privilege= (lex->sql_command == SQLCOM_INSERT_SELECT ?
- INSERT_ACL : INSERT_ACL | UPDATE_ACL | DELETE_ACL);
+ ulong privilege= (lex->sql_command == SQLCOM_INSERT_SELECT ?
+ INSERT_ACL : INSERT_ACL | UPDATE_ACL | DELETE_ACL);
TABLE_LIST *save_next=tables->next;
tables->next=0;
if (check_access(thd, privilege,
@@ -2011,9 +2024,7 @@ mysql_execute_command(void)
}
auxi->lock_type=walk->lock_type=TL_WRITE;
auxi->table_list= walk; // Remember corresponding table
- (void)add_item_to_list(new Item_field(auxi->db,auxi->real_name,"*"));
}
- tables->grant.want_privilege=(SELECT_ACL & ~tables->grant.privilege);
if (add_item_to_list(new Item_null()))
{
res= -1;
@@ -2071,13 +2082,13 @@ mysql_execute_command(void)
DBUG_VOID_RETURN;
#else
if ((specialflag & SPECIAL_SKIP_SHOW_DB) &&
- check_process_priv(thd))
+ check_global_access(thd, SHOW_DB_ACL))
goto error;
res= mysqld_show_dbs(thd, (lex->wild ? lex->wild->ptr() : NullS));
break;
#endif
case SQLCOM_SHOW_PROCESSLIST:
- if (!thd->priv_user[0] && check_process_priv(thd))
+ if (!thd->priv_user[0] && check_global_access(thd,PROCESS_ACL))
break;
mysqld_list_processes(thd,thd->master_access & PROCESS_ACL ? NullS :
thd->priv_user,lex->verbose);
@@ -2092,11 +2103,12 @@ mysql_execute_command(void)
res= mysqld_show_column_types(thd);
break;
case SQLCOM_SHOW_STATUS:
- res= mysqld_show(thd,(lex->wild ? lex->wild->ptr() : NullS),status_vars);
+ res= mysqld_show(thd,(lex->wild ? lex->wild->ptr() : NullS),status_vars,
+ OPT_GLOBAL);
break;
case SQLCOM_SHOW_VARIABLES:
res= mysqld_show(thd, (lex->wild ? lex->wild->ptr() : NullS),
- init_vars);
+ init_vars, lex->option_type);
break;
case SQLCOM_SHOW_LOGS:
#ifdef DONT_ALLOW_SHOW_COMMANDS
@@ -2227,39 +2239,11 @@ mysql_execute_command(void)
break;
}
case SQLCOM_SET_OPTION:
- {
- ulong org_options=thd->options;
- thd->options=select_lex->options;
- thd->update_lock_default= ((thd->options & OPTION_LOW_PRIORITY_UPDATES) ?
- TL_WRITE_LOW_PRIORITY : TL_WRITE);
- thd->default_select_limit=select_lex->select_limit;
- thd->tx_isolation=lex->tx_isolation;
- DBUG_PRINT("info",("options: %ld limit: %ld",
- thd->options,(long) thd->default_select_limit));
-
- /* Check if auto_commit mode changed */
- if ((org_options ^ select_lex->options) & OPTION_NOT_AUTO_COMMIT)
- {
- if ((org_options & OPTION_NOT_AUTO_COMMIT))
- {
- /* We changed to auto_commit mode */
- thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE);
- thd->server_status|= SERVER_STATUS_AUTOCOMMIT;
- if (ha_commit(thd))
- {
- res= -1;
- break;
- }
- }
- else
- {
- thd->options&= ~(ulong) (OPTION_STATUS_NO_TRANS_UPDATE);
- thd->server_status&= ~SERVER_STATUS_AUTOCOMMIT;
- }
- }
- send_ok(&thd->net);
+ if (sql_set_variables(thd, &lex->var_list))
+ res= -1;
+ else
+ send_ok(&thd->net);
break;
- }
case SQLCOM_UNLOCK_TABLES:
if (thd->locked_tables)
{
@@ -2284,8 +2268,7 @@ mysql_execute_command(void)
}
if (check_db_used(thd,tables) || end_active_trans(thd))
goto error;
- if (check_table_access(thd, SELECT_ACL | INSERT_ACL | UPDATE_ACL | DELETE_ACL , tables)
- || (grant_option && check_grant(thd,SELECT_ACL | INSERT_ACL | UPDATE_ACL | DELETE_ACL,tables)))
+ if (check_table_access(thd, LOCK_TABLES_ACL | SELECT_ACL, tables))
goto error;
thd->in_lock_tables=1;
thd->options|= OPTION_TABLE_LOCK;
@@ -2306,6 +2289,8 @@ mysql_execute_command(void)
net_printf(&thd->net,ER_WRONG_DB_NAME, lex->name);
break;
}
+ if (lower_case_table_names)
+ casedn_str(lex->name);
if (check_access(thd,CREATE_ACL,lex->name,0,1))
break;
res=mysql_create_db(thd,lex->name,&lex->create_info,0);
@@ -2318,6 +2303,8 @@ mysql_execute_command(void)
net_printf(&thd->net,ER_WRONG_DB_NAME, lex->name);
break;
}
+ if (lower_case_table_names)
+ casedn_str(lex->name);
if (check_access(thd,DROP_ACL,lex->name,0,1))
break;
if (thd->locked_tables || thd->active_transaction())
@@ -2391,8 +2378,10 @@ mysql_execute_command(void)
tables ? 0 : 1))
goto error;
- /* Check that the user isn't trying to change a password for another
- user if he doesn't have UPDATE privilege to the MySQL database */
+ /*
+ Check that the user isn't trying to change a password for another
+ user if he doesn't have UPDATE privilege to the MySQL database
+ */
if (thd->user) // If not replication
{
@@ -2426,7 +2415,7 @@ mysql_execute_command(void)
mysql_update_log.write(thd, thd->query, thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query);
+ Query_log_event qinfo(thd, thd->query, thd->query_length);
mysql_bin_log.write(&qinfo);
}
}
@@ -2446,15 +2435,15 @@ mysql_execute_command(void)
mysql_update_log.write(thd, thd->query, thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query);
+ Query_log_event qinfo(thd, thd->query, thd->query_length);
mysql_bin_log.write(&qinfo);
}
- if (mqh_used && (lex->mqh.questions || lex->mqh.updates || lex->mqh.connections) && lex->sql_command == SQLCOM_GRANT)
+ if (mqh_used && lex->sql_command == SQLCOM_GRANT)
{
List_iterator <LEX_USER> str_list(lex->users_list);
LEX_USER *user;
while ((user=str_list++))
- reset_mqh(thd,user,&(lex->mqh));
+ reset_mqh(thd,user);
}
}
}
@@ -2462,7 +2451,7 @@ mysql_execute_command(void)
}
case SQLCOM_FLUSH:
case SQLCOM_RESET:
- if (check_access(thd,RELOAD_ACL,any_db) || check_db_used(thd, tables))
+ if (check_global_access(thd,RELOAD_ACL) || check_db_used(thd, tables))
goto error;
if (reload_acl_and_cache(thd, lex->type, tables))
send_error(&thd->net,0);
@@ -2535,7 +2524,6 @@ mysql_execute_command(void)
}
else
res= -1;
- thd->transaction.cleanup();
break;
}
case SQLCOM_ROLLBACK:
@@ -2550,7 +2538,6 @@ mysql_execute_command(void)
else
res= -1;
thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE);
- thd->transaction.cleanup();
break;
default: /* Impossible */
send_ok(&thd->net);
@@ -2566,20 +2553,23 @@ error:
/****************************************************************************
-** Get the user (global) and database privileges for all used tables
-** Returns true (error) if we can't get the privileges and we don't use
-** table/column grants.
-** The idea of EXTRA_ACL is that one will be granted access to the table if
-** one has the asked privilege on any column combination of the table; For
-** example to be able to check a table one needs to have SELECT privilege on
-** any column of the table.
+ Get the user (global) and database privileges for all used tables
+ Returns true (error) if we can't get the privileges and we don't use
+ table/column grants.
+ The idea of EXTRA_ACL is that one will be granted access to the table if
+ one has the asked privilege on any column combination of the table; For
+ example to be able to check a table one needs to have SELECT privilege on
+ any column of the table.
****************************************************************************/
bool
-check_access(THD *thd,uint want_access,const char *db, uint *save_priv,
+check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
bool dont_check_global_grants, bool no_errors)
{
- uint db_access,dummy;
+ DBUG_ENTER("check_access");
+ DBUG_PRINT("enter",("want_access: %lu master_access: %lu", want_access,
+ thd->master_access));
+ ulong db_access,dummy;
if (save_priv)
*save_priv=0;
else
@@ -2589,15 +2579,15 @@ check_access(THD *thd,uint want_access,const char *db, uint *save_priv,
{
if (!no_errors)
send_error(&thd->net,ER_NO_DB_ERROR); /* purecov: tested */
- return TRUE; /* purecov: tested */
+ DBUG_RETURN(TRUE); /* purecov: tested */
}
if ((thd->master_access & want_access) == want_access)
{
*save_priv=thd->master_access;
- return FALSE;
+ DBUG_RETURN(FALSE);
}
- if ((want_access & ~thd->master_access) & ~(DB_ACLS | EXTRA_ACL) ||
+ if (((want_access & ~thd->master_access) & ~(DB_ACLS | EXTRA_ACL)) ||
! db && dont_check_global_grants)
{ // We can never grant this
if (!no_errors)
@@ -2605,50 +2595,60 @@ check_access(THD *thd,uint want_access,const char *db, uint *save_priv,
thd->priv_user,
thd->host_or_ip,
thd->password ? ER(ER_YES) : ER(ER_NO));/* purecov: tested */
- return TRUE; /* purecov: tested */
+ DBUG_RETURN(TRUE); /* purecov: tested */
}
if (db == any_db)
- return FALSE; // Allow select on anything
+ DBUG_RETURN(FALSE); // Allow select on anything
if (db && (!thd->db || strcmp(db,thd->db)))
db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr,
thd->priv_user, db); /* purecov: inspected */
else
db_access=thd->db_access;
- want_access &= ~EXTRA_ACL; // Remove SHOW attribute
+ // Remove SHOW attribute and access rights we already have
+ want_access &= ~(thd->master_access | EXTRA_ACL);
db_access= ((*save_priv=(db_access | thd->master_access)) & want_access);
/* grant_option is set if there exists a single table or column grant */
if (db_access == want_access ||
((grant_option && !dont_check_global_grants) &&
!(want_access & ~TABLE_ACLS)))
- return FALSE; /* Ok */
+ DBUG_RETURN(FALSE); /* Ok */
if (!no_errors)
net_printf(&thd->net,ER_DBACCESS_DENIED_ERROR,
thd->priv_user,
thd->host_or_ip,
db ? db : thd->db ? thd->db : "unknown"); /* purecov: tested */
- return TRUE; /* purecov: tested */
+ DBUG_RETURN(TRUE); /* purecov: tested */
}
-bool check_process_priv(THD *thd)
+/* check for global access and give descriptive error message if it fails */
+
+bool check_global_access(THD *thd, ulong want_access)
{
- return (check_access(thd ? thd : current_thd,PROCESS_ACL,any_db));
+ char command[128];
+ if ((thd->master_access & want_access) == want_access)
+ return 0;
+ get_privilege_desc(command, sizeof(command), want_access);
+ net_printf(&thd->net,ER_SPECIFIC_ACCESS_DENIED_ERROR,
+ command);
+ return 1;
}
/*
-** Check the privilege for all used tables. Table privileges are cached
-** in the table list for GRANT checking
+ Check the privilege for all used tables. Table privileges are cached
+ in the table list for GRANT checking
*/
bool
-check_table_access(THD *thd,uint want_access,TABLE_LIST *tables,
+check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables,
bool no_errors)
{
- uint found=0,found_access=0;
+ uint found=0;
+ ulong found_access=0;
TABLE_LIST *org_tables=tables;
for (; tables ; tables=tables->next)
{
@@ -2669,17 +2669,8 @@ check_table_access(THD *thd,uint want_access,TABLE_LIST *tables,
}
}
else if (check_access(thd,want_access,tables->db,&tables->grant.privilege,
- 0, no_errors | grant_option))
- {
- if (grant_option)
- {
- if ( check_access(thd,want_access & (uint) ~TABLE_ACLS,tables->db,&tables->grant.privilege,
0, no_errors))
- return TRUE;
- }
- else
- return TRUE;
- }
+ return TRUE;
}
if (grant_option)
return check_grant(thd,want_access & ~EXTRA_ACL,org_tables,
@@ -2805,6 +2796,8 @@ mysql_init_query(THD *thd)
thd->free_list= 0;
thd->lex.union_option= 0;
thd->lex.select= &thd->lex.select_lex;
+ thd->lex.olap=0;
+ thd->lex.select->olap= UNSPECIFIED_OLAP_TYPE;
thd->fatal_error= 0; // Safety
thd->last_insert_id_used= thd->query_start_used= thd->insert_id_used=0;
thd->sent_row_count= thd->examined_row_count= 0;
@@ -2821,11 +2814,13 @@ mysql_init_select(LEX *lex)
SELECT_LEX *select_lex= lex->select;
select_lex->init_select();
select_lex->master_unit()->select_limit= select_lex->select_limit=
- lex->thd->default_select_limit;
+ lex->thd->variables.select_limit;
+ select_lex->olap= UNSPECIFIED_OLAP_TYPE;
lex->exchange= 0;
lex->proc_list.first= 0;
}
+
bool
mysql_new_select(LEX *lex, bool move_down)
{
@@ -2855,6 +2850,7 @@ mysql_new_select(LEX *lex, bool move_down)
return 0;
}
+
void mysql_init_multi_delete(LEX *lex)
{
lex->sql_command= SQLCOM_DELETE_MULTI;
@@ -2865,6 +2861,7 @@ void mysql_init_multi_delete(LEX *lex)
lex->select->init_query();
}
+
void
mysql_parse(THD *thd, char *inBuf, uint length)
{
@@ -2877,7 +2874,8 @@ mysql_parse(THD *thd, char *inBuf, uint length)
LEX *lex=lex_start(thd, (uchar*) inBuf, length);
if (!yyparse() && ! thd->fatal_error)
{
- if (mqh_used && thd->user_connect && check_mqh(thd))
+ if (mqh_used && thd->user_connect &&
+ check_mqh(thd, thd->lex.sql_command))
{
thd->net.error = 0;
}
@@ -2888,7 +2886,11 @@ mysql_parse(THD *thd, char *inBuf, uint length)
}
}
else
+ {
+ DBUG_PRINT("info",("Command aborted. Fatal_error: %d",
+ thd->fatal_error));
query_cache_abort(&thd->net);
+ }
thd->proc_info="freeing items";
free_items(thd); /* Free strings used by items */
lex_end(lex);
@@ -3379,14 +3381,12 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables)
bool result=0;
select_errors=0; /* Write if more errors */
- // TODO: figure out what's up with the commented out line below
- // mysql_log.flush(); // Flush log
if (options & REFRESH_GRANT)
{
acl_reload();
grant_reload();
if (mqh_used)
- reset_mqh(thd,(LEX_USER *) NULL, 0, true);
+ reset_mqh(thd,(LEX_USER *) NULL,true);
}
if (options & REFRESH_LOG)
{
@@ -3436,38 +3436,56 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables)
if (options & REFRESH_SLAVE)
{
LOCK_ACTIVE_MI;
- if (reset_slave(active_mi))
+ if (reset_slave(thd, active_mi))
result=1;
UNLOCK_ACTIVE_MI;
}
if (options & REFRESH_USER_RESOURCES)
- reset_mqh(thd,(LEX_USER *) NULL, 0);
+ reset_mqh(thd,(LEX_USER *) NULL);
return result;
}
+/*
+ kill on thread
+
+ SYNOPSIS
+ kill_one_thread()
+ thd Thread class
+ id Thread id
+
+ NOTES
+ This is written such that we have a short lock on LOCK_thread_count
+*/
+
void kill_one_thread(THD *thd, ulong id)
{
- VOID(pthread_mutex_lock(&LOCK_thread_count)); // For unlink from list
- I_List_iterator<THD> it(threads);
THD *tmp;
uint error=ER_NO_SUCH_THREAD;
+ VOID(pthread_mutex_lock(&LOCK_thread_count)); // For unlink from list
+ I_List_iterator<THD> it(threads);
while ((tmp=it++))
{
if (tmp->thread_id == id)
{
- if ((thd->master_access & PROCESS_ACL) ||
- !strcmp(thd->user,tmp->user))
- {
- tmp->awake(1 /*prepare to die*/);
- error=0;
- }
- else
- error=ER_KILL_DENIED_ERROR;
- break; // Found thread
+ pthread_mutex_lock(&tmp->LOCK_delete); // Lock from delete
+ break;
}
}
VOID(pthread_mutex_unlock(&LOCK_thread_count));
+ if (tmp)
+ {
+ if ((thd->master_access & SUPER_ACL) ||
+ !strcmp(thd->user,tmp->user))
+ {
+ tmp->awake(1 /*prepare to die*/);
+ error=0;
+ }
+ else
+ error=ER_KILL_DENIED_ERROR;
+ pthread_mutex_unlock(&tmp->LOCK_delete);
+ }
+
if (!error)
send_ok(&thd->net);
else
@@ -3514,3 +3532,28 @@ static bool append_file_to_dir(THD *thd, char **filename_ptr, char *table_name)
strxmov(ptr,buff,table_name,NullS);
return 0;
}
+
+/*
+ Check if the select is a simple select (not an union)
+
+ SYNOPSIS
+ check_simple_select()
+
+ RETURN VALUES
+ 0 ok
+ 1 error ; In this case the error messege is sent to the client
+*/
+
+bool check_simple_select()
+{
+ THD *thd= current_thd;
+ if (thd->lex.select != &thd->lex.select_lex)
+ {
+ char command[80];
+ strmake(command, thd->lex.yylval->symbol.str,
+ min(thd->lex.yylval->symbol.length, sizeof(command)-1));
+ net_printf(&thd->net, ER_CANT_USE_OPTION_HERE, command);
+ return 1;
+ }
+ return 0;
+}
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index 305491c7346..049690eb318 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -94,7 +94,7 @@ end:
mysql_update_log.write(thd,thd->query,thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query);
+ Query_log_event qinfo(thd, thd->query, thd->query_length);
mysql_bin_log.write(&qinfo);
}
send_ok(&thd->net);
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index b6c7c98a4cf..628b1775778 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -21,14 +21,13 @@
#include "sql_acl.h"
#include "log_event.h"
#include "mini_client.h"
-#include <thr_alarm.h>
#include <my_dir.h>
#include <assert.h>
extern const char* any_db;
int max_binlog_dump_events = 0; // unlimited
-bool opt_sporadic_binlog_dump_fail = 0;
+my_bool opt_sporadic_binlog_dump_fail = 0;
static int binlog_dump_count = 0;
int check_binlog_magic(IO_CACHE* log, const char** errmsg)
@@ -93,13 +92,17 @@ static int send_file(THD *thd)
char buf[IO_SIZE]; // It's safe to alloc this
DBUG_ENTER("send_file");
- // the client might be slow loading the data, give him wait_timeout to do
- // the job
- old_timeout = thd->net.timeout;
- thd->net.timeout = thd->inactive_timeout;
+ /*
+ The client might be slow loading the data, give him wait_timeout to do
+ the job
+ */
+ old_timeout = thd->net.read_timeout;
+ thd->net.read_timeout = thd->variables.net_wait_timeout;
- // we need net_flush here because the client will not know it needs to send
- // us the file name until it has processed the load event entry
+ /*
+ We need net_flush here because the client will not know it needs to send
+ us the file name until it has processed the load event entry
+ */
if (net_flush(net) || (packet_len = my_net_read(net)) == packet_error)
{
errmsg = "while reading file name";
@@ -138,7 +141,7 @@ static int send_file(THD *thd)
error = 0;
err:
- thd->net.timeout = old_timeout;
+ thd->net.read_timeout = old_timeout;
if (fd >= 0)
(void) my_close(fd, MYF(0));
if (errmsg)
@@ -154,6 +157,7 @@ File open_binlog(IO_CACHE *log, const char *log_file_name,
const char **errmsg)
{
File file;
+ DBUG_ENTER("open_binlog");
if ((file = my_open(log_file_name, O_RDONLY | O_BINARY, MYF(MY_WME))) < 0 ||
init_io_cache(log, file, IO_SIZE*2, READ_CACHE, 0, 0,
@@ -164,7 +168,7 @@ File open_binlog(IO_CACHE *log, const char *log_file_name,
}
if (check_binlog_magic(log,errmsg))
goto err;
- return file;
+ DBUG_RETURN(file);
err:
if (file >= 0)
@@ -172,10 +176,31 @@ err:
my_close(file,MYF(0));
end_io_cache(log);
}
- return -1;
+ DBUG_RETURN(-1);
}
+/*
+ Adjust the position pointer in the binary log file for all running slaves
+
+ SYNOPSIS
+ adjust_linfo_offsets()
+ purge_offset Number of bytes removed from start of log index file
+
+ NOTES
+ - This is called when doing a PURGE when we delete lines from the
+ index log file
+
+ REQUIREMENTS
+ - Before calling this function, we have to ensure that no threads are
+ using any binary log file before purge_offset.a
+
+ TODO
+ - Inform the slave threads that they should sync the position
+ in the binary log file with flush_relay_log_info.
+ Now they sync is done for next read.
+*/
+
void adjust_linfo_offsets(my_off_t purge_offset)
{
THD *tmp;
@@ -189,9 +214,10 @@ void adjust_linfo_offsets(my_off_t purge_offset)
if ((linfo = tmp->current_linfo))
{
pthread_mutex_lock(&linfo->lock);
- /* index file offset can be less that purge offset
- only if we just started reading the index file. In that case
- we have nothing to adjust
+ /*
+ Index file offset can be less that purge offset only if
+ we just started reading the index file. In that case
+ we have nothing to adjust
*/
if (linfo->index_file_offset < purge_offset)
linfo->fatal = (linfo->index_file_offset != 0);
@@ -221,7 +247,8 @@ bool log_in_use(const char* log_name)
pthread_mutex_lock(&linfo->lock);
result = !memcmp(log_name, linfo->log_file_name, log_name_len);
pthread_mutex_unlock(&linfo->lock);
- if (result) break;
+ if (result)
+ break;
}
}
@@ -265,12 +292,16 @@ binlog purge"; break;
return 0;
}
+/*
+ TODO: Clean up loop to only have one call to send_file()
+*/
-void mysql_binlog_send(THD* thd, char* log_ident, ulong pos, ushort flags)
+void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
+ ushort flags)
{
LOG_INFO linfo;
char *log_file_name = linfo.log_file_name;
- char search_file_name[FN_REFLEN];
+ char search_file_name[FN_REFLEN], *name;
IO_CACHE log;
File file = -1;
String* packet = &thd->packet;
@@ -281,66 +312,78 @@ void mysql_binlog_send(THD* thd, char* log_ident, ulong pos, ushort flags)
int left_events = max_binlog_dump_events;
#endif
DBUG_ENTER("mysql_binlog_send");
+ DBUG_PRINT("enter",("log_ident: '%s' pos: %ld", log_ident, (long) pos));
+
bzero((char*) &log,sizeof(log));
#ifndef DBUG_OFF
if (opt_sporadic_binlog_dump_fail && (binlog_dump_count++ % 2))
{
errmsg = "Master failed COM_BINLOG_DUMP to test if slave can recover";
+ my_errno= ER_UNKNOWN_ERROR;
goto err;
}
#endif
-
if (!mysql_bin_log.is_open())
{
errmsg = "Binary log is not open";
+ my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
goto err;
}
if (!server_id_supplied)
{
errmsg = "Misconfigured master - server id was not set";
+ my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
goto err;
}
+ name=search_file_name;
if (log_ident[0])
mysql_bin_log.make_log_name(search_file_name, log_ident);
else
- search_file_name[0] = 0;
+ name=0; // Find first log
linfo.index_file_offset = 0;
thd->current_linfo = &linfo;
- if (mysql_bin_log.find_first_log(&linfo, search_file_name))
+ if (mysql_bin_log.find_log_pos(&linfo, name, 1))
{
- errmsg = "Could not find first log";
+ errmsg = "Could not find first log file name in binary log index file";
+ my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
goto err;
}
if ((file=open_binlog(&log, log_file_name, &errmsg)) < 0)
+ {
+ my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
goto err;
-
- if (pos < 4)
+ }
+ if (pos < BIN_LOG_HEADER_SIZE || pos > my_b_filelength(&log))
{
- errmsg = "Client requested master to start repliction from \
+ errmsg= "Client requested master to start replication from \
impossible position";
+ my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
goto err;
}
my_b_seek(&log, pos); // Seek will done on next read
- packet->length(0);
- // we need to start a packet with something other than 255
- // to distiquish it from error
- packet->append("\0", 1);
+ /*
+ We need to start a packet with something other than 255
+ to distiquish it from error
+ */
+ packet->set("\0", 1);
// if we are at the start of the log
- if (pos == 4)
+ if (pos == BIN_LOG_HEADER_SIZE)
{
// tell the client log name with a fake rotate_event
if (fake_rotate_event(net, packet, log_file_name, &errmsg))
+ {
+ my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
goto err;
- packet->length(0);
- packet->append("\0", 1);
+ }
+ packet->set("\0", 1);
}
while (!net->error && net->vio != 0 && !thd->killed)
@@ -354,12 +397,14 @@ impossible position";
{
net_flush(net);
errmsg = "Debugging binlog dump abort";
+ my_errno= ER_UNKNOWN_ERROR;
goto err;
}
#endif
if (my_net_write(net, (char*)packet->ptr(), packet->length()) )
{
errmsg = "Failed on my_net_write()";
+ my_errno= ER_UNKNOWN_ERROR;
goto err;
}
DBUG_PRINT("info", ("log event code %d",
@@ -369,23 +414,26 @@ impossible position";
if (send_file(thd))
{
errmsg = "failed in send_file()";
+ my_errno= ER_UNKNOWN_ERROR;
goto err;
}
}
- packet->length(0);
- packet->append("\0",1);
+ packet->set("\0", 1);
}
- // TODO: now that we are logging the offset, check to make sure
- // the recorded offset and the actual match
+ /*
+ TODO: now that we are logging the offset, check to make sure
+ the recorded offset and the actual match
+ */
if (error != LOG_READ_EOF)
{
- switch(error) {
+ my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
+ switch (error) {
case LOG_READ_BOGUS:
errmsg = "bogus data in log event";
break;
case LOG_READ_TOO_LARGE:
- errmsg = "log event entry exceeded max_allowed_packet -\
- increase max_allowed_packet on master";
+ errmsg = "log event entry exceeded max_allowed_packet; \
+Increase max_allowed_packet on master";
break;
case LOG_READ_IO:
errmsg = "I/O error reading log event";
@@ -406,18 +454,22 @@ impossible position";
if (!(flags & BINLOG_DUMP_NON_BLOCK) &&
mysql_bin_log.is_active(log_file_name))
{
- // block until there is more data in the log
- // unless non-blocking mode requested
+ /*
+ Block until there is more data in the log
+ */
if (net_flush(net))
{
errmsg = "failed on net_flush()";
+ my_errno= ER_UNKNOWN_ERROR;
goto err;
}
- // we may have missed the update broadcast from the log
- // that has just happened, let's try to catch it if it did
- // if we did not miss anything, we just wait for other threads
- // to signal us
+ /*
+ We may have missed the update broadcast from the log
+ that has just happened, let's try to catch it if it did.
+ If we did not miss anything, we just wait for other threads
+ to signal us.
+ */
{
log.error=0;
bool read_packet = 0, fatal_error = 0;
@@ -425,45 +477,55 @@ impossible position";
#ifndef DBUG_OFF
if (max_binlog_dump_events && !left_events--)
{
- net_flush(net);
errmsg = "Debugging binlog dump abort";
+ my_errno= ER_UNKNOWN_ERROR;
goto err;
}
#endif
- // no one will update the log while we are reading
- // now, but we'll be quick and just read one record
+ /*
+ No one will update the log while we are reading
+ now, but we'll be quick and just read one record
+
+ TODO:
+ Add an counter that is incremented for each time we update
+ the binary log. We can avoid the following read if the counter
+ has not been updated since last read.
+ */
+
pthread_mutex_lock(log_lock);
- switch (Log_event::read_log_event(&log, packet, (pthread_mutex_t*)0))
- {
+ switch (Log_event::read_log_event(&log, packet, (pthread_mutex_t*)0)) {
case 0:
- pthread_mutex_unlock(log_lock);
+ /* we read successfully, so we'll need to send it to the slave */
+ pthread_mutex_unlock(log_lock);
read_packet = 1;
- // we read successfully, so we'll need to send it to the
- // slave
break;
+
case LOG_READ_EOF:
DBUG_PRINT("wait",("waiting for data in binary log"));
- // wait_for_update unlocks the log lock - needed to avoid race
if (!thd->killed)
+ {
+ /* Note that the following call unlocks lock_log */
mysql_bin_log.wait_for_update(thd);
+ }
else
pthread_mutex_unlock(log_lock);
DBUG_PRINT("wait",("binary log received update"));
break;
default:
- pthread_mutex_unlock(log_lock);
+ pthread_mutex_unlock(log_lock);
fatal_error = 1;
break;
}
-
+
if (read_packet)
{
thd->proc_info = "sending update to slave";
if (my_net_write(net, (char*)packet->ptr(), packet->length()) )
{
errmsg = "Failed on my_net_write()";
+ my_errno= ER_UNKNOWN_ERROR;
goto err;
}
@@ -472,18 +534,21 @@ impossible position";
if (send_file(thd))
{
errmsg = "failed in send_file()";
+ my_errno= ER_UNKNOWN_ERROR;
goto err;
}
}
- packet->length(0);
- packet->append("\0",1);
- // no need to net_flush because we will get to flush later when
- // we hit EOF pretty quick
+ packet->set("\0", 1);
+ /*
+ No need to net_flush because we will get to flush later when
+ we hit EOF pretty quick
+ */
}
if (fatal_error)
{
errmsg = "error reading log entry";
+ my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
goto err;
}
log.error=0;
@@ -494,7 +559,7 @@ impossible position";
bool loop_breaker = 0;
// need this to break out of the for loop from switch
thd->proc_info = "switching to next log";
- switch (mysql_bin_log.find_next_log(&linfo)) {
+ switch (mysql_bin_log.find_next_log(&linfo, 1)) {
case LOG_INFO_EOF:
loop_breaker = (flags & BINLOG_DUMP_NON_BLOCK);
break;
@@ -502,6 +567,7 @@ impossible position";
break;
default:
errmsg = "could not find next log";
+ my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
goto err;
}
@@ -515,8 +581,10 @@ impossible position";
// otherwise the slave make get confused about the offset
if ((file=open_binlog(&log, log_file_name, &errmsg)) < 0 ||
fake_rotate_event(net, packet, log_file_name, &errmsg))
+ {
+ my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
goto err;
-
+ }
packet->length(0);
packet->append("\0",1);
}
@@ -535,12 +603,14 @@ impossible position";
err:
thd->proc_info = "waiting to finalize termination";
end_io_cache(&log);
+ /*
+ Exclude iteration through thread list
+ this is needed for purge_logs() - it will iterate through
+ thread list and update thd->current_linfo->index_file_offset
+ this mutex will make sure that it never tried to update our linfo
+ after we return from this stack frame
+ */
pthread_mutex_lock(&LOCK_thread_count);
- // exclude iteration through thread list
- // this is needed for purge_logs() - it will iterate through
- // thread list and update thd->current_linfo->index_file_offset
- // this mutex will make sure that it never tried to update our linfo
- // after we return from this stack frame
thd->current_linfo = 0;
pthread_mutex_unlock(&LOCK_thread_count);
if (file >= 0)
@@ -555,16 +625,19 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
if (!thd) thd = current_thd;
NET* net = &thd->net;
int thread_mask;
+ DBUG_ENTER("start_slave");
- if (check_access(thd, PROCESS_ACL, any_db))
- return 1;
+ if (check_access(thd, SUPER_ACL, any_db))
+ DBUG_RETURN(1);
lock_slave_threads(mi); // this allows us to cleanly read slave_running
init_thread_mask(&thread_mask,mi,1 /* inverse */);
if (thd->lex.slave_thd_opt)
thread_mask &= thd->lex.slave_thd_opt;
if (thread_mask)
{
- if (server_id_supplied && (!mi->inited || (mi->inited && *mi->host)))
+ if (init_master_info(mi,master_info_file,relay_log_info_file, 0))
+ slave_errno=ER_MASTER_INFO;
+ else if (server_id_supplied && *mi->host)
slave_errno = start_slave_threads(0 /*no mutex */,
1 /* wait for start */,
mi,
@@ -582,12 +655,12 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
{
if (net_report)
send_error(net, slave_errno);
- return 1;
+ DBUG_RETURN(1);
}
else if (net_report)
send_ok(net);
- return 0;
+ DBUG_RETURN(0);
}
int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report )
@@ -596,7 +669,7 @@ int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report )
if (!thd) thd = current_thd;
NET* net = &thd->net;
- if (check_access(thd, PROCESS_ACL, any_db))
+ if (check_access(thd, SUPER_ACL, any_db))
return 1;
thd->proc_info = "Killing slave";
int thread_mask;
@@ -622,17 +695,20 @@ int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report )
return 0;
}
-int reset_slave(MASTER_INFO* mi)
+int reset_slave(THD *thd, MASTER_INFO* mi)
{
MY_STAT stat_area;
char fname[FN_REFLEN];
int restart_thread_mask = 0,error=0;
const char* errmsg=0;
-
+ DBUG_ENTER("reset_slave");
+
lock_slave_threads(mi);
init_thread_mask(&restart_thread_mask,mi,0 /* not inverse */);
if ((error=terminate_slave_threads(mi,restart_thread_mask,1 /*skip lock*/))
- || (error=purge_relay_logs(&mi->rli,1 /*just reset*/,&errmsg)))
+ || (error=purge_relay_logs(&mi->rli, thd,
+ 1 /* just reset */,
+ &errmsg)))
goto err;
end_master_info(mi);
@@ -649,14 +725,14 @@ int reset_slave(MASTER_INFO* mi)
goto err;
}
if (restart_thread_mask)
- error=start_slave_threads(0 /* mutex not needed*/,
- 1 /* wait for start*/,
- mi,master_info_file,relay_log_info_file,
- restart_thread_mask);
+ error=start_slave_threads(0 /* mutex not needed */,
+ 1 /* wait for start*/,
+ mi,master_info_file,relay_log_info_file,
+ restart_thread_mask);
// TODO: fix error messages so they get to the client
err:
unlock_slave_threads(mi);
- return error;
+ DBUG_RETURN(error);
}
void kill_zombie_dump_threads(uint32 slave_server_id)
@@ -670,17 +746,21 @@ void kill_zombie_dump_threads(uint32 slave_server_id)
if (tmp->command == COM_BINLOG_DUMP &&
tmp->server_id == slave_server_id)
{
- /*
- Here we do not call kill_one_thread() as
- it will be slow because it will iterate through the list
- again. Plus it double-locks LOCK_tread_count, which
- make safe_mutex complain and abort.
- We just to do kill the thread ourselves.
- */
- tmp->awake(1/*prepare to die*/);
+ pthread_mutex_lock(&tmp->LOCK_delete); // Lock from delete
+ break;
}
}
pthread_mutex_unlock(&LOCK_thread_count);
+ if (tmp)
+ {
+ /*
+ Here we do not call kill_one_thread() as
+ it will be slow because it will iterate through the list
+ again. We just to do kill the thread ourselves.
+ */
+ tmp->awake(1/*prepare to die*/);
+ pthread_mutex_unlock(&tmp->LOCK_delete);
+ }
}
@@ -689,7 +769,8 @@ int change_master(THD* thd, MASTER_INFO* mi)
int error=0,restart_thread_mask;
const char* errmsg=0;
bool need_relay_log_purge=1;
-
+ DBUG_ENTER("change_master");
+
// kill slave thread
lock_slave_threads(mi);
init_thread_mask(&restart_thread_mask,mi,0 /*not inverse*/);
@@ -700,27 +781,28 @@ int change_master(THD* thd, MASTER_INFO* mi)
{
send_error(&thd->net,error);
unlock_slave_threads(mi);
- return 1;
+ DBUG_RETURN(1);
}
thd->proc_info = "changing master";
LEX_MASTER_INFO* lex_mi = &thd->lex.mi;
// TODO: see if needs re-write
- if (init_master_info(mi,master_info_file,relay_log_info_file))
+ if (init_master_info(mi, master_info_file, relay_log_info_file, 0))
{
send_error(&thd->net, 0, "Could not initialize master info");
unlock_slave_threads(mi);
- return 1;
+ DBUG_RETURN(1);
}
- /* data lock not needed since we have already stopped the running threads,
- and we have the hold on the run locks which will keep all threads that
- could possibly modify the data structures from running
+ /*
+ Data lock not needed since we have already stopped the running threads,
+ and we have the hold on the run locks which will keep all threads that
+ could possibly modify the data structures from running
*/
if ((lex_mi->host || lex_mi->port) && !lex_mi->log_file_name && !lex_mi->pos)
{
// if we change host or port, we must reset the postion
mi->master_log_name[0] = 0;
- mi->master_log_pos = 4; // skip magic number
+ mi->master_log_pos= BIN_LOG_HEADER_SIZE;
mi->rli.pending = 0;
}
@@ -729,9 +811,10 @@ int change_master(THD* thd, MASTER_INFO* mi)
sizeof(mi->master_log_name));
if (lex_mi->pos)
{
- mi->master_log_pos = lex_mi->pos;
+ mi->master_log_pos= lex_mi->pos;
mi->rli.pending = 0;
}
+ DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos));
if (lex_mi->host)
strmake(mi->host, lex_mi->host, sizeof(mi->host));
@@ -748,7 +831,7 @@ int change_master(THD* thd, MASTER_INFO* mi)
{
need_relay_log_purge = 0;
mi->rli.skip_log_purge=1;
- strnmov(mi->rli.relay_log_name,lex_mi->relay_log_name,
+ strmake(mi->rli.relay_log_name,lex_mi->relay_log_name,
sizeof(mi->rli.relay_log_name)-1);
}
@@ -763,36 +846,38 @@ int change_master(THD* thd, MASTER_INFO* mi)
{
mi->rli.skip_log_purge=0;
thd->proc_info="purging old relay logs";
- if (purge_relay_logs(&mi->rli,0 /* not only reset, but also reinit*/,
+ if (purge_relay_logs(&mi->rli, thd,
+ 0 /* not only reset, but also reinit */,
&errmsg))
{
net_printf(&thd->net, 0, "Failed purging old relay logs: %s",errmsg);
- return 1;
+ DBUG_RETURN(1);
}
}
else
{
const char* msg;
- if (init_relay_log_pos(&mi->rli,0/*log already inited*/,
- 0 /*pos already inited*/,
+ /* Relay log is already initialized */
+ if (init_relay_log_pos(&mi->rli,
+ mi->rli.relay_log_name,
+ mi->rli.relay_log_pos,
0 /*no data lock*/,
&msg))
{
- //Sasha: note that I had to change net_printf() to make this work
net_printf(&thd->net,0,"Failed initializing relay log position: %s",msg);
unlock_slave_threads(mi);
- return 1;
+ DBUG_RETURN(1);
}
-
}
mi->rli.master_log_pos = mi->master_log_pos;
- strnmov(mi->rli.master_log_name,mi->master_log_name,
- sizeof(mi->rli.master_log_name));
+ DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos));
+ strmake(mi->rli.master_log_name,mi->master_log_name,
+ sizeof(mi->rli.master_log_name)-1);
if (!mi->rli.master_log_name[0]) // uninitialized case
mi->rli.master_log_pos=0;
pthread_mutex_lock(&mi->rli.data_lock);
- mi->rli.abort_pos_wait = 1;
+ mi->rli.abort_pos_wait++;
pthread_cond_broadcast(&mi->data_cond);
pthread_mutex_unlock(&mi->rli.data_lock);
@@ -808,7 +893,7 @@ int change_master(THD* thd, MASTER_INFO* mi)
send_error(&thd->net,error);
else
send_ok(&thd->net);
- return 0;
+ DBUG_RETURN(0);
}
int reset_master(THD* thd)
@@ -848,26 +933,28 @@ int show_binlog_events(THD* thd)
if (mysql_bin_log.is_open())
{
- LOG_INFO linfo;
- char search_file_name[FN_REFLEN];
- LEX_MASTER_INFO* lex_mi = &thd->lex.mi;
+ LEX_MASTER_INFO *lex_mi = &thd->lex.mi;
uint event_count, limit_start, limit_end;
- const char* log_file_name = lex_mi->log_file_name;
- Log_event* ev;
my_off_t pos = lex_mi->pos;
-
+ char search_file_name[FN_REFLEN], *name;
+ const char *log_file_name = lex_mi->log_file_name;
+ pthread_mutex_t *log_lock = mysql_bin_log.get_log_lock();
+ LOG_INFO linfo;
+ Log_event* ev;
+
limit_start = thd->lex.select->offset_limit;
limit_end = thd->lex.select->select_limit + limit_start;
+ name= search_file_name;
if (log_file_name)
mysql_bin_log.make_log_name(search_file_name, log_file_name);
else
- search_file_name[0] = 0;
+ name=0; // Find first log
linfo.index_file_offset = 0;
thd->current_linfo = &linfo;
- if (mysql_bin_log.find_first_log(&linfo, search_file_name))
+ if (mysql_bin_log.find_log_pos(&linfo, name, 1))
{
errmsg = "Could not find target log";
goto err;
@@ -882,7 +969,7 @@ int show_binlog_events(THD* thd)
goto err;
}
- pthread_mutex_lock(mysql_bin_log.get_log_lock());
+ pthread_mutex_lock(log_lock);
my_b_seek(&log, pos);
for (event_count = 0;
@@ -893,7 +980,7 @@ int show_binlog_events(THD* thd)
{
errmsg = "Net error";
delete ev;
- pthread_mutex_unlock(mysql_bin_log.get_log_lock());
+ pthread_mutex_unlock(log_lock);
goto err;
}
@@ -907,11 +994,11 @@ int show_binlog_events(THD* thd)
if (event_count < limit_end && log.error)
{
errmsg = "Wrong offset or I/O error";
- pthread_mutex_unlock(mysql_bin_log.get_log_lock());
+ pthread_mutex_unlock(log_lock);
goto err;
}
- pthread_mutex_unlock(mysql_bin_log.get_log_lock());
+ pthread_mutex_unlock(log_lock);
}
err:
@@ -955,88 +1042,73 @@ int show_binlog_info(THD* thd)
net_store_data(packet, (longlong)li.pos);
net_store_data(packet, &binlog_do_db);
net_store_data(packet, &binlog_ignore_db);
+ if (my_net_write(&thd->net, (char*)thd->packet.ptr(), packet->length()))
+ DBUG_RETURN(-1);
}
- else
- {
- net_store_null(packet);
- net_store_null(packet);
- net_store_null(packet);
- net_store_null(packet);
- }
-
- if (my_net_write(&thd->net, (char*)thd->packet.ptr(), packet->length()))
- DBUG_RETURN(-1);
-
send_eof(&thd->net);
DBUG_RETURN(0);
}
+/*
+ Send a lost of all binary logs to client
+
+ SYNOPSIS
+ show_binlogs()
+ thd Thread specific variable
+
+ RETURN VALUES
+ 0 ok
+ 1 error (Error message sent to client)
+*/
+
int show_binlogs(THD* thd)
{
- const char* errmsg = 0;
- File index_file;
+ const char *errmsg;
+ IO_CACHE *index_file;
char fname[FN_REFLEN];
NET* net = &thd->net;
List<Item> field_list;
- String* packet = &thd->packet;
- IO_CACHE io_cache;
+ String *packet = &thd->packet;
uint length;
if (!mysql_bin_log.is_open())
{
- errmsg = "binlog is not open";
- goto err;
+ //TODO: Replace with ER() error message
+ errmsg= "You are not using binary logging";
+ goto err_with_msg;
}
- field_list.push_back(new Item_empty_string("Log_name", 128));
+ field_list.push_back(new Item_empty_string("Log_name", 255));
if (send_fields(thd, field_list, 1))
- {
- sql_print_error("Failed in send_fields");
return 1;
- }
-
mysql_bin_log.lock_index();
- index_file = mysql_bin_log.get_index_file();
- if (index_file < 0)
- {
- errmsg = "Uninitialized index file pointer";
- goto err2;
- }
- if (init_io_cache(&io_cache, index_file, IO_SIZE, READ_CACHE, 0, 0,
- MYF(MY_WME)))
- {
- errmsg = "Failed on init_io_cache()";
- goto err2;
- }
- while ((length=my_b_gets(&io_cache, fname, sizeof(fname))))
+ index_file=mysql_bin_log.get_index_file();
+
+ reinit_io_cache(index_file, READ_CACHE, (my_off_t) 0, 0, 0);
+
+ /* The file ends with EOF or empty line */
+ while ((length=my_b_gets(index_file, fname, sizeof(fname))) > 1)
{
- fname[--length]=0;
int dir_len = dirname_length(fname);
packet->length(0);
- net_store_data(packet, fname + dir_len, length-dir_len);
+ /* The -1 is for removing newline from fname */
+ net_store_data(packet, fname + dir_len, length-1-dir_len);
if (my_net_write(net, (char*) packet->ptr(), packet->length()))
- {
- sql_print_error("Failed in my_net_write");
- end_io_cache(&io_cache);
- mysql_bin_log.unlock_index();
- return 1;
- }
+ goto err;
}
-
mysql_bin_log.unlock_index();
- end_io_cache(&io_cache);
send_eof(net);
return 0;
-err2:
- mysql_bin_log.unlock_index();
- end_io_cache(&io_cache);
-err:
+err_with_msg:
send_error(net, 0, errmsg);
+err:
+ mysql_bin_log.unlock_index();
return 1;
}
+
int log_loaded_block(IO_CACHE* file)
{
LOAD_FILE_INFO* lf_info;
diff --git a/sql/sql_repl.h b/sql/sql_repl.h
index b15c72a0bde..1d919df7309 100644
--- a/sql/sql_repl.h
+++ b/sql/sql_repl.h
@@ -1,6 +1,3 @@
-#ifndef SQL_REPL_H
-#define SQL_REPL_H
-
#include "slave.h"
typedef struct st_slave_info
@@ -14,20 +11,19 @@ typedef struct st_slave_info
THD* thd;
} SLAVE_INFO;
-extern bool opt_show_slave_auth_info, opt_old_rpl_compat;
+extern my_bool opt_show_slave_auth_info, opt_old_rpl_compat;
extern char* master_host;
extern my_string opt_bin_logname, master_info_file;
-extern uint32 server_id;
extern bool server_id_supplied;
extern I_List<i_string> binlog_do_db, binlog_ignore_db;
extern int max_binlog_dump_events;
-extern bool opt_sporadic_binlog_dump_fail;
+extern my_bool opt_sporadic_binlog_dump_fail;
-#define KICK_SLAVE(thd) thd->awake(0 /* do not prepare to die*/);
+#define KICK_SLAVE(thd) { pthread_mutex_lock(&(thd)->LOCK_delete); (thd)->awake(0 /* do not prepare to die*/); pthread_mutex_unlock(&(thd)->LOCK_delete); }
File open_binlog(IO_CACHE *log, const char *log_file_name,
- const char **errmsg);
+ const char **errmsg);
int start_slave(THD* thd, MASTER_INFO* mi, bool net_report);
int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report);
@@ -35,7 +31,7 @@ int change_master(THD* thd, MASTER_INFO* mi);
int show_binlog_events(THD* thd);
int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1,
const char* log_file_name2, ulonglong log_pos2);
-int reset_slave(MASTER_INFO* mi);
+int reset_slave(THD *thd, MASTER_INFO* mi);
int reset_master(THD* thd);
int purge_master_logs(THD* thd, const char* to_log);
bool log_in_use(const char* log_name);
@@ -58,6 +54,3 @@ typedef struct st_load_file_info
} LOAD_FILE_INFO;
int log_loaded_block(IO_CACHE* file);
-
-#endif
-
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 4e7dbd96127..8a64fbf968c 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -62,7 +62,7 @@ static void update_depend_map(JOIN *join);
static void update_depend_map(JOIN *join, ORDER *order);
static ORDER *remove_const(JOIN *join,ORDER *first_order,COND *cond,
bool *simple_order);
-static int return_zero_rows(select_result *res,TABLE_LIST *tables,
+static int return_zero_rows(JOIN *join, select_result *res,TABLE_LIST *tables,
List<Item> &fields, bool send_row,
uint select_options, const char *info,
Item *having, Procedure *proc,
@@ -144,7 +144,7 @@ static void init_sum_functions(Item_sum **func);
static bool update_sum_func(Item_sum **func);
static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
bool distinct, const char *message=NullS);
-static void describe_info(THD *thd, const char *info);
+static void describe_info(JOIN *join, const char *info);
/*
This handles SELECT with and without UNION
@@ -164,9 +164,35 @@ int handle_select(THD *thd, LEX *lex, select_result *result)
for (TABLE_LIST *cursor= (TABLE_LIST *)sl->table_list.first;
cursor;
cursor=cursor->next)
- cursor->table= cursor->table_list->table;
+ {
+ if (cursor->do_redirect) // False if CUBE/ROLLUP
+ {
+ cursor->do_redirect=false;
+ cursor->table= ((TABLE_LIST*) cursor->table)->table;
+ }
+ }
}
}
+
+#ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1
+ if (lex->olap)
+ {
+ SELECT_LEX *sl, *sl_next;
+ int error;
+ for (sl= &select_lex; sl; sl=sl_next)
+ {
+ sl_next=sl->next; // Save if sl->next changes
+ if (sl->olap != UNSPECIFIED_OLAP_TYPE)
+ {
+ if ((error=handle_olaps(lex,sl)))
+ return error;
+ lex->last_selects->next=sl_next;
+ }
+ }
+ lex->select = select_lex;
+ }
+#endif /* DISABLED_UNTIL_REWRITTEN_IN_4_1 */
+
if (select_lex->next_select())
res=mysql_union(thd,lex,result);
else
@@ -187,8 +213,8 @@ int handle_select(THD *thd, LEX *lex, select_result *result)
/*****************************************************************************
-** check fields, find best join, do the select and output fields.
-** mysql_select assumes that all tables are already opened
+ Check fields, find best join, do the select and output fields.
+ mysql_select assumes that all tables are already opened
*****************************************************************************/
/*
@@ -198,9 +224,10 @@ int handle_select(THD *thd, LEX *lex, select_result *result)
*/
int
JOIN::prepare(TABLE_LIST *tables_init,
- COND *conds_init, ORDER *order_init, ORDER *group_init,
- Item *having_init,
- ORDER *proc_param_init, SELECT_LEX *select, SELECT_LEX_UNIT *unit)
+ COND *conds_init, ORDER *order_init, ORDER *group_init,
+ Item *having_init,
+ ORDER *proc_param_init, SELECT_LEX *select_lex,
+ SELECT_LEX_UNIT *unit)
{
DBUG_ENTER("JOIN::prepare");
@@ -210,7 +237,6 @@ JOIN::prepare(TABLE_LIST *tables_init,
having= having_init;
proc_param= proc_param_init;
tables_list= tables_init;
- select_lex= select;
select->join= this;
union_part= (unit->first_select()->next_select() != 0);
@@ -243,7 +269,7 @@ JOIN::prepare(TABLE_LIST *tables_init,
and no GROUP BY.
TODO: Add check of calculation of GROUP functions and fields:
SELECT COUNT(*)+table.col1 from table1;
- */
+ */
{
if (!group_list)
{
@@ -382,11 +408,7 @@ JOIN::optimize()
}
if (select_options & SELECT_DESCRIBE)
{
- if (union_part)
- select_describe(this, false, false, false,
- "Select tables optimized away");
- else
- describe_info(thd, "Select tables optimized away");
+ describe_info(this, "Select tables optimized away");
delete procedure;
DBUG_RETURN(1);
}
@@ -429,7 +451,7 @@ JOIN::optimize()
DBUG_RETURN(0);
}
if (!(thd->options & OPTION_BIG_SELECTS) &&
- best_read > (double) thd->max_join_size &&
+ best_read > (double) thd->variables.max_join_size &&
!(select_options & SELECT_DESCRIBE))
{ /* purecov: inspected */
result->send_error(ER_TOO_BIG_SELECT,ER(ER_TOO_BIG_SELECT)); /* purecov: inspected */
@@ -530,9 +552,19 @@ JOIN::optimize()
simple_order=0;
}
+ /*
+ Check if we need to create a temporary table.
+ This has to be done if all tables are not already read (const tables)
+ and one of the following conditions holds:
+ - We are using DISTINCT (simple distinct's are already optimized away)
+ - We are using an ORDER BY or GROUP BY on fields not in the first table
+ - We are using different ORDER BY and GROUP BY orders
+ - The user wants us to buffer the result.
+ */
need_tmp= (const_tables != tables &&
((select_distinct || !simple_order || !simple_group) ||
- (group_list && order) || buffer_result));
+ (group_list && order) ||
+ test(select_options & OPTION_BUFFER_RESULT)));
// No cache for MATCH
make_join_readinfo(this,
@@ -541,11 +573,13 @@ JOIN::optimize()
(thd->lex.select->ftfunc_list.elements ?
SELECT_NO_JOIN_CACHE : 0));
- /* Need to tell Innobase that to play it safe, it should fetch all
- columns of the tables: this is because MySQL
- may build row pointers for the rows, and for all columns of the primary
- key the field->query_id has not necessarily been set to thd->query_id
- by MySQL. */
+ /*
+ Need to tell Innobase that to play it safe, it should fetch all
+ columns of the tables: this is because MySQL may build row
+ pointers for the rows, and for all columns of the primary key the
+ field->query_id has not necessarily been set to thd->query_id by
+ MySQL.
+ */
#ifdef HAVE_INNOBASE_DB
if (need_tmp || select_distinct || group_list || order)
@@ -639,12 +673,7 @@ JOIN::exec()
{ // Only test of functions
error=0;
if (select_options & SELECT_DESCRIBE)
- {
- if (union_part)
- select_describe(this, false, false, false, "No tables used");
- else
- describe_info(thd, "No tables used");
- }
+ describe_info(this, "No tables used");
else
{
result->send_fields(fields_list,1);
@@ -667,16 +696,13 @@ JOIN::exec()
if (zero_result_cause)
{
- if (select_options & SELECT_DESCRIBE && union_part)
- select_describe(this, false, false, false, zero_result_cause);
- else
- error=return_zero_rows(result, tables_list, fields_list,
- tmp_table_param.sum_func_count != 0 &&
- !group_list,
- select_options,
- zero_result_cause,
- having,procedure,
- unit);
+ (void) return_zero_rows(this, result, tables_list, fields_list,
+ tmp_table_param.sum_func_count != 0 &&
+ !group_list,
+ select_options,
+ zero_result_cause,
+ having,procedure,
+ unit);
DBUG_VOID_RETURN;
}
@@ -712,6 +738,8 @@ JOIN::exec()
DBUG_PRINT("info",("Creating tmp table"));
thd->proc_info="Creating tmp table";
+ tmp_table_param.hidden_field_count= (all_fields.elements-
+ fields.elements);
if (!(exec_tmp_table =
create_tmp_table(thd, &tmp_table_param, all_fields,
((!simple_group && !procedure &&
@@ -816,11 +844,11 @@ JOIN::exec()
}
/*
- ** If we have different sort & group then we must sort the data by group
- ** and copy it to another tmp table
- ** This code is also used if we are using distinct something
- ** we haven't been able to store in the temporary table yet
- ** like SEC_TO_TIME(SUM(...)).
+ If we have different sort & group then we must sort the data by group
+ and copy it to another tmp table
+ This code is also used if we are using distinct something
+ we haven't been able to store in the temporary table yet
+ like SEC_TO_TIME(SUM(...)).
*/
if (group_list && (!test_if_subpart(group_list,order) ||
@@ -1009,8 +1037,7 @@ mysql_select(THD *thd, TABLE_LIST *tables, List<Item> &fields, COND *conds,
{
DBUG_RETURN(-1);
}
- switch(join->optimize())
- {
+ switch (join->optimize()) {
case 1:
DBUG_RETURN(join->error);
case -1:
@@ -1032,8 +1059,8 @@ err:
}
/*****************************************************************************
-** Create JOIN_TABS, make a guess about the table types,
-** Approximate how many records will be used in each table
+ Create JOIN_TABS, make a guess about the table types,
+ Approximate how many records will be used in each table
*****************************************************************************/
static ha_rows get_quick_record_count(SQL_SELECT *select,TABLE *table,
@@ -1353,11 +1380,11 @@ make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds,
/*****************************************************************************
-** check with keys are used and with tables references with tables
-** updates in stat:
-** keys Bitmap of all used keys
-** const_keys Bitmap of all keys with may be used with quick_select
-** keyuse Pointer to possible keys
+ Check with keys are used and with tables references with tables
+ Updates in stat:
+ keys Bitmap of all used keys
+ const_keys Bitmap of all keys with may be used with quick_select
+ keyuse Pointer to possible keys
*****************************************************************************/
typedef struct key_field_t { // Used when finding key fields
@@ -1589,8 +1616,8 @@ add_key_fields(JOIN_TAB *stat,KEY_FIELD **key_fields,uint *and_level,
}
/*
-** Add all keys with uses 'field' for some keypart
-** If field->and_level != and_level then only mark key_part as const_part
+ Add all keys with uses 'field' for some keypart
+ If field->and_level != and_level then only mark key_part as const_part
*/
static uint
@@ -1725,9 +1752,9 @@ sort_keyuse(KEYUSE *a,KEYUSE *b)
/*
-** Update keyuse array with all possible keys we can use to fetch rows
-** join_tab is a array in tablenr_order
-** stat is a reference array in 'prefered' order.
+ Update keyuse array with all possible keys we can use to fetch rows
+ join_tab is a array in tablenr_order
+ stat is a reference array in 'prefered' order.
*/
static bool
@@ -1766,9 +1793,9 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
}
/*
- ** remove ref if there is a keypart which is a ref and a const.
- ** remove keyparts without previous keyparts.
- ** Special treatment for ft-keys.
+ Remove ref if there is a keypart which is a ref and a const.
+ Remove keyparts without previous keyparts.
+ Special treatment for ft-keys.
*/
if (keyuse->elements)
{
@@ -1818,8 +1845,8 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
/*****************************************************************************
-** Go through all combinations of not marked tables and find the one
-** which uses least records
+ Go through all combinations of not marked tables and find the one
+ which uses least records
*****************************************************************************/
/* Save const tables first as used tables */
@@ -1834,7 +1861,7 @@ set_position(JOIN *join,uint idx,JOIN_TAB *table,KEYUSE *key)
/* Move the const table as down as possible in best_ref */
JOIN_TAB **pos=join->best_ref+idx+1;
JOIN_TAB *next=join->best_ref[idx];
- for ( ;next != table ; pos++)
+ for (;next != table ; pos++)
{
JOIN_TAB *tmp=pos[0];
pos[0]=next;
@@ -1860,6 +1887,7 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
{
ulong rec;
double tmp;
+ THD *thd= join->thd;
if (!rest_tables)
{
@@ -1925,12 +1953,12 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
found_ref|= keyuse->used_tables;
}
/*
- ** If we find a ref, assume this table matches a proportional
- ** part of this table.
- ** For example 100 records matching a table with 5000 records
- ** gives 5000/100 = 50 records per key
- ** Constant tables are ignored and to avoid bad matches,
- ** we don't make rec less than 100.
+ If we find a ref, assume this table matches a proportional
+ part of this table.
+ For example 100 records matching a table with 5000 records
+ gives 5000/100 = 50 records per key
+ Constant tables are ignored and to avoid bad matches,
+ we don't make rec less than 100.
*/
if (keyuse->used_tables &
(map=(keyuse->used_tables & ~join->const_table_map)))
@@ -1951,7 +1979,7 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
} while (keyuse->table == table && keyuse->key == key);
/*
- ** Assume that that each key matches a proportional part of table.
+ Assume that that each key matches a proportional part of table.
*/
if (!found_part && !ft_key)
continue; // Nothing usable found
@@ -1959,13 +1987,13 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
rec=1L; // Fix for small tables
/*
- ** ft-keys require special treatment
+ ft-keys require special treatment
*/
if (ft_key)
{
/*
- ** Really, there should be records=0.0 (yes!)
- ** but 1.0 would be probably safer
+ Really, there should be records=0.0 (yes!)
+ but 1.0 would be probably safer
*/
tmp=prev_record_reads(join,found_ref);
records=1.0;
@@ -1973,7 +2001,7 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
else
{
/*
- ** Check if we found full key
+ Check if we found full key
*/
if (found_part == PREV_BITS(uint,keyinfo->key_parts))
{ /* use eq key */
@@ -2020,17 +2048,18 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
else
{
/*
- ** Use as much key-parts as possible and a uniq key is better
- ** than a not unique key
- ** Set tmp to (previous record count) * (records / combination)
+ Use as much key-parts as possible and a uniq key is better
+ than a not unique key
+ Set tmp to (previous record count) * (records / combination)
*/
if ((found_part & 1) &&
!(table->file->index_flags(key) & HA_ONLY_WHOLE_INDEX))
{
max_key_part=max_part_bit(found_part);
- /* Check if quick_range could determinate how many rows we
- will match */
-
+ /*
+ Check if quick_range could determinate how many rows we
+ will match
+ */
if (table->quick_keys & ((key_map) 1 << key) &&
table->quick_key_parts[key] <= max_key_part)
tmp=records= (double) table->quick_rows[key];
@@ -2042,18 +2071,18 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
else
{
/*
- ** Assume that the first key part matches 1% of the file
- ** and that the hole key matches 10 (dupplicates) or 1
- ** (unique) records.
- ** Assume also that more key matches proportionally more
- ** records
- ** This gives the formula:
- ** records= (x * (b-a) + a*c-b)/(c-1)
- **
- ** b = records matched by whole key
- ** a = records matched by first key part (10% of all records?)
- ** c = number of key parts in key
- ** x = used key parts (1 <= x <= c)
+ Assume that the first key part matches 1% of the file
+ and that the hole key matches 10 (dupplicates) or 1
+ (unique) records.
+ Assume also that more key matches proportionally more
+ records
+ This gives the formula:
+ records= (x * (b-a) + a*c-b)/(c-1)
+
+ b = records matched by whole key
+ a = records matched by first key part (10% of all records?)
+ c = number of key parts in key
+ x = used key parts (1 <= x <= c)
*/
double rec_per_key;
if (!(rec_per_key=(double)
@@ -2125,7 +2154,8 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
tmp=(double) s->read_time;
/* Calculate time to read through cache */
tmp*=(1.0+floor((double) cache_record_length(join,idx)*
- record_count/(double) join_buff_size));
+ record_count /
+ (double) thd->variables.join_buff_size));
}
if (best == DBL_MAX ||
(tmp + record_count/(double) TIME_FOR_COMPARE*s->found_records <
@@ -2177,7 +2207,7 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
/*
-** Find how much space the prevous read not const tables takes in cache
+ Find how much space the prevous read not const tables takes in cache
*/
static void calc_used_field_length(THD *thd, JOIN_TAB *join_tab)
@@ -2253,7 +2283,7 @@ prev_record_reads(JOIN *join,table_map found_ref)
/*****************************************************************************
-** Set up join struct according to best position.
+ Set up join struct according to best position.
*****************************************************************************/
static bool
@@ -2319,7 +2349,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
KEY *keyinfo;
/*
- ** Use best key from find_best
+ Use best key from find_best
*/
table=j->table;
key=keyuse->key;
@@ -2468,8 +2498,8 @@ get_store_key(THD *thd, KEYUSE *keyuse, table_map used_tables,
}
/*
-** This function is only called for const items on fields which are keys
-** returns 1 if there was some conversion made when the field was stored.
+ This function is only called for const items on fields which are keys
+ returns 1 if there was some conversion made when the field was stored.
*/
bool
@@ -2747,7 +2777,7 @@ make_join_readinfo(JOIN *join, uint options)
break;
case JT_ALL:
/*
- ** if previous table use cache
+ If previous table use cache
*/
table->status=STATUS_NO_RECORD;
if (i != join->const_tables && !(options & SELECT_NO_JOIN_CACHE) &&
@@ -2861,8 +2891,10 @@ join_free(JOIN *join)
if (!join->select_lex->depended)
join->table=0;
}
- // We are not using tables anymore
- // Unlock all tables. We may be in an INSERT .... SELECT statement.
+ /*
+ We are not using tables anymore
+ Unlock all tables. We may be in an INSERT .... SELECT statement.
+ */
if (join->lock && join->thd->lock &&
!(join->select_options & SELECT_NO_UNLOCK))
{
@@ -2879,19 +2911,19 @@ join_free(JOIN *join)
/*****************************************************************************
-** Remove the following expressions from ORDER BY and GROUP BY:
-** Constant expressions
-** Expression that only uses tables that are of type EQ_REF and the reference
-** is in the ORDER list or if all refereed tables are of the above type.
-**
-** In the following, the X field can be removed:
-** SELECT * FROM t1,t2 WHERE t1.a=t2.a ORDER BY t1.a,t2.X
-** SELECT * FROM t1,t2,t3 WHERE t1.a=t2.a AND t2.b=t3.b ORDER BY t1.a,t3.X
-**
-** These can't be optimized:
-** SELECT * FROM t1,t2 WHERE t1.a=t2.a ORDER BY t2.X,t1.a
-** SELECT * FROM t1,t2 WHERE t1.a=t2.a AND t1.b=t2.b ORDER BY t1.a,t2.c
-** SELECT * FROM t1,t2 WHERE t1.a=t2.a ORDER BY t2.b,t1.a
+ Remove the following expressions from ORDER BY and GROUP BY:
+ Constant expressions
+ Expression that only uses tables that are of type EQ_REF and the reference
+ is in the ORDER list or if all refereed tables are of the above type.
+
+ In the following, the X field can be removed:
+ SELECT * FROM t1,t2 WHERE t1.a=t2.a ORDER BY t1.a,t2.X
+ SELECT * FROM t1,t2,t3 WHERE t1.a=t2.a AND t2.b=t3.b ORDER BY t1.a,t3.X
+
+ These can't be optimized:
+ SELECT * FROM t1,t2 WHERE t1.a=t2.a ORDER BY t2.X,t1.a
+ SELECT * FROM t1,t2 WHERE t1.a=t2.a AND t1.b=t2.b ORDER BY t1.a,t2.c
+ SELECT * FROM t1,t2 WHERE t1.a=t2.a ORDER BY t2.b,t1.a
*****************************************************************************/
static bool
@@ -2931,7 +2963,7 @@ eq_ref_table(JOIN *join, ORDER *start_order, JOIN_TAB *tab)
}
}
/* Check that there was no reference to table before sort order */
- for ( ; found && start_order ; start_order=start_order->next)
+ for (; found && start_order ; start_order=start_order->next)
{
if (start_order->used & map)
{
@@ -2949,7 +2981,7 @@ static bool
only_eq_ref_tables(JOIN *join,ORDER *order,table_map tables)
{
if (specialflag & SPECIAL_SAFE_MODE)
- return 0; // skip this optimize /* purecov: inspected */
+ return 0; // skip this optimize /* purecov: inspected */
for (JOIN_TAB **tab=join->map2table ; tables ; tab++, tables>>=1)
{
if (tables & 1 && !eq_ref_table(join, order, *tab))
@@ -2965,7 +2997,7 @@ static void update_depend_map(JOIN *join)
{
JOIN_TAB *join_tab=join->join_tab, *end=join_tab+join->tables;
- for ( ; join_tab != end ; join_tab++)
+ for (; join_tab != end ; join_tab++)
{
TABLE_REF *ref= &join_tab->ref;
table_map depend_map=0;
@@ -2989,7 +3021,7 @@ static void update_depend_map(JOIN *join)
static void update_depend_map(JOIN *join, ORDER *order)
{
- for ( ; order ; order=order->next)
+ for (; order ; order=order->next)
{
table_map depend_map;
order->item[0]->update_used_tables();
@@ -3072,16 +3104,18 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order)
DBUG_RETURN(first_order);
}
+
static int
-return_zero_rows(select_result *result,TABLE_LIST *tables,List<Item> &fields,
- bool send_row, uint select_options,const char *info,
- Item *having, Procedure *procedure, SELECT_LEX_UNIT *unit)
+return_zero_rows(JOIN *join, select_result *result,TABLE_LIST *tables,
+ List<Item> &fields, bool send_row, uint select_options,
+ const char *info, Item *having, Procedure *procedure,
+ SELECT_LEX_UNIT *unit)
{
DBUG_ENTER("return_zero_rows");
if (select_options & SELECT_DESCRIBE)
{
- describe_info(current_thd, info);
+ describe_info(join, info);
DBUG_RETURN(0);
}
if (procedure)
@@ -3119,12 +3153,12 @@ static void clear_tables(JOIN *join)
}
/*****************************************************************************
-** Make som simple condition optimization:
-** If there is a test 'field = const' change all refs to 'field' to 'const'
-** Remove all dummy tests 'item = item', 'const op const'.
-** Remove all 'item is NULL', when item can never be null!
-** item->marker should be 0 for all items on entry
-** Return in cond_value FALSE if condition is impossible (1 = 2)
+ Make som simple condition optimization:
+ If there is a test 'field = const' change all refs to 'field' to 'const'
+ Remove all dummy tests 'item = item', 'const op const'.
+ Remove all 'item is NULL', when item can never be null!
+ item->marker should be 0 for all items on entry
+ Return in cond_value FALSE if condition is impossible (1 = 2)
*****************************************************************************/
class COND_CMP :public ilink {
@@ -3146,8 +3180,8 @@ template class List_iterator<Item_func_match>;
#endif
/*
-** change field = field to field = const for each found field = const in the
-** and_level
+ change field = field to field = const for each found field = const in the
+ and_level
*/
static void
@@ -3292,8 +3326,8 @@ optimize_cond(COND *conds,Item::cond_result *cond_value)
DBUG_EXECUTE("where",print_where(conds,"original"););
propagate_cond_constants((I_List<COND_CMP> *) 0,conds,conds);
/*
- ** Remove all instances of item == item
- ** Remove all and-levels where CONST item != CONST item
+ Remove all instances of item == item
+ Remove all and-levels where CONST item != CONST item
*/
DBUG_EXECUTE("where",print_where(conds,"after const change"););
conds=remove_eq_conds(conds,cond_value) ;
@@ -3303,11 +3337,11 @@ optimize_cond(COND *conds,Item::cond_result *cond_value)
/*
-** remove const and eq items. Return new item, or NULL if no condition
-** cond_value is set to according:
-** COND_OK query is possible (field = constant)
-** COND_TRUE always true ( 1 = 1 )
-** COND_FALSE always false ( 1 = 2 )
+ Remove const and eq items. Return new item, or NULL if no condition
+ cond_value is set to according:
+ COND_OK query is possible (field = constant)
+ COND_TRUE always true ( 1 = 1 )
+ COND_FALSE always false ( 1 = 2 )
*/
static COND *
@@ -3445,7 +3479,7 @@ remove_eq_conds(COND *cond,Item::cond_result *cond_value)
}
/*
-** Return 1 if the item is a const value in all the WHERE clause
+ Return 1 if the item is a const value in all the WHERE clause
*/
static bool
@@ -3504,10 +3538,10 @@ const_expression_in_where(COND *cond, Item *comp_item, Item **const_item)
/****************************************************************************
-** Create a temp table according to a field list.
-** Set distinct if duplicates could be removed
-** Given fields field pointers are changed to point at tmp_table
-** for send_fields
+ Create a temp table according to a field list.
+ Set distinct if duplicates could be removed
+ Given fields field pointers are changed to point at tmp_table
+ for send_fields
****************************************************************************/
Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
@@ -3803,7 +3837,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
field_count= (uint) (reg_field - table->field);
/* If result table is small; use a heap */
- if (blob_count || using_unique_constraint ||
+ if (blob_count || using_unique_constraint || group_null_items ||
(select_options & (OPTION_BIG_TABLES | SELECT_SMALL_RESULT)) ==
OPTION_BIG_TABLES)
{
@@ -3825,7 +3859,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
if (blob_count == 0)
{
/* We need to ensure that first byte is not 0 for the delete link */
- if (hidden_null_count)
+ if (param->hidden_field_count)
hidden_null_count++;
else
null_count++;
@@ -3920,12 +3954,13 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
param->recinfo=recinfo;
store_record(table,2); // Make empty default record
- if (tmp_table_size == ~(ulong) 0) // No limit
+ if (thd->variables.tmp_table_size == ~(ulong) 0) // No limit
table->max_rows= ~(ha_rows) 0;
else
table->max_rows=(((table->db_type == DB_TYPE_HEAP) ?
- min(tmp_table_size, max_heap_table_size) :
- tmp_table_size)/ table->reclength);
+ min(thd->variables.tmp_table_size,
+ thd->variables.max_heap_table_size) :
+ thd->variables.tmp_table_size)/ table->reclength);
set_if_bigger(table->max_rows,1); // For dummy start options
keyinfo=param->keyinfo;
@@ -3973,7 +4008,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
key_part_info->null_offset= (uint) (field->null_ptr -
(uchar*) table->record[0]);
group->field->move_field((char*) ++group->buff);
- ++group_buff;
+ group_buff++;
}
else
group->field->move_field((char*) group_buff);
@@ -3991,6 +4026,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
'param->hidden_field_count' extra columns, whose null bits are stored
in the first 'hidden_null_pack_length' bytes of the row.
*/
+ DBUG_PRINT("info",("hidden_field_count: %d", param->hidden_field_count));
+
null_pack_length-=hidden_null_pack_length;
keyinfo->key_parts= ((field_count-param->hidden_field_count)+
test(null_pack_length));
@@ -4013,7 +4050,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
goto err;
table->key_info=keyinfo;
keyinfo->key_part=key_part_info;
- keyinfo->flags=HA_NOSAME;
+ keyinfo->flags=HA_NOSAME | HA_NULL_ARE_EQUAL;
keyinfo->key_length=(uint16) reclength;
keyinfo->name=(char*) "tmp";
if (null_pack_length)
@@ -4320,7 +4357,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
join->procedure=procedure;
/*
- ** Tell the client how many fields there are in a row
+ Tell the client how many fields there are in a row
*/
if (!table)
join->result->send_fields(*fields,1);
@@ -4405,7 +4442,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
}
if (table)
{
- int old_error=error,tmp;
+ int tmp;
if ((tmp=table->file->extra(HA_EXTRA_NO_CACHE)))
{
my_errno=tmp;
@@ -4582,10 +4619,9 @@ flush_cached_records(JOIN *join,JOIN_TAB *join_tab,bool skipp_last)
/*****************************************************************************
-** The different ways to read a record
-** Returns -1 if row was not found, 0 if row was found and 1 on errors
+ The different ways to read a record
+ Returns -1 if row was not found, 0 if row was found and 1 on errors
*****************************************************************************/
-
static int
join_read_const_table(JOIN_TAB *tab, POSITION *pos)
{
@@ -4929,7 +4965,8 @@ join_read_last(JOIN_TAB *tab)
{
TABLE *table=tab->table;
int error;
- if (!table->key_read && (table->used_keys & ((key_map) 1 << tab->index)))
+ if (!table->key_read && (table->used_keys & ((key_map) 1 << tab->index)) &&
+ !table->no_keyread)
{
table->key_read=1;
table->file->extra(HA_EXTRA_KEYREAD);
@@ -5022,12 +5059,12 @@ join_ft_read_next(READ_RECORD *info)
/*****************************************************************************
-** The different end of select functions
-** These functions returns < 0 when end is reached, 0 on ok and > 0 if a
-** fatal error (like table corruption) was detected
+ The different end of select functions
+ These functions returns < 0 when end is reached, 0 on ok and > 0 if a
+ fatal error (like table corruption) was detected
*****************************************************************************/
- /* ARGSUSED */
+/* ARGSUSED */
static int
end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
bool end_of_records)
@@ -5053,12 +5090,24 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
JOIN_TAB *jt=join->join_tab;
if ((join->tables == 1) && !join->tmp_table && !join->sort_and_group
&& !join->send_group_parts && !join->having && !jt->select_cond &&
+ !(jt->select && jt->select->quick) &&
!(jt->table->file->table_flags() & HA_NOT_EXACT_COUNT))
{
/* Join over all rows in table; Return number of found rows */
+ TABLE *table=jt->table;
+
join->select_options ^= OPTION_FOUND_ROWS;
- jt->table->file->info(HA_STATUS_VARIABLE);
- join->send_records = jt->table->file->records;
+ if (table->record_pointers ||
+ (table->io_cache && my_b_inited(table->io_cache)))
+ {
+ /* Using filesort */
+ join->send_records= table->found_records;
+ }
+ else
+ {
+ table->file->info(HA_STATUS_VARIABLE);
+ join->send_records = table->file->records;
+ }
}
else
{
@@ -5204,7 +5253,7 @@ end_write(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
error == HA_ERR_FOUND_DUPP_UNIQUE)
goto end;
if (create_myisam_from_heap(table, &join->tmp_table_param, error,1))
- DBUG_RETURN(1); // Not a table_is_full error
+ DBUG_RETURN(-1); // Not a table_is_full error
table->uniques=0; // To ensure rows are the same
}
if (++join->send_records >= join->tmp_table_param.end_write_records &&
@@ -5376,7 +5425,7 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
{
if (create_myisam_from_heap(table, &join->tmp_table_param,
error, 0))
- DBUG_RETURN(1); // Not a table_is_full error
+ DBUG_RETURN(-1); // Not a table_is_full error
}
else
join->send_records++;
@@ -5409,11 +5458,11 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
/*****************************************************************************
-** Remove calculation with tables that aren't yet read. Remove also tests
-** against fields that are read through key where the table is not a
-** outer join table.
-** We can't remove tests that are made against columns which are stored
-** in sorted order.
+ Remove calculation with tables that aren't yet read. Remove also tests
+ against fields that are read through key where the table is not a
+ outer join table.
+ We can't remove tests that are made against columns which are stored
+ in sorted order.
*****************************************************************************/
/* Return 1 if right_item is used removable reference key on left_item */
@@ -5431,8 +5480,10 @@ static bool test_if_ref(Item_field *left_item,Item *right_item)
return (field->eq_def(((Item_field *) right_item)->field));
if (right_item->const_item() && !(right_item->is_null()))
{
- // We can remove binary fields and numerical fields except float,
- // as float comparison isn't 100 % secure
+ /*
+ We can remove binary fields and numerical fields except float,
+ as float comparison isn't 100 % secure
+ */
if (field->binary() &&
(field->type() != FIELD_TYPE_FLOAT || field->decimals() == 0))
{
@@ -5496,9 +5547,9 @@ make_cond_for_table(COND *cond,table_map tables,table_map used_table)
}
/*
- ** Because the following test takes a while and it can be done
- ** table_count times, we mark each item that we have examined with the result
- ** of the test
+ Because the following test takes a while and it can be done
+ table_count times, we mark each item that we have examined with the result
+ of the test
*/
if (cond->marker == 3 || (cond->used_tables() & ~tables))
@@ -5546,11 +5597,11 @@ part_of_refkey(TABLE *table,Field *field)
/*****************************************************************************
-** Test if one can use the key to resolve ORDER BY
-** Returns: 1 if key is ok.
-** 0 if key can't be used
-** -1 if reverse key can be used
-** used_key_parts is set to key parts used if length != 0
+ Test if one can use the key to resolve ORDER BY
+ Returns: 1 if key is ok.
+ 0 if key can't be used
+ -1 if reverse key can be used
+ used_key_parts is set to key parts used if length != 0
*****************************************************************************/
static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx,
@@ -5817,7 +5868,7 @@ err:
}
/*
-** Add the HAVING criteria to table->select
+ Add the HAVING criteria to table->select
*/
#ifdef NOT_YET
@@ -5852,11 +5903,11 @@ static bool fix_having(JOIN *join, Item **having)
/*****************************************************************************
-** Remove duplicates from tmp table
-** This should be recoded to add a uniuqe index to the table and remove
-** dupplicates
-** Table is a locked single thread table
-** fields is the number of fields to check (from the end)
+ Remove duplicates from tmp table
+ This should be recoded to add a unique index to the table and remove
+ duplicates
+ Table is a locked single thread table
+ fields is the number of fields to check (from the end)
*****************************************************************************/
static bool compare_record(TABLE *table, Field **ptr)
@@ -5896,6 +5947,7 @@ remove_duplicates(JOIN *join, TABLE *entry,List<Item> &fields, Item *having)
int error;
ulong reclength,offset;
uint field_count;
+ THD *thd= current_thd;
DBUG_ENTER("remove_duplicates");
entry->reginfo.lock_type=TL_WRITE;
@@ -5924,7 +5976,7 @@ remove_duplicates(JOIN *join, TABLE *entry,List<Item> &fields, Item *having)
if (entry->db_type == DB_TYPE_HEAP ||
(!entry->blob_fields &&
((ALIGN_SIZE(reclength) +sizeof(HASH_LINK)) * entry->file->records <
- sortbuff_size)))
+ thd->variables.sortbuff_size)))
error=remove_dup_with_hash_index(join->thd, entry,
field_count, first_field,
reclength, having);
@@ -6247,7 +6299,7 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
cache->length=length+blobs*sizeof(char*);
cache->blobs=blobs;
*blob_ptr=0; /* End sequentel */
- size=max(join_buff_size,cache->length);
+ size=max(thd->variables.join_buff_size, cache->length);
if (!(cache->buff=(uchar*) my_malloc(size,MYF(0))))
DBUG_RETURN(1); /* Don't use cache */ /* purecov: inspected */
cache->end=cache->buff+size;
@@ -6288,7 +6340,7 @@ store_record_in_cache(JOIN_CACHE *cache)
cache->ptr_record=cache->records;
/*
- ** There is room in cache. Put record there
+ There is room in cache. Put record there
*/
cache->records++;
for (copy=cache->field ; copy < end_field; copy++)
@@ -6414,13 +6466,13 @@ cp_buffer_from_ref(TABLE_REF *ref)
/*****************************************************************************
-** Group and order functions
+ Group and order functions
*****************************************************************************/
/*
-** Find order/group item in requested columns and change the item to point at
-** it. If item doesn't exists, add it first in the field list
-** Return 0 if ok.
+ Find order/group item in requested columns and change the item to point at
+ it. If item doesn't exists, add it first in the field list
+ Return 0 if ok.
*/
static int
@@ -6465,8 +6517,8 @@ find_order_in_list(THD *thd,TABLE_LIST *tables,ORDER *order,List<Item> &fields,
/*
-** Change order to point at item in select list. If item isn't a number
-** and doesn't exits in the select list, add it the the field list.
+ Change order to point at item in select list. If item isn't a number
+ and doesn't exits in the select list, add it the the field list.
*/
int setup_order(THD *thd,TABLE_LIST *tables,List<Item> &fields,
@@ -6500,7 +6552,7 @@ setup_group(THD *thd,TABLE_LIST *tables,List<Item> &fields,
uint org_fields=all_fields.elements;
thd->where="group statement";
- for ( ; order; order=order->next)
+ for (; order; order=order->next)
{
if (find_order_in_list(thd,tables,order,fields,all_fields))
return 1;
@@ -6535,7 +6587,7 @@ setup_group(THD *thd,TABLE_LIST *tables,List<Item> &fields,
}
/*
-** Add fields with aren't used at start of field list. Return FALSE if ok
+ Add fields with aren't used at start of field list. Return FALSE if ok
*/
static bool
@@ -6547,7 +6599,7 @@ setup_new_fields(THD *thd,TABLE_LIST *tables,List<Item> &fields,
thd->set_query_id=1; // Not really needed, but...
thd->where=0; // Don't give error
- for ( ; new_field ; new_field=new_field->next)
+ for (; new_field ; new_field=new_field->next)
{
if ((item=find_item_in_list(*new_field->item,fields)))
new_field->item=item; /* Change to shared Item */
@@ -6565,9 +6617,9 @@ setup_new_fields(THD *thd,TABLE_LIST *tables,List<Item> &fields,
}
/*
-** Create a group by that consist of all non const fields. Try to use
-** the fields in the order given by 'order' to allow one to optimize
-** away 'order by'.
+ Create a group by that consist of all non const fields. Try to use
+ the fields in the order given by 'order' to allow one to optimize
+ away 'order by'.
*/
static ORDER *
@@ -6616,7 +6668,7 @@ create_distinct_group(ORDER *order_list,List<Item> &fields)
/*****************************************************************************
-** Update join with count of the different type of fields
+ Update join with count of the different type of fields
*****************************************************************************/
void
@@ -6707,7 +6759,7 @@ get_sort_by_table(ORDER *a,ORDER *b,TABLE_LIST *tables)
if (!map || (map & RAND_TABLE_BIT))
DBUG_RETURN(0);
- for ( ; !(map & tables->table->map) ; tables=tables->next) ;
+ for (; !(map & tables->table->map) ; tables=tables->next) ;
if (map != tables->table->map)
DBUG_RETURN(0); // More than one table
DBUG_PRINT("exit",("sort by table: %d",tables->table->tablenr));
@@ -6751,8 +6803,8 @@ calc_group_buffer(JOIN *join,ORDER *group)
/*
-** Get a list of buffers for saveing last group
-** Groups are saved in reverse order for easyer check loop
+ Get a list of buffers for saveing last group
+ Groups are saved in reverse order for easyer check loop
*/
static bool
@@ -6790,10 +6842,10 @@ test_if_group_changed(List<Item_buff> &list)
/*
-** Setup copy_fields to save fields at start of new group
-** Only FIELD_ITEM:s and FUNC_ITEM:s needs to be saved between groups.
-** Change old item_field to use a new field with points at saved fieldvalue
-** This function is only called before use of send_fields
+ Setup copy_fields to save fields at start of new group
+ Only FIELD_ITEM:s and FUNC_ITEM:s needs to be saved between groups.
+ Change old item_field to use a new field with points at saved fieldvalue
+ This function is only called before use of send_fields
*/
bool
@@ -6862,7 +6914,7 @@ err2:
/*
-** Copy fields and null values between two tables
+ Copy fields and null values between two tables
*/
void
@@ -6871,7 +6923,7 @@ copy_fields(TMP_TABLE_PARAM *param)
Copy_field *ptr=param->copy_field;
Copy_field *end=param->copy_field_end;
- for ( ; ptr != end; ptr++)
+ for (; ptr != end; ptr++)
(*ptr->do_copy)(ptr);
List_iterator_fast<Item> &it=param->copy_funcs_it;
@@ -6883,7 +6935,7 @@ copy_fields(TMP_TABLE_PARAM *param)
/*****************************************************************************
-** Make an array of pointer to sum_functions to speed up sum_func calculation
+ Make an array of pointer to sum_functions to speed up sum_func calculation
*****************************************************************************/
static bool
@@ -6915,7 +6967,7 @@ make_sum_func_list(JOIN *join,List<Item> &fields)
/*
-** Change all funcs and sum_funcs to fields in tmp table
+ Change all funcs and sum_funcs to fields in tmp table
*/
static bool
@@ -6965,8 +7017,8 @@ change_to_use_tmp_fields(List<Item> &items)
/*
-** Change all sum_func refs to fields to point at fields in tmp table
-** Change all funcs to be fields in tmp table
+ Change all sum_func refs to fields to point at fields in tmp table
+ Change all funcs to be fields in tmp table
*/
static bool
@@ -7022,7 +7074,7 @@ change_refs_to_tmp_fields(THD *thd,List<Item> &items)
/******************************************************************************
-** code for calculating functions
+ Code for calculating functions
******************************************************************************/
static void
@@ -7090,8 +7142,8 @@ copy_funcs(Item_result_field **func_ptr)
/*****************************************************************************
-** Create a condition for a const reference and add this to the
-** currenct select for the table
+ Create a condition for a const reference and add this to the
+ currenct select for the table
*****************************************************************************/
static bool add_ref_to_table_cond(THD *thd, JOIN_TAB *join_tab)
@@ -7132,7 +7184,7 @@ static bool add_ref_to_table_cond(THD *thd, JOIN_TAB *join_tab)
}
/****************************************************************************
-** Send a description about what how the select will be done to stdout
+ Send a description about what how the select will be done to stdout
****************************************************************************/
static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
@@ -7145,6 +7197,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
MYSQL_LOCK *save_lock;
SELECT_LEX *select_lex = &(join->thd->lex.select_lex);
select_result *result=join->result;
+ Item *item_null= new Item_null();
DBUG_ENTER("select_describe");
/* Don't log this into the slow query log */
@@ -7172,14 +7225,11 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
if (message)
{
- item_list.push_back(new Item_empty_string("",0));
- item_list.push_back(new Item_empty_string("",0));
- item_list.push_back(new Item_empty_string("",0));
- item_list.push_back(new Item_empty_string("",0));
- item_list.push_back(new Item_empty_string("",0));
- item_list.push_back(new Item_empty_string("",0));
- item_list.push_back(new Item_empty_string("",0));
- item_list.push_back(new Item_string(message,strlen(message),default_charset_info));
+ Item *empty= new Item_empty_string("",0);
+ for (uint i=0 ; i < 7; i++)
+ item_list.push_back(empty);
+ item_list.push_back(new Item_string(message,strlen(message),
+ default_charset_info));
if (result->send_data(item_list))
result->send_error(0,NullS);
}
@@ -7191,15 +7241,21 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
JOIN_TAB *tab=join->join_tab+i;
TABLE *table=tab->table;
char buff[512],*buff_ptr=buff;
- char buff1[512], buff2[512], bufff[512];
+ char buff1[512], buff2[512], buff3[512];
String tmp1(buff1,sizeof(buff1),default_charset_info);
String tmp2(buff2,sizeof(buff2),default_charset_info);
+ tmp1.length(0);
+ tmp2.length(0);
item_list.empty();
+
if (tab->type == JT_ALL && tab->select && tab->select->quick)
tab->type= JT_RANGE;
- item_list.push_back(new Item_string(table->table_name,strlen(table->table_name),default_charset_info));
- item_list.push_back(new Item_string(join_type_str[tab->type],strlen(join_type_str[tab->type]),default_charset_info));
- tmp1.length(0); tmp2.length(0);
+ item_list.push_back(new Item_string(table->table_name,
+ strlen(table->table_name),
+ default_charset_info));
+ item_list.push_back(new Item_string(join_type_str[tab->type],
+ strlen(join_type_str[tab->type]),
+ default_charset_info));
key_map bits;
uint j;
for (j=0,bits=tab->keys ; bits ; j++,bits>>=1)
@@ -7212,48 +7268,61 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
}
}
if (tmp1.length())
- item_list.push_back(new Item_string(tmp1.ptr(),tmp1.length(),default_charset_info));
+ item_list.push_back(new Item_string(tmp1.ptr(),tmp1.length(),
+ default_charset_info));
else
- item_list.push_back(new Item_null());
+ item_list.push_back(item_null);
if (tab->ref.key_parts)
{
- item_list.push_back(new Item_string(table->key_info[tab->ref.key].name,strlen(table->key_info[tab->ref.key].name),default_charset_info));
- item_list.push_back(new Item_int((int) tab->ref.key_length));
+ KEY *key_info=table->key_info+ tab->ref.key;
+ item_list.push_back(new Item_string(key_info->name,
+ strlen(key_info->name)));
+ item_list.push_back(new Item_int((int32) tab->ref.key_length));
for (store_key **ref=tab->ref.key_copy ; *ref ; ref++)
{
if (tmp2.length())
tmp2.append(',');
tmp2.append((*ref)->name());
}
- item_list.push_back(new Item_string(tmp2.ptr(),tmp2.length(),default_charset_info));
+ item_list.push_back(new Item_string(tmp2.ptr(),tmp2.length(),
+ default_charset_info));
}
else if (tab->type == JT_NEXT)
{
- item_list.push_back(new Item_string(table->key_info[tab->index].name,strlen(table->key_info[tab->index].name),default_charset_info));
- item_list.push_back(new Item_int((int) table->key_info[tab->index].key_length));
- item_list.push_back(new Item_null());
+ KEY *key_info=table->key_info+ tab->index;
+ item_list.push_back(new Item_string(key_info->name,
+ strlen(key_info->name),
+ default_charset_info));
+ item_list.push_back(new Item_int((int32) key_info->key_length));
+ item_list.push_back(item_null);
}
else if (tab->select && tab->select->quick)
{
- item_list.push_back(new Item_string(table->key_info[tab->select->quick->index].name,strlen(table->key_info[tab->select->quick->index].name),default_charset_info));
- item_list.push_back(new Item_int((int) tab->select->quick->max_used_key_length));
- item_list.push_back(new Item_null());
+ KEY *key_info=table->key_info+ tab->select->quick->index;
+ item_list.push_back(new Item_string(key_info->name,
+ strlen(key_info->name),
+ default_charset_info));
+ item_list.push_back(new Item_int((int32) tab->select->quick->
+ max_used_key_length));
+ item_list.push_back(item_null);
}
else
{
- item_list.push_back(new Item_null());
- item_list.push_back(new Item_null());
- item_list.push_back(new Item_null());
+ item_list.push_back(item_null);
+ item_list.push_back(item_null);
+ item_list.push_back(item_null);
}
- sprintf(bufff,"%.0f",join->best_positions[i].records_read);
- item_list.push_back(new Item_string(bufff,strlen(bufff),default_charset_info));
+ sprintf(buff3,"%.0f",join->best_positions[i].records_read);
+ item_list.push_back(new Item_string(buff3,strlen(buff3),
+ default_charset_info));
my_bool key_read=table->key_read;
if (tab->type == JT_NEXT &&
((table->used_keys & ((key_map) 1 << tab->index))))
key_read=1;
if (tab->info)
- item_list.push_back(new Item_string(tab->info,strlen(tab->info),default_charset_info));
+ item_list.push_back(new Item_string(tab->info,strlen(tab->info),
+ default_charset_info));
else if (tab->select)
{
if (tab->use_quick == 2)
@@ -7307,14 +7376,15 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
}
buff_ptr=strmov(buff_ptr,"Distinct");
}
- item_list.push_back(new Item_string(buff,(uint) (buff_ptr - buff),default_charset_info));
+ item_list.push_back(new Item_string(buff,(uint) (buff_ptr - buff),
+ default_charset_info));
// For next iteration
used_tables|=table->map;
if (result->send_data(item_list))
result->send_error(0,NullS);
}
}
- if (!join->thd->lex.select->next_select())
+ if (!thd->lex.select->next_select())
{
save_lock=thd->lock;
thd->lock=(MYSQL_LOCK *)0;
@@ -7325,13 +7395,21 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
}
-static void describe_info(THD *thd, const char *info)
+static void describe_info(JOIN *join, const char *info)
{
+ THD *thd= join->thd;
+
+ if (thd->lex.select->next_select()) /* If in UNION */
+ {
+ select_describe(join,FALSE,FALSE,FALSE,info);
+ return;
+ }
List<Item> field_list;
String *packet= &thd->packet;
/* Don't log this into the slow query log */
- thd->lex.select_lex.options&= ~(QUERY_NO_INDEX_USED | QUERY_NO_GOOD_INDEX_USED);
+ thd->lex.select_lex.options&= ~(QUERY_NO_INDEX_USED |
+ QUERY_NO_GOOD_INDEX_USED);
field_list.push_back(new Item_empty_string("Comment",80));
if (send_fields(thd,field_list,1))
return; /* purecov: inspected */
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index e227a5bf5ca..5899fe86024 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -78,13 +78,13 @@ mysqld_show_dbs(THD *thd,const char *wild)
List_iterator_fast<char> it(files);
while ((file_name=it++))
{
- if (!opt_safe_show_db || thd->master_access ||
+ if (thd->master_access & (DB_ACLS | SHOW_DB_ACL) ||
acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr,
thd->priv_user, file_name) ||
(grant_option && !check_grant_db(thd, file_name)))
- {
+ {
thd->packet.length(0);
- net_store_data(&thd->packet, thd->convert_set, file_name);
+ net_store_data(&thd->packet, thd->variables.convert_set, file_name);
if (my_net_write(&thd->net, (char*) thd->packet.ptr(),
thd->packet.length()))
DBUG_RETURN(-1);
@@ -102,7 +102,7 @@ int mysqld_show_open_tables(THD *thd,const char *wild)
{
List<Item> field_list;
OPEN_TABLE_LIST *open_list;
- CONVERT *convert=thd->convert_set;
+ CONVERT *convert=thd->variables.convert_set;
DBUG_ENTER("mysqld_show_open_tables");
field_list.push_back(new Item_empty_string("Database",NAME_LEN));
@@ -116,7 +116,7 @@ int mysqld_show_open_tables(THD *thd,const char *wild)
if (!(open_list=list_open_tables(thd,wild)) && thd->fatal_error)
DBUG_RETURN(-1);
- for ( ; open_list ; open_list=open_list->next)
+ for (; open_list ; open_list=open_list->next)
{
thd->packet.length(0);
net_store_data(&thd->packet,convert, open_list->db);
@@ -124,13 +124,15 @@ int mysqld_show_open_tables(THD *thd,const char *wild)
net_store_data(&thd->packet,open_list->in_use);
net_store_data(&thd->packet,open_list->locked);
if (my_net_write(&thd->net,(char*) thd->packet.ptr(),thd->packet.length()))
+ {
DBUG_RETURN(-1);
+ }
}
-
send_eof(&thd->net);
DBUG_RETURN(0);
}
+
/***************************************************************************
** List all tables in a database (fast version)
** A table is a .frm file in the current databasedir
@@ -161,7 +163,7 @@ int mysqld_show_tables(THD *thd,const char *db,const char *wild)
while ((file_name=it++))
{
thd->packet.length(0);
- net_store_data(&thd->packet, thd->convert_set, file_name);
+ net_store_data(&thd->packet, thd->variables.convert_set, file_name);
if (my_net_write(&thd->net,(char*) thd->packet.ptr(),thd->packet.length()))
DBUG_RETURN(-1);
}
@@ -452,7 +454,7 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild)
char *file_name;
TABLE *table;
String *packet= &thd->packet;
- CONVERT *convert=thd->convert_set;
+ CONVERT *convert=thd->variables.convert_set;
DBUG_ENTER("mysqld_extend_show_tables");
(void) sprintf(path,"%s/%s",mysql_data_home,db);
@@ -628,7 +630,7 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild,
handler *file;
char tmp[MAX_FIELD_WIDTH];
Item *item;
- CONVERT *convert=thd->convert_set;
+ CONVERT *convert=thd->variables.convert_set;
DBUG_ENTER("mysqld_show_fields");
DBUG_PRINT("enter",("db: %s table: %s",table_list->db,
table_list->real_name));
@@ -748,7 +750,7 @@ int
mysqld_show_create(THD *thd, TABLE_LIST *table_list)
{
TABLE *table;
- CONVERT *convert=thd->convert_set;
+ CONVERT *convert=thd->variables.convert_set;
DBUG_ENTER("mysqld_show_create");
DBUG_PRINT("enter",("db: %s table: %s",table_list->db,
table_list->real_name));
@@ -840,7 +842,7 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list)
{
TABLE *table;
char buff[256];
- CONVERT *convert=thd->convert_set;
+ CONVERT *convert=thd->variables.convert_set;
DBUG_ENTER("mysqld_show_keys");
DBUG_PRINT("enter",("db: %s table: %s",table_list->db,
table_list->real_name));
@@ -972,7 +974,7 @@ mysqld_list_fields(THD *thd, TABLE_LIST *table_list, const char *wild)
int
mysqld_dump_create_info(THD *thd, TABLE *table, int fd)
{
- CONVERT *convert=thd->convert_set;
+ CONVERT *convert=thd->variables.convert_set;
DBUG_ENTER("mysqld_dump_create_info");
DBUG_PRINT("enter",("table: %s",table->real_name));
@@ -1240,8 +1242,9 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
Item *field;
List<Item> field_list;
I_List<thread_info> thread_infos;
- ulong max_query_length= verbose ? max_allowed_packet : PROCESS_LIST_WIDTH;
- CONVERT *convert=thd->convert_set;
+ ulong max_query_length= (verbose ? thd->variables.max_allowed_packet :
+ PROCESS_LIST_WIDTH);
+ CONVERT *convert=thd->variables.convert_set;
DBUG_ENTER("mysqld_list_processes");
field_list.push_back(new Item_int("Id",0,7));
@@ -1360,7 +1363,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
/*****************************************************************************
-** Status functions
+ Status functions
*****************************************************************************/
int mysqld_show_charsets(THD *thd, const char *wild)
@@ -1385,7 +1388,8 @@ int mysqld_show_charsets(THD *thd, const char *wild)
{
if (!cs->name)
continue;
- if (!(wild && wild[0] && wild_case_compare(system_charset_info,cs->name,wild)))
+ if (!(wild && wild[0] &&
+ wild_case_compare(system_charset_info,cs->name,wild)))
{
packet2.length(0);
net_store_data(&packet2,convert,cs->name);
@@ -1403,15 +1407,17 @@ err:
DBUG_RETURN(1);
}
+
-int mysqld_show(THD *thd, const char *wild, show_var_st *variables)
+int mysqld_show(THD *thd, const char *wild, show_var_st *variables,
+ enum enum_var_type value_type)
{
- uint i;
char buff[8192];
- String packet2(buff,sizeof(buff),default_charset_info);
+ String packet2(buff,sizeof(buff), system_charset_info);
List<Item> field_list;
- CONVERT *convert=thd->convert_set;
+ CONVERT *convert=thd->variables.convert_set;
DBUG_ENTER("mysqld_show");
+
field_list.push_back(new Item_empty_string("Variable_name",30));
field_list.push_back(new Item_empty_string("Value",256));
if (send_fields(thd,field_list,1))
@@ -1419,40 +1425,49 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables)
/* pthread_mutex_lock(&THR_LOCK_keycache); */
pthread_mutex_lock(&LOCK_status);
- for (i=0; variables[i].name; i++)
+ for (; variables->name; variables++)
{
if (!(wild && wild[0] && wild_case_compare(system_charset_info,
variables[i].name,wild)))
{
packet2.length(0);
- net_store_data(&packet2,convert,variables[i].name);
- switch (variables[i].type){
+ net_store_data(&packet2,convert,variables->name);
+ SHOW_TYPE show_type=variables->type;
+ char *value=variables->value;
+ if (show_type == SHOW_SYS)
+ {
+ show_type= ((sys_var*) value)->type();
+ value= (char*) ((sys_var*) value)->value_ptr(thd, value_type);
+ }
+
+ switch (show_type) {
case SHOW_LONG:
case SHOW_LONG_CONST:
- net_store_data(&packet2,(uint32) *(ulong*) variables[i].value);
+ net_store_data(&packet2,(uint32) *(ulong*) value);
+ break;
+ case SHOW_LONGLONG:
+ net_store_data(&packet2,(longlong) *(longlong*) value);
break;
case SHOW_BOOL:
- net_store_data(&packet2,(ulong) *(bool*) variables[i].value ?
- "ON" : "OFF");
+ net_store_data(&packet2,(ulong) *(bool*) value ? "ON" : "OFF");
break;
case SHOW_MY_BOOL:
- net_store_data(&packet2,(ulong) *(my_bool*) variables[i].value ?
- "ON" : "OFF");
+ net_store_data(&packet2,(ulong) *(my_bool*) value ? "ON" : "OFF");
break;
case SHOW_INT_CONST:
case SHOW_INT:
- net_store_data(&packet2,(uint32) *(int*) variables[i].value);
+ net_store_data(&packet2,(uint32) *(int*) value);
break;
case SHOW_HAVE:
{
- SHOW_COMP_OPTION tmp= *(SHOW_COMP_OPTION*) variables[i].value;
+ SHOW_COMP_OPTION tmp= *(SHOW_COMP_OPTION*) value;
net_store_data(&packet2, (tmp == SHOW_OPTION_NO ? "NO" :
tmp == SHOW_OPTION_YES ? "YES" :
"DISABLED"));
break;
}
case SHOW_CHAR:
- net_store_data(&packet2,convert, variables[i].value);
+ net_store_data(&packet2,convert, value);
break;
case SHOW_STARTTIME:
net_store_data(&packet2,(uint32) (thd->query_start() - start_time));
@@ -1476,11 +1491,11 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables)
net_store_data(&packet2,(uint32) cached_tables());
break;
case SHOW_CHAR_PTR:
- {
- char *value= *(char**) variables[i].value;
- net_store_data(&packet2,convert, value ? value : "");
- break;
- }
+ {
+ value= *(char**) value;
+ net_store_data(&packet2,convert, value ? value : "");
+ break;
+ }
#ifdef HAVE_OPENSSL
/* First group - functions relying on CTX */
case SHOW_SSL_CTX_SESS_ACCEPT:
@@ -1564,7 +1579,7 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables)
net_store_data(&packet2,"NONE" );
break;
}
- switch(SSL_CTX_get_session_cache_mode(ssl_acceptor_fd->ssl_context_))
+ switch (SSL_CTX_get_session_cache_mode(ssl_acceptor_fd->ssl_context_))
{
case SSL_SESS_CACHE_OFF:
net_store_data(&packet2,"OFF" );
@@ -1637,6 +1652,10 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables)
break;
#endif /* HAVE_OPENSSL */
+ case SHOW_UNDEF: // Show never happen
+ case SHOW_SYS:
+ net_store_data(&packet2, ""); // Safety
+ break;
}
if (my_net_write(&thd->net, (char*) packet2.ptr(),packet2.length()))
goto err; /* purecov: inspected */
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 9014ca430d9..6a42078cbcd 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -657,7 +657,7 @@ int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *str_end,
{ // Found wild_many
wildstr++;
/* Remove any '%' and '_' from the wild search string */
- for ( ; wildstr != wildend ; wildstr++)
+ for (; wildstr != wildend ; wildstr++)
{
if (*wildstr == wild_many)
continue;
@@ -786,7 +786,7 @@ int wild_compare(const char *str,const char *str_end,
{ // Found wild_many
wildstr++;
/* Remove any '%' and '_' from the wild search string */
- for ( ; wildstr != wildend ; wildstr++)
+ for (; wildstr != wildend ; wildstr++)
{
if (*wildstr == wild_many)
continue;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 3652b2512f4..6b24999763b 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -20,6 +20,7 @@
#include "mysql_priv.h"
#include <hash.h>
#include <myisam.h>
+#include <assert.h>
#ifdef __WIN__
#include <io.h>
@@ -71,8 +72,8 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists)
error=mysql_rm_table_part2(thd,tables,if_exists,0);
err:
- VOID(pthread_cond_broadcast(&COND_refresh)); // Signal to refresh
pthread_mutex_unlock(&LOCK_open);
+ VOID(pthread_cond_broadcast(&COND_refresh)); // Signal to refresh
pthread_mutex_lock(&thd->mysys_var->mutex);
thd->mysys_var->current_mutex= 0;
@@ -85,6 +86,27 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists)
DBUG_RETURN(0);
}
+int mysql_rm_table_part2_with_lock(THD *thd,
+ TABLE_LIST *tables, bool if_exists,
+ bool dont_log_query)
+{
+ int error;
+ thd->mysys_var->current_mutex= &LOCK_open;
+ thd->mysys_var->current_cond= &COND_refresh;
+ VOID(pthread_mutex_lock(&LOCK_open));
+
+ error=mysql_rm_table_part2(thd,tables, if_exists, dont_log_query);
+
+ pthread_mutex_unlock(&LOCK_open);
+ VOID(pthread_cond_broadcast(&COND_refresh)); // Signal to refresh
+
+ pthread_mutex_lock(&thd->mysys_var->mutex);
+ thd->mysys_var->current_mutex= 0;
+ thd->mysys_var->current_cond= 0;
+ pthread_mutex_unlock(&thd->mysys_var->mutex);
+ return error;
+}
+
int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
bool dont_log_query)
@@ -115,15 +137,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
}
drop_locked_tables(thd,db,table->real_name);
if (thd->killed)
- {
- VOID(pthread_cond_broadcast(&COND_refresh)); // Signal to refresh
- VOID(pthread_mutex_unlock(&LOCK_open));
- pthread_mutex_lock(&thd->mysys_var->mutex);
- thd->mysys_var->current_mutex= 0;
- thd->mysys_var->current_cond= 0;
- pthread_mutex_unlock(&thd->mysys_var->mutex);
DBUG_RETURN(-1);
- }
+
/* remove form file and isam files */
(void) sprintf(path,"%s/%s/%s%s",mysql_data_home,db,table->real_name,
reg_ext);
@@ -167,7 +182,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
mysql_update_log.write(thd, thd->query,thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query);
+ Query_log_event qinfo(thd, thd->query, thd->query_length);
mysql_bin_log.write(&qinfo);
}
}
@@ -746,7 +761,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
mysql_update_log.write(thd,thd->query, thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query);
+ Query_log_event qinfo(thd, thd->query, thd->query_length);
mysql_bin_log.write(&qinfo);
}
}
@@ -859,7 +874,9 @@ TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
table->reginfo.lock_type=TL_WRITE;
if (!((*lock)=mysql_lock_tables(thd,&table,1)))
{
+ VOID(pthread_mutex_lock(&LOCK_open));
hash_delete(&open_cache,(byte*) table);
+ VOID(pthread_mutex_unlock(&LOCK_open));
quick_rm_table(create_info->db_type,db,name);
DBUG_RETURN(0);
}
@@ -912,6 +929,8 @@ bool close_cached_table(THD *thd,TABLE *table)
{
bool result=0;
DBUG_ENTER("close_cached_table");
+ safe_mutex_assert_owner(&LOCK_open);
+
if (table)
{
DBUG_PRINT("enter",("table: %s", table->table_name));
@@ -964,8 +983,9 @@ static int send_check_errmsg(THD* thd, TABLE_LIST* table,
return 1;
}
+
static int prepare_for_restore(THD* thd, TABLE_LIST* table,
- HA_CHECK_OPT *check_opt)
+ HA_CHECK_OPT *check_opt)
{
DBUG_ENTER("prepare_for_restore");
@@ -995,27 +1015,38 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table,
fn_format(dst_path, dst_path,"", reg_ext, 4),
MYF(MY_WME)))
{
+ pthread_mutex_lock(&LOCK_open);
unlock_table_name(thd, table);
+ pthread_mutex_unlock(&LOCK_open);
DBUG_RETURN(send_check_errmsg(thd, table, "restore",
"Failed copying .frm file"));
}
if (mysql_truncate(thd, table, 1))
{
+ pthread_mutex_lock(&LOCK_open);
unlock_table_name(thd, table);
+ pthread_mutex_unlock(&LOCK_open);
DBUG_RETURN(send_check_errmsg(thd, table, "restore",
"Failed generating table from .frm file"));
}
}
- // now we should be able to open the partially restored table
- // to finish the restore in the handler later on
+ /*
+ Now we should be able to open the partially restored table
+ to finish the restore in the handler later on
+ */
if (!(table->table = reopen_name_locked_table(thd, table)))
- unlock_table_name(thd, table);
+ {
+ pthread_mutex_lock(&LOCK_open);
+ unlock_table_name(thd, table);
+ pthread_mutex_unlock(&LOCK_open);
+ }
DBUG_RETURN(0);
}
+
static int prepare_for_repair(THD* thd, TABLE_LIST* table,
- HA_CHECK_OPT *check_opt)
+ HA_CHECK_OPT *check_opt)
{
DBUG_ENTER("prepare_for_repair");
@@ -1040,38 +1071,52 @@ static int prepare_for_repair(THD* thd, TABLE_LIST* table,
if (my_rename(from, tmp, MYF(MY_WME)))
{
+ pthread_mutex_lock(&LOCK_open);
unlock_table_name(thd, table);
+ pthread_mutex_unlock(&LOCK_open);
DBUG_RETURN(send_check_errmsg(thd, table, "repair",
"Failed renaming .MYD file"));
}
if (mysql_truncate(thd, table, 1))
{
+ pthread_mutex_lock(&LOCK_open);
unlock_table_name(thd, table);
+ pthread_mutex_unlock(&LOCK_open);
DBUG_RETURN(send_check_errmsg(thd, table, "repair",
"Failed generating table from .frm file"));
}
if (my_rename(tmp, from, MYF(MY_WME)))
{
+ pthread_mutex_lock(&LOCK_open);
unlock_table_name(thd, table);
+ pthread_mutex_unlock(&LOCK_open);
DBUG_RETURN(send_check_errmsg(thd, table, "repair",
"Failed restoring .MYD file"));
}
}
- // now we should be able to open the partially repaired table
- // to finish the repair in the handler later on
+ /*
+ Now we should be able to open the partially repaired table
+ to finish the repair in the handler later on.
+ */
if (!(table->table = reopen_name_locked_table(thd, table)))
- unlock_table_name(thd, table);
+ {
+ pthread_mutex_lock(&LOCK_open);
+ unlock_table_name(thd, table);
+ pthread_mutex_unlock(&LOCK_open);
+ }
DBUG_RETURN(0);
}
+
static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
HA_CHECK_OPT* check_opt,
const char *operator_name,
thr_lock_type lock_type,
bool open_for_modify,
uint extra_open_options,
- int (*prepare_func)(THD *, TABLE_LIST *, HA_CHECK_OPT *),
+ int (*prepare_func)(THD *, TABLE_LIST *,
+ HA_CHECK_OPT *),
int (handler::*operator_func)
(THD *, HA_CHECK_OPT *))
{
@@ -1212,8 +1257,10 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
table->table->version=0; // Force close of table
else if (open_for_modify)
{
+ pthread_mutex_lock(&LOCK_open);
remove_table_from_cache(thd, table->table->table_cache_key,
table->table->real_name);
+ pthread_mutex_unlock(&LOCK_open);
/* May be something modified consequently we have to invalidate cache */
query_cache_invalidate3(thd, table->table, 0);
}
@@ -1242,6 +1289,7 @@ int mysql_backup_table(THD* thd, TABLE_LIST* table_list)
&handler::backup));
}
+
int mysql_restore_table(THD* thd, TABLE_LIST* table_list)
{
DBUG_ENTER("mysql_restore_table");
@@ -1251,6 +1299,7 @@ int mysql_restore_table(THD* thd, TABLE_LIST* table_list)
&handler::restore));
}
+
int mysql_repair_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt)
{
DBUG_ENTER("mysql_repair_table");
@@ -1260,6 +1309,7 @@ int mysql_repair_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt)
&handler::repair));
}
+
int mysql_optimize_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt)
{
DBUG_ENTER("mysql_optimize_table");
@@ -1423,7 +1473,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
mysql_update_log.write(thd, thd->query, thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query);
+ Query_log_event qinfo(thd, thd->query, thd->query_length);
mysql_bin_log.write(&qinfo);
}
send_ok(&thd->net);
@@ -1799,7 +1849,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
mysql_update_log.write(thd, thd->query,thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query);
+ Query_log_event qinfo(thd, thd->query, thd->query_length);
mysql_bin_log.write(&qinfo);
}
goto end_temporary;
@@ -1920,16 +1970,20 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
error=1;
if (error)
{
- VOID(pthread_cond_broadcast(&COND_refresh));
VOID(pthread_mutex_unlock(&LOCK_open));
+ VOID(pthread_cond_broadcast(&COND_refresh));
goto err;
}
-
+#ifdef HAVE_BERKELEY_DB
+ extern bool berkeley_flush_logs(void);
+ if (old_db_type == DB_TYPE_BERKELEY_DB && berkeley_flush_logs())
+ goto err;
+#endif
thd->proc_info="end";
mysql_update_log.write(thd, thd->query,thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query);
+ Query_log_event qinfo(thd, thd->query, thd->query_length);
mysql_bin_log.write(&qinfo);
}
VOID(pthread_cond_broadcast(&COND_refresh));
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 0bc1feed839..ef26a1f45fe 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -21,6 +21,7 @@
#include "mysql_priv.h"
#include "sql_select.h"
#include <hash.h>
+#include <thr_alarm.h>
/* Intern key cache variables */
extern "C" pthread_mutex_t THR_LOCK_keycache;
@@ -240,6 +241,18 @@ Open streams: %10lu\n",
(ulong) cached_tables(),
(ulong) my_file_opened,
(ulong) my_stream_opened);
+
+ ALARM_INFO alarm_info;
+#ifndef DONT_USE_THR_ALARM
+ thr_alarm_info(&alarm_info);
+ printf("\nAlarm status:\n\
+Active alarms: %u\n\
+Max used alarms: %u\n\
+Next alarm time: %lu\n",
+ alarm_info.active_alarms,
+ alarm_info.max_used_alarms,
+ alarm_info.next_alarm_time);
+#endif
fflush(stdout);
if (thd)
thd->proc_info="malloc";
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 0eea10e068a..51f278536de 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -43,8 +43,8 @@ int mysql_union(THD *thd, LEX *lex,select_result *result)
/* Global option */
if (((void*)(global= unit->global_parameters)) == ((void*)unit))
{
- found_rows_for_union = lex->select_lex.options & OPTION_FOUND_ROWS &&
- !describe && global->select_limit;
+ found_rows_for_union= (lex->select_lex.options & OPTION_FOUND_ROWS &&
+ !describe && global->select_limit);
if (found_rows_for_union)
lex->select_lex.options ^= OPTION_FOUND_ROWS;
}
@@ -221,10 +221,11 @@ bool select_union::send_data(List<Item> &values)
unit->offset_limit_cnt--;
return 0;
}
+
fill_record(table->field,values);
if ((write_record(table,&info)))
{
- if (create_myisam_from_heap(table, tmp_table_param, info.errorno, 0))
+ if (create_myisam_from_heap(table, tmp_table_param, info.last_errno, 0))
return 1;
}
return 0;
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 51453f955e8..f0ca5ad6c7b 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -16,9 +16,7 @@
/* Update of records
-
Multi-table updates were introduced by Monty and Sinisa <sinisa@mysql.com>
-
*/
#include "mysql_priv.h"
@@ -119,7 +117,7 @@ int mysql_update(THD *thd,
table->used_keys=0;
select=make_select(table,0,0,conds,&error);
if (error ||
- (select && select->check_quick(test(thd->options & SQL_SAFE_UPDATES),
+ (select && select->check_quick(test(thd->options & OPTION_SAFE_UPDATES),
limit)) ||
!limit)
{
@@ -309,7 +307,8 @@ int mysql_update(THD *thd,
mysql_update_log.write(thd,thd->query,thd->query_length);
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query, using_transactions);
+ Query_log_event qinfo(thd, thd->query, thd->query_length,
+ using_transactions);
if (mysql_bin_log.write(&qinfo) && using_transactions)
error=1;
}
@@ -347,7 +346,7 @@ int mysql_update(THD *thd,
}
/***************************************************************************
-** update multiple tables from join
+ Update multiple tables from join
***************************************************************************/
multi_update::multi_update(THD *thd_arg, TABLE_LIST *ut, List<Item> &fs,
@@ -363,7 +362,7 @@ multi_update::multi_update(THD *thd_arg, TABLE_LIST *ut, List<Item> &fs,
for (TABLE_LIST *dt=ut ; dt ; dt=dt->next,counter++)
{
TABLE *table=ut->table;
-// (void) ut->table->file->extra(HA_EXTRA_NO_KEYREAD);
+ // (void) ut->table->file->extra(HA_EXTRA_NO_KEYREAD);
dt->table->used_keys=0;
if (table->timestamp_field)
{
@@ -403,10 +402,14 @@ multi_update::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
}
}
}
-// Here I have to connect fields with tables and only update tables that need to be updated ...
+ /*
+ Here I have to connect fields with tables and only update tables that
+ need to be updated.
+ I calculate num_updated and fill-up table_sequence
+ Set table_list->shared to true or false, depending on whether table is
+ to be updated or not
+ */
-// I calculate num_updated and fill-up table_sequence
-// Set table_list->shared to true or false, depending on whether table is to be updated or not
Item_field *item;
List_iterator<Item> it(fields);
num_fields=fields.elements;
@@ -415,21 +418,28 @@ multi_update::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
while ((item= (Item_field *)it++))
{
unsigned int counter=0;
- for (table_ref=update_tables; table_ref; table_ref=table_ref->next, counter++)
+ for (table_ref=update_tables; table_ref;
+ table_ref=table_ref->next, counter++)
{
- if (table_ref->table == item->field->table && !table_ref->shared)
+ if (table_ref->table == item->field->table)
{
- num_updated++;
- table_ref->shared=1;
- if (!not_trans_safe && !table_ref->table->file->has_transactions())
- not_trans_safe=true;
- table_ref->table->no_keyread=1; // to be moved if initialize_tables has to be used
+ if (!table_ref->shared)
+ {
+ TABLE *tbl=table_ref->table;
+ num_updated++;
+ table_ref->shared=1;
+ if (!not_trans_safe && !table_ref->table->file->has_transactions())
+ not_trans_safe=true;
+ // to be moved if initialize_tables has to be used
+ tbl->no_keyread=1;
+ tbl->used_keys=0;
+ }
break;
}
}
if (!table_ref)
{
- error = 1; // A proper error message is due here
+ net_printf(&thd->net, ER_NOT_SUPPORTED_YET, "JOIN SYNTAX WITH MULTI-TABLE UPDATES");
DBUG_RETURN(1);
}
else
@@ -437,12 +447,14 @@ multi_update::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
}
if (!num_updated)
{
- error = 1; // A proper error message is due here
+ net_printf(&thd->net, ER_NOT_SUPPORTED_YET, "SET CLAUSE MUST CONTAIN TABLE.FIELD REFERENCE");
DBUG_RETURN(1);
}
-// Here, I have to allocate the array of temporary tables
-// I have to treat a case of num_updated=1 differently in send_data() method.
+ /*
+ Here, I have to allocate the array of temporary tables
+ I have to treat a case of num_updated=1 differently in send_data() method.
+ */
if (num_updated > 1)
{
tmp_tables = (TABLE **) sql_calloc(sizeof(TABLE *) * (num_updated - 1));
@@ -454,7 +466,7 @@ multi_update::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
{
if (!table_ref->shared)
continue;
-// Here we have to add row offset as an additional field ...
+ // Here we have to add row offset as an additional field ...
if (!(temp_fields = (List_item *)sql_calloc(sizeof(List_item))))
{
error = 1; // A proper error message is due here
@@ -473,7 +485,8 @@ multi_update::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
"offset", table_ref->table, true,
default_charset_info);
temp_fields->push_front(new Item_field(((Field *)&offset)));
-// Here I make tmp tables
+
+ // Make a temporary table
int cnt=counter-1;
TMP_TABLE_PARAM tmp_table_param;
bzero((char*) &tmp_table_param,sizeof(tmp_table_param));
@@ -496,6 +509,7 @@ multi_update::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
counter++;
}
}
+ init_ftfuncs(thd,1);
error = 0; // Timestamps do not need to be restored, so far ...
DBUG_RETURN(0);
}
@@ -504,7 +518,8 @@ multi_update::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
void
multi_update::initialize_tables(JOIN *join)
{
-/* We skip it as it only makes a mess ...........
+#ifdef NOT_YET
+ We skip it as it only makes a mess ...........
TABLE_LIST *walk;
table_map tables_to_update_from=0;
for (walk= update_tables ; walk ; walk=walk->next)
@@ -517,14 +532,14 @@ multi_update::initialize_tables(JOIN *join)
{
if (tab->table->map & tables_to_update_from)
{
- We are going to update from this table
- walk->table=tab->table;
- walk=walk->next;
- if (tab == join->join_tab)
- tab->table->no_keyread=1;
+// We are going to update from this table
+ TABLE *tbl=walk->table=tab->table;
+ /* Don't use KEYREAD optimization on this table */
+ tbl->no_keyread=1;
+ walk=walk->next;
}
}
-*/
+#endif
}
@@ -552,7 +567,7 @@ bool multi_update::send_data(List<Item> &values)
List<Item> real_values(values);
for (uint counter = 0; counter < fields.elements; counter++)
real_values.pop();
-// We have skipped fields ....
+ // We have skipped fields ....
if (num_updated == 1)
{
for (table_being_updated=update_tables ;
@@ -566,7 +581,7 @@ bool multi_update::send_data(List<Item> &values)
if (table->status & (STATUS_NULL_ROW | STATUS_UPDATED))
return 0;
table->file->position(table->record[0]);
-// Only one table being updated receives a completely different treatment
+ // Only one table being updated receives a completely different treatment
table->status|= STATUS_UPDATED;
store_record(table,1);
if (fill_record(fields,real_values))
@@ -575,6 +590,7 @@ bool multi_update::send_data(List<Item> &values)
if (/* compare_record(table, query_id) && */
!(error=table->file->update_row(table->record[1], table->record[0])))
updated++;
+ table->file->extra(HA_EXTRA_NO_CACHE);
return error;
}
}
@@ -602,7 +618,7 @@ bool multi_update::send_data(List<Item> &values)
if (*int_ptr++ == (uint) (secure_counter + 1))
values_by_table.push_back(item);
}
-// Here I am breaking values as per each table
+ // Here I am breaking values as per each table
if (secure_counter < 0)
{
table->status|= STATUS_UPDATED;
@@ -612,7 +628,10 @@ bool multi_update::send_data(List<Item> &values)
found++;
if (/*compare_record(table, query_id) && */
!(error=table->file->update_row(table->record[1], table->record[0])))
+ {
updated++;
+ table->file->extra(HA_EXTRA_NO_CACHE);
+ }
else
{
table->file->print_error(error,MYF(0));
@@ -646,13 +665,13 @@ void multi_update::send_error(uint errcode,const char *err)
::send_error(&thd->net,errcode,err);
/* reset used flags */
-// update_tables->table->no_keyread=0;
+ // update_tables->table->no_keyread=0;
/* If nothing updated return */
if (!updated)
return;
- /* Somthing alredy updated consequently we have to invalidate cache */
+ /* Something already updated so we have to invalidate cache */
query_cache_invalidate3(thd, update_tables, 1);
/* Below can happen when thread is killed early ... */
@@ -668,7 +687,7 @@ void multi_update::send_error(uint errcode,const char *err)
if ((table_being_updated->table->file->has_transactions() &&
table_being_updated == update_tables) || !not_trans_safe)
ha_rollback_stmt(thd);
- else if (do_update)
+ else if (do_update && num_updated > 1)
VOID(do_updates(true));
}
@@ -677,8 +696,6 @@ int multi_update::do_updates (bool from_send_error)
{
int error = 0, counter = 0;
- if (num_updated == 1)
- return 0;
if (from_send_error)
{
/* Found out table number for 'table_being_updated' */
@@ -779,7 +796,7 @@ bool multi_update::send_eof()
if (updated || not_trans_safe)
{
mysql_update_log.write(thd,thd->query,thd->query_length);
- Query_log_event qinfo(thd, thd->query);
+ Query_log_event qinfo(thd, thd->query, thd->query_length);
/*
mysql_bin_log is not open if binlogging or replication
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 01894bfb7ad..8571cb9af6d 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -53,6 +53,12 @@ inline Item *or_or_concat(Item* A, Item* B)
Item *item;
List<Item> *item_list;
List<String> *string_list;
+ String *string;
+ key_part_spec *key_part;
+ TABLE_LIST *table_list;
+ udf_func *udf;
+ LEX_USER *lex_user;
+ sys_var *variable;
Key::Keytype key_type;
enum ha_key_alg key_alg;
enum db_type db_type;
@@ -60,13 +66,8 @@ inline Item *or_or_concat(Item* A, Item* B)
enum ha_rkey_function ha_rkey_mode;
enum enum_tx_isolation tx_isolation;
enum Item_cast cast_type;
- String *string;
- key_part_spec *key_part;
- TABLE_LIST *table_list;
- udf_func *udf;
- interval_type interval;
- LEX_USER *lex_user;
enum Item_udftype udf_type;
+ interval_type interval;
}
%{
@@ -82,7 +83,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token LAST_SYM
%token NEXT_SYM
%token PREV_SYM
-%token SQL_CALC_FOUND_ROWS
%token EQ
%token EQUAL_SYM
@@ -96,50 +96,56 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token SHIFT_RIGHT
%token SET_VAR
-%token AVG_SYM
-%token COUNT_SYM
-%token MAX_SYM
-%token MIN_SYM
-%token SUM_SYM
-%token STD_SYM
-%token ABORT_SYM
+%token ABORT_SYM
%token ADD
-%token ALTER
%token AFTER_SYM
-%token ANALYZE_SYM
-%token BEGIN_SYM
+%token ALTER
+%token ANALYZE_SYM
+%token AVG_SYM
+%token BEGIN_SYM
+%token BINLOG_SYM
%token CHANGE
-%token COMMENT_SYM
-%token COMMIT_SYM
+%token CLIENT_SYM
+%token COMMENT_SYM
+%token COMMIT_SYM
+%token COUNT_SYM
%token CREATE
%token CROSS
+%token CUBE_SYM
%token DELETE_SYM
%token DO_SYM
%token DROP
-%token INSERT
+%token EVENTS_SYM
+%token EXECUTE_SYM
%token FLUSH_SYM
-%token SELECT_SYM
-%token MASTER_SYM
-%token REPAIR
-%token RESET_SYM
-%token PURGE
-%token SLAVE
-%token IO_THREAD
-%token SQL_THREAD
-%token START_SYM
-%token STOP_SYM
-%token TRUNCATE_SYM
-%token ROLLBACK_SYM
-%token OPTIMIZE
-%token SHOW
-%token UPDATE_SYM
+%token INSERT
+%token IO_THREAD
%token KILL_SYM
%token LOAD
-%token LOCK_SYM
%token LOCKS_SYM
+%token LOCK_SYM
+%token MASTER_SYM
+%token MAX_SYM
+%token MIN_SYM
+%token OPTIMIZE
+%token PURGE
+%token REPAIR
+%token REPLICATION
+%token RESET_SYM
+%token ROLLBACK_SYM
+%token ROLLUP_SYM
+%token SELECT_SYM
+%token SHOW
+%token SLAVE
+%token SQL_THREAD
+%token START_SYM
+%token STD_SYM
+%token STOP_SYM
+%token SUM_SYM
+%token SUPER_SYM
+%token TRUNCATE_SYM
%token UNLOCK_SYM
-%token BINLOG_SYM
-%token EVENTS_SYM
+%token UPDATE_SYM
%token ACTION
%token AGGREGATE_SYM
@@ -148,9 +154,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token AS
%token ASC
%token AUTO_INC
-%token AUTOCOMMIT
%token AVG_ROW_LENGTH
-%token BACKUP_SYM
+%token BACKUP_SYM
%token BERKELEY_DB_SYM
%token BINARY
%token BIT_SYM
@@ -178,7 +183,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token DEFAULT
%token DELAYED_SYM
%token DELAY_KEY_WRITE_SYM
-%token DEMAND_SYM
%token DESC
%token DESCRIBE
%token DES_KEY_FILE
@@ -188,7 +192,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token ENABLE_SYM
%token ENCLOSED
%token ESCAPED
-%token DIRECTORY_SYM
+%token DIRECTORY_SYM
%token ESCAPE_SYM
%token EXISTS
%token EXTENDED_SYM
@@ -199,8 +203,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token FOREIGN
%token FROM
%token FULL
-%token FULLTEXT_SYM
-%token GLOBAL_SYM
+%token FULLTEXT_SYM
+%token GLOBAL_SYM
%token GRANT
%token GRANTS
%token GREATEST_SYM
@@ -220,7 +224,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token INNOBASE_SYM
%token INTO
%token IN_SYM
-%token ISOLATION
+%token ISOLATION
%token ISAM_SYM
%token ISSUER
%token JOIN_SYM
@@ -228,44 +232,45 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token KEY_SYM
%token LEADING
%token LEAST_SYM
-%token LEVEL_SYM
+%token LEVEL_SYM
%token LEX_HOSTNAME
%token LIKE
%token LINES
%token LOCAL_SYM
+%token LOG_SYM
%token LOGS_SYM
%token LONG_NUM
%token LONG_SYM
%token LOW_PRIORITY
-%token MASTER_HOST_SYM
-%token MASTER_USER_SYM
-%token MASTER_LOG_FILE_SYM
-%token MASTER_LOG_POS_SYM
-%token MASTER_LOG_SEQ_SYM
-%token MASTER_PASSWORD_SYM
-%token MASTER_PORT_SYM
-%token MASTER_CONNECT_RETRY_SYM
-%token MASTER_SERVER_ID_SYM
-%token RELAY_LOG_FILE_SYM
-%token RELAY_LOG_POS_SYM
+%token MASTER_HOST_SYM
+%token MASTER_USER_SYM
+%token MASTER_LOG_FILE_SYM
+%token MASTER_LOG_POS_SYM
+%token MASTER_LOG_SEQ_SYM
+%token MASTER_PASSWORD_SYM
+%token MASTER_PORT_SYM
+%token MASTER_CONNECT_RETRY_SYM
+%token MASTER_SERVER_ID_SYM
+%token RELAY_LOG_FILE_SYM
+%token RELAY_LOG_POS_SYM
%token MATCH
%token MAX_ROWS
-%token MAX_CONNECTIONS_PER_HOUR
-%token MAX_QUERIES_PER_HOUR
-%token MAX_UPDATES_PER_HOUR
+%token MAX_CONNECTIONS_PER_HOUR
+%token MAX_QUERIES_PER_HOUR
+%token MAX_UPDATES_PER_HOUR
%token MEDIUM_SYM
%token MERGE_SYM
%token MIN_ROWS
%token MYISAM_SYM
%token NATIONAL_SYM
%token NATURAL
-%token NEW_SYM
+%token NEW_SYM
%token NCHAR_SYM
%token NOT
+%token NO_FOREIGN_KEY_CHECKS
%token NO_SYM
%token NULL_SYM
%token NUM
-%token OFF
%token ON
%token OPEN_SYM
%token OPTION
@@ -275,7 +280,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token ORDER_SYM
%token OUTER
%token OUTFILE
-%token DUMPFILE
+%token DUMPFILE
%token PACK_KEYS_SYM
%token PARTIAL
%token PRIMARY_SYM
@@ -292,12 +297,13 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token REAL_NUM
%token REFERENCES
%token REGEXP
+%token RELAXED_UNIQUE_CHECKS
%token RELOAD
%token RENAME
%token REPEATABLE_SYM
%token REQUIRE_SYM
-%token RESOURCES
-%token RESTORE_SYM
+%token RESOURCES
+%token RESTORE_SYM
%token RESTRICT
%token REVOKE
%token ROWS_SYM
@@ -310,8 +316,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token SIMPLE_SYM
%token SHUTDOWN
%token SPATIAL_SYM
-%token SQL_CACHE_SYM
-%token SQL_NO_CACHE_SYM
%token SSL_SYM
%token STARTING
%token STATUS_SYM
@@ -334,7 +338,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token UDF_RETURNS_SYM
%token UDF_SONAME_SYM
%token UDF_SYM
-%token UNCOMMITTED_SYM
+%token UNCOMMITTED_SYM
%token UNDERSCORE_CHARSET
%token UNION_SYM
%token UNIQUE_SYM
@@ -347,8 +351,9 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token WHERE
%token WITH
%token WRITE_SYM
-%token X509_SYM
-%token COMPRESSED_SYM
+%token X509_SYM
+%token XOR
+%token COMPRESSED_SYM
%token ERRORS
%token SQL_ERROR_COUNT
@@ -358,7 +363,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token BIGINT
%token BLOB_SYM
%token CHAR_SYM
-%token CHANGED
+%token CHANGED
%token COALESCE
%token DATETIME
%token DATE_SYM
@@ -377,7 +382,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token MEDIUMTEXT
%token NUMERIC_SYM
%token PRECISION
-%token QUICK
+%token QUICK
%token REAL
%token SIGNED_SYM
%token SMALLINT
@@ -395,14 +400,14 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token VARYING
%token ZEROFILL
-%token AGAINST
+%token AGAINST
%token ATAN
%token BETWEEN_SYM
%token BIT_AND
%token BIT_OR
%token CASE_SYM
%token CONCAT
-%token CONCAT_WS
+%token CONCAT_WS
%token CURDATE
%token CURTIME
%token DATABASE
@@ -434,7 +439,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token HOUR_SYM
%token IDENTIFIED_SYM
%token IF
-%token INSERT_ID
%token INSERT_METHOD
%token INTERVAL_SYM
%token LAST_INSERT_ID
@@ -445,7 +449,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token MAKE_SET_SYM
%token MINUTE_SECOND_SYM
%token MINUTE_SYM
-%token MODE_SYM
+%token MODE_SYM
%token MODIFY_SYM
%token MONTH_SYM
%token MLINEFROMTEXT
@@ -481,31 +485,20 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token USER
%token WEEK_SYM
%token WHEN_SYM
-%token WORK_SYM
+%token WORK_SYM
%token YEAR_MONTH_SYM
%token YEAR_SYM
%token YEARWEEK
-%token BENCHMARK_SYM
-%token END
-%token THEN_SYM
-
-%token SQL_BIG_TABLES
-%token SQL_BIG_SELECTS
-%token SQL_SELECT_LIMIT
-%token SQL_MAX_JOIN_SIZE
-%token SQL_LOG_BIN
-%token SQL_LOG_OFF
-%token SQL_LOG_UPDATE
-%token SQL_LOW_PRIORITY_UPDATES
-%token SQL_SMALL_RESULT
+%token BENCHMARK_SYM
+%token END
+%token THEN_SYM
+
%token SQL_BIG_RESULT
+%token SQL_CACHE_SYM
+%token SQL_CALC_FOUND_ROWS
+%token SQL_NO_CACHE_SYM
+%token SQL_SMALL_RESULT
%token SQL_BUFFER_RESULT
-%token SQL_WARNINGS
-%token SQL_AUTO_IS_NULL
-%token SQL_SAFE_UPDATES
-%token SQL_QUERY_CACHE_TYPE_SYM
-%token SQL_QUOTE_SHOW_CREATE
-%token SQL_SLAVE_SKIP_COUNTER
%token ISSUER_SYM
%token SUBJECT_SYM
@@ -522,6 +515,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%left '-' '+'
%left '*' '/' '%'
%left NEG '~'
+%left XOR
+%left '^'
%right NOT
%right BINARY COLLATE_SYM
@@ -543,9 +538,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
text_string
%type <num>
- type int_type real_type order_dir opt_field_spec set_option lock_option
+ type int_type real_type order_dir opt_field_spec lock_option
udf_type if_exists opt_local opt_table_options table_options
- table_option opt_if_not_exists delete_option
+ table_option opt_if_not_exists opt_var_type opt_var_ident_type
+ delete_option
%type <ulong_num>
ULONG_NUM raid_types merge_insert_types
@@ -557,7 +553,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
literal text_literal insert_ident order_ident
simple_ident select_item2 expr opt_expr opt_else sum_expr in_sum_expr
table_wild opt_pad no_in_expr expr_expr simple_expr no_and_expr
- using_list param_marker singleval_subselect singleval_subselect_init
+ using_list expr_or_default set_expr_or_default
+ param_marker singleval_subselect singleval_subselect_init
exists_subselect exists_subselect_init
%type <item_list>
@@ -588,7 +585,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%type <row_type> row_types
-%type <tx_isolation> tx_isolation isolation_types
+%type <tx_isolation> isolation_types
%type <ha_rkey_mode> handler_rkey_mode
@@ -600,6 +597,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%type <lex_user> user grant_user
+%type <variable> internal_variable_name
+
%type <NONE>
query verb_clause create change select do drop insert replace insert2
insert_values update delete truncate rename
@@ -703,8 +702,7 @@ change:
master_defs:
master_def
- |
- master_defs ',' master_def;
+ | master_defs ',' master_def;
master_def:
MASTER_HOST_SYM EQ TEXT_STRING
@@ -770,7 +768,7 @@ create:
lex->change=NullS;
bzero((char*) &lex->create_info,sizeof(lex->create_info));
lex->create_info.options=$2 | $4;
- lex->create_info.db_type= default_table_type;
+ lex->create_info.db_type= (enum db_type) lex->thd->variables.table_type;
lex->create_info.table_charset=NULL;
}
create2
@@ -1395,19 +1393,15 @@ slave:
lex->type = 0;
};
-slave_thread_opts: slave_thread_opt
- | slave_thread_opts ',' slave_thread_opt;
+slave_thread_opts:
+ slave_thread_opt
+ | slave_thread_opts ',' slave_thread_opt;
slave_thread_opt:
- /*empty*/ {}
- | SQL_THREAD
- {
- Lex->slave_thd_opt|=SLAVE_SQL;
- }
- | IO_THREAD
- {
- Lex->slave_thd_opt|=SLAVE_IO;
- };
+ /*empty*/ {}
+ | SQL_THREAD { Lex->slave_thd_opt|=SLAVE_SQL; }
+ | IO_THREAD { Lex->slave_thd_opt|=SLAVE_IO; }
+ ;
restore:
RESTORE_SYM table_or_tables
@@ -1418,6 +1412,7 @@ restore:
{
Lex->backup_dir = $6.str;
};
+
backup:
BACKUP_SYM table_or_tables
{
@@ -1558,22 +1553,51 @@ select_option_list:
select_option:
STRAIGHT_JOIN { Select->options|= SELECT_STRAIGHT_JOIN; }
- | HIGH_PRIORITY { if (Select != &Lex->select_lex) YYABORT; Lex->lock_option= TL_READ_HIGH_PRIORITY; }
+ | HIGH_PRIORITY
+ {
+ if (check_simple_select())
+ YYABORT;
+ Lex->lock_option= TL_READ_HIGH_PRIORITY;
+ }
| DISTINCT { Select->options|= SELECT_DISTINCT; }
| SQL_SMALL_RESULT { Select->options|= SELECT_SMALL_RESULT; }
| SQL_BIG_RESULT { Select->options|= SELECT_BIG_RESULT; }
- | SQL_BUFFER_RESULT { if (Select != &Lex->select_lex) YYABORT; Select->options|= OPTION_BUFFER_RESULT; }
- | SQL_CALC_FOUND_ROWS { if (Select != &Lex->select_lex) YYABORT; Select->options|= OPTION_FOUND_ROWS; }
- | SQL_NO_CACHE_SYM { if (Select != &Lex->select_lex) YYABORT; current_thd->safe_to_cache_query=0; }
- | SQL_CACHE_SYM { if (Select != &Lex->select_lex) YYABORT; Select->options |= OPTION_TO_QUERY_CACHE; }
- | ALL {};
+ | SQL_BUFFER_RESULT
+ {
+ if (check_simple_select())
+ YYABORT;
+ Select->options|= OPTION_BUFFER_RESULT;
+ }
+ | SQL_CALC_FOUND_ROWS
+ {
+ if (check_simple_select())
+ YYABORT;
+ Select->options|= OPTION_FOUND_ROWS;
+ }
+ | SQL_NO_CACHE_SYM { current_thd->safe_to_cache_query=0; }
+ | SQL_CACHE_SYM { Select->options|= OPTION_TO_QUERY_CACHE; }
+ | ALL {}
+ ;
select_lock_type:
/* empty */
| FOR_SYM UPDATE_SYM
- { if (Select != &Lex->select_lex) YYABORT; Lex->lock_option= TL_WRITE; current_thd->safe_to_cache_query=0; }
+ {
+ LEX *lex=Lex;
+ if (check_simple_select())
+ YYABORT;
+ lex->lock_option= TL_WRITE;
+ lex->thd->safe_to_cache_query=0;
+ }
| LOCK_SYM IN_SYM SHARE_SYM MODE_SYM
- { if (Select != &Lex->select_lex) YYABORT; Lex->lock_option= TL_READ_WITH_SHARED_LOCKS; current_thd->safe_to_cache_query=0; };
+ {
+ LEX *lex=Lex;
+ if (check_simple_select())
+ YYABORT;
+ lex->lock_option= TL_READ_WITH_SHARED_LOCKS;
+ lex->thd->safe_to_cache_query=0;
+ }
+ ;
select_item_list:
select_item_list ',' select_item
@@ -1633,6 +1657,7 @@ expr_expr:
{ $$= new Item_func_not(new Item_func_between($1,$4,$6)); }
| expr OR_OR_CONCAT expr { $$= or_or_concat($1,$3); }
| expr OR expr { $$= new Item_cond_or($1,$3); }
+ | expr XOR expr { $$= new Item_cond_xor($1,$3); }
| expr AND expr { $$= new Item_cond_and($1,$3); }
| expr LIKE simple_expr opt_escape { $$= new Item_func_like($1,$3,$4); }
| expr NOT LIKE simple_expr opt_escape { $$= new Item_func_not(new Item_func_like($1,$4,$5));}
@@ -1654,6 +1679,7 @@ expr_expr:
| expr '*' expr { $$= new Item_func_mul($1,$3); }
| expr '/' expr { $$= new Item_func_div($1,$3); }
| expr '|' expr { $$= new Item_func_bit_or($1,$3); }
+ | expr '^' expr { $$= new Item_func_bit_xor($1,$3); }
| expr '&' expr { $$= new Item_func_bit_and($1,$3); }
| expr '%' expr { $$= new Item_func_mod($1,$3); }
| expr '+' INTERVAL_SYM expr interval
@@ -1678,6 +1704,7 @@ no_in_expr:
{ $$= new Item_func_not(new Item_func_between($1,$4,$6)); }
| no_in_expr OR_OR_CONCAT expr { $$= or_or_concat($1,$3); }
| no_in_expr OR expr { $$= new Item_cond_or($1,$3); }
+ | no_in_expr XOR expr { $$= new Item_cond_xor($1,$3); }
| no_in_expr AND expr { $$= new Item_cond_and($1,$3); }
| no_in_expr LIKE simple_expr opt_escape { $$= new Item_func_like($1,$3,$4); }
| no_in_expr NOT LIKE simple_expr opt_escape { $$= new Item_func_not(new Item_func_like($1,$4,$5)); }
@@ -1699,6 +1726,7 @@ no_in_expr:
| no_in_expr '*' expr { $$= new Item_func_mul($1,$3); }
| no_in_expr '/' expr { $$= new Item_func_div($1,$3); }
| no_in_expr '|' expr { $$= new Item_func_bit_or($1,$3); }
+ | no_in_expr '^' expr { $$= new Item_func_bit_xor($1,$3); }
| no_in_expr '&' expr { $$= new Item_func_bit_and($1,$3); }
| no_in_expr '%' expr { $$= new Item_func_mod($1,$3); }
| no_in_expr '+' INTERVAL_SYM expr interval
@@ -1719,6 +1747,7 @@ no_and_expr:
{ $$= new Item_func_not(new Item_func_between($1,$4,$6)); }
| no_and_expr OR_OR_CONCAT expr { $$= or_or_concat($1,$3); }
| no_and_expr OR expr { $$= new Item_cond_or($1,$3); }
+ | no_and_expr XOR expr { $$= new Item_cond_xor($1,$3); }
| no_and_expr LIKE simple_expr opt_escape { $$= new Item_func_like($1,$3,$4); }
| no_and_expr NOT LIKE simple_expr opt_escape { $$= new Item_func_not(new Item_func_like($1,$4,$5)); }
| no_and_expr REGEXP expr { $$= new Item_func_regex($1,$3); }
@@ -1739,6 +1768,7 @@ no_and_expr:
| no_and_expr '*' expr { $$= new Item_func_mul($1,$3); }
| no_and_expr '/' expr { $$= new Item_func_div($1,$3); }
| no_and_expr '|' expr { $$= new Item_func_bit_or($1,$3); }
+ | no_and_expr '^' expr { $$= new Item_func_bit_xor($1,$3); }
| no_and_expr '&' expr { $$= new Item_func_bit_and($1,$3); }
| no_and_expr '%' expr { $$= new Item_func_mod($1,$3); }
| no_and_expr '+' INTERVAL_SYM expr interval
@@ -1752,16 +1782,19 @@ simple_expr:
| literal
| param_marker
| '@' ident_or_text SET_VAR expr
- { $$= new Item_func_set_user_var($2,$4);
+ {
+ $$= new Item_func_set_user_var($2,$4);
current_thd->safe_to_cache_query=0;
}
| '@' ident_or_text
- { $$= new Item_func_get_user_var($2);
+ {
+ $$= new Item_func_get_user_var($2);
current_thd->safe_to_cache_query=0;
}
- | '@' '@' ident_or_text
- { if (!($$= get_system_var($3))) YYABORT;
- current_thd->safe_to_cache_query=0;
+ | '@' '@' opt_var_ident_type ident_or_text
+ {
+ if (!($$= get_system_var((enum_var_type) $3, $4)))
+ YYABORT;
}
| sum_expr
| '-' expr %prec NEG { $$= new Item_func_neg($2); }
@@ -1914,6 +1947,10 @@ simple_expr:
{ $5->push_front($3); $$= new Item_func_max(*$5); }
| LEAST_SYM '(' expr ',' expr_list ')'
{ $5->push_front($3); $$= new Item_func_min(*$5); }
+ | LOG_SYM '(' expr ')'
+ { $$= new Item_func_log($3); }
+ | LOG_SYM '(' expr ',' expr ')'
+ { $$= new Item_func_log($3, $5); }
| LINEFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
| LINEFROMTEXT '(' expr ',' expr ')'
@@ -2232,7 +2269,8 @@ join_table:
{
SELECT_LEX *sel=Select;
if (!($$=add_table_to_list($2,$3,0,TL_UNLOCK, sel->use_index_ptr,
- sel->ignore_index_ptr))) YYABORT;
+ sel->ignore_index_ptr)))
+ YYABORT;
}
| '{' ident join_table LEFT OUTER JOIN_SYM join_table ON expr '}'
{ add_join_on($7,$9); $7->outer_join|=JOIN_TYPE_LEFT; $$=$7; }
@@ -2356,7 +2394,7 @@ opt_escape:
group_clause:
/* empty */
- | GROUP BY group_list;
+ | GROUP BY group_list olap_opt;
group_list:
group_list ',' order_ident order_dir
@@ -2364,6 +2402,26 @@ group_list:
| order_ident order_dir
{ if (add_group_to_list($1,(bool) $2)) YYABORT; };
+olap_opt:
+ /* empty */ {}
+ | WITH CUBE_SYM
+ {
+ LEX *lex=Lex;
+ lex->olap = true;
+ lex->select->olap= CUBE_TYPE;
+ net_printf(&lex->thd->net, ER_NOT_SUPPORTED_YET, "CUBE");
+ YYABORT; /* To be deleted in 4.1 */
+ }
+ | WITH ROLLUP_SYM
+ {
+ LEX *lex=Lex;
+ lex->olap = true;
+ lex->select->olap= ROLLUP_TYPE;
+ net_printf(&lex->thd->net, ER_NOT_SUPPORTED_YET, "ROLLUP");
+ YYABORT; /* To be deleted in 4.1 */
+ }
+ ;
+
/*
Order by statement in select
*/
@@ -2377,7 +2435,17 @@ order_clause:
{
LEX *lex=Lex;
if (lex->sql_command == SQLCOM_MULTI_UPDATE)
+ {
+ net_printf(&lex->thd->net, ER_WRONG_USAGE, "UPDATE", "ORDER BY");
+ YYABORT;
+ }
+ if (lex->select->olap != UNSPECIFIED_OLAP_TYPE)
+ {
+ net_printf(&lex->thd->net, ER_WRONG_USAGE,
+ "CUBE/ROLLUP",
+ "ORDER BY");
YYABORT;
+ }
} order_list;
order_list:
@@ -2396,14 +2464,29 @@ limit_clause:
/* empty */ {}
| LIMIT ULONG_NUM
{
+ LEX *lex=Lex;
+ if (lex->select->olap != UNSPECIFIED_OLAP_TYPE)
+ {
+ net_printf(&lex->thd->net, ER_WRONG_USAGE, "CUBE/ROLLUP",
+ "LIMIT");
+ YYABORT;
+ }
SELECT_LEX *sel=Select;
sel->select_limit= $2;
- sel->offset_limit=0L;
+ sel->offset_limit= 0L;
}
| LIMIT ULONG_NUM ',' ULONG_NUM
{
- SELECT_LEX *sel=Select;
- sel->select_limit= $4; sel->offset_limit=$2;
+ LEX *lex=Lex;
+ if (lex->select->olap != UNSPECIFIED_OLAP_TYPE)
+ {
+ net_printf(&lex->thd->net, ER_WRONG_USAGE, "CUBE/ROLLUP",
+ "LIMIT");
+ YYABORT;
+ }
+ SELECT_LEX *sel=lex->select;
+ sel->select_limit= $4;
+ sel->offset_limit= $2;
};
delete_limit_clause:
@@ -2411,7 +2494,10 @@ delete_limit_clause:
{
LEX *lex=Lex;
if (lex->sql_command == SQLCOM_MULTI_UPDATE)
+ {
+ net_printf(&lex->thd->net, ER_WRONG_USAGE, "DELETE", "LIMIT");
YYABORT;
+ }
lex->select->select_limit= HA_POS_ERROR;
}
| LIMIT ulonglong_num
@@ -2617,7 +2703,7 @@ ident_eq_list:
ident_eq_value;
ident_eq_value:
- simple_ident equal expr
+ simple_ident equal expr_or_default
{
LEX *lex=Lex;
if (lex->field_list.push_back($1) ||
@@ -2626,7 +2712,13 @@ ident_eq_value:
};
equal: EQ {}
- | SET_VAR {};
+ | SET_VAR {}
+ ;
+
+opt_equal:
+ /* empty */ {}
+ | equal {}
+ ;
no_braces:
'('
@@ -2646,16 +2738,22 @@ opt_values:
| values;
values:
- values ',' expr
+ values ',' expr_or_default
{
if (Lex->insert_list->push_back($3))
YYABORT;
}
- | expr
- {
- if (Lex->insert_list->push_back($1))
- YYABORT;
- };
+ | expr_or_default
+ {
+ if (Lex->insert_list->push_back($1))
+ YYABORT;
+ }
+ ;
+
+expr_or_default:
+ expr { $$= $1;}
+ | DEFAULT {$$= new Item_default(); }
+ ;
/* Update rows in a table */
@@ -2810,7 +2908,7 @@ show_param:
{
LEX *lex=Lex;
lex->sql_command = SQLCOM_SHOW_BINLOG_EVENTS;
- lex->select->select_limit= lex->thd->default_select_limit;
+ lex->select->select_limit= lex->thd->variables.select_limit;
lex->select->offset_limit= 0L;
} limit_clause
| keys_or_index FROM table_ident opt_db
@@ -2846,10 +2944,16 @@ show_param:
{ Lex->sql_command = SQLCOM_SHOW_ERRORS;}
| STATUS_SYM wild
{ Lex->sql_command= SQLCOM_SHOW_STATUS; }
+ | INNOBASE_SYM STATUS_SYM
+ { Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS;}
| opt_full PROCESSLIST_SYM
{ Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;}
- | VARIABLES wild
- { Lex->sql_command= SQLCOM_SHOW_VARIABLES; }
+ | opt_var_type VARIABLES wild
+ {
+ THD *thd= current_thd;
+ thd->lex.sql_command= SQLCOM_SHOW_VARIABLES;
+ thd->lex.option_type= (enum_var_type) $1;
+ }
| CHAR_SYM SET wild
{ Lex->sql_command= SQLCOM_SHOW_CHARSETS; }
| LOGS_SYM
@@ -2957,11 +3061,12 @@ flush_option:
| STATUS_SYM { Lex->type|= REFRESH_STATUS; }
| SLAVE { Lex->type|= REFRESH_SLAVE; }
| MASTER_SYM { Lex->type|= REFRESH_MASTER; }
- | DES_KEY_FILE { Lex->type|= REFRESH_DES_KEY_FILE; };
+ | DES_KEY_FILE { Lex->type|= REFRESH_DES_KEY_FILE; }
+ | RESOURCES { Lex->type|= REFRESH_USER_RESOURCES; };
opt_table_list:
- /* empty */ {}
- | table_list {};
+ /* empty */ {;}
+ | table_list {;};
reset:
RESET_SYM
@@ -3226,7 +3331,6 @@ keyword:
| AFTER_SYM {}
| AGAINST {}
| AGGREGATE_SYM {}
- | AUTOCOMMIT {}
| AUTO_INC {}
| AVG_ROW_LENGTH {}
| AVG_SYM {}
@@ -3242,18 +3346,19 @@ keyword:
| CHECKSUM_SYM {}
| CHECK_SYM {}
| CIPHER_SYM {}
+ | CLIENT_SYM {}
| CLOSE_SYM {}
| COMMENT_SYM {}
| COMMITTED_SYM {}
| COMMIT_SYM {}
| COMPRESSED_SYM {}
| CONCURRENT {}
+ | CUBE_SYM {}
| DATA_SYM {}
| DATETIME {}
| DATE_SYM {}
| DAY_SYM {}
| DELAY_KEY_WRITE_SYM {}
- | DEMAND_SYM {}
| DES_KEY_FILE {}
| DIRECTORY_SYM {}
| DO_SYM {}
@@ -3263,16 +3368,17 @@ keyword:
| ENUM {}
| ESCAPE_SYM {}
| EVENTS_SYM {}
+ | EXECUTE_SYM {}
| EXTENDED_SYM {}
| FAST_SYM {}
- | DISABLE_SYM {}
- | ENABLE_SYM {}
+ | DISABLE_SYM {}
+ | ENABLE_SYM {}
| FULL {}
| FILE_SYM {}
| FIRST_SYM {}
| FIXED_SYM {}
| FLUSH_SYM {}
- | GRANTS {}
+ | GRANTS {}
| GLOBAL_SYM {}
| HEAP_SYM {}
| HANDLER_SYM {}
@@ -3285,7 +3391,7 @@ keyword:
| ISSUER_SYM {}
| INNOBASE_SYM {}
| INSERT_METHOD {}
- | IO_THREAD {}
+ | IO_THREAD {}
| LAST_SYM {}
| LEVEL_SYM {}
| LOCAL_SYM {}
@@ -3300,9 +3406,9 @@ keyword:
| MASTER_USER_SYM {}
| MASTER_PASSWORD_SYM {}
| MASTER_CONNECT_RETRY_SYM {}
- | MAX_CONNECTIONS_PER_HOUR {}
- | MAX_QUERIES_PER_HOUR {}
- | MAX_UPDATES_PER_HOUR {}
+ | MAX_CONNECTIONS_PER_HOUR {}
+ | MAX_QUERIES_PER_HOUR {}
+ | MAX_UPDATES_PER_HOUR {}
| MEDIUM_SYM {}
| MERGE_SYM {}
| MINUTE_SYM {}
@@ -3316,7 +3422,6 @@ keyword:
| NEXT_SYM {}
| NEW_SYM {}
| NO_SYM {}
- | OFF {}
| OPEN_SYM {}
| PACK_KEYS_SYM {}
| PARTIAL {}
@@ -3326,20 +3431,22 @@ keyword:
| PROCESSLIST_SYM {}
| QUERY_SYM {}
| QUICK {}
- | RAID_0_SYM {}
+ | RAID_0_SYM {}
| RAID_CHUNKS {}
| RAID_CHUNKSIZE {}
- | RAID_STRIPED_SYM {}
+ | RAID_STRIPED_SYM {}
| RAID_TYPE {}
- | RELAY_LOG_FILE_SYM {}
- | RELAY_LOG_POS_SYM {}
+ | RELAY_LOG_FILE_SYM {}
+ | RELAY_LOG_POS_SYM {}
| RELOAD {}
| REPAIR {}
| REPEATABLE_SYM {}
+ | REPLICATION {}
| RESET_SYM {}
| RESOURCES {}
| RESTORE_SYM {}
| ROLLBACK_SYM {}
+ | ROLLUP_SYM {}
| ROWS_SYM {}
| ROW_FORMAT_SYM {}
| ROW_SYM {}
@@ -3350,16 +3457,17 @@ keyword:
| SIMPLE_SYM {}
| SHARE_SYM {}
| SHUTDOWN {}
- | SLAVE {}
+ | SLAVE {}
| SQL_CACHE_SYM {}
+ | SQL_BUFFER_RESULT {}
| SQL_NO_CACHE_SYM {}
- | SQL_QUERY_CACHE_TYPE_SYM {}
- | SQL_THREAD {}
+ | SQL_THREAD {}
| START_SYM {}
| STATUS_SYM {}
| STOP_SYM {}
| STRING_SYM {}
| SUBJECT_SYM {}
+ | SUPER_SYM {}
| TEMPORARY {}
| TEXT_SYM {}
| TRANSACTION_SYM {}
@@ -3372,7 +3480,8 @@ keyword:
| USE_FRM {}
| VARIABLES {}
| WORK_SYM {}
- | YEAR_SYM {};
+ | YEAR_SYM {}
+ ;
/* Option functions */
@@ -3381,11 +3490,8 @@ set:
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_SET_OPTION;
- lex->select->options=lex->thd->options;
- lex->select->select_limit=lex->thd->default_select_limit;
- lex->tx_isolation=lex->thd->tx_isolation;
- lex->option_type=0;
- lex->option_list.empty();
+ lex->option_type=OPT_DEFAULT;
+ lex->var_list.empty();
}
option_value_list;
@@ -3394,154 +3500,90 @@ opt_option:
| OPTION {};
option_value_list:
- option_value
- | GLOBAL_SYM { Lex->option_type=1; } option_value
- | LOCAL_SYM { Lex->option_type=0; } option_value
- | option_value_list ',' option_value;
+ option_type option_value
+ | option_value_list ',' option_type option_value;
+
+option_type:
+ /* empty */ {}
+ | GLOBAL_SYM { Lex->option_type= OPT_GLOBAL; }
+ | LOCAL_SYM { Lex->option_type= OPT_SESSION; }
+ | SESSION_SYM { Lex->option_type= OPT_SESSION; }
+ ;
+
+opt_var_type:
+ /* empty */ { $$=OPT_SESSION; }
+ | GLOBAL_SYM { $$=OPT_GLOBAL; }
+ | LOCAL_SYM { $$=OPT_SESSION; }
+ | SESSION_SYM { $$=OPT_SESSION; }
+ ;
+
+opt_var_ident_type:
+ /* empty */ { $$=OPT_DEFAULT; }
+ | GLOBAL_SYM '.' { $$=OPT_GLOBAL; }
+ | LOCAL_SYM '.' { $$=OPT_SESSION; }
+ | SESSION_SYM '.' { $$=OPT_SESSION; }
+ ;
option_value:
- set_option equal NUM
- {
- SELECT_LEX *sel=Select;
- if (atoi($3.str) == 0)
- sel->options&= ~$1;
- else
- sel->options|= $1;
- }
- | set_isolation
- | AUTOCOMMIT equal NUM
- {
- SELECT_LEX *sel=Select;
- if (atoi($3.str) != 0) /* Test NOT AUTOCOMMIT */
- sel->options&= ~(OPTION_NOT_AUTO_COMMIT);
- else
- sel->options|= OPTION_NOT_AUTO_COMMIT;
- }
- | SQL_SELECT_LIMIT equal ULONG_NUM
- {
- Select->select_limit= $3;
- }
- | SQL_SELECT_LIMIT equal DEFAULT
- {
- Select->select_limit= HA_POS_ERROR;
- }
- | SQL_MAX_JOIN_SIZE equal ULONG_NUM
- {
- LEX *lex=Lex;
- lex->thd->max_join_size= $3;
- lex->select->options&= ~OPTION_BIG_SELECTS;
- }
- | SQL_MAX_JOIN_SIZE equal DEFAULT
- {
- current_thd->max_join_size= HA_POS_ERROR;
- }
- | TIMESTAMP equal ULONG_NUM
- {
- current_thd->set_time((time_t) $3);
- }
- | TIMESTAMP equal DEFAULT
+ '@' ident_or_text equal expr
{
- current_thd->user_time=0;
+ Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var($2,$4)));
}
- | LAST_INSERT_ID equal ulonglong_num
- {
- current_thd->insert_id($3);
- }
- | INSERT_ID equal ulonglong_num
- {
- current_thd->next_insert_id=$3;
- }
- | CHAR_SYM SET IDENT
- {
- CONVERT *tmp;
- if (!(tmp=get_convert_set($3.str)))
+ | internal_variable_name equal set_expr_or_default
{
- net_printf(&current_thd->net,ER_UNKNOWN_CHARACTER_SET,$3.str);
- YYABORT;
+ LEX *lex=Lex;
+ lex->var_list.push_back(new set_var(lex->option_type, $1, $3));
}
- current_thd->convert_set=tmp;
- }
- | CHAR_SYM SET DEFAULT
+ | '@' '@' opt_var_ident_type internal_variable_name equal set_expr_or_default
+ {
+ LEX *lex=Lex;
+ lex->var_list.push_back(new set_var((enum_var_type) $3, $4, $6));
+ }
+ | TRANSACTION_SYM ISOLATION LEVEL_SYM isolation_types
+ {
+ LEX *lex=Lex;
+ lex->var_list.push_back(new set_var(lex->option_type,
+ find_sys_var("tx_isolation"),
+ new Item_int((int) $4)));
+ }
+ | CHAR_SYM SET opt_equal set_expr_or_default
{
- current_thd->convert_set=0;
+ LEX *lex=Lex;
+ lex->var_list.push_back(new set_var(lex->option_type,
+ find_sys_var("convert_character_set"),
+ $4));
}
| PASSWORD equal text_or_password
- {
- if (change_password(current_thd,current_thd->host,
- current_thd->priv_user,$3))
- YYABORT;
- }
- | PASSWORD FOR_SYM user equal text_or_password
- {
- if (change_password(current_thd,
- $3->host.str ? $3->host.str : current_thd->host,
- $3->user.str,$5))
- YYABORT;
- }
- | SQL_QUERY_CACHE_TYPE_SYM equal query_cache_type
- | SQL_ERROR_COUNT equal ULONG_NUM
- {
- LEX *lex = Lex;
- lex->thd->max_error_count = $3;
- }
- | SQL_WARNING_COUNT equal ULONG_NUM
- {
- LEX *lex = Lex;
- lex->thd->max_warning_count = $3;
- }
- | '@' ident_or_text equal expr
- {
- Item_func_set_user_var *item = new Item_func_set_user_var($2,$4);
- if (item->fix_fields(current_thd, 0, (Item**) &item) ||
- item->update())
- {
- send_error(&current_thd->net, ER_SET_CONSTANTS_ONLY);
- YYABORT;
- }
- }
- | SQL_SLAVE_SKIP_COUNTER equal ULONG_NUM
- {
- LOCK_ACTIVE_MI;
- pthread_mutex_lock(&active_mi->rli.run_lock);
- if (active_mi->rli.slave_running)
- send_error(&current_thd->net, ER_SLAVE_MUST_STOP);
- else
- {
- pthread_mutex_lock(&active_mi->rli.data_lock);
- active_mi->rli.slave_skip_counter = $3;
- pthread_mutex_unlock(&active_mi->rli.data_lock);
- }
- pthread_mutex_unlock(&active_mi->rli.run_lock);
- UNLOCK_ACTIVE_MI;
- }
- | ident equal DEFAULT
{
- LEX *lex=Lex;
- lex->option_list.push_back(new Set_option(lex->option_type,
- $1.str,$1.length,
- (Item*) 0));
- }
- | ident equal expr
+ THD *thd=current_thd;
+ LEX_USER *user;
+ if (!(user=(LEX_USER*) sql_alloc(sizeof(LEX_USER))))
+ YYABORT;
+ user->host.str=0;
+ user->user.str=thd->priv_user;
+ thd->lex.var_list.push_back(new set_var_password(user, $3));
+ }
+ | PASSWORD FOR_SYM user equal text_or_password
{
- THD *thd=current_thd;
- Item *item= $3;
- if (item->fix_fields(current_thd, 0, &item))
- {
- send_error(&thd->net, ER_SET_CONSTANTS_ONLY);
- YYABORT;
- }
- thd->lex.option_list.
- push_back(new Set_option(thd->lex.option_type,
- $1.str,$1.length,
- item));
- };
+ Lex->var_list.push_back(new set_var_password($3,$5));
+ }
-query_cache_type:
- NUM { current_thd->query_cache_type = set_zone(atoi($1.str),0,3); }
- | OFF { current_thd->query_cache_type = 0; }
- | ON { current_thd->query_cache_type = 1; }
- | DEMAND_SYM { current_thd->query_cache_type = 2; };
+internal_variable_name:
+ ident
+ {
+ sys_var *tmp=find_sys_var($1.str, $1.length);
+ if (!tmp)
+ YYABORT;
+ $$=tmp;
+ }
+isolation_types:
+ READ_SYM UNCOMMITTED_SYM { $$= ISO_READ_UNCOMMITTED; }
+ | READ_SYM COMMITTED_SYM { $$= ISO_READ_COMMITTED; }
+ | REPEATABLE_SYM READ_SYM { $$= ISO_REPEATABLE_READ; }
+ | SERIALIZABLE_SYM { $$= ISO_SERIALIZABLE; }
+ ;
+
text_or_password:
TEXT_STRING { $$=$1.str;}
| PASSWORD '(' TEXT_STRING ')'
@@ -3556,54 +3598,14 @@ text_or_password:
}
};
-set_option:
- SQL_BIG_TABLES { $$= OPTION_BIG_TABLES; }
- | SQL_BIG_SELECTS { $$= OPTION_BIG_SELECTS; }
- | SQL_LOG_OFF { $$= OPTION_LOG_OFF; }
- | SQL_LOG_UPDATE
- {
- $$= (opt_sql_bin_update)?
- OPTION_UPDATE_LOG|OPTION_BIN_LOG:
- OPTION_UPDATE_LOG ;
- }
- | SQL_LOG_BIN
- {
- $$= (opt_sql_bin_update)?
- OPTION_UPDATE_LOG|OPTION_BIN_LOG:
- OPTION_BIN_LOG ;
- }
- | SQL_WARNINGS { $$= OPTION_WARNINGS; }
- | SQL_LOW_PRIORITY_UPDATES { $$= OPTION_LOW_PRIORITY_UPDATES; }
- | SQL_AUTO_IS_NULL { $$= OPTION_AUTO_IS_NULL; }
- | SQL_SAFE_UPDATES { $$= OPTION_SAFE_UPDATES; }
- | SQL_BUFFER_RESULT { $$= OPTION_BUFFER_RESULT; }
- | SQL_QUOTE_SHOW_CREATE { $$= OPTION_QUOTE_SHOW_CREATE; };
+set_expr_or_default:
+ expr { $$=$1; }
+ | DEFAULT { $$=0; }
+ | ON { $$=new Item_string("ON",2); }
+ | ALL { $$=new Item_string("ALL",3); }
+ ;
-set_isolation:
- GLOBAL_SYM tx_isolation
- {
- if (check_process_priv())
- YYABORT;
- default_tx_isolation= $2;
- default_tx_isolation_name=tx_isolation_typelib.type_names[default_tx_isolation];
- }
- | SESSION_SYM tx_isolation
- {
- LEX *lex=Lex;
- lex->thd->session_tx_isolation= lex->tx_isolation= $2;
- }
- | tx_isolation
- { Lex->tx_isolation= $1; };
-
-tx_isolation:
- TRANSACTION_SYM ISOLATION LEVEL_SYM isolation_types { $$=$4; };
-
-isolation_types:
- READ_SYM UNCOMMITTED_SYM { $$= ISO_READ_UNCOMMITTED; }
- | READ_SYM COMMITTED_SYM { $$= ISO_READ_COMMITTED; }
- | REPEATABLE_SYM READ_SYM { $$= ISO_REPEATABLE_READ; }
- | SERIALIZABLE_SYM { $$= ISO_SERIALIZABLE; };
/* Lock function */
@@ -3705,6 +3707,7 @@ revoke:
lex->columns.empty();
lex->grant= lex->grant_tot_col=0;
lex->select->db=0;
+ bzero((char*) &lex->mqh, sizeof(lex->mqh));
}
grant_privileges ON opt_table FROM user_list;
@@ -3726,88 +3729,91 @@ grant:
grant_privileges:
grant_privilege_list {}
- | ALL PRIVILEGES { Lex->grant = UINT_MAX;}
- | ALL { Lex->grant = UINT_MAX;};
+ | ALL PRIVILEGES { Lex->grant = GLOBAL_ACLS;}
+ | ALL { Lex->grant = GLOBAL_ACLS;};
grant_privilege_list:
grant_privilege
| grant_privilege_list ',' grant_privilege;
grant_privilege:
- SELECT_SYM
- { Lex->which_columns = SELECT_ACL;}
- opt_column_list
- | INSERT
- { Lex->which_columns = INSERT_ACL; }
- opt_column_list
- | UPDATE_SYM
- { Lex->which_columns = UPDATE_ACL; }
- opt_column_list
- | DELETE_SYM { Lex->grant |= DELETE_ACL;}
- | REFERENCES { Lex->which_columns = REFERENCES_ACL;} opt_column_list
- | USAGE {}
+ SELECT_SYM { Lex->which_columns = SELECT_ACL;} opt_column_list
+ | INSERT { Lex->which_columns = INSERT_ACL;} opt_column_list
+ | UPDATE_SYM { Lex->which_columns = UPDATE_ACL; } opt_column_list
+ | REFERENCES { Lex->which_columns = REFERENCES_ACL;} opt_column_list
+ | DELETE_SYM { Lex->grant |= DELETE_ACL;}
+ | USAGE {}
| INDEX { Lex->grant |= INDEX_ACL;}
| ALTER { Lex->grant |= ALTER_ACL;}
| CREATE { Lex->grant |= CREATE_ACL;}
| DROP { Lex->grant |= DROP_ACL;}
+ | EXECUTE_SYM { Lex->grant |= EXECUTE_ACL;}
| RELOAD { Lex->grant |= RELOAD_ACL;}
| SHUTDOWN { Lex->grant |= SHUTDOWN_ACL;}
| PROCESS { Lex->grant |= PROCESS_ACL;}
| FILE_SYM { Lex->grant |= FILE_ACL;}
- | GRANT OPTION { Lex->grant |= GRANT_ACL;};
+ | GRANT OPTION { Lex->grant |= GRANT_ACL;}
+ | SHOW DATABASES { Lex->grant |= SHOW_DB_ACL;}
+ | SUPER_SYM { Lex->grant |= SUPER_ACL;}
+ | CREATE TEMPORARY TABLES { Lex->grant |= CREATE_TMP_ACL;}
+ | LOCK_SYM TABLES { Lex->grant |= LOCK_TABLES_ACL; }
+ | REPLICATION SLAVE { Lex->grant |= REPL_SLAVE_ACL;}
+ | REPLICATION CLIENT_SYM { Lex->grant |= REPL_CLIENT_ACL;}
+ ;
require_list: require_list_element AND require_list
| require_list_element ;
require_list_element: SUBJECT_SYM TEXT_STRING
- {
- LEX *lex=Lex;
- if (lex->x509_subject)
- {
- net_printf(&lex->thd->net,ER_DUP_ARGUMENT, "SUBJECT");
- YYABORT;
- }
- lex->x509_subject=$2.str;
- }
- | ISSUER_SYM TEXT_STRING
- {
- LEX *lex=Lex;
- if (lex->x509_issuer)
- {
- net_printf(&lex->thd->net,ER_DUP_ARGUMENT, "ISSUER");
- YYABORT;
- }
- lex->x509_issuer=$2.str;
- }
- | CIPHER_SYM TEXT_STRING
- {
- LEX *lex=Lex;
- if (lex->ssl_cipher)
- {
- net_printf(&lex->thd->net,ER_DUP_ARGUMENT, "CIPHER");
- YYABORT;
- }
- lex->ssl_cipher=$2.str;
- };
+ {
+ LEX *lex=Lex;
+ if (lex->x509_subject)
+ {
+ net_printf(&lex->thd->net,ER_DUP_ARGUMENT, "SUBJECT");
+ YYABORT;
+ }
+ lex->x509_subject=$2.str;
+ }
+ | ISSUER_SYM TEXT_STRING
+ {
+ LEX *lex=Lex;
+ if (lex->x509_issuer)
+ {
+ net_printf(&lex->thd->net,ER_DUP_ARGUMENT, "ISSUER");
+ YYABORT;
+ }
+ lex->x509_issuer=$2.str;
+ }
+ | CIPHER_SYM TEXT_STRING
+ {
+ LEX *lex=Lex;
+ if (lex->ssl_cipher)
+ {
+ net_printf(&lex->thd->net,ER_DUP_ARGUMENT, "CIPHER");
+ YYABORT;
+ }
+ lex->ssl_cipher=$2.str;
+ }
+ ;
opt_table:
'*'
{
LEX *lex=Lex;
lex->select->db=lex->thd->db;
- if (lex->grant == UINT_MAX)
+ if (lex->grant == GLOBAL_ACLS)
lex->grant = DB_ACLS & ~GRANT_ACL;
else if (lex->columns.elements)
{
- send_error(&lex->thd->net,ER_ILLEGAL_GRANT_FOR_TABLE);
- YYABORT;
+ send_error(&lex->thd->net,ER_ILLEGAL_GRANT_FOR_TABLE);
+ YYABORT;
}
}
| ident '.' '*'
{
LEX *lex=Lex;
lex->select->db = $1.str;
- if (lex->grant == UINT_MAX)
+ if (lex->grant == GLOBAL_ACLS)
lex->grant = DB_ACLS & ~GRANT_ACL;
else if (lex->columns.elements)
{
@@ -3819,8 +3825,8 @@ opt_table:
{
LEX *lex=Lex;
lex->select->db = NULL;
- if (lex->grant == UINT_MAX)
- lex->grant = GLOBAL_ACLS & ~GRANT_ACL;
+ if (lex->grant == GLOBAL_ACLS)
+ lex->grant= GLOBAL_ACLS & ~GRANT_ACL;
else if (lex->columns.elements)
{
send_error(&lex->thd->net,ER_ILLEGAL_GRANT_FOR_TABLE);
@@ -3832,14 +3838,19 @@ opt_table:
LEX *lex=Lex;
if (!add_table_to_list($1,NULL,0))
YYABORT;
- if (lex->grant == UINT_MAX)
+ if (lex->grant == GLOBAL_ACLS)
lex->grant = TABLE_ACLS & ~GRANT_ACL;
};
user_list:
- grant_user { if (Lex->users_list.push_back($1)) YYABORT;}
- | user_list ',' grant_user { if (Lex->users_list.push_back($3)) YYABORT;};
+ grant_user { if (Lex->users_list.push_back($1)) YYABORT;}
+ | user_list ',' grant_user
+ {
+ if (Lex->users_list.push_back($3))
+ YYABORT;
+ }
+ ;
grant_user:
@@ -3920,25 +3931,28 @@ grant_option_list:
grant_option:
GRANT OPTION { Lex->grant |= GRANT_ACL;}
- | MAX_QUERIES_PER_HOUR EQ ULONG_NUM
+ | MAX_QUERIES_PER_HOUR ULONG_NUM
{
- Lex->mqh.questions=$3;
+ Lex->mqh.questions=$2;
+ Lex->mqh.bits |= 1;
}
- | MAX_UPDATES_PER_HOUR EQ ULONG_NUM
+ | MAX_UPDATES_PER_HOUR ULONG_NUM
{
- Lex->mqh.updates=$3;
+ Lex->mqh.updates=$2;
+ Lex->mqh.bits |= 2;
}
- | MAX_CONNECTIONS_PER_HOUR EQ ULONG_NUM
+ | MAX_CONNECTIONS_PER_HOUR ULONG_NUM
{
- Lex->mqh.connections=$3;
- }
+ Lex->mqh.connections=$2;
+ Lex->mqh.bits |= 4;
+ };
begin:
BEGIN_SYM { Lex->sql_command = SQLCOM_BEGIN;} opt_work;
opt_work:
/* empty */ {}
- | WORK_SYM {};
+ | WORK_SYM {;};
commit:
COMMIT_SYM { Lex->sql_command = SQLCOM_COMMIT;};
@@ -3948,93 +3962,102 @@ rollback:
/*
-** UNIONS : glue selects together
+ UNIONS : glue selects together
*/
union:
- /* empty */ {}
- | union_list;
+ /* empty */ {}
+ | union_list;
union_list:
- UNION_SYM union_option
- {
- LEX *lex=Lex;
- if (lex->exchange)
- {
- /* Only the last SELECT can have INTO...... */
- net_printf(&lex->thd->net, ER_WRONG_USAGE,"UNION","INTO");
- YYABORT;
- }
- if (lex->select->linkage == GLOBAL_OPTIONS_TYPE ||
- mysql_new_select(lex, 0))
- YYABORT;
- lex->select->linkage=UNION_TYPE;
- }
- select_init;
+ UNION_SYM union_option
+ {
+ LEX *lex=Lex;
+ if (lex->exchange)
+ {
+ /* Only the last SELECT can have INTO...... */
+ net_printf(&lex->thd->net, ER_WRONG_USAGE, "UNION", "INTO");
+ YYABORT;
+ }
+ if (lex->select->linkage == GLOBAL_OPTIONS_TYPE)
+ {
+ send_error(&lex->thd->net, ER_SYNTAX_ERROR);
+ YYABORT;
+ }
+ if (mysql_new_select(lex))
+ YYABORT;
+ lex->select->linkage=UNION_TYPE;
+ }
+ select_init
+ ;
union_opt:
- union {}
- | optional_order_or_limit {};
+ union {}
+ | optional_order_or_limit {};
optional_order_or_limit:
- /* empty */ {}
- |
- {
- LEX *lex=Lex;
- if (!lex->select->braces)
- YYABORT;
- lex->select->master_unit()->global_parameters=
- lex->select->master_unit();
- /*
- Following type conversion looks like hack, but all that need SELECT_LEX
- fields always check linkage type.
- */
- lex->select= (SELECT_LEX*)lex->select->master_unit();
- lex->select->select_limit=lex->thd->default_select_limit;
- }
- opt_order_clause limit_clause;
+ /* empty */ {}
+ |
+ {
+ LEX *lex=Lex;
+ if (!lex->select->braces)
+ {
+ send_error(&lex->thd->net, ER_SYNTAX_ERROR);
+ YYABORT;
+ }
+ lex->select->master_unit()->global_parameters=
+ lex->select->master_unit();
+ /*
+ Following type conversion looks like hack, but all that need
+ SELECT_LEX fields always check linkage type.
+ */
+ lex->select= (SELECT_LEX*)lex->select->master_unit();
+ lex->select->select_limit=lex->thd->default_select_limit;
+ }
+ opt_order_clause limit_clause
+ ;
union_option:
- /* empty */ {}
- | ALL {Lex->union_option=1;};
+ /* empty */ {}
+ | ALL {Lex->union_option=1;};
singleval_subselect:
- subselect_start singleval_subselect_init
- subselect_end
- {
- $$= $2;
- };
+ subselect_start singleval_subselect_init
+ subselect_end
+ {
+ $$= $2;
+ };
singleval_subselect_init:
- select_init
- {
- $$= new Item_singleval_subselect(current_thd, Lex->select);
- };
+ select_init
+ {
+ $$= new Item_singleval_subselect(current_thd, Lex->select);
+ };
exists_subselect:
- subselect_start exists_subselect_init
- subselect_end
- {
- $$= $2;
- };
+ subselect_start exists_subselect_init
+ subselect_end
+ {
+ $$= $2;
+ };
exists_subselect_init:
- select_init
- {
- $$= new Item_exists_subselect(current_thd, Lex->select);
- };
+ select_init
+ {
+ $$= new Item_exists_subselect(current_thd, Lex->select);
+ };
subselect_start:
- '('
- {
- if (mysql_new_select(Lex, 1))
- YYABORT;
- };
+ '('
+ {
+ if (mysql_new_select(Lex, 1))
+ YYABORT;
+ };
subselect_end:
- ')'
- {
- LEX *lex=Lex;
- lex->select = lex->select->outer_select();
- };
+ ')'
+ {
+ LEX *lex=Lex;
+ lex->select = lex->select->outer_select();
+ };
diff --git a/sql/stacktrace.c b/sql/stacktrace.c
index d86d65f567e..1aba73dda33 100644
--- a/sql/stacktrace.c
+++ b/sql/stacktrace.c
@@ -145,7 +145,7 @@ terribly wrong...\n");
fprintf(stderr, "Warning: Alpha stacks are difficult -\
will be taking some wild guesses, stack trace may be incorrect or \
terminate abruptly\n");
- // On Alpha, we need to get pc
+ /* On Alpha, we need to get pc */
__asm __volatile__ ("bsr %0, do_next; do_next: "
:"=r"(pc)
:"r"(pc));
@@ -210,8 +210,8 @@ resolve it\n");
void write_core(int sig)
{
signal(sig, SIG_DFL);
- if (fork() != 0) exit(1); // Abort main program
- // Core will be written at exit
+ if (fork() != 0) exit(1); /* Abort main program */
+ /* Core will be written at exit */
}
#else
void write_core(int sig)
diff --git a/sql/structs.h b/sql/structs.h
index c4cb6c82209..c2ad4ef527e 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -50,14 +50,14 @@ typedef struct st_keyfile_info { /* used with ha_info() */
typedef struct st_key_part_info { /* Info about a key part */
Field *field;
uint offset; /* offset in record (from 0) */
- uint null_offset; // Offset to null_bit in record
+ uint null_offset; /* Offset to null_bit in record */
uint16 length; /* Length of key_part */
uint16 store_length;
uint16 key_type;
uint16 fieldnr; /* Fieldnum in UNIREG */
uint8 key_part_flag; /* 0 or HA_REVERSE_SORT */
uint8 type;
- uint8 null_bit; // Position to null_bit
+ uint8 null_bit; /* Position to null_bit */
} KEY_PART_INFO ;
@@ -124,33 +124,37 @@ typedef struct {
} INTERVAL;
-enum SHOW_TYPE { SHOW_LONG,SHOW_CHAR,SHOW_INT,SHOW_CHAR_PTR,SHOW_BOOL,
- SHOW_MY_BOOL,SHOW_OPENTABLES,SHOW_STARTTIME,SHOW_QUESTION,
- SHOW_LONG_CONST, SHOW_INT_CONST, SHOW_HAVE
+enum SHOW_TYPE
+{
+ SHOW_UNDEF,
+ SHOW_LONG, SHOW_LONGLONG, SHOW_INT, SHOW_CHAR, SHOW_CHAR_PTR, SHOW_BOOL,
+ SHOW_MY_BOOL, SHOW_OPENTABLES, SHOW_STARTTIME, SHOW_QUESTION,
+ SHOW_LONG_CONST, SHOW_INT_CONST, SHOW_HAVE, SHOW_SYS,
#ifdef HAVE_OPENSSL
- ,SHOW_SSL_CTX_SESS_ACCEPT, SHOW_SSL_CTX_SESS_ACCEPT_GOOD
- ,SHOW_SSL_GET_VERSION, SHOW_SSL_CTX_GET_SESSION_CACHE_MODE
- ,SHOW_SSL_CTX_SESS_CB_HITS, SHOW_SSL_CTX_SESS_ACCEPT_RENEGOTIATE
- ,SHOW_SSL_CTX_SESS_NUMBER, SHOW_SSL_SESSION_REUSED
- ,SHOW_SSL_CTX_SESS_GET_CACHE_SIZE, SHOW_SSL_GET_CIPHER
- ,SHOW_SSL_GET_DEFAULT_TIMEOUT, SHOW_SSL_GET_VERIFY_MODE
- ,SHOW_SSL_CTX_GET_VERIFY_MODE, SHOW_SSL_GET_VERIFY_DEPTH
- ,SHOW_SSL_CTX_GET_VERIFY_DEPTH, SHOW_SSL_CTX_SESS_CONNECT
- ,SHOW_SSL_CTX_SESS_CONNECT_RENEGOTIATE, SHOW_SSL_CTX_SESS_CONNECT_GOOD
- ,SHOW_SSL_CTX_SESS_HITS, SHOW_SSL_CTX_SESS_MISSES
- ,SHOW_SSL_CTX_SESS_TIMEOUTS, SHOW_SSL_CTX_SESS_CACHE_FULL
- ,SHOW_SSL_GET_CIPHER_LIST
+ SHOW_SSL_CTX_SESS_ACCEPT, SHOW_SSL_CTX_SESS_ACCEPT_GOOD,
+ SHOW_SSL_GET_VERSION, SHOW_SSL_CTX_GET_SESSION_CACHE_MODE,
+ SHOW_SSL_CTX_SESS_CB_HITS, SHOW_SSL_CTX_SESS_ACCEPT_RENEGOTIATE,
+ SHOW_SSL_CTX_SESS_NUMBER, SHOW_SSL_SESSION_REUSED,
+ SHOW_SSL_CTX_SESS_GET_CACHE_SIZE, SHOW_SSL_GET_CIPHER,
+ SHOW_SSL_GET_DEFAULT_TIMEOUT, SHOW_SSL_GET_VERIFY_MODE,
+ SHOW_SSL_CTX_GET_VERIFY_MODE, SHOW_SSL_GET_VERIFY_DEPTH,
+ SHOW_SSL_CTX_GET_VERIFY_DEPTH, SHOW_SSL_CTX_SESS_CONNECT,
+ SHOW_SSL_CTX_SESS_CONNECT_RENEGOTIATE, SHOW_SSL_CTX_SESS_CONNECT_GOOD,
+ SHOW_SSL_CTX_SESS_HITS, SHOW_SSL_CTX_SESS_MISSES,
+ SHOW_SSL_CTX_SESS_TIMEOUTS, SHOW_SSL_CTX_SESS_CACHE_FULL,
+ SHOW_SSL_GET_CIPHER_LIST,
#endif /* HAVE_OPENSSL */
- ,SHOW_RPL_STATUS, SHOW_SLAVE_RUNNING
+ SHOW_RPL_STATUS, SHOW_SLAVE_RUNNING
};
enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED};
+typedef int *(*update_var)(THD *, struct show_var_st *);
-struct show_var_st {
+typedef struct show_var_st {
const char *name;
char *value;
SHOW_TYPE type;
-};
+} SHOW_VAR;
struct show_table_type_st {
const char *type;
@@ -186,7 +190,7 @@ typedef struct st_lex_user {
typedef struct user_resources {
- uint questions, updates, connections;
+ uint questions, updates, connections, bits;
} USER_RESOURCES;
typedef struct user_conn {
diff --git a/sql/table.cc b/sql/table.cc
index 8a7604687e7..3e41da73109 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -136,7 +136,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
if (read_string(file,(gptr*) &disk_buff,key_info_length))
goto err_not_open; /* purecov: inspected */
outparam->keys=keys= disk_buff[0];
- outparam->keys_in_use= set_bits(key_map, keys);
+ outparam->keys_for_keyread= outparam->keys_in_use= set_bits(key_map, keys);
outparam->key_parts=key_parts=disk_buff[1];
n_length=keys*sizeof(KEY)+key_parts*sizeof(KEY_PART_INFO);
@@ -402,17 +402,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
}
}
if (reg_field->unireg_check == Field::NEXT_NUMBER)
- {
- if ((int) (outparam->next_number_index= (uint)
- find_ref_key(outparam,reg_field,
- &outparam->next_number_key_offset)) < 0)
- reg_field->unireg_check=Field::NONE; /* purecov: inspected */
- else
- {
- outparam->found_next_number_field=reg_field;
- reg_field->flags|=AUTO_INCREMENT_FLAG;
- }
- }
+ outparam->found_next_number_field= reg_field;
if (outparam->timestamp_field == reg_field)
outparam->timestamp_field_offset=i;
if (use_hash)
@@ -432,7 +422,17 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
for (uint key=0 ; key < outparam->keys ; key++,keyinfo++)
{
uint usable_parts=0;
+ ulong index_flags;
keyinfo->name=(char*) outparam->keynames.type_names[key];
+ /* Fix fulltext keys for old .frm files */
+ if (outparam->key_info[key].flags & HA_FULLTEXT)
+ outparam->key_info[key].algorithm= HA_KEY_ALG_FULLTEXT;
+
+ /* This has to be done after the above fulltext correction */
+ index_flags=outparam->file->index_flags(key);
+ if (!(index_flags & HA_KEY_READ_ONLY))
+ outparam->keys_for_keyread&= ~((key_map) 1 << key);
+
if (primary_key >= MAX_KEY && (keyinfo->flags & HA_NOSAME))
{
/*
@@ -493,15 +493,14 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
if (field->key_length() == key_part->length &&
field->type() != FIELD_TYPE_BLOB)
{
- if ((ha_option & HA_HAVE_KEY_READ_ONLY) &&
+ if ((index_flags & HA_HAVE_KEY_READ_ONLY) &&
(field->key_type() != HA_KEYTYPE_TEXT ||
(!(ha_option & HA_KEY_READ_WRONG_STR) &&
!(keyinfo->flags & HA_FULLTEXT))))
field->part_of_key|= ((key_map) 1 << key);
if ((field->key_type() != HA_KEYTYPE_TEXT ||
!(keyinfo->flags & HA_FULLTEXT)) &&
- !(outparam->file->index_flags(key) &
- HA_WRONG_ASCII_ORDER))
+ !(index_flags & HA_WRONG_ASCII_ORDER))
field->part_of_sortkey|= ((key_map) 1 << key);
}
if (!(key_part->key_part_flag & HA_REVERSE_SORT) &&
@@ -568,6 +567,20 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
bfill(outparam->null_flags+outparam->rec_buff_length*2,null_length,255);
}
+
+ if ((reg_field=outparam->found_next_number_field))
+ {
+ if ((int) (outparam->next_number_index= (uint)
+ find_ref_key(outparam,reg_field,
+ &outparam->next_number_key_offset)) < 0)
+ {
+ reg_field->unireg_check=Field::NONE; /* purecov: inspected */
+ outparam->found_next_number_field=0;
+ }
+ else
+ reg_field->flags|=AUTO_INCREMENT_FLAG;
+ }
+
if (outparam->blob_fields)
{
Field **ptr;
@@ -808,7 +821,7 @@ ulong make_new_entry(File file, uchar *fileinfo, TYPELIB *formnames,
int2store(fileinfo+8,names+1);
int2store(fileinfo+4,n_length+length);
- VOID(my_chsize(file,newpos,MYF(MY_WME))); /* Append file with '\0' */
+ VOID(my_chsize(file, newpos, 0, MYF(MY_WME)));/* Append file with '\0' */
DBUG_RETURN(newpos);
} /* make_new_entry */
@@ -1123,7 +1136,8 @@ bool check_db_name(const char *name)
}
}
#endif
- if (*name == '/' || *name == FN_LIBCHAR || *name == FN_EXTCHAR)
+ if (*name == '/' || *name == '\\' || *name == FN_LIBCHAR ||
+ *name == FN_EXTCHAR)
return 1;
name++;
}
diff --git a/sql/table.h b/sql/table.h
index b89701bfc8e..02abb090426 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -37,8 +37,8 @@ typedef struct st_grant_info
{
GRANT_TABLE *grant_table;
uint version;
- uint privilege;
- uint want_privilege;
+ ulong privilege;
+ ulong want_privilege;
} GRANT_INFO;
enum tmp_table_type {NO_TMP_TABLE=0, TMP_TABLE=1, TRANSACTIONAL_TMP_TABLE=2};
@@ -61,7 +61,8 @@ struct st_table {
uint uniques;
uint null_fields; /* number of null fields */
uint blob_fields; /* number of blob fields */
- key_map keys_in_use, keys_in_use_for_query;
+ key_map keys_in_use, keys_for_keyread;
+ key_map quick_keys, used_keys, keys_in_use_for_query;
KEY *key_info; /* data of keys in database */
TYPELIB keynames; /* Pointers to keynames */
ha_rows max_rows; /* create information */
@@ -120,7 +121,6 @@ struct st_table {
byte *record_pointers; /* If sorted in memory */
ha_rows found_records; /* How many records in sort */
ORDER *group;
- key_map quick_keys, used_keys;
ha_rows quick_rows[MAX_KEY];
uint quick_key_parts[MAX_KEY];
key_part_map const_key_parts[MAX_KEY];
@@ -136,7 +136,8 @@ struct st_table {
#define JOIN_TYPE_LEFT 1
#define JOIN_TYPE_RIGHT 2
-typedef struct st_table_list {
+typedef struct st_table_list
+{
struct st_table_list *next;
char *db,*name,*real_name;
uint32 db_length, real_name_length;
@@ -155,16 +156,18 @@ typedef struct st_table_list {
};
GRANT_INFO grant;
thr_lock_type lock_type;
- uint outer_join; /* Which join type */
- bool straight; /* optimize with prev table */
- bool updating; /* for replicate-do/ignore table */
- bool shared; /* Used twice in union */
- void *derived; /* SELECT_LEX_UNIT of derived table */
+ uint outer_join; /* Which join type */
+ bool straight; /* optimize with prev table */
+ bool updating; /* for replicate-do/ignore table */
+ bool shared; /* Used twice in union */
+ bool do_redirect; /* If *table has to be fixed in UNION */
+ void *derived; /* SELECT_LEX_UNIT of derived table */
} TABLE_LIST;
-typedef struct st_changed_table_list {
+typedef struct st_changed_table_list
+{
struct st_changed_table_list *next;
- char *key, *table_name;
+ char *key;
uint32 key_length;
} CHANGED_TABLE_LIST;
diff --git a/sql/time.cc b/sql/time.cc
index 2a791ccc30e..aadc32964ff 100644
--- a/sql/time.cc
+++ b/sql/time.cc
@@ -501,7 +501,7 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date)
}
if (str != end && current_thd->count_cuted_fields)
{
- for ( ; str != end ; str++)
+ for (; str != end ; str++)
{
if (!my_isspace(system_charset_info,*str))
{
diff --git a/sql/udf_example.cc b/sql/udf_example.cc
index a5ec77f88e4..f5ff9fe67b5 100644
--- a/sql/udf_example.cc
+++ b/sql/udf_example.cc
@@ -271,7 +271,7 @@ char *metaphon(UDF_INIT *initid, UDF_ARGS *args, char *result,
* characters and converting to uppercase.
*-------------------------------------------------------*/
- for ( n = ntrans + 1, n_end = ntrans + sizeof(ntrans)-2;
+ for (n = ntrans + 1, n_end = ntrans + sizeof(ntrans)-2;
word != w_end && n < n_end; word++ )
if ( isalpha ( *word ))
*n++ = toupper ( *word );
@@ -324,7 +324,7 @@ char *metaphon(UDF_INIT *initid, UDF_ARGS *args, char *result,
KSflag = 0; /* state flag for KS translation */
- for ( metaph_end = result + MAXMETAPH, n_start = n;
+ for (metaph_end = result + MAXMETAPH, n_start = n;
n <= n_end && result < metaph_end; n++ )
{
@@ -402,7 +402,7 @@ char *metaphon(UDF_INIT *initid, UDF_ARGS *args, char *result,
n[2] != 'G' ) ?
(char)'J' : (char)'K';
else
- if( n[1] == 'H' &&
+ if ( n[1] == 'H' &&
!NOGHTOF( *( n - 3 )) &&
*( n - 4 ) != 'H')
*result++ = 'F';
@@ -440,7 +440,7 @@ char *metaphon(UDF_INIT *initid, UDF_ARGS *args, char *result,
case 'T': /* TIO, TIA = X ("sh" sound) */
/* TH = 0, ("th" sound ) */
- if( *( n + 1 ) == 'I' && ( n[2] == 'O'
+ if ( *( n + 1 ) == 'I' && ( n[2] == 'O'
|| n[2] == 'A') )
*result++ = 'X';
else
diff --git a/sql/uniques.cc b/sql/uniques.cc
index 3a26f610dc5..60905567ba0 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -22,7 +22,7 @@
The basic idea is as follows:
Store first all strings in a binary tree, ignoring duplicates.
- When the three uses more memory than 'max_heap_table_size',
+ When the tree uses more memory than 'max_heap_table_size',
write the tree (in sorted order) out to disk and start with a new tree.
When all data has been generated, merge the trees (removing any found
duplicates).
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 57a1407ea06..8db9b871a39 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -105,7 +105,7 @@ int rea_create_table(my_string file_name,
fileinfo[26]= (uchar) test((create_info->max_rows == 1) &&
(create_info->min_rows == 1) && (keys == 0));
int2store(fileinfo+28,key_info_length);
- strnmov((char*) forminfo+47,create_info->comment ? create_info->comment : "",
+ strmake((char*) forminfo+47,create_info->comment ? create_info->comment : "",
60);
forminfo[46]=(uchar) strlen((char*)forminfo+47); // Length of comment
diff --git a/sql/unireg.h b/sql/unireg.h
index 5a61f4a6c12..2cfa709bbdc 100644
--- a/sql/unireg.h
+++ b/sql/unireg.h
@@ -46,6 +46,7 @@
#define MAX_DBKEY_LENGTH (FN_LEN*2+6) /* extra 4 bytes for slave tmp
* tables */
#define MAX_FIELD_NAME 34 /* Max colum name length +2 */
+#define MAX_SYS_VAR_LENGTH 32
#define MAX_KEY 32 /* Max used keys */
#define MAX_REF_PARTS 16 /* Max parts used as ref */
#define MAX_KEY_LENGTH 500 /* max possible key */
@@ -129,6 +130,10 @@ bfill((A)->null_flags,(A)->null_bytes,255);\
*/
#define MIN_TURBOBM_PATTERN_LEN 3
+/* Defines for binary logging */
+
+#define BIN_LOG_HEADER_SIZE 4
+
/* Include prototypes for unireg */
#include "mysqld_error.h"
diff --git a/stamp-h.in b/stamp-h.in
deleted file mode 100644
index 9788f70238c..00000000000
--- a/stamp-h.in
+++ /dev/null
@@ -1 +0,0 @@
-timestamp
diff --git a/strings/ctype-latin1_de.c b/strings/ctype-latin1_de.c
index acaa668b24e..80fb259dfc8 100644
--- a/strings/ctype-latin1_de.c
+++ b/strings/ctype-latin1_de.c
@@ -332,7 +332,7 @@ my_bool my_like_range_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
*min_length = (uint)(min_str - min_org);
*max_length = res_length;
do {
- *min_str++ = ' '; // Because if key compression
+ *min_str++ = ' '; /* Because if key compression */
*max_str++ = max_sort_char;
} while (min_str != min_end);
return 0;
@@ -349,7 +349,7 @@ my_bool my_like_range_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
}
while (min_str != min_end)
- *min_str++ = *max_str++ = ' '; // Because if key compression
+ *min_str++ = *max_str++ = ' '; /* Because if key compression */
return 0;
}
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index 8510ba21d0a..b4358a967ac 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -462,8 +462,8 @@ static uchar* thai2sortable(const uchar * tstr,uint len)
const uchar* p = tstr;
uchar *outBuf;
-// uchar *pRight1, *pRight2, *pRight3, *pRight4;
-// uchar *pLeft1, *pLeft2, *pLeft3, *pLeft4;
+/* uchar *pRight1, *pRight2, *pRight3, *pRight4; */
+/* uchar *pLeft1, *pLeft2, *pLeft3, *pLeft4; */
uchar *pRight1, *pRight2, *pRight3;
uchar *pLeft1, *pLeft2, *pLeft3;
uint bufSize;
@@ -498,11 +498,11 @@ static uchar* thai2sortable(const uchar * tstr,uint len)
*pRight1++ = t_ctype[p[1]][0];
*pRight2++ = t_ctype[p[1]][1];
*pRight3++ = t_ctype[p[1]][2];
-// *pRight4++ = t_ctype[p[1]][3];
+/* *pRight4++ = t_ctype[p[1]][3]; */
*pRight1++ = t_ctype[*p][0];
*pRight2++ = t_ctype[*p][1];
*pRight3++ = t_ctype[*p][2];
-// *pRight4++ = t_ctype[*p][3];
+/* *pRight4++ = t_ctype[*p][3]; */
len--;
p += 2;
} else {
@@ -519,17 +519,17 @@ static uchar* thai2sortable(const uchar * tstr,uint len)
}
*pRight1++ = L2_BLANK;
*pRight2++ = L3_BLANK;
-// *pRight3++ = L4_BLANK;
+/* *pRight3++ = L4_BLANK; */
*pRight3++ = '\0';
-// *pRight4++ = '\0';
+/* *pRight4++ = '\0'; */
memcpy(pRight1, pLeft2, pRight2 - pLeft2);
pRight1 += pRight2 - pLeft2;
memcpy(pRight1, pLeft3, pRight3 - pLeft3);
-// pRight1 += pRight3 - pLeft3;
-// memcpy(pRight1, pLeft4, pRight4 - pLeft4);
+/* pRight1 += pRight3 - pLeft3; */
+/* memcpy(pRight1, pLeft4, pRight4 - pLeft4); */
free(pLeft2);
free(pLeft3);
-// free(pLeft4);
+/* free(pLeft4); */
return(outBuf);
}
@@ -626,22 +626,22 @@ my_bool my_like_range_tis620(CHARSET_INFO *cs __attribute__((unused)),
{
if (*ptr == escape && ptr+1 != end)
{
- ptr++; // Skipp escape
+ ptr++; /* Skipp escape */
*min_str++= *max_str++ = *ptr;
continue;
}
- if (*ptr == wild_one) // '_' in SQL
+ if (*ptr == wild_one) /* '_' in SQL */
{
- *min_str++='\0'; // This should be min char
+ *min_str++='\0'; /* This should be min char */
*max_str++=max_sort_chr;
continue;
}
- if (*ptr == wild_many) // '%' in SQL
+ if (*ptr == wild_many) /* '%' in SQL */
{
*min_length= (uint) (min_str - min_org);
*max_length=res_length;
do {
- *min_str++ = ' '; // Because if key compression
+ *min_str++ = ' '; /* Because if key compression */
*max_str++ = max_sort_chr;
} while (min_str != min_end);
return 0;
@@ -651,7 +651,7 @@ my_bool my_like_range_tis620(CHARSET_INFO *cs __attribute__((unused)),
*min_length= *max_length = (uint) (min_str - min_org);
while (min_str != min_end)
- *min_str++ = *max_str++ = ' '; // Because if key compression
+ *min_str++ = *max_str++ = ' '; /* Because if key compression */
return 0;
}
diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh
index 88d83afb986..50a14b0fc96 100644
--- a/support-files/my-huge.cnf.sh
+++ b/support-files/my-huge.cnf.sh
@@ -61,20 +61,19 @@ server-id = 1 # required unique id between 1 and 2^32 - 1
#set-variable = bdb_cache_size=384M
#set-variable = bdb_max_lock=100000
-# Uncomment the following if you are using Innobase tables
-#innodb_data_file_path = ibdata1:2000M;ibdata2:2000M
+# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = @localstatedir@/
+#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
#innodb_log_group_home_dir = @localstatedir@/
#innodb_log_arch_dir = @localstatedir@/
-#set-variable = innodb_mirrored_log_groups=1
-#set-variable = innodb_log_files_in_group=3
-#set-variable = innodb_log_file_size=5M
+# You can set .._buffer_pool_size up to 50 - 80 %
+# of RAM but beware of setting memory usage too high
+#set-variable = innodb_buffer_pool_size=384M
+#set-variable = innodb_additional_mem_pool_size=20M
+# Set .._log_file_size to 25 % of buffer pool size
+#set-variable = innodb_log_file_size=100M
#set-variable = innodb_log_buffer_size=8M
#innodb_flush_log_at_trx_commit=1
-#innodb_log_archive=0
-#set-variable = innodb_buffer_pool_size=16M
-#set-variable = innodb_additional_mem_pool_size=2M
-#set-variable = innodb_file_io_threads=4
#set-variable = innodb_lock_wait_timeout=50
[mysqldump]
diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh
index 0602921abc1..3c388d611d8 100644
--- a/support-files/my-large.cnf.sh
+++ b/support-files/my-large.cnf.sh
@@ -42,20 +42,19 @@ server-id = 1
#set-variable = bdb_cache_size=64M
#set-variable = bdb_max_lock=100000
-# Uncomment the following if you are using Innobase tables
-#innodb_data_file_path = ibdata1:1000M
+# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = @localstatedir@/
+#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = @localstatedir@/
#innodb_log_arch_dir = @localstatedir@/
-#set-variable = innodb_mirrored_log_groups=1
-#set-variable = innodb_log_files_in_group=3
-#set-variable = innodb_log_file_size=5M
+# You can set .._buffer_pool_size up to 50 - 80 %
+# of RAM but beware of setting memory usage too high
+#set-variable = innodb_buffer_pool_size=256M
+#set-variable = innodb_additional_mem_pool_size=20M
+# Set .._log_file_size to 25 % of buffer pool size
+#set-variable = innodb_log_file_size=64M
#set-variable = innodb_log_buffer_size=8M
#innodb_flush_log_at_trx_commit=1
-#innodb_log_archive=0
-#set-variable = innodb_buffer_pool_size=16M
-#set-variable = innodb_additional_mem_pool_size=2M
-#set-variable = innodb_file_io_threads=4
#set-variable = innodb_lock_wait_timeout=50
# Point the following paths to different dedicated disks
diff --git a/support-files/my-medium.cnf.sh b/support-files/my-medium.cnf.sh
index bddba03eee9..a92494358cb 100644
--- a/support-files/my-medium.cnf.sh
+++ b/support-files/my-medium.cnf.sh
@@ -44,20 +44,19 @@ server-id = 1
#set-variable = bdb_cache_size=4M
#set-variable = bdb_max_lock=10000
-# Uncomment the following if you are using Innobase tables
-#innodb_data_file_path = ibdata1:400M
+# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = @localstatedir@/
+#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = @localstatedir@/
#innodb_log_arch_dir = @localstatedir@/
-#set-variable = innodb_mirrored_log_groups=1
-#set-variable = innodb_log_files_in_group=3
+# You can set .._buffer_pool_size up to 50 - 80 %
+# of RAM but beware of setting memory usage too high
+#set-variable = innodb_buffer_pool_size=16M
+#set-variable = innodb_additional_mem_pool_size=2M
+# Set .._log_file_size to 25 % of buffer pool size
#set-variable = innodb_log_file_size=5M
#set-variable = innodb_log_buffer_size=8M
#innodb_flush_log_at_trx_commit=1
-#innodb_log_archive=0
-#set-variable = innodb_buffer_pool_size=16M
-#set-variable = innodb_additional_mem_pool_size=2M
-#set-variable = innodb_file_io_threads=4
#set-variable = innodb_lock_wait_timeout=50
[mysqldump]
diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh
index 9e7d07ec449..b8941184fe0 100644
--- a/support-files/my-small.cnf.sh
+++ b/support-files/my-small.cnf.sh
@@ -41,20 +41,19 @@ server-id = 1
# Uncomment the following if you are NOT using BDB tables
#skip-bdb
-# Uncomment the following if you are using Innobase tables
-#innodb_data_file_path = ibdata1:100M
+# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = @localstatedir@/
+#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = @localstatedir@/
#innodb_log_arch_dir = @localstatedir@/
-#set-variable = innodb_mirrored_log_groups=1
-#set-variable = innodb_log_files_in_group=3
+# You can set .._buffer_pool_size up to 50 - 80 %
+# of RAM but beware of setting memory usage too high
+#set-variable = innodb_buffer_pool_size=16M
+#set-variable = innodb_additional_mem_pool_size=2M
+# Set .._log_file_size to 25 % of buffer pool size
#set-variable = innodb_log_file_size=5M
#set-variable = innodb_log_buffer_size=8M
#innodb_flush_log_at_trx_commit=1
-#innodb_log_archive=0
-#set-variable = innodb_buffer_pool_size=16M
-#set-variable = innodb_additional_mem_pool_size=2M
-#set-variable = innodb_file_io_threads=4
#set-variable = innodb_lock_wait_timeout=50
[mysqldump]
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
index e6a32d91e77..7493fd29856 100644
--- a/support-files/mysql.server.sh
+++ b/support-files/mysql.server.sh
@@ -24,17 +24,27 @@
# Description: MySQL is a very fast and reliable SQL database engine.
### END INIT INFO
-
-# The following variables are only set for letting mysql.server find things.
+# If you install MySQL on some other places than @prefix@, then you
+# have to do one of the following thing for this script to work:
+#
+# - Run this script from the MySQL installation directory
+# - Create a /etc/my.cnf file with the following information:
+# [mysqld]
+# basedir=path-to-mysql-installation-directory
+# - Add the above to any other configuration file (for example ~/.my.ini)
+# and copy my_print_defaults to /usr/bin
+# - Add the path to the mysql-installation-directory to the basedir variable
+# below.
+#
# If you want to affect other MySQL variables, you should make your changes
-# in the /etc/my.cnf or other configuration files.
+# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-export PATH
+basedir=
+
+# The following variables are only set for letting mysql.server find things.
# Set some defaults
datadir=@localstatedir@
-basedir=
pid_file=
if test -z "$basedir"
then
@@ -43,6 +53,10 @@ then
else
bindir="$basedir/bin"
fi
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin
+export PATH
+
if test -z "$pid_file"
then
pid_file=$datadir/`@HOSTNAME@`.pid
@@ -123,7 +137,7 @@ case "$mode" in
touch /var/lock/subsys/mysql
fi
else
- echo "Can't execute $bindir/mysqld_safe"
+ echo "Can't execute $bindir/mysqld_safe from dir $basedir"
fi
;;
@@ -140,7 +154,7 @@ case "$mode" in
sleep 1
while [ -s $pid_file -a "$flags" != aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ]
do
- [ -z "$flags" ] && echo "Wait for mysqld to exit\c" || echo ".\c"
+ [ -z "$flags" ] && echo -n "Wait for mysqld to exit" || echo -n "."
flags=a$flags
sleep 1
done
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index 372c70327b9..e49bc3f37f0 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -1,6 +1,6 @@
%define mysql_version @VERSION@
%define shared_lib_version @SHARED_LIB_VERSION@
-%define release 2
+%define release 0
%define mysqld_user mysql
%define see_base For a description of MySQL see the base MySQL RPM or http://www.mysql.com
@@ -16,7 +16,7 @@ Copyright: GPL / LGPL
Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql_version}.tar.gz
Icon: mysql.gif
URL: http://www.mysql.com/
-Packager: David Axmark <david@mysql.com>
+Packager: Lenz Grimmer <lenz@mysql.com>
Vendor: MySQL AB
Requires: fileutils sh-utils
Provides: msqlormysql MySQL-server mysql
@@ -45,6 +45,13 @@ The MySQL web site (http://www.mysql.com/) provides the latest
news and information about the MySQL software. Also please see the
documentation and the manual for more information.
+This package includes the MySQL server binary (statically linked,
+compiled with InnoDB support) as well as related utilities to run
+and administrate a MySQL server.
+
+If you want to access and work with the database, you have to install
+package "MySQL-client" as well!
+
%package client
Release: %{release}
Summary: MySQL - Client
@@ -111,15 +118,18 @@ languages and applications need to dynamically load and use MySQL.
%package Max
Release: %{release}
-Summary: MySQL - server with Berkeley DB and Innodb support
+Summary: MySQL - server with Berkeley DB, RAID and UDF support
Group: Applications/Databases
Provides: mysql-Max
Obsoletes: mysql-Max
%description Max
Optional MySQL server binary that supports additional features like
-transactional tables. To activate this binary, just install this
-package in addition to the MySQL package.
+Berkeley DB, RAID and User Defined Functions (UDF).
+To activate this binary, just install this package in addition to
+the standard MySQL package.
+
+Please note that this is a dynamically linked binary!
%package embedded
Release: %{release}
@@ -214,10 +224,14 @@ mkdir -p $RBR
PATH=${MYSQL_BUILD_PATH:-/bin:/usr/bin}
export PATH
-# We need to build shared libraries separate from mysqld-max because we
-# are using --with-other-libc
+# Build the 4.0 Max binary (includes BDB and UDFs and therefore
+# cannot be linked statically against the patched glibc)
-BuildMySQL "--disable-shared $USE_OTHER_LIBC_DIR --with-berkeley-db --with-innodb --with-mysqld-ldflags='-all-static' --with-server-suffix='-Max'"
+BuildMySQL "--enable-shared \
+ --with-berkeley-db \
+ --with-innodb \
+ --with-raid \
+ --with-server-suffix='-Max'"
# Save everything for debug
# tar cf $RBR/all.tar .
@@ -226,13 +240,7 @@ BuildMySQL "--disable-shared $USE_OTHER_LIBC_DIR --with-berkeley-db --with-innod
mv sql/mysqld sql/mysqld-max
nm --numeric-sort sql/mysqld-max > sql/mysqld-max.sym
-# Save manual to avoid rebuilding
-mv Docs/manual.ps Docs/manual.ps.save
-make distclean
-mv Docs/manual.ps.save Docs/manual.ps
-
-# now build and save shared libraries
-BuildMySQL "--enable-shared --enable-thread-safe-client --without-server "
+# Save libraries
(cd libmysql/.libs; tar cf $RBR/shared-libs.tar *.so*)
(cd libmysql_r/.libs; tar rf $RBR/shared-libs.tar *.so*)
@@ -244,11 +252,15 @@ mv Docs/manual.ps.save Docs/manual.ps
# RPM:s destroys Makefile.in files, so we generate them here
automake
-BuildMySQL "--disable-shared" \
- "--with-mysqld-ldflags='-all-static'" \
- "--with-client-ldflags='-all-static'" \
- "$USE_OTHER_LIBC_DIR" \
- "--without-berkeley-db --without-innodb"
+# Now build the statically linked 4.0 binary (which includes InnoDB)
+BuildMySQL "--disable-shared \
+ --with-mysqld-ldflags='-all-static' \
+ --with-client-ldflags='-all-static' \
+ $USE_OTHER_LIBC_DIR \
+ --without-berkeley-db \
+ --with-innodb \
+ --without-vio \
+ --without-openssl"
nm --numeric-sort sql/mysqld > sql/mysqld.sym
%install -n mysql-%{mysql_version}
@@ -258,19 +270,18 @@ MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}
# Ensure that needed directories exists
install -d $RBR/etc/{logrotate.d,rc.d/init.d}
install -d $RBR/var/lib/mysql/mysql
-install -d $RBR/usr/share/sql-bench
-install -d $RBR/usr/share/mysql-test
+install -d $RBR/usr/share/{sql-bench,mysql-test}
install -d $RBR%{_mandir}
-install -d $RBR/usr/{sbin,share,include}
-install -d $RBR/usr/lib
-# Make install
-make install DESTDIR=$RBR benchdir_root=/usr/share/
+install -d $RBR/usr/{sbin,lib,include}
+
+# Install all binaries stripped
+make install-strip DESTDIR=$RBR benchdir_root=/usr/share/
# Install shared libraries (Disable for architectures that don't support it)
(cd $RBR/usr/lib; tar xf $RBR/shared-libs.tar)
# install saved mysqld-max
-install -m755 $MBD/sql/mysqld-max $RBR/usr/sbin/mysqld-max
+install -s -m755 $MBD/sql/mysqld-max $RBR/usr/sbin/mysqld-max
# install symbol files ( for stack trace resolution)
install -m644 $MBD/sql/mysqld-max.sym $RBR/usr/lib/mysql/mysqld-max.sym
@@ -280,6 +291,10 @@ install -m644 $MBD/sql/mysqld.sym $RBR/usr/lib/mysql/mysqld.sym
install -m644 $MBD/support-files/mysql-log-rotate $RBR/etc/logrotate.d/mysql
install -m755 $MBD/support-files/mysql.server $RBR/etc/rc.d/init.d/mysql
+# Create symbolic compatibility link safe_mysqld -> mysqld_safe
+# (safe_mysqld will be gone in MySQL 4.1)
+ln -sf ./mysqld_safe $RBR/usr/bin/safe_mysqld
+
%pre
if test -x /etc/rc.d/init.d/mysql
then
@@ -346,7 +361,13 @@ fi
# We do not remove the mysql user since it may still own a lot of
# database files.
+# Clean up the BuildRoot
+%clean
+[ "$RBR" != "/" ] && [ -d $RBR ] && rm -rf $RBR;
+
%files
+%defattr(755 root, root)
+
%doc %attr(644, root, root) COPYING COPYING.LIB README
%doc %attr(644, root, root) Docs/manual.{html,ps,texi,txt} Docs/manual_toc.html
%doc %attr(644, root, root) support-files/my-*.cnf
@@ -384,6 +405,7 @@ fi
%attr(755, root, root) /usr/bin/replace
%attr(755, root, root) /usr/bin/resolve_stack_dump
%attr(755, root, root) /usr/bin/resolveip
+%attr(755, root, root) /usr/bin/safe_mysqld
%attr(755, root, root) /usr/sbin/mysqld
%attr(644, root, root) /usr/lib/mysql/mysqld.sym
@@ -459,6 +481,30 @@ fi
%changelog
+* Fri Aug 09 2002 Lenz Grimmer <lenz@mysql.com>
+
+- Turn off OpenSSL in MySQL-Max for now until it works properly again
+- enable RAID for the Max binary instead
+- added compatibility link: safe_mysqld -> mysqld_safe to ease the
+ transition from 3.23
+
+* Thu Jul 18 2002 Lenz Grimmer <lenz@mysql.com>
+
+- Reworked the build steps a little bit: the Max binary is supposed
+ to include OpenSSL, which cannot be linked statically, thus trying
+ to statically link against a special glibc is futile anyway
+- because of this, it is not required to make yet another build run
+ just to compile the shared libs (saves a lot of time)
+- updated package description of the Max subpackage
+- clean up the BuildRoot directory afterwards
+
+* Mon Jul 15 2002 Lenz Grimmer <lenz@mysql.com>
+
+- Updated Packager information
+- Fixed the build options: the regular package is supposed to
+ include InnoDB and linked statically, while the Max package
+ should include BDB and SSL support
+
* Fri May 03 2002 Lenz Grimmer <lenz@mysql.com>
- Use more RPM macros (e.g. infodir, mandir) to make the spec
diff --git a/tests/function.res b/tests/function.res
index a2322020d74..acd34f41a3e 100644
--- a/tests/function.res
+++ b/tests/function.res
@@ -11,11 +11,11 @@ select floor(5.5),floor(-5.5),ceiling(5.5),ceiling(-5.5),round(5.5),round(-5.5)
floor(5.5) floor(-5.5) ceiling(5.5) ceiling(-5.5) round(5.5) round(-5.5)
5 -6 6 -5 6 -6
--------------
-select abs(-10),log(exp(10)),exp(log(sqrt(10))*2),pow(10,log10(10)),rand(999999),rand()
+select abs(-10),log(exp(10)),ln(exp(10)),log2(65535),log(2,65535),exp(log(sqrt(10))*2),pow(10,log10(10)),rand(999999),rand()
--------------
-abs(-10) log(exp(10)) exp(log(sqrt(10))*2) pow(10,log10(10)) rand(999999) rand()
-10 10.000000 10.000000 10.000000 0.1844 0.7637
+abs(-10) log(exp(10)) ln(exp(10)) log2(65535) log(2,65535) exp(log(sqrt(10))*2) pow(10,log10(10)) rand(999999) rand()
+10 10.000000 10.000000 2.000000 2.000000 10.000000 10.000000 0.1844 0.7637
--------------
select least(6,1.0,2.0),greatest(3,4,5,0)
--------------
diff --git a/tests/function.tst b/tests/function.tst
index 5b8746e8d3c..17e1cb6c8ac 100644
--- a/tests/function.tst
+++ b/tests/function.tst
@@ -7,7 +7,7 @@
#
select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2,sign(-5) ;
select floor(5.5),floor(-5.5),ceiling(5.5),ceiling(-5.5),round(5.5),round(-5.5);
-select abs(-10),log(exp(10)),exp(log(sqrt(10))*2),pow(10,log10(10)),rand(999999),rand();
+select abs(-10),log(exp(10)),ln(exp(10)),log2(65535),log(2,65535),exp(log(sqrt(10))*2),pow(10,log10(10)),rand(999999),rand();
select least(6,1.0,2.0),greatest(3,4,5,0) ;
select 1 | (1+1),5 & 3,bit_count(7) ;
#
diff --git a/tests/grant.pl b/tests/grant.pl
index 0219fdb71ee..6da4326d465 100644
--- a/tests/grant.pl
+++ b/tests/grant.pl
@@ -8,9 +8,10 @@ use DBI;
use Getopt::Long;
use strict;
-use vars qw($dbh $user_dbh $opt_help $opt_Information $opt_force $opt_debug
- $opt_verbose $opt_server $opt_root_user $opt_password $opt_user
- $opt_database $opt_host $version $user $tables_cols $columns_cols);
+use vars qw($dbh $user_dbh $opt_help $opt_Information $opt_force $opt_debug
+ $opt_verbose $opt_server $opt_root_user $opt_password $opt_user
+ $opt_database $opt_host $version $user $tables_cols $columns_cols
+ $tmp_table);
$version="1.0";
$opt_help=$opt_Information=$opt_force=$opt_debug=$opt_verbose=0;
@@ -35,6 +36,8 @@ $|=1;
$tables_cols="Host, Db, User, Table_name, Grantor, Table_priv, Column_priv";
$columns_cols="Host, Db, User, Table_name, Column_name, Column_priv";
+$tmp_table="/tmp/mysql-grant.test"; # Can't use $$ as we are logging result
+unlink($tmp_table);
#
# clear grant tables
@@ -72,6 +75,7 @@ user_connect(0);
user_query("select * from mysql.user where user = '$opt_user'");
user_query("select * from mysql.db where user = '$opt_user'");
safe_query("grant select on *.* to $user,$user");
+safe_query("show grants for $user");
# The following should fail
user_query("insert into mysql.user (host,user) values ('error','$opt_user')",1);
@@ -294,6 +298,7 @@ safe_query("select $tables_cols from mysql.tables_priv");
safe_query("revoke ALL PRIVILEGES on $opt_database.test from $user");
safe_query("select $tables_cols from mysql.tables_priv");
safe_query("revoke GRANT OPTION on $opt_database.test from $user",1);
+
#
# Test grants on database level
#
@@ -378,20 +383,80 @@ safe_query("select $tables_cols from mysql.tables_priv where user = '$opt_user'"
safe_query("select $columns_cols from mysql.columns_priv where user = '$opt_user'");
#
-# Test IDENTIFIED BY
-#
+# Clear up privileges to make future tests easier
safe_query("delete from user where user='$opt_user'");
+safe_query("delete from db where user='$opt_user'");
safe_query("flush privileges");
+safe_query("show grants for $user",1);
+
+#
+# Test IDENTIFIED BY
+#
+
safe_query("grant ALL PRIVILEGES on $opt_database.test to $user identified by 'dummy', ${opt_user}\@127.0.0.1 identified by 'dummy2'");
user_connect(0,"dummy");
safe_query("grant SELECT on $opt_database.* to $user identified by ''");
user_connect(0);
+safe_query("revoke ALL PRIVILEGES on $opt_database.test from $user identified by ''");
+safe_query("revoke ALL PRIVILEGES on $opt_database.* from $user identified by ''");
+safe_query("show grants for $user");
+
+#
+# Test bug reported in SELECT INTO OUTFILE
+#
+
+safe_query("create table $opt_database.test3 (a int)");
+safe_query("grant SELECT on $opt_database.test3 to $user");
+safe_query("grant FILE on *.* to $user");
+safe_query("insert into $opt_database.test3 values (1)");
+user_connect(0);
+user_query("select * into outfile '$tmp_table' from $opt_database.test3");
+safe_query("revoke SELECT on $opt_database.test3 from $user");
+safe_query("revoke FILE on *.* from $user");
+safe_query("drop table $opt_database.test3");
+
+#
+# Test privileges needed for LOCK TABLES
+#
+
+safe_query("create table $opt_database.test3 (a int)");
+user_connect(1);
+safe_query("grant INSERT on $opt_database.test3 to $user");
+user_connect(0);
+user_query("select * into outfile '$tmp_table' from $opt_database.test3",1);
+safe_query("grant SELECT on $opt_database.test3 to $user");
+user_connect(0);
+user_query("LOCK TABLES $opt_database.test3 READ",1);
+safe_query("grant LOCK TABLES on *.* to $user");
+safe_query("show grants for $user");
+safe_query("select * from mysql.user where user='$opt_user'");
+user_connect(0);
+user_query("LOCK TABLES $opt_database.test3 READ");
+user_query("UNLOCK TABLES");
+safe_query("revoke SELECT,INSERT,UPDATE,DELETE on $opt_database.test3 from $user");
+user_connect(1);
+safe_query("revoke LOCK TABLES on *.* from $user");
+safe_query("drop table $opt_database.test3");
+
+#
+# test new privileges in 4.0.2
+#
+
+safe_query("show grants for $user");
+safe_query("grant all on *.* to $user WITH MAX_QUERIES_PER_HOUR 1 MAX_UPDATES_PER_HOUR 2 MAX_CONNECTIONS_PER_HOUR 3");
+safe_query("show grants for $user");
+safe_query("revoke LOCK TABLES on *.* from $user");
+safe_query("flush privileges");
+safe_query("show grants for $user");
+safe_query("revoke ALL PRIVILEGES on *.* from $user");
+safe_query("show grants for $user");
#
# Clean up things
#
+unlink($tmp_table);
safe_query("drop database $opt_database");
safe_query("delete from user where user='$opt_user'");
safe_query("delete from db where user='$opt_user'");
diff --git a/tests/grant.res b/tests/grant.res
index 37266facc61..b54fec94514 100644
--- a/tests/grant.res
+++ b/tests/grant.res
@@ -19,10 +19,13 @@ Access denied for user: 'grant_user@localhost' (Using password: NO)
set password FOR grant_user=''
Connecting grant_user
select * from mysql.user where user = 'grant_user'
-localhost grant_user Y N N N N N N N N N N N N N
+localhost grant_user Y N N N N N N N N N N N N N N N N N N N N 0 0 0
select * from mysql.db where user = 'grant_user'
grant select on *.* to grant_user@localhost,grant_user@localhost
+show grants for grant_user@localhost
+GRANT SELECT ON *.* TO 'grant_user'@'localhost'
+
insert into mysql.user (host,user) values ('error','grant_user')
Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
update mysql.user set host='error' WHERE user='grant_user'
@@ -48,7 +51,7 @@ Error in execute: The host or user argument to GRANT is too long
grant select on grant_test.test to grant_user with grant option
Error in execute: grant command denied to user: 'grant_user@localhost' for table 'test'
set password FOR ''@''=''
-Error in execute: You are using MySQL as an anonymous users and anonymous users are not allowed to change passwords
+Error in execute: Can't find any matching row in the user table
set password FOR root@localhost = password('test')
Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
revoke select on *.* from grant_user@localhost
@@ -93,7 +96,7 @@ delete from user where user='grant_user'
flush privileges
grant select on grant_test.* to grant_user@localhost
select * from mysql.user where user = 'grant_user'
-localhost grant_user N N N N N N N N N N N N N N
+localhost grant_user N N N N N N N N N N N N N N N N N N N N N 0 0 0
select * from mysql.db where user = 'grant_user'
localhost grant_test grant_user Y N N N N N N N N N
@@ -152,7 +155,7 @@ insert into mysql.user (host,user) values ('error','grant_user',0)
Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
revoke ALL PRIVILEGES on grant_test.* from grant_user@localhost
select * from mysql.user where user = 'grant_user'
-localhost grant_user N N N N N N N N N N N N N N
+localhost grant_user N N N N N N N N N N N N N N N N N N N N N 0 0 0
select * from mysql.db where user = 'grant_user'
Connecting grant_user
@@ -168,7 +171,7 @@ Error in execute: select command denied to user: 'grant_user@localhost' for tabl
show keys from test
Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
show columns from test2
-a int(11) 0
+a int(11) 0
show keys from test2
select * from test
@@ -311,8 +314,8 @@ revoke GRANT OPTION on grant_test.test from grant_user@localhost
Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost' on table 'test'
grant select(a) on grant_test.test to grant_user@localhost
show columns from test
-a int(11) YES NULL select
-b int(11) YES NULL
+a int(11) YES NULL
+b int(11) YES NULL
grant insert (b), update (b) on grant_test.test to grant_user@localhost
select count(a) from test
@@ -432,11 +435,66 @@ localhost grant_test grant_user N Y N N N N N N N N
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv where user = 'grant_user'
select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_priv where user = 'grant_user'
delete from user where user='grant_user'
+delete from db where user='grant_user'
flush privileges
+show grants for grant_user@localhost
+Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost'
grant ALL PRIVILEGES on grant_test.test to grant_user@localhost identified by 'dummy', grant_user@127.0.0.1 identified by 'dummy2'
Connecting grant_user
grant SELECT on grant_test.* to grant_user@localhost identified by ''
Connecting grant_user
+revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost identified by ''
+revoke ALL PRIVILEGES on grant_test.* from grant_user@localhost identified by ''
+show grants for grant_user@localhost
+create table grant_test.test3 (a int)
+grant SELECT on grant_test.test3 to grant_user@localhost
+grant FILE on *.* to grant_user@localhost
+insert into grant_test.test3 values (1)
+Connecting grant_user
+select * into outfile '/tmp/mysql-grant.test' from grant_test.test3
+revoke SELECT on grant_test.test3 from grant_user@localhost
+revoke FILE on *.* from grant_user@localhost
+drop table grant_test.test3
+create table grant_test.test3 (a int)
+Connecting grant_user
+Access denied for user: 'grant_user@localhost' to database 'grant_test'
+grant INSERT on grant_test.test3 to grant_user@localhost
+Connecting grant_user
+select * into outfile '/tmp/mysql-grant.test' from grant_test.test3
+Error in execute: Access denied for user: 'grant_user@localhost' (Using password: NO)
+grant SELECT on grant_test.test3 to grant_user@localhost
+Connecting grant_user
+LOCK TABLES grant_test.test3 READ
+Error in execute: Access denied for user: 'grant_user@localhost' (Using password: NO)
+grant LOCK TABLES on *.* to grant_user@localhost
+show grants for grant_user@localhost
+GRANT LOCK TABLES ON *.* TO 'grant_user'@'localhost'
+GRANT SELECT, INSERT ON grant_test.test3 TO 'grant_user'@'localhost'
+
+select * from mysql.user where user='grant_user'
+127.0.0.1 grant_user 7f70e8b858ee6782 N N N N N N N N N N N N N N N N N N N N N 0 0 0
+localhost grant_user N N N N N N N N N N N N N N N N N Y N N N 0 0 0
+
+Connecting grant_user
+LOCK TABLES grant_test.test3 READ
+UNLOCK TABLES
+revoke SELECT,INSERT,UPDATE,DELETE on grant_test.test3 from grant_user@localhost
+Connecting grant_user
+Access denied for user: 'grant_user@localhost' to database 'grant_test'
+revoke LOCK TABLES on *.* from grant_user@localhost
+drop table grant_test.test3
+show grants for grant_user@localhost
+grant all on *.* to grant_user@localhost WITH MAX_QUERIES_PER_HOUR 1 MAX_UPDATES_PER_HOUR 2 MAX_CONNECTIONS_PER_HOUR 3
+show grants for grant_user@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'grant_user'@'localhost' WITH MAX_QUERIES_PER_HOUR 1 MAX_UPDATES_PER_HOUR 2 MAX_CONNECTIONS_PER_HOUR 3
+
+revoke LOCK TABLES on *.* from grant_user@localhost
+flush privileges
+show grants for grant_user@localhost
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'grant_user'@'localhost' WITH MAX_QUERIES_PER_HOUR 1 MAX_UPDATES_PER_HOUR 2 MAX_CONNECTIONS_PER_HOUR 3
+
+revoke ALL PRIVILEGES on *.* from grant_user@localhost
+show grants for grant_user@localhost
drop database grant_test
delete from user where user='grant_user'
delete from db where user='grant_user'
diff --git a/tests/truncate.pl b/tests/truncate.pl
new file mode 100755
index 00000000000..57b50cf96b6
--- /dev/null
+++ b/tests/truncate.pl
@@ -0,0 +1,125 @@
+#!/usr/bin/perl -w
+#
+# This is a test with uses many processes to test a MySQL server.
+#
+
+$opt_loop_count=10000; # Change this to make test harder/easier
+
+##################### Standard benchmark inits ##############################
+
+use DBI;
+use Getopt::Long;
+use Benchmark;
+
+package main;
+
+$opt_skip_create=$opt_skip_in=$opt_verbose=$opt_fast_insert=
+$opt_lock_tables=$opt_debug=$opt_skip_delete=$opt_fast=$opt_force=0;
+$opt_threads=2;
+$opt_host=$opt_user=$opt_password=""; $opt_db="test";
+
+GetOptions("host=s","db=s","user=s","password=s","loop-count=i","skip-create","skip-in","skip-delete","verbose","fast-insert","lock-tables","debug","fast","force","threads=i") || die "Aborted";
+$opt_verbose=$opt_debug=$opt_lock_tables=$opt_fast_insert=$opt_fast=$opt_skip_in=$opt_force=undef; # Ignore warnings from these
+
+print "Testing truncate from $opt_threads multiple connections $opt_loop_count times\n";
+
+@testtables = ( ["bench_f31", "type=heap"]);
+
+####
+#### Start timeing and start test
+####
+
+$start_time=new Benchmark;
+$dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
+ $opt_user, $opt_password,
+ { PrintError => 0}) || die $DBI::errstr;
+if (!$opt_skip_create)
+{
+ my $table_def;
+ foreach $table_def (@testtables)
+ {
+ my ($table,$extra)= ($table_def->[0], $table_def->[1]);
+ print "Creating table $table in database $opt_db\n";
+ $dbh->do("drop table if exists $table");
+ $dbh->do("create table $table".
+ " (id int(6) not null,".
+ " info varchar(32)," .
+ " marker timestamp," .
+ " flag int not null," .
+ " primary key(id)) $extra")
+
+ or die $DBI::errstr;
+ }
+}
+
+$dbh->disconnect; $dbh=0; # Close handler
+$|= 1; # Autoflush
+
+####
+#### Start the tests
+####
+
+for ($i=0 ; $i < $opt_threads ; $i ++)
+{
+ test_truncate() if (($pid=fork()) == 0); $work{$pid}="truncate";
+}
+
+print "Started $opt_threads threads\n";
+
+$errors=0;
+$running_insert_threads=$opt_threads;
+while (($pid=wait()) != -1)
+{
+ $ret=$?/256;
+ print "thread '" . $work{$pid} . "' finished with exit code $ret\n";
+ --$running_insert_threads;
+ $errors++ if ($ret != 0);
+}
+
+#
+# Cleanup
+#
+
+if (!$opt_skip_delete && !$errors)
+{
+ my $table_def;
+ $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
+ $opt_user, $opt_password,
+ { PrintError => 0}) || die $DBI::errstr;
+
+ foreach $table_def (@testtables)
+ {
+ $dbh->do("drop table " . $table_def->[0]);
+ }
+ $dbh->disconnect; $dbh=0; # Close handler
+}
+
+print ($errors ? "Test failed\n" :"Test ok\n");
+$end_time=new Benchmark;
+print "Total time: " .
+ timestr(timediff($end_time, $start_time),"noc") . "\n";
+
+exit(0);
+
+
+#
+# Insert records in the table
+#
+
+sub test_truncate
+{
+ my ($dbh,$i,$j,$count,$table_def,$table);
+
+ $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host",
+ $opt_user, $opt_password,
+ { PrintError => 0}) || die $DBI::errstr;
+
+ for ($count=0; $count < $opt_loop_count ; $count++)
+ {
+ my ($table)= ($testtables[0]->[0]);
+ $dbh->do("truncate table $table") || die "Got error on truncate: $DBI::errstr\n";
+ }
+ $dbh->disconnect; $dbh=0;
+ print "Test_truncate: Run $count times\n";
+ exit(0);
+}
diff --git a/tools/mysqlmanager.c b/tools/mysqlmanager.c
index a68038a8c37..6a246f096c8 100644
--- a/tools/mysqlmanager.c
+++ b/tools/mysqlmanager.c
@@ -14,11 +14,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* MySQL server management daemon
- *
- * Written by:
- * Sasha Pachev <sasha@mysql.com>
- **/
+/*
+ MySQL server management daemon
+
+ Written by:
+ Sasha Pachev <sasha@mysql.com>
+*/
#include <my_global.h>
#include <my_pthread.h>
@@ -90,9 +91,10 @@
#define MAX_RETRY_COUNT 100
-/* Variable naming convention - if starts with manager_, either is set
- directly by the user, or used closely in ocnjunction with a variable
- set by the user
+/*
+ Variable naming convention - if starts with manager_, either is set
+ directly by the user, or used closely in ocnjunction with a variable
+ set by the user
*/
#if defined(__i386__) && defined(HAVE_LINUXTHREADS)
@@ -180,10 +182,12 @@ typedef int (*manager_cmd_handler)(struct manager_thd*,char*,char*);
static void handle_child(int __attribute__((unused)) sig);
static void handle_sigpipe(int __attribute__((unused)) sig);
-/* exec() in a threaded application is full of problems
- to solve this, we fork off a launcher at the very start
- and communicate with it through a pipe
+/*
+ exec() in a threaded application is full of problems.
+ To solve this, we fork off a launcher at the very start
+ and communicate with it through a pipe
*/
+
static void fork_launcher();
static void run_launcher_loop();
int to_launcher_pipe[2],from_launcher_pipe[2];
@@ -230,11 +234,12 @@ struct manager_exec
static int set_exec_param(struct manager_thd* thd, char* args_start,
char* args_end, PARAM_TYPE param_type);
-#define HANDLE_DECL(com) static int com (struct manager_thd* thd, char* args_start,char* args_end)
-#define HANDLE_NOARG_DECL(com) static int com \
- (struct manager_thd* thd, char *args_start __attribute__((unused)),\
- char* args_end __attribute__((unused)))
-
+#define HANDLE_DECL(com) \
+static int com(struct manager_thd* thd, char* args_start,char* args_end)
+#define HANDLE_NOARG_DECL(com) \
+static int com(struct manager_thd *thd,\
+ char *args_start __attribute__((unused)),\
+ char* args_end __attribute__((unused)))
HANDLE_NOARG_DECL(handle_ping);
HANDLE_NOARG_DECL(handle_quit);
@@ -321,9 +326,8 @@ static int client_msg_pre(NET* net,int err_code,const char* fmt,...);
static int client_msg_raw(NET* net,int err_code,int pre,const char* fmt,
va_list args);
static int authenticate(struct manager_thd* thd);
-static char* read_line(struct manager_thd* thd); /* returns pointer to end of
- line
- */
+/* returns pointer to end of line */
+static char* read_line(struct manager_thd* thd);
static pthread_handler_decl(process_connection, arg);
static pthread_handler_decl(process_launcher_messages, arg);
static int exec_line(struct manager_thd* thd,char* buf,char* buf_end);
@@ -400,7 +404,7 @@ void print_stacktrace()
fprintf(errfp,"frame points is NULL, cannot trace stack\n");
return;
}
- for(i=0;i<MAX_DEPTH && fp<(uchar**)stack_bottom;i++)
+ for (i=0;i<MAX_DEPTH && fp<(uchar**)stack_bottom;i++)
{
#ifdef __i386__
uchar** new_fp = (uchar**)*fp;
@@ -429,8 +433,8 @@ static int exec_line(struct manager_thd* thd,char* buf,char* buf_end)
log_info("Command '%s'", buf);
if (!(cmd=lookup_cmd(buf,(int)(p-buf))))
{
- if(client_msg(&thd->net,MANAGER_CLIENT_ERR,
- "Unrecognized command '%s', type help to see list of supported\
+ if (client_msg(&thd->net,MANAGER_CLIENT_ERR,
+ "Unrecognized command '%s', type help to see list of supported\
commands", buf))
thd->fatal=1;
return 1;
@@ -521,7 +525,7 @@ HANDLE_DECL(handle_set_exec_con)
else
e->con_sock[0]=0;
}
- else if(num_args > 4)
+ else if (num_args > 4)
{
pthread_mutex_unlock(&lock_exec_hash);
error="Too many arguments";
@@ -572,8 +576,7 @@ static int set_exec_param(struct manager_thd* thd, char* args_start,
}
arg_p+=strlen(arg_p)+1;
param_size=strlen(arg_p)+1;
- switch (param_type)
- {
+ switch (param_type) {
case PARAM_STDOUT:
param=e->stdout_path;
e->req_len+=(param_size-e->stdout_path_size);
@@ -881,8 +884,7 @@ static int manager_exec_launch(struct manager_exec* e)
if (one_thread)
{
pid_t tmp_pid;
- switch ((tmp_pid=fork()))
- {
+ switch ((tmp_pid=fork())) {
case -1:
e->error="Cannot fork";
return 1;
@@ -973,7 +975,7 @@ static void manager_exec_print(NET* net,struct manager_exec* e)
goto end;
*p++='\t';
- for(;p<buf_end && *args;args++)
+ for (;p<buf_end && *args;args++)
{
p=arg_strmov(p,*args,(int)(buf_end-p)-1);
*p++='\t';
@@ -1060,8 +1062,7 @@ static void die(const char* fmt, ...)
void print_msg_type(int msg_type)
{
const char* msg;
- switch (msg_type)
- {
+ switch (msg_type) {
case LOG_ERR: msg = "ERROR"; break;
case LOG_WARN: msg = "WARNING"; break;
case LOG_INFO: msg = "INFO"; break;
@@ -1099,8 +1100,7 @@ static pthread_handler_decl(process_launcher_messages,
sleep(1);
continue;
}
- switch (buf[0])
- {
+ switch (buf[0]) {
case CHILD_START:
{
char* ident=buf+1;
@@ -1229,7 +1229,7 @@ static void handle_child(int __attribute__((unused)) sig)
pid_t child;
int child_status;
- for(;(child=waitpid(-1,&child_status,WNOHANG))>0;)
+ for (;(child=waitpid(-1,&child_status,WNOHANG))>0;)
{
char msg_buf[1+sizeof(int)+sizeof(int)];
msg_buf[0]=CHILD_STOP;
@@ -1284,7 +1284,7 @@ static void clean_up()
close(manager_sock);
log_info("Ended");
if (errfp != stderr)
- fclose(errfp);
+ my_fclose(errfp, MYF(0));
hash_free(&exec_hash);
if (created_pid_file)
my_delete(pid_file, MYF(0));
@@ -1343,12 +1343,13 @@ static int init_server()
log_info("Started");
if ((manager_sock=socket(PF_INET,SOCK_STREAM,0)) < 0)
die("Could not create socket");
- bzero((char*)&manager_addr, sizeof(manager_addr));
+ bzero((char*) &manager_addr, sizeof(manager_addr));
manager_addr.sin_family = AF_INET;
manager_addr.sin_addr.s_addr = manager_bind_addr;
manager_addr.sin_port = htons(manager_port);
setsockopt(manager_sock,SOL_SOCKET, SO_REUSEADDR,(char*)&arg,sizeof(arg));
- if (bind(manager_sock,(struct sockaddr*)&manager_addr, sizeof(manager_addr)) < 0)
+ if (bind(manager_sock,(struct sockaddr*)&manager_addr, sizeof(manager_addr))
+ < 0)
die("Could not bind");
if (listen(manager_sock,manager_back_log) < 0)
die("Could not listen");
@@ -1432,8 +1433,11 @@ static int run_server_loop()
static FILE* open_log_stream()
{
FILE* fp;
- if (!(fp=fopen(manager_log_file,"a")))
- die("Could not open log file '%s'", manager_log_file);
+ if (!(fp=my_fopen(manager_log_file, O_APPEND | FILE_BINARY, MYF(MY_WME))))
+ {
+ clean_up();
+ exit(1);
+ }
return fp;
}
@@ -1473,11 +1477,10 @@ static uint tokenize_args(char* arg_start,char** arg_end)
int quoted=0,escaped=0,last_space=0;
p_end=*arg_end;
p_write=p=arg_start;
- for(;p<p_end;p++)
+ for (; p < p_end ; p++)
{
char c = *p;
- switch (c)
- {
+ switch (c) {
case ' ':
case '\r':
case '\n':
@@ -1522,16 +1525,16 @@ static uint tokenize_args(char* arg_start,char** arg_end)
arg_count++;
*p_write=0;
*arg_end=p_write;
- log_debug("arg_count=%d,arg_start='%s'",arg_count,arg_start);
+ log_debug("arg_count: %d arg_start: '%s'",arg_count,arg_start);
return arg_count;
}
static void update_req_len(struct manager_exec* e)
{
- e->req_len=e->data_buf_size+
- (e->stdout_path_size=strlen(e->stdout_path)+1)+
- (e->stderr_path_size=strlen(e->stderr_path)+1);
- }
+ e->req_len=(e->data_buf_size+
+ (e->stdout_path_size=strlen(e->stdout_path)+1)+
+ (e->stderr_path_size=strlen(e->stderr_path)+1));
+}
static struct manager_exec* manager_exec_new(char* arg_start,char* arg_end)
{
@@ -1641,8 +1644,11 @@ static void init_user_hash()
if (hash_init(&user_hash,system_charset_info,1024,0,0,
get_user_key,manager_user_free,MYF(0)))
die("Could not initialize user hash");
- if (!(f=fopen(manager_pw_file,"r")))
- die("Could not open password file '%s'", manager_pw_file);
+ if (!(f=my_fopen(manager_pw_file, O_RDONLY | O_BINARY, MYF(MY_WME))))
+ {
+ clean_up();
+ exit(1);
+ }
for (;;line_num++)
{
struct manager_user* u;
@@ -1661,19 +1667,24 @@ static void init_user_hash()
hash_insert(&user_hash,(gptr)u);
}
}
- fclose(f);
+ my_fclose(f, MYF(0));
}
+
static void init_pid_file()
{
- FILE* fp = fopen(pid_file, "w");
+ FILE* fp = my_fopen(pid_file, O_WRONLY | O_BINARY, MYF(MY_WME));
if (!fp)
- die("Could not open pid file %s", pid_file);
+ {
+ clean_up();
+ exit(1);
+ }
created_pid_file=1;
fprintf(fp, "%d\n", (int) getpid());
- fclose(fp);
+ my_fclose(fp, MYF(0));
}
+
static void init_globals()
{
pthread_attr_t thr_attr;
@@ -1753,8 +1764,7 @@ stdout_path=%s,stderr_path=%s",
req_len,ident,ident_len,exec_path,stdout_path,stderr_path);
init_arg_array(exec_path,args,num_args-1);
- switch ((pid=fork()))
- {
+ switch ((pid=fork())) {
case -1:
log_err("launcher: cannot fork");
sleep(1);
@@ -1781,8 +1791,7 @@ static void fork_launcher()
{
if (pipe(to_launcher_pipe) || pipe(from_launcher_pipe))
die("Could not create launcher pipes");
- switch ((launcher_pid=fork()))
- {
+ switch ((launcher_pid=fork())) {
case 0:
signal(SIGCHLD,handle_child);
run_launcher_loop();
@@ -1794,23 +1803,22 @@ static void fork_launcher()
static int daemonize()
{
- switch (fork())
- {
- case -1:
- die("Cannot fork");
- case 0:
- errfp = open_log_stream();
- init_globals();
- close(0);
- close(1);
- close(2);
- init_server();
- run_server_loop();
- clean_up();
- break;
- default:
- break;
- }
+ switch (fork()) {
+ case -1:
+ die("Cannot fork");
+ case 0:
+ errfp = open_log_stream();
+ init_globals();
+ close(0);
+ close(1);
+ close(2);
+ init_server();
+ run_server_loop();
+ clean_up();
+ break;
+ default:
+ break;
+ }
return 0;
}
diff --git a/vio/test-ssl.c b/vio/test-ssl.c
index 9fdab86e9b9..acce201bfba 100644
--- a/vio/test-ssl.c
+++ b/vio/test-ssl.c
@@ -59,6 +59,7 @@ main( int argc,
char* ca_file = 0, *ca_path = 0;
char* cipher=0;
int child_pid,sv[2];
+ my_bool unused;
struct st_VioSSLAcceptorFd* ssl_acceptor=0;
struct st_VioSSLConnectorFd* ssl_connector=0;
Vio* client_vio=0, *server_vio=0;
@@ -96,11 +97,11 @@ main( int argc,
client_vio = (struct st_vio*)my_malloc(sizeof(struct st_vio),MYF(0));
client_vio->sd = sv[0];
- client_vio->vioblocking(client_vio,0);
+ client_vio->vioblocking(client_vio, 0, &unused);
sslconnect(ssl_connector,client_vio,60L);
server_vio = (struct st_vio*)my_malloc(sizeof(struct st_vio),MYF(0));
server_vio->sd = sv[1];
- server_vio->vioblocking(client_vio,0);
+ server_vio->vioblocking(client_vio, 0, &unused);
sslaccept(ssl_acceptor,server_vio,60L);
printf("Socketpair: %d , %d\n", client_vio->sd, server_vio->sd);
diff --git a/vio/vio.c b/vio/vio.c
index 67cb7ec95cd..bed380c6cd9 100644
--- a/vio/vio.c
+++ b/vio/vio.c
@@ -24,11 +24,10 @@
#define DONT_MAP_VIO
#include <my_global.h>
#include <mysql_com.h>
-#include <violite.h>
-#include <errno.h>
#include <my_sys.h>
-#include <my_net.h>
#include <m_string.h>
+#include <violite.h>
+#include <errno.h>
/*
* Helper to fill most of the Vio* with defaults.
@@ -60,7 +59,7 @@ void vio_reset(Vio* vio, enum enum_vio_type type,
vio->vioclose =vio_ssl_close;
vio->peer_addr =vio_ssl_peer_addr;
vio->in_addr =vio_ssl_in_addr;
- vio->vioblocking =vio_blocking;
+ vio->vioblocking =vio_ssl_blocking;
vio->is_blocking =vio_is_blocking;
}
else /* default is VIO_TYPE_TCPIP */
@@ -83,6 +82,7 @@ void vio_reset(Vio* vio, enum enum_vio_type type,
DBUG_VOID_RETURN;
}
+
/* Open the socket or TCP/IP connection and read the fnctl() status */
Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost)
@@ -102,12 +102,14 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost)
#elif defined(HAVE_SYS_IOCTL_H) /* hpux */
/* Non blocking sockets doesn't work good on HPUX 11.0 */
(void) ioctl(sd,FIOSNBIO,0);
+ vio->fcntl_mode &= ~O_NONBLOCK;
#endif
#else /* !defined(__WIN__) && !defined(__EMX__) */
{
/* set to blocking mode by default */
ulong arg=0, r;
r = ioctlsocket(sd,FIONBIO,(void*) &arg, sizeof(arg));
+ vio->fcntl_mode &= ~O_NONBLOCK;
}
#endif
}
diff --git a/vio/viosocket.c b/vio/viosocket.c
index 85e239f29ac..2c6cdb5a7fd 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -110,16 +110,19 @@ int vio_write(Vio * vio, const gptr buf, int size)
}
-int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode)
+int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode,
+ my_bool *old_mode)
{
int r=0;
DBUG_ENTER("vio_blocking");
- DBUG_PRINT("enter", ("set_blocking_mode: %d", (int) set_blocking_mode));
+
+ *old_mode= test(!(vio->fcntl_mode & O_NONBLOCK));
+ DBUG_PRINT("enter", ("set_blocking_mode: %d old_mode: %d",
+ (int) set_blocking_mode, (int) *old_mode));
#if !defined(HAVE_OPENSSL)
#if !defined(___WIN__) && !defined(__EMX__)
#if !defined(NO_FCNTL_NONBLOCK)
-
if (vio->sd >= 0)
{
int old_fcntl=vio->fcntl_mode;
@@ -130,6 +133,8 @@ int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode)
if (old_fcntl != vio->fcntl_mode)
r = fcntl(vio->sd, F_SETFL, vio->fcntl_mode);
}
+#else
+ r= set_blocking_mode ? 0 : 1;
#endif /* !defined(NO_FCNTL_NONBLOCK) */
#else /* !defined(__WIN__) && !defined(__EMX__) */
#ifndef __EMX__
@@ -151,9 +156,13 @@ int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode)
if (old_fcntl != vio->fcntl_mode)
r = ioctlsocket(vio->sd,FIONBIO,(void*) &arg, sizeof(arg));
}
+#ifndef __EMX__
+ else
+ r= test(!(vio->fcntl_mode & O_NONBLOCK)) != set_blocking_mode;
+#endif /* __EMX__ */
#endif /* !defined(__WIN__) && !defined(__EMX__) */
#endif /* !defined (HAVE_OPENSSL) */
- DBUG_PRINT("exit", ("return %d", r));
+ DBUG_PRINT("exit", ("%d", r));
DBUG_RETURN(r);
}
@@ -273,7 +282,7 @@ my_socket vio_fd(Vio* vio)
my_bool vio_peer_addr(Vio * vio, char *buf)
{
DBUG_ENTER("vio_peer_addr");
- DBUG_PRINT("enter", ("sd=%d", vio->sd));
+ DBUG_PRINT("enter", ("sd: %d", vio->sd));
if (vio->localhost)
{
strmov(buf,"127.0.0.1");
@@ -284,12 +293,12 @@ my_bool vio_peer_addr(Vio * vio, char *buf)
if (getpeername(vio->sd, (struct sockaddr *) (& (vio->remote)),
&addrLen) != 0)
{
- DBUG_PRINT("exit", ("getpeername, error: %d", socket_errno));
+ DBUG_PRINT("exit", ("getpeername gave error: %d", socket_errno));
DBUG_RETURN(1);
}
my_inet_ntoa(vio->remote.sin_addr,buf);
}
- DBUG_PRINT("exit", ("addr=%s", buf));
+ DBUG_PRINT("exit", ("addr: %s", buf));
DBUG_RETURN(0);
}
diff --git a/vio/viossl.c b/vio/viossl.c
index 6d85b119f20..6d4f5450148 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -259,8 +259,10 @@ void sslaccept(struct st_VioSSLAcceptorFd* ptr, Vio* vio, long timeout)
char *str;
char buf[1024];
X509* client_cert;
+ my_bool unused;
DBUG_ENTER("sslaccept");
DBUG_PRINT("enter", ("sd=%d ptr=%p", vio->sd,ptr));
+
vio_reset(vio,VIO_TYPE_SSL,vio->sd,0,FALSE);
vio->ssl_=0;
vio->open_=FALSE;
@@ -272,7 +274,7 @@ void sslaccept(struct st_VioSSLAcceptorFd* ptr, Vio* vio, long timeout)
}
DBUG_PRINT("info", ("ssl_=%p timeout=%ld",vio->ssl_, timeout));
SSL_clear(vio->ssl_);
- vio_blocking(vio, FALSE);
+ vio_blocking(vio, FALSE, &unused);
SSL_SESSION_set_timeout(SSL_get_session(vio->ssl_), timeout);
SSL_set_fd(vio->ssl_,vio->sd);
SSL_set_accept_state(vio->ssl_);
@@ -310,12 +312,15 @@ void sslaccept(struct st_VioSSLAcceptorFd* ptr, Vio* vio, long timeout)
DBUG_VOID_RETURN;
}
+
void sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* vio, long timeout)
{
char *str;
X509* server_cert;
+ my_bool unused;
DBUG_ENTER("sslconnect");
DBUG_PRINT("enter", ("sd=%d ptr=%p ctx: %p", vio->sd,ptr,ptr->ssl_context_));
+
vio_reset(vio,VIO_TYPE_SSL,vio->sd,0,FALSE);
vio->ssl_=0;
vio->open_=FALSE;
@@ -327,7 +332,7 @@ void sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* vio, long timeout)
}
DBUG_PRINT("info", ("ssl_=%p timeout=%ld",vio->ssl_, timeout));
SSL_clear(vio->ssl_);
- vio_blocking(vio, FALSE);
+ vio_blocking(vio, FALSE, &unused);
SSL_SESSION_set_timeout(SSL_get_session(vio->ssl_), timeout);
SSL_set_fd (vio->ssl_, vio->sd);
SSL_set_connect_state(vio->ssl_);
@@ -357,4 +362,14 @@ void sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* vio, long timeout)
DBUG_VOID_RETURN;
}
+
+int vio_ssl_blocking(Vio * vio __attribute__((unused)),
+ my_bool set_blocking_mode,
+ my_bool *old_mode)
+{
+ /* Return error if we try to change to non_blocking mode */
+ *old_mode=1; /* Mode is always blocking */
+ return set_blocking_mode ? 0 : 1;
+}
+
#endif /* HAVE_OPENSSL */
diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c
index 322c1ce01e4..23a35f540f6 100644
--- a/vio/viosslfactories.c
+++ b/vio/viosslfactories.c
@@ -28,7 +28,8 @@ static bool ssl_error_strings_loaded= FALSE;
static int verify_depth = 0;
static int verify_error = X509_V_OK;
-static unsigned char dh512_p[]={
+static unsigned char dh512_p[]=
+{
0xDA,0x58,0x3C,0x16,0xD9,0x85,0x22,0x89,0xD0,0xE4,0xAF,0x75,
0x6F,0x4C,0xCA,0x92,0xDD,0x4B,0xE5,0x33,0xB8,0x04,0xFB,0x0F,
0xED,0x94,0xEF,0x9C,0x8A,0x44,0x03,0xED,0x57,0x46,0x50,0xD3,
@@ -36,22 +37,28 @@ static unsigned char dh512_p[]={
0xE2,0x18,0xF4,0xDD,0x1E,0x08,0x4C,0xF6,0xD8,0x00,0x3E,0x7C,
0x47,0x74,0xE8,0x33,
};
+
static unsigned char dh512_g[]={
0x02,
};
static DH *get_dh512(void)
{
- DH *dh=NULL;
-
- if ((dh=DH_new()) == NULL) return(NULL);
- dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
- dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
- if ((dh->p == NULL) || (dh->g == NULL))
- return(NULL);
+ DH *dh;
+ if ((dh=DH_new()))
+ {
+ dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
+ dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
+ if (! dh->p || ! dh->g)
+ {
+ DH_free(dh);
+ dh=0;
+ }
+ }
return(dh);
}
+
static void
report_errors()
{
@@ -66,7 +73,7 @@ report_errors()
{
char buf[200];
DBUG_PRINT("error", ("OpenSSL: %s:%s:%d:%s\n", ERR_error_string(l,buf),
- file,line,(flags&ERR_TXT_STRING)?data:"")) ;
+ file,line,(flags & ERR_TXT_STRING) ? data : "")) ;
}
DBUG_VOID_RETURN;
}
@@ -98,13 +105,14 @@ vio_set_cert_stuff(SSL_CTX *ctx, const char *cert_file, const char *key_file)
DBUG_RETURN(0);
}
- /* If we are using DSA, we can copy the parameters from
- * the private key */
- /* Now we know that a key and cert have been set against
- * the SSL context */
+ /*
+ If we are using DSA, we can copy the parameters from the private key
+ Now we know that a key and cert have been set against the SSL context
+ */
if (!SSL_CTX_check_private_key(ctx))
{
- DBUG_PRINT("error", ("Private key does not match the certificate public key\n"));
+ DBUG_PRINT("error",
+ ("Private key does not match the certificate public key\n"));
DBUG_RETURN(0);
}
}
@@ -128,7 +136,7 @@ vio_verify_callback(int ok, X509_STORE_CTX *ctx)
X509_NAME_oneline(X509_get_subject_name(err_cert),buf,sizeof(buf));
if (!ok)
{
- DBUG_PRINT("error",("verify error:num=%d:%s\n",err,
+ DBUG_PRINT("error",("verify error: num: %d : '%s'\n",err,
X509_verify_cert_error_string(err)));
if (verify_depth >= depth)
{
@@ -137,7 +145,6 @@ vio_verify_callback(int ok, X509_STORE_CTX *ctx)
}
else
{
- ok=0;
verify_error=X509_V_ERR_CERT_CHAIN_TOO_LONG;
}
}
@@ -157,17 +164,18 @@ vio_verify_callback(int ok, X509_STORE_CTX *ctx)
/*ASN1_TIME_print_fp(stderr,X509_get_notAfter(ctx->current_cert));*/
break;
}
- DBUG_PRINT("exit", ("r=%d", ok));
+ DBUG_PRINT("exit", ("%d", ok));
DBUG_RETURN(ok);
}
/************************ VioSSLConnectorFd **********************************/
-struct st_VioSSLConnectorFd* new_VioSSLConnectorFd(const char* key_file,
- const char* cert_file,
- const char* ca_file,
- const char* ca_path,
- const char* cipher)
+struct st_VioSSLConnectorFd *
+new_VioSSLConnectorFd(const char* key_file,
+ const char* cert_file,
+ const char* ca_file,
+ const char* ca_path,
+ const char* cipher)
{
int verify = SSL_VERIFY_PEER;
struct st_VioSSLConnectorFd* ptr;
@@ -177,9 +185,13 @@ struct st_VioSSLConnectorFd* new_VioSSLConnectorFd(const char* key_file,
DBUG_PRINT("enter",
("key_file=%s, cert_file=%s, ca_path=%s, ca_file=%s, cipher=%s",
key_file, cert_file, ca_path, ca_file, cipher));
- ptr=(struct st_VioSSLConnectorFd*)my_malloc(sizeof(struct st_VioSSLConnectorFd),MYF(0));
- ptr->ssl_context_=0;
- ptr->ssl_method_=0;
+
+ if (!(ptr=((struct st_VioSSLConnectorFd*)
+ my_malloc(sizeof(struct st_VioSSLConnectorFd),MYF(0)))))
+ DBUG_RETURN(0);
+
+ ptr->ssl_context_= 0;
+ ptr->ssl_method_= 0;
/* FIXME: constants! */
if (!ssl_algorithms_added)
@@ -204,10 +216,10 @@ struct st_VioSSLConnectorFd* new_VioSSLConnectorFd(const char* key_file,
goto ctor_failure;
}
/*
- * SSL_CTX_set_options
- * SSL_CTX_set_info_callback
+ SSL_CTX_set_options
+ SSL_CTX_set_info_callback
*/
- if(cipher)
+ if (cipher)
{
result=SSL_CTX_set_cipher_list(ptr->ssl_context_, cipher);
DBUG_PRINT("info",("SSL_set_cipher_list() returned %d",result));
@@ -219,10 +231,10 @@ struct st_VioSSLConnectorFd* new_VioSSLConnectorFd(const char* key_file,
report_errors();
goto ctor_failure;
}
- if (SSL_CTX_load_verify_locations( ptr->ssl_context_, ca_file,ca_path)==0)
+ if (SSL_CTX_load_verify_locations( ptr->ssl_context_, ca_file,ca_path) == 0)
{
DBUG_PRINT("warning", ("SSL_CTX_load_verify_locations failed"));
- if (SSL_CTX_set_default_verify_paths(ptr->ssl_context_)==0)
+ if (SSL_CTX_set_default_verify_paths(ptr->ssl_context_) == 0)
{
DBUG_PRINT("error", ("SSL_CTX_set_default_verify_paths failed"));
report_errors();
@@ -246,16 +258,15 @@ ctor_failure:
/************************ VioSSLAcceptorFd **********************************/
struct st_VioSSLAcceptorFd*
-new_VioSSLAcceptorFd(const char* key_file,
- const char* cert_file,
- const char* ca_file,
- const char* ca_path,
- const char* cipher)
+new_VioSSLAcceptorFd(const char *key_file,
+ const char *cert_file,
+ const char *ca_file,
+ const char *ca_path,
+ const char *cipher)
{
- int verify = (SSL_VERIFY_PEER |
- SSL_VERIFY_FAIL_IF_NO_PEER_CERT |
- SSL_VERIFY_CLIENT_ONCE);
-
+ int verify = (SSL_VERIFY_PEER |
+ SSL_VERIFY_FAIL_IF_NO_PEER_CERT |
+ SSL_VERIFY_CLIENT_ONCE);
struct st_VioSSLAcceptorFd* ptr;
int result;
DH *dh=NULL;
@@ -264,11 +275,12 @@ new_VioSSLAcceptorFd(const char* key_file,
("key_file=%s, cert_file=%s, ca_path=%s, ca_file=%s, cipher=%s",
key_file, cert_file, ca_path, ca_file, cipher));
- ptr=(struct st_VioSSLAcceptorFd*)my_malloc(sizeof(struct st_VioSSLAcceptorFd),MYF(0));
+ ptr= ((struct st_VioSSLAcceptorFd*)
+ my_malloc(sizeof(struct st_VioSSLAcceptorFd),MYF(0)));
ptr->ssl_context_=0;
ptr->ssl_method_=0;
/* FIXME: constants! */
- ptr->session_id_context_ = ptr;
+ ptr->session_id_context_ = ptr;
if (!ssl_algorithms_added)
{
@@ -283,42 +295,38 @@ new_VioSSLAcceptorFd(const char* key_file,
ssl_error_strings_loaded = TRUE;
SSL_load_error_strings();
}
- ptr->ssl_method_ = TLSv1_server_method();
- ptr->ssl_context_ = SSL_CTX_new(ptr->ssl_method_);
- if (ptr->ssl_context_==0)
+ ptr->ssl_method_= TLSv1_server_method();
+ ptr->ssl_context_= SSL_CTX_new(ptr->ssl_method_);
+ if (ptr->ssl_context_ == 0)
{
DBUG_PRINT("error", ("SSL_CTX_new failed"));
report_errors();
goto ctor_failure;
}
- if(cipher)
+ if (cipher)
{
result=SSL_CTX_set_cipher_list(ptr->ssl_context_, cipher);
DBUG_PRINT("info",("SSL_set_cipher_list() returned %d",result));
}
- /*
- * SSL_CTX_set_quiet_shutdown(ctx,1);
- *
- */
+ /* SSL_CTX_set_quiet_shutdown(ctx,1); */
SSL_CTX_sess_set_cache_size(ptr->ssl_context_,128);
-
-
- /* DH?
- */
+ /* DH? */
SSL_CTX_set_verify(ptr->ssl_context_, verify, vio_verify_callback);
- SSL_CTX_set_session_id_context(ptr->ssl_context_,(const uchar*)&(ptr->session_id_context_),sizeof(ptr->session_id_context_));
+ SSL_CTX_set_session_id_context(ptr->ssl_context_,
+ (const uchar*) &(ptr->session_id_context_),
+ sizeof(ptr->session_id_context_));
/*
- * SSL_CTX_set_client_CA_list(ctx,SSL_load_client_CA_file(CAfile));
- */
+ SSL_CTX_set_client_CA_list(ctx,SSL_load_client_CA_file(CAfile));
+ */
if (vio_set_cert_stuff(ptr->ssl_context_, cert_file, key_file) == -1)
{
DBUG_PRINT("error", ("vio_set_cert_stuff failed"));
report_errors();
goto ctor_failure;
}
- if (SSL_CTX_load_verify_locations( ptr->ssl_context_, ca_file, ca_path)==0)
+ if (SSL_CTX_load_verify_locations( ptr->ssl_context_, ca_file, ca_path) == 0)
{
DBUG_PRINT("warning", ("SSL_CTX_load_verify_locations failed"));
if (SSL_CTX_set_default_verify_paths(ptr->ssl_context_)==0)
@@ -332,11 +340,11 @@ new_VioSSLAcceptorFd(const char* key_file,
dh=get_dh512();
SSL_CTX_set_tmp_dh(ptr->ssl_context_,dh);
DH_free(dh);
-
DBUG_RETURN(ptr);
+
ctor_failure:
DBUG_PRINT("exit", ("there was an error"));
- my_free((gptr)ptr,MYF(0));
+ my_free((gptr) ptr,MYF(0));
DBUG_RETURN(0);
}